| | |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.domain.enums.TaskStatusType; |
| | | import com.zy.asrs.domain.enums.WorkNoType; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.TaskWrk; |
| | | import com.zy.asrs.entity.TaskWrkReport; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.wms.StorageEscalationParam; |
| | | import com.zy.asrs.entity.wms.WmsResult; |
| | | import com.zy.asrs.service.*; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void addReportLog(TaskWrkLog taskWrk) { |
| | | TaskWrkReport taskWrkReport = new TaskWrkReport(); |
| | | Synchro.Copy(taskWrk, taskWrkReport); |
| | | taskWrkReport.setCreateTime(new Date()); |
| | | taskWrkReportService.insert(taskWrkReport); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void addReportLog(WrkMast taskWrk) { |
| | | TaskWrkReport taskWrkReport = new TaskWrkReport(); |
| | | Synchro.Copy(taskWrk, taskWrkReport); |
| | | taskWrkReport.setCreateTime(new Date()); |
| | | taskWrkReportService.insert(taskWrkReport); |
| | | } |
| | | |
| | | @Override |
| | | public TaskWrk getLocNoFromWms(StorageEscalationParam wmsParam) { |
| | | String response = ""; |
| | | Boolean success = false; |
| | |
| | | if (!Cools.isEmpty(response)) { |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (!Cools.isEmpty(jsonObject.get(code)) && jsonObject.get(code).equals(successCode)) { |
| | | //有些三方wms系统不能及时返回库位号,这时候就需要 |
| | | //ZWmsResult result = JSON.parseObject(jsonObject.get(data).toString(), WmsResult.class); |
| | | TaskWrk taskWrk = null; |
| | | int i = 1; |
| | | while (i < 10) { |
| | | taskWrk = taskWrkService.selectByBarcode(wmsParam.getBarcode()); |
| | | if (taskWrk != null) { |
| | | break; |
| | | } |
| | | try { |
| | | i++; |
| | | Thread.sleep(500L); |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | return taskWrk; |
| | | WmsResult result = JSON.parseObject(jsonObject.get(data).toString(), WmsResult.class); |
| | | return createInTask(result, wmsParam.getBarcode(), wmsParam.getStationCode()); |
| | | } |
| | | } |
| | | } catch (IOException e) { |