Commit 662082ed authored by 刘林's avatar 刘林

fix(jg):暂存功能问题处理

parent e1978de1
...@@ -1538,68 +1538,88 @@ ...@@ -1538,68 +1538,88 @@
<select id="queryRegistrationToBeSubmitPage" <select id="queryRegistrationToBeSubmitPage"
resultType="com.yeejoin.amos.boot.module.jg.api.dto.JgNoticeToBeSubmitDto"> resultType="com.yeejoin.amos.boot.module.jg.api.dto.JgNoticeToBeSubmitDto">
SELECT SELECT *
ur.sequence_nbr AS sequenceNbr, FROM (
'使用登记' AS businessType, SELECT
ur.apply_no AS applyNo, sequence_nbr AS sequenceNbr,
ec1. NAME AS equListName, business_type AS businessType,
ur.receive_org_name AS receiveOrgName, apply_no AS applyNo,
CASE ur.status WHEN '6610' THEN '待提交' ELSE ur.status END AS status, equ_list_name AS equListName,
DATE_FORMAT (ur.create_date, '%Y-%m-%d') AS createDate receive_org_name AS receiveOrgName,
FROM CASE status WHEN '6610' THEN '待提交' ELSE status END AS status,
tzs_jg_use_registration ur DATE_FORMAT(create_date, '%Y-%m-%d') AS createDate,
LEFT JOIN tzs_jg_use_registration_eq ure ON ur.sequence_nbr = ure.equip_transfer_id ROW_NUMBER() OVER (
LEFT JOIN idx_biz_jg_register_info ri ON ri."RECORD" = ure.equ_id PARTITION BY sequence_nbr
LEFT JOIN tz_equipment_category ec1 ON ec1.code = ri."EQU_LIST" ORDER BY create_date DESC, apply_no DESC
WHERE ) AS rn
ur.is_delete = FALSE FROM (
AND ur.status = '使用单位待提交' -- 使用登记
AND ur.use_unit_credit_code = #{companyCode} SELECT
UNION ALL ur.sequence_nbr,
SELECT '使用登记' AS business_type,
crr.sequence_nbr AS sequenceNbr, ur.apply_no,
'改造变更登记' AS businessType, ec1.NAME AS equ_list_name,
crr.apply_no AS applyNo, ur.receive_org_name,
crr.equip_list_name AS equListName, ur.status,
crr.receive_org_name AS receiveOrgName, ur.create_date
CASE crr.status WHEN '6610' THEN '待提交' ELSE crr.status END AS status, FROM tzs_jg_use_registration ur
DATE_FORMAT (crr.create_date, '%Y-%m-%d') AS createDate LEFT JOIN tzs_jg_use_registration_eq ure ON ur.sequence_nbr = ure.equip_transfer_id
FROM LEFT JOIN idx_biz_jg_register_info ri ON ri."RECORD" = ure.equ_id
tzs_jg_change_registration_reform crr LEFT JOIN tz_equipment_category ec1 ON ec1.code = ri."EQU_LIST"
WHERE WHERE ur.is_delete = FALSE
crr.is_delete = FALSE AND ur.status = '使用单位待提交'
AND crr.status = '使用单位待提交' AND ur.use_unit_credit_code = #{companyCode}
AND crr.use_unit_credit_code = #{companyCode}
UNION ALL UNION ALL
SELECT
crt.sequence_nbr AS sequenceNbr, -- 改造变更登记
'移装变更登记' AS businessType, SELECT
crt.apply_no AS applyNo, crr.sequence_nbr,
crt.equip_list_name AS equListName, '改造变更登记' AS business_type,
crt.receive_org_name AS receiveOrgName, crr.apply_no,
CASE crt.status WHEN '6610' THEN '待提交' ELSE crt.status END AS status, crr.equip_list_name,
DATE_FORMAT (crt.create_date, '%Y-%m-%d') AS createDate crr.receive_org_name,
FROM crr.status,
tzs_jg_change_registration_transfer crt crr.create_date
WHERE FROM tzs_jg_change_registration_reform crr
crt.is_delete = FALSE WHERE crr.is_delete = FALSE
AND crt.status = '使用单位待提交' AND crr.status = '使用单位待提交'
AND crt.use_unit_credit_code = #{companyCode} AND crr.use_unit_credit_code = #{companyCode}
UNION ALL
SELECT UNION ALL
vi.sequence_nbr AS sequenceNbr,
'车用气瓶登记' AS businessType, -- 移装变更登记
vi.apply_no AS applyNo, SELECT
'车用气瓶' AS equListName, crt.sequence_nbr,
vi.receive_org_name AS receiveOrgName, '移装变更登记' AS business_type,
CASE vi.status WHEN '6610' THEN '待提交' ELSE vi.status END AS status, crt.apply_no,
DATE_FORMAT (vi.create_date, '%Y-%m-%d') AS createDate crt.equip_list_name,
FROM crt.receive_org_name,
tzs_jg_vehicle_information vi crt.status,
WHERE crt.create_date
vi.is_delete = FALSE FROM tzs_jg_change_registration_transfer crt
AND vi.status = '使用单位待提交' WHERE crt.is_delete = FALSE
AND vi.use_unit_credit_code = #{companyCode} AND crt.status = '使用单位待提交'
ORDER BY createDate DESC, applyNo DESC AND crt.use_unit_credit_code = #{companyCode}
UNION ALL
-- 车用气瓶登记
SELECT
vi.sequence_nbr,
'车用气瓶登记' AS business_type,
vi.apply_no,
'车用气瓶' AS equ_list_name,
vi.receive_org_name,
vi.status,
vi.create_date
FROM tzs_jg_vehicle_information vi
WHERE vi.is_delete = FALSE
AND vi.status = '使用单位待提交'
AND vi.use_unit_credit_code = #{companyCode}
) all_data
) dedup
WHERE dedup.rn = 1
ORDER BY dedup.createDate DESC, dedup.applyNo DESC
</select> </select>
</mapper> </mapper>
...@@ -25,7 +25,8 @@ public class InstallNoticeStrategyHandler implements ToBeSubmitDetailStrategy { ...@@ -25,7 +25,8 @@ public class InstallNoticeStrategyHandler implements ToBeSubmitDetailStrategy {
Map<String, Object> basic = new HashMap<>(); Map<String, Object> basic = new HashMap<>();
basic.put("type", ApplicationFormTypeEnum.AZGZ.getBusinessCode()); basic.put("type", ApplicationFormTypeEnum.AZGZ.getBusinessCode());
basic.put("receiveOrgCreditCode", installationInfo.get("receiveOrgCreditCode")); basic.put("receiveOrgCreditCode", installationInfo.get("receiveOrgCreditCode"));
basic.put("code", installationInfo.get("equListCode"));
basic.put("equCategory", installationInfo.get("equCategoryCode"));
Map<String, Map<String, Object>> result = new HashMap<>(); Map<String, Map<String, Object>> result = new HashMap<>();
result.put("notice", installationInfo); result.put("notice", installationInfo);
result.put("basic", basic); result.put("basic", basic);
......
...@@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Objects;
@Component @Component
public class UseRegistrationStrategyHandler implements ToBeSubmitDetailStrategy { public class UseRegistrationStrategyHandler implements ToBeSubmitDetailStrategy {
...@@ -27,7 +28,7 @@ public class UseRegistrationStrategyHandler implements ToBeSubmitDetailStrategy ...@@ -27,7 +28,7 @@ public class UseRegistrationStrategyHandler implements ToBeSubmitDetailStrategy
Map<String, Map<String, Object>> result = new HashMap<>(); Map<String, Map<String, Object>> result = new HashMap<>();
result.put("notice", notice); result.put("notice", notice);
result.put("basic", basic); result.put("basic", basic);
useRegFormUpload.put("uploadMode", notice.get("uploadMode")); useRegFormUpload.put("uploadMode", Objects.toString(notice.get("uploadMode"),"2"));
useRegFormUpload.put("useRegistrationFormUrl", notice.get("useRegistrationFormUrl")); useRegFormUpload.put("useRegistrationFormUrl", notice.get("useRegistrationFormUrl"));
result.put("useRegFormUpload", useRegFormUpload); result.put("useRegFormUpload", useRegFormUpload);
return result; return result;
......
...@@ -956,12 +956,12 @@ public class DataDockServiceImpl { ...@@ -956,12 +956,12 @@ public class DataDockServiceImpl {
String equCode = data.getEquCode(); String equCode = data.getEquCode();
if (!StringUtils.isEmpty(equCode)) { if (!StringUtils.isEmpty(equCode)) {
if (equCode.matches("[a-zA-Z0-9]+")) { if (equCode.matches("[a-zA-Z0-9]+")) {
// if (equCode.length() < 17) { if (equCode.length() < 17) {
// rowError.append("设备代码不能小于17位;"); rowError.append("设备代码不能小于17位;");
// } }
// if (equCode.length() > 20) { if (equCode.length() > 21) {
// rowError.append("设备代码不能大于20位;"); rowError.append("设备代码不能大于21位;");
// } }
} else { } else {
rowError.append("设备代码不能包含特殊字符;"); rowError.append("设备代码不能包含特殊字符;");
} }
......
...@@ -1178,12 +1178,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -1178,12 +1178,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 设备参数 // 设备参数
if (equIpClassMap.containsKey(EQU_LIST) && !ValidationUtil.isEmpty(equIpClassMap.get(EQU_LIST).toString())) { if (equIpClassMap.containsKey(EQU_LIST) && !ValidationUtil.isEmpty(equIpClassMap.get(EQU_LIST).toString())) {
Map<String, Object> equipParamsMap = this.getEquipParamsMap(record, "", equIpClassMap.get(EQU_LIST).toString()); Map<String, Object> equipParamsMap = this.getEquipParamsMap(record, "", equIpClassMap.get(EQU_LIST).toString());
equipParamsMap.put(EQU_LIST, String.valueOf(equIpClassMap.get(EQU_LIST)));
equipParamsMap.put(EQU_CATEGORY, String.valueOf(equIpClassMap.get(EQU_CATEGORY)));
equipParamsMap.put(EQU_DEFINE, String.valueOf(equIpClassMap.get(EQU_DEFINE)));
if (!ValidationUtil.isEmpty(equipParamsMap)) { if (!ValidationUtil.isEmpty(equipParamsMap)) {
// 给技术参数中添加设备种类,标记技术参数属于那个设备 // 给技术参数中添加设备种类,标记技术参数属于那个设备
equipParamsMap.put(EQU_LIST, String.valueOf(equIpClassMap.get(EQU_LIST)));
equipParamsMap.put(EQU_CATEGORY, String.valueOf(equIpClassMap.get(EQU_CATEGORY)));
equipParamsMap.put(EQU_DEFINE, String.valueOf(equIpClassMap.get(EQU_DEFINE)));
resultMap.put(EQUIP_PARAMS_FORM_ID, equipParamsMap); resultMap.put(EQUIP_PARAMS_FORM_ID, equipParamsMap);
} }
equipInfoMap.put("identificationCode", equipParamsMap.get("VIN")); equipInfoMap.put("identificationCode", equipParamsMap.get("VIN"));
......
...@@ -101,8 +101,8 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -101,8 +101,8 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
public static final String RECORD = "record"; public static final String RECORD = "record";
public static final String SEQUENCE_NBR = "SEQUENCE_NBR"; public static final String SEQUENCE_NBR = "SEQUENCE_NBR";
public static final String PROJECT_CONTRAPTION = "projectContraption"; public static final String PROJECT_CONTRAPTION = "projectContraption";
public static final String EQU_LIST_CODE = "EQU_LIST_CODE"; public static final String EQU_LIST_CODE = "equListCode";
public static final String EQU_CATEGORY_CODE = "EQU_CATEGORY_CODE"; public static final String EQU_CATEGORY_CODE = "equCategoryCode";
public static final String EQUIP_INFO = "equipInfo"; public static final String EQUIP_INFO = "equipInfo";
public static final String PROJECT_CONTRAPTION_ID = "projectContraptionId"; public static final String PROJECT_CONTRAPTION_ID = "projectContraptionId";
public static final String PRODUCT_PHOTO = "PRODUCT_PHOTO"; public static final String PRODUCT_PHOTO = "PRODUCT_PHOTO";
...@@ -527,7 +527,11 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -527,7 +527,11 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
} }
// 申请单业务主键seq // 申请单业务主键seq
long sequenceNbr = sequence.nextId(); Long sequenceNbr = Optional.ofNullable(jsonObject.get("sequenceNbr"))
.map(Object::toString)
.filter(str -> !str.trim().isEmpty())
.map(Long::valueOf)
.orElseGet(sequence::nextId);
// 启动工作流 // 启动工作流
List<WorkflowResultDto> workflowResultList = this.startWorkFlow(model.getReceiveCompanyCode(), submitType, applyNoList.get(0)); List<WorkflowResultDto> workflowResultList = this.startWorkFlow(model.getReceiveCompanyCode(), submitType, applyNoList.get(0));
CompanyBo companyBo = commonService.getOneCompany(model.getReceiveCompanyCode()); CompanyBo companyBo = commonService.getOneCompany(model.getReceiveCompanyCode());
......
...@@ -351,7 +351,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform ...@@ -351,7 +351,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
BeanUtils.copyProperties(vehicleInfoDto, vehicleInformation); BeanUtils.copyProperties(vehicleInfoDto, vehicleInformation);
vehicleInformation.setCreateUserId(reginParams.getUserModel().getUserId()); vehicleInformation.setCreateUserId(reginParams.getUserModel().getUserId());
vehicleInformation.setRegDate(new Date()); vehicleInformation.setRegDate(new Date());
vehicleInformation.setUseDate(Optional.ofNullable(String.valueOf(map.get("useDate"))).orElse("")); vehicleInformation.setUseDate(Objects.toString(map.get("useDate"),""));
vehicleInformation.setCreateUserName(reginParams.getUserModel().getRealName()); vehicleInformation.setCreateUserName(reginParams.getUserModel().getRealName());
vehicleInformation.setGasNum(Optional.ofNullable(equipmentLists).map(List::size).orElse(0)); vehicleInformation.setGasNum(Optional.ofNullable(equipmentLists).map(List::size).orElse(0));
BigDecimal totalVolume = Optional.ofNullable(equipmentLists) BigDecimal totalVolume = Optional.ofNullable(equipmentLists)
......
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