Merge remote-tracking branch 'origin/main' into zxt/stock

This commit is contained in:
escapemoon
2025-12-08 09:11:36 +08:00
43 changed files with 3372 additions and 383 deletions

View File

@@ -0,0 +1,31 @@
package com.ruoyi.api.controller;
import com.ruoyi.api.service.IStockScreenService;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/api/stock")
public class StockScreenController {
@Autowired
private IStockScreenService stockScreenService;
@GetMapping("/all")
public AjaxResult getAllStocks() {
return AjaxResult.success(stockScreenService.getAllStocksWithTotal());
}
@GetMapping("/cargoSpace/pie")
public AjaxResult getCargoSpacePie() {
return AjaxResult.success(stockScreenService.getCargoSpacePie());
}
@GetMapping("/inout/stat")
public AjaxResult getInOutStat() {
return AjaxResult.success(stockScreenService.getInOutSummary());
}
}

View File

@@ -21,26 +21,35 @@ public class ToErpApiController {
/**
* 接收物料信息
*/
@GetMapping("/receiveMaterial")
public AjaxResult receiveMaterial(@RequestBody BasProduct basProduct) {
return toErpService.receiveMaterial(basProduct);
@GetMapping("/receiveProduct")
public AjaxResult receiveProduct() {
return toErpService.receiveProduct();
}
/**
* 接收客户信息
*/
@GetMapping("/receiveCustomer")
public AjaxResult receiveCustomer(@RequestBody BasCustomer basProduct) {
return toErpService.receiveCustomer(basProduct);
public AjaxResult receiveCustomer() {
return toErpService.receiveCustomer();
}
/**
* 接收供应商信息
*/
@GetMapping("/receiveSupplier")
public AjaxResult receiveSupplier(/*@RequestBody BasSupplier basSupplier*/) {
public AjaxResult receiveSupplier() {
return toErpService.receiveSupplier();
}
/**
* 接收出库单信息
*/
@GetMapping("/outStockList")
public AjaxResult outStockList(){
return toErpService.receiveOutStockList();
}
@PostMapping("/login")
public AjaxResult login() {
toErpService.login();

View File

@@ -0,0 +1,28 @@
package com.ruoyi.api.domain.erp;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AspRequestParam {
private String session;
private String cmdkey;
private List<DataInfo> datas;
@Data
@AllArgsConstructor
@NoArgsConstructor
public static class DataInfo{
private String id;
private Object val;
}
}

View File

@@ -0,0 +1,8 @@
package com.ruoyi.api.domain.erp;
import lombok.Data;
@Data
public class AspResponse {
private Body body;
}

View File

@@ -0,0 +1,10 @@
package com.ruoyi.api.domain.erp;
import lombok.Data;
@Data
public class Body {
private String action;
private String model;
private Source source;
}

View File

@@ -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;
}

View File

@@ -0,0 +1,9 @@
package com.ruoyi.api.domain.erp;
import lombok.Data;
@Data
public class Col {
private String id;
private String dbtype;
}

View File

@@ -0,0 +1,31 @@
package com.ruoyi.api.domain.erp;
import com.mysql.cj.x.protobuf.MysqlxDatatypes;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ErpOutStockListParam {
private int Cateid;
private String Kg;
private String Ck;
private int Sort1;
private int Complete1;
private String Title;
private String Ckbh;
private int Company;
private String pro_name;
private String Order1;
private String Type1;
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;
}

View File

@@ -0,0 +1,34 @@
package com.ruoyi.api.domain.erp;
import cn.hutool.core.annotation.Alias;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ErpOutStockListResponse {
@Alias("Page")
private Page page;
@Alias("Cols")
private List<String> cols;
@Alias("Rows")
private List<List<Object>> rows;
@Data
@AllArgsConstructor
@NoArgsConstructor
public static class Page{
@Alias("RecordCount")
private int recordCount;
@Alias("PageSize")
private int pageSize;
@Alias("PageIndex")
private int pageIndex;
@Alias("PageCount")
private int pageCount;
}
}

View File

@@ -0,0 +1,18 @@
package com.ruoyi.api.domain.erp;
import lombok.Data;
@Data
public class Field {
private String type;
private Object source;
private String text;
private String post;
private boolean notnull;
private boolean onlyread;
private int minl;
private int maxl;
private boolean edit;
private boolean visible;
private boolean canset;
}

View File

@@ -0,0 +1,14 @@
package com.ruoyi.api.domain.erp;
import lombok.Data;
import java.util.List;
@Data
public class Layout {
private String uitype;
private String action;
private String url;
private List<Field> fields;
private List<Object> buttons;
}

View File

@@ -0,0 +1,11 @@
package com.ruoyi.api.domain.erp;
import lombok.Data;
@Data
public class Page {
private int recordcount;
private int pagesize;
private int pagecount;
private int pageindex;
}

View File

@@ -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;
}
}

View File

@@ -0,0 +1,9 @@
package com.ruoyi.api.domain.erp;
import lombok.Data;
@Data
public class Source {
private String type;
private Table table;
}

View File

@@ -0,0 +1,13 @@
package com.ruoyi.api.domain.erp;
import lombok.Data;
import java.util.List;
@Data
public class Table {
private Layout layout;
private Page page;
private List<Col> cols;
private List<List<String>> rows;
}

View File

@@ -0,0 +1,9 @@
package com.ruoyi.api.service;
import java.util.Map;
public interface IStockScreenService {
Map<String, Object> getAllStocksWithTotal();
Map<String, Object> getCargoSpacePie();
Map<String, Object> getInOutSummary();
}

View File

@@ -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;
@@ -17,11 +18,14 @@ public interface IToErpService {
Map<String,String> billCompletedCallBack();
AjaxResult receiveMaterial(BasProduct basProduct);
AjaxResult receiveProduct();
AjaxResult receiveCustomer(BasCustomer basProduct);
AjaxResult receiveCustomer();
AjaxResult receiveSupplier();
String login();
AjaxResult callErp(ReceiveOutStockConfirm receiveOutStockConfirm);
AjaxResult receiveOutStockList();
}

View File

@@ -0,0 +1,137 @@
package com.ruoyi.api.service.impl;
import com.ruoyi.api.service.IStockScreenService;
import com.ruoyi.bas.cargoSpace.mapper.BasCargoSpaceMapper;
import com.ruoyi.stock.stock.domain.BasStock;
import com.ruoyi.stock.stock.service.IBasStockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class StockScreenServiceImpl implements IStockScreenService {
@Autowired
private IBasStockService basStockService;
@Autowired
private BasCargoSpaceMapper basCargoSpaceMapper;
@Autowired
private JdbcTemplate jdbcTemplate;
@Override
public Map<String, Object> getAllStocksWithTotal() {
List<BasStock> list = basStockService.selectBasStockListApi(new BasStock());
BigDecimal total = BigDecimal.ZERO;
for (BasStock s : list) {
String q = s.getQuantity();
if (q != null && !q.trim().isEmpty()) {
try {
total = total.add(new BigDecimal(q.trim()));
} catch (Exception ignored) {
}
}
}
Map<String, Object> result = new HashMap<>();
List<BasStock> topList = list.size() > 50 ? list.subList(0, 50) : list;
result.put("stockMsg", topList);
result.put("totalQuantity", total);
return result;
}
@Override
public Map<String, Object> getCargoSpacePie() {
List<Map<String, Object>> statusCounts = basCargoSpaceMapper.selectStatusCount();
Map<String, Integer> countMap = new HashMap<>();
for (Map<String, Object> m : statusCounts) {
Object status = m.get("status");
Object count = m.get("count");
if (status != null && count != null) {
try {
countMap.put(String.valueOf(status), Integer.parseInt(String.valueOf(count)));
} catch (Exception ignored) {
}
}
}
int totalCount = 0;
for (Integer v : countMap.values()) {
totalCount += v != null ? v : 0;
}
List<Map<String, Object>> pie = new ArrayList<>();
Map<String, Object> i1 = new HashMap<>(); i1.put("value", countMap.getOrDefault("1", 0)); i1.put("name", "空货位"); pie.add(i1);
Map<String, Object> i2 = new HashMap<>(); i2.put("value", countMap.getOrDefault("2", 0)); i2.put("name", "满货位"); pie.add(i2);
Map<String, Object> i3 = new HashMap<>(); i3.put("value", countMap.getOrDefault("3", 0)); i3.put("name", "入库已分配"); pie.add(i3);
Map<String, Object> i4 = new HashMap<>(); i4.put("value", countMap.getOrDefault("4", 0)); i4.put("name", "出库已分配"); pie.add(i4);
Map<String, Object> i5 = new HashMap<>(); i5.put("value", countMap.getOrDefault("5", 0)); i5.put("name", "入库需盘点"); pie.add(i5);
Map<String, Object> i6 = new HashMap<>(); i6.put("value", countMap.getOrDefault("6", 0)); i6.put("name", "出库需盘点"); pie.add(i6);
Map<String, Object> result = new HashMap<>();
result.put("pie", pie);
result.put("totalCargoSpace", totalCount);
return result;
}
@Override
public Map<String, Object> getInOutSummary() {
java.time.LocalDate now = java.time.LocalDate.now();
java.time.format.DateTimeFormatter dFmt = java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd");
java.time.format.DateTimeFormatter mFmt = java.time.format.DateTimeFormatter.ofPattern("yyyy-MM");
String todayPrefix = now.format(dFmt);
int dIn = countLike("in_stockin_finish", todayPrefix);
int dOut = countLike("out_stockout_finish", todayPrefix);
java.time.LocalDate monday = now.with(java.time.DayOfWeek.MONDAY);
List<Integer> wkIn = new ArrayList<>();
List<Integer> wkOut = new ArrayList<>();
for (int i = 0; i < 7; i++) {
java.time.LocalDate day = monday.plusDays(i);
String p = day.format(dFmt);
wkIn.add(countLike("in_stockin_finish", p));
wkOut.add(countLike("out_stockout_finish", p));
}
int year = now.getYear();
List<Map<String, Object>> monthStat = new ArrayList<>();
for (int m = 1; m <= 12; m++) {
java.time.LocalDate mm = java.time.LocalDate.of(year, m, 1);
String mp = mm.format(mFmt);
int mi = countLikeMonth("in_stockin_finish", mp);
int mo = countLikeMonth("out_stockout_finish", mp);
Map<String, Object> item = new HashMap<>();
item.put("mouth", String.valueOf(m));
item.put("入库", mi);
item.put("出库", mo);
monthStat.add(item);
}
Map<String, Object> res = new HashMap<>();
res.put("drrk", String.valueOf(dIn));
res.put("drck", String.valueOf(dOut));
res.put("bzrk", wkIn);
res.put("bzck", wkOut);
res.put("statistic", monthStat);
return res;
}
private int countLike(String table, String dayPrefix) {
try {
Integer c = jdbcTemplate.queryForObject("SELECT COUNT(1) FROM " + table + " WHERE create_date LIKE ?", Integer.class, dayPrefix + "%");
return c == null ? 0 : c;
} catch (Exception e) {
return 0;
}
}
private int countLikeMonth(String table, String monthPrefix) {
try {
Integer c = jdbcTemplate.queryForObject("SELECT COUNT(1) FROM " + table + " WHERE create_date LIKE ?", Integer.class, monthPrefix + "%");
return c == null ? 0 : c;
} catch (Exception e) {
return 0;
}
}
}

View File

@@ -5,11 +5,10 @@ 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.ErpSupplierParam;
import com.ruoyi.api.domain.erp.ErpSupplierResponse;
import com.ruoyi.api.domain.erp.LoginParam;
import com.ruoyi.api.domain.erp.LoginResponse;
import com.ruoyi.api.domain.erp.*;
import com.ruoyi.api.service.IToErpService;
import com.ruoyi.bas.BasCustomer.domain.BasCustomer;
import com.ruoyi.bas.BasCustomer.service.IBasCustomerService;
@@ -19,13 +18,24 @@ import com.ruoyi.bas.BasSupplier.domain.BasSupplier;
import com.ruoyi.bas.BasSupplier.service.IBasSupplierService;
import com.ruoyi.common.core.domain.AjaxResult;
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;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
/**
@@ -40,6 +50,24 @@ public class ToErpServiceImpl implements IToErpService {
@Autowired
private IBasSupplierService basSupplierService;
@Autowired
private IErpOutStockService erpOutStockService;
@Autowired
private IOutStockoutService outStockoutService;
@Autowired
private IOutStockMiddleService outStockMiddleService;
@Autowired
private IErpOutStockDetailService erpOutStockDetailService;
@Autowired
private IOutStockoutDetailService outStockoutDetailService;
@Autowired
private IBasJobIdService basJobIdService;
@Autowired
private IBasCustomerService basCustomerService;
@@ -51,6 +79,12 @@ public class ToErpServiceImpl implements IToErpService {
private static final String loginUrl = erpUrl+"/webapi/v3/ov1/login";
private static final String supplierListUrl = erpUrl+"/webapi/v3/store/supplierList";
private static final String customerListUrl = erpUrl+"/sysa/mobilephone/salesmanage/custom/list.asp";
private static final String productListUrl = erpUrl+"/sysa/mobilephone/salesmanage/product/billlist.asp";
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
@@ -68,26 +102,80 @@ public class ToErpServiceImpl implements IToErpService {
}
@Override
public AjaxResult receiveMaterial(BasProduct basProduct) {
String productId = basProduct.getProductId();
BasProduct oldProduct = basProductService.selectBasProductByProductId(productId);
if (ObjUtil.isNotNull(oldProduct)){
basProductService.updateBasProduct(basProduct);
}else {
basProductService.insertBasProduct(basProduct);
public AjaxResult receiveProduct() {
AspRequestParam erpCustomerParam = new AspRequestParam();
erpCustomerParam.setSession(login());
erpCustomerParam.setCmdkey("refresh");
List<AspRequestParam.DataInfo> dataInfoList = new ArrayList<>();
dataInfoList.add(new AspRequestParam.DataInfo("pagesize", 100000));
dataInfoList.add(new AspRequestParam.DataInfo("pageindex", 1));
dataInfoList.add(new AspRequestParam.DataInfo("idProductClass", "532"));
erpCustomerParam.setDatas(dataInfoList);
String body = HttpRequest.post(productListUrl).header(TOKEN_KEY, login()).body(JSONUtil.toJsonStr(erpCustomerParam)).execute().body();
AspResponse responseBean = JSONUtil.toBean(body, AspResponse.class);
for (List<String> row : responseBean.getBody().getSource().getTable().getRows()) {
BasProduct product = new BasProduct();
product.setProductGuid(row.get(0));
product.setProductId(row.get(0));
product.setProductName(row.get(1));
product.setCargoNo(row.get(2));
product.setSpec(row.get(3));
product.setUnit(row.get(4));
product.setSpare1(row.get(5));
product.setPrice(row.get(6));
product.setParentId(row.get(7));
product.setSpare3(row.get(8));
product.setSpare4(row.get(9));
product.setSpare5(row.get(10));
product.setSpare6(row.get(11));
product.setSpare7(row.get(12));
BasProduct basProduct = basProductService.selectBasProductByProductId(product.getProductId());
if (ObjUtil.isNotNull(basProduct)){
BeanUtil.copyProperties(product,basProduct);
basProductService.updateBasProduct(basProduct);
}else {
basProductService.insertBasProduct(product);
}
}
return AjaxResult.success();
}
@Override
public AjaxResult receiveCustomer(BasCustomer basCustomer) {
String customerNo = basCustomer.getId();
BasCustomer oldCustomer = basCustomerService.selectBasCustomerById(customerNo);
if (ObjUtil.isNotNull(oldCustomer)){
basCustomerService.updateBasCustomer(basCustomer);
}else {
basCustomerService.insertBasCustomer(basCustomer);
public AjaxResult receiveCustomer() {
AspRequestParam erpCustomerParam = new AspRequestParam();
erpCustomerParam.setSession(login());
erpCustomerParam.setCmdkey("refresh");
List<AspRequestParam.DataInfo> dataInfoList = new ArrayList<>();
dataInfoList.add(new AspRequestParam.DataInfo("pagesize", 100000));
dataInfoList.add(new AspRequestParam.DataInfo("pageindex", 1));
erpCustomerParam.setDatas(dataInfoList);
String body = HttpRequest.post(customerListUrl).header(TOKEN_KEY, login()).body(JSONUtil.toJsonStr(erpCustomerParam)).execute().body();
AspResponse responseBean = JSONUtil.toBean(body, AspResponse.class);
for (List<String> row : responseBean.getBody().getSource().getTable().getRows()) {
BasCustomer customer = new BasCustomer();
customer.setCustomerName(Convert.toStr(row.get(0)));
customer.setSalesman(Convert.toStr(row.get(1)));
customer.setBusinessDepartment(Convert.toStr(row.get(2)));
customer.setSupCustomer(Convert.toStr(row.get(3)));
customer.setContactName(Convert.toStr(row.get(4)));
customer.setMnemonicCode(Convert.toStr(row.get(5)));
customer.setType(Convert.toStr(row.get(6)));
customer.setTaxpayerRegistrationNumber(Convert.toStr(row.get(7)));
customer.setOrganization(Convert.toStr(row.get(8)));
customer.setRetailInvestor(Convert.toStr(row.get(9)));
customer.setId(Convert.toStr(row.get(10)));
customer.setCustomerNo(Convert.toStr(row.get(10)));
customer.setShipment(Convert.toStr(row.get(11)));
customer.setTaxCategory(Convert.toStr(row.get(12)));
BasCustomer basCustomer = basCustomerService.selectBasCustomerById(customer.getId());
if (ObjUtil.isNotNull(basCustomer)){
basCustomerService.updateBasCustomer(customer);
}else {
basCustomerService.insertBasCustomer(customer);
}
}
return AjaxResult.success();
}
@@ -96,7 +184,7 @@ public class ToErpServiceImpl implements IToErpService {
ErpSupplierParam erpSupplierParam = new ErpSupplierParam();
erpSupplierParam.setPage_index(1);
erpSupplierParam.setPage_size(100000);
String body = HttpRequest.post(supplierListUrl).header("ZBAPI-Token", login()).body(JSONUtil.toJsonStr(erpSupplierParam)).execute().body();
String body = HttpRequest.post(supplierListUrl).header(TOKEN_KEY, login()).body(JSONUtil.toJsonStr(erpSupplierParam)).execute().body();
ErpSupplierResponse responseBean = JSONUtil.toBean(body, ErpSupplierResponse.class);
for (List<Object> row : responseBean.getRows()) {
BasSupplier supplier = new BasSupplier();
@@ -120,6 +208,150 @@ 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();
erpOutStock.setStockoutId(Convert.toStr(row.get(0)));
erpOutStock.setTheme(Convert.toStr(row.get(1)));
erpOutStock.setWarehouse(Convert.toStr(row.get(2)));
erpOutStock.setApplicationDate(Convert.toStr(row.get(3)));
erpOutStock.setConfirmTheDate(Convert.toStr(row.get(4)));
erpOutStock.setOutboundRemarks(Convert.toStr(row.get(5)));
erpOutStock.setOutboundCompletionStatus(Convert.toStr(row.get(6)));
erpOutStock.setShippingStatus(Convert.toStr(row.get(7)));
erpOutStock.setApprovalComments(Convert.toStr(row.get(8)));
erpOutStock.setAddPersonnel(Convert.toStr(row.get(9)));
erpOutStock.setStatus(Convert.toStr(row.get(10)));
erpOutStock.setApprover(Convert.toStr(row.get(11)));
erpOutStock.setActualOperationTime(Convert.toStr(row.get(12)));
erpOutStock.setStorekeeper(Convert.toStr(row.get(13)));
erpOutStock.setOutboundNumber(Convert.toStr(row.get(14)));
erpOutStock.setOutboundType(Convert.toStr(row.get(15)));
erpOutStock.setConsignee(Convert.toStr(row.get(16)));
erpOutStock.setLandline(Convert.toStr(row.get(17)));
erpOutStock.setMobilePhone(Convert.toStr(row.get(18)));
erpOutStock.setAddress(Convert.toStr(row.get(19)));
erpOutStock.setPostalCode(Convert.toStr(row.get(20)));
erpOutStock.setHedge(Convert.toStr(row.get(21)));
erpOutStock.setApprovalStatus(Convert.toStr(row.get(22)));
erpOutStock.setProductDetails(Convert.toStr(row.get(23)));
erpOutStock.setCustomerName(Convert.toStr(row.get(24)));
erpOutStock.setSpare2(Convert.toStr(row.get(25)));
erpOutStock.setSpare3(Convert.toStr(row.get(26)));
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(stockOutId);
outStockout.setCreateDate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
outStockout.setOutType("1");
outStockout.setStatus("1");
ErpOutStock erpOutStock1 = erpOutStockService.selectErpOutStockByStockoutId(erpOutStock.getStockoutId());
OutStockout outStockout1 = outStockoutService.selectOutStockoutByStockoutGuid(outStockout.getStockoutGuid());
if (ObjUtil.isNotNull(erpOutStock1)){
erpOutStockService.updateErpOutStock(erpOutStock1);
}else {
erpOutStockService.insertErpOutStock(erpOutStock);
}
if (ObjUtil.isNotNull(outStockout1)){
outStockoutService.updateOutStockout(outStockout1);
}else {
outStockoutService.insertOutStockout(outStockout);
}
// 解析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();
@@ -142,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());
}
}
}

View File

@@ -15,19 +15,19 @@ import com.ruoyi.bas.BasProduct.service.IBasProductService;
/**
* 物料管理Service业务层处理
*
*
* @author gw
* @date 2025-09-17
*/
@Service
public class BasProductServiceImpl implements IBasProductService
public class BasProductServiceImpl implements IBasProductService
{
@Autowired
private BasProductMapper basProductMapper;
/**
* 查询物料管理
*
*
* @param productGuid 物料管理主键
* @return 物料管理
*/
@@ -51,7 +51,7 @@ public class BasProductServiceImpl implements IBasProductService
/**
* 查询物料管理列表
*
*
* @param basProduct 物料管理
* @return 物料管理
*/
@@ -63,7 +63,7 @@ public class BasProductServiceImpl implements IBasProductService
/**
* 新增物料管理
*
*
* @param basProduct 物料管理
* @return 结果
*/
@@ -77,16 +77,12 @@ public class BasProductServiceImpl implements IBasProductService
throw new RuntimeException("物料编号已存在");
}
basProduct.setProductGuid(basProduct.getProductId());
basProduct.setSpare3(DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
//获取当前系统登录用户名
String username = SecurityUtils.getUsername();
basProduct.setSpare4(username);
return basProductMapper.insertBasProduct(basProduct);
}
/**
* 修改物料管理
*
*
* @param basProduct 物料管理
* @return 结果
*/
@@ -105,7 +101,7 @@ public class BasProductServiceImpl implements IBasProductService
/**
* 批量删除物料管理
*
*
* @param productGuids 需要删除的物料管理主键
* @return 结果
*/
@@ -117,7 +113,7 @@ public class BasProductServiceImpl implements IBasProductService
/**
* 删除物料管理信息
*
*
* @param productGuid 物料管理主键
* @return 结果
*/

View File

@@ -0,0 +1,96 @@
package com.ruoyi.out.ErpOutStock.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.ErpOutStock.domain.ErpOutStock;
import com.ruoyi.out.ErpOutStock.service.IErpOutStockService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 出库主单关联表Controller
*
* @author ruoyi
* @date 2025-12-04
*/
@RestController
@RequestMapping("/out/ErpOutStock")
public class ErpOutStockController extends BaseController
{
@Autowired
private IErpOutStockService erpOutStockService;
/**
* 查询出库主单关联表列表
*/
@PreAuthorize("@ss.hasPermi('out:ErpOutStock:list')")
@GetMapping("/list")
public TableDataInfo list(ErpOutStock erpOutStock)
{
startPage();
List<ErpOutStock> list = erpOutStockService.selectErpOutStockList(erpOutStock);
return getDataTable(list);
}
/**
* 导出出库主单关联表列表
*/
@PreAuthorize("@ss.hasPermi('out:ErpOutStock:export')")
@Log(title = "出库主单关联表", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ErpOutStock erpOutStock)
{
List<ErpOutStock> list = erpOutStockService.selectErpOutStockList(erpOutStock);
ExcelUtil<ErpOutStock> util = new ExcelUtil<ErpOutStock>(ErpOutStock.class);
util.exportExcel(response, list, "出库主单关联表数据");
}
/**
* 新增出库主单关联表
*/
@PreAuthorize("@ss.hasPermi('out:ErpOutStock:add')")
@Log(title = "出库主单关联表", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ErpOutStock erpOutStock)
{
return toAjax(erpOutStockService.insertErpOutStock(erpOutStock));
}
/**
* 修改出库主单关联表
*/
@PreAuthorize("@ss.hasPermi('out:ErpOutStock:edit')")
@Log(title = "出库主单关联表", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ErpOutStock erpOutStock)
{
return toAjax(erpOutStockService.updateErpOutStock(erpOutStock));
}
/**
* 删除出库主单关联表
*/
@PreAuthorize("@ss.hasPermi('out:ErpOutStock:remove')")
@Log(title = "出库主单关联表", businessType = BusinessType.DELETE)
@DeleteMapping("/{stockoutIds}")
public AjaxResult remove(@PathVariable String[] stockoutIds)
{
return toAjax(erpOutStockService.deleteErpOutStockByStockoutIds(stockoutIds));
}
}

View File

@@ -0,0 +1,443 @@
package com.ruoyi.out.ErpOutStock.domain;
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
*
* @author ruoyi
* @date 2025-12-04
*/
public class ErpOutStock extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 出库id 542 */
@Excel(name = "出库id 542")
private String stockoutId;
/** 主题 */
@Excel(name = "主题")
private String theme;
/** 仓库 */
@Excel(name = "仓库")
private String warehouse;
/** 申请日期 */
@Excel(name = "申请日期")
private String applicationDate;
/** 确认日期 */
@Excel(name = "确认日期")
private String confirmTheDate;
/** 出库备注 */
@Excel(name = "出库备注")
private String outboundRemarks;
/** 出库完成状态 */
@Excel(name = "出库完成状态")
private String outboundCompletionStatus;
/** 发货状态 */
@Excel(name = "发货状态")
private String shippingStatus;
/** 审批意见 */
@Excel(name = "审批意见")
private String approvalComments;
/** 添加人员 */
@Excel(name = "添加人员")
private String addPersonnel;
/** 状态 */
@Excel(name = "状态")
private String status;
/** 审批人 */
@Excel(name = "审批人")
private String approver;
/** 实际操作时间 */
@Excel(name = "实际操作时间")
private String actualOperationTime;
/** 库管 */
@Excel(name = "库管")
private String storekeeper;
/** 出库编号 */
@Excel(name = "出库编号")
private String outboundNumber;
/** 出库类型 */
@Excel(name = "出库类型")
private String outboundType;
/** 收货人 */
@Excel(name = "收货人")
private String consignee;
/** 固话 */
@Excel(name = "固话")
private String landline;
/** 手机 */
@Excel(name = "手机")
private String mobilePhone;
/** 地址 */
@Excel(name = "地址")
private String address;
/** 邮编 */
@Excel(name = "邮编")
private String postalCode;
/** 是否对冲后转出库单 */
@Excel(name = "是否对冲后转出库单")
private String hedge;
/** 审批状态 */
@Excel(name = "审批状态")
private String approvalStatus;
/** 产品明细 */
@Excel(name = "产品明细")
private String productDetails;
/** 客户名称 */
@Excel(name = "客户名称")
private String customerName;
/** 自定义2 */
@Excel(name = "自定义2")
private String spare2;
/** 自定义3 */
@Excel(name = "自定义3")
private String spare3;
/** 自定义4 */
@Excel(name = "自定义4")
private String spare4;
public void setStockoutId(String stockoutId)
{
this.stockoutId = stockoutId;
}
public String getStockoutId()
{
return stockoutId;
}
public void setTheme(String theme)
{
this.theme = theme;
}
public String getTheme()
{
return theme;
}
public void setWarehouse(String warehouse)
{
this.warehouse = warehouse;
}
public String getWarehouse()
{
return warehouse;
}
public void setApplicationDate(String applicationDate)
{
this.applicationDate = applicationDate;
}
public String getApplicationDate()
{
return applicationDate;
}
public void setConfirmTheDate(String confirmTheDate)
{
this.confirmTheDate = confirmTheDate;
}
public String getConfirmTheDate()
{
return confirmTheDate;
}
public void setOutboundRemarks(String outboundRemarks)
{
this.outboundRemarks = outboundRemarks;
}
public String getOutboundRemarks()
{
return outboundRemarks;
}
public void setOutboundCompletionStatus(String outboundCompletionStatus)
{
this.outboundCompletionStatus = outboundCompletionStatus;
}
public String getOutboundCompletionStatus()
{
return outboundCompletionStatus;
}
public void setShippingStatus(String shippingStatus)
{
this.shippingStatus = shippingStatus;
}
public String getShippingStatus()
{
return shippingStatus;
}
public void setApprovalComments(String approvalComments)
{
this.approvalComments = approvalComments;
}
public String getApprovalComments()
{
return approvalComments;
}
public void setAddPersonnel(String addPersonnel)
{
this.addPersonnel = addPersonnel;
}
public String getAddPersonnel()
{
return addPersonnel;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setApprover(String approver)
{
this.approver = approver;
}
public String getApprover()
{
return approver;
}
public void setActualOperationTime(String actualOperationTime)
{
this.actualOperationTime = actualOperationTime;
}
public String getActualOperationTime()
{
return actualOperationTime;
}
public void setStorekeeper(String storekeeper)
{
this.storekeeper = storekeeper;
}
public String getStorekeeper()
{
return storekeeper;
}
public void setOutboundNumber(String outboundNumber)
{
this.outboundNumber = outboundNumber;
}
public String getOutboundNumber()
{
return outboundNumber;
}
public void setOutboundType(String outboundType)
{
this.outboundType = outboundType;
}
public String getOutboundType()
{
return outboundType;
}
public void setConsignee(String consignee)
{
this.consignee = consignee;
}
public String getConsignee()
{
return consignee;
}
public void setLandline(String landline)
{
this.landline = landline;
}
public String getLandline()
{
return landline;
}
public void setMobilePhone(String mobilePhone)
{
this.mobilePhone = mobilePhone;
}
public String getMobilePhone()
{
return mobilePhone;
}
public void setAddress(String address)
{
this.address = address;
}
public String getAddress()
{
return address;
}
public void setPostalCode(String postalCode)
{
this.postalCode = postalCode;
}
public String getPostalCode()
{
return postalCode;
}
public void setHedge(String hedge)
{
this.hedge = hedge;
}
public String getHedge()
{
return hedge;
}
public void setApprovalStatus(String approvalStatus)
{
this.approvalStatus = approvalStatus;
}
public String getApprovalStatus()
{
return approvalStatus;
}
public void setProductDetails(String productDetails)
{
this.productDetails = productDetails;
}
public String getProductDetails()
{
return productDetails;
}
public void setCustomerName(String customerName)
{
this.customerName = customerName;
}
public String getCustomerName()
{
return customerName;
}
public void setSpare2(String spare2)
{
this.spare2 = spare2;
}
public String getSpare2()
{
return spare2;
}
public void setSpare3(String spare3)
{
this.spare3 = spare3;
}
public String getSpare3()
{
return spare3;
}
public void setSpare4(String spare4)
{
this.spare4 = spare4;
}
public String getSpare4()
{
return spare4;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("stockoutId", getStockoutId())
.append("theme", getTheme())
.append("warehouse", getWarehouse())
.append("applicationDate", getApplicationDate())
.append("confirmTheDate", getConfirmTheDate())
.append("outboundRemarks", getOutboundRemarks())
.append("outboundCompletionStatus", getOutboundCompletionStatus())
.append("shippingStatus", getShippingStatus())
.append("approvalComments", getApprovalComments())
.append("addPersonnel", getAddPersonnel())
.append("status", getStatus())
.append("approver", getApprover())
.append("actualOperationTime", getActualOperationTime())
.append("storekeeper", getStorekeeper())
.append("outboundNumber", getOutboundNumber())
.append("outboundType", getOutboundType())
.append("consignee", getConsignee())
.append("landline", getLandline())
.append("mobilePhone", getMobilePhone())
.append("address", getAddress())
.append("postalCode", getPostalCode())
.append("hedge", getHedge())
.append("approvalStatus", getApprovalStatus())
.append("productDetails", getProductDetails())
.append("customerName", getCustomerName())
.append("spare2", getSpare2())
.append("spare3", getSpare3())
.append("spare4", getSpare4())
.toString();
}
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.out.ErpOutStock.mapper;
import java.util.List;
import com.ruoyi.out.ErpOutStock.domain.ErpOutStock;
/**
* 出库主单关联表Mapper接口
*
* @author ruoyi
* @date 2025-12-04
*/
public interface ErpOutStockMapper
{
/**
* 查询出库主单关联表
*
* @param stockoutId 出库主单关联表主键
* @return 出库主单关联表
*/
public ErpOutStock selectErpOutStockByStockoutId(String stockoutId);
/**
* 查询出库主单关联表列表
*
* @param erpOutStock 出库主单关联表
* @return 出库主单关联表集合
*/
public List<ErpOutStock> selectErpOutStockList(ErpOutStock erpOutStock);
/**
* 新增出库主单关联表
*
* @param erpOutStock 出库主单关联表
* @return 结果
*/
public int insertErpOutStock(ErpOutStock erpOutStock);
/**
* 修改出库主单关联表
*
* @param erpOutStock 出库主单关联表
* @return 结果
*/
public int updateErpOutStock(ErpOutStock erpOutStock);
/**
* 删除出库主单关联表
*
* @param stockoutId 出库主单关联表主键
* @return 结果
*/
public int deleteErpOutStockByStockoutId(String stockoutId);
/**
* 批量删除出库主单关联表
*
* @param stockoutIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteErpOutStockByStockoutIds(String[] stockoutIds);
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.out.ErpOutStock.service;
import java.util.List;
import com.ruoyi.out.ErpOutStock.domain.ErpOutStock;
/**
* 出库主单关联表Service接口
*
* @author ruoyi
* @date 2025-12-04
*/
public interface IErpOutStockService
{
/**
* 查询出库主单关联表
*
* @param stockoutId 出库主单关联表主键
* @return 出库主单关联表
*/
public ErpOutStock selectErpOutStockByStockoutId(String stockoutId);
/**
* 查询出库主单关联表列表
*
* @param erpOutStock 出库主单关联表
* @return 出库主单关联表集合
*/
public List<ErpOutStock> selectErpOutStockList(ErpOutStock erpOutStock);
/**
* 新增出库主单关联表
*
* @param erpOutStock 出库主单关联表
* @return 结果
*/
public int insertErpOutStock(ErpOutStock erpOutStock);
/**
* 修改出库主单关联表
*
* @param erpOutStock 出库主单关联表
* @return 结果
*/
public int updateErpOutStock(ErpOutStock erpOutStock);
/**
* 批量删除出库主单关联表
*
* @param stockoutIds 需要删除的出库主单关联表主键集合
* @return 结果
*/
public int deleteErpOutStockByStockoutIds(String[] stockoutIds);
/**
* 删除出库主单关联表信息
*
* @param stockoutId 出库主单关联表主键
* @return 结果
*/
public int deleteErpOutStockByStockoutId(String stockoutId);
}

View File

@@ -0,0 +1,93 @@
package com.ruoyi.out.ErpOutStock.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.out.ErpOutStock.mapper.ErpOutStockMapper;
import com.ruoyi.out.ErpOutStock.domain.ErpOutStock;
import com.ruoyi.out.ErpOutStock.service.IErpOutStockService;
/**
* 出库主单关联表Service业务层处理
*
* @author ruoyi
* @date 2025-12-04
*/
@Service
public class ErpOutStockServiceImpl implements IErpOutStockService
{
@Autowired
private ErpOutStockMapper erpOutStockMapper;
/**
* 查询出库主单关联表
*
* @param stockoutId 出库主单关联表主键
* @return 出库主单关联表
*/
@Override
public ErpOutStock selectErpOutStockByStockoutId(String stockoutId)
{
return erpOutStockMapper.selectErpOutStockByStockoutId(stockoutId);
}
/**
* 查询出库主单关联表列表
*
* @param erpOutStock 出库主单关联表
* @return 出库主单关联表
*/
@Override
public List<ErpOutStock> selectErpOutStockList(ErpOutStock erpOutStock)
{
return erpOutStockMapper.selectErpOutStockList(erpOutStock);
}
/**
* 新增出库主单关联表
*
* @param erpOutStock 出库主单关联表
* @return 结果
*/
@Override
public int insertErpOutStock(ErpOutStock erpOutStock)
{
return erpOutStockMapper.insertErpOutStock(erpOutStock);
}
/**
* 修改出库主单关联表
*
* @param erpOutStock 出库主单关联表
* @return 结果
*/
@Override
public int updateErpOutStock(ErpOutStock erpOutStock)
{
return erpOutStockMapper.updateErpOutStock(erpOutStock);
}
/**
* 批量删除出库主单关联表
*
* @param stockoutIds 需要删除的出库主单关联表主键
* @return 结果
*/
@Override
public int deleteErpOutStockByStockoutIds(String[] stockoutIds)
{
return erpOutStockMapper.deleteErpOutStockByStockoutIds(stockoutIds);
}
/**
* 删除出库主单关联表信息
*
* @param stockoutId 出库主单关联表主键
* @return 结果
*/
@Override
public int deleteErpOutStockByStockoutId(String stockoutId)
{
return erpOutStockMapper.deleteErpOutStockByStockoutId(stockoutId);
}
}

View File

@@ -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));
}
}

