| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.jws.WebService; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public String equipmentDaySchedule(String msg) { |
| | | log.info("MES上报日计划原始数据 === {}", msg); |
| | | EquipmentDaySchedule equipmentDaySchedule = JSONObject.parseObject(msg, EquipmentDaySchedule.class); |
| | | MdcEquipmentDaySchedule mdcEquipmentDaySchedule = new MdcEquipmentDaySchedule(); |
| | | BeanUtils.copyProperties(equipmentDaySchedule, mdcEquipmentDaySchedule); |
| | | mdcEquipmentDayScheduleService.save(mdcEquipmentDaySchedule); |
| | | List<EquipmentDaySchedule> equipmentDayScheduleList = JSONObject.parseArray(msg, EquipmentDaySchedule.class); |
| | | if (equipmentDayScheduleList == null || equipmentDayScheduleList.isEmpty()) { |
| | | WsResult wsResult = new WsResult("0", "json解析失败"); |
| | | return JSONObject.toJSONString(wsResult); |
| | | } |
| | | List<MdcEquipmentDaySchedule> mdcEquipmentDayScheduleList = new ArrayList<>(); |
| | | for (EquipmentDaySchedule equipmentDaySchedule : equipmentDayScheduleList) { |
| | | MdcEquipmentDaySchedule mdcEquipmentDaySchedule = new MdcEquipmentDaySchedule(); |
| | | BeanUtils.copyProperties(equipmentDaySchedule, mdcEquipmentDaySchedule); |
| | | mdcEquipmentDayScheduleList.add(mdcEquipmentDaySchedule); |
| | | } |
| | | mdcEquipmentDayScheduleService.saveBatch(mdcEquipmentDayScheduleList); |
| | | |
| | | log.info("MES上报日计划数据成功!"); |
| | | WsResult wsResult = new WsResult("1", "成功"); |
| | |
| | | @Override |
| | | public String equipmentDaySummary(String msg) { |
| | | log.info("MES上报日汇总原始数据 === {}", msg); |
| | | EquipmentDaySummary equipmentDaySummary = JSONObject.parseObject(msg, EquipmentDaySummary.class); |
| | | MdcEquipmentDaySummary mdcEquipmentDaySummary = new MdcEquipmentDaySummary(); |
| | | BeanUtils.copyProperties(equipmentDaySummary, mdcEquipmentDaySummary); |
| | | mdcEquipmentDaySummaryService.save(mdcEquipmentDaySummary); |
| | | |
| | | List<EquipmentDaySummary> equipmentDaySummaryList = JSONObject.parseArray(msg, EquipmentDaySummary.class); |
| | | if (equipmentDaySummaryList == null || equipmentDaySummaryList.isEmpty()) { |
| | | WsResult wsResult = new WsResult("0", "json解析失败"); |
| | | return JSONObject.toJSONString(wsResult); |
| | | } |
| | | List<MdcEquipmentDaySummary> mdcEquipmentDaySummaryList = new ArrayList<>(); |
| | | for (EquipmentDaySummary equipmentDaySummary : equipmentDaySummaryList) { |
| | | MdcEquipmentDaySummary mdcEquipmentDaySummary = new MdcEquipmentDaySummary(); |
| | | BeanUtils.copyProperties(equipmentDaySummary, mdcEquipmentDaySummary); |
| | | mdcEquipmentDaySummaryList.add(mdcEquipmentDaySummary); |
| | | } |
| | | mdcEquipmentDaySummaryService.saveBatch(mdcEquipmentDaySummaryList); |
| | | log.info("MES上报日汇总数据成功!"); |
| | | WsResult wsResult = new WsResult("1", "成功"); |
| | | return JSONObject.toJSONString(wsResult); |