Commit 57ae600a authored by tianyiming's avatar tianyiming

一码通草稿功能

parent e5f4c215
...@@ -195,4 +195,23 @@ public class IdxBizJgUseInfo extends TzsBaseEntity { ...@@ -195,4 +195,23 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
@TableField("\"IS_NOT_ELEV\"") @TableField("\"IS_NOT_ELEV\"")
private String isNotElev; private String isNotElev;
/**
* 创建时间
*/
@TableField("\"CREATE_DATE\"")
private Date createDate;
/**
* 认领时间
*/
@TableField("\"CLAIM_DATE\"")
private Date claimDate;
/**
* 数据来源(新增:0、导入:1、复制:复制数据的id )
*/
@TableField("\"DATA_SOURCE\"")
private String dataSource;
} }
...@@ -287,6 +287,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -287,6 +287,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
//一码通复制功能url参数key //一码通复制功能url参数key
private static final String COPY_KEY = "stashType"; private static final String COPY_KEY = "stashType";
//一码通判断是否复制
private static final String IS_COPY = "isCopy";
@Autowired @Autowired
RestHighLevelClient restHighLevelClient; RestHighLevelClient restHighLevelClient;
...@@ -379,8 +382,8 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -379,8 +382,8 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
Terms field2Terms = field1Bucket.getAggregations().get("group_by_status"); Terms field2Terms = field1Bucket.getAggregations().get("group_by_status");
for (Terms.Bucket field2Bucket : field2Terms.getBuckets()) { for (Terms.Bucket field2Bucket : field2Terms.getBuckets()) {
String field1Value = field1Bucket.getKeyAsString(); String field1Value = field1Bucket.getKeyAsString();
String field2Value = "已认领".equals(field2Bucket.getKeyAsString()) ? "alreadyClaim" : String field2Value = EquipmentCategoryEnum.YRL.getName().equals(field2Bucket.getKeyAsString()) ? "alreadyClaim" :
"待认领".equals(field2Bucket.getKeyAsString()) ? "waitClaim" : "refuseClaim"; EquipmentCategoryEnum.DRL.getName().equals(field2Bucket.getKeyAsString()) ? "waitClaim" : "refuseClaim";
long docCount = field2Bucket.getDocCount(); long docCount = field2Bucket.getDocCount();
statusCountMap.put(field1Value + "|" + field2Value, docCount); statusCountMap.put(field1Value + "|" + field2Value, docCount);
} }
...@@ -1349,6 +1352,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1349,6 +1352,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
String claimStatus = String.valueOf(superviseMap.get("claimStatus")); String claimStatus = String.valueOf(superviseMap.get("claimStatus"));
String code96333 = String.valueOf(superviseMap.get("code96333")); String code96333 = String.valueOf(superviseMap.get("code96333"));
String operateType = String.valueOf(superviseMap.get("operateType")); String operateType = String.valueOf(superviseMap.get("operateType"));
String isCopy = String.valueOf(useInfoFrom.get("isCopy"));
//生成码 //生成码
Map<String, String> codeMap = new HashMap<>(); Map<String, String> codeMap = new HashMap<>();
if (EquipmentCategoryEnum.YRL.getName().equals(claimStatus)) { if (EquipmentCategoryEnum.YRL.getName().equals(claimStatus)) {
...@@ -1378,7 +1382,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1378,7 +1382,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} }
StopWatch stopWatch1 = new StopWatch(); StopWatch stopWatch1 = new StopWatch();
stopWatch1.start(); stopWatch1.start();
record = batchSubmitOrUpdate(map, equCategory, operateType); record = batchSubmitOrUpdate(map, isCopy, operateType,claimStatus);
stopWatch1.stop(); stopWatch1.stop();
if (log.isInfoEnabled()) { if (log.isInfoEnabled()) {
log.info("业务存数据耗时:{} 秒", stopWatch1.getTotalTimeSeconds()); log.info("业务存数据耗时:{} 秒", stopWatch1.getTotalTimeSeconds());
...@@ -1393,9 +1397,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1393,9 +1397,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
supervisionMap.put("CODE96333", "null".equals(code96333) ? null : code96333); supervisionMap.put("CODE96333", "null".equals(code96333) ? null : code96333);
map.put(supervision_form_id, supervisionMap); map.put(supervision_form_id, supervisionMap);
//根据操作状态判断是调用新增还是修改接口 //根据操作状态判断是调用新增还是修改接口
record = batchSubmitOrUpdate(map, equCategory, operateType); record = batchSubmitOrUpdate(map, isCopy, operateType,claimStatus);
} else { } else {
record = batchSubmitOrUpdate(map, equCategory, operateType); record = batchSubmitOrUpdate(map, isCopy, operateType,claimStatus);
} }
StopWatch stopWatch4 = new StopWatch(); StopWatch stopWatch4 = new StopWatch();
stopWatch4.start(); stopWatch4.start();
...@@ -1440,7 +1444,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1440,7 +1444,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
return ResponseHelper.buildResponse(record); return ResponseHelper.buildResponse(record);
} }
private String batchSubmitOrUpdate(Map<String, Object> map, String equCategory, String type) { private String batchSubmitOrUpdate(Map<String, Object> map, String isCopy, String type, String claimStatus) {
Date date = new Date(); Date date = new Date();
String record = null; String record = null;
LinkedHashMap useInfoForm = (LinkedHashMap) map.get(use_info_form_id); LinkedHashMap useInfoForm = (LinkedHashMap) map.get(use_info_form_id);
...@@ -1473,9 +1477,17 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1473,9 +1477,17 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
IdxBizJgUseInfo useInfo = JSON.parseObject(JSON.toJSONString(useInfoForm), IdxBizJgUseInfo.class); IdxBizJgUseInfo useInfo = JSON.parseObject(JSON.toJSONString(useInfoForm), IdxBizJgUseInfo.class);
useInfo.setRecord(record); useInfo.setRecord(record);
useInfo.setRecDate(date); useInfo.setRecDate(date);
useInfo.setCreateDate("save".equals(type) ? new Date() : null);
useInfo.setClaimDate((EquipmentCategoryEnum.YRL.getName().equals(claimStatus) || EquipmentCategoryEnum.YJL.getName().equals(claimStatus)) ? new Date() : null);
if("save".equals(type)){
useInfo.setDataSource(IS_COPY.equals(isCopy) ? useInfo.getSequenceNbr() : "0");
}
if (IS_COPY.equals(isCopy)) {
useInfo.setSequenceNbr(null);
}
idxBizJgUseInfoService.saveOrUpdate(useInfo); idxBizJgUseInfoService.saveOrUpdate(useInfo);
//监督管理信息 //监督管理信息
LinkedHashMap supervisionForm = (LinkedHashMap) map.get(supervision_form_id); LinkedHashMap supervisionForm = (LinkedHashMap) map.get(supervision_form_id);
IdxBizJgSupervisionInfo supervisionInfo = JSON.parseObject(JSON.toJSONString(supervisionForm), IdxBizJgSupervisionInfo.class); IdxBizJgSupervisionInfo supervisionInfo = JSON.parseObject(JSON.toJSONString(supervisionForm), IdxBizJgSupervisionInfo.class);
...@@ -1485,6 +1497,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1485,6 +1497,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
IdxBizJgOtherInfo idxBizJgOtherInfo = JSON.parseObject(JSON.toJSONString(supervisionForm), IdxBizJgOtherInfo.class); IdxBizJgOtherInfo idxBizJgOtherInfo = JSON.parseObject(JSON.toJSONString(supervisionForm), IdxBizJgOtherInfo.class);
if (!ObjectUtils.isEmpty(idxBizJgOtherInfo)) { if (!ObjectUtils.isEmpty(idxBizJgOtherInfo)) {
if(EquipmentCategoryEnum.DRL.getName().equals(claimStatus)){
idxBizJgOtherInfo.setClaimStatus("草稿");
}
idxBizJgOtherInfo.setRecord(record); idxBizJgOtherInfo.setRecord(record);
idxBizJgOtherInfo.setRecDate(date); idxBizJgOtherInfo.setRecDate(date);
idxBizJgOtherInfo.setSequenceNbr("save".equals(type) ? null : otherInfo.getSequenceNbr()); idxBizJgOtherInfo.setSequenceNbr("save".equals(type) ? null : otherInfo.getSequenceNbr());
...@@ -1941,6 +1956,17 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1941,6 +1956,17 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
if (!ObjectUtils.isEmpty(map.getString("STATUS"))) { if (!ObjectUtils.isEmpty(map.getString("STATUS"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
String test = QueryParser.escape(map.getString("STATUS")); String test = QueryParser.escape(map.getString("STATUS"));
if (test.contains("非")) {
meBuilder.must(QueryBuilders.matchPhraseQuery("STATUS", test.replace("非","")));
boolMust.mustNot(meBuilder);
} else {
meBuilder.must(QueryBuilders.matchPhraseQuery("STATUS", test));
boolMust.must(meBuilder);
}
}
if (!ObjectUtils.isEmpty(map.getString("CLAIM_STATUS"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
String test = QueryParser.escape(map.getString("CLAIM_STATUS"));
meBuilder.must(QueryBuilders.matchPhraseQuery("STATUS", test)); meBuilder.must(QueryBuilders.matchPhraseQuery("STATUS", test));
boolMust.must(meBuilder); boolMust.must(meBuilder);
} }
......
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