feat(api): 重构WCS和WMS接口服务并添加货位重量查询功能
- 新增BasCargoSpaceWeight实体类用于货位重量统计 - 在BasCargoSpaceMapper中添加selectPlatByWeight方法查询每排重量 - 实现selectPlatByWeight方法的SQL查询逻辑 - 在IBasCargoSpaceService中添加selectPlatByWeight接口 - 实现selectPlatByWeight服务方法用于分配重量平衡的货位 - 更新RequestLogService接口添加sourceSystem参数 - 在ToErpApiController中添加接口调用日志记录功能 - 在ToMesApiController中添加接口调用日志记录功能 - 重构ToWcsApiController添加任务完成、重新分配等接口 - 移除IToWmsService中已废弃的接口方法 - 移除PdaController中已废弃的addInJob方法 - 在ToWcsServiceImpl中实现货位分配和任务处理逻辑 - 添加RequestEnterResponse用于返回货位分配结果
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
package com.ruoyi.api.controller;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.ruoyi.api.service.IToErpService;
|
||||
import com.ruoyi.bas.BasCustomer.domain.BasCustomer;
|
||||
import com.ruoyi.bas.BasProduct.domain.BasProduct;
|
||||
import com.ruoyi.bas.BasSupplier.domain.BasSupplier;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.in.stockin.domain.vo.InstockInVo;
|
||||
import com.ruoyi.log.domain.RequestLog;
|
||||
import com.ruoyi.log.service.IRequestLogService;
|
||||
import com.ruoyi.out.outStockout.domain.OutStockoutVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -22,20 +25,28 @@ public class ToErpApiController {
|
||||
|
||||
@Autowired
|
||||
private IToErpService toErpService;
|
||||
@Autowired
|
||||
private IRequestLogService requestLogService;
|
||||
|
||||
/**
|
||||
* 接收物料信息
|
||||
*/
|
||||
@PostMapping("/receiveMaterial")
|
||||
public AjaxResult receiveMaterial(@RequestBody BasProduct basProduct) {
|
||||
return toErpService.receiveMaterial(basProduct);
|
||||
AjaxResult ajaxResult = toErpService.receiveMaterial(basProduct);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(basProduct), "接收ERP物料信息",ajaxResult, "ERP");
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
return ajaxResult;
|
||||
}
|
||||
/**
|
||||
* 接收客户信息
|
||||
*/
|
||||
@PostMapping("/receiveCustomer")
|
||||
public AjaxResult receiveCustomer(@RequestBody BasCustomer basProduct) {
|
||||
return toErpService.receiveCustomer(basProduct);
|
||||
public AjaxResult receiveCustomer(@RequestBody BasCustomer basCustomer) {
|
||||
AjaxResult ajaxResult = toErpService.receiveCustomer(basCustomer);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(basCustomer), "接收ERP客户信息",ajaxResult, "ERP");
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -43,7 +54,10 @@ public class ToErpApiController {
|
||||
*/
|
||||
@PostMapping("/receiveSupplier")
|
||||
public AjaxResult receiveSupplier(@RequestBody BasSupplier basSupplier) {
|
||||
return toErpService.receiveSupplier(basSupplier);
|
||||
AjaxResult ajaxResult = toErpService.receiveSupplier(basSupplier);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(basSupplier), "接收ERP供应商信息",ajaxResult, "ERP");
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -51,7 +65,10 @@ public class ToErpApiController {
|
||||
*/
|
||||
@PostMapping("/receiveInBill")
|
||||
public AjaxResult receiveInBill(@RequestBody InstockInVo inStockinVo) {
|
||||
return toErpService.receiveInBill(inStockinVo);
|
||||
AjaxResult ajaxResult = toErpService.receiveInBill(inStockinVo);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(inStockinVo), "接收ERP入库单据信息",ajaxResult, "ERP");
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -59,7 +76,10 @@ public class ToErpApiController {
|
||||
*/
|
||||
@PostMapping("/receiveOutBill")
|
||||
public AjaxResult receiveOutBill(@RequestBody OutStockoutVo outStockoutVo) {
|
||||
return toErpService.receiveOutBill(outStockoutVo);
|
||||
AjaxResult ajaxResult = toErpService.receiveOutBill(outStockoutVo);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(outStockoutVo), "接收ERP出库单据信息", ajaxResult, "ERP");
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
return ajaxResult;
|
||||
}
|
||||
/**
|
||||
* 单据信息回传
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.api.controller;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.ruoyi.api.service.IToErpService;
|
||||
import com.ruoyi.api.service.IToMesService;
|
||||
import com.ruoyi.bas.BasCustomer.domain.BasCustomer;
|
||||
@@ -7,6 +8,8 @@ import com.ruoyi.bas.BasProduct.domain.BasProduct;
|
||||
import com.ruoyi.bas.BasSupplier.domain.BasSupplier;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.in.stockin.domain.vo.InstockInVo;
|
||||
import com.ruoyi.log.domain.RequestLog;
|
||||
import com.ruoyi.log.service.IRequestLogService;
|
||||
import com.ruoyi.out.outStockout.domain.OutStockoutVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -20,13 +23,18 @@ public class ToMesApiController {
|
||||
|
||||
@Autowired
|
||||
private IToMesService toMesService;
|
||||
@Autowired
|
||||
private IRequestLogService requestLogService;
|
||||
|
||||
/**
|
||||
* 接收物料信息
|
||||
*/
|
||||
@PostMapping("/receiveMaterial")
|
||||
public AjaxResult receiveMaterial(@RequestBody BasProduct basProduct) {
|
||||
return toMesService.receiveMaterial(basProduct);
|
||||
AjaxResult ajaxResult = toMesService.receiveMaterial(basProduct);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(basProduct), "接收MES物料信息",ajaxResult,"MES");
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -34,7 +42,10 @@ public class ToMesApiController {
|
||||
*/
|
||||
@PostMapping("/receiveInBill")
|
||||
public AjaxResult receiveInBill(@RequestBody InstockInVo inStockinVo) {
|
||||
return toMesService.receiveInBill(inStockinVo);
|
||||
AjaxResult ajaxResult = toMesService.receiveInBill(inStockinVo);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(inStockinVo), "接收MES入库单据信息",ajaxResult,"MES");
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -42,7 +53,10 @@ public class ToMesApiController {
|
||||
*/
|
||||
@PostMapping("/receiveOutBill")
|
||||
public AjaxResult receiveOutBill(@RequestBody OutStockoutVo outStockoutVo) {
|
||||
return toMesService.receiveOutBill(outStockoutVo);
|
||||
AjaxResult ajaxResult = toMesService.receiveOutBill(outStockoutVo);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(outStockoutVo), "接收MES出库单据信息",ajaxResult,"MES");
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
return ajaxResult;
|
||||
}
|
||||
/**
|
||||
* 单据信息回传
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
package com.ruoyi.api.controller;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.ruoyi.api.domain.AgvMoveParam;
|
||||
import com.ruoyi.api.domain.ReMaterialParam;
|
||||
import com.ruoyi.api.domain.RequestEnter;
|
||||
import com.ruoyi.api.domain.WmsJobRequest;
|
||||
import com.ruoyi.api.service.IToWcsService;
|
||||
import com.ruoyi.api.service.IToWmsService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.log.domain.RequestLog;
|
||||
import com.ruoyi.log.service.IRequestLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -19,14 +26,62 @@ public class ToWcsApiController {
|
||||
|
||||
@Autowired
|
||||
private IToWcsService toWcsService;
|
||||
@Autowired
|
||||
private IToWmsService toWmsService;
|
||||
@Autowired
|
||||
private IRequestLogService requestLogService;
|
||||
|
||||
|
||||
/**
|
||||
* 推送agv搬运作业
|
||||
* @return
|
||||
* 获取入库作业
|
||||
*/
|
||||
@PostMapping("/pushAgvMoveJob")
|
||||
public AjaxResult pushAgvMoveJob(@RequestBody AgvMoveParam agvMoveParam) {
|
||||
return toWcsService.pushAgvMoveJob(agvMoveParam);
|
||||
@RequestMapping("/requestEnterByTrayCodeAndEntranceId")
|
||||
public AjaxResult requestEnterByTrayCodeAndEntranceId(@RequestBody RequestEnter requestEnter) {
|
||||
AjaxResult ajaxResult = toWcsService.requestEnterByTrayCodeAndEntranceId(requestEnter);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(requestEnter), "获取入库作业",ajaxResult,"WCS");
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库、出库 任务完成回传
|
||||
* Map<String, String>
|
||||
* "wmsType": "任务类型" 1-入库 2-出库 3-agv搬运,
|
||||
* taskNo:出库 入库任务号
|
||||
* trayCode:托盘码
|
||||
* positionCode1:起点
|
||||
* positionCode2:终点
|
||||
* containerCode:容器编码
|
||||
*
|
||||
*/
|
||||
@PostMapping("/jobFinish")
|
||||
public AjaxResult jobFinish(@RequestBody WmsJobRequest wmsJobRequest) {
|
||||
AjaxResult ajaxResult = toWcsService.jobFinish(wmsJobRequest);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(wmsJobRequest), "jobFinish",ajaxResult,"WCS");
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 放货有货,重新分配货位
|
||||
*/
|
||||
@PostMapping("/reAssign")
|
||||
public AjaxResult reAssign(@RequestBody ReMaterialParam reMaterialParam) {
|
||||
AjaxResult ajaxResult = toWcsService.reAssign(reMaterialParam);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(reMaterialParam), "重新分配货位",ajaxResult,"WCS");
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 取货无货,重新分配物料
|
||||
*/
|
||||
@PostMapping("/reMaterial")
|
||||
public AjaxResult reMaterial(@RequestBody ReMaterialParam reMaterialParam) {
|
||||
AjaxResult ajaxResult = toWcsService.reMaterial(reMaterialParam);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(reMaterialParam), "重新分配物料",ajaxResult,"WCS");
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,84 +23,9 @@ import java.util.Map;
|
||||
@RequestMapping("/api2wms")
|
||||
public class ToWmsApiController {
|
||||
|
||||
@Autowired
|
||||
private IToWmsService toWmsService;
|
||||
@Autowired
|
||||
private IRequestLogService requestLogService;
|
||||
|
||||
/**
|
||||
* 入库请求生成作业
|
||||
*/
|
||||
@PostMapping("/requestEnterByTrayCode")
|
||||
public AjaxResult requestEnterByTrayCode(@RequestBody RequestEnter requestEnter) {
|
||||
AjaxResult ajaxResult = toWmsService.requestEnterByTrayCode(requestEnter);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(requestEnter), "入库任务创建请求",ajaxResult);
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求补码作业
|
||||
*/
|
||||
@RequestMapping("/requestByNoTrayCode")
|
||||
public AjaxResult requestByNoTrayCode(@RequestBody RequestEnter requestEnter) {
|
||||
AjaxResult ajaxResult = toWmsService.selectMydoJobByEntranceId(requestEnter);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(requestEnter), "请求补码作业",ajaxResult);
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取入库作业
|
||||
*/
|
||||
@RequestMapping("/requestEnterByTrayCodeAndEntranceId")
|
||||
public AjaxResult requestEnterByTrayCodeAndEntranceId(@RequestBody RequestEnter requestEnter) {
|
||||
AjaxResult ajaxResult = toWmsService.requestEnterByTrayCodeAndEntranceId(requestEnter);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(requestEnter), "获取入库作业",ajaxResult);
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 入库、出库 任务完成回传
|
||||
* Map<String, String>
|
||||
* "wmsType": "任务类型" 1-入库 2-出库 3-agv搬运,
|
||||
* taskNo:出库 入库任务号
|
||||
* trayCode:托盘码
|
||||
* positionCode1:起点
|
||||
* positionCode2:终点
|
||||
* containerCode:容器编码
|
||||
*
|
||||
*/
|
||||
@PostMapping("/jobFinish")
|
||||
public AjaxResult jobFinish(@RequestBody WmsJobRequest wmsJobRequest) {
|
||||
AjaxResult ajaxResult = toWmsService.jobFinish(wmsJobRequest);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(wmsJobRequest), "jobFinish",ajaxResult);
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 放货有货,重新分配货位
|
||||
*/
|
||||
@PostMapping("/reAssign")
|
||||
public AjaxResult reAssign(@RequestBody ReMaterialParam reMaterialParam) {
|
||||
AjaxResult ajaxResult = toWmsService.reAssign(reMaterialParam);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(reMaterialParam), "reAssign",ajaxResult);
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 取货无货,重新分配物料
|
||||
*/
|
||||
@PostMapping("/reMaterial")
|
||||
public AjaxResult reMaterial(@RequestBody ReMaterialParam reMaterialParam) {
|
||||
AjaxResult ajaxResult = toWmsService.reMaterial(reMaterialParam);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(reMaterialParam), "reMaterial",ajaxResult);
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user