| | |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | /* private void extracted(TjFlowingWater tjFlowingWater, TjOrder order, TjCustomer customer) { |
| | | List<TjConsumables> list2 = new ArrayList<>(); |
| | | String[] tjProIds = tjFlowingWater.getTjProIds(); |
| | | for (String tjProId : tjProIds) { |
| | | LambdaQueryWrapper<TjProject> wq0 = new LambdaQueryWrapper<>(); |
| | | wq0.eq(TjProject::getProParentId, tjProId); |
| | | List<Long> proIds = projectService.list(wq0).stream().map(TjProject::getProId).collect(Collectors.toList()); |
| | | TjOrderDetail detail = new TjOrderDetail(); |
| | | detail.setTjStatus(0L); |
| | | detail.setOrderId(tjFlowingWater.getOrderId()); |
| | | detail.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | detail.setProId(Long.valueOf(tjProId)); |
| | | detail.setIsAddition("Y"); |
| | | detailService.save(detail); |
| | | for (Long proId : proIds) { |
| | | TjOrderDetail detail1 = new TjOrderDetail(); |
| | | detail1.setTjStatus(0L); |
| | | detail1.setOrderId(tjFlowingWater.getOrderId()); |
| | | detail1.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | detail1.setProId(proId); |
| | | detail1.setIsAddition("Y"); |
| | | detailService.save(detail1); |
| | | } |
| | | LambdaQueryWrapper<TbTransition> wqq = new LambdaQueryWrapper<>(); |
| | | wqq.eq(TbTransition::getCusId, customer.getCusIdcard()); |
| | | wqq.in(TbTransition::getProId, proIds); |
| | | List<TbTransition> tbTransitionList = transitionService.list(wqq); |
| | | if (null != tbTransitionList && tbTransitionList.size() > 0) { |
| | | for (TbTransition transition : tbTransitionList) { |
| | | TjProject tjProject = projectService.selectTjProjectByProId(transition.getProId()); |
| | | //子项 |
| | | if (null != tjProject) { |
| | | TjChargingStandard tjChargingStandard = new TjChargingStandard(); |
| | | tjChargingStandard.setTjNum(order.getTjNumber()); |
| | | tjChargingStandard.setProId(transition.getProId()); |
| | | tjChargingStandard.setPrice(transition.getNowPrice()); |
| | | tjChargingStandard.setProName(tjProject.getProName()); |
| | | chargingStandardService.save(tjChargingStandard); |
| | | } |
| | | } |
| | | //父项 |
| | | TjProject parentProject = projectService.getById(tjProId); |
| | | if (null != parentProject) { |
| | | LambdaQueryWrapper<TjProConsumables> wqqq = new LambdaQueryWrapper<>(); |
| | | wqqq.eq(TjProConsumables::getProId, parentProject.getProId()); |
| | | List<TjProConsumables> proConsumables = proConsumablesService.list(wqqq); |
| | | if (null != proConsumables && proConsumables.size() > 0) { |
| | | for (TjProConsumables tjProConsumables : proConsumables) { |
| | | TjConsumables tjConsumables = consumablesService.selectTjConsumablesById(tjProConsumables.getConsumablesId()); |
| | | list2.add(tjConsumables); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //父项耗材 |
| | | ArrayList<TjConsumables> collect = list2.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(TjConsumables::getId))), ArrayList::new)); |
| | | for (TjConsumables tjConsumables : collect) { |
| | | TjChargingStandard tjChargingStandard = new TjChargingStandard(); |
| | | tjChargingStandard.setTjNum(order.getTjNumber()); |
| | | tjChargingStandard.setConsumablesId(tjConsumables.getId()); |
| | | tjChargingStandard.setPrice(tjConsumables.getPrice()); |
| | | tjChargingStandard.setProName(tjConsumables.getMakings()); |
| | | tjChargingStandard.setConsumablesName(tjConsumables.getMakings()); |
| | | tjChargingStandard.setCompany(tjConsumables.getSpecifications()); |
| | | chargingStandardService.save(tjChargingStandard); |
| | | } |
| | | }*/ |
| | | |
| | | //备用添加收费明细 |
| | | /*private void extracted(TjOrder order, List<TjConsumables> list2, List<TbTransition> tbTransitionList) { |
| | | for (TbTransition transition : tbTransitionList) { |
| | | TjProject tjProject = projectService.selectTjProjectByProId(transition.getProId()); |
| | | //子项 |
| | | if (null != tjProject) { |
| | | TjChargingStandard tjChargingStandard = new TjChargingStandard(); |
| | | tjChargingStandard.setTjNum(order.getTjNumber()); |
| | | tjChargingStandard.setProId(transition.getProId()); |
| | | tjChargingStandard.setPrice(transition.getNowPrice()); |
| | | tjChargingStandard.setProName(tjProject.getProName()); |
| | | chargingStandardService.save(tjChargingStandard); |
| | | } |
| | | } |
| | | |
| | | //父项 |
| | | ArrayList<TbTransition> collect1 = tbTransitionList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(TbTransition::getParentProId))), ArrayList::new)); |
| | | List<Long> parentProIds = collect1.stream().map(TbTransition::getParentProId).collect(Collectors.toList()); |
| | | if (parentProIds.size() > 0) { |
| | | for (Long parentProId : parentProIds) { |
| | | TjProject parentProject = projectService.selectTjProjectByProId(parentProId); |
| | | if (null != parentProject) { |
| | | LambdaQueryWrapper<TjProConsumables> wqqq = new LambdaQueryWrapper<>(); |
| | | wqqq.eq(TjProConsumables::getProId, parentProject.getProId()); |
| | | List<TjProConsumables> proConsumables = proConsumablesService.list(wqqq); |
| | | if (null != proConsumables && proConsumables.size() > 0) { |
| | | for (TjProConsumables tjProConsumables : proConsumables) { |
| | | TjConsumables tjConsumables = consumablesService.selectTjConsumablesById(tjProConsumables.getConsumablesId()); |
| | | list2.add(tjConsumables); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | ArrayList<TjConsumables> collect = list2.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(TjConsumables::getId))), ArrayList::new)); |
| | | for (TjConsumables tjConsumables : collect) { |
| | | TjChargingStandard tjChargingStandard = new TjChargingStandard(); |
| | | tjChargingStandard.setTjNum(order.getTjNumber()); |
| | | tjChargingStandard.setConsumablesId(tjConsumables.getId()); |
| | | tjChargingStandard.setPrice(tjConsumables.getPrice()); |
| | | tjChargingStandard.setProName(tjConsumables.getMakings()); |
| | | tjChargingStandard.setConsumablesName(tjConsumables.getMakings()); |
| | | tjChargingStandard.setCompany(tjConsumables.getSpecifications()); |
| | | chargingStandardService.save(tjChargingStandard); |
| | | } |
| | | }*/ |
| | | |
| | | /** |
| | | * 删除体检流水 |