|
@@ -12,7 +12,9 @@ import com.qs.mp.channel.mapper.ChannelMapper;
|
|
|
import com.qs.mp.channel.service.IChannelCommissionService;
|
|
|
import com.qs.mp.channel.service.IChannelService;
|
|
|
import com.qs.mp.channel.service.IChannelUserRelService;
|
|
|
+import com.qs.mp.common.enums.ChannelCertifyStatusEnum;
|
|
|
import com.qs.mp.common.enums.ChannelRoleEnum;
|
|
|
+import com.qs.mp.common.enums.ChannelVerifyStatusEnum;
|
|
|
import com.qs.mp.common.enums.RoleTypeEnum;
|
|
|
import com.qs.mp.common.exception.ServiceException;
|
|
|
import com.qs.mp.common.jsms.JSMSUtils;
|
|
@@ -196,27 +198,33 @@ public class ChannelServiceImpl extends ServiceImpl<ChannelMapper, Channel> impl
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public boolean siteVerify(Channel channel) {
|
|
|
|
|
|
- // 更新经销商信息
|
|
|
- channelService.updateById(channel);
|
|
|
+ if(channel.getVerifyStatus() == ChannelVerifyStatusEnum.ACCEPT) {
|
|
|
+ channel.setCertifyStatus(ChannelCertifyStatusEnum.CERTIFIED);
|
|
|
+
|
|
|
+ // 设置保存地址信息
|
|
|
+ UserAddr userAddr = new UserAddr();
|
|
|
+ userAddr.setUserId(channel.getUserId());
|
|
|
+ userAddr.setReceiver(channel.getContact());
|
|
|
+ userAddr.setProvince(channel.getProvince());
|
|
|
+ userAddr.setProvinceId(channel.getProvinceId());
|
|
|
+ userAddr.setCity(channel.getCity());
|
|
|
+ userAddr.setCityId(channel.getCityId());
|
|
|
+ userAddr.setArea(channel.getArea());
|
|
|
+ userAddr.setAreaId(channel.getAreaId());
|
|
|
+ userAddr.setAddr(channel.getAddress());
|
|
|
+ userAddr.setMobile(channel.getMobile());
|
|
|
+ userAddr.setStatus(1);
|
|
|
+ int count = userAddrService.count(new LambdaQueryWrapper<UserAddr>().eq(UserAddr::getUserId, channel.getUserId()));
|
|
|
+ if (count == 0) {
|
|
|
+ userAddr.setCommonAddr(1);
|
|
|
+ }
|
|
|
+ userAddrService.save(userAddr);
|
|
|
|
|
|
- // 设置保存地址信息
|
|
|
- UserAddr userAddr = new UserAddr();
|
|
|
- userAddr.setUserId(channel.getUserId());
|
|
|
- userAddr.setReceiver(channel.getContact());
|
|
|
- userAddr.setProvince(channel.getProvince());
|
|
|
- userAddr.setProvinceId(channel.getProvinceId());
|
|
|
- userAddr.setCity(channel.getCity());
|
|
|
- userAddr.setCityId(channel.getCityId());
|
|
|
- userAddr.setArea(channel.getArea());
|
|
|
- userAddr.setAreaId(channel.getAreaId());
|
|
|
- userAddr.setAddr(channel.getAddress());
|
|
|
- userAddr.setMobile(channel.getMobile());
|
|
|
- userAddr.setStatus(1);
|
|
|
- int count = userAddrService.count(new LambdaQueryWrapper<UserAddr>().eq(UserAddr::getUserId, channel.getUserId()));
|
|
|
- if (count == 0) {
|
|
|
- userAddr.setCommonAddr(1);
|
|
|
+ }else {
|
|
|
+ channel.setCertifyStatus(ChannelCertifyStatusEnum.NOT_CERTIFIED);
|
|
|
}
|
|
|
- userAddrService.save(userAddr);
|
|
|
+ // 更新经销商信息
|
|
|
+ channelService.updateById(channel);
|
|
|
|
|
|
return true;
|
|
|
}
|