View File

@@ -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();
}
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}
}

View File

@@ -0,0 +1,104 @@
package com.ruoyi.out.OutStockMiddle.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.OutStockMiddle.domain.OutStockMiddle;
import com.ruoyi.out.OutStockMiddle.service.IOutStockMiddleService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 出库单中间表Controller
*
* @author ruoyi
* @date 2025-12-05
*/
@RestController
@RequestMapping("/out/OutStockMiddle")
public class OutStockMiddleController extends BaseController
{
@Autowired
private IOutStockMiddleService outStockMiddleService;
/**
* 查询出库单中间表列表
*/
@PreAuthorize("@ss.hasPermi('out:OutStockMiddle:list')")
@GetMapping("/list")
public TableDataInfo list(OutStockMiddle outStockMiddle)
{
startPage();
List<OutStockMiddle> list = outStockMiddleService.selectOutStockMiddleList(outStockMiddle);
return getDataTable(list);
}
/**
* 导出出库单中间表列表
*/
@PreAuthorize("@ss.hasPermi('out:OutStockMiddle:export')")
@Log(title = "出库单中间表", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, OutStockMiddle outStockMiddle)
{
List<OutStockMiddle> list = outStockMiddleService.selectOutStockMiddleList(outStockMiddle);
ExcelUtil<OutStockMiddle> util = new ExcelUtil<OutStockMiddle>(OutStockMiddle.class);
util.exportExcel(response, list, "出库单中间表数据");
}
/**
* 获取出库单中间表详细信息
*/
@PreAuthorize("@ss.hasPermi('out:OutStockMiddle:query')")
@GetMapping(value = "/{stockoutId}")
public AjaxResult getInfo(@PathVariable("stockoutId") String stockoutId)
{
return success(outStockMiddleService.selectOutStockMiddleByStockoutId(stockoutId));
}
/**
* 新增出库单中间表
*/
@PreAuthorize("@ss.hasPermi('out:OutStockMiddle:add')")
@Log(title = "出库单中间表", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody OutStockMiddle outStockMiddle)
{
return toAjax(outStockMiddleService.insertOutStockMiddle(outStockMiddle));
}
/**
* 修改出库单中间表
*/
@PreAuthorize("@ss.hasPermi('out:OutStockMiddle:edit')")
@Log(title = "出库单中间表", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody OutStockMiddle outStockMiddle)
{
return toAjax(outStockMiddleService.updateOutStockMiddle(outStockMiddle));
}
/**
* 删除出库单中间表
*/
@PreAuthorize("@ss.hasPermi('out:OutStockMiddle:remove')")
@Log(title = "出库单中间表", businessType = BusinessType.DELETE)
@DeleteMapping("/{stockoutIds}")
public AjaxResult remove(@PathVariable String[] stockoutIds)
{
return toAjax(outStockMiddleService.deleteOutStockMiddleByStockoutIds(stockoutIds));
}
}

View File

@@ -0,0 +1,112 @@
package com.ruoyi.out.OutStockMiddle.domain;
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;
/**
* 出库单中间表对象 out_stock_middle
*
* @author ruoyi
* @date 2025-12-05
*/
public class OutStockMiddle extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 出库主单id */
private String stockoutId;
/** 是否添加子单 0否 1是 */
@Excel(name = "是否添加子单 0否 1是")
private String status;
/** 创建时间 */
@Excel(name = "创建时间")
private String createDate;
/** 备用字段1 */
@Excel(name = "备用字段1")
private String spare1;
/** 备用字段2 */
@Excel(name = "备用字段2")
private String spare2;
/** 备用字段3 */
@Excel(name = "备用字段3")
private String spare3;
public void setStockoutId(String stockoutId)
{
this.stockoutId = stockoutId;
}
public String getStockoutId()
{
return stockoutId;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setCreateDate(String createDate)
{
this.createDate = createDate;
}
public String getCreateDate()
{
return createDate;
}
public void setSpare1(String spare1)
{
this.spare1 = spare1;
}
public String getSpare1()
{
return spare1;
}
public void setSpare2(String spare2)
{
this.spare2 = spare2;
}
public String getSpare2()
{
return spare2;
}
public void setSpare3(String spare3)
{
this.spare3 = spare3;
}
public String getSpare3()
{
return spare3;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("stockoutId", getStockoutId())
.append("status", getStatus())
.append("createDate", getCreateDate())
.append("spare1", getSpare1())
.append("spare2", getSpare2())
.append("spare3", getSpare3())
.toString();
}
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.out.OutStockMiddle.mapper;
import java.util.List;
import com.ruoyi.out.OutStockMiddle.domain.OutStockMiddle;
/**
* 出库单中间表Mapper接口
*
* @author ruoyi
* @date 2025-12-05
*/
public interface OutStockMiddleMapper
{
/**
* 查询出库单中间表
*
* @param stockoutId 出库单中间表主键
* @return 出库单中间表
*/
public OutStockMiddle selectOutStockMiddleByStockoutId(String stockoutId);
/**
* 查询出库单中间表列表
*
* @param outStockMiddle 出库单中间表
* @return 出库单中间表集合
*/
public List<OutStockMiddle> selectOutStockMiddleList(OutStockMiddle outStockMiddle);
/**
* 新增出库单中间表
*
* @param outStockMiddle 出库单中间表
* @return 结果
*/
public int insertOutStockMiddle(OutStockMiddle outStockMiddle);
/**
* 修改出库单中间表
*
* @param outStockMiddle 出库单中间表
* @return 结果
*/
public int updateOutStockMiddle(OutStockMiddle outStockMiddle);
/**
* 删除出库单中间表
*
* @param stockoutId 出库单中间表主键
* @return 结果
*/
public int deleteOutStockMiddleByStockoutId(String stockoutId);
/**
* 批量删除出库单中间表
*
* @param stockoutIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteOutStockMiddleByStockoutIds(String[] stockoutIds);
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.out.OutStockMiddle.service;
import java.util.List;
import com.ruoyi.out.OutStockMiddle.domain.OutStockMiddle;
/**
* 出库单中间表Service接口
*
* @author ruoyi
* @date 2025-12-05
*/
public interface IOutStockMiddleService
{
/**
* 查询出库单中间表
*
* @param stockoutId 出库单中间表主键
* @return 出库单中间表
*/
public OutStockMiddle selectOutStockMiddleByStockoutId(String stockoutId);
/**
* 查询出库单中间表列表
*
* @param outStockMiddle 出库单中间表
* @return 出库单中间表集合
*/
public List<OutStockMiddle> selectOutStockMiddleList(OutStockMiddle outStockMiddle);
/**
* 新增出库单中间表
*
* @param outStockMiddle 出库单中间表
* @return 结果
*/
public int insertOutStockMiddle(OutStockMiddle outStockMiddle);
/**
* 修改出库单中间表
*
* @param outStockMiddle 出库单中间表
* @return 结果
*/
public int updateOutStockMiddle(OutStockMiddle outStockMiddle);
/**
* 批量删除出库单中间表
*
* @param stockoutIds 需要删除的出库单中间表主键集合
* @return 结果
*/
public int deleteOutStockMiddleByStockoutIds(String[] stockoutIds);
/**
* 删除出库单中间表信息
*
* @param stockoutId 出库单中间表主键
* @return 结果
*/
public int deleteOutStockMiddleByStockoutId(String stockoutId);
}

View File

@@ -0,0 +1,93 @@
package com.ruoyi.out.OutStockMiddle.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.out.OutStockMiddle.mapper.OutStockMiddleMapper;
import com.ruoyi.out.OutStockMiddle.domain.OutStockMiddle;
import com.ruoyi.out.OutStockMiddle.service.IOutStockMiddleService;
/**
* 出库单中间表Service业务层处理
*
* @author ruoyi
* @date 2025-12-05
*/
@Service
public class OutStockMiddleServiceImpl implements IOutStockMiddleService
{
@Autowired
private OutStockMiddleMapper outStockMiddleMapper;
/**
* 查询出库单中间表
*
* @param stockoutId 出库单中间表主键
* @return 出库单中间表
*/
@Override
public OutStockMiddle selectOutStockMiddleByStockoutId(String stockoutId)
{
return outStockMiddleMapper.selectOutStockMiddleByStockoutId(stockoutId);
}
/**
* 查询出库单中间表列表
*
* @param outStockMiddle 出库单中间表
* @return 出库单中间表
*/
@Override
public List<OutStockMiddle> selectOutStockMiddleList(OutStockMiddle outStockMiddle)
{
return outStockMiddleMapper.selectOutStockMiddleList(outStockMiddle);
}
/**
* 新增出库单中间表
*
* @param outStockMiddle 出库单中间表
* @return 结果
*/
@Override
public int insertOutStockMiddle(OutStockMiddle outStockMiddle)
{
return outStockMiddleMapper.insertOutStockMiddle(outStockMiddle);
}
/**
* 修改出库单中间表
*
* @param outStockMiddle 出库单中间表
* @return 结果
*/
@Override
public int updateOutStockMiddle(OutStockMiddle outStockMiddle)
{
return outStockMiddleMapper.updateOutStockMiddle(outStockMiddle);
}
/**
* 批量删除出库单中间表
*
* @param stockoutIds 需要删除的出库单中间表主键
* @return 结果
*/
@Override
public int deleteOutStockMiddleByStockoutIds(String[] stockoutIds)
{
return outStockMiddleMapper.deleteOutStockMiddleByStockoutIds(stockoutIds);
}
/**
* 删除出库单中间表信息
*
* @param stockoutId 出库单中间表主键
* @return 结果
*/
@Override
public int deleteOutStockMiddleByStockoutId(String stockoutId)
{
return outStockMiddleMapper.deleteOutStockMiddleByStockoutId(stockoutId);
}
}

View File

@@ -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();
}

View File

@@ -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>

View File

@@ -0,0 +1,189 @@
<?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.ErpOutStock.mapper.ErpOutStockMapper">
<resultMap type="ErpOutStock" id="ErpOutStockResult">
<result property="stockoutId" column="stockout_id" />
<result property="theme" column="theme" />
<result property="warehouse" column="warehouse" />
<result property="applicationDate" column="application_date" />
<result property="confirmTheDate" column="confirm_the_date" />
<result property="outboundRemarks" column="outbound_remarks" />
<result property="outboundCompletionStatus" column="outbound_completion_status" />
<result property="shippingStatus" column="shipping_status" />
<result property="approvalComments" column="approval_comments" />
<result property="addPersonnel" column="add_personnel" />
<result property="status" column="status" />
<result property="approver" column="approver" />
<result property="actualOperationTime" column="actual_operation_time" />
<result property="storekeeper" column="storekeeper" />
<result property="outboundNumber" column="outbound_number" />
<result property="outboundType" column="outbound_type" />
<result property="consignee" column="consignee" />
<result property="landline" column="landline" />
<result property="mobilePhone" column="mobile_phone" />
<result property="address" column="address" />
<result property="postalCode" column="postal_code" />
<result property="hedge" column="hedge" />
<result property="approvalStatus" column="approval_status" />
<result property="productDetails" column="product_details" />
<result property="customerName" column="customer_name" />
<result property="spare2" column="spare2" />
<result property="spare3" column="spare3" />
<result property="spare4" column="spare4" />
</resultMap>
<sql id="selectErpOutStockVo">
select stockout_id, theme, warehouse, application_date, confirm_the_date, outbound_remarks, outbound_completion_status, shipping_status, approval_comments, add_personnel, status, approver, actual_operation_time, storekeeper, outbound_number, outbound_type, consignee, landline, mobile_phone, address, postal_code, hedge, approval_status, product_details, customer_name, spare2, spare3, spare4 from erp_out_stock
</sql>
<select id="selectErpOutStockList" parameterType="ErpOutStock" resultMap="ErpOutStockResult">
<include refid="selectErpOutStockVo"/>
<where>
<if test="stockoutId != null and stockoutId != ''"> and stockout_id = #{stockoutId}</if>
<if test="theme != null and theme != ''"> and theme = #{theme}</if>
<if test="warehouse != null and warehouse != ''"> and warehouse = #{warehouse}</if>
<if test="applicationDate != null and applicationDate != ''"> and application_date = #{applicationDate}</if>
<if test="confirmTheDate != null and confirmTheDate != ''"> and confirm_the_date = #{confirmTheDate}</if>
<if test="outboundRemarks != null and outboundRemarks != ''"> and outbound_remarks = #{outboundRemarks}</if>
<if test="outboundCompletionStatus != null and outboundCompletionStatus != ''"> and outbound_completion_status = #{outboundCompletionStatus}</if>
<if test="shippingStatus != null and shippingStatus != ''"> and shipping_status = #{shippingStatus}</if>
<if test="approvalComments != null and approvalComments != ''"> and approval_comments = #{approvalComments}</if>
<if test="addPersonnel != null and addPersonnel != ''"> and add_personnel = #{addPersonnel}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="approver != null and approver != ''"> and approver = #{approver}</if>
<if test="actualOperationTime != null and actualOperationTime != ''"> and actual_operation_time = #{actualOperationTime}</if>
<if test="storekeeper != null and storekeeper != ''"> and storekeeper = #{storekeeper}</if>
<if test="outboundNumber != null and outboundNumber != ''"> and outbound_number = #{outboundNumber}</if>
<if test="outboundType != null and outboundType != ''"> and outbound_type = #{outboundType}</if>
<if test="consignee != null and consignee != ''"> and consignee = #{consignee}</if>
<if test="landline != null and landline != ''"> and landline = #{landline}</if>
<if test="mobilePhone != null and mobilePhone != ''"> and mobile_phone = #{mobilePhone}</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="postalCode != null and postalCode != ''"> and postal_code = #{postalCode}</if>
<if test="hedge != null and hedge != ''"> and hedge = #{hedge}</if>
<if test="approvalStatus != null and approvalStatus != ''"> and approval_status = #{approvalStatus}</if>
<if test="productDetails != null and productDetails != ''"> and product_details = #{productDetails}</if>
<if test="customerName != null and customerName != ''"> and customer_name = #{customerName}</if>
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
<if test="spare4 != null and spare4 != ''"> and spare4 = #{spare4}</if>
</where>
</select>
<select id="selectErpOutStockByStockoutId" parameterType="String" resultMap="ErpOutStockResult">
<include refid="selectErpOutStockVo"/>
where stockout_id = #{stockoutId}
</select>
<insert id="insertErpOutStock" parameterType="ErpOutStock">
insert into erp_out_stock
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="stockoutId != null">stockout_id,</if>
<if test="theme != null">theme,</if>
<if test="warehouse != null">warehouse,</if>
<if test="applicationDate != null">application_date,</if>
<if test="confirmTheDate != null">confirm_the_date,</if>
<if test="outboundRemarks != null">outbound_remarks,</if>
<if test="outboundCompletionStatus != null">outbound_completion_status,</if>
<if test="shippingStatus != null">shipping_status,</if>
<if test="approvalComments != null">approval_comments,</if>
<if test="addPersonnel != null">add_personnel,</if>
<if test="status != null">status,</if>
<if test="approver != null">approver,</if>
<if test="actualOperationTime != null">actual_operation_time,</if>
<if test="storekeeper != null">storekeeper,</if>
<if test="outboundNumber != null">outbound_number,</if>
<if test="outboundType != null">outbound_type,</if>
<if test="consignee != null">consignee,</if>
<if test="landline != null">landline,</if>
<if test="mobilePhone != null">mobile_phone,</if>
<if test="address != null">address,</if>
<if test="postalCode != null">postal_code,</if>
<if test="hedge != null">hedge,</if>
<if test="approvalStatus != null">approval_status,</if>
<if test="productDetails != null">product_details,</if>
<if test="customerName != null">customer_name,</if>
<if test="spare2 != null">spare2,</if>
<if test="spare3 != null">spare3,</if>
<if test="spare4 != null">spare4,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="stockoutId != null">#{stockoutId},</if>
<if test="theme != null">#{theme},</if>
<if test="warehouse != null">#{warehouse},</if>
<if test="applicationDate != null">#{applicationDate},</if>
<if test="confirmTheDate != null">#{confirmTheDate},</if>
<if test="outboundRemarks != null">#{outboundRemarks},</if>
<if test="outboundCompletionStatus != null">#{outboundCompletionStatus},</if>
<if test="shippingStatus != null">#{shippingStatus},</if>
<if test="approvalComments != null">#{approvalComments},</if>
<if test="addPersonnel != null">#{addPersonnel},</if>
<if test="status != null">#{status},</if>
<if test="approver != null">#{approver},</if>
<if test="actualOperationTime != null">#{actualOperationTime},</if>
<if test="storekeeper != null">#{storekeeper},</if>
<if test="outboundNumber != null">#{outboundNumber},</if>
<if test="outboundType != null">#{outboundType},</if>
<if test="consignee != null">#{consignee},</if>
<if test="landline != null">#{landline},</if>
<if test="mobilePhone != null">#{mobilePhone},</if>
<if test="address != null">#{address},</if>
<if test="postalCode != null">#{postalCode},</if>
<if test="hedge != null">#{hedge},</if>
<if test="approvalStatus != null">#{approvalStatus},</if>
<if test="productDetails != null">#{productDetails},</if>
<if test="customerName != null">#{customerName},</if>
<if test="spare2 != null">#{spare2},</if>
<if test="spare3 != null">#{spare3},</if>
<if test="spare4 != null">#{spare4},</if>
</trim>
</insert>
<update id="updateErpOutStock" parameterType="ErpOutStock">
update erp_out_stock
<trim prefix="SET" suffixOverrides=",">
<if test="theme != null">theme = #{theme},</if>
<if test="warehouse != null">warehouse = #{warehouse},</if>
<if test="applicationDate != null">application_date = #{applicationDate},</if>
<if test="confirmTheDate != null">confirm_the_date = #{confirmTheDate},</if>
<if test="outboundRemarks != null">outbound_remarks = #{outboundRemarks},</if>
<if test="outboundCompletionStatus != null">outbound_completion_status = #{outboundCompletionStatus},</if>
<if test="shippingStatus != null">shipping_status = #{shippingStatus},</if>
<if test="approvalComments != null">approval_comments = #{approvalComments},</if>
<if test="addPersonnel != null">add_personnel = #{addPersonnel},</if>
<if test="status != null">status = #{status},</if>
<if test="approver != null">approver = #{approver},</if>
<if test="actualOperationTime != null">actual_operation_time = #{actualOperationTime},</if>
<if test="storekeeper != null">storekeeper = #{storekeeper},</if>
<if test="outboundNumber != null">outbound_number = #{outboundNumber},</if>
<if test="outboundType != null">outbound_type = #{outboundType},</if>
<if test="consignee != null">consignee = #{consignee},</if>
<if test="landline != null">landline = #{landline},</if>
<if test="mobilePhone != null">mobile_phone = #{mobilePhone},</if>
<if test="address != null">address = #{address},</if>
<if test="postalCode != null">postal_code = #{postalCode},</if>
<if test="hedge != null">hedge = #{hedge},</if>
<if test="approvalStatus != null">approval_status = #{approvalStatus},</if>
<if test="productDetails != null">product_details = #{productDetails},</if>
<if test="customerName != null">customer_name = #{customerName},</if>
<if test="spare2 != null">spare2 = #{spare2},</if>
<if test="spare3 != null">spare3 = #{spare3},</if>
<if test="spare4 != null">spare4 = #{spare4},</if>
</trim>
where stockout_id = #{stockoutId}
</update>
<delete id="deleteErpOutStockByStockoutId" parameterType="String">
delete from erp_out_stock where stockout_id = #{stockoutId}
</delete>
<delete id="deleteErpOutStockByStockoutIds" parameterType="String">
delete from erp_out_stock where stockout_id in
<foreach item="stockoutId" collection="array" open="(" separator="," close=")">
#{stockoutId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,78 @@
<?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.OutStockMiddle.mapper.OutStockMiddleMapper">
<resultMap type="OutStockMiddle" id="OutStockMiddleResult">
<result property="stockoutId" column="stockout_id" />
<result property="status" column="status" />
<result property="createDate" column="create_date" />
<result property="spare1" column="spare1" />
<result property="spare2" column="spare2" />
<result property="spare3" column="spare3" />
</resultMap>
<sql id="selectOutStockMiddleVo">
select stockout_id, status, create_date, spare1, spare2, spare3 from out_stock_middle
</sql>
<select id="selectOutStockMiddleList" parameterType="OutStockMiddle" resultMap="OutStockMiddleResult">
<include refid="selectOutStockMiddleVo"/>
<where>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="createDate != null and createDate != ''"> and create_date = #{createDate}</if>
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
</where>
</select>
<select id="selectOutStockMiddleByStockoutId" parameterType="String" resultMap="OutStockMiddleResult">
<include refid="selectOutStockMiddleVo"/>
where stockout_id = #{stockoutId}
</select>
<insert id="insertOutStockMiddle" parameterType="OutStockMiddle">
insert into out_stock_middle
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="stockoutId != null and stockoutId != ''">stockout_id,</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>
<if test="spare3 != null">spare3,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="stockoutId != null and stockoutId != ''">#{stockoutId},</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>
<if test="spare3 != null">#{spare3},</if>
</trim>
</insert>
<update id="updateOutStockMiddle" parameterType="OutStockMiddle">
update out_stock_middle
<trim prefix="SET" suffixOverrides=",">
<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>
<if test="spare3 != null">spare3 = #{spare3},</if>
</trim>
where stockout_id = #{stockoutId}
</update>
<delete id="deleteOutStockMiddleByStockoutId" parameterType="String">
delete from out_stock_middle where stockout_id = #{stockoutId}
</delete>
<delete id="deleteOutStockMiddleByStockoutIds" parameterType="String">
delete from out_stock_middle where stockout_id in
<foreach item="stockoutId" collection="array" open="(" separator="," close=")">
#{stockoutId}
</foreach>
</delete>
</mapper>

View File

@@ -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>