Commit beb3830b authored by suhuiguang's avatar suhuiguang

1.使用登记、单位变更、移转变更修改

parent 74670963
...@@ -66,7 +66,7 @@ public interface IJgChangeRegistrationReformService { ...@@ -66,7 +66,7 @@ public interface IJgChangeRegistrationReformService {
void deleteBatch(List<Long> ids); void deleteBatch(List<Long> ids);
/** /**
* @deprecated 根据当前的数据id获取详情 * 根据当前的数据id获取详情
* @param currentDocumentId * @param currentDocumentId
* @param equipId * @param equipId
* @return * @return
......
...@@ -26,7 +26,7 @@ public interface IJgChangeRegistrationTransferService extends IService<JgChangeR ...@@ -26,7 +26,7 @@ public interface IJgChangeRegistrationTransferService extends IService<JgChangeR
boolean deleteBatchBySequenceNbrs(Long[] sequenceNbrs); boolean deleteBatchBySequenceNbrs(Long[] sequenceNbrs);
Map<String, Map<String, Object>> getTransferDetail(String sequenceNbr, String equipId); Map<String, Map<String, Object>> getTransferDetail(String sequenceNbr);
Page<Map<String, Object>> queryListForPage(Page<Map<String, Object>> page, JgChangeRegistrationTransferDto params, String companyTypeCode, String companyType); Page<Map<String, Object>> queryListForPage(Page<Map<String, Object>> page, JgChangeRegistrationTransferDto params, String companyTypeCode, String companyType);
......
...@@ -127,9 +127,8 @@ public class JgChangeRegistrationTransferController extends BaseController { ...@@ -127,9 +127,8 @@ public class JgChangeRegistrationTransferController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/detail") @GetMapping(value = "/detail")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个移装变更登记登记", notes = "根据sequenceNbr查询单个移装变更登记登记") @ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个移装变更登记登记", notes = "根据sequenceNbr查询单个移装变更登记登记")
public ResponseModel<Map<String, Map<String, Object>>> selectOne(@RequestParam(value = "sequenceNbr") String sequenceNbr, public ResponseModel<Map<String, Map<String, Object>>> selectOne(@RequestParam(value = "sequenceNbr") String sequenceNbr) {
@RequestParam(value = "equipId", required = false) String equipId) { return ResponseHelper.buildResponse(jgChangeRegistrationTransferService.getTransferDetail(sequenceNbr));
return ResponseHelper.buildResponse(jgChangeRegistrationTransferService.getTransferDetail(sequenceNbr, equipId));
} }
/** /**
......
...@@ -505,17 +505,19 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -505,17 +505,19 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
Map<String, Object> originalDataOther = new HashMap<>(); Map<String, Object> originalDataOther = new HashMap<>();
if ((jgChangeRegistrationReform.getStatus().equals("已完成") || jgChangeRegistrationReform.getStatus().equals("流程结束"))) { if ((jgChangeRegistrationReform.getStatus().equals("已完成") || jgChangeRegistrationReform.getStatus().equals("流程结束"))) {
originalData = idxBizJgRegisterInfoService.getDetailByRecord(equipId); // 完成时显示历史数据
originalDataOther = idxBizJgRegisterInfoService.getDetailFieldCamelCaseByRecord(equipId);
detail.putAll(originalDataOther);
detail.put("techInfo", originalData);
} else {
JgRegistrationHistory jgRegistrationHistory = jgRegistrationHistoryMapper.selectOne(new QueryWrapper<JgRegistrationHistory>() JgRegistrationHistory jgRegistrationHistory = jgRegistrationHistoryMapper.selectOne(new QueryWrapper<JgRegistrationHistory>()
.eq("equ_id", equipId) .eq("equ_id", equipId)
.eq("current_document_id", jgChangeRegistrationReform.getApplyNo()) .eq("current_document_id", jgChangeRegistrationReform.getApplyNo())
.eq("registration_class", bussinessType)); .eq("registration_class", bussinessType));
originalData = JSONObject.parseObject(jgRegistrationHistory.getChangeData(), Map.class); originalData = JSONObject.parseObject(jgRegistrationHistory.getChangeData(), Map.class);
detail.putAll(originalData); detail.putAll(originalData);
} else {
// 非完成显示最新数据
originalData = idxBizJgRegisterInfoService.getDetailByRecord(equipId);
originalDataOther = idxBizJgRegisterInfoService.getDetailFieldCamelCaseByRecord(equipId);
detail.putAll(originalDataOther);
detail.put("techInfo", originalData);
} }
detail.putAll(JSONObject.parseObject(JSONObject.toJSONString(jgChangeRegistrationReform), Map.class)); detail.putAll(JSONObject.parseObject(JSONObject.toJSONString(jgChangeRegistrationReform), Map.class));
if (!ObjectUtils.isEmpty(detail.get("transformationQualityCertificate"))) { if (!ObjectUtils.isEmpty(detail.get("transformationQualityCertificate"))) {
......
...@@ -10,6 +10,7 @@ import com.yeejoin.amos.boot.biz.common.bo.CompanyBo; ...@@ -10,6 +10,7 @@ import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jg.api.common.StringUtil;
import com.yeejoin.amos.boot.module.jg.api.dto.*; import com.yeejoin.amos.boot.module.jg.api.dto.*;
import com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationTransfer; import com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationTransfer;
import com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationTransferEq; import com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationTransferEq;
...@@ -51,6 +52,7 @@ import org.springframework.beans.BeanUtils; ...@@ -51,6 +52,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
...@@ -554,32 +556,20 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang ...@@ -554,32 +556,20 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
/** /**
* 根据移装变更记录sequenceNbr查询详情 * 根据移装变更记录sequenceNbr查询详情
*
* @param sequenceNbr 变更记录sequenceNbr * @param sequenceNbr 变更记录sequenceNbr
* @return * @return
*/ */
public Map<String, Map<String, Object>> getTransferDetail(String sequenceNbr, String equipId) { @Override
public Map<String, Map<String, Object>> getTransferDetail(String sequenceNbr) {
Map<String, Map<String, Object>> pageDataMap = new HashMap<>(); Map<String, Map<String, Object>> pageDataMap = new HashMap<>();
Map<String, Object> resultDataMap = new HashMap<>(); Map<String, Object> resultDataMap = new HashMap<>();
//移装变更详情 //移装变更详情
JgChangeRegistrationTransfer transferById = this.getById(sequenceNbr); JgChangeRegistrationTransfer transferById = this.getById(sequenceNbr);
if (!ValidationUtil.isEmpty(transferById)) {
Map<String, Object> transferToMap = Bean.BeantoMap(transferById);
resultDataMap.putAll(transferToMap);
}
//查询设备详情 //查询设备详情
if (ValidationUtil.isEmpty(equipId)) { String equipId = jgChangeRegistrationTransferEqMapper.getEquipIdByEquipTransferId(sequenceNbr);
equipId = jgChangeRegistrationTransferEqMapper.getEquipIdByEquipTransferId(sequenceNbr);
}
Map<String, Object> equipDetailMap = idxBizJgRegisterInfoService.getDetailFieldCamelCaseByRecord(equipId);
resultDataMap.putAll(equipDetailMap);
//判断流程是否执行完成, if (ValidationUtil.equals(FlowStatusEnum.TO_BE_FINISHED.getName(), transferById.getStatus())) {
// 1、未执行完成时查询历史表 // 执行完成时查询历史表
// 2、执行完成后查询使用信息表
if (!ValidationUtil.equals(FlowStatusEnum.TO_BE_FINISHED.getName(), transferById.getStatus())) {
JgRegistrationHistory historyData = jgRegistrationHistoryService.getDteailByRecord(equipId, transferById.getApplyNo()); JgRegistrationHistory historyData = jgRegistrationHistoryService.getDteailByRecord(equipId, transferById.getApplyNo());
if (!ValidationUtil.isEmpty(historyData)) { if (!ValidationUtil.isEmpty(historyData)) {
Map<String,Object> newPosition = JSON.parseObject(historyData.getChangeData(),Map.class); Map<String,Object> newPosition = JSON.parseObject(historyData.getChangeData(),Map.class);
...@@ -588,81 +578,19 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang ...@@ -588,81 +578,19 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
Map<String, Object> transferToMap = Bean.BeantoMap(transferById); Map<String, Object> transferToMap = Bean.BeantoMap(transferById);
resultDataMap.putAll(transferToMap); resultDataMap.putAll(transferToMap);
} }
// String record = newPosition.getString("record");
// String receiveOrgCode = newPosition.getString("receiveOrgCode");
// String equCode = newPosition.getString("equCode");
// 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");
// String longitudeLatitude = newPosition.getString("longitudeLatitude");
// if (!ObjectUtils.isEmpty(record)) {
// resultDataMap.put("record", record);
// }
// if (!ObjectUtils.isEmpty(equCode)) {
// resultDataMap.put("equCode", equCode);
// }
// if (!ObjectUtils.isEmpty(receiveOrgCode)) {
// resultDataMap.put("receiveOrgCode", receiveOrgCode);
// }
//
// // 分割省市区街道字段
// if (!ObjectUtils.isEmpty(province)) {
// resultDataMap.put("province", province);
// }
// if (!ObjectUtils.isEmpty(city)) {
// resultDataMap.put("city", city);
// }
// if (!ObjectUtils.isEmpty(county)) {
// resultDataMap.put("county", county);
// }
// if (!ObjectUtils.isEmpty(street)) {
// resultDataMap.put("street", street);
// }
// if (!ObjectUtils.isEmpty(address)) {
// resultDataMap.put("address", address);
// }
// if (!ObjectUtils.isEmpty(longitudeLatitude)) {
// resultDataMap.put("longitudeLatitude", JSON.parseObject(longitudeLatitude));
// }
} }
} else { } else {
JgRegistrationHistory historyData = jgRegistrationHistoryService.getDteailByRecord(equipId, transferById.getApplyNo()); // 非执行完成状态显示最新设备信息
Map<String,Object> newPosition = JSON.parseObject(historyData.getChangeData(),Map.class); Map<String, Object> equipDetailMap = idxBizJgRegisterInfoService.getDetailFieldCamelCaseByRecord(equipId);
resultDataMap.putAll(newPosition); resultDataMap.putAll(equipDetailMap);
if (!ValidationUtil.isEmpty(transferById)) { if (!ValidationUtil.isEmpty(transferById)) {
Map<String, Object> transferToMap = Bean.BeantoMap(transferById); Map<String, Object> transferToMap = Bean.BeantoMap(transferById);
resultDataMap.putAll(transferToMap); resultDataMap.putAll(transferToMap);
} }
//设备注册信息
IdxBizJgRegisterInfo registerInfo = idxBizJgRegisterInfoService.getOne(new QueryWrapper<IdxBizJgRegisterInfo>().eq("RECORD", equipId));
//使用信息详情
IdxBizJgUseInfo useInfoByRecord = idxBizJgUseInfoService.getOneData(equipId);
if (!ValidationUtil.isEmpty(useInfoByRecord)) {
Map<String, Object> useInfoToMap = Bean.BeantoMap(useInfoByRecord);
String record = useInfoByRecord.getRecord();
resultDataMap.put("record", record);
resultDataMap.putAll(useInfoToMap);
// 省市区街道字段
resultDataMap.put("province", useInfoByRecord.getProvince() + "_" + useInfoByRecord.getProvinceName());
resultDataMap.put("city", useInfoByRecord.getCity() + "_" + useInfoByRecord.getCityName());
resultDataMap.put("county", useInfoByRecord.getCounty() + "_" + useInfoByRecord.getCountyName());
resultDataMap.put("street", useInfoByRecord.getFactoryUseSiteStreet() + "_" + useInfoByRecord.getStreetName());
resultDataMap.put("address", useInfoByRecord.getAddress());
if (!ObjectUtils.isEmpty(useInfoByRecord.getLongitudeLatitude())) {
resultDataMap.put("longitudeLatitude", JSON.parseObject(useInfoByRecord.getLongitudeLatitude()));
}
}
if (!ValidationUtil.isEmpty(registerInfo)) {
resultDataMap.put("equCode", registerInfo.getEquCode());
}
resultDataMap.put("receiveOrgCode", transferById.getReceiveCompanyCode() + "_" + transferById.getReceiveOrgName()); resultDataMap.put("receiveOrgCode", transferById.getReceiveCompanyCode() + "_" + transferById.getReceiveOrgName());
} }
String transferSafetyManager = Optional.ofNullable(resultDataMap.get("transferSafetyManager")).orElse("").toString(); String transferSafetyManager = Optional.ofNullable(resultDataMap.get("transferSafetyManager")).orElse("").toString();
if(!transferSafetyManager.equals("")){ if(StringUtil.isNotEmpty(transferSafetyManager)){
String[] transferSafetyManagerList = transferSafetyManager.split("_"); String[] transferSafetyManagerList = transferSafetyManager.split("_");
if(transferSafetyManagerList.length>1){ if(transferSafetyManagerList.length>1){
resultDataMap.put("transferSafetyManagerName",transferSafetyManagerList[1]); resultDataMap.put("transferSafetyManagerName",transferSafetyManagerList[1]);
......
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