1. 实名判断
2. 骑行费用为0则直接改已支付 3. 押金充值也要加运营区id 4. 改成立即分账
This commit is contained in:
parent
5172cb184b
commit
11fd8fa493
|
@ -144,6 +144,10 @@ public class AppVerifyController extends BaseController
|
||||||
if(order.getRuleId()==null){
|
if(order.getRuleId()==null){
|
||||||
return error("=============================================ruleId未传!!!=============================================");
|
return error("=============================================ruleId未传!!!=============================================");
|
||||||
}
|
}
|
||||||
|
//实名判断
|
||||||
|
if(!asUserService.checkIsAuthentication(order.getUserId())){
|
||||||
|
return error("您还未实名,请先实名");
|
||||||
|
}
|
||||||
//运营时间判断
|
//运营时间判断
|
||||||
if(!asDeviceService.isOperatingTime(order.getSn())){
|
if(!asDeviceService.isOperatingTime(order.getSn())){
|
||||||
return error("不在营业时间内,不得骑行");
|
return error("不在营业时间内,不得骑行");
|
||||||
|
@ -643,6 +647,7 @@ public class AppVerifyController extends BaseController
|
||||||
asUser.setUserId(authenticationVo.getUserId());
|
asUser.setUserId(authenticationVo.getUserId());
|
||||||
asUser.setRealName(authenticationVo.getRealName());
|
asUser.setRealName(authenticationVo.getRealName());
|
||||||
asUser.setIdCard(authenticationVo.getIdCard());
|
asUser.setIdCard(authenticationVo.getIdCard());
|
||||||
|
asUser.setIsAuthentication(ServiceConstants.IS_AUTHENTICATION_YES);
|
||||||
int updateUser = asUserService.updateUser(asUser);
|
int updateUser = asUserService.updateUser(asUser);
|
||||||
if(updateUser==0){
|
if(updateUser==0){
|
||||||
throw new ServiceException("【实名认证】保存身份信息失败");
|
throw new ServiceException("【实名认证】保存身份信息失败");
|
||||||
|
|
|
@ -105,6 +105,11 @@ public class ServiceConstants {
|
||||||
*/
|
*/
|
||||||
public static final String PAY_TYPE_WX = "wx";
|
public static final String PAY_TYPE_WX = "wx";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付方式: sys-系统 免费骑行时,订单金额为0
|
||||||
|
*/
|
||||||
|
public static final String PAY_TYPE_SYS = "sys";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付方式: alipay-支付宝
|
* 支付方式: alipay-支付宝
|
||||||
*/
|
*/
|
||||||
|
@ -454,4 +459,13 @@ public class ServiceConstants {
|
||||||
public static final String AREA_TIME_CUSTOM= "2";
|
public static final String AREA_TIME_CUSTOM= "2";
|
||||||
|
|
||||||
/**----------------------------运营时间end----------------------------*/
|
/**----------------------------运营时间end----------------------------*/
|
||||||
|
|
||||||
|
/**----------------------------是否已实名start----------------------------*/
|
||||||
|
|
||||||
|
/** 是否认证:0-未认证;1-已认证 */
|
||||||
|
public static final String IS_AUTHENTICATION_NO = "0";
|
||||||
|
|
||||||
|
public static final String IS_AUTHENTICATION_YES = "1";
|
||||||
|
/**----------------------------是否已实名start----------------------------*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,6 +106,17 @@ public class AsUser extends BaseEntity
|
||||||
/** 运营区id */
|
/** 运营区id */
|
||||||
private Long areaId;
|
private Long areaId;
|
||||||
|
|
||||||
|
/** 是否认证:0-未认证;1-已认证 */
|
||||||
|
public String isAuthentication;
|
||||||
|
|
||||||
|
public String getIsAuthentication() {
|
||||||
|
return isAuthentication;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsAuthentication(String isAuthentication) {
|
||||||
|
this.isAuthentication = isAuthentication;
|
||||||
|
}
|
||||||
|
|
||||||
public Long getAreaId() {
|
public Long getAreaId() {
|
||||||
return areaId;
|
return areaId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,9 @@ public class EtOrderVo {
|
||||||
/** 备注 */
|
/** 备注 */
|
||||||
private String mark;
|
private String mark;
|
||||||
|
|
||||||
|
/** 区域id */
|
||||||
|
private Long areaId;
|
||||||
|
|
||||||
// /** 是否预约 */
|
// /** 是否预约 */
|
||||||
// private Boolean isAppointment;
|
// private Boolean isAppointment;
|
||||||
}
|
}
|
||||||
|
|
|
@ -217,4 +217,11 @@ public interface IAsUserService
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Object authentication(AuthenticationVo authenticationVo);
|
Object authentication(AuthenticationVo authenticationVo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检测用户是否实名认证
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean checkIsAuthentication(Long userId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -931,13 +931,6 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
||||||
AsDevice device = asDeviceMapper.selectAsDeviceBySn(order.getSn());
|
AsDevice device = asDeviceMapper.selectAsDeviceBySn(order.getSn());
|
||||||
/** 2. 车辆远程关锁*/
|
/** 2. 车辆远程关锁*/
|
||||||
sendCommand(device.getMac(), token,IotConstants.COMMAND_CLOSE,"还车关锁");
|
sendCommand(device.getMac(), token,IotConstants.COMMAND_CLOSE,"还车关锁");
|
||||||
//间隔1秒
|
|
||||||
// try {
|
|
||||||
// Thread.sleep(500);
|
|
||||||
// } catch (InterruptedException ex) {
|
|
||||||
// ex.printStackTrace();
|
|
||||||
// }
|
|
||||||
// sendCommand(device.getMac(), token,IotConstants.COMMAND_PLAY8,"还车关锁播报");
|
|
||||||
/** 4. 更新车辆状态*/
|
/** 4. 更新车辆状态*/
|
||||||
device.setStatus(ServiceConstants.VEHICLE_STATUS_NORMAL);
|
device.setStatus(ServiceConstants.VEHICLE_STATUS_NORMAL);
|
||||||
device.setLockStatus(ServiceConstants.LOCK_STATUS_CLOSE);
|
device.setLockStatus(ServiceConstants.LOCK_STATUS_CLOSE);
|
||||||
|
|
|
@ -520,4 +520,15 @@ public class AsUserServiceImpl implements IAsUserService
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检测是否实名认证
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean checkIsAuthentication(Long userId) {
|
||||||
|
if(asUserMapper.selectUserById(userId).getIsAuthentication().equals("1")){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,9 +88,6 @@ public class CallbackServiceImpl implements CallbackService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IEtCapitalFlowService etCapitalFlowService;
|
private IEtCapitalFlowService etCapitalFlowService;
|
||||||
|
|
||||||
@Value("${et.handlingCharge}")
|
|
||||||
private String handlingCharge;
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private SysUserMapper userMapper;
|
private SysUserMapper userMapper;
|
||||||
|
|
||||||
|
@ -103,6 +100,12 @@ public class CallbackServiceImpl implements CallbackService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ScheduledExecutorService scheduledExecutorService;
|
private ScheduledExecutorService scheduledExecutorService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEtDividendDetailService dividendDetailService;
|
||||||
|
|
||||||
|
@Value("${et.handlingCharge}")
|
||||||
|
private String handlingCharge;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信支付回调
|
* 微信支付回调
|
||||||
|
@ -196,9 +199,6 @@ public class CallbackServiceImpl implements CallbackService {
|
||||||
}
|
}
|
||||||
}, autoRefundDeposit, TimeUnit.HOURS);
|
}, autoRefundDeposit, TimeUnit.HOURS);
|
||||||
}
|
}
|
||||||
logger.info("=================【微信支付回调】10秒后开始请求分账==================");
|
|
||||||
// 30秒后请求分账
|
|
||||||
scheduledExecutorService.schedule(() -> {
|
|
||||||
logger.info("=================【微信支付回调】开始请求分账==================");
|
logger.info("=================【微信支付回调】开始请求分账==================");
|
||||||
logger.info("区域对象====="+JSON.toJSONString(area));
|
logger.info("区域对象====="+JSON.toJSONString(area));
|
||||||
logger.info("订单对象====="+JSON.toJSONString(order));
|
logger.info("订单对象====="+JSON.toJSONString(order));
|
||||||
|
@ -211,6 +211,7 @@ public class CallbackServiceImpl implements CallbackService {
|
||||||
List<SysUser> sysUsers = userMapper.selectUserList(sysUser);
|
List<SysUser> sysUsers = userMapper.selectUserList(sysUser);
|
||||||
|
|
||||||
for (SysUser sysUser1 : sysUsers){
|
for (SysUser sysUser1 : sysUsers){
|
||||||
|
EtDividendDetail etDividendDetail = new EtDividendDetail();
|
||||||
AsUser asUser1 = asUserMapper.selectUserById(sysUser1.getAppUserId());
|
AsUser asUser1 = asUserMapper.selectUserById(sysUser1.getAppUserId());
|
||||||
if(asUser1!=null && asUser1.getWxopenid()!=null){
|
if(asUser1!=null && asUser1.getWxopenid()!=null){
|
||||||
BigDecimal dividendAmount = BigDecimal.ZERO;
|
BigDecimal dividendAmount = BigDecimal.ZERO;
|
||||||
|
@ -234,8 +235,22 @@ public class CallbackServiceImpl implements CallbackService {
|
||||||
BigDecimal multiply = dividendAmount.multiply(divide);
|
BigDecimal multiply = dividendAmount.multiply(divide);
|
||||||
logger.info(sysUser1.getUserName()+"分账比例:"+sysUser1.getDividendProportion()+"%,分账金额:"+multiply);
|
logger.info(sysUser1.getUserName()+"分账比例:"+sysUser1.getDividendProportion()+"%,分账金额:"+multiply);
|
||||||
receiver.setAmount(multiply.multiply(new BigDecimal(100)).longValue());
|
receiver.setAmount(multiply.multiply(new BigDecimal(100)).longValue());
|
||||||
receiver.setDescription("系统自动分账");
|
receiver.setDescription(area.getAreaName()+"共享电动车自动分账");
|
||||||
receivers.add(receiver);
|
receivers.add(receiver);
|
||||||
|
|
||||||
|
etDividendDetail.setAreaId(area.getAreaId());
|
||||||
|
etDividendDetail.setPartnerId(sysUser1.getUserId());
|
||||||
|
etDividendDetail.setOrderNo(order.getOrderNo());
|
||||||
|
etDividendDetail.setTotalAmount(order.getTotalFee());
|
||||||
|
etDividendDetail.setCreateTime(DateUtils.getNowDate());
|
||||||
|
etDividendDetail.setDividendProportion(sysUser1.getDividendProportion());
|
||||||
|
etDividendDetail.setDividendAmount(multiply);
|
||||||
|
etDividendDetail.setDividendItem(dividendItem);
|
||||||
|
logger.info("【微信支付回调】保存分账明细 === " + JSON.toJSONString(etDividendDetail));
|
||||||
|
int i = dividendDetailService.insertEtDividendDetail(etDividendDetail);
|
||||||
|
if(i==0){
|
||||||
|
throw new ServiceException("保存分账明细失败");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
OrdersEntity ordersEntity = wxPayService.createOrder(transactionId,receivers);
|
OrdersEntity ordersEntity = wxPayService.createOrder(transactionId,receivers);
|
||||||
|
@ -245,7 +260,6 @@ public class CallbackServiceImpl implements CallbackService {
|
||||||
logger.info("【微信支付回调】发起分账失败");
|
logger.info("【微信支付回调】发起分账失败");
|
||||||
throw new ServiceException("发起分账失败");
|
throw new ServiceException("发起分账失败");
|
||||||
}
|
}
|
||||||
}, 10, TimeUnit.SECONDS);
|
|
||||||
}else if(attachVo.getType().equals(ServiceConstants.BUSINESS_TYPE_APPOINTMENT)){
|
}else if(attachVo.getType().equals(ServiceConstants.BUSINESS_TYPE_APPOINTMENT)){
|
||||||
logger.info("【微信支付回调】取消预约支付");
|
logger.info("【微信支付回调】取消预约支付");
|
||||||
// 2-取消预约支付
|
// 2-取消预约支付
|
||||||
|
|
|
@ -453,6 +453,7 @@ public class EtOrderServiceImpl implements IEtOrderService
|
||||||
etOrder.setMark(order.getMark());
|
etOrder.setMark(order.getMark());
|
||||||
etOrder.setCreateTime(DateUtils.getNowDate());
|
etOrder.setCreateTime(DateUtils.getNowDate());
|
||||||
etOrder.setRuleId(order.getRuleId());
|
etOrder.setRuleId(order.getRuleId());
|
||||||
|
etOrder.setAreaId(order.getAreaId());
|
||||||
/** 订单类型 1骑行 2预约 3套餐 4押金 根据类型不同下单的参数也不同,不同的参数有: 金额、类型、rule_id(套餐id)*/
|
/** 订单类型 1骑行 2预约 3套餐 4押金 根据类型不同下单的参数也不同,不同的参数有: 金额、类型、rule_id(套餐id)*/
|
||||||
String type = order.getType();
|
String type = order.getType();
|
||||||
if(type.equals("1")){//骑行订单,正常骑行(包含预约费),计时收费,根据开锁时间、起步价和起步时长、时长费和时长分钟等参数,如果有预约,还要加上预约费计算费用
|
if(type.equals("1")){//骑行订单,正常骑行(包含预约费),计时收费,根据开锁时间、起步价和起步时长、时长费和时长分钟等参数,如果有预约,还要加上预约费计算费用
|
||||||
|
@ -784,6 +785,19 @@ public class EtOrderServiceImpl implements IEtOrderService
|
||||||
if(ObjectUtil.isNotNull(etFeeRule)){
|
if(ObjectUtil.isNotNull(etFeeRule)){
|
||||||
order.setRule(etFeeRule);
|
order.setRule(etFeeRule);
|
||||||
}
|
}
|
||||||
|
// 骑行结束并且订单金额等于0,并且未支付
|
||||||
|
if(ServiceConstants.ORDER_STATUS_RIDING_END.equals(order.getStatus()) && order.getTotalFee().compareTo(BigDecimal.ZERO) == 0 && order.getPaid().equals(ServiceConstants.ORDER_PAY_STATUS_NON_PAYMENT)){
|
||||||
|
order.setPaid(ServiceConstants.ORDER_PAY_STATUS_PAID);
|
||||||
|
order.setPayTime(new Date());
|
||||||
|
order.setPayType(ServiceConstants.PAY_TYPE_SYS);
|
||||||
|
order.setStatus(ServiceConstants.ORDER_STATUS_ORDER_END);
|
||||||
|
int updateEtOrder = etOrderMapper.updateEtOrder(order);
|
||||||
|
if(updateEtOrder == 0){
|
||||||
|
throw new ServiceException("更新订单outTradeNo失败");
|
||||||
|
}else {
|
||||||
|
log.info("【isInOrder接口】更新订单outTradeNo成功");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return inOrder;
|
return inOrder;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,20 +32,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="isSign" column="is_sign" />
|
<result property="isSign" column="is_sign" />
|
||||||
<result property="sysUserId" column="sys_user_id" />
|
<result property="sysUserId" column="sys_user_id" />
|
||||||
<result property="areaId" column="area_id" />
|
<result property="areaId" column="area_id" />
|
||||||
|
<result property="isAuthentication" column="is_authentication" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectUserVo">
|
<sql id="selectUserVo">
|
||||||
select u.user_id, u.user_name, u.real_name, u.id_card, u.nick_name, u.email, u.avatar,
|
select u.user_id, u.user_name, u.real_name, u.id_card, u.nick_name, u.email, u.avatar,
|
||||||
u.phonenumber, u.balance, u.birthday, u.password, u.pay_password, u.sex, u.status,
|
u.phonenumber, u.balance, u.birthday, u.password, u.pay_password, u.sex, u.status,
|
||||||
u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.wxopenid,
|
u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.wxopenid,
|
||||||
u.is_sign,u.role,u.sys_user_id,u.area_id
|
u.is_sign,u.role,u.sys_user_id,u.area_id,u.is_authentication
|
||||||
from et_user u
|
from et_user u
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectUserList" parameterType="AsUser" resultMap="AsUserResult">
|
<select id="selectUserList" parameterType="AsUser" resultMap="AsUserResult">
|
||||||
select u.user_id, u.nick_name, u.user_name, u.real_name,u.email, u.avatar, u.phonenumber, u.balance,
|
select u.user_id, u.nick_name, u.user_name, u.real_name,u.email, u.avatar, u.phonenumber, u.balance,
|
||||||
u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
||||||
u.wxopenid,u.is_sign,u.role,u.sys_user_id,u.area_id from et_user u
|
u.wxopenid,u.is_sign,u.role,u.sys_user_id,u.area_id,u.is_authentication from et_user u
|
||||||
where u.del_flag = '0'
|
where u.del_flag = '0'
|
||||||
<if test="userId != null and userId != 0">
|
<if test="userId != null and userId != 0">
|
||||||
AND u.user_id = #{userId}
|
AND u.user_id = #{userId}
|
||||||
|
@ -164,6 +165,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="isSign != null and isSign != ''">is_sign,</if>
|
<if test="isSign != null and isSign != ''">is_sign,</if>
|
||||||
<if test="sysUserId != null and sysUserId != ''">sys_user_id,</if>
|
<if test="sysUserId != null and sysUserId != ''">sys_user_id,</if>
|
||||||
<if test="areaId != null">area_id,</if>
|
<if test="areaId != null">area_id,</if>
|
||||||
|
<if test="isAuthentication != null">is_authentication,</if>
|
||||||
create_time
|
create_time
|
||||||
)values(
|
)values(
|
||||||
<if test="userId != null and userId != ''">#{userId},</if>
|
<if test="userId != null and userId != ''">#{userId},</if>
|
||||||
|
@ -185,6 +187,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="isSign != null and isSign != ''">#{isSign},</if>
|
<if test="isSign != null and isSign != ''">#{isSign},</if>
|
||||||
<if test="sysUserId != null and sysUserId != ''">#{sysUserId},</if>
|
<if test="sysUserId != null and sysUserId != ''">#{sysUserId},</if>
|
||||||
<if test="areaId != null">#{areaId},</if>
|
<if test="areaId != null">#{areaId},</if>
|
||||||
|
<if test="isAuthentication != null">#{isAuthentication},</if>
|
||||||
sysdate()
|
sysdate()
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
@ -212,6 +215,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="isSign != null">is_sign = #{isSign},</if>
|
<if test="isSign != null">is_sign = #{isSign},</if>
|
||||||
<if test="sysUserId != null">sys_user_id = #{sysUserId},</if>
|
<if test="sysUserId != null">sys_user_id = #{sysUserId},</if>
|
||||||
<if test="areaId != null">area_id = #{areaId},</if>
|
<if test="areaId != null">area_id = #{areaId},</if>
|
||||||
|
<if test="isAuthentication != null">is_authentication = #{isAuthentication},</if>
|
||||||
update_time = sysdate()
|
update_time = sysdate()
|
||||||
</set>
|
</set>
|
||||||
where user_id = #{userId}
|
where user_id = #{userId}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user