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

fix(jg):bug

parent 4c881cc7
......@@ -1709,29 +1709,7 @@ public class CommonServiceImpl implements ICommonService {
}
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
......
......@@ -131,6 +131,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
@Autowired
CodeUtil codeUtil;
@Autowired
CommonServiceImpl commonServiceImpl;
@Autowired
private JgInstallationNoticeMapper jgInstallationNoticeMapper;
@Autowired
private ProduceInfoMapper produceInfoMapper;
......@@ -146,8 +148,6 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
private CommonServiceImpl commonService;
@Autowired
private RedissonClient redissonClient;
@Autowired
CommonServiceImpl commonServiceImpl;
/**
* 根据sequenceNbr查询
......@@ -912,11 +912,12 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
.eq(IdxBizJgSupervisionInfo::getRecord, jgRelationEquip.getEquId());
IdxBizJgSupervisionInfo idxBizJgSupervisionInfo = idxBizJgSupervisionInfoMapper.selectOne(eq);
if (!ObjectUtils.isEmpty(jgInstallationNotice.getOrgBranchCode()) && !ObjectUtils.isEmpty(jgInstallationNotice.getOrgBranchName())) {
// CompanyModel result = Privilege.companyClient.queryByCompanyName(jgInstallationNotice.getOrgBranchName()).getResult();
LinkedHashMap linkedHashMap = commonServiceImpl.recursiveMatching(tree, jgInstallationNotice.getOrgBranchCode());
idxBizJgSupervisionInfo.setOrgBranchCode((String) linkedHashMap.get("orgCode"));
idxBizJgSupervisionInfo.setOrgBranchName((String) linkedHashMap.get("companyName"));
idxBizJgSupervisionInfo.setCompanyOrgBranchCode((String) linkedHashMap.get("companyCode"));
HashMap<String, Object> parentMessage = (HashMap<String, Object>) Privilege.companyClient.queryByOrgcode(jgInstallationNotice.getOrgBranchCode()).getResult();
// 目前平台返回key为compnay(存在拼写错误)
CompanyModel parentModel = JSON.parseObject(JSON.toJSONString(parentMessage.get("compnay")), CompanyModel.class);
idxBizJgSupervisionInfo.setOrgBranchCode(parentModel.getOrgCode());
idxBizJgSupervisionInfo.setOrgBranchName(parentModel.getCompanyName());
idxBizJgSupervisionInfo.setCompanyOrgBranchCode(parentModel.getCompanyCode());
idxBizJgSupervisionInfoMapper.updateById(idxBizJgSupervisionInfo);
}
......
......@@ -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.FlowStatusEnum;
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.model.DictionarieValueModel;
import com.yeejoin.amos.feign.systemctl.model.TaskV2Model;
......@@ -234,11 +236,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
IdxBizJgSupervisionInfo idxBizJgSupervisionInfo = new IdxBizJgSupervisionInfo();
if (map.containsKey("orgBranchCode") && !ObjectUtils.isEmpty(map.get("orgBranchCode"))) {
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.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"));
idxBizJgSupervisionInfoMapper.update(idxBizJgSupervisionInfo, eq);
}
......@@ -531,10 +536,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
.filter(code -> code.contains("_"))
.map(code -> code.split("_"))
.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.setReceiveCompanyOrgCode(splitReceiveOrgCode[0]);
useRegistration.setReceiveCompanyCode((String) linkedHashMap.get("companyCode"));
useRegistration.setReceiveCompanyCode(parentModel.getCompanyCode());
useRegistration.setReceiveOrgName(splitReceiveOrgCode[1]);
});
......
......@@ -189,10 +189,10 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
if (!StringUtils.isEmpty(vehicleInfoDto.getReceiveOrgCode())) {
List<LinkedHashMap> tree = commonService.getCreatTree();
String[] splitReceiveOrgCode = vehicleInfoDto.getReceiveOrgCode().split("_");
String orgCode = this.recursiveMatching(tree, splitReceiveOrgCode[0]);
vehicleInfoDto.setReceiveOrgCode(orgCode);
vehicleInfoDto.setReceiveCompanyCode(splitReceiveOrgCode[0]);
CompanyModel result = Privilege.companyClient.queryByCompanyCode(splitReceiveOrgCode[0]).getResult();
vehicleInfoDto.setReceiveOrgCode(splitReceiveOrgCode[0]);
vehicleInfoDto.setReceiveOrgName(splitReceiveOrgCode[1]);
vehicleInfoDto.setReceiveCompanyCode(result.getCompanyCode());
}
//检验机构信息
if (!StringUtils.isEmpty(vehicleInfoDto.getInspectUnitCreditCode())) {
......@@ -787,11 +787,12 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
IdxBizJgSupervisionInfo idxBizJgSupervisionInfo = new IdxBizJgSupervisionInfo();
if (map.containsKey("orgBranchCode") && !ObjectUtils.isEmpty(map.get("orgBranchCode"))) {
String[] data = String.valueOf(map.getString("orgBranchCode")).split("_");
List<LinkedHashMap> tree = commonService.getCreatTree();
String orgCode = this.recursiveMatching(tree, data[0]);
idxBizJgSupervisionInfo.setOrgBranchCode(orgCode);
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.setOrgBranchName(data[1]);
idxBizJgSupervisionInfo.setCompanyOrgBranchCode(data[0]);
idxBizJgSupervisionInfo.setCompanyOrgBranchCode(parentModel.getCompanyCode());
LambdaQueryWrapper<IdxBizJgSupervisionInfo> eq = new QueryWrapper<IdxBizJgSupervisionInfo>().lambda().eq(IdxBizJgSupervisionInfo::getRecord, map.get("record"));
idxBizJgSupervisionInfoMapper.update(idxBizJgSupervisionInfo, eq);
}
......@@ -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的“已注册”的字典值
*
* @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