Browse Source

同步年度预算的外委研究支出费,项目总预算,任务书预算

lgl 1 year ago
parent
commit
6ccfa1aa9c

+ 1 - 1
src/main/java/com/liang/controller/PrjAnnualbudgetController.java

@@ -278,7 +278,7 @@ public class PrjAnnualbudgetController extends BaseController {
278 278
             for(int i=0;i<list.size();i++){
279 279
                 if("总计".equals(list.get(i).getFymc())){
280 280
                     zjfy=i;
281
-                    list.get(i).setXmzys(list.get(i).getRwsys());
281
+                    list.get(i).setXmzys(list.get(i).getXmzys());
282 282
                 }
283 283
                 if((list.get(i).getFymc()).endsWith("外委支出费")&&!(list.get(i).getFymc()).startsWith("(1)")){
284 284
                     fy1=i;

+ 6 - 12
src/main/java/com/liang/controller/PrjProjectController.java

@@ -1,6 +1,5 @@
1 1
 package com.liang.controller;
2 2
 
3
-import com.fasterxml.jackson.databind.ObjectMapper;
4 3
 import com.github.pagehelper.PageHelper;
5 4
 import com.github.pagehelper.PageInfo;
6 5
 import com.liang.common.JsonTool;
@@ -11,18 +10,15 @@ import com.liang.common.utils.MoneyToChineseUtil;
11 10
 import com.liang.common.utils.StringUtils;
12 11
 import com.liang.common.utils.WordUtils;
13 12
 import com.liang.dao.PrjAnnualbudgetdetailDao;
14
-import com.liang.dao.PrjProjectDao;
15 13
 import com.liang.entity.*;
16 14
 import com.liang.service.*;
17 15
 //import com.liang.vo.service.*;
18
-import io.swagger.annotations.Api;
19 16
 import io.swagger.annotations.ApiOperation;
20 17
 import org.json.JSONArray;
21 18
 import org.json.JSONException;
22 19
 import org.json.JSONObject;
23 20
 import org.slf4j.Logger;
24 21
 import org.slf4j.LoggerFactory;
25
-import org.springframework.beans.factory.annotation.Autowired;
26 22
 import org.springframework.data.domain.Page;
27 23
 import org.springframework.data.domain.PageRequest;
28 24
 import org.springframework.http.ResponseEntity;
@@ -345,18 +341,16 @@ public class PrjProjectController extends BaseController {
345 341
     public BaseResult updateSpzt(@RequestBody String strData) {
346 342
         PrjProject rws = JsonTool.parseObject(strData, PrjProject.class);
347 343
         int num = prjProjectService.updateSpzt(rws);
348
-        //审批结束时 同步年度预算的数据
344
+        //审批结束时 更新任务书预算
349 345
         if (StringUtils.isNotBlank(rws.getSpzt()) && "审批结束".equals(rws.getSpzt())) {
350
-            int updateNum = prjAnnualbudgetdetailDao.updateRWSYSAndXMZYSAndDw1(rws.getId());
351
-
346
+            int updateNum = prjAnnualbudgetdetailDao.updateRWSYS(rws.getId());
347
+            //更新项目总预算
348
+            BigDecimal XMZYS = prjAnnualbudgetdetailDao.selectXMZYS(rws.getId());
349
+            int numXMZYS = prjAnnualbudgetdetailDao.updateXMZYS(rws.getId(), XMZYS);
352 350
             //更新外委研究支出费
353 351
             BigDecimal WWYJZCF = prjAnnualbudgetdetailDao.selectWWYJZCF(rws.getId());
354 352
             int numWWYJZCF = prjAnnualbudgetdetailDao.updateWWYJZCF(rws.getId(), WWYJZCF);
355
-            if (numWWYJZCF > 0 && updateNum > 0) {
356
-                return BaseResult.success("保存成功!");
357
-            } else {
358
-                return BaseResult.failure("保存失败!");
359
-            }
353
+
360 354
         }
361 355
         if (num > 0) {
362 356
             return BaseResult.success("保存成功!");

+ 5 - 1
src/main/java/com/liang/dao/PrjAnnualbudgetdetailDao.java

@@ -102,10 +102,14 @@ public interface PrjAnnualbudgetdetailDao {
102 102
      */
103 103
     int batchDelete(List<Integer> nysList);
104 104
 
105
-    int updateRWSYSAndXMZYSAndDw1(Integer id);
105
+    int updateRWSYS(Integer id);
106 106
 
107 107
     int updateWWYJZCF(@Param("id") Integer id, @Param("WWYJZCF") BigDecimal WWYJZCF);
108 108
 
109 109
     BigDecimal selectWWYJZCF(Integer id);
110
+
111
+    BigDecimal selectXMZYS(Integer id);
112
+
113
+    int updateXMZYS(@Param("id") Integer id, @Param("rwsys") BigDecimal rwsys);
110 114
 }
111 115
 

+ 16 - 4
src/main/resources/mapper/PrjAnnualbudgetdetailDao.xml

@@ -437,12 +437,11 @@
437 437
             BYJ     = #{byj}
438 438
         where ID = #{id}
439 439
     </update>
440
-    <update id="updateRWSYSAndXMZYSAndDw1">
440
+    <update id="updateRWSYS">
441 441
 
442 442
         update A
443
-        set A.DW1   = B.YSJE,
444
-            A.RWSYS = B.YSJE,
445
-            A.XMZYS =B.YSJE
443
+        set
444
+            A.RWSYS = B.YSJE
446 445
         from prj_AnnualBudgetDetail A
447 446
         inner join (SELECT  MC ,YSJE from prj_Budget where XM = #{id}) B on A.FYMC = B.MC
448 447
         where
@@ -460,6 +459,14 @@
460 459
           and FYMC = '1.外委研究支出费'
461 460
 
462 461
     </update>
462
+    <update id="updateXMZYS">
463
+        update prj_AnnualBudgetDetail
464
+        set
465
+            XMZYS = #{rwsys}
466
+        where
467
+            NYS = (SELECT ID from prj_AnnualBudget where RWS = #{id})
468
+          and FYMC = '总计'
469
+    </update>
463 470
 
464 471
     <!--通过主键删除-->
465 472
     <delete id="deleteById">
@@ -520,5 +527,10 @@
520 527
         where
521 528
             pu.DWMC not LIKE  '%国网陕西省电力%'
522 529
     </select>
530
+    <select id="selectXMZYS" resultType="java.math.BigDecimal">
531
+
532
+        SELECT SUM(CZJE) from prj_feescheme  where ZB = #{id} and DWMC  LIKE  '%国网陕西省电力%'
533
+
534
+    </select>
523 535
 </mapper>
524 536
 

+ 2 - 1
src/main/resources/templates/annualbudget/view_annualbudget.html

@@ -211,6 +211,7 @@
211 211
                     }
212 212
                 }
213 213
                 $("#ndbyj").val(dataBudget[zjfy].byj);
214
+                $("#rwsys").val(dataBudget[zjfy].xmzys);
214 215
             }
215 216
         });
216 217
 
@@ -248,7 +249,7 @@
248 249
                 [
249 250
                     {type: 'numbers', width: '3%'},
250 251
                     {field: 'fymc', width: '30%', title: '费用名称'},
251
-                    {field: 'xmzys', width: '12%', title: '项目总预算'},
252
+                    {field: 'rwsys', width: '12%', title: '项目总预算'},
252 253
                     {field: 'xtjsyzx', width: '15%', title: '系统计算已执行'},
253 254
                     {field: 'sjyzx', width: '12%', title: '实际已执行'},
254 255
                     {field: 'ysje', width: '10%', title: '预算金额'},