10 Incheckningar f04d11a791 ... 199d76870a

Upphovsman SHA1 Meddelande Datum
  lgl 199d76870a Merge remote-tracking branch 'origin/master' 5 månader sedan
  lgl 00e3e2dc48 年度预算-已执行情况v2.0 历史数据处理 5 månader sedan
  lgl dae30faf1d 年度预算-已执行情况v2.0 历史数据处理 5 månader sedan
  lgl 47af36cd05 Merge branch 'master' into dev-lgl 5 månader sedan
  lgl 1d2c818938 年度预算-已执行情况计算总和优化 5 månader sedan
  lgl da92c99b26 年度预算-已执行情况bug 5 månader sedan
  lgl 7b383e570a 年度预算-本年度已申请金额 和 本年度已申请金额 总和计算 5 månader sedan
  lgl bb3151f9f6 年度预算-年度预算详情编码配置 5 månader sedan
  lgl 08009c42b3 Merge branch 'master' into dev-lgl 5 månader sedan
  lgl d85e5f96c9 年度预算-已知情情况 bug 5 månader sedan

+ 33 - 0
src/main/java/com/liang/common/config/SFTYProperties.java

@@ -1,18 +1,51 @@
1 1
 package com.liang.common.config;
2 2
 
3 3
 
4
+import com.liang.common.constants.CommonConstant;
5
+import com.liang.common.utils.SpringUtil;
6
+import com.liang.dao.BaseProjectbudgetDao;
7
+import com.liang.vo.dto.Ndysbm;
4 8
 import lombok.Data;
5 9
 import lombok.NoArgsConstructor;
10
+import lombok.extern.slf4j.Slf4j;
6 11
 import org.springframework.boot.context.properties.ConfigurationProperties;
7 12
 import org.springframework.stereotype.Component;
8 13
 
14
+import java.util.HashMap;
15
+import java.util.List;
16
+import java.util.Map;
17
+import java.util.stream.Collectors;
18
+
9 19
 import static com.liang.common.config.SFTYProperties.PREFIX;
10 20
 
11 21
 @Component
12 22
 @ConfigurationProperties(PREFIX)
13 23
 @Data
14 24
 @NoArgsConstructor
