|
@@ -6,10 +6,16 @@ import com.caimei365.user.components.WeChatService;
|
|
import com.caimei365.user.mapper.BaseMapper;
|
|
import com.caimei365.user.mapper.BaseMapper;
|
|
import com.caimei365.user.mapper.LoginMapper;
|
|
import com.caimei365.user.mapper.LoginMapper;
|
|
import com.caimei365.user.mapper.RegisterMapper;
|
|
import com.caimei365.user.mapper.RegisterMapper;
|
|
|
|
+import com.caimei365.user.mapper.SellerMapper;
|
|
import com.caimei365.user.model.ResponseJson;
|
|
import com.caimei365.user.model.ResponseJson;
|
|
import com.caimei365.user.model.dto.*;
|
|
import com.caimei365.user.model.dto.*;
|
|
import com.caimei365.user.model.po.*;
|
|
import com.caimei365.user.model.po.*;
|
|
import com.caimei365.user.model.vo.ServiceProviderVo;
|
|
import com.caimei365.user.model.vo.ServiceProviderVo;
|
|
|
|
+import com.caimei365.user.model.po.ClubPo;
|
|
|
|
+import com.caimei365.user.model.po.OperationPo;
|
|
|
|
+import com.caimei365.user.model.po.ShopPo;
|
|
|
|
+import com.caimei365.user.model.po.UserPo;
|
|
|
|
+import com.caimei365.user.model.vo.*;
|
|
import com.caimei365.user.service.RegisterService;
|
|
import com.caimei365.user.service.RegisterService;
|
|
import com.caimei365.user.utils.AliyunSmsUtil;
|
|
import com.caimei365.user.utils.AliyunSmsUtil;
|
|
import com.caimei365.user.utils.CodeUtil;
|
|
import com.caimei365.user.utils.CodeUtil;
|
|
@@ -46,6 +52,8 @@ public class RegisterServiceImpl implements RegisterService {
|
|
private LoginMapper loginMapper;
|
|
private LoginMapper loginMapper;
|
|
@Resource
|
|
@Resource
|
|
private RegisterMapper registerMapper;
|
|
private RegisterMapper registerMapper;
|
|
|
|
+ @Resource
|
|
|
|
+ private SellerMapper sellerMapper;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 检查账号可以注册
|
|
* 检查账号可以注册
|
|
@@ -166,7 +174,7 @@ public class RegisterServiceImpl implements RegisterService {
|
|
保存数据库 user
|
|
保存数据库 user
|
|
*/
|
|
*/
|
|
int insertFlag = registerMapper.insertClubUser(user);
|
|
int insertFlag = registerMapper.insertClubUser(user);
|
|
- log.info("插入数据库User表,获得userId:"+user.getUserId());
|
|
|
|
|
|
+ log.info("插入数据库User表,获得userId:" + user.getUserId());
|
|
if (insertFlag < 1) {
|
|
if (insertFlag < 1) {
|
|
throw new RuntimeException("插入数据库异常user:" + user.toString());
|
|
throw new RuntimeException("插入数据库异常user:" + user.toString());
|
|
}
|
|
}
|
|
@@ -200,10 +208,10 @@ public class RegisterServiceImpl implements RegisterService {
|
|
user.setClubId(club.getClubId());
|
|
user.setClubId(club.getClubId());
|
|
registerMapper.updateUserClubId(user.getUserId(), club.getClubId());
|
|
registerMapper.updateUserClubId(user.getUserId(), club.getClubId());
|
|
// 注册成功短信
|
|
// 注册成功短信
|
|
- boolean smsFlag = AliyunSmsUtil.sendSms(clubRegisterDto.getBindMobile(), 10, "{name:"+ clubRegisterDto.getBindMobile() +"}");
|
|
|
|
|
|
+ boolean smsFlag = AliyunSmsUtil.sendSms(clubRegisterDto.getBindMobile(), 10, "{name:" + clubRegisterDto.getBindMobile() + "}");
|
|
if (!smsFlag) {
|
|
if (!smsFlag) {
|
|
// 短信发送失败重试一次
|
|
// 短信发送失败重试一次
|
|
- AliyunSmsUtil.sendSms(clubRegisterDto.getBindMobile(), 10, "{name:"+ clubRegisterDto.getBindMobile() +"}");
|
|
|
|
|
|
+ AliyunSmsUtil.sendSms(clubRegisterDto.getBindMobile(), 10, "{name:" + clubRegisterDto.getBindMobile() + "}");
|
|
}
|
|
}
|
|
/*
|
|
/*
|
|
绑定微信,成为机构运营人员
|
|
绑定微信,成为机构运营人员
|
|
@@ -246,7 +254,7 @@ public class RegisterServiceImpl implements RegisterService {
|
|
保存数据库 operation
|
|
保存数据库 operation
|
|
*/
|
|
*/
|
|
int insertOperationFlag = registerMapper.insertOperation(operation);
|
|
int insertOperationFlag = registerMapper.insertOperation(operation);
|
|
- log.info("插入数据库cm_mall_operation_user表,获得id:"+operation.getId());
|
|
|
|
|
|
+ log.info("插入数据库cm_mall_operation_user表,获得id:" + operation.getId());
|
|
if (insertOperationFlag < 1) {
|
|
if (insertOperationFlag < 1) {
|
|
log.info(operation.getUserId() + " 插入数据库异常operation:" + operation.toString());
|
|
log.info(operation.getUserId() + " 插入数据库异常operation:" + operation.toString());
|
|
}
|
|
}
|
|
@@ -254,7 +262,7 @@ public class RegisterServiceImpl implements RegisterService {
|
|
}
|
|
}
|
|
log.info("注册普通机构成功,手机号>>>" + clubRegisterDto.getBindMobile());
|
|
log.info("注册普通机构成功,手机号>>>" + clubRegisterDto.getBindMobile());
|
|
if (!smsFlag) {
|
|
if (!smsFlag) {
|
|
- log.info("短信发送失败,手机号:"+clubRegisterDto.getBindMobile());
|
|
|
|
|
|
+ log.info("短信发送失败,手机号:" + clubRegisterDto.getBindMobile());
|
|
}
|
|
}
|
|
//新用户自主注册送50采美豆
|
|
//新用户自主注册送50采美豆
|
|
UserBeansHistoryPo beansHistory = new UserBeansHistoryPo();
|
|
UserBeansHistoryPo beansHistory = new UserBeansHistoryPo();
|
|
@@ -387,7 +395,7 @@ public class RegisterServiceImpl implements RegisterService {
|
|
club.setSocialCreditCode(upgradeDto.getSocialCreditCode());
|
|
club.setSocialCreditCode(upgradeDto.getSocialCreditCode());
|
|
// 分类: 1医美, 2生美
|
|
// 分类: 1医美, 2生美
|
|
club.setFirstClubType(upgradeDto.getFirstClubType());
|
|
club.setFirstClubType(upgradeDto.getFirstClubType());
|
|
- if (upgradeDto.getFirstClubType() == 1){
|
|
|
|
|
|
+ if (upgradeDto.getFirstClubType() == 1) {
|
|
// 医美二级分类: 1诊所、2门诊、3医院
|
|
// 医美二级分类: 1诊所、2门诊、3医院
|
|
club.setSecondClubType(upgradeDto.getSecondClubType());
|
|
club.setSecondClubType(upgradeDto.getSecondClubType());
|
|
// 门诊和医院则需要填写科室
|
|
// 门诊和医院则需要填写科室
|
|
@@ -412,56 +420,38 @@ public class RegisterServiceImpl implements RegisterService {
|
|
/**
|
|
/**
|
|
* 协销拉机构上线
|
|
* 协销拉机构上线
|
|
*
|
|
*
|
|
- * @param onlineDto ClubOnlineDto:{
|
|
|
|
- * source 注册来源: 0网站 1小程序
|
|
|
|
- * userId 协销用户ID(userID)
|
|
|
|
- * name 机构名称
|
|
|
|
- * shortName 机构简称(shortName)
|
|
|
|
- * bindMobile 企业绑定手机号
|
|
|
|
- * contractEmail 邮箱(email)
|
|
|
|
- * linkMan 联系人(linkMan1)
|
|
|
|
- * provinceId 省Id
|
|
|
|
- * cityId 市Id
|
|
|
|
- * townId 县区Id
|
|
|
|
- * address 地址
|
|
|
|
- * shopPhoto 门头照(headpic)
|
|
|
|
- * businessLicense 营业执照(businessLicenseImage)
|
|
|
|
- * socialCreditCode 统一社会信用代码(socialCreditCode)
|
|
|
|
- * firstClubType 一级分类:医美=1和生美=2
|
|
|
|
- * secondClubType 医美的二级分类:诊所=1、门诊=2、医院=3。 生美没有二级分类
|
|
|
|
- * department 医美分类下的门诊和医院则需要填写科室
|
|
|
|
- * medicalPracticeLicense 医美分类必须上传医疗执业许可证(medicalPracticeLicenseImg)
|
|
|
|
- * mainProduct 主打项目(mainpro)
|
|
|
|
- * isAgreed 是否同意勾选同意协议,1是,其他否
|
|
|
|
- * }
|
|
|
|
- * @param headers HttpHeaders
|
|
|
|
|
|
+ * @param id 暂存机构数据id
|
|
* @return ClubPo
|
|
* @return ClubPo
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
- public ResponseJson<Integer> clubOnline(ClubOnlineDto onlineDto, HttpHeaders headers) {
|
|
|
|
- Integer isAgreed = onlineDto.getIsAgreed();
|
|
|
|
|
|
+ public ResponseJson<Integer> clubOnline(Integer id, HttpHeaders headers) {
|
|
|
|
+ ClubTemporaryVo clubTemporary = registerMapper.getTemporary(id);
|
|
|
|
+ if (clubTemporary == null) {
|
|
|
|
+ return ResponseJson.error("机构数据异常", null);
|
|
|
|
+ }
|
|
|
|
+ Integer isAgreed = clubTemporary.getIsAgreed();
|
|
// 打印IP
|
|
// 打印IP
|
|
String ip = headers.getFirst("X-CLIENT-IP");
|
|
String ip = headers.getFirst("X-CLIENT-IP");
|
|
log.info("协销拉机构上线 X-CLIENT-IP : " + ip);
|
|
log.info("协销拉机构上线 X-CLIENT-IP : " + ip);
|
|
// 手机号
|
|
// 手机号
|
|
- String mobile = onlineDto.getBindMobile();
|
|
|
|
|
|
+ String mobile = clubTemporary.getBindMobile();
|
|
// 参数校验
|
|
// 参数校验
|
|
- if (null == onlineDto.getUserId()) {
|
|
|
|
|
|
+ if (null == clubTemporary.getUserId()) {
|
|
return ResponseJson.error("参数异常:用户Id不能为空!", null);
|
|
return ResponseJson.error("参数异常:用户Id不能为空!", null);
|
|
}
|
|
}
|
|
if (StringUtils.isBlank(mobile)) {
|
|
if (StringUtils.isBlank(mobile)) {
|
|
return ResponseJson.error("参数异常:企业绑定手机号不能为空!", null);
|
|
return ResponseJson.error("参数异常:企业绑定手机号不能为空!", null);
|
|
}
|
|
}
|
|
- if (StringUtils.isBlank(onlineDto.getLinkMan())) {
|
|
|
|
|
|
+ if (StringUtils.isBlank(clubTemporary.getLinkMan())) {
|
|
return ResponseJson.error("参数异常:联系人不能为空!", null);
|
|
return ResponseJson.error("参数异常:联系人不能为空!", null);
|
|
}
|
|
}
|
|
if (null == isAgreed || 1 != isAgreed) {
|
|
if (null == isAgreed || 1 != isAgreed) {
|
|
return ResponseJson.error("请勾选同意协议", null);
|
|
return ResponseJson.error("请勾选同意协议", null);
|
|
}
|
|
}
|
|
// 是否填写升级资料
|
|
// 是否填写升级资料
|
|
- String businessLicense = onlineDto.getBusinessLicense();
|
|
|
|
- String email = onlineDto.getContractEmail();
|
|
|
|
|
|
+ String businessLicense = clubTemporary.getBusinessLicense();
|
|
|
|
+ String email = clubTemporary.getContractEmail();
|
|
if (StringUtils.isNotBlank(businessLicense)) {
|
|
if (StringUtils.isNotBlank(businessLicense)) {
|
|
// 邮箱验证
|
|
// 邮箱验证
|
|
String emailCheck = commonService.emailValidate(email);
|
|
String emailCheck = commonService.emailValidate(email);
|
|
@@ -469,13 +459,13 @@ public class RegisterServiceImpl implements RegisterService {
|
|
return ResponseJson.error(emailCheck, null);
|
|
return ResponseJson.error(emailCheck, null);
|
|
}
|
|
}
|
|
// 机构名称检查
|
|
// 机构名称检查
|
|
- String nameCheck = ValidateUtil.validateClubName(onlineDto.getName());
|
|
|
|
|
|
+ String nameCheck = ValidateUtil.validateClubName(clubTemporary.getName());
|
|
if (nameCheck != null) {
|
|
if (nameCheck != null) {
|
|
return ResponseJson.error(nameCheck, null);
|
|
return ResponseJson.error(nameCheck, null);
|
|
}
|
|
}
|
|
- if (onlineDto.getFirstClubType() == 1) {
|
|
|
|
|
|
+ if (clubTemporary.getFirstClubType() == 1) {
|
|
// 医美分类
|
|
// 医美分类
|
|
- if (onlineDto.getSecondClubType() == null || StringUtils.isBlank(onlineDto.getMedicalPracticeLicense())) {
|
|
|
|
|
|
+ if (clubTemporary.getSecondClubType() == null || StringUtils.isBlank(clubTemporary.getMedicalPracticeLicense())) {
|
|
return ResponseJson.error("医美分类下参数异常,医美的二级分类为空或医疗执业许可证为空", null);
|
|
return ResponseJson.error("医美分类下参数异常,医美的二级分类为空或医疗执业许可证为空", null);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -486,7 +476,7 @@ public class RegisterServiceImpl implements RegisterService {
|
|
return ResponseJson.error(result, null);
|
|
return ResponseJson.error(result, null);
|
|
}
|
|
}
|
|
// 获取协销信息
|
|
// 获取协销信息
|
|
- Integer userId = onlineDto.getUserId();
|
|
|
|
|
|
+ Integer userId = clubTemporary.getUserId();
|
|
ServiceProviderVo serviceProvider = loginMapper.getServiceProviderByUserId(userId);
|
|
ServiceProviderVo serviceProvider = loginMapper.getServiceProviderByUserId(userId);
|
|
// 设置日期时间格式
|
|
// 设置日期时间格式
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
@@ -506,9 +496,9 @@ public class RegisterServiceImpl implements RegisterService {
|
|
// 用户类型,供应商1,会员机构3,普通机构4
|
|
// 用户类型,供应商1,会员机构3,普通机构4
|
|
user.setRegisterUserTypeId(4);
|
|
user.setRegisterUserTypeId(4);
|
|
// 组织名称
|
|
// 组织名称
|
|
- user.setName(onlineDto.getLinkMan());
|
|
|
|
|
|
+ user.setName(clubTemporary.getLinkMan());
|
|
// 用户名
|
|
// 用户名
|
|
- user.setUserName(onlineDto.getLinkMan());
|
|
|
|
|
|
+ user.setUserName(clubTemporary.getLinkMan());
|
|
// 绑定手机号
|
|
// 绑定手机号
|
|
user.setBindMobile(mobile);
|
|
user.setBindMobile(mobile);
|
|
// 用户身份: 1协销 2会员机构 3供应商 4普通机构
|
|
// 用户身份: 1协销 2会员机构 3供应商 4普通机构
|
|
@@ -534,7 +524,7 @@ public class RegisterServiceImpl implements RegisterService {
|
|
// 状态:待审查资料
|
|
// 状态:待审查资料
|
|
user.setClubStatus(1);
|
|
user.setClubStatus(1);
|
|
// 组织名称
|
|
// 组织名称
|
|
- user.setName(onlineDto.getName());
|
|
|
|
|
|
+ user.setName(clubTemporary.getName());
|
|
// 邮箱
|
|
// 邮箱
|
|
user.setEmail(email);
|
|
user.setEmail(email);
|
|
// 是否已经引导过(机构升级:0否,1是)
|
|
// 是否已经引导过(机构升级:0否,1是)
|
|
@@ -557,7 +547,7 @@ public class RegisterServiceImpl implements RegisterService {
|
|
// 联系手机
|
|
// 联系手机
|
|
club.setContractMobile(mobile);
|
|
club.setContractMobile(mobile);
|
|
// 联系人
|
|
// 联系人
|
|
- club.setLinkMan(onlineDto.getLinkMan());
|
|
|
|
|
|
+ club.setLinkMan(clubTemporary.getLinkMan());
|
|
// 用户Id
|
|
// 用户Id
|
|
club.setUserId(user.getUserId());
|
|
club.setUserId(user.getUserId());
|
|
// 设置协销ID
|
|
// 设置协销ID
|
|
@@ -569,45 +559,45 @@ public class RegisterServiceImpl implements RegisterService {
|
|
// 会员机构,填写升级资料
|
|
// 会员机构,填写升级资料
|
|
if (StringUtils.isNotBlank(businessLicense)) {
|
|
if (StringUtils.isNotBlank(businessLicense)) {
|
|
// 机构名称
|
|
// 机构名称
|
|
- club.setName(onlineDto.getName());
|
|
|
|
|
|
+ club.setName(clubTemporary.getName());
|
|
// 机构简称
|
|
// 机构简称
|
|
- club.setShortName(onlineDto.getShortName());
|
|
|
|
|
|
+ club.setShortName(clubTemporary.getShortName());
|
|
// 邮箱
|
|
// 邮箱
|
|
club.setContractEmail(email);
|
|
club.setContractEmail(email);
|
|
// 待审查资料
|
|
// 待审查资料
|
|
club.setStatus(1);
|
|
club.setStatus(1);
|
|
// 地址
|
|
// 地址
|
|
- club.setProvinceId(onlineDto.getProvinceId());
|
|
|
|
- club.setCityId(onlineDto.getCityId());
|
|
|
|
- club.setTownId(onlineDto.getTownId());
|
|
|
|
- club.setAddress(onlineDto.getAddress());
|
|
|
|
|
|
+ club.setProvinceId(clubTemporary.getProvinceId());
|
|
|
|
+ club.setCityId(clubTemporary.getCityId());
|
|
|
|
+ club.setTownId(clubTemporary.getTownId());
|
|
|
|
+ club.setAddress(clubTemporary.getAddress());
|
|
// 门头照
|
|
// 门头照
|
|
- club.setShopPhoto(onlineDto.getShopPhoto());
|
|
|
|
|
|
+ club.setShopPhoto(clubTemporary.getShopPhoto());
|
|
// 营业执照
|
|
// 营业执照
|
|
club.setBusinessLicense(businessLicense);
|
|
club.setBusinessLicense(businessLicense);
|
|
// 统一社会信用代码
|
|
// 统一社会信用代码
|
|
- club.setSocialCreditCode(onlineDto.getSocialCreditCode());
|
|
|
|
|
|
+ club.setSocialCreditCode(clubTemporary.getSocialCreditCode());
|
|
// 分类: 1医美, 2生美
|
|
// 分类: 1医美, 2生美
|
|
- club.setFirstClubType(onlineDto.getFirstClubType());
|
|
|
|
- if (onlineDto.getFirstClubType() == 1) {
|
|
|
|
|
|
+ club.setFirstClubType(clubTemporary.getFirstClubType());
|
|
|
|
+ if (clubTemporary.getFirstClubType() == 1) {
|
|
// 医美二级分类: 1诊所、2门诊、3医院
|
|
// 医美二级分类: 1诊所、2门诊、3医院
|
|
- club.setSecondClubType(onlineDto.getSecondClubType());
|
|
|
|
|
|
+ club.setSecondClubType(clubTemporary.getSecondClubType());
|
|
// 门诊和医院则需要填写科室
|
|
// 门诊和医院则需要填写科室
|
|
- club.setDepartment(onlineDto.getDepartment());
|
|
|
|
|
|
+ club.setDepartment(clubTemporary.getDepartment());
|
|
// 医美分类必须上传医疗执业许可证
|
|
// 医美分类必须上传医疗执业许可证
|
|
- club.setMedicalPracticeLicense(onlineDto.getMedicalPracticeLicense());
|
|
|
|
|
|
+ club.setMedicalPracticeLicense(clubTemporary.getMedicalPracticeLicense());
|
|
}
|
|
}
|
|
// 主打项目(mainpro)
|
|
// 主打项目(mainpro)
|
|
- club.setMainProduct(onlineDto.getMainProduct());
|
|
|
|
|
|
+ club.setMainProduct(clubTemporary.getMainProduct());
|
|
/*
|
|
/*
|
|
保存数据库(会员机构) club
|
|
保存数据库(会员机构) club
|
|
*/
|
|
*/
|
|
insertClubFlag = registerMapper.insertUpgradeClub(club);
|
|
insertClubFlag = registerMapper.insertUpgradeClub(club);
|
|
} else {
|
|
} else {
|
|
// 机构名称
|
|
// 机构名称
|
|
- club.setName(onlineDto.getLinkMan());
|
|
|
|
|
|
+ club.setName(clubTemporary.getLinkMan());
|
|
// 机构简称
|
|
// 机构简称
|
|
- club.setShortName(onlineDto.getLinkMan());
|
|
|
|
|
|
+ club.setShortName(clubTemporary.getLinkMan());
|
|
// 状态设置上线
|
|
// 状态设置上线
|
|
club.setStatus(90);
|
|
club.setStatus(90);
|
|
/*
|
|
/*
|
|
@@ -636,16 +626,17 @@ public class RegisterServiceImpl implements RegisterService {
|
|
logTxt = String.format(logTxt, "普通机构", mobile, initPassword);
|
|
logTxt = String.format(logTxt, "普通机构", mobile, initPassword);
|
|
}
|
|
}
|
|
// 发送短信
|
|
// 发送短信
|
|
- boolean smsFlag = AliyunSmsUtil.sendSms(mobile, 6, "{name:"+ mobile +",content:"+ randomCode +"}");
|
|
|
|
|
|
+ boolean smsFlag = AliyunSmsUtil.sendSms(mobile, 6, "{name:" + mobile + ",content:" + randomCode + "}");
|
|
if (!smsFlag) {
|
|
if (!smsFlag) {
|
|
// 短信发送失败重试一次
|
|
// 短信发送失败重试一次
|
|
- AliyunSmsUtil.sendSms(mobile, 6, "{name:"+ mobile +",content:"+ randomCode +"}");
|
|
|
|
|
|
+ AliyunSmsUtil.sendSms(mobile, 6, "{name:" + mobile + ",content:" + randomCode + "}");
|
|
}
|
|
}
|
|
// 打印短信内容
|
|
// 打印短信内容
|
|
log.info(logTxt);
|
|
log.info(logTxt);
|
|
if (!smsFlag) {
|
|
if (!smsFlag) {
|
|
- log.info("短信发送失败,手机号:"+mobile);
|
|
|
|
|
|
+ log.info("短信发送失败,手机号:" + mobile);
|
|
}
|
|
}
|
|
|
|
+ sellerMapper.deleteTemporaryClub(id);
|
|
// 返回状态
|
|
// 返回状态
|
|
return ResponseJson.success(user.getUserId());
|
|
return ResponseJson.success(user.getUserId());
|
|
}
|
|
}
|
|
@@ -813,6 +804,8 @@ public class RegisterServiceImpl implements RegisterService {
|
|
shop.setValidFlag("1");
|
|
shop.setValidFlag("1");
|
|
// 供应商:90:已上线,91:已下线,92:审核不通过,3:待审核
|
|
// 供应商:90:已上线,91:已下线,92:审核不通过,3:待审核
|
|
shop.setStatus(3);
|
|
shop.setStatus(3);
|
|
|
|
+ //如选择为医疗>>三类器械 则必须要上传资质
|
|
|
|
+ shop.setMedicalPracticeLicenseImg1(shopRegisterDto.getMedicalPracticeLicense());
|
|
/*
|
|
/*
|
|
保存数据库 shop
|
|
保存数据库 shop
|
|
*/
|
|
*/
|
|
@@ -882,5 +875,49 @@ public class RegisterServiceImpl implements RegisterService {
|
|
return ResponseJson.success();
|
|
return ResponseJson.success();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public ResponseJson<Integer> clubTemporary(ClubOnlineDto onlineDto) {
|
|
|
|
+ if (StringUtils.isNotBlank(onlineDto.getBusinessLicense())) {
|
|
|
|
+ // 邮箱验证
|
|
|
|
+ String emailCheck = commonService.emailValidate(onlineDto.getContractEmail());
|
|
|
|
+ if (emailCheck != null) {
|
|
|
|
+ return ResponseJson.error(emailCheck, null);
|
|
|
|
+ }
|
|
|
|
+ // 机构名称检查
|
|
|
|
+ String nameCheck = ValidateUtil.validateClubName(onlineDto.getName());
|
|
|
|
+ if (nameCheck != null) {
|
|
|
|
+ return ResponseJson.error(nameCheck, null);
|
|
|
|
+ }
|
|
|
|
+ if (onlineDto.getFirstClubType() == 1) {
|
|
|
|
+ // 医美分类
|
|
|
|
+ if (onlineDto.getSecondClubType() == null || StringUtils.isBlank(onlineDto.getMedicalPracticeLicense())) {
|
|
|
|
+ return ResponseJson.error("医美分类下参数异常,医美的二级分类为空或医疗执业许可证为空", null);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 手机号验证
|
|
|
|
+ String result = commonService.mobileAndCodeValidate(onlineDto.getBindMobile(), null);
|
|
|
|
+ if (result != null) {
|
|
|
|
+ return ResponseJson.error(result, null);
|
|
|
|
+ }
|
|
|
|
+ registerMapper.insertClubTemporary(onlineDto);
|
|
|
|
+ return ResponseJson.success(onlineDto.getUserId());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public ResponseJson<ClubTemporaryVo> temporaryData(Integer id) {
|
|
|
|
+ ClubTemporaryVo clubTemporary = registerMapper.getTemporary(id);
|
|
|
|
+ if (clubTemporary == null) {
|
|
|
|
+ return ResponseJson.error("用户资料不存在", null);
|
|
|
|
+ }
|
|
|
|
+ if (null != clubTemporary.getTownId()) {
|
|
|
|
+ TownVo town = baseMapper.getTown(clubTemporary.getTownId());
|
|
|
|
+ CityVo city = baseMapper.getCity(town.getCityId());
|
|
|
|
+ ProvinceVo province = baseMapper.getProvince(city.getProvinceId());
|
|
|
|
+ clubTemporary.setProvincialAddress(province.getName() + "" + city.getName() + "" + town.getName());
|
|
|
|
+ }
|
|
|
|
+ return ResponseJson.success(clubTemporary);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|