|
@@ -145,7 +145,7 @@ public class MeterTreeController extends BladeController {
|
|
|
@ApiOperationSupport(order = 5)
|
|
|
@ApiOperation(value = "系统树节点详情", notes = "传入id")
|
|
|
public R<MeterTreeSystem> systemDetail(@RequestParam String id) {
|
|
|
- return R.data(meterTreeSystemService.getById(id));
|
|
|
+ return R.data(meterTreeSystemService.systemDetail(id));
|
|
|
}
|
|
|
|
|
|
@PostMapping("/system/save")
|
|
@@ -357,7 +357,7 @@ public class MeterTreeController extends BladeController {
|
|
|
@ApiOperationSupport(order = 14)
|
|
|
@ApiOperation(value = "项目树节点详情", notes = "传入id")
|
|
|
public R<MeterTreeProject> projectDetail(@RequestParam String id) {
|
|
|
- return R.data(meterTreeProjectService.getById(id));
|
|
|
+ return R.data(meterTreeProjectService.projectDetail(id));
|
|
|
}
|
|
|
|
|
|
@PostMapping("/project/save")
|
|
@@ -702,50 +702,20 @@ public class MeterTreeController extends BladeController {
|
|
|
@GetMapping("/contract/detail")
|
|
|
@ApiOperationSupport(order = 25)
|
|
|
@ApiOperation(value = "合同段树节点详情", notes = "传入id")
|
|
|
- public R<MeterTreeContractVO> contractDetail(@RequestParam String id) {
|
|
|
- MeterTreeContract basicInfo = jdbcTemplate.query("select * from s_meter_tree_contract where is_deleted = 0 and id = " + id, new BeanPropertyRowMapper<>(MeterTreeContract.class)).stream().findAny().orElse(null);
|
|
|
- if (basicInfo != null) {
|
|
|
- MeterTreeContractVO vo = new MeterTreeContractVO();
|
|
|
- BeanUtil.copyProperties(basicInfo, vo);
|
|
|
-
|
|
|
- if (ObjectUtil.isNotEmpty(basicInfo.getStakeType())) {
|
|
|
- Dict dict = jdbcTemplate.query("SELECT dict_value FROM blade_dict WHERE is_deleted = 0 AND code = 'meter_stake_type' AND dict_key = " + basicInfo.getStakeType(), new BeanPropertyRowMapper<>(Dict.class)).stream().findAny().orElse(null);
|
|
|
- if (dict != null) {
|
|
|
- vo.setStakeTypeName(dict.getDictValue());
|
|
|
- }
|
|
|
- }
|
|
|
- if (basicInfo.getNodeType() != null){
|
|
|
- Dict dict = jdbcTemplate.query("SELECT dict_value FROM blade_dict_biz WHERE is_deleted = 0 AND code = 'meter_unit_type' AND dict_key = " + basicInfo.getNodeType(), new BeanPropertyRowMapper<>(Dict.class)).stream().findAny().orElse(null);
|
|
|
- if (dict != null) {
|
|
|
- vo.setNodeTypeName(dict.getDictValue());
|
|
|
- }
|
|
|
- }
|
|
|
- //判断是否为最底层节点,如果为最底层节点则直接查询清单,不为最底层节点则汇总子节点总和
|
|
|
- long count = meterTreeContractService.count(new LambdaQueryWrapper<MeterTreeContract>()
|
|
|
- .eq(MeterTreeContract::getContractId, basicInfo.getContractId())
|
|
|
- .eq(MeterTreeContract::getParentId, basicInfo.getId()));
|
|
|
- if (count == 0) {
|
|
|
- //设置是否被计量
|
|
|
- int total = Math.toIntExact(middleMeterApplyService.count(new LambdaQueryWrapper<MiddleMeterApply>()
|
|
|
- .eq(MiddleMeterApply::getContractId, basicInfo.getContractId())
|
|
|
- .eq(MiddleMeterApply::getContractUnitId, id)));
|
|
|
- if (total == 0){
|
|
|
- vo.setIsMeter(0);
|
|
|
- }else {
|
|
|
- vo.setIsMeter(1);
|
|
|
- }
|
|
|
- //设置清单
|
|
|
- List<ContractFromVO> contrFormAllByContrId = contractInventoryFormService.getNodeResolveForm(basicInfo.getContractId(), basicInfo.getId());
|
|
|
- vo.setDecompositionList(contrFormAllByContrId);
|
|
|
- //设置关联节点信息
|
|
|
- List<MeterTreeLinkWbsTreeVO> wbsTreeVOS = meterTreeLinkWbsTreeService.getWbsListByMeterId(basicInfo.getContractId(), basicInfo.getId());
|
|
|
- vo.setLinkNodeList(wbsTreeVOS);
|
|
|
- } else {
|
|
|
- meterTreeContractService.getAllChildNodeMoney(vo);
|
|
|
- }
|
|
|
- return R.data(vo);
|
|
|
+ public R<MeterTreeContractVO> contractDetail(@RequestParam Long id) {
|
|
|
+ MeterTreeContractVO vo = meterTreeContractService.contractDetail(id);
|
|
|
+ //判断是否是最底层
|
|
|
+ if (vo.getChildTotal() == 0) {
|
|
|
+ //设置清单
|
|
|
+ List<ContractFromVO> contrFormAllByContrId = contractInventoryFormService.getNodeResolveForm(vo.getContractId(), vo.getId());
|
|
|
+ vo.setDecompositionList(contrFormAllByContrId);
|
|
|
+ //设置关联节点信息
|
|
|
+ List<MeterTreeLinkWbsTreeVO> wbsTreeVOS = meterTreeLinkWbsTreeService.getWbsListByMeterId(vo.getContractId(), vo.getId());
|
|
|
+ vo.setLinkNodeList(wbsTreeVOS);
|
|
|
+ } else {
|
|
|
+ meterTreeContractService.getAllChildNodeMoney(vo);
|
|
|
}
|
|
|
- return R.data(null);
|
|
|
+ return R.data(vo);
|
|
|
}
|
|
|
|
|
|
@GetMapping("/contract/lazy")
|