| | |
| | | |
| | | //创建任务 |
| | | @PostMapping("/taskCreate") |
| | | @AppAuth(memo = "WMS任务下发") |
| | | @Transactional |
| | | public R taskCreate(@RequestHeader String appkey, |
| | | public synchronized R taskCreate(@RequestHeader String appkey, |
| | | @RequestBody List<TaskCreateParam> param1, |
| | | HttpServletRequest request) { |
| | | auth(appkey, param1, request); |
| | |
| | | if (Cools.isEmpty(param)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | |
| | | if (Cools.isEmpty(param.getTaskNo())) { |
| | | return R.error("任务号[taskNo]不能为空"); |
| | | } |
| | | if (Cools.isEmpty(param.getIoType())) { |
| | | return R.error("任务类型[ioType]不能为空"); |
| | | } |
| | | param.updateIoTyoe(param.getIoType());//中航下发 1:出库,2:移库 3:入库 ====转换为====> 1:入库,2:出库,3:移库 |
| | | |
| | | if (Cools.isEmpty(param.getBarcode())) { |
| | | return R.error("条码[barcode]不能为空"); |
| | | } |
| | | |
| | | String locNo=null; |
| | | if(param.getIoType()==1){ |
| | | locNo=param.getTargetPoint(); |
| | |
| | | |
| | | public TaskCreateParam(){}; |
| | | |
| | | public TaskCreateParam(String taskNo, Integer ioType, String barcode, String startPoint, Integer taskPriority, String targetPoint, String emptyContainer) { |
| | | this.taskNo = taskNo; |
| | | this.ioType = ioType; |
| | | this.barcode = barcode; |
| | | this.startPoint = startPoint; |
| | | this.taskPriority = taskPriority; |
| | | this.targetPoint = targetPoint; |
| | | this.emptyContainer = emptyContainer; |
| | | } |
| | | |
| | | public TaskCreateParam(String taskNo, Integer ioType, String startPoint, Integer taskPriority, String targetPoint, String emptyContainer, String barcode, String memo) { |
| | | this.taskNo = taskNo; |
| | | this.ioType = ioType; |
| | | this.startPoint = startPoint; |
| | | this.taskPriority = taskPriority; |
| | | this.targetPoint = targetPoint; |
| | | this.emptyContainer = emptyContainer; |
| | | this.barcode = barcode; |
| | | this.memo = memo; |
| | | } |
| | | |
| | | public TaskCreateParam(WMSAndAGVInterfaceParam param){ |
| | | this.taskNo = param.getTaskNo(); |
| | | this.ioType = convertParamIoType(param.getTaskType()); |
| | |
| | | } |
| | | } |
| | | |
| | | public void updateIoTyoe(Integer ioTypeOld){ |
| | | switch (ioTypeOld){ |
| | | case 1: |
| | | this.ioType = 2; |
| | | break; |
| | | case 2: |
| | | this.ioType = 3; |
| | | break; |
| | | case 3: |
| | | this.ioType = 1; |
| | | break; |
| | | default: |
| | | this.ioType = 3; |
| | | } |
| | | } |
| | | |
| | | } |