| | |
| | | |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.applyRoomDiscount.ApplyRoomDiscountDto; |
| | | import com.java110.dto.room.ApplyRoomDiscountDto; |
| | | import com.java110.dto.fee.FeeDetailDto; |
| | | import com.java110.dto.fee.FeeDto; |
| | | import com.java110.dto.feeDiscount.ComputeDiscountDto; |
| | | import com.java110.dto.feeDiscount.FeeDiscountDto; |
| | | import com.java110.dto.feeDiscount.FeeDiscountRuleDto; |
| | | import com.java110.dto.feeDiscount.FeeDiscountSpecDto; |
| | | import com.java110.dto.payFeeConfigDiscount.PayFeeConfigDiscountDto; |
| | | import com.java110.dto.fee.ComputeDiscountDto; |
| | | import com.java110.dto.fee.FeeDiscountDto; |
| | | import com.java110.dto.fee.FeeDiscountRuleDto; |
| | | import com.java110.dto.fee.FeeDiscountSpecDto; |
| | | import com.java110.dto.payFee.PayFeeConfigDiscountDto; |
| | | import com.java110.fee.dao.IFeeDiscountServiceDao; |
| | | import com.java110.fee.discount.IComputeDiscount; |
| | | import com.java110.intf.fee.*; |
| | | import com.java110.po.feeDiscount.FeeDiscountPo; |
| | | import com.java110.po.fee.FeeDiscountPo; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.factory.ApplicationContextFactory; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.MoneyUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | payFeeConfigDiscountDto.setStatusCd("0"); |
| | | Date currentTime = new Date(); |
| | | payFeeConfigDiscountDto.setCurrentTime(currentTime); |
| | | //根据费用查询折扣 |
| | | //根据费用项查询折扣(该费用项下的所有折扣信息) |
| | | List<PayFeeConfigDiscountDto> payFeeConfigDiscountDtos = |
| | | payFeeConfigDiscountInnerServiceSMOImpl.queryPayFeeConfigDiscounts(payFeeConfigDiscountDto); |
| | | if (payFeeConfigDiscountDtos == null || payFeeConfigDiscountDtos.size() < 1) { |
| | |
| | | List<ComputeDiscountDto> computeDiscountDtoList = new ArrayList<>(); |
| | | for (ComputeDiscountDto computeDiscountDto : computeDiscountDtos) { |
| | | computeDiscountDto.setValue(value); |
| | | |
| | | computeDiscountDto.setDiscountPrice( |
| | | MoneyUtil.computePriceScale( |
| | | computeDiscountDto.getDiscountPrice(), |
| | | feeDtos.get(0).getScale(), |
| | | Integer.parseInt(feeDtos.get(0).getDecimalPlace()) |
| | | ) |
| | | ); |
| | | if (!StringUtil.isEmpty(computeDiscountDto.getDiscountType()) && "3003".equals(computeDiscountDto.getDiscountType())) { |
| | | computeDiscountDto.setArdId(feeDetailDto.getArdId()); |
| | | } |
| | |
| | | feeDiscountDto.setDiscountId(tmpPayFeeConfigDiscountDto.getDiscountId()); |
| | | //查询打折表 |
| | | List<FeeDiscountDto> feeDiscountInfo = BeanConvertUtil.covertBeanList(feeDiscountServiceDaoImpl.getFeeDiscountInfo(BeanConvertUtil.beanCovertMap(feeDiscountDto)), FeeDiscountDto.class); |
| | | Assert.listOnlyOne(feeDiscountInfo, "查询打折表错误!"); |
| | | //Assert.listOnlyOne(feeDiscountInfo, "查询打折表错误!"); |
| | | if(feeDiscountInfo == null || feeDiscountInfo.size() < 1){ |
| | | continue; |
| | | } |
| | | FeeDiscountRuleDto feeDiscountRuleDto = new FeeDiscountRuleDto(); |
| | | feeDiscountRuleDto.setRuleId(feeDiscountInfo.get(0).getRuleId()); |
| | | //查询打折规则表 |
| | | List<FeeDiscountRuleDto> feeDiscountRuleDtos = feeDiscountRuleInnerServiceSMOImpl.queryFeeDiscountRules(feeDiscountRuleDto); |
| | | Assert.listOnlyOne(feeDiscountRuleDtos, "查询打折规则表错误!"); |
| | | //Assert.listOnlyOne(feeDiscountRuleDtos, "查询打折规则表错误!"); |
| | | if(feeDiscountRuleDtos == null || feeDiscountRuleDtos.size() < 1){ |
| | | continue; |
| | | } |
| | | if (!StringUtil.isEmpty(feeDiscountRuleDtos.get(0).getBeanImpl()) && feeDiscountRuleDtos.get(0).getBeanImpl().equals("reductionMonthFeeRule")) { //赠送规则 |
| | | FeeDiscountSpecDto feeDiscountSpecDto = new FeeDiscountSpecDto(); |
| | | feeDiscountSpecDto.setDiscountId(tmpPayFeeConfigDiscountDto.getDiscountId()); |
| | |
| | | List<ComputeDiscountDto> computeDiscountDtoList = new ArrayList<>(); |
| | | for (ComputeDiscountDto computeDiscountDto : computeDiscountDtos) { |
| | | computeDiscountDto.setValue(value); |
| | | computeDiscountDto.setDiscountPrice( |
| | | MoneyUtil.computePriceScale( |
| | | computeDiscountDto.getDiscountPrice(), |
| | | feeDtos.get(0).getScale(), |
| | | Integer.parseInt(feeDtos.get(0).getDecimalPlace()) |
| | | ) |
| | | ); |
| | | if (!StringUtil.isEmpty(computeDiscountDto.getDiscountType()) && "3003".equals(computeDiscountDto.getDiscountType())) { |
| | | computeDiscountDto.setArdId(feeDetailDto.getArdId()); |
| | | } |