| | |
| | | return AjaxResult.success("该订单已付款 无须再付"); |
| | | } |
| | | if (tjFlowingWaterService.updateById(tjFlowingWater)) { |
| | | LambdaQueryWrapper<TjOrderDetail> wq2 = new LambdaQueryWrapper<>(); |
| | | wq2.eq(TjOrderDetail::getOrderId, tjFlowingWater.getOrderId()); |
| | | wq2.isNull(TjOrderDetail::getFlowingWaterId); |
| | | // LambdaQueryWrapper<TjOrderDetail> wq2 = new LambdaQueryWrapper<>(); |
| | | // wq2.eq(TjOrderDetail::getOrderId, tjFlowingWater.getOrderId()); |
| | | // wq2.isNull(TjOrderDetail::getFlowingWaterId); |
| | | List<TjConsumables> list2 = new ArrayList<>(); |
| | | for (TjOrderDetail tjOrderDetail : detailService.list(wq2)) { |
| | | tjOrderDetail.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | detailService.updateById(tjOrderDetail); |
| | | } |
| | | // for (TjOrderDetail tjOrderDetail : detailService.list(wq2)) { |
| | | // tjOrderDetail.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | // detailService.updateById(tjOrderDetail); |
| | | // } |
| | | detailService.updateTjOrderDetailsFlowingWaterIdByJxbzisnull(String.valueOf(order.getOrderId()),String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | remarkService.updateTjOrderRemarkSfbzByJxbzisnull(order.getOrderId().toString(),tjFlowingWater.getTjSerialNumber().toString()); |
| | | LambdaQueryWrapper<TjOrderDetail> wq3 = new LambdaQueryWrapper<>(); |
| | | wq3.eq(TjOrderDetail::getOrderId, tjFlowingWater.getOrderId()); |
| | | wq3.isNotNull(TjOrderDetail::getFlowingWaterId); |
| | | List<TjOrderDetail> detailList = detailService.list(wq3); |
| | | if (null != detailList && detailList.size() > 0) { |
| | | if (null != detailList && !detailList.isEmpty()) { |
| | | LambdaQueryWrapper<TbTransition> wqq = new LambdaQueryWrapper<>(); |
| | | wqq.eq(TbTransition::getCusId, customer.getCusIdcard()); |
| | | wqq.in(TbTransition::getProId, detailList.stream().map(TjOrderDetail::getProId).collect(Collectors.toList())); |
| | | List<TbTransition> tbTransitionList = transitionService.list(wqq); |
| | | if (null != tbTransitionList && tbTransitionList.size() > 0) { |
| | | if (null != tbTransitionList && !tbTransitionList.isEmpty()) { |
| | | // extracted(order, list2, tbTransitionList); |
| | | //异步添加收费明细 |
| | | asyncService.collectFees(order, list2, tbTransitionList, sysUser, tjFlowingWater.getDiscount()); |
| | |
| | | .or() |
| | | .like(TjCustomer::getCusPhone, tjPhone); |
| | | List<TjCustomer> customerList = customerService.list(wq0); |
| | | if (null != customerList && customerList.size() > 0) { |
| | | if (null != customerList && !customerList.isEmpty()) { |
| | | for (TjCustomer customer : customerList) { |
| | | LambdaQueryWrapper<TjOrder> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjOrder::getUserId, customer.getCusId()); |
| | | wq1.eq(TjOrder::getCheckStatus, 0); |
| | | wq1.orderByDesc(TjOrder::getCreateTime); |
| | | List<TjOrder> tjOrders = orderService.list(wq1); |
| | | if (null != tjOrders && tjOrders.size() > 0) { |
| | | if (null != tjOrders && !tjOrders.isEmpty()) { |
| | | for (TjOrder order : tjOrders) { |
| | | LambdaQueryWrapper<TjOrderDetail> wq2 = new LambdaQueryWrapper<>(); |
| | | wq2.eq(TjOrderDetail::getOrderId, order.getOrderId()); |
| | | List<TjOrderDetail> detailList = detailService.list(wq2); |
| | | if (null != detailList && detailList.size() > 0) { |
| | | if (null != detailList && !detailList.isEmpty()) { |
| | | TjCollectFeesVo tjRefundVo = new TjCollectFeesVo(); |
| | | tjRefundVo.setTjCusId(String.valueOf(customer.getCusId())); |
| | | tjRefundVo.setTjName(customer.getCusName()); |
| | |
| | | } |
| | | } |
| | | } |
| | | // TjOrder order = null; |
| | | // if (null != tjOrders && tjOrders.size() > 0) { |
| | | // order = tjOrders.get(0); |
| | | // } |
| | | // if (null == order) { |
| | | // continue; |
| | | // } |
| | | // LambdaQueryWrapper<TjOrderDetail> wq2 = new LambdaQueryWrapper<>(); |
| | | // wq2.eq(TjOrderDetail::getOrderId, order.getOrderId()); |
| | | // List<TjOrderDetail> detailList = detailService.list(wq2); |
| | | // if (null != detailList && detailList.size() > 0) { |
| | | // TjCollectFeesVo tjRefundVo = new TjCollectFeesVo(); |
| | | // tjRefundVo.setTjCusId(String.valueOf(customer.getCusId())); |
| | | // tjRefundVo.setTjName(customer.getCusName()); |
| | | // tjRefundVo.setTjPhone(customer.getCusPhone()); |
| | | // tjRefundVo.setSex(String.valueOf(customer.getCusSex())); |
| | | // tjRefundVo.setIdCard(customer.getCusIdcard()); |
| | | // if (null != order.getDictCompName()) |
| | | // tjRefundVo.setTjComp(compService.getById(order.getFirmId()) != null ? compService.getById(order.getFirmId()).getCnName() : null); |
| | | // if (null != order.getTjType()) tjRefundVo.setTjType(order.getTjType()); |
| | | // LambdaQueryWrapper<TjFlowingWater> wq = new LambdaQueryWrapper<>(); |
| | | // wq.eq(TjFlowingWater::getOrderId, order.getOrderId()); |
| | | // wq.eq(TjFlowingWater::getIsAddition, "N"); |
| | | // wq.eq(TjFlowingWater::getPayStasus, 0); |
| | | // TjFlowingWater one = tjFlowingWaterService.getOne(wq); |
| | | //// if (null == one) { |
| | | //// return AjaxResult.success("不可重复收费"); |
| | | //// } |
| | | // tjRefundVo.setTjFlowingWater(one); |
| | | // tjRefundVo.setTjNumber(order.getTjNumber()); |
| | | // tjRefundVo.setTjOrderId(String.valueOf(order.getOrderId())); |
| | | // tjCollectFeesVoList.add(tjRefundVo); |
| | | // } |
| | | } |
| | | return AjaxResult.success(tjCollectFeesVoList); |
| | | } |
| | |
| | | wq1.likeLeft(TjOrder::getTjNumber, tjNum); |
| | | // wq1.eq(TjOrder::getCheckStatus, 0); |
| | | List<TjOrder> orderList = orderService.list(wq1); |
| | | if (null != orderList && orderList.size() > 0) { |
| | | if (null != orderList && !orderList.isEmpty()) { |
| | | for (TjOrder order : orderList) { |
| | | LambdaQueryWrapper<TjOrderDetail> wq2 = new LambdaQueryWrapper<>(); |
| | | wq2.eq(TjOrderDetail::getOrderId, order.getOrderId()); |
| | | //wq2.isNull(TjOrderDetail::getFlowingWaterId); |
| | | List<TjOrderDetail> detailList = detailService.list(wq2); |
| | | if (null != detailList && detailList.size() > 0) { |
| | | if (null != detailList && !detailList.isEmpty()) { |
| | | TjCustomer customer = customerService.getById(order.getUserId()); |
| | | if (null != customer) { |
| | | TjCollectFeesVo tjRefundVo = new TjCollectFeesVo(); |
| | |
| | | } |
| | | String pacId = transitionService.selectPacIdByTbTransitionTjNumAndProId(order.getTjNumber(),order.getCardId()); |
| | | String s = tjFlowingWaterService.getDiscount(OrderId); |
| | | if (null != tjProjectList && tjProjectList.size() > 0) { |
| | | if (null != tjProjectList && !tjProjectList.isEmpty()) { |
| | | for (TjProject project : tjProjectList) { |
| | | if (project.getProParentId() == 0) { |
| | | /* //LambdaQueryWrapper<TbTransition> wqq1 = new LambdaQueryWrapper<>(); |
| | | // wqq1.eq(TbTransition::getCusId, customerService.getById(order.getUserId()).getCusIdcard()); |
| | | // wqq1.eq(TbTransition::getParentProId, project.getProId()); |
| | | // List<TbTransition> tbTransitionList = transitionService.list(wqq1); |
| | | // BigDecimal bigDecimal = new BigDecimal("0.00"); |
| | | // BigDecimal bigDecimal1 = new BigDecimal("0.00"); |
| | | // for (TbTransition transition : tbTransitionList) { |
| | | // bigDecimal = bigDecimal.add(transition.getNowPrice()); |
| | | // bigDecimal1=bigDecimal1.add(transition.getOrdPrice()); |
| | | // } |
| | | // project.setProPrice(bigDecimal.setScale(0,BigDecimal.ROUND_UP)); |
| | | // project.setProOrdPrice(bigDecimal1); |
| | | BigDecimal decimal = transitionService.getTbTransitionPriceAndOrdPrice(customerService.getById(order.getUserId()).getCusIdcard(), |
| | | project.getProId()); |
| | | String s = tjFlowingWaterService.getDiscount(OrderId); |
| | | if(null !=decimal){ |
| | | // project.setProPrice(decimal.setScale(2)); |
| | | project.setProPrice(decimal); |
| | | // project.setProOrdPrice(decimal.multiply(new BigDecimal(s)).setScale(2)); |
| | | project.setProOrdPrice(decimal); |
| | | }else { |
| | | BigDecimal decimal1 = transitionService.getTbTransitionDxPriceAndOrdPrice(String.valueOf(order.getUserId()),project.getProId()); |
| | | if(null !=decimal1){ |
| | | project.setProPrice(decimal1.setScale(2)); |
| | | project.setProOrdPrice(decimal1.multiply(new BigDecimal(s)).setScale(2)); |
| | | }else { |
| | | project.setProPrice(new BigDecimal("0.00").setScale(2)); |
| | | project.setProOrdPrice(new BigDecimal("0.00").setScale(2)); |
| | | } |
| | | }*/ |
| | | if (null != pacId) { |
| | | TjPackageProject pp = tjPackageProjectService.getOne(new LambdaQueryWrapper<TjPackageProject>().eq(TjPackageProject::getPacId, pacId) |
| | | .eq(TjPackageProject::getProId, String.valueOf(project.getProId()))); |
| | |
| | | List<TjFlowingWater> list = tjFlowingWaterService.list(new LambdaQueryWrapper<TjFlowingWater>() |
| | | .eq(TjFlowingWater::getOrderId, order) |
| | | .eq(TjFlowingWater::getPayStasus, 2)); |
| | | if (null != list && list.size() > 0) { |
| | | if (null != list && !list.isEmpty()) { |
| | | List<TjProject> projectList = projectService.getTjProListByPacIdAndDeptId(pacId); |
| | | if(null !=projectList && projectList.size()>0){ |
| | | if(null !=projectList && !projectList.isEmpty()){ |
| | | for (TjProject project : projectList) { |
| | | project.setProOrdPrice(tjPackageProjectService.getPacProPriceByPacIdAndPro(project.getProId(),pacId) |
| | | .multiply(new BigDecimal(s)).setScale(2)); |