dev-discount
袁野 3 years ago
commit 5513785f13
  1. 1
      hai-bweb/src/main/java/com/bweb/controller/HighTestController.java
  2. 2
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  3. 99
      hai-cweb/src/main/java/com/cweb/controller/WechatController.java
  4. 47
      hai-schedule/src/main/java/com/hai/config/SwaggerConfig.java
  5. 2
      hai-schedule/src/main/java/com/hai/schedule/HighCouponSchedule.java
  6. 1
      hai-schedule/src/main/java/com/hai/schedule/HighTestController.java
  7. 32
      hai-schedule/src/main/resources/dev/application.yml
  8. 32
      hai-schedule/src/main/resources/pre/application.yml
  9. 14
      hai-schedule/src/main/resources/prod/application.yml
  10. 98
      hai-schedule/src/test/common/test.java
  11. 132
      hai-service/src/main/java/com/hai/config/UnionUserConfig.java
  12. 13
      hai-service/src/main/java/com/hai/dao/HighUserMapper.java
  13. 14
      hai-service/src/main/java/com/hai/dao/HighUserSqlProvider.java
  14. 19
      hai-service/src/main/java/com/hai/entity/HighUser.java
  15. 60
      hai-service/src/main/java/com/hai/entity/HighUserExample.java
  16. 8
      hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java

