| | |
| | | transitionService.saveRedisTransitionByPacId(cusId, cardId, pacId); |
| | | |
| | | //补差价 |
| | | List<Map<String, Object>> cjMaps = groupingProService.huoquxiangmuchajia(pacId.toString(), cusId); |
| | | List<Map<String, Object>> cjMaps = transitionService.addTbhuoquxiangmuchajia(pacId.toString(), cusId); |
| | | if (null != cjMaps && !cjMaps.isEmpty()) { |
| | | log.info("该套餐"+pacId+"中有差价:"+cjMaps.size()+"个"); |
| | | for (Map<String, Object> cjMap : cjMaps) { |
| | | log.info("添加临时表套餐数据时所选的差价为:"+ cjMap.get("cj").toString()); |
| | | transitionService.buxiangmuchajia(cusId, pacId.toString(), cjMap.get("xmid").toString(), new BigDecimal(cjMap.get("cj").toString())); |
| | | } |
| | | } |
| | |
| | | log.info("前端传递的价格:{}",yhj.toString()); |
| | | BigDecimal cj = yhj.subtract(dxzj); |
| | | log.info("计算的差价:{}",cj.toString()); |
| | | // int index1 = 0; |
| | | for (TbTransition transition : list) { |
| | | // BigDecimal ordPrice = transition.getOrdPrice(); |
| | | // BigDecimal multiply = ordPrice.multiply((new BigDecimal(dto.getDiscount()).divide(BigDecimal.valueOf(10)))); |
| | | BigDecimal result = transition.getNowPrice().add(cj); |
| | | log.info("补上差价前的价格为:{}",transition.getNowPrice().toString()); |
| | | if (result.compareTo(BigDecimal.ZERO)>0 && !flag && cj.compareTo(BigDecimal.ZERO) != 0){ |
| | |
| | | flag = true; |
| | | break; |
| | | } |
| | | // if (index1 == 0 ){ |
| | | // log.info("修改小项 {}{} 原本价格:{}",transition.getProId(),transition.getProName(),multiply.toString()); |
| | | // multiply = multiply.add(cj); |
| | | // log.info("增加差价后:{}",multiply.toString()); |
| | | // } |
| | | // index1++; |
| | | // log.info("后端计算的金额: " + multiply.toString()); |
| | | //// log.info("前端传递的金额: " + dto.getYhj()); |
| | | // transition.setNowPrice(multiply); |
| | | // transition.setDiscount(new BigDecimal(dto.getDiscount())); |
| | | // transitionService.updateById(transition); |
| | | } |
| | | |
| | | // log.info("dxzj:{}",dxzj.toString()); |
| | | // if (index == dtos.size()){ |
| | | // BigDecimal yhj = dto.getYhj(); |
| | | // log.info("前端传递的价格:{}",yhj.toString()); |
| | | // BigDecimal cj = yhj.subtract(dxzj); |
| | | // log.info("计算的差价:{}",cj.toString()); |
| | | // int index1 = 0; |
| | | // for (TbTransition transition : list) { |
| | | // BigDecimal ordPrice = transition.getOrdPrice(); |
| | | // BigDecimal multiply = ordPrice.multiply((new BigDecimal(dto.getDiscount()).divide(BigDecimal.valueOf(10)))); |
| | | // if (index1 == 0 ){ |
| | | // log.info("修改小项 {}{} 原本价格:{}",transition.getProId(),transition.getProName(),multiply.toString()); |
| | | // multiply = multiply.add(cj); |
| | | // log.info("增加差价后:{}",multiply.toString()); |
| | | // } |
| | | // index1++; |
| | | // log.info("后端计算的金额: " + multiply.toString()); |
| | | //// log.info("前端传递的金额: " + dto.getYhj()); |
| | | // transition.setNowPrice(multiply); |
| | | // transition.setDiscount(new BigDecimal(dto.getDiscount())); |
| | | // transitionService.updateById(transition); |
| | | // } |
| | | // }else { |
| | | // for (TbTransition transition : list) { |
| | | // BigDecimal ordPrice = transition.getOrdPrice(); |
| | | // BigDecimal multiply = ordPrice.multiply((new BigDecimal(dto.getDiscount()).divide(BigDecimal.valueOf(10)))); |
| | | // log.info("后端计算的金额: " + multiply.toString()); |
| | | //// log.info("前端传递的金额: " + dto.getYhj()); |
| | | // transition.setNowPrice(multiply); |
| | | // transition.setDiscount(new BigDecimal(dto.getDiscount())); |
| | | // transitionService.updateById(transition); |
| | | // } |
| | | //// if (null != dto.getYhj() && dto.getYhj().compareTo(BigDecimal.ZERO) >= 0) { |
| | | //// List<TbTransition> transitionList = list.stream().filter(a -> |
| | | //// transitionService.getTbTransitionPriceAndOrdPrice(dto.getCusIdCard(), dto.getParentProId()).subtract(dto.getYhj()).compareTo(BigDecimal.ZERO) >= 0).collect(Collectors.toList()); |
| | | //// if (!transitionList.isEmpty()) { |
| | | //// TbTransition tbTransition = transitionList.get(0); |
| | | //// tbTransition.setNowPrice(dxzj); |
| | | //// transitionService.updateById(tbTransition); |
| | | //// } |
| | | //// } |
| | | // } |
| | | } |
| | | } |
| | | } |