diff --git a/threecolor-modbus-collector/src/main/java/com/xujie/modbus/mapper/ThreeColorLampMapper.java b/threecolor-modbus-collector/src/main/java/com/xujie/modbus/mapper/ThreeColorLampMapper.java index 65bb6a7..1b9f1a8 100644 --- a/threecolor-modbus-collector/src/main/java/com/xujie/modbus/mapper/ThreeColorLampMapper.java +++ b/threecolor-modbus-collector/src/main/java/com/xujie/modbus/mapper/ThreeColorLampMapper.java @@ -17,4 +17,6 @@ public interface ThreeColorLampMapper extends BaseMapper { SoscheduledroutingVo getSoscheduled(@Param("seqno") String seqno); ThreeColorLamp selectThreeColorLastByResourceId(@Param("site") String site,@Param("equipmentNo") String equipmentNo); + + int selectHistSeqno(@Param("site") String site,@Param("seqNo") String seqNo); } diff --git a/threecolor-modbus-collector/src/main/java/com/xujie/modbus/service/impl/ModbusCollectServiceImpl.java b/threecolor-modbus-collector/src/main/java/com/xujie/modbus/service/impl/ModbusCollectServiceImpl.java index 19fa345..c275642 100644 --- a/threecolor-modbus-collector/src/main/java/com/xujie/modbus/service/impl/ModbusCollectServiceImpl.java +++ b/threecolor-modbus-collector/src/main/java/com/xujie/modbus/service/impl/ModbusCollectServiceImpl.java @@ -270,14 +270,15 @@ public class ModbusCollectServiceImpl } if (red){ - if(!"X".equals(resourceScheduled.getStatus())){ + if(!"X".equals(resourceScheduled.getIssend())){ SoscheduledroutingVo soscheduled = threeColorLampMapper.getSoscheduled(resourceScheduled.getSeqNo()); + int histSeqno = threeColorLampMapper.selectHistSeqno(folderLocation.getSite(), resourceScheduled.getSeqNo()); SfdcTimeHist sfdcTimeHist = new SfdcTimeHist(); sfdcTimeHist.setSite(folderLocation.getSite()); sfdcTimeHist.setOrderNo(soscheduled.getOrderno()); sfdcTimeHist.setItemNo(Double.valueOf(soscheduled.getItemno())); sfdcTimeHist.setSeqNo(soscheduled.getSeqno()); - sfdcTimeHist.setHistSeqno(null); + sfdcTimeHist.setHistSeqno(histSeqno+1); sfdcTimeHist.setEventTime(new Date()); sfdcTimeHist.setEnteredBy(null); sfdcTimeHist.setEventDesc(null); diff --git a/threecolor-modbus-collector/src/main/resources/dao/ThreeColorLampMapper.xml b/threecolor-modbus-collector/src/main/resources/dao/ThreeColorLampMapper.xml index da3f3cd..be3ab0f 100644 --- a/threecolor-modbus-collector/src/main/resources/dao/ThreeColorLampMapper.xml +++ b/threecolor-modbus-collector/src/main/resources/dao/ThreeColorLampMapper.xml @@ -52,4 +52,8 @@ site = #{site} and equipment_no = #{equipmentNo} ORDER BY create_date DESC + \ No newline at end of file