@ -0,0 +1 @@
package com.bweb.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.XmlUtil; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.WxUtils; import com.hai.config.*; import com.hai.dao.HighGasOrderPushMapper; import com.hai.entity.*; import com.hai.model.HighMerchantModel; import com.hai.model.HighMerchantStoreModel; import com.hai.model.ResponseData; import com.hai.model.ResultProfitSharing; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.ssl.SSLContexts; import org.apache.http.util.EntityUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import javax.net.ssl.SSLContext; import java.io.FileInputStream; import java.math.BigDecimal; import java.security.KeyStore; import java.util.*; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private HighMerchantService highMerchantService; @Resource private HighMerchantStoreService highMerchantStoreService; @Resource private HighGasOilPriceService highGasOilPriceService; @Resource private HighOrderService highOrderService; @Resource private HighProfitSharingRecordService highProfitSharingRecordService; @Resource private HighGasOrderPushMapper highGasOrderPushMapper; @Resource private HuiLianTongConfig huiLianTongConfig; @Resource private UnionPayConfig unionPayConfig; @RequestMapping(value = "/getBackendToken", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取访问令牌backendToken") public ResponseData getBackendToken() { try { return ResponseMsgUtil.success(UnionUserConfig.getBackendToken()); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } }

File diff suppressed because one or more lines are too long

@ -17,6 +17,7 @@ import com.hai.common.exception.SysCode;
import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.IDGenerator;
import com.hai.common.utils.RedisUtil;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.HighUser;
@ -116,6 +117,80 @@ public class WechatController {
}
}
@RequestMapping(value = "/loginByPhone", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "小程序根据手机号登录或注册")
public ResponseData loginByPhone(@RequestParam(value = "encryptedData", required = true) String encryptedData,
@RequestParam(value = "iv", required = true) String iv,
@RequestParam(value = "openId", required = true) String openId,
HttpServletRequest request, HttpServletResponse response) {
try {
log.error("origin encryptedData:" + encryptedData + ";iv:" + iv);
//校验openId不能为空
//encryptedData,iv与unionId不能同时为空
encryptedData = encryptedData.replace(" ", "+");
iv = iv.replace(" ", "+");
log.error("dest encryptedData:" + encryptedData + ";iv:" + iv);
if (StringUtils.isEmpty(openId)
|| StringUtils.isEmpty(encryptedData) || StringUtils.isEmpty(iv)) {
throw ErrorHelp.genException(SysCode.MiniProgram, ErrorCode.REQ_PARAMS_ERROR, "");
}
//请求微信api,获取用户session_key以及openId
Object skObject = redisUtil.hget(WX_OPENID_SESSION_REDIS,openId);
if (skObject == null){
throw ErrorHelp.genException(SysCode.MiniProgram, ErrorCode.WECHAT_LOGIN_ERROR);
}
WxMaJscode2SessionResult session = (WxMaJscode2SessionResult)skObject;
final WxMaService wxService = WxMaConfiguration.getMaService();
WxMaPhoneNumberInfo phoneNoInfo = wxService.getUserService().getPhoneNoInfo(session.getSessionKey(), encryptedData, iv);
if (phoneNoInfo == null || StringUtils.isEmpty(phoneNoInfo.getPurePhoneNumber())) {
throw ErrorHelp.genException(SysCode.MiniProgram, ErrorCode.WECHAT_DECRYPT_ERROR, "用户phoneNumber解析失败");
}
HighUser user = highUserService.findByOpenId(session.getOpenid());
if (user != null) {
if (StringUtils.isBlank(user.getPhone())) {
if (highUserService.findByPhone(phoneNoInfo.getPurePhoneNumber()) != null) {
throw ErrorHelp.genException(SysCode.MiniProgram, ErrorCode.COMMON_ERROR, "手机号已被绑定,请更换后重新授权");
}
user.setPhone(phoneNoInfo.getPurePhoneNumber());
}
} else {
if (highUserService.findByPhone(phoneNoInfo.getPurePhoneNumber()) != null) {
throw ErrorHelp.genException(SysCode.MiniProgram, ErrorCode.COMMON_ERROR, "手机号已被绑定,请更换后重新授权");
}
user = new HighUser();
user.setName("用户" + IDGenerator.nextId(5));
user.setPhone(phoneNoInfo.getPurePhoneNumber());
user.setRegTime(new Date());
user.setGold(0);
user.setOpenId(session.getOpenid());
user.setUnionId(session.getUnionid());
user.setStatus(1);
// 用户信息完整状态
// 0:完整
// 1:需要填写用户信息
// 2:需要填写手机号
user.setInfoCompleteStatus(1);
highUserService.insertUser(user);
}
// 定义个人所有数据
HighUserModel highUserModel = new HighUserModel();
HighUser detailData = highUserService.getDetailDataByUser(user.getId());
detailData.setPassword(null);
highUserModel.setHighUser(detailData);
SessionObject so = new SessionObject(user.getUnionId(), 1 , highUserModel);
userCenter.save(request, response, so);
return ResponseMsgUtil.success(so);
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getPhoneNumber", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "小程序获取用户手机号码")
@ -206,8 +281,20 @@ public class WechatController {
user.setGold(0);
user.setHeaderImg(userInfo.getAvatarUrl());
user.setName(userInfo.getNickName());
user.setInfoCompleteStatus(2);
highUserService.insertUser(user);
} else {
// 用户信息完整状态
// 0:完整
// 1:需要填写用户信息
// 2:需要填写手机号
if (user.getInfoCompleteStatus() == 1) {
if (StringUtils.isNotBlank(user.getPhone())) {
user.setInfoCompleteStatus(0);
} else {
user.setInfoCompleteStatus(2);
}
}
user.setUnionId(session.getUnionid());
user.setHeaderImg(userInfo.getAvatarUrl());
user.setName(userInfo.getNickName());
@ -323,8 +410,20 @@ public class WechatController {
user.setGold(0);
user.setHeaderImg(userInfo.getString("headimgurl"));
user.setName(userInfo.getString("nickname"));
user.setInfoCompleteStatus(2);
highUserService.insertUser(user);
} else {
// 用户信息完整状态
// 0:完整
// 1:需要填写用户信息
// 2:需要填写手机号
if (user.getInfoCompleteStatus() == 1) {
if (StringUtils.isNotBlank(user.getPhone())) {
user.setInfoCompleteStatus(0);
} else {
user.setInfoCompleteStatus(2);
}
}
user.setOpenIdH5(openid);
user.setHeaderImg(userInfo.getString("headimgurl"));
user.setName(userInfo.getString("nickname"));

@ -0,0 +1,47 @@
package com.hai.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* SwaggerConfig.java
* 项目名称:
* :
* 类名称: SwaggerConfig.java
* 类描述: 构建restful api接口文档
* 创建人:
* 创建时间: 2017 下午4:23:45
*/
@Configuration
@EnableSwagger2
public class SwaggerConfig
{
/**
* 描述api的基本信息
* 基本信息会展现在文档页面中
* @return [api的基本信息]
*/
ApiInfo apiInfo()
{
return new ApiInfoBuilder().title("hgj-CWeb").description("提供给用户端的接口").termsOfServiceUrl("").version("1.0.0")
.contact(new Contact("", "", "")).build();
}
@Bean
public Docket customImplementation()
{
return new Docket(DocumentationType.SWAGGER_2).select()
.apis(RequestHandlerSelectors.basePackage("com"))
.build().directModelSubstitute(org.joda.time.LocalDate.class, java.sql.Date.class)
.directModelSubstitute(org.joda.time.DateTime.class, java.util.Date.class).apiInfo(apiInfo());
}
}

@ -68,7 +68,7 @@ public class HighCouponSchedule {
* @Description 处理汇联卡券状态
* @Date 2021/4/4 22:44
**/
@Scheduled(cron="0 0/30 * * * ?") //每30分钟执行一次
@Scheduled(cron="0 0/10 * * * ?") //每10分钟执行一次
public void handleCouponStatus() throws Exception {
HighCouponCodeOtherExample example = new HighCouponCodeOtherExample();

@ -0,0 +1 @@
package com.hai.schedule; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.XmlUtil; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.WxUtils; import com.hai.config.*; import com.hai.dao.HighGasOrderPushMapper; import com.hai.entity.*; import com.hai.model.HighMerchantModel; import com.hai.model.HighMerchantStoreModel; import com.hai.model.ResponseData; import com.hai.model.ResultProfitSharing; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.ssl.SSLContexts; import org.apache.http.util.EntityUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import javax.net.ssl.SSLContext; import java.io.FileInputStream; import java.math.BigDecimal; import java.security.KeyStore; import java.util.*; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private HighMerchantService highMerchantService; @Resource private HighMerchantStoreService highMerchantStoreService; @Resource private HighGasOilPriceService highGasOilPriceService; @Resource private HighOrderService highOrderService; @Resource private HighProfitSharingRecordService highProfitSharingRecordService; @Resource private HighGasOrderPushMapper highGasOrderPushMapper; @Resource private HuiLianTongConfig huiLianTongConfig; @Resource private UnionPayConfig unionPayConfig; @RequestMapping(value = "/getToken", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取贵州中石化token") public ResponseData getToken() { try { return ResponseMsgUtil.success(huiLianTongConfig.getToken()); } catch (Exception e) { log.error("HighOrderController --> getToken() error!", e); return ResponseMsgUtil.exception(e); } } }

@ -27,10 +27,42 @@ spring:
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
redis:
database: 0
host: 139.159.177.244
port: 36379
password: HF123456.Redis
timeout: 1000
jedis:
pool:
max-active: 20
max-wait: -1
max-idle: 10
min-idle: 0
#thymelea模板配置
thymeleaf:
prefix: classpath:/templates/
suffix: .html
mode: HTML5
encoding: UTF-8
#热部署文件,页面不产生缓存,及时更新
cache: false
#配置日期返回至前台为时间戳
jackson:
serialization:
write-dates-as-timestamps: true
thymeleaf:
cache: false
prefix: classpath:/templates/
suffix: .html
encoding: UTF-8
content-type: text/html
mode: HTML5
mybatis:
mapperLocations:
- classpath*:sqlmap*/*.xml

@ -27,10 +27,42 @@ spring:
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
redis:
database: 0
host: 139.159.177.244
port: 36379
password: HF123456.Redis
timeout: 1000
jedis:
pool:
max-active: 20
max-wait: -1
max-idle: 10
min-idle: 0
#thymelea模板配置
thymeleaf:
prefix: classpath:/templates/
suffix: .html
mode: HTML5
encoding: UTF-8
#热部署文件,页面不产生缓存,及时更新
cache: false
#配置日期返回至前台为时间戳
jackson:
serialization:
write-dates-as-timestamps: true
thymeleaf:
cache: false
prefix: classpath:/templates/
suffix: .html
encoding: UTF-8
content-type: text/html
mode: HTML5
mybatis:
mapperLocations:
- classpath*:sqlmap*/*.xml

@ -27,6 +27,20 @@ spring:
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
redis:
database: 0
host: 127.0.0.1
port: 36379
password: HF123456.Redis
timeout: 1000
jedis:
pool:
max-active: 20
max-wait: -1
max-idle: 10
min-idle: 0
#thymelea模板配置
thymeleaf:
prefix: classpath:/templates/

@ -0,0 +1,98 @@
package common;
import com.alibaba.fastjson.JSONObject;
import com.hai.ScheduleApplication;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.RedisUtil;
import com.hai.config.HuiLianTongConfig;
import com.hai.service.HighDiscountAgentCodeService;
import com.hai.service.HighDiscountUserRelService;
import com.hai.service.HighUserService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @ClassName RegionTest
* @Description: TODO ()
* @Author 胡锐
* @Date 2020/12/29
**/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = ScheduleApplication.class)
@WebAppConfiguration
public class test {
@Resource
private HighUserService highUserService;
@Resource
private HighDiscountUserRelService highDiscountUserRelService;
@Resource
private HighDiscountAgentCodeService highDiscountAgentCodeService;
@Resource
private RedisUtil redisUtil;
@Resource
private HuiLianTongConfig huiLianTongConfig;
@Test
public void test(){
try {
huiLianTongConfig.getToken();
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
requestOrder();
}
public static void requestOrder(){
Map<String, Object> heard = new HashMap<>();
heard.put("Cookie", "_ida=oArhO6XxKSvjI9wLP3cTK-iSG8yY");
Map<String, Object> map = new HashMap<>();;
map.put("goodsId", "23423529");
map.put("goodsType", "1");
map.put("saleCount", "1");
List<Map<String, Object>> orderList = new ArrayList<>();
orderList.add(map);
Map<String, Object> param = new HashMap<>();
param.put("highChildOrderList", orderList);
int success = 0 ;
int fail = 0;
JSONObject object = HttpsUtils.doPost("https://hsgcs.dctpay.com/crest/highOrder/addOrder", param, heard);
if (object.getString("return_code").equals("000000")) {
success++;
System.out.println("提交订单成功");
} else {
fail++;
System.out.println(object.getString("return_msg"));
}
System.out.println("成功数量" + success);
System.out.println("失败数量" + fail);
}
}

@ -0,0 +1,132 @@
package com.hai.config;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.pay.util.sdk.WXPayConstants;
import com.hai.common.utils.HttpsUtils;
import org.apache.commons.lang3.StringUtils;
import javax.xml.bind.DatatypeConverter;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.util.*;
/**
* 银联用户信息
* @author hurui
*/
public class UnionUserConfig {
private static String requestUrl = "https://open.95516.com/open/access/1.0/backendToken";
private static String appId = "1900bc84497cab3b";
private static String secret = "665193ddd44248acb461594cfe0ded5b";
/**
* 获取应用访问令牌backendToken
* @return
*/
public static JSONObject getBackendToken() {
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("appId", appId);
paramMap.put("nonceStr", createNonceStr());
paramMap.put("timestamp", System.currentTimeMillis());
paramMap.put("signature", generateSign(paramMap));
return HttpsUtils.doPost(requestUrl, JSONObject.toJSONString(paramMap));
}
/**
* 参数排序
* @param param
* @return
*/
private static String paramSort(final Map<String, Object> param) {
Set<String> keySet = param.keySet();
String[] keyArray = keySet.toArray(new String[keySet.size()]);
Arrays.sort(keyArray);
StringBuilder sb = new StringBuilder();
for (String k : keyArray) {
if (k.equals(WXPayConstants.FIELD_SIGN)) {
continue;
}
if (StringUtils.isBlank(sb.toString())) {
sb.append(k).append("=").append(param.get(k));
} else {
sb.append("&").append(k).append("=").append(param.get(k));
}
}
param.remove("secret");
return sb.toString();
}
/**
* 生成签名
* @param data
* @return
* @throws Exception
*/
private static String generateSign(Map<String, Object> data){
data.put("secret", secret);
String sign = sha256(paramSort(data).getBytes());
return sign;
}
/**
* 生成随机16位随机字符串
* @return
*/
public static String createNonceStr(){
String sl = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
StringBuilder sb = new StringBuilder();
for(int i = 0 ; i < 16 ; i ++){
sb.append(sl.charAt(new Random().nextInt(sl.length())));
}
return sb.toString();
}
public static String sha256(byte[] data) {
try {
MessageDigest md = MessageDigest.getInstance("SHA-256");
return bytesToHex(md.digest(data));
} catch (Exception ex) {
return null;
}
}
public static String bytesToHex(byte[] bytes) {
String hexArray = "0123456789abcdef";
StringBuilder sb = new StringBuilder(bytes.length * 2);
for (byte b : bytes) {
int bi = b & 0xff;
sb.append(hexArray.charAt(bi >> 4));
sb.append(hexArray.charAt(bi & 0xf));
}
return sb.toString();
}
public static Map<String, Object> generatorRSA(){
KeyPairGenerator keyGen = null;
try {
keyGen = KeyPairGenerator.getInstance("RSA");
keyGen.initialize(1024);
KeyPair keyPair = keyGen.generateKeyPair();
RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic();
RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate();
String publicKeyBase64 = DatatypeConverter.printBase64Binary(publicKey.getEncoded());
String privateKeyBase64 = DatatypeConverter.printBase64Binary(privateKey.getEncoded());
Map<String, Object> map = new HashMap<>();
map.put("publicKey", publicKeyBase64);
map.put("privateKey", privateKeyBase64);
return map;
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
return null;
}
}

@ -44,15 +44,15 @@ public interface HighUserMapper extends HighUserMapperExt {
"sex, birthdate, reg_time, ",
"gold, `status`, open_id, ",
"open_id_h5, union_id, ",
"ext_1, ext_2, ext_3, ",
"ext_4)",
"info_complete_status, ext_1, ",
"ext_2, ext_3, ext_4)",
"values (#{headerImg,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, ",
"#{phone,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, ",
"#{sex,jdbcType=VARCHAR}, #{birthdate,jdbcType=DATE}, #{regTime,jdbcType=TIMESTAMP}, ",
"#{gold,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{openId,jdbcType=VARCHAR}, ",
"#{openIdH5,jdbcType=VARCHAR}, #{unionId,jdbcType=VARCHAR}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, ",
"#{ext4,jdbcType=VARCHAR})"
"#{infoCompleteStatus,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, #{ext4,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighUser record);
@ -76,6 +76,7 @@ public interface HighUserMapper extends HighUserMapperExt {
@Result(column="open_id", property="openId", jdbcType=JdbcType.VARCHAR),
@Result(column="open_id_h5", property="openIdH5", jdbcType=JdbcType.VARCHAR),
@Result(column="union_id", property="unionId", jdbcType=JdbcType.VARCHAR),
@Result(column="info_complete_status", property="infoCompleteStatus", jdbcType=JdbcType.INTEGER),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR),
@ -86,7 +87,7 @@ public interface HighUserMapper extends HighUserMapperExt {
@Select({
"select",
"id, header_img, `name`, phone, `password`, sex, birthdate, reg_time, gold, `status`, ",
"open_id, open_id_h5, union_id, ext_1, ext_2, ext_3, ext_4",
"open_id, open_id_h5, union_id, info_complete_status, ext_1, ext_2, ext_3, ext_4",
"from high_user",
"where id = #{id,jdbcType=BIGINT}"
})
@ -104,6 +105,7 @@ public interface HighUserMapper extends HighUserMapperExt {
@Result(column="open_id", property="openId", jdbcType=JdbcType.VARCHAR),
@Result(column="open_id_h5", property="openIdH5", jdbcType=JdbcType.VARCHAR),
@Result(column="union_id", property="unionId", jdbcType=JdbcType.VARCHAR),
@Result(column="info_complete_status", property="infoCompleteStatus", jdbcType=JdbcType.INTEGER),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR),
@ -134,6 +136,7 @@ public interface HighUserMapper extends HighUserMapperExt {
"open_id = #{openId,jdbcType=VARCHAR},",
"open_id_h5 = #{openIdH5,jdbcType=VARCHAR},",
"union_id = #{unionId,jdbcType=VARCHAR},",
"info_complete_status = #{infoCompleteStatus,jdbcType=INTEGER},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR},",

@ -76,6 +76,10 @@ public class HighUserSqlProvider {
sql.VALUES("union_id", "#{unionId,jdbcType=VARCHAR}");
}
if (record.getInfoCompleteStatus() != null) {
sql.VALUES("info_complete_status", "#{infoCompleteStatus,jdbcType=INTEGER}");
}
if (record.getExt1() != null) {
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}");
}
@ -114,6 +118,7 @@ public class HighUserSqlProvider {
sql.SELECT("open_id");
sql.SELECT("open_id_h5");
sql.SELECT("union_id");
sql.SELECT("info_complete_status");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
@ -187,6 +192,10 @@ public class HighUserSqlProvider {
sql.SET("union_id = #{record.unionId,jdbcType=VARCHAR}");
}
if (record.getInfoCompleteStatus() != null) {
sql.SET("info_complete_status = #{record.infoCompleteStatus,jdbcType=INTEGER}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
@ -224,6 +233,7 @@ public class HighUserSqlProvider {
sql.SET("open_id = #{record.openId,jdbcType=VARCHAR}");
sql.SET("open_id_h5 = #{record.openIdH5,jdbcType=VARCHAR}");
sql.SET("union_id = #{record.unionId,jdbcType=VARCHAR}");
sql.SET("info_complete_status = #{record.infoCompleteStatus,jdbcType=INTEGER}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
@ -286,6 +296,10 @@ public class HighUserSqlProvider {
sql.SET("union_id = #{unionId,jdbcType=VARCHAR}");
}
if (record.getInfoCompleteStatus() != null) {
sql.SET("info_complete_status = #{infoCompleteStatus,jdbcType=INTEGER}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}");
}

@ -67,9 +67,6 @@ public class HighUser extends UserModel implements Serializable {
private String openId;
/**
* H5openId
*/
private String openIdH5;
/**
@ -77,6 +74,11 @@ public class HighUser extends UserModel implements Serializable {
*/
private String unionId;
/**
* 用户信息完整状态 0完整 1需要填写用户信息 2需要填写手机号
*/
private Integer infoCompleteStatus;
private String ext1;
private String ext2;
@ -191,6 +193,14 @@ public class HighUser extends UserModel implements Serializable {
this.unionId = unionId;
}
public Integer getInfoCompleteStatus() {
return infoCompleteStatus;
}
public void setInfoCompleteStatus(Integer infoCompleteStatus) {
this.infoCompleteStatus = infoCompleteStatus;
}
public String getExt1() {
return ext1;
}
@ -248,6 +258,7 @@ public class HighUser extends UserModel implements Serializable {
&& (this.getOpenId() == null ? other.getOpenId() == null : this.getOpenId().equals(other.getOpenId()))
&& (this.getOpenIdH5() == null ? other.getOpenIdH5() == null : this.getOpenIdH5().equals(other.getOpenIdH5()))
&& (this.getUnionId() == null ? other.getUnionId() == null : this.getUnionId().equals(other.getUnionId()))
&& (this.getInfoCompleteStatus() == null ? other.getInfoCompleteStatus() == null : this.getInfoCompleteStatus().equals(other.getInfoCompleteStatus()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2()))
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3()))
@ -271,6 +282,7 @@ public class HighUser extends UserModel implements Serializable {
result = prime * result + ((getOpenId() == null) ? 0 : getOpenId().hashCode());
result = prime * result + ((getOpenIdH5() == null) ? 0 : getOpenIdH5().hashCode());
result = prime * result + ((getUnionId() == null) ? 0 : getUnionId().hashCode());
result = prime * result + ((getInfoCompleteStatus() == null) ? 0 : getInfoCompleteStatus().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode());
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode());
@ -297,6 +309,7 @@ public class HighUser extends UserModel implements Serializable {
sb.append(", openId=").append(openId);
sb.append(", openIdH5=").append(openIdH5);
sb.append(", unionId=").append(unionId);
sb.append(", infoCompleteStatus=").append(infoCompleteStatus);
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);
sb.append(", ext3=").append(ext3);

@ -1012,6 +1012,66 @@ public class HighUserExample {
return (Criteria) this;
}
public Criteria andInfoCompleteStatusIsNull() {
addCriterion("info_complete_status is null");
return (Criteria) this;
}
public Criteria andInfoCompleteStatusIsNotNull() {
addCriterion("info_complete_status is not null");
return (Criteria) this;
}
public Criteria andInfoCompleteStatusEqualTo(Integer value) {
addCriterion("info_complete_status =", value, "infoCompleteStatus");
return (Criteria) this;
}
public Criteria andInfoCompleteStatusNotEqualTo(Integer value) {
addCriterion("info_complete_status <>", value, "infoCompleteStatus");
return (Criteria) this;
}
public Criteria andInfoCompleteStatusGreaterThan(Integer value) {
addCriterion("info_complete_status >", value, "infoCompleteStatus");
return (Criteria) this;
}
public Criteria andInfoCompleteStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("info_complete_status >=", value, "infoCompleteStatus");
return (Criteria) this;
}
public Criteria andInfoCompleteStatusLessThan(Integer value) {
addCriterion("info_complete_status <", value, "infoCompleteStatus");
return (Criteria) this;
}
public Criteria andInfoCompleteStatusLessThanOrEqualTo(Integer value) {
addCriterion("info_complete_status <=", value, "infoCompleteStatus");
return (Criteria) this;
}
public Criteria andInfoCompleteStatusIn(List<Integer> values) {
addCriterion("info_complete_status in", values, "infoCompleteStatus");
return (Criteria) this;
}
public Criteria andInfoCompleteStatusNotIn(List<Integer> values) {
addCriterion("info_complete_status not in", values, "infoCompleteStatus");
return (Criteria) this;
}
public Criteria andInfoCompleteStatusBetween(Integer value1, Integer value2) {
addCriterion("info_complete_status between", value1, value2, "infoCompleteStatus");
return (Criteria) this;
}
public Criteria andInfoCompleteStatusNotBetween(Integer value1, Integer value2) {
addCriterion("info_complete_status not between", value1, value2, "infoCompleteStatus");
return (Criteria) this;
}
public Criteria andExt1IsNull() {
addCriterion("ext_1 is null");
return (Criteria) this;

@ -156,6 +156,14 @@ public class HighUserServiceImpl implements HighUserService {
user.setName(highUser.getName());
user.setOpenId(highUser.getOpenId());
user.setUnionId(highUser.getUnionId());
// 用户信息完整状态
// 0:完整
// 1:需要填写用户信息
// 2:需要填写手机号
if (user.getInfoCompleteStatus() == 2) {
user.setInfoCompleteStatus(0);
}
highUserMapper.updateByPrimaryKey(user);
return user;
}

Loading…
Cancel
Save