2025-03-10 13:46:51 +08:00
|
|
|
package com.cim.idm.controller;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
2025-03-24 08:41:44 +08:00
|
|
|
import com.cim.idm.service.Impl.MaterialUndoServiceImpl;
|
2025-03-10 13:46:51 +08:00
|
|
|
import com.cim.idm.service.MESToWMSService;
|
|
|
|
import com.cim.idm.service.Impl.MESToWMSServiceImpl;
|
|
|
|
import com.cim.idm.utils.AjaxResult;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
@Api("接收MES请求接口")
|
|
|
|
@RestController
|
|
|
|
@RequestMapping("/api/wms")
|
|
|
|
@Slf4j
|
|
|
|
public class MESToWMSController {
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private MESToWMSServiceImpl mesToWMSService;
|
|
|
|
|
2025-03-24 08:41:44 +08:00
|
|
|
|
2025-03-10 13:46:51 +08:00
|
|
|
@ApiOperation(value = "物料消耗请求")
|
|
|
|
@RequestMapping(value = "/meswms_materialconsume_request", method = RequestMethod.POST)
|
|
|
|
public AjaxResult materialConsume_Request(@RequestBody JSONArray in) {
|
|
|
|
log.info("Received material consume request: {}", in.toJSONString());
|
|
|
|
try {
|
|
|
|
return mesToWMSService.materialConsume_Request(in);
|
|
|
|
} catch (Exception e) {
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-04-01 16:50:31 +08:00
|
|
|
@ApiOperation(value = "二次确认物料出库请求")
|
2025-03-10 13:46:51 +08:00
|
|
|
@RequestMapping(value = "/meswms_materialout_request", method = RequestMethod.POST)
|
|
|
|
public AjaxResult materialOutByMES(@RequestBody JSONArray in) {
|
|
|
|
log.info("Received material out request: {}", in.toJSONString());
|
|
|
|
try {
|
|
|
|
return mesToWMSService.materialOutByMES(in);
|
|
|
|
} catch (Exception e) {
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@ApiOperation(value = "取消物料入库请求")
|
|
|
|
@RequestMapping(value = "/meswms_cancelship_request", method = RequestMethod.POST)
|
2025-04-01 17:31:06 +08:00
|
|
|
public AjaxResult cancelShipByMES(@RequestBody JSONArray in) {
|
2025-03-10 13:46:51 +08:00
|
|
|
log.info("Received cancel ship request: {}", in.toJSONString());
|
2025-03-24 08:41:44 +08:00
|
|
|
String undoId = in.getJSONObject(0).getString("undoId");
|
|
|
|
String userId = in.getJSONObject(0).getString("userId");
|
|
|
|
// return mesToWMSService.cancelShipByMES(in);
|
2025-04-01 17:31:06 +08:00
|
|
|
try {
|
|
|
|
return mesToWMSService.sapcprkUndo(undoId, userId);
|
|
|
|
} catch (Exception e) {
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
}
|
2025-03-10 13:46:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
@ApiOperation(value = "物料入库请求")
|
|
|
|
@RequestMapping(value = "/meswms_ship_request", method = RequestMethod.POST)
|
2025-04-01 17:31:06 +08:00
|
|
|
public AjaxResult shipByMES(@RequestBody JSONArray in) {
|
2025-03-10 13:46:51 +08:00
|
|
|
log.info("Received ship request: {}", in.toJSONString());
|
2025-04-01 17:31:06 +08:00
|
|
|
try {
|
|
|
|
return mesToWMSService.shipByMES(in);
|
|
|
|
} catch (Exception e) {
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
}
|
2025-03-10 13:46:51 +08:00
|
|
|
}
|
|
|
|
}
|