|  |  |  | 
|---|
|  |  |  | import com.core.exception.CoolException; | 
|---|
|  |  |  | import com.zy.asrs.entity.*; | 
|---|
|  |  |  | import com.zy.asrs.service.*; | 
|---|
|  |  |  | import com.zy.common.CodeRes; | 
|---|
|  |  |  | import com.zy.common.model.LocTypeDto; | 
|---|
|  |  |  | import com.zy.common.model.StartupDto; | 
|---|
|  |  |  | import com.zy.common.service.CommonService; | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/pakin/loc/v1") | 
|---|
|  |  |  | @ResponseBody | 
|---|
|  |  |  | public synchronized R getLocNo(@RequestBody SearchLocParam param) { | 
|---|
|  |  |  | log.info("收到WCS入库接口请求====>>入参:{}", param); | 
|---|
|  |  |  | if (Cools.isEmpty(param.getIoType())) { | 
|---|
|  |  |  | return R.error("入出库类型不能为空"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | waitPakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode())); | 
|---|
|  |  |  | if (Cools.isEmpty(waitPakins)) { | 
|---|
|  |  |  | return R.error("条码数据错误"); | 
|---|
|  |  |  | WrkMast wrkMast = wrkMastService.selectByBarcode(param.getBarcode()); | 
|---|
|  |  |  | if (wrkMast != null && wrkMast.getIoType() == 103) { | 
|---|
|  |  |  | return R.parse(CodeRes.PICK_600); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return R.parse(CodeRes.NO_COMB_700); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",param.getBarcode())); | 
|---|
|  |  |  | int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet",param.getBarcode())); | 
|---|
|  |  |  | if (countLoc > 0 || countWrk > 0) { | 
|---|
|  |  |  | return R.error("工作档/库存条码数据已存在"); | 
|---|
|  |  |  | return R.error(CodeRes.EXIST_500); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (Cools.isEmpty(param.getLocType1())){ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 源站点状态检测 | 
|---|
|  |  |  | BasDevp sourceStaNo = basDevpService.checkSiteStatus(param.getSourceStaNo(), true); | 
|---|
|  |  |  | sourceStaNo.setLocType1(param.getLocType1()); | 
|---|
|  |  |  | LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | StartupDto dto = null; | 
|---|
|  |  |  | 
|---|
|  |  |  | default: | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | log.info("WCS入库接口返参:{},托盘码:{}", dto, param.getBarcode()); | 
|---|
|  |  |  | return R.ok().add(dto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 全板入库 | 
|---|
|  |  |  | 
|---|
|  |  |  | Wrapper<WaitPakin> wrapper = new EntityWrapper<WaitPakin>() | 
|---|
|  |  |  | .eq("zpallet", barcode); | 
|---|
|  |  |  | WaitPakin setParam = new WaitPakin(); | 
|---|
|  |  |  | setParam.setLocNo(dto.getLocNo()); | 
|---|
|  |  |  | setParam.setIoStatus("Y"); | 
|---|
|  |  |  | setParam.setModiTime(now); | 
|---|
|  |  |  | if (!waitPakinService.update(setParam, wrapper)) { | 
|---|