|
@@ -3,6 +3,7 @@ package com.hcloud.microserver.h5.service.impl;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.hcloud.microserver.commoncore.exception.Asserts;
|
|
|
+import com.hcloud.microserver.commoncore.util.TracedCodeUtils;
|
|
|
import com.hcloud.microserver.h5.bo.CustomerDetails;
|
|
|
import com.hcloud.microserver.h5.bo.CustomerInfoBO;
|
|
|
import com.hcloud.microserver.h5.dao.*;
|
|
@@ -349,7 +350,8 @@ public class CustomerInfoServiceImpl implements CustomerInfoService {
|
|
|
if (null == customerInfo) {
|
|
|
customerInfo = new CustomerInfo();
|
|
|
//设置唯一标识
|
|
|
- customerInfo.setGuid(GetUUID.getUUID());
|
|
|
+ String uuid = GetUUID.getUUID();
|
|
|
+ customerInfo.setGuid(uuid);
|
|
|
customerInfo.setUnionId(unionId);
|
|
|
customerInfo.setWxId(openId);
|
|
|
customerInfo.setSex(sex);
|
|
@@ -357,10 +359,24 @@ public class CustomerInfoServiceImpl implements CustomerInfoService {
|
|
|
customerInfo.setPhone(phone);
|
|
|
}
|
|
|
customerInfo.setNickName(nickname);
|
|
|
+ //默认设置为自己的昵称
|
|
|
+ customerInfo.setCustomerName(nickname);
|
|
|
customerInfo.setHeadImage(headImgUrl);
|
|
|
customerInfo.setIsCompany(0);
|
|
|
//状态设置为可用
|
|
|
customerInfo.setIsEnable(1);
|
|
|
+ customerInfo.setCreateTime(new Date());
|
|
|
+ customerInfo.setCreateUser(uuid);
|
|
|
+ //设置为自然人
|
|
|
+ customerInfo.setCustomerType(1);
|
|
|
+ //0 为未认证
|
|
|
+ customerInfo.setIsValidate(0);
|
|
|
+ //默认密码
|
|
|
+ String s = Md5Util.toMD5("000000");
|
|
|
+ customerInfo.setPasswd(s);
|
|
|
+ //设置登陆账号
|
|
|
+ String commonRandomCode = TracedCodeUtils.getCommonRandomCode();
|
|
|
+ customerInfo.setAccount(commonRandomCode);
|
|
|
customerInfoMapper.insertSelective(customerInfo);
|
|
|
} else {
|
|
|
customerInfo.setUnionId(unionId);
|
|
@@ -371,12 +387,16 @@ public class CustomerInfoServiceImpl implements CustomerInfoService {
|
|
|
}
|
|
|
customerInfo.setNickName(nickname);
|
|
|
customerInfo.setHeadImage(headImgUrl);
|
|
|
+ customerInfo.setModifiedUser(customerInfo.getGuid());
|
|
|
+ customerInfo.setModifiedTime(new Date());
|
|
|
customerInfoMapper.updateByPrimaryKeySelective(customerInfo);
|
|
|
}
|
|
|
return customerInfo.getGuid();
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public int delByPrimaryKey(String guid) {
|
|
|
return customerInfoMapper.deleteByPrimaryKey(guid);
|