| | |
| | | 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; |
| | |
| | | private TjAsyncService asyncService; |
| | | @Resource |
| | | private IJimuOnlineReportService reportService; |
| | | |
| | | @Resource |
| | | private ITjPackageProjectService tjPackageProjectService; |
| | | |
| | | /** |
| | | * 查询该体检号对应的订单流水列表 |
| | |
| | | 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)) { |
| | | //异步单项收费明细 |
| | |
| | | List<TjOrderDetail> detailList = detailService.list(wq2); |
| | | if (null != detailList && detailList.size() > 0) { |
| | | TjRefundVo tjRefundVo = new TjRefundVo(); |
| | | tjRefundVo.setTjName(MatchUtils.hideCusName(customer.getCusName())); |
| | | tjRefundVo.setTjPhone(MatchUtils.hidePhoneNum(customer.getCusPhone())); |
| | | tjRefundVo.setTjName(customer.getCusName()); |
| | | tjRefundVo.setTjPhone(customer.getCusPhone()); |
| | | tjRefundVo.setTjNumber(order.getTjNumber()); |
| | | tjRefundVo.setTjOrderId(String.valueOf(order.getOrderId())); |
| | | if (null != order.getDictCompName()) tjRefundVo.setTjComp(order.getDictCompName()); |
| | |
| | | TjCustomer customer = customerService.getById(order.getUserId()); |
| | | if (null != customer) { |
| | | TjRefundVo tjRefundVo = new TjRefundVo(); |
| | | tjRefundVo.setTjName(MatchUtils.hideCusName(customer.getCusName())); |
| | | tjRefundVo.setTjPhone(MatchUtils.hidePhoneNum(customer.getCusPhone())); |
| | | tjRefundVo.setTjName(customer.getCusName()); |
| | | tjRefundVo.setTjPhone(customer.getCusPhone()); |
| | | tjRefundVo.setTjNumber(order.getTjNumber()); |
| | | tjRefundVo.setTjOrderId(String.valueOf(order.getOrderId())); |
| | | if (null != order.getDictCompName()) tjRefundVo.setTjComp(order.getDictCompName()); |
| | |
| | | if (null != detailList && detailList.size() > 0) { |
| | | TjCollectFeesVo tjRefundVo = new TjCollectFeesVo(); |
| | | tjRefundVo.setTjCusId(String.valueOf(customer.getCusId())); |
| | | tjRefundVo.setTjName(MatchUtils.hideCusName(customer.getCusName())); |
| | | tjRefundVo.setTjPhone(MatchUtils.hidePhoneNum(customer.getCusPhone())); |
| | | tjRefundVo.setTjName(customer.getCusName()); |
| | | tjRefundVo.setTjPhone(customer.getCusPhone()); |
| | | tjRefundVo.setSex(String.valueOf(customer.getCusSex())); |
| | | if(null !=customer.getCusIdcard()) tjRefundVo.setIdCard(MatchUtils.hideIdCardNum(customer.getCusIdcard())); |
| | | DictComp dictComp = compService.getById(order.getFirmId()); |
| | |
| | | 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<>(); |
| | | /* //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); |
| | |
| | | project.getProId()); |
| | | String s = tjFlowingWaterService.getDiscount(OrderId); |
| | | if(null !=decimal){ |
| | | project.setProPrice(decimal.setScale(2)); |
| | | project.setProOrdPrice(decimal.multiply(new BigDecimal(s)).setScale(2)); |
| | | // project.setProPrice(decimal.setScale(2)); |
| | | project.setProPrice(decimal); |
| | | // project.setProOrdPrice(decimal.multiply(new BigDecimal(s)).setScale(2)); |
| | | project.setProOrdPrice(decimal); |
| | | }else { |
| | | project.setProPrice(new BigDecimal("0.00")); |
| | | project.setProOrdPrice(new BigDecimal("0.00")); |
| | | 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)); |
| | | } |
| | | }*/ |
| | | String s = tjFlowingWaterService.getDiscount(OrderId); |
| | | String pacId = transitionService.selectPacIdByTbTransitionTjNumAndProId(order.getTjNumber(), String.valueOf(project.getProId())); |
| | | if(null !=pacId){ |
| | | TjPackageProject pp = tjPackageProjectService.getOne(new LambdaQueryWrapper<TjPackageProject>().eq(TjPackageProject::getPacId, pacId) |
| | | .eq(TjPackageProject::getProId,String.valueOf(project.getProId()))); |
| | | if(null !=pp){ |
| | | project.setProPrice(pp.getPriceNow()); |
| | | project.setProOrdPrice(pp.getPriceNow().multiply(new BigDecimal(s))); |
| | | }else { |
| | | project.setProPrice(project.getProPrice().setScale(2)); |
| | | project.setProOrdPrice(project.getProPrice().multiply(new BigDecimal(s)).setScale(2)); |
| | | } |
| | | }else { |
| | | project.setProPrice(project.getProPrice().setScale(2)); |
| | | project.setProOrdPrice(project.getProPrice().multiply(new BigDecimal(s)).setScale(2)); |
| | | } |
| | | } |
| | | } |
| | |
| | | public AjaxResult getTjRefundProInfoVoList(@RequestParam @ApiParam(value = "体检订单id") String orderId) { |
| | | TjOrder tjOrder = orderService.getById(orderId); |
| | | if (null == tjOrder) return AjaxResult.error("该体检记录不存在"); |
| | | TjCustomer customer = customerService.getById(tjOrder.getUserId()); |
| | | // TjCustomer customer = customerService.getById(tjOrder.getUserId()); |
| | | if (tjOrder.getCheckStatus() == 0 && tjOrder.getReportTime() == null) { |
| | | LambdaQueryWrapper<TjOrderDetail> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjOrderDetail::getOrderId, orderId); |
| | |
| | | for (TjOrderDetail detail : detailList) { |
| | | TjProject project = projectService.getById(detail.getProId()); |
| | | if (project.getProParentId() == 0) { |
| | | LambdaQueryWrapper<TbTransition> wqq1 = new LambdaQueryWrapper<>(); |
| | | wqq1.eq(TbTransition::getCusId, customer.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, customer.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()); |
| | | // } |
| | | String s = tjFlowingWaterService.getDiscount(orderId); |
| | | String pacId = transitionService.selectPacIdByTbTransitionTjNumAndProId(tjOrder.getTjNumber(), String.valueOf(project.getProId())); |
| | | TjRefundProInfoVo proInfoVo = new TjRefundProInfoVo(); |
| | | // double discount = Double.parseDouble(tjFlowingWaterService.getById(detail.getFlowingWaterId()).getDiscount()); |
| | | //BigDecimal decimal = BigDecimal.valueOf(discount).divide(BigDecimal.valueOf(100)); |
| | | //proInfoVo.setNetReceipts(bigDecimal.multiply(decimal).setScale(2, BigDecimal.ROUND_DOWN)); |
| | | proInfoVo.setNetReceipts(bigDecimal); |
| | | |
| | | if(null !=pacId){ |
| | | TjPackageProject pp = tjPackageProjectService.getOne(new LambdaQueryWrapper<TjPackageProject>().eq(TjPackageProject::getPacId, pacId) |
| | | .eq(TjPackageProject::getProId,String.valueOf(project.getProId()))); |
| | | if(null !=pp){ |
| | | proInfoVo.setNetReceipts(pp.getPriceNow().multiply(new BigDecimal(s))); |
| | | proInfoVo.setPrice(pp.getPriceNow()); |
| | | }else { |
| | | proInfoVo.setNetReceipts(project.getProPrice().multiply(new BigDecimal(s))); |
| | | proInfoVo.setPrice(project.getProPrice()); |
| | | } |
| | | }else { |
| | | proInfoVo.setNetReceipts(project.getProPrice().multiply(new BigDecimal(s))); |
| | | proInfoVo.setPrice(project.getProPrice()); |
| | | } |
| | | proInfoVo.setCollectFeesTime(tjFlowingWaterService.getById(detail.getFlowingWaterId()).getUpdateTime()); |
| | | proInfoVo.setTollCollector(userService.getById(tjFlowingWaterService.getById(detail.getFlowingWaterId()).getTollCollectorId()).getNickName()); |
| | | proInfoVo.setProName(project.getProName()); |
| | | proInfoVo.setProId(String.valueOf(project.getProId())); |
| | | //proInfoVo.setPrice(project.getProPrice().setScale(2, BigDecimal.ROUND_DOWN)); |
| | | proInfoVo.setPrice(bigDecimal1); |
| | | tjRefundProInfoVoList.add(proInfoVo); |
| | | } |
| | | } |