Commit ce777e3b authored by tianyiming's avatar tianyiming

查询单位信息修改

parent 234f2e1e
...@@ -147,18 +147,7 @@ public class JgUseRegistrationController extends BaseController { ...@@ -147,18 +147,7 @@ public class JgUseRegistrationController extends BaseController {
@GetMapping(value = "/getMessage") @GetMapping(value = "/getMessage")
public ResponseModel<Map<String, Object>> getMessage() { public ResponseModel<Map<String, Object>> getMessage() {
ReginParams selectedOrgInfo = getSelectedOrgInfo(); ReginParams selectedOrgInfo = getSelectedOrgInfo();
HashMap<String, Object> map = new HashMap<>(); return ResponseHelper.buildResponse(jgUseRegistrationServiceImpl.getUnitInfo(selectedOrgInfo));
String companyType = selectedOrgInfo.getCompany().getCompanyType();
if ("个人主体".equals(companyType)) {
String[] code = selectedOrgInfo.getCompany().getCompanyCode().split("_");
map.put("useUnitCreditCode", code.length > 1 ? code[1] : code[0]);
String[] companyName = selectedOrgInfo.getCompany().getCompanyName().split("_");
map.put("useUnitName", companyName.length > 1 ? companyName[1] : companyName[0]);
} else {
map.put("useUnitCreditCode", selectedOrgInfo.getCompany().getCompanyCode());
map.put("useUnitName", selectedOrgInfo.getCompany().getCompanyName());
}
return ResponseHelper.buildResponse(map);
} }
......
...@@ -129,6 +129,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -129,6 +129,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
@Autowired @Autowired
IdxBizJgSupervisionInfoMapper idxBizJgSupervisionInfoMapper; IdxBizJgSupervisionInfoMapper idxBizJgSupervisionInfoMapper;
@Autowired @Autowired
TzBaseEnterpriseInfoMapper tzBaseEnterpriseInfoMapper;
@Autowired
EquipTechParamPipelineMapper equipTechParamPipelineMapper; EquipTechParamPipelineMapper equipTechParamPipelineMapper;
@Autowired @Autowired
DataDictionaryServiceImpl iDataDictionaryService; DataDictionaryServiceImpl iDataDictionaryService;
...@@ -3032,4 +3034,24 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -3032,4 +3034,24 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
.ne(JgUseRegistration::getStatus, "已作废"); .ne(JgUseRegistration::getStatus, "已作废");
return this.baseMapper.selectOne(queryWrapper); return this.baseMapper.selectOne(queryWrapper);
} }
public Map<String, Object> getUnitInfo(ReginParams selectedOrgInfo) {
HashMap<String, Object> map = new HashMap<>();
String companyType = selectedOrgInfo.getCompany().getCompanyType();
QueryWrapper queryWrapper = new QueryWrapper<TzBaseEnterpriseInfo>();
queryWrapper.eq("use_code", selectedOrgInfo.getCompany().getCompanyCode());
TzBaseEnterpriseInfo tzBaseEnterpriseInfo = tzBaseEnterpriseInfoMapper.selectOne(queryWrapper);
if ("个人主体".equals(companyType)) {
String[] code = selectedOrgInfo.getCompany().getCompanyCode().split("_");
map.put("useUnitCreditCode", code.length > 1 ? code[1] : code[0]);
String[] companyName = selectedOrgInfo.getCompany().getCompanyName().split("_");
map.put("useUnitName", ObjectUtils.isEmpty(tzBaseEnterpriseInfo) ? companyName.length > 1 ? companyName[1] : companyName[0] : tzBaseEnterpriseInfo.getUseUnit());
} else {
map.put("useUnitCreditCode", selectedOrgInfo.getCompany().getCompanyCode());
map.put("useUnitName", ObjectUtils.isEmpty(tzBaseEnterpriseInfo) ? selectedOrgInfo.getCompany().getCompanyName() : tzBaseEnterpriseInfo.getUseUnit());
}
return map;
}
} }
\ No newline at end of file
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