| @@ -0,0 +1,200 @@ | |||||
| ALTER TABLE `mallink`.`wx_pay_order_0` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_1` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_2` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_3` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_4` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_5` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_6` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_7` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_8` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_9` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_10` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_11` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_12` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_13` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_14` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_15` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_16` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_17` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_18` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_19` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_20` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_21` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_22` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_23` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_24` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_25` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_26` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_27` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_28` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_29` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_30` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_31` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_32` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_33` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_34` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_35` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_36` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_37` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_38` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_39` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_40` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_41` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_42` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_43` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_44` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_45` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_46` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_47` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_48` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_49` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_50` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_51` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_52` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_53` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_54` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_55` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_56` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_57` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_58` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_59` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_60` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_61` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_62` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_63` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_64` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_65` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_66` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_67` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_68` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_69` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_70` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_71` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_72` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_73` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_74` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_75` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_76` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_77` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_78` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_79` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_80` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_81` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_82` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_83` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_84` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_85` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_86` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_87` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_88` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_89` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_90` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_91` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_92` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_93` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_94` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_95` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_96` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_97` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_98` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| ALTER TABLE `mallink`.`wx_pay_order_99` | |||||
| ADD COLUMN `open_id` varchar(50) AFTER `c_user_id`; | |||||
| @@ -1,5 +1,6 @@ | |||||
| package com.iformall.controller; | package com.iformall.controller; | ||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.CUser; | import com.iformall.domain.po.CUser; | ||||
| @@ -9,11 +10,14 @@ import com.iformall.domain.po.WxMsgValidationcode; | |||||
| import com.iformall.enums.EnumAppPlat; | import com.iformall.enums.EnumAppPlat; | ||||
| import com.iformall.enums.EnumAssignTagsTrigger; | import com.iformall.enums.EnumAssignTagsTrigger; | ||||
| import com.iformall.enums.EnumPayWay; | import com.iformall.enums.EnumPayWay; | ||||
| import com.iformall.exception.MallinkException; | |||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.service.cuser.CUserServiceFactory; | |||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -33,28 +37,31 @@ public class WxMsgValidationcodeController extends BaseController { | |||||
| private WxMsgValidationcodeService wxMsgValidationcodeService; | private WxMsgValidationcodeService wxMsgValidationcodeService; | ||||
| @Autowired | @Autowired | ||||
| private WxCUserService wxCUserService; | |||||
| @Autowired | |||||
| private WxCUserTagsService wxCUserTagsService; | |||||
| private CUserServiceFactory cuserFactory; | |||||
| @Autowired | @Autowired | ||||
| private WxAppinfoService WxAppinfoService; | private WxAppinfoService WxAppinfoService; | ||||
| @Autowired | |||||
| private CUserTokenService cUserTokenService; | |||||
| @GetMapping("sendvalidationcode") | @GetMapping("sendvalidationcode") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "phone", value = "手机号", dataType = "String", paramType = "query", required = true), | @ApiImplicitParam(name = "phone", value = "手机号", dataType = "String", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "type", value = "场景", dataType = "Integer", paramType = "query", required = true)}) | @ApiImplicitParam(name = "type", value = "场景", dataType = "Integer", paramType = "query", required = true)}) | ||||
| public ResultData sendvalidationcode(String phone, Integer type) { | public ResultData sendvalidationcode(String phone, Integer type) { | ||||
| if (StringUtils.isBlank(phone)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "手机号 不能为空"); | |||||
| } | |||||
| if(!phone.matches("^1[0-9]{10}$")){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"手机号格式不正确"); | |||||
| } | |||||
| if(type == null){ | |||||
| type = 1; | |||||
| } | |||||
| WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | ||||
| wxMsgValidationcode.updateTenantInfo(getTenantInfo()); | wxMsgValidationcode.updateTenantInfo(getTenantInfo()); | ||||
| wxMsgValidationcode.setPhone(phone); | wxMsgValidationcode.setPhone(phone); | ||||
| wxMsgValidationcode.setType(type); | wxMsgValidationcode.setType(type); | ||||
| //只需要一端发就可以了 | //只需要一端发就可以了 | ||||
| WxAppinfo appinfo = WxAppinfoService.getCAppInfo(getTenantInfo(), EnumAppPlat.WX); | |||||
| WxAppinfo appinfo = WxAppinfoService.getCAppInfo(getTenantInfo(), getCUser().getAppPlat()); | |||||
| wxMsgValidationcode.setAppid(appinfo.getAppId()); | wxMsgValidationcode.setAppid(appinfo.getAppId()); | ||||
| return wxMsgValidationcodeService.sendvalidationcode(wxMsgValidationcode); | return wxMsgValidationcodeService.sendvalidationcode(wxMsgValidationcode); | ||||
| } | } | ||||
| @@ -65,6 +72,18 @@ public class WxMsgValidationcodeController extends BaseController { | |||||
| @ApiImplicitParam(name = "type", value = "场景", dataType = "Integer", paramType = "query", required = true), | @ApiImplicitParam(name = "type", value = "场景", dataType = "Integer", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "code", value = "验证码", dataType = "String", paramType = "query", required = true)}) | @ApiImplicitParam(name = "code", value = "验证码", dataType = "String", paramType = "query", required = true)}) | ||||
| public ResultData hasvalidationcode(String phone, Integer type, String code) { | public ResultData hasvalidationcode(String phone, Integer type, String code) { | ||||
| if (StringUtils.isBlank(phone)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "手机号 不能为空"); | |||||
| } | |||||
| if(!phone.matches("^1[0-9]{10}$")){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"手机号格式不正确"); | |||||
| } | |||||
| if(type == null){ | |||||
| type = 1; | |||||
| } | |||||
| if (StringUtils.isBlank(code)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "验证码未填写"); | |||||
| } | |||||
| CUser user = getCUser(); | CUser user = getCUser(); | ||||
| WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | ||||
| wxMsgValidationcode.updateTenantInfo(getTenantInfo()); | wxMsgValidationcode.updateTenantInfo(getTenantInfo()); | ||||
| @@ -72,28 +91,16 @@ public class WxMsgValidationcodeController extends BaseController { | |||||
| wxMsgValidationcode.setType(type); | wxMsgValidationcode.setType(type); | ||||
| wxMsgValidationcode.setCode(code); | wxMsgValidationcode.setCode(code); | ||||
| //只需要一端发就可以了 | //只需要一端发就可以了 | ||||
| WxAppinfo appinfo = WxAppinfoService.getCAppInfo(getTenantInfo(), EnumAppPlat.WX); | |||||
| WxAppinfo appinfo = WxAppinfoService.getCAppInfo(getTenantInfo(), user.getAppPlat()); | |||||
| wxMsgValidationcode.setAppid(appinfo.getAppId()); | wxMsgValidationcode.setAppid(appinfo.getAppId()); | ||||
| //wxMsgValidationcode.setAppid(user.getAppId()); | |||||
| ResultData rd = wxMsgValidationcodeService.hasvalidationcode(wxMsgValidationcode); | ResultData rd = wxMsgValidationcodeService.hasvalidationcode(wxMsgValidationcode); | ||||
| if (rd.code == Result.SUCCESS) { | if (rd.code == Result.SUCCESS) { | ||||
| // 更新到basicinfo | // 更新到basicinfo | ||||
| Long basicUserId = saveToBasicInfoByCUser(phone, user.getNickName(), user.getAvatarUrl(), user.getGender(), user.getUserId()); | |||||
| if (null != basicUserId) { | |||||
| if(basicUserId.intValue() == -1){ | |||||
| return rd; | |||||
| } | |||||
| user.setUserId(basicUserId); | |||||
| try{ | |||||
| cuserFactory.getCUserService(user.getAppPlat()).savePhoneToBasicInfo(user,phone); | |||||
| } catch (MallinkException e) { | |||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||||
| } | } | ||||
| // 更新 WxCUser | |||||
| user.setVerifyCodePhone(phone); | |||||
| user.setUpdateDate(new Date()); | |||||
| wxCUserService.saveOrUpdate((WxCUser) user); | |||||
| wxCUserService.delForUserIdOnly(user.getId(),user.getUserId(),user.getTenantId()); | |||||
| // wxCUserService.assureUserIdOnly(user.getId(),); | |||||
| wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_PHONE,user,wxMsgValidationcode,null); | |||||
| cUserTokenService.removeTokenCache(user.getToken()); | |||||
| } | } | ||||
| return rd; | return rd; | ||||
| } | } | ||||
| @@ -124,6 +124,7 @@ public class WxPayOrderController extends BaseController { | |||||
| } | } | ||||
| WxPayOrder record = new WxPayOrder(); | WxPayOrder record = new WxPayOrder(); | ||||
| record.setOrderId(orderId); | record.setOrderId(orderId); | ||||
| record.setOpenId(getCUser().getOpenId()); | |||||
| try { | try { | ||||
| record.setIp(IPUtil.getIpAddr(request)); | record.setIp(IPUtil.getIpAddr(request)); | ||||
| record.setComposeOrder(Integer.parseInt(composeOrderType)); | record.setComposeOrder(Integer.parseInt(composeOrderType)); | ||||
| @@ -75,9 +75,6 @@ public class WxUserGrantController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| WxAuthorizerInfoService wxAuthorizerInfoService; | WxAuthorizerInfoService wxAuthorizerInfoService; | ||||
| @Autowired | |||||
| private FmOpenService openService; | |||||
| @Autowired | @Autowired | ||||
| WxMerchantService wxMerchantService; | WxMerchantService wxMerchantService; | ||||
| @@ -87,17 +84,11 @@ public class WxUserGrantController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| WxCreditHistoryService wxCreditHistoryService; | WxCreditHistoryService wxCreditHistoryService; | ||||
| @Autowired | |||||
| private MemCouponFromDspService memCouponFromDspService; | |||||
| @Autowired | @Autowired | ||||
| WxMallService mallService; | WxMallService mallService; | ||||
| @Autowired | @Autowired | ||||
| private QrCodeService qrCodeService; | private QrCodeService qrCodeService; | ||||
| @Autowired | |||||
| private CUserTokenService cUserTokenService; | |||||
| /** | /** | ||||
| @@ -30,6 +30,8 @@ public class WxPayOrder extends TenantEntity { | |||||
| private Long orderId; | private Long orderId; | ||||
| @io.swagger.annotations.ApiModelProperty(value="用户ID",name="cUserId") | @io.swagger.annotations.ApiModelProperty(value="用户ID",name="cUserId") | ||||
| private Long cUserId; | private Long cUserId; | ||||
| @io.swagger.annotations.ApiModelProperty(value="",name="openId") | |||||
| private String openId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="B端用户ID",name="bUserId") | @io.swagger.annotations.ApiModelProperty(value="B端用户ID",name="bUserId") | ||||
| private Long bUserId; | private Long bUserId; | ||||
| @io.swagger.annotations.ApiModelProperty(value="扫码授权编码",name="authCode") | @io.swagger.annotations.ApiModelProperty(value="扫码授权编码",name="authCode") | ||||
| @@ -10,9 +10,6 @@ import lombok.ToString; | |||||
| @EqualsAndHashCode(callSuper = true) | @EqualsAndHashCode(callSuper = true) | ||||
| public class WxPayOrderVo extends WxPayOrder { | public class WxPayOrderVo extends WxPayOrder { | ||||
| @io.swagger.annotations.ApiModelProperty(value="用户绑定的openId",name="openId") | |||||
| private String openId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="用户支付appId",name="appId") | @io.swagger.annotations.ApiModelProperty(value="用户支付appId",name="appId") | ||||
| private String appId; | private String appId; | ||||
| @@ -27,6 +27,8 @@ public interface CUserServiceApapter { | |||||
| String decryptPhoneNoInfo(String encryptedData, String iv, CUser cuser, WxAppinfo wxAppinfo, boolean isFmOpen); | String decryptPhoneNoInfo(String encryptedData, String iv, CUser cuser, WxAppinfo wxAppinfo, boolean isFmOpen); | ||||
| void savePhoneToBasicInfo(CUser user, String phone); | |||||
| CUser handleLoginUser(CUser cUser, WxCUserFrom wxCUserFrom); | CUser handleLoginUser(CUser cUser, WxCUserFrom wxCUserFrom); | ||||
| CUser getById(Long id, String tenantId); | CUser getById(Long id, String tenantId); | ||||
| @@ -42,4 +44,5 @@ public interface CUserServiceApapter { | |||||
| long findCount(WxCUserBasicInfoDto dto, List<TenantEntity> tenantEntitys); | long findCount(WxCUserBasicInfoDto dto, List<TenantEntity> tenantEntitys); | ||||
| List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto, List<TenantEntity> tenantEntitys); | List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto, List<TenantEntity> tenantEntitys); | ||||
| } | } | ||||
| @@ -135,6 +135,17 @@ public class TtBUserServiceAdapter extends BasicCUserService implements CUserSer | |||||
| } | } | ||||
| } | } | ||||
| @Override | |||||
| public void savePhoneToBasicInfo(CUser user, String phone) { | |||||
| TtBuser updateUser = new TtBuser(); | |||||
| updateUser.setId(user.getId()); | |||||
| updateUser.updateTenantInfo(user); | |||||
| updateUser.setPhone(phone); | |||||
| updateUser.setUpdateDate(new Date()); | |||||
| ttBuserMapper.updateById(updateUser); | |||||
| cleanCuserToken(user.getToken()); | |||||
| } | |||||
| @Override | @Override | ||||
| public CUser handleLoginUser(CUser cUser, WxCUserFrom wxCUserFrom) { | public CUser handleLoginUser(CUser cUser, WxCUserFrom wxCUserFrom) { | ||||
| TtBuser newUser = new TtBuser(); | TtBuser newUser = new TtBuser(); | ||||
| @@ -113,7 +113,7 @@ public class TtCUserServiceAdapter extends BasicCUserService implements CUserSer | |||||
| updateUser.setCity(userInfo.getCity()); | updateUser.setCity(userInfo.getCity()); | ||||
| updateUser.setLanguage(userInfo.getLanguage()); | updateUser.setLanguage(userInfo.getLanguage()); | ||||
| updateUser.setUpdateDate(new Date()); | updateUser.setUpdateDate(new Date()); | ||||
| ttCUserMapper.updateUserId(updateUser); | |||||
| ttCUserMapper.updateById(updateUser); | |||||
| if(cuser.getUserId() != null){ | if(cuser.getUserId() != null){ | ||||
| WxCUserBasicInfo wxCUserBasicInfo = new WxCUserBasicInfo(); | WxCUserBasicInfo wxCUserBasicInfo = new WxCUserBasicInfo(); | ||||
| @@ -166,6 +166,30 @@ public class TtCUserServiceAdapter extends BasicCUserService implements CUserSer | |||||
| } | } | ||||
| } | } | ||||
| @Override | |||||
| public void savePhoneToBasicInfo(CUser user, String phone) { | |||||
| TtCUser updateUser = new TtCUser(); | |||||
| updateUser.setId(user.getId()); | |||||
| updateUser.updateTenantInfo(user); | |||||
| updateUser.setPhone(phone); | |||||
| // 更新到basicinfo | |||||
| Long userBasicId = saveToBasicInfoByCUser(updateUser,updateUser.getPhone(), user.getNickName(), user.getAvatarUrl(), user.getGender(), user.getUserId()); | |||||
| if (null != userBasicId) { | |||||
| if(userBasicId.intValue() == -1){ | |||||
| throw new MallinkException(ErrorCode.USER_PHONE_IS_FOUND); | |||||
| } | |||||
| updateUser.setUserId(userBasicId); | |||||
| }else{ | |||||
| throw new MallinkException(ErrorCode.PHONE_DECODE_ERR); | |||||
| } | |||||
| updateUser.setUpdateDate(new Date()); | |||||
| ttCUserMapper.updateById(updateUser); | |||||
| delForUserIdOnly(updateUser.getId(),updateUser.getUserId(),updateUser.getTenantId()); | |||||
| wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_PHONE, updateUser,updateUser,null); | |||||
| cleanCuserToken(user.getToken()); | |||||
| } | |||||
| @Override | @Override | ||||
| public CUser handleLoginUser(CUser cUser, WxCUserFrom wxCUserFrom) { | public CUser handleLoginUser(CUser cUser, WxCUserFrom wxCUserFrom) { | ||||
| TtCUser newUser = new TtCUser(); | TtCUser newUser = new TtCUser(); | ||||
| @@ -135,6 +135,17 @@ public class WxBUserServiceAdapter extends BasicCUserService implements CUserSer | |||||
| } | } | ||||
| } | } | ||||
| @Override | |||||
| public void savePhoneToBasicInfo(CUser user, String phone) { | |||||
| WxBuser updateUser = new WxBuser(); | |||||
| updateUser.setId(user.getId()); | |||||
| updateUser.updateTenantInfo(user); | |||||
| updateUser.setPhone(phone); | |||||
| updateUser.setUpdateDate(new Date()); | |||||
| wxBuserMapper.updateById(updateUser); | |||||
| cleanCuserToken(user.getToken()); | |||||
| } | |||||
| @Override | @Override | ||||
| public CUser handleLoginUser(CUser cUser, WxCUserFrom wxCUserFrom) { | public CUser handleLoginUser(CUser cUser, WxCUserFrom wxCUserFrom) { | ||||
| WxBuser newUser = new WxBuser(); | WxBuser newUser = new WxBuser(); | ||||
| @@ -173,6 +173,30 @@ public class WxCUserServiceAdapter extends BasicCUserService implements CUserSer | |||||
| } | } | ||||
| } | } | ||||
| @Override | |||||
| public void savePhoneToBasicInfo(CUser user, String phone) { | |||||
| WxCUser updateUser = new WxCUser(); | |||||
| updateUser.setId(user.getId()); | |||||
| updateUser.updateTenantInfo(user); | |||||
| updateUser.setPhone(phone); | |||||
| // 更新到basicinfo | |||||
| Long userBasicId = saveToBasicInfoByCUser(updateUser,updateUser.getPhone(), user.getNickName(), user.getAvatarUrl(), user.getGender(), user.getUserId()); | |||||
| if (null != userBasicId) { | |||||
| if(userBasicId.intValue() == -1){ | |||||
| throw new MallinkException(ErrorCode.USER_PHONE_IS_FOUND); | |||||
| } | |||||
| updateUser.setUserId(userBasicId); | |||||
| }else{ | |||||
| throw new MallinkException(ErrorCode.PHONE_DECODE_ERR); | |||||
| } | |||||
| updateUser.setUpdateDate(new Date()); | |||||
| wxCUserMapper.updateById(updateUser); | |||||
| delForUserIdOnly(updateUser.getId(),updateUser.getUserId(),updateUser.getTenantId()); | |||||
| wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_PHONE, updateUser,updateUser,null); | |||||
| cleanCuserToken(user.getToken()); | |||||
| } | |||||
| @Override | @Override | ||||
| public CUser handleLoginUser(CUser cUser, WxCUserFrom wxCUserFrom) { | public CUser handleLoginUser(CUser cUser, WxCUserFrom wxCUserFrom) { | ||||
| WxCUser newUser = new WxCUser(); | WxCUser newUser = new WxCUser(); | ||||
| @@ -2267,6 +2267,11 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| logger.error("couponOrder失败:" + e.getMessage(),e); | logger.error("couponOrder失败:" + e.getMessage(),e); | ||||
| throw new MallinkException(ErrorCode.COUPON_ORDER_SAVE_ERR.getCode(),"["+coupon.getTitle()+"]保存券订单错误."+e.getMessage()); | throw new MallinkException(ErrorCode.COUPON_ORDER_SAVE_ERR.getCode(),"["+coupon.getTitle()+"]保存券订单错误."+e.getMessage()); | ||||
| } | } | ||||
| try { | |||||
| } catch (Exception e) { | |||||
| logger.error("同步订单失败:" + e.getMessage(),e); | |||||
| } | |||||
| return record; | return record; | ||||
| } | } | ||||
| @@ -81,6 +81,16 @@ public interface PayAdapterService { | |||||
| * @throws Exception | * @throws Exception | ||||
| */ | */ | ||||
| public PayAdapterResult payOrderReverse(WxAppinfo appInfo, WxPayOrder record,WxPayAccount payAccount) throws Exception; | public PayAdapterResult payOrderReverse(WxAppinfo appInfo, WxPayOrder record,WxPayAccount payAccount) throws Exception; | ||||
| /** | |||||
| * API 订单同步 | |||||
| * @param appInfo | |||||
| * @param record | |||||
| * @param payAccount | |||||
| * @return | |||||
| * @throws Exception | |||||
| */ | |||||
| public PayAdapterResult payOrderPush(WxAppinfo appInfo, WxPayOrder record,WxPayAccount payAccount) throws Exception; | |||||
| /** | /** | ||||
| * 获取二维码 | * 获取二维码 | ||||
| @@ -82,6 +82,11 @@ public class TtMiniAppPayAdapterService extends BaseTtPayAdapterService implemen | |||||
| return super.payOrderReverse(appInfo, record, payAccount); | return super.payOrderReverse(appInfo, record, payAccount); | ||||
| } | } | ||||
| @Override | |||||
| public PayAdapterResult payOrderPush(WxAppinfo appInfo, WxPayOrder record, WxPayAccount payAccount) throws Exception { | |||||
| return null; | |||||
| } | |||||
| @Override | @Override | ||||
| public File getQrcode(WxAppinfo appinfo,String pageUrl,int type,String sceneParam) throws Exception{ | public File getQrcode(WxAppinfo appinfo,String pageUrl,int type,String sceneParam) throws Exception{ | ||||
| return super.getQrCode(appinfo, pageUrl, type, sceneParam); | return super.getQrCode(appinfo, pageUrl, type, sceneParam); | ||||
| @@ -60,6 +60,11 @@ public class WxH5PayService extends BaseWxPayAdapterService implements CDriving | |||||
| return null; | return null; | ||||
| } | } | ||||
| @Override | |||||
| public PayAdapterResult payOrderPush(WxAppinfo appInfo, WxPayOrder record, WxPayAccount payAccount) throws Exception { | |||||
| return null; | |||||
| } | |||||
| @Override | @Override | ||||
| public File getQrcode(WxAppinfo appinfo,String pageUrl,int type,String sceneParam) throws Exception{ | public File getQrcode(WxAppinfo appinfo,String pageUrl,int type,String sceneParam) throws Exception{ | ||||
| // TODO Auto-generated method stub | // TODO Auto-generated method stub | ||||
| @@ -268,7 +268,12 @@ public class WxMiniAppPayAdapterService extends BaseWxPayAdapterService implemen | |||||
| return super.payOrderReverse(appInfo, record, payAccount); | return super.payOrderReverse(appInfo, record, payAccount); | ||||
| } | } | ||||
| @Override | |||||
| @Override | |||||
| public PayAdapterResult payOrderPush(WxAppinfo appInfo, WxPayOrder record, WxPayAccount payAccount) throws Exception { | |||||
| return null; | |||||
| } | |||||
| @Override | |||||
| public File getQrcode(WxAppinfo appinfo,String pageUrl,int type,String sceneParam) throws Exception{ | public File getQrcode(WxAppinfo appinfo,String pageUrl,int type,String sceneParam) throws Exception{ | ||||
| return super.getQrCode(appinfo, pageUrl, type, sceneParam); | return super.getQrCode(appinfo, pageUrl, type, sceneParam); | ||||
| } | } | ||||
| @@ -255,7 +255,12 @@ public class WxMiniMaPayAdapterService extends BaseWxPayAdapterService implement | |||||
| return super.payOrderReverse(appInfo, record, payAccount); | return super.payOrderReverse(appInfo, record, payAccount); | ||||
| } | } | ||||
| @Override | |||||
| @Override | |||||
| public PayAdapterResult payOrderPush(WxAppinfo appInfo, WxPayOrder record, WxPayAccount payAccount) throws Exception { | |||||
| return null; | |||||
| } | |||||
| @Override | |||||
| public File getQrcode(WxAppinfo appinfo,String pageUrl,int type,String sceneParam) throws Exception { | public File getQrcode(WxAppinfo appinfo,String pageUrl,int type,String sceneParam) throws Exception { | ||||
| return super.getQrCode(appinfo, pageUrl, type, sceneParam); | return super.getQrCode(appinfo, pageUrl, type, sceneParam); | ||||
| } | } | ||||
| @@ -9,6 +9,7 @@ | |||||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | ||||
| <result column="order_id" jdbcType="BIGINT" property="orderId"/> | <result column="order_id" jdbcType="BIGINT" property="orderId"/> | ||||
| <result column="c_user_id" jdbcType="BIGINT" property="cUserId"/> | <result column="c_user_id" jdbcType="BIGINT" property="cUserId"/> | ||||
| <result column="open_id" jdbcType="VARCHAR" property="openId"/> | |||||
| <result column="b_user_id" jdbcType="BIGINT" property="bUserId"/> | <result column="b_user_id" jdbcType="BIGINT" property="bUserId"/> | ||||
| <result column="auth_code" jdbcType="VARCHAR" property="authCode"/> | <result column="auth_code" jdbcType="VARCHAR" property="authCode"/> | ||||
| <result column="ip" jdbcType="VARCHAR" property="ip"/> | <result column="ip" jdbcType="VARCHAR" property="ip"/> | ||||
| @@ -34,7 +35,7 @@ | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`order_id`,`c_user_id`,`b_user_id`, | |||||
| `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`order_id`,`c_user_id`,`open_id`,`b_user_id`, | |||||
| `auth_code`,`ip`,`pay_amount`,`pay_time_start`,`pay_time_end`, | `auth_code`,`ip`,`pay_amount`,`pay_time_start`,`pay_time_end`, | ||||
| `prepay_id`,`transaction_id`,`pay_vendor`,`pay_order_no`, | `prepay_id`,`transaction_id`,`pay_vendor`,`pay_order_no`, | ||||
| `pay_order_status`,`share`,`share_amount`,`rate_amount`,`fail_reason`, | `pay_order_status`,`share`,`share_amount`,`rate_amount`,`fail_reason`, | ||||
| @@ -72,6 +73,10 @@ | |||||
| and `c_user_id` = #{cUserId} | and `c_user_id` = #{cUserId} | ||||
| </if> | </if> | ||||
| <if test=" null != openId "> | |||||
| and `open_id` = #{openId} | |||||
| </if> | |||||
| <if test=" null != bUserId "> | <if test=" null != bUserId "> | ||||
| and `b_user_id` = #{bUserId} | and `b_user_id` = #{bUserId} | ||||
| </if> | </if> | ||||
| @@ -203,6 +208,7 @@ | |||||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | ||||
| <result column="order_id" jdbcType="BIGINT" property="orderId"/> | <result column="order_id" jdbcType="BIGINT" property="orderId"/> | ||||
| <result column="c_user_id" jdbcType="BIGINT" property="cUserId"/> | <result column="c_user_id" jdbcType="BIGINT" property="cUserId"/> | ||||
| <result column="open_id" jdbcType="VARCHAR" property="openId"/> | |||||
| <result column="b_user_id" jdbcType="BIGINT" property="bUserId"/> | <result column="b_user_id" jdbcType="BIGINT" property="bUserId"/> | ||||
| <result column="auth_code" jdbcType="VARCHAR" property="authCode"/> | <result column="auth_code" jdbcType="VARCHAR" property="authCode"/> | ||||
| <result column="ip" jdbcType="VARCHAR" property="ip"/> | <result column="ip" jdbcType="VARCHAR" property="ip"/> | ||||
| @@ -219,17 +225,15 @@ | |||||
| <result column="rate_amount" jdbcType="INTEGER" property="rateAmount"/> | <result column="rate_amount" jdbcType="INTEGER" property="rateAmount"/> | ||||
| <result column="fail_reason" jdbcType="VARCHAR" property="failReason"/> | <result column="fail_reason" jdbcType="VARCHAR" property="failReason"/> | ||||
| <result column="open_id" jdbcType="VARCHAR" property="openId"/> | |||||
| <result column="app_id" jdbcType="VARCHAR" property="appId"/> | <result column="app_id" jdbcType="VARCHAR" property="appId"/> | ||||
| <result column="pay_id" jdbcType="BIGINT" property="payId"/> | <result column="pay_id" jdbcType="BIGINT" property="payId"/> | ||||
| </resultMap> | </resultMap> | ||||
| <sql id="allVColumns"> | <sql id="allVColumns"> | ||||
| p.`id`,p.`tenant_id`,p.`parent_tenant_id`,p.`create_time`,p.`update_time`,p.`order_id`,p.`c_user_id`,p.`b_user_id`, | |||||
| p.`id`,p.`tenant_id`,p.`parent_tenant_id`,p.`create_time`,p.`update_time`,p.`order_id`,p.`c_user_id`,p.`open_id`,p.`b_user_id`, | |||||
| p.`auth_code`,p.`ip`,p.`pay_amount`,p.`pay_time_start`,p.`pay_time_end`, | p.`auth_code`,p.`ip`,p.`pay_amount`,p.`pay_time_start`,p.`pay_time_end`, | ||||
| p.`prepay_id`,p.`transaction_id`,p.`pay_vendor`,p.`pay_order_no`, | p.`prepay_id`,p.`transaction_id`,p.`pay_vendor`,p.`pay_order_no`, | ||||
| p.`pay_order_status`,p.`share`,p.`share_amount`,p.`rate_amount`,p.`fail_reason`, | p.`pay_order_status`,p.`share`,p.`share_amount`,p.`rate_amount`,p.`fail_reason`, | ||||
| u.`open_id`, | |||||
| a.`app_id`, a.`pay_id` | a.`app_id`, a.`pay_id` | ||||
| </sql> | </sql> | ||||
| @@ -237,9 +241,8 @@ | |||||
| select | select | ||||
| <include refid="allVColumns"/> | <include refid="allVColumns"/> | ||||
| from wx_pay_order p | from wx_pay_order p | ||||
| left join wx_c_user u on p.`c_user_id` = u.`id` | |||||
| left join wx_appinfo a on a.`tenant_id` = p.`tenant_id` and a.`type` = 2 | left join wx_appinfo a on a.`tenant_id` = p.`tenant_id` and a.`type` = 2 | ||||
| where p.`pay_order_status` = '1' and p.`pay_vendor` = 0 and u.`union_id` is null | |||||
| where p.`pay_order_status` = '1' and p.`pay_vendor` = 0 | |||||
| <if test="startDate != null"> | <if test="startDate != null"> | ||||
| AND unix_timestamp(p.`pay_time_end`) > unix_timestamp(#{startDate,jdbcType=TIMESTAMP}) | AND unix_timestamp(p.`pay_time_end`) > unix_timestamp(#{startDate,jdbcType=TIMESTAMP}) | ||||
| </if> | </if> | ||||