Commit abae611b authored by suhuiguang's avatar suhuiguang

refeat(jyjc): 报检规则4.0开发

1.报检规则联调自测,自测bug
parent 003ed358
......@@ -44,11 +44,11 @@ public enum JYJCTypeEnum {
return null;
}
public static List<JYJCTypeEnum> getListByBizType(String bizType) {
if (StringUtils.isEmpty(bizType)) {
public static List<JYJCTypeEnum> getListByBizType(String bizTypes) {
if (StringUtils.isEmpty(bizTypes)) {
return Arrays.asList(JYJCTypeEnum.values());
}
return Arrays.stream(JYJCTypeEnum.values()).filter(e -> e.getBizType().equals(bizType)).collect(Collectors.toList());
return Arrays.stream(JYJCTypeEnum.values()).filter(e -> bizTypes.contains(e.getBizType())).collect(Collectors.toList());
}
public static List<HashMap<String,Object>> getTypeEnumList() {
......
......@@ -254,7 +254,7 @@
</choose>
<choose>
<when test="companyType == '使用单位'">
and res.biz_type in ('firstinspect','entrust', 'detection')
and (res.biz_type in ('firstinspect','entrust', 'detection') or res.biz_type = 'useUnitEntry')
</when>
<when test="companyType == '安装改造维修单位'">
and res.biz_type = 'supervise'
......@@ -317,7 +317,7 @@
</choose>
<choose>
<when test="companyType == '使用单位'">
and res.biz_type in ('firstinspect','entrust', 'detection')
and (res.biz_type in ('firstinspect','entrust', 'detection') or res.biz_type = 'useUnitEntry')
</when>
<when test="companyType == '安装改造维修单位'">
and res.biz_type = 'supervise'
......
......@@ -177,8 +177,8 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
@NotNull
public static List<DictionarieModel> getDictionarieModels(String bizType) {
List<JYJCTypeEnum> enums = JYJCTypeEnum.getListByBizType(bizType);
public static List<DictionarieModel> getDictionarieModels(String bizTypes) {
List<JYJCTypeEnum> enums = JYJCTypeEnum.getListByBizType(bizTypes);
return enums.stream().map(e -> {
DictionarieModel dictionarieModel = new DictionarieModel();
dictionarieModel.setDictCode(e.getCode());
......@@ -1506,6 +1506,10 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
if(!ObjectUtils.isEmpty(map.getString("tag1")) && EquipmentClassifityEnum.YLSS.getCode().equals(map.getString("EQU_LIST_CODE"))){
boolMust.must(QueryBuilders.termQuery("tag1.keyword", QueryParser.escape(map.getString("tag1"))));
}
// 固定式压力容器按照是否球罐过滤
if(!ObjectUtils.isEmpty(map.getString("tag1")) && EquipmentClassifityEnum.YLSS.getCode().equals(map.getString("EQU_CATEGORY_CODE"))){
boolMust.must(QueryBuilders.termQuery("WHETHER_SPHERICAL_TANK", QueryParser.escape(map.getString("tag1"))));
}
this.setFilterOfInFlowing(boolMust, map.getString("EQU_LIST_CODE"), map.getString("inspectionType"), map.getString("EQU_CATEGORY_CODE"));
builder.query(boolMust);
builder.sort("REC_DATE", SortOrder.DESC);
......
......@@ -217,7 +217,7 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
}
v.setSourceResult(ResultTypeEnum.getNameByCode(v.getResultType()));
v.setIdentity(identity);
v.setUseInnerCode("null".equals(v.getUseInnerCode()) ? "" : v.getUseInnerCode());
v.setUseInnerCode("null".equals(v.getUseInnerCode()) ? "" : v.getUseInnerCode());
});
return resultPage;
}
......@@ -225,11 +225,11 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
static String getPersonIdentityByType(String companyType) {
if ("使用单位".equals(companyType)) {
return BizTypeEnum.FIRST_INSPECTION.getCode();
return String.join(",", Arrays.asList(BizTypeEnum.FIRST_INSPECTION.getCode(), BizTypeEnum.DETECTION.getCode()));
} else if ("安装改造维修单位".equals(companyType)) {
return BizTypeEnum.SUPERVISE.getCode();
return String.join(",", Arrays.asList(BizTypeEnum.SUPERVISE.getCode(), BizTypeEnum.DETECTION.getCode()));
} else {
return "";
return null;
}
}
......@@ -682,8 +682,8 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
}
public List<DictionarieModel> inspectTypeListByPerson(ReginParams selectedOrgInfo) {
String group = getPersonIdentityByType(selectedOrgInfo.getCompany().getCompanyType());
return JyjcInspectionApplicationServiceImpl.getDictionarieModels(group);
String groups = getPersonIdentityByType(selectedOrgInfo.getCompany().getCompanyType());
return JyjcInspectionApplicationServiceImpl.getDictionarieModels(groups);
}
@Async
......
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