| | |
| | | package com.zy.api.controller; |
| | | |
| | | import com.core.common.R; |
| | | import com.zy.api.controller.params.AgvCallBackParam; |
| | | import com.zy.api.entity.CallAgvParams; |
| | | import com.zy.api.service.AgvScheduleService; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | return agvScheduleService.callAgvCarry(params); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * AGV任务完成 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @ApiOperation("agv搬运结果回传") |
| | | @PostMapping("/agv/result/callback") |
| | | public R agvCarryCallBack(@RequestBody CallAgvParams params) { |
| | | public R agvCarryCallBack(@RequestBody AgvCallBackParam params) { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| New file |
| | |
| | | package com.zy.api.controller.params; |
| | | |
| | | import com.alibaba.excel.annotation.format.DateTimeFormat; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | public class AgvCallBackItemParam implements Serializable { |
| | | |
| | | |
| | | private CallBackItem values; |
| | | |
| | | // { |
| | | // "robotTaskCode": "5685", |
| | | // "singleRobotCode": "8857", |
| | | // "currentSeq": -1, |
| | | // "extra": { |
| | | // "async": "0", |
| | | // "values": { |
| | | // "mapCode": "DD", |
| | | // "slotCategory": "SITE", |
| | | // "slotCode": "286260DD305240", |
| | | // "slotName": "JH06", |
| | | // "x": 286260.0, |
| | | // "y": 305240.0, |
| | | // "method": "start", |
| | | // "carrierCategory": "POD", |
| | | // "carrierType": "TC", |
| | | // "carrierCode": "TC10104", |
| | | // "pileCount": 1, |
| | | // "taskTime": "2026-02-12 15:59:45.704", |
| | | // "amrCategory": "LMR", |
| | | // "amrType": "17", |
| | | // "amrCode": "8857", |
| | | // "carrierName": "TC10104", |
| | | // "layerNo": 1 |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.api.controller.params; |
| | | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | public class AgvCallBackParam implements Serializable { |
| | | |
| | | private String robotTaskCode; |
| | | |
| | | private AgvCallBackItemParam extra; |
| | | } |
| New file |
| | |
| | | package com.zy.api.controller.params; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "AgvCarriesParam", description = "AGV搬运参数") |
| | | public class AgvCarriesParam implements Serializable { |
| | | |
| | | private Integer autoStart = 1; |
| | | |
| | | private String code; |
| | | |
| | | private Integer seq; |
| | | |
| | | private String type = "SITE"; |
| | | } |
| New file |
| | |
| | | package com.zy.api.controller.params; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "AgvRequestParam", description = "Agv请求参数") |
| | | public class AgvRequestParam implements Serializable { |
| | | |
| | | //任务类型 |
| | | private String taskType; |
| | | |
| | | //任务执行清单 |
| | | private List<AgvCarriesParam> targetRoute; |
| | | |
| | | //任务号 |
| | | private String robotTaskCode; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.api.controller.params; |
| | | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | public class CallBackItem implements Serializable { |
| | | |
| | | private String slotName; |
| | | |
| | | private String method; |
| | | |
| | | private String carrierCode; |
| | | |
| | | private String taskTime; |
| | | |
| | | private String carrierName; |
| | | |
| | | // "values": { |
| | | // "mapCode": "DD", |
| | | // "slotCategory": "SITE", |
| | | // "slotCode": "286260DD305240", |
| | | // "slotName": "JH06", |
| | | // "x": 286260.0, |
| | | // "y": 305240.0, |
| | | // "method": "start", |
| | | // "carrierCategory": "POD", |
| | | // "carrierType": "TC", |
| | | // "carrierCode": "TC10104", |
| | | // "pileCount": 1, |
| | | // "taskTime": "2026-02-12 15:59:45.704", |
| | | // "amrCategory": "LMR", |
| | | // "amrType": "17", |
| | | // "amrCode": "8857", |
| | | // "carrierName": "TC10104", |
| | | // "layerNo": 1 |
| | | // } |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("任务号") |
| | | private String wrkNo; |
| | | |
| | | @ApiModelProperty("任务类型") |
| | | private String taskType = "M2"; |
| | | } |
| | |
| | | |
| | | public static Long getTag(String type) { |
| | | if (type.equals(MatType.LARGE.type)) { |
| | | return Long.parseLong(MatLocType.AUTOMATED.type); |
| | | return Long.parseLong(MatLocType.EO_HOLDING.type); |
| | | } else if (type.equals(MatType.MIDDEL.type)) { |
| | | return Long.parseLong(MatLocType.SO_HOLDING.type); |
| | | } else if (type.equals(MatType.SMALL.type)) { |
| | | return Long.parseLong(MatLocType.EO_HOLDING.type); |
| | | return Long.parseLong(MatLocType.AUTOMATED.type); |
| | | } else { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public static String getMatTag(String type) { |
| | | if (type.equals(MatLocType.AUTOMATED.type)) { |
| | | if (type.equals(MatLocType.EO_HOLDING.type)) { |
| | | return MatType.LARGE.type; |
| | | } else if (type.equals(MatLocType.SO_HOLDING.type)) { |
| | | return MatType.MIDDEL.type; |
| | | } else if (type.equals(MatLocType.EO_HOLDING.type)) { |
| | | } else if (type.equals(MatLocType.AUTOMATED.type)) { |
| | | return MatType.SMALL.type; |
| | | } else { |
| | | return null; |
| | |
| | | package com.zy.api.service; |
| | | |
| | | import com.core.common.R; |
| | | import com.zy.api.controller.params.AgvCallBackParam; |
| | | import com.zy.api.entity.CallAgvParams; |
| | | |
| | | public interface AgvScheduleService { |
| | | |
| | | R callAgvCarry(CallAgvParams params); |
| | | |
| | | R callback(CallAgvParams params); |
| | | R callback(AgvCallBackParam params); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.api.controller.params.AgvCallBackParam; |
| | | import com.zy.api.controller.params.AgvCarriesParam; |
| | | import com.zy.api.controller.params.AgvRequestParam; |
| | | import com.zy.api.entity.CallAgvParams; |
| | | import com.zy.api.enums.OrderType; |
| | | import com.zy.api.service.AgvScheduleService; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.UUID; |
| | | import java.util.*; |
| | | |
| | | @Slf4j |
| | | @Service |
| | |
| | | task.setWrkSts(TaskStatusType.AGV_TASK_ISSUED_OUT.type); |
| | | } |
| | | |
| | | HIKResultDTO hikResultDTO = sendAgvTask(params, HIKApiConstant.TASK_SUBMIT); |
| | | |
| | | if (hikResultDTO.isSuccess()) { |
| | | if (!taskService.updateById(task)) { |
| | | throw new CoolException("任务状态更新失败!!"); |
| | | } |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 获取自定义请求头 |
| | | * |
| | | * @return java.util.Map<java.lang.String, java.lang.Object> |
| | | * @author Ryan |
| | | * @date 2025/12/29 9:11 |
| | | */ |
| | | private Map<String, Object> getHeaderParam() { |
| | | Map<String, Object> headerParam = new HashMap<>(); |
| | | //设置请求连接的Token |
| | | headerParam.put("X-LR-REQUEST-ID", new Date().getTime() + ""); |
| | | return headerParam; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R callback(CallAgvParams params) { |
| | | public R callback(AgvCallBackParam params) { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getWrkNo())) { |
| | | if (Objects.isNull(params.getRobotTaskCode())) { |
| | | return R.error("任务号不能为空!!"); |
| | | } |
| | | Task task = taskService.selectOne(new EntityWrapper<Task>().eq("wrk_no", params.getWrkNo())); |
| | | Task task = taskService.selectOne(new EntityWrapper<Task>().eq("wrk_no", params.getRobotTaskCode())); |
| | | if (Objects.isNull(task)) { |
| | | return R.error("任务信息不存在!!"); |
| | | } |
| | | |
| | | // if (!Arrays.asList(TaskStatusType.AGV_TASK_ISSUED_IN.type, TaskStatusType.AGV_TASK_ISSUED_OUT.type).contains(task.getIoType())) { |
| | | // return R.error(""); |
| | | // } |
| | | // |
| | | if (Arrays.asList(TaskIOType.ALL_IN.type, TaskIOType.PICK_IN.type, TaskIOType.MERGE_IN.type) |
| | | .contains(task.getIoType())) { |
| | | // 入库 |
| | | if (params.getStatus().equals("RUNNING")) { |
| | | if (params.getExtra().getValues().getMethod().equals("start")) { |
| | | task.setWrkSts(TaskStatusType.AGV_TASK_RUNNING_IN.type); |
| | | } else if (params.getStatus().equals("FINISHED")){ |
| | | } else if (params.getExtra().getValues().getMethod().equals("end")){ |
| | | task.setWrkSts(TaskStatusType.AGV_TASK_FINISHED_IN.type); |
| | | |
| | | } |
| | | } else if (Arrays.asList(TaskIOType.ALL_OUT.type, TaskIOType.PICK_OUT.type, TaskIOType.MERGE_OUT.type, TaskIOType.EMPTY_OUT.type) |
| | | .contains(task.getIoType())) { |
| | | // 出库 |
| | | if (params.getStatus().equals("RUNNING")) { |
| | | // 出库p |
| | | if (params.getExtra().getValues().getMethod().equals("start")) { |
| | | task.setWrkSts(TaskStatusType.AGV_TASK_RUNNING_OUT.type); |
| | | } else if (params.getStatus().equals("FINISHED")){ |
| | | } else if (params.getExtra().getValues().getMethod().equals("end")){ |
| | | task.setWrkSts(TaskStatusType.AGV_TASK_FINISHED_OUT.type); |
| | | } |
| | | } |
| | |
| | | if (!taskService.updateById(task)) { |
| | | throw new CoolException("状态修改失败!!"); |
| | | } |
| | | |
| | | return R.ok("执行完成 !!"); |
| | | } |
| | | |
| | | public HIKResultDTO sendAgvTask(HIKApiDTO haiKangApiDTO, String path) { |
| | | public HIKResultDTO sendAgvTask(CallAgvParams param, String path) { |
| | | HIKResultDTO result = new HIKResultDTO(); |
| | | ForwardAGVTaskDTO forwardAGVTaskParam = new ForwardAGVTaskDTO(); |
| | | forwardAGVTaskParam.setReqCode(UUID.randomUUID().toString().replace("-", "")); |
| | | forwardAGVTaskParam.setClientCode("IWMS"); |
| | | forwardAGVTaskParam.setTaskTyp(haiKangApiDTO.getTaskType()); |
| | | forwardAGVTaskParam.setCtnrTyp(haiKangApiDTO.getCtnrType()); |
| | | forwardAGVTaskParam.setPriority(haiKangApiDTO.getPriority()); |
| | | List<ForwardAGVTaskDTO.PositionCodePaths> positionCodePathsList = new ArrayList<>(); |
| | | positionCodePathsList |
| | | .add(new ForwardAGVTaskDTO.PositionCodePaths(haiKangApiDTO.getOrg(), haiKangApiDTO.getOrgType())); |
| | | positionCodePathsList |
| | | .add(new ForwardAGVTaskDTO.PositionCodePaths(haiKangApiDTO.getTar(), haiKangApiDTO.getTarType())); |
| | | forwardAGVTaskParam.setPositionCodePath(positionCodePathsList); |
| | | String body = JSON.toJSONString(forwardAGVTaskParam); |
| | | AgvRequestParam requestParam = new AgvRequestParam(); |
| | | requestParam.setTaskType(param.getTaskType()); |
| | | List<AgvCarriesParam> agvCarriesParams = new ArrayList<>(); |
| | | |
| | | AgvCarriesParam carriesParam = new AgvCarriesParam(); |
| | | carriesParam.setSeq(0); |
| | | carriesParam.setCode(param.getOrgSite()); |
| | | |
| | | agvCarriesParams.add(carriesParam); |
| | | |
| | | AgvCarriesParam carriesParam2 = new AgvCarriesParam(); |
| | | carriesParam2.setSeq(1); |
| | | carriesParam2.setCode(param.getTarSite()); |
| | | |
| | | agvCarriesParams.add(carriesParam2); |
| | | |
| | | requestParam.setRobotTaskCode(param.getWrkNo()); |
| | | requestParam.setTargetRoute(agvCarriesParams); |
| | | |
| | | String body = JSON.toJSONString(requestParam); |
| | | String response = ""; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(HIKApiConstant.AGV_IP) |
| | | .setPath(path) |
| | | .setHeaders(getHeaderParam()) |
| | | .setJson(body) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code").equals(0)) { |
| | | if (jsonObject.getString("code").equals("SUCCESS")) { |
| | | result.setSuccess(true); |
| | | } else { |
| | | result.setMessage(jsonObject.getString("message")); |
| | |
| | | import com.zy.asrs.service.*; |
| | | |
| | | import com.zy.asrs.service.impl.BasAreasServiceImpl; |
| | | import com.zy.asrs.service.impl.OrderDetlPakinServiceImpl; |
| | | import com.zy.asrs.service.impl.OrderPakinServiceImpl; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | private String prefix; |
| | | @Autowired |
| | | private BasAreasService basAreasService; |
| | | @Autowired |
| | | private OrderPakinService orderPakinService; |
| | | @Autowired |
| | | private OrderDetlPakinService orderDetlPakinService; |
| | | |
| | | |
| | | /** |
| | |
| | | if (Objects.isNull(params.getCompany_id())) { |
| | | throw new CoolException("公司ID不能为空!!"); |
| | | } |
| | | |
| | | addOrUpdateOrders(params, type); |
| | | }); |
| | | |
| | |
| | | /** 不存在,新增订单 */ |
| | | generateOrders(params, type); |
| | | } else { |
| | | if (order.getSettle() == 2) { |
| | | OrderPakin orderPakin = orderPakinService.selectOne(new EntityWrapper<OrderPakin>().eq("order_no", order.getOrderNo())); |
| | | if (!Objects.isNull(orderPakin) && orderPakin.getSettle() != 1) { |
| | | throw new CoolException("订单已处理,不可再变更!!"); |
| | | } |
| | | /** 存在,删除老订单,更新插入新订单 */ |
| | | // 删除旧订单明细 |
| | | if (!orderDetlService.delete(new EntityWrapper<OrderDetl>().eq("order_id", order.getId()))) { |
| | | throw new CoolException("订单明细删除失败!!"); |
| | | if (!orderDetlPakinService.delete(new EntityWrapper<OrderDetlPakin>().eq("order_no", orderPakin.getOrderNo()))) { |
| | | throw new CoolException("订单删除失败!!"); |
| | | } |
| | | |
| | | if (!orderService.deleteById(order.getId())) { |
| | | if (!orderPakinService.delete(new EntityWrapper<OrderPakin>().eq("order_no", orderPakin.getOrderNo()))) { |
| | | throw new CoolException("主单删除失败!!"); |
| | | } |
| | | // 删除旧订单明细 |
| | | // if (!orderDetlService.delete(new EntityWrapper<OrderDetl>().eq("order_id", order.getId()))) { |
| | | // throw new CoolException("订单明细删除失败!!"); |
| | | // } |
| | | |
| | | order.setSettle(3L); |
| | | if (!orderService.updateById(order)) { |
| | | throw new CoolException("原单据删除失败!!"); |
| | | } |
| | | generateOrders(params, type); |
| | | // generateOrders(params, type); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | if (!Objects.isNull(params.getDetails()) && !params.getDetails().isEmpty()) { |
| | | params.getDetails().forEach(item -> { |
| | | Mat matnr = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", item.getPro_komcode())); |
| | | Mat matnr = matService.selectOne(new EntityWrapper<Mat>() |
| | | .eq("supp_code", item.getPro_id()) |
| | | .eq("matnr", item.getPro_komcode())); |
| | | if (Objects.isNull(matnr)) { |
| | | throw new CoolException("物料编码不存在!!"); |
| | | } |
| | |
| | | } else { |
| | | locDetlDto.setStock_qty(Integer.parseInt(item.getBookQty().toString())); |
| | | } |
| | | LocDetl barcode = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("barcode", item.getZpallet())); |
| | | LocDetl barcode = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("zpallet", item.getZpallet())); |
| | | if (!Objects.isNull(barcode)) { |
| | | BasAreas areas = basAreasService.selectOne(new EntityWrapper<BasAreas>().eq("id", barcode.getAreaId())); |
| | | if (!Objects.isNull(areas)) { |
| | | locDetlDto.setLocation_no(areas.getName()); |
| | | locDetlDto.setTarget_location(areas.getName()); |
| | | } |
| | | } |
| | | locDetlDto |
| | | .setPro_komcode(item.getMatnr()) |
| | | .setPro_id(item.getStandby1()) |
| | | .setLocation_no(item.getZpallet()) |
| | | .setTarget_location(""); |
| | | .setLocation_no(item.getZpallet()); |
| | | dtos.add(locDetlDto); |
| | | }); |
| | | return XSR.ok(dtos); |
| | |
| | | * @date 2026/1/10 13:58 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R pubWrkToWcs(WorkTaskParams params) { |
| | | if (Objects.isNull(params.getTaskNo())) { |
| | | return R.error("任务号不能为空!!"); |
| | | } |
| | | // if (params.getType().equals("in")) |
| | | // if (Objects.isNull(params.getBarcode())) { |
| | | // return R.error("托盘码不能为空!!"); |
| | | // } |
| | | // if (Objects.isNull(params.getLocNo())) { |
| | | // return R.error("目标库位不能为空!!"); |
| | | // } |
| | | String url = MesConstant.PUB_TASK_IN; |
| | | if (!Objects.isNull(params.getType()) && params.getType().equals("out")) { |
| | | url = MesConstant.PUB_TASK_OUT; |
| | | } |
| | | |
| | | log.info("出库任务下发参数:{}", JSON.toJSONString(params)); |
| | | String response; |
| | | try { |
| | |
| | | .doPost(); |
| | | Map<String, Object> result = JSON.parseObject(response, Map.class); |
| | | |
| | | if (result.get("code").equals(200)) { |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", params.getTaskNo())); |
| | | wrkMast.setWrkSts(12L); |
| | | wrkMastService.updateById(wrkMast); |
| | | if (!wrkMastService.updateById(wrkMast)) { |
| | | throw new CoolException("更新失败!!"); |
| | | } |
| | | if (result.get("code").equals(200)) { |
| | | //TODO 上报是否成功 |
| | | } else { |
| | | return R.error().add(result); |
| | | throw new CoolException("出库下发任务下发失败!!"); |
| | | // return R.error().add(result); |
| | | } |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | |
| | | for (LocDetl locDetl : groupLocDetl.getRecords()) { |
| | | AbnormalLocDetlParam abnormalLocDetlParam = new AbnormalLocDetlParam(); |
| | | Mat mat = matService.selectOne(new EntityWrapper<Mat>() |
| | | .eq("supp_code", locDetl.getStandby1()) |
| | | .eq("matnr", locDetl.getMatnr())); |
| | | if (Cools.isEmpty(mat)) { |
| | | continue; |
| | |
| | | for (LocDetl locDetl : groupLocDetl.getRecords()) { |
| | | AbnormalLocDetlParam abnormalLocDetlParam = new AbnormalLocDetlParam(); |
| | | Mat mat = matService.selectOne(new EntityWrapper<Mat>() |
| | | .eq("supp_code", locDetl.getStandby1()) |
| | | .eq("matnr", locDetl.getMatnr())); |
| | | if (Cools.isEmpty(mat)) { |
| | | continue; |
| | |
| | | |
| | | public String getTag$() { |
| | | MatService service = SpringUtils.getBean(MatService.class); |
| | | Mat order = service.selectOne(new EntityWrapper<Mat>().eq("matnr", this.matnr)); |
| | | Mat order = service.selectOne(new EntityWrapper<Mat>() |
| | | .eq("supp_code", this.suppCode) |
| | | .eq("matnr", this.matnr)); |
| | | if (Cools.isEmpty(order)){ |
| | | return null; |
| | | } |
| | |
| | | |
| | | public String getTag$() { |
| | | MatService service = SpringUtils.getBean(MatService.class); |
| | | Mat order = service.selectOne(new EntityWrapper<Mat>().eq("matnr", this.matnr)); |
| | | Mat order = service.selectOne(new EntityWrapper<Mat>() |
| | | .eq("supp_code", this.suppCode) |
| | | .eq("matnr", this.matnr)); |
| | | if (Cools.isEmpty(order)){ |
| | | return null; |
| | | } |
| | |
| | | |
| | | public String getTag$() { |
| | | MatService service = SpringUtils.getBean(MatService.class); |
| | | Mat order = service.selectOne(new EntityWrapper<Mat>().eq("matnr", this.matnr)); |
| | | Mat order = service.selectOne(new EntityWrapper<Mat>() |
| | | .eq("supp_code", this.suppCode) |
| | | .eq("matnr", this.matnr)); |
| | | if (Cools.isEmpty(order)){ |
| | | return null; |
| | | } |
| | |
| | | |
| | | public String getTag$() { |
| | | MatService service = SpringUtils.getBean(MatService.class); |
| | | Mat order = service.selectOne(new EntityWrapper<Mat>().eq("matnr", this.matnr)); |
| | | Mat order = service.selectOne(new EntityWrapper<Mat>() |
| | | .eq("supp_code", this.suppCode) |
| | | .eq("matnr", this.matnr)); |
| | | if (Cools.isEmpty(order)){ |
| | | return null; |
| | | } |
| | |
| | | |
| | | public String getTag$() { |
| | | MatService service = SpringUtils.getBean(MatService.class); |
| | | Mat order = service.selectOne(new EntityWrapper<Mat>().eq("matnr", this.matnr)); |
| | | Mat order = service.selectOne(new EntityWrapper<Mat>() |
| | | .eq("supp_code", this.suppCode) |
| | | .eq("matnr", this.matnr)); |
| | | if (Cools.isEmpty(order)){ |
| | | return null; |
| | | } |
| | |
| | | |
| | | public String getTag$() { |
| | | MatService service = SpringUtils.getBean(MatService.class); |
| | | Mat order = service.selectOne(new EntityWrapper<Mat>().eq("matnr", this.matnr)); |
| | | Mat order = service.selectOne(new EntityWrapper<Mat>() |
| | | .eq("supp_code", this.suppCode) |
| | | .eq("matnr", this.matnr)); |
| | | if (Cools.isEmpty(order)){ |
| | | return null; |
| | | } |
| | |
| | | * 备用1 |
| | | */ |
| | | @ApiModelProperty(value= "备用1") |
| | | private String standby1 = ""; |
| | | private String standby1; |
| | | |
| | | /** |
| | | * 备用2 |
| | |
| | | */ |
| | | @ApiModelProperty(value= "备用1") |
| | | @TableField("box_type1") |
| | | private String boxType1 = "1"; |
| | | private String boxType1; |
| | | |
| | | /** |
| | | * 备用2 |
| | |
| | | |
| | | public String getTag$() { |
| | | MatService service = SpringUtils.getBean(MatService.class); |
| | | Mat order = service.selectOne(new EntityWrapper<Mat>().eq("matnr", this.matnr)); |
| | | Mat order = service.selectOne(new EntityWrapper<Mat>() |
| | | .eq("supp_code", this.suppCode) |
| | | .eq("matnr", this.matnr)); |
| | | if (Cools.isEmpty(order)){ |
| | | return null; |
| | | } |
| | |
| | | |
| | | public String getTag$() { |
| | | MatService service = SpringUtils.getBean(MatService.class); |
| | | Mat order = service.selectOne(new EntityWrapper<Mat>().eq("matnr", this.matnr)); |
| | | Mat order = service.selectOne(new EntityWrapper<Mat>() |
| | | .eq("supp_code", this.suppCode) |
| | | .eq("matnr", this.matnr)); |
| | | if (Cools.isEmpty(order)){ |
| | | return null; |
| | | } |
| | |
| | | .eq("loc_no", locMast.getLocNo()) |
| | | .eq("matnr", checkOrderDetl.getMatnr()) |
| | | .eq(!Cools.isEmpty(checkOrderDetl.getBatch()),"batch", checkOrderDetl.getBatch()) |
| | | .eq("supp_code", checkOrderDetl.getSuppCode()) |
| | | .eq(!Cools.isEmpty(checkOrderDetl.getSuppCode()),"supp_code", checkOrderDetl.getSuppCode()) |
| | | ); |
| | | if (!Cools.isEmpty(locDetl)){ |
| | | throw new CoolException("当前库位有相同库存信息"); |
| | |
| | | public R initLocCache(LocMastInitParam param, Long userId) { |
| | | try { |
| | | List<LocCache> list = new ArrayList<>(); |
| | | if (!Cools.isEmpty(param.getEnable()) && param.getEnable() == 1) { |
| | | if (!this.delete(new EntityWrapper<>())) { |
| | | throw new CoolException("删除失败!!"); |
| | | } |
| | | } |
| | | BasAreas areas = basAreasService.selectById(param.getIdentifying()); |
| | | if (Cools.isEmpty(areas)) { |
| | | return R.error("库区不存在!!!"); |
| | | } |
| | | for (int r = param.getStartRow(); r <= param.getEndRow(); r++) { |
| | | for (int b = param.getStartBay(); b <= param.getEndBay(); b++) { |
| | | for (int l = param.getStartLev(); l <= param.getEndLev(); l++) { |
| | | // for (int b = param.getStartBay(); b <= param.getEndBay(); b++) { |
| | | // for (int l = param.getStartLev(); l <= param.getEndLev(); l++) { |
| | | // |
| | | // } |
| | | // } |
| | | // 获取库位号 |
| | | String locNo = areas.getAreaNo() + String.format("%02d", r) + String.format("%03d", b) + String.format("%02d", l); |
| | | String locNo = areas.getAreaNo() + String.format("%02d", r); |
| | | Date now = new Date(); |
| | | LocCache locMast = new LocCache(); |
| | | locMast.setLocNo(locNo); |
| | | locMast.setLocSts("O"); |
| | | locMast.setRow1(r); // 排 |
| | | locMast.setBay1(b); // 列 |
| | | locMast.setLev1(l); // 层 |
| | | locMast.setId(null); |
| | | locMast.setBay1(1); // 列 |
| | | locMast.setLev1(1); // 层 |
| | | locMast.setFullPlt("N"); |
| | | locMast.setLocType1(!Cools.isEmpty(param.getLocType1()) ? param.getLocType1() : 1); |
| | | locMast.setLocType2(param.getLocType2()); |
| | | locMast.setLocType3(param.getLocType3()); |
| | |
| | | locMast.setModiTime(now); |
| | | locMast.setAreaId(areas.getId()); |
| | | locMast.setAreaName(areas.getName()); |
| | | list.add(locMast); |
| | | } |
| | | } |
| | | } |
| | | if (!Cools.isEmpty(param.getEnable()) && param.getEnable() == 1) { |
| | | if (!this.delete(new EntityWrapper<>())) { |
| | | throw new CoolException("删除失败!!"); |
| | | // list.add(locMast); |
| | | |
| | | if (!this.insert(locMast)) { |
| | | throw new CoolException("添加失败!!"); |
| | | } |
| | | } |
| | | |
| | | if (!this.insertBatch(list)) { |
| | | throw new CoolException("添加失败!!"); |
| | | } |
| | | return R.ok("初始化成功"); |
| | | } catch (Exception e) { |
| | | return R.error("初始化失败===>" + e.getMessage()); |
| | |
| | | wrkMastService.insert(wrkMast); |
| | | |
| | | for (OrderDetl orderDetl : param.getCombMats()) { |
| | | Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", orderDetl.getMatnr())); |
| | | Mat mat = matService.selectOne(new EntityWrapper<Mat>() |
| | | .eq("supp_code", orderDetl.getStandby1()) |
| | | .eq("matnr", orderDetl.getMatnr())); |
| | | if (mat == null) { |
| | | throw new CoolException("保存工作档失败,物料信息不存在:" + orderDetl.getMatnr()); |
| | | } |
| | |
| | | for (CombParam.CombMat combMat : combParam.getCombMats()) { |
| | | List<LocDetl> locDetlList = locDetlService.selectList(new EntityWrapper<LocDetl>() |
| | | .eq("loc_no", combParam.getLocNo()) |
| | | .eq(!Cools.isEmpty(combMat.getStandby1()), "supp_code", combMat.getStandby1()) |
| | | .eq("matnr", combMat.getMatnr())); |
| | | if (locDetlList.isEmpty()) { |
| | | return R.error("未查询到库存数据"); |
| | |
| | | wrkMast.setModiUser(userId); |
| | | wrkMastService.insert(wrkMast); |
| | | |
| | | Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", combMat.getMatnr())); |
| | | Mat mat = matService.selectOne(new EntityWrapper<Mat>() |
| | | .eq(!Cools.isEmpty(combMat.getStandby1()), "supp_code", combMat.getStandby1()) |
| | | .eq("matnr", combMat.getMatnr())); |
| | | if (mat == null) { |
| | | throw new CoolException("保存工作档失败,物料信息不存在:" + combMat.getMatnr()); |
| | | } |
| | |
| | | // elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3()); |
| | | OrderDetlPakin detls = orderDetlPakinService.selectOne(new EntityWrapper<OrderDetlPakin>() |
| | | .eq("order_id", order.getId()) |
| | | .eq("supp_code", elem.getStandby1()) |
| | | .eq("matnr", elem.getMatnr())); |
| | | if (Objects.isNull(elem.getBoxType1())) { |
| | | throw new CoolException("格层编码不能为空!!"); |
| | |
| | | } |
| | | }); |
| | | |
| | | Set<String> matnrs = detlDtos.stream().map(DetlDto::getMatnr).collect(Collectors.toSet()); |
| | | List<Mat> mats = matService.selectList(new EntityWrapper<Mat>().in("matnr", matnrs)); |
| | | Set<Long> tagIds = mats.stream().map(Mat::getTagId).collect(Collectors.toSet()); |
| | | List<Mat> tempMats = new ArrayList<>(); |
| | | for (DetlDto detlDto : detlDtos) { |
| | | Mat mat = matService.selectOne(new EntityWrapper<Mat>() |
| | | .eq("matnr", detlDto.getMatnr()) |
| | | .eq("supp_code", detlDto.getStandby1())); |
| | | tempMats.add(mat); |
| | | } |
| | | |
| | | // Set<String> matnrs = tempMats.stream().map(Mat::getMatnr).collect(Collectors.toSet()); |
| | | Set<Long> tagIds = tempMats.stream().map(Mat::getTagId).collect(Collectors.toSet()); |
| | | if (tagIds.size() > 1) { |
| | | throw new CoolException("组托物料类型不一致,只有相同的物料分类才可以组托!!"); |
| | | } |
| | |
| | | orderDetl.setUpdateBy(userId); |
| | | orderDetl.setUpdateTime(now); |
| | | Wrapper wrapper = new EntityWrapper<OrderDetl>().eq("order_no", orderNo) |
| | | .eq(!Cools.isEmpty(orderDetl.getStandby1()), "supp_code", orderDetl.getStandby1()) |
| | | .eq("matnr", orderDetl.getMatnr()); |
| | | if (!Cools.isEmpty(orderDetl.getBatch())) { |
| | | wrapper.eq("batch", orderDetl.getBatch()); |
| | |
| | | .eq("area_id", basAreas.getId()) |
| | | .eq("frozen", 0) |
| | | .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type) |
| | | // .eq("loc_no", params.getTarSite()) |
| | | .orderAsc(Arrays.asList("loc_no")) |
| | | .last("OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY")); |
| | | if (Objects.isNull(locCache)) { |
| | |
| | | if (container.getMixMax() < detlDtos.size()) { |
| | | throw new CoolException("超出容器最大混装数量,当前容器最大数量为:" + container.getMixMax() + "!!"); |
| | | } |
| | | Set<String> matnrs = detlDtos.stream().map(DetlDto::getMatnr).collect(Collectors.toSet()); |
| | | List<Mat> mats = matService.selectList(new EntityWrapper<Mat>().in("matnr", matnrs)); |
| | | Set<Long> tagIds = mats.stream().map(Mat::getTagId).collect(Collectors.toSet()); |
| | | List<Mat> tempMats = new ArrayList<>(); |
| | | for (DetlDto detlDto : detlDtos) { |
| | | Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", detlDto.getMatnr()) |
| | | .eq("supp_code", detlDto.getStandby1())); |
| | | tempMats.add(mat); |
| | | } |
| | | Set<Long> tagIds = tempMats.stream().map(Mat::getTagId).collect(Collectors.toSet()); |
| | | if (tagIds.size() > 1) { |
| | | throw new CoolException("组托物料类型不一致,只有相同的物料分类才可以组托!!"); |
| | | } |
| | |
| | | .eq("dev_no", basStation.getDevNo()) |
| | | .eq("matnr", combMat.getMatnr()) |
| | | .eq("batch", combMat.getBatch()) |
| | | .eq("standby1", combMat.getStandby1())); |
| | | .eq(!Cools.isEmpty(combMat.getStandby1()), "standby1", combMat.getStandby1())); |
| | | if (Cools.isEmpty(basStationDetl)) { |
| | | basStationDetl = new BasStationDetl(); |
| | | Mat mat = matService.selectByMatnr(combMat.getMatnr()); |
| | |
| | | OrderDetlPakin orderDetlPakin = orderDetlPakinService.selectOne(new EntityWrapper<OrderDetlPakin>() |
| | | .eq("order_id", orderPakin.getId()) |
| | | .eq("matnr", combMat.getMatnr()) |
| | | .eq("batch", combMat.getBatch()) |
| | | .eq("standby1", combMat.getStandby1())); |
| | | .eq(!Cools.isEmpty(combMat.getBatch()),"batch", combMat.getBatch()) |
| | | .eq(!Cools.isEmpty(combMat.getStandby1()), "supp_code", combMat.getStandby1())); |
| | | if (Cools.isEmpty(orderDetlPakin)) { |
| | | throw new CoolException("检索单据明细数据失败"); |
| | | } |
| | |
| | | // 更新入库通知档 ioStatus ===>> Y |
| | | Wrapper<WaitPakin> wrapper = new EntityWrapper<WaitPakin>() |
| | | .eq("zpallet", pakin.getZpallet()); |
| | | |
| | | WaitPakin setParam = new WaitPakin(); |
| | | setParam.setLocNo(locNo); |
| | | setParam.setIoStatus("Y"); |
| | |
| | | if (container.getMixMax() > sets.size()) { |
| | | //余下可混放种类 |
| | | long suplus = Math.round((container.getMixMax() - sets.size()) * 10000) / 10000; |
| | | Mat mats = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", matnr)); |
| | | Mat mats = matService.selectOne(new EntityWrapper<Mat>() |
| | | .eq("supp_code", supId) |
| | | .eq("matnr", matnr)); |
| | | if (Objects.isNull(mats)) { |
| | | throw new CoolException("物料不存在!!"); |
| | | } |
| | |
| | | if (!taskDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作档明细失败"); |
| | | } |
| | | |
| | | } |
| | | |
| | | for (WaitPakin pakin : pakins) { |
| | |
| | | String locNo = ""; // 待修改目标库位 |
| | | String locSts = ""; // 待修改目标库位状态 |
| | | // 入库取消(修改目标库位) |
| | | if (wrkMast.getWrkSts() < 4) { |
| | | if (wrkMast.getIoType() == 1 && wrkMast.getWrkSts() < 204) { |
| | | locNo = wrkMast.getLocNo(); |
| | | locSts = "O"; |
| | | |
| | |
| | | throw new CoolException("更新源站点状态失败,目标库位状态:" + station.getLocSts()); |
| | | } |
| | | // 出库取消(修改源库位) |
| | | } else if (wrkMast.getWrkSts() > 10 && wrkMast.getWrkSts() != 14) { |
| | | } else if (wrkMast.getWrkSts() > 10 && wrkMast.getWrkSts() < 14) { |
| | | locNo = wrkMast.getSourceLocNo(); |
| | | // 出库 ===>> F.在库 |
| | | if (wrkMast.getIoType() > 100 && wrkMast.getIoType() != 110) { |
| | |
| | | } else { |
| | | throw new CoolException("更新源站点状态失败,目标库位状态:" + station.getLocSts()); |
| | | } |
| | | } else { |
| | | throw new CoolException("当前工作状态无法取消"); |
| | | } |
| | | |
| | | //取消入库工作档时,查询组托表,如果有将状态改为待处理 |
| | | if (wrkMast.getIoType() == 1) { |
| | | } else if (wrkMast.getIoType() == 1) { |
| | | List<WaitPakin> waitPakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", wrkMast.getBarcode())); |
| | | for (WaitPakin waitPakin : waitPakins) { |
| | | if (!Cools.isEmpty(waitPakin)) { |
| | |
| | | .eq("batch", waitPakin.getBatch())); |
| | | } |
| | | } |
| | | BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", wrkMast.getSourceStaNo())); |
| | | if (station.getLocSts().equals("R")) { |
| | | station.setLocSts("O"); |
| | | station.setBarcode(""); |
| | | station.setModiTime(new Date()); |
| | | station.setModiUser(userId); |
| | | if (!basStationService.updateById(station)) { |
| | | throw new CoolException("更新源站点状态失败"); |
| | | } |
| | | } |
| | | } else { |
| | | throw new CoolException("当前工作状态无法取消"); |
| | | } |
| | | |
| | | //取消入库工作档时,查询组托表,如果有将状态改为待处理 |
| | | |
| | | |
| | | //取消出库工作档时,查询单据管理表,回滚作业中数量 |
| | | if (wrkMast.getIoType() == 101 || wrkMast.getIoType() == 103) { |
| | |
| | | locDetl.getBoxType1(), locDetl.getBoxType2(), locDetl.getBoxType3(), locDetl.getAnfme(), locDetl.getThreeCode())); |
| | | locDetl.setOwner(param.getOwnerId()); |
| | | try { |
| | | locDetlService.update(locDetl, new EntityWrapper<LocDetl>().eq("loc_no", locNo).eq("matnr", locDetl.getMatnr())); |
| | | locDetlService.update(locDetl, new EntityWrapper<LocDetl>().eq("loc_no", locNo) |
| | | .eq("supp_code", locDetl.getStandby1()) |
| | | .eq("matnr", locDetl.getMatnr())); |
| | | } catch (Exception e) { |
| | | throw new Exception("更新库存明细拥有者字段信息出错了"); |
| | | } |
| | |
| | | locDetlService.selectOne(new EntityWrapper<LocDetl>() |
| | | .eq("loc_no", locDto.getLocNo()) |
| | | .eq("matnr", locDto.getMatnr()) |
| | | .eq("batch", locDto.getBatch()) |
| | | .eq(!Cools.isEmpty(locDto.getBatch()), "batch", locDto.getBatch()) |
| | | .eq("standby1",locDto.getStandby1()) |
| | | ).getDiffQty().compareTo(BigDecimal.ZERO) == 0 |
| | | ); |
| | |
| | | List<CheckOrderDetl> checkOrderDetls = checkOrderDetlService.selectList(new EntityWrapper<CheckOrderDetl>() |
| | | .eq("loc_no", locDto.getLocNo()) |
| | | .eq("matnr", locDto.getMatnr()) |
| | | .eq("batch", locDto.getBatch()) |
| | | .eq(!Cools.isEmpty(locDto.getBatch()),"batch", locDto.getBatch()) |
| | | .eq("order_no", locDto.getOrderNo()) |
| | | ); |
| | | |
| | |
| | | if (Cools.isEmpty(mat)) { |
| | | throw new CoolException("目标库位商品编码有误!"); |
| | | } |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("matnr", param.getLocDetls().get(0).getMatnr())); |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>() |
| | | .eq("matnr", param.getLocDetls().get(0).getMatnr())); |
| | | if (Cools.isEmpty(locDetls) || locDetls.size() < 1) { |
| | | throw new CoolException("待修改商品无库存,无需修改! 品号:" + param.getLocDetls().get(0).getMatnr()); |
| | | } |
| | |
| | | package com.zy.asrs.task; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.zy.api.controller.params.AgvCarriesParam; |
| | | import com.zy.api.controller.params.WorkTaskParams; |
| | | import com.zy.api.entity.CallAgvParams; |
| | | import com.zy.api.service.AgvScheduleService; |
| | | import com.zy.api.service.WcsApiService; |
| | | import com.zy.asrs.entity.Task; |
| | | import com.zy.asrs.entity.WrkMast; |
| | |
| | | private MobileService mobileService; |
| | | @Autowired |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private AgvScheduleService agvScheduleService; |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | private void execute() { |
| | |
| | | if (wrkMasts.isEmpty()) { |
| | | return; |
| | | } |
| | | Collections.shuffle(wrkMasts); |
| | | // Collections.shuffle(wrkMasts); |
| | | wrkMasts.forEach(wrkMast -> { |
| | | WorkTaskParams params = new WorkTaskParams(); |
| | | if (wrkMast.getIoType().equals(11)) { |
| | |
| | | wcsApiService.pubWrkToWcs(params); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * AGV任务自动下发出库任务 |
| | | * |
| | | * @author Ryan |
| | | * @date 2026/1/10 14:42 |
| | | */ |
| | | @Scheduled(cron = "0/5 * * * * ? ") |
| | | private void autoPubAgvTasks() { |
| | | List<Task> tasks = taskService.selectList(new EntityWrapper<Task>().in("wrk_sts", Arrays.asList(201L, 301L))); |
| | | if (tasks.isEmpty()) { |
| | | return; |
| | | } |
| | | Collections.shuffle(tasks); |
| | | tasks.forEach(wrkMast -> { |
| | | CallAgvParams param = new CallAgvParams(); |
| | | if (wrkMast.getIoType() == 1) { |
| | | param.setWrkNo(wrkMast.getWrkNo() + ""); |
| | | param.setOrgSite(wrkMast.getSourceStaNo()); |
| | | param.setTarSite(wrkMast.getLocNo()); |
| | | } else if (wrkMast.getIoType() == 110 ||wrkMast.getIoType() == 101){ |
| | | param.setWrkNo(wrkMast.getWrkNo() + ""); |
| | | param.setOrgSite(wrkMast.getSourceLocNo()); |
| | | param.setTarSite(wrkMast.getStaNo()); |
| | | } |
| | | agvScheduleService.callAgvCarry(param); |
| | | }); |
| | | } |
| | | } |
| | |
| | | import com.zy.asrs.service.WorkService; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.common.properties.SlaveProperties; |
| | | import com.zy.common.service.CommonService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private WorkService workService; |
| | | |
| | | @Autowired |
| | | private SlaveProperties slaveProperties; |
| | | |
| | | @Transactional(isolation = Isolation.REPEATABLE_READ) |
| | | public ReturnT<String> start(Integer crnNo, Integer ioType) { |
| | | try { |
| | |
| | | List<LocMast> locMasts = locMastService.selectLocMastShuttleMoveUnilateral(bay, lev, crnNo); |
| | | if (!Cools.isEmpty(locMasts) && locMasts.size() < 4) { |
| | | for (LocMast locMast : locMasts) { |
| | | // LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo())); |
| | | // StartupDto startupDto = commonService.getLocNo(crnNo == 1 ? 6 : 5, ioType, crnNo == 1 ? 917 : 918, locDetl.getMatnr(), locDetl.getBatch(),locDetl.getBrand(), null); |
| | | // FindLocNoAttributeVo findLocNoAttributeVo = new FindLocNoAttributeVo(locDetl); |
| | | if (Utils.isDeepLoc(slaveProperties, locMast.getLocNo())) { |
| | | String shallowLoc = Utils.getShallowLoc(slaveProperties, locMast.getLocNo()); |
| | | LocMast locNo = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", shallowLoc)); |
| | | if (!Objects.isNull(locNo)) { |
| | | StartupDto startupDto = commonService.getLocNo(ioType, crnNo == 1 ? 109 : 126, 1, null, null); |
| | | workService.locMove(locNo.getLocNo(), startupDto.getLocNo(), 9527L); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | StartupDto startupDto = commonService.getLocNo(ioType, crnNo == 1 ? 109 : 126, 1, null, null); |
| | | workService.locMove(locMast.getLocNo(), startupDto.getLocNo(), 9527L); |
| | | break; |
| | |
| | | List<LocMast> locMasts = locMastService.selectLocMastShuttleMoveUnilateral(bay, lev, crnNo ); |
| | | if (!Cools.isEmpty(locMasts) && locMasts.size() < 4) { |
| | | for (LocMast locMast : locMasts) { |
| | | // if (Utils.isDeepLoc(slaveProperties, locMast.getLocNo())) { |
| | | // String shallowLoc = Utils.getShallowLoc(slaveProperties, locMast.getLocNo()); |
| | | // LocMast locNo = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | // .eq("crn_no", crnNo) |
| | | // .eq("loc_no", shallowLoc)); |
| | | // if (!Objects.isNull(locNo)) { |
| | | // StartupDto startupDto = commonService.getLocNo(ioType, crnNo == 1 ? 205 : 215, 3, null, null); |
| | | // workService.locMove(locNo.getLocNo(), startupDto.getLocNo(), 9527L); |
| | | // break; |
| | | // } |
| | | // } |
| | | |
| | | // LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo())); |
| | | // StartupDto startupDto = commonService.getLocNo(crnNo == 1 ? 6 : 5, ioType, crnNo == 1 ? 917 : 918, locDetl.getMatnr(), locDetl.getBatch(),locDetl.getBrand(), null); |
| | | // FindLocNoAttributeVo findLocNoAttributeVo = new FindLocNoAttributeVo(locDetl); |
| | |
| | | public class HIKApiConstant { |
| | | |
| | | // AGV IP地址 |
| | | public static final String AGV_IP = "10.0.100.110:8182"; |
| | | public static final String AGV_IP = "http://192.168.238.202/rcs/rtas/api/robot/controller"; |
| | | |
| | | public static final String TASK_SUBMIT = "/task/submit"; |
| | | |
| | | // 入库呼叫AGV取货 |
| | | public static final String AGV_CALL_IN_PATH = "/rcms/services/rest/hikRpcService/genAgvSchedulingTask"; |
| | |
| | | // public static final String URL = "http://webservice.kopen.com.cn:1482/kc-api/api/wms/ "; |
| | | public static final String URL = "http://10.143.23.26:1482/kc-api/api/wms/ "; |
| | | |
| | | //AGV拉口地址 |
| | | public static final String AGV_URL = "http://192.168.238.202/rcs/rtas/api/robot/controller"; |
| | | |
| | | //WCS系统接口地址 |
| | | // public static final String WCS_URL = "http://192.168.238.32:9090/wcs"; |
| | | |
| | | public static final String WCS_URL = "http://192.168.238.241:9090/wcs"; |
| | | public static final String WCS_URL = "http://192.168.238.31:9090/wcs"; |
| | | |
| | | //上架派工单反馈 |
| | | public static final String IN_DISPATCH_RESULT = "getInDispatchResult"; |
| | |
| | | logger.info("++++++++ 开始加载许可证 ++++++++"); |
| | | |
| | | try { |
| | | // String publicKeysStoreFileName = this.getClass().getClassLoader().getResource(publicKeysStorePath).getPath(); |
| | | // File publicKeysStoreFile = new File(publicKeysStoreFileName); |
| | | // |
| | | // String licensePathFileName = this.getClass().getClassLoader().getResource(licensePath).getPath(); |
| | | // File licensePathFile = new File(licensePathFileName); |
| | | String publicKeysStoreFileName = this.getClass().getClassLoader().getResource(publicKeysStorePath).getPath(); |
| | | File publicKeysStoreFile = new File(publicKeysStoreFileName); |
| | | |
| | | String licensePathFileName = this.getClass().getClassLoader().getResource(licensePath).getPath(); |
| | | File licensePathFile = new File(licensePathFileName); |
| | | |
| | | LicenseVerifyParam param = new LicenseVerifyParam(); |
| | | param.setSubject(subject); |
| | |
| | | |
| | | LicenseVerify licenseVerify = new LicenseVerify(); |
| | | //安装证书 |
| | | // LicenseContent install = licenseVerify.install(param); |
| | | LicenseContent install = licenseVerify.install(param); |
| | | |
| | | logger.info("++++++++ 许可证加载结束 ++++++++"); |
| | | |
| | | logger.info("++++++++ 许可证加载标记,搜索修改 ++++++++"); |
| | | licenseTimer.setSystemSupport(true); |
| | | licenseTimer.setLicenseDays(9999); |
| | | return true; |
| | | // licenseTimer.setLicenseDays(9999); |
| | | // return true; |
| | | |
| | | // licenseTimer.setSystemSupport(install!=null); |
| | | // |
| | | // if (install != null) { |
| | | // Date start = new Date(); |
| | | // Date end = install.getNotAfter(); |
| | | // Long starTime = start.getTime(); |
| | | // Long endTime = end.getTime(); |
| | | // Long num = endTime - starTime;//时间戳相差的毫秒数 |
| | | // int day = (int) (num / 24 / 60 / 60 / 1000); |
| | | // licenseTimer.setLicenseDays(day); |
| | | // } |
| | | // |
| | | // |
| | | // return install != null; |
| | | licenseTimer.setSystemSupport(install!=null); |
| | | |
| | | if (install != null) { |
| | | Date start = new Date(); |
| | | Date end = install.getNotAfter(); |
| | | Long starTime = start.getTime(); |
| | | Long endTime = end.getTime(); |
| | | Long num = endTime - starTime;//时间戳相差的毫秒数 |
| | | int day = (int) (num / 24 / 60 / 60 / 1000); |
| | | licenseTimer.setLicenseDays(day); |
| | | } |
| | | |
| | | |
| | | return install != null; |
| | | } catch (Exception e) { |
| | | return false; |
| | | } |
| | |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | username: sa |
| | | password: sa@123 |
| | | url: jdbc:sqlserver://47.97.1.152:1433;databasename=jsxsasrs |
| | | url: jdbc:sqlserver://192.168.238.32:1433;databasename=jsxsasrs |
| | | # url: jdbc:sqlserver://127.0.0.1:1433;databasename=jsxsasrs |
| | | mvc: |
| | | static-path-pattern: /** |
| | | redis: |
| | |
| | | # 双深 |
| | | doubleDeep: true |
| | | # 双深库位排号 |
| | | doubleLocs: 1,4,5,8,9,12,13,16 |
| | | doubleLocs: 11, 14 |
| | | # 一个堆垛机负责的货架排数 |
| | | groupCount: 4 |
| | | # 左深库位排号 |
| | | doubleLocsLeft: 1,5,9,13 |
| | | doubleLocsLeft: 11 |
| | | # 右深库位排号 |
| | | doubleLocsRight: 4,8,12,16 |
| | | doubleLocsRight: 14 |
| | | # wms参数配置 |
| | | wms-parameter: |
| | | # 自动补空板功能开关 |
| | | automaticFillingBoardStaNosBoolean: false |
| | | automaticFillingBoardStaNosBoolean: true |
| | | # 自动补空板站点 |
| | | automaticFillingBoardStaNos: 112,101 |
| | | # 自动移库功能开关 |
| | | autoLocMoveBoolean: false |
| | | autoLocMoveBoolean: true |
| | | # 自动移库功能开关 穿梭 |
| | | autoLocMoveUnilateralBoolean: false |
| | | |
| | |
| | | |
| | | #KOPEN小松平台 |
| | | kopen: |
| | | url: webservice.kopen.com.cn |
| | | # url: webservice.kopen.com.cn |
| | | url: 10.143.23.26 |
| | | port: 1482 |
| | | prefix: /kc-api/api/wms |
| | | |
| | |
| | | <!-- 排 --> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">起止排</label> |
| | | <label class="layui-form-label">起止</label> |
| | | <div class="layui-input-inline" style="width: 100px;"> |
| | | <input type="text" name="startRow" autocomplete="off" class="layui-input" |
| | | lay-verify="required|number"> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 列 --> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">起止列</label> |
| | | <div class="layui-input-inline" style="width: 100px;"> |
| | | <input type="text" name="startBay" autocomplete="off" class="layui-input" |
| | | lay-verify="required|number"> |
| | | </div> |
| | | <div class="layui-form-mid">-</div> |
| | | <div class="layui-input-inline" style="width: 100px;"> |
| | | <input type="text" name="endBay" autocomplete="off" class="layui-input" |
| | | lay-verify="required|number"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 层 --> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">起止层</label> |
| | | <div class="layui-input-inline" style="width: 100px;"> |
| | | <input type="text" name="startLev" autocomplete="off" class="layui-input" |
| | | lay-verify="required|number"> |
| | | </div> |
| | | <div class="layui-form-mid">-</div> |
| | | <div class="layui-input-inline" style="width: 100px;"> |
| | | <input type="text" name="endLev" autocomplete="off" class="layui-input" |
| | | lay-verify="required|number"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">堆垛机数量</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="crnAmount" lay-verify="required|number" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">起始堆垛机</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="staCrn" autocomplete="off" class="layui-input" lay-verify="number"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- <!– 列 –>--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <label class="layui-form-label">起止列</label>--> |
| | | <!-- <div class="layui-input-inline" style="width: 100px;">--> |
| | | <!-- <input type="text" name="startBay" autocomplete="off" class="layui-input"--> |
| | | <!-- lay-verify="required|number">--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-mid">-</div>--> |
| | | <!-- <div class="layui-input-inline" style="width: 100px;">--> |
| | | <!-- <input type="text" name="endBay" autocomplete="off" class="layui-input"--> |
| | | <!-- lay-verify="required|number">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <!– 层 –>--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <label class="layui-form-label">起止层</label>--> |
| | | <!-- <div class="layui-input-inline" style="width: 100px;">--> |
| | | <!-- <input type="text" name="startLev" autocomplete="off" class="layui-input"--> |
| | | <!-- lay-verify="required|number">--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-mid">-</div>--> |
| | | <!-- <div class="layui-input-inline" style="width: 100px;">--> |
| | | <!-- <input type="text" name="endLev" autocomplete="off" class="layui-input"--> |
| | | <!-- lay-verify="required|number">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">堆垛机数量</label>--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <input type="text" name="crnAmount" lay-verify="required|number" autocomplete="off" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <label class="layui-form-label">起始堆垛机</label>--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <input type="text" name="staCrn" autocomplete="off" class="layui-input" lay-verify="number">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- 库位类型 --> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">高低类型</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="locType1"> |
| | | <option style="display: none"></option> |
| | | <option value="0">未知</option> |
| | | <option value="1">低库位</option> |
| | | <option value="2">高库位</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">宽窄类型</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="locType2"> |
| | | <option style="display: none"></option> |
| | | <option value="0">未知</option> |
| | | <option value="1">窄库位</option> |
| | | <option value="2">宽库位</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">轻重类型</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="locType3"> |
| | | <option style="display: none"></option> |
| | | <option value="0">未知</option> |
| | | <option value="1">轻库位</option> |
| | | <option value="2">重库位</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">高低类型</label>--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <select name="locType1">--> |
| | | <!-- <option style="display: none"></option>--> |
| | | <!-- <option value="0">未知</option>--> |
| | | <!-- <option value="1">低库位</option>--> |
| | | <!-- <option value="2">高库位</option>--> |
| | | <!-- </select>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">宽窄类型</label>--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <select name="locType2">--> |
| | | <!-- <option style="display: none"></option>--> |
| | | <!-- <option value="0">未知</option>--> |
| | | <!-- <option value="1">窄库位</option>--> |
| | | <!-- <option value="2">宽库位</option>--> |
| | | <!-- </select>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">轻重类型</label>--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <select name="locType3">--> |
| | | <!-- <option style="display: none"></option>--> |
| | | <!-- <option value="0">未知</option>--> |
| | | <!-- <option value="1">轻库位</option>--> |
| | | <!-- <option value="2">重库位</option>--> |
| | | <!-- </select>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div style="text-align: center; margin-top: 20px"> |
| | | <button class="layui-btn layui-btn-radius layui-btn-normal" id="initDo" lay-submit lay-filter="initDo"> |
| | | 确定 |