| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | |
| | | import com.zy.asrs.domain.vo.CrnStateTableVo; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.mapper.BasCrnErrorMapper; |
| | | import com.zy.asrs.service.ApiLogService; |
| | | import com.zy.asrs.service.BasCrnpService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.service.impl.MainServiceImpl; |
| | | import com.zy.asrs.utils.CommandUtils; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.core.CrnThread; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.OutputQueue; |
| | |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.properties.SystemProperties; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.hibernate.validator.internal.engine.messageinterpolation.parser.ELState; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | @RestController |
| | | public class CrnController { |
| | | |
| | | @Value("${wms.url}") |
| | | private String wmsUrl; |
| | | @Value("${wms.movePath}") |
| | | private String movePath; |
| | | |
| | | |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | @Autowired |
| | | private SlaveProperties slaveProperties; |
| | | @Autowired |
| | |
| | | vo.setLiftPos(crnProtocol.getLiftPosType().desc); |
| | | vo.setWalkPos(crnProtocol.getWalkPos()==1?"不在定位":"在定位"); |
| | | vo.setWarnCode(String.valueOf(crnProtocol.getAlarm1())); |
| | | if (crnProtocol.getAlarm1() > 0) { |
| | | BasCrnError crnError = basCrnErrorMapper.selectById(crnProtocol.getAlarm1()); |
| | | if (crnProtocol.getAlarm() > 0) { |
| | | BasCrnError crnError = basCrnErrorMapper.selectById(crnProtocol.getAlarm()); |
| | | vo.setAlarm(crnError==null?"未知异常":crnError.getErrName()); |
| | | } |
| | | } |
| | |
| | | @ManagerAuth(memo = "入库") |
| | | @PostMapping("/crn/operator/put") |
| | | public R crnPut(CrnOperatorParam param){ |
| | | // // 系统运行状态判断 |
| | | // if (SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | // return R.error("wcs系统状态为开启"); |
| | | // } |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | | command.setAckFinish((short) 0); // 任务完成确认位 |
| | | command.setTaskMode(CrnTaskModeType.PAKIN); // 任务模式 |
| | | command.setSourcePosX(param.getSourceRow()); // 源库位排 |
| | | command.setSourcePosY(param.getSourceBay()); // 源库位列 |
| | | command.setSourcePosZ(param.getSourceLev()); // 源库位层 |
| | | command.setDestinationPosX(param.getRow()); // 目标库位排 |
| | | command.setDestinationPosY(param.getBay()); // 目标库位列 |
| | | command.setDestinationPosZ(param.getLev()); // 目标库位层 |
| | | command.setSourcePosZ(param.getSourceRow()); // 源库位排 |
| | | command.setSourcePosX(param.getSourceBay()); // 源库位列 |
| | | command.setSourcePosY(param.getSourceLev()); // 源库位层 |
| | | command.setDestinationPosZ(param.getRow()); // 目标库位排 |
| | | command.setDestinationPosX(param.getBay()); // 目标库位列 |
| | | command.setDestinationPosY(param.getLev()); // 目标库位层 |
| | | command.setCommand((short)1); |
| | | String locNo =String.format("%2d",param.getRow()) + String.format("%3d",param.getBay()) + String.format("%2d",param.getLev()); |
| | | String startlocNo =String.format("%2d",param.getSourceRow()) + String.format("%3d",param.getSourceBay()) + String.format("%2d",param.getSourceLev()); |
| | | boolean wmsLocStatus = toWmsLocStatus(1, startlocNo, locNo, param.getBarcode(), param.getBarcodeType(), param.getEmptyContainer()); |
| | | if (!wmsLocStatus){ |
| | | return R.error("库位更新失败"); |
| | | } |
| | | return crnControl(command)?R.ok():R.error(); |
| | | } |
| | | |
| | | @ManagerAuth(memo = "出库") |
| | | @PostMapping("/crn/operator/take") |
| | | public R crnTake(CrnOperatorParam param){ |
| | | // 系统运行状态判断 |
| | | // if (SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | // return R.error("wcs系统状态为开启"); |
| | | // } |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | | command.setAckFinish((short) 0); // 任务完成确认位 |
| | | command.setTaskMode(CrnTaskModeType.PAKOUT); // 任务模式 |
| | | command.setSourcePosX(param.getSourceRow()); // 源库位排 |
| | | command.setSourcePosY(param.getSourceBay()); // 源库位列 |
| | | command.setSourcePosZ(param.getSourceLev()); // 源库位层 |
| | | command.setDestinationPosX(param.getRow()); // 目标库位排 |
| | | command.setDestinationPosY(param.getBay()); // 目标库位列 |
| | | command.setDestinationPosZ(param.getLev()); // 目标库位层 |
| | | command.setSourcePosZ(param.getSourceRow()); // 源库位排 |
| | | command.setSourcePosX(param.getSourceBay()); // 源库位列 |
| | | command.setSourcePosY(param.getSourceLev()); // 源库位层 |
| | | command.setDestinationPosZ(param.getRow()); // 目标库位排 |
| | | command.setDestinationPosX(param.getBay()); // 目标库位列 |
| | | command.setDestinationPosY(param.getLev()); // 目标库位层 |
| | | String locNo =String.format("%2d",param.getRow()) + String.format("%3d",param.getBay()) + String.format("%2d",param.getLev()); |
| | | String startlocNo =String.format("%2d",param.getSourceRow()) + String.format("%3d",param.getSourceBay()) + String.format("%2d",param.getSourceLev()); |
| | | boolean wmsLocStatus = toWmsLocStatus(2, startlocNo, locNo, param.getBarcode(), param.getBarcodeType(), param.getEmptyContainer()); |
| | | if (!wmsLocStatus){ |
| | | return R.error("库位更新失败"); |
| | | } |
| | | return crnControl(command)?R.ok():R.error(); |
| | | } |
| | | |
| | | @ManagerAuth(memo = "库位转移") |
| | | @PostMapping("/crn/operator/stockMove") |
| | | public R crnStockMove(CrnOperatorParam param){ |
| | | // 系统运行状态判断 |
| | | // if (SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | // return R.error("wcs系统状态为开启"); |
| | | // } |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | | command.setAckFinish((short) 0); // 任务完成确认位 |
| | | command.setTaskMode(CrnTaskModeType.LOC_MOVE); // 任务模式 |
| | | command.setSourcePosX(param.getSourceRow()); // 源库位排 |
| | | command.setSourcePosY(param.getSourceBay()); // 源库位列 |
| | | command.setSourcePosZ(param.getSourceLev()); // 源库位层 |
| | | command.setDestinationPosX(param.getRow()); // 目标库位排 |
| | | command.setDestinationPosY(param.getBay()); // 目标库位列 |
| | | command.setDestinationPosZ(param.getLev()); // 目标库位层 |
| | | command.setSourcePosZ(param.getSourceRow()); // 源库位排 |
| | | command.setSourcePosX(param.getSourceBay()); // 源库位列 |
| | | command.setSourcePosY(param.getSourceLev()); // 源库位层 |
| | | command.setDestinationPosZ(param.getRow()); // 目标库位排 |
| | | command.setDestinationPosX(param.getBay()); // 目标库位列 |
| | | command.setDestinationPosY(param.getLev()); // 目标库位层 |
| | | command.setCommand((short)1); |
| | | LocMast sourceLoc = locMastService.selectOne(new EntityWrapper<LocMast>().eq("row1", command.getSourcePosX()) |
| | | .eq("bay1", command.getSourcePosY()).eq("lev1", command.getSourcePosZ())); |
| | | LocMast loc = locMastService.selectOne(new EntityWrapper<LocMast>().eq("row1", command.getDestinationPosX()) |
| | | .eq("bay1", command.getDestinationPosY()).eq("lev1", command.getDestinationPosZ())); |
| | | VersionUtils.locMoveCheckLocType(sourceLoc, loc); |
| | | String locNo =String.format("%2d",param.getRow()) + String.format("%3d",param.getBay()) + String.format("%2d",param.getLev()); |
| | | String startlocNo =String.format("%2d",param.getSourceRow()) + String.format("%3d",param.getSourceBay()) + String.format("%2d",param.getSourceLev()); |
| | | boolean wmsLocStatus = toWmsLocStatus(3, startlocNo, locNo, param.getBarcode(), param.getBarcodeType(), param.getEmptyContainer()); |
| | | if (!wmsLocStatus){ |
| | | return R.error("库位更新失败"); |
| | | } |
| | | return crnControl(command)?R.ok():R.error(); |
| | | } |
| | | |
| | | @ManagerAuth(memo = "站到站") |
| | | @PostMapping("/crn/operator/siteMove") |
| | | public R crnSiteMove(CrnOperatorParam param){ |
| | | // 系统运行状态判断 |
| | | // if (SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | // return R.error("wcs系统状态为开启"); |
| | | // } |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | |
| | | @ManagerAuth(memo = "回原点") |
| | | @PostMapping("/crn/operator/bacOrigin") |
| | | public R crnBacOrigin(CrnOperatorParam param){ |
| | | // 系统运行状态判断 |
| | | // if (SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | // return R.error("wcs系统状态为开启"); |
| | | // } |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | |
| | | @ManagerAuth(memo = "反原点") |
| | | @PostMapping("/crn/operator/reverseOrigin") |
| | | public R reverseOrigin(CrnOperatorParam param){ |
| | | // 系统运行状态判断 |
| | | // if (SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | // return R.error("wcs系统状态为开启"); |
| | | // } |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | |
| | | command.setSourcePosY((short) 0); // 源库位列 |
| | | command.setSourcePosZ((short) 0); // 源库位层 |
| | | command.setDestinationPosX((short) 0); // 目标库位排 |
| | | command.setDestinationPosY((short) 34); // 目标库位列 |
| | | command.setDestinationPosZ((short) 5); // 目标库位层 |
| | | command.setDestinationPosY((short) 22); // 目标库位列 |
| | | command.setDestinationPosZ((short) 1); // 目标库位层 |
| | | return crnControl(command)?R.ok():R.error(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth(memo = "任务完成") |
| | | @PostMapping("/crn/operator/taskComplete") |
| | | public R crnTaskComplete(CrnOperatorParam param){ |
| | | // 系统运行状态判断 |
| | | // if (SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | // return R.error("wcs系统状态为开启"); |
| | | // } |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | |
| | | @ManagerAuth(memo = "清除命令") |
| | | @PostMapping("/crn/operator/clearCommand") |
| | | public R crnClearCommand(CrnOperatorParam param){ |
| | | // 系统运行状态判断 |
| | | // if (SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | // return R.error("wcs系统状态为开启"); |
| | | // } |
| | | if (param.getCrnNo() == null) { |
| | | throw new CoolException("请选择堆垛机"); |
| | | } |
| | |
| | | @ManagerAuth(memo = "手动复位") |
| | | @PostMapping("/crn/operator/handleReset") |
| | | public R handleReset(CrnOperatorParam param) throws Exception { |
| | | // 系统运行状态判断 |
| | | // if (SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | // return R.error("wcs系统状态为开启"); |
| | | // } |
| | | if (param.getCrnNo() == null) { |
| | | throw new CoolException("请选择堆垛机"); |
| | | } |
| | |
| | | crnCommand.setCommand((short) 0); // 任务完成确认位 |
| | | // 延时发送 |
| | | Thread.sleep(1000L); |
| | | if (MessageQueue.offer(SlaveType.Crn, crn.getId(), new Task(2, crnCommand))) { |
| | | if (CommandUtils.offer(SlaveType.Crn, crn.getId(), new Task(5, crnCommand), false)) { |
| | | return R.ok(); |
| | | } else { |
| | | throw new CoolException("命令下发失败"); |
| | |
| | | |
| | | return R.error(); |
| | | } |
| | | |
| | | @ManagerAuth(memo = "切换联机模式") |
| | | @PostMapping("/crn/operator/auto") |
| | | public R crnAuto(CrnOperatorParam param){ |
| | | // 系统运行状态判断 |
| | | // if (SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | // return R.error("wcs系统状态为开启"); |
| | | // } |
| | | short[] array = new short[9]; |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | | command.setAuto((short)1); |
| | | |
| | | return crnControl2(command)?R.ok():R.error(); |
| | | } |
| | | @ManagerAuth(memo = "切换半手动模式") |
| | | @PostMapping("/crn/operator/semiAutomatic") |
| | | public R crnsemiAutomatic(CrnOperatorParam param){ |
| | | // 系统运行状态判断 |
| | | // if (SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | // return R.error("wcs系统状态为开启"); |
| | | // } |
| | | short[] array = new short[9]; |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | | command.setAuto((short)2); |
| | | |
| | | return crnControl2(command)?R.ok():R.error(); |
| | | } |
| | | @ManagerAuth(memo = "切换手动模式") |
| | | @PostMapping("/crn/operator/hand") |
| | | public R onlineWrk1(CrnOperatorParam param){ |
| | | // 系统运行状态判断 |
| | | // if (SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | // return R.error("wcs系统状态为开启"); |
| | | // } |
| | | short[] array = new short[9]; |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | | command.setAuto((short)3); |
| | | |
| | | return crnControl2(command)?R.ok():R.error(); |
| | | } |
| | | @ManagerAuth(memo = "申请完成任务") |
| | | @PostMapping("/crn/operator/onlineWrk1") |
| | | public R onlineWrk2(CrnOperatorParam param){ |
| | | // 系统运行状态判断 |
| | | // if (SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | // return R.error("wcs系统状态为开启"); |
| | | // } |
| | | short[] array = new short[9]; |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | | command.setOnlineWrk1((short)1); |
| | | |
| | | return crnControl2(command)?R.ok():R.error(); |
| | | } |
| | | @ManagerAuth(memo = "申请取消任务") |
| | | @PostMapping("/crn/operator/onlineWrk2") |
| | | public R onlineWrk3(CrnOperatorParam param){ |
| | | // 系统运行状态判断 |
| | | // if (SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | // return R.error("wcs系统状态为开启"); |
| | | // } |
| | | short[] array = new short[9]; |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | | command.setOnlineWrk2((short)1); |
| | | |
| | | return crnControl2(command)?R.ok():R.error(); |
| | | } |
| | | @ManagerAuth(memo = "清除联机任务") |
| | | @PostMapping("/crn/operator/onlineWrk3") |
| | | public R onlineWrk4(CrnOperatorParam param){ |
| | | // 系统运行状态判断 |
| | | // if (SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | // return R.error("wcs系统状态为开启"); |
| | | // } |
| | | short[] array = new short[9]; |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | | command.setOnlineWrk3((short)1); |
| | | |
| | | return crnControl2(command)?R.ok():R.error(); |
| | | } |
| | | @ManagerAuth(memo = "恢复联机任务") |
| | | @PostMapping("/crn/operator/onlineWrk4") |
| | | public R crnHand(CrnOperatorParam param){ |
| | | // 系统运行状态判断 |
| | | // if (SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | // return R.error("wcs系统状态为开启"); |
| | | // } |
| | | short[] array = new short[9]; |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | | command.setOnlineWrk4((short)1); |
| | | |
| | | return crnControl2(command)?R.ok():R.error(); |
| | | } |
| | | |
| | | @ManagerAuth(memo = "复位") |
| | | @PostMapping("/crn/operator/reset") |
| | | public R crnReset(CrnOperatorParam param){ |
| | | // 系统运行状态判断 |
| | | // if (SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | // return R.error("wcs系统状态为开启"); |
| | | // } |
| | | short[] array = new short[9]; |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | | command.setReset((short)1); |
| | | |
| | | return crnControl2(command)?R.ok():R.error(); |
| | | } |
| | | |
| | | |
| | | |
| | | private boolean crnControl2(CrnCommand command){ |
| | | if (command.getCrnNo() == null) { |
| | | throw new CoolException("请选择堆垛机"); |
| | | } |
| | | for (CrnSlave crn : slaveProperties.getCrn()) { |
| | | // 获取堆垛机信息 |
| | | if (command.getCrnNo().equals(crn.getId())) { |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId()); |
| | | if (crnThread == null) { |
| | | throw new CoolException("堆垛机不在线"); |
| | | } |
| | | CrnProtocol crnProtocol = crnThread.getCrnProtocol(); |
| | | if (crnProtocol == null) { |
| | | throw new CoolException("堆垛机不在线"); |
| | | } |
| | | // 空闲判断 |
| | | // if (crnProtocol.getStatusType().equals(com.zy.core.enums.CrnStatusType.IDLE) && crnProtocol.getTaskNo() == 0) { |
| | | if (MessageQueue.offer(SlaveType.Crn, crn.getId(), new Task(4, command))) { |
| | | return true; |
| | | } else { |
| | | throw new CoolException("命令下发失败"); |
| | | } |
| | | // } else { |
| | | // throw new CoolException("堆垛机不在空闲状态"); |
| | | // } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | private boolean crnControl(CrnCommand command){ |
| | | if (command.getCrnNo() == null) { |
| | |
| | | } |
| | | // 空闲判断 |
| | | // if (crnProtocol.getStatusType().equals(com.zy.core.enums.CrnStatusType.IDLE) && crnProtocol.getTaskNo() == 0) { |
| | | if (MessageQueue.offer(SlaveType.Crn, crn.getId(), new Task(2, command))) { |
| | | return true; |
| | | } else { |
| | | throw new CoolException("命令下发失败"); |
| | | } |
| | | if (CommandUtils.offer(SlaveType.Crn, crn.getId(), new Task(2, command), false)) { |
| | | return true; |
| | | } else { |
| | | throw new CoolException("命令下发失败"); |
| | | } |
| | | // } else { |
| | | // throw new CoolException("堆垛机不在空闲状态"); |
| | | // } |
| | |
| | | return R.ok().add(list); |
| | | } |
| | | |
| | | public boolean toWmsLocStatus(Integer type,String startlocNo,String locNo,String barcode,String barcodeType,String emptyContainer){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("x-api-key","7a15b5db-29b6-552c-8cff-0cfec3756da2"); |
| | | WmsLocStatus param = new WmsLocStatus(); |
| | | param.setWarehouseId("1688469798893297665"); |
| | | param.setLocationCode(Utils.getWmsLocNo(locNo)); |
| | | if (emptyContainer.equals("1")){ |
| | | param.setEmptyContainer("Y"); |
| | | }else { |
| | | param.setEmptyContainer("N"); |
| | | } |
| | | param.setStatus("QY"); |
| | | param.setContainerCode(barcode); |
| | | param.setContainerTypeCode(barcodeType); |
| | | |
| | | String response = null; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setHeaders(map) |
| | | .setUri(wmsUrl) |
| | | .setPath("wcsManager/wcsInterface/locationUpdate") |
| | | .setJson(JSON.toJSONString(param)) |
| | | .build() |
| | | .doPost(); |
| | | }catch (Exception e){ |
| | | log.error("库位更新失败"); |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code").equals(200)){ |
| | | LocMast originLoc = locMastService.selectByLocNo(startlocNo); |
| | | LocMast locMast = locMastService.selectByLocNo(locNo); |
| | | if (type == 1){ |
| | | locMast.setBarcode(barcode); |
| | | locMast.setLocSts("Z"); |
| | | locMastService.updateById(locMast); |
| | | }else if (type == 2){ |
| | | originLoc.setLocSts("K"); |
| | | originLoc.setBarcode(""); |
| | | locMastService.updateById(originLoc); |
| | | }else if (type == 3){ |
| | | originLoc.setLocSts("K"); |
| | | originLoc.setBarcode(""); |
| | | locMast.setBarcode(barcode); |
| | | locMast.setLocSts("Z"); |
| | | locMastService.updateById(originLoc); |
| | | locMastService.updateById(locMast); |
| | | } |
| | | |
| | | apiLogService.save("Wms变更货位状态" |
| | | ,wmsUrl+"wcsManager/wcsInterface/inboundTaskApply" |
| | | ,null |
| | | ,"127.0.0.1" |
| | | ,JSON.toJSONString(param) |
| | | ,response |
| | | ,true |
| | | ); |
| | | return true; |
| | | } |
| | | return false; |
| | | |
| | | } |
| | | |
| | | |
| | | } |