| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.iailab.framework.common.util.date.DateUtils; |
| | | import com.iailab.module.ansteel.coking.entity.*; |
| | | import com.iailab.module.ansteel.coking.entity.CokingAnalyIndEntity; |
| | | import com.iailab.module.ansteel.coking.entity.CokingTraceDeviationEntity; |
| | | import com.iailab.module.ansteel.coking.entity.CokingTraceSuggestEntity; |
| | | import com.iailab.module.ansteel.coking.service.*; |
| | | import com.iailab.module.ansteel.common.constant.CommonConstant; |
| | | import com.iailab.module.ansteel.common.enums.ProcessConfDataTypeEnum; |
| | | import com.iailab.module.data.api.ind.IndItemApi; |
| | | import com.iailab.module.data.api.ind.dto.ApiIndItemValueDTO; |
| | | import com.iailab.module.data.api.point.DataPointApi; |
| | | import com.iailab.module.model.api.mcs.McsApi; |
| | | import com.iailab.module.model.api.mcs.dto.ChartParamDTO; |
| | | import com.iailab.module.model.api.mdk.MdkApi; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | private CokingTraceIndService cokingTraceIndService; |
| | | |
| | | @Autowired |
| | | private CokingTraceConfService cokingTraceConfService; |
| | | |
| | | @Autowired |
| | | private McsApi mcsApi; |
| | | |
| | | @Autowired |
| | | private DataPointApi dataPointApi; |
| | | private MdkApi mdkApi; |
| | | |
| | | @Autowired |
| | | private IndItemApi indItemApi; |
| | | private final static String process = "干熄焦工序"; |
| | | |
| | | private static final HashMap<String, Object> steamFirstColoumMap = new HashMap<String, Object>() {{ |
| | | put("steamFirstColoum0", "一级指标-偏差值"); |
| | | put("steamFirstColoum1", "二级指标-偏差值"); |
| | | put("steamFirstColoum2", "影响因素1-偏差值"); |
| | | put("steamFirstColoum3", "影响因素2-偏差值"); |
| | | put("steamFirstColoum4", "影响因素3-偏差值"); |
| | | put("steamFirstColoum5", "影响因素n-偏差值"); |
| | | }}; |
| | | private final static String reportName = "干熄焦工序异常溯源"; |
| | | |
| | | private static final HashMap<String, Object> steamSecondColoumMap = new HashMap<String, Object>() {{ |
| | | put("steamSecondColoum0", "一级指标-偏差值"); |
| | | put("steamSecondColoum1", "二级指标-偏差值"); |
| | | put("steamSecondColoum2", "影响因素1-偏差值"); |
| | | put("steamSecondColoum3", "影响因素2-偏差值"); |
| | | put("steamSecondColoum4", "影响因素3-偏差值"); |
| | | put("steamSecondColoum5", "影响因素n-偏差值"); |
| | | }}; |
| | | private final static String indType = "干熄焦工序异常溯源"; |
| | | |
| | | private final static String steamRow = "steamRow"; |
| | | |
| | | private final static String SugObj = "GXJ"; |
| | | |
| | | private static final String jsonStr="{\"result\":{" + |
| | | " \"steamTotal1\":\"2#干熄焦蒸汽发生量因空气导入量偏高、锅炉入口温度偏低而减少13t,经模型计算,建议调整空气导入量,预计可使主蒸汽流量指标升高20m3/h\",\n" + |
| | | " \"steamTotal2\":\"2#干熄焦蒸汽发生量因空气导入量偏高、锅炉入口温度偏低而减少13m3/h,经模型计算,建议调整循环风机转速,预计可使主蒸汽流量指标升高32m3/h\",\n" + |
| | | " \"steamFirstColoum0\":[[14,20],[14,30],[14,35]],\n" + |
| | | " \"steamFirstColoum1\":[[10,5],[11,15],[21,20]],\n" + |
| | | " \"steamFirstColoum2\":[[74,8],[36,18],[35,34]],\n" + |
| | | " \"steamFirstColoum3\":[[24,67],[6,12],[19,21]],\n" + |
| | | " \"steamFirstColoum4\":[[21,19],[22,31],[8,42]],\n" + |
| | | " \"steamFirstColoum5\":[[11,45],[9,62],[18,34]],\n" + |
| | | " \"steamSecondColoum0\":[[14,20],[14,50],[14,13]],\n" + |
| | | " \"steamSecondColoum1\":[[11,27],[10,35],[22,16]],\n" + |
| | | " \"steamSecondColoum2\":[[36,90],[35,34],[74,55]],\n" + |
| | | " \"steamSecondColoum3\":[[6,66],[19,73],[21,31]],\n" + |
| | | " \"steamSecondColoum4\":[[22,65],[8,22],[21,67]],\n" + |
| | | " \"steamSecondColoum5\":[[9,29],[11,56],[18,61]],\n" + |
| | | " \"steamHomePage\":[[663,617],[66.5,68.9]],\n" + |
| | | " \"steamHomeIndex\":[[90.4,90.2],[80.3,78],[103,100],[280,270]],\n" + |
| | | " \"steamHomeIndexInfo\":\"2月18日甲班:干熄焦产蒸汽量异常\",\n" + |
| | | " \"steamHomeErr\":\"2月18日循环风机转速数据异常(无数据)\"}}"; |
| | | " \"steamProd\":[[0.038,0.036],[0.035,0.036],[0.037,0.034]]," + |
| | | "\"steamRow0\":[[14.0,20.7],[14.0,30.5],[14.0,35.2],[24.0,67.9],[6.0,12.3]]," + |
| | | "\"steamRow1\":[[10.0,5.5],[11.0,15.1],[21.0,20.6],[22.0,31.3],[8.0,42.5]]," + |
| | | "\"steamRow2\":[[74.0,8.2],[36.0,18.2],[35.0,34.6],[9.0,62.4],[18.0,34.7]]," + |
| | | "\"steamPressure\":[3.7,3.6,3.4]," + |
| | | "\"steamHomePage\":[[220.4,223.5],[0.5],[673214.3]]," + |
| | | "\"steamHomeIndexInfo\":\"2025-04-28 甲班 干熄焦产蒸汽量异常\"," + |
| | | "\"steamTemperature\":[461.3,460.4,456.6]," + |
| | | "\"steamElec\":[233564.3,224571.7,246120.2,603157.7]," + |
| | | "\"steamIndex\":[[3.182,3.265,3.275],[1250.3,1293.1,1264.05],[890.3,886.32,901.21],[161495.2,171043.5,168533.6],[203667.2,238742.6,226731.7],[223548.3,223097.9,226733.3]]," + |
| | | "\"steamTotal1\":\"2#干熄焦蒸汽发生量因空气导入量偏高、锅炉入口温度偏低而减少13t,经模型计算,建议调整空气导入量,预计可使主蒸汽流量指标升高20m3/h\"," + |
| | | "\"steamHomeIndex\":[[63.2,61.7],[62.8,67.2],[66.1,65.7],[204.6,220.5]]" + |
| | | " }" + |
| | | "}"; |
| | | |
| | | @Override |
| | | public void run(String params) { |
| | | logger.info("RunCokingTraceModelGXJTask,参数为:{}", params); |
| | | try { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | calendar.set(Calendar.MINUTE, 0); |
| | | int hour = calendar.get(Calendar.HOUR_OF_DAY); |
| | | String yesterday = DateUtils.format(DateUtils.addDateDays(new Date(), -1), DateUtils.FORMAT_YEAR_MONTH_DAY); |
| | | Date startDate = calendar.getTime(); |
| | | String clock = ""; |
| | | String analyClass = ""; |
| | | if (hour == 0) { |
| | | clock = yesterday.concat("-").concat("A"); |
| | | if (hour >= 8 && hour < 16) { |
| | | calendar.set(Calendar.HOUR_OF_DAY, 0); |
| | | startDate = calendar.getTime(); |
| | | clock = DateUtils.format(startDate).concat("-").concat("A"); |
| | | analyClass = "甲班"; |
| | | } else if (hour == 8) { |
| | | clock = yesterday.concat("-").concat("B"); |
| | | } else if (hour >= 16 && hour < 24) { |
| | | calendar.set(Calendar.HOUR_OF_DAY, 8); |
| | | startDate = calendar.getTime(); |
| | | clock = DateUtils.format(startDate).concat("-").concat("B"); |
| | | analyClass = "乙班"; |
| | | } else if (hour == 16) { |
| | | clock = yesterday.concat("-").concat("C"); |
| | | } else if (hour >= 0 && hour < 8) { |
| | | calendar.add(Calendar.DAY_OF_YEAR, -1); |
| | | calendar.set(Calendar.HOUR_OF_DAY, 16); |
| | | startDate = calendar.getTime(); |
| | | clock = DateUtils.format(startDate).concat("-").concat("B"); |
| | | analyClass = "丙班"; |
| | | } |
| | | Map<String, Object> tMap = new HashMap<>(); |
| | | tMap.put("relId", UUID.randomUUID().toString()); |
| | | tMap.put("process", "干熄焦工序"); |
| | | tMap.put("reportName", "锅炉蒸汽产量"); |
| | | tMap.put("analyDate", yesterday); |
| | | tMap.put("analyClass", analyClass); |
| | | tMap.put("clock", clock); |
| | | tMap.put("analyContent", "干熄焦产蒸汽量异常"); |
| | | |
| | | JSONObject jsonObject= JSONObject.parseObject(jsonStr); |
| | | JSONObject result = (JSONObject)JSON.toJSON(jsonObject.get("result")); |
| | | if(!Objects.isNull(result)){ |
| | | saveTraceReport(tMap,result); |
| | | saveTraceSuggest(tMap,result); |
| | | saveTraceDeviation(tMap,result); |
| | | saveAnalyInd(tMap,result); |
| | | saveTraceInd(tMap,result); |
| | | // 调用模型 |
| | | /* MdkScheduleReqDTO dto = new MdkScheduleReqDTO(); |
| | | dto.setScheduleTime(calendar.getTime()); |
| | | dto.setScheduleCode(params); |
| | | MdkScheduleRespDTO mdkScheduleRespDTO = mdkApi.doSchedule(dto); |
| | | logger.info(params + "调度方案执行完成," + mdkScheduleRespDTO); |
| | | Map<String, Object> result = mdkScheduleRespDTO.getResult(); |
| | | |
| | | JSONObject jsonObject = new JSONObject(result); |
| | | JSONObject result2 = (JSONObject) JSON.toJSON(jsonObject.get("result"));*/ |
| | | |
| | | JSONObject jsonObject = JSONObject.parseObject(jsonStr); |
| | | JSONObject result = (JSONObject) JSON.toJSON(jsonObject.get("result")); |
| | | if (Objects.isNull(result)) { |
| | | logger.info("模型结果为空"); |
| | | return; |
| | | } |
| | | |
| | | // 保存报告 |
| | | String analyDate = DateUtils.format(startDate); |
| | | String analyContent = result.getString("steamHomeIndexInfo"); |
| | | String relId = cokingTraceReportService.save(process, reportName, analyDate, analyClass, clock, analyContent); |
| | | |
| | | // 保存一级分析指标 |
| | | saveAnalyInd(relId, process, analyDate, analyClass, analyContent); |
| | | |
| | | // 保存优化建议 |
| | | saveTraceSuggest(relId, process, clock, result); |
| | | |
| | | // 保存偏差值 |
| | | saveTraceDeviation(relId, process, clock, result); |
| | | |
| | | // 保存溯源指标 |
| | | cokingTraceIndService.saveTraceInd(relId, indType, clock); |
| | | |
| | | } catch (Exception ex) { |
| | | logger.error("RunCokingTraceModelGXJTask运行异常"); |
| | | ex.printStackTrace(); |
| | |
| | | |
| | | } |
| | | |
| | | public void saveTraceReport(Map<String, Object> tMap,JSONObject result) { |
| | | CokingTraceReportEntity reportEntity = new CokingTraceReportEntity(); |
| | | reportEntity.setId(tMap.get("relId").toString()); |
| | | reportEntity.setProcess(tMap.get("process").toString()); |
| | | reportEntity.setReportName(tMap.get("reportName").toString()); |
| | | reportEntity.setAnalyDate(tMap.get("analyDate").toString()); |
| | | reportEntity.setAnalyClass(tMap.get("analyClass").toString()); |
| | | reportEntity.setClock(tMap.get("clock").toString()); |
| | | reportEntity.setAnalyContent(tMap.get("analyContent").toString()); |
| | | reportEntity.setCreateDate(new Date()); |
| | | cokingTraceReportService.save(reportEntity); |
| | | } |
| | | |
| | | public void saveTraceSuggest(Map<String, Object> tMap,JSONObject result) { |
| | | for(int i=1;i<=2;i++){ |
| | | String steamTotal = result.get("steamTotal"+i).toString(); |
| | | if(StringUtils.isNotBlank(steamTotal)){ |
| | | CokingTraceSuggestEntity suggestEntity = new CokingTraceSuggestEntity(); |
| | | suggestEntity.setRelId(tMap.get("relId").toString()); |
| | | suggestEntity.setProcess(tMap.get("process").toString()); |
| | | suggestEntity.setSugObj("GXJ"); |
| | | suggestEntity.setClock(tMap.get("clock").toString()); |
| | | suggestEntity.setContent(steamTotal); |
| | | suggestEntity.setCreateDate(new Date()); |
| | | cokingTraceSuggestService.save(suggestEntity); |
| | | } |
| | | public void saveTraceSuggest(String relId, String process, String clock, JSONObject result) { |
| | | List<CokingTraceSuggestEntity> entityList = new ArrayList<>(); |
| | | String steamTotal = result.get("steamTotal1").toString(); |
| | | if(StringUtils.isNotBlank(steamTotal)){ |
| | | CokingTraceSuggestEntity suggestEntity = new CokingTraceSuggestEntity(); |
| | | suggestEntity.setRelId(relId); |
| | | suggestEntity.setProcess(process); |
| | | suggestEntity.setSugObj("GXJ"); |
| | | suggestEntity.setClock(clock); |
| | | suggestEntity.setContent(steamTotal); |
| | | suggestEntity.setCreateDate(new Date()); |
| | | entityList.add(suggestEntity); |
| | | } |
| | | cokingTraceSuggestService.insert(entityList); |
| | | } |
| | | |
| | | public void saveTraceDeviation(Map<String, Object> tMap,JSONObject result) { |
| | | @Transactional |
| | | public void saveTraceDeviation(String relId, String process, String clock, JSONObject result) { |
| | | List<ChartParamDTO> list = mcsApi.getChartParamList(CommonConstant.STEAM_INDEX_CHARTCODE); |
| | | Map<String, String> steamIndexMaps = list.stream().collect(Collectors.toMap(ChartParamDTO::getParamCode, e -> e.getParamName())); |
| | | for(int i=0;i<=5;i++){ |
| | | String steamFirstColoum = result.get("steamFirstColoum"+i).toString(); |
| | | if(StringUtils.isNotBlank(steamFirstColoum)){ |
| | | JSONArray responseArr = JSON.parseArray(steamFirstColoum); |
| | | List<CokingTraceDeviationEntity> entityList = new ArrayList<>(); |
| | | for (int j = 0; j < responseArr.size(); j++) { |
| | | JSONArray element = JSON.parseArray(responseArr.get(j).toString()); |
| | | CokingTraceDeviationEntity deviationEntity = new CokingTraceDeviationEntity(); |
| | | deviationEntity.setRelId(tMap.get("relId").toString()); |
| | | deviationEntity.setProcess(tMap.get("process").toString()); |
| | | deviationEntity.setClock(tMap.get("clock").toString()); |
| | | deviationEntity.setSugObj("GXJ"); |
| | | deviationEntity.setGroupName(steamFirstColoumMap.get("steamFirstColoum"+i).toString()); |
| | | deviationEntity.setIndName(steamIndexMaps.get(element.get(0).toString())); |
| | | deviationEntity.setIndValue(element.get(1).toString()); |
| | | deviationEntity.setCreateDate(new Date()); |
| | | entityList.add(deviationEntity); |
| | | cokingTraceDeviationService.save(entityList); |
| | | } |
| | | |
| | | List<String> coalRowKeys = new ArrayList<>(); |
| | | result.forEach((key, value) -> { |
| | | if (StringUtils.isNotBlank(key) && key.contains(steamRow)) { |
| | | coalRowKeys.add(key); |
| | | } |
| | | } |
| | | for(int i=0;i<=5;i++){ |
| | | String steamSecondColoum = result.get("steamSecondColoum"+i).toString(); |
| | | if(StringUtils.isNotBlank(steamSecondColoum)){ |
| | | JSONArray responseArr = JSON.parseArray(steamSecondColoum); |
| | | List<CokingTraceDeviationEntity> entityList = new ArrayList<>(); |
| | | for (int j = 0; j < responseArr.size(); j++) { |
| | | JSONArray element = JSON.parseArray(responseArr.get(j).toString()); |
| | | CokingTraceDeviationEntity deviationEntity = new CokingTraceDeviationEntity(); |
| | | deviationEntity.setRelId(tMap.get("relId").toString()); |
| | | deviationEntity.setProcess(tMap.get("process").toString()); |
| | | deviationEntity.setClock(tMap.get("clock").toString()); |
| | | deviationEntity.setSugObj("GXJ"); |
| | | deviationEntity.setGroupName(steamSecondColoumMap.get("steamSecondColoum" + i).toString()); |
| | | deviationEntity.setIndName(steamIndexMaps.get(element.get(0).toString())); |
| | | deviationEntity.setIndValue(element.get(1).toString()); |
| | | deviationEntity.setCreateDate(new Date()); |
| | | entityList.add(deviationEntity); |
| | | cokingTraceDeviationService.save(entityList); |
| | | } |
| | | |
| | | }); |
| | | logger.info("coalRowKeys=" + coalRowKeys); |
| | | List<CokingTraceDeviationEntity> entityList = new ArrayList<>(); |
| | | for (String key : coalRowKeys) { |
| | | JSONArray rowArr = JSON.parseArray(result.get(key).toString()); |
| | | if (CollectionUtils.isEmpty(rowArr)) { |
| | | logger.info("rowArr is empty"); |
| | | continue; |
| | | } |
| | | CokingTraceDeviationEntity entity = new CokingTraceDeviationEntity(); |
| | | entity.setRelId(relId); |
| | | entity.setProcess(process); |
| | | entity.setClock(clock); |
| | | entity.setSugObj(SugObj); |
| | | |
| | | entity.setInd1Name(steamIndexMaps.get(new BigDecimal(rowArr.getJSONArray(0).get(0).toString()).setScale(0,BigDecimal.ROUND_HALF_UP).toString())); |
| | | entity.setInd1Value(rowArr.getJSONArray(0).get(1).toString()); |
| | | entity.setInd1Unit(""); |
| | | |
| | | entity.setInd2Name(steamIndexMaps.get(new BigDecimal(rowArr.getJSONArray(1).get(0).toString()).setScale(0,BigDecimal.ROUND_HALF_UP).toString())); |
| | | entity.setInd2Value(rowArr.getJSONArray(1).get(1).toString()); |
| | | entity.setInd2Unit(""); |
| | | |
| | | if (rowArr.size() > 2) { |
| | | entity.setFac1Name(steamIndexMaps.get(new BigDecimal(rowArr.getJSONArray(2).get(0).toString()).setScale(0,BigDecimal.ROUND_HALF_UP).toString())); |
| | | entity.setFac1Value(rowArr.getJSONArray(2).get(1).toString()); |
| | | entity.setFac1Unit(""); |
| | | } |
| | | if (rowArr.size() > 3) { |
| | | entity.setFac2Name(steamIndexMaps.get(new BigDecimal(rowArr.getJSONArray(3).get(0).toString()).setScale(0,BigDecimal.ROUND_HALF_UP).toString())); |
| | | entity.setFac2Value(rowArr.getJSONArray(3).get(1).toString()); |
| | | entity.setFac2Unit(""); |
| | | } |
| | | if (rowArr.size() > 4) { |
| | | entity.setFac3Name(steamIndexMaps.get(new BigDecimal(rowArr.getJSONArray(4).get(0).toString()).setScale(0,BigDecimal.ROUND_HALF_UP).toString())); |
| | | entity.setFac3Value(rowArr.getJSONArray(4).get(1).toString()); |
| | | entity.setFac3Unit(""); |
| | | } |
| | | if (rowArr.size() > 5) { |
| | | entity.setFac4Name(steamIndexMaps.get(new BigDecimal(rowArr.getJSONArray(5).get(0).toString()).setScale(0,BigDecimal.ROUND_HALF_UP).toString())); |
| | | entity.setFac4Value(rowArr.getJSONArray(5).get(1).toString()); |
| | | entity.setFac4Unit(""); |
| | | } |
| | | if (rowArr.size() > 6) { |
| | | entity.setFac5Name(steamIndexMaps.get(new BigDecimal(rowArr.getJSONArray(6).get(0).toString()).setScale(0,BigDecimal.ROUND_HALF_UP).toString())); |
| | | entity.setFac5Value(rowArr.getJSONArray(6).get(1).toString()); |
| | | entity.setFac5Unit(""); |
| | | } |
| | | entityList.add(entity); |
| | | } |
| | | |
| | | cokingTraceDeviationService.save(entityList); |
| | | } |
| | | |
| | | public void saveAnalyInd(Map<String, Object> tMap,JSONObject result) { |
| | | String[] analyContent = tMap.get("analyContent").toString().split(";"); |
| | | List<CokingAnalyIndEntity> entityList = new ArrayList<>(); |
| | | for(int i=0;i<analyContent.length;i++){ |
| | | CokingAnalyIndEntity analyIndEntity = new CokingAnalyIndEntity(); |
| | | analyIndEntity.setRelId(tMap.get("relId").toString()); |
| | | analyIndEntity.setAnalyType(tMap.get("process").toString()); |
| | | analyIndEntity.setAnalyDate(tMap.get("analyDate").toString()); |
| | | analyIndEntity.setAnalyClass(tMap.get("analyClass").toString()); |
| | | analyIndEntity.setAnalyContent(analyContent[i]); |
| | | analyIndEntity.setSort(i+1); |
| | | entityList.add(analyIndEntity); |
| | | cokingAnalyIndService.save(entityList); |
| | | } |
| | | } |
| | | |
| | | public void saveTraceInd(Map<String, Object> tMap,JSONObject result) { |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("indType","干熄焦工序异常溯源"); |
| | | List<CokingTraceConfEntity> list = cokingTraceConfService.list(map); |
| | | if (CollectionUtils.isEmpty(list)) { |
| | | logger.info("ConfLis is Empty"); |
| | | public void saveAnalyInd(String relId, String process, String analyDate, String analyClass, String analyContent) { |
| | | if (StringUtils.isBlank(analyContent)) { |
| | | logger.info("analyContent is null"); |
| | | return; |
| | | } |
| | | List<CokingTraceIndEntity> entityList = new ArrayList<>(); |
| | | for (CokingTraceConfEntity conf : list) { |
| | | if (StringUtils.isBlank(conf.getDataType())) { |
| | | logger.info("DataType is Empty"); |
| | | continue; |
| | | } |
| | | if (StringUtils.isBlank(conf.getPointNo())) { |
| | | logger.info("PointNo is Empty"); |
| | | continue; |
| | | } |
| | | String value = ""; |
| | | switch (ProcessConfDataTypeEnum.getEumByCode(conf.getDataType())) { |
| | | case DATAPOINT: |
| | | List<String> points = new ArrayList<>(); |
| | | points.add(conf.getPointNo()); |
| | | Map<String, Object> pointsRealValue = dataPointApi.queryPointsRealValue(points); |
| | | value = pointsRealValue.get(conf.getPointNo()).toString(); |
| | | break; |
| | | case IND: |
| | | List<ApiIndItemValueDTO> indValues = indItemApi.queryIndItemDefaultValue(conf.getPointNo()); |
| | | if (!CollectionUtils.isEmpty(indValues)) { |
| | | value = indValues.get(indValues.size() - 1).getDataValue().toString(); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | |
| | | } |
| | | CokingTraceIndEntity cokingTraceIndEntity = new CokingTraceIndEntity(); |
| | | cokingTraceIndEntity.setRelId(tMap.get("relId").toString()); |
| | | cokingTraceIndEntity.setTitle(conf.getIndType()); |
| | | cokingTraceIndEntity.setClock(tMap.get("clock").toString()); |
| | | cokingTraceIndEntity.setIndCode(conf.getIndCode()); |
| | | cokingTraceIndEntity.setIndName(conf.getIndName()); |
| | | cokingTraceIndEntity.setIndValue(value); |
| | | cokingTraceIndEntity.setIndUnit(conf.getIndUnit()); |
| | | entityList.add(cokingTraceIndEntity); |
| | | cokingTraceIndService.save(entityList); |
| | | |
| | | String[] analyContentArr = analyContent.split(";"); |
| | | List<CokingAnalyIndEntity> entityList = new ArrayList<>(); |
| | | for(int i=0;i<analyContentArr.length;i++){ |
| | | CokingAnalyIndEntity analyIndEntity = new CokingAnalyIndEntity(); |
| | | analyIndEntity.setRelId(relId); |
| | | analyIndEntity.setAnalyType(process); |
| | | analyIndEntity.setAnalyDate(analyDate); |
| | | analyIndEntity.setAnalyClass(analyClass); |
| | | analyIndEntity.setAnalyContent(analyContentArr[i]); |
| | | analyIndEntity.setSort(i+1); |
| | | entityList.add(analyIndEntity); |
| | | } |
| | | // 清理旧数据 |
| | | cokingAnalyIndService.delete(process, analyDate, analyClass); |
| | | cokingAnalyIndService.save(entityList); |
| | | } |
| | | } |