|
|
@@ -1,13 +1,16 @@
|
|
|
package com.sqx.modules.pay.service.impl;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.github.wxpay.sdk.WXPay;
|
|
|
import com.github.wxpay.sdk.WXPayConstants;
|
|
|
import com.github.wxpay.sdk.WXPayUtil;
|
|
|
+import com.sqx.common.exception.SqxException;
|
|
|
+import com.sqx.common.utils.Constant;
|
|
|
import com.sqx.common.utils.Result;
|
|
|
import com.sqx.modules.app.dao.UserDao;
|
|
|
import com.sqx.modules.app.entity.UserEntity;
|
|
|
-import com.sqx.modules.app.entity.UserMoneyDetails;
|
|
|
import com.sqx.modules.app.service.UserMoneyDetailsService;
|
|
|
import com.sqx.modules.app.service.UserService;
|
|
|
import com.sqx.modules.common.entity.CommonInfo;
|
|
|
@@ -17,6 +20,7 @@ import com.sqx.modules.errand.service.TbIndentService;
|
|
|
import com.sqx.modules.pay.config.WXConfig;
|
|
|
import com.sqx.modules.pay.controller.app.AliPayController;
|
|
|
import com.sqx.modules.pay.dao.PayDetailsDao;
|
|
|
+import com.sqx.modules.pay.dto.RiderCertificationDTO;
|
|
|
import com.sqx.modules.pay.entity.PayDetails;
|
|
|
import com.sqx.modules.pay.service.WxErrRiderService;
|
|
|
import com.sqx.modules.pay.service.WxService;
|
|
|
@@ -104,19 +108,33 @@ public class WxErrRiderServiceImpl implements WxErrRiderService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Result wxPayJsApiRiderCertification(Long userId,Integer type, UserEntity userEntity, Integer userType) throws Exception {
|
|
|
+ public Result wxPayJsApiRiderCertification(Long userId, RiderCertificationDTO dto) {
|
|
|
+ UserEntity user = userService.getById(userId);
|
|
|
+ if(ObjectUtil.isNull(user)){
|
|
|
+ throw new SqxException("用户不存在!");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StrUtil.equals(Constant.YES, user.getCheckCertification())){
|
|
|
+ return Result.error("您已认证成功,无需重复认证!");
|
|
|
+ }
|
|
|
+
|
|
|
CommonInfo isVerify = commonInfoService.findOne(260);
|
|
|
- String generalOrder = getGeneralOrder();
|
|
|
if("是".equals(isVerify.getValue())){
|
|
|
- String result = VerifyIdCardUtils.verifyIdCard(userEntity.getIdentityCardNumber(),userEntity.getUserName());
|
|
|
+ String result = VerifyIdCardUtils.verifyIdCard(dto.getIdentityCardNumber(),dto.getUserName());
|
|
|
if(!"ok".equals(result)){
|
|
|
return Result.error("您填写的信息有误,请检查后重试!");
|
|
|
}
|
|
|
}
|
|
|
- userEntity.setUserId(userId);
|
|
|
- userEntity.setCheckNumber(generalOrder);
|
|
|
- // 因为添加站点,所以需要更新tb_user表
|
|
|
- userDao.updateById(userEntity);
|
|
|
+
|
|
|
+ UserEntity newUser = new UserEntity();
|
|
|
+ BeanUtil.copyProperties(dto, newUser);
|
|
|
+ newUser.setUserId(userId);
|
|
|
+ // 2 骑手
|
|
|
+ newUser.setType(2);
|
|
|
+ // 设置为待审核状态
|
|
|
+ newUser.setCheckCertification(Constant.NO);
|
|
|
+ newUser.setCheckCertificationMessage("待审核");
|
|
|
+ userService.updateById(newUser);
|
|
|
|
|
|
return Result.success();
|
|
|
}
|