| | |
| | | private ISystemPriceCityService systemPriceCityService; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取正在进行中的订单 |
| | | * |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 推广订单支付成功回调 |
| | | * |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | private void promotion(Integer orderType,Integer orderId){ |
| | | switch (orderType){ |
| | | case 1: |
| | | orderPrivateCarService.promotion(orderId); |
| | | break; |
| | | case 2: |
| | | orderTaxiService.promotion(orderId); |
| | | break; |
| | | case 3: |
| | | orderCrossCityService.promotion(orderId); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/get/unPayOrder") |
| | | @ApiOperation(value = "获取未支付订单", tags = {"用户端-首页"}, notes = "") |
| | |
| | | @ApiImplicitParam(value = "ip地址", name = "registIp", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "登录端口-小程序传Applets", name = "loginType", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "当前定位区县行政编号", name = "registAreaCode", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "司机id", name = "driverId", required = false, dataType = "int"), |
| | | }) |
| | | public ResultUtil<LoginWarpper> captchaLogin(String phone, String code, String registIp, String registAreaCode,String loginType,String jsCode){ |
| | | public ResultUtil<LoginWarpper> captchaLogin(String phone, String code, String registIp, String registAreaCode,String loginType,String jsCode,Integer driverId){ |
| | | try { |
| | | return userInfoService.captchaLogin(phone, code, registIp, registAreaCode,loginType); |
| | | return userInfoService.captchaLogin(phone, code, registIp, registAreaCode,loginType,driverId); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | /** |
| | | * 推广订单 1否 2是 |
| | | */ |
| | | @TableField("promotion") |
| | | private Integer promotion; |
| | | |
| | | |
| | | /** |
| | | * 乘客反馈情况 |
| | | */ |
| | | @TableField("abnormalIntro") |
| | |
| | | @TableField("abnormalImg") |
| | | private String abnormalImg; |
| | | |
| | | private Integer promotionDriverId; |
| | | |
| | | private BigDecimal promotionMoney; |
| | | |
| | | private String splitAllocation; |
| | | |
| | | public Integer getPromotion() { |
| | | return promotion; |
| | | } |
| | | |
| | | public void setPromotion(Integer promotion) { |
| | | this.promotion = promotion; |
| | | } |
| | | |
| | | public Integer getPromotionDriverId() { |
| | | return promotionDriverId; |
| | | } |
| | | |
| | | public void setPromotionDriverId(Integer promotionDriverId) { |
| | | this.promotionDriverId = promotionDriverId; |
| | | } |
| | | |
| | | public BigDecimal getPromotionMoney() { |
| | | return promotionMoney; |
| | | } |
| | | |
| | | public void setPromotionMoney(BigDecimal promotionMoney) { |
| | | this.promotionMoney = promotionMoney; |
| | | } |
| | | |
| | | public Integer getAbnormal() { |
| | | return abnormal; |
| | | } |
| | |
| | | */ |
| | | void addAppeal(Integer uid, Integer orderId,String abnormalIntro, String abnormalImg); |
| | | |
| | | void promotion(Integer orderId); |
| | | |
| | | |
| | | } |
| | |
| | | private IRegionService regionService; |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private TDriverPromotionActivityService driverPromotionActivityService; |
| | | |
| | | |
| | | @Value("${callbackPath}") |
| | | private String callbackPath; |
| | | |
| | |
| | | // orderCrossCity.setTelX(map.get("telX")); |
| | | // orderCrossCity.setBindId(map.get("bindId")); |
| | | // } |
| | | |
| | | // 是否推广订单 |
| | | Integer promotion = isPromotion(uid); |
| | | orderCrossCity.setPromotion(promotion); |
| | | |
| | | this.insert(orderCrossCity); |
| | | |
| | | if (driver.getState() == 2) { |
| | |
| | | return ResultUtil.success(baseWarpper); |
| | | } |
| | | |
| | | private Integer isPromotion(Integer userId){ |
| | | UserInfo userInfo = userInfoService.selectById(userId); |
| | | if(userInfo.getBindDriverId()!=null && userInfo.getBindExpireDate().getTime()<=System.currentTimeMillis()){ |
| | | String registAreaCode = userInfo.getRegistAreaCode(); |
| | | TDriverPromotionActivity tDriverPromotionActivity = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("districtCode", registAreaCode).ge("startTime", new Date()).lt("endTime", new Date()).last("AND FIND_IN_SET(" + 3 + ", bizType) limit 1")); |
| | | if(tDriverPromotionActivity!=null){ |
| | | return 2; |
| | | } |
| | | } |
| | | return null; |
| | | |
| | | } |
| | | /** |
| | | * 获取订单 |
| | | * |
| | |
| | | orderCrossCity.setAbnormal(1); |
| | | this.baseMapper.updateById(orderCrossCity); |
| | | } |
| | | |
| | | @Override |
| | | public void promotion(Integer orderId) { |
| | | OrderCrossCity orderCrossCity = this.baseMapper.selectById(orderId); |
| | | UserInfo userInfo = userInfoService.selectById(orderCrossCity.getUserId()); |
| | | if(userInfo.getBindDriverId()!=null && userInfo.getBindExpireDate().getTime()<=System.currentTimeMillis()){ |
| | | String registAreaCode = userInfo.getRegistAreaCode(); |
| | | TDriverPromotionActivity tDriverPromotionActivity = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("districtCode", registAreaCode).ge("startTime", new Date()).lt("endTime", new Date()).last("AND FIND_IN_SET(" + 3 + ", bizType) limit 1")); |
| | | if(tDriverPromotionActivity!=null){ |
| | | Double payMoney = orderCrossCity.getPayMoney(); |
| | | BigDecimal bigDecimal = tDriverPromotionActivity.getCommissionRatio().divide(new BigDecimal(100), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(payMoney)).setScale(2, RoundingMode.HALF_UP); |
| | | orderCrossCity.setPromotionDriverId(userInfo.getBindDriverId()); |
| | | orderCrossCity.setPromotionMoney(bigDecimal); |
| | | this.baseMapper.updateById(orderCrossCity); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | private Integer abnormal; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 推广订单 1否 2是 |
| | | */ |
| | | @TableField("promotion") |
| | | private Integer promotion; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 乘客反馈情况 |
| | | */ |
| | |
| | | @TableField("abnormalImg") |
| | | private String abnormalImg; |
| | | |
| | | |
| | | private Integer promotionDriverId; |
| | | |
| | | private BigDecimal promotionMoney; |
| | | |
| | | |
| | | |
| | | private Integer totalPeopleNum; |
| | | /** |
| | | * 预估里程(米) |
| | |
| | | |
| | | private String splitAllocation; |
| | | |
| | | public Integer getPromotion() { |
| | | return promotion; |
| | | } |
| | | |
| | | public void setPromotion(Integer promotion) { |
| | | this.promotion = promotion; |
| | | } |
| | | |
| | | public Integer getPromotionDriverId() { |
| | | return promotionDriverId; |
| | | } |
| | | |
| | | public void setPromotionDriverId(Integer promotionDriverId) { |
| | | this.promotionDriverId = promotionDriverId; |
| | | } |
| | | |
| | | public BigDecimal getPromotionMoney() { |
| | | return promotionMoney; |
| | | } |
| | | |
| | | public void setPromotionMoney(BigDecimal promotionMoney) { |
| | | this.promotionMoney = promotionMoney; |
| | | } |
| | | |
| | | public Integer getAbnormal() { |
| | | return abnormal; |
| | | } |
| | |
| | | */ |
| | | void addAppeal(Integer uid, Integer orderId,String abnormalIntro, String abnormalImg); |
| | | |
| | | void promotion(Integer orderId); |
| | | |
| | | } |
| | |
| | | @Autowired |
| | | private AppOrderController appOrderController; |
| | | |
| | | @Autowired |
| | | private TDriverPromotionActivityService driverPromotionActivityService; |
| | | |
| | | /** |
| | | * 专车下单操作 |
| | | * |
| | |
| | | orderPrivateCar.setTotalPeopleNum(peopleNum); |
| | | orderPrivateCar.setIsReassign(1); |
| | | orderPrivateCar.setIsDelete(1); |
| | | |
| | | // 是否推广订单 |
| | | Integer promotion = isPromotion(uid); |
| | | orderPrivateCar.setPromotion(promotion); |
| | | |
| | | |
| | | this.insert(orderPrivateCar); |
| | | |
| | | //判断独享,一口价,拼车 |
| | |
| | | } |
| | | return ResultUtil.success(baseWarpper); |
| | | } |
| | | |
| | | |
| | | private Integer isPromotion(Integer userId){ |
| | | UserInfo userInfo = userInfoService.selectById(userId); |
| | | if(userInfo.getBindDriverId()!=null && userInfo.getBindExpireDate().getTime()<=System.currentTimeMillis()){ |
| | | String registAreaCode = userInfo.getRegistAreaCode(); |
| | | TDriverPromotionActivity tDriverPromotionActivity = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("districtCode", registAreaCode).ge("startTime", new Date()).lt("endTime", new Date()).last("AND FIND_IN_SET(" + 1 + ", bizType) limit 1")); |
| | | if(tDriverPromotionActivity!=null){ |
| | | return 2; |
| | | } |
| | | } |
| | | return null; |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 下单后继续等待 |
| | |
| | | this.baseMapper.updateById(orderPrivateCar); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void promotion(Integer orderId) { |
| | | OrderPrivateCar orderPrivateCar = this.baseMapper.selectById(orderId); |
| | | UserInfo userInfo = userInfoService.selectById(orderPrivateCar.getUserId()); |
| | | if(userInfo.getBindDriverId()!=null && userInfo.getBindExpireDate().getTime()<=System.currentTimeMillis()){ |
| | | String registAreaCode = userInfo.getRegistAreaCode(); |
| | | TDriverPromotionActivity tDriverPromotionActivity = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("districtCode", registAreaCode).ge("startTime", new Date()).lt("endTime", new Date()).last("AND FIND_IN_SET(" + 1 + ", bizType) limit 1")); |
| | | if(tDriverPromotionActivity!=null){ |
| | | Double payMoney = orderPrivateCar.getPayMoney(); |
| | | BigDecimal bigDecimal = tDriverPromotionActivity.getCommissionRatio().divide(new BigDecimal(100), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(payMoney)).setScale(2, RoundingMode.HALF_UP); |
| | | orderPrivateCar.setPromotionDriverId(userInfo.getBindDriverId()); |
| | | orderPrivateCar.setPromotionMoney(bigDecimal); |
| | | this.baseMapper.updateById(orderPrivateCar); |
| | | } |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.stylefeng.guns.modular.system.model.TDriverPromotionActivity; |
| | | |
| | | /** |
| | | * <p> |
| | | * 司机推广活动主表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2025-07-23 |
| | | */ |
| | | public interface TDriverPromotionActivityMapper extends BaseMapper<TDriverPromotionActivity> { |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.stylefeng.guns.modular.system.dao.TDriverPromotionActivityMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 司机推广活动主表 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2025-07-23 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_driver_promotion_activity") |
| | | public class TDriverPromotionActivity extends Model<TDriverPromotionActivity> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 推广活动ID |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * 关联业务:1-专车/2-出租车/3-城际/4-顺风车/5-代驾 |
| | | */ |
| | | private String bizType; |
| | | /** |
| | | * 推广活动标题 |
| | | */ |
| | | private String activityTitle; |
| | | /** |
| | | * 活动区域-省 |
| | | */ |
| | | private String province; |
| | | /** |
| | | * 省code |
| | | */ |
| | | private String provinceCode; |
| | | /** |
| | | * 活动区域-市 |
| | | */ |
| | | private String city; |
| | | /** |
| | | * 市code |
| | | */ |
| | | private String cityCode; |
| | | /** |
| | | * 活动区域-区/县 |
| | | */ |
| | | private String district; |
| | | /** |
| | | * 区code |
| | | */ |
| | | private String districtCode; |
| | | /** |
| | | * 活动开始时间 |
| | | */ |
| | | private Date startTime; |
| | | /** |
| | | * 活动结束时间 |
| | | */ |
| | | private Date endTime; |
| | | /** |
| | | * 抽佣比例(如 10.00 代表 10%) |
| | | */ |
| | | private BigDecimal commissionRatio; |
| | | /** |
| | | * 司机乘客绑定有效期(天) |
| | | */ |
| | | private Integer bindingDays; |
| | | /** |
| | | * 推广活动说明 |
| | | */ |
| | | private String activityDesc; |
| | | /** |
| | | * 状态:1-未开始 2-进行中 3-已结束 |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private String creator; |
| | | private Date createTime; |
| | | private Date updateTime; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
| | |
| | | @TableField("state") |
| | | private Integer state; |
| | | |
| | | |
| | | /** |
| | | * 绑定的司机id |
| | | */ |
| | | @TableField("bindDriverId") |
| | | private Integer bindDriverId; |
| | | |
| | | /** |
| | | * 绑定司机有效期 |
| | | */ |
| | | |
| | | private Date bindExpireDate; |
| | | |
| | | public Integer getBindDriverId() { |
| | | return bindDriverId; |
| | | } |
| | | |
| | | public void setBindDriverId(Integer bindDriverId) { |
| | | this.bindDriverId = bindDriverId; |
| | | } |
| | | |
| | | public Date getBindExpireDate() { |
| | | return bindExpireDate; |
| | | } |
| | | |
| | | public void setBindExpireDate(Date bindExpireDate) { |
| | | this.bindExpireDate = bindExpireDate; |
| | | } |
| | | |
| | | public String getRegistIp() { |
| | | return registIp; |
| | | } |
| | |
| | | * @param code |
| | | * @return |
| | | */ |
| | | ResultUtil<LoginWarpper> captchaLogin(String phone, String code, String registIp, String registAreaCode,String loginType) throws Exception; |
| | | ResultUtil<LoginWarpper> captchaLogin(String phone, String code, String registIp, String registAreaCode,String loginType,Integer driverId) throws Exception; |
| | | |
| | | /** |
| | | * 手机一键登录 |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.TDriverPromotionActivity; |
| | | |
| | | /** |
| | | * <p> |
| | | * 司机推广活动主表 服务类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2025-07-23 |
| | | */ |
| | | public interface TDriverPromotionActivityService extends IService<TDriverPromotionActivity> { |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.TDriverPromotionActivityMapper; |
| | | import com.stylefeng.guns.modular.system.model.TDriverPromotionActivity; |
| | | import com.stylefeng.guns.modular.system.service.TDriverPromotionActivityService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 司机推广活动主表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2025-07-23 |
| | | */ |
| | | @Service |
| | | public class TDriverPromotionActivityServiceImpl extends ServiceImpl<TDriverPromotionActivityMapper, TDriverPromotionActivity> implements TDriverPromotionActivityService { |
| | | |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.taxi.model.PaymentRecord; |
| | | import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService; |
| | | import com.stylefeng.guns.modular.taxi.service.ITransactionDetailsService; |
| | | import org.apache.commons.lang.time.DateUtils; |
| | | import org.apache.shiro.authc.SimpleAuthenticationInfo; |
| | | import org.apache.shiro.authc.UsernamePasswordToken; |
| | | import org.apache.shiro.authc.credential.HashedCredentialsMatcher; |
| | |
| | | import java.net.URLConnection; |
| | | import java.security.spec.AlgorithmParameterSpec; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.concurrent.locks.Lock; |
| | |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | |
| | | @Autowired |
| | | private TDriverPromotionActivityService driverPromotionActivityService; |
| | | |
| | | @Value("${callbackPath}") |
| | | private String callbackPath; |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public synchronized ResultUtil<LoginWarpper> captchaLogin(String phone, String code, String registIp, String registAreaCode,String loginType) throws Exception { |
| | | public synchronized ResultUtil<LoginWarpper> captchaLogin(String phone, String code, String registIp, String registAreaCode,String loginType,Integer driverId) throws Exception { |
| | | UserInfo userInfo = userInfoMapper.queryByPhone(phone); |
| | | String nickName = null; |
| | | if (null == userInfo) { |
| | |
| | | }else { |
| | | userInfo.setCompanyId(1); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 是否需要绑定司机 |
| | | TDriverPromotionActivity tDriverPromotionActivity = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("districtCode", registAreaCode).ge("startTime", new Date()).lt("endTime", new Date()).last(" limit 1")); |
| | | if(tDriverPromotionActivity!=null){ |
| | | Integer bindingDays = tDriverPromotionActivity.getBindingDays(); |
| | | // 当前时间+绑定天数 |
| | | Date endTime = DateUtils.addDays(new Date(), bindingDays); |
| | | userInfo.setBindDriverId(driverId); |
| | | userInfo.setBindExpireDate(endTime); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | this.insert(userInfo); |
| | | |
| | | this.addCoupon(userInfo);//添加优惠券 |
| | |
| | | } |
| | | @Override |
| | | public synchronized ResultUtil<LoginWarpper> captchaLogin(String phone, String code, Integer uid, Integer type, Integer userType,String loginType) throws Exception { |
| | | ResultUtil<LoginWarpper> resultUtil = this.captchaLogin(phone, code, null, null,loginType); |
| | | ResultUtil<LoginWarpper> resultUtil = this.captchaLogin(phone, code, null, null,loginType,null); |
| | | if(resultUtil.getCode() == 200 && null != uid){ |
| | | if(type == 2){//司机分享 |
| | | Driver driver = driverMapper.selectById(uid); |
| | |
| | | if(null == userInfo){ |
| | | return ResultUtil.error("获取用户信息失败"); |
| | | } |
| | | return this.captchaLogin(userInfo.get("phone"), "1234", null, registAreaCode, loginType); |
| | | return this.captchaLogin(userInfo.get("phone"), "1234", null, registAreaCode, loginType,null); |
| | | }else{ |
| | | return ResultUtil.error(jsonObject.getString("msg")); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.stylefeng.guns.modular.system.model.BaseBean; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | @TableField("abnormalImg") |
| | | private String abnormalImg; |
| | | |
| | | |
| | | private Integer promotionDriverId; |
| | | |
| | | private BigDecimal promotionMoney; |
| | | |
| | | |
| | | private String splitAllocation; |
| | | |
| | | public Integer getPromotionDriverId() { |
| | | return promotionDriverId; |
| | | } |
| | | |
| | | public void setPromotionDriverId(Integer promotionDriverId) { |
| | | this.promotionDriverId = promotionDriverId; |
| | | } |
| | | |
| | | public BigDecimal getPromotionMoney() { |
| | | return promotionMoney; |
| | | } |
| | | |
| | | public void setPromotionMoney(BigDecimal promotionMoney) { |
| | | this.promotionMoney = promotionMoney; |
| | | } |
| | | |
| | | public Integer getAbnormal() { |
| | | return abnormal; |
| | |
| | | * @param orderId |
| | | */ |
| | | void addAppeal(Integer uid, Integer orderId,String abnormalIntro, String abnormalImg); |
| | | |
| | | void promotion(Integer orderId); |
| | | |
| | | } |
| | |
| | | private String callbackPath; |
| | | |
| | | |
| | | @Autowired |
| | | private TDriverPromotionActivityService driverPromotionActivityService; |
| | | /** |
| | | * 出租车下单操作 |
| | | * |
| | |
| | | orderTaxi.setAbnormal(1); |
| | | this.baseMapper.updateById(orderTaxi); |
| | | } |
| | | |
| | | @Override |
| | | public void promotion(Integer orderId) { |
| | | OrderTaxi orderTaxi = this.baseMapper.selectById(orderId); |
| | | UserInfo userInfo = userInfoService.selectById(orderTaxi.getUserId()); |
| | | if(userInfo.getBindDriverId()!=null && userInfo.getBindExpireDate().getTime()<=System.currentTimeMillis()){ |
| | | String registAreaCode = userInfo.getRegistAreaCode(); |
| | | TDriverPromotionActivity tDriverPromotionActivity = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("districtCode", registAreaCode).ge("startTime", new Date()).lt("endTime", new Date()).last("AND FIND_IN_SET(" + 2 + ", bizType) limit 1")); |
| | | if(tDriverPromotionActivity!=null){ |
| | | Double payMoney = orderTaxi.getPayMoney(); |
| | | BigDecimal bigDecimal = tDriverPromotionActivity.getCommissionRatio().divide(new BigDecimal(100), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(payMoney)).setScale(2, RoundingMode.HALF_UP); |
| | | orderTaxi.setPromotionDriverId(userInfo.getBindDriverId()); |
| | | orderTaxi.setPromotionMoney(bigDecimal); |
| | | this.baseMapper.updateById(orderTaxi); |
| | | } |
| | | } |
| | | } |
| | | } |