Merge branch 'jsxswms' of http://47.97.1.152:5880/r/zy-asrs into jsxswms
| | |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getType())) { |
| | | return R.error("搬运类型不能为空!!"); |
| | | } |
| | | return agvScheduleService.callAgvCarry(params); |
| | | } |
| | | |
| | |
| | | package com.zy.api.controller; |
| | | |
| | | |
| | | import com.core.common.R; |
| | | import com.zy.api.entity.OrderParams; |
| | | import com.zy.api.controller.params.PageRequestParams; |
| | | import com.zy.api.entity.PubOrderParams; |
| | | import com.zy.api.entity.ReportOrderParam; |
| | | import com.zy.api.entity.StockAdjustParams; |
| | | import com.zy.api.entity.StockUpOrderParams; |
| | | import com.zy.api.entity.SyncMatParmas; |
| | | import com.zy.api.entity.dto.XSR; |
| | | import com.zy.api.service.KopenApiService; |
| | | import com.zy.common.web.BaseController; |
| | | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/kopen") |
| | | public class KopenApiController { |
| | | public class KopenApiController extends BaseController{ |
| | | |
| | | @Autowired |
| | | private KopenApiService kopenApiService; |
| | |
| | | */ |
| | | @ApiOperation("上架派工单") |
| | | @PostMapping("/sendInDispatch") |
| | | public XSR receiveOrders(@RequestBody PubOrderParams params) { |
| | | public XSR receiveOrders(@RequestBody List<PubOrderParams> params) { |
| | | if (Objects.isNull(params)) { |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getType())) { |
| | | return XSR.error("单据类型不能为空!"); |
| | | } |
| | | // if (Objects.isNull(params.getType())) { |
| | | // return XSR.error("单据类型不能为空!"); |
| | | // } |
| | | return kopenApiService.receiveOrders(params); |
| | | } |
| | | |
| | | /** |
| | | * 上游下发零件数据变更 |
| | | * s |
| | | * |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:19 |
| | | * @param params |
| | |
| | | return kopenApiService.basMatupdate(params); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 上架派工单反馈 |
| | | * @author Ryan |
| | |
| | | */ |
| | | @ApiOperation("上架派工单反馈") |
| | | @PostMapping("/getInDispatchResult") |
| | | public XSR getInDispatchResult(@RequestBody ReportOrderParam params) { |
| | | public XSR getInDispatchResult(@RequestBody List<ReportOrderParam> params) { |
| | | if (Objects.isNull(params)) { |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getKopen_id()) && Objects.isNull(params.getInv_no()) && Objects.isNull(params.getDispatch_no())) { |
| | | return XSR.error("取消条件不能为空!!"); |
| | | } |
| | | // if (Objects.isNull(params.getKopen_id()) && Objects.isNull(params.getInv_no()) && Objects.isNull(params.getDispatch_no())) { |
| | | // return XSR.error("取消条件不能为空!!"); |
| | | // } |
| | | return kopenApiService.getInDispatchResult(params); |
| | | } |
| | | |
| | |
| | | */ |
| | | @ApiOperation("备货指示派工单下发") |
| | | @PostMapping("/sendOutDispatch") |
| | | public XSR sendStockPrepareDispatch(@RequestBody PubOrderParams params) { |
| | | public XSR sendStockPrepareDispatch(@RequestBody List<PubOrderParams> params) { |
| | | if (Objects.isNull(params)) { |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getDetails()) || params.getDetails().isEmpty()) { |
| | | return XSR.error("上报订单列表不能为空!!"); |
| | | } |
| | | // if (Objects.isNull(params.getDetails()) || params.getDetails().isEmpty()) { |
| | | // return XSR.error("上报订单列表不能为空!!"); |
| | | // } |
| | | return kopenApiService.sendOutDispatch(params); |
| | | } |
| | | |
| | |
| | | */ |
| | | @ApiOperation("备货单下发") |
| | | @PostMapping("/getOutDetails") |
| | | public XSR getOutDetails(@RequestBody StockUpOrderParams params) { |
| | | public XSR getOutDetails(@RequestBody List<StockUpOrderParams> params) { |
| | | if (Objects.isNull(params)) { |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getDetails()) || params.getDetails().isEmpty()) { |
| | | return XSR.error("上报订单列表不能为空!!"); |
| | | } |
| | | return kopenApiService.getOutDetails(params); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询WMS库存信息 |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:22 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | @ApiOperation("查询WMS库存信息") |
| | | @PostMapping("/getStockInfo") |
| | | public XSR getStockInfo(@RequestBody PageRequestParams params) { |
| | | return kopenApiService.getStockInfo(params); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 零件损溢单下发 |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:22 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | @ApiOperation("零件损溢单下发") |
| | | @PostMapping("/sendBSBYDetails") |
| | | public XSR sendStockAdjust(@RequestBody List<StockAdjustParams> params) { |
| | | if (Objects.isNull(params) || params.isEmpty()) { |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | return kopenApiService.sendStockAdjust(params, 1L); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import lombok.experimental.Accessors; |
| | | import java.io.Serializable; |
| | | |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "OrderItemsParam", description = "订单明细参数") |
| | |
| | | @ApiModelProperty("捆绑/叫料/数量数量") |
| | | private Integer pick_qty; |
| | | |
| | | @ApiModelProperty("损溢数量") |
| | | private Integer bsby_qty; |
| | | |
| | | @ApiModelProperty("托盘编号") |
| | | private String location_no; |
| | | |
| | | } |
| | |
| | | package com.zy.api.entity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | |
| | | private String cus_address; |
| | | |
| | | |
| | | |
| | | |
| | | @ApiModelProperty("WMS ID") |
| | | private String wms_id; |
| | | |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | |
| | | @ApiModelProperty("差异数量") |
| | | private Integer diff_qty; |
| | | |
| | | @ApiModelProperty("原上架派工数量") |
| | | private Integer old_qty; |
| | | |
| | | @ApiModelProperty("变更数量") |
| | | private Integer new_qty; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "BaseResponse", description = "基础响应") |
| | | @ApiModel(value = "XSR", description = "基础响应") |
| | | public class XSR<T> { |
| | | private static final String SUCCESS_CODE = "200"; |
| | | private static final String FAIL_CODE = "500"; |
| | |
| | | |
| | | private String returnMessage; |
| | | |
| | | private T data; |
| | | private T result; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | |
| | | .setSuccess(true) |
| | | .setMessage("操作成功") |
| | | .setReturnMessage("操作成功") |
| | | .setData(data); |
| | | .setResult(data); |
| | | } |
| | | |
| | | public static <T> XSR<T> ok(T data, String message) { |
| | |
| | | .setSuccess(true) |
| | | .setMessage(message) |
| | | .setReturnMessage(message) |
| | | .setData(data); |
| | | .setResult(data); |
| | | } |
| | | |
| | | public static <T> XSR<T> error(String message) { |
| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public static String getMatTag(String type) { |
| | | if (type.equals(MatLocType.AUTOMATED.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)) { |
| | | return MatType.SMALL.type; |
| | | } else { |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.zy.api.controller.params.PageRequestParams; |
| | | import com.zy.api.entity.PubOrderParams; |
| | | import com.zy.api.entity.ReportOrderParam; |
| | | import com.zy.api.entity.StockAdjustParams; |
| | | import com.zy.api.entity.StockUpOrderParams; |
| | | import com.zy.api.entity.SyncMatParmas; |
| | | import com.zy.api.entity.dto.XSR; |
| | |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | XSR receiveOrders(PubOrderParams params); |
| | | XSR receiveOrders(List<PubOrderParams> params); |
| | | |
| | | /** |
| | | * 基础零件变更 |
| | |
| | | * @param params |
| | | * @return |
| | | */ |
| | | XSR getInDispatchResult(ReportOrderParam params); |
| | | XSR getInDispatchResult(List<ReportOrderParam> params); |
| | | |
| | | /** |
| | | * 备货指示派工单下发 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | XSR sendOutDispatch(PubOrderParams params); |
| | | XSR sendOutDispatch(List<PubOrderParams> params); |
| | | |
| | | /** |
| | | * 备货单下发 |
| | |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | XSR getOutDetails(StockUpOrderParams params); |
| | | XSR getOutDetails(List<StockUpOrderParams> params); |
| | | |
| | | /** |
| | | * 查询WMS库存信息 |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:22 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | XSR getStockInfo(PageRequestParams params); |
| | | |
| | | /** |
| | | * 零件损溢单下发 |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:22 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | XSR sendStockAdjust(List<StockAdjustParams> params, Long userId); |
| | | } |
| | |
| | | import com.zy.asrs.entity.result.HIKResultDTO; |
| | | import com.zy.asrs.enums.LocStsType; |
| | | import com.zy.asrs.enums.TaskIOType; |
| | | import com.zy.asrs.enums.TaskStatusType; |
| | | import com.zy.asrs.service.ApiLogService; |
| | | import com.zy.asrs.service.LocCacheService; |
| | | import com.zy.asrs.service.TaskService; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | 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; |
| | |
| | | * @version 1.0 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R callAgvCarry(CallAgvParams params) { |
| | | if (params.getType().equals(OrderType.ORDER_OUT.type)) { |
| | | //缓存区出库 |
| | | } else if (params.getType().equals(OrderType.ORDER_IN.type)) { |
| | | //缓存区入库 |
| | | } else { |
| | | |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getWrkNo())) { |
| | | return R.error("任务号不能为空!!"); |
| | | } |
| | | |
| | | Task task = taskService.selectOne(new EntityWrapper<Task>().eq("wrk_no", params.getWrkNo())); |
| | | if (Objects.isNull(task)) { |
| | | return R.error("任务信息不存在!!"); |
| | | } |
| | | |
| | | if (Arrays.asList(TaskIOType.ALL_IN.type, TaskIOType.PICK_IN.type, TaskIOType.MERGE_IN.type) |
| | | .contains(task.getIoType())) { |
| | | // 入库 |
| | | task.setWrkSts(TaskStatusType.AGV_TASK_ISSUED_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())) { |
| | | // 出库 |
| | | task.setWrkSts(TaskStatusType.AGV_TASK_ISSUED_OUT.type); |
| | | } |
| | | |
| | | if (!taskService.updateById(task)) { |
| | | throw new CoolException("任务状态更新失败!!"); |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R callback(CallAgvParams params) { |
| | | //TODO 1. 搬运完成,修改站点库位状态 |
| | | if (params.getType().equals(OrderType.ORDER_OUT.type)) { |
| | | //出库单 |
| | | if (params.getStatus().equals("RUNING")) { |
| | | LocCache locCache = locCacheService.selectOne(new EntityWrapper<LocCache>().eq("loc_no", params.getOrgLoc())); |
| | | if (Objects.isNull(locCache)) { |
| | | throw new CoolException("库位信息不存在!!"); |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | if (!locCache.getLocSts().equals(LocStsType.LOC_STS_TYPE_O.type)) { |
| | | locCache.setLocSts(LocStsType.LOC_STS_TYPE_O.type); |
| | | if (Objects.isNull(params.getWrkNo())) { |
| | | return R.error("任务号不能为空!!"); |
| | | } |
| | | } else if (params.getStatus().equals("FINISHED")) { |
| | | Task task = taskService.selectOne(new EntityWrapper<Task>().eq("wrk_no", params.getWrkNo())); |
| | | if (Objects.isNull(task)) { |
| | | throw new CoolException("任务信息不存在!!"); |
| | | 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")) { |
| | | task.setWrkSts(TaskStatusType.AGV_TASK_RUNNING_IN.type); |
| | | } else if (params.getStatus().equals("FINISHED")){ |
| | | 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")) { |
| | | task.setWrkSts(TaskStatusType.AGV_TASK_RUNNING_OUT.type); |
| | | } else if (params.getStatus().equals("FINISHED")){ |
| | | task.setWrkSts(TaskStatusType.AGV_TASK_FINISHED_OUT.type); |
| | | } |
| | | } |
| | | |
| | | if (!taskService.updateById(task)) { |
| | | throw new CoolException("任务状态更新失败!!"); |
| | | } |
| | | } |
| | | } else { |
| | | //入库单 |
| | | |
| | | throw new CoolException("状态修改失败!!"); |
| | | } |
| | | |
| | | return null; |
| | | return R.ok("执行完成 !!"); |
| | | } |
| | | |
| | | |
| | | public HIKResultDTO sendAgvTask(HIKApiDTO haiKangApiDTO, String path) { |
| | | HIKResultDTO result = new HIKResultDTO(); |
| | |
| | | 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())); |
| | | 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); |
| | | String response = ""; |
| | |
| | | "127.0.0.1", |
| | | body, |
| | | response, |
| | | result.isSuccess() |
| | | ); |
| | | result.isSuccess()); |
| | | } catch (Exception e) { |
| | | log.error("", e); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.R; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.SnowflakeIdWorker; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.api.controller.params.PageRequestParams; |
| | | import com.zy.api.entity.OrderItemsParam; |
| | | import com.zy.api.entity.OrderParams; |
| | | import com.zy.api.entity.OutOrderParams; |
| | | import com.zy.api.entity.PubOrderParams; |
| | | import com.zy.api.entity.ReportOrderParam; |
| | | import com.zy.api.entity.StockAdjustParams; |
| | | import com.zy.api.entity.StockUpOrderParams; |
| | | import com.zy.api.entity.SyncMatParmas; |
| | | import com.zy.api.entity.dto.XSR; |
| | |
| | | import com.zy.api.enums.OrderType; |
| | | import com.zy.api.enums.OrderWkType; |
| | | import com.zy.api.service.KopenApiService; |
| | | import com.zy.asrs.entity.CheckOrder; |
| | | import com.zy.asrs.entity.CheckOrderDetl; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.enums.CommonEnum; |
| | | import com.zy.asrs.enums.OrderSettle; |
| | | import com.zy.asrs.enums.OrderTypeEnum; |
| | | import com.zy.asrs.service.CheckOrderDetlService; |
| | | import com.zy.asrs.service.CheckOrderService; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import com.zy.asrs.service.OrderService; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | private OrderDetlService orderDetlService; |
| | | @Autowired |
| | | private MatService matService; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | private CheckOrderService checkOrderService; |
| | | @Autowired |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | @Autowired |
| | | private CheckOrderDetlService checkOrderDetlService; |
| | | |
| | | /** |
| | | * 接收下发订单信息 |
| | | * |
| | | * @param params |
| | | * @param orderParams |
| | | * @return com.core.common.R |
| | | * @author Ryan |
| | | * @date 2025/11/24 14:49 |
| | | */ |
| | | @Override |
| | | public XSR receiveOrders(PubOrderParams params) { |
| | | public XSR receiveOrders(List<PubOrderParams> orderParams) { |
| | | orderParams.forEach(params -> { |
| | | if (params.getType().equals(OrderWkType.getTypeVal(params.getType()))) { |
| | | return XSR.error("当前类型不是上架派工单!!"); |
| | | throw new CoolException("当前类型不是上架派工单!!"); |
| | | } |
| | | addOrUpdateOrders(params, "add"); |
| | | }); |
| | | |
| | | return XSR.ok("单据下发成功!!"); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public XSR getInDispatchResult(ReportOrderParam params) { |
| | | public XSR getInDispatchResult(List<ReportOrderParam> params) { |
| | | if (Objects.isNull(params)) { |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | |
| | | /** |
| | | * 备货指示派工单下发 |
| | | * |
| | | * @param params |
| | | * @param pubOrderParams |
| | | * @return com.core.common.R |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:21 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public XSR sendOutDispatch(PubOrderParams params) { |
| | | if (Objects.isNull(params)) { |
| | | public XSR sendOutDispatch(List<PubOrderParams> pubOrderParams) { |
| | | if (Objects.isNull(pubOrderParams) || pubOrderParams.isEmpty()) { |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | pubOrderParams.forEach(params -> { |
| | | // 校验参数 |
| | | if (Objects.isNull(params.getDispatch_no())) { |
| | | return XSR.error("派工单编号不能为空!!"); |
| | | throw new CoolException("派工单编号不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getKopen_id())) { |
| | | return XSR.error("流水号不能为空!!"); |
| | | throw new CoolException("流水号不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getCompany_id())) { |
| | | return XSR.error("公司ID不能为空!!"); |
| | | throw new CoolException("公司ID不能为空!!"); |
| | | } |
| | | |
| | | addOrUpdateOrders(params, "add"); |
| | | }); |
| | | |
| | | return XSR.ok("备货指示派工单下发成功!!"); |
| | | } |
| | |
| | | // 备货单出库 |
| | | newOrder.setOrderNo(params.getPick_no()); |
| | | newOrder.setNumber(params.getDispatch_no()); |
| | | newOrder.setShipCode(params.getOrder_no()); |
| | | newOrder.setCstmrName(params.getCus_id()); |
| | | newOrder.setTel(params.getCus_address()); |
| | | newOrder.setDocType(Long.parseLong(OrderTypeEnum.STOCK.type + "")); |
| | |
| | | /** |
| | | * 备货单下发 |
| | | * |
| | | * @param params |
| | | * @param stockUpParams |
| | | * @return com.core.common.R |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:40 |
| | | */ |
| | | @Override |
| | | public XSR getOutDetails(StockUpOrderParams params) { |
| | | if (Objects.isNull(params)) { |
| | | public XSR getOutDetails(List<StockUpOrderParams> stockUpParams) { |
| | | if (Objects.isNull(stockUpParams)) { |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | // 校验参数 |
| | | stockUpParams.forEach(params -> { |
| | | if (Objects.isNull(params.getDispatch_no())) { |
| | | return XSR.error("派工单编号不能为空!!"); |
| | | throw new CoolException("派工单编号不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getKopen_id())) { |
| | | return XSR.error("流水号不能为空!!"); |
| | | throw new CoolException("流水号不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getCompany_id())) { |
| | | return XSR.error("公司ID不能为空!!"); |
| | | throw new CoolException("公司ID不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getDetails()) || params.getDetails().isEmpty()) { |
| | | return XSR.error("订单明细不能为空!!"); |
| | | throw new CoolException("订单明细不能为空!!"); |
| | | } |
| | | |
| | | List<OrderItemsParam> items = new ArrayList<>(); |
| | | if (params.getDetails() != null) { |
| | | for (OutOrderParams detail : params.getDetails()) { |
| | |
| | | pubOrderParams.setDetails(item.getPartList()); |
| | | addOrUpdateOrders(pubOrderParams, "add"); |
| | | }); |
| | | }); |
| | | |
| | | return XSR.ok("备货单下发成功!!"); |
| | | } |
| | | |
| | | /** |
| | | * 查询WMS库存信息 |
| | | * |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | @Override |
| | | public XSR getStockInfo(PageRequestParams params) { |
| | | EntityWrapper<LocDetl> wrapper = new EntityWrapper<>(); |
| | | if (!Objects.isNull(params.getPro_id())) { |
| | | wrapper.eq("supp_code", params.getPro_id()); |
| | | } |
| | | if (!Objects.isNull(params.getPro_komcode())) { |
| | | wrapper.eq("matnr", params.getPro_komcode()); |
| | | } |
| | | |
| | | Page<LocDetl> locDetls = locDetlService.selectPage(new Page<>(params.getCurr(), params.getLimit()), wrapper); |
| | | |
| | | return XSR.ok(locDetls.getRecords()); |
| | | } |
| | | |
| | | /** |
| | | * 零件损溢单下发 |
| | | * |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:22 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public XSR sendStockAdjust(List<StockAdjustParams> params, Long userId) { |
| | | if (Objects.isNull(params)) { |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | params.forEach(param -> { |
| | | gentCheckOrders(param, userId); |
| | | }); |
| | | |
| | | return XSR.ok("零件损溢单下发成功!!"); |
| | | } |
| | | |
| | | /** 生成新的零件损溢单 |
| | | * @param userId */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void gentCheckOrders(StockAdjustParams params, Long userId) { |
| | | if (Objects.isNull(params.getDetails()) || params.getDetails().isEmpty()) { |
| | | throw new CoolException("订单明细不能为空!!"); |
| | | } |
| | | // 校验参数 |
| | | if (Objects.isNull(params.getBsby_no())) { |
| | | throw new CoolException("损溢单编号不能为空!!"); |
| | | } |
| | | |
| | | CheckOrder checkOrder = checkOrderService |
| | | .selectOne(new EntityWrapper<CheckOrder>().eq("order_no", params.getBsby_no())); |
| | | if (!Objects.isNull(checkOrder)) { |
| | | throw new CoolException("损溢单已存在!!"); |
| | | } |
| | | |
| | | CheckOrder order = new CheckOrder(); |
| | | order.setOrderNo(params.getBsby_no()); |
| | | order.setCstmrName(params.getCompany_id()); |
| | | order.setDefNumber(params.getKopen_id()); |
| | | order.setDocType(4L); |
| | | order.setUuid(String.valueOf(snowflakeIdWorker.nextId())); |
| | | order.setSettle(Long.valueOf(CommonEnum.COMMON_ENUM_Y.type + "")); |
| | | order.setStatus(CommonEnum.COMMON_ENUM_Y.type); |
| | | order.setOrderTime(params.getUpdate_time()); |
| | | order.setMemo(params.getResason()); |
| | | order.setShipName(params.getReason_name()); |
| | | order.setCreateTime(new Date()); |
| | | order.setUpdateTime(new Date()); |
| | | |
| | | if (!checkOrderService.insert(order)) { |
| | | throw new CoolException("损溢单新增失败!!"); |
| | | } |
| | | |
| | | if (Objects.isNull(params.getDetails()) || params.getDetails().isEmpty()) { |
| | | throw new CoolException("订单明细不能为空!!"); |
| | | } |
| | | |
| | | params.getDetails().forEach(item -> { |
| | | CheckOrderDetl checkOrderDetl = new CheckOrderDetl(); |
| | | //通过托盘, 物料编码, 供应商编码查询库存明细 |
| | | LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>() |
| | | .eq("matnr", item.getPro_komcode()) |
| | | .eq("zpallet", item.getLocation_no()) |
| | | .eq("supp_code", item.getPro_id())); |
| | | if (Objects.isNull(locDetl)) { |
| | | throw new CoolException("库存不存在!!"); |
| | | } |
| | | BeanUtils.copyProperties(locDetl, checkOrderDetl); |
| | | checkOrderDetl.setLocDetlId(locDetl.getId()); |
| | | checkOrderDetl.setOrderId(order.getId()); |
| | | checkOrderDetl.setOrderNo(order.getOrderNo()); |
| | | checkOrderDetl.setMatnr(locDetl.getMatnr()); |
| | | checkOrderDetl.setMaktx(locDetl.getMaktx()); |
| | | checkOrderDetl.setBatch(locDetl.getBatch()); |
| | | checkOrderDetl.setSpecs(locDetl.getSpecs()); |
| | | checkOrderDetl.setThreeCode(locDetl.getThreeCode()); |
| | | checkOrderDetl.setSuppCode(locDetl.getSuppCode()); |
| | | checkOrderDetl.setStandby1(locDetl.getSuppCode()); |
| | | checkOrderDetl.setAnfme(new BigDecimal(locDetl.getAnfme().toString())); |
| | | checkOrderDetl.setDiffQty(BigDecimal.ZERO); |
| | | checkOrderDetl.setWorkQty(BigDecimal.ZERO); |
| | | checkOrderDetl.setStatus(1); |
| | | checkOrderDetl.setZpallet(locDetl.getZpallet()); |
| | | checkOrderDetl.setCreateBy(userId); |
| | | checkOrderDetl.setCreateTime(new Date()); |
| | | checkOrderDetl.setUpdateBy(userId); |
| | | checkOrderDetl.setUpdateTime(new Date()); |
| | | |
| | | if (!checkOrderDetlService.insert(checkOrderDetl)) { |
| | | throw new CoolException("保存盘点单明细失败"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.zy.asrs.entity.LocCache; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.param.LocMastInitParam; |
| | | import com.zy.asrs.enums.LocAreaType; |
| | | import com.zy.asrs.service.LocCacheService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | |
| | | if (Cools.isEmpty(locCache) || null==locCache.getLocNo()){ |
| | | return R.error(); |
| | | } |
| | | locCacheService.updateById(locCache); |
| | | LocCache cache = locCacheService.selectOne(new EntityWrapper<LocCache>() |
| | | .eq("loc_no", locCache.getLocNo())); |
| | | if (Cools.isEmpty(cache)){ |
| | | return R.error("库位不存在"); |
| | | } |
| | | cache.setSort(locCache.getSort()); |
| | | if (!locCacheService.updateById(cache)) { |
| | | return R.error("更新失败"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | return mobileService.collectionPakinView(params); |
| | | } |
| | | |
| | | /** |
| | | * SO/EO 区组托 |
| | | * @author Ryan |
| | | * @date 2025/12/18 15:19 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | @PostMapping("/agv/collectionPakin/auth") |
| | | @ManagerAuth |
| | | public R pdaAgvCollectionPakin(@RequestBody CollectionPakinParams params) { |
| | |
| | | return R.ok("组托成功"); |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/9/24 |
| | | * @description: 呼叫AGV返回 |
| | | * @version 1.0 |
| | | */ |
| | | @ManagerAuth(memo = "呼叫AGV返回") |
| | | @RequestMapping("/agv/call/back") |
| | | public R callAgvBack(@RequestBody AgvCallParams callAgvBackParam) { |
| | | if (Objects.isNull(callAgvBackParam.getOrgSite())) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | |
| | | return mobileService.agvCallback(callAgvBackParam, getUserId()); |
| | | } |
| | | |
| | | |
| | | @ManagerAuth(memo = "缓冲库确认上架(模拟物理按钮)") |
| | | @RequestMapping("/cache/comb/pub") |
| | | public R cacheCombPub(@RequestBody CompleteParam combParam) { |
| | |
| | | List<Long> areaIds = basAreas.stream() |
| | | .map(BasAreas::getId) |
| | | .collect(Collectors.toList()); |
| | | Map<Long, Double> locDetlUsage = new HashMap<>(); |
| | | for (OrderDetlPakout orderDetl : orderDetlPakouts) { |
| | | double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getWorkQty()).orElse(0.0D); |
| | | if (issued <= 0.0D) { |
| | | continue; |
| | | } |
| | | List<LocDetl> locDetls = locDetlService.queryStockAll(null, exist,orderDetl.getMatnr(), orderDetl.getBatch(), |
| | | List<LocDetl> locDetls = locDetlService.queryStockAll(null, null,orderDetl.getMatnr(), orderDetl.getBatch(), |
| | | orderDetl.getBrand(),orderDetl.getStandby1(),orderDetl.getStandby2(),orderDetl.getStandby3(),orderDetl.getBoxType1(),orderDetl.getBoxType2(),orderDetl.getBoxType3(),areaIds); |
| | | for (LocDetl locDetl : locDetls) { |
| | | if (issued > 0) { |
| | | LocDto locDto = new LocDto(locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getMaktx(), locDetl.getBatch(), orderDetl.getOrderNo(), |
| | | issued >= locDetl.getAnfme() ? locDetl.getAnfme() : issued); |
| | | Long detlId = locDetl.getId(); |
| | | Double used = locDetlUsage.getOrDefault(detlId, 0.0); |
| | | Double available = locDetl.getAnfme() - used; |
| | | if (available <= 0.000001) { |
| | | continue; |
| | | } |
| | | |
| | | Double currentIssue = (issued >= available) ? available : issued; |
| | | |
| | | LocDto locDto = new LocDto(locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getMaktx(), locDetl.getBatch(), orderDetl.getOrderNo(), currentIssue); |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetl.getLocNo())); |
| | | locDto.setFrozen(locDetl.getFrozen()); |
| | | locDto.setFrozenLoc(locMast.getFrozen()); |
| | | List<Integer> staNos = staDescService.queryOutStaNosByLocNo(locDetl.getLocNo(), issued >= locDetl.getAnfme() ? 101 : 103); |
| | | List<Integer> staNos = staDescService.queryOutStaNosByLocNo(locDetl.getLocNo(), currentIssue >= available ? 101 : 103); |
| | | locDto.setStaNos(staNos); |
| | | locDto.setBrand(orderDetl.getBrand()); |
| | | |
| | |
| | | locDto.setBoxType2(orderDetl.getBoxType2()); |
| | | locDto.setBoxType3(orderDetl.getBoxType3()); |
| | | locDtos.add(locDto); |
| | | exist.add(locDetl.getLocNo()); |
| | | |
| | | locDetlUsage.put(detlId, used + currentIssue); |
| | | // 剩余待出数量递减 |
| | | issued = issued - locDetl.getAnfme(); |
| | | issued = issued - currentIssue; |
| | | } else { |
| | | break; |
| | | } |
| | |
| | | return null; |
| | | } |
| | | if (this.locSts.equals(LocStsType.LOC_STS_TYPE_O.type)) { |
| | | return LocStsType.LOC_STS_TYPE_O.type + "." + LocStsType.LOC_STS_TYPE_O.desc; |
| | | return LocStsType.LOC_STS_TYPE_O.desc; |
| | | } else if (this.locSts.equals(LocStsType.LOC_STS_TYPE_R.type)) { |
| | | return LocStsType.LOC_STS_TYPE_R.type + "." + LocStsType.LOC_STS_TYPE_R.desc; |
| | | return LocStsType.LOC_STS_TYPE_R.desc; |
| | | } else if (this.locSts.equals(LocStsType.LOC_STS_TYPE_S.type)) { |
| | | return LocStsType.LOC_STS_TYPE_S.type + "." + LocStsType.LOC_STS_TYPE_S.desc; |
| | | return LocStsType.LOC_STS_TYPE_S.desc; |
| | | } else if (this.locSts.equals(LocStsType.LOC_STS_TYPE_F.type)) { |
| | | return LocStsType.LOC_STS_TYPE_F.type + "." + LocStsType.LOC_STS_TYPE_F.desc; |
| | | return LocStsType.LOC_STS_TYPE_F.desc; |
| | | } else if (this.locSts.equals(LocStsType.LOC_STS_TYPE_X.type)) { |
| | | return LocStsType.LOC_STS_TYPE_X.type + "." + LocStsType.LOC_STS_TYPE_X.desc; |
| | | return LocStsType.LOC_STS_TYPE_X.desc; |
| | | } else if (this.locSts.equals(LocStsType.LOC_STS_TYPE_D.type)) { |
| | | return LocStsType.LOC_STS_TYPE_D.type + "." + LocStsType.LOC_STS_TYPE_D.desc; |
| | | return LocStsType.LOC_STS_TYPE_D.desc; |
| | | } |
| | | return null; |
| | | } |
| | |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.enums.CheckStatusEnum; |
| | | import com.zy.asrs.service.OrderService; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.common.utils.Synchro; |
| | | import com.zy.system.service.UserService; |
| | | import com.zy.system.entity.User; |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.UserService; |
| | | import com.zy.system.entity.User; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.enums.LocStsType; |
| | | import com.zy.asrs.service.BasWhsTypeService; |
| | | import com.zy.asrs.service.BasCrnpService; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | |
| | | |
| | | |
| | | @ApiModelProperty("主键ID") |
| | | @TableId |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | |
| | | } else if (locSts.equals(LocStsType.LOC_STS_TYPE_D.type)) { |
| | | return LocStsType.LOC_STS_TYPE_D.desc; |
| | | } else if (locSts.equals(LocStsType.LOC_STS_TYPE_O.type)) { |
| | | return LocStsType.LOC_STS_TYPE_F.desc; |
| | | return LocStsType.LOC_STS_TYPE_O.desc; |
| | | } else if (locSts.equals(LocStsType.LOC_STS_TYPE_R.type)) { |
| | | return LocStsType.LOC_STS_TYPE_R.desc; |
| | | } else if (locSts.equals(LocStsType.LOC_STS_TYPE_S.type)) { |
| | |
| | | this.memo = memo; |
| | | } |
| | | |
| | | // Mat mat = new Mat( |
| | | // null, // 编号 |
| | | // null, // 所属归类 |
| | | // null, // 商品编号 |
| | | // null, // 商品名称 |
| | | // null, // 别名 |
| | | // null, // 规格 |
| | | // null, // 型号 |
| | | // null, // 颜色 |
| | | // null, // 品牌 |
| | | // null, // 单位 |
| | | // null, // 单价 |
| | | // null, // sku |
| | | // null, // 单位量 |
| | | // null, // 条码 |
| | | // null, // 产地 |
| | | // null, // 厂家 |
| | | // null, // 生产日期 |
| | | // null, // 品项数 |
| | | // null, // 安全库存量 |
| | | // null, // 重量 |
| | | // null, // 长度 |
| | | // null, // 体积 |
| | | // null, // 三方编码 |
| | | // null, // 供应商 |
| | | // null, // 供应商编码 |
| | | // null, // 是否批次 |
| | | // null, // 保质期 |
| | | // null, // 预警天数 |
| | | // null, // 制购 |
| | | // null, // 要求检验 |
| | | // null, // 危险品 |
| | | // null, // 状态[非空] |
| | | // null, // 添加人员 |
| | | // null, // 添加时间 |
| | | // null, // 修改人员 |
| | | // null, // 修改时间 |
| | | // null // 备注 |
| | | // ); |
| | | |
| | | public String getTagId$(){ |
| | | // TagService service = SpringUtils.getBean(TagService.class); |
| | | // Tag tag = service.selectById(this.tagId); |
| | | // if (!Cools.isEmpty(tag)){ |
| | | // return String.valueOf(tag.getName()); |
| | | // } |
| | | return MatLocType.getTagName(this.tagId + ""); |
| | | } |
| | | |
| | |
| | | return null; |
| | | } |
| | | |
| | | public String getProType(){ |
| | | return MatLocType.getMatTag(this.tagId + ""); |
| | | } |
| | | |
| | | public String getBeBatch$(){ |
| | | if (null == this.beBatch){ return null; } |
| | | switch (this.beBatch){ |
| | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | private String crn_end_time; |
| | | |
| | | @ApiModelProperty(value= "工作号") |
| | | private Integer wrk_no; |
| | | @TableField("wrk_no") |
| | | private Integer wrkNo; |
| | | |
| | | @ApiModelProperty(value= "工作时间") |
| | | private Date io_time; |
| | | @TableField("io_time") |
| | | private Date ioTime; |
| | | |
| | | @ApiModelProperty(value= "库位号") |
| | | private String loc_no; |
| | | @TableField("loc_no") |
| | | private String locNo; |
| | | |
| | | @ApiModelProperty(value= "托盘条码") |
| | | private String zpallet; |
| | |
| | | private Double volume; |
| | | |
| | | @ApiModelProperty(value= "三方编码") |
| | | private String three_code; |
| | | @TableField("three_code") |
| | | private String threeCode; |
| | | |
| | | @ApiModelProperty(value= "供应商") |
| | | private String supp; |
| | | |
| | | @ApiModelProperty(value= "供应商编码") |
| | | private String supp_code; |
| | | @TableField("supp_code") |
| | | private String suppCode; |
| | | |
| | | @ApiModelProperty(value= "是否批次 1: 是 0: 否 ") |
| | | private Integer be_batch; |
| | |
| | | private Integer danger; |
| | | |
| | | @ApiModelProperty(value= "修改人员") |
| | | private Long modi_user; |
| | | @TableField("modi_user") |
| | | private Long modiUser; |
| | | |
| | | @ApiModelProperty(value= "修改时间") |
| | | private Object modi_time; |
| | | @TableField("modi_time") |
| | | private Object modiTime; |
| | | |
| | | @ApiModelProperty(value= "创建者") |
| | | private Long appe_user; |
| | | @TableField("appe_user") |
| | | private Long appeUser; |
| | | |
| | | @ApiModelProperty(value= "添加时间") |
| | | private Object appe_time; |
| | | @TableField("appe_time") |
| | | private Object appeTime; |
| | | |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | public String getModiUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.modi_user); |
| | | User user = service.selectById(this.modiUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | |
| | | |
| | | public String getAppeUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.appe_user); |
| | | User user = service.selectById(this.appeUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | |
| | | } |
| | | |
| | | public String getIoTime$(){ |
| | | if (Cools.isEmpty(this.io_time)){ |
| | | if (Cools.isEmpty(this.ioTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.io_time); |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.ioTime); |
| | | } |
| | | |
| | | public String getTag$() { |
| | | if (!Cools.isEmpty(this.matnr)){ |
| | | MatService matnrService = SpringUtils.getBean(MatService.class); |
| | | Mat matnr = matnrService.selectByMatnr(this.matnr); |
| | | if (!Cools.isEmpty(matnr)){ |
| | | return matnr.getTagId$(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | public void setQuery_date(String query_date) { |
| | |
| | | public enum LocStsType { |
| | | |
| | | //空板 |
| | | LOC_STS_TYPE_D("D", "空板"), |
| | | LOC_STS_TYPE_D("D", "D.空板"), |
| | | //在库 |
| | | LOC_STS_TYPE_F("F", "在库"), |
| | | LOC_STS_TYPE_F("F", "F.在库"), |
| | | //空库 |
| | | LOC_STS_TYPE_O("O", "空库"), |
| | | LOC_STS_TYPE_O("O", "O.空库"), |
| | | //禁用 |
| | | LOC_STS_TYPE_X("X", "禁用"), |
| | | LOC_STS_TYPE_X("X", "X.禁用"), |
| | | //入库预约 |
| | | LOC_STS_TYPE_S("S", "入库预约"), |
| | | LOC_STS_TYPE_S("S", "S.入库预约"), |
| | | //出库预约 |
| | | LOC_STS_TYPE_R("R", "出库预约"), |
| | | LOC_STS_TYPE_R("R", "R.出库预约"), |
| | | ; |
| | | |
| | | public String type; |
| New file |
| | |
| | | package com.zy.asrs.enums; |
| | | |
| | | /** |
| | | * 工作状态枚举 |
| | | * 根据WrkStaus表生成对应枚举信息 |
| | | */ |
| | | public enum TaskStatusType { |
| | | |
| | | IN_START("1", "1.生成入库ID"), |
| | | DEVICE_MOVE("2", "2.设备上走"), |
| | | CRANE_IN_PROGRESS("3", "3.吊车入库中"), |
| | | INBOUND_COMPLETED("4", "4.入库完成"), |
| | | INBOUND_ARCHIVED("5", "5.库存更新完成"), |
| | | DEVICE_EXIT("6", "6.设备上退出"), |
| | | OUT_START("11", "11.生成出库ID"), |
| | | CRANE_OUT_PROGRESS("12", "12.吊车出库中"), |
| | | CRANE_EMPTY_OUT_ERROR("13", "13.吊车空出库错误"), |
| | | OUTBOUND_COMPLETED("14", "14.已出库未确认"), |
| | | OUTBOUND_ARCHIVED("15", "15.出库更新完成"), |
| | | AGV_IN_START("201", "201.生成入库ID"), |
| | | AGV_TASK_ISSUED_IN("202", "202.任务下发成功"), |
| | | AGV_TASK_RUNNING_IN("203", "203.任务执行中"), |
| | | AGV_TASK_FINISHED_IN("204", "204.任务执行完成"), |
| | | AGV_INVENTORY_UPDATED_IN("205", "205.库存更新完成"), |
| | | AGV_OUT_START("301", "301.生成出库ID"), |
| | | AGV_TASK_ISSUED_OUT("302", "302.任务下发成功"), |
| | | AGV_TASK_RUNNING_OUT("303", "303.任务执行中"), |
| | | AGV_TASK_FINISHED_OUT("304", "304.任务执行完成"), |
| | | AGV_INVENTORY_UPDATED_OUT("305", "305.库存更新完成"), |
| | | ; |
| | | |
| | | public Long type; |
| | | public String desc; |
| | | |
| | | TaskStatusType(String type, String desc) { |
| | | this.type = Long.valueOf(type); |
| | | this.desc = desc; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.CheckOrder; |
| | | import com.zy.asrs.entity.Order; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | |
| | | Order selectOrderMoveStatus(); |
| | | Order selectOrderMoveStatusInitial(); |
| | | /** |
| | | * 查询损溢单完结的订单 |
| | | * @return |
| | | */ |
| | | List<CheckOrder> selectCompleteCheck(); |
| | | } |
| | |
| | | */ |
| | | void combInPub(CompleteParam combParam, Long userId); |
| | | |
| | | /** |
| | | * SO/EO 区组托 |
| | | * @author Ryan |
| | | * @date 2025/12/18 15:19 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | R collectionPakin(CollectionPakinParams params, Long userId); |
| | | |
| | | R collectionPakinView(CollectionPakinParams params); |
| | | |
| | | /** |
| | | * 呼叫AGV返回 |
| | | * @author Ryan |
| | | * @date 2025/9/24 |
| | | * @param callAgvBackParam |
| | | * @return com.core.common.R |
| | | */ |
| | | R agvCallback(AgvCallParams callAgvBackParam, Long userId); |
| | | } |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.entity.*; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.WrkDetl; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | Order selectOrderMoveStatus(); |
| | | Order selectOrderMoveStatusInitial(); |
| | | |
| | | /** |
| | | * 查询损溢单完结的订单 |
| | | * @return |
| | | */ |
| | | List<CheckOrder> selectCompleteCheck(); |
| | | |
| | | } |
| | |
| | | OrderInAndOutUtil.increaseWorkQty(Boolean.TRUE, order.getId(), elem.getMatnr(), elem.getBatch(), |
| | | elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(), |
| | | elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme()); |
| | | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), |
| | | DetlDto detlDto = new DetlDto(order.getOrderNo(), elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), |
| | | elem.getStandby2(), elem.getStandby3(), |
| | | elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme(), |
| | | elem.getThreeCode()); |
| | | detlDto.setOrderId(order.getId()); |
| | | detlDto.setOrderNo(order.getOrderNo()); |
| | | if (DetlDto.has(detlDtos, detlDto)) { |
| | | if (DetlDto.hasOrder(detlDtos, detlDto)) { |
| | | DetlDto one = DetlDto.findDto(detlDtos, detlDto); |
| | | assert one != null; |
| | | one.setAnfme(one.getAnfme() + detlDto.getAnfme()); |
| | |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(MesConstant.URL) |
| | | .setPath(MesConstant.PACK_DOWN_URL) |
| | | .setPath(MesConstant.IN_DISPATCH_RESULT) |
| | | .setJson(JSON.toJSONString(mesCombParam)) |
| | | .build() |
| | | .doPost(); |
| | |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | success = true; |
| | | } else if (jsonObject.getInteger("code").equals(500)) { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL + MesConstant.PACK_DOWN_URL, |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL + MesConstant.IN_DISPATCH_RESULT, |
| | | JSON.toJSONString(mesCombParam), response); |
| | | throw new CoolException(jsonObject.getString("msg")); |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL + MesConstant.PACK_DOWN_URL, |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL + MesConstant.IN_DISPATCH_RESULT, |
| | | JSON.toJSONString(mesCombParam), response); |
| | | throw new CoolException("上报mes系统失败"); |
| | | } |
| | |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "打包下线帮托上报", |
| | | MesConstant.URL + MesConstant.PACK_DOWN_URL, |
| | | MesConstant.URL + MesConstant.IN_DISPATCH_RESULT, |
| | | null, |
| | | "127.0.0.1", |
| | | JSON.toJSONString(mesCombParam), |
| | |
| | | throw new CoolException("数据错误,站点不存在!!"); |
| | | } |
| | | station.setLocSts(LocStsType.LOC_STS_TYPE_O.type); |
| | | station.setBarcode(""); |
| | | if (!basStationService.updateById(station)) { |
| | | throw new CoolException("站点状态更新失败!!"); |
| | | } |
| | |
| | | } |
| | | |
| | | station.setLocSts(LocStsType.LOC_STS_TYPE_O.type); |
| | | station.setBarcode(""); |
| | | if (!basStationService.updateById(station)) { |
| | | throw new CoolException("站点状态修改失败!"); |
| | | } |
| | |
| | | generateCrnInTask(waitPakins, station, param.getLocType1(), userId); |
| | | } |
| | | |
| | | /** |
| | | * SO/EO 区组托 |
| | | * @author Ryan |
| | | * @date 2025/12/18 15:19 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R collectionPakin(CollectionPakinParams params, Long userId) { |
| | |
| | | .eq("loc_sts", LocStsType.LOC_STS_TYPE_D.type) |
| | | .orderAsc(Arrays.asList("row1", "bay1", "lev1")) |
| | | .last("OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY")); |
| | | |
| | | if (Objects.isNull(locMast)) { |
| | | throw new CoolException("未查询到可用的空板信息!!"); |
| | | } |
| | | |
| | | CrnTaskDetlDTO crnTaskDetlDTO = new CrnTaskDetlDTO().setLocNo(locMast.getLocNo()).setLocDetlList(locDetls); |
| | | locMasts.add(crnTaskDetlDTO); |
| | | |
| | | // 空板出库 |
| | | generateTask(locMasts, TaskIOType.MERGE_OUT.type, basDevp, userId, station); |
| | | } |
| | |
| | | Task task = new Task(); |
| | | task.setWrkNo(workNo) |
| | | .setIoTime(new Date()) |
| | | .setWrkSts(11L) // 工作状态:11.生成出库ID |
| | | .setWrkSts(301L) // 工作状态:11.生成出库ID |
| | | .setIoType(loc.getLocSts().equals("D") ? 110 : 101) // 入出库状态: 11.库格移载 |
| | | .setTaskType("agv") |
| | | .setIoPri(10D) |
| | |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void generateAgvTask(String type, LocCache loc, String orgSite, String barcode, Long userId) { |
| | | List<WaitPakin> pakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", barcode)); |
| | | if (Objects.isNull(pakins) || pakins.isEmpty()) { |
| | | throw new CoolException("组托信息不存在!!"); |
| | | } |
| | | |
| | | List<Task> tasks = taskService.selectList(new EntityWrapper<Task>().eq("barcode", barcode)); |
| | | if (!tasks.isEmpty()) { |
| | | throw new CoolException("托盘已在任务执行中.."); |
| | |
| | | Task task = new Task(); |
| | | task.setWrkNo(workNo) |
| | | .setIoTime(new Date()) |
| | | .setWrkSts(1L) // 工作状态:11.生成出库ID |
| | | .setWrkSts(201L) // 工作状态:11.生成出库ID |
| | | .setIoType(1) // 入出库状态: 11.库格移载 |
| | | .setTaskType("agv") |
| | | .setIoPri(10D) |
| | |
| | | .setModiTime(new Date()); |
| | | if (!taskService.insert(task)) { |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | |
| | | if (!type.equals("agv_back")) { |
| | | List<WaitPakin> pakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", barcode)); |
| | | if (Objects.isNull(pakins) || pakins.isEmpty()) { |
| | | throw new CoolException("组托信息不存在!!"); |
| | | } |
| | | |
| | | for (WaitPakin pakin : pakins) { |
| | |
| | | throw new CoolException("更新组托信息失败"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 修改目标库位状态 |
| | | if (loc.getLocSts().equals(LocStsType.LOC_STS_TYPE_O.type)) { |
| | |
| | | throw new CoolException("站点不存在!!"); |
| | | } |
| | | |
| | | if (station.getLocSts().equals(LocStsType.LOC_STS_TYPE_O.type)) { |
| | | if (station.getLocSts().equals(LocStsType.LOC_STS_TYPE_O.type) || station.getLocSts().equals(LocStsType.LOC_STS_TYPE_D.type)) { |
| | | station.setLocSts("R"); // S.入库预约 |
| | | // station.setBarcode(barcode); |
| | | station.setBarcode(barcode); |
| | | station.setModiTime(new Date()); |
| | | station.setModiUser(userId); |
| | | if (!basStationService.updateById(station)) { |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 呼叫AGV空台车返回 |
| | | * @author Ryan |
| | | * @date 2025/9/24 |
| | | * @param callAgvBackParam |
| | | * @return com.core.common.R |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R agvCallback(AgvCallParams callAgvBackParam, Long userId) { |
| | | if (Objects.isNull(callAgvBackParam.getOrgSite())) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | |
| | | // 按当前查找库位顺序,查到一个后,不再往下查询 |
| | | LocCache locCache = findPriorityLocCache(); |
| | | |
| | | if (Objects.isNull(locCache)) { |
| | | return R.error("未查询到可用库位"); |
| | | } |
| | | |
| | | // 修改目标站点信息 |
| | | BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", callAgvBackParam.getOrgSite())); |
| | | if (Objects.isNull(station)) { |
| | | throw new CoolException("站点不存在!!"); |
| | | } |
| | | |
| | | try { |
| | | //空台车回库 |
| | | generateAgvTask("agv_back", locCache, callAgvBackParam.getOrgSite(), station.getBarcode(), userId); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return R.error(e.getMessage()); |
| | | } |
| | | |
| | | return R.ok(locCache); |
| | | } |
| | | |
| | | /** |
| | | * 按优先级查找可用库位 |
| | | * 顺序:入库缓存区 -> SO区 -> EO区 |
| | | */ |
| | | private LocCache findPriorityLocCache() { |
| | | // 1. Try Inbound Cache Area |
| | | LocCache loc = findAvailableLocByAreaType(LocAreaType.LOC_AREA_TYPE_IN_CACHE); |
| | | if (loc != null) return loc; |
| | | |
| | | // 2. Try SO Area |
| | | loc = findAvailableLocByAreaType(LocAreaType.LOC_AREA_TYPE_SO); |
| | | if (loc != null) return loc; |
| | | |
| | | // 3. Try EO Area |
| | | loc = findAvailableLocByAreaType(LocAreaType.LOC_AREA_TYPE_EO); |
| | | return loc; |
| | | } |
| | | |
| | | /** |
| | | * 根据区域类型查找可用库位 |
| | | */ |
| | | private LocCache findAvailableLocByAreaType(LocAreaType areaType) { |
| | | BasAreas area = basAreasService.selectOne(new EntityWrapper<BasAreas>().eq("whs_type_id", areaType.type)); |
| | | if (area == null) { |
| | | return null; |
| | | } |
| | | return locCacheService.selectOne(new EntityWrapper<LocCache>() |
| | | .eq("area_id", area.getId()) |
| | | .eq("frozen", 0) |
| | | .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type) |
| | | .orderAsc(Arrays.asList("loc_no")) |
| | | .last("OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY")); |
| | | } |
| | | } |
| | |
| | | return this.baseMapper.selectOrderMoveStatusInitial(); |
| | | } |
| | | |
| | | /** |
| | | * 查询损溢单完结的订单 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<CheckOrder> selectCompleteCheck() { |
| | | return this.baseMapper.selectCompleteCheck(); |
| | | } |
| | | |
| | | } |
| | |
| | | BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", wrkMast.getSourceStaNo())); |
| | | if (!Objects.isNull(station)) { |
| | | station.setLocSts(LocStsType.LOC_STS_TYPE_O.type); |
| | | station.setBarcode(null); |
| | | station.setBarcode(""); |
| | | if (!basStationService.updateById(station)) { |
| | | throw new CoolException("站点状态修改失败!!"); |
| | | } |
| | |
| | | BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", wrkMast.getStaNo())); |
| | | if (station.getLocSts().equals("S")) { |
| | | station.setLocSts("O"); |
| | | station.setBarcode(null); |
| | | station.setBarcode(""); |
| | | station.setModiTime(new Date()); |
| | | station.setModiUser(userId); |
| | | if (!basStationService.updateById(station)) { |
| | |
| | | package com.zy.asrs.task; |
| | | |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.CheckOrder; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.enums.OrderTypeEnum; |
| | | import com.zy.asrs.service.ApiLogService; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /**损溢单完结上报 */ |
| | | @Scheduled(cron = "0/30 * * * * ?") |
| | | @Async("orderThreadPool") |
| | | public void completeCheckOrderReport() { |
| | | if (!ErpReportOld){ |
| | | return; |
| | | } |
| | | String erpReport = Parameter.get().getErpReport(); |
| | | if (!Cools.isEmpty(erpReport) && erpReport.equals("true")) { |
| | | List<CheckOrder> orders = orderService.selectCompleteCheck(); |
| | | for (CheckOrder order : orders) { |
| | | try { |
| | | ReturnT<String> result = orderSyncHandler.startCheckOrderReport(order); |
| | | if (!result.isSuccess()) { |
| | | log.error("单据[orderNo={}]上报erp失败", order.getOrderNo()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage()); |
| | | log.error("单据[orderNo={}]上报erp失败", order.getOrderNo()); |
| | | } |
| | | |
| | | try { |
| | | Thread.sleep(300); |
| | | } catch (InterruptedException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.api.entity.OrderItemsParam; |
| | | import com.zy.api.entity.OutOrderParams; |
| | | import com.zy.api.entity.PubOrderParams; |
| | | import com.zy.api.entity.ReportOrderParam; |
| | | import com.zy.api.entity.ReportOrderParams; |
| | | import com.zy.api.entity.StockAdjustParams; |
| | | import com.zy.api.entity.StockUpOrderParams; |
| | | import com.zy.api.entity.dto.XSR; |
| | | import com.zy.api.service.KopenApiService; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.enums.OrderTypeEnum; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.service.impl.CheckOrderDetlServiceImpl; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.utils.OrderInAndOutUtil; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.constant.MesConstant; |
| | | import com.zy.common.model.DetlDto; |
| | | import com.zy.common.model.MesPakinParam; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/7/7 |
| | |
| | | @Slf4j |
| | | @Service |
| | | public class OrderSyncHandler extends AbstractHandler<String> { |
| | | |
| | | private final CheckOrderDetlServiceImpl checkOrderDetlService; |
| | | |
| | | @Autowired |
| | | private JdbcTemplate jdbcTemplate; |
| | |
| | | private OrderDetlPakinService orderDetlPakinService; |
| | | @Autowired |
| | | private KopenApiService kopenApiService; |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | | OrderSyncHandler(CheckOrderDetlServiceImpl checkOrderDetlService) { |
| | | this.checkOrderDetlService = checkOrderDetlService; |
| | | } |
| | | |
| | | @Transactional |
| | | public ReturnT<String> startOrderIssuedOnceMore(Order order) { |
| | |
| | | return SUCCESS; |
| | | } |
| | | |
| | | @Transactional |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ReturnT<String> startOrderIssued(Order order) { |
| | | DocType docType = docTypeService.selectById(order.getDocType()); |
| | | if (null == docType) { |
| | |
| | | List<OrderDetl> orderDetlList = new ArrayList<>(); |
| | | |
| | | for (OrderDetl detail : orderDetls) { |
| | | DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(),detail.getBrand(),detail.getStandby1(),detail.getStandby2(),detail.getStandby3(), |
| | | detail.getBoxType1(),detail.getBoxType2(),detail.getBoxType3(), detail.getAnfme(), detail.getThreeCode()); |
| | | DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(), detail.getBrand(), detail.getStandby1(), |
| | | detail.getStandby2(), detail.getStandby3(), |
| | | detail.getBoxType1(), detail.getBoxType2(), detail.getBoxType3(), detail.getAnfme(), |
| | | detail.getThreeCode()); |
| | | if (DetlDto.has(list, dto)) { |
| | | DetlDto detlDto = DetlDto.find(list, dto.getMatnr(), dto.getBatch(),dto.getBrand(),dto.getStandby1(),dto.getStandby2(),dto.getStandby3(),dto.getBoxType1(),dto.getBoxType2(),dto.getBoxType3()); |
| | | DetlDto detlDto = DetlDto.find(list, dto.getMatnr(), dto.getBatch(), dto.getBrand(), dto.getStandby1(), |
| | | dto.getStandby2(), dto.getStandby3(), dto.getBoxType1(), dto.getBoxType2(), dto.getBoxType3()); |
| | | assert detlDto != null; |
| | | detlDto.setAnfme(detlDto.getAnfme() + detail.getAnfme()); |
| | | |
| | | OrderDetl orderDetl = OrderDetl.find(orderDetlList, dto.getMatnr(), dto.getBatch(),dto.getBrand(),dto.getStandby1(),dto.getStandby2(),dto.getStandby3(),dto.getBoxType1(),dto.getBoxType2(),dto.getBoxType3()); |
| | | OrderDetl orderDetl = OrderDetl.find(orderDetlList, dto.getMatnr(), dto.getBatch(), dto.getBrand(), |
| | | dto.getStandby1(), dto.getStandby2(), dto.getStandby3(), dto.getBoxType1(), dto.getBoxType2(), |
| | | dto.getBoxType3()); |
| | | assert orderDetl != null; |
| | | orderDetl.setAnfme(orderDetl.getAnfme() + detail.getAnfme()); |
| | | } else { |
| | |
| | | throw new CoolException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | // 修改订单状态 1.未作业 ===>> 2.作业中 |
| | | if (!orderService.updateSettle(order.getId(), 2L, null)) { |
| | |
| | | BeanUtils.copyProperties(orderDetl,orderDetlPakin); |
| | | orderDetlPakin.setOrderId(orderPakin.getId()); |
| | | |
| | | |
| | | if (!orderDetlPakinService.insert(orderDetlPakin)){ |
| | | throw new CoolException("插入备货入库单失败"); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | return SUCCESS; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 单据上报 |
| | | * @author Ryan |
| | | * @date 2025/12/15 16:14 |
| | | * |
| | | * @param order |
| | | * @return com.zy.asrs.task.core.ReturnT<java.lang.String> |
| | | * @author Ryan |
| | | * @date 2025/12/15 16:14 |
| | | */ |
| | | @Transactional |
| | | public ReturnT<String> startOrderReport(Order order) { |
| | |
| | | } |
| | | long settle = 6L; |
| | | List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId()); |
| | | // 入库完成上报 |
| | | if (docType.getPakin() == 1) { |
| | | MesPakinParam pakinParam = new MesPakinParam(); |
| | | pakinParam.setPakinTime(DateUtils.convert(order.getUpdateTime())); |
| | | pakinParam.setLgortFrom("5008"); |
| | | pakinParam.setLgortTo("5006"); |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | if (!orderDetl.getQty().equals(orderDetl.getAnfme())){ |
| | | settle = 99L;//二次生成单据 |
| | | } |
| | | String serial = Cools.isEmpty(orderDetl.getBatch()) ? "" : orderDetl.getBatch(); |
| | | pakinParam.getList().add(new MesPakinParam.Detl(orderDetl.getMatnr() + (Cools.isEmpty(serial) ? "" : "-" + serial), orderDetl.getAnfme())); |
| | | } |
| | | if (Integer.valueOf(docType.getDocId() + "").equals(OrderTypeEnum.PICKING.type)) { |
| | | // 上架派工单完成 |
| | | ReportOrderParam orderParam = new ReportOrderParam(); |
| | | orderParam.setCompany_id(order.getCstmrName()) |
| | | .setWms_id(order.getId() + "") |
| | | .setOrder_no(order.getOrderNo()) |
| | | .setType(order.getDocType() + "") |
| | | .setInv_no(order.getNumber()) |
| | | .setPm_tktid(order.getItemName()) |
| | | .setUpdate_time(Utils.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss")) |
| | | .setTarget_location(""); |
| | | |
| | | String response = ""; |
| | | List<ReportOrderParams> reportOrderParams = new ArrayList<>(); |
| | | orderDetls.forEach(detl -> { |
| | | Mat material = matService.selectByMatnr(detl.getMatnr()); |
| | | if (Objects.isNull(material)) { |
| | | throw new CoolException("物料不存在"); |
| | | } |
| | | ReportOrderParams itemParam = new ReportOrderParams(); |
| | | // BS Code |
| | | itemParam.setTotal_serial(detl.getThreeCode()) |
| | | // 上报时,默认产品类型是null |
| | | .setPro_type(material.getProType()) |
| | | // 上报时,默认产品编码 |
| | | .setPro_komcode(detl.getMatnr()) |
| | | // 上报时,默认产品id是供应商编码 |
| | | .setPro_id(detl.getSuppCode()) |
| | | // 上报时,默认来源位置是null |
| | | .setLocation_no(null) |
| | | // 上报时,默认目标位置是null |
| | | .setLocation_type(null) |
| | | // 上报时,默认上报时间是更新时间 |
| | | .setSj_date(order.getUpdateBy().toString()) |
| | | // 上报时,默认上报人是更新人 |
| | | .setSj_emp(order.getUpdateBy$()) |
| | | // 上报时,默认上报数量是订单数量 |
| | | .setPick_qty(detl.getQty().intValue()) |
| | | // 上报时,默认损坏数量是0 |
| | | .setDamage_qty(0) |
| | | // 上报时,默认差异数量是0 |
| | | .setDiff_qty(0); |
| | | |
| | | reportOrderParams.add(itemParam); |
| | | }); |
| | | |
| | | orderParam.setDetails(reportOrderParams); |
| | | |
| | | XSR response = null; |
| | | boolean success = false; |
| | | try { |
| | | ReportOrderParam orderParam = new ReportOrderParam(); |
| | | List<ReportOrderParam> orderParams = new ArrayList<>(); |
| | | orderParams.add(orderParam); |
| | | response = kopenApiService.getInDispatchResult(orderParams); |
| | | |
| | | kopenApiService.getInDispatchResult(orderParam); |
| | | // response = new HttpHandler.Builder() |
| | | // .setUri(MesConstant.URL) |
| | | // .setPath(MesConstant.PAKIN_URL) |
| | | // .setJson(JSON.toJSONString(pakinParam)) |
| | | // .build() |
| | | // .doPost(); |
| | | // JSONObject jsonObject = JSON.parseObject(response); |
| | | // if (jsonObject.getInteger("code").equals(200)) { |
| | | if (true) { |
| | | success = true; |
| | | // 修改订单状态 4.完成 ===>> 6.已上报 |
| | | if (!orderService.updateSettle(order.getId(), settle, null)) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PAKIN_URL, JSON.toJSONString(pakinParam), response); |
| | | throw new CoolException("上报mes系统失败"); |
| | | } |
| | | // if (true) { |
| | | // success = true; |
| | | // // 修改订单状态 4.完成 ===>> 6.已上报 |
| | | // if (!orderService.updateSettle(order.getId(), settle, null)) { |
| | | // throw new CoolException("服务器内部错误,请联系管理员"); |
| | | // } |
| | | // } else { |
| | | // log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL + |
| | | // MesConstant.PAKIN_URL, JSON.toJSONString(pakinParam), response); |
| | | // throw new CoolException("上报mes系统失败"); |
| | | // } |
| | | } catch (Exception e) { |
| | | log.error("fail", e); |
| | | // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | |
| | | try { |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "成品库入库上报", |
| | | MesConstant.URL + MesConstant.PAKIN_URL, |
| | | "上架派工单完成上报", |
| | | MesConstant.URL + MesConstant.IN_DISPATCH_RESULT, |
| | | null, |
| | | "127.0.0.1", |
| | | JSON.toJSONString(pakinParam), |
| | | response, |
| | | success |
| | | ); |
| | | } catch (Exception e) { log.error("", e); } |
| | | JSON.toJSONString(orderParam), |
| | | JSON.toJSONString(response), |
| | | success); |
| | | } catch (Exception e) { |
| | | log.error("", e); |
| | | } |
| | | } |
| | | // 出库完成上报 |
| | | if (docType.getPakout() == 1) { |
| | | MesPakoutParam pakoutParam = new MesPakoutParam(); |
| | | pakoutParam.setTag(!order.getDocType$().equalsIgnoreCase("手动出库单")); |
| | | pakoutParam.setPakoutTime(DateUtils.convert(order.getUpdateTime())); |
| | | pakoutParam.setLgortFrom("5006"); |
| | | pakoutParam.setLgortTo("1111"); |
| | | if (!pakoutParam.isTag()) { |
| | | pakoutParam.setKunnr("C1000"); |
| | | } else if (Integer.valueOf(docType.getDocId() + "").equals(OrderTypeEnum.TRANSFER.type)) { |
| | | // 备货派工单(出库) |
| | | ReportOrderParam orderParam = new ReportOrderParam(); |
| | | orderParam.setCompany_id(order.getCstmrName()) |
| | | .setWms_id(order.getId() + "") |
| | | .setOrder_no(order.getOrderNo()) |
| | | .setType(order.getDocType() + "") |
| | | .setInv_no(order.getNumber()) |
| | | .setPm_tktid(order.getItemName()) |
| | | .setUpdate_time(Utils.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss")) |
| | | .setTarget_location(""); |
| | | |
| | | List<ReportOrderParams> reportOrderParams = new ArrayList<>(); |
| | | orderDetls.forEach(detl -> { |
| | | Mat material = matService.selectByMatnr(detl.getMatnr()); |
| | | if (Objects.isNull(material)) { |
| | | throw new CoolException("物料不存在"); |
| | | } |
| | | pakoutParam.setOrderNo(order.getOrderNo()); |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | if (!orderDetl.getQty().equals(orderDetl.getAnfme())){ |
| | | settle = 99L;//二次生成单据 |
| | | } |
| | | String serial = Cools.isEmpty(orderDetl.getBatch()) ? "" : orderDetl.getBatch(); |
| | | pakoutParam.getList().add(new MesPakoutParam.Detl(orderDetl.getMatnr() + (Cools.isEmpty(serial) ? "" : "-" + serial), orderDetl.getAnfme())); |
| | | } |
| | | String response = ""; |
| | | ReportOrderParams itemParam = new ReportOrderParams(); |
| | | // BS Code |
| | | itemParam.setTotal_serial(detl.getThreeCode()) |
| | | // 上报时,默认产品类型是null |
| | | .setPro_type(material.getProType()) |
| | | // 上报时,默认产品编码 |
| | | .setPro_komcode(detl.getMatnr()) |
| | | // 上报时,默认产品id是供应商编码 |
| | | .setPro_id(detl.getSuppCode()) |
| | | // 上报时,默认来源位置是null |
| | | .setLocation_no(null) |
| | | // 上报时,默认目标位置是null |
| | | .setLocation_type(null) |
| | | // 上报时,默认上报时间是更新时间 |
| | | .setSj_date(order.getUpdateBy().toString()) |
| | | // 上报时,默认上报人是更新人 |
| | | .setSj_emp(order.getUpdateBy$()) |
| | | // 上报时,默认上报数量是订单数量 |
| | | .setPick_qty(detl.getQty().intValue()) |
| | | // 上报时,默认损坏数量是0 |
| | | .setDamage_qty(0) |
| | | // 上报时,默认差异数量是0 |
| | | .setDiff_qty(0); |
| | | |
| | | reportOrderParams.add(itemParam); |
| | | }); |
| | | |
| | | orderParam.setDetails(reportOrderParams); |
| | | |
| | | XSR response = null; |
| | | boolean success = false; |
| | | try { |
| | | // response = new HttpHandler.Builder() |
| | |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PAKOUT_URL, JSON.toJSONString(pakoutParam), response); |
| | | throw new CoolException("上报mes系统失败"); |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", |
| | | MesConstant.URL + MesConstant.OUT_DISPATCH_RESULT, |
| | | JSON.toJSONString(orderParam), JSON.toJSONString(response)); |
| | | throw new CoolException("上报KOPEN系统失败"); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("fail", e); |
| | | // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg(e.getMessage()); |
| | | } finally { |
| | | try { |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "成品库出库上报", |
| | | MesConstant.URL + MesConstant.PAKOUT_URL, |
| | | "备货派工单完成上报", |
| | | MesConstant.URL + MesConstant.OUT_DISPATCH_RESULT, |
| | | null, |
| | | "127.0.0.1", |
| | | JSON.toJSONString(pakoutParam), |
| | | response, |
| | | success |
| | | ); |
| | | } catch (Exception e) { log.error("", e); } |
| | | JSON.toJSONString(orderParam), |
| | | JSON.toJSONString(response), |
| | | success); |
| | | } catch (Exception e) { |
| | | log.error("", e); |
| | | } |
| | | } |
| | | } else if (Integer.valueOf(docType.getDocId() + "").equals(OrderTypeEnum.STOCK.type)) { |
| | | // 备货单反馈 |
| | | StockUpOrderParams stockUpOrderParams = new StockUpOrderParams(); |
| | | stockUpOrderParams.setCompany_id(order.getCstmrName()) |
| | | .setWms_id(order.getId() + "") |
| | | .setDispatch_no(order.getNumber()); |
| | | |
| | | OutOrderParams pubOrderParams = new OutOrderParams(); |
| | | pubOrderParams.setPick_no(order.getOrderNo()) |
| | | .setOrder_no(order.getShipCode()) |
| | | .setCus_id(order.getCstmrName()) |
| | | .setCus_address(order.getTel()); |
| | | |
| | | List<OrderItemsParam> reportOrderParams = new ArrayList<>(); |
| | | orderDetls.forEach(detl -> { |
| | | Mat material = matService.selectByMatnr(detl.getMatnr()); |
| | | if (Objects.isNull(material)) { |
| | | throw new CoolException("物料不存在"); |
| | | } |
| | | OrderItemsParam itemParam = new OrderItemsParam(); |
| | | // 上报时,默认产品类型是null |
| | | itemParam.setPro_type(material.getProType()); |
| | | // 上报时,默认产品编码 |
| | | itemParam.setPro_komcode(material.getMatnr()); |
| | | // 上报时,默认产品id是供应商编码 |
| | | itemParam.setPro_id(detl.getSuppCode()); |
| | | |
| | | // 上报时,默认上报时间是更新时间 |
| | | itemParam.setPick_qty(detl.getQty().intValue()); |
| | | reportOrderParams.add(itemParam); |
| | | }); |
| | | pubOrderParams.setPartList(reportOrderParams); |
| | | |
| | | List<OutOrderParams> pubOrderParamsList = new ArrayList<>(); |
| | | pubOrderParamsList.add(pubOrderParams); |
| | | // 设置派工单明细 |
| | | stockUpOrderParams.setDetails(pubOrderParamsList); |
| | | stockUpOrderParams.setUpdate_time(order.getUpdateBy$()); |
| | | |
| | | XSR response = null; |
| | | boolean success = false; |
| | | try { |
| | | // response = new HttpHandler.Builder() |
| | | // .setUri(MesConstant.URL) |
| | | // .setPath(MesConstant.PAKOUT_URL) |
| | | // .setJson(JSON.toJSONString(pakoutParam)) |
| | | // .build() |
| | | // .doPost(); |
| | | // JSONObject jsonObject = JSON.parseObject(response); |
| | | // if (jsonObject.getInteger("code").equals(200)) { |
| | | if (true) { |
| | | success = true; |
| | | // 修改订单状态 4.完成 ===>> 6.已上报 |
| | | if (!orderService.updateSettle(order.getId(), settle, null)) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", |
| | | MesConstant.URL + MesConstant.OUT_DETAILS_RESULT, |
| | | JSON.toJSONString(stockUpOrderParams), JSON.toJSONString(response)); |
| | | throw new CoolException("上报KOPEN系统失败"); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("fail", e); |
| | | return FAIL.setMsg(e.getMessage()); |
| | | } finally { |
| | | try { |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "备货单完成上报", |
| | | MesConstant.URL + MesConstant.OUT_DETAILS_RESULT, |
| | | null, |
| | | "127.0.0.1", |
| | | JSON.toJSONString(stockUpOrderParams), |
| | | JSON.toJSONString(response), |
| | | success); |
| | | } catch (Exception e) { |
| | | log.error("", e); |
| | | } |
| | | } |
| | | |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 损溢单完结上报 |
| | | * |
| | | * @param order |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ReturnT<String> startCheckOrderReport(CheckOrder order) { |
| | | List<StockAdjustParams> adjustParams = new ArrayList<>(); |
| | | |
| | | StockAdjustParams adjustParam = new StockAdjustParams(); |
| | | |
| | | adjustParam.setCompany_id(order.getCstmrName()) |
| | | .setWms_id(order.getId() + "") |
| | | .setType(0 + "") |
| | | .setCompany_id(order.getCstmrName()); |
| | | |
| | | adjustParam.setBsby_no(order.getNumber()) |
| | | .setResason("") |
| | | .setReason_name(""); |
| | | List<CheckOrderDetl> detls = checkOrderDetlService |
| | | .selectList(new EntityWrapper<CheckOrderDetl>().eq("order_id", order.getId())); |
| | | if (Objects.isNull(detls) || detls.isEmpty()) { |
| | | throw new CoolException("损溢单详情不存在"); |
| | | } |
| | | List<OrderItemsParam> items = new ArrayList<>(); |
| | | detls.forEach(detl -> { |
| | | Mat material = matService.selectByMatnr(detl.getMatnr()); |
| | | if (Objects.isNull(material)) { |
| | | throw new CoolException("物料不存在"); |
| | | } |
| | | OrderItemsParam itemParam = new OrderItemsParam(); |
| | | itemParam.setLocation_no(detl.getZpallet()) |
| | | .setPro_komcode(material.getMatnr()) |
| | | .setPro_id(detl.getSuppCode()) |
| | | .setBsby_qty(detl.getDiffQty().intValue()); |
| | | items.add(itemParam); |
| | | }); |
| | | adjustParam.setDetails(items); |
| | | |
| | | adjustParams.add(adjustParam); |
| | | |
| | | return SUCCESS; |
| | | // TODO Auto-generated method stub |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.enums.TaskStatusType; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | |
| | | return SUCCESS; |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ReturnT<String> AgvStart(Task task) { |
| | | try { |
| | | List<TaskDetl> taskDetls = taskDetlService.selectList(new EntityWrapper<TaskDetl>().eq("wrk_no", task.getWrkNo())); |
| | |
| | | } |
| | | |
| | | // 入库 -------------------------------------------------------------------------------- |
| | | if (task.getWrkSts() == 5) { |
| | | if (task.getWrkSts().equals(TaskStatusType.AGV_INVENTORY_UPDATED_IN.type)) { |
| | | // 全板入库 |
| | | if (task.getIoType() == 1) { |
| | | // 入库通知单 |
| | |
| | | } |
| | | |
| | | // 出库 -------------------------------------------------------------------------------- |
| | | } else if (task.getWrkSts() == 15) { |
| | | } else if (task.getWrkSts().equals(TaskStatusType.AGV_INVENTORY_UPDATED_OUT.type)) { |
| | | // if (!Cools.isEmpty(wrkDetls)) { |
| | | // if (!orderService.saveHandlerOrder(Boolean.FALSE, wrkMast, wrkDetls)) { |
| | | // exceptionHandle("生成手动出库单据[workNo={0}]失败", wrkMast.getWrkNo()); |
| | |
| | | import com.zy.asrs.enums.LocAreaType; |
| | | import com.zy.asrs.enums.LocStsType; |
| | | import com.zy.asrs.enums.TaskIOType; |
| | | import com.zy.asrs.enums.TaskStatusType; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.service.impl.*; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | |
| | | if (wrkMast.getIoType() == TaskIOType.MERGE_IN.type) { |
| | | agvSta = wrkMast.getPauseMk(); |
| | | } |
| | | |
| | | // . 删除缓存站点明细 |
| | | if (!Objects.isNull(agvSta)) { |
| | | // 修改目标站点信息 |
| | |
| | | throw new CoolException("站点状态更新失败!!"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | break; |
| | | // 盘点入库 |
| | | case 57: |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ReturnT<String> AgvStart(Task task) { |
| | | // 4.入库完成 |
| | | if (task.getWrkSts() == 4) { |
| | | if (task.getWrkSts().equals(TaskStatusType.AGV_TASK_FINISHED_IN.type)) { |
| | | return agvDoIn(task); |
| | | // 14.出库完成 |
| | | } else if (task.getWrkSts() == 14) { |
| | | } else if (task.getWrkSts().equals(TaskStatusType.AGV_TASK_FINISHED_OUT.type)) { |
| | | return agvDoOut(task); |
| | | } |
| | | return SUCCESS; |
| | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/9/25 |
| | | * @description: AGV出库任务 |
| | | * @description: AGV出库任 |
| | | * @version 1.0 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | throw new CoolException("当前库位状态" + locMast.getLocSts() + ", 无法执行出库操作!!"); |
| | | } |
| | | |
| | | |
| | | |
| | | task.setWrkSts(15L); |
| | | task.setWrkSts(TaskStatusType.AGV_INVENTORY_UPDATED_OUT.type); |
| | | if (!taskService.updateById(task)) { |
| | | throw new CoolException("任务状态修改失败!!"); |
| | | } |
| | |
| | | if (!basStationService.updateById(devNo)) { |
| | | throw new CoolException("站点信息修改失败!!"); |
| | | } |
| | | task.setWrkSts(15L); |
| | | task.setWrkSts(TaskStatusType.AGV_INVENTORY_UPDATED_OUT.type); |
| | | if (!taskService.updateById(task)) { |
| | | throw new CoolException("任务状态修改失败!!"); |
| | | } |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ReturnT<String> agvDoIn(Task wrkMast) { |
| | | LocCache locCache = locCacheService.selectOne(new EntityWrapper<LocCache>().eq("loc_no", wrkMast.getLocNo())); |
| | | |
| | | if (!Objects.isNull(wrkMast.getSourceStaNo())) { |
| | | BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>() |
| | | .eq("dev_no", wrkMast.getSourceStaNo())); |
| | |
| | | if (!list.contains(station.getLocSts())) { |
| | | station.setLocSts(LocStsType.LOC_STS_TYPE_O.type); |
| | | } |
| | | station.setBarcode(null); |
| | | station.setBarcode(""); |
| | | basStationService.updateById(station); |
| | | } |
| | | } |
| | |
| | | if (!locCacheService.updateById(locCache)) { |
| | | throw new CoolException("库位状态修改失败!"); |
| | | } |
| | | wrkMast.setWrkSts(5L); |
| | | wrkMast.setWrkSts(TaskStatusType.AGV_INVENTORY_UPDATED_IN.type); |
| | | wrkMast.setModiTime(new Date()); |
| | | if (!taskService.updateById(wrkMast)) { |
| | | throw new CoolException("任务状态修改失败!!"); |
| | |
| | | } |
| | | |
| | | // 修改工作主档状态 |
| | | wrkMast.setWrkSts(5L); |
| | | wrkMast.setWrkSts(TaskStatusType.AGV_INVENTORY_UPDATED_IN.type); |
| | | wrkMast.setModiTime(now); |
| | | if (!taskService.updateById(wrkMast)) { |
| | | // exceptionHandle("更新入库完成状态失败;[workNo={0}]", wrkMast.getWrkNo()); |
| | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 日期转换为字符串 |
| | | * @param date 日期 |
| | | * @param format 格式 |
| | | * @return 字符串 |
| | | */ |
| | | public static String dateToStr(Date date, String format) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat(format); |
| | | return sdf.format(date); |
| | | } |
| | | |
| | | } |
| | |
| | | generator.url="192.168.4.15:1433;databasename=jsxsasrs"; |
| | | generator.username="sa"; |
| | | generator.password="sa@123"; |
| | | generator.table="agv_bas_station_detl"; |
| | | generator.table="man_order_pakin_rela"; |
| | | generator.packagePath="com.zy.asrs"; |
| | | generator.html = false; |
| | | generator.js = false; |
| | |
| | | */ |
| | | public class MesConstant { |
| | | |
| | | public static final String URL = "http://192.168.99.130:80"; |
| | | //小系统接口地址 |
| | | public static final String URL = "http://webservice.kopen.com.cn:1482/kc-api/api/wms/ "; |
| | | |
| | | public static final String PACK_DOWN_URL = "mes/api/zy/v1/packDown/sendList"; |
| | | |
| | | public static final String PAKIN_URL = "mes/api/zy/v1/warehouse/sendList"; |
| | | |
| | | public static final String PAKOUT_URL = "wmsFinprd/api/zy/v1/packOut/sendList"; |
| | | //上架派工单反馈 |
| | | public static final String IN_DISPATCH_RESULT = "getInDispatchResult"; |
| | | //备货指示派工单反馈 |
| | | public static final String OUT_DISPATCH_RESULT = "getOutDispatchResult"; |
| | | //备货订单反馈 |
| | | public static final String OUT_DETAILS_RESULT = "getOutDetailsResult"; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | } |
| | | |
| | | // public DetlDto(String orderNo, String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3, Double anfme) { |
| | | // this.orderNo = orderNo; |
| | | // this.matnr = matnr; |
| | | // this.batch = batch; |
| | | // this.brand = brand; |
| | | // this.standby1 = standby1; |
| | | // this.standby2 = standby2; |
| | | // this.standby3 = standby3; |
| | | // this.boxType1 = boxType1; |
| | | // this.boxType2 = boxType2; |
| | | // this.boxType3 = boxType3; |
| | | // this.anfme = anfme; |
| | | // } |
| | | public DetlDto(String orderNo, String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3, Double anfme, String threeCode) { |
| | | this.orderNo = orderNo; |
| | | this.matnr = matnr; |
| | | this.batch = batch; |
| | | this.brand = brand; |
| | | this.standby1 = standby1; |
| | | this.standby2 = standby2; |
| | | this.standby3 = standby3; |
| | | this.boxType1 = boxType1; |
| | | this.boxType2 = boxType2; |
| | | this.boxType3 = boxType3; |
| | | this.anfme = anfme; |
| | | this.threeCode = threeCode; |
| | | } |
| | | |
| | | public DetlDto(String orderNo, String matnr, String batch, String brand, String standby1, String standby2, String standby3, Long lineNumber, String boxType1, String boxType2, String boxType3, Double anfme, String threeCode) { |
| | | this.orderNo = orderNo; |
| | |
| | | return false; |
| | | } |
| | | |
| | | public static boolean hasOrder(List<DetlDto> detlDtos, DetlDto detlDto) { |
| | | for (DetlDto dto : detlDtos) { |
| | | if (dto.getOrderNo().equals(detlDto.getOrderNo()) && dto.getMatnr().equals(detlDto.getMatnr()) && Cools.eq(dto.getBatch(), detlDto.getBatch()) |
| | | && Cools.eq(dto.getBrand(), detlDto.getBrand()) && Cools.eq(dto.getStandby1(), detlDto.getStandby1()) |
| | | && Cools.eq(dto.getStandby2(), detlDto.getStandby2()) && Cools.eq(dto.getStandby3(), detlDto.getStandby3()) |
| | | && Cools.eq(dto.getBoxType1(), detlDto.getBoxType1()) && Cools.eq(dto.getBoxType2(), detlDto.getBoxType2()) |
| | | && Cools.eq(dto.getBoxType3(), detlDto.getBoxType3()) ) { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | public static boolean hasLineNumber(List<DetlDto> detlDtos, DetlDto detlDto) { |
| | | for (DetlDto dto : detlDtos) { |
| | | if (dto.getMatnr().equals(detlDto.getMatnr()) && Cools.eq(dto.getBatch(), detlDto.getBatch()) |
| | |
| | | <if test="matnr!=null and matnr!='' "> |
| | | and mod.matnr like '%' + #{matnr} + '%' |
| | | </if> |
| | | <if test="doc_type!=null and doc_type!='' "> |
| | | and mo.doc_type like '%' + #{doc_type} + '%' |
| | | </if> |
| | | <if test="maktx!=null and maktx!='' "> |
| | | and mod.maktx like '%' + #{maktx} + '%' |
| | | </if> |
| | |
| | | and move_status = 1 |
| | | order by update_time |
| | | </select> |
| | | <select id="selectCompleteCheck" resultType="com.zy.asrs.entity.Order"> |
| | | SELECT TOP |
| | | 20 * |
| | | FROM |
| | | man_check_order |
| | | WHERE |
| | | settle = 4 |
| | | AND status = 1 |
| | | AND doc_type = 4 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | where 1=1 |
| | | and settle = 4 |
| | | and status = 1 |
| | | and doc_type != 7 |
| | | order by create_time asc |
| | | </select> |
| | | |
| | |
| | | |
| | | </resultMap> |
| | | <select id="selectToBeCompleteData" resultType="com.zy.asrs.entity.Task"> |
| | | select * from agv_task where ((wrk_sts = 4 Or wrk_sts = 14 ) and io_type != 103 and io_type != 104 and io_type != 107 ) or (wrk_sts = 2 and io_type=6) order by upd_mk,error_time,io_time,wrk_no |
| | | select * from agv_task where ((wrk_sts = 204 Or wrk_sts = 304 ) and io_type != 103 and io_type != 104 and io_type != 107 ) or (wrk_sts = 2 and io_type=6) order by upd_mk,error_time,io_time,wrk_no |
| | | </select> |
| | | |
| | | |
| | | <select id="selectToBeHistoryData" resultType="com.zy.asrs.entity.Task"> |
| | | select * from agv_task |
| | | where wrk_sts=5 or wrk_sts=15 |
| | | where wrk_sts=205 or wrk_sts=305 |
| | | order by io_time,wrk_no asc |
| | | </select> |
| | | |
| | |
| | | |
| | | <!-- mapper不支持sql语句嵌套时,采用sql片段包含方式,解决xml标签问题 --> |
| | | <sql id="viewWorkInConditionSql"> |
| | | <if test="loc_no!=null and loc_no!='' "> |
| | | and loc_no like '%' + #{loc_no} + '%' |
| | | <if test="locNo!=null and locNo!='' "> |
| | | and loc_no like '%' + #{locNo} + '%' |
| | | </if> |
| | | <if test="matnr!=null and matnr!='' "> |
| | | and matnr like '%' + #{matnr} + '%' |
| | |
| | | cols: [[ |
| | | {type: 'numbers'}, |
| | | {field: 'orderNo', title: '单据编号'}, |
| | | {field: 'docType$', align: 'center', title: '类型', minWidth: 160, width: 160}, |
| | | { field: 'docType$', align: 'center', title: '类型', minWidth: 120, width: 120 }, |
| | | { field: 'defNumber', align: 'center', title: '流水号', minWidth: 160, width: 160 }, |
| | | { field: 'cstmrName', align: 'center', title: '公司', minWidth: 160, width: 160 }, |
| | | { field: 'orderTime', title: '订单时间', minWidth: 200, width: 200 }, |
| | | { field: 'shipName', align: 'center', title: '调整原因' }, |
| | | { field: 'memo', align: 'center', title: '原因描述' }, |
| | | { field: 'settle$', align: 'center', title: '状态', templet: '#settleTpl', minWidth: 120, width: 120 }, |
| | | {align: 'center', title: '明细', toolbar: '#tbLook', minWidth: 160, width: 160}, |
| | | {field: 'createTime$', title: '创建时间', minWidth: 200, width: 200}, |
| | | {field: 'settle$', align: 'center', title: '状态', templet: '#settleTpl', minWidth: 160, width: 160}, |
| | | {field: 'memo', align: 'center',title: '备注', hide: true}, |
| | | {align: 'center', title: '操作', toolbar: '#operate',} |
| | | ]], |
| | | request: { |
| | |
| | | {field: 'zpallet', title: '容器码', width: 120}, |
| | | {field: 'matnr', title: '商品编码', width: 160}, |
| | | {field: 'maktx', title: '商品名称', width: 160}, |
| | | {field: 'batch', title: '批号'}, |
| | | {field: 'diffQty', title: '差异数量', style: 'font-weight: bold'}, |
| | | { field: 'suppCode', title: '供应商编码' }, |
| | | { field: 'length', align: 'center', title: '重量', hide: false } |
| | | ,{ field: 'volume', align: 'center', title: '尺寸', hide: false } |
| | | ,{ field: 'diffQty', title: '差异数量', style: 'font-weight: bold' }, |
| | | {field: 'specs', title: '规格'}, |
| | | {field: 'status$', title: '状态'} |
| | | ]], |
| | |
| | | {field: 'matnr', align: 'center',title: '商品编号', sort:true} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称', sort:true} |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号', hide: false} |
| | | ,{field: 'standby1', align: 'center',title: '供应商编码', hide: false} |
| | | ,{field: 'suppCode', align: 'center',title: '供应商编码', hide: false} |
| | | ,{field: 'threeCode', align: 'center',title: 'BS Code', hide: false} |
| | | ,{field: 'tag$', align: 'center',title: '零件类型', hide: false} |
| | | ,{field: 'batch', align: 'center',title: '批号', hide: true} |
| | |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码', hide: false} |
| | | ,{field: 'length', align: 'center',title: '重量', hide: false} |
| | | ,{field: 'volume', align: 'center',title: '尺寸', hide: false} |
| | | ,{field: 'modiTime$', align: 'center',title: '更新时间', hide: false} |
| | | ,{field: 'modiTime', align: 'center',title: '更新时间', hide: false} |
| | | ,{field: 'supp', align: 'center',title: '供应商', hide: true} |
| | | ,{field: 'specs', align: 'center',title: '规格', hide: true} |
| | | ,{field: 'model', align: 'center',title: '代码', hide: true} |
| | |
| | | cols: [[{type: 'checkbox'}, {field: 'locNo', align: 'center', title: '库位号', width: 120} |
| | | , {field: 'barcode', align: 'center', title: '托盘码'} |
| | | , {field: 'areaName', align: 'center', title: '库区名称'} |
| | | // , {field: 'whsType$', align: 'center', title: '库位类型'} |
| | | , {field: 'locSts', align: 'center', title: '库位状态'} |
| | | , {field: 'locSts$', align: 'center', title: '库位状态'} |
| | | , {field: 'row1', align: 'center', title: '排'} |
| | | , {field: 'bay1', align: 'center', title: '列'} |
| | | , {field: 'lev1', align: 'center', title: '层'} |
| | | // , {field: 'locType', align: 'center', title: '库位类型'} |
| | | , {field: 'sort', align: 'center', title: '优先级'} |
| | | , {field: 'sort', align: 'center', title: '优先级', sort: true} |
| | | , {field: 'modiUser$', align: 'center', title: '修改人员'} |
| | | , {field: 'modiTime$', align: 'center', title: '修改时间'} |
| | | , {field: 'appeUser$', align: 'center', title: '创建者'} |
| | |
| | | , {field: 'frozenMemo', align: 'center', title: '冻结备注', hide: true} |
| | | , {fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 160}] |
| | | ], |
| | | |
| | | |
| | | request: { |
| | | pageName: 'curr', pageSize: 'limit' |
| | | }, |
| | |
| | | }) |
| | | }); |
| | | |
| | | // 修改优先级 |
| | | form.on('submit(updateProi)', function (data) { |
| | | var checkStatus = table.checkStatus('locCache').data; |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择需要修改的数据信息', {icon: 2}); |
| | | return false; |
| | | } |
| | | var sortVal = data.field.identifying; |
| | | var loadIndex = layer.load(2); |
| | | var promises = checkStatus.map(function (item) { |
| | | return new Promise(function (resolve, reject) { |
| | | $.ajax({ |
| | | url: baseUrl + "/locCache/update/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | id: item.id, |
| | | locNo: item.locNo, |
| | | sort: sortVal |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) resolve(res); |
| | | else reject(res); |
| | | }, |
| | | error: function (err) { |
| | | reject(err); |
| | | } |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | Promise.all(promises).then(function () { |
| | | layer.close(loadIndex); |
| | | layer.closeAll(); |
| | | layer.msg("修改成功"); |
| | | tableReload(false); |
| | | }).catch(function (err) { |
| | | layer.close(loadIndex); |
| | | layer.msg("修改失败: " + (err.msg || "未知错误")); |
| | | }); |
| | | return false; |
| | | }); |
| | | |
| | | function batchModifies() { |
| | | layer.open({ |
| | | type: 1, |
| | |
| | | var pageCurr; |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: 'ioTime$', align: 'center', title: '入库日期', width: 200} |
| | | ,{field: 'loc_no', align: 'center',title: '库位号'} |
| | | {field: 'ioTime', align: 'center', title: '入库日期', width: 200} |
| | | ,{field: 'locNo', align: 'center',title: '库位号'} |
| | | ]; |
| | | cols.push.apply(cols, detlCols); |
| | | return cols; |
| | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select name="area_name"> |
| | | <option value="">库区名称</option> |
| | | <option value="入库区">入库区</option> |
| | | <option value="集货区">集货区</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" |
| | | autocomplete="off"> |
| | | </div> |
| | |
| | | <div class="layui-form layui-form-pane"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>库区名称:</label> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="identifying" name="identifying" class="layui-input" type="text" style="display: none"> |
| | | <input id="identifying$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" |
| | | type="text" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="basAreasQueryBywhsType" |
| | | onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="basAreasQueryBywhsTypeSelect" |
| | | onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 库位类型 --> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">高低类型</label> |
| | | <label class="layui-form-label"><span class="not-null">*</span>优先级:</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> |
| | | <input id="identifying" name="identifying" class="layui-input" type="text"> |
| | | </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-normal" id="initDo" lay-submit lay-filter="initDo"> |
| | | <button class="layui-btn layui-btn-normal" id="updateProi" lay-submit lay-filter="updateProi"> |
| | | 确定 |
| | | </button> |
| | | </div> |
| | |
| | | <div id="search-box" class="layui-form layui-card-header"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="loc_no" placeholder="库位号" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="locNo" placeholder="库位号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |