平台服务费
This commit is contained in:
		
							parent
							
								
									089c60e15c
								
							
						
					
					
						commit
						578c481d9c
					
				|  | @ -61,4 +61,7 @@ public class RlAgent extends BaseEntity | |||
|     @Excel(name = "是否免费送取车") | ||||
|     private Boolean isFreeCar; | ||||
| 
 | ||||
|     /** 服务费比例 */ | ||||
|     @Excel(name = "服务费比例") | ||||
|     private BigDecimal serviceFeeProportion; | ||||
| } | ||||
|  |  | |||
|  | @ -176,7 +176,8 @@ public class CallbackServiceImpl implements CallbackService { | |||
|             } | ||||
|             /** 计算分成金额更新分成状态 */ | ||||
|             logger.info("=================1111111111111111111111111=================="); | ||||
|             BigDecimal totalDividendAmount = originalOrder.getLeaseFee().add(originalOrder.getOverdueFee()); | ||||
|             // 扣除掉平台服务费的金额 | ||||
|             BigDecimal totalDividendAmount = originalOrder.getLeaseFee().add(originalOrder.getOverdueFee()).subtract(originalOrder.getPlatformServiceFee()); | ||||
|             logger.info("=================2222222222222222222222222=================="); | ||||
|             List<RlDividendDetailVO> rlDividendDetailVOS = dividendDetailService.selectRlDividendDetailListByOrderNo(originalOrder.getOrderNo()); | ||||
|             logger.info("=================3333333333333333333333333=================="); | ||||
|  |  | |||
|  | @ -403,6 +403,16 @@ public class RlOrderServiceImpl implements IRlOrderService | |||
|         if(ObjectUtil.isNotNull(rlModelVO)){ | ||||
|             order.setModel(rlModelVO.getModel()); | ||||
|         } | ||||
|         //先计算平台服务费,再将扣除掉平台服务费订单金额拿去分成 | ||||
|         RlAgentVO rlAgentVO = agentService.selectRlAgentByAgentId(order.getAgentId()); | ||||
|         if(ObjectUtil.isNull(rlAgentVO)){ | ||||
|             throw new ServiceException("根据agentId【"+order.getAgentId()+"】代理商不存在"); | ||||
|         } | ||||
|         BigDecimal serviceFee = rlAgentVO.getServiceFeeProportion() | ||||
|                 .multiply(order.getPayFee()) | ||||
|                 .setScale(2, RoundingMode.HALF_UP);// 服务费 = 48 * 0.05 = 2.4 | ||||
|         order.setPlatformServiceFee(serviceFee); | ||||
|         logger.info("计算出平台服务费:{}",serviceFee); | ||||
|         /** 记录分成比例,状态为未出账 */ | ||||
|         int i1 = dividendDetailService.calculationDividend(order,ServiceConstants.USER_TYPE_MERCHANT); | ||||
|         if (i1 < 1) { | ||||
|  |  | |||
|  | @ -7,7 +7,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
|     <resultMap type="RlAgentVO" id="RlAgentResult" autoMapping="true" /> | ||||
| 
 | ||||
|     <sql id="selectRlAgentVo"> | ||||
|         select a.agent_id, a.name, a.service_phone, a.dispatch_fee, a.delivery_fee, a.city_id, a.contact, a.phone, a.userid, a.pay_channel, a.is_free_car,c.name cityName | ||||
|         select a.agent_id, a.name, a.service_phone, a.dispatch_fee, a.delivery_fee, a.city_id, a.contact, | ||||
|                a.phone, a.userid, a.pay_channel, a.is_free_car,c.name,a.service_fee_proportion cityName | ||||
|         from rl_agent a | ||||
|         left join rl_city c on c.city_id = a.city_id | ||||
|     </sql> | ||||
|  | @ -56,6 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
|             <if test="userid != null">userid,</if> | ||||
|             <if test="payChannel != null">pay_channel,</if> | ||||
|             <if test="isFreeCar != null">is_free_car,</if> | ||||
|             <if test="serviceFeeProportion != null">service_fee_proportion,</if> | ||||
|          </trim> | ||||
|         <trim prefix="values (" suffix=")" suffixOverrides=","> | ||||
|             <if test="name != null">#{name},</if> | ||||
|  | @ -68,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
|             <if test="userid != null">#{userid},</if> | ||||
|             <if test="payChannel != null">#{payChannel},</if> | ||||
|             <if test="isFreeCar != null">#{isFreeCar},</if> | ||||
|             <if test="serviceFeeProportion != null">#{serviceFeeProportion},</if> | ||||
|          </trim> | ||||
|     </insert> | ||||
| 
 | ||||
|  | @ -84,6 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
|             <if test="userid != null">userid = #{userid},</if> | ||||
|             <if test="payChannel != null">pay_channel = #{payChannel},</if> | ||||
|             <if test="isFreeCar != null">is_free_car = #{isFreeCar},</if> | ||||
|             <if test="serviceFeeProportion != null">service_fee_proportion = #{serviceFeeProportion},</if> | ||||
|         </trim> | ||||
|         where agent_id = #{agentId} | ||||
|     </update> | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user