src/main/java/com/zy/asrs/controller/OpenController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/zy/common/service/CommonService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/zy/asrs/controller/OpenController.java
@@ -39,7 +39,7 @@ @AppAuth(memo = "商品信息同步接口") public synchronized R syncMatInfo(@RequestHeader(required = false) String appkey, @RequestBody(required = false) MatSyncParam param, HttpServletRequest request){ HttpServletRequest request) { auth(appkey, param, request); if (Cools.isEmpty(param)) { return R.parse(BaseRes.PARAM); @@ -199,7 +199,6 @@ orderDetails.add(detlDto); } System.out.println(JSON.toJSONString(param)); // 2 System.out.println("======================================"); OpenOrderCompleteParam param1 = new OpenOrderCompleteParam(); param1.setOrderNo("963001846497017856"); @@ -208,11 +207,11 @@ /*...........................赣州新增..............以下.............赣州新增...........................*/ @PostMapping("/rpc/watchDog/auth/v1") // @AppAuth(memo = "心跳接口调用") @AppAuth(memo = "心跳接口调用") public synchronized R hostName(@RequestHeader(required = false) String appkey, @RequestBody(required = false) HeartBeat param, HttpServletRequest request){ appkey="ea1f0459efc02a79f046f982767939ae"; HttpServletRequest request) { appkey = "ea1f0459efc02a79f046f982767939ae"; auth(appkey, param, request); if (Cools.isEmpty(param)) { return R.parse(BaseRes.PARAM); @@ -220,17 +219,17 @@ //........ System.out.println(String.format("id:%s,hostName:%s,requestTime:%s", param.getId(),param.getHostName(),param.getRequestTime())); param.getId(), param.getHostName(), param.getRequestTime())); return R.ok(); } @PostMapping("/rpc/pakIn/auth/v1") // @AppAuth(memo = "入库通知单接口调用") @AppAuth(memo = "入库通知单接口调用") public synchronized R combPack(@RequestHeader(required = false) String appkey, @RequestBody(required = false) CombParam param, HttpServletRequest request){ appkey="ea1f0459efc02a79f046f982767939ae"; HttpServletRequest request) { appkey = "ea1f0459efc02a79f046f982767939ae"; auth(appkey, param, request); if (Cools.isEmpty(param)) { return R.parse(BaseRes.PARAM); @@ -238,27 +237,28 @@ //生成入库通知档 openService.combPACK(param); Map<String,Boolean> map=new HashMap<>(); Map<String, Boolean> map = new HashMap<>(); apiLogService.save( "mes申请入库", "172.28.15.251", null, "127.0.0.1", JSON.toJSONString("PackNo:"+param.getPackNo() +" PackName:"+param.getPackName() +" RequestTime:"+param.getRequestTime() +" SettingTimes:"+param.getSettingTimes()), JSON.toJSONString("PackNo:" + param.getPackNo() + " PackName:" + param.getPackName() + " RequestTime:" + param.getRequestTime() + " SettingTimes:" + param.getSettingTimes()), "172.28.15.251", true ); map.put("isComplete",true); map.put("isComplete", true); return R.ok(map); } @PostMapping("/rpc/pakOut/auth/v1") // @AppAuth(memo = "出库通知单接口调用") @AppAuth(memo = "出库通知单接口调用") public synchronized R combpakOut(@RequestHeader(required = false) String appkey, @RequestBody(required = false) CombParam param, HttpServletRequest request){ @RequestBody(required = false) CombParam param, HttpServletRequest request) { auth(appkey, param, request); if (Cools.isEmpty(param)) { @@ -267,48 +267,49 @@ //出库开始 openService.combPackOut(param); Map<String,Boolean> map=new HashMap<>(); map.put("isComplete",true); Map<String, Boolean> map = new HashMap<>(); map.put("isComplete", true); return R.ok(map); } @PostMapping("/rpv/infoReview/auth/v1") // @AppAuth(memo = "测试条码信息复核请求") @AppAuth(memo = "测试条码信息复核请求") public synchronized R infoReview(@RequestHeader(required = false) String appkey, @RequestBody(required = false) Review param, HttpServletRequest request){ appkey="ea1f0459efc02a79f046f982767939ae"; @RequestBody(required = false) Review param, HttpServletRequest request) { appkey = "ea1f0459efc02a79f046f982767939ae"; auth(appkey, param, request); if (Cools.isEmpty(param)) { return R.parse(BaseRes.PARAM); } TestMast testMast = openService.infoReview(param); if (testMast.getStatus()==3){ if (testMast.getStatus() == 3) { return R.ok(); }else if (testMast.getStatus()==2){ } else if (testMast.getStatus() == 2) { return R.error("等待员工操作"); } return R.error(); } @PostMapping("/rpv/testFinish/auth/v1") // @AppAuth(memo = "测试完成") @AppAuth(memo = "测试完成") public synchronized R testFinish(@RequestHeader(required = false) String appkey, @RequestBody(required = false) Review param, HttpServletRequest request){ appkey="ea1f0459efc02a79f046f982767939ae"; @RequestBody(required = false) Review param, HttpServletRequest request) { appkey = "ea1f0459efc02a79f046f982767939ae"; auth(appkey, param, request); Map<String,Boolean> map=new HashMap<>(); Map<String, Boolean> map = new HashMap<>(); if (Cools.isEmpty(param)) { return R.parse(BaseRes.PARAM); } if (param.getTestResult().equals("OK")){ map.put("isComplete",openService.testFinish(param)); }else if(param.getTestResult().equals("NG")){ if (param.getTestResult().equals("OK")) { map.put("isComplete", openService.testFinish(param)); } else if (param.getTestResult().equals("NG")) { openService.testNG(param); map.put("isComplete",false); }else{ map.put("isComplete",false); map.put("isComplete", false); } else { map.put("isComplete", false); } return R.ok(map); } src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -715,17 +715,19 @@ review.setBarcode(testMast.getBarcode()); review.setChannel(testMast.getChannel().toString()); review.setRequestTime(DateUtils.convert(new Date())); if (testMast.getChannel()>=1 && testMast.getChannel()<=8){ if (testMast.getChannel()<1 || testMast.getChannel()>48){ log.error("通道有误,请查看!"); } else if (testMast.getChannel()<=8){ renUrl=renUrl1; }else if (testMast.getChannel()>=9 && testMast.getChannel()<=16){ }else if (testMast.getChannel()<=16){ renUrl=renUrl2; }else if (testMast.getChannel()>=17 && testMast.getChannel()<=24){ }else if (testMast.getChannel()<=24){ renUrl=renUrl3; }else if (testMast.getChannel()>=25 && testMast.getChannel()<=32){ }else if (testMast.getChannel()<=32){ renUrl=renUrl4; }else if (testMast.getChannel()>=33 && testMast.getChannel()<=40){ }else if (testMast.getChannel()<=40){ renUrl=renUrl5; }else if (testMast.getChannel()>=41 && testMast.getChannel()<=48){ }else if (testMast.getChannel()<=48){ renUrl=renUrl6; } return postMesData(renUrl,startUpTestPACK,review); @@ -805,6 +807,8 @@ case "48": renUrl=renUrl6; break; default: log.error("通道有误,请查看!"); } return postMesData(renUrl,suspendTestPACK,review); }catch (Exception e) { @@ -831,6 +835,8 @@ name="测试系统"; }else if (URL.equals(renUrl6)){ name="测试系统"; }else { log.error("查询连接失败,请查看!"); } if(combParam != null){ String response = ""; src/main/java/com/zy/common/service/CommonService.java
@@ -52,6 +52,7 @@ /** * 生成工作号 * * @param wrkMk 0:入库 1 - 3000 ; 1:拣料/并板/盘点 3001 - 6000 ; 2: 出库 6001 -9000 ; 3:其他 9001 -9999 * @return workNo(工作号) */ @@ -64,17 +65,17 @@ int workNo = wrkLastno.getWrkNo(); int sNo = wrkLastno.getSNo(); int eNo = wrkLastno.getENo(); workNo = workNo>=eNo ? sNo : workNo+1; workNo = workNo >= eNo ? sNo : workNo + 1; while (true) { WrkMast wrkMast = wrkMastService.selectById(workNo); if (null != wrkMast) { workNo = workNo>=eNo ? sNo : workNo+1; workNo = workNo >= eNo ? sNo : workNo + 1; } else { break; } } // 修改序号记录 if (workNo > 0){ if (workNo > 0) { wrkLastno.setWrkNo(workNo); wrkLastnoService.updateById(wrkLastno); } @@ -82,7 +83,7 @@ if (workNo == 0) { throw new CoolException("生成工作号失败,请联系管理员"); } else { if (wrkMastService.selectById(workNo)!=null) { if (wrkMastService.selectById(workNo) != null) { throw new CoolException("生成工作号" + workNo + "在工作档中已存在"); } } @@ -91,19 +92,22 @@ /** * 检索库位号 * @param whsType 类型 1:双深式货架 * @param staDescId 路径工作类型 * * @param whsType 类型 1:双深式货架 * @param staDescId 路径工作类型 * @param sourceStaNo 源站 * @param matNos 商品编号集合 * @param matNos 商品编号集合 * @return locNo 检索到的库位号 */ @Transactional public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, List<String> matNos, LocTypeDto locTypeDto, int times) { if (sourceStaNo.equals(100)){ whsType=1; }else if (sourceStaNo.equals(200)){ whsType=2; if (sourceStaNo.equals(100)) { whsType = 1; locTypeDto.setLocType1((short) 1); } else if (sourceStaNo.equals(200)) { whsType = 2; locTypeDto.setLocType1((short) 2); } StartupDto startupDto = new StartupDto(); @@ -123,12 +127,12 @@ // 目标库位 LocMast locMast = null; if (curRow==3){ curRow=4; }else if (curRow==4){ curRow=3; }else { rowCount=0; if (curRow == 3) { curRow = 4; } else if (curRow == 4) { curRow = 3; } else { rowCount = 0; } if (crnNo == 0) { @@ -146,26 +150,24 @@ } BasDevp staNo = basDevpService.selectById(staDesc.getCrnStn()); if (!staNo.getAutoing().equals("Y")) { throw new CoolException("目标站"+staDesc.getCrnStn()+"不可用"); throw new CoolException("目标站" + staDesc.getCrnStn() + "不可用"); } // 更新库位排号 rowLastno.setCurrentRow(curRow); rowLastnoService.updateById(rowLastno); // 开始查找库位 ==============================>> if (Cools.isEmpty(locMast)) { Integer ruleId = Integer.parseInt(Parameter.get().getFindLocRule()); if (whsType!=1){ locMast = locMastService.queryFreeLocMast(curRow, locTypeDto.getLocType1()); } else if (ruleId == 1){ //按测试设备排序,优先排满单台设备 locMast = locMastService.queryFreeLocMast1(curRow, locTypeDto.getLocType1() ,channelMax+1); } else if (ruleId == 2){ //按通道排序,均匀分配每台设备 Short locType2 = getLocType2Small(curRow, locTypeDto.getLocType1()); locMast = locMastService.queryFreeLocMast2(curRow, locTypeDto.getLocType1() ,locType2); } else { //默认规则 locMast = locMastService.queryFreeLocMast(curRow, locTypeDto.getLocType1()); } // 开始查找库位 ==============================> int ruleId = Integer.parseInt(Parameter.get().getFindLocRule()); if (whsType != 1) { locMast = locMastService.queryFreeLocMast(curRow, locTypeDto.getLocType1()); } else if (ruleId == 1) { //按测试设备排序,优先排满单台设备 locMast = locMastService.queryFreeLocMast1(curRow, locTypeDto.getLocType1(), channelMax + 1); } else if (ruleId == 2) { //按通道排序,均匀分配每台设备 Short locType2 = getLocType2Small(curRow, locTypeDto.getLocType1()); locMast = locMastService.queryFreeLocMast2(curRow, locTypeDto.getLocType1(), locType2); } else { //默认规则 locMast = locMastService.queryFreeLocMast(curRow, locTypeDto.getLocType1()); } // 2.库位当前所属尺寸无空库位时,调整尺寸参数,向上兼容检索库位 @@ -175,7 +177,6 @@ times = times + 1; return getLocNo(1, staDescId, sourceStaNo, matNos, locTypeDto, times); } log.error("系统没有空库位!!! 尺寸规格: {}, 轮询次数:{}", JSON.toJSONString(locTypeDto), times); throw new CoolException("没有空库位"); } @@ -192,17 +193,16 @@ return startupDto; } public Short getLocType2Small(Integer curRow,short locType1){ Integer OCount = locMastService.queryFreeLocMastCount(curRow, locType1, (short)1); short locType2=1; for (int i=2;i<equipmentCount+1;i++){ Integer integer =locMastService.queryFreeLocMastCount(curRow, locType1, (short)i); if (OCount<integer){ OCount=integer; locType2=(short)i; public Short getLocType2Small(Integer curRow, short locType1) { Integer OCount = locMastService.queryFreeLocMastCount(curRow, locType1, (short) 1); short locType2 = 1; for (int i = 2; i < equipmentCount + 1; i++) { Integer integer = locMastService.queryFreeLocMastCount(curRow, locType1, (short) i); if (OCount < integer) { OCount = integer; locType2 = (short) i; } } return locType2; }