25
+@Slf4j
15 26
 public class SFTYProperties {
27
+    static Map<String, Map<String, String>> NDYSBM = new HashMap<>();
28
+
29
+    static {
30
+        BaseProjectbudgetDao baseProjectbudgetDao = SpringUtil.getBean("baseProjectbudgetDao");
31
+
32
+        List<Ndysbm> ndysbms = baseProjectbudgetDao.getNDYSBM();
33
+        Map<String, List<Ndysbm>> collect = ndysbms.stream().collect(Collectors.groupingBy(Ndysbm::getXmlx));
34
+        collect.forEach((k, v) -> {
35
+            Map<String, String> bm = new HashMap<>();
36
+            v.forEach(item -> {
37
+                bm.put(item.getMc(), item.getBm());
38
+            });
39
+            NDYSBM.put(k, bm);
40
+        });
41
+        log.info("============NDYSBM 初始化成功 :{}================", NDYSBM);
42
+    }
43
+
44
+    public static String getNDYSBM(String xmlx,String bmmc) {
45
+        Map<String, String> map = NDYSBM.get(xmlx);
46
+        return map.get(bmmc);
47
+    }
48
+
16 49
     public static final String PREFIX = "sfty";
17 50
 
18 51
     private String uploadFilePath;

+ 13 - 0
src/main/java/com/liang/common/constants/CommonConstant.java

@@ -16,4 +16,17 @@ public class CommonConstant {
16 16
     public static final String WTJFH = "未提交(返回)";
17 17
     public static final String WTJ = "未提交";
18 18
     public static final String SPJS = "审批结束";
19
+    /**
20
+     * 模板项目预算
21
+     */
22
+
23
+    public static final String ZJ = "总计";
24
+    public static final String ZJF = "(一)直接费";
25
+    public static final String RGF = "1.人工费";
26
+    public static final String SBF = "1.设备费";
27
+    public static final String SBSYF = "2.设备使用费";
28
+    public static final String YWF = "3.业务费";
29
+    public static final String CDSYF = "4.场地使用费";
30
+    public static final String WWZCF = "(三)外委支出费";
31
+
19 32
 }

+ 78 - 16
src/main/java/com/liang/controller/PrjAnnualbudgetController.java

@@ -8,6 +8,8 @@ import com.github.pagehelper.PageInfo;
8 8
 import com.liang.common.JsonTool;
9 9
 import com.liang.common.base.BaseController;
10 10
 import com.liang.common.base.BaseResult;
11
+import com.liang.common.config.SFTYProperties;
12
+import com.liang.common.constants.CommonConstant;
11 13
 import com.liang.common.enums.PostInfoEnum;
12 14
 import com.liang.common.enums.ProjectTypeEnnum;
13 15
 import com.liang.common.utils.ExcelPoiUtil;
@@ -19,6 +21,7 @@ import com.liang.service.*;
19 21
 import com.liang.vo.PrjAnnualbudgetNfVo;
20 22
 import com.liang.vo.PrjAnnualbudgetYzxqkVo;
21 23
 import io.swagger.annotations.ApiOperation;
24
+import lombok.extern.slf4j.Slf4j;
22 25
 import org.springframework.data.domain.Page;
23 26
 import org.springframework.data.domain.PageRequest;
24 27
 import org.springframework.http.ResponseEntity;
@@ -41,6 +44,7 @@ import java.util.stream.Collectors;
41 44
  * @since 2023-05-17 08:56:49
42 45
  */
43 46
 @Controller
47
+@Slf4j
44 48
 @RequestMapping("prjAnnualbudget")
45 49
 public class PrjAnnualbudgetController extends BaseController {
46 50
     /**
@@ -304,7 +308,7 @@ public class PrjAnnualbudgetController extends BaseController {
304 308
 
305 309
                 Set<String> nf = yzxqkVos.stream().map(PrjAnnualbudgetYzxqkVo::getNf).collect(Collectors.toSet());
306 310
                 //后端对已执行情况的父级求和
307
-                sumYzxqk(readValue, nf);
311
+                sumYzxqk(readValue, nf, yzxqkVos.get(0).getXmlx());
308 312
                 nf.forEach(nfItem -> {
309 313
                     readValue.stream().forEach(item -> {
310 314
                         Double ysje = allBudgetDetails.stream().filter(allBudgetDetailItem -> allBudgetDetailItem.getFymc().equals(item.get("fymc")) && nfItem.equals(String.valueOf(allBudgetDetailItem.getNf()))).collect(Collectors.toList()).get(0).getYsje();
@@ -326,29 +330,87 @@ public class PrjAnnualbudgetController extends BaseController {
326 330
 
327 331
     }
328 332
 
329
-    private void sumYzxqk(List<Map<String, Object>> readValue, Set<String> nf) {
333
+    private void sumYzxqk(List<Map<String, Object>> readValue, Set<String> nf, String xmlx) {
330 334
         for (String n : nf) {
335
+            String rgfbm = SFTYProperties.getNDYSBM(xmlx, CommonConstant.RGF);
331 336
             //更新人工费
332
-            BigDecimal rgf = readValue.stream().filter(item -> "32".equals(item.get("fj")) && Tools.notEmpty(item.get("yzxqk" + n))).map(item -> new BigDecimal(String.valueOf(item.get("yzxqk" + n)))).reduce(BigDecimal.ZERO, BigDecimal::add);
333
-            readValue.stream().filter(item -> "32".equals(item.get("bm"))).forEach(item -> item.put("yzxqk" + n, rgf.setScale(2, 4)));
337
+            if (Tools.notEmpty(rgfbm)) {
338
+                List<Map<String, Object>> rgfs = readValue.stream().filter(item -> {
339
+                    return Tools.notEmpty(rgfbm) && rgfbm.equals(item.get("fj")) && item.get("yzxqk" + n) != null;
340
+                }).collect(Collectors.toList());
341
+                if (Tools.notEmpty(rgfs)) {
342
+                    BigDecimal rgf = rgfs.stream().map(item -> new BigDecimal(String.valueOf(item.get("yzxqk" + n)))).reduce(BigDecimal.ZERO, BigDecimal::add);
343
+                    readValue.stream().filter(item -> rgfbm.equals(item.get("bm"))).forEach(item -> item.put("yzxqk" + n, rgf.setScale(2, 4)));
344
+                }
345
+            }
346
+            //更新设备费
347
+            String sbfbm = SFTYProperties.getNDYSBM(xmlx, CommonConstant.SBF);
348
+            if (Tools.notEmpty(sbfbm)) {
349
+                List<Map<String, Object>> sbfs = readValue.stream().filter(item -> {
350
+                    return Tools.notEmpty(sbfbm) && sbfbm.equals(item.get("fj")) && item.get("yzxqk" + n) != null;
351
+                }).collect(Collectors.toList());
352
+                if (Tools.notEmpty(sbfs)) {
353
+                    BigDecimal sbf = sbfs.stream().map(item -> new BigDecimal(String.valueOf(item.get("yzxqk" + n)))).reduce(BigDecimal.ZERO, BigDecimal::add);
354
+                    readValue.stream().filter(item -> sbfbm.equals(item.get("bm"))).forEach(item -> item.put("yzxqk" + n, sbf.setScale(2, 4)));
355
+                }
356
+            }
334 357
             //更新设备使用费
335
-            BigDecimal sbsyf = readValue.stream().filter(item -> "36".equals(item.get("fj")) && Tools.notEmpty(item.get("yzxqk" + n))).map(item -> new BigDecimal(String.valueOf(item.get("yzxqk" + n)))).reduce(BigDecimal.ZERO, BigDecimal::add);
336
-            readValue.stream().filter(item -> "36".equals(item.get("bm"))).forEach(item -> item.put("yzxqk" + n, String.valueOf(sbsyf)));
358
+            String sbsyfbm = SFTYProperties.getNDYSBM(xmlx, CommonConstant.SBSYF);
359
+            if (Tools.notEmpty(sbsyfbm)) {
360
+                List<Map<String, Object>> sbsyfs = readValue.stream().filter(item -> sbsyfbm.equals(item.get("fj")) && item.get("yzxqk" + n) != null).collect(Collectors.toList());
361
+                if (Tools.notEmpty(sbsyfs)) {
362
+                    BigDecimal sbsyf = sbsyfs.stream().map(item -> new BigDecimal(String.valueOf(item.get("yzxqk" + n)))).reduce(BigDecimal.ZERO, BigDecimal::add);
363
+                    readValue.stream().filter(item -> sbsyfbm.equals(item.get("bm"))).forEach(item -> item.put("yzxqk" + n, String.valueOf(sbsyf)));
364
+                }
365
+            }
337 366
             //更新业务费
338
-            BigDecimal ywf = readValue.stream().filter(item -> "39".equals(item.get("fj")) && Tools.notEmpty(item.get("yzxqk" + n))).map(item -> new BigDecimal(String.valueOf(item.get("yzxqk" + n)))).reduce(BigDecimal.ZERO, BigDecimal::add);
339
-            readValue.stream().filter(item -> "39".equals(item.get("bm"))).forEach(item -> item.put("yzxqk" + n, String.valueOf(ywf)));
367
+            String ywfbm = SFTYProperties.getNDYSBM(xmlx, CommonConstant.YWF);
368
+            if (Tools.notEmpty(ywfbm)) {
369
+                List<Map<String, Object>> yfws = readValue.stream().filter(item -> ywfbm.equals(item.get("fj")) && item.get("yzxqk" + n) != null).collect(Collectors.toList());
370
+                if (Tools.notEmpty(yfws)) {
371
+                    BigDecimal ywf = yfws.stream().map(item -> new BigDecimal(String.valueOf(item.get("yzxqk" + n)))).reduce(BigDecimal.ZERO, BigDecimal::add);
372
+                    readValue.stream().filter(item -> ywfbm.equals(item.get("bm"))).forEach(item -> item.put("yzxqk" + n, String.valueOf(ywf)));
373
+                }
374
+            }
340 375
             //更新场地使用费
341
-            BigDecimal cdsyf = readValue.stream().filter(item -> "43".equals(item.get("fj")) && Tools.notEmpty(item.get("yzxqk" + n))).map(item -> new BigDecimal(String.valueOf(item.get("yzxqk" + n)))).reduce(BigDecimal.ZERO, BigDecimal::add);
342
-            readValue.stream().filter(item -> "43".equals(item.get("bm"))).forEach(item -> item.put("yzxqk" + n, String.valueOf(cdsyf)));
376
+            String cdsyfbm = SFTYProperties.getNDYSBM(xmlx, CommonConstant.CDSYF);
377
+            if (Tools.notEmpty(cdsyfbm)) {
378
+                List<Map<String, Object>> cdsyfs = readValue.stream().filter(item -> cdsyfbm.equals(item.get("fj")) && item.get("yzxqk" + n) != null).collect(Collectors.toList());
379
+                if (Tools.notEmpty(cdsyfs)) {
380
+                    BigDecimal cdsyf = cdsyfs.stream().map(item -> new BigDecimal(String.valueOf(item.get("yzxqk" + n)))).reduce(BigDecimal.ZERO, BigDecimal::add);
381
+                    readValue.stream().filter(item -> cdsyfbm.equals(item.get("bm"))).forEach(item -> item.put("yzxqk" + n, String.valueOf(cdsyf)));
382
+                }
383
+            }
384
+
343 385
             //更新外委支出费
344
-            BigDecimal wwzcf = readValue.stream().filter(item -> "48".equals(item.get("fj")) && Tools.notEmpty(item.get("yzxqk" + n))).map(item -> new BigDecimal(String.valueOf(item.get("yzxqk" + n)))).reduce(BigDecimal.ZERO, BigDecimal::add);
345
-            readValue.stream().filter(item -> "48".equals(item.get("bm"))).forEach(item -> item.put("yzxqk" + n, String.valueOf(wwzcf)));
386
+            String wwzcfbm = SFTYProperties.getNDYSBM(xmlx, CommonConstant.WWZCF);
387
+            if (Tools.notEmpty(wwzcfbm)) {
388
+                List<Map<String, Object>> wwzcfs = readValue.stream().filter(item -> wwzcfbm.equals(item.get("fj")) && item.get("yzxqk" + n) != null).collect(Collectors.toList());
389
+                if (Tools.notEmpty(wwzcfs)) {
390
+                    BigDecimal wwzcf = wwzcfs.stream().map(item -> new BigDecimal(String.valueOf(item.get("yzxqk" + n)))).reduce(BigDecimal.ZERO, BigDecimal::add);
391
+                    readValue.stream().filter(item -> wwzcfbm.equals(item.get("bm"))).forEach(item -> item.put("yzxqk" + n, String.valueOf(wwzcf)));
392
+                }
393
+            }
394
+
346 395
             //更新直接费
347
-            BigDecimal zjf = readValue.stream().filter(item -> "31".equals(item.get("fj")) && Tools.notEmpty(item.get("yzxqk" + n))).map(item -> new BigDecimal(String.valueOf(item.get("yzxqk" + n)))).reduce(BigDecimal.ZERO, BigDecimal::add);
348
-            readValue.stream().filter(item -> "31".equals(item.get("bm"))).forEach(item -> item.put("yzxqk" + n, String.valueOf(zjf)));
396
+            String zjfbm = SFTYProperties.getNDYSBM(xmlx, CommonConstant.ZJF);
397
+            if (Tools.notEmpty(zjfbm)) {
398
+                List<Map<String, Object>> zjfs = readValue.stream().filter(item -> zjfbm.equals(item.get("fj")) && item.get("yzxqk" + n) != null).collect(Collectors.toList());
399
+                if (Tools.notEmpty(zjfs)) {
400
+                    BigDecimal zjf = zjfs.stream().map(item -> new BigDecimal(String.valueOf(item.get("yzxqk" + n)))).reduce(BigDecimal.ZERO, BigDecimal::add);
401
+                    readValue.stream().filter(item -> zjfbm.equals(item.get("bm"))).forEach(item -> item.put("yzxqk" + n, String.valueOf(zjf)));
402
+                }
403
+            }
349 404
             //更新总计
350
-            BigDecimal zj = readValue.stream().filter(item -> "30".equals(item.get("fj")) && Tools.notEmpty(item.get("yzxqk" + n))).map(item -> new BigDecimal(String.valueOf(item.get("yzxqk" + n)))).reduce(BigDecimal.ZERO, BigDecimal::add);
351
-            readValue.stream().filter(item -> "30".equals(item.get("bm"))).forEach(item -> item.put("yzxqk" + n, String.valueOf(zj)));
405
+            String zjbm = SFTYProperties.getNDYSBM(xmlx, CommonConstant.ZJ);
406
+            if (Tools.notEmpty(zjbm)) {
407
+                List<Map<String, Object>> zjs = readValue.stream().filter(item -> zjbm.equals(item.get("fj")) && item.get("yzxqk" + n) != null).collect(Collectors.toList());
408
+                if (Tools.notEmpty(zjs)) {
409
+                    BigDecimal zj = zjs.stream().map(item -> new BigDecimal(String.valueOf(item.get("yzxqk" + n)))).reduce(BigDecimal.ZERO, BigDecimal::add);
410
+                    readValue.stream().filter(item -> zjbm.equals(item.get("bm"))).forEach(item -> item.put("yzxqk" + n, String.valueOf(zj)));
411
+                }
412
+            }
413
+
352 414
         }
353 415
     }
354 416
 

+ 4 - 0
src/main/java/com/liang/dao/BaseProjectbudgetDao.java

@@ -1,6 +1,7 @@
1 1
 package com.liang.dao;
2 2
 
3 3
 import com.liang.entity.BaseProjectbudget;
4
+import com.liang.vo.dto.Ndysbm;
4 5
 import org.apache.ibatis.annotations.Param;
5 6
 import org.springframework.data.domain.Pageable;
6 7
 
@@ -109,5 +110,8 @@ public interface BaseProjectbudgetDao {
109 110
      * @return
110 111
      */
111 112
     List<BaseProjectbudget> getBudgetListByXmlx(String xmlx);
113
+
114
+    List<Ndysbm> getNDYSBM();
115
+
112 116
 }
113 117
 

+ 6 - 0
src/main/java/com/liang/dao/PrjAnnualbudgetDao.java

@@ -155,5 +155,11 @@ public interface PrjAnnualbudgetDao {
155 155
     void updateSJYZXByNysId(@Param("rwsId") Integer rwsId, @Param("nf") String nf, @Param("nysId") Integer nysId);
156 156
 
157 157
     void updateSJYZXSumByNysId(@Param("rwsId") Integer rwsId, @Param("nf") String nf, @Param("nysId") Integer nysId);
158
+
159
+    void updateZFXMFYMC(@Param("nysId") Integer nysId, @Param("rwsId") Integer rwsId);
160
+
161
+    void updateSXGSKJXMFYMC(@Param("nysId") Integer nysId, @Param("rwsId") Integer rwsId);
162
+
163
+    void updateGWGSKJXMFYMC(@Param("nysId") Integer nysId, @Param("rwsId") Integer rwsId);
158 164
 }
159 165
 

+ 20 - 11
src/main/java/com/liang/service/impl/PrjAnnualbudgetServiceImpl.java

@@ -1,6 +1,8 @@
1 1
 package com.liang.service.impl;
2 2
 
3 3
 import com.liang.common.base.BaseResult;
4
+import com.liang.common.enums.ProjectTypeEnnum;
5
+import com.liang.common.exception.CustomException;
4 6
 import com.liang.dao.PrjAnnualbudgetDao;
5 7
 import com.liang.dao.PrjAnnualbudgetdetailDao;
6 8
 import com.liang.entity.PrjAnnualbudget;
@@ -157,20 +159,27 @@ public class PrjAnnualbudgetServiceImpl implements PrjAnnualbudgetService {
157 159
             prjAnnualbudgetDao.updateSJYZXSum(rws);
158 160
         }
159 161
     }
162
+
160 163
     @GetMapping("/updateSJYZXAndXTJSYZX/{rwsId}/{nysId}")
161 164
     @Transactional(rollbackFor = Exception.class)
162
-    public BaseResult updateSJYZXAndXTJSYZX(@PathVariable("rwsId")Integer rwsId, @PathVariable("nysId")Integer nysId) {
163
-        List<PrjAnnualbudget> prjAnnualbudgets = prjAnnualbudgetDao.listByRws(rwsId);
164
-        //第一年的年度预算不需要更新
165
-        if (!Collections.isEmpty(prjAnnualbudgets) && !prjAnnualbudgets.get(0).getId().equals(nysId)) {
166
-            PrjAnnualbudget annualbudget = prjAnnualbudgets.stream().filter(item -> item.getId().equals(nysId)).collect(Collectors.toList()).get(0);
167
-            //更新 系统计算已执行
168
-            prjAnnualbudgetDao.updateXTJSYZXByNysId(rwsId,annualbudget.getNf(),annualbudget.getId());
169
-            //更新 历史年度预算的实际已执行
170
-            prjAnnualbudgetDao.updateSJYZXByNysId(rwsId,annualbudget.getNf(),annualbudget.getId());
171
-            //更新已执行总计
172
-//            prjAnnualbudgetDao.updateSJYZXSumByNysId(rwsId,annualbudget.getNf(),annualbudget.getId());
165
+    public BaseResult updateSJYZXAndXTJSYZX(@PathVariable("rwsId") Integer rwsId, @PathVariable("nysId") Integer nysId) {
166
+        PrjAnnualbudget prjAnnualbudget = prjAnnualbudgetDao.queryById(nysId);
167
+        try {
168
+            if (ProjectTypeEnnum.ZFLXM.getCode().equals(prjAnnualbudget.getXmlx())) {
169
+                //政府项目
170
+                //更新费用名称
171
+                prjAnnualbudgetDao.updateZFXMFYMC(nysId, rwsId);
172
+            } else if (ProjectTypeEnnum.SXGSKJXM.getCode().equals(prjAnnualbudget.getXmlx())) {
173
+                //陕西公司科技项目
174
+                prjAnnualbudgetDao.updateSXGSKJXMFYMC(nysId, rwsId);
175
+            } else if (ProjectTypeEnnum.GWGSKJXM.getCode().equals(prjAnnualbudget.getXmlx())) {
176
+                //国网公司科技项目
177
+                prjAnnualbudgetDao.updateGWGSKJXMFYMC(nysId, rwsId);
178
+            }
179
+        } catch (Exception e) {
180
+            throw new CustomException("已执行数据同步失败");
173 181
         }
182
+
174 183
         return BaseResult.success("已执行数据同步成功");
175 184
     }
176 185
 

+ 1 - 0
src/main/java/com/liang/vo/PrjAnnualbudgetYzxqkVo.java

@@ -18,4 +18,5 @@ public class PrjAnnualbudgetYzxqkVo {
18 18
     private String bzje;
19 19
     private String fymc;
20 20
     private String nf;
21
+    private String xmlx;
21 22
 }

+ 21 - 0
src/main/java/com/liang/vo/dto/Ndysbm.java

@@ -0,0 +1,21 @@
1
+package com.liang.vo.dto;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Builder;
5
+import lombok.Data;
6
+import lombok.NoArgsConstructor;
7
+
8
+/**
9
+ * @author by lgl
10
+ * @date 2024/5/13.
11
+ */
12
+@Data
13
+@Builder
14
+@NoArgsConstructor
15
+@AllArgsConstructor
16
+public class Ndysbm {
17
+    private String mc;
18
+    private String bm;
19
+    private String xmlx;
20
+
21
+}

+ 14 - 0
src/main/resources/mapper/BaseProjectbudgetDao.xml

@@ -202,5 +202,19 @@
202 202
                  LEFT JOIN base_ProjectBudget AS b ON t.ID = b.XM
203 203
         where p.ID = #{xm}
204 204
     </select>
205
+    <select id="getNDYSBM" resultType="com.liang.vo.dto.Ndysbm">
206
+        SELECT bpb.mc,bpb.bm , bpt.XMLX
207
+        FROM
208
+            base_ProjectBudget bpb ,base_ProjectTemplate bpt
209
+        WHERE bpb.XM = bpt.ID
210
+          AND (bpb.MC = '总计'
211
+               OR bpb.MC = '(一)直接费'
212
+               OR bpb.MC = '1.人工费'
213
+               OR bpb.MC = '2.设备使用费'
214
+               OR bpb.MC = '3.业务费'
215
+               OR bpb.MC = '4.场地使用费'
216
+               OR bpb.MC = '(三)外委支出费')
217
+        order by xmlx
218
+    </select>
205 219
 </mapper>
206 220
 

+ 98 - 0
src/main/resources/mapper/PrjAnnualbudgetDao.xml

@@ -529,6 +529,97 @@
529 529
         where
530 530
             NYS = #{nysId}
531 531
     </update>
532
+    <update id="updateZFXMFYMC">
533
+        update prj_AnnualBudgetDetail  set FYMC  = '(一)直接费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a15524497';
534
+        update prj_AnnualBudgetDetail  set FYMC  = '1、设备费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a155612437';
535
+        update prj_AnnualBudgetDetail  set FYMC  = '(1)购置设备费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a155639759';
536
+        update prj_AnnualBudgetDetail  set FYMC  = '(2)试制设备费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a155757605';
537
+        update prj_AnnualBudgetDetail  set FYMC  = '(3)设备改造与租赁费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a155830224';
538
+        update prj_AnnualBudgetDetail  set FYMC  = '2、材料费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a155903296';
539
+        update prj_AnnualBudgetDetail  set FYMC  = '3、测试实验加工费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a160001888';
540
+        update prj_AnnualBudgetDetail  set FYMC  = '4、燃料动力费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a160026901';
541
+        update prj_AnnualBudgetDetail  set FYMC  = '5、差旅费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a160047208';
542
+        update prj_AnnualBudgetDetail  set FYMC  = '6、会议费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a160100215';
543
+        update prj_AnnualBudgetDetail  set FYMC  = '7、国际合作与交流费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a160112278';
544
+        update prj_AnnualBudgetDetail  set FYMC  = '8、出版/文献/信息传播/知识产权事务费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a160131916';
545
+        update prj_AnnualBudgetDetail  set FYMC  = '9、劳务费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a160425416';
546
+        update prj_AnnualBudgetDetail  set FYMC  = '10、专家咨询费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a160458412';
547
+        update prj_AnnualBudgetDetail  set FYMC  = '11、其他支出' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a160517974';
548
+        update prj_AnnualBudgetDetail  set FYMC  = '(二)间接费用' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a160623545';
549
+        update prj_AnnualBudgetDetail  set FYMC  = '其中:绩效来源' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a160654304';
550
+        update prj_AnnualBudgetDetail  set FYMC  = '(三)外委支出费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a100055750';
551
+        update prj_AnnualBudgetDetail  set FYMC  = '(1)外委支出费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a142751829';
552
+        update A
553
+        set  A.bm = B.bm, A.fj = B.fj
554
+            from prj_AnnualBudgetDetail A
555
+        inner join (
556
+         select bp.* from base_ProjectBudget bp ,prj_Project pp,base_ProjectTemplate bpt
557
+         where pp.xmlx = bpt.xmlx and bpt.id = bp.xm  and pp.id = #{rwsId}
558
+            ) B on A.FYMC = B.mc
559
+        where
560
+            NYS in ( SELECT id from prj_AnnualBudget where rws =  #{rwsId} );
561
+    </update>
562
+    <update id="updateSXGSKJXMFYMC">
563
+        UPDATE prj_AnnualBudgetDetail set bm = '7' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = '6' and FYMC = '2.设备使用费' ;
564
+        UPDATE prj_AnnualBudgetDetail set bm = '8' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = '7' and FYMC = '(1)仪器设备使用费' ;
565
+        UPDATE prj_AnnualBudgetDetail set bm = '9' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = '8' and FYMC = '(2)软件使用费' ;
566
+        UPDATE prj_AnnualBudgetDetail set bm = '10' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = '9' and FYMC = '3.业务费' ;
567
+        UPDATE prj_AnnualBudgetDetail set bm = '11' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = '10' and FYMC = '(1)材料费' ;
568
+        UPDATE prj_AnnualBudgetDetail set bm = '12' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = '11' and FYMC = '(2)资料、印刷及知识产权费' ;
569
+        UPDATE prj_AnnualBudgetDetail set bm = '13' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = '12' and FYMC = '(3)会议、差旅及国际合作交流费' ;
570
+        UPDATE prj_AnnualBudgetDetail set bm = '14' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = '17' and FYMC = '4.场地使用费' ;
571
+        UPDATE prj_AnnualBudgetDetail set bm = '15' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = '18' and FYMC = '(1)场地物业费' ;
572
+        UPDATE prj_AnnualBudgetDetail set bm = '16' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = '19' and FYMC = '(2)场地使用租金' ;
573
+        UPDATE prj_AnnualBudgetDetail set bm = '17' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = '20' and FYMC = '5.专家咨询费' ;
574
+        UPDATE prj_AnnualBudgetDetail set bm = '18' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = '21' and FYMC = '(二)间接费' ;
575
+        UPDATE prj_AnnualBudgetDetail set bm = '19' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = '22' and FYMC = '(三)外委支出费' ;
576
+        UPDATE prj_AnnualBudgetDetail set bm = '20' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = '23' and FYMC = '1.外委研究支出费' ;
577
+        UPDATE prj_AnnualBudgetDetail set bm = '21' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = '24' and FYMC = '2.仪器设备租赁费' ;
578
+        UPDATE prj_AnnualBudgetDetail set bm = '22' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = '25' and FYMC = '3.外协测试试验与加工费' ;
579
+        UPDATE prj_AnnualBudgetDetail set bm = '23' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = '26' and FYMC = '(四)税金' ;
580
+        update A
581
+        set  A.fymc = B.mc, A.fj = B.fj
582
+            from prj_AnnualBudgetDetail A
583
+        inner join (
584
+         select bp.* from base_ProjectBudget bp ,prj_Project pp,base_ProjectTemplate bpt
585
+         where pp.xmlx = bpt.xmlx and bpt.id = bp.xm  and pp.id = #{rwsId}
586
+            ) B on A.bm = B.bm
587
+        where
588
+            NYS in ( SELECT id from prj_AnnualBudget where rws =  #{rwsId} );
589
+    </update>
590
+    <update id="updateGWGSKJXMFYMC">
591
+        update prj_AnnualBudgetDetail  set FYMC  = '(一)直接费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a100002972';
592
+        update prj_AnnualBudgetDetail  set FYMC  = '1.人工费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a100100606';
593
+        update prj_AnnualBudgetDetail  set FYMC  = '(1)专职研究人员人工费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a100252246';
594
+        update prj_AnnualBudgetDetail  set FYMC  = '(2)劳务外包人员人工费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a10025555';
595
+        update prj_AnnualBudgetDetail  set FYMC  = '(3)临时性研究人员人工费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a094823724';
596
+        update prj_AnnualBudgetDetail  set FYMC  = '2.设备使用费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a100124784';
597
+        update prj_AnnualBudgetDetail  set FYMC  = '(1)仪器设备使用费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a10033260';
598
+        update prj_AnnualBudgetDetail  set FYMC  = '(2)软件使用费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a100335414';
599
+        update prj_AnnualBudgetDetail  set FYMC  = '3.业务费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a100142605';
600
+        update prj_AnnualBudgetDetail  set FYMC  = '(1)材料费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a100402638';
601
+        update prj_AnnualBudgetDetail  set FYMC  = '(2)资料,印刷及知识产权费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a100404901';
602
+        update prj_AnnualBudgetDetail  set FYMC  = '(3)会议,差旅及国际合作交流费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a100406974';
603
+        update prj_AnnualBudgetDetail  set FYMC  = '4.场地使用费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a100145230';
604
+        update prj_AnnualBudgetDetail  set FYMC  = '(1)场地物业费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a100529887';
605
+        update prj_AnnualBudgetDetail  set FYMC  = '(2)场地使用租金' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a10053223';
606
+        update prj_AnnualBudgetDetail  set FYMC  = '5.专家咨询费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a100237514';
607
+        update prj_AnnualBudgetDetail  set FYMC  = '(二)间接费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a10055632';
608
+        update prj_AnnualBudgetDetail  set FYMC  = '(三)外委支出费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a100604109';
609
+        update prj_AnnualBudgetDetail  set FYMC  = '1.外委研究支出费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a10063271';
610
+        update prj_AnnualBudgetDetail  set FYMC  = '2.仪器设备租赁费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a1006345';
611
+        update prj_AnnualBudgetDetail  set FYMC  = '3.外协测试试验与加工费' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a100635599';
612
+        update prj_AnnualBudgetDetail  set FYMC  = '(四)税金' where nys in (SELECT id from prj_AnnualBudget where rws = #{rwsId} ) and bm = 'a100606333';
613
+        update A
614
+        set  A.bm = B.bm, A.fj = B.fj
615
+            from prj_AnnualBudgetDetail A
616
+        inner join (
617
+         select bp.* from base_ProjectBudget bp ,prj_Project pp,base_ProjectTemplate bpt
618
+         where pp.xmlx = bpt.xmlx and bpt.id = bp.xm  and pp.id = #{rwsId}
619
+            ) B on A.FYMC = B.mc
620
+        where
621
+            NYS in ( SELECT id from prj_AnnualBudget where rws =  #{rwsId} );
622
+    </update>
532 623
 
533 624
     <!--已申请费用的预算-->
534 625
     <select id="getFysqBudgetList">
@@ -575,5 +666,12 @@
575 666
         where RWS = #{rws}
576 667
           AND a.NF = #{nf}
577 668
     </select>
669
+
670
+
671
+
672
+
673
+
674
+
675
+
578 676
 </mapper>
579 677
 

+ 8 - 8
src/main/resources/mapper/PrjAnnualbudgetdetailDao.xml

@@ -14,8 +14,8 @@
14 14
         <result property="px" column="PX" jdbcType="VARCHAR"/>
15 15
         <result property="hjbm" column="HJBM" jdbcType="VARCHAR"/>
16 16
         <result property="bz" column="BZ" jdbcType="VARCHAR"/>
17
-        <result property="bndsqje" column="bndbzje" jdbcType="NUMERIC"/>
18
-        <result property="bndsqje" column="bndbzje" jdbcType="NUMERIC"/>
17
+        <result property="bndsqje" column="bndsqje" jdbcType="NUMERIC"/>
18
+        <result property="bndbzje" column="bndbzje" jdbcType="NUMERIC"/>
19 19
         <result property="dw1" column="DW1" jdbcType="NUMERIC"/>
20 20
         <result property="dw2" column="DW2" jdbcType="NUMERIC"/>
21 21
         <result property="dw3" column="DW3" jdbcType="NUMERIC"/>
@@ -625,11 +625,11 @@
625 625
         AND NYS=#{nys})
626 626
     </select>
627 627
     <select id="getYzxqk" resultType="com.liang.vo.PrjAnnualbudgetYzxqkVo">
628
-        SELECT convert(decimal(18,2),(sum(BZJE)/10000)) BZJE ,pa.fymc,sb.nf
629
-        from(SELECT	sb.id ,sb.fylb,pa.nf
630
-             from sta_BudgetApproval sb
631
-                 left join prj_AnnualBudget pa on pa.id = sb.nys
632
-             where	nys in (
628
+        SELECT convert(decimal(18,2),(sum(BZJE)/10000)) BZJE ,pa.fymc,sb.nf,sb.xmlx
629
+        from(SELECT	sb.id ,sb.fylb,pa.nf,pa.xmlx
630
+             from  prj_AnnualBudget pa
631
+                 left join sta_BudgetApproval sb on pa.id = sb.nys
632
+             where	pa.id in (
633 633
                  select	id
634 634
                  from prj_AnnualBudget
635 635
                  where rws = (select rws from prj_AnnualBudget where ID = #{nys})
@@ -637,7 +637,7 @@
637 637
                  )) sb
638 638
                 left join sta_Reimbursement sa on sa.fysq = sb.id
639 639
                 LEFT join prj_AnnualBudgetDetail pa on pa.id = sb.fylb
640
-        group by pa.fymc,sb.nf
640
+        group by pa.fymc,sb.nf,sb.xmlx
641 641
         order by sb.nf asc
642 642
     </select>
643 643
     <select id="getNf" resultType="com.liang.vo.PrjAnnualbudgetYzxqkVo">

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

@@ -315,7 +315,7 @@
315 315
         //父级预算
316 316
         function setFjBudget(fj) {
317 317
             if (fj != null && fj != '') {
318
-                var xmzys = 0, xmz = 0, byj = 0, xtjsyzx = 0, sjyzx = 0;
318
+                var xmzys = 0, xmz = 0, byj = 0, xtjsyzx = 0, sjyzx = 0, bndsqje = 0, bndbzje = 0;
319 319
                 //子节点的值相加
320 320
                 for (var j = 0; j < dataBudget1.length; j++) {
321 321
                     if (fj == dataBudget1[j].fj) {
@@ -331,6 +331,12 @@
331 331
                         var t4 = parseFloat(dataBudget1[j].sjyzx);
332 332
                         if (!isNaN(t4))
333 333
                             sjyzx += t4;
334
+                        var t5 = parseFloat(dataBudget1[j].bndsqje);
335
+                        if (!isNaN(t5))
336
+                            bndsqje += t5;
337
+                        var t6 = parseFloat(dataBudget1[j].bndbzje);
338
+                        if (!isNaN(t6))
339
+                            bndbzje += t6;
334 340
                     }
335 341
                 }
336 342
                 //更新父节点的值
@@ -355,6 +361,15 @@
355 361
                         else
356 362
                             dataBudget1[j].ysje = ysje.toFixed(2);
357 363
 
364
+                        if (bndsqje == 0)
365
+                            dataBudget1[j].bndsqje = "";
366
+                        else
367
+                            dataBudget1[j].bndsqje = bndsqje.toFixed(2);
368
+
369
+                        if (bndbzje == 0)
370
+                            dataBudget1[j].bndbzje = "";
371
+                        else
372
+                            dataBudget1[j].bndbzje = bndbzje.toFixed(2);
358 373
                         setFjBudget(dataBudget1[j].fj);
359 374
                         break;
360 375
                     }