|
@@ -238,35 +238,28 @@ public class RtrServerImpl implements RtrServer {
|
|
|
if (UtilMap.getString(dataForm, "textField_mipmks2t").contains("-")) {
|
|
if (UtilMap.getString(dataForm, "textField_mipmks2t").contains("-")) {
|
|
|
body.put("MONAT", UtilMap.getString(dataForm, "textField_mipmks2t").split("-")[1]);
|
|
body.put("MONAT", UtilMap.getString(dataForm, "textField_mipmks2t").split("-")[1]);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
List<Map> details = UtilMap.getList(dataForm, "tableField_mipgl0vx");
|
|
List<Map> details = UtilMap.getList(dataForm, "tableField_mipgl0vx");
|
|
|
if (details.size() == 50) {
|
|
if (details.size() == 50) {
|
|
|
details = ydService.queryDetails(YDParam.builder().formInstanceId(InstanceId).formUuid(formUuid).tableFieldId("tableField_mipgl0vx").build());
|
|
details = ydService.queryDetails(YDParam.builder().formInstanceId(InstanceId).formUuid(formUuid).tableFieldId("tableField_mipgl0vx").build());
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
log.info("销售计提行项目, {}, {}", InstanceId, details.size());
|
|
log.info("销售计提行项目, {}, {}", InstanceId, details.size());
|
|
|
int total = details.size(), succ = 0, fail = 0;
|
|
int total = details.size(), succ = 0, fail = 0;
|
|
|
// 批量推送Sap凭证: 兼容重试场景
|
|
// 批量推送Sap凭证: 兼容重试场景
|
|
|
for (Map detail : details) {
|
|
for (Map detail : details) {
|
|
|
-
|
|
|
|
|
if ("成功".equals(UtilMap.getString(detail, "selectField_mjihy3si"))) {
|
|
if ("成功".equals(UtilMap.getString(detail, "selectField_mjihy3si"))) {
|
|
|
succ += 1;
|
|
succ += 1;
|
|
|
- continue;
|
|
|
|
|
|
|
+// continue;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
/// 主表字段: 上传编号, 抬头文本
|
|
/// 主表字段: 上传编号, 抬头文本
|
|
|
String referCode = UtilMap.getString(dataForm, "serialNumberField_mjc4e95b") + UtilMap.getString(detail, "textField_mjif9kha");
|
|
String referCode = UtilMap.getString(dataForm, "serialNumberField_mjc4e95b") + UtilMap.getString(detail, "textField_mjif9kha");
|
|
|
body.put("ZUPDNR", referCode);
|
|
body.put("ZUPDNR", referCode);
|
|
|
body.put("BKTXT", UtilMap.getString(detail, "textField_mipgl0w4"));
|
|
body.put("BKTXT", UtilMap.getString(detail, "textField_mipgl0w4"));
|
|
|
-
|
|
|
|
|
- /// 明细字段: 凭证货币金额, 成本中心, 项目文本, 利润中心, 分配, 参考码1, 参考码2, 产品号, 销售组织, 分销渠道, 产品组, 客户定义, 物料组包装物料, 销售地区, 客户简称
|
|
|
|
|
- Map row = UtilMap.map("WRBTR, KOSTL, SGTXT, PRCTR, ZUONR, XREF1, XREF2, ARTNR, VKORG, VTWEG, SPART, KDKG4, MAGRV, BZIRK, WWKCG",
|
|
|
|
|
- "numberField_mipgl0w2, textField_mipgl0w3, textField_mipgl0w4, textField_mjihy3sn, textField_mipgl0w5, textField_mipgl0w6, textField_mipgl0w7, textField_mipgl0w9, textField_mipgl0wa, textField_mipgl0wb, textField_mipgl0wc, textField_mipgl0wd, textField_mipgl0we, textField_mipgl0wf, textField_mipgl0wg",
|
|
|
|
|
|
|
+ /// 明细字段: 凭证货币金额, 项目文本, 利润中心, 分配, 参考码1, 参考码2, 产品号, 销售组织, 分销渠道, 产品组, 客户定义, 物料组包装物料, 销售地区, 客户简称
|
|
|
|
|
+ Map row = UtilMap.map("WRBTR, SGTXT, PRCTR, ZUONR, XREF1, XREF2, ARTNR, VKORG, VTWEG, SPART, KDKG4, MAGRV, BZIRK, WWKCG",
|
|
|
|
|
+ "numberField_mipgl0w2, textField_mipgl0w4, textField_mjihy3sn, textField_mipgl0w5, textField_mipgl0w6, textField_mipgl0w7, textField_mipgl0w9, textField_mipgl0wa, textField_mipgl0wb, textField_mipgl0wc, textField_mipgl0wd, textField_mipgl0we, textField_mipgl0wf, textField_mipgl0wg",
|
|
|
detail);
|
|
detail);
|
|
|
row.put("ZUPDNR", referCode);
|
|
row.put("ZUPDNR", referCode);
|
|
|
-
|
|
|
|
|
try {
|
|
try {
|
|
|
-
|
|
|
|
|
Map result = this._pushSap(detail, body, row);
|
|
Map result = this._pushSap(detail, body, row);
|
|
|
if ("S".equals(result.get("E_SYSMSGTYPE"))) {
|
|
if ("S".equals(result.get("E_SYSMSGTYPE"))) {
|
|
|
detail.put("selectField_mjihy3si", "成功");
|
|
detail.put("selectField_mjihy3si", "成功");
|
|
@@ -304,10 +297,20 @@ public class RtrServerImpl implements RtrServer {
|
|
|
|
|
|
|
|
/// 借贷处理: 行项目号; 记账代码, 借方-40, 贷方-50; 总账科目;
|
|
/// 借贷处理: 行项目号; 记账代码, 借方-40, 贷方-50; 总账科目;
|
|
|
List<Map> items = new ArrayList<>();
|
|
List<Map> items = new ArrayList<>();
|
|
|
- Map jf = UtilMap.map("ITMNR, BSCHL, HKONT", "001", "40", UtilMap.getString(detail, "textField_mipgl0vy"));
|
|
|
|
|
|
|
+ /// 成本中心: 传递到sap,科目大于等于5取值到成本中心行项目,否则则不赋值
|
|
|
|
|
+ String cbzx = UtilMap.getString(detail, "textField_mipgl0w3");
|
|
|
|
|
+ String jfkm = UtilMap.getString(detail, "textField_mipgl0vy");
|
|
|
|
|
+ Map jf = UtilMap.map("ITMNR, BSCHL, HKONT", "001", "40", jfkm);
|
|
|
|
|
+ if (Integer.valueOf(jfkm.substring(0, 1)) >= 5) {
|
|
|
|
|
+ jf.put("KOSTL", cbzx);
|
|
|
|
|
+ }
|
|
|
jf.putAll(row);
|
|
jf.putAll(row);
|
|
|
items.add(jf);
|
|
items.add(jf);
|
|
|
- Map df = UtilMap.map("ITMNR, BSCHL, HKONT", "002", "50", UtilMap.getString(detail, "textField_mipgl0w1"));
|
|
|
|
|
|
|
+ String dfkm = UtilMap.getString(detail, "textField_mipgl0w1");
|
|
|
|
|
+ Map df = UtilMap.map("ITMNR, BSCHL, HKONT", "002", "50", dfkm);
|
|
|
|
|
+ if (Integer.valueOf(dfkm.substring(0, 1)) >= 5) {
|
|
|
|
|
+ df.put("KOSTL", cbzx);
|
|
|
|
|
+ }
|
|
|
df.putAll(row);
|
|
df.putAll(row);
|
|
|
items.add(df);
|
|
items.add(df);
|
|
|
body.put("ITEMS", items);
|
|
body.put("ITEMS", items);
|