2025-03-10 13:46:51 +08:00
|
|
|
package com.cim.idm.controller;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
2025-03-31 15:02:54 +08:00
|
|
|
import com.cim.idm.model.po.MaterialReceiveRequest;
|
2025-03-10 13:46:51 +08:00
|
|
|
import com.cim.idm.utils.AjaxResult;
|
|
|
|
import com.cim.idm.wmspackage.materialpacking.management.data.MaterialPacking;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
|
|
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;
|
|
|
|
|
|
|
|
import com.cim.idm.service.ChargeSplitService;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* PC成品入库和批次拆分
|
|
|
|
* @author ZXYGY17
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
@RestController
|
|
|
|
@RequestMapping("/api/SplitCharge")
|
|
|
|
@EnableAutoConfiguration
|
|
|
|
public class ChargeSplitController {
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private ChargeSplitService ChargeSplitService;
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/SplitCharge", method = RequestMethod.POST)
|
|
|
|
public AjaxResult SplitCharge(@RequestBody JSONObject in ) throws Exception {
|
|
|
|
MaterialReceiveRequest sl = JSON.toJavaObject(in, MaterialReceiveRequest.class);
|
|
|
|
String user = sl.getUser();
|
|
|
|
List<MaterialPacking> boxList = sl.getBoxList();
|
|
|
|
|
|
|
|
boolean moveTransformOut = ChargeSplitService.ChargeSplit(boxList, user);
|
|
|
|
if (moveTransformOut != true) {
|
2025-04-23 18:34:12 +08:00
|
|
|
throw new RuntimeException("拆分失败");
|
2025-03-10 13:46:51 +08:00
|
|
|
} else {
|
|
|
|
return AjaxResult.me().setSuccess(true).setResultObj(null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|