Commit 0863bd3d authored by KeYong's avatar KeYong

Merge branch 'develop_tzs_register' of…

Merge branch 'develop_tzs_register' of http://36.40.66.175:5000/moa/amos-boot-biz into develop_tzs_register
parents 3126b3d2 c32cafb0
......@@ -24,5 +24,5 @@ public interface JgChangeRegistrationNameMapper extends BaseMapper<JgChangeRegis
void deleteHistoryInfoById(@Param("code") String code);
Page<Map<String, Object>> getListPage(Page<Map<String, Object>> page, JgChangeRegistrationNameDto dto, List<String> roleIds, String orgCode);
Page<Map<String, Object>> getListPage(@Param("page") Page<Map<String, Object>> page, @Param("dto") JgChangeRegistrationNameDto dto, @Param("roleIds") List<String> roleIds, @Param("orgCode") String orgCode);
}
......@@ -31,5 +31,5 @@ public interface IJgChangeRegistrationTransferService extends IService<JgChangeR
void revocation(String instanceId);
void exportUseRegistrationCertificate(String sequenceNbr);
String exportUseRegistrationCertificate(String sequenceNbr);
}
......@@ -58,7 +58,7 @@
AND ur.receive_org_code = #{orgCode}
</if>
<if test="dto.type == 'enterprise' ">
and ur.use_unit_code = #{orgCode}
and ur.use_unit_credit_code = #{orgCode}
</if>
</where>
order by ur.rec_date desc
......
......@@ -33,9 +33,6 @@
<if test="dto.applyNo != null and dto.applyNo != '' ">
and jed.apply_no like concat('%',#{dto.applyNo},'%')
</if>
<if test="dto.applyNo != null and dto.applyNo != '' ">
and jed.apply_no = #{dto.receiveOrgCode}
</if>
<if test="dto.auditStatus != null and dto.auditStatus != '' ">
and jed.audit_status = #{dto.auditStatus}
</if>
......@@ -45,6 +42,13 @@
<if test="dto.type == 'supervision'">
and jed.receive_org_code = #{dto.useUnitCreditCode}
</if>
<if test="dto.receiveOrgCode != null and dto.receiveOrgCode != ''">
and jed.receive_org_code = #{dto.receiveOrgCode}
</if>
<if test="dto.applyType != null and dto.applyType != ''">
and jed.apply_type = #{dto.applyType}
</if>
<if test="dto.roleIds != null and dto.type == 'supervision'">
<foreach collection='dto.roleIds' item='role' open='and (' close=')' separator='or'>
execute_sequence like concat('%',#{role},'%')
......
......@@ -107,7 +107,7 @@ public class JgChangeRegistrationNameController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "列表全部数据查询", notes = "列表全部数据查询")
@PostMapping(value = "/getList")
public ResponseModel<Page<Map<String, Object>>> getList(@RequestBody JgChangeRegistrationNameDto dto,
public ResponseModel<Page<Map<String, Object>>> getList(JgChangeRegistrationNameDto dto,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
Page<Map<String, Object>> page = new Page<>(current, size);
......
......@@ -114,7 +114,7 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
List<Map<String, Object>> deviceList = jgChangeRegistrationNameMapper.getEquipInfoByOrgCode(reginParams.getCompany().getCompanyCode());
// 获取告知单号
ResponseModel<List<String>> listResponseModel = tzsServiceFeignClient.applicationFormCode(ApplicationFormTypeEnum.SBZX.getCode(), 1);
ResponseModel<List<String>> listResponseModel = tzsServiceFeignClient.applicationFormCode(ApplicationFormTypeEnum.GMBG.getCode(), 1);
if (!ObjectUtils.isEmpty(listResponseModel) && listResponseModel.getStatus() != HttpStatus.OK.value()) {
log.error(" 获取告知单号失败");
throw new RuntimeException();
......
......@@ -62,6 +62,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.io.IOException;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
......@@ -242,10 +243,9 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
oldTransfer.setSupervisoryCode(supervisoryCode);
}
}
//使用登记编号
if (!ValidationUtil.isEmpty(dto2.get("USE_REGISTRATION_CODE"))) {
oldTransfer.setUseRegistrationCode((String) dto2.get("USE_REGISTRATION_CODE"));
if (!ValidationUtil.isEmpty(dto2.get("USE_ORG_CODE"))) {
oldTransfer.setUseRegistrationCode((String) dto2.get("USE_ORG_CODE"));
} else {
//使用登记编号
oldTransfer.setUseRegistrationCode(idxBizJgRegisterInfoMapper.getUseOrgCodeByEquip(equId));
......@@ -534,6 +534,53 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
*/
public Page<Map<String, Object>> queryListForPage(Page<Map<String, Object>> page, JgChangeRegistrationTransferDto params) {
Page<Map<String, Object>> listPage = this.baseMapper.getListPage(page, params, params.getRoleIds());
listPage.getRecords().stream().forEach(item->{
// 流程未走完时,移装地址需从 历史表中获取
if (item.containsKey("status") && !FlowStatusEnum.TO_BE_FINISHED.getName().equals(item.get("status").toString())) {
String fullAddress = "";
if(item.containsKey("equipId") && item.containsKey("applyNo")){
JgRegistrationHistory history = jgRegistrationHistoryService.getDteailByRecord(item.get("equipId").toString(), item.get("applyNo").toString());
if(!ValidationUtil.isEmpty(history)){
JSONObject newPosition = JSON.parseObject(history.getChangeData());
String province = newPosition.getString("province");
String city = newPosition.getString("city");
String county = newPosition.getString("county");
String street = newPosition.getString("street");
String address = newPosition.getString("address");
// 分割省市区街道字段
if (!ObjectUtils.isEmpty(province)) {
String[] provinceList = province.split("_");
if (provinceList.length > 1) {
fullAddress += provinceList[1];
}
}
if (!ObjectUtils.isEmpty(city)) {
String[] cityList = city.split("_");
if (cityList.length > 1) {
fullAddress += cityList[1];
}
}
if (!ObjectUtils.isEmpty(county)) {
String[] countyList = county.split("_");
if (countyList.length > 1) {
fullAddress += countyList[1];
}
}
if (!ObjectUtils.isEmpty(street)) {
String[] streetList = street.split("_");
if (streetList.length > 1) {
fullAddress += streetList[1];
}
}
if (!ObjectUtils.isEmpty(address)) {
fullAddress += address;
}
}
}
item.put("allAddress", fullAddress);
}
});
return listPage;
}
......@@ -781,7 +828,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
*
* @param sequenceNbr
*/
public void exportUseRegistrationCertificate(String sequenceNbr) {
public String exportUseRegistrationCertificate(String sequenceNbr) {
Map<String, Object> exportParamsMap = new HashMap<>();
//查询移装变更详情
JgChangeRegistrationTransfer transfer = this.getById(sequenceNbr);
......@@ -801,7 +848,10 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
//监管码
exportParamsMap.put("supervisoryCode", transfer.getSupervisoryCode());
//发证日期(当前时间)
exportParamsMap.put("issueData", new Date());
LocalDate today = LocalDate.now();
exportParamsMap.put("giveOutYear", today.getYear());
exportParamsMap.put("giveOutMonth", today.getMonthValue());
exportParamsMap.put("giveOutDay", today.getDayOfMonth());
//设备使用地址
if(!ValidationUtil.isEmpty(transferHistory)){
String fullAddress="";
......@@ -876,7 +926,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
if(!ValidationUtil.isEmpty(factoryInfo)){
exportParamsMap.put("factoryNum", factoryInfo.getFactoryNum());
}
//调用生成使用登记证
return commonService.generateCertificateReport(exportParamsMap);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment