Ver código fonte

日常物耗申请单中采购专员审批后更新字段初始物耗费用总计修复bug

fyz 9 meses atrás
pai
commit
0035198601

+ 1 - 1
mjava-lanyun/src/main/java/com/malk/lanyun/controller/TimerController.java

@@ -101,7 +101,7 @@ public class TimerController {
      * @param
      */
     @PostMapping("materialConsumption")
-    void updateMaterialConsumption(String formInstId,String firstCost,String nowCost){
+    void updateMaterialConsumption(String formInstId,Double firstCost,Double nowCost){
         log.info("进入更新字段初始物耗费用总计方法");
         timerService.updateMaterialConsumption(formInstId,firstCost,nowCost);
     }

+ 1 - 1
mjava-lanyun/src/main/java/com/malk/lanyun/service/TimerService.java

@@ -53,5 +53,5 @@ public interface TimerService {
      * 日常物耗申请单中采购专员审批后更新字段初始物耗费用总计
      * @param
      */
-    void updateMaterialConsumption(String formInstId,String firstCost,String nowCost);
+    void updateMaterialConsumption(String formInstId,Double firstCost,Double nowCost);
 }

+ 5 - 4
mjava-lanyun/src/main/java/com/malk/lanyun/service/impl/TimerServiceImpl.java

@@ -603,15 +603,16 @@ public class TimerServiceImpl implements TimerService {
      * @param
      */
     @Override
-    public void updateMaterialConsumption(String formInstId,String firstCost,String nowCost) {
-        if(!Objects.equals(firstCost, "")){
+    public void updateMaterialConsumption(String formInstId,Double firstCost,Double nowCost) {
+        log.info("初始物耗费用合计为:{}",firstCost);
+        if(ObjectUtil.isEmpty(firstCost) || firstCost == 0.0){
             log.info("流程id为:{}",formInstId);
+            log.info("初始物耗费用合计为:{}",firstCost);
+            log.info("本次物耗费用合计为:{}",nowCost);
             ydClient.operateData(YDParam.builder()
                     .appType("APP_ERBDTFS82HOVBPL3NFH0")
                     .systemToken("RRB66F91T97H1WN89QZYC47PKLZO2ZQOUMOQLP")
                     .formInstanceId(formInstId)
-//                    .useLatestVersion(true)
-//                    .updateFormDataJson(JSONObject.toJSONString(new HashMap<>()))
                     .updateFormDataJson(JSON.toJSONString(UtilMap.map("numberField_m0xizy3q", nowCost)))
                     .build(), YDConf.FORM_OPERATION.update);
         }