销售交货单完善字段

This commit is contained in:
张明 2025-05-21 12:55:43 +08:00
parent 5b29eedb44
commit 5884103604
1 changed files with 15 additions and 26 deletions

View File

@ -90,34 +90,29 @@ public class SalesDeliveryOrderRuleMES implements IRule<SaleOutVO> {
// 主表数据 - 所有字段处理
// 必填字段
info.put("orderNo", hvo.getVbillcode()); // 必填交货单号
info.put("orderDate", hvo.getDbilldate() == null ? null : hvo.getDbilldate().toString().substring(0, 10)); // 必填TODO 开单日期格式yyyy-MM-dd
info.put("deliveryDate", hvo.getDbilldate() == null ? null : hvo.getDbilldate().toString().substring(0, 10)); // 必填 TODO 计划发货日期暂用单据日期
info.put("orderDate", hvo.getDbilldate() == null ? null : hvo.getDbilldate().toString().substring(0, 10));
info.put("deliveryDate", hvo.getDbilldate() == null ? null : hvo.getDbilldate().toString().substring(0, 10));
// 客户ID - 订单客户(ccustomerid)
info.put("customId", transferCodeByPk(CustomerVO.getDefaultTableName(),
CustomerVO.CODE, CustomerVO.PK_CUSTOMER, hvo.getCcustomerid())); // 必填客户编码
// 开票单位编码
info.put("invoicingUnit", null); // 必填TODO 开票单位编码无对应字段
info.put("invoicingUnit", transferCodeByPk(CustomerVO.getDefaultTableName(), CustomerVO.CODE, CustomerVO.PK_CUSTOMER, hvo.getCcustomervid()));
// 销售部门编码
info.put("departmentId", transferCodeByPk(DeptVersionVO.getDefaultTableName(),
DeptVersionVO.CODE, DeptVersionVO.PK_VID, hvo.getCdptvid())); // 必填销售部门编码
// 销售员
info.put("seller", transferCodeByPk(PsndocVO.getDefaultTableName(),
PsndocVO.CODE, PsndocVO.PK_PSNDOC, hvo.getCbiztype())); // 必填TODO 销售员
info.put("exchangeRate", null); // 必填TODO 汇率无对应字段 销售出库也没有
PsndocVO.NAME, PsndocVO.PK_PSNDOC, hvo.getCbizid()));
info.put("invoicingBasis", "S"); // 必填开票依据
info.put("settlementType", null); // 必填TODO 结算方式无对应字段
info.put("settlementType", "S"); // 必填结算方式
// 仓库编码
info.put("warehouseId", transferCodeByPk(RackVO.getDefaultTableName(),
RackVO.CODE, RackVO.PK_RACK, hvo.getCwarehouseid())); // 必填仓库编码
info.put("type", "XSJH"); // 必填事务类型销售交货
info.put("genType", null); // 必填TODO 生成方式无对应字段
info.put("returned", null); // 必填TODO 是否退货无对应字段
// 必填生成方式
info.put("genType", "S");
// 必填是否退货
info.put("returned", "N");
// 非必填字段
info.put("transportMode", null); // 运输方式
info.put("deliveryAddress", null); // 收货地点
@ -135,30 +130,27 @@ public class SalesDeliveryOrderRuleMES implements IRule<SaleOutVO> {
for (SaleOutBodyVO bvo : bvos) {
JSONObject detail = new JSONObject();
// 表头字段需要表体字段
// 必填汇率
info.put("exchangeRate", bvo.getNchangestdrate());
// 必填货币编码
info.put("currency", transferCodeByPk(CurrtypeVO.getDefaultTableName(),
CurrtypeVO.CODE, CurrtypeVO.PK_CURRTYPE, bvo.getCorigcurrencyid()));
// 必填字段
detail.put("orderNo", hvo.getVbillcode()); // 必填交货单号
detail.put("orderSn", bvo.getCrowno()); // 必填TODO 交货单序号
detail.put("orderSn", bvo.getCrowno()); // 必填交货单序号
// 生成方式为按订单时必填
detail.put("soOrderNo", bvo.getVsourcebillcode()); // TODO 销售订单号
detail.put("soSequenceNum", bvo.getVsourcerowno()); // TODO 销售订单序号
detail.put("soOrderNo", bvo.getVsourcebillcode()); // 销售订单号
detail.put("soSequenceNum", bvo.getVsourcerowno()); // 销售订单序号
// 物料编码
detail.put("materialId", transferCodeByPk(MaterialVO.getDefaultTableName(),
MaterialVO.CODE, MaterialVO.PK_MATERIAL, bvo.getCmaterialoid())); // 必填物料编码
// 计量单位
detail.put("unit", transferCodeByPk(MeasdocVO.getDefaultTableName(),
MeasdocVO.CODE, MeasdocVO.PK_MEASDOC, bvo.getCunitid())); // 必填计量单位
detail.put("scaleFactor", transferSpecialField(bvo.getVchangerate())); // 必填换算系数
detail.put("taxRate", bvo.getNtaxrate()); // 必填税率
detail.put("recQty", bvo.getNshouldassistnum()); // 必填应收数量
detail.put("mainRecQty", bvo.getNshouldnum()); // 必填TODO 主应收数量
detail.put("mainRecQty", bvo.getNnum()); // 必填主应收数量
// 非必填字段
detail.put("batchNum", null); // 物料批号
@ -168,15 +160,12 @@ public class SalesDeliveryOrderRuleMES implements IRule<SaleOutVO> {
detail.put("amountIncludeTax", null); // 原币含税金额
detail.put("taxAmount", null); // 税额
detail.put("remark", null); // 备注
details.add(detail);
}
}
info.put("Details", details);
// 将info对象添加到请求数据中
requestData.put("Data", info);
return requestData;
}