lige
2024-01-24 f4634091d71bc3e99df179d5976b9c59a24ca5f7
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java
@@ -1051,9 +1051,12 @@
        }
        if ((null == proIds || proIds.size() == 0) && (null == packId || packId.equals(""))) {
            transitionService.deletedTbTransitionByCusId(cusId);
            if (redisCache.hasKey(cusId)) redisCache.deleteObject(cusId);
            if (redisCache.hasKey(cardId+cusId + "cusId")) redisCache.deleteCacheMapValue(cardId+cusId + "cusId", cardId+cusId);
            if (redisCache.hasKey(cardId+cusId)) {
                redisCache.deleteObject(cardId+cusId);
            }
            if (redisCache.hasKey(cardId+cusId + "cusId")){
                redisCache.deleteCacheMapValue(cardId+cusId + "cusId", cardId+cusId);
            }
        }
        List<TbTransition> tbTransitionList = null;
        if (!redisCache.hasKey(cardId+cusId)) {
@@ -1439,35 +1442,33 @@
            if (null != pacId) {
                TjPackage aPackage = tjPackageService.getById(entry.getValue().get(0).getPacId());
                map.put("pacName", aPackage.getPacName());
                TjProject tjProject = projectService.getById(entry.getKey());
                TjPackageProject project = tjPackageProjectService.getOne(new LambdaQueryWrapper<TjPackageProject>().eq(TjPackageProject::getPacId, pacId)
                        .eq(TjPackageProject::getProId, entry.getKey()));
                map.put("ordPrice",tjProject.getProPrice());
                if(null !=project){
                    map.put("nowPrice",project.getPriceNow());
                }else {
                    map.put("nowPrice",tjProject.getProPrice());
                }
            } else {
                map.put("pacName", "单项");
                List<TbTransition> tbTransitionList = entry.getValue();
                if (null != tbTransitionList && tbTransitionList.size() > 0) {
                    BigDecimal money1 = new BigDecimal("0.00");
                    BigDecimal money2 = new BigDecimal("0.00");
                    for (TbTransition tbTransition : tbTransitionList) {
                        money1 = money1.add(tbTransition.getOrdPrice());
                        money2 = money2.add(tbTransition.getNowPrice());
                    }
                    map.put("ordPrice", money1);
                    map.put("nowPrice", money2);
                 }
            }
            map.put("parentName", projectService.getById(entry.getKey()).getProName());
            map.put("list", entry.getValue());
            List<TbTransition> tbTransitionList = entry.getValue();
            if (null != tbTransitionList && tbTransitionList.size() > 0) {
                BigDecimal money1 = new BigDecimal("0.00");
                BigDecimal money2 = new BigDecimal("0.00");
                for (TbTransition tbTransition : tbTransitionList) {
                    money1 = money1.add(tbTransition.getOrdPrice());
                    money2 = money2.add(tbTransition.getNowPrice());
//                    if (tbTransition.getOrdPrice().compareTo(BigDecimal.valueOf(0)) == 0 || tbTransition.getNowPrice().compareTo(BigDecimal.valueOf(0)) == 0) {
//                        tbTransition.setDiscount("0");
//                    } else {
//                        tbTransition.setDiscount((tbTransition.getNowPrice()).divide(tbTransition.getOrdPrice(), BigDecimal.ROUND_CEILING).toString());
//                    }
//                    if (null != tbTransition.getPacId()) {
//                        tbTransition.setPacPrice(tjPackageService.getById(tbTransition.getPacId()).getPrice());
//                    }
//                    if (null != tbTransition.getParentProId()) {
//                        tbTransition.setPacPrice(projectService.getTjProjectById(String.valueOf(tbTransition.getParentProId())).getProPrice());
//                    }
                }
//                map.put("ordPrice", money1.setScale(Integer.parseInt(configService.selectConfigByKey("sys.price.save")), Integer.parseInt(configService.selectConfigByKey("sys.price"))));
//                map.put("nowPrice", money2.setScale(Integer.parseInt(configService.selectConfigByKey("sys.price.save")), Integer.parseInt(configService.selectConfigByKey("sys.price"))));
                map.put("ordPrice", money1);
                map.put("nowPrice", money2);
            }
            list.add(map);
        }
        return list;