出库确认
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();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.out.ErpOutStockDetail.mapper.ErpOutStockDetailMapper">
|
||||
|
||||
<resultMap type="ErpOutStockDetail" id="ErpOutStockDetailResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="productName" column="product_name" />
|
||||
<result property="productCode" column="product_code" />
|
||||
<result property="productModel" column="product_model" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<result property="unitPrice" column="unit_price" />
|
||||
<result property="totalPrice" column="total_price" />
|
||||
<result property="auxiliaryQuantity" column="auxiliary_quantity" />
|
||||
<result property="costUnitPrice" column="cost_unit_price" />
|
||||
<result property="costTotalPrice" column="cost_total_price" />
|
||||
<result property="accountingCostTotalPrice" column="accounting_cost_total_price" />
|
||||
<result property="accountingQuantity" column="accounting_quantity" />
|
||||
<result property="accountingStatus" column="accounting_status" />
|
||||
<result property="batchNumber" column="batch_number" />
|
||||
<result property="serialNumber" column="serial_number" />
|
||||
<result property="productionDate" column="production_date" />
|
||||
<result property="expiryDate" column="expiry_date" />
|
||||
<result property="unitId" column="unit_id" />
|
||||
<result property="productAttribute1" column="product_attribute1" />
|
||||
<result property="productAttribute2" column="product_attribute2" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="packaging" column="packaging" />
|
||||
<result property="packageCount" column="package_count" />
|
||||
<result property="warehouseId" column="warehouse_id" />
|
||||
<result property="storageLocationId" column="storage_location_id" />
|
||||
<result property="parentInboundOrderId" column="parent_inbound_order_id" />
|
||||
<result property="relatedDocumentId" column="related_document_id" />
|
||||
<result property="customField1" column="custom_field1" />
|
||||
<result property="customField2" column="custom_field2" />
|
||||
<result property="customField3" column="custom_field3" />
|
||||
<result property="customField4" column="custom_field4" />
|
||||
<result property="customField5" column="custom_field5" />
|
||||
<result property="customField6" column="custom_field6" />
|
||||
<result property="handlerId" column="handler_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectErpOutStockDetailVo">
|
||||
select id, product_name, product_code, product_model, quantity, unit_price, total_price, auxiliary_quantity, cost_unit_price, cost_total_price, accounting_cost_total_price, accounting_quantity, accounting_status, batch_number, serial_number, production_date, expiry_date, unit_id, product_attribute1, product_attribute2, remark, packaging, package_count, warehouse_id, storage_location_id, parent_inbound_order_id, related_document_id, custom_field1, custom_field2, custom_field3, custom_field4, custom_field5, custom_field6, handler_id from erp_out_stock_detail
|
||||
</sql>
|
||||
|
||||
<select id="selectErpOutStockDetailList" parameterType="ErpOutStockDetail" resultMap="ErpOutStockDetailResult">
|
||||
<include refid="selectErpOutStockDetailVo"/>
|
||||
<where>
|
||||
<if test="id != null "> and id = #{id}</if>
|
||||
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
|
||||
<if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if>
|
||||
<if test="productModel != null and productModel != ''"> and product_model = #{productModel}</if>
|
||||
<if test="quantity != null "> and quantity = #{quantity}</if>
|
||||
<if test="unitPrice != null "> and unit_price = #{unitPrice}</if>
|
||||
<if test="totalPrice != null "> and total_price = #{totalPrice}</if>
|
||||
<if test="auxiliaryQuantity != null "> and auxiliary_quantity = #{auxiliaryQuantity}</if>
|
||||
<if test="costUnitPrice != null "> and cost_unit_price = #{costUnitPrice}</if>
|
||||
<if test="costTotalPrice != null "> and cost_total_price = #{costTotalPrice}</if>
|
||||
<if test="accountingCostTotalPrice != null "> and accounting_cost_total_price = #{accountingCostTotalPrice}</if>
|
||||
<if test="accountingQuantity != null "> and accounting_quantity = #{accountingQuantity}</if>
|
||||
<if test="accountingStatus != null "> and accounting_status = #{accountingStatus}</if>
|
||||
<if test="batchNumber != null and batchNumber != ''"> and batch_number = #{batchNumber}</if>
|
||||
<if test="serialNumber != null and serialNumber != ''"> and serial_number = #{serialNumber}</if>
|
||||
<if test="productionDate != null and productionDate != ''"> and production_date = #{productionDate}</if>
|
||||
<if test="expiryDate != null and expiryDate != ''"> and expiry_date = #{expiryDate}</if>
|
||||
<if test="unitId != null "> and unit_id = #{unitId}</if>
|
||||
<if test="productAttribute1 != null "> and product_attribute1 = #{productAttribute1}</if>
|
||||
<if test="productAttribute2 != null "> and product_attribute2 = #{productAttribute2}</if>
|
||||
<if test="packaging != null and packaging != ''"> and packaging = #{packaging}</if>
|
||||
<if test="packageCount != null "> and package_count = #{packageCount}</if>
|
||||
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
|
||||
<if test="storageLocationId != null "> and storage_location_id = #{storageLocationId}</if>
|
||||
<if test="parentInboundOrderId != null "> and parent_inbound_order_id = #{parentInboundOrderId}</if>
|
||||
<if test="relatedDocumentId != null "> and related_document_id = #{relatedDocumentId}</if>
|
||||
<if test="customField1 != null and customField1 != ''"> and custom_field1 = #{customField1}</if>
|
||||
<if test="customField2 != null and customField2 != ''"> and custom_field2 = #{customField2}</if>
|
||||
<if test="customField3 != null and customField3 != ''"> and custom_field3 = #{customField3}</if>
|
||||
<if test="customField4 != null and customField4 != ''"> and custom_field4 = #{customField4}</if>
|
||||
<if test="customField5 != null and customField5 != ''"> and custom_field5 = #{customField5}</if>
|
||||
<if test="customField6 != null and customField6 != ''"> and custom_field6 = #{customField6}</if>
|
||||
<if test="handlerId != null "> and handler_id = #{handlerId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectErpOutStockDetailById" parameterType="Long" resultMap="ErpOutStockDetailResult">
|
||||
<include refid="selectErpOutStockDetailVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertErpOutStockDetail" parameterType="ErpOutStockDetail" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into erp_out_stock_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="productName != null">product_name,</if>
|
||||
<if test="productCode != null">product_code,</if>
|
||||
<if test="productModel != null">product_model,</if>
|
||||
<if test="quantity != null">quantity,</if>
|
||||
<if test="unitPrice != null">unit_price,</if>
|
||||
<if test="totalPrice != null">total_price,</if>
|
||||
<if test="auxiliaryQuantity != null">auxiliary_quantity,</if>
|
||||
<if test="costUnitPrice != null">cost_unit_price,</if>
|
||||
<if test="costTotalPrice != null">cost_total_price,</if>
|
||||
<if test="accountingCostTotalPrice != null">accounting_cost_total_price,</if>
|
||||
<if test="accountingQuantity != null">accounting_quantity,</if>
|
||||
<if test="accountingStatus != null">accounting_status,</if>
|
||||
<if test="batchNumber != null">batch_number,</if>
|
||||
<if test="serialNumber != null">serial_number,</if>
|
||||
<if test="productionDate != null">production_date,</if>
|
||||
<if test="expiryDate != null">expiry_date,</if>
|
||||
<if test="unitId != null">unit_id,</if>
|
||||
<if test="productAttribute1 != null">product_attribute1,</if>
|
||||
<if test="productAttribute2 != null">product_attribute2,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="packaging != null">packaging,</if>
|
||||
<if test="packageCount != null">package_count,</if>
|
||||
<if test="warehouseId != null">warehouse_id,</if>
|
||||
<if test="storageLocationId != null">storage_location_id,</if>
|
||||
<if test="parentInboundOrderId != null">parent_inbound_order_id,</if>
|
||||
<if test="relatedDocumentId != null">related_document_id,</if>
|
||||
<if test="customField1 != null">custom_field1,</if>
|
||||
<if test="customField2 != null">custom_field2,</if>
|
||||
<if test="customField3 != null">custom_field3,</if>
|
||||
<if test="customField4 != null">custom_field4,</if>
|
||||
<if test="customField5 != null">custom_field5,</if>
|
||||
<if test="customField6 != null">custom_field6,</if>
|
||||
<if test="handlerId != null">handler_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="productName != null">#{productName},</if>
|
||||
<if test="productCode != null">#{productCode},</if>
|
||||
<if test="productModel != null">#{productModel},</if>
|
||||
<if test="quantity != null">#{quantity},</if>
|
||||
<if test="unitPrice != null">#{unitPrice},</if>
|
||||
<if test="totalPrice != null">#{totalPrice},</if>
|
||||
<if test="auxiliaryQuantity != null">#{auxiliaryQuantity},</if>
|
||||
<if test="costUnitPrice != null">#{costUnitPrice},</if>
|
||||
<if test="costTotalPrice != null">#{costTotalPrice},</if>
|
||||
<if test="accountingCostTotalPrice != null">#{accountingCostTotalPrice},</if>
|
||||
<if test="accountingQuantity != null">#{accountingQuantity},</if>
|
||||
<if test="accountingStatus != null">#{accountingStatus},</if>
|
||||
<if test="batchNumber != null">#{batchNumber},</if>
|
||||
<if test="serialNumber != null">#{serialNumber},</if>
|
||||
<if test="productionDate != null">#{productionDate},</if>
|
||||
<if test="expiryDate != null">#{expiryDate},</if>
|
||||
<if test="unitId != null">#{unitId},</if>
|
||||
<if test="productAttribute1 != null">#{productAttribute1},</if>
|
||||
<if test="productAttribute2 != null">#{productAttribute2},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="packaging != null">#{packaging},</if>
|
||||
<if test="packageCount != null">#{packageCount},</if>
|
||||
<if test="warehouseId != null">#{warehouseId},</if>
|
||||
<if test="storageLocationId != null">#{storageLocationId},</if>
|
||||
<if test="parentInboundOrderId != null">#{parentInboundOrderId},</if>
|
||||
<if test="relatedDocumentId != null">#{relatedDocumentId},</if>
|
||||
<if test="customField1 != null">#{customField1},</if>
|
||||
<if test="customField2 != null">#{customField2},</if>
|
||||
<if test="customField3 != null">#{customField3},</if>
|
||||
<if test="customField4 != null">#{customField4},</if>
|
||||
<if test="customField5 != null">#{customField5},</if>
|
||||
<if test="customField6 != null">#{customField6},</if>
|
||||
<if test="handlerId != null">#{handlerId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateErpOutStockDetail" parameterType="ErpOutStockDetail">
|
||||
update erp_out_stock_detail
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="productName != null">product_name = #{productName},</if>
|
||||
<if test="productCode != null">product_code = #{productCode},</if>
|
||||
<if test="productModel != null">product_model = #{productModel},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</if>
|
||||
<if test="unitPrice != null">unit_price = #{unitPrice},</if>
|
||||
<if test="totalPrice != null">total_price = #{totalPrice},</if>
|
||||
<if test="auxiliaryQuantity != null">auxiliary_quantity = #{auxiliaryQuantity},</if>
|
||||
<if test="costUnitPrice != null">cost_unit_price = #{costUnitPrice},</if>
|
||||
<if test="costTotalPrice != null">cost_total_price = #{costTotalPrice},</if>
|
||||
<if test="accountingCostTotalPrice != null">accounting_cost_total_price = #{accountingCostTotalPrice},</if>
|
||||
<if test="accountingQuantity != null">accounting_quantity = #{accountingQuantity},</if>
|
||||
<if test="accountingStatus != null">accounting_status = #{accountingStatus},</if>
|
||||
<if test="batchNumber != null">batch_number = #{batchNumber},</if>
|
||||
<if test="serialNumber != null">serial_number = #{serialNumber},</if>
|
||||
<if test="productionDate != null">production_date = #{productionDate},</if>
|
||||
<if test="expiryDate != null">expiry_date = #{expiryDate},</if>
|
||||
<if test="unitId != null">unit_id = #{unitId},</if>
|
||||
<if test="productAttribute1 != null">product_attribute1 = #{productAttribute1},</if>
|
||||
<if test="productAttribute2 != null">product_attribute2 = #{productAttribute2},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="packaging != null">packaging = #{packaging},</if>
|
||||
<if test="packageCount != null">package_count = #{packageCount},</if>
|
||||
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
|
||||
<if test="storageLocationId != null">storage_location_id = #{storageLocationId},</if>
|
||||
<if test="parentInboundOrderId != null">parent_inbound_order_id = #{parentInboundOrderId},</if>
|
||||
<if test="relatedDocumentId != null">related_document_id = #{relatedDocumentId},</if>
|
||||
<if test="customField1 != null">custom_field1 = #{customField1},</if>
|
||||
<if test="customField2 != null">custom_field2 = #{customField2},</if>
|
||||
<if test="customField3 != null">custom_field3 = #{customField3},</if>
|
||||
<if test="customField4 != null">custom_field4 = #{customField4},</if>
|
||||
<if test="customField5 != null">custom_field5 = #{customField5},</if>
|
||||
<if test="customField6 != null">custom_field6 = #{customField6},</if>
|
||||
<if test="handlerId != null">handler_id = #{handlerId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteErpOutStockDetailById" parameterType="Long">
|
||||
delete from erp_out_stock_detail where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteErpOutStockDetailByIds" parameterType="String">
|
||||
delete from erp_out_stock_detail where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -37,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
insert into out_stock_middle
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="stockoutId != null and stockoutId != ''">stockout_id,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createDate != null and createDate != ''">create_date,</if>
|
||||
<if test="spare1 != null">spare1,</if>
|
||||
<if test="spare2 != null">spare2,</if>
|
||||
@@ -45,7 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="stockoutId != null and stockoutId != ''">#{stockoutId},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createDate != null and createDate != ''">#{createDate},</if>
|
||||
<if test="spare1 != null">#{spare1},</if>
|
||||
<if test="spare2 != null">#{spare2},</if>
|
||||
@@ -56,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<update id="updateOutStockMiddle" parameterType="OutStockMiddle">
|
||||
update out_stock_middle
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="createDate != null and createDate != ''">create_date = #{createDate},</if>
|
||||
<if test="spare1 != null">spare1 = #{spare1},</if>
|
||||
<if test="spare2 != null">spare2 = #{spare2},</if>
|
||||
|
||||
@@ -127,7 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="lotNo != null">lot_no,</if>
|
||||
<if test="productGuid != null">product_guid,</if>
|
||||
<if test="productId != null">product_id,</if>
|
||||
|
||||
<if test="productName != null">product_name,</if>
|
||||
<if test="quantity != null">quantity,</if>
|
||||
<if test="quantityX != null">quantity_x,</if>
|
||||
<if test="quantityJ != null">quantity_j,</if>
|
||||
@@ -151,7 +151,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="spec != null">spec,</if>
|
||||
<if test="supplierId != null">supplier_id,</if>
|
||||
<if test="cargoNo != null">cargo_no,</if>
|
||||
|
||||
<if test="printDate != null">print_date,</if>
|
||||
<if test="voltage != null">voltage,</if>
|
||||
<if test="power != null">power,</if>
|
||||
@@ -169,7 +168,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="lotNo != null">#{lotNo},</if>
|
||||
<if test="productGuid != null">#{productGuid},</if>
|
||||
<if test="productId != null">#{productId},</if>
|
||||
|
||||
<if test="productName != null">#{productName},</if>
|
||||
<if test="quantity != null">#{quantity},</if>
|
||||
<if test="quantityX != null">#{quantityX},</if>
|
||||
<if test="quantityJ != null">#{quantityJ},</if>
|
||||
@@ -214,6 +213,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="lotNo != null">lot_no = #{lotNo},</if>
|
||||
<if test="productGuid != null">product_guid = #{productGuid},</if>
|
||||
<if test="productId != null">product_id = #{productId},</if>
|
||||
<if test="productName != null">product_name = #{productName},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</if>
|
||||
<if test="quantityX != null">quantity_x = #{quantityX},</if>
|
||||
<if test="quantityJ != null">quantity_j = #{quantityJ},</if>
|
||||
|
||||
Reference in New Issue
Block a user