Browse Source

锤子塑业付款申请调整

fyz 1 month ago
parent
commit
d5d8080a8a

+ 7 - 6
mjava-chuizi/src/main/java/com/malk/chuizi/controller/ChuiziController.java

@@ -7,22 +7,23 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.Map;
+
 @RestController
 public class ChuiziController {
 
     @Autowired
-    private ChuiZiService jianhuiService;
-
+    ChuiZiService chuiZiService;
     @GetMapping("/test")
     public McR test(){
         return McR.success();
     }
 
     //新增其他应付单
-//    @PostMapping("/saveOtherMeet")
-//    public McR saveOtherMeet(String processInstanceId) {
-//        return jianhuiService.saveOtherMeet(processInstanceId);
-//    }
+    @PostMapping("/saveAccountsPayable")
+    public McR saveOtherMeet(Map processData) {
+        return chuiZiService.saveAccountsPayable(processData);
+    }
 
 
 }

+ 12 - 14
mjava-chuizi/src/main/java/com/malk/chuizi/service/impl/ChuiZiServiceImpl.java

@@ -42,9 +42,6 @@ public class ChuiZiServiceImpl implements ChuiZiService {
     @Autowired
     private DDClient_Personnel ddClientPersonnel;
 
-    @Autowired
-    private DDClient_Workflow ddClient_workflow;
-
     @Value("${dingtalk.agentId}")
     private Long agentId;
 
@@ -321,14 +318,13 @@ public class ChuiZiServiceImpl implements ChuiZiService {
 //        String userId = String.valueOf(processData.get("originatorUserId"));
         Save save = new Save();
 
-        Model otherMeet = new Model();
-        otherMeet.setFCONTACTUNITTYPE("BD_Supplier");
-        otherMeet.setFBillTypeID(new BillTypeID("FKDLX01_SYS"));
-        otherMeet.setFDATE(LocalDateTimeUtil.format(LocalDate.now(),"yyyy-MM-dd"));
-        otherMeet.setFCURRENCYID(new FNumber("PRE001"));//币别
-        otherMeet.setFRECTUNIT(new FNumber("1000159"));
-        otherMeet.setFCONTACTUNIT(new FNumber("1000159"));
+        Model model = new Model();
+        model.setFCONTACTUNITTYPE("BD_Supplier");
+        model.setFBillTypeID(new BillTypeID("FKDLX01_SYS"));
+        model.setFDATE(LocalDateTimeUtil.format(LocalDate.now(),"yyyy-MM-dd"));
+        model.setFCURRENCYID(new FNumber("PRE001"));//币别
         List<Map> formComponentValues = (List<Map>) processData.get("formComponentValues");
+
         Map<String, Object> mainData = new HashMap<>();
 
         formComponentValues.forEach(e->{
@@ -338,19 +334,21 @@ public class ChuiZiServiceImpl implements ChuiZiService {
         List<AccountsPayableEntity> objects  = new ArrayList<>();
         if (ObjectUtil.isNotNull(mainData)){
             //主表
-            otherMeet.setFREMARK(mainData.get("付款事由").toString());
+            model.setFREMARK(mainData.get("付款事由").toString());
+            model.setFRECTUNIT(new FNumber(mainData.get("供应商编码").toString()));
+            model.setFCONTACTUNIT(new FNumber(mainData.get("供应商编码").toString()));
             //明细
             AccountsPayableEntity accountsPayableEntity = new AccountsPayableEntity();
             accountsPayableEntity.setFSETTLETYPEID(new FNumber(PAYMENT_METHOD.get(mainData.get("付款方式"))));//结算方式
-            accountsPayableEntity.setFPURPOSEID(new FNumber("SFKYT09_SYS"));//付款用途
+            accountsPayableEntity.setFPURPOSEID(new FNumber(mainData.get("付款用途编码").toString()));//付款用途
             accountsPayableEntity.setFPAYTOTALAMOUNTFOR(Double.parseDouble(mainData.get("付款总额").toString()));
             accountsPayableEntity.setFPAYAMOUNTFOR_E(Double.parseDouble(mainData.get("付款总额").toString()));
 
             objects.add(accountsPayableEntity);
         }
-        otherMeet.setFPAYBILLENTRY(objects);
+        model.setFPAYBILLENTRY(objects);
 
-        save.setModel(otherMeet);
+        save.setModel(model);
         System.out.println(save);
 
         try{