|
@@ -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
|
|