| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.extra.pinyin.PinyinUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ltkj.common.core.domain.entity.SysUser; |
| | | import com.ltkj.common.utils.SecurityUtils; |
| | |
| | | TjOrder order = orderService.getById(tjFlowingWater.getOrderId()); |
| | | TjCustomer customer = customerService.getById(order.getUserId()); |
| | | if (null != tjFlowingWater.getTjProIds() && tjFlowingWater.getTjProIds().length > 0) { |
| | | tjFlowingWater.setWaterId(SecurityUtils.getUsername() + DateUtil.format(new Date(), "yyMMddHHmmssSSS")); |
| | | tjFlowingWater.setWaterId(PinyinUtil.getFirstLetter(customer.getCusName(), "").toUpperCase() + DateUtil.format(new Date(), "yyMMddHHmmssSSS")); |
| | | tjFlowingWater.setIsAddition("Y"); |
| | | if (tjFlowingWaterService.save(tjFlowingWater)) { |
| | | //异步单项收费明细 |
| | |
| | | tjRefundVo.setTjName(MatchUtils.hideCusName(customer.getCusName())); |
| | | tjRefundVo.setTjPhone(MatchUtils.hidePhoneNum(customer.getCusPhone())); |
| | | tjRefundVo.setSex(String.valueOf(customer.getCusSex())); |
| | | tjRefundVo.setIdCard(MatchUtils.hideIdCardNum(customer.getCusIdcard())); |
| | | if(null !=customer.getCusIdcard()) tjRefundVo.setIdCard(MatchUtils.hideIdCardNum(customer.getCusIdcard())); |
| | | DictComp dictComp = compService.getById(order.getFirmId()); |
| | | if(null !=dictComp){ |
| | | tjRefundVo.setTjComp(dictComp.getCnName()); |
| | |
| | | tjRefundVo.setTjPhone(MatchUtils.hidePhoneNum(customer.getCusPhone())); |
| | | tjRefundVo.setSex(String.valueOf(customer.getCusSex())); |
| | | tjRefundVo.setIdCard(MatchUtils.hideIdCardNum(customer.getCusIdcard())); |
| | | if (null != order.getDictCompName()) |
| | | tjRefundVo.setTjComp(compService.getById(order.getFirmId()) != null ? compService.getById(order.getFirmId()).getCnName() : null); |
| | | if (null != order.getFirmId()){ |
| | | DictComp byId = compService.getById(order.getFirmId()); |
| | | if(null != byId){ |
| | | tjRefundVo.setTjComp(byId.getCnName()); |
| | | } |
| | | } |
| | | if (null != order.getTjType()) tjRefundVo.setTjType(order.getTjType()); |
| | | TjFlowingWater one = tjFlowingWaterService.getOne(new LambdaQueryWrapper<TjFlowingWater>() |
| | | .eq(TjFlowingWater::getOrderId, order.getOrderId()) |
| | |
| | | if (null != tjProjectList && tjProjectList.size() > 0) { |
| | | 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()); |
| | | //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)); |
| | | } |
| | | } |
| | | project.setProPrice(bigDecimal.setScale(0,BigDecimal.ROUND_UP)); |
| | | project.setProOrdPrice(bigDecimal1); |
| | | } |
| | | } |
| | | } |