Commit a2a9bc8e authored by 韩桐桐's avatar 韩桐桐

fix(jg):bug

parent 4c881cc7
...@@ -1709,29 +1709,7 @@ public class CommonServiceImpl implements ICommonService { ...@@ -1709,29 +1709,7 @@ public class CommonServiceImpl implements ICommonService {
} }
return result; return result;
} }
/**
* 递归属地监管部门树匹配监管部门
*
* @param tree 监管树
* @param orgBranchCode 监管部门orgCode
* @return 监管部门信息
*/
public LinkedHashMap recursiveMatching(List<LinkedHashMap> tree, String orgBranchCode) {
if (tree != null) {
for (LinkedHashMap map : tree) {
if (orgBranchCode.equals(map.get("orgCode"))) {
return map;
}
if (map.containsKey("children") && map.get("children") instanceof List) {
LinkedHashMap result = recursiveMatching((List<LinkedHashMap>) map.get("children"), orgBranchCode);
if (!"".equals(result)) {
return result;
}
}
}
}
return null;
}
/** /**
* 排序 :页面列表排序功能支持,将 "字段,ascend" 或 "字段,descend" 转化为对应JSONObject * 排序 :页面列表排序功能支持,将 "字段,ascend" 或 "字段,descend" 转化为对应JSONObject
......
...@@ -131,6 +131,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -131,6 +131,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
@Autowired @Autowired
CodeUtil codeUtil; CodeUtil codeUtil;
@Autowired @Autowired
CommonServiceImpl commonServiceImpl;
@Autowired
private JgInstallationNoticeMapper jgInstallationNoticeMapper; private JgInstallationNoticeMapper jgInstallationNoticeMapper;
@Autowired @Autowired
private ProduceInfoMapper produceInfoMapper; private ProduceInfoMapper produceInfoMapper;
...@@ -146,8 +148,6 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -146,8 +148,6 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
private CommonServiceImpl commonService; private CommonServiceImpl commonService;
@Autowired @Autowired
private RedissonClient redissonClient; private RedissonClient redissonClient;
@Autowired
CommonServiceImpl commonServiceImpl;
/** /**
* 根据sequenceNbr查询 * 根据sequenceNbr查询
...@@ -912,11 +912,12 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -912,11 +912,12 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
.eq(IdxBizJgSupervisionInfo::getRecord, jgRelationEquip.getEquId()); .eq(IdxBizJgSupervisionInfo::getRecord, jgRelationEquip.getEquId());
IdxBizJgSupervisionInfo idxBizJgSupervisionInfo = idxBizJgSupervisionInfoMapper.selectOne(eq); IdxBizJgSupervisionInfo idxBizJgSupervisionInfo = idxBizJgSupervisionInfoMapper.selectOne(eq);
if (!ObjectUtils.isEmpty(jgInstallationNotice.getOrgBranchCode()) && !ObjectUtils.isEmpty(jgInstallationNotice.getOrgBranchName())) { if (!ObjectUtils.isEmpty(jgInstallationNotice.getOrgBranchCode()) && !ObjectUtils.isEmpty(jgInstallationNotice.getOrgBranchName())) {
// CompanyModel result = Privilege.companyClient.queryByCompanyName(jgInstallationNotice.getOrgBranchName()).getResult(); HashMap<String, Object> parentMessage = (HashMap<String, Object>) Privilege.companyClient.queryByOrgcode(jgInstallationNotice.getOrgBranchCode()).getResult();
LinkedHashMap linkedHashMap = commonServiceImpl.recursiveMatching(tree, jgInstallationNotice.getOrgBranchCode()); // 目前平台返回key为compnay(存在拼写错误)
idxBizJgSupervisionInfo.setOrgBranchCode((String) linkedHashMap.get("orgCode")); CompanyModel parentModel = JSON.parseObject(JSON.toJSONString(parentMessage.get("compnay")), CompanyModel.class);
idxBizJgSupervisionInfo.setOrgBranchName((String) linkedHashMap.get("companyName")); idxBizJgSupervisionInfo.setOrgBranchCode(parentModel.getOrgCode());
idxBizJgSupervisionInfo.setCompanyOrgBranchCode((String) linkedHashMap.get("companyCode")); idxBizJgSupervisionInfo.setOrgBranchName(parentModel.getCompanyName());
idxBizJgSupervisionInfo.setCompanyOrgBranchCode(parentModel.getCompanyCode());
idxBizJgSupervisionInfoMapper.updateById(idxBizJgSupervisionInfo); idxBizJgSupervisionInfoMapper.updateById(idxBizJgSupervisionInfo);
} }
......
...@@ -39,6 +39,8 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.EquCodeTypeEnum; ...@@ -39,6 +39,8 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.EquCodeTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.*; import com.yeejoin.amos.boot.module.ymt.api.mapper.*;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel; import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import com.yeejoin.amos.feign.systemctl.model.TaskV2Model; import com.yeejoin.amos.feign.systemctl.model.TaskV2Model;
...@@ -234,11 +236,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -234,11 +236,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
IdxBizJgSupervisionInfo idxBizJgSupervisionInfo = new IdxBizJgSupervisionInfo(); IdxBizJgSupervisionInfo idxBizJgSupervisionInfo = new IdxBizJgSupervisionInfo();
if (map.containsKey("orgBranchCode") && !ObjectUtils.isEmpty(map.get("orgBranchCode"))) { if (map.containsKey("orgBranchCode") && !ObjectUtils.isEmpty(map.get("orgBranchCode"))) {
String[] data = String.valueOf(map.getString("orgBranchCode")).split("_"); String[] data = String.valueOf(map.getString("orgBranchCode")).split("_");
List<LinkedHashMap> tree = commonServiceImpl.getCreatTree();
LinkedHashMap linkedHashMap = commonServiceImpl.recursiveMatching(tree, data[0]); HashMap<String, Object> parentMessage = (HashMap<String, Object>) Privilege.companyClient.queryByOrgcode(data[0]).getResult();
// 目前平台返回key为compnay(存在拼写错误)
CompanyModel parentModel = JSON.parseObject(JSON.toJSONString(parentMessage.get("compnay")), CompanyModel.class);
idxBizJgSupervisionInfo.setOrgBranchCode(data[0]); idxBizJgSupervisionInfo.setOrgBranchCode(data[0]);
idxBizJgSupervisionInfo.setOrgBranchName(data[1]); idxBizJgSupervisionInfo.setOrgBranchName(data[1]);
idxBizJgSupervisionInfo.setCompanyOrgBranchCode((String) linkedHashMap.get("companyCode")); idxBizJgSupervisionInfo.setCompanyOrgBranchCode(parentModel.getCompanyCode());
LambdaQueryWrapper<IdxBizJgSupervisionInfo> eq = new QueryWrapper<IdxBizJgSupervisionInfo>().lambda().eq(IdxBizJgSupervisionInfo::getRecord, map.get("equipId")); LambdaQueryWrapper<IdxBizJgSupervisionInfo> eq = new QueryWrapper<IdxBizJgSupervisionInfo>().lambda().eq(IdxBizJgSupervisionInfo::getRecord, map.get("equipId"));
idxBizJgSupervisionInfoMapper.update(idxBizJgSupervisionInfo, eq); idxBizJgSupervisionInfoMapper.update(idxBizJgSupervisionInfo, eq);
} }
...@@ -531,10 +536,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -531,10 +536,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
.filter(code -> code.contains("_")) .filter(code -> code.contains("_"))
.map(code -> code.split("_")) .map(code -> code.split("_"))
.ifPresent(splitReceiveOrgCode -> { .ifPresent(splitReceiveOrgCode -> {
LinkedHashMap linkedHashMap = commonServiceImpl.recursiveMatching(tree, splitReceiveOrgCode[0]); HashMap<String, Object> parentMessage = (HashMap<String, Object>) Privilege.companyClient.queryByOrgcode(splitReceiveOrgCode[0]).getResult();
// 目前平台返回key为compnay(存在拼写错误)
CompanyModel parentModel = JSON.parseObject(JSON.toJSONString(parentMessage.get("compnay")), CompanyModel.class);
useRegistration.setReceiveOrgCode(splitReceiveOrgCode[0]); useRegistration.setReceiveOrgCode(splitReceiveOrgCode[0]);
useRegistration.setReceiveCompanyOrgCode(splitReceiveOrgCode[0]); useRegistration.setReceiveCompanyOrgCode(splitReceiveOrgCode[0]);
useRegistration.setReceiveCompanyCode((String) linkedHashMap.get("companyCode")); useRegistration.setReceiveCompanyCode(parentModel.getCompanyCode());
useRegistration.setReceiveOrgName(splitReceiveOrgCode[1]); useRegistration.setReceiveOrgName(splitReceiveOrgCode[1]);
}); });
......
...@@ -189,10 +189,10 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform ...@@ -189,10 +189,10 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
if (!StringUtils.isEmpty(vehicleInfoDto.getReceiveOrgCode())) { if (!StringUtils.isEmpty(vehicleInfoDto.getReceiveOrgCode())) {
List<LinkedHashMap> tree = commonService.getCreatTree(); List<LinkedHashMap> tree = commonService.getCreatTree();
String[] splitReceiveOrgCode = vehicleInfoDto.getReceiveOrgCode().split("_"); String[] splitReceiveOrgCode = vehicleInfoDto.getReceiveOrgCode().split("_");
String orgCode = this.recursiveMatching(tree, splitReceiveOrgCode[0]); CompanyModel result = Privilege.companyClient.queryByCompanyCode(splitReceiveOrgCode[0]).getResult();
vehicleInfoDto.setReceiveOrgCode(orgCode); vehicleInfoDto.setReceiveOrgCode(splitReceiveOrgCode[0]);
vehicleInfoDto.setReceiveCompanyCode(splitReceiveOrgCode[0]);
vehicleInfoDto.setReceiveOrgName(splitReceiveOrgCode[1]); vehicleInfoDto.setReceiveOrgName(splitReceiveOrgCode[1]);
vehicleInfoDto.setReceiveCompanyCode(result.getCompanyCode());
} }
//检验机构信息 //检验机构信息
if (!StringUtils.isEmpty(vehicleInfoDto.getInspectUnitCreditCode())) { if (!StringUtils.isEmpty(vehicleInfoDto.getInspectUnitCreditCode())) {
...@@ -787,11 +787,12 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform ...@@ -787,11 +787,12 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
IdxBizJgSupervisionInfo idxBizJgSupervisionInfo = new IdxBizJgSupervisionInfo(); IdxBizJgSupervisionInfo idxBizJgSupervisionInfo = new IdxBizJgSupervisionInfo();
if (map.containsKey("orgBranchCode") && !ObjectUtils.isEmpty(map.get("orgBranchCode"))) { if (map.containsKey("orgBranchCode") && !ObjectUtils.isEmpty(map.get("orgBranchCode"))) {
String[] data = String.valueOf(map.getString("orgBranchCode")).split("_"); String[] data = String.valueOf(map.getString("orgBranchCode")).split("_");
List<LinkedHashMap> tree = commonService.getCreatTree(); HashMap<String, Object> parentMessage = (HashMap<String, Object>) Privilege.companyClient.queryByOrgcode(data[0]).getResult();
String orgCode = this.recursiveMatching(tree, data[0]); // 目前平台返回key为compnay(存在拼写错误)
idxBizJgSupervisionInfo.setOrgBranchCode(orgCode); CompanyModel parentModel = JSON.parseObject(JSON.toJSONString(parentMessage.get("compnay")), CompanyModel.class);
idxBizJgSupervisionInfo.setOrgBranchCode(data[0]);
idxBizJgSupervisionInfo.setOrgBranchName(data[1]); idxBizJgSupervisionInfo.setOrgBranchName(data[1]);
idxBizJgSupervisionInfo.setCompanyOrgBranchCode(data[0]); idxBizJgSupervisionInfo.setCompanyOrgBranchCode(parentModel.getCompanyCode());
LambdaQueryWrapper<IdxBizJgSupervisionInfo> eq = new QueryWrapper<IdxBizJgSupervisionInfo>().lambda().eq(IdxBizJgSupervisionInfo::getRecord, map.get("record")); LambdaQueryWrapper<IdxBizJgSupervisionInfo> eq = new QueryWrapper<IdxBizJgSupervisionInfo>().lambda().eq(IdxBizJgSupervisionInfo::getRecord, map.get("record"));
idxBizJgSupervisionInfoMapper.update(idxBizJgSupervisionInfo, eq); idxBizJgSupervisionInfoMapper.update(idxBizJgSupervisionInfo, eq);
} }
...@@ -825,30 +826,6 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform ...@@ -825,30 +826,6 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
} }
/** /**
* 递归属地监管部门树匹配监管部门
*
* @param tree 监管树
* @param orgBranchCode 监管部门companyCode
* @return 监管部门orgCode
*/
public String recursiveMatching(List<LinkedHashMap> tree, String orgBranchCode) {
if (tree != null) {
for (LinkedHashMap map : tree) {
if (orgBranchCode.equals(map.get("companyCode"))) {
return (String) map.get("orgCode");
}
if (map.containsKey("children") && map.get("children") instanceof List) {
String result = recursiveMatching((List<LinkedHashMap>) map.get("children"), orgBranchCode);
if (!"".equals(result)) {
return result;
}
}
}
}
return "";
}
/**
* 获取类型为ZC的“已注册”的字典值 * 获取类型为ZC的“已注册”的字典值
* *
* @return code * @return code
......
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