| | |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.dto.NotifyCustomDataDto; |
| | | import com.zy.asrs.domain.enums.NotifyMsgType; |
| | | import com.zy.asrs.domain.enums.TaskStatusType; |
| | | import com.zy.asrs.entity.CommandInfo; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.TaskWrk; |
| | | import com.zy.asrs.entity.param.TaskOverToWms; |
| | | import com.zy.asrs.service.ApiLogService; |
| | | import com.zy.asrs.service.CommandInfoService; |
| | | import com.zy.asrs.service.LocMastService; |
| | |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.utils.NotifyUtils; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.common.web.BaseController; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | |
| | | @Value("${wms.url}") |
| | | private String wmsUrl; |
| | | |
| | | @Autowired |
| | | private TaskWrkService taskWrkService; |
| | | |
| | | @Autowired |
| | | private CommandInfoService commandInfoService; |
| | | |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | |
| | | @Value("${wms.TaskExecCallback}") |
| | | private String TaskExecCallback; |
| | | |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | @Autowired |
| | | private NotifyUtils notifyUtils; |
| | | |
| | | @RequestMapping(value = "/taskWrk/{wrkNo}/auth") |
| | | @ManagerAuth |
| | |
| | | locMast.setBarcode(taskWrk.getBarcode()); |
| | | |
| | | } |
| | | String response=""; |
| | | try{ |
| | | HashMap<String, Object> headParam = new HashMap<>(); |
| | | headParam.put("TaskNo",taskWrk.getTaskNo()); |
| | | headParam.put("Result",1); |
| | | // headParam.put("reportTime",new Date()); |
| | | log.info("wcs手动完成任务上报wms={}", taskWrk); |
| | | response = new HttpHandler.Builder() |
| | | // .setHeaders(headParam) |
| | | .setUri(wmsUrl) |
| | | .setPath(TaskExecCallback) |
| | | .setJson(JSON.toJSONString(headParam)) |
| | | .build() |
| | | .doPost(); |
| | | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | apiLogService.save("wcs手动完成任务上报wms" |
| | | ,wmsUrl+TaskExecCallback |
| | | ,null |
| | | ,"127.0.0.1" |
| | | ,JSON.toJSONString(headParam) |
| | | ,response |
| | | ,true |
| | | ); |
| | | }catch (Exception e){ |
| | | log.error("wcs手动完成任务上报wms失{},返回值={}", taskWrk,response); |
| | | // throw new CoolException(e); |
| | | } |
| | | locMastService.updateById(locMast); |
| | | taskWrk.setStatus(7);//手动完成任务 |
| | | taskWrk.setModiTime(new Date()); |
| | |
| | | }catch (Exception e){ |
| | | taskWrk.setModiUser(9999L);//操作员 |
| | | } |
| | | String response=""; |
| | | try{ |
| | | HashMap<String, Object> headParam = new HashMap<>(); |
| | | headParam.put("TaskNo",taskWrk.getTaskNo()); |
| | | headParam.put("Result",0); |
| | | // headParam.put("reportTime",new Date()); |
| | | |
| | | log.info("wcs手动取消任务上报wm={}", taskWrk); |
| | | response = new HttpHandler.Builder() |
| | | // .setHeaders(headParam) |
| | | .setUri(wmsUrl) |
| | | .setPath(TaskExecCallback) |
| | | .setJson(JSON.toJSONString(headParam)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | apiLogService.save("wcs手动取消任务上报wms" |
| | | ,wmsUrl+TaskExecCallback |
| | | ,null |
| | | ,"127.0.0.1" |
| | | ,JSON.toJSONString(headParam) |
| | | ,response |
| | | ,true |
| | | ); |
| | | }catch (Exception e){ |
| | | log.error("wcs手动取消任务上报wms失败={},返回值={}", taskWrk,response); |
| | | // throw new CoolException(e); |
| | | } |
| | | taskWrk.setCompleteTime(now);//完结时间 |
| | | taskWrkService.updateById(taskWrk); |
| | | return R.ok(); |