出库确认
This commit is contained in:
@@ -41,11 +41,15 @@ public class ToErpApiController {
|
||||
return toErpService.receiveSupplier();
|
||||
}
|
||||
|
||||
/**
|
||||
* 接收出库单信息
|
||||
*/
|
||||
@GetMapping("/outStockList")
|
||||
public AjaxResult outStockList(){
|
||||
return toErpService.receiveOutStockList();
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/login")
|
||||
public AjaxResult login() {
|
||||
toErpService.login();
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.ruoyi.api.domain.erp;
|
||||
|
||||
import cn.hutool.core.annotation.Alias;
|
||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CallErpResponse {
|
||||
@Alias("Code")
|
||||
private Integer code;
|
||||
@Alias("Msg")
|
||||
private String msg;
|
||||
}
|
||||
@@ -20,11 +20,12 @@ public class ErpOutStockListParam {
|
||||
private String pro_name;
|
||||
private String Order1;
|
||||
private String Type1;
|
||||
private String Date3_start;
|
||||
private String Date3_end;
|
||||
private String Date3_start;//申请开始时间
|
||||
private String Date3_end;//申请结束时间
|
||||
private String Date5_start;
|
||||
private String Date5_end;
|
||||
private int needList;
|
||||
private int page_size;
|
||||
private int page_index;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.ruoyi.api.domain.erp;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class ReceiveOutStockConfirm {
|
||||
private Integer ord;
|
||||
|
||||
private Integer complete1;
|
||||
|
||||
private String intro2;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date date5;
|
||||
|
||||
private List<Kuout> kuoutList;
|
||||
|
||||
@JsonProperty("!B__SysCusmf_0_62001_511_0")
|
||||
private String sysCusmfField511;
|
||||
|
||||
@JsonProperty("!B__SysCusmf_0_62001_512_0")
|
||||
private String sysCusmfField512;
|
||||
|
||||
@JsonProperty("!B__SysCusmf_0_62001_513_0")
|
||||
private String sysCusmfField513;
|
||||
|
||||
@JsonProperty("!B__SysCusmf_0_62001_514_0")
|
||||
private String sysCusmfField514;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class Kuout {
|
||||
@JsonProperty("Id")
|
||||
private Integer id;
|
||||
|
||||
@JsonProperty("Num1")
|
||||
private Integer num1;
|
||||
|
||||
@JsonProperty("Ck")
|
||||
private Integer ck;
|
||||
|
||||
@JsonProperty("WareHousePositionID")
|
||||
private Integer wareHousePositionID;
|
||||
|
||||
@JsonProperty("Bz")
|
||||
private String bz;
|
||||
|
||||
@JsonProperty("Js")
|
||||
private String js;
|
||||
|
||||
@JsonProperty("date2")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date date2;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.api.service;
|
||||
|
||||
import com.ruoyi.api.domain.erp.ReceiveOutStockConfirm;
|
||||
import com.ruoyi.bas.BasCustomer.domain.BasCustomer;
|
||||
import com.ruoyi.bas.BasProduct.domain.BasProduct;
|
||||
import com.ruoyi.bas.BasSupplier.domain.BasSupplier;
|
||||
@@ -25,5 +26,6 @@ public interface IToErpService {
|
||||
|
||||
String login();
|
||||
|
||||
AjaxResult callErp(ReceiveOutStockConfirm receiveOutStockConfirm);
|
||||
AjaxResult receiveOutStockList();
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.ruoyi.api.domain.erp.*;
|
||||
import com.ruoyi.api.service.IToErpService;
|
||||
@@ -19,11 +21,16 @@ import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.utils.uuid.UUID;
|
||||
import com.ruoyi.out.ErpOutStock.domain.ErpOutStock;
|
||||
import com.ruoyi.out.OutStockMiddle.domain.OutStockMiddle;
|
||||
import com.ruoyi.out.ErpOutStockDetail.domain.ErpOutStockDetail;
|
||||
import com.ruoyi.out.ErpOutStockDetail.service.IErpOutStockDetailService;
|
||||
import com.ruoyi.out.outStockout.domain.OutStockout;
|
||||
import com.ruoyi.out.ErpOutStock.service.IErpOutStockService;
|
||||
import com.ruoyi.out.outStockout.service.IOutStockoutService;
|
||||
import com.ruoyi.out.OutStockMiddle.service.IOutStockMiddleService;
|
||||
import com.ruoyi.bas.basJobId.service.IBasJobIdService;
|
||||
import com.ruoyi.out.outStockoutDetail.domain.OutStockoutDetail;
|
||||
import com.ruoyi.out.ErpOutStockDetail.service.IErpOutStockDetailService;
|
||||
import com.ruoyi.out.outStockoutDetail.service.IOutStockoutDetailService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -52,6 +59,12 @@ public class ToErpServiceImpl implements IToErpService {
|
||||
@Autowired
|
||||
private IOutStockMiddleService outStockMiddleService;
|
||||
|
||||
@Autowired
|
||||
private IErpOutStockDetailService erpOutStockDetailService;
|
||||
|
||||
@Autowired
|
||||
private IOutStockoutDetailService outStockoutDetailService;
|
||||
|
||||
@Autowired
|
||||
private IBasJobIdService basJobIdService;
|
||||
|
||||
@@ -71,6 +84,7 @@ public class ToErpServiceImpl implements IToErpService {
|
||||
|
||||
private static final String TOKEN_KEY = "ZBAPI-Token";
|
||||
private static final String outStockListUrl = erpUrl+"/webapi/v3/store/KuOutApplyList";
|
||||
private static final String outStockConfirmUrl = erpUrl+"/webapi/v3/store/KuOutApplyEdit/edit";
|
||||
|
||||
|
||||
@Override
|
||||
@@ -194,17 +208,33 @@ public class ToErpServiceImpl implements IToErpService {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public AjaxResult receiveOutStockList() {
|
||||
ErpOutStockListParam erpOutStockListParam = new ErpOutStockListParam();
|
||||
OutStockMiddle outStockMiddle = new OutStockMiddle();
|
||||
OutStockMiddle outStockMiddle1 = outStockMiddleService.selectOutStockMiddleByStockoutId("1");
|
||||
erpOutStockListParam.setDate3_end(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
||||
// 判断是否有上次访问时间
|
||||
if (ObjUtil.isNotNull(outStockMiddle1)){
|
||||
erpOutStockListParam.setDate3_start(outStockMiddle1.getCreateDate());
|
||||
outStockMiddle1.setCreateDate(erpOutStockListParam.getDate3_end());
|
||||
outStockMiddleService.updateOutStockMiddle(outStockMiddle1);
|
||||
}else {
|
||||
erpOutStockListParam.setDate3_start("");
|
||||
outStockMiddle.setStockoutId("1");
|
||||
outStockMiddle.setCreateDate(erpOutStockListParam.getDate3_end());
|
||||
outStockMiddleService.insertOutStockMiddle(outStockMiddle);
|
||||
}
|
||||
erpOutStockListParam.setPage_index(0);
|
||||
erpOutStockListParam.setPage_size(0);
|
||||
erpOutStockListParam.setNeedList(1);
|
||||
// 访问erp出库列表给主表添加数据
|
||||
String body=HttpRequest.post(outStockListUrl).header("ZBAPI-Token", login()).body(JSONUtil.toJsonStr(erpOutStockListParam)).execute().body();
|
||||
ErpOutStockListResponse responseBean = JSONUtil.toBean(body, ErpOutStockListResponse.class);
|
||||
for (List<Object> row : responseBean.getRows()) {
|
||||
ErpOutStock erpOutStock = new ErpOutStock();
|
||||
OutStockout outStockout = new OutStockout();
|
||||
OutStockMiddle outStockMiddle = new OutStockMiddle();
|
||||
erpOutStock.setStockoutId(Convert.toStr(row.get(0)));
|
||||
erpOutStock.setTheme(Convert.toStr(row.get(1)));
|
||||
erpOutStock.setWarehouse(Convert.toStr(row.get(2)));
|
||||
@@ -235,19 +265,16 @@ public class ToErpServiceImpl implements IToErpService {
|
||||
erpOutStock.setSpare4(Convert.toStr(row.get(27)));
|
||||
String stockOutId = basJobIdService.getJobId("CKD");
|
||||
outStockout.setStockoutId(stockOutId);
|
||||
outStockout.setWarehouseId(Convert.toStr(row.get(2)));
|
||||
outStockout.setErpStockoutId(Convert.toStr(row.get(0)));
|
||||
outStockout.setStockoutGuid(UUID.randomUUID().toString());
|
||||
outStockout.setStockoutGuid(stockOutId);
|
||||
outStockout.setCreateDate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
||||
outStockout.setOutType("1");
|
||||
outStockout.setStatus("1");
|
||||
outStockMiddle.setStockoutId(stockOutId);
|
||||
outStockMiddle.setCreateDate(outStockout.getCreateDate());
|
||||
outStockMiddle.setStatus("0");
|
||||
ErpOutStock outStock1 = erpOutStockService.selectErpOutStockByStockoutId(erpOutStock.getStockoutId());
|
||||
ErpOutStock erpOutStock1 = erpOutStockService.selectErpOutStockByStockoutId(erpOutStock.getStockoutId());
|
||||
OutStockout outStockout1 = outStockoutService.selectOutStockoutByStockoutGuid(outStockout.getStockoutGuid());
|
||||
OutStockMiddle outStockMiddle1 = outStockMiddleService.selectOutStockMiddleByStockoutId(outStockMiddle.getStockoutId());
|
||||
if (ObjUtil.isNotNull(outStock1)){
|
||||
erpOutStockService.updateErpOutStock(outStock1);
|
||||
if (ObjUtil.isNotNull(erpOutStock1)){
|
||||
erpOutStockService.updateErpOutStock(erpOutStock1);
|
||||
}else {
|
||||
erpOutStockService.insertErpOutStock(erpOutStock);
|
||||
}
|
||||
@@ -256,15 +283,75 @@ public class ToErpServiceImpl implements IToErpService {
|
||||
}else {
|
||||
outStockoutService.insertOutStockout(outStockout);
|
||||
}
|
||||
if (ObjUtil.isNotNull(outStockMiddle1)){
|
||||
outStockMiddleService.updateOutStockMiddle(outStockMiddle1);
|
||||
}else {
|
||||
outStockMiddleService.insertOutStockMiddle(outStockMiddle);
|
||||
// 解析JSON字符串给子表添加数据
|
||||
JSONObject jsonObject = JSONUtil.parseObj(erpOutStock.getProductDetails());
|
||||
JSONArray rows = jsonObject.getJSONArray("Rows");
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
ErpOutStockDetail detail = new ErpOutStockDetail();
|
||||
OutStockoutDetail outStockoutDetail = new OutStockoutDetail();
|
||||
JSONArray row1 = rows.getJSONArray(i);
|
||||
detail.setId(Convert.toLong(row1.get(0)));
|
||||
detail.setProductName(Convert.toStr(row1.get(1)));
|
||||
detail.setProductCode(Convert.toStr(row1.get(2)));
|
||||
detail.setProductModel(Convert.toStr(row1.get(3)));
|
||||
detail.setQuantity(Convert.toBigDecimal(row1.get(4)));
|
||||
detail.setUnitPrice(Convert.toBigDecimal(row1.get(5)));
|
||||
detail.setTotalPrice(Convert.toBigDecimal(row1.get(6)));
|
||||
detail.setAuxiliaryQuantity(Convert.toBigDecimal(row1.get(7)));
|
||||
detail.setCostUnitPrice(Convert.toBigDecimal(row1.get(8)));
|
||||
detail.setCostTotalPrice(Convert.toBigDecimal(row1.get(9)));
|
||||
detail.setAccountingCostTotalPrice(Convert.toBigDecimal(row1.get(10)));
|
||||
detail.setAccountingQuantity(Convert.toBigDecimal(row1.get(11)));
|
||||
detail.setAccountingStatus(Convert.toLong(row1.get(12)));
|
||||
detail.setBatchNumber(Convert.toStr(row1.get(13)));
|
||||
detail.setSerialNumber(Convert.toStr(row1.get(14)));
|
||||
detail.setProductionDate(Convert.toStr(row1.get(15)));
|
||||
detail.setExpiryDate(Convert.toStr(row1.get(16)));
|
||||
detail.setUnitId(Convert.toLong(row1.get(17)));
|
||||
detail.setProductAttribute1(Convert.toLong(row1.get(18)));
|
||||
detail.setProductAttribute2(Convert.toLong(row1.get(19)));
|
||||
detail.setRemark(Convert.toStr(row1.get(20)));
|
||||
detail.setPackaging(Convert.toStr(row1.get(21)));
|
||||
detail.setPackageCount(Convert.toLong(row1.get(22)));
|
||||
detail.setWarehouseId(Convert.toLong(row1.get(23)));
|
||||
detail.setStorageLocationId(Convert.toLong(row1.get(24)));
|
||||
detail.setParentInboundOrderId(Convert.toLong(row1.get(25)));
|
||||
detail.setRelatedDocumentId(Convert.toLong(row1.get(26)));
|
||||
detail.setCustomField1(Convert.toStr(row1.get(27)));
|
||||
detail.setCustomField2(Convert.toStr(row1.get(28)));
|
||||
detail.setCustomField3(Convert.toStr(row1.get(29)));
|
||||
detail.setCustomField4(Convert.toStr(row1.get(30)));
|
||||
detail.setCustomField5(Convert.toStr(row1.get(31)));
|
||||
detail.setCustomField6(Convert.toStr(row1.get(32)));
|
||||
detail.setHandlerId(Convert.toLong(row1.get(33)));
|
||||
outStockoutDetail.setStockoutDetailId(stockOutId + "-" + (i + 1));
|
||||
outStockoutDetail.setStockoutGuid(outStockout.getStockoutGuid());
|
||||
outStockoutDetail.setStockoutId(stockOutId);
|
||||
outStockoutDetail.setProductId(detail.getProductCode());
|
||||
outStockoutDetail.setQuantity(detail.getQuantity());
|
||||
outStockoutDetail.setProductName(detail.getProductName());
|
||||
outStockoutDetail.setFid(Convert.toStr(detail.getId()));
|
||||
ErpOutStockDetail erpOutStockDetail1 = erpOutStockDetailService.selectErpOutStockDetailById(detail.getId());
|
||||
OutStockoutDetail outStockoutDetail1 = outStockoutDetailService.selectOutStockoutDetailByStockoutDetailId(outStockoutDetail.getStockoutDetailId());
|
||||
if (ObjUtil.isNotNull(erpOutStockDetail1)){
|
||||
erpOutStockDetailService.updateErpOutStockDetail(erpOutStockDetail1);
|
||||
}else {
|
||||
erpOutStockDetailService.insertErpOutStockDetail(detail);
|
||||
}
|
||||
if (ObjUtil.isNotNull(outStockoutDetail1)){
|
||||
outStockoutDetailService.updateOutStockoutDetail(outStockoutDetail1);
|
||||
}else {
|
||||
outStockoutDetailService.insertOutStockoutDetail(outStockoutDetail);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String login() {
|
||||
LoginParam loginParam = new LoginParam();
|
||||
@@ -287,4 +374,22 @@ public class ToErpServiceImpl implements IToErpService {
|
||||
return redisCache.getCacheObject("erpSession");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult callErp(ReceiveOutStockConfirm receiveOutStockConfirm) {
|
||||
String body=HttpRequest.post(outStockConfirmUrl).header("ZBAPI-Token", login()).body(JSONUtil.toJsonStr(receiveOutStockConfirm)).execute().body();
|
||||
CallErpResponse callErpResponse = JSONUtil.toBean(body, CallErpResponse.class);
|
||||
if (callErpResponse.getCode()==200){
|
||||
return AjaxResult.success();
|
||||
}else {
|
||||
if (callErpResponse.getCode()==300){
|
||||
return AjaxResult.error("请求失败");
|
||||
}else if (callErpResponse.getCode()==400){
|
||||
return AjaxResult.error("token验证失败");
|
||||
}else if (callErpResponse.getCode()==500){
|
||||
return AjaxResult.error("服务器内部错误");
|
||||
}
|
||||
return AjaxResult.error(callErpResponse.getMsg());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.ruoyi.out.ErpOutStockDetail.controller;
|
||||
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.out.ErpOutStockDetail.domain.ErpOutStockDetail;
|
||||
import com.ruoyi.out.ErpOutStockDetail.service.IErpOutStockDetailService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 出库子表关联表Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-12-06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/out/ErpOutStockDetail")
|
||||
public class ErpOutStockDetailController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IErpOutStockDetailService erpOutStockDetailService;
|
||||
|
||||
/**
|
||||
* 查询出库子表关联表列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('out:ErpOutStockDetail:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ErpOutStockDetail erpOutStockDetail)
|
||||
{
|
||||
startPage();
|
||||
List<ErpOutStockDetail> list = erpOutStockDetailService.selectErpOutStockDetailList(erpOutStockDetail);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出出库子表关联表列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('out:ErpOutStockDetail:export')")
|
||||
@Log(title = "出库子表关联表", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ErpOutStockDetail erpOutStockDetail)
|
||||
{
|
||||
List<ErpOutStockDetail> list = erpOutStockDetailService.selectErpOutStockDetailList(erpOutStockDetail);
|
||||
ExcelUtil<ErpOutStockDetail> util = new ExcelUtil<ErpOutStockDetail>(ErpOutStockDetail.class);
|
||||
util.exportExcel(response, list, "出库子表关联表数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取出库子表关联表详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('out:ErpOutStockDetail:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(erpOutStockDetailService.selectErpOutStockDetailById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增出库子表关联表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('out:ErpOutStockDetail:add')")
|
||||
@Log(title = "出库子表关联表", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ErpOutStockDetail erpOutStockDetail)
|
||||
{
|
||||
return toAjax(erpOutStockDetailService.insertErpOutStockDetail(erpOutStockDetail));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改出库子表关联表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('out:ErpOutStockDetail:edit')")
|
||||
@Log(title = "出库子表关联表", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ErpOutStockDetail erpOutStockDetail)
|
||||
{
|
||||
return toAjax(erpOutStockDetailService.updateErpOutStockDetail(erpOutStockDetail));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除出库子表关联表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('out:ErpOutStockDetail:remove')")
|
||||
@Log(title = "出库子表关联表", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(erpOutStockDetailService.deleteErpOutStockDetailByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,520 @@
|
||||
package com.ruoyi.out.ErpOutStockDetail.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 出库子表关联表对象 erp_out_stock_detail
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-12-06
|
||||
*/
|
||||
public class ErpOutStockDetail extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 出库明细ID */
|
||||
@Excel(name = "出库明细ID")
|
||||
private Long id;
|
||||
|
||||
/** 产品名称 */
|
||||
@Excel(name = "产品名称")
|
||||
private String productName;
|
||||
|
||||
/** 产品编号 */
|
||||
@Excel(name = "产品编号")
|
||||
private String productCode;
|
||||
|
||||
/** 产品型号 */
|
||||
@Excel(name = "产品型号")
|
||||
private String productModel;
|
||||
|
||||
/** 数量 */
|
||||
@Excel(name = "数量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
/** 单价 */
|
||||
@Excel(name = "单价")
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/** 总价 */
|
||||
@Excel(name = "总价")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/** 辅助数量 */
|
||||
@Excel(name = "辅助数量")
|
||||
private BigDecimal auxiliaryQuantity;
|
||||
|
||||
/** 成本单价 */
|
||||
@Excel(name = "成本单价")
|
||||
private BigDecimal costUnitPrice;
|
||||
|
||||
/** 成本总价 */
|
||||
@Excel(name = "成本总价")
|
||||
private BigDecimal costTotalPrice;
|
||||
|
||||
/** 核算成本总价 */
|
||||
@Excel(name = "核算成本总价")
|
||||
private BigDecimal accountingCostTotalPrice;
|
||||
|
||||
/** 核算数量 */
|
||||
@Excel(name = "核算数量")
|
||||
private BigDecimal accountingQuantity;
|
||||
|
||||
/** 核算状态 */
|
||||
@Excel(name = "核算状态")
|
||||
private Long accountingStatus;
|
||||
|
||||
/** 批号 */
|
||||
@Excel(name = "批号")
|
||||
private String batchNumber;
|
||||
|
||||
/** 序列号 */
|
||||
@Excel(name = "序列号")
|
||||
private String serialNumber;
|
||||
|
||||
/** 生产日期 */
|
||||
@Excel(name = "生产日期")
|
||||
private String productionDate;
|
||||
|
||||
/** 有效日期 */
|
||||
@Excel(name = "有效日期")
|
||||
private String expiryDate;
|
||||
|
||||
/** 单位 */
|
||||
@Excel(name = "单位")
|
||||
private Long unitId;
|
||||
|
||||
/** 产品属性1 */
|
||||
@Excel(name = "产品属性1")
|
||||
private Long productAttribute1;
|
||||
|
||||
/** 产品属性2 */
|
||||
@Excel(name = "产品属性2")
|
||||
private Long productAttribute2;
|
||||
|
||||
/** 包装 */
|
||||
@Excel(name = "包装")
|
||||
private String packaging;
|
||||
|
||||
/** 件数 */
|
||||
@Excel(name = "件数")
|
||||
private Long packageCount;
|
||||
|
||||
/** 仓库 */
|
||||
@Excel(name = "仓库")
|
||||
private Long warehouseId;
|
||||
|
||||
/** 库位id */
|
||||
@Excel(name = "库位id")
|
||||
private Long storageLocationId;
|
||||
|
||||
/** 关联父入库单 */
|
||||
@Excel(name = "关联父入库单")
|
||||
private Long parentInboundOrderId;
|
||||
|
||||
/** 关联单据 */
|
||||
@Excel(name = "关联单据")
|
||||
private Long relatedDocumentId;
|
||||
|
||||
/** 自定义1 */
|
||||
@Excel(name = "自定义1")
|
||||
private String customField1;
|
||||
|
||||
/** 自定义2 */
|
||||
@Excel(name = "自定义2")
|
||||
private String customField2;
|
||||
|
||||
/** 自定义3 */
|
||||
@Excel(name = "自定义3")
|
||||
private String customField3;
|
||||
|
||||
/** 自定义4 */
|
||||
@Excel(name = "自定义4")
|
||||
private String customField4;
|
||||
|
||||
/** 自定义5 */
|
||||
@Excel(name = "自定义5")
|
||||
private String customField5;
|
||||
|
||||
/** 自定义6 */
|
||||
@Excel(name = "自定义6")
|
||||
private String customField6;
|
||||
|
||||
/** 装卸工 */
|
||||
@Excel(name = "装卸工")
|
||||
private Long handlerId;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setProductName(String productName)
|
||||
{
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public String getProductName()
|
||||
{
|
||||
return productName;
|
||||
}
|
||||
|
||||
public void setProductCode(String productCode)
|
||||
{
|
||||
this.productCode = productCode;
|
||||
}
|
||||
|
||||
public String getProductCode()
|
||||
{
|
||||
return productCode;
|
||||
}
|
||||
|
||||
public void setProductModel(String productModel)
|
||||
{
|
||||
this.productModel = productModel;
|
||||
}
|
||||
|
||||
public String getProductModel()
|
||||
{
|
||||
return productModel;
|
||||
}
|
||||
|
||||
public void setQuantity(BigDecimal quantity)
|
||||
{
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public BigDecimal getQuantity()
|
||||
{
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setUnitPrice(BigDecimal unitPrice)
|
||||
{
|
||||
this.unitPrice = unitPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getUnitPrice()
|
||||
{
|
||||
return unitPrice;
|
||||
}
|
||||
|
||||
public void setTotalPrice(BigDecimal totalPrice)
|
||||
{
|
||||
this.totalPrice = totalPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalPrice()
|
||||
{
|
||||
return totalPrice;
|
||||
}
|
||||
|
||||
public void setAuxiliaryQuantity(BigDecimal auxiliaryQuantity)
|
||||
{
|
||||
this.auxiliaryQuantity = auxiliaryQuantity;
|
||||
}
|
||||
|
||||
public BigDecimal getAuxiliaryQuantity()
|
||||
{
|
||||
return auxiliaryQuantity;
|
||||
}
|
||||
|
||||
public void setCostUnitPrice(BigDecimal costUnitPrice)
|
||||
{
|
||||
this.costUnitPrice = costUnitPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getCostUnitPrice()
|
||||
{
|
||||
return costUnitPrice;
|
||||
}
|
||||
|
||||
public void setCostTotalPrice(BigDecimal costTotalPrice)
|
||||
{
|
||||
this.costTotalPrice = costTotalPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getCostTotalPrice()
|
||||
{
|
||||
return costTotalPrice;
|
||||
}
|
||||
|
||||
public void setAccountingCostTotalPrice(BigDecimal accountingCostTotalPrice)
|
||||
{
|
||||
this.accountingCostTotalPrice = accountingCostTotalPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getAccountingCostTotalPrice()
|
||||
{
|
||||
return accountingCostTotalPrice;
|
||||
}
|
||||
|
||||
public void setAccountingQuantity(BigDecimal accountingQuantity)
|
||||
{
|
||||
this.accountingQuantity = accountingQuantity;
|
||||
}
|
||||
|
||||
public BigDecimal getAccountingQuantity()
|
||||
{
|
||||
return accountingQuantity;
|
||||
}
|
||||
|
||||
public void setAccountingStatus(Long accountingStatus)
|
||||
{
|
||||
this.accountingStatus = accountingStatus;
|
||||
}
|
||||
|
||||
public Long getAccountingStatus()
|
||||
{
|
||||
return accountingStatus;
|
||||
}
|
||||
|
||||
public void setBatchNumber(String batchNumber)
|
||||
{
|
||||
this.batchNumber = batchNumber;
|
||||
}
|
||||
|
||||
public String getBatchNumber()
|
||||
{
|
||||
return batchNumber;
|
||||
}
|
||||
|
||||
public void setSerialNumber(String serialNumber)
|
||||
{
|
||||
this.serialNumber = serialNumber;
|
||||
}
|
||||
|
||||
public String getSerialNumber()
|
||||
{
|
||||
return serialNumber;
|
||||
}
|
||||
|
||||
public void setProductionDate(String productionDate)
|
||||
{
|
||||
this.productionDate = productionDate;
|
||||
}
|
||||
|
||||
public String getProductionDate()
|
||||
{
|
||||
return productionDate;
|
||||
}
|
||||
|
||||
public void setExpiryDate(String expiryDate)
|
||||
{
|
||||
this.expiryDate = expiryDate;
|
||||
}
|
||||
|
||||
public String getExpiryDate()
|
||||
{
|
||||
return expiryDate;
|
||||
}
|
||||
|
||||
public void setUnitId(Long unitId)
|
||||
{
|
||||
this.unitId = unitId;
|
||||
}
|
||||
|
||||
public Long getUnitId()
|
||||
{
|
||||
return unitId;
|
||||
}
|
||||
|
||||
public void setProductAttribute1(Long productAttribute1)
|
||||
{
|
||||
this.productAttribute1 = productAttribute1;
|
||||
}
|
||||
|
||||
public Long getProductAttribute1()
|
||||
{
|
||||
return productAttribute1;
|
||||
}
|
||||
|
||||
public void setProductAttribute2(Long productAttribute2)
|
||||
{
|
||||
this.productAttribute2 = productAttribute2;
|
||||
}
|
||||
|
||||
public Long getProductAttribute2()
|
||||
{
|
||||
return productAttribute2;
|
||||
}
|
||||
|
||||
public void setPackaging(String packaging)
|
||||
{
|
||||
this.packaging = packaging;
|
||||
}
|
||||
|
||||
public String getPackaging()
|
||||
{
|
||||
return packaging;
|
||||
}
|
||||
|
||||
public void setPackageCount(Long packageCount)
|
||||
{
|
||||
this.packageCount = packageCount;
|
||||
}
|
||||
|
||||
public Long getPackageCount()
|
||||
{
|
||||
return packageCount;
|
||||
}
|
||||
|
||||
public void setWarehouseId(Long warehouseId)
|
||||
{
|
||||
this.warehouseId = warehouseId;
|
||||
}
|
||||
|
||||
public Long getWarehouseId()
|
||||
{
|
||||
return warehouseId;
|
||||
}
|
||||
|
||||
public void setStorageLocationId(Long storageLocationId)
|
||||
{
|
||||
this.storageLocationId = storageLocationId;
|
||||
}
|
||||
|
||||
public Long getStorageLocationId()
|
||||
{
|
||||
return storageLocationId;
|
||||
}
|
||||
|
||||
public void setParentInboundOrderId(Long parentInboundOrderId)
|
||||
{
|
||||
this.parentInboundOrderId = parentInboundOrderId;
|
||||
}
|
||||
|
||||
public Long getParentInboundOrderId()
|
||||
{
|
||||
return parentInboundOrderId;
|
||||
}
|
||||
|
||||
public void setRelatedDocumentId(Long relatedDocumentId)
|
||||
{
|
||||
this.relatedDocumentId = relatedDocumentId;
|
||||
}
|
||||
|
||||
public Long getRelatedDocumentId()
|
||||
{
|
||||
return relatedDocumentId;
|
||||
}
|
||||
|
||||
public void setCustomField1(String customField1)
|
||||
{
|
||||
this.customField1 = customField1;
|
||||
}
|
||||
|
||||
public String getCustomField1()
|
||||
{
|
||||
return customField1;
|
||||
}
|
||||
|
||||
public void setCustomField2(String customField2)
|
||||
{
|
||||
this.customField2 = customField2;
|
||||
}
|
||||
|
||||
public String getCustomField2()
|
||||
{
|
||||
return customField2;
|
||||
}
|
||||
|
||||
public void setCustomField3(String customField3)
|
||||
{
|
||||
this.customField3 = customField3;
|
||||
}
|
||||
|
||||
public String getCustomField3()
|
||||
{
|
||||
return customField3;
|
||||
}
|
||||
|
||||
public void setCustomField4(String customField4)
|
||||
{
|
||||
this.customField4 = customField4;
|
||||
}
|
||||
|
||||
public String getCustomField4()
|
||||
{
|
||||
return customField4;
|
||||
}
|
||||
|
||||
public void setCustomField5(String customField5)
|
||||
{
|
||||
this.customField5 = customField5;
|
||||
}
|
||||
|
||||
public String getCustomField5()
|
||||
{
|
||||
return customField5;
|
||||
}
|
||||
|
||||
public void setCustomField6(String customField6)
|
||||
{
|
||||
this.customField6 = customField6;
|
||||
}
|
||||
|
||||
public String getCustomField6()
|
||||
{
|
||||
return customField6;
|
||||
}
|
||||
|
||||
public void setHandlerId(Long handlerId)
|
||||
{
|
||||
this.handlerId = handlerId;
|
||||
}
|
||||
|
||||
public Long getHandlerId()
|
||||
{
|
||||
return handlerId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("productName", getProductName())
|
||||
.append("productCode", getProductCode())
|
||||
.append("productModel", getProductModel())
|
||||
.append("quantity", getQuantity())
|
||||
.append("unitPrice", getUnitPrice())
|
||||
.append("totalPrice", getTotalPrice())
|
||||
.append("auxiliaryQuantity", getAuxiliaryQuantity())
|
||||
.append("costUnitPrice", getCostUnitPrice())
|
||||
.append("costTotalPrice", getCostTotalPrice())
|
||||
.append("accountingCostTotalPrice", getAccountingCostTotalPrice())
|
||||
.append("accountingQuantity", getAccountingQuantity())
|
||||
.append("accountingStatus", getAccountingStatus())
|
||||
.append("batchNumber", getBatchNumber())
|
||||
.append("serialNumber", getSerialNumber())
|
||||
.append("productionDate", getProductionDate())
|
||||
.append("expiryDate", getExpiryDate())
|
||||
.append("unitId", getUnitId())
|
||||
.append("productAttribute1", getProductAttribute1())
|
||||
.append("productAttribute2", getProductAttribute2())
|
||||
.append("remark", getRemark())
|
||||
.append("packaging", getPackaging())
|
||||
.append("packageCount", getPackageCount())
|
||||
.append("warehouseId", getWarehouseId())
|
||||
.append("storageLocationId", getStorageLocationId())
|
||||
.append("parentInboundOrderId", getParentInboundOrderId())
|
||||
.append("relatedDocumentId", getRelatedDocumentId())
|
||||
.append("customField1", getCustomField1())
|
||||
.append("customField2", getCustomField2())
|
||||
.append("customField3", getCustomField3())
|
||||
.append("customField4", getCustomField4())
|
||||
.append("customField5", getCustomField5())
|
||||
.append("customField6", getCustomField6())
|
||||
.append("handlerId", getHandlerId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.out.ErpOutStockDetail.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.out.ErpOutStockDetail.domain.ErpOutStockDetail;
|
||||
|
||||
/**
|
||||
* 出库子表关联表Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-12-06
|
||||
*/
|
||||
public interface ErpOutStockDetailMapper
|
||||
{
|
||||
/**
|
||||
* 查询出库子表关联表
|
||||
*
|
||||
* @param id 出库子表关联表主键
|
||||
* @return 出库子表关联表
|
||||
*/
|
||||
public ErpOutStockDetail selectErpOutStockDetailById(Long id);
|
||||
|
||||
/**
|
||||
* 查询出库子表关联表列表
|
||||
*
|
||||
* @param erpOutStockDetail 出库子表关联表
|
||||
* @return 出库子表关联表集合
|
||||
*/
|
||||
public List<ErpOutStockDetail> selectErpOutStockDetailList(ErpOutStockDetail erpOutStockDetail);
|
||||
|
||||
/**
|
||||
* 新增出库子表关联表
|
||||
*
|
||||
* @param erpOutStockDetail 出库子表关联表
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertErpOutStockDetail(ErpOutStockDetail erpOutStockDetail);
|
||||
|
||||
/**
|
||||
* 修改出库子表关联表
|
||||
*
|
||||
* @param erpOutStockDetail 出库子表关联表
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateErpOutStockDetail(ErpOutStockDetail erpOutStockDetail);
|
||||
|
||||
/**
|
||||
* 删除出库子表关联表
|
||||
*
|
||||
* @param id 出库子表关联表主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteErpOutStockDetailById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除出库子表关联表
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteErpOutStockDetailByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.out.ErpOutStockDetail.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.out.ErpOutStockDetail.domain.ErpOutStockDetail;
|
||||
|
||||
/**
|
||||
* 出库子表关联表Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-12-06
|
||||
*/
|
||||
public interface IErpOutStockDetailService
|
||||
{
|
||||
/**
|
||||
* 查询出库子表关联表
|
||||
*
|
||||
* @param id 出库子表关联表主键
|
||||
* @return 出库子表关联表
|
||||
*/
|
||||
public ErpOutStockDetail selectErpOutStockDetailById(Long id);
|
||||
|
||||
/**
|
||||
* 查询出库子表关联表列表
|
||||
*
|
||||
* @param erpOutStockDetail 出库子表关联表
|
||||
* @return 出库子表关联表集合
|
||||
*/
|
||||
public List<ErpOutStockDetail> selectErpOutStockDetailList(ErpOutStockDetail erpOutStockDetail);
|
||||
|
||||
/**
|
||||
* 新增出库子表关联表
|
||||
*
|
||||
* @param erpOutStockDetail 出库子表关联表
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertErpOutStockDetail(ErpOutStockDetail erpOutStockDetail);
|
||||
|
||||
/**
|
||||
* 修改出库子表关联表
|
||||
*
|
||||
* @param erpOutStockDetail 出库子表关联表
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateErpOutStockDetail(ErpOutStockDetail erpOutStockDetail);
|
||||
|
||||
/**
|
||||
* 批量删除出库子表关联表
|
||||
*
|
||||
* @param ids 需要删除的出库子表关联表主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteErpOutStockDetailByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除出库子表关联表信息
|
||||
*
|
||||
* @param id 出库子表关联表主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteErpOutStockDetailById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.ruoyi.out.ErpOutStockDetail.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.out.ErpOutStockDetail.mapper.ErpOutStockDetailMapper;
|
||||
import com.ruoyi.out.ErpOutStockDetail.domain.ErpOutStockDetail;
|
||||
import com.ruoyi.out.ErpOutStockDetail.service.IErpOutStockDetailService;
|
||||
|
||||
/**
|
||||
* 出库子表关联表Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-12-06
|
||||
*/
|
||||
@Service
|
||||
public class ErpOutStockDetailServiceImpl implements IErpOutStockDetailService
|
||||
{
|
||||
@Autowired
|
||||
private ErpOutStockDetailMapper erpOutStockDetailMapper;
|
||||
|
||||
/**
|
||||
* 查询出库子表关联表
|
||||
*
|
||||
* @param id 出库子表关联表主键
|
||||
* @return 出库子表关联表
|
||||
*/
|
||||
@Override
|
||||
public ErpOutStockDetail selectErpOutStockDetailById(Long id)
|
||||
{
|
||||
return erpOutStockDetailMapper.selectErpOutStockDetailById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询出库子表关联表列表
|
||||
*
|
||||
* @param erpOutStockDetail 出库子表关联表
|
||||
* @return 出库子表关联表
|
||||
*/
|
||||
@Override
|
||||
public List<ErpOutStockDetail> selectErpOutStockDetailList(ErpOutStockDetail erpOutStockDetail)
|
||||
{
|
||||
return erpOutStockDetailMapper.selectErpOutStockDetailList(erpOutStockDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增出库子表关联表
|
||||
*
|
||||
* @param erpOutStockDetail 出库子表关联表
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertErpOutStockDetail(ErpOutStockDetail erpOutStockDetail)
|
||||
{
|
||||
return erpOutStockDetailMapper.insertErpOutStockDetail(erpOutStockDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改出库子表关联表
|
||||
*
|
||||
* @param erpOutStockDetail 出库子表关联表
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateErpOutStockDetail(ErpOutStockDetail erpOutStockDetail)
|
||||
{
|
||||
return erpOutStockDetailMapper.updateErpOutStockDetail(erpOutStockDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除出库子表关联表
|
||||
*
|
||||
* @param ids 需要删除的出库子表关联表主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteErpOutStockDetailByIds(Long[] ids)
|
||||
{
|
||||
return erpOutStockDetailMapper.deleteErpOutStockDetailByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除出库子表关联表信息
|
||||
*
|
||||
* @param id 出库子表关联表主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteErpOutStockDetailById(Long id)
|
||||
{
|
||||
return erpOutStockDetailMapper.deleteErpOutStockDetailById(id);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
package com.ruoyi.out.outStockout.service.impl;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.api.domain.erp.ReceiveOutStockConfirm;
|
||||
import com.ruoyi.api.service.IToWcsService;
|
||||
import com.ruoyi.api.service.impl.ToErpServiceImpl;
|
||||
import com.ruoyi.bas.basJobId.service.IBasJobIdService;
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.MessageUtils;
|
||||
import com.ruoyi.common.utils.uuid.UUID;
|
||||
import com.ruoyi.out.outStockout.domain.OutStockout;
|
||||
import com.ruoyi.out.outStockout.domain.OutStockoutVo;
|
||||
@@ -21,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -46,6 +48,9 @@ public class OutStockoutServiceImpl implements IOutStockoutService
|
||||
@Autowired
|
||||
private IToWcsService toWcsService;
|
||||
|
||||
@Autowired
|
||||
private ToErpServiceImpl toErpService;
|
||||
|
||||
/**
|
||||
* 查询出库主单
|
||||
*
|
||||
@@ -150,14 +155,47 @@ public class OutStockoutServiceImpl implements IOutStockoutService
|
||||
public String updateOutStockoutStatus(String[] stockoutIds, String status, String newStatus,String exitId) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for(String stockoutId:stockoutIds){
|
||||
map.put("outStockId",stockoutId);
|
||||
map.put("status",status);
|
||||
map.put("newStatus",newStatus);
|
||||
map.put("exitId",exitId);
|
||||
outStockoutMapper.updateOutStockoutStatus(map);
|
||||
stringBuilder.append(",").append(map.get("v_resultString"));
|
||||
if (status.equals("4")){
|
||||
for(String stockoutId:stockoutIds){
|
||||
ReceiveOutStockConfirm receiveOutStockConfirm = new ReceiveOutStockConfirm();
|
||||
OutStockout outStockout = selectOutStockoutByStockoutGuid(stockoutId);
|
||||
List<OutStockoutDetail> outStockoutDetails = outStockoutDetailService.selectOutStockoutDetailByStockoutGuid(stockoutId);
|
||||
receiveOutStockConfirm.setOrd(Convert.toInt(outStockout.getErpStockoutId()));
|
||||
receiveOutStockConfirm.setComplete1(3);
|
||||
receiveOutStockConfirm.setIntro2("出库确认完成,货物已全部发出");
|
||||
receiveOutStockConfirm.setDate5(new Date());
|
||||
List<ReceiveOutStockConfirm.Kuout> kuouts = new ArrayList<>();
|
||||
for (OutStockoutDetail outStockoutDetail : outStockoutDetails) {
|
||||
ReceiveOutStockConfirm.Kuout kuout = new ReceiveOutStockConfirm.Kuout();
|
||||
kuout.setId(Convert.toInt(outStockoutDetail.getFid()));
|
||||
kuout.setNum1(Convert.toInt(outStockoutDetail.getQuantity()));
|
||||
kuout.setCk(Convert.toInt(outStockout.getWarehouseId()));
|
||||
kuouts.add(kuout);
|
||||
}
|
||||
receiveOutStockConfirm.setKuoutList(kuouts);
|
||||
AjaxResult ajaxResult = toErpService.callErp(receiveOutStockConfirm);
|
||||
if (!ajaxResult.isSuccess()){
|
||||
stringBuilder.append(",").append(stockoutId).append(ajaxResult.get("msg"));
|
||||
}else {
|
||||
map.put("outStockId",stockoutId);
|
||||
map.put("status",status);
|
||||
map.put("newStatus",newStatus);
|
||||
map.put("exitId",exitId);
|
||||
outStockoutMapper.updateOutStockoutStatus(map);
|
||||
stringBuilder.append(",").append(map.get("v_resultString"));
|
||||
}
|
||||
}
|
||||
}else {
|
||||
for(String stockoutId:stockoutIds) {
|
||||
map.put("outStockId", stockoutId);
|
||||
map.put("status", status);
|
||||
map.put("newStatus", newStatus);
|
||||
map.put("exitId", exitId);
|
||||
outStockoutMapper.updateOutStockoutStatus(map);
|
||||
stringBuilder.append(",").append(map.get("v_resultString"));
|
||||
}
|
||||
}
|
||||
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user