Commit 97f29568 authored by litengwei's avatar litengwei

安装改造Bug修复

parent 5d6b188d
......@@ -236,4 +236,11 @@ public class JgInstallationNoticeDto extends BaseDto {
private String instanceStatus;
@ApiModelProperty(value = "设备地址")
private String equAddress;
@ApiModelProperty(value = "办理日期")
private Date handleDate;
}
......@@ -378,4 +378,12 @@ public class JgInstallationNotice extends BaseEntity {
@TableField("instance_status")
private String instanceStatus;
@TableField("equ_address")
private String equAddress;
@TableField("handle_date")
private Date handleDate;
}
......@@ -11,6 +11,7 @@
isn.use_unit_name AS useUnitName,
isn.receive_org_name AS receiveOrgName,
isn.region_no AS regionNo,
isn.install_start_date AS installStartDate,
isn.address AS address,
isn.notice_status AS noticeStatus,
isn.install_unit_name AS installUnitName,
......@@ -21,6 +22,9 @@
isn.promoter,
isn.next_execute_ids AS nextExecuteIds,
isn.instance_status AS instanceStatus,
isn.equ_address AS equAddress,
isn.handle_date AS handleDate,
isn.equ_list AS equList,
isn.notice_report_url AS noticeReportUrl
FROM
tzs_jg_installation_notice isn
......@@ -30,14 +34,14 @@
<if test="param.applyNo != null and param.applyNo != ''">
AND isn.apply_no LIKE CONCAT('%', #{param.applyNo}, '%')
</if>
<if test="param.receiveOrgName != null and param.receiveOrgName != ''">
AND isn.receive_org_name LIKE CONCAT('%', #{param.receiveOrgName}, '%')
<if test="param.receiveOrgCreditCode != null and param.receiveOrgCreditCode != ''">
AND isn.receive_org_credit_code = #{param.receiveOrgCreditCode}
</if>
<if test="param.useUnitName != null and param.useUnitName != ''">
AND isn.use_unit_name LIKE CONCAT('%', #{param.useUnitName}, '%')
AND isn.use_unit_credit_code = #{param.useUnitName}
</if>
<if test="param.installUnitName != null and param.installUnitName != ''">
AND isn.install_unit_name LIKE CONCAT('%', #{param.installUnitName}, '%')
AND isn.install_unit_credit_code = #{param.installUnitName}
</if>
<if test="param.noticeStatus != null and param.noticeStatus != ''">
AND isn.notice_status = #{param.noticeStatus}
......@@ -51,7 +55,7 @@
</if>
</where>
ORDER BY
isn.rec_date DESC
isn.create_date DESC
</select>
<select id="queryEquipInformation" resultType="java.util.Map">
......@@ -62,6 +66,7 @@
isn.province_name AS provinceName,
isn.city_name AS cityName,
isn.county_name AS countyName,
isn.street_name AS streetName,
isn.address AS address,
isn.install_start_date AS installStartDate,
isn.install_license_no AS installLicenseNo,
......@@ -98,12 +103,9 @@
fi.factory_standard AS factoryStandard,
fi.product_quality_yield_prove AS productQualityYieldProve,
fi.ins_use_maintain_explain AS insUseMaintainExplain,
ui.safety_manager AS safetyManager,
ui.phone AS safetyManagerPhone,
ui.PROVINCE_NAME AS useUnitProvinceName,
ui.CITY_NAME AS useUnitCityName,
ui.COUNTY_NAME AS useUnitCountyName,
ui.ADDRESS AS useUnitAddress
ei.legal_person AS safetyManager,
ei.legal_phone AS safetyManagerPhone,
ei.address AS address
FROM
tzs_jg_installation_notice isn
LEFT JOIN tzs_jg_installation_notice_eq re ON re.equip_transfer_id = isn.sequence_nbr
......@@ -112,6 +114,7 @@
LEFT JOIN idx_biz_jg_factory_info fi ON fi.record = re.equ_id
LEFT JOIN idx_biz_jg_inspection_detection_info idi ON idi.record = re.equ_id
LEFT JOIN idx_biz_jg_use_info ui ON ui.record = re.equ_id
LEFT JOIN tz_base_enterprise_info ei ON ei.use_code = isn.use_unit_credit_code
WHERE
isn.sequence_nbr = #{sequenceNbr}
LIMIT 1
......
......@@ -80,8 +80,10 @@ public class JgInstallationByWorkFlowController {
public ResponseModel<JgInstallationNoticeDto> accept(@RequestBody Map<String, Object> model, String op) {
// TODO 受理安装告知流程
LinkedHashMap model1 = (LinkedHashMap)model.get("model");
String opinion = (String)model.get("opinion");
LinkedHashMap installationInfo = (LinkedHashMap)model1.get("installationInfo");
JgInstallationNoticeDto jgInstallationNoticeDto = JSON.parseObject(JSON.toJSONString(installationInfo), JgInstallationNoticeDto.class);
jgInstallationNoticeDto.setProcessAdvice(opinion);
jgInstallationNoticeServiceImpl.accept(jgInstallationNoticeDto,op);
return ResponseHelper.buildResponse(null);
}
......
......@@ -37,6 +37,8 @@ import com.yeejoin.amos.feign.workflow.model.AjaxResult;
import com.yeejoin.amos.feign.workflow.model.TaskResultDTO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;
......@@ -319,21 +321,21 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
placeholders.put("productName", getValue.apply("productName"));
placeholders.put("equipType", getValue.apply("equType"));
placeholders.put("equipCode", getValue.apply("equRegisterCode"));
placeholders.put("produceCode", getValue.apply("produceCode")); // TODO: 制造编号
placeholders.put("produceCode", getValue.apply("factoryNum")); // TODO: 出厂编号
placeholders.put("produceUnitName", getValue.apply("produceUnitName"));
placeholders.put("produceLicenseNum", getValue.apply("produceLicenseNum"));
placeholders.put("fullAddress", getValue.apply("provinceName") + getValue.apply("cityName") + getValue.apply("countyName") + getValue.apply("address"));
placeholders.put("installUnitAddress", getValue.apply("provinceName") + getValue.apply("cityName") + getValue.apply("countyName") + getValue.apply("streetName") + getValue.apply("address"));
placeholders.put("installStartDate", getValue.apply("installStartDate"));
placeholders.put("installType", getValue.apply("installType")); // TODO: 施工类别
placeholders.put("installType", "安装告知"); // TODO: 施工类别
placeholders.put("installLicenseNo", getValue.apply("installLicenseNo"));
placeholders.put("installLicenseExpirationDate", getValue.apply("installLicenseExpirationDate"));
placeholders.put("installLeaderName", getValue.apply("installLeaderName"));
placeholders.put("installLeaderPhone", getValue.apply("installLeaderPhone"));
placeholders.put("installUnitAddress", getValue.apply("installUnitAddress")); // TODO: 施工单位地址
placeholders.put("fullAddress", getValue.apply("provinceName") + getValue.apply("cityName") + getValue.apply("countyName") + getValue.apply("streetName") + getValue.apply("address"));
placeholders.put("useUnitName", getValue.apply("useUnitName"));
placeholders.put("useUnitLeaderName", getValue.apply("safetyManager"));
placeholders.put("useUnitLeaderPhone", getValue.apply("safetyManagerPhone"));
placeholders.put("useUnitLeaderAddress", getValue.apply("useUnitProvinceName") + getValue.apply("useUnitCityName") + getValue.apply("useUnitCountyName") + getValue.apply("useUnitAddress"));
placeholders.put("useUnitLeaderAddress", getValue.apply("address"));
// 生成二维码
String qrCode = ImageUtils.generateQRCode(getValue.apply("applyNo"), 300, 300);
placeholders.put("qrCode", qrCode);
......@@ -458,7 +460,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
TaskResultDTO dto = new TaskResultDTO();
dto.setResultCode("approvalStatus");
dto.setTaskId(taskId);
dto.setComment("提交流程");
dto.setComment("");
HashMap<String, Object> map = new HashMap<>();
map.put("approvalStatus", "0");
dto.setVariable(map);
......@@ -498,6 +500,10 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
}
dto.setInstallUnitName(reginParams.getCompany().getCompanyName());
dto.setInstallUnitCreditCode(reginParams.getCompany().getCompanyCode());
dto.setEquList((String.valueOf(obj.get("EQU_CATEGORY"))));
StringBuffer buffer = new StringBuffer();
buffer.append(dto.getProvinceName()).append(dto.getCityName()).append(dto.getCountyName()).append(dto.getAddress());
dto.setEquAddress(buffer.toString());
jgRelationEquip.setEquId(String.valueOf(obj.get("SEQUENCE_NBR")));
jgRelationEquip.setEquipTransferId(applyNo);
if (!CollectionUtils.isEmpty(instanceIdList)) {
......@@ -630,7 +636,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
TaskResultDTO dto = new TaskResultDTO();
dto.setResultCode("approvalStatus");
dto.setTaskId(taskId);
dto.setComment("提交流程");
if(!ValidationUtil.isEmpty(notice.getProcessAdvice())) {
dto.setComment(notice.getProcessAdvice());
}
HashMap<String, Object> map = new HashMap<>();
map.put("approvalStatus", op);
dto.setVariable(map);
......@@ -664,10 +672,12 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
}
}
@Transactional
public void accept(JgInstallationNoticeDto dto,String op) {
String[] taskName = new String[]{"流程结束"};
String userId = RequestContext.getExeUserId();
JgInstallationNotice jgInstallationNotice = this.jgInstallationNoticeMapper.selectById(dto.getSequenceNbr());
jgInstallationNotice.setProcessAdvice(dto.getProcessAdvice());
// 组装设备注册代码
StringBuffer stringBuffer = new StringBuffer();
String ym = null;
......@@ -706,7 +716,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
map.put("cityCode",jgInstallationNotice.getCity());
map.put("countyCode",jgInstallationNotice.getCounty());
map.put("equCategory",tzsJgRegistrationInfo.getEquCategory());
map.put("isXiXian", jgInstallationNotice.getIsXixian() == null ? "0" : jgInstallationNotice.getIsXixian());
map.put("isXiXian", jgInstallationNotice.getIsXixian() == null ? "null" : jgInstallationNotice.getIsXixian().equals("0") ? "null" : "1");
Map<String, Object> mapCode;
ResponseModel<Map<String, Object>> code = tzsServiceFeignClient.createCode(map);
mapCode = code.getResult();
......@@ -716,18 +726,21 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
SupervisoryCodeInfo supervisoryCodeInfo = supervisoryCodeInfoMapper.selectOne(queryWrapper3);
supervisoryCodeInfo.setStatus("1");
supervisoryCodeInfoMapper.updateById(supervisoryCodeInfo);
jgInstallationNotice.setNoticeStatus(String.valueOf(FlowStatusEnum.TO_BE_FINISHED.getCode()));
this.generateInstallationNoticeReport(jgInstallationNotice.getSequenceNbr());
jgInstallationNotice.setHandleDate(new Date());
Map<String,Object> map1 =new HashMap<>();
// 更新其他业务表
tzsJgOtherInfo.setCode96333(mapCode.get("code96333").toString());
if(!ValidationUtil.isEmpty(mapCode.get("code96333"))) {
tzsJgOtherInfo.setCode96333(mapCode.get("code96333").toString());
map1.put("CODE96333",tzsJgOtherInfo.getCode96333() );
}
tzsJgOtherInfo.setSupervisoryCode(mapCode.get("superviseCode").toString());
tzsJgRegistrationInfo.setEquCode(deviceRegistrationCode);
jgInstallationNotice.setEquRegisterCode(deviceRegistrationCode);
jgInstallationNotice.setSupervisoryCode(mapCode.get("superviseCode").toString());
Map<String,Map<String,Object>> objMap = new HashMap<>();
Map<String,Object> map1 =new HashMap<>();
map1.put("CODE96333",tzsJgOtherInfo.getCode96333() );
map1.put("EQU_CODE",tzsJgRegistrationInfo.getEquCode() );
map1.put("SUPERVISORY_CODE",tzsJgOtherInfo.getSupervisoryCode());
objMap.put(tzsJgOtherInfo.getRecord(),map1);
......@@ -735,6 +748,13 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
tzsServiceFeignClient.commonUpdateEsDataByIds(objMap);
tzsJgOtherInfoMapper.updateById(tzsJgOtherInfo);
tzsJgRegistrationInfoMapper.updateById(tzsJgRegistrationInfo);
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
@Override
public void afterCommit() {
generateInstallationNoticeReport(jgInstallationNotice.getSequenceNbr());
}
});
} else {
jgInstallationNotice.setNextExecuteIds(String.join(",", roleList));
if (!ObjectUtils.isEmpty(jgInstallationNotice.getInstanceStatus())) {
......
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