Browse Source

三色灯停机修改

master
shenzhouyu 1 month ago
parent
commit
9abb22370e
  1. 2
      threecolor-modbus-collector/src/main/java/com/xujie/modbus/mapper/ThreeColorLampMapper.java
  2. 5
      threecolor-modbus-collector/src/main/java/com/xujie/modbus/service/impl/ModbusCollectServiceImpl.java
  3. 4
      threecolor-modbus-collector/src/main/resources/dao/ThreeColorLampMapper.xml

2
threecolor-modbus-collector/src/main/java/com/xujie/modbus/mapper/ThreeColorLampMapper.java

@ -17,4 +17,6 @@ public interface ThreeColorLampMapper extends BaseMapper<ThreeColorLamp> {
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);
}

5
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);

4
threecolor-modbus-collector/src/main/resources/dao/ThreeColorLampMapper.xml

@ -52,4 +52,8 @@
site = #{site} and equipment_no = #{equipmentNo}
ORDER BY create_date DESC
</select>
<select id="selectHistSeqno" resultType="int">
SELECT MAX(sth.hist_seqno) FROM sfdc_time_hist sth
WHERE sth.site = #{site} AND sth.seq_no = #{seqNo}
</select>
</mapper>
Loading…
Cancel
Save