星空对接接口开发:优化回传星空接口逻辑以及可读性/

This commit is contained in:
16358 2025-06-18 16:29:07 +08:00
parent 1fd5b4d93d
commit 9288155070
20 changed files with 920 additions and 178 deletions

View File

@ -85,8 +85,16 @@ public class PoundBill extends BaseEntity
@Excel(name = "原净重")
private BigDecimal srcnetmqty;
/** 名称 */
@Excel(name = "名称")
/** 物料编码 */
@Excel(name = "物料编码")
private String itnumber;
/** 捆号 */
@Excel(name = "捆号")
private Long bundleNo;
/** 物料名称 */
@Excel(name = "物料名称")
private String itmname;
/** 毛重司磅员 */
@ -316,6 +324,22 @@ public class PoundBill extends BaseEntity
this.zgsName = zgsName;
}
public String getItnumber() {
return itnumber;
}
public void setItnumber(String itnumber) {
this.itnumber = itnumber;
}
public Long getBundleNo() {
return bundleNo;
}
public void setBundleNo(Long bundleNo) {
this.bundleNo = bundleNo;
}
public void setId(String id)
{
this.id = id;

View File

@ -1,10 +1,13 @@
package com.ruoyi.webApi;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.ruoyi.bill.domain.PoundBill;
import com.ruoyi.bill.domain.Poundappli;
import com.ruoyi.bill.service.IPoundBillService;
import com.ruoyi.bill.service.IPoundappliService;
import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.webApi.billHandlerUtil.BillHandler;
import com.ruoyi.webApi.billHandlerUtil.BillHandlers;
import com.ruoyi.webApi.requestbody.DynamicFormRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@ -14,6 +17,7 @@ import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
/**
* 各个单据回传星空接口单据更新单据下推
@ -25,209 +29,73 @@ public class ApiPostBack {
@Autowired
private ISysConfigService sysConfigService;
@Autowired
private ApiTask apiTask;
@Autowired
private IPoundBillService poundBillService;
/**
* 磅单信息对象更新回星空
* @return 回传成功报文/错误日志信息
*/
public String makePoundBillFormData(String id){
private static final ObjectMapper objectMapper = new ObjectMapper();
public String makePoundBillFormData(String id) throws IOException {
PoundBill poundBill = poundBillService.selectPoundBillById(id);
if(poundBill == null) throw new RuntimeException("磅单不存在!");
// 目标URL
String url = sysConfigService.selectConfigByKey("OA_Url")+"/k3cloud/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.save.common.kdsvc";
if (poundBill == null) throw new RuntimeException("磅单不存在!");
String jsonInputString = "";
String oabilltype = poundBill.getSrcblltype();
if("SAL_DELIVERYNOTICE".equals(oabilltype)){
//发货通知单
jsonInputString = "{\n" +
" \"Formid\": \"SAL_DELIVERYNOTICE\",\n" +
" \"data\": {\n" +
" \"NeedUpDateFields\": [],\n" +
" \"NeedReturnFields\": [],\n" +
" \"IsDeleteEntry\": \"true\",\n" +
" \"IsAutoAdjustField\": \"true\",\n" +
" \"Model\": {\n" +
" \"FID\": \""+poundBill.getFid()+"\",\n" +
" \"F_GMSHDW\": \""+poundBill.getRecunitid()+"\",\n" +
" \"F_CYDW\": \""+poundBill.getTrnunitid()+"\",\n" +
" \"F_BDMC\":\""+poundBill.getPoundname()+" \",\n" +
" \"FEntity\": [\n" +
" {\n" +
" \"FEntryID\": "+poundBill.getFentity_fentryid()+",\n" +
" \"F_JLHCSL\": \""+poundBill.getNetmqty()+"\",\n" +
" \"F_YMZ\": \""+poundBill.getSrcwghmqty()+"\",\n" +
" \"F_YPZ\": \""+poundBill.getSrcempmqty()+"\",\n" +
" \"F_JS\": \""+poundBill.getNetmqty()+"\"\n" +
" }\n" +
" ]\n" +
" }\n" +
" }\n" +
"}";
}else if("PUR_ReceiveBill".equals(oabilltype)){
//收料通知单
jsonInputString = "{\n" +
" \"Formid\": \"PUR_ReceiveBill\",\n" +
" \"data\": {\n" +
" \"NeedUpDateFields\": [],\n" +
" \"NeedReturnFields\": [],\n" +
" \"IsDeleteEntry\": \"true\",\n" +
" \"IsAutoAdjustField\": \"true\",\n" +
" \"Model\": {\n" +
" \"FID\": \""+poundBill.getFid()+"\",\n" +
" \"F_GMSHDW\": \""+poundBill.getRecunitid()+"\",\n" +
" \"F_CYDW\": \""+poundBill.getTrnunitid()+"\",\n" +
" \"F_BDMC\":\""+poundBill.getPoundname()+" \",\n" +
" \"FDetailEntity\": [\n" +
" {\n" +
" \"FEntryID\": "+poundBill.getFentity_fentryid()+",\n" +
" \"F_JLHCSL\": \""+poundBill.getNetmqty()+"\",\n" +
" \"F_YMZ\": \""+poundBill.getSrcwghmqty()+"\",\n" +
" \"F_YPZ\": \""+poundBill.getSrcempmqty()+"\",\n" +
" \"F_JS\": \""+poundBill.getNetmqty()+"\"\n" +
" }\n" +
" ]\n" +
" }\n" +
" }\n" +
"}";
}else if("STK_TRANSFERAPPLY".equals(oabilltype)){
//调拨申请单
jsonInputString = "{\n" +
" \"Formid\": \"STK_TRANSFERAPPLY\",\n" +
" \"data\": {\n" +
" \"NeedUpDateFields\": [],\n" +
" \"NeedReturnFields\": [],\n" +
" \"IsDeleteEntry\": \"true\",\n" +
" \"IsAutoAdjustField\": \"true\",\n" +
" \"Model\": {\n" +
" \"FID\": \""+poundBill.getFid()+"\",\n" +
" \"F_DYCS\": "+poundBill.getPrintcount()+", \n" +
" \"F_CYDW\": \""+poundBill.getTrnunitid()+"\", \n" +
" \"F_FHDW\": \""+poundBill.getSendunitid()+"\", \n" +
" \"F_SHDW\": \""+poundBill.getRecunitid()+"\", \n" +
" \"F_ZGS\": "+poundBill.getZgsId()+", \n" +
" \"FEntity\": [\n" +
" {\n" +
" \"FEntryID\": "+poundBill.getFentity_fentryid()+",\n" +
" \"F_JLHCSL\": \""+poundBill.getNetmqty()+"\" \n" +
" }\n" +
" ]\n" +
" }\n" +
" }\n" +
"}";
}else if("SP_InStock".equals(oabilltype)){
//简单生产入库单
jsonInputString = "{\n" +
" \"Formid\": \"SP_InStock\",\n" +
" \"data\": {\n" +
" \"NeedUpDateFields\": [],\n" +
" \"NeedReturnFields\": [],\n" +
" \"IsDeleteEntry\": \"true\",\n" +
" \"IsAutoAdjustField\": \"true\",\n" +
" \"Model\": {\n" +
" \"FID\": \""+poundBill.getFid()+"\",\n" +
" \"F_YWBD\": \""+poundBill.getPoundid()+"\",\n" +
" \"F_SJYWBD\": \""+poundBill.getPoundid()+"\",\n" +
" \"F_ZGS\": "+poundBill.getZgsId()+", \n" +
" \"F_FHDW\": \""+poundBill.getSendunitid()+"\", \n" +
" \"F_SHDW\": \""+poundBill.getRecunitid()+"\", \n" +
" \"FEntity\": [\n" +
" {\n" +
" \"FEntryID\": "+poundBill.getFentity_fentryid()+",\n" +
" \"FMaterialId\": {\n" +
" \"FNumber\": \"\"\n" +
" },\n" +
" \"FInStockType\": \"1\",\n" +
" \"FMustQty\": "+poundBill.getNetmqty()+",\n" +
" \"FRealQty\": "+poundBill.getNetmqty()+",\n" +
" \"FStockId\": {\n" +
" \"FNumber\": \"\"\n" +
" },\n" +
" \"FWorkShopId1\": {\n" +
" \"FNumber\": \"\"\n" +
" },\n" +
" \"FShiftGroupId\": {\n" +
" \"FNumber\": \"\"\n" +
" },\n" +
" \"F_CZ\": 0,\n" +
" \"FMemo\": \""+poundBill.getRemark()+"\",\n" +
" \"F_LC\": \""+poundBill.getBoilerno()+"\",\n" +
" \"F_GH\": 0,\n" +
" \"F_GANGH\": \""+poundBill.getSteeno()+"\",\n" +
" \"F_ZKS\": 0,\n" +
" \"F_KH\": 0,\n" +
" \"F_PJZL\": 0,\n" +
" \"F_XCLX\": \""+poundBill.getLinetype()+"\",\n" +
" \"F_PH\": \""+poundBill.getBatno()+"\"\n" +
" }\n" +
" ]\n" +
" }\n" +
" }\n" +
"}";
}else {
throw new RuntimeException("单据类型错误!");
String url = sysConfigService.selectConfigByKey("OA_Url") +
"/k3cloud/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.save.common.kdsvc";
BillHandler handler = BillHandlers.getHandler(poundBill.getSrcblltype());
DynamicFormRequest request = handler.buildRequest(poundBill);
String jsonInputString;
try {
jsonInputString = objectMapper.writeValueAsString(request);
} catch (JsonProcessingException e) {
return "JSON序列化失败" + e.getMessage();
}
//记录错误日志
return sendPostRequest(url, jsonInputString);
}
private String sendPostRequest(String url, String jsonBody) throws IOException {
StringBuilder errorLog = new StringBuilder();
try {
// 创建URL对象
URL apiUrl = new URL(url);
// 打开连接
HttpURLConnection connection = (HttpURLConnection) apiUrl.openConnection();
// 设置请求方法为POST
connection.setRequestMethod("POST");
// 设置请求头
// Content-Type 指定发送的数据格式是JSON并且字符集为UTF-8
connection.setRequestProperty("Content-Type", "application/json; utf-8");
// Accept 指定期望接收的数据格式是JSON
connection.setRequestProperty("Accept", "application/json");
// 设置请求头包含token
String token = apiTask.getToken();
if (token != null && !token.isEmpty()) {
connection.setRequestProperty("kdservice-sessionid", token);
} else {
if (token == null || token.isEmpty()) {
throw new RuntimeException("获取到的Token为空无法设置请求头。");
}
// 允许写入请求体
connection.setRequestProperty("kdservice-sessionid", token);
connection.setDoOutput(true);
// 获取输出流发送请求体数据
try (OutputStream os = connection.getOutputStream()) {
byte[] input = jsonInputString.getBytes("utf-8");
byte[] input = jsonBody.getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
// 获取响应码
int responseCode = connection.getResponseCode();
// 读取响应内容
StringBuilder response = new StringBuilder();
try (BufferedReader br = new BufferedReader(
new InputStreamReader(connection.getInputStream(), "utf-8"))) {
String responseLine = null;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
if (responseCode == HttpURLConnection.HTTP_OK) {
try (BufferedReader br = new BufferedReader(
new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8))) {
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
return response.toString();
}
return response.toString();
}catch (Exception e) {
// throw new RuntimeException("因未知原因导致获取数据失败!");
errorLog.append("因未知原因导致数据回传星空失败!\n");
} else {
return "请求失败,响应码:" + responseCode;
}
} catch (IOException e) {
// throw new RuntimeException(e);
errorLog.append("回传数据失败!: " + e.getMessage()+ "\n");
return "回传数据失败!: " + e.getMessage();
}
return errorLog.toString();
}
}

View File

@ -0,0 +1,12 @@
package com.ruoyi.webApi.billHandlerUtil;
import com.ruoyi.bill.domain.PoundBill;
import com.ruoyi.webApi.requestbody.DynamicFormRequest;
/**
* @author 16358
* @date 2025/6/18
*/
public interface BillHandler {
DynamicFormRequest buildRequest(PoundBill bill);
}

View File

@ -0,0 +1,50 @@
package com.ruoyi.webApi.billHandlerUtil;
import com.ruoyi.webApi.billHandlerUtil.impl.PURHandler;
import com.ruoyi.webApi.billHandlerUtil.impl.SALHandler;
import com.ruoyi.webApi.billHandlerUtil.impl.SPHandler;
import com.ruoyi.webApi.billHandlerUtil.impl.STKHandler;
public enum BillHandlers {
SAL_DELIVERYNOTICE {
@Override
public BillHandler getHandler() {
return new SALHandler();
}
},
PUR_ReceiveBill {
@Override
public BillHandler getHandler() {
return new PURHandler();
}
},
STK_TRANSFERAPPLY {
@Override
public BillHandler getHandler() {
return new STKHandler();
}
},
SP_InStock {
@Override
public BillHandler getHandler() {
return new SPHandler();
}
};
public abstract BillHandler getHandler();
public static BillHandler getHandler(String type) {
switch (type) {
case "SAL_DELIVERYNOTICE":
return SAL_DELIVERYNOTICE.getHandler();
case "PUR_ReceiveBill":
return PUR_ReceiveBill.getHandler();
case "STK_TRANSFERAPPLY":
return STK_TRANSFERAPPLY.getHandler();
case "SP_InStock":
return SP_InStock.getHandler();
default:
throw new IllegalArgumentException("不支持的单据类型: " + type);
}
}
}

View File

@ -0,0 +1,24 @@
package com.ruoyi.webApi.billHandlerUtil.impl;
import com.ruoyi.bill.domain.PoundBill;
import com.ruoyi.webApi.billHandlerUtil.BillHandler;
import com.ruoyi.webApi.requestbody.DynamicFormRequest;
import com.ruoyi.webApi.requestbody.RequestData;
import com.ruoyi.webApi.requestbody.model.PURModel;
/**
* @author 16358
* @date 2025/6/18
* 收料通知单
*/
public class PURHandler implements BillHandler {
@Override
public DynamicFormRequest buildRequest(PoundBill bill) {
DynamicFormRequest request = new DynamicFormRequest("PUR_ReceiveBill");
RequestData data = new RequestData();
PURModel model = new PURModel(bill);
data.setModel(model);
request.setData(data);
return request;
}
}

View File

@ -0,0 +1,24 @@
package com.ruoyi.webApi.billHandlerUtil.impl;
import com.ruoyi.bill.domain.PoundBill;
import com.ruoyi.webApi.billHandlerUtil.BillHandler;
import com.ruoyi.webApi.requestbody.DynamicFormRequest;
import com.ruoyi.webApi.requestbody.RequestData;
import com.ruoyi.webApi.requestbody.model.SALModel;
/**
* @author 16358
* @date 2025/6/18
* 发货通知单
*/
public class SALHandler implements BillHandler {
@Override
public DynamicFormRequest buildRequest(PoundBill bill) {
DynamicFormRequest request = new DynamicFormRequest("SAL_DELIVERYNOTICE");
RequestData data = new RequestData();
SALModel model = new SALModel(bill);
data.setModel(model);
request.setData(data);
return request;
}
}

View File

@ -0,0 +1,24 @@
package com.ruoyi.webApi.billHandlerUtil.impl;
import com.ruoyi.bill.domain.PoundBill;
import com.ruoyi.webApi.billHandlerUtil.BillHandler;
import com.ruoyi.webApi.requestbody.DynamicFormRequest;
import com.ruoyi.webApi.requestbody.RequestData;
import com.ruoyi.webApi.requestbody.model.SPModel;
/**
* @author 16358
* @date 2025/6/18
* 简单生产入库单
*/
public class SPHandler implements BillHandler {
@Override
public DynamicFormRequest buildRequest(PoundBill bill) {
DynamicFormRequest request = new DynamicFormRequest("SP_InStock");
RequestData data = new RequestData();
SPModel model = new SPModel(bill);
data.setModel(model);
request.setData(data);
return request;
}
}

View File

@ -0,0 +1,24 @@
package com.ruoyi.webApi.billHandlerUtil.impl;
import com.ruoyi.bill.domain.PoundBill;
import com.ruoyi.webApi.billHandlerUtil.BillHandler;
import com.ruoyi.webApi.requestbody.DynamicFormRequest;
import com.ruoyi.webApi.requestbody.RequestData;
import com.ruoyi.webApi.requestbody.model.STKModel;
/**
* @author 16358
* @date 2025/6/18
* 调拨申请单
*/
public class STKHandler implements BillHandler {
@Override
public DynamicFormRequest buildRequest(PoundBill bill) {
DynamicFormRequest request = new DynamicFormRequest("STK_TRANSFERAPPLY");
RequestData data = new RequestData();
STKModel model = new STKModel(bill);
data.setModel(model);
request.setData(data);
return request;
}
}

View File

@ -0,0 +1,19 @@
package com.ruoyi.webApi.requestbody;
import com.fasterxml.jackson.annotation.JsonInclude;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class DynamicFormRequest {
private String Formid;
private RequestData data = new RequestData();
public DynamicFormRequest(String formId) {
this.Formid = formId;
}
// Getters and setters
public String getFormid() { return Formid; }
public void setFormid(String formid) { Formid = formid; }
public RequestData getData() { return data; }
public void setData(RequestData data) { this.data = data; }
}

View File

@ -0,0 +1,57 @@
package com.ruoyi.webApi.requestbody;
import java.util.ArrayList;
import java.util.List;
/**
* @author 16358
* @date 2025/6/18
*/
public class RequestData {
private List<String> NeedUpDateFields = new ArrayList<>();
private List<String> NeedReturnFields = new ArrayList<>();
private String IsDeleteEntry = "true";
private String IsAutoAdjustField = "true";
private RequestModel Model;
// Getter and Setter
public List<String> getNeedUpDateFields() {
return NeedUpDateFields;
}
public void setNeedUpDateFields(List<String> needUpDateFields) {
NeedUpDateFields = needUpDateFields;
}
public List<String> getNeedReturnFields() {
return NeedReturnFields;
}
public void setNeedReturnFields(List<String> needReturnFields) {
NeedReturnFields = needReturnFields;
}
public String getIsDeleteEntry() {
return IsDeleteEntry;
}
public void setIsDeleteEntry(String isDeleteEntry) {
IsDeleteEntry = isDeleteEntry;
}
public String getIsAutoAdjustField() {
return IsAutoAdjustField;
}
public void setIsAutoAdjustField(String isAutoAdjustField) {
IsAutoAdjustField = isAutoAdjustField;
}
public RequestModel getModel() {
return Model;
}
public void setModel(RequestModel model) {
Model = model;
}
}

View File

@ -0,0 +1,54 @@
package com.ruoyi.webApi.requestbody;
/**
* @author 16358
* @date 2025/6/18
*/
public class RequestModel {
private String FID;
private String F_GMSHDW;
private String F_CYDW;
private String F_BDMC;
private Object FEntity; // 根据类型可以是 Entity[] DetailEntity[]
// Getter and Setter
public String getFID() {
return FID;
}
public void setFID(String FID) {
this.FID = FID;
}
public String getF_GMSHDW() {
return F_GMSHDW;
}
public void setF_GMSHDW(String f_GMSHDW) {
F_GMSHDW = f_GMSHDW;
}
public String getF_CYDW() {
return F_CYDW;
}
public void setF_CYDW(String f_CYDW) {
F_CYDW = f_CYDW;
}
public String getF_BDMC() {
return F_BDMC;
}
public void setF_BDMC(String f_BDMC) {
F_BDMC = f_BDMC;
}
public Object getFEntity() {
return FEntity;
}
public void setFEntity(Object FEntity) {
this.FEntity = FEntity;
}
}

View File

@ -0,0 +1,64 @@
package com.ruoyi.webApi.requestbody.entity;
import java.math.BigDecimal;
/**
* @author 16358
* @date 2025/6/18
* @description: 收料通知单entity
*/
public class PUREntity {
private String FEntryID;
private BigDecimal F_JLHCSL;
private BigDecimal F_YMZ;
private BigDecimal F_YPZ;
private BigDecimal F_JS;
public PUREntity(String FEntryID, BigDecimal F_JLHCSL, BigDecimal F_YMZ, BigDecimal F_YPZ, BigDecimal F_JS) {
this.FEntryID = FEntryID;
this.F_JLHCSL = F_JLHCSL;
this.F_YMZ = F_YMZ;
this.F_YPZ = F_YPZ;
this.F_JS = F_JS;
}
public String getFEntryID() {
return FEntryID;
}
public void setFEntryID(String FEntryID) {
this.FEntryID = FEntryID;
}
public BigDecimal getF_JLHCSL() {
return F_JLHCSL;
}
public void setF_JLHCSL(BigDecimal f_JLHCSL) {
F_JLHCSL = f_JLHCSL;
}
public BigDecimal getF_YMZ() {
return F_YMZ;
}
public void setF_YMZ(BigDecimal f_YMZ) {
F_YMZ = f_YMZ;
}
public BigDecimal getF_YPZ() {
return F_YPZ;
}
public void setF_YPZ(BigDecimal f_YPZ) {
F_YPZ = f_YPZ;
}
public BigDecimal getF_JS() {
return F_JS;
}
public void setF_JS(BigDecimal f_JS) {
F_JS = f_JS;
}
}

View File

@ -0,0 +1,64 @@
package com.ruoyi.webApi.requestbody.entity;
import java.math.BigDecimal;
/**
* @author 16358
* @date 2025/6/18
* @description:发货通知单entity
*/
public class SALEntity {
private String FEntryID;
private BigDecimal F_JLHCSL;
private BigDecimal F_YMZ;
private BigDecimal F_YPZ;
private BigDecimal F_JS;
public SALEntity(String FEntryID, BigDecimal F_JLHCSL, BigDecimal F_YMZ, BigDecimal F_YPZ, BigDecimal F_JS) {
this.FEntryID = FEntryID;
this.F_JLHCSL = F_JLHCSL;
this.F_YMZ = F_YMZ;
this.F_YPZ = F_YPZ;
this.F_JS = F_JS;
}
public String getFEntryID() {
return FEntryID;
}
public void setFEntryID(String FEntryID) {
this.FEntryID = FEntryID;
}
public BigDecimal getF_JLHCSL() {
return F_JLHCSL;
}
public void setF_JLHCSL(BigDecimal f_JLHCSL) {
F_JLHCSL = f_JLHCSL;
}
public BigDecimal getF_YMZ() {
return F_YMZ;
}
public void setF_YMZ(BigDecimal f_YMZ) {
F_YMZ = f_YMZ;
}
public BigDecimal getF_YPZ() {
return F_YPZ;
}
public void setF_YPZ(BigDecimal f_YPZ) {
F_YPZ = f_YPZ;
}
public BigDecimal getF_JS() {
return F_JS;
}
public void setF_JS(BigDecimal f_JS) {
F_JS = f_JS;
}
}

View File

@ -0,0 +1,206 @@
package com.ruoyi.webApi.requestbody.entity;
import java.math.BigDecimal;
/**
* @author 16358
* @date 2025/6/18
* @description: 简单生产入库entity
*/
public class SPEntity {
private String FEntryID;
private Ref<FNumberRef> FMaterialId;
private String FInStockType;
private BigDecimal FMustQty;
private BigDecimal FRealQty;
private Ref<FNumberRef> FStockId;
private Ref<FNumberRef> FWorkShopId1;
private Ref<FNumberRef> FShiftGroupId;
private Long F_CZ;
private String FMemo;
private String F_LC;
private String F_GH;
private String F_GANGH;
private Long F_ZKS;
private Long F_KH;
private Long F_PJZL;
private String F_XCLX;
private String F_PH;
public String getFEntryID() {
return FEntryID;
}
public void setFEntryID(String FEntryID) {
this.FEntryID = FEntryID;
}
public Ref<FNumberRef> getFMaterialId() {
return FMaterialId;
}
public void setFMaterialId(Ref<FNumberRef> FMaterialId) {
this.FMaterialId = FMaterialId;
}
public String getFInStockType() {
return FInStockType;
}
public void setFInStockType(String FInStockType) {
this.FInStockType = FInStockType;
}
public BigDecimal getFMustQty() {
return FMustQty;
}
public void setFMustQty(BigDecimal FMustQty) {
this.FMustQty = FMustQty;
}
public BigDecimal getFRealQty() {
return FRealQty;
}
public void setFRealQty(BigDecimal FRealQty) {
this.FRealQty = FRealQty;
}
public Ref<FNumberRef> getFStockId() {
return FStockId;
}
public void setFStockId(Ref<FNumberRef> FStockId) {
this.FStockId = FStockId;
}
public Ref<FNumberRef> getFWorkShopId1() {
return FWorkShopId1;
}
public void setFWorkShopId1(Ref<FNumberRef> FWorkShopId1) {
this.FWorkShopId1 = FWorkShopId1;
}
public Ref<FNumberRef> getFShiftGroupId() {
return FShiftGroupId;
}
public void setFShiftGroupId(Ref<FNumberRef> FShiftGroupId) {
this.FShiftGroupId = FShiftGroupId;
}
public Long getF_CZ() {
return F_CZ;
}
public void setF_CZ(Long f_CZ) {
F_CZ = f_CZ;
}
public String getFMemo() {
return FMemo;
}
public void setFMemo(String FMemo) {
this.FMemo = FMemo;
}
public String getF_LC() {
return F_LC;
}
public void setF_LC(String f_LC) {
F_LC = f_LC;
}
public String getF_GH() {
return F_GH;
}
public void setF_GH(String f_GH) {
F_GH = f_GH;
}
public String getF_GANGH() {
return F_GANGH;
}
public void setF_GANGH(String f_GANGH) {
F_GANGH = f_GANGH;
}
public Long getF_ZKS() {
return F_ZKS;
}
public void setF_ZKS(Long f_ZKS) {
F_ZKS = f_ZKS;
}
public Long getF_KH() {
return F_KH;
}
public void setF_KH(Long f_KH) {
F_KH = f_KH;
}
public Long getF_PJZL() {
return F_PJZL;
}
public void setF_PJZL(Long f_PJZL) {
F_PJZL = f_PJZL;
}
public String getF_XCLX() {
return F_XCLX;
}
public void setF_XCLX(String f_XCLX) {
F_XCLX = f_XCLX;
}
public String getF_PH() {
return F_PH;
}
public void setF_PH(String f_PH) {
F_PH = f_PH;
}
public static class Ref<T> {
private T FNumber;
public Ref(T FNumber) {
this.FNumber = FNumber;
}
public T getFNumber() {
return FNumber;
}
public void setFNumber(T FNumber) {
this.FNumber = FNumber;
}
}
public static class FNumberRef {
private String FNumber;
public FNumberRef(String FNumber) {
this.FNumber = FNumber;
}
public String getFNumber() {
return FNumber;
}
public void setFNumber(String FNumber) {
this.FNumber = FNumber;
}
}
}

View File

@ -0,0 +1,34 @@
package com.ruoyi.webApi.requestbody.entity;
import java.math.BigDecimal;
/**
* @author 16358
* @date 2025/6/18
* @description: 调拨申请单entity
*/
public class STKEntity {
private String FEntryID;
private BigDecimal F_JLHCSL;
public STKEntity(String FEntryID, BigDecimal F_JLHCSL) {
this.FEntryID = FEntryID;
this.F_JLHCSL = F_JLHCSL;
}
public String getFEntryID() {
return FEntryID;
}
public void setFEntryID(String FEntryID) {
this.FEntryID = FEntryID;
}
public BigDecimal getF_JLHCSL() {
return F_JLHCSL;
}
public void setF_JLHCSL(BigDecimal f_JLHCSL) {
F_JLHCSL = f_JLHCSL;
}
}

View File

@ -0,0 +1,40 @@
package com.ruoyi.webApi.requestbody.model;
import com.ruoyi.bill.domain.PoundBill;
import com.ruoyi.webApi.requestbody.entity.PUREntity;
import com.ruoyi.webApi.requestbody.RequestModel;
/**
* @author 16358
* @date 2025/6/18
* @description:收料通知单model
*/
public class PURModel extends RequestModel {
private PUREntity[] FDetailEntity;
public PURModel(PoundBill bill) {
setFID(bill.getFid());
setF_GMSHDW(bill.getRecunitid());
setF_CYDW(bill.getTrnunitid());
setF_BDMC(bill.getPoundname());
this.FDetailEntity = new PUREntity[] {
new PUREntity(
bill.getFentity_fentryid(),
bill.getNetmqty(),
bill.getSrcwghmqty(),
bill.getSrcempmqty(),
bill.getNetmqty()
)
};
}
public PUREntity[] getFDetailEntity() {
return FDetailEntity;
}
public void setFDetailEntity(PUREntity[] FDetailEntity) {
this.FDetailEntity = FDetailEntity;
super.setFEntity(FDetailEntity);
}
}

View File

@ -0,0 +1,40 @@
package com.ruoyi.webApi.requestbody.model;
import com.ruoyi.bill.domain.PoundBill;
import com.ruoyi.webApi.requestbody.entity.SALEntity;
import com.ruoyi.webApi.requestbody.RequestModel;
/**
* @author 16358
* @date 2025/6/18
* @description:发货通知单model
*/
public class SALModel extends RequestModel {
private SALEntity[] FEntity;
public SALModel(PoundBill bill) {
setFID(bill.getFid());
setF_GMSHDW(bill.getRecunitid());
setF_CYDW(bill.getTrnunitid());
setF_BDMC(bill.getPoundname());
this.FEntity = new SALEntity[] {
new SALEntity(
bill.getFentity_fentryid(),
bill.getNetmqty(),
bill.getSrcwghmqty(),
bill.getSrcempmqty(),
bill.getNetmqty()
)
};
}
public SALEntity[] getFEntity() {
return FEntity;
}
public void setFEntity(SALEntity[] FEntity) {
this.FEntity = FEntity;
super.setFEntity(FEntity);
}
}

View File

@ -0,0 +1,62 @@
package com.ruoyi.webApi.requestbody.model;
import com.ruoyi.bill.domain.PoundBill;
import com.ruoyi.webApi.requestbody.entity.SPEntity;
import com.ruoyi.webApi.requestbody.RequestModel;
import com.ruoyi.webApi.requestbody.entity.SPEntity.Ref;
import com.ruoyi.webApi.requestbody.entity.SPEntity.FNumberRef;
/**
* @author 16358
* @date 2025/6/18 下午3:53
* @ description:简单生产入库单model
*/
public class SPModel extends RequestModel {
private SPEntity[] FEntity;
private String F_YWBD;
private String F_SJYWBD;
private String F_ZGS;
private String F_FHDW;
private String F_SHDW;
public SPModel(PoundBill bill) {
setFID(bill.getFid());
this.F_YWBD = bill.getPoundid();
this.F_SJYWBD = bill.getPoundid();
this.F_ZGS = bill.getZgsId();
this.F_FHDW = bill.getSendunitid();
this.F_SHDW = bill.getRecunitid();
this.FEntity = new SPEntity[] {
new SPEntity() {{
setFEntryID(bill.getFentity_fentryid());
setFMaterialId(new Ref<>(new FNumberRef(bill.getItnumber())));
setFInStockType("1");
setFMustQty(bill.getNetmqty());
setFRealQty(bill.getNetmqty());
setFStockId(new Ref<>(new FNumberRef("")));
setFWorkShopId1(new Ref<>(new FNumberRef("")));
setFShiftGroupId(new Ref<>(new FNumberRef("")));
setF_CZ(0l);
setFMemo(bill.getRemark());
setF_LC(bill.getBoilerno());
setF_GH(bill.getCarno());
setF_GANGH(bill.getSteeno());
setF_ZKS(0l);
setF_KH(bill.getBundleNo());
setF_PJZL(0l);
setF_XCLX(bill.getLinetype());
setF_PH(bill.getBatno());
}}
};
}
public SPEntity[] getFEntity() {
return FEntity;
}
public void setFEntity(SPEntity[] FEntity) {
this.FEntity = FEntity;
super.setFEntity(FEntity);
}
}

View File

@ -0,0 +1,42 @@
package com.ruoyi.webApi.requestbody.model;
import com.ruoyi.bill.domain.PoundBill;
import com.ruoyi.webApi.requestbody.entity.STKEntity;
import com.ruoyi.webApi.requestbody.RequestModel;
/**
* @author 16358
* @date 2025/6/18
* @description: 调拨申请单model
*/
public class STKModel extends RequestModel {
private STKEntity[] FEntity;
private Long F_DYCS;
private String F_FHDW;
private String F_SHDW;
private String F_ZGS;
public STKModel(PoundBill bill) {
setFID(bill.getFid());
this.F_DYCS = bill.getPrintcount();
this.F_FHDW = bill.getSendunitid();
this.F_SHDW = bill.getRecunitid();
this.F_ZGS = bill.getZgsId();
this.FEntity = new STKEntity[] {
new STKEntity(
bill.getFentity_fentryid(),
bill.getNetmqty()
)
};
}
public STKEntity[] getFEntity() {
return FEntity;
}
public void setFEntity(STKEntity[] FEntity) {
this.FEntity = FEntity;
super.setFEntity(FEntity);
}
}

View File

@ -19,6 +19,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="srcempmqty" column="srcempmqty" />
<result property="srcnetmqty" column="srcnetmqty" />
<result property="itmname" column="itmname" />
<result property="itnumber" column="itnumber" />
<result property="bundleNo" column="bundleNo" />
<result property="wghdtoprname" column="wghdtoprname" />
<result property="empdtoprname" column="empdtoprname" />
<result property="specification" column="specification" />
@ -80,7 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectPoundBillVo">
select id, billstate, usrcode, carno, wghmqty, empmqty, netmqty, wghdt, empdt, srcpunmqty, srcwghmqty, srcempmqty, srcnetmqty, itmname, wghdtoprname, empdtoprname, specification, msrname, poundid, poundname, empsysid, empusrcode, wghsysid, wghusrcode, recunitid, recunitname, sendunitid, sendunitname, trnunitid, trnunitname, bsnunitid, bsnunitname, bsndptid, bsndptname, wghtype, scltype, cardriver, srcblltype, pondsrc, wetusrcode, srcbllusrcode, remark, boilerno,agnstatus,agngrossmqty,agntaremqty,agnnetmqty,ductmqty,ductmqtypre, steeno, unitlen, indexid, carnolz, steeltype, linetype, batno, lzno, lqty, bdcode, crtorgid, printcount, zgsId, zgsName, fid, fentity_fentryid, isinuse, crtdt, crtopr, lstedtdt, lstedtopr from t_data_poundbill
select id, billstate, usrcode, carno, wghmqty, empmqty, netmqty, wghdt, empdt, srcpunmqty, srcwghmqty, srcempmqty, srcnetmqty, itmname, itnumber, bundleNo, wghdtoprname, empdtoprname, specification, msrname, poundid, poundname, empsysid, empusrcode, wghsysid, wghusrcode, recunitid, recunitname, sendunitid, sendunitname, trnunitid, trnunitname, bsnunitid, bsnunitname, bsndptid, bsndptname, wghtype, scltype, cardriver, srcblltype, pondsrc, wetusrcode, srcbllusrcode, remark, boilerno,agnstatus,agngrossmqty,agntaremqty,agnnetmqty,ductmqty,ductmqtypre, steeno, unitlen, indexid, carnolz, steeltype, linetype, batno, lzno, lqty, bdcode, crtorgid, printcount, zgsId, zgsName, fid, fentity_fentryid, isinuse, crtdt, crtopr, lstedtdt, lstedtopr from t_data_poundbill
</sql>
<select id="selectPoundBillList" parameterType="PoundBill" resultMap="PoundBillResult">
@ -99,6 +101,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="srcempmqty != null "> and srcempmqty = #{srcempmqty}</if>
<if test="srcnetmqty != null "> and srcnetmqty = #{srcnetmqty}</if>
<if test="itmname != null and itmname != ''"> and itmname = #{itmname}</if>
<if test="itnumber != null and itnumber != ''"> and itnumber = #{itnumber}</if>
<if test="bundleNo != null"> and bundleNo = #{bundleNo}</if>
<if test="wghdtoprname != null and wghdtoprname != ''"> and wghdtoprname = #{wghdtoprname}</if>
<if test="empdtoprname != null and empdtoprname != ''"> and empdtoprname = #{empdtoprname}</if>
<if test="specification != null and specification != ''"> and specification = #{specification}</if>
@ -174,6 +178,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="srcempmqty != null">srcempmqty,</if>
<if test="srcnetmqty != null">srcnetmqty,</if>
<if test="itmname != null">itmname,</if>
<if test="itnumber != null">itnumber,</if>
<if test="bundleNo != null">bundleNo,</if>
<if test="wghdtoprname != null">wghdtoprname,</if>
<if test="empdtoprname != null">empdtoprname,</if>
<if test="specification != null">specification,</if>
@ -240,6 +246,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="srcempmqty != null">#{srcempmqty},</if>
<if test="srcnetmqty != null">#{srcnetmqty},</if>
<if test="itmname != null">#{itmname},</if>
<if test="itnumber != null">#{itnumber},</if>
<if test="bundleNo != null">#{bundleNo},</if>
<if test="wghdtoprname != null">#{wghdtoprname},</if>
<if test="empdtoprname != null">#{empdtoprname},</if>
<if test="specification != null">#{specification},</if>
@ -309,6 +317,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="srcempmqty != null">srcempmqty = #{srcempmqty},</if>
<if test="srcnetmqty != null">srcnetmqty = #{srcnetmqty},</if>
<if test="itmname != null">itmname = #{itmname},</if>
<if test="itnumber != null">itnumber = #{itnumber},</if>
<if test="bundleNo != null">bundleNo = #{bundleNo},</if>
<if test="wghdtoprname != null">wghdtoprname = #{wghdtoprname},</if>
<if test="empdtoprname != null">empdtoprname = #{empdtoprname},</if>
<if test="specification != null">specification = #{specification},</if>