|
@@ -1999,6 +1999,120 @@ public class SikuServiceImpl implements SikuService {
|
|
|
.build(), YDConf.FORM_OPERATION.create);
|
|
.build(), YDConf.FORM_OPERATION.create);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public McR saveRepayment(Map map) {
|
|
|
|
|
+ String formInstId = UtilMap.getString(map, "formInstId");
|
|
|
|
|
+
|
|
|
|
|
+ Map formData = ydClient.queryData(YDParam.builder()
|
|
|
|
|
+ .formInstanceId(formInstId)
|
|
|
|
|
+ .build(), YDConf.FORM_QUERY.retrieve_id).getFormData();
|
|
|
|
|
+
|
|
|
|
|
+ String thbh = UtilMap.getString(formData, "serialNumberField_mkkmij3o");//退回编号
|
|
|
|
|
+
|
|
|
|
|
+ String type = UtilMap.getString(formData, "radioField_mkkmij3b");
|
|
|
|
|
+ String ssgssh = UtilMap.getString(formData, "textField_mmd6hio7");//所属公司税号
|
|
|
|
|
+
|
|
|
|
|
+ String sqrgh = UtilMap.getString(formData, "textField_mmwvodde");//申请人工号
|
|
|
|
|
+
|
|
|
|
|
+ Map employeeDetails = MkBxUtil.employeeDetails(UtilMap.map("employeeIds", Arrays.asList(sqrgh)));
|
|
|
|
|
+ String deptBusinessCode = "";
|
|
|
|
|
+ String empId = "";
|
|
|
|
|
+ if (Objects.nonNull(employeeDetails)){
|
|
|
|
|
+ List<Map> departments = UtilMap.getList(employeeDetails, "departments");
|
|
|
|
|
+ deptBusinessCode = UtilMap.getString(departments.get(0), "businessCode");
|
|
|
|
|
+
|
|
|
|
|
+ empId = sqrgh;
|
|
|
|
|
+ }else {
|
|
|
|
|
+ empId = "002";//默认沃洲洋
|
|
|
|
|
+ deptBusinessCode = "DI203800035494740082";//默认DI203800035494740082
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ("直接采购".equals(type)){
|
|
|
|
|
+ String cgbh = UtilMap.getString(formData, "textField_mn4fwdj5");//采购编号
|
|
|
|
|
+
|
|
|
|
|
+ List<Map> cgmxList = UtilMap.getList(formData, "tableField_mkkmij56");
|
|
|
|
|
+
|
|
|
|
|
+ for (Map cgmx : cgmxList) {
|
|
|
|
|
+ Double amt = UtilMap.getDouble(cgmx, "numberField_mn2wqvpp");//退回金额
|
|
|
|
|
+ if (amt == 0) continue;
|
|
|
|
|
+
|
|
|
|
|
+ int index = UtilMap.getInt(cgmx, "numberField_mn36ykxx");//索引
|
|
|
|
|
+ String thsy = UtilMap.getString(cgmx, "textareaField_mo2k0ien");//退回事由
|
|
|
|
|
+ String gysbh = UtilMap.getString(cgmx, "textField_mmbmohrb");//供应商编号
|
|
|
|
|
+
|
|
|
|
|
+ Map reimburseDetailInfo = MkBxUtil.reimburseDetailInfo(cgbh + "-" + index);
|
|
|
|
|
+
|
|
|
|
|
+ Map expense = ((List<Map>) UtilMap.getList(reimburseDetailInfo, "expenseList")).get(0);
|
|
|
|
|
+
|
|
|
|
|
+ String expenseCode = UtilMap.getString(expense, "code");//费用编码
|
|
|
|
|
+
|
|
|
|
|
+ Map noReceiptReturn = new HashMap();
|
|
|
|
|
+ noReceiptReturn.put("recordExpenseCode",expenseCode);
|
|
|
|
|
+ noReceiptReturn.put("recordDeductionAmount",new HashMap<String,Object>(){{put("currency","CNY");put("amount",amt);}});
|
|
|
|
|
+
|
|
|
|
|
+ Map body = new HashMap();
|
|
|
|
|
+ body.put("formCode",thbh + index);
|
|
|
|
|
+ body.put("repaymentName",thsy);
|
|
|
|
|
+ body.put("formSubTypeBizCode","FT212654855978767371");
|
|
|
|
|
+ body.put("submittedUserEmployeeId",empId);
|
|
|
|
|
+ body.put("coverEmployeeId",empId);
|
|
|
|
|
+ body.put("departmentBizCode",deptBusinessCode);
|
|
|
|
|
+ body.put("legalEntityBizCode",ssgssh);
|
|
|
|
|
+ body.put("repayAmount",new HashMap<String,Object>(){{put("currency","CNY");put("amount",amt);}});
|
|
|
|
|
+ body.put("repaymentDate",System.currentTimeMillis());
|
|
|
|
|
+ body.put("tradingPartnerBizCode",gysbh);
|
|
|
|
|
+ body.put("paymentType","BANK");
|
|
|
|
|
+ body.put("noReceiptReturnList",Arrays.asList(noReceiptReturn));
|
|
|
|
|
+ body.put("stagingFlag",false);
|
|
|
|
|
+
|
|
|
|
|
+ MkBxUtil.receiveRepayment(body);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }else {//需求采购
|
|
|
|
|
+ String xqbh = UtilMap.getString(formData, "textField_mn4fwdj4");//需求编号
|
|
|
|
|
+
|
|
|
|
|
+ List<Map> cgmxList = UtilMap.getList(formData, "tableField_mn2xmq2b");
|
|
|
|
|
+
|
|
|
|
|
+ for (Map cgmx : cgmxList) {
|
|
|
|
|
+ Double amt = UtilMap.getDouble(cgmx, "numberField_mn2xmq1p");//退回金额
|
|
|
|
|
+ if (amt == 0) continue;
|
|
|
|
|
+
|
|
|
|
|
+ int index = UtilMap.getInt(cgmx, "numberField_mn39fdfe");//索引
|
|
|
|
|
+ String thsy = UtilMap.getString(cgmx, "textareaField_mo2k0iep");//退回事由
|
|
|
|
|
+ String gysbh = UtilMap.getString(cgmx, "textField_mn2xmq27");//供应商编号
|
|
|
|
|
+
|
|
|
|
|
+ Map reimburseDetailInfo = MkBxUtil.reimburseDetailInfo(xqbh + "-" + index);
|
|
|
|
|
+
|
|
|
|
|
+ Map expense = ((List<Map>) UtilMap.getList(reimburseDetailInfo, "expenseList")).get(0);
|
|
|
|
|
+
|
|
|
|
|
+ String expenseCode = UtilMap.getString(expense, "code");//费用编码
|
|
|
|
|
+
|
|
|
|
|
+ Map noReceiptReturn = new HashMap();
|
|
|
|
|
+ noReceiptReturn.put("recordExpenseCode",expenseCode);
|
|
|
|
|
+ noReceiptReturn.put("recordDeductionAmount",new HashMap<String,Object>(){{put("currency","CNY");put("amount",amt);}});
|
|
|
|
|
+
|
|
|
|
|
+ Map body = new HashMap();
|
|
|
|
|
+ body.put("formCode",thbh + index);
|
|
|
|
|
+ body.put("repaymentName",thsy);
|
|
|
|
|
+ body.put("formSubTypeBizCode","FT212654855978767371");
|
|
|
|
|
+ body.put("submittedUserEmployeeId",empId);
|
|
|
|
|
+ body.put("coverEmployeeId",empId);
|
|
|
|
|
+ body.put("departmentBizCode",deptBusinessCode);
|
|
|
|
|
+ body.put("legalEntityBizCode",ssgssh);
|
|
|
|
|
+ body.put("repayAmount",new HashMap<String,Object>(){{put("currency","CNY");put("amount",amt);}});
|
|
|
|
|
+ body.put("repaymentDate",System.currentTimeMillis());
|
|
|
|
|
+ body.put("tradingPartnerBizCode",gysbh);
|
|
|
|
|
+ body.put("paymentType","BANK");
|
|
|
|
|
+ body.put("noReceiptReturnList",Arrays.asList(noReceiptReturn));
|
|
|
|
|
+ body.put("stagingFlag",false);
|
|
|
|
|
+
|
|
|
|
|
+ MkBxUtil.receiveRepayment(body);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return McR.success();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private static String getMkStrValue(Map formData, String entityName) {
|
|
private static String getMkStrValue(Map formData, String entityName) {
|
|
|
Map title = UtilMap.getMap(formData, entityName);
|
|
Map title = UtilMap.getMap(formData, entityName);
|
|
|
Map value = UtilMap.getMap(title, "value");
|
|
Map value = UtilMap.getMap(title, "value");
|