2025-03-JS-SDK-svr/zi-wms-pda/src/main/java/com/cim/idm/controller/AllocateStockInController.java

59 lines
2.3 KiB
Java
Raw Normal View History

2025-03-24 14:40:15 +08:00
package com.cim.idm.controller;
import com.alibaba.fastjson.JSONObject;
import com.cim.idm.model.BarcodeListByInvoice;
import com.cim.idm.model.HoldAndReleaseDto;
import com.cim.idm.response.BaseResponse;
import com.cim.idm.response.RespGenerator;
import com.cim.idm.service.AllocateStockInService;
import com.cim.idm.utils.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
2025-04-15 16:09:27 +08:00
import org.springframework.beans.factory.annotation.Autowired;
2025-03-24 14:40:15 +08:00
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 javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@RestController
@RequestMapping("/AllocateStockIn")
@Slf4j
@Api(tags = "调拨入库")
public class AllocateStockInController {
2025-04-15 16:09:27 +08:00
private final AllocateStockInService allocateStockInService;
// 构造器注入
public AllocateStockInController(AllocateStockInService allocateStockInService) {
this.allocateStockInService = allocateStockInService;
}
2025-03-24 14:40:15 +08:00
/**
* 调拨入库过账
* @param request
* @param response
* @param barcodeListByInvoice
* @return
*/
@RequestMapping(value = "/commit", method = RequestMethod.POST)
public BaseResponse<Object> commit(HttpServletRequest request,
HttpServletResponse response,
@ApiParam(value = "调拨入库参数", required = true) @RequestBody BarcodeListByInvoice barcodeListByInvoice) {
log.info("AllocateStockInController commit {}", barcodeListByInvoice);
try {
allocateStockInService.allocateStockIn(barcodeListByInvoice.getShipRequestName(),
barcodeListByInvoice.getSiteName(),
barcodeListByInvoice.getUserId(),
2025-05-08 19:04:44 +08:00
barcodeListByInvoice.getErpLocation(),barcodeListByInvoice.getLocationName(),barcodeListByInvoice.getCommitDate());
2025-03-24 14:40:15 +08:00
} catch (Exception e) {
return RespGenerator.returnError(e.toString());
}
return RespGenerator.returnOK(null);
}
}