| | |
| | | package com.zy.core.netty.handle; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.FireLog; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.service.FireLogService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.impl.MainServiceImpl; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.core.netty.AbstractInboundHandler; |
| | | import com.zy.core.netty.cache.ChannelCache; |
| | | import com.zy.core.netty.constant.Constant; |
| | |
| | | String fireNo = fire3030.getNo().toString() + fire3030.getLoop().toString() + fire3030.getPartNo().toString(); |
| | | String fireTime = "20" + fire3030.getYear() + "-" + fire3030.getMonth() + "-" + fire3030.getDay() |
| | | + " " + fire3030.getHour() + ":" + fire3030.getMinute() + ":" + fire3030.getSeconds(); |
| | | |
| | | Date dt = DateUtils.convert(fireTime); |
| | | LocMastService locMastService = SpringUtils.getBean(LocMastService.class); |
| | | if(null != locMastService){ |
| | | //报警信号更新到库存主档 fire_status字段 |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("fire_no",fireNo)); |
| | | if(null != locMast){ |
| | | locMast.setFireStatus(1); |
| | | locMast.setModiTime(new Date()); |
| | | locMastService.update(locMast, new EntityWrapper<LocMast>().eq("fire_no",fireNo)); |
| | | if(locMast.getFireStatus() != 1) { |
| | | locMast.setFireStatus(1); |
| | | locMast.setModiTime(new Date()); |
| | | locMastService.update(locMast, new EntityWrapper<LocMast>().eq("fire_no", fireNo)); |
| | | } |
| | | |
| | | //插入报警日志记录,同一库位同一报警只插入一次 |
| | | FireLogService fireLogService = SpringUtils.getBean(FireLogService.class); |
| | | if(null != fireLogService){ |
| | | String ymd = "20" + fire3030.getYear() + "" + fire3030.getMonth() + "" + fire3030.getDay(); |
| | | FireLog one = fireLogService.selectOne(new EntityWrapper<FireLog>() |
| | | .eq("ymd",ymd) |
| | | .eq("fire_no",fireNo)); |
| | | if(null == one) { |
| | | FireLog fireLog = new FireLog(); |
| | | fireLog.setYmd(ymd); |
| | | fireLog.setFireNo(fireNo); |
| | | fireLog.setFireTime(dt); |
| | | fireLog.setLocNo(locMast.getLocNo()); |
| | | fireLog.setCreateTime(new Date()); |
| | | fireLogService.insert(fireLog); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | break; |