108 lines
4.0 KiB
Java
108 lines
4.0 KiB
Java
package com.ruoyi.api.controller;
|
||
|
||
|
||
import cn.hutool.json.JSONUtil;
|
||
import com.ruoyi.api.domain.wcsJobHandle.WmsJobHandler;
|
||
import com.ruoyi.api.domain.wcsStockin.WcsStockinReceive;
|
||
import com.ruoyi.api.service.impl.ApiWcsService;
|
||
import com.ruoyi.common.core.controller.BaseController;
|
||
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.*;
|
||
|
||
import java.util.Map;
|
||
|
||
@RestController
|
||
@RequestMapping("/api/wmsService/wcs")
|
||
public class WcsServiceController extends BaseController {
|
||
|
||
@Autowired
|
||
ApiWcsService apiWcsService;
|
||
|
||
@Autowired
|
||
IRequestLogService requestLogService;
|
||
|
||
|
||
/**
|
||
* 请求生成入库作业
|
||
*/
|
||
@PostMapping("/requestMydoJobByTrayCode")
|
||
public AjaxResult requestEnterByTrayCode(@RequestBody WcsStockinReceive wcsStockinReiceive) {
|
||
AjaxResult ajaxResult = apiWcsService.requestMydoJobByTrayCode(wcsStockinReiceive);
|
||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(wcsStockinReiceive), "创建入库任务请求", ajaxResult);
|
||
requestLogService.insertRequestLog(requestLog);
|
||
return ajaxResult;
|
||
}
|
||
|
||
|
||
/**
|
||
* 手动指定货位出库
|
||
*/
|
||
@PostMapping("/stockoutByManual")
|
||
public AjaxResult stockoutByManual(@RequestBody Map<String, String> params) {
|
||
AjaxResult ajaxResult = apiWcsService.stockoutByManual(params);
|
||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(params), "创建入库任务请求", ajaxResult);
|
||
requestLogService.insertRequestLog(requestLog);
|
||
return ajaxResult;
|
||
}
|
||
|
||
|
||
/**
|
||
* 请求补码作业
|
||
*/
|
||
@PostMapping("/requestMydoJobByNoTrayCode")
|
||
public AjaxResult requestByNoTrayCode(@RequestBody WcsStockinReceive wcsStockinReiceive) {
|
||
AjaxResult ajaxResult = apiWcsService.requestMydoJobManual(wcsStockinReiceive);
|
||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(wcsStockinReiceive), "请求补码作业",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 WmsJobHandler wmsJobHandler) {
|
||
AjaxResult ajaxResult = apiWcsService.jobFinish(wmsJobHandler);
|
||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(wmsJobHandler), "wcs任务回传",ajaxResult);
|
||
requestLogService.insertRequestLog(requestLog);
|
||
return ajaxResult;
|
||
}
|
||
|
||
/**
|
||
* 放货有货,重新分配货位
|
||
*/
|
||
@PostMapping("/reAssign")
|
||
public AjaxResult reAssign(@RequestBody WmsJobHandler wmsJobHandler) {
|
||
AjaxResult ajaxResult = apiWcsService.reAssign(wmsJobHandler);
|
||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(wmsJobHandler), "入库重分货位", ajaxResult);
|
||
requestLogService.insertRequestLog(requestLog);
|
||
return ajaxResult;
|
||
}
|
||
|
||
/**
|
||
* 取货无货,重新分配物料
|
||
*/
|
||
@PostMapping("/reMaterial")
|
||
public AjaxResult reMaterial(@RequestBody WmsJobHandler wmsJobHandler) {
|
||
AjaxResult ajaxResult = apiWcsService.reMaterial(wmsJobHandler);
|
||
// RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(wmsJobHandler), "取货无货重分物料",ajaxResult);
|
||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(wmsJobHandler), "取货无货任务作废-货位需要盘点",ajaxResult);
|
||
requestLogService.insertRequestLog(requestLog);
|
||
return ajaxResult;
|
||
}
|
||
|
||
|
||
|
||
}
|