Commit 5a46c82e authored by suhuiguang's avatar suhuiguang

feat(jyjc):检验检测业务管理

1.按照要求进行调整
parent bf88de2f
......@@ -28,4 +28,9 @@ public class JyjcBizManageModel extends JyjcOpeningApplicationModel {
* 新开通区域
*/
private List<String> newDetectionRegion;
/**
* 是否启用登录人区域-是否开通
*/
private Boolean logUserEnable;
}
......@@ -81,6 +81,7 @@ public class JyjcBizManageServiceImpl {
bizManageModel.setDetectionRegionName(this.buildRegionName(detectionRegionCodeNameMap, r.getDetectionRegion()));
bizManageModel.setExclusionRegionName(this.buildRegionName(detectionRegionCodeNameMap, r.getExclusionRegion()));
bizManageModel.setAgencyClassifyName(agencyClassifyNameCodeNameMap.getOrDefault(bizManageModel.getAgencyClassify(), ""));
bizManageModel.setLogUserEnable(!Optional.ofNullable(r.getExclusionRegion()).orElse(new ArrayList<>()).contains(company.getCompanyCode()));
return bizManageModel;
}).collect(Collectors.toList());
page.setRecords(manageModels);
......@@ -134,14 +135,10 @@ public class JyjcBizManageServiceImpl {
throw new BadRequest("其他机构同时在操作该业务,请稍后重试!");
}
JyjcOpeningApplication openingApplication = openingApplicationService.getById(appSeq);
List<String> detectionRegion = openingApplication.getDetectionRegion();
Set<String> detectionRegionSet = new HashSet<>(detectionRegion);
detectionRegionSet.add(company.getCompanyCode());
List<String> exclusionRegion = openingApplication.getExclusionRegion();
if (exclusionRegion != null) {
exclusionRegion.remove(company.getCompanyCode());
}
openingApplication.setDetectionRegion(new ArrayList<>(detectionRegionSet));
openingApplication.setExclusionRegion(exclusionRegion);
openingApplicationService.saveOrUpdate(openingApplication);
......@@ -166,14 +163,9 @@ public class JyjcBizManageServiceImpl {
throw new BadRequest("其他机构同时在操作该业务,请稍后重试!");
}
JyjcOpeningApplication openingApplication = openingApplicationService.getById(appSeq);
List<String> detectionRegion = openingApplication.getDetectionRegion();
if (detectionRegion != null) {
detectionRegion.remove(company.getCompanyCode());
}
List<String> exclusionRegion = openingApplication.getExclusionRegion();
Set<String> exclusionRegionSet = Optional.ofNullable(exclusionRegion).map(HashSet::new).orElse(new HashSet<>());
exclusionRegionSet.add(company.getCompanyCode());
openingApplication.setDetectionRegion(detectionRegion);
openingApplication.setExclusionRegion(new ArrayList<>(exclusionRegionSet));
openingApplicationService.saveOrUpdate(openingApplication);
} catch (InterruptedException e) {
......@@ -281,7 +273,7 @@ public class JyjcBizManageServiceImpl {
public JyjcBizManageModel getBasicInfo(String appSeq) {
JyjcOpeningApplication openingApplication = openingApplicationService.getById(appSeq);
JyjcBizManageModel manageModel = BeanUtil.copyProperties(openingApplication, JyjcBizManageModel.class);
manageModel.setNewDetectionRegion(openingApplication.getDetectionRegion().stream().filter(e -> !Optional.ofNullable(openingApplication.getExclusionRegion()).orElse(new ArrayList<>()).contains(e)).collect(Collectors.toList()));
manageModel.setNewDetectionRegion(openingApplication.getDetectionRegion());
return manageModel;
}
......
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