销售交货单完善字段
This commit is contained in:
parent
5b29eedb44
commit
5884103604
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue