| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class BasErrLogController extends BaseController { |
| | |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<BasErrLog> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){ |
| | | wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | } else { |
| | | wrapper.orderBy("CREATE_TIME", false); |
| | | } |
| | | try{ |
| | | Integer wrkNo = null; |
| | | Integer crnNo = null; |
| | | Integer plcNo = null; |
| | | Integer status = null; |
| | | String memo = null; |
| | | Date modiTimeStart = null, modiTimeEnd = null; |
| | | for (Map.Entry<String, Object> entry : param.entrySet()) { |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (Cools.isEmpty(val)) { |
| | | continue; |
| | | } |
| | | if (val.contains(RANGE_TIME_LINK)) { |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | modiTimeStart = DateUtils.convert(dates[0]); |
| | | modiTimeEnd = DateUtils.convert(dates[1]); |
| | | } else if (entry.getKey().equals("wrk_no")) { |
| | | wrkNo = Integer.parseInt(val); |
| | | } else if (entry.getKey().equals("crn_no")) { |
| | | crnNo = Integer.parseInt(val); |
| | | } else if (entry.getKey().equals("plc_no")) { |
| | | plcNo = Integer.parseInt(val); |
| | | } else if (entry.getKey().equals("status")) { |
| | | status = Integer.parseInt(val); |
| | | } else if (entry.getKey().equals("condition")) { |
| | | memo = val; |
| | | } |
| | | } |
| | | |
| | | List<BasErrLog> basErrLogList = basErrLogService.selectList(wrapper); |
| | | Page<BasErrLog> page = new Page<BasErrLog>(0, 10).setRecords(basErrLogList); |
| | | page.setTotal(basErrLogList.size()); |
| | | return R.ok(page); |
| | | // EntityWrapper<BasErrLog> wrapper = new EntityWrapper<>(); |
| | | // excludeTrash(param); |
| | | // convert(param, wrapper); |
| | | // if (!Cools.isEmpty(orderByField)){ |
| | | // wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | // } else { |
| | | // wrapper.orderBy("CREATE_TIME", false); |
| | | // } |
| | | |
| | | List<BasErrLog> basErrLogList = basErrLogService.selectBasErrLogList(wrkNo,crnNo,plcNo,status,memo,modiTimeStart,modiTimeEnd,curr,limit); |
| | | Page<BasErrLog> page = new Page<BasErrLog>(curr, limit).setRecords(basErrLogList); |
| | | page.setTotal(basErrLogService.selectBasErrLogListTotal(wrkNo,crnNo,plcNo,status,memo,modiTimeStart,modiTimeEnd)); |
| | | return R.ok(page); |
| | | } catch (Exception e) { |
| | | return R.error("查询失败,请检查参数:"+e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | |
| | | |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("wms/taskCreate", 1, "wms任务下发,params:"+JSON.toJSONString(params)); |
| | | deviceErrorService.addDeviceError("wms/taskCreate", 1, "wms任务下发,任务数:"+params.size()); |
| | | } catch (Exception e2){ |
| | | // log.error("e2:"+e2.getMessage()); |
| | | } |
| | |
| | | if (Cools.isEmpty(param)){ |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("wmsErr", 1, "参数为空,params:"+JSON.toJSONString(params)); |
| | | deviceErrorService.addDeviceError("wmsErr", 1, "参数为空,param:"+JSON.toJSONString(param)); |
| | | } catch (Exception e2){ |
| | | // log.error("e2:"+e2.getMessage()); |
| | | } |
| | |
| | | status = Integer.parseInt(val); |
| | | } |
| | | } |
| | | |
| | | EntityWrapper<TaskWrk> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | // |
| | | // EntityWrapper<TaskWrk> wrapper = new EntityWrapper<>(); |
| | | // excludeTrash(param); |
| | | // convert(param, wrapper); |
| | | // if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | |
| | | List<TaskWrk> taskWrkList = taskWrkService.selectTaskWrkList(wrkNo,taskNo,status,modiTimeStart,modiTimeEnd, curr, limit); |
| | | Page<TaskWrk> page = new Page<TaskWrk>(curr, limit).setRecords(taskWrkList); |
| | |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.BasWrkIotypeService; |
| | | import com.zy.asrs.service.BasWrkStatusService; |
| | | import com.zy.core.model.command.CrnCommand; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | this.memo = memo; |
| | | } |
| | | |
| | | |
| | | public BasErrLog(CrnCommand command,String error,String memo) { |
| | | Date now = new Date(); |
| | | this.uuid = now.toString(); |
| | | this.wrkNo = command.getTaskNo().intValue(); |
| | | this.startTime = now; |
| | | this.endTime = now; |
| | | this.wrkSts = 0L; |
| | | this.ioType = 0; |
| | | this.crnNo = command.getLaneNo(); |
| | | this.plcNo = command.getCrnNo(); |
| | | this.locNo = command.getSourcePosX()+"排"+command.getSourcePosY()+"列"+command.getSourcePosZ()+"层"; |
| | | this.staNo = 0; |
| | | this.sourceStaNo = 0; |
| | | this.sourceLocNo = command.getDestinationPosX()+"排"+command.getDestinationPosY()+"列"+command.getDestinationPosY()+"层"; |
| | | this.barcode = ""; |
| | | this.errCode = 0; |
| | | this.error = error; |
| | | this.status = 0; |
| | | this.createTime = now; |
| | | this.createBy = null; |
| | | this.updateTime = now; |
| | | this.updateBy = null; |
| | | this.memo = memo; |
| | | } |
| | | |
| | | // BasErrLog basErrLog = new BasErrLog( |
| | | // null, // 编号 |
| | | // null, // 工作号 |
| | |
| | | import com.zy.asrs.entity.BasErrLog; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface BasErrLogMapper extends BaseMapper<BasErrLog> { |
| | | |
| | | List<BasErrLog> selectBasErrLogList(@Param("taskNo") Integer taskNo, |
| | | @Param("crnNo") Integer crnNo, |
| | | @Param("plcNo") Integer plcNo, |
| | | @Param("status") Integer status, |
| | | @Param("memo") String memo, |
| | | @Param("modiTimeStart") Date modiTimeStart, |
| | | @Param("modiTimeEnd") Date modiTimeEnd, |
| | | @Param("pageNumber") Integer curr, |
| | | @Param("pageSize") Integer limit); |
| | | |
| | | Long selectBasErrLogListTotal(@Param("taskNo") Integer taskNo, |
| | | @Param("crnNo") Integer crnNo, |
| | | @Param("plcNo") Integer plcNo, |
| | | @Param("status") Integer status, |
| | | @Param("memo") String memo, |
| | | @Param("modiTimeStart") Date modiTimeStart, |
| | | @Param("modiTimeEnd") Date modiTimeEnd); |
| | | |
| | | } |
| | |
| | | import com.zy.asrs.entity.BasErrLog; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface BasErrLogService extends IService<BasErrLog> { |
| | | |
| | | BasErrLog findLatestByTaskNo(Integer crnNo, Integer taskNo); |
| | | |
| | | BasErrLog findLatest(Integer crnNo); |
| | | |
| | | List<BasErrLog> selectBasErrLogList(Integer taskNo, Integer crnNo, Integer plcNo, Integer status,String memo, Date modiTimeStart, Date modiTimeEnd, Integer curr, Integer limit); |
| | | Long selectBasErrLogListTotal(Integer taskNo, Integer crnNo, Integer plcNo, Integer status,String memo,Date modiTimeStart,Date modiTimeEnd); |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service("basErrLogService") |
| | |
| | | return basErrLogs.get(0); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<BasErrLog> selectBasErrLogList(Integer taskNo, Integer crnNo, Integer plcNo, Integer status,String memo,Date modiTimeStart,Date modiTimeEnd, Integer curr, Integer limit) { |
| | | return this.baseMapper.selectBasErrLogList(taskNo,crnNo,plcNo, status,memo,modiTimeStart,modiTimeEnd,curr,limit); |
| | | } |
| | | |
| | | @Override |
| | | public Long selectBasErrLogListTotal(Integer taskNo, Integer crnNo, Integer plcNo, Integer status,String memo,Date modiTimeStart,Date modiTimeEnd) { |
| | | return this.baseMapper.selectBasErrLogListTotal(taskNo,crnNo,plcNo, status,memo,modiTimeStart,modiTimeEnd); |
| | | } |
| | | } |
| | |
| | | null, // 结束时间 |
| | | taskWrk.getWrkSts().longValue(), // 工作状态 |
| | | taskWrk.getIoType(), // 入出库类型 |
| | | crn.getId(), // 堆垛机 |
| | | null, // plc |
| | | taskWrk.getCrnNo(), // 巷道号 |
| | | crn.getId(), // 堆垛机号 |
| | | taskWrk.getTargetPoint(), // 目标库位 |
| | | 0, // 目标站 |
| | | 0, // 源站 |
| | |
| | | log.error("任务生成失败===》异常信息:{}", e.getMessage()); |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("rgvErr", rgvSlave.getId(), "指令生成失败:异常信息"+e.getMessage()); |
| | | deviceErrorService.addDeviceError("rgvErr", rgvSlave.getId(), "指令生成失败"); |
| | | } catch (Exception e2){ |
| | | } |
| | | } |
| | |
| | | |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("rgvErr", rgvSlave.getId(), "任务生成失败issued1:异常信息"+e.getMessage()); |
| | | deviceErrorService.addDeviceError("rgvErr", rgvSlave.getId(), "任务生成失败issued1"); |
| | | } catch (Exception e2){ |
| | | } |
| | | return false; |
| | |
| | | |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("rgvErr", rgvSlave.getId(), "站点任务生成失败issued2:异常信息"+e.getMessage()); |
| | | deviceErrorService.addDeviceError("rgvErr", rgvSlave.getId(), "站点任务生成失败issued2"); |
| | | } catch (Exception e2){ |
| | | } |
| | | } |
| | |
| | | System.out.println("礼拜"); |
| | | System.out.println(mm); |
| | | } |
| | | |
| | | public String getNowTask() { |
| | | String souLoc = this.getSourcePosX() + "排" + this.getSourcePosY() + "列" + this.getSourcePosZ() + "层"; |
| | | String endLoc = this.getDestinationPosX() + "排" + this.getDestinationPosY() + "列" + this.getDestinationPosY() + "层"; |
| | | |
| | | return "任务号:"+this.taskNo+";起点:"+souLoc+";终点:"+endLoc+";模式:"+this.taskModeType.name(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.BasCrnOpt; |
| | | import com.zy.asrs.entity.BasCrnp; |
| | | import com.zy.asrs.entity.BasErrLog; |
| | | import com.zy.asrs.service.BasCrnOptService; |
| | | import com.zy.asrs.service.BasCrnpService; |
| | | import com.zy.asrs.service.BasErrLogService; |
| | | import com.zy.asrs.service.DeviceErrorService; |
| | | import com.zy.core.CrnThread; |
| | | import com.zy.core.cache.CrnErrCache; |
| | |
| | | return false; |
| | | } |
| | | CrnErrCache.updateCrnErr(slave.getId(), "-"); |
| | | |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("crnWrite", slave.getId(), "巷道号"+command.getLaneNo()+";堆垛机指令下发:"+JSON.toJSONString(command.getNowTask())); |
| | | } catch (Exception e2){ |
| | | } |
| | | try{ |
| | | BasErrLogService basErrLogService = SpringUtils.getBean(BasErrLogService.class); |
| | | BasErrLog basErrLog = new BasErrLog(command,"","非异常,任务下发记录"); |
| | | if (!basErrLogService.insert(basErrLog)) { |
| | | log.error("堆垛机plc异常记录失败 ===>> [id:{}] [error:{}]", slave.getId(), "任务下发记录失败"); |
| | | } |
| | | } catch (Exception e3){ |
| | | } |
| | | // convertRow(command); |
| | | command.setCrnNo(slave.getId()); |
| | | short[] array = new short[10]; |
| | |
| | | CrnErrCache.updateCrnErr(slave.getId(), "堆垛机命令地址写入后回读失败"); |
| | | |
| | | log.error("堆垛机命令地址写入后回读失败[id:{}]>>>>重写[{}] >>>>> 写入[{}],===>>回读[{}]", slave.getId(), i,JSON.toJSON(command),JSON.toJSON(one)); |
| | | |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("crnErr", slave.getId(), "巷道号"+command.getLaneNo()+";写入次数"+i+";堆垛机命令地址写入后回读失败:"+JSON.toJSONString(command.getNowTask())); |
| | | } catch (Exception e2){ |
| | | } |
| | | try{ |
| | | BasErrLogService basErrLogService = SpringUtils.getBean(BasErrLogService.class); |
| | | BasErrLog basErrLog = new BasErrLog(command,"堆垛机命令地址写入后回读失败",""); |
| | | if (!basErrLogService.insert(basErrLog)) { |
| | | log.error("堆垛机plc异常记录失败 ===>> [id:{}] [error:{}]", slave.getId(), "堆垛机命令地址写入后回读失败记录失败"); |
| | | } |
| | | } catch (Exception e3){ |
| | | } |
| | | result = siemensNet.Write("DB100.0", array); |
| | | }else{ |
| | | break; |
| | |
| | | log.info("下发DB100.18 回读失败" + "commandFinish:"+commandFinish); |
| | | log.info("下发DB100.18 回读失败" + "array:"+ JSON.toJSONString(array)); |
| | | CrnErrCache.updateCrnErr(slave.getId(), "下发DB100.18 回读失败"); |
| | | |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("crnErr", slave.getId(), "巷道号"+command.getLaneNo()+";写入次数"+signFinish+";下发DB100.18 回读失败:"+JSON.toJSONString(command.getNowTask())); |
| | | } catch (Exception e2){ |
| | | } |
| | | try{ |
| | | BasErrLogService basErrLogService = SpringUtils.getBean(BasErrLogService.class); |
| | | BasErrLog basErrLog = new BasErrLog(command,"下发DB100.18 回读失败",""); |
| | | if (!basErrLogService.insert(basErrLog)) { |
| | | log.error("堆垛机plc异常记录失败 ===>> [id:{}] [error:{}]", slave.getId(), "下发DB100.18 回读失败记录失败"); |
| | | } |
| | | } catch (Exception e3){ |
| | | } |
| | | result = siemensNet.Write("DB100.18", commandFinish); |
| | | signFinish++; |
| | | }else { |
| | |
| | | |
| | | } catch (Exception e) { |
| | | connectDev = false; |
| | | log.error("RGV数据读取线程异常!!! ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort()); |
| | | log.error("dev数据读取线程异常!!! ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort()); |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("rgvErr", slave.getId(), "RGV数据读取线程异常"+e.getMessage()); |
| | | deviceErrorService.addDeviceError("devErr", slave.getId(), "dev数据读取线程异常"+e.getMessage()); |
| | | } catch (Exception e2){ |
| | | // log.error("e2:"+e2.getMessage()); |
| | | } |
| | |
| | | log.error("更新数据库数据失败 ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot()); |
| | | } |
| | | |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.deleteDeviceError("devp", slave.getId()); |
| | | } catch (Exception e){ |
| | | // log.error("e:"+e.getMessage()); |
| | | } |
| | | // try{ |
| | | // DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | // deviceErrorService.deleteDeviceError("devp", slave.getId()); |
| | | // } catch (Exception e){ |
| | | //// log.error("e:"+e.getMessage()); |
| | | // } |
| | | } else { |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】读取输送线plc状态信息失败 ===>> [id:{1}] [ip:{2}] [port:{3}] [rack:{4}] [slot:{5}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot())); |
| | | // log.error("读取输送线plc状态信息失败 ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot()); |
| | |
| | | ArrayList<Integer> staNos = getStaNo(); |
| | | |
| | | int index = staNos.indexOf(staProtocol.getSiteId()); |
| | | |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("devWrite", staProtocol.getSiteId(), "单站点写入:任务号:"+staProtocol.getWorkNo()+";目标站:"+staProtocol.getStaNo()); |
| | | } catch (Exception e2){ |
| | | } |
| | | |
| | | // //更新命令日志 |
| | | // CommandInfoLogService commandInfoLogService = SpringUtils.getBean(CommandInfoLogService.class); |
| | |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线命令后返回成功,但是读取任务值不一致。输送线plc编号={1},站点数据={2},写入次数={3}", |
| | | slave.getId(), JSON.toJSON(staProtocol),writeCount)); |
| | | log.error("写入输送线命令后返回成功,但是读取任务值不一致。输送线plc编号={},{},写入次数={}", slave.getId(), JSON.toJSON(staProtocol), writeCount); |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("devErr", staProtocol.getSiteId(), "写入次数"+writeCount+"写入后读取任务值不一致:"+"单站点写入:任务号:"+staProtocol.getWorkNo()+";目标站:"+staProtocol.getStaNo()); |
| | | } catch (Exception e2){ |
| | | } |
| | | } |
| | | } else { |
| | | writeCount++; |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线命令后读取失败。输送线plc编号={1},站点数据={2},写入次数={3}", |
| | | slave.getId(), JSON.toJSON(staProtocol), writeCount)); |
| | | log.error("写入输送线命令后读取失败。输送线plc编号={},站点数据={},写入次数={}", slave.getId(), JSON.toJSON(staProtocol), writeCount); |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("devErr", staProtocol.getSiteId(), "写入次数"+writeCount+"写入输送线命令后读取失败:"+"单站点写入:任务号:"+staProtocol.getWorkNo()+";目标站:"+staProtocol.getStaNo()); |
| | | } catch (Exception e2){ |
| | | } |
| | | } |
| | | } else { |
| | | writeCount++; |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线命令失败。输送线plc编号={1},站点数据={2},写入次数={3}", |
| | | slave.getId(), JSON.toJSON(staProtocol),writeCount)); |
| | | log.error("写入输送线命令失败。输送线plc编号={},站点数据={},写入次数={}", slave.getId(), JSON.toJSON(staProtocol), writeCount); |
| | | |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("devErr", staProtocol.getSiteId(), "写入次数"+writeCount+"写入输送线命令失败:"+"单站点写入:任务号:"+staProtocol.getWorkNo()+";目标站:"+staProtocol.getStaNo()); |
| | | } catch (Exception e2){ |
| | | } |
| | | //更新指令日志 |
| | | // commandInfoLog.setDeviceLog("指令下发失败"); |
| | | // commandInfoLogService.insert(commandInfoLog); |
| | |
| | | } |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线命令尝试5次失败。输送线plc编号={1},站点数据={2}", slave.getId(), JSON.toJSON(staProtocol))); |
| | | log.error("写入输送线命令尝试5次失败。输送线plc编号={},站点数据={}", slave.getId(), JSON.toJSON(staProtocol)); |
| | | |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("devErr", staProtocol.getSiteId(), "写入次数"+writeCount+"写入输送线命令尝试5次失败:"+"单站点写入:任务号:"+staProtocol.getWorkNo()+";目标站:"+staProtocol.getStaNo()); |
| | | } catch (Exception e2){ |
| | | } |
| | | //重新添加数据到任务队列 |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, slave.getId(), new Task(2, staProtocol)); |
| | | read();//读取1次设备状态 |
| | |
| | | //加载证书 |
| | | public boolean loadLicense() { |
| | | if(!Cools.isEmpty(licensePath)){ |
| | | logger.info("++++++++ 开始加载许可证 ++++++++"); |
| | | // logger.info("++++++++ 开始加载许可证 ++++++++"); |
| | | if (true){ |
| | | |
| | | logger.info("++++++++ 许可证加载结束 ++++++++"); |
| | | // logger.info("++++++++ 许可证加载结束 ++++++++"); |
| | | |
| | | return true; |
| | | } |
| | |
| | | //安装证书 |
| | | LicenseContent install = licenseVerify.install(param); |
| | | |
| | | logger.info("++++++++ 许可证加载结束 ++++++++"); |
| | | // logger.info("++++++++ 许可证加载结束 ++++++++"); |
| | | |
| | | return install != null; |
| | | } catch (Exception e) { |
| | |
| | | licenseManager.uninstall(); |
| | | |
| | | result = licenseManager.install(new File(param.getLicensePath())); |
| | | logger.info(MessageFormat.format("许可证加载成功,许可证有效期:{0} - {1}",format.format(result.getNotBefore()),format.format(result.getNotAfter()))); |
| | | // logger.info(MessageFormat.format("许可证加载成功,许可证有效期:{0} - {1}",format.format(result.getNotBefore()),format.format(result.getNotAfter()))); |
| | | }catch (Exception e){ |
| | | logger.error("许可证加载失败!",e); |
| | | } |
| | |
| | | } |
| | | |
| | | LicenseContent licenseContent = licenseManager.verify(); |
| | | logger.info(MessageFormat.format("许可证校验通过,许可证有效期:{0} - {1}",format.format(licenseContent.getNotBefore()),format.format(licenseContent.getNotAfter()))); |
| | | // logger.info(MessageFormat.format("许可证校验通过,许可证有效期:{0} - {1}",format.format(licenseContent.getNotBefore()),format.format(licenseContent.getNotAfter()))); |
| | | return true; |
| | | }catch (Exception e){ |
| | | logger.error("许可证校验失败!",e); |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zy.asrs.mapper.BasErrLogMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.BasErrLog"> |
| | | <id column="ID" property="id" /> |
| | | <result column="UUID" property="uuid" /> |
| | | <result column="WRK_NO" property="wrkNo" /> |
| | | <result column="START_TIME" property="startTime" /> |
| | | <result column="END_TIME" property="endTime" /> |
| | | <result column="WRK_STS" property="wrkSts" /> |
| | | <result column="IO_TYPE" property="ioType" /> |
| | | <result column="CRN_NO" property="crnNo" /> |
| | | <result column="PLC_NO" property="plcNo" /> |
| | | <result column="LOC_NO" property="locNo" /> |
| | | <result column="STA_NO" property="staNo" /> |
| | | <result column="SOURCE_STA_NO" property="sourceStaNo" /> |
| | | <result column="SOURCE_LOC_NO" property="sourceLocNo" /> |
| | | <result column="BARCODE" property="barcode" /> |
| | | <result column="ERR_CODE" property="errCode" /> |
| | | <result column="ERROR" property="error" /> |
| | | <result column="STATUS" property="status" /> |
| | | <result column="CREATE_TIME" property="createTime" /> |
| | | <result column="CREATE_BY" property="createBy" /> |
| | | <result column="UPDATE_TIME" property="updateTime" /> |
| | | <result column="UPDATE_BY" property="updateBy" /> |
| | | <result column="MEMO" property="memo" /> |
| | | |
| | | </resultMap> |
| | | |
| | | <sql id="batchSeq"> |
| | | <if test="taskNo != null"> |
| | | and WRK_NO = #{taskNo} |
| | | </if> |
| | | <if test="crnNo != null"> |
| | | and CRN_NO = #{crnNo} |
| | | </if> |
| | | <if test="plcNo != null"> |
| | | and PLC_NO = #{plcNo} |
| | | </if> |
| | | <if test="status != null"> |
| | | and STATUS = #{status} |
| | | </if> |
| | | <if test="memo != null"> |
| | | and MEMO = #{memo} |
| | | </if> |
| | | <if test="modiTimeStart != null "> |
| | | <if test="modiTimeEnd != null "> |
| | | and START_TIME between #{modiTimeStart} and #{modiTimeEnd} |
| | | </if> |
| | | </if> |
| | | </sql> |
| | | |
| | | <select id="selectBasErrLogList" resultMap="BaseResultMap"> |
| | | SELECT * FROM "SOURCE"."asr_bas_err_log" |
| | | WHERE 1=1 |
| | | <include refid="batchSeq"></include> |
| | | ORDER BY CREATE_TIME DESC |
| | | LIMIT #{pageSize} OFFSET ((#{pageNumber} - 1) * #{pageSize}); |
| | | </select> |
| | | |
| | | <select id="selectBasErrLogListTotal" resultType="Long"> |
| | | SELECT count(1) FROM "SOURCE"."asr_bas_err_log" |
| | | WHERE 1=1 |
| | | <include refid="batchSeq"></include> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | {type: 'checkbox'} |
| | | // ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} |
| | | ,{field: 'uuid', align: 'center',title: '编号', hide: true} |
| | | ,{field: 'wrkNo', align: 'center',title: '任务号'} |
| | | ,{field: 'startTime$', align: 'center',title: '发生时间'} |
| | | ,{field: 'endTime$', align: 'center',title: '结束时间'} |
| | | ,{field: 'wrkSts$', align: 'center',title: '任务状态'} |
| | | ,{field: 'ioType$', align: 'center',title: '入出库类型'} |
| | | ,{field: 'crnNo', align: 'center',title: '堆垛机'} |
| | | ,{field: 'plcNo', align: 'center',title: 'plc', hide: true} |
| | | ,{field: 'wrkNo', align: 'center',title: '任务号', hide: false} |
| | | ,{field: 'startTime$', align: 'center',title: '发生时间', hide: false} |
| | | ,{field: 'endTime$', align: 'center',title: '结束时间', hide: false} |
| | | ,{field: 'wrkSts$', align: 'center',title: '任务状态', hide: false} |
| | | ,{field: 'ioType$', align: 'center',title: '入出库类型', hide: false} |
| | | ,{field: 'crnNo', align: 'center',title: '巷道号', hide: false} |
| | | ,{field: 'plcNo', align: 'center',title: '堆垛机号', hide: false} |
| | | ,{field: 'locNo', align: 'center',title: '目标库位', hide: true} |
| | | ,{field: 'staNo', align: 'center',title: '目标站', hide: true} |
| | | ,{field: 'sourceStaNo', align: 'center',title: '源站', hide: true} |
| | | ,{field: 'sourceLocNo', align: 'center',title: '源库位', hide: true} |
| | | ,{field: 'barcode', align: 'center',title: '条码', hide: true} |
| | | ,{field: 'errCode', align: 'center',title: '异常码'} |
| | | ,{field: 'error', align: 'center',title: '异常描述'} |
| | | ,{field: 'status$', align: 'center',title: '异常情况'} |
| | | ,{field: 'errCode', align: 'center',title: '异常码', hide: true} |
| | | ,{field: 'error', align: 'center',title: '异常描述', hide: false} |
| | | ,{field: 'status$', align: 'center',title: '异常情况', hide: false} |
| | | // ,{field: 'createTime$', align: 'center',title: '添加时间'} |
| | | // ,{field: 'createBy$', align: 'center',title: '添加人员'} |
| | | ,{field: 'updateTime$', align: 'center',title: '修改时间', hide: true} |
| | | ,{field: 'updateBy$', align: 'center',title: '修改人员', hide: true} |
| | | ,{field: 'memo', align: 'center',title: '备注', hide: true} |
| | | ,{field: 'memo', align: 'center',title: '备注', hide: false} |
| | | |
| | | // ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | ]], |
| | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="plc_no" placeholder="巷道号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select name="status"> |
| | | <option value="" style="display: none"></option> |
| | | <option value="1">待处理</option> |
| | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="备注" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | |