Commit 1393dfda authored by caotao's avatar caotao

历史表中存储的current_document_id调整为applyNo相关代码提交。

parent 8a41dc76
......@@ -128,4 +128,12 @@ public class JgChangeRegistrationReformController extends BaseController {
map.put("useUnitName", selectedOrgInfo.getCompany().getCompanyName());
return ResponseHelper.buildResponse(map);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "打印历史数据", notes = "打印历史数据")
@GetMapping(value = "/printHistoryData")
public ResponseModel<Map<String, Object>> printHistoryData(@RequestParam("currentDocumentId") String currentDocumentId,@RequestParam(value = "equipId",required = false) String equipId) {
return ResponseHelper.buildResponse(jgChangeRegistrationReformServiceImpl.getDetail(currentDocumentId,equipId));
}
}
......@@ -81,7 +81,12 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
private IdxBizJgRegisterInfoMapper idxBizJgRegisterInfoMapper;
@Autowired
private IdxBizJgOtherInfoMapper idxBizJgOtherInfoMapper;
//单位变更登记关系表mapper
@Autowired
private JgChangeRegistrationUnitEqMapper jgChangeRegistrationUnitEqMapper;
//更名变更登记关系表mapper
@Autowired
private JgChangeRegistrationNameEqMapper jgChangeRegistrationNameEqMapper;
/**
* 分页查询
......@@ -188,7 +193,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
jgChangeRegistrationReformEq.setEquipTransferId(jgChangeRegistrationReform.getSequenceNbr().toString());
jgChangeRegistrationReformEqMapper.insert(jgChangeRegistrationReformEq);
//当前单据id
jgRegistrationHistory.setCurrentDocumentId(jgChangeRegistrationReform.getSequenceNbr().toString());
jgRegistrationHistory.setCurrentDocumentId(jgChangeRegistrationReform.getApplyNo());
jgRegistrationHistoryMapper.insert(jgRegistrationHistory);
}
......@@ -281,7 +286,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
JgChangeRegistrationReformEq jgChangeRegistrationReformEq = jgChangeRegistrationReformEqMapper.selectOne(new QueryWrapper<JgChangeRegistrationReformEq>().eq("equip_transfer_id", jgChangeRegistrationReform.getSequenceNbr()));
String newUseRegistrationCertificateNumber = getCode(jgChangeRegistrationReform.getSupervisoryCode());
jgChangeRegistrationReform.setUseRegistrationCode(newUseRegistrationCertificateNumber);
updateTechparamsByEquIdAndCurrentDoucumentId(jgChangeRegistrationReformEq.getEquId(), jgChangeRegistrationReform.getSequenceNbr().toString(),newUseRegistrationCertificateNumber );
updateTechparamsByEquIdAndCurrentDoucumentId(jgChangeRegistrationReformEq.getEquId(), jgChangeRegistrationReform.getSequenceNbr().toString(),newUseRegistrationCertificateNumber,jgChangeRegistrationReform.getApplyNo() );
}
this.getBaseMapper().updateById(jgChangeRegistrationReform);
}
......@@ -454,7 +459,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
} else {
JgRegistrationHistory jgRegistrationHistory = jgRegistrationHistoryMapper.selectOne(new QueryWrapper<JgRegistrationHistory>()
.eq("equ_id", equipId)
.eq("current_document_id", currentDocumentId)
.eq("current_document_id", jgChangeRegistrationReform.getApplyNo())
.eq("registration_class", "改造登记"));
originalData = JSONObject.parseObject(jgRegistrationHistory.getChangeData(), Map.class);
originalData.remove("sequenceNbr");
......@@ -474,6 +479,10 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
jgChangeRegistrationReformEqMapper.updateEquipIsVaildByEquipIdAndCurrentDocumentId(equipmentId, currentDocumentId);
jgChangeRegistrationTransferEqMapper.updateEquipIsVaildByEquipIdAndCurrentDocumentId(equipmentId, currentDocumentId);
jgUseRegistrationEqMapper.updateEquipIsVaildByEquipIdAndCurrentDocumentId(equipmentId, currentDocumentId);
//单位变更登记
jgChangeRegistrationUnitEqMapper.updateEquipIsVaildByEquipIdAndCurrentDocumentId(equipmentId, currentDocumentId);
//更名变更登记
jgChangeRegistrationNameEqMapper.updateEquipIsVaildByEquipIdAndCurrentDocumentId(equipmentId, currentDocumentId);
}
/**
......@@ -482,12 +491,12 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
* @param equipId
* @param currentDocumentId
*/
public void updateTechparamsByEquIdAndCurrentDoucumentId(String equipId, String currentDocumentId, String newUseRegistrationCertificateNumber) {
public void updateTechparamsByEquIdAndCurrentDoucumentId(String equipId, String currentDocumentId, String newUseRegistrationCertificateNumber,String applyNo) {
IdxBizJgTechParamsElevator idxBizJgTechParamsElevator = idxBizJgTechParamsElevatorMapper.selectOne(new QueryWrapper<IdxBizJgTechParamsElevator>().eq("RECORD", equipId));
JgRegistrationHistory jgRegistrationHistory = jgRegistrationHistoryMapper.selectOne(new QueryWrapper<JgRegistrationHistory>()
.eq("equ_id", equipId)
.eq("current_document_id", currentDocumentId)
.eq("current_document_id", applyNo)
.eq("registration_class", "改造登记"));
if (!ObjectUtils.isEmpty(idxBizJgTechParamsElevator) && !ObjectUtils.isEmpty(jgRegistrationHistory)) {
......@@ -500,7 +509,8 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
BeanUtil.copyProperties(idxBizJgTechParamsElevatorNew, idxBizJgTechParamsElevator, "sequenceNbr", "record");
idxBizJgTechParamsElevatorMapper.updateById(idxBizJgTechParamsElevator);
//将历史数据回填到历史记录表中
jgRegistrationHistory.setChangeData(historyData);
jgRegistrationHistory.setChangeData(newData);
jgRegistrationHistory.setOldData(historyData);
jgRegistrationHistory.setStatus("history");
jgRegistrationHistoryMapper.updateById(jgRegistrationHistory);
makeEquipmentsInvalid(equipId, currentDocumentId);
......
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