| | |
| | | @TableField("out_station_list") |
| | | private String outStationList; |
| | | |
| | | /** |
| | | * è¿è¡å µå¡éæ°åé
åºä½ç«ç¹æ°æ® |
| | | */ |
| | | @ApiModelProperty(value= "è¿è¡å µå¡éæ°åé
åºä½ç«ç¹æ°æ®") |
| | | @TableField("run_block_reassign_loc_station_list") |
| | | private String runBlockReassignLocStationList; |
| | | |
| | | public BasDevp() {} |
| | | |
| | | public BasDevp(Integer devpNo,Integer status,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo,String stationList,String barcodeStationList,String inStationList,String outStationList) { |
| | |
| | | return list; |
| | | } |
| | | |
| | | public List<StationObjModel> getRunBlockReassignLocStationList$(){ |
| | | List<StationObjModel> list = new ArrayList<>(); |
| | | if (Cools.isEmpty(this.runBlockReassignLocStationList)){ |
| | | return list; |
| | | } |
| | | |
| | | List<StationObjModel> jsonList = JSON.parseArray(this.runBlockReassignLocStationList, StationObjModel.class); |
| | | for (StationObjModel json : jsonList){ |
| | | list.add(json); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | LocMast queryByLoc(String locNo); |
| | | |
| | | LocMast queryByQrCode(String qrCodeValue); |
| | | |
| | | List<LocMast> selectLocByLev(Integer lev); |
| | | |
| | | List<LocMast> selectEmptyLocNos(@Param("locNos") List<String> locNos); |
| | | |
| | | List<LocMast> selectNotEmptyLocNos(@Param("locNos") List<String> locNos); |
| | | |
| | | //æ¥è¯¢æææ¥¼å± |
| | | List<Integer> getLevList(); |
| | |
| | | |
| | | LocMast queryByLoc(String locNo); |
| | | |
| | | LocMast queryByQrCode(String qrCodeValue); |
| | | |
| | | //æ¥è¯¢æå®æ¥¼å±çåºä½æ°æ® |
| | | List<LocMast> selectLocByLev(Integer lev); |
| | | |
| | | List<LocMast> selectEmptyLocNos(List<String> locNos); |
| | | |
| | | List<LocMast> selectNotEmptyLocNos(List<String> locNos); |
| | | |
| | | //æ¥è¯¢æææ¥¼å± |
| | | List<Integer> getLevList(); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public LocMast queryByQrCode(String qrCodeValue) { |
| | | return this.baseMapper.queryByQrCode(qrCodeValue); |
| | | } |
| | | |
| | | @Override |
| | | public List<LocMast> selectLocByLev(Integer lev) { |
| | | return this.baseMapper.selectLocByLev(lev); |
| | | } |
| | | |
| | | @Override |
| | | public List<LocMast> selectEmptyLocNos(List<String> locNos) { |
| | | return this.baseMapper.selectEmptyLocNos(locNos); |
| | | } |
| | | |
| | | @Override |
| | | public List<LocMast> selectNotEmptyLocNos(List<String> locNos) { |
| | | if (locNos.isEmpty()) { |
| | | return new ArrayList<LocMast>(); |
| | | } |
| | | return this.baseMapper.selectNotEmptyLocNos(locNos); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import com.zy.core.network.api.ZyStationConnectApi; |
| | | import com.zy.core.network.entity.ZyStationStatusEntity; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | import java.util.concurrent.CopyOnWriteArrayList; |
| | |
| | | } |
| | | |
| | | if (!checkTaskNoInArea(taskNo)) { |
| | | if (System.currentTimeMillis() - executeTime > 1000 * 10) { |
| | | boolean fakeAllowCheckBlock = true; |
| | | Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key); |
| | | if (systemConfigMapObj != null) { |
| | | HashMap<String, String> systemConfigMap = (HashMap<String, String>) systemConfigMapObj; |
| | | if (!systemConfigMap.get("fakeAllowCheckBlock").equals("Y")) { |
| | | fakeAllowCheckBlock = false; |
| | | } |
| | | } |
| | | |
| | | if (fakeAllowCheckBlock && System.currentTimeMillis() - executeTime > 1000 * 10) { |
| | | //认å®å µå¡ |
| | | boolean result = runBlockStation(taskNo, currentStationId, taskNo, currentStationId); |
| | | if(!result) { |
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.domain.param.CreateInTaskParam; |
| | | import com.zy.asrs.entity.BasCrnp; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.zy.asrs.entity.HttpRequestLog; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.service.BasCrnpService; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.asrs.service.HttpRequestLogService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.common.service.CommonService; |
| | |
| | | private ConfigService configService; |
| | | @Autowired |
| | | private HttpRequestLogService httpRequestLogService; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | |
| | | //æ§è¡è¾éç«ç¹å
¥åºä»»å¡ |
| | | public synchronized void stationInExecute() { |
| | |
| | | continue; |
| | | } |
| | | |
| | | List<Integer> runBlockReassignLocStationList = new ArrayList<>(); |
| | | for (StationObjModel stationObjModel : basDevp.getRunBlockReassignLocStationList$()) { |
| | | runBlockReassignLocStationList.add(stationObjModel.getStationId()); |
| | | } |
| | | |
| | | List<StationProtocol> list = stationThread.getStatus(); |
| | | for (StationProtocol stationProtocol : list) { |
| | | if(stationProtocol.isAutoing() |
| | |
| | | && stationProtocol.getTaskNo() > 0 |
| | | && stationProtocol.isRunBlock() |
| | | ) { |
| | | //è¿è¡å µå¡ï¼éæ°ç³è¯·ä»»å¡ |
| | | WrkMast wrkMast = wrkMastService.selectByWorkNo(stationProtocol.getTaskNo()); |
| | | if (wrkMast == null) { |
| | | News.info("è¾éç«ç¹å·={} è¿è¡é»å¡ï¼ä½æ æ³æ¾å°å¯¹åºä»»å¡ï¼å·¥ä½å·={}", stationProtocol.getStationId(), stationProtocol.getTaskNo()); |
| | |
| | | if (lock != null) { |
| | | continue; |
| | | } |
| | | |
| | | redisUtil.set(RedisKeyType.CHECK_STATION_RUN_BLOCK_LIMIT_.key + stationProtocol.getTaskNo(), "lock", 15); |
| | | |
| | | if (runBlockReassignLocStationList.contains(stationProtocol.getStationId())) { |
| | | //ç«ç¹å¤äºéæ°åé
åºä½åºå |
| | | //è¿è¡å µå¡ï¼éæ°ç³è¯·ä»»å¡ |
| | | |
| | | HashMap<String, Object> requestParam = new HashMap<>(); |
| | | String response = null; |
| | |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | | |
| | | String sourceLocNo = wrkMast.getLocNo(); |
| | | String locNo = dto.getLocNo(); |
| | | //æ´æ°æ°æ® |
| | | wrkMast.setLocNo(locNo); |
| | | wrkMastService.updateById(wrkMast); |
| | | |
| | | LocMast sourceLocMast = locMastService.queryByLoc(sourceLocNo); |
| | | if (sourceLocMast == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "åºä½å·:{} æºåºä½ä¿¡æ¯ä¸åå¨", sourceLocNo); |
| | | continue; |
| | | } |
| | | |
| | | if (!sourceLocMast.getLocSts().equals("S")) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "åºä½å·:{} æºåºä½ç¶æä¸å¤äºå
¥åºé¢çº¦", sourceLocNo); |
| | | continue; |
| | | } |
| | | |
| | | LocMast locMast = locMastService.queryByLoc(locNo); |
| | | if (locMast == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "åºä½å·:{} ç®æ åºä½ä¿¡æ¯ä¸åå¨", locNo); |
| | | continue; |
| | | } |
| | | |
| | | if (!locMast.getLocSts().equals("O")) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "åºä½å·:{} ç®æ åºä½ç¶æä¸å¤äºç©ºåºä½", locNo); |
| | | continue; |
| | | } |
| | | |
| | | Integer crnNo = commonService.findCrnNoByLocNo(locNo); |
| | | if (crnNo == null) { |
| | |
| | | News.taskInfo(wrkMast.getWrkNo(), "è·åè¾é线å½ä»¤å¤±è´¥"); |
| | | continue; |
| | | } |
| | | |
| | | //æ´æ°æºåºä½ |
| | | sourceLocMast.setLocSts("O"); |
| | | sourceLocMast.setModiTime(new Date()); |
| | | locMastService.updateById(sourceLocMast); |
| | | |
| | | //æ´æ°ç®æ åºä½ |
| | | locMast.setLocSts("S"); |
| | | locMast.setModiTime(new Date()); |
| | | locMastService.updateById(locMast); |
| | | |
| | | //æ´æ°å·¥ä½æ¡£æ°æ® |
| | | wrkMast.setLocNo(locNo); |
| | | wrkMast.setCrnNo(crnNo); |
| | | wrkMast.setStaNo(targetStationId); |
| | | if (wrkMastService.updateById(wrkMast)) { |
| | | MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command)); |
| | | } |
| | | News.info("请æ±WMSæ¥å£æåï¼ï¼ï¼urlï¼{}ï¼requestï¼{}ï¼responseï¼{}", wmsUrl + wmsSystemReassignInTaskUrl, JSON.toJSONString(requestParam), response); |
| | | } else { |
| | | News.error("请æ±WMSæ¥å£å¤±è´¥ï¼ï¼ï¼urlï¼{}ï¼requestï¼{}ï¼responseï¼{}", wmsUrl + wmsSystemReassignInTaskUrl, JSON.toJSONString(requestParam), response); |
| | |
| | | httpRequestLog.setCreateTime(new Date()); |
| | | httpRequestLogService.insert(httpRequestLog); |
| | | } |
| | | }else { |
| | | //è¿è¡å µå¡ï¼éæ°è®¡ç®è·¯çº¿ |
| | | StationCommand command = stationThread.getMoveCommand(wrkMast.getWrkNo(), stationProtocol.getStationId(), wrkMast.getStaNo(), 0); |
| | | if(command == null){ |
| | | News.taskInfo(wrkMast.getWrkNo(), "è·åè¾é线å½ä»¤å¤±è´¥"); |
| | | continue; |
| | | } |
| | | |
| | | MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command)); |
| | | News.info("è¾éç«ç¹å µå¡åéæ°è®¡ç®è·¯å¾å½ä»¤ä¸åæåï¼ç«ç¹å·={}ï¼å·¥ä½å·={}ï¼å½ä»¤æ°æ®={}", stationProtocol.getStationId(), wrkMast.getWrkNo(), JSON.toJSONString(command)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | <result column="barcode_station_list" property="barcodeStationList" /> |
| | | <result column="in_station_list" property="inStationList" /> |
| | | <result column="out_station_list" property="outStationList" /> |
| | | <result column="run_block_reassign_loc_station_list" property="runBlockReassignLocStationList" /> |
| | | |
| | | </resultMap> |
| | | |
| | |
| | | select * from asr_loc_mast where loc_no = #{locNo} limit 0,1 |
| | | </select> |
| | | |
| | | <select id="queryByQrCode" resultMap="BaseResultMap"> |
| | | select * from asr_loc_mast where qr_code_value = #{qrCodeValue} limit 0,1 |
| | | </select> |
| | | |
| | | <select id="selectLocByLev" resultMap="BaseResultMap"> |
| | | SELECT * FROM asr_loc_mast WHERE lev1 = #{lev} |
| | | </select> |
| | | |
| | | <select id="selectEmptyLocNos" resultMap="BaseResultMap"> |
| | | select * from asr_loc_mast |
| | | where loc_no in |
| | | <foreach item="loc" collection="locNos" index="index" separator="," open="(" close=")"> |
| | | #{loc} |
| | | </foreach> |
| | | and loc_sts = 'O' |
| | | order by row1 |
| | | </select> |
| | | |
| | | <select id="selectNotEmptyLocNos" resultMap="BaseResultMap"> |
| | | select * from asr_loc_mast |
| | | where loc_no in |
| | | <foreach item="loc" collection="locNos" index="index" separator="," open="(" close=")"> |
| | | #{loc} |
| | | </foreach> |
| | | and loc_sts not in ('O') |
| | | order by row1 |
| | | </select> |
| | | |
| | | <select id="getLevList" resultType="java.lang.Integer"> |
| | |
| | | { field: "id", align: "center", title: "ç¼å·" }, |
| | | { field: "devpNo", align: "center", title: "设å¤ç¼å·" }, |
| | | { field: "status$", align: "center", title: "ç¶æ" }, |
| | | { field: "createBy", align: "center", title: "å建人å" }, |
| | | { field: "createTime$", align: "center", title: "å建æ¶é´" }, |
| | | { field: "updateBy", align: "center", title: "ä¿®æ¹äººå" }, |
| | | { field: "updateTime$", align: "center", title: "ä¿®æ¹æ¶é´" }, |
| | | // { field: "createBy", align: "center", title: "å建人å" }, |
| | | // { field: "createTime$", align: "center", title: "å建æ¶é´" }, |
| | | // { field: "updateBy", align: "center", title: "ä¿®æ¹äººå" }, |
| | | // { field: "updateTime$", align: "center", title: "ä¿®æ¹æ¶é´" }, |
| | | { field: "memo", align: "center", title: "夿³¨" }, |
| | | { field: "stationList", align: "center", title: "ç«ç¹æ°æ®" }, |
| | | { field: "barcodeStationList", align: "center", title: "æ¡ç ç«ç¹æ°æ®" }, |
| | | { field: "inStationList", align: "center", title: "å
¥åºç«ç¹æ°æ®" }, |
| | | { field: "outStationList", align: "center", title: "åºåºç«ç¹æ°æ®" }, |
| | | { field: "runBlockReassignLocStationList", align: "center", title: "è¿è¡å µå¡éæ°åé
åºä½ç«ç¹æ°æ®" }, |
| | | |
| | | { |
| | | fixed: "right", |
| | |
| | | <input class="layui-input" name="outStationList" placeholder="请è¾å
¥åºåºç«ç¹æ°æ®"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">è¿è¡å µå¡éæ°åé
åºä½ç«ç¹æ°æ®: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="runBlockReassignLocStationList" placeholder="请è¾å
¥è¿è¡å µå¡éæ°åé
åºä½ç«ç¹æ°æ®"> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |