| | |
| | | import com.zy.core.model.Task; |
| | | import com.zy.core.model.protocol.StaProtocol; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class OpenServiceImpl implements OpenService { |
| | | |
| | |
| | | taskWrk.setIoPri(param.getTaskPriority());//优先级 |
| | | taskWrk.setBarcode(param.getBarcode());//条码 |
| | | taskWrk.setCrnNo(param.getCrn()); |
| | | String stats = ""; |
| | | String wcsLocNo = ""; |
| | | if(param.getIoType() == 1){ |
| | | taskWrk.setWrkSts(1); |
| | | if (!Cools.isEmpty(param.getTargetPoint())) { |
| | | taskWrk.setTargetPoint(Utils.getWcsLocNo(param.getTargetPoint()));//终点 |
| | | wcsLocNo = taskWrk.getTargetPoint(); |
| | | taskWrk.setOriginTargetPoint(param.getTargetPoint()); |
| | | stats = "S"; |
| | | } |
| | | |
| | | } else if (param.getIoType() == 2) { |
| | | taskWrk.setWrkSts(11); |
| | | if (!Cools.isEmpty(param.getStartPoint())) { |
| | | taskWrk.setStartPoint(Utils.getWcsLocNo(param.getStartPoint()));//起点 |
| | | wcsLocNo = taskWrk.getStartPoint(); |
| | | taskWrk.setOriginStartPoint(param.getStartPoint()); |
| | | stats = "R"; |
| | | } |
| | | taskWrk.setTargetPoint(param.getTargetPoint()); |
| | | }else if (param.getIoType() == 3){ |
| | | taskWrk.setWrkSts(11); |
| | | if (!Cools.isEmpty(param.getStartPoint())) { |
| | | taskWrk.setStartPoint(Utils.getWcsLocNo(param.getStartPoint()));//起点 |
| | | wcsLocNo = taskWrk.getStartPoint(); |
| | | taskWrk.setOriginStartPoint(param.getStartPoint()); |
| | | stats = "R"; |
| | | } |
| | | } |
| | | |
| | |
| | | if (!Cools.isEmpty(param.getMemo())) { |
| | | taskWrk.setMemo(param.getMemo());//备注 |
| | | } |
| | | |
| | | // 更新库位状态 |
| | | LocMast locMast = locMastService.selectByLocNo(wcsLocNo); |
| | | locMast.setLocSts(stats); |
| | | locMastService.updateById(locMast); |
| | | |
| | | if (!taskWrkService.insert(taskWrk)) { |
| | | return R.error("创建任务失败"); |
| | |
| | | list = getInEnableRoadway(); |
| | | }else { |
| | | list = getInEnableRoadway2(); |
| | | } |
| | | |
| | | if (Cools.isEmpty(list)){ |
| | | log.warn("无可入巷道,请稍后再试"); |
| | | return R.error("无可入巷道"); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | |
| | | apiLogService.save("wms请求入库码头接口" |
| | | apiLogService.save("请求入库码头接口" |
| | | ,wmsUrl+"wcsManager/wcsInterface/inboundTaskApply" |
| | | ,null |
| | | ,"127.0.0.1" |
| | |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | Short workNo = staProtocol.getWorkNo(); |
| | | if (workNo == 0 && !staProtocol.isLoading()){ |
| | | if (workNo == 0 && !staProtocol.isLoading() && staProtocol.isAutoing()){ |
| | | if (Cools.isEmpty( map.get(inSta.getStaNo()))){ |
| | | continue; |
| | | } |