Commit db3805eb authored by suhuiguang's avatar suhuiguang

fix(检验检测): 使用单位自行录入检验结果

1.切换索引到新索引 2.增加按照出场编号筛选设备
parent 78c6b5d0
......@@ -53,4 +53,6 @@ public interface BizCommonConstant {
* 已分配已确认
*/
String JS_YFP_YQR = "66192";
String FACTORY_NUM = "FACTORY_NUM";
}
......@@ -24,6 +24,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.ContraptionQueryParams;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.common.api.enums.JYJCBusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import com.yeejoin.amos.boot.module.jyjc.api.common.BizCommonConstant;
import com.yeejoin.amos.boot.module.jyjc.api.entity.*;
import com.yeejoin.amos.boot.module.jyjc.api.enums.*;
import com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcBaseMapper;
......@@ -1242,7 +1243,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
int size = ObjectUtils.isEmpty(map.getInteger("size")) ? 20 : map.getInteger("size");
Page<JSONObject> result = new Page<>(pageNumber, size);
SearchRequest request = new SearchRequest();
request.indices("idx_biz_view_jg_all");
request.indices("idx_biz_equipment_info");
SearchSourceBuilder builder = new SearchSourceBuilder();
builder.trackTotalHits(true);
BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
......@@ -1320,6 +1321,14 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
String test = QueryParser.escape(map.getString("USE_INNER_CODE"));
boolMust.must(QueryBuilders.matchPhraseQuery("USE_INNER_CODE", test));
}
// 出厂编号/产品编码模糊查询
if (!org.springframework.util.ObjectUtils.isEmpty(map.getString(BizCommonConstant.FACTORY_NUM))) {
BoolQueryBuilder pBuilder = QueryBuilders.boolQuery();
String test = QueryParser.escape(map.getString(BizCommonConstant.FACTORY_NUM));
pBuilder.must(QueryBuilders.wildcardQuery(BizCommonConstant.FACTORY_NUM, "*" + test + "*"));
boolMust.must(pBuilder);
}
builder.query(boolMust);
builder.sort("REC_DATE", SortOrder.DESC);
builder.from((pageNumber - 1) * size);
......@@ -1341,6 +1350,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
dto2.put(EQU_STATE, status);
}
dto2.put("record", dto2.get(SEQUENCE_NBR));
this.replaceNull2EmptyString(dto2);
list.add(dto2);
}
// 填充地址
......@@ -1354,6 +1364,14 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
return result;
}
private void replaceNull2EmptyString(JSONObject dto2) {
dto2.forEach((k,v)->{
if(v == null || "null".equals(v)){
dto2.put(k,"");
}
});
}
/**
* 设备过滤查询-显示未提交的设备、未使用的设备,流程中的设备不显示
*
......@@ -1531,7 +1549,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
private Object removeSplitLine(JSONObject item) {
String fullAddress = item.getString("USE_PLACE") + item.getString("ADDRESS");
fullAddress = fullAddress.replace("/", "");
fullAddress = fullAddress.replace("/", "").replace("null", "");
return fullAddress;
}
......
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