| | |
| | | <groupId>com.zy</groupId> |
| | | <artifactId>asrs</artifactId> |
| | | <version>1.1.1</version> |
| | | <packaging>war</packaging> |
| | | <packaging>jar</packaging> |
| | | |
| | | <properties> |
| | | <java.version>1.8</java.version> |
| | |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | </plugin> |
| | | </plugins> |
| | | <resources> |
| | | <!-- 1. 首先,让Maven处理原有的resources目录 --> |
| | | <resource> |
| | | <directory>${basedir}/src/main/resources</directory> |
| | | </resource> |
| | | <!-- 2. 其次,将webapp目录下的文件,复制到META-INF/resources目录下 --> |
| | | <resource> |
| | | <directory>${basedir}/src/main/webapp</directory> |
| | | <targetPath>META-INF/resources</targetPath> |
| | | <includes> |
| | | <include>**/*</include> |
| | | </includes> |
| | | </resource> |
| | | </resources> |
| | | </build> |
| | | |
| | | </project> |
| New file |
| | |
| | | package com.zy.api.controller; |
| | | |
| | | import com.core.common.R; |
| | | import com.zy.api.controller.params.AgvCallBackParam; |
| | | import com.zy.api.entity.CallAgvParams; |
| | | import com.zy.api.entity.dto.HKR; |
| | | import com.zy.api.service.AgvScheduleService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | @RestController |
| | | @RequestMapping("/hlk") |
| | | public class AgvScheduleController { |
| | | |
| | | @Autowired |
| | | private AgvScheduleService agvScheduleService; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/11/3 |
| | | * @description: 呼叫AGV搬运缓存区/EO/SO |
| | | * @version 1.0 |
| | | */ |
| | | @ApiOperation("呼叫AGV搬运") |
| | | @PostMapping("/call/carry") |
| | | public R callAgvCarry(@RequestBody CallAgvParams params) { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return agvScheduleService.callAgvCarry(params); |
| | | } |
| | | |
| | | /** |
| | | * AGV任务完成 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @ApiOperation("agv搬运结果回传") |
| | | @PostMapping("/agv/result/callback") |
| | | public HKR agvCarryCallBack(@RequestBody AgvCallBackParam params) { |
| | | if (Objects.isNull(params)) { |
| | | return HKR.error("参数不能为空!!"); |
| | | } |
| | | return agvScheduleService.callback(params); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.api.controller; |
| | | |
| | | |
| | | 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; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/kopen") |
| | | public class KopenApiController extends BaseController{ |
| | | |
| | | @Autowired |
| | | private KopenApiService kopenApiService; |
| | | |
| | | /** |
| | | * 上游下发派工单 |
| | | * |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:18 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | @ApiOperation("上架派工单") |
| | | @PostMapping("/sendInDispatch") |
| | | public XSR receiveOrders(@RequestBody List<PubOrderParams> params) { |
| | | if (Objects.isNull(params)) { |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | // if (Objects.isNull(params.getType())) { |
| | | // return XSR.error("单据类型不能为空!"); |
| | | // } |
| | | return kopenApiService.receiveOrders(params, "add"); |
| | | } |
| | | |
| | | /** |
| | | * 上架派工单变更 |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:22 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | @ApiOperation("上架派工单变更") |
| | | @PostMapping("/sendInDispatchCancel") |
| | | public XSR dispatchUpdate(@RequestBody List<PubOrderParams> params) { |
| | | if (Objects.isNull(params)) { |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | // if (Objects.isNull(params.getType())) { |
| | | // return XSR.error("单据类型不能为空!"); |
| | | // } |
| | | return kopenApiService.receiveOrders(params, "update"); |
| | | } |
| | | |
| | | /** |
| | | * 上游下发零件数据变更 |
| | | * |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:19 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | @ApiOperation("零件信息数据更新") |
| | | @PostMapping("/sendPartsMaster") |
| | | public XSR basMatUpdate(@RequestBody List<SyncMatParmas> params) { |
| | | if (Objects.isNull(params) || params.isEmpty()) { |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | return kopenApiService.basMatupdate(params); |
| | | } |
| | | |
| | | /** |
| | | * 上架派工单反馈 |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:20 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | @ApiOperation("上架派工单反馈") |
| | | @PostMapping("/getInDispatchResult") |
| | | 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("取消条件不能为空!!"); |
| | | // } |
| | | return kopenApiService.getInDispatchResult(params, null); |
| | | } |
| | | |
| | | /** |
| | | * 备货指示派工单下发 |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:21 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | @ApiOperation("备货指示派工单下发") |
| | | @PostMapping("/sendOutDispatch") |
| | | 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("上报订单列表不能为空!!"); |
| | | // } |
| | | return kopenApiService.sendOutDispatch(params, "add"); |
| | | } |
| | | |
| | | /** |
| | | * 备货指示派工单变更 |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:22 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | @ApiOperation("备货指示派工单变更") |
| | | @PostMapping("/sendOutDispacthCancel") |
| | | public XSR sendOutDispatchCancel(@RequestBody List<PubOrderParams> params) { |
| | | if (Objects.isNull(params)) { |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | // if (Objects.isNull(params.getDetails()) || params.getDetails().isEmpty()) { |
| | | // return XSR.error("上报订单列表不能为空!!"); |
| | | // } |
| | | return kopenApiService.sendOutDispatch(params, "update"); |
| | | } |
| | | |
| | | |
| | | // /** |
| | | // * 备货指示派工单反馈 |
| | | // * @author Ryan |
| | | // * @date 2025/11/24 15:22 |
| | | // * @param params |
| | | // * @return com.core.common.R |
| | | // */ |
| | | // @ApiOperation("备货指示派工单反馈") |
| | | // @PostMapping("/getOutDispatchResult") |
| | | // public R getOutDispatchResult(@RequestBody ReportOrderParam params) { |
| | | // if (Objects.isNull(params)) { |
| | | // return R.error("参数不能为空!!"); |
| | | // } |
| | | // if (Objects.isNull(params.getKopen_id()) && Objects.isNull(params.getInv_no()) && Objects.isNull(params.getDispatch_no())) { |
| | | // return R.error("取消条件不能为空!!"); |
| | | // } |
| | | // return kopenApiService.getOutDispatchResult(params); |
| | | // } |
| | | |
| | | |
| | | /** |
| | | * 备货单下发 |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:21 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | @ApiOperation("备货单下发") |
| | | @PostMapping("/getOutDetails") |
| | | public XSR getOutDetails(@RequestBody List<StockUpOrderParams> params) { |
| | | if (Objects.isNull(params)) { |
| | | 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("/getPartsStock") |
| | | public XSR getStockInfo(@RequestBody List<PageRequestParams> params) { |
| | | return kopenApiService.getStockInfo(params); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.api.controller; |
| | | |
| | | |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.R; |
| | | import com.zy.api.controller.params.ReceviceTaskParams; |
| | | import com.zy.api.controller.params.WorkTaskParams; |
| | | import com.zy.api.service.WcsApiService; |
| | | import com.zy.asrs.entity.param.CompleteParam; |
| | | import com.zy.asrs.service.MobileService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | @Api("WCS交互接口") |
| | | @RequestMapping("/wcs") |
| | | @RestController |
| | | public class WcsApiController { |
| | | |
| | | @Autowired |
| | | private WcsApiService wcsApiService; |
| | | @Autowired |
| | | private MobileService mobileService; |
| | | |
| | | |
| | | /** |
| | | * 獲取庫位信息 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @ManagerAuth |
| | | @ApiOperation("同步库位信息") |
| | | @PostMapping("/sync/locs") |
| | | public R getAllLocs(@RequestBody Map<String, String> params) { |
| | | return wcsApiService.getLocs(params); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取站点信息 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @ManagerAuth |
| | | @ApiOperation("获取站点信息") |
| | | @PostMapping("sync/stations") |
| | | public R getAllStation(@RequestBody Map<String, String> params) { |
| | | return wcsApiService.getStations(params); |
| | | } |
| | | |
| | | /** |
| | | * 下发任务至WCS |
| | | * @author Ryan |
| | | * @date 2026/1/10 13:57 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | @ManagerAuth |
| | | @ApiOperation("下发任务至WCS") |
| | | @PostMapping("/pub/wrks") |
| | | public R pubWrkToWcs(@RequestBody WorkTaskParams params) { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return wcsApiService.pubWrkToWcs(params); |
| | | } |
| | | |
| | | |
| | | @ManagerAuth(memo = "入库申请(模拟物理按钮)") |
| | | @RequestMapping("/openapi/comb/pub") |
| | | public R cacheCombPub(@RequestBody CompleteParam combParam) { |
| | | if (Objects.isNull(combParam)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return wcsApiService.combInPub(combParam, 10031L); |
| | | } |
| | | |
| | | /** |
| | | * WCS申请在库库位更换库位 |
| | | * @param combParam |
| | | * @return |
| | | */ |
| | | @ManagerAuth(memo = "WCS申请在库库位更换库位") |
| | | @RequestMapping("/openapi/change/loc") |
| | | public R changeLoc(@RequestBody CompleteParam combParam) { |
| | | if (Objects.isNull(combParam)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return mobileService.changeLoc(combParam, 10031L); |
| | | } |
| | | |
| | | |
| | | @ManagerAuth |
| | | @ApiOperation("设备执行状态回写") |
| | | @PostMapping("/openapi/report") |
| | | public R receviceTaskFromWcs(@RequestBody ReceviceTaskParams params) { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return wcsApiService.receviceTaskFromWcs(params); |
| | | } |
| | | |
| | | /** |
| | | * 重新分配入库信息 |
| | | */ |
| | | @ManagerAuth |
| | | @ApiOperation("WCS申请任务重新分配入库") |
| | | @PostMapping("/openapi/reassign/loc") |
| | | public R repeatLocs(@RequestBody CompleteParam params) { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return wcsApiService.repeatLoc(params); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.api.controller.params; |
| | | |
| | | import com.alibaba.excel.annotation.format.DateTimeFormat; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | public class AgvCallBackItemParam implements Serializable { |
| | | |
| | | |
| | | private CallBackItem values; |
| | | |
| | | // { |
| | | // "robotTaskCode": "5685", |
| | | // "singleRobotCode": "8857", |
| | | // "currentSeq": -1, |
| | | // "extra": { |
| | | // "async": "0", |
| | | // "values": { |
| | | // "mapCode": "DD", |
| | | // "slotCategory": "SITE", |
| | | // "slotCode": "286260DD305240", |
| | | // "slotName": "JH06", |
| | | // "x": 286260.0, |
| | | // "y": 305240.0, |
| | | // "method": "start", |
| | | // "carrierCategory": "POD", |
| | | // "carrierType": "TC", |
| | | // "carrierCode": "TC10104", |
| | | // "pileCount": 1, |
| | | // "taskTime": "2026-02-12 15:59:45.704", |
| | | // "amrCategory": "LMR", |
| | | // "amrType": "17", |
| | | // "amrCode": "8857", |
| | | // "carrierName": "TC10104", |
| | | // "layerNo": 1 |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.api.controller.params; |
| | | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | public class AgvCallBackParam implements Serializable { |
| | | |
| | | private String robotTaskCode; |
| | | |
| | | private AgvCallBackItemParam extra; |
| | | } |
| New file |
| | |
| | | package com.zy.api.controller.params; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "AgvCarriesParam", description = "AGV搬运参数") |
| | | public class AgvCarriesParam implements Serializable { |
| | | |
| | | private Integer autoStart = 1; |
| | | |
| | | private String code; |
| | | |
| | | private Integer seq; |
| | | |
| | | private String type = "SITE"; |
| | | } |
| New file |
| | |
| | | package com.zy.api.controller.params; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "AgvRequestParam", description = "Agv请求参数") |
| | | public class AgvRequestParam implements Serializable { |
| | | |
| | | //任务类型 |
| | | private String taskType; |
| | | |
| | | //任务执行清单 |
| | | private List<AgvCarriesParam> targetRoute; |
| | | |
| | | //任务号 |
| | | private String robotTaskCode; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.api.controller.params; |
| | | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | public class CallBackItem implements Serializable { |
| | | |
| | | private String slotName; |
| | | |
| | | private String method; |
| | | |
| | | private String carrierCode; |
| | | |
| | | private String taskTime; |
| | | |
| | | private String carrierName; |
| | | |
| | | // "values": { |
| | | // "mapCode": "DD", |
| | | // "slotCategory": "SITE", |
| | | // "slotCode": "286260DD305240", |
| | | // "slotName": "JH06", |
| | | // "x": 286260.0, |
| | | // "y": 305240.0, |
| | | // "method": "start", |
| | | // "carrierCategory": "POD", |
| | | // "carrierType": "TC", |
| | | // "carrierCode": "TC10104", |
| | | // "pileCount": 1, |
| | | // "taskTime": "2026-02-12 15:59:45.704", |
| | | // "amrCategory": "LMR", |
| | | // "amrType": "17", |
| | | // "amrCode": "8857", |
| | | // "carrierName": "TC10104", |
| | | // "layerNo": 1 |
| | | // } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.api.controller.params; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel("分页请求参数") |
| | | public class PageRequestParams { |
| | | |
| | | private String pro_komcode; |
| | | |
| | | private String pro_id; |
| | | } |
| | | |
| New file |
| | |
| | | package com.zy.api.controller.params; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "ReceviceTaskParams", description = "穿线墙参数") |
| | | public class ReceviceTaskParams implements Serializable { |
| | | |
| | | |
| | | @ApiModelProperty("流水号") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("通知类型:task") |
| | | private String notifyType; |
| | | |
| | | @ApiModelProperty("堆垛机号") |
| | | private Integer device; |
| | | |
| | | @ApiModelProperty("WCS任务号") |
| | | private String taskNo; |
| | | |
| | | @ApiModelProperty("WMS任务号") |
| | | private String wrkNo; |
| | | |
| | | @ApiModelProperty("WMS系统任务号") |
| | | private String superTaskNo; |
| | | |
| | | @ApiModelProperty("消息类型:task_complete、task_cancel") |
| | | private String msgType; |
| | | |
| | | @ApiModelProperty("消息描述") |
| | | private String msgDesc; |
| | | |
| | | @ApiModelProperty("消息数据") |
| | | private String data; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.api.controller.params; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "WorkTaskParams", description = "执行任务参数") |
| | | public class WorkTaskParams implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty("协议任务编号(对应出库任务号)") |
| | | private String taskNo; |
| | | |
| | | @ApiModelProperty("工作档任务号") |
| | | private String wrkNo; |
| | | |
| | | @ApiModelProperty("库位编码") |
| | | private String locNo; |
| | | |
| | | @ApiModelProperty("条码") |
| | | private String barcode; |
| | | |
| | | @ApiModelProperty("优先级") |
| | | private Integer taskPri; |
| | | |
| | | @ApiModelProperty("出库站点") |
| | | private String staNo; |
| | | |
| | | @ApiModelProperty("作业类型,in: 入库, out:出库") |
| | | private String type; |
| | | |
| | | @ApiModelProperty("是否余料") |
| | | private Integer isSuplus; |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.api.entity; |
| | | |
| | | import java.util.Map; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | @Data |
| | | @ApiModel("基础请求参数") |
| | | @Accessors(chain = true) |
| | | public class BaseRequstParam { |
| | | |
| | | private Map<String, Object> root; |
| | | } |
| New file |
| | |
| | | package com.zy.api.entity; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "CallAgvParams", description = "AGV搬运参数") |
| | | public class CallAgvParams implements Serializable { |
| | | |
| | | @ApiModelProperty("呼叫类型:出库:out, 入库:in") |
| | | private String type; |
| | | |
| | | @ApiModelProperty("原库位") |
| | | private String orgLoc; |
| | | |
| | | @ApiModelProperty("目标站点") |
| | | private String tarSite; |
| | | |
| | | @ApiModelProperty("原站点") |
| | | private String orgSite; |
| | | |
| | | @ApiModelProperty("目标库位") |
| | | private String tarLoc; |
| | | |
| | | @ApiModelProperty("搬运状态") |
| | | private String status; |
| | | |
| | | @ApiModelProperty("任务号") |
| | | private String wrkNo; |
| | | |
| | | @ApiModelProperty("任务类型") |
| | | private String taskType = "M2"; |
| | | } |
| New file |
| | |
| | | package com.zy.api.entity; |
| | | |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "MatnrsParams", description = "物料信息") |
| | | public class MatnrsParams { |
| | | |
| | | @ApiModelProperty("单据类型") |
| | | private String pro_komcode; |
| | | |
| | | @ApiModelProperty("工单类型") |
| | | private String pro_id; |
| | | |
| | | @ApiModelProperty("订单号") |
| | | private String company_id; |
| | | |
| | | @ApiModelProperty("订单数量") |
| | | private Double pro_name; |
| | | |
| | | @ApiModelProperty("操作人") |
| | | private String pro_size; |
| | | |
| | | @ApiModelProperty("重量") |
| | | private String pro_wet; |
| | | |
| | | @ApiModelProperty("零件类型") |
| | | private String pro_type; |
| | | |
| | | @ApiModelProperty("更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private String update_time; |
| | | } |
| New file |
| | |
| | | package com.zy.api.entity; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "OrderItemsParam", description = "订单明细参数") |
| | | public class OrderItemsParam implements Serializable { |
| | | |
| | | @ApiModelProperty("BS Code") |
| | | private String total_serial; |
| | | |
| | | @ApiModelProperty("目标库区") |
| | | private String target_location; |
| | | |
| | | @ApiModelProperty("零件类型") |
| | | private String pro_type; |
| | | |
| | | @ApiModelProperty("零件代码") |
| | | private String pro_komcode; |
| | | |
| | | @ApiModelProperty("供应商编码") |
| | | private String pro_id; |
| | | |
| | | @ApiModelProperty("入库通知数量") |
| | | private Double inv_qty; |
| | | |
| | | @ApiModelProperty("指示拣货订单数量") |
| | | private Integer order_qty; |
| | | |
| | | @ApiModelProperty("原上架派工数量") |
| | | private Integer old_qty; |
| | | |
| | | @ApiModelProperty("变更数量") |
| | | private Integer new_qty; |
| | | |
| | | @ApiModelProperty("捆绑/叫料/数量数量") |
| | | private Integer pick_qty; |
| | | |
| | | @ApiModelProperty("损溢数量") |
| | | private Integer bsby_qty; |
| | | |
| | | @ApiModelProperty("托盘编号") |
| | | private String location_no; |
| | | |
| | | @ApiModelProperty("台车编码") |
| | | private String truck_no; |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.api.entity; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "OrderParams", description = "单据信息") |
| | | public class OrderParams implements Serializable { |
| | | |
| | | @ApiModelProperty("流水号(唯一)") |
| | | private String kopen_id; |
| | | |
| | | @ApiModelProperty("派工单号") |
| | | private String dispatch_no; |
| | | |
| | | @ApiModelProperty("公司ID") |
| | | private String company_id; |
| | | |
| | | @ApiModelProperty("入库类型 1: 采购入库,2: 调拨入库,3: 销售退货入库,4: 套包入库, 5:SO, 6:EO, 7:出库") |
| | | private String type; |
| | | |
| | | @ApiModelProperty("箱号") |
| | | private String pm_tktid; |
| | | |
| | | @ApiModelProperty("入库通知单号") |
| | | private String inv_no; |
| | | |
| | | @ApiModelProperty("目标库区") |
| | | private String target_location; |
| | | |
| | | @ApiModelProperty("源库区") |
| | | private String source_location; |
| | | |
| | | |
| | | @ApiModelProperty("拣货单号") |
| | | private String pick_no; |
| | | |
| | | @ApiModelProperty("订单号") |
| | | private String order_no; |
| | | |
| | | |
| | | @ApiModelProperty("客户ID") |
| | | private String cus_id; |
| | | |
| | | |
| | | @ApiModelProperty("客户地址") |
| | | private String cus_address; |
| | | |
| | | |
| | | @ApiModelProperty("WMS ID") |
| | | private String wms_id; |
| | | |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private String update_time; |
| | | } |
| New file |
| | |
| | | package com.zy.api.entity; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "OutOrderParams", description = "备货订单参数") |
| | | public class OutOrderParams implements Serializable { |
| | | |
| | | @ApiModelProperty("明细备货单号") |
| | | private String pick_no; |
| | | |
| | | @ApiModelProperty("订单号") |
| | | private String order_no; |
| | | |
| | | @ApiModelProperty("客户") |
| | | private String cus_id; |
| | | |
| | | @ApiModelProperty("客户地址") |
| | | private String cus_address; |
| | | |
| | | @ApiModelProperty("业务类型") |
| | | private String type; |
| | | |
| | | @ApiModelProperty("订单明细") |
| | | private List<OrderItemsParam> partList; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.api.entity; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "PubOrderParams", description = "发布订单信息") |
| | | public class PubOrderParams extends OrderParams { |
| | | |
| | | @ApiModelProperty("入库物料列表") |
| | | List<OrderItemsParam> details; |
| | | } |
| New file |
| | |
| | | package com.zy.api.entity; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "ReportOrderParam", description = "上报订单信息") |
| | | public class ReportOrderParam extends OrderParams{ |
| | | |
| | | @ApiModelProperty("上报订单列表") |
| | | List<ReportOrderParams> details; |
| | | |
| | | @ApiModelProperty("订单明细") |
| | | private List<OrderItemsParam> partList; |
| | | } |
| New file |
| | |
| | | package com.zy.api.entity; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel("上报订单参数") |
| | | public class ReportOrderParams implements Serializable { |
| | | |
| | | @ApiModelProperty("BS Code") |
| | | private String total_serial; |
| | | |
| | | @ApiModelProperty("产品类型") |
| | | private String pro_type; |
| | | |
| | | @ApiModelProperty("零件代码") |
| | | private String pro_komcode; |
| | | |
| | | @ApiModelProperty("供应商ID") |
| | | private String pro_id; |
| | | |
| | | @ApiModelProperty("容器编码") |
| | | private String location_no; |
| | | |
| | | @ApiModelProperty("货位类型") |
| | | private String location_type; |
| | | |
| | | @ApiModelProperty("上架日期") |
| | | private String sj_date; |
| | | |
| | | @ApiModelProperty("上架人") |
| | | private String sj_emp; |
| | | |
| | | @ApiModelProperty("上架数量") |
| | | private Integer pick_qty; |
| | | |
| | | @ApiModelProperty("破损数量") |
| | | private Integer damage_qty; |
| | | |
| | | @ApiModelProperty("差异数量") |
| | | private Integer diff_qty; |
| | | |
| | | @ApiModelProperty("原上架派工数量") |
| | | private Integer old_qty; |
| | | |
| | | @ApiModelProperty("变更数量") |
| | | private Integer new_qty; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.api.entity; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "StockAdjustParams", description = "零件损溢单参数") |
| | | public class StockAdjustParams extends OrderParams { |
| | | |
| | | @ApiModelProperty("调整原因") |
| | | private String reason; |
| | | |
| | | @ApiModelProperty("调整原因名称") |
| | | private String reason_name; |
| | | |
| | | @ApiModelProperty("调整单编号") |
| | | private String bsby_no; |
| | | |
| | | @ApiModelProperty("调整单明细列表") |
| | | List<OrderItemsParam> details; |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.api.entity; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "StockUpOrderParams", description = "备货订单参数") |
| | | public class StockUpOrderParams extends OrderParams{ |
| | | |
| | | |
| | | @ApiModelProperty("订单明细") |
| | | private List<OutOrderParams> details; |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.api.entity; |
| | | |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "SyncMatParmas", description = "物料同步参数") |
| | | public class SyncMatParmas implements Serializable { |
| | | |
| | | |
| | | @ApiModelProperty("零件类型") |
| | | private String pro_type; |
| | | |
| | | @ApiModelProperty("零件代码") |
| | | private String pro_komcode; |
| | | |
| | | @ApiModelProperty("供应商编码") |
| | | private String pro_id; |
| | | |
| | | @ApiModelProperty("入库通知数量") |
| | | private Double inv_qty; |
| | | |
| | | @ApiModelProperty("公司ID") |
| | | private String company_id; |
| | | |
| | | @ApiModelProperty("零件名称") |
| | | private String pro_name; |
| | | |
| | | @ApiModelProperty("尺寸") |
| | | private String pro_size; |
| | | |
| | | @ApiModelProperty("重量") |
| | | private String pro_wet; |
| | | |
| | | @ApiModelProperty("更新时间") |
| | | private String update_time; |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.api.entity.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.sql.Date; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "HKR", description = "海康响应信息") |
| | | public class HKR<T> { |
| | | private static final String SUCCESS_CODE = "200"; |
| | | private static final String FAIL_CODE = "500"; |
| | | |
| | | private String code; |
| | | |
| | | private String message; |
| | | |
| | | private Boolean success; |
| | | |
| | | private String reqCode; |
| | | |
| | | private Integer errorCode; |
| | | |
| | | private T result; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date timestamp; |
| | | |
| | | public HKR() { |
| | | this.timestamp = new Date(System.currentTimeMillis()); |
| | | } |
| | | |
| | | public static <T> HKR<T> ok() { |
| | | return new HKR<T>() |
| | | .setCode("SUCCESS") |
| | | .setSuccess(true) |
| | | .setMessage("操作成功") |
| | | .setErrorCode(0); |
| | | } |
| | | |
| | | public static <T> HKR<T> ok(T data) { |
| | | return new HKR<T>() |
| | | .setCode("SUCCESS") |
| | | .setSuccess(true) |
| | | .setMessage("操作成功") |
| | | .setErrorCode(0) |
| | | .setResult(data); |
| | | } |
| | | |
| | | public static <T> HKR<T> ok(T data, String message) { |
| | | return new HKR<T>() |
| | | .setCode("SUCCESS") |
| | | .setSuccess(true) |
| | | .setMessage(message) |
| | | .setErrorCode(0) |
| | | .setResult(data); |
| | | } |
| | | |
| | | public static <T> HKR<T> error(String message) { |
| | | return new HKR<T>() |
| | | .setCode("ERROR") |
| | | .setSuccess(false) |
| | | .setMessage(message) |
| | | .setErrorCode(99); |
| | | } |
| | | |
| | | public static <T> HKR<T> error(String code, String message) { |
| | | return new HKR<T>() |
| | | .setCode("ERROR") |
| | | .setSuccess(false) |
| | | .setMessage(message) |
| | | .setErrorCode(99); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.api.entity.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.experimental.Accessors; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "LocDetlDto", description = "库位明细返回值") |
| | | public class LocDetlDto implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty("物料编码") |
| | | private String pro_komcode; |
| | | |
| | | @ApiModelProperty("供应商") |
| | | private String pro_id; |
| | | |
| | | @ApiModelProperty("可用库存") |
| | | private Integer stock_qty; |
| | | |
| | | @ApiModelProperty("隔离库存") |
| | | private Integer lock_qty; |
| | | |
| | | @ApiModelProperty("目标托盘") |
| | | private String location_no; |
| | | |
| | | @ApiModelProperty("库区") |
| | | private String target_location; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.api.entity.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "LocMastDto", description = "库位信息") |
| | | public class LocMastDto implements Serializable { |
| | | |
| | | @ApiModelProperty("库位信息") |
| | | private String locNo; |
| | | |
| | | private String locSts; |
| | | |
| | | private String barcode; |
| | | |
| | | private Integer row; |
| | | |
| | | private Integer bay; |
| | | |
| | | private Integer lev; |
| | | } |
| New file |
| | |
| | | package com.zy.api.entity.dto; |
| | | |
| | | import java.sql.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "XSR", description = "基础响应") |
| | | public class XSR<T> { |
| | | private static final String SUCCESS_CODE = "200"; |
| | | private static final String FAIL_CODE = "500"; |
| | | |
| | | private String code; |
| | | |
| | | private String message; |
| | | |
| | | private Boolean success; |
| | | |
| | | private String returnMessage; |
| | | |
| | | private T result; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date timestamp; |
| | | |
| | | public XSR() { |
| | | this.timestamp = new Date(System.currentTimeMillis()); |
| | | } |
| | | |
| | | public static <T> XSR<T> ok() { |
| | | return new XSR<T>() |
| | | .setCode(SUCCESS_CODE) |
| | | .setSuccess(true) |
| | | .setMessage("操作成功") |
| | | .setReturnMessage("操作成功"); |
| | | } |
| | | |
| | | public static <T> XSR<T> ok(T data) { |
| | | return new XSR<T>() |
| | | .setCode(SUCCESS_CODE) |
| | | .setSuccess(true) |
| | | .setMessage("操作成功") |
| | | .setReturnMessage("操作成功") |
| | | .setResult(data); |
| | | } |
| | | |
| | | public static <T> XSR<T> ok(T data, String message) { |
| | | return new XSR<T>() |
| | | .setCode(SUCCESS_CODE) |
| | | .setSuccess(true) |
| | | .setMessage(message) |
| | | .setReturnMessage(message) |
| | | .setResult(data); |
| | | } |
| | | |
| | | public static <T> XSR<T> error(String message) { |
| | | return new XSR<T>() |
| | | .setCode(FAIL_CODE) |
| | | .setSuccess(false) |
| | | .setMessage(message) |
| | | .setReturnMessage(message); |
| | | } |
| | | |
| | | public static <T> XSR<T> error(String code, String message) { |
| | | return new XSR<T>() |
| | | .setCode(code) |
| | | .setSuccess(false) |
| | | .setMessage(message) |
| | | .setReturnMessage(message); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.api.enums; |
| | | /** |
| | | * 库区类型 |
| | | */ |
| | | public enum LocAreaType { |
| | | |
| | | |
| | | /** 大库区 */ |
| | | AUTOMATED("1", "立库"), |
| | | /** 中库区 */ |
| | | SO_HOLDING("2", "SO等待区"), |
| | | /** 小件库区 */ |
| | | EO_HOLDING("3", "EO等待区"); |
| | | |
| | | public String type; |
| | | |
| | | public String desc; |
| | | |
| | | LocAreaType(String type, String desc) { |
| | | this.type = type; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.api.enums; |
| | | |
| | | /** |
| | | * 物料所属库位类型 |
| | | * @author Ryan |
| | | * @date 2025/12/6 10:41 |
| | | * @return null |
| | | */ |
| | | public enum MatLocType { |
| | | |
| | | /** 小件 */ |
| | | AUTOMATED("12", "小件"), |
| | | /** 中件 */ |
| | | SO_HOLDING("13", "中件"), |
| | | /** 大件 */ |
| | | EO_HOLDING("14", "滤芯"); |
| | | |
| | | public String type; |
| | | |
| | | public String desc; |
| | | |
| | | MatLocType(String type, String desc) { |
| | | this.type = type; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public static String getTagName(String type) { |
| | | if (type.equals(MatLocType.AUTOMATED.type)) { |
| | | return MatLocType.AUTOMATED.desc; |
| | | } else if (type.equals(MatLocType.SO_HOLDING.type)) { |
| | | return MatLocType.SO_HOLDING.desc; |
| | | } else if (type.equals(MatLocType.EO_HOLDING.type)) { |
| | | return MatLocType.EO_HOLDING.desc; |
| | | } else { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | public static Long getTag(String type) { |
| | | if (type.equals(MatType.LARGE.type)) { |
| | | return Long.parseLong(MatLocType.EO_HOLDING.type); |
| | | } else if (type.equals(MatType.MIDDEL.type)) { |
| | | return Long.parseLong(MatLocType.SO_HOLDING.type); |
| | | } else if (type.equals(MatType.SMALL.type)) { |
| | | return Long.parseLong(MatLocType.AUTOMATED.type); |
| | | } else { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | public static String getMatTag(String type) { |
| | | if (type.equals(MatLocType.EO_HOLDING.type)) { |
| | | return MatType.LARGE.type; |
| | | } else if (type.equals(MatLocType.SO_HOLDING.type)) { |
| | | return MatType.MIDDEL.type; |
| | | } else if (type.equals(MatLocType.AUTOMATED.type)) { |
| | | return MatType.SMALL.type; |
| | | } else { |
| | | return null; |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.api.enums; |
| | | |
| | | /** |
| | | * 物料类型 |
| | | */ |
| | | public enum MatType { |
| | | |
| | | /** 滤芯 */ |
| | | LARGE("1", "滤芯"), |
| | | /** 中件 */ |
| | | MIDDEL("2", "中件"), |
| | | /** 小件 */ |
| | | SMALL("3", "小件"); |
| | | |
| | | public String type; |
| | | |
| | | public String desc; |
| | | |
| | | MatType(String type, String desc) { |
| | | this.type = type; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public static Long getTag(String type) { |
| | | if (type.equals(MatType.LARGE.type)) { |
| | | return Long.parseLong(MatLocType.AUTOMATED.type); |
| | | } else if (type.equals(MatType.MIDDEL.type)) { |
| | | return Long.parseLong(MatLocType.SO_HOLDING.type); |
| | | } else if (type.equals(MatType.SMALL.type)) { |
| | | return Long.parseLong(MatLocType.EO_HOLDING.type); |
| | | } else { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.api.enums; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @version 1.0 |
| | | * @title PurchaseType |
| | | * @description |
| | | * @create 2025/3/5 15:54 |
| | | */ |
| | | public enum OrderType { |
| | | //订单类型 |
| | | ORDER_OUT("out", "出库单"), |
| | | ORDER_IN("in", "入库单"), |
| | | ORDER_TRANSFER("transfer", "调拔单"), |
| | | ORDER_REVISE("revise", "库存调整"), |
| | | ORDER_CHECK("check", "盘点单"); |
| | | |
| | | |
| | | OrderType(String type, String desc) { |
| | | this.type = type; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public String type; |
| | | public String desc; |
| | | |
| | | public static String getTypeVal(String desc) { |
| | | if (desc.equals(OrderType.ORDER_IN.desc)) { |
| | | return OrderType.ORDER_IN.type; |
| | | } else if (desc.equals(OrderType.ORDER_OUT.desc)) { |
| | | return OrderType.ORDER_OUT.type; |
| | | } else if (desc.equals(OrderType.ORDER_CHECK.desc)) { |
| | | return OrderType.ORDER_CHECK.type; |
| | | } else if (desc.equals(OrderType.ORDER_TRANSFER.desc)) { |
| | | return OrderType.ORDER_TRANSFER.type; |
| | | } else if (desc.equals(OrderType.ORDER_REVISE.desc)) { |
| | | return OrderType.ORDER_REVISE.type; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static String getValType(String type) { |
| | | if (type.equals(OrderType.ORDER_IN.type)) { |
| | | return OrderType.ORDER_IN.desc; |
| | | } else if (type.equals(OrderType.ORDER_OUT.type)) { |
| | | return OrderType.ORDER_OUT.desc; |
| | | } else if (type.equals(OrderType.ORDER_CHECK.type)) { |
| | | return OrderType.ORDER_CHECK.desc; |
| | | } else if (type.equals(OrderType.ORDER_TRANSFER.type)) { |
| | | return OrderType.ORDER_TRANSFER.desc; |
| | | } else if (type.equals(OrderType.ORDER_REVISE.type)) { |
| | | return OrderType.ORDER_REVISE.desc; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.api.enums; |
| | | |
| | | import com.zy.asrs.enums.OrderTypeEnum; |
| | | |
| | | public enum OrderWkType { |
| | | |
| | | // 订单类型 |
| | | ORDER_WK_PUR_IN("0", "采购入库"), |
| | | ORDER_WK_TRANSFER_IN("1", "调拔入库"), |
| | | ORDER_WK_SALE_IN("2", "客户退货"), |
| | | ORDER_WK_BAG_IN("5", "索赔入库"), |
| | | ORDER_WK_SUPLUS_IN("7", "报溢入库"), |
| | | ORDER_WK_PRO_UPDATE_IN("8", "件号变更入库"), |
| | | ORDER_WK_PRO_LIXIANG_IN("8", "逆向上架入库"), |
| | | ORDER_WK_MEGER_IN("K", "组合拆零入库"), |
| | | ORDER_WK_MOVE_IN("Y", "移库位入库"), |
| | | ORDER_WK_ORDER_OUT_EO("12", "EO"), |
| | | ORDER_WK_ORDER_OUT_SO("11", "SO"), |
| | | ORDER_WK_ORDER_OUT("13", "MD"); |
| | | |
| | | OrderWkType(String val, String desc) { |
| | | this.val = val; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public String val; |
| | | public String desc; |
| | | |
| | | public static String getTypeVal(String val) { |
| | | if (val.equals(OrderWkType.ORDER_WK_PUR_IN.val) |
| | | || val.equals(OrderWkType.ORDER_WK_SUPLUS_IN.val) |
| | | || val.equals(OrderWkType.ORDER_WK_MEGER_IN.val) |
| | | || val.equals(OrderWkType.ORDER_WK_PRO_LIXIANG_IN.val) |
| | | || val.equals(OrderWkType.ORDER_WK_PRO_UPDATE_IN.val) |
| | | || val.equals(OrderWkType.ORDER_WK_MOVE_IN.val)) { |
| | | return OrderType.ORDER_IN.type; |
| | | } else if (val.equals(OrderWkType.ORDER_WK_TRANSFER_IN.val)) { |
| | | return OrderType.ORDER_IN.type; |
| | | } else if (val.equals(OrderWkType.ORDER_WK_SALE_IN.val)) { |
| | | return OrderType.ORDER_IN.type; |
| | | } else if (val.equals(OrderWkType.ORDER_WK_BAG_IN.val)) { |
| | | return OrderType.ORDER_IN.type; |
| | | } else if (val.equals(OrderWkType.ORDER_WK_ORDER_OUT_EO.val) || val.equals(OrderWkType.ORDER_WK_ORDER_OUT_SO.val) || val.equals(OrderWkType.ORDER_WK_ORDER_OUT.val)) { |
| | | return OrderType.ORDER_OUT.type; |
| | | } else { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public static Integer getDocType(String val) { |
| | | if (val.equals(OrderWkType.ORDER_WK_PUR_IN.val) |
| | | || val.equals(OrderWkType.ORDER_WK_SUPLUS_IN.val) |
| | | || val.equals(OrderWkType.ORDER_WK_MEGER_IN.val) |
| | | || val.equals(OrderWkType.ORDER_WK_PRO_UPDATE_IN.val) |
| | | || val.equals(OrderWkType.ORDER_WK_MOVE_IN.val) |
| | | ) { |
| | | return OrderTypeEnum.PICKING.type; |
| | | } else if (val.equals(OrderWkType.ORDER_WK_TRANSFER_IN.val)) { |
| | | return OrderTypeEnum.PICKING.type; |
| | | } else if (val.equals(OrderWkType.ORDER_WK_SALE_IN.val)) { |
| | | return OrderTypeEnum.PICKING.type; |
| | | } else if (val.equals(OrderWkType.ORDER_WK_BAG_IN.val)) { |
| | | return OrderTypeEnum.PICKING.type; |
| | | } else if (val.equals(OrderWkType.ORDER_WK_ORDER_OUT_EO.val) || val.equals(OrderWkType.ORDER_WK_ORDER_OUT_SO.val)) { |
| | | return OrderTypeEnum.TRANSFER.type; |
| | | } else if (val.equals(OrderWkType.ORDER_WK_ORDER_OUT.val)) { |
| | | return OrderTypeEnum.STOCK.type; |
| | | }else { |
| | | return null; |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.api.service; |
| | | |
| | | import com.core.common.R; |
| | | import com.zy.api.controller.params.AgvCallBackParam; |
| | | import com.zy.api.entity.CallAgvParams; |
| | | import com.zy.api.entity.dto.HKR; |
| | | |
| | | public interface AgvScheduleService { |
| | | |
| | | R callAgvCarry(CallAgvParams params); |
| | | |
| | | HKR callback(AgvCallBackParam params); |
| | | } |
| New file |
| | |
| | | package com.zy.api.service; |
| | | |
| | | 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.StockUpOrderParams; |
| | | import com.zy.api.entity.SyncMatParmas; |
| | | import com.zy.api.entity.dto.XSR; |
| | | import com.zy.asrs.entity.Order; |
| | | |
| | | public interface KopenApiService { |
| | | |
| | | |
| | | /** |
| | | * 上架派工单下发 |
| | | * @author Ryan |
| | | * @date 2025/11/24 14:42 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | XSR receiveOrders(List<PubOrderParams> params, String type); |
| | | |
| | | /** |
| | | * 基础零件变更 |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:04 |
| | | * @param matnrs |
| | | * @return com.core.common.R |
| | | */ |
| | | XSR basMatupdate(List<SyncMatParmas> matnrs); |
| | | |
| | | |
| | | /** |
| | | * 新增或修改单据信息 |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:33 |
| | | */ |
| | | void addOrUpdateOrders(PubOrderParams params, String type) ; |
| | | |
| | | /** |
| | | * 上架派工单反馈 |
| | | * |
| | | * @param params |
| | | * @param order |
| | | * @return |
| | | */ |
| | | XSR getInDispatchResult(List<ReportOrderParam> params, Order order); |
| | | |
| | | /** |
| | | * 备货指示派工单下发 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | XSR sendOutDispatch(List<PubOrderParams> params, String type); |
| | | |
| | | /** |
| | | * 备货单下发 |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:40 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | XSR getOutDetails(List<StockUpOrderParams> params); |
| | | |
| | | /** |
| | | * 查询WMS库存信息 |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:22 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | XSR getStockInfo(List<PageRequestParams> params); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.api.service; |
| | | |
| | | import com.core.common.R; |
| | | import com.zy.api.controller.params.ReceviceTaskParams; |
| | | import com.zy.api.controller.params.WorkTaskParams; |
| | | import com.zy.asrs.entity.param.CompleteParam; |
| | | |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | public interface WcsApiService { |
| | | |
| | | /** |
| | | * 锁定库位信息 |
| | | * @author Ryan |
| | | * @date 2026/1/10 11:17 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | R lockLocs(ReceviceTaskParams params); |
| | | |
| | | // /** |
| | | // * 回库搬运指令 |
| | | // * @author Ryan |
| | | // * @date 2026/1/10 13:08 |
| | | // * @param params |
| | | // * @return com.core.common.R |
| | | // */ |
| | | // R backLocs(WorkTaskParams params); |
| | | |
| | | /** |
| | | * 下发任务至WCS |
| | | * @author Ryan |
| | | * @date 2026/1/10 13:57 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | R pubWrkToWcs(WorkTaskParams params); |
| | | |
| | | // |
| | | // /** |
| | | // * 锁定或释放库位 |
| | | // * @author Ryan |
| | | // * @date 2026/1/10 14:35 |
| | | // * @param locs |
| | | // * @param type |
| | | // */ |
| | | // void reportLockLocs(Set<String> locs, String type); |
| | | |
| | | /** |
| | | * 堆垛机任务完成状态上报 |
| | | * @author Ryan |
| | | * @date 2026/1/10 16:29 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | R receviceTaskFromWcs(ReceviceTaskParams params); |
| | | |
| | | /** |
| | | * 獲取庫位信息 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | R getLocs(Map<String, String> params); |
| | | |
| | | /** |
| | | * 获取站点信息 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | R getStations(Map<String, String> params); |
| | | |
| | | /** |
| | | * 条码站扫码入库申请 |
| | | * @param combParam |
| | | * @param l |
| | | * @return |
| | | */ |
| | | R combInPub(CompleteParam combParam, long l); |
| | | |
| | | /** |
| | | * WCS申请任务重新分配入库 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | R repeatLoc(CompleteParam params); |
| | | } |
| New file |
| | |
| | | package com.zy.api.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.api.controller.params.AgvCallBackParam; |
| | | import com.zy.api.controller.params.AgvCarriesParam; |
| | | import com.zy.api.controller.params.AgvRequestParam; |
| | | import com.zy.api.entity.CallAgvParams; |
| | | import com.zy.api.entity.dto.HKR; |
| | | import com.zy.api.enums.OrderType; |
| | | import com.zy.api.service.AgvScheduleService; |
| | | import com.zy.asrs.entity.LocCache; |
| | | import com.zy.asrs.entity.Task; |
| | | import com.zy.asrs.entity.result.ForwardAGVTaskDTO; |
| | | import com.zy.asrs.entity.result.HIKApiDTO; |
| | | 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 com.zy.asrs.service.impl.LocCacheServiceImpl; |
| | | import com.zy.common.constant.HIKApiConstant; |
| | | import com.zy.common.utils.HttpHandler; |
| | | 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.*; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class AgvScheduleServiceImpl implements AgvScheduleService { |
| | | |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | @Autowired |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private LocCacheService locCacheService; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/11/3 |
| | | * @description: 呼叫AGV搬运 |
| | | * @version 1.0 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R callAgvCarry(CallAgvParams params) { |
| | | 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 (!task.getIsNewIn().equals("M2")) { |
| | | params.setTaskType(task.getIsNewIn()); |
| | | } |
| | | |
| | | HIKResultDTO hikResultDTO = sendAgvTask(params, HIKApiConstant.TASK_SUBMIT); |
| | | |
| | | if (hikResultDTO.isSuccess()) { |
| | | if (!taskService.updateById(task)) { |
| | | throw new CoolException("任务状态更新失败!!"); |
| | | } |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 获取自定义请求头 |
| | | * |
| | | * @return java.util.Map<java.lang.String, java.lang.Object> |
| | | * @author Ryan |
| | | * @date 2025/12/29 9:11 |
| | | */ |
| | | private Map<String, Object> getHeaderParam() { |
| | | Map<String, Object> headerParam = new HashMap<>(); |
| | | //设置请求连接的Token |
| | | headerParam.put("X-LR-REQUEST-ID", new Date().getTime() + ""); |
| | | return headerParam; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public HKR callback(AgvCallBackParam params) { |
| | | if (Objects.isNull(params)) { |
| | | return HKR.error("参数不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getRobotTaskCode())) { |
| | | return HKR.error("任务号不能为空!!"); |
| | | } |
| | | Task task = taskService.selectOne(new EntityWrapper<Task>().eq("wrk_no", params.getRobotTaskCode())); |
| | | if (Objects.isNull(task)) { |
| | | return HKR.error("任务信息不存在!!"); |
| | | } |
| | | |
| | | if (Arrays.asList(TaskIOType.ALL_IN.type, TaskIOType.PICK_IN.type, TaskIOType.MERGE_IN.type) |
| | | .contains(task.getIoType())) { |
| | | // 入库 |
| | | if (params.getExtra().getValues().getMethod().equals("start")) { |
| | | task.setWrkSts(TaskStatusType.AGV_TASK_RUNNING_IN.type); |
| | | } else if (params.getExtra().getValues().getMethod().equals("end")){ |
| | | task.setWrkSts(TaskStatusType.AGV_TASK_FINISHED_IN.type); |
| | | } |
| | | } else if (Arrays.asList(TaskIOType.ALL_OUT.type, TaskIOType.PICK_OUT.type, TaskIOType.MERGE_OUT.type, TaskIOType.EMPTY_OUT.type) |
| | | .contains(task.getIoType())) { |
| | | // 出库p |
| | | if (params.getExtra().getValues().getMethod().equals("start")) { |
| | | task.setWrkSts(TaskStatusType.AGV_TASK_RUNNING_OUT.type); |
| | | } else if (params.getExtra().getValues().getMethod().equals("end")){ |
| | | task.setWrkSts(TaskStatusType.AGV_TASK_FINISHED_OUT.type); |
| | | } |
| | | } |
| | | if (!taskService.updateById(task)) { |
| | | throw new CoolException("状态修改失败!!"); |
| | | } |
| | | return HKR.ok("执行完成 !!"); |
| | | } |
| | | |
| | | public HIKResultDTO sendAgvTask(CallAgvParams param, String path) { |
| | | HIKResultDTO result = new HIKResultDTO(); |
| | | AgvRequestParam requestParam = new AgvRequestParam(); |
| | | requestParam.setTaskType(param.getTaskType()); |
| | | List<AgvCarriesParam> agvCarriesParams = new ArrayList<>(); |
| | | |
| | | AgvCarriesParam carriesParam = new AgvCarriesParam(); |
| | | carriesParam.setSeq(0); |
| | | carriesParam.setCode(param.getOrgSite()); |
| | | |
| | | agvCarriesParams.add(carriesParam); |
| | | |
| | | AgvCarriesParam carriesParam2 = new AgvCarriesParam(); |
| | | carriesParam2.setSeq(1); |
| | | carriesParam2.setCode(param.getTarSite()); |
| | | |
| | | agvCarriesParams.add(carriesParam2); |
| | | |
| | | requestParam.setRobotTaskCode(param.getWrkNo()); |
| | | requestParam.setTargetRoute(agvCarriesParams); |
| | | |
| | | String body = JSON.toJSONString(requestParam); |
| | | String response = ""; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(HIKApiConstant.AGV_IP) |
| | | .setPath(path) |
| | | .setHeaders(getHeaderParam()) |
| | | .setJson(body) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getString("code").equals("SUCCESS")) { |
| | | result.setSuccess(true); |
| | | } else { |
| | | result.setMessage(jsonObject.getString("message")); |
| | | log.error("发送agv任务失败!!!url:{};request:{};response:{}", HIKApiConstant.AGV_IP + path, body, response); |
| | | } |
| | | // {"code":"1","data":"","interrupt":false,"message":"重复提交","msgErrCode":"0x3a80D012","reqCode":"fa92b49481a44627ae4d80c1400f28f6"} |
| | | } catch (Exception e) { |
| | | result.setMessage(e.getMessage()); |
| | | log.error("发送agv任务异常", e); |
| | | } finally { |
| | | try { |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "发送agv任务", |
| | | HIKApiConstant.AGV_IP + path, |
| | | null, |
| | | "127.0.0.1", |
| | | body, |
| | | response, |
| | | result.isSuccess()); |
| | | } catch (Exception e) { |
| | | log.error("", e); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.api.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | 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.LocDetlDto; |
| | | import com.zy.api.entity.dto.XSR; |
| | | import com.zy.api.enums.MatLocType; |
| | | import com.zy.api.enums.OrderType; |
| | | import com.zy.api.enums.OrderWkType; |
| | | import com.zy.api.service.KopenApiService; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.enums.CommonEnum; |
| | | import com.zy.asrs.enums.OrderSettle; |
| | | import com.zy.asrs.enums.OrderTypeEnum; |
| | | import com.zy.asrs.service.*; |
| | | |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.*; |
| | | |
| | | @Slf4j |
| | | @Service("kopenApiServiceImpl") |
| | | public class KopenApiServiceImpl implements KopenApiService { |
| | | |
| | | @Autowired |
| | | private OrderService orderService; |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | @Autowired |
| | | private MatService matService; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | // @Value("${kopen.url}") |
| | | private String url; |
| | | // @Value("${kopen.port}") |
| | | private String port; |
| | | // @Value("${kopen.prefix}") |
| | | private String prefix; |
| | | @Autowired |
| | | private BasAreasService basAreasService; |
| | | @Autowired |
| | | private OrderPakinService orderPakinService; |
| | | @Autowired |
| | | private OrderDetlPakinService orderDetlPakinService; |
| | | @Autowired |
| | | private OrderPakoutService orderPakoutService; |
| | | @Autowired |
| | | private OrderDetlPakoutService orderDetlPakoutService; |
| | | |
| | | |
| | | /** |
| | | * 接收下发订单信息 |
| | | * |
| | | * @param orderParams |
| | | * @return com.core.common.R |
| | | * @author Ryan |
| | | * @date 2025/11/24 14:49 |
| | | */ |
| | | @Override |
| | | public XSR receiveOrders(List<PubOrderParams> orderParams, String type) { |
| | | log.info("接收下发订单信息参数:{}", JSONObject.toJSONString(orderParams)); |
| | | orderParams.forEach(params -> { |
| | | if (params.getType().equals(OrderWkType.getTypeVal(params.getType()))) { |
| | | throw new CoolException("当前类型不是上架派工单!!"); |
| | | } |
| | | addOrUpdateOrders(params, type); |
| | | }); |
| | | |
| | | return XSR.ok("单据下发成功!!"); |
| | | } |
| | | |
| | | /** |
| | | * 上架派工单反馈 |
| | | * |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:33 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public XSR getInDispatchResult(List<ReportOrderParam> params, Order order) { |
| | | log.info("上架派工单反馈请求参数:{}", JSONObject.toJSONString(params)); |
| | | if (Objects.isNull(params)) { |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | String response = null; |
| | | |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(url + ":" + port) |
| | | .setPath(prefix + "/getInDispatchResult") |
| | | .setJson(JSONObject.toJSONString(params)) |
| | | .build() |
| | | .doPost(); |
| | | if (Objects.isNull(response) || response.trim().isEmpty()) { |
| | | return XSR.error("外网接口无响应!!"); |
| | | } |
| | | JSONObject jsonObject = JSONObject.parseObject(response); |
| | | Integer code = jsonObject.getInteger("code"); |
| | | log.info("上架派工单返回结果:{}", JSONObject.toJSONString(response)); |
| | | if (!Objects.isNull(code) && code.equals(200)) { |
| | | if (!Objects.isNull(order)) { |
| | | order.setReportOnce(5); |
| | | order.setSettle(6L); |
| | | orderService.updateById(order); |
| | | } |
| | | return XSR.ok("入库单上报完成!!"); |
| | | } else { |
| | | if (!Objects.isNull(order)) { |
| | | int reportOnce = order.getReportOnce(); |
| | | reportOnce++; |
| | | order.setReportOnce(reportOnce); |
| | | orderService.updateById(order); |
| | | } |
| | | String msg = jsonObject.getString("message"); |
| | | return XSR.error(Objects.isNull(msg) ? "上报失败!!" : msg); |
| | | } |
| | | } catch (Exception e) { |
| | | if (!Objects.isNull(order)) { |
| | | int reportOnce = order.getReportOnce(); |
| | | reportOnce++; |
| | | order.setReportOnce(reportOnce); |
| | | orderService.updateById(order); |
| | | } |
| | | log.error(e.getMessage(), e); |
| | | return XSR.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取自定义请求头 |
| | | * |
| | | * @return java.util.Map<java.lang.String, java.lang.Object> |
| | | * @author Ryan |
| | | * @date 2025/12/29 9:11 |
| | | */ |
| | | private Map<String, Object> getHeaderParam() { |
| | | Map<String, Object> headerParam = new HashMap<>(); |
| | | // headerParam.put("accept", "*/*"); |
| | | // headerParam.put("connection", "Keep-Alive"); |
| | | //设置请求连接的Token |
| | | headerParam.put("api_key", "WMS"); |
| | | headerParam.put("charset", "UTF-8"); |
| | | headerParam.put("timestamp", new Date()); |
| | | headerParam.put("format", "xml"); |
| | | headerParam.put("signature", "c56ced444ed772098ffeb59537bbfa59"); |
| | | |
| | | return headerParam; |
| | | } |
| | | |
| | | /* */ |
| | | |
| | | /** |
| | | * 备货指示派工单下发 |
| | | * |
| | | * @param pubOrderParams |
| | | * @return com.core.common.R |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:21 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public XSR sendOutDispatch(List<PubOrderParams> pubOrderParams, String type) { |
| | | log.info("备货指示派工单下发参数:{}", JSONObject.toJSONString(pubOrderParams)); |
| | | |
| | | if (Objects.isNull(pubOrderParams) || pubOrderParams.isEmpty()) { |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | pubOrderParams.forEach(params -> { |
| | | // 校验参数 |
| | | if (Objects.isNull(params.getDispatch_no())) { |
| | | throw new CoolException("派工单编号不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getKopen_id())) { |
| | | throw new CoolException("流水号不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getCompany_id())) { |
| | | throw new CoolException("公司ID不能为空!!"); |
| | | } |
| | | addOrUpdateOrders(params, type); |
| | | }); |
| | | |
| | | return XSR.ok("备货指示派工单下发成功!!"); |
| | | } |
| | | |
| | | // /** |
| | | // * 备货指示派工单 |
| | | // * |
| | | // * @author Ryan |
| | | // * @date 2025/12/16 9:15 |
| | | // * @param params |
| | | // */ |
| | | // private void outOrderAddAndUpdate(PubOrderParams params, String type) { |
| | | // if (Objects.isNull(params)) { |
| | | // throw new CoolException("参数不能为空!!"); |
| | | // } |
| | | // if (Objects.isNull(params.getType())) { |
| | | // throw new CoolException("订单类型不能为空!!"); |
| | | // } |
| | | |
| | | // OrderParams orderParams = |
| | | // JSONObject.parseObject(JSONObject.toJSONString(params), OrderParams.class); |
| | | // Order order = orderService.selectOne(new |
| | | // EntityWrapper<Order>().eq("order_no", orderParams.getInv_no())); |
| | | // if (type.equals("add") && !Objects.isNull(order)) { |
| | | // throw new CoolException("单据已存在, 不可重复添加!!"); |
| | | // } |
| | | // // 判断订单是否存在 |
| | | // if (Objects.isNull(order)) { |
| | | // /** 不存在,新增订单 */ |
| | | // generateOrders(params); |
| | | // } else { |
| | | // /** 存在,删除老订单,更新插入新订单 */ |
| | | // // 删除旧订单明细 |
| | | // if (!orderDetlService.delete(new EntityWrapper<OrderDetl>().eq("order_id", |
| | | // order.getId()))) { |
| | | // throw new CoolException("订单明细删除失败!!"); |
| | | // } |
| | | // ; |
| | | // if (!orderService.deleteById(order.getId())) { |
| | | // throw new CoolException("原单据删除失败!!"); |
| | | // } |
| | | // generateOrders(params); |
| | | // } |
| | | |
| | | // } |
| | | |
| | | /** |
| | | * 基础零件变更 |
| | | * |
| | | * @param params |
| | | * @return com.core.common.R |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:05 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public synchronized XSR basMatupdate(List<SyncMatParmas> params) { |
| | | log.info("基础零件变更:{}", JSONArray.toJSONString(params)); |
| | | |
| | | if (Objects.isNull(params) || params.isEmpty()) { |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | params.forEach(mats -> { |
| | | if (Objects.isNull(mats)) { |
| | | throw new CoolException("物料编码不能为空!!"); |
| | | } |
| | | if (Objects.isNull(mats.getPro_type())) { |
| | | throw new CoolException("零件类型不能为空!!"); |
| | | } |
| | | if (Objects.isNull(mats.getPro_id())) { |
| | | throw new CoolException("供应商不能为空!!"); |
| | | } |
| | | Mat matnr = matService.selectOne(new EntityWrapper<Mat>() |
| | | .eq("supp_code", mats.getPro_id()) |
| | | .eq("matnr", mats.getPro_komcode())); |
| | | if (!Objects.isNull(matnr)) { |
| | | // 订单时间 |
| | | if (Utils.isValidFormat(mats.getUpdate_time(), "yyyy-MM-dd HH:mm:ss")) { |
| | | Date date1 = Utils.getFormateDate(mats.getUpdate_time()); |
| | | matnr.setUpdateTime(date1); |
| | | } |
| | | matnr.setMaktx(mats.getPro_name()); |
| | | matnr.setSpecs(mats.getPro_size()); |
| | | matnr.setWeight(Objects.isNull(mats.getPro_wet()) ? 0.0 : Double.parseDouble(mats.getPro_wet())); |
| | | matnr.setSuppCode(mats.getPro_id()); |
| | | matnr.setTagId(MatLocType.getTag(mats.getPro_type())); |
| | | matnr.setLocType(MatLocType.getTag(mats.getPro_type())); |
| | | matnr.setManu(mats.getCompany_id()); |
| | | if (!matService.updateById(matnr)) { |
| | | throw new CoolException("物料更新失败或无需更新!!"); |
| | | } |
| | | } else { |
| | | if (Objects.isNull(matnr)) { |
| | | matnr = new Mat(); |
| | | } |
| | | // 订单时间 |
| | | if (Utils.isValidFormat(mats.getUpdate_time(), "yyyy-MM-dd HH:mm:ss")) { |
| | | Date date1 = Utils.getFormateDate(mats.getUpdate_time()); |
| | | matnr.setUpdateTime(date1); |
| | | } |
| | | matnr.setMaktx(mats.getPro_name()); |
| | | matnr.setMatnr(mats.getPro_komcode()); |
| | | matnr.setSpecs(mats.getPro_size()); |
| | | matnr.setWeight(Double.parseDouble(mats.getPro_wet())); |
| | | matnr.setSuppCode(mats.getPro_id()); |
| | | matnr.setTagId(MatLocType.getTag(mats.getPro_type())); |
| | | matnr.setLocType(MatLocType.getTag(mats.getPro_type())); |
| | | matnr.setManu(mats.getCompany_id()); |
| | | if (!matService.insert(matnr)) { |
| | | throw new CoolException("物料更新失败!!"); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | return XSR.ok("保存成功!!"); |
| | | } |
| | | |
| | | /** |
| | | * 新增或修改订单信息 |
| | | * |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:32 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addOrUpdateOrders(PubOrderParams params, String type) { |
| | | if (Objects.isNull(params)) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getType())) { |
| | | throw new CoolException("订单类型不能为空!!"); |
| | | } |
| | | OrderParams orderParams = JSONObject.parseObject(JSONObject.toJSONString(params), OrderParams.class); |
| | | // Order order = orderService.selectOne(new |
| | | // EntityWrapper<Order>().eq("order_no", orderParams.getDispatch_no())); |
| | | Order order = null; |
| | | if (OrderType.ORDER_IN.type.equals(OrderWkType.getTypeVal(params.getType()))) { |
| | | // 入库 |
| | | order = orderService.selectOne(new EntityWrapper<Order>().eq("order_no", |
| | | orderParams.getDispatch_no())); |
| | | } else if (OrderType.ORDER_OUT.type.equals(OrderWkType.getTypeVal(params.getType()))) { |
| | | // 出库 |
| | | if (OrderWkType.ORDER_WK_ORDER_OUT.val.equals(params.getType())) { |
| | | // 备货单出库 |
| | | order = orderService.selectOne(new EntityWrapper<Order>().eq("order_no", |
| | | orderParams.getPick_no())); |
| | | } else if (OrderWkType.ORDER_WK_ORDER_OUT_EO.val.equals(params.getType()) |
| | | || OrderWkType.ORDER_WK_ORDER_OUT_SO.val.equals(params.getType())) { |
| | | // 备货指示派工单(EO/SO)出库 |
| | | order = orderService.selectOne(new EntityWrapper<Order>().eq("order_no", |
| | | orderParams.getDispatch_no())); |
| | | } else { |
| | | throw new CoolException("单据类型不存在,不支持添加!!"); |
| | | } |
| | | } else { |
| | | throw new CoolException("单据类型不存在,不支持添加!!"); |
| | | } |
| | | // 出库 |
| | | if (type.equals("add") && !Objects.isNull(order)) { |
| | | throw new CoolException("单据已存在, 不可重复添加!!"); |
| | | } |
| | | // 判断订单是否存在 |
| | | if (Objects.isNull(order)) { |
| | | /** 不存在,新增订单 */ |
| | | generateOrders(params, type); |
| | | } else { |
| | | if (OrderType.ORDER_IN.type.equals(OrderWkType.getTypeVal(params.getType()))) { |
| | | // 入库 |
| | | OrderPakin orderPakin = orderPakinService.selectOne(new EntityWrapper<OrderPakin>().eq("order_no", order.getOrderNo())); |
| | | if (!Objects.isNull(orderPakin) && orderPakin.getSettle() != 1) { |
| | | throw new CoolException("订单已处理,不可再变更!!"); |
| | | } |
| | | /** 存在,删除老订单,更新插入新订单 */ |
| | | if (!orderDetlPakinService.delete(new EntityWrapper<OrderDetlPakin>().eq("order_no", orderPakin.getOrderNo()))) { |
| | | throw new CoolException("订单删除失败!!"); |
| | | } |
| | | |
| | | if (!orderPakinService.delete(new EntityWrapper<OrderPakin>().eq("order_no", orderPakin.getOrderNo()))) { |
| | | throw new CoolException("主单删除失败!!"); |
| | | } |
| | | } else if (OrderType.ORDER_OUT.type.equals(OrderWkType.getTypeVal(params.getType()))) { |
| | | // 出库 |
| | | if (OrderWkType.ORDER_WK_ORDER_OUT_EO.val.equals(params.getType()) |
| | | || OrderWkType.ORDER_WK_ORDER_OUT_SO.val.equals(params.getType()) || |
| | | OrderWkType.ORDER_WK_ORDER_OUT.val.equals(params.getType())) { |
| | | // 备货指示派工单(EO/SO)出库 |
| | | OrderPakout orderPakin = orderPakoutService.selectOne(new EntityWrapper<OrderPakout>().eq("order_no", order.getOrderNo())); |
| | | if (!Objects.isNull(orderPakin) && orderPakin.getSettle() != 1) { |
| | | throw new CoolException("订单已处理,不可再变更!!"); |
| | | } |
| | | |
| | | /** 存在,删除老订单,更新插入新订单 */ |
| | | if (!orderPakoutService.delete(new EntityWrapper<OrderPakout>().eq("order_no", orderPakin.getOrderNo()))) { |
| | | throw new CoolException("订单删除失败!!"); |
| | | } |
| | | |
| | | if (!orderDetlPakoutService.delete(new EntityWrapper<OrderDetlPakout>().eq("order_no", orderPakin.getOrderNo()))) { |
| | | throw new CoolException("主单删除失败!!"); |
| | | } |
| | | } else { |
| | | throw new CoolException("单据类型不存在,不支持添加!!"); |
| | | } |
| | | } |
| | | |
| | | order.setSettle(3L); |
| | | if (!orderService.updateById(order)) { |
| | | throw new CoolException("原单据删除失败!!"); |
| | | } |
| | | // generateOrders(params, type); |
| | | } |
| | | } |
| | | |
| | | public static String generateUUID(OrderParams params) { |
| | | return java.util.UUID.randomUUID().toString(); |
| | | } |
| | | |
| | | /** |
| | | * 生成订单信息 |
| | | * |
| | | * @param params |
| | | * @param type |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void generateOrders(PubOrderParams params, String type) { |
| | | // 将数据当新订单插入 |
| | | Order newOrder = new Order(); |
| | | // 派工单号 |
| | | newOrder.setOrderNo(params.getDispatch_no()); |
| | | if (OrderType.ORDER_IN.type.equals(OrderWkType.getTypeVal(params.getType()))) { |
| | | // 入库 |
| | | newOrder.setPakinPakoutStatus(1); |
| | | Integer docType = OrderWkType.getDocType(params.getType()); |
| | | newOrder.setDocType(Long.parseLong(docType + "")); |
| | | newOrder.setNumber(params.getInv_no()); |
| | | } else if (OrderType.ORDER_OUT.type.equals(OrderWkType.getTypeVal(params.getType()))) { |
| | | // 出库 |
| | | if (OrderWkType.ORDER_WK_ORDER_OUT.val.equals(params.getType())) { |
| | | // 备货单出库 |
| | | 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 + "")); |
| | | } else if (OrderWkType.ORDER_WK_ORDER_OUT_EO.val.equals(params.getType()) |
| | | || OrderWkType.ORDER_WK_ORDER_OUT_SO.val.equals(params.getType())) { |
| | | // 备货指示派工单(EO/SO)出库 |
| | | newOrder.setDocType(Long.parseLong(OrderTypeEnum.TRANSFER.type + "")); |
| | | } |
| | | newOrder.setPakinPakoutStatus(2); |
| | | } |
| | | |
| | | newOrder.setUuid(generateUUID(params)); |
| | | newOrder.setShipName(params.getType()); |
| | | // 流水号(唯一) |
| | | newOrder.setDefNumber(params.getKopen_id()); |
| | | // newOrder.setTargetLocation(params.getTarget_location()); |
| | | // 箱号 |
| | | newOrder.setItemName(params.getPm_tktid()); |
| | | newOrder.setSettle(OrderSettle.ORDER_SETTLE_HOLDING.type); |
| | | newOrder.setStatus(CommonEnum.COMMON_ENUM_Y.type); |
| | | // 订单时间 |
| | | if (Utils.isValidFormat(params.getUpdate_time(), "yyyy-MM-dd HH:mm:ss")) { |
| | | newOrder.setOrderTime(params.getUpdate_time()); |
| | | } |
| | | // 公司ID |
| | | newOrder.setCstmrName(params.getCompany_id()); |
| | | newOrder.setCreateTime(new Date()); |
| | | newOrder.setUpdateTime(new Date()); |
| | | if (!orderService.insert(newOrder)) { |
| | | throw new RuntimeException("新增订单失败!!"); |
| | | } |
| | | if (!Objects.isNull(params.getDetails()) && !params.getDetails().isEmpty()) { |
| | | List<OrderDetl> orderDetls = new ArrayList<>(); |
| | | params.getDetails().forEach(item -> { |
| | | Mat matnr = matService.selectOne(new EntityWrapper<Mat>() |
| | | .eq("supp_code", item.getPro_id()) |
| | | .eq("matnr", item.getPro_komcode())); |
| | | if (Objects.isNull(matnr)) { |
| | | throw new CoolException(item.getPro_komcode() + ",物料编码不存在,请维护后再推送!!"); |
| | | } |
| | | OrderDetl orderItem = new OrderDetl(); |
| | | BeanUtils.copyProperties(matnr, orderItem); |
| | | orderItem.setOrderId(newOrder.getId()); |
| | | orderItem.setOrderNo(newOrder.getOrderNo()); |
| | | |
| | | if (OrderType.ORDER_IN.type.equals(OrderWkType.getTypeVal(params.getType()))) { |
| | | // 入库 |
| | | if (type.equals("add")) { |
| | | orderItem.setAnfme(Math.round(item.getInv_qty() * 10000) / 10000.0); |
| | | } else { |
| | | orderItem.setAnfme(Math.round(item.getNew_qty() * 10000) / 10000.0); |
| | | } |
| | | } else if (OrderType.ORDER_OUT.type.equals(OrderWkType.getTypeVal(params.getType()))) { |
| | | // 出库 |
| | | if (OrderWkType.ORDER_WK_ORDER_OUT.val.equals(params.getType())) { |
| | | // 备货单出库 |
| | | orderItem.setAnfme(Math.round(item.getPick_qty() * 10000) / 10000.0); |
| | | } else if (OrderWkType.ORDER_WK_ORDER_OUT_EO.val.equals(params.getType()) |
| | | || OrderWkType.ORDER_WK_ORDER_OUT_SO.val.equals(params.getType())) { |
| | | // 备货指示派工单(EO/SO)出库 |
| | | if (type.equals("add")) { |
| | | orderItem.setAnfme(Math.round(item.getOrder_qty() * 10000) / 10000.0); |
| | | } else { |
| | | orderItem.setAnfme(Math.round(item.getNew_qty() * 10000) / 10000.0); |
| | | } |
| | | } |
| | | } |
| | | orderItem.setMatnr(matnr.getMatnr()); |
| | | orderItem.setMaktx(matnr.getMaktx()); |
| | | orderItem.setBrand(matnr.getBrand()); |
| | | orderItem.setBatch(1 + ""); |
| | | orderItem.setStandby1(item.getPro_id()); |
| | | // 关联上加派工单号+零件代码+供应商代码 |
| | | orderItem.setThreeCode(item.getTotal_serial()); |
| | | // 供应商代码 |
| | | orderItem.setSuppCode(item.getPro_id()); |
| | | orderItem.setCreateTime(new Date()); |
| | | orderItem.setUpdateTime(new Date()); |
| | | orderDetls.add(orderItem); |
| | | }); |
| | | |
| | | orderDetls.forEach(orderDetl -> { |
| | | if (!orderDetlService.insert(orderDetl)) { |
| | | throw new CoolException("订单明细新增失败!!"); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 备货单下发 |
| | | * |
| | | * @param stockUpParams |
| | | * @return com.core.common.R |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:40 |
| | | */ |
| | | @Override |
| | | public XSR getOutDetails(List<StockUpOrderParams> stockUpParams) { |
| | | log.info("备货单下发参数:{}", JSONArray.toJSONString(stockUpParams)); |
| | | |
| | | if (Objects.isNull(stockUpParams)) { |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | stockUpParams.forEach(params -> { |
| | | if (Objects.isNull(params.getDispatch_no())) { |
| | | throw new CoolException("派工单编号不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getKopen_id())) { |
| | | throw new CoolException("流水号不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getCompany_id())) { |
| | | throw new CoolException("公司ID不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getDetails()) || params.getDetails().isEmpty()) { |
| | | throw new CoolException("订单明细不能为空!!"); |
| | | } |
| | | List<OrderItemsParam> items = new ArrayList<>(); |
| | | if (params.getDetails() != null) { |
| | | for (OutOrderParams detail : params.getDetails()) { |
| | | if (detail.getPartList() != null) { |
| | | items.addAll(detail.getPartList()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | params.getDetails().forEach(item -> { |
| | | PubOrderParams pubOrderParams = new PubOrderParams(); |
| | | BeanUtils.copyProperties(params, pubOrderParams); |
| | | pubOrderParams.setType(item.getType()) |
| | | .setPick_no(item.getPick_no()) |
| | | .setCus_address(item.getCus_address()) |
| | | .setOrder_no(item.getOrder_no()) |
| | | .setUpdate_time(params.getUpdate_time()) |
| | | .setCus_id(item.getCus_id()); |
| | | pubOrderParams.setDetails(item.getPartList()); |
| | | addOrUpdateOrders(pubOrderParams, "add"); |
| | | }); |
| | | }); |
| | | |
| | | return XSR.ok("备货单下发成功!!"); |
| | | } |
| | | |
| | | /** |
| | | * 查询WMS库存信息 |
| | | * |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | @Override |
| | | public XSR getStockInfo(List<PageRequestParams> params) { |
| | | if (Objects.isNull(params) || params.isEmpty()) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | List<LocDetl> detls = new ArrayList<>(); |
| | | params.forEach(param -> { |
| | | List<LocDetl> selectList = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("supp_code", param.getPro_id()).eq("matnr", param.getPro_komcode())); |
| | | if (selectList != null && !selectList.isEmpty()) { |
| | | detls.addAll(selectList); |
| | | } |
| | | }); |
| | | |
| | | if (detls == null || detls.isEmpty()) { |
| | | return XSR.ok(); |
| | | } |
| | | List<LocDetlDto> dtos = new ArrayList<>(); |
| | | detls.forEach(item -> { |
| | | LocDetlDto locDetlDto = new LocDetlDto(); |
| | | LocDetl barcode = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("zpallet", item.getZpallet())); |
| | | if (!Objects.isNull(barcode)) { |
| | | BasAreas areas = basAreasService.selectOne(new EntityWrapper<BasAreas>().eq("id", barcode.getAreaId())); |
| | | if (!Objects.isNull(areas)) { |
| | | locDetlDto.setTarget_location(areas.getName()); |
| | | } |
| | | } |
| | | locDetlDto |
| | | .setPro_komcode(item.getMatnr()) |
| | | .setPro_id(item.getStandby1()) |
| | | .setLocation_no(item.getZpallet()); |
| | | dtos.add(locDetlDto); |
| | | }); |
| | | return XSR.ok(dtos); |
| | | } |
| | | |
| | | private String kopen() { |
| | | return url + ":" + port + prefix; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.api.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.api.controller.params.ReceviceTaskParams; |
| | | import com.zy.api.controller.params.WorkTaskParams; |
| | | import com.zy.api.entity.dto.LocMastDto; |
| | | import com.zy.api.service.WcsApiService; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.CompleteParam; |
| | | import com.zy.asrs.entity.result.FindLocNoAttributeVo; |
| | | import com.zy.asrs.enums.ContainerType; |
| | | import com.zy.asrs.enums.LocStsType; |
| | | import com.zy.asrs.enums.TaskIOType; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.service.impl.*; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.constant.MesConstant; |
| | | import com.zy.common.model.LocTypeDto; |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static jdk.nashorn.internal.runtime.regexp.joni.Config.log; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class WcsApiServiceImpl implements WcsApiService { |
| | | |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private WorkService workService; |
| | | @Autowired |
| | | private WrkDetlService wrkDetlService; |
| | | @Autowired |
| | | private MatService matService; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | private RowLastnoService rowLastnoService; |
| | | @Autowired |
| | | private OrderDetlPakoutService orderDetlPakoutService; |
| | | @Autowired |
| | | private WrkMastLogService wrkMastLogService; |
| | | @Autowired |
| | | private WrkDetlLogService wrkDetlLogService; |
| | | @Autowired |
| | | private BasContainerService basContainerService; |
| | | @Autowired |
| | | private BasDevpService basDevpService; |
| | | @Autowired |
| | | private WaitPakinService waitPakinService; |
| | | @Autowired |
| | | private CommonService commonService; |
| | | |
| | | /** |
| | | * 通知WCS锁定库位,及禁止当前库位的一切操作 |
| | | * |
| | | * @param params |
| | | * @return com.core.common.R |
| | | * @author Ryan |
| | | * @date 2026/1/10 11:18 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R lockLocs(ReceviceTaskParams params) { |
| | | // BasDevice basDevice = basDeviceService.selectOne(new EntityWrapper<BasDevice>() |
| | | // .eq("status", 1) |
| | | // .eq("dev_no", params.getDeviceNo())); |
| | | // if (Objects.isNull(basDevice)) { |
| | | // throw new CoolException("机台信息不存在或已禁用!!"); |
| | | // } |
| | | // List<LocAroundBind> binds = locAroundBindService.selectList(new EntityWrapper<LocAroundBind>().eq("dev_no", basDevice.getDevNo())); |
| | | // if (Objects.isNull(binds) || binds.isEmpty()) { |
| | | // throw new CoolException("机台未绑定工作站台!!"); |
| | | // } |
| | | // Set<String> locs = binds.stream().map(LocAroundBind::getBlocNo).collect(Collectors.toSet()); |
| | | // |
| | | // reportLockLocs(locs, "lock"); |
| | | |
| | | return R.ok("上报成功!!"); |
| | | } |
| | | |
| | | // /** |
| | | // * 余料回库 (搬运余料回库) |
| | | // * |
| | | // * @param params |
| | | // * @return com.core.common.R |
| | | // * @author Ryan |
| | | // * @date 2026/1/10 13:19 |
| | | // */ |
| | | // @Override |
| | | // @Transactional(rollbackFor = Exception.class) |
| | | // public R backLocs(WorkTaskParams params) { |
| | | // if (Objects.isNull(params.getWrkNo())) { |
| | | // throw new CoolException("工作号不能为空!!"); |
| | | // } |
| | | //// String wrkCode = params.getTaskNo(); |
| | | //// if (wrkCode.contains("-1")) { |
| | | //// throw new CoolException("配对任务编码错误,请检查后重新上传!!"); |
| | | //// } |
| | | // WrkMast mast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", params.getWrkNo())); |
| | | // if (Objects.isNull(mast)) { |
| | | // throw new CoolException("任务不存在!!"); |
| | | // } |
| | | //// if (!mast.getWrkSts().equals(103L)) { |
| | | //// throw new CoolException("当前任务并非余料出库任务!!"); |
| | | //// } |
| | | //// if (params.getIsSuplus() == 1) { |
| | | //// mast.setIsSuplus(1); |
| | | //// } |
| | | //// |
| | | //// if (!wrkMastService.updateById(mast)) { |
| | | //// throw new CoolException("任务状态更新失败!!"); |
| | | //// } |
| | | // workService.backLocOperation(mast.getWrkNo() + "", mast.getAppeUser()); |
| | | // |
| | | // return R.ok("接收成功,执行回库中..."); |
| | | // } |
| | | |
| | | /** |
| | | * 下发任务至WCS |
| | | * |
| | | * @param params |
| | | * @return com.core.common.R |
| | | * @author Ryan |
| | | * @date 2026/1/10 13:58 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R pubWrkToWcs(WorkTaskParams params) { |
| | | if (Objects.isNull(params.getTaskNo())) { |
| | | return R.error("任务号不能为空!!"); |
| | | } |
| | | String url = MesConstant.PUB_TASK_IN; |
| | | if (!Objects.isNull(params.getType()) && params.getType().equals("out")) { |
| | | url = MesConstant.PUB_TASK_OUT; |
| | | } |
| | | log.info("出库任务下发参数:{}", JSON.toJSONString(params)); |
| | | String response; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(MesConstant.WCS_URL) |
| | | .setPath(url) |
| | | .setJson(JSON.toJSONString(params)) |
| | | .build() |
| | | .doPost(); |
| | | Map<String, Object> result = JSON.parseObject(response, Map.class); |
| | | if (result.get("code").equals(200)) { |
| | | //TODO 上报是否成功 |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", params.getTaskNo())); |
| | | wrkMast.setWrkSts(12L); |
| | | if (!wrkMastService.updateById(wrkMast)) { |
| | | throw new CoolException("更新失败!!"); |
| | | } |
| | | } else { |
| | | throw new CoolException("出库下发任务下发失败---------------->" + result.get("msg")); |
| | | // return R.error().add(result); |
| | | } |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 堆垛机执行状态上报 |
| | | * |
| | | * @param params |
| | | * @return com.core.common.R |
| | | * @author Ryan |
| | | * @date 2026/1/10 16:30 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R receviceTaskFromWcs(ReceviceTaskParams params) { |
| | | if (Objects.isNull(params.getSuperTaskNo())) { |
| | | throw new CoolException("WMS任务号不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getNotifyType())) { |
| | | throw new CoolException("动作类型不能为空!!"); |
| | | } |
| | | WrkMast mast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", params.getSuperTaskNo())); |
| | | if (Objects.isNull(mast)) { |
| | | throw new CoolException("任务档不存在!!"); |
| | | } |
| | | log.info("任务执行参数回写:{}", JSON.toJSONString(params)); |
| | | if (params.getMsgType().equals("task_complete") || params.getMsgType().equals("station_out_task_run_complete")) { |
| | | JSONObject json = JSONObject.parseObject(params.getData()); |
| | | log.info(params.getSuperTaskNo() + "==============>{}", json); |
| | | if (mast.getIoType() == 1 || mast.getIoType() == 11 || mast.getIoType() == 10 || mast.getIoType() == 53 || mast.getIoType() == 54 || mast.getIoType() == 57) { |
| | | if (params.getMsgType().equals("task_complete")) { |
| | | if (mast.getIoType() == 53 && !Objects.isNull(json) && json.getInteger("ioType") == 1) { |
| | | List<WrkDetl> wrkDetls103 = wrkDetlService |
| | | .selectList(new EntityWrapper<WrkDetl>().eq("wrk_no", mast.getWrkNo())); |
| | | if (wrkDetls103.isEmpty()) { |
| | | throw new CoolException("拣料出库 ===>> 更新订单完成数量失败; [workNo=" + mast.getWrkNo()); |
| | | } |
| | | for (WrkDetl wrkDetl : wrkDetls103) { |
| | | // 更新订单完成数量 |
| | | OrderDetlPakout orderDetlPakout = orderDetlPakoutService.selectItem(wrkDetl.getOrderNo(), |
| | | wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), |
| | | wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3()); |
| | | if (orderDetlPakout == null) { |
| | | orderDetlPakout = orderDetlPakoutService.selectItem(wrkDetl.getOrderNo(), |
| | | wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), |
| | | wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3()); |
| | | } |
| | | if (!Cools.isEmpty(orderDetlPakout)) { |
| | | if (!orderDetlPakoutService.increaseQtyByOrderNo(wrkDetl.getOrderNo(), |
| | | wrkDetl.getMatnr(), |
| | | orderDetlPakout.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), |
| | | wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3(), |
| | | wrkDetl.getAnfme())) { |
| | | throw new CoolException("全板出库 ===>> 更新订单完成数量失败; [workNo=" + mast.getWrkNo()); |
| | | } |
| | | } |
| | | } |
| | | mast.setWrkSts(4L); |
| | | } else if ((mast.getIoType() == 54 || mast.getIoType() == 57) && !Objects.isNull(json) && json.getInteger("ioType") == 1 ) { |
| | | mast.setWrkSts(4L); |
| | | } else if (mast.getIoType() != 53 && mast.getIoType() != 54 && mast.getIoType() != 57) { |
| | | mast.setWrkSts(4L); |
| | | } |
| | | } |
| | | } else if (mast.getIoType() == 101 || mast.getIoType() == 110 || mast.getIoType() == 103 || mast.getIoType() == 104 || mast.getIoType() == 107) { |
| | | if (mast.getWrkSts() != 14) { |
| | | //TODO 恢复正常后,这里代码要注释掉 |
| | | // if (mast.getIoType() == 103 || mast.getIoType() == 107) { |
| | | // List<WrkDetl> wrkDetls103 = wrkDetlService |
| | | // .selectList(new EntityWrapper<WrkDetl>().eq("wrk_no", mast.getWrkNo())); |
| | | // if (wrkDetls103.isEmpty()) { |
| | | // throw new CoolException("拣料出库 ===>> 更新订单完成数量失败; [workNo=" + mast.getWrkNo()); |
| | | // } |
| | | // for (WrkDetl wrkDetl : wrkDetls103) { |
| | | // // 更新订单完成数量 |
| | | // OrderDetlPakout orderDetlPakout = orderDetlPakoutService.selectItem(wrkDetl.getOrderNo(), |
| | | // wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), |
| | | // wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | // wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3()); |
| | | // if (orderDetlPakout == null) { |
| | | // orderDetlPakout = orderDetlPakoutService.selectItem(wrkDetl.getOrderNo(), |
| | | // wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), |
| | | // wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | // wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3()); |
| | | // } |
| | | // if (!Cools.isEmpty(orderDetlPakout)) { |
| | | // if (!orderDetlPakoutService.increaseQtyByOrderNo(wrkDetl.getOrderNo(), |
| | | // wrkDetl.getMatnr(), |
| | | // orderDetlPakout.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), |
| | | // wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | // wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3(), |
| | | // wrkDetl.getAnfme())) { |
| | | // throw new CoolException("全板出库 ===>> 更新订单完成数量失败; [workNo=" + mast.getWrkNo()); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | mast.setWrkSts(14L); |
| | | } |
| | | if (!wrkMastService.updateById(mast)) { |
| | | throw new CoolException("任务状态修改失败!!"); |
| | | } |
| | | } else if (params.getMsgType().equals("task_cancel")) { |
| | | //todo 取消任务 |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 獲取庫位信息 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R getLocs(Map<String, String> params) { |
| | | String url = MesConstant.SYN_LOCS; |
| | | String response; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(MesConstant.WCS_URL) |
| | | .setPath(url) |
| | | .setJson(JSON.toJSONString(params)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSONObject.parseObject(response); |
| | | if (jsonObject.get("code").equals(200)) { |
| | | List<LocMastDto> dtos = JSONArray.parseArray(jsonObject.get("data").toString(), LocMastDto.class); |
| | | dtos.forEach(e -> { |
| | | LocMast locMast = new LocMast(); |
| | | BeanUtils.copyProperties(e, locMast); |
| | | locMast.setRow1(e.getRow()); |
| | | locMast.setLev1(e.getLev()); |
| | | locMast.setBay1(e.getBay()); |
| | | System.out.println(JSONObject.toJSON(locMast)); |
| | | if (!locMastService.insert(locMast)) { |
| | | throw new CoolException("库位保存失败!!"); |
| | | } |
| | | }); |
| | | } |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R getStations(Map<String, String> params) { |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 条码站入库申请 |
| | | * |
| | | * @param param |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R combInPub(CompleteParam param, long userId) { |
| | | if (Objects.isNull(param.getBarcode())) { |
| | | throw new CoolException("托盘码不能为空!!"); |
| | | } |
| | | if (Objects.isNull(param.getSourceStaNo())) { |
| | | throw new CoolException("站点不能为空!!"); |
| | | } |
| | | if (Objects.isNull(param.getLocType1())) { |
| | | param.setLocType1((short) 1); |
| | | } |
| | | |
| | | BasContainer container = basContainerService.selectOne(new EntityWrapper<BasContainer>().eq("barcode", param.getBarcode())); |
| | | if (Objects.isNull(container)) { |
| | | throw new CoolException("容器编码未维护,请维护后再操作!!"); |
| | | } |
| | | |
| | | WrkMast barcode = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", param.getBarcode())); |
| | | if (!Objects.isNull(barcode) && (barcode.getIoType() == 104 || barcode.getIoType() == 103 || barcode.getIoType() == 107) && barcode.getWrkSts() == 14L) { |
| | | // |
| | | workService.pickWrkMast(barcode.getWrkNo() + "", userId); |
| | | |
| | | Map<String, Object> response = new HashMap<>(); |
| | | response.put("taskNo", barcode.getWrkNo()); |
| | | response.put("locNo", barcode.getLocNo()); |
| | | response.put("taskPri", barcode.getIoPri()); |
| | | |
| | | return R.ok("任务生成成功").add(response); |
| | | } else { |
| | | log.info("WCS任务生成请求参数:{}", JSONObject.toJSONString(param)); |
| | | |
| | | BasDevp station = basDevpService.selectOne(new EntityWrapper<BasDevp>() |
| | | .eq("dev_no", param.getSourceStaNo())); |
| | | if (Objects.isNull(station)) { |
| | | throw new CoolException("站点不存在!!"); |
| | | } |
| | | Map<String, Object> response = new HashMap<>(); |
| | | |
| | | if (Objects.isNull(barcode)) { |
| | | List<WaitPakin> waitPakins = waitPakinService |
| | | .selectList(new EntityWrapper<WaitPakin>() |
| | | .eq("io_status", "N") |
| | | .eq("zpallet", param.getBarcode())); |
| | | if (Objects.isNull(waitPakins) || waitPakins.isEmpty()) { |
| | | throw new CoolException("数据错误,组拖档已不存在!!"); |
| | | } |
| | | |
| | | WrkMast wrkMast = generateCrnInTask(waitPakins, station, param.getLocType1(), userId); |
| | | |
| | | response.put("taskNo", wrkMast.getWrkNo()); |
| | | response.put("locNo", wrkMast.getLocNo()); |
| | | response.put("taskPri", wrkMast.getIoPri()); |
| | | } else { |
| | | response.put("taskNo", barcode.getWrkNo()); |
| | | response.put("locNo", barcode.getLocNo()); |
| | | response.put("taskPri", barcode.getIoPri()); |
| | | } |
| | | |
| | | return R.ok("任务生成成功").add(response); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 生成堆垛机入库任务 |
| | | * |
| | | * @param station |
| | | * @author Ryan |
| | | * @date 2025/12/9 13:54 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public WrkMast generateCrnInTask(List<WaitPakin> waitPakins, BasDevp station, Short locType, Long userId) { |
| | | Date now = new Date(); |
| | | |
| | | BasDevp sourceStaNo = basDevpService.checkSiteStatus(station.getDevNo(), true); |
| | | sourceStaNo.setLocType1(locType); |
| | | LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo); |
| | | WaitPakin pakin = waitPakins.stream().findFirst().get(); |
| | | FindLocNoAttributeVo findLocNoAttributeVo = new FindLocNoAttributeVo(pakin); |
| | | |
| | | WrkMast mast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", pakin.getZpallet())); |
| | | WrkMast wrkMast = new WrkMast(); |
| | | String locNo; |
| | | if (!Objects.isNull(mast)) { |
| | | if (mast.getIoType().equals(TaskIOType.MERGE_OUT.type) || mast.getIoType().equals(TaskIOType.PICK_OUT.type) || mast.getIoType().equals(TaskIOType.CHECK_OUT.type)) { |
| | | int ioType = mast.getIoType() - 50; |
| | | |
| | | List<WrkDetl> wrkDetls103 = wrkDetlService |
| | | .selectList(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo())); |
| | | if (wrkDetls103.isEmpty()) { |
| | | ioType = 10; |
| | | } |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", wrkMast.getSourceLocNo())); |
| | | if (!Objects.isNull(locDetls) && !locDetls.isEmpty()) { |
| | | Double sum = wrkDetls103.stream().mapToDouble(WrkDetl::getAnfme).sum(); |
| | | Double summed = locDetls.stream().mapToDouble(LocDetl::getAnfme).sum(); |
| | | if (summed.compareTo(sum) <= 0) { |
| | | ioType = 10; |
| | | } |
| | | } |
| | | mast.setIoType(ioType); |
| | | mast.setWrkSts(2L); |
| | | mast.setSourceStaNo(mast.getSourceStaNo()); |
| | | mast.setStaNo(mast.getSourceStaNo()); |
| | | mast.setLocNo(mast.getSourceLocNo()); |
| | | boolean res = wrkMastService.updateById(mast); |
| | | BeanUtils.copyProperties(mast, wrkMast); |
| | | if (!res) { |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | locNo = mast.getLocNo(); |
| | | // 更新源站点信息 |
| | | sourceStaNo.setWrkNo(mast.getWrkNo()); |
| | | sourceStaNo.setModiTime(now); |
| | | if (!basDevpService.updateById(sourceStaNo)) { |
| | | throw new CoolException("更新源站失败"); |
| | | } |
| | | // 更新目标库位状态 |
| | | LocMast locMast = locMastService.selectById(mast.getLocNo()); |
| | | if (locMast.getLocSts().equals("O")) { |
| | | locMast.setLocSts("S"); // S.入库预约 |
| | | locMast.setModiTime(now); |
| | | if (!locMastService.updateById(locMast)) { |
| | | throw new CoolException("改变库位状态失败"); |
| | | } |
| | | } else { |
| | | throw new CoolException(mast.getLocNo() + "目标库位已被占用"); |
| | | } |
| | | } else { |
| | | throw new CoolException("托盘已存在任务档!!"); |
| | | } |
| | | } else { |
| | | StartupDto dto = commonService.getLocNo(1, sourceStaNo.getDevNo(), findLocNoAttributeVo, locTypeDto); |
| | | |
| | | int workNo = dto.getWorkNo(); |
| | | // 生成工作档 |
| | | wrkMast.setWrkNo(workNo); |
| | | wrkMast.setIoTime(new Date()); |
| | | wrkMast.setWrkSts(2L); // 工作状态:生成入库ID |
| | | wrkMast.setIoType(1); // 入出库状态:1.入库 |
| | | wrkMast.setCrnNo(dto.getCrnNo()); |
| | | wrkMast.setSourceStaNo(dto.getSourceStaNo() + ""); |
| | | wrkMast.setStaNo(!Objects.isNull(dto.getStaNo()) ? dto.getStaNo() + "" : null); |
| | | wrkMast.setLocNo(dto.getLocNo()); |
| | | wrkMast.setIoPri(13D); // 优先级 |
| | | wrkMast.setBarcode(pakin.getZpallet()); // 托盘码 |
| | | wrkMast.setFullPlt("Y"); // 满板:Y |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk("N"); // 空板 |
| | | wrkMast.setLinkMis("Y"); |
| | | wrkMast.setModiUser(userId); |
| | | wrkMast.setAppeUser(userId); |
| | | wrkMast.setCtnType(sourceStaNo.getCtnType()); // 容器类型 |
| | | // 操作人员数据 |
| | | wrkMast.setAppeTime(now); |
| | | wrkMast.setModiTime(now); |
| | | boolean res = wrkMastService.insert(wrkMast); |
| | | if (!res) { |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | locNo = dto.getLocNo(); |
| | | // 更新源站点信息 |
| | | sourceStaNo.setWrkNo(workNo); |
| | | sourceStaNo.setModiTime(now); |
| | | if (!basDevpService.updateById(sourceStaNo)) { |
| | | throw new CoolException("更新源站失败"); |
| | | } |
| | | // 更新目标库位状态 |
| | | LocMast locMast = locMastService.selectById(dto.getLocNo()); |
| | | if (locMast.getLocSts().equals("O")) { |
| | | locMast.setLocSts("S"); // S.入库预约 |
| | | locMast.setModiTime(now); |
| | | if (!locMastService.updateById(locMast)) { |
| | | throw new CoolException("改变库位状态失败"); |
| | | } |
| | | } else { |
| | | throw new CoolException(dto.getLocNo() + "目标库位已被占用"); |
| | | } |
| | | } |
| | | |
| | | // 生成工作档明细 |
| | | waitPakins.forEach(waitPakin -> { |
| | | if (!Objects.isNull(waitPakin.getMatnr())) { |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | wrkDetl.sync(waitPakin); |
| | | wrkDetl.setWrkNo(wrkMast.getWrkNo()); |
| | | wrkDetl.setIoTime(wrkMast.getIoTime()); |
| | | wrkDetl.setAppeTime(now); |
| | | wrkDetl.setModiTime(now); |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作明细失败"); |
| | | } |
| | | } else { |
| | | wrkMast.setWrkSts(2L); |
| | | wrkMast.setIoType(10); |
| | | wrkMastService.updateById(wrkMast); |
| | | } |
| | | }); |
| | | |
| | | // 更新入库通知档 ioStatus ===>> Y |
| | | Wrapper<WaitPakin> wrapper = new EntityWrapper<WaitPakin>() |
| | | .eq("zpallet", pakin.getZpallet()); |
| | | |
| | | WaitPakin setParam = new WaitPakin(); |
| | | setParam.setLocNo(locNo); |
| | | setParam.setIoStatus("Y"); |
| | | setParam.setModiTime(now); |
| | | if (!waitPakinService.update(setParam, wrapper)) { |
| | | throw new CoolException("更新通知档失败"); |
| | | } |
| | | |
| | | return wrkMast; |
| | | } |
| | | |
| | | /** |
| | | * WCS申请任务重新分配入库 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R repeatLoc(CompleteParam params) { |
| | | if (Objects.isNull(params.getTaskNo())) { |
| | | return R.error("工作号不能为空!!"); |
| | | } |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", params.getTaskNo())); |
| | | if (Objects.isNull(wrkMast)) { |
| | | WrkMastLog wrkLog = wrkMastLogService.selectOne(new EntityWrapper<WrkMastLog>() |
| | | .eq("loc_no", params.getLocNo()) |
| | | .eq("wrk_no", params.getTaskNo())); |
| | | |
| | | wrkMast = new WrkMast(); |
| | | BeanUtils.copyProperties(wrkLog, wrkMast); |
| | | |
| | | // return R.error("任务档不存在,或已加入历史档"); |
| | | } |
| | | LocMast locMast = locMastService.selectById(wrkMast.getLocNo()); |
| | | if (Objects.isNull(locMast)) { |
| | | return R.error("库位信息不存在!!"); |
| | | } |
| | | |
| | | Integer whsType = Utils.GetWhsType(Integer.parseInt(wrkMast.getSourceStaNo())); |
| | | if (whsType.equals(1)) { |
| | | RowLastno lastno = rowLastnoService.selectById(whsType); |
| | | if (Objects.isNull(lastno)) { |
| | | return R.error("堆垛要策略不存在!!"); |
| | | } |
| | | if (locMast.getRow1().equals(141)) { |
| | | LocMast selectOne = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .ne("row1", 141) |
| | | .ge("crn_no", lastno.getsCrnNo()) |
| | | .le("crn_no", lastno.geteCrnNo()) |
| | | .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type) |
| | | .orderAsc(Arrays.asList("row1", "bay1", "lev1"))); |
| | | if (!Objects.isNull(selectOne)) { |
| | | Map<String, Object> response = new HashMap<>(); |
| | | response.put("locNo", selectOne.getLocNo()); |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", wrkMast.getLocNo())); |
| | | locDetls.forEach(locDetl -> { |
| | | String locNo = locDetl.getLocNo(); |
| | | locDetl.setLocNo(selectOne.getLocNo()); |
| | | if (!locDetlService.update(locDetl, new EntityWrapper<LocDetl>() |
| | | .eq("loc_no", locNo) |
| | | .eq("supp_code", locDetl.getSuppCode()) |
| | | .eq("matnr", locDetl.getMatnr()))) { |
| | | throw new CoolException("库位更新失败!!"); |
| | | } |
| | | }); |
| | | |
| | | //新库位预约入库 |
| | | selectOne.setBarcode(locMast.getBarcode()); |
| | | selectOne.setLocSts(LocStsType.LOC_STS_TYPE_F.type); |
| | | locMastService.updateById(selectOne); |
| | | |
| | | wrkMast.setLocNo(selectOne.getLocNo()); |
| | | wrkMast.setWrkSts(2L); |
| | | wrkMast.setBarcode(locMast.getBarcode()); |
| | | wrkMastService.updateById(wrkMast); |
| | | |
| | | |
| | | //原库位置空 |
| | | locMast.setLocSts(LocStsType.LOC_STS_TYPE_O.type); |
| | | locMast.setBarcode(null); |
| | | locMastService.updateById(locMast); |
| | | |
| | | return R.ok().add(response); |
| | | } else { |
| | | return R.error("暂无可用库位!!"); |
| | | } |
| | | } else { |
| | | LocMast selectOne = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("crn_no", wrkMast.getCrnNo()) |
| | | .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type) |
| | | .orderAsc(Arrays.asList("row1", "bay1", "lev1"))); |
| | | if (!Objects.isNull(selectOne)) { |
| | | Map<String, Object> response = new HashMap<>(); |
| | | response.put("locNo", selectOne.getLocNo()); |
| | | |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", wrkMast.getLocNo())); |
| | | locDetls.forEach(locDetl -> { |
| | | String locNo = locDetl.getLocNo(); |
| | | locDetl.setLocNo(selectOne.getLocNo()); |
| | | if (!locDetlService.update(locDetl, new EntityWrapper<LocDetl>() |
| | | .eq("loc_no", locNo) |
| | | .eq("supp_code", locDetl.getSuppCode()) |
| | | .eq("matnr", locDetl.getMatnr()))) { |
| | | throw new CoolException("库位更新失败!!"); |
| | | } |
| | | }); |
| | | |
| | | //新库位预约入库 |
| | | selectOne.setBarcode(locMast.getBarcode()); |
| | | selectOne.setLocSts(LocStsType.LOC_STS_TYPE_F.type); |
| | | locMastService.updateById(selectOne); |
| | | |
| | | wrkMast.setLocNo(selectOne.getLocNo()); |
| | | wrkMast.setWrkSts(2L); |
| | | wrkMast.setBarcode(locMast.getBarcode()); |
| | | wrkMastService.updateById(wrkMast); |
| | | |
| | | |
| | | //原库位置空 |
| | | locMast.setLocSts(LocStsType.LOC_STS_TYPE_O.type); |
| | | locMast.setBarcode(null); |
| | | locMastService.updateById(locMast); |
| | | |
| | | return R.ok().add(response); |
| | | } else { |
| | | return R.error("暂无可用库位!!"); |
| | | } |
| | | } |
| | | } else { |
| | | LocMast selectOne = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("crn_no", wrkMast.getCrnNo()) |
| | | .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type) |
| | | .orderAsc(Arrays.asList("row1", "bay1", "lev1"))); |
| | | if (!Objects.isNull(selectOne)) { |
| | | Map<String, Object> response = new HashMap<>(); |
| | | response.put("locNo", selectOne.getLocNo()); |
| | | |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", wrkMast.getLocNo())); |
| | | locDetls.forEach(locDetl -> { |
| | | String locNo = locDetl.getLocNo(); |
| | | locDetl.setLocNo(selectOne.getLocNo()); |
| | | if (!locDetlService.update(locDetl, new EntityWrapper<LocDetl>() |
| | | .eq("loc_no", locNo) |
| | | .eq("supp_code", locDetl.getSuppCode()) |
| | | .eq("matnr", locDetl.getMatnr()))) { |
| | | throw new CoolException("库位更新失败!!"); |
| | | } |
| | | }); |
| | | |
| | | //新库位预约入库 |
| | | selectOne.setBarcode(locMast.getBarcode()); |
| | | selectOne.setLocSts(LocStsType.LOC_STS_TYPE_F.type); |
| | | locMastService.updateById(selectOne); |
| | | |
| | | wrkMast.setLocNo(selectOne.getLocNo()); |
| | | wrkMast.setWrkSts(2L); |
| | | wrkMast.setBarcode(locMast.getBarcode()); |
| | | wrkMastService.updateById(wrkMast); |
| | | |
| | | |
| | | //原库位置空 |
| | | locMast.setLocSts(LocStsType.LOC_STS_TYPE_O.type); |
| | | locMast.setBarcode(null); |
| | | locMastService.updateById(locMast); |
| | | |
| | | return R.ok().add(response); |
| | | } else { |
| | | return R.error("暂无可用库位!!"); |
| | | } |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.BasStationDetl; |
| | | import com.zy.asrs.service.BasStationDetlService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class BasStationDetlController extends BaseController { |
| | | |
| | | @Autowired |
| | | private BasStationDetlService basStationDetlService; |
| | | |
| | | @RequestMapping(value = "/basStationDetl/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(basStationDetlService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basStationDetl/list/auth") |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<BasStationDetl> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(basStationDetlService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else { |
| | | wrapper.like(entry.getKey(), val); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/basStationDetl/add/auth") |
| | | @ManagerAuth |
| | | public R add(BasStationDetl basStationDetl) { |
| | | basStationDetlService.insert(basStationDetl); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basStationDetl/update/auth") |
| | | @ManagerAuth |
| | | public R update(BasStationDetl basStationDetl){ |
| | | if (Cools.isEmpty(basStationDetl) || null==basStationDetl.getId()){ |
| | | return R.error(); |
| | | } |
| | | basStationDetlService.updateById(basStationDetl); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basStationDetl/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | basStationDetlService.deleteById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basStationDetl/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<BasStationDetl> wrapper = new EntityWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("basStationDetl")); |
| | | convert(map, wrapper); |
| | | List<BasStationDetl> list = basStationDetlService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basStationDetlQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<BasStationDetl> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<BasStationDetl> page = basStationDetlService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasStationDetl basStationDetl : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", basStationDetl.getId()); |
| | | map.put("value", basStationDetl.getId()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basStationDetl/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasStationDetl> wrapper = new EntityWrapper<BasStationDetl>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basStationDetlService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasStationDetl.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.annotations.AppAuth; |
| | | import com.core.common.*; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.param.MatSyncParam; |
| | | import com.zy.asrs.entity.param.OpenOrderCompleteParam; |
| | | import com.zy.asrs.entity.param.OpenOrderPakinParam; |
| | | import com.zy.asrs.entity.param.OpenOrderPakoutParam; |
| | | import com.zy.asrs.service.OpenService; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.AxisBean; |
| | | import com.zy.asrs.entity.param.*; |
| | | import com.zy.asrs.mapper.ReportQueryMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.model.DetlDto; |
| | | import com.zy.common.web.BaseController; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * Created by vincent on 2022/4/8 |
| | |
| | | |
| | | @Autowired |
| | | private OpenService openService; |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private WorkService workService; |
| | | @Autowired |
| | | private WrkDetlService wrkDetlService; |
| | | @Autowired |
| | | private ReportQueryMapper reportQueryMapper; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | private MatService matService; |
| | | @Autowired |
| | | private WaitPakinService waitPakinService; |
| | | @Autowired |
| | | private BasStationService basStationService; |
| | | @Autowired |
| | | private BasStationDetlService basStationDetlService; |
| | | |
| | | @PostMapping("/order/matSync/default/v2") |
| | | // @AppAuth(memo = "商品信息同步接口") |
| | | public synchronized R syncMatInfoV2(@RequestHeader(required = false) String appkey, |
| | | @RequestBody(required = false) MatSyncParam.MatParam param, |
| | | HttpServletRequest request) { |
| | | |
| | | auth(appkey, param, request); |
| | | /** |
| | | * 组托查询接口 |
| | | */ |
| | | @PostMapping("/queryComb") |
| | | public synchronized R queryComb(@RequestBody QueryCombParam param) { |
| | | if (Cools.isEmpty(param)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | MatSyncParam matSyncParam = new MatSyncParam(); |
| | | List<MatSyncParam.MatParam> objects = new ArrayList<>(); |
| | | objects.add(param); |
| | | matSyncParam.matDetails = objects; |
| | | openService.syncMat(matSyncParam); |
| | | return R.ok(); |
| | | if (Cools.isEmpty(param.getBarcode())) { |
| | | return R.error("托盘码[barcode]不能为空"); |
| | | } |
| | | |
| | | List<WaitPakin> waitPakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode())); |
| | | |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("barcode", param.getBarcode()); |
| | | map.put("combDetls", waitPakins); |
| | | return R.ok().add(map); |
| | | } |
| | | |
| | | /** |
| | | * 任务查询接口 |
| | | */ |
| | | @PostMapping("/queryTask") |
| | | public synchronized R queryTask(@RequestBody QueryTaskParam param) { |
| | | if (Cools.isEmpty(param)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | |
| | | if (param.getTaskType().equals("crn")) { |
| | | if (Cools.isEmpty(param.getTaskNo())) { |
| | | return R.error("任务号[taskNo]不能为空"); |
| | | } |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no",param.getTaskNo())); |
| | | if (wrkMast == null) { |
| | | return R.error("任务不存在"); |
| | | } |
| | | |
| | | List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(Integer.valueOf(param.getTaskNo())); |
| | | map.put("taskNo", param.getTaskNo()); |
| | | map.put("ioType", wrkMast.getIoType()); |
| | | map.put("wrkDetls", wrkDetls); |
| | | } else { |
| | | BasStation basStation = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", param.getAgvSite())); |
| | | if (Objects.isNull(basStation)) { |
| | | return R.error("站点不存在,请联系管理员检查站点信息!!"); |
| | | } |
| | | List<BasStationDetl> basStationDetls = basStationDetlService.selectList(new EntityWrapper<BasStationDetl>().eq("dev_no", param.getAgvSite())); |
| | | map.put("taskNo", param.getAgvSite()); |
| | | map.put("ioType", 1); |
| | | map.put("wrkDetls", basStationDetls); |
| | | } |
| | | return R.ok().add(map); |
| | | } |
| | | |
| | | /** |
| | | * 库存信息查询接口 |
| | | */ |
| | | @GetMapping("/queryLoc") |
| | | public synchronized R queryLoc() { |
| | | List<Map<String, Object>> pie = new ArrayList<>(); |
| | | LocChartPie locUseRate = reportQueryMapper.getLocUseRate(); |
| | | |
| | | if (locUseRate != null) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("name", "在库"); |
| | | map.put("value", locUseRate.getFqty()); |
| | | pie.add(map); |
| | | |
| | | Map<String, Object> map1 = new HashMap<>(); |
| | | map1.put("name", "空"); |
| | | map1.put("value", locUseRate.getOqty()); |
| | | pie.add(map1); |
| | | |
| | | Map<String, Object> map2 = new HashMap<>(); |
| | | map2.put("name", "使用"); |
| | | map2.put("value", locUseRate.getUqty()); |
| | | pie.add(map2); |
| | | |
| | | Map<String, Object> map3 = new HashMap<>(); |
| | | map3.put("name", "禁用"); |
| | | map3.put("value", locUseRate.getXqty()); |
| | | pie.add(map3); |
| | | } |
| | | |
| | | // 总库位数 |
| | | Integer total = (int) Arith.add(0, locUseRate.getFqty(), locUseRate.getOqty(), locUseRate.getUqty(), locUseRate.getXqty()); |
| | | // 使用中 |
| | | Integer used = locUseRate.getFqty() + locUseRate.getUqty(); |
| | | // 库位使用率 |
| | | double usedDivides = Arith.divides(3, used, total); |
| | | double usedPr = Arith.multiplys(1, usedDivides, 100); |
| | | |
| | | return R.ok( |
| | | Cools.add("pie", pie) |
| | | .add("stockCount", locUseRate.getFqty()) |
| | | .add("emptyCount", locUseRate.getOqty()) |
| | | .add("disableCount", locUseRate.getXqty()) |
| | | .add("total", total) |
| | | .add("used", used) |
| | | .add("usedPr", usedPr) |
| | | ); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/line/charts") |
| | | public R locIoLineCharts(){ |
| | | Map<String,Object> map=new HashMap<String, Object>(); |
| | | List<com.zy.asrs.entity.AxisBean> list = new ArrayList<AxisBean>(); |
| | | |
| | | List<WorkChartAxis> listChart = reportQueryMapper.getChartAxis(); |
| | | |
| | | if(listChart!=null) { |
| | | ArrayList<Integer> data1 = new ArrayList<Integer>(); |
| | | ArrayList<Integer> data2 = new ArrayList<Integer>(); |
| | | |
| | | SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.add(Calendar.DATE, -12); |
| | | for(int i=0;i<12;i++) { |
| | | boolean flag = true; |
| | | calendar.add(Calendar.DATE, 1); |
| | | String str = sf.format(calendar.getTime()); |
| | | for(WorkChartAxis workChart : listChart) { |
| | | if(str.equals(workChart.getYmd())) { |
| | | data1.add(workChart.getInqty()); |
| | | data2.add(workChart.getOutqty()); |
| | | flag = false; |
| | | break; |
| | | } |
| | | } |
| | | if(flag) { |
| | | data1.add(0); |
| | | data2.add(0); |
| | | } |
| | | } |
| | | AxisBean inqty = new AxisBean(); |
| | | inqty.setName("入库数量"); |
| | | Integer[] array1 = new Integer[data1.size()]; |
| | | inqty.setData(data1.toArray(array1)); |
| | | list.add(inqty); |
| | | AxisBean outqty = new AxisBean(); |
| | | outqty.setName("出库数量"); |
| | | Integer[] array2 = new Integer[data2.size()]; |
| | | outqty.setData(data2.toArray(array2)); |
| | | list.add(outqty); |
| | | } |
| | | map.put("rows",list); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | @GetMapping("/locDetl/statistics") |
| | | public R locDetlStatistics(){ |
| | | HashMap<String, Object> param = new HashMap<>(); |
| | | Page<LocDetl> stockStatis = locDetlService.getStockStatis(toPage(1, 100, param, LocDetl.class)); |
| | | for (LocDetl locDetl : stockStatis.getRecords()) { |
| | | Mat mat = matService.selectByMatnr(locDetl.getMatnr()); |
| | | if (mat != null) { |
| | | locDetl.sync(mat); |
| | | } |
| | | } |
| | | return R.ok(stockStatis); |
| | | } |
| | | |
| | | @PostMapping("/order/matSync/default/v1") |
| | | // @AppAuth(memo = "商品信息同步接口") |
| | | @AppAuth(memo = "商品信息同步接口") |
| | | public synchronized R syncMatInfo(@RequestHeader(required = false) String appkey, |
| | | @RequestBody(required = false) MatSyncParam param, |
| | | HttpServletRequest request) { |
| | |
| | | /** |
| | | * 入库单回写 |
| | | */ |
| | | // @PostMapping("/order/pakin/complete/default/v1") |
| | | @PostMapping("/order/pakin/complete/default/v1") |
| | | public synchronized R orderPakinComplete(@RequestHeader(required = false) String appkey, |
| | | @RequestBody(required = false) OpenOrderCompleteParam param, |
| | | HttpServletRequest request) { |
| | |
| | | if (Cools.isEmpty(param)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | if (Cools.isEmpty(param.getLgort())) { |
| | | return R.error("单据编号[lgort]不能为空"); |
| | | } |
| | | if (!param.getLgort().equals("5006")) { |
| | | return R.ok(); |
| | | } |
| | | if (Cools.isEmpty(param.getOrderNo())) { |
| | | return R.error("单据编号[orderNo]不能为空"); |
| | | } |
| | |
| | | /** |
| | | * 出库单回写 |
| | | */ |
| | | // @PostMapping("/order/pakout/complete/default/v1") |
| | | @PostMapping("/order/pakout/complete/default/v1") |
| | | public synchronized R orderPakoutComplete(@RequestHeader(required = false) String appkey, |
| | | @RequestBody(required = false) OpenOrderCompleteParam param, |
| | | HttpServletRequest request) { |
| | |
| | | System.out.println(JSON.toJSONString(param1)); |
| | | } |
| | | |
| | | /*********************************同步物料档案和订单****************************************************/ |
| | | |
| | | /*********************************wcs接口对接****************************************************/ |
| | | |
| | | /** |
| | | * 任务开始 |
| | | */ |
| | | @RequestMapping("/start/task") |
| | | public HashMap<String, Object> startTask(@RequestBody HashMap<String, Object> map) { |
| | | String taskNo = map.get("TaskNo") + ""; |
| | | HashMap<String, Object> map1 = new HashMap<>(); |
| | | if (Cools.isEmpty(taskNo)) { |
| | | map1.put("ReturnStatus", "1"); |
| | | map1.put("ErrorMessage", "任务号为空"); |
| | | } else { |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", Integer.valueOf(taskNo))); |
| | | if (wrkMast == null) { |
| | | map1.put("ReturnStatus", "1"); |
| | | map1.put("ErrorMessage", "没有找到该任务号:" + taskNo); |
| | | } else { |
| | | if (wrkMast.getIoType() == 1||wrkMast.getIoType() == 57|| wrkMast.getIoType() == 53) { |
| | | wrkMast.setWrkSts(3L);//入库开始 |
| | | } else if (wrkMast.getIoType() == 11 ||wrkMast.getIoType() == 107|| wrkMast.getIoType() == 103 ) { |
| | | wrkMast.setWrkSts(13L);//出库开始 |
| | | } |
| | | wrkMast.setModiTime(new Date()); |
| | | if (wrkMastService.updateById(wrkMast)) { |
| | | log.info("WMS任务开始更新"+wrkMast); |
| | | map1.put("ReturnStatus", "0"); |
| | | map1.put("ErrorMessage", ""); |
| | | } else { |
| | | map1.put("ReturnStatus", "1"); |
| | | map1.put("ErrorMessage", "更新任务状态失败" + wrkMast); |
| | | } |
| | | } |
| | | } |
| | | return map1; |
| | | } |
| | | |
| | | /** |
| | | * 搬运到目的地 |
| | | */ |
| | | @RequestMapping("/destination/task") |
| | | public HashMap<String, Object> destinationTask(@RequestBody HashMap<String, Object> map) { |
| | | String taskNo = map.get("TaskNo") + ""; |
| | | HashMap<String, Object> map1 = new HashMap<>(); |
| | | if (Cools.isEmpty(taskNo)) { |
| | | map1.put("ReturnStatus", "1"); |
| | | map1.put("ErrorMessage", "任务号为空"); |
| | | } else { |
| | | //任务完成 |
| | | if (map.get("Result").equals(1)) { |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", Integer.valueOf(taskNo))); |
| | | if (wrkMast == null) { |
| | | map1.put("ReturnStatus", "1"); |
| | | map1.put("ErrorMessage", "没有找到该任务号:" + taskNo); |
| | | } else { |
| | | if (wrkMast.getIoType() == 1 || wrkMast.getIoType() == 10) { |
| | | wrkMast.setWrkSts(4L);//任务结束 |
| | | } else if (wrkMast.getIoType() == 101) { |
| | | wrkMast.setWrkSts(13L);//出库到站点上 |
| | | } else if (wrkMast.getIoType() == 53 || wrkMast.getIoType() == 57) { |
| | | wrkMast.setWrkSts(4L);//4.任务结束 |
| | | } else if (wrkMast.getIoType() == 103 || wrkMast.getIoType() == 107 || wrkMast.getIoType() == 110) { |
| | | wrkMast.setWrkSts(14L); |
| | | }else if(wrkMast.getIoType() == 11) { |
| | | wrkMast.setWrkSts(4L); |
| | | } |
| | | wrkMast.setModiTime(new Date()); |
| | | if (wrkMastService.update(wrkMast,new EntityWrapper<WrkMast>().eq("wrk_no",wrkMast.getWrkNo()))) { |
| | | log.info("WMS任务完成更新"+wrkMast); |
| | | map1.put("ReturnStatus", "0"); |
| | | map1.put("ErrorMessage", ""); |
| | | } else { |
| | | map1.put("ReturnStatus", "1"); |
| | | map1.put("ErrorMessage", "更新任务状态失败" + wrkMast); |
| | | } |
| | | } |
| | | } else { |
| | | //任务取消 |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", Integer.valueOf(taskNo))); |
| | | if (wrkMast == null) { |
| | | map1.put("ReturnStatus", "1"); |
| | | map1.put("ErrorMessage", "没有找到该任务号:" + taskNo); |
| | | return map1; |
| | | } |
| | | workService.cancelWrkMast(String.valueOf(wrkMast.getWrkNo()),9999L); |
| | | map1.put("ReturnStatus", "0"); |
| | | map1.put("ErrorMessage", ""); |
| | | } |
| | | } |
| | | return map1; |
| | | } |
| | | |
| | | /** |
| | | * 出库---目的地搬离 |
| | | */ |
| | | @RequestMapping("/leave/task") |
| | | public R leaveTask(@RequestBody HashMap<String, Object> map) { |
| | | String taskNo = String.valueOf(map.get("taskNo")); |
| | | String status = String.valueOf(map.get("status")); |
| | | HashMap<String, Object> map1 = new HashMap<>(); |
| | | if (Cools.isEmpty(taskNo)) { |
| | | return R.error("任务号为空"); |
| | | } else { |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", Integer.valueOf(taskNo))); |
| | | if (wrkMast == null) { |
| | | return R.error("没有找到该任务号:" + taskNo); |
| | | } |
| | | |
| | | if (status.equals("complete")) { |
| | | // 入库 + 库位转移 |
| | | if (wrkMast.getWrkSts() < 4 || (wrkMast.getWrkSts() > 10 && wrkMast.getIoType()==11)) { |
| | | wrkMast.setWrkSts(4L); |
| | | // 出库 |
| | | } else if (wrkMast.getWrkSts() > 10) { |
| | | wrkMast.setWrkSts(14L); |
| | | } |
| | | Date now = new Date(); |
| | | wrkMast.setWrkSts(14L);//出库到站点上 |
| | | wrkMast.setCrnStrTime(DateUtils.calculate(now, 1L, TimeUnit.SECONDS, true)); |
| | | wrkMast.setCrnEndTime(now); |
| | | wrkMast.setModiTime(now); |
| | | wrkMastService.updateById(wrkMast); |
| | | |
| | | return R.ok(); |
| | | } else if (status.equals("cancel")) { |
| | | workService.cancelWrkMast(taskNo, 9527L); |
| | | return R.ok(); |
| | | } |
| | | } |
| | | return R.error(); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | 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.service.MatService; |
| | | import com.zy.system.service.UserService; |
| | | import com.zy.system.entity.User; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import lombok.experimental.Accessors; |
| | | 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 io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("agv_bas_station_detl") |
| | | @Accessors(chain = true) |
| | | public class BasStationDetl implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 站点编码 |
| | | */ |
| | | @ApiModelProperty(value= "站点编码") |
| | | @TableField("dev_no") |
| | | private String devNo; |
| | | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | @ApiModelProperty(value= "数量") |
| | | private Double anfme; |
| | | |
| | | @ApiModelProperty("执行中数量") |
| | | private Double workQty; |
| | | |
| | | /** |
| | | * 托盘条码 |
| | | */ |
| | | @ApiModelProperty(value= "托盘条码") |
| | | private String zpallet; |
| | | |
| | | /** |
| | | * 商品编号 |
| | | */ |
| | | @ApiModelProperty(value= "商品编号") |
| | | private String matnr; |
| | | |
| | | /** |
| | | * 商品名称 |
| | | */ |
| | | @ApiModelProperty(value= "商品名称") |
| | | private String maktx; |
| | | |
| | | /** |
| | | * 批号 |
| | | */ |
| | | @ApiModelProperty(value= "批号") |
| | | private String batch; |
| | | |
| | | /** |
| | | * 单据编号 |
| | | */ |
| | | @ApiModelProperty(value= "单据编号") |
| | | @TableField("order_no") |
| | | private String orderNo; |
| | | |
| | | /** |
| | | * 规格 |
| | | */ |
| | | @ApiModelProperty(value= "规格") |
| | | private String specs; |
| | | |
| | | /** |
| | | * 型号 |
| | | */ |
| | | @ApiModelProperty(value= "型号") |
| | | private String model; |
| | | |
| | | /** |
| | | * 颜色 |
| | | */ |
| | | @ApiModelProperty(value= "颜色") |
| | | private String color; |
| | | |
| | | /** |
| | | * 品牌 |
| | | */ |
| | | @ApiModelProperty(value= "品牌") |
| | | private String brand; |
| | | |
| | | /** |
| | | * 单位 |
| | | */ |
| | | @ApiModelProperty(value= "单位") |
| | | private String unit; |
| | | |
| | | /** |
| | | * 单价 |
| | | */ |
| | | @ApiModelProperty(value= "单价") |
| | | private Double price; |
| | | |
| | | /** |
| | | * sku |
| | | */ |
| | | @ApiModelProperty(value= "sku") |
| | | private String sku; |
| | | |
| | | /** |
| | | * 单位量 |
| | | */ |
| | | @ApiModelProperty(value= "单位量") |
| | | private Double units; |
| | | |
| | | /** |
| | | * 条码 |
| | | */ |
| | | @ApiModelProperty(value= "条码") |
| | | private String barcode; |
| | | |
| | | /** |
| | | * 产地 |
| | | */ |
| | | @ApiModelProperty(value= "产地") |
| | | private String origin; |
| | | |
| | | /** |
| | | * 厂家 |
| | | */ |
| | | @ApiModelProperty(value= "厂家") |
| | | private String manu; |
| | | |
| | | /** |
| | | * 生产日期 |
| | | */ |
| | | @ApiModelProperty(value= "生产日期") |
| | | @TableField("manu_date") |
| | | private String manuDate; |
| | | |
| | | /** |
| | | * 品项数 |
| | | */ |
| | | @ApiModelProperty(value= "品项数") |
| | | @TableField("item_num") |
| | | private String itemNum; |
| | | |
| | | /** |
| | | * 安全库存量 |
| | | */ |
| | | @ApiModelProperty(value= "安全库存量") |
| | | @TableField("safe_qty") |
| | | private Double safeQty; |
| | | |
| | | /** |
| | | * 重量 |
| | | */ |
| | | @ApiModelProperty(value= "重量") |
| | | private Double weight; |
| | | |
| | | /** |
| | | * 长度 |
| | | */ |
| | | @ApiModelProperty(value= "长度") |
| | | @TableField("man_length") |
| | | private Double manLength; |
| | | |
| | | /** |
| | | * 体积 |
| | | */ |
| | | @ApiModelProperty(value= "体积") |
| | | private Double volume; |
| | | |
| | | /** |
| | | * 三方编码 |
| | | */ |
| | | @ApiModelProperty(value= "三方编码") |
| | | @TableField("three_code") |
| | | private String threeCode; |
| | | |
| | | /** |
| | | * 供应商 |
| | | */ |
| | | @ApiModelProperty(value= "供应商") |
| | | private String supp; |
| | | |
| | | /** |
| | | * 供应商编码 |
| | | */ |
| | | @ApiModelProperty(value= "供应商编码") |
| | | @TableField("supp_code") |
| | | private String suppCode; |
| | | |
| | | /** |
| | | * 是否批次 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "是否批次 1: 是 0: 否 ") |
| | | @TableField("be_batch") |
| | | private Integer beBatch; |
| | | |
| | | /** |
| | | * 保质期 |
| | | */ |
| | | @ApiModelProperty(value= "保质期") |
| | | @TableField("dead_time") |
| | | private String deadTime; |
| | | |
| | | /** |
| | | * 预警天数 |
| | | */ |
| | | @ApiModelProperty(value= "预警天数") |
| | | @TableField("dead_warn") |
| | | private Integer deadWarn; |
| | | |
| | | /** |
| | | * 制购 1: 制造 2: 采购 3: 外协 |
| | | */ |
| | | @ApiModelProperty(value= "制购 1: 制造 2: 采购 3: 外协 ") |
| | | private Integer source; |
| | | |
| | | /** |
| | | * 要求检验 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "要求检验 1: 是 0: 否 ") |
| | | private Integer inspect; |
| | | |
| | | /** |
| | | * 危险品 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "危险品 1: 是 0: 否 ") |
| | | private Integer danger; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | @TableField("modi_user") |
| | | private Long modiUser; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @TableField("modi_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date modiTime; |
| | | |
| | | /** |
| | | * 添加人员 |
| | | */ |
| | | @ApiModelProperty(value= "添加人员") |
| | | @TableField("appe_user") |
| | | private Long appeUser; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @ApiModelProperty(value= "添加时间") |
| | | @TableField("appe_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date appeTime; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("line_number") |
| | | private Long lineNumber; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | private String standby1; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | private String standby2; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | private String standby3; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("box_type1") |
| | | private String boxType1; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("box_type2") |
| | | private String boxType2; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("box_type3") |
| | | private String boxType3; |
| | | |
| | | public BasStationDetl() {} |
| | | |
| | | public BasStationDetl(Long id,String devNo,Double anfme,String zpallet,String matnr,String maktx,String batch,String orderNo,String specs,String model,String color,String brand,String unit,Double price,String sku,Double units,String barcode,String origin,String manu,String manuDate,String itemNum,Double safeQty,Double weight,Double manLength,Double volume,String threeCode,String supp,String suppCode,Integer beBatch,String deadTime,Integer deadWarn,Integer source,Integer inspect,Integer danger,Long modiUser,Date modiTime,Long appeUser,Date appeTime,String memo,Long lineNumber,String standby1,String standby2,String standby3,String boxType1,String boxType2,String boxType3) { |
| | | this.id = id; |
| | | this.devNo = devNo; |
| | | this.anfme = anfme; |
| | | this.zpallet = zpallet; |
| | | this.matnr = matnr; |
| | | this.maktx = maktx; |
| | | this.batch = batch; |
| | | this.orderNo = orderNo; |
| | | this.specs = specs; |
| | | this.model = model; |
| | | this.color = color; |
| | | this.brand = brand; |
| | | this.unit = unit; |
| | | this.price = price; |
| | | this.sku = sku; |
| | | this.units = units; |
| | | this.barcode = barcode; |
| | | this.origin = origin; |
| | | this.manu = manu; |
| | | this.manuDate = manuDate; |
| | | this.itemNum = itemNum; |
| | | this.safeQty = safeQty; |
| | | this.weight = weight; |
| | | this.manLength = manLength; |
| | | this.volume = volume; |
| | | this.threeCode = threeCode; |
| | | this.supp = supp; |
| | | this.suppCode = suppCode; |
| | | this.beBatch = beBatch; |
| | | this.deadTime = deadTime; |
| | | this.deadWarn = deadWarn; |
| | | this.source = source; |
| | | this.inspect = inspect; |
| | | this.danger = danger; |
| | | this.modiUser = modiUser; |
| | | this.modiTime = modiTime; |
| | | this.appeUser = appeUser; |
| | | this.appeTime = appeTime; |
| | | this.memo = memo; |
| | | this.lineNumber = lineNumber; |
| | | this.standby1 = standby1; |
| | | this.standby2 = standby2; |
| | | this.standby3 = standby3; |
| | | this.boxType1 = boxType1; |
| | | this.boxType2 = boxType2; |
| | | this.boxType3 = boxType3; |
| | | } |
| | | |
| | | // BasStationDetl basStationDetl = new BasStationDetl( |
| | | // null, // [非空] |
| | | // null, // 站点编码[非空] |
| | | // null, // 数量 |
| | | // 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, // |
| | | // null, // |
| | | // null, // |
| | | // null, // |
| | | // null, // |
| | | // null, // |
| | | // null // |
| | | // ); |
| | | |
| | | public String getBeBatch$(){ |
| | | if (null == this.beBatch){ return null; } |
| | | switch (this.beBatch){ |
| | | case 1: |
| | | return "是"; |
| | | case 0: |
| | | return "否"; |
| | | default: |
| | | return String.valueOf(this.beBatch); |
| | | } |
| | | } |
| | | |
| | | public String getSource$(){ |
| | | if (null == this.source){ return null; } |
| | | switch (this.source){ |
| | | case 1: |
| | | return "制造"; |
| | | case 2: |
| | | return "采购"; |
| | | case 3: |
| | | return "外协"; |
| | | default: |
| | | return String.valueOf(this.source); |
| | | } |
| | | } |
| | | |
| | | public String getInspect$(){ |
| | | if (null == this.inspect){ return null; } |
| | | switch (this.inspect){ |
| | | case 1: |
| | | return "是"; |
| | | case 0: |
| | | return "否"; |
| | | default: |
| | | return String.valueOf(this.inspect); |
| | | } |
| | | } |
| | | |
| | | public String getTag$() { |
| | | MatService service = SpringUtils.getBean(MatService.class); |
| | | Mat order = service.selectOne(new EntityWrapper<Mat>() |
| | | .eq("supp_code", this.suppCode) |
| | | .eq("matnr", this.matnr)); |
| | | if (Cools.isEmpty(order)){ |
| | | return null; |
| | | } |
| | | return order.getTagId$(); |
| | | } |
| | | |
| | | public String getDanger$(){ |
| | | if (null == this.danger){ return null; } |
| | | switch (this.danger){ |
| | | case 1: |
| | | return "是"; |
| | | case 0: |
| | | return "否"; |
| | | default: |
| | | return String.valueOf(this.danger); |
| | | } |
| | | } |
| | | |
| | | public String getModiUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.modiUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getModiTime$(){ |
| | | if (Cools.isEmpty(this.modiTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.modiTime); |
| | | } |
| | | |
| | | public String getAppeUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.appeUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getAppeTime$(){ |
| | | if (Cools.isEmpty(this.appeTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.appeTime); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class CompleteParam implements Serializable { |
| | | |
| | | private String barcode; |
| | | |
| | | // 库位规格( 0:未知, 1:低库位, 2:高库位) |
| | | private Short locType1; |
| | | |
| | | //站點 |
| | | private String sourceStaNo; |
| | | |
| | | //源库位 |
| | | private String sourceLocNo; |
| | | |
| | | //目标库位 |
| | | private String locNo; |
| | | |
| | | private String taskNo; |
| | | |
| | | //任务号 |
| | | private String workNo; |
| | | |
| | | //可用排 |
| | | private List<Integer> rowList; |
| | | |
| | | private String carBarcode; |
| | | |
| | | private Integer IoType; |
| | | |
| | | } |
| | |
| | | @TableField("move_status") |
| | | private Integer moveStatus; |
| | | |
| | | @ApiModelProperty("上报次数") |
| | | @TableField("report_once") |
| | | private Integer reportOnce; |
| | | |
| | | /** |
| | | * 状态 1: 进行中 0: 初始 2:已完成 |
| | | */ |
| | |
| | | @TableField("upd_mk") |
| | | private String updMk; |
| | | |
| | | @TableField("is_new_in") |
| | | private String isNewIn; |
| | | |
| | | /** |
| | | * 退出 |
| | | */ |
| | |
| | | // null // |
| | | // ); |
| | | |
| | | public String getWrkNo$() { |
| | | WrkMastService service = SpringUtils.getBean(WrkMastService.class); |
| | | WrkMast wrkMast = service.selectById(this.wrkNo); |
| | | if (!Cools.isEmpty(wrkMast)) { |
| | | return String.valueOf(wrkMast.getId()); |
| | | } |
| | | return null; |
| | | } |
| | | // public String getWrkNo$() { |
| | | // WrkMastService service = SpringUtils.getBean(WrkMastService.class); |
| | | // WrkMast wrkMast = service.selectById(this.wrkNo); |
| | | // if (!Cools.isEmpty(wrkMast)) { |
| | | // return String.valueOf(wrkMast.getId()); |
| | | // } |
| | | // return null; |
| | | // } |
| | | |
| | | public String getYmd$() { |
| | | if (Cools.isEmpty(this.ymd)) { |
| | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | // @TableId(value = "id", type = IdType.AUTO) |
| | | // private Long id; |
| | | |
| | | /** |
| | | * 工作号 |
| | |
| | | public WrkMastLog() { |
| | | } |
| | | |
| | | public String getWrkNo$() { |
| | | WrkMastService service = SpringUtils.getBean(WrkMastService.class); |
| | | WrkMast wrkMast = service.selectById(this.wrkNo); |
| | | if (!Cools.isEmpty(wrkMast)) { |
| | | return String.valueOf(wrkMast.getWrkNo()); |
| | | } |
| | | return null; |
| | | } |
| | | // public String getWrkNo$() { |
| | | // WrkMastService service = SpringUtils.getBean(WrkMastService.class); |
| | | // WrkMast wrkMast = service.selectById(this.wrkNo); |
| | | // if (!Cools.isEmpty(wrkMast)) { |
| | | // return String.valueOf(wrkMast.getWrkNo()); |
| | | // } |
| | | // return null; |
| | | // } |
| | | |
| | | public String getYmd$() { |
| | | if (Cools.isEmpty(this.ymd)) { |
| New file |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class QueryCombParam { |
| | | |
| | | private String barcode; |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class QueryTaskParam { |
| | | |
| | | private String taskNo; |
| | | |
| | | private String taskType; |
| | | |
| | | private String agvSite; |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.entity.result; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import com.zy.common.utils.Synchro; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode |
| | | @HeadRowHeight(20) |
| | | public class CheckOrderExportDTO { |
| | | @ExcelProperty({"盘点差异单", "订单号"}) |
| | | private String orderNo; |
| | | |
| | | @ExcelProperty({"盘点差异单", "库位号"}) |
| | | private String locNo; |
| | | |
| | | @ExcelProperty({"盘点差异单", "容器码"}) |
| | | private String zpallet; |
| | | |
| | | @ExcelProperty({"盘点差异单", "物料代码"}) |
| | | private String matnr; |
| | | |
| | | @ExcelProperty({"盘点差异单", "物料名称"}) |
| | | private String maktx; |
| | | |
| | | @ExcelProperty({"盘点差异单", "物料规格"}) |
| | | private String specs; |
| | | |
| | | @ExcelProperty({"盘点差异单", "批次"}) |
| | | private String batch; |
| | | |
| | | @ExcelProperty({"盘点差异单", "库存数量"}) |
| | | private BigDecimal anfme; |
| | | |
| | | @ExcelProperty({"盘点差异单", "盘点数量"}) |
| | | private BigDecimal workQty; |
| | | |
| | | @ExcelProperty({"盘点差异单", "差异数量"}) |
| | | private BigDecimal diffQty; |
| | | |
| | | |
| | | public void sync(Object source) { |
| | | Synchro.Copy(source, this); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.entity.result; |
| | | |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | public class CrnTaskDetlDTO { |
| | | |
| | | private String locNo; |
| | | |
| | | private List<LocDetl> locDetlList; |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | public boolean beSimilar(LocDetl locDetl) { |
| | | public boolean beSimilar(LocDetl locDetl){ |
| | | return (this.matnr.equals(locDetl.getMatnr()) |
| | | && this.batch.equals(locDetl.getBatch()) |
| | | && this.brand.equals(locDetl.getBrand()) |
| | | && this.standby1.equals(locDetl.getStandby1()) |
| | | && this.standby2.equals(locDetl.getStandby2()) |
| | | && this.standby3.equals(locDetl.getStandby3()) |
| | | && this.boxType1.equals(locDetl.getBoxType1()) |
| | | && this.boxType2.equals(locDetl.getBoxType2()) |
| | | && this.boxType3.equals(locDetl.getBoxType3()) |
| | | && this.batch.equals(locDetl.getBatch()) |
| | | && this.brand.equals(locDetl.getBrand()) |
| | | && this.standby1.equals(locDetl.getStandby1()) |
| | | && this.standby2.equals(locDetl.getStandby2()) |
| | | && this.standby3.equals(locDetl.getStandby3()) |
| | | && this.boxType1.equals(locDetl.getBoxType1()) |
| | | && this.boxType2.equals(locDetl.getBoxType2()) |
| | | && this.boxType3.equals(locDetl.getBoxType3()) |
| | | ); |
| | | } |
| | | |
| | | public boolean beSimilar(WrkDetl wrkDetl) { |
| | | public boolean beSimilar(WrkDetl wrkDetl){ |
| | | return (this.matnr.equals(wrkDetl.getMatnr()) |
| | | && this.batch.equals(wrkDetl.getBatch()) |
| | | && this.brand.equals(wrkDetl.getBrand()) |
| New file |
| | |
| | | package com.zy.asrs.entity.result; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class ForwardAGVTaskDTO { |
| | | private String reqCode; |
| | | private String reqTime; |
| | | private String taskTyp; |
| | | private String ctnrCode; |
| | | private List<PositionCodePaths> positionCodePath; |
| | | private String clientCode = ""; |
| | | private String tokenCode = ""; |
| | | private String ctnrTyp = ""; |
| | | private String ctnrNum = ""; |
| | | private String wbCode = ""; |
| | | private String podCode = ""; |
| | | private String podDir = ""; |
| | | private String podTyp = ""; |
| | | private String materialLot = ""; |
| | | private String priority = ""; |
| | | private String taskCode; |
| | | private String agvCode = ""; |
| | | private String data = ""; |
| | | |
| | | @Data |
| | | public static class PositionCodePaths{ |
| | | private String positionCode; |
| | | private String type; |
| | | |
| | | public PositionCodePaths(String positionCode, String type){ |
| | | this.positionCode = positionCode; |
| | | this.type = type; |
| | | |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.entity.result; |
| | | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | public class HIKApiDTO { |
| | | /** |
| | | * 源站 |
| | | */ |
| | | private String org; |
| | | /** |
| | | * 源站类型 |
| | | */ |
| | | private String orgType; |
| | | /** |
| | | * 目标站 |
| | | */ |
| | | private String tar; |
| | | /** |
| | | * 目标站类型 |
| | | */ |
| | | private String tarType; |
| | | /** |
| | | * 任务类型 |
| | | */ |
| | | private String taskType; |
| | | /** |
| | | * 容器类型 |
| | | */ |
| | | private String ctnrType; |
| | | /** |
| | | * 优先级 |
| | | */ |
| | | private String priority; |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.entity.result; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class HIKResultDTO { |
| | | private boolean success = false; |
| | | private String message; |
| | | } |
| | |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.LocOwner; |
| | | import com.zy.asrs.service.LocOwnerService; |
| | | import com.zy.common.utils.Synchro; |
| | | import lombok.Data; |
| | | import org.springframework.beans.BeanUtils; |
| | | |
| | | import java.util.Date; |
| | | |
| | |
| | | private String meno; |
| | | private String manu; |
| | | |
| | | public String getOwner$() { |
| | | public String getOwner$(){ |
| | | LocOwnerService service = SpringUtils.getBean(LocOwnerService.class); |
| | | LocOwner locOwner = service.selectById(this.owner); |
| | | if (!Cools.isEmpty(locOwner)) { |
| | | if (!Cools.isEmpty(locOwner)){ |
| | | return String.valueOf(locOwner.getOwner()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getPayment$() { |
| | | if (null == this.payment) { |
| | | return null; |
| | | } |
| | | switch (this.payment) { |
| | | public String getPayment$(){ |
| | | if (null == this.payment){ return null; } |
| | | switch (this.payment){ |
| | | case 1: |
| | | return "仓储"; |
| | | case 0: |
| | |
| | | } |
| | | |
| | | public void sync(Object source) { |
| | | BeanUtils.copyProperties(source, this); |
| | | Synchro.Copy(source, this); |
| | | } |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | |
| | | /** |
| | | * 所属项目 |
| | | */ |
| | | @ApiModelProperty(value = "所属项目") |
| | | @ApiModelProperty(value= "所属项目") |
| | | @TableField("host_id") |
| | | private Long hostId; |
| | | |
| | | /** |
| | | * 任务号 |
| | | */ |
| | | @ApiModelProperty(value = "任务号") |
| | | @ApiModelProperty(value= "任务号") |
| | | @TableField("wrk_no") |
| | | private String wrkNo; |
| | | |
| | | /** |
| | | * 工作状态 |
| | | */ |
| | | @ApiModelProperty(value = "工作状态") |
| | | @ApiModelProperty(value= "工作状态") |
| | | @TableField("wrk_sts") |
| | | private Long wrkSts; |
| | | |
| | | /** |
| | | * 托盘号 |
| | | */ |
| | | @ApiModelProperty(value = "托盘号") |
| | | @ApiModelProperty(value= "托盘号") |
| | | private String zpallet; |
| | | |
| | | /** |
| | | * 入库数量 |
| | | */ |
| | | @ApiModelProperty(value = "入库数量") |
| | | @ApiModelProperty(value= "入库数量") |
| | | @ExcelProperty(value = "入库总量") |
| | | private Double anfme; |
| | | |
| | | /** |
| | | * 关联货位 |
| | | */ |
| | | @ApiModelProperty(value = "关联货位") |
| | | @ApiModelProperty(value= "关联货位") |
| | | @TableField("node_id") |
| | | private Long nodeId; |
| | | |
| | | /** |
| | | * 货位 |
| | | */ |
| | | @ApiModelProperty(value = "货位") |
| | | @ApiModelProperty(value= "货位") |
| | | @TableField("loc_no") |
| | | private String locNo; |
| | | |
| | | /** |
| | | * 商品编码 |
| | | */ |
| | | @ApiModelProperty(value = "商品编码") |
| | | @ApiModelProperty(value= "商品编码") |
| | | @ExcelProperty(value = "商品编码") |
| | | private String matnr; |
| | | |
| | | /** |
| | | * 商品名称 |
| | | */ |
| | | @ApiModelProperty(value = "商品名称") |
| | | @ApiModelProperty(value= "商品名称") |
| | | @ExcelProperty(value = "商品名称") |
| | | private String maktx; |
| | | |
| | | /** |
| | | * 名称 |
| | | */ |
| | | @ApiModelProperty(value = "名称") |
| | | @ApiModelProperty(value= "名称") |
| | | private String name; |
| | | |
| | | /** |
| | | * 规格 |
| | | */ |
| | | @ApiModelProperty(value = "规格") |
| | | @ApiModelProperty(value= "规格") |
| | | @ExcelProperty(value = "规格") |
| | | private String specs; |
| | | |
| | | /** |
| | | * 型号 |
| | | */ |
| | | @ApiModelProperty(value = "型号") |
| | | @ApiModelProperty(value= "型号") |
| | | private String model; |
| | | |
| | | /** |
| | | * 批号 |
| | | */ |
| | | @ApiModelProperty(value = "批号") |
| | | @ApiModelProperty(value= "批号") |
| | | private String batch; |
| | | |
| | | /** |
| | | * 单位 |
| | | */ |
| | | @ApiModelProperty(value = "单位") |
| | | @ApiModelProperty(value= "单位") |
| | | @ExcelProperty(value = "单位") |
| | | private String unit; |
| | | |
| | | /** |
| | | * SKC |
| | | */ |
| | | @ApiModelProperty(value = "SKC") |
| | | @ApiModelProperty(value= "SKC") |
| | | @ExcelProperty(value = "SKC") |
| | | private String barcode; |
| | | |
| | | /** |
| | | * 单据类型 |
| | | */ |
| | | @ApiModelProperty(value = "单据类型") |
| | | @ApiModelProperty(value= "单据类型") |
| | | @TableField("doc_id") |
| | | private Long docId; |
| | | |
| | | /** |
| | | * 单据编号 |
| | | */ |
| | | @ApiModelProperty(value = "单据编号") |
| | | @ApiModelProperty(value= "单据编号") |
| | | @TableField("doc_num") |
| | | private String docNum; |
| | | |
| | | /** |
| | | * 客户名称 |
| | | */ |
| | | @ApiModelProperty(value = "客户名称") |
| | | @ApiModelProperty(value= "客户名称") |
| | | @TableField("cust_name") |
| | | private String custName; |
| | | |
| | | /** |
| | | * 品项数 |
| | | */ |
| | | @ApiModelProperty(value = "品项数") |
| | | @ApiModelProperty(value= "品项数") |
| | | @TableField("item_num") |
| | | private Integer itemNum; |
| | | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | @ApiModelProperty(value = "数量") |
| | | @ApiModelProperty(value= "数量") |
| | | private Integer count; |
| | | |
| | | /** |
| | | * 单价 |
| | | */ |
| | | @ApiModelProperty(value = "单价") |
| | | @ApiModelProperty(value= "单价") |
| | | private Double price; |
| | | |
| | | /** |
| | | * 重量 |
| | | */ |
| | | @ApiModelProperty(value = "重量") |
| | | @ApiModelProperty(value= "重量") |
| | | private Double weight; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 禁用 |
| | | */ |
| | | @ApiModelProperty(value = "状态 1: 正常 0: 禁用 ") |
| | | @ApiModelProperty(value= "状态 1: 正常 0: 禁用 ") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 添加人员 |
| | | */ |
| | | @ApiModelProperty(value = "添加人员") |
| | | @ApiModelProperty(value= "添加人员") |
| | | @TableField("create_by") |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @ApiModelProperty(value = "添加时间") |
| | | @ApiModelProperty(value= "添加时间") |
| | | @TableField("create_time") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value = "修改人员") |
| | | @ApiModelProperty(value= "修改人员") |
| | | @TableField("update_by") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value = "修改时间") |
| | | @ApiModelProperty(value= "修改时间") |
| | | @TableField("update_time") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value = "备注") |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | public Pakin() { |
| | | } |
| | | public Pakin() {} |
| | | |
| | | public Pakin(Long hostId, String wrkNo, Long wrkSts, String zpallet, Double anfme, Long nodeId, String locNo, String matnr, String maktx, String name, String specs, String model, String batch, String unit, String barcode, Long docId, String docNum, String custName, Integer itemNum, Integer count, Double weight, Integer status, Long createBy, Date createTime, Long updateBy, Date updateTime, String memo) { |
| | | this.hostId = hostId; |
| | |
| | | // null // 备注 |
| | | // ); |
| | | |
| | | public String getHostId$() { |
| | | public String getHostId$(){ |
| | | HostService service = SpringUtils.getBean(HostService.class); |
| | | Host host = service.selectById(this.hostId); |
| | | if (!Cools.isEmpty(host)) { |
| | | if (!Cools.isEmpty(host)){ |
| | | return String.valueOf(host.getName()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | public String getStatus$() { |
| | | if (null == this.status) { |
| | | return null; |
| | | } |
| | | switch (this.status) { |
| | | |
| | | public String getStatus$(){ |
| | | if (null == this.status){ return null; } |
| | | switch (this.status){ |
| | | case 1: |
| | | return "正常"; |
| | | case 0: |
| | |
| | | } |
| | | } |
| | | |
| | | public String getCreateBy$() { |
| | | public String getCreateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.createBy); |
| | | if (!Cools.isEmpty(user)) { |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getCreateTime$() { |
| | | if (Cools.isEmpty(this.createTime)) { |
| | | public String getCreateTime$(){ |
| | | if (Cools.isEmpty(this.createTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); |
| | | } |
| | | |
| | | public String getUpdateBy$() { |
| | | public String getUpdateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.updateBy); |
| | | if (!Cools.isEmpty(user)) { |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getUpdateTime$() { |
| | | if (Cools.isEmpty(this.updateTime)) { |
| | | public String getUpdateTime$(){ |
| | | if (Cools.isEmpty(this.updateTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); |
| New file |
| | |
| | | package com.zy.asrs.enums; |
| | | |
| | | public enum CheckStatusEnum { |
| | | //状态 1: 未生成 0: 禁用 2:待盘 3:已盘 |
| | | NO_CREATE(1, "未生成"), |
| | | DISABLED(0, "禁用"), |
| | | WAIT_CHECK(2, "待盘"), |
| | | CHECKED(3, "已盘"), |
| | | |
| | | //调整单 |
| | | ALLOW(4, "允许"), |
| | | FORBID(5, "禁止"), |
| | | MODIFIED(6, "已修改"); |
| | | |
| | | |
| | | |
| | | public final Integer type; |
| | | |
| | | public final String desc; |
| | | |
| | | CheckStatusEnum(Integer type, String desc) { |
| | | this.type = type; |
| | | this.desc = desc; |
| | | } |
| | | public static String getDescByType(Integer type) { |
| | | for (CheckStatusEnum value : CheckStatusEnum.values()) { |
| | | if (value.type.equals(type)) { |
| | | return value.desc; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @version 1.0 |
| | | * @date 2025/9/25 |
| | | * @description: 通用类型枚举 |
| | | * @version 1.0 |
| | | */ |
| | | public enum CommonEnum { |
| | | |
| New file |
| | |
| | | package com.zy.asrs.enums; |
| | | |
| | | /** |
| | | * 通用站点 |
| | | * @author Ryan |
| | | * @date 2025/12/6 13:56 |
| | | * @return null |
| | | */ |
| | | public enum CommonStation { |
| | | |
| | | //通用类型 |
| | | COMMON_STATION_Y("Y", "是"), |
| | | //通用 |
| | | COMMON_STATION_N("N", "否"); |
| | | |
| | | public String type; |
| | | |
| | | public String desc; |
| | | |
| | | CommonStation(String type, String desc) { |
| | | this.type = type; |
| | | this.desc = desc; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.enums; |
| | | |
| | | /** |
| | | * 库区类型 |
| | | * @author Ryan |
| | | * @date 2025/12/3 9:59 |
| | | * @return null |
| | | */ |
| | | public enum LocAreaType { |
| | | |
| | | //入库缓存区 |
| | | LOC_AREA_TYPE_IN_CACHE("5", "入库缓存区"), |
| | | //堆垛机 |
| | | LOC_AREA_TYPE_CRN("1", "立库区"), |
| | | |
| | | LOC_AREA_TYPE_SO("2", "出库SO区"), |
| | | |
| | | LOC_AREA_TYPE_EO("3", "出库EO区") |
| | | ; |
| | | |
| | | public Long type; |
| | | |
| | | public String desc; |
| | | |
| | | LocAreaType(String type, String desc) { |
| | | this.type = Long.valueOf(type); |
| | | this.desc = desc; |
| | | } |
| | | |
| | | } |
| | |
| | | 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_P("P", "P.拣货中"), |
| | | //出库预约 |
| | | LOC_STS_TYPE_R("R", "出库预约"), |
| | | LOC_STS_TYPE_R("R", "R.出库预约"), |
| | | ; |
| | | |
| | | public String type; |
| | |
| | | //小件 |
| | | MAT_TAGT_YPE_SMALL("12", "小件"), |
| | | //滤芯 |
| | | MAT_TAGT_YPE_XIN("14", "滤芯"); |
| | | MAT_TAGT_YPE_XIN("14", "滤芯") |
| | | ; |
| | | |
| | | public String id; |
| | | |
| New file |
| | |
| | | package com.zy.asrs.enums; |
| | | |
| | | /** |
| | | * 单据状态 |
| | | * @author Ryan |
| | | * @date 2025/12/1 12:41 |
| | | * @return null |
| | | */ |
| | | public enum OrderSettle { |
| | | //初始化 |
| | | ORDER_SETTLE_INIT("0", "初始化"), |
| | | //待处理 |
| | | ORDER_SETTLE_HOLDING("1", "待处理"), |
| | | |
| | | ORDER_SETTLE_WORKING("2", "作业中"), |
| | | |
| | | ORDER_SETTLE_CANCEL("3", "已取消"), |
| | | |
| | | ORDER_SETTLE_DONE("4", "已完成"), |
| | | |
| | | ORDER_SETTLE_UN_CANCEL("5", "准备取消"), |
| | | |
| | | ORDER_SETTLE_REPORTED("6", "上报完成"), |
| | | |
| | | ORDER_SETTLE_DATA_EX("7", "数据异常"), |
| | | |
| | | ORDER_SETTLE_CHECKED("8", "审核完成"), |
| | | |
| | | ORDER_SETTLE_SUBMITED("8", "提交完成"), |
| | | |
| | | ORDER_SETTLE_SAVED("10", "保存完成"), |
| | | |
| | | ORDER_SETTLE_CHECKED_TASKED("11", "已生成盘点任务"), |
| | | |
| | | ORDER_SETTLE_SECTION_TASKED("12", "已生成部分任务"), |
| | | |
| | | ; |
| | | |
| | | public Long type; |
| | | |
| | | public String desc; |
| | | |
| | | OrderSettle(String type, String desc) { |
| | | this.type = Long.valueOf(type); |
| | | this.desc = desc; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.enums; |
| | | |
| | | public enum OrderTypeEnum { |
| | | //上架派工单 |
| | | PICKING(0, "上架派工单"), |
| | | //备货派工单 |
| | | TRANSFER(2, "备货派工单"), |
| | | INVENTORY(3, "盘点单"), |
| | | ADJUSTMENT(4, "库存调整单"), |
| | | //备货单 |
| | | STOCK(5, "备货单"), |
| | | |
| | | //备货出库单 |
| | | STOCK_OUT(6, "备货出库单"), |
| | | |
| | | //备货入库单 |
| | | STOCK_IN(7, "备货入库单"); |
| | | |
| | | |
| | | public Integer type; |
| | | public String desc; |
| | | OrderTypeEnum(Integer type, String desc) { |
| | | this.type = type; |
| | | this.desc = desc; |
| | | } |
| | | public static String getDescByType(Integer type) { |
| | | for (OrderTypeEnum value : OrderTypeEnum.values()) { |
| | | if (value.type.equals(type)) { |
| | | return value.desc; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.enums; |
| | | |
| | | /** |
| | | * 任务出入库类型 |
| | | * @author Ryan |
| | | * @date 2025/12/6 14:55 |
| | | * @param null |
| | | * @return null |
| | | */ |
| | | public enum TaskIOType { |
| | | |
| | | //料箱 |
| | | ALL_IN("1", "1.入库"), |
| | | //托盘 |
| | | STATION_STATION("3", "3.站到站"), |
| | | |
| | | DEVICE_OUT("6", "6.设备上退出"), |
| | | |
| | | PICKING_MEGER("8", "8.拣料途中并板"), |
| | | |
| | | EMPTY_IN("10", "10.空板入库"), |
| | | |
| | | MOVE("11", "11.库格移载"), |
| | | |
| | | PICK_IN("53", "53.拣料入库"), |
| | | |
| | | MERGE_IN("54", "54.并板入库"), |
| | | |
| | | CHECK_IN("57", "57.盘点入库"), |
| | | |
| | | ALL_OUT("101", "101.出库"), |
| | | |
| | | PICK_OUT("103", "103.拣料出库"), |
| | | |
| | | MERGE_OUT("104", "104.并板出库"), |
| | | |
| | | CHECK_OUT("107", "107.盘点出库"), |
| | | |
| | | EMPTY_OUT("110", "110.空板出库"), |
| | | |
| | | ; |
| | | |
| | | public Integer type; |
| | | |
| | | public String desc; |
| | | |
| | | TaskIOType(String type, String desc) { |
| | | this.type = Integer.valueOf(type); |
| | | this.desc = desc; |
| | | } |
| | | } |
| 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; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.BasStationDetl; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface BasStationDetlMapper extends BaseMapper<BasStationDetl> { |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.BasStationDetl; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | public interface BasStationDetlService extends IService<BasStationDetl> { |
| | | |
| | | } |
| | |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.OrderDetlPakout; |
| | | import com.zy.asrs.entity.param.*; |
| | | import com.zy.asrs.entity.param.CompleteParam; |
| | | |
| | | import java.util.Date; |
| | | |
| | |
| | | Double curOutQty, Integer ioType, Long userId, Date now); |
| | | |
| | | /** |
| | | * WCS申请在库库位更换库位 |
| | | * @param combParam |
| | | * @param l |
| | | * @return |
| | | */ |
| | | R changeLoc(CompleteParam combParam, long l); |
| | | |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/9/22 |
| | | * @description: 获取缓冲区库位信息 |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.WrkDetl; |
| | | import com.zy.asrs.entity.WrkMast; |
| | |
| | | void remove(Long orderId); |
| | | |
| | | List<Order> selectComplete(); |
| | | |
| | | List<Order> selectComplete1(); |
| | | |
| | | List<Order> selectComplete99(); |
| | | |
| | | List<Order> selectComplete8(); |
| | | |
| | | boolean addToLogTable(Order order); |
| | |
| | | List<Order> selectorderNoL(String orderNo); |
| | | |
| | | Order selectOrderMoveStatus(); |
| | | |
| | | Order selectOrderMoveStatusInitial(); |
| | | |
| | | } |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.zy.asrs.entity.WaitPakin; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.entity.param.EmptyPlateOutParam; |
| | | import com.zy.asrs.entity.param.FullStoreParam; |
| | | import com.zy.asrs.entity.param.LocDetlAdjustParam; |
| | | import com.zy.asrs.entity.param.StockOutParam; |
| | | import com.zy.asrs.entity.param.*; |
| | | import com.zy.asrs.entity.param.CompleteParam; |
| | | import com.zy.common.model.LocDetlDto; |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.common.model.TaskDto; |
| | |
| | | |
| | | void turnMatLocDetl(EmptyPlateOutParam param, Long userId); |
| | | |
| | | /** |
| | | * 移库任务 |
| | | * @param param |
| | | * @param userId |
| | | */ |
| | | R taskMove(CompleteParam param, Long userId ); |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.zy.asrs.mapper.BasStationDetlMapper; |
| | | import com.zy.asrs.entity.BasStationDetl; |
| | | import com.zy.asrs.service.BasStationDetlService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("basStationDetlService") |
| | | public class BasStationDetlServiceImpl extends ServiceImpl<BasStationDetlMapper, BasStationDetl> implements BasStationDetlService { |
| | | |
| | | } |
| | |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.*; |
| | | import com.zy.asrs.entity.param.CompleteParam; |
| | | import com.zy.asrs.enums.LocStsType; |
| | | import com.zy.asrs.mapper.LocMastMapper; |
| | | import com.zy.asrs.mapper.ManLocDetlMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.MatUtils; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.constant.MesConstant; |
| | | import com.zy.common.entity.Parameter; |
| | | import com.zy.common.model.DetlDto; |
| | | import com.zy.common.model.MesCombParam; |
| | | import com.zy.common.model.enums.WorkNoType; |
| | | import com.zy.common.properties.SlaveProperties; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.system.timer.LoadingConfigTimer; |
| | |
| | | |
| | | @Autowired |
| | | private TaskService taskService; |
| | | |
| | | @Autowired |
| | | private SlaveProperties slaveProperties; |
| | | |
| | | @Autowired |
| | | private TaskDetlService taskDetlService; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 6.15WCS申请在库库位更换库位 |
| | | * |
| | | * @param combParam |
| | | * @param l |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R changeLoc(CompleteParam combParam, long l) { |
| | | if (Objects.isNull(combParam)) { |
| | | return R.error("参数不能为空!"); |
| | | } |
| | | if (Objects.isNull(combParam.getLocNo())) { |
| | | return R.error("库位号不能为空!!"); |
| | | } |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", combParam.getLocNo())); |
| | | if (Objects.isNull(locMast)) { |
| | | return R.error("库位信息不存在或库位状态非 F.在库 状态"); |
| | | } |
| | | |
| | | List<Integer> doubleLocs = slaveProperties.getDoubleLocs(); |
| | | List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>() |
| | | .in("row1", doubleLocs) |
| | | .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type)); |
| | | Map<String, Object> result = new HashMap<>(); |
| | | LocMast selected = new LocMast(); |
| | | for (LocMast loc : locMasts) { |
| | | LocMast temLoc = locMastService.selectById(loc.getLocNo()); |
| | | if (Objects.isNull(temLoc)) { |
| | | throw new CoolException("数据错误, 原库位信息不存在!!"); |
| | | } |
| | | String shallowLoc = Utils.getShallowLoc(slaveProperties, temLoc.getLocNo()); |
| | | |
| | | LocMast locMast1 = locMastService.selectById(shallowLoc); |
| | | if (Objects.isNull(locMast1)) { |
| | | throw new CoolException("数据错误, 新库位信息不存在!!"); |
| | | } |
| | | if (!locMast1.getLocSts().equals(LocStsType.LOC_STS_TYPE_O.type)) { |
| | | continue; |
| | | } |
| | | selected = loc; |
| | | |
| | | break; |
| | | } |
| | | |
| | | WrkMast moveTask = generateMoveTask(selected, locMast); |
| | | result.put("locNo", selected.getLocNo()); |
| | | result.put("taskNo", moveTask.getWrkNo()); |
| | | |
| | | return R.ok().add(result); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 生成移库任务 |
| | | * |
| | | * @param result |
| | | * @param sourceLoc |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public WrkMast generateMoveTask(LocMast result, LocMast sourceLoc) { |
| | | WrkMast wrkMast = new WrkMast(); |
| | | int workNo = commonService.getWorkNo(0); |
| | | |
| | | wrkMast.setWrkNo(workNo); |
| | | wrkMast.setLocNo(result.getLocNo()); |
| | | wrkMast.setSourceLocNo(sourceLoc.getLocNo()); |
| | | wrkMast.setWrkSts(11L); |
| | | wrkMast.setIoType(11); |
| | | wrkMast.setCrnNo(sourceLoc.getCrnNo()); |
| | | wrkMast.setAppeTime(new Date()); |
| | | wrkMast.setModiTime(new Date()); |
| | | wrkMast.setIoPri(13D); |
| | | wrkMast.setWrkDate(new Date()); |
| | | |
| | | if (!wrkMastService.insert(wrkMast)) { |
| | | throw new CoolException("任务保存失败!!"); |
| | | } |
| | | |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", sourceLoc.getLocNo())); |
| | | locDetls.forEach(detl -> { |
| | | detl.setLocNo(result.getLocNo()); |
| | | if (!locDetlService.updateById(detl)) { |
| | | throw new CoolException("明细更新失败!!"); |
| | | } |
| | | }); |
| | | |
| | | return wrkMast; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/9/22 |
| | | * @description: 获取缓冲区库位信息 |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SnowflakeIdWorker; |
| | | import com.core.common.*; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.EmptyPlateOutParam; |
| | | import com.zy.asrs.entity.param.FullStoreParam; |
| | | import com.zy.asrs.entity.param.LocDetlAdjustParam; |
| | | import com.zy.asrs.entity.param.StockOutParam; |
| | | import com.zy.asrs.entity.param.*; |
| | | import com.zy.asrs.entity.param.CompleteParam; |
| | | import com.zy.asrs.entity.result.FindLocNoAttributeVo; |
| | | import com.zy.asrs.mapper.LocMastMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.constant.MesConstant; |
| | | import com.zy.common.model.*; |
| | | import com.zy.common.model.enums.IoWorkType; |
| | | import com.zy.common.model.enums.WorkNoType; |
| | | import com.zy.common.properties.SlaveProperties; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.common.web.WcsController; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 执行移库任务 |
| | | * @param combParam |
| | | * @param userId |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R taskMove(CompleteParam combParam, Long userId) { |
| | | |
| | | if (Objects.isNull(combParam.getTaskNo())) { |
| | | return R.error("任务号不能为空"); |
| | | } |
| | | if (Objects.isNull(combParam.getSourceLocNo())) { |
| | | return R.error("源库位不能为空!!"); |
| | | } |
| | | if (Objects.isNull(combParam.getLocNo())) { |
| | | return R.error("目标库位不能为空!"); |
| | | } |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", combParam.getTaskNo())); |
| | | if (Objects.isNull(wrkMast)) { |
| | | return R.error("任务档不存在!!"); |
| | | } |
| | | |
| | | String body = JSON.toJSONString(combParam); |
| | | boolean success = false; |
| | | String response = ""; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(MesConstant.WCS_URL) |
| | | .setPath(MesConstant.MOVE_LOC_TASK) |
| | | .setJson(body) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | wrkMast.setWrkSts(2L); |
| | | if (!wrkMastService.updateById(wrkMast)) { |
| | | throw new CoolException("任务状态更新失败!!"); |
| | | } |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", wrkMast.getSourceLocNo())); |
| | | if (!Objects.isNull(locMast)) { |
| | | locMast.setMoveStatus(1); |
| | | locMastService.updateById(locMast); |
| | | } |
| | | success = true; |
| | | } else { |
| | | log.error("发送agv任务失败!!!url:{};request:{};response:{}", MesConstant.WCS_URL + MesConstant.MOVE_LOC_TASK, body, response); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("发送agv任务异常", e); |
| | | } finally { |
| | | try { |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "发送agv任务", |
| | | MesConstant.WCS_URL + MesConstant.MOVE_LOC_TASK, |
| | | null, |
| | | "127.0.0.1", |
| | | body, |
| | | response, |
| | | success); |
| | | } catch (Exception e) { |
| | | log.error("", e); |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.zy.asrs.task; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.zy.api.controller.params.WorkTaskParams; |
| | | import com.zy.api.service.WcsApiService; |
| | | import com.zy.asrs.entity.Task; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.entity.param.CompleteParam; |
| | | import com.zy.asrs.service.TaskService; |
| | | import com.zy.asrs.service.WorkService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.task.handler.WorkMastHandler; |
| | |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/7/7 |
| | |
| | | private WorkMastHandler workMastHandler; |
| | | @Autowired |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private WcsApiService wcsApiService; |
| | | @Autowired |
| | | private WorkService workService; |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | private void execute() { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 任务自动下发出库任务 |
| | | * |
| | | * @author Ryan |
| | | * @date 2026/1/10 14:42 |
| | | */ |
| | | @Scheduled(cron = "0/5 * * * * ? ") |
| | | private void autoPubTasks() { |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | .in("wrk_sts", Arrays.asList(11L, 1L)) |
| | | .orderDesc(Arrays.asList("io_pri"))); |
| | | if (wrkMasts.isEmpty()) { |
| | | return; |
| | | } |
| | | Map<Integer, List<WrkMast>> listMap = wrkMasts.stream().collect(Collectors.groupingBy(WrkMast::getCrnNo)); |
| | | listMap.keySet().forEach(key -> { |
| | | List<WrkMast> wrkMasts1 = listMap.get(key); |
| | | Collections.shuffle(wrkMasts1); |
| | | try { |
| | | wrkMasts1.forEach(wrkMast -> { |
| | | WorkTaskParams params = new WorkTaskParams(); |
| | | if (wrkMast.getIoType().equals(11)) { |
| | | CompleteParam param = new CompleteParam(); |
| | | param.setTaskNo(wrkMast.getWrkNo() + ""); |
| | | param.setSourceLocNo(wrkMast.getSourceLocNo()); |
| | | param.setLocNo(wrkMast.getLocNo()); |
| | | workService.taskMove(param, 9527L); |
| | | } else if (wrkMast.getIoType() > 100) { |
| | | params.setType("in") |
| | | .setTaskNo(wrkMast.getWrkNo() + "") |
| | | .setLocNo(wrkMast.getSourceLocNo()) |
| | | .setBarcode(wrkMast.getBarcode()) |
| | | .setStaNo(wrkMast.getStaNo()) |
| | | .setTaskPri(wrkMast.getIoPri().intValue()); |
| | | wcsApiService.pubWrkToWcs(params); |
| | | } |
| | | }); |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage()); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.zy.common.properties.SlaveProperties; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.Instant; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneId; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | |
| | | public static boolean isValidFormat(String dateStr, String format) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat(format); |
| | | sdf.setLenient(false); // 严格模式,必须完全匹配格式 |
| | | try { |
| | | sdf.parse(dateStr); |
| | | return true; |
| | | } catch (ParseException e) { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | public static Date getFormateDate(String datestr) { |
| | | //字符串转日期 |
| | | DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | LocalDateTime parse = LocalDateTime.parse(datestr, dateTimeFormatter); |
| | | Instant instant = parse.atZone(ZoneId.systemDefault()).toInstant(); |
| | | Date date = Date.from(instant); |
| | | return date; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 判断是否为深库位 |
| | | */ |
| New file |
| | |
| | | package com.zy.common.constant; |
| | | |
| | | |
| | | public class HIKApiConstant { |
| | | |
| | | // AGV IP地址 |
| | | public static final String AGV_IP = "http://192.168.238.202/rcs/rtas/api/robot/controller"; |
| | | |
| | | public static final String TASK_SUBMIT = "/task/submit"; |
| | | |
| | | // 入库呼叫AGV取货 |
| | | public static final String AGV_CALL_IN_PATH = "/rcms/services/rest/hikRpcService/genAgvSchedulingTask"; |
| | | |
| | | // AGV绑定仓位 |
| | | public static final String AGV_BIND_PATH = "/rcms/services/rest/hikRpcService/bindCtnrAndBin"; |
| | | |
| | | } |
| | |
| | | public static final String PAKIN_URL = "mes/api/zy/v1/warehouse/sendList"; |
| | | |
| | | public static final String PAKOUT_URL = "wmsFinprd/api/zy/v1/packOut/sendList"; |
| | | //WCS系统接口地址 |
| | | // public static final String WCS_URL = "http://192.168.238.31:9090/wcs"; |
| | | |
| | | public static final String WCS_URL = "http://127.0.0.1:9090/wcs"; |
| | | /**移库申请链接任务**/ |
| | | public static final String MOVE_LOC_TASK = "/openapi/createLocMoveTask"; |
| | | /***申请入库任务*/ |
| | | public static final String PUB_TASK_IN = "/openapi/createInTask"; |
| | | |
| | | /***申请出库任务*/ |
| | | public static final String PUB_TASK_OUT = "/openapi/createOutTask"; |
| | | |
| | | /***同步庫位信息*/ |
| | | public static final String SYN_LOCS = "/openapi/getAllLocInformation"; |
| | | /** |
| | | * token通过header传递的名称 |
| | | */ |
| | |
| | | server: |
| | | port: 8081 |
| | | port: 8080 |
| | | servlet: |
| | | context-path: /@pom.build.finalName@ |
| | | context-path: /wms |
| | | |
| | | spring: |
| | | application: |
| | | name: @pom.build.finalName@ |
| | | name: wms |
| | | jmx: |
| | | enabled: false |
| | | datasource: |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | username: sa |
| | | password: sa@123 |
| | | url: jdbc:sqlserver://192.168.4.15:1433;databasename=jxhcwms |
| | | url: jdbc:sqlserver://192.168.10.221:1433;databaseName=nbtlwms; |
| | | mvc: |
| | | static-path-pattern: /** |
| | | redis: |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zy.asrs.mapper.BasStationDetlMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.BasStationDetl"> |
| | | <result column="id" property="id" /> |
| | | <result column="dev_no" property="devNo" /> |
| | | <result column="anfme" property="anfme" /> |
| | | <result column="zpallet" property="zpallet" /> |
| | | <result column="matnr" property="matnr" /> |
| | | <result column="maktx" property="maktx" /> |
| | | <result column="batch" property="batch" /> |
| | | <result column="order_no" property="orderNo" /> |
| | | <result column="specs" property="specs" /> |
| | | <result column="model" property="model" /> |
| | | <result column="color" property="color" /> |
| | | <result column="brand" property="brand" /> |
| | | <result column="unit" property="unit" /> |
| | | <result column="price" property="price" /> |
| | | <result column="sku" property="sku" /> |
| | | <result column="units" property="units" /> |
| | | <result column="barcode" property="barcode" /> |
| | | <result column="origin" property="origin" /> |
| | | <result column="manu" property="manu" /> |
| | | <result column="manu_date" property="manuDate" /> |
| | | <result column="item_num" property="itemNum" /> |
| | | <result column="safe_qty" property="safeQty" /> |
| | | <result column="weight" property="weight" /> |
| | | <result column="man_length" property="manLength" /> |
| | | <result column="volume" property="volume" /> |
| | | <result column="three_code" property="threeCode" /> |
| | | <result column="supp" property="supp" /> |
| | | <result column="supp_code" property="suppCode" /> |
| | | <result column="be_batch" property="beBatch" /> |
| | | <result column="dead_time" property="deadTime" /> |
| | | <result column="dead_warn" property="deadWarn" /> |
| | | <result column="source" property="source" /> |
| | | <result column="inspect" property="inspect" /> |
| | | <result column="danger" property="danger" /> |
| | | <result column="modi_user" property="modiUser" /> |
| | | <result column="modi_time" property="modiTime" /> |
| | | <result column="appe_user" property="appeUser" /> |
| | | <result column="appe_time" property="appeTime" /> |
| | | <result column="memo" property="memo" /> |
| | | <result column="line_number" property="lineNumber" /> |
| | | <result column="standby1" property="standby1" /> |
| | | <result column="standby2" property="standby2" /> |
| | | <result column="standby3" property="standby3" /> |
| | | <result column="box_type1" property="boxType1" /> |
| | | <result column="box_type2" property="boxType2" /> |
| | | <result column="box_type3" property="boxType3" /> |
| | | |
| | | </resultMap> |
| | | |
| | | </mapper> |