瀏覽代碼

审批结束时 同步年度预算的数据

lgl 1 年之前
父節點
當前提交
d9b7aeb6d3

+ 24 - 9
src/main/java/com/liang/controller/PrjProjectController.java

@@ -8,7 +8,9 @@ import com.liang.common.base.BaseController;
8 8
 import com.liang.common.base.BaseResult;
9 9
 import com.liang.common.utils.ExcelPoiUtil;
10 10
 import com.liang.common.utils.MoneyToChineseUtil;
11
+import com.liang.common.utils.StringUtils;
11 12
 import com.liang.common.utils.WordUtils;
13
+import com.liang.dao.PrjAnnualbudgetdetailDao;
12 14
 import com.liang.dao.PrjProjectDao;
13 15
 import com.liang.entity.*;
14 16
 import com.liang.service.*;
@@ -90,6 +92,8 @@ public class PrjProjectController extends BaseController {
90 92
     private PrjContactsService prjContactsService;
91 93
     @Resource
92 94
     private SysUserInfoService sysUserInfoService;
95
+    @Resource
96
+    private PrjAnnualbudgetdetailDao prjAnnualbudgetdetailDao;
93 97
 
94 98
 
95 99
     private final static List oldCddwList = new ArrayList();
@@ -338,6 +342,15 @@ public class PrjProjectController extends BaseController {
338 342
     public BaseResult updateSpzt(@RequestBody String strData) {
339 343
         PrjProject rws = JsonTool.parseObject(strData, PrjProject.class);
340 344
         int num = prjProjectService.updateSpzt(rws);
345
+        //审批结束时 同步年度预算的数据
346
+        if (StringUtils.isNotBlank(rws.getSpzt()) && "审批结束".equals(rws.getSpzt())) {
347
+            int updateNum = prjAnnualbudgetdetailDao.updateRWSYSAndXMZYSAndDw1(rws.getId());
348
+            if (updateNum > 0) {
349
+                return BaseResult.success("保存成功!");
350
+            } else {
351
+                return BaseResult.failure("保存失败!");
352
+            }
353
+        }
341 354
         if (num > 0) {
342 355
             return BaseResult.success("保存成功!");
343 356
         } else {
@@ -368,17 +381,18 @@ public class PrjProjectController extends BaseController {
368 381
             return BaseResult.failure("批量删除失败!");
369 382
         }
370 383
     }
371
-    @ApiOperation(value = "修改任务书当前审批状态",notes = "修改任务书当前审批状态")
372
-    @RequestMapping(value = "/upDataSpzt",method = RequestMethod.POST)
384
+
385
+    @ApiOperation(value = "修改任务书当前审批状态", notes = "修改任务书当前审批状态")
386
+    @RequestMapping(value = "/upDataSpzt", method = RequestMethod.POST)
373 387
     @ResponseBody
374
-    public BaseResult upDataSpzt(@RequestBody String data){
388
+    public BaseResult upDataSpzt(@RequestBody String data) {
375 389
 
376
-        if(data.isEmpty()){
390
+        if (data.isEmpty()) {
377 391
             return BaseResult.failure("回退失败");
378 392
         }
379 393
         PrjProject prs = new PrjProject();
380 394
         System.out.println(data);
381
-        try{
395
+        try {
382 396
             // 将String json 字符串 转换为  数组
383 397
             JSONArray jsonArray = new JSONArray(data);
384 398
             Integer id1 = 0;
@@ -387,7 +401,7 @@ public class PrjProjectController extends BaseController {
387 401
                 id1 = jsonObject.getInt("id");
388 402
                 System.out.println("ID: " + id1);
389 403
             }
390
-            System.out.println("这是新建的bean"+prs);
404
+            System.out.println("这是新建的bean" + prs);
391 405
             PrjProject project = prjProjectService.queryById(id1);
392 406
 
393 407
             project.setSpzt("未提交");
@@ -395,13 +409,13 @@ public class PrjProjectController extends BaseController {
395 409
 
396 410
             Integer pr = prjProjectService.update(project);
397 411
 
398
-            if(pr < 1){
412
+            if (pr < 1) {
399 413
 
400 414
                 return BaseResult.failure("回退失败");
401
-           }
415
+            }
402 416
 
403 417
             return BaseResult.success("回退成功");
404
-        }catch (Exception a){
418
+        } catch (Exception a) {
405 419
             a.printStackTrace();
406 420
         }
407 421
 
@@ -1789,6 +1803,7 @@ public class PrjProjectController extends BaseController {
1789 1803
      */
1790 1804
 
1791 1805
     int f1 = 0;
1806
+
1792 1807
     private List<Map<String, Object>> getFzrInfo(List<PrjMember> list, int personType) {
1793 1808
         List<Map<String, Object>> ktfzrList = new ArrayList<>();
1794 1809
         String rylx = "项目负责人";

+ 2 - 0
src/main/java/com/liang/dao/PrjAnnualbudgetdetailDao.java

@@ -101,5 +101,7 @@ public interface PrjAnnualbudgetdetailDao {
101 101
      * @return
102 102
      */
103 103
     int batchDelete(List<Integer> nysList);
104
+
105
+    int updateRWSYSAndXMZYSAndDw1(Integer id);
104 106
 }
105 107
 

文件差異過大導致無法顯示
+ 47 - 15
src/main/resources/mapper/PrjAnnualbudgetdetailDao.xml