dev-discount
袁野 2 years ago
commit 01495d176f
  1. 4
      hai-cweb/src/main/java/com/cweb/controller/CommonController.java
  2. 8
      hai-cweb/src/main/java/com/cweb/controller/HighUserCommonController.java
  3. 10
      hai-service/src/main/java/com/hai/service/HighUserService.java
  4. 4
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  5. 11
      hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java

@ -285,7 +285,9 @@ public class CommonController {
) { ) {
try { try {
return ResponseMsgUtil.success(commonService.findByLatAndLng(lng , lat)); JSONObject object = commonService.findByLatAndLng(lng , lat);
return ResponseMsgUtil.success(object);
} catch (Exception e) { } catch (Exception e) {
log.error("HighOrderController --> unionStagingPay() error!", e); log.error("HighOrderController --> unionStagingPay() error!", e);

@ -55,6 +55,7 @@ public class HighUserCommonController {
@ApiOperation(value = "登录接口【用户不存在会自动注册】") @ApiOperation(value = "登录接口【用户不存在会自动注册】")
public ResponseData login(@RequestParam(value = "phone", required = true) String phone, public ResponseData login(@RequestParam(value = "phone", required = true) String phone,
@RequestParam(value = "code", required = true) String code, @RequestParam(value = "code", required = true) String code,
@RequestParam(value = "openId", required = false) String openId,
@RequestParam(value = "popularizeUserId", required = false) Long popularizeUserId, @RequestParam(value = "popularizeUserId", required = false) Long popularizeUserId,
@RequestParam(value = "regionId", required = false) String regionId, @RequestParam(value = "regionId", required = false) String regionId,
HttpServletRequest request, HttpServletResponse response) { HttpServletRequest request, HttpServletResponse response) {
@ -70,12 +71,16 @@ public class HighUserCommonController {
redisUtil.del("SMS_"+phone); redisUtil.del("SMS_"+phone);
HighUser user = highUserService.findByPhone(phone); HighUser user = highUserService.findByPhone(phone);
if(user == null) { if(user == null) {
user = new HighUser(); user = new HighUser();
user.setName("用户" + IDGenerator.nextId(5)); user.setName("用户" + IDGenerator.nextId(5));
user.setPhone(phone); user.setPhone(phone);
user.setRegTime(new Date()); user.setRegTime(new Date());
user.setGold(0); user.setGold(0);
user.setOpenIdH5(openId);
user.setStatus(1); user.setStatus(1);
// 用户信息完整状态 // 用户信息完整状态
// 0:完整 // 0:完整
@ -84,6 +89,9 @@ public class HighUserCommonController {
user.setInfoCompleteStatus(1); user.setInfoCompleteStatus(1);
highUserService.insertUser(user , popularizeUserId , regionId); highUserService.insertUser(user , popularizeUserId , regionId);
} else {
user.setOpenIdH5(openId);
highUserService.updateUser(user);
} }
HighUserModel highUserModel = new HighUserModel(); HighUserModel highUserModel = new HighUserModel();

@ -57,6 +57,16 @@ public interface HighUserService {
**/ **/
HighUser findByOpenId(String openId); HighUser findByOpenId(String openId);
/**
* @Author Sum1Dream
* @name findByOpenIdH5.java
* @Description // 根据h5openId查询
* @Date 15:10 2022/8/23
* @Param [java.lang.String]
* @return com.hai.entity.HighUser
*/
HighUser findByOpenIdH5(String openId);
/** /**
* *
* @param unionId * @param unionId

@ -1395,6 +1395,10 @@ public class HighOrderServiceImpl implements HighOrderService {
// 扣预存款 // 扣预存款
this.redisTemplate.boundListOps(MsgTopic.MerStoreAccount.getName()).leftPush(pushParam); this.redisTemplate.boundListOps(MsgTopic.MerStoreAccount.getName()).leftPush(pushParam);
} }
// 打印小票
printGasOrder(highChildOrder.getGoodsId(), order, false);
} else if (store.getSourceType().equals(2)) { } else if (store.getSourceType().equals(2)) {
// 推送团油订单 // 推送团油订单
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();

@ -143,6 +143,17 @@ public class HighUserServiceImpl implements HighUserService {
return null; return null;
} }
@Override
public HighUser findByOpenIdH5(String openId) {
HighUserExample example = new HighUserExample();
example.createCriteria().andOpenIdH5EqualTo(openId).andStatusEqualTo(1);
List<HighUser> list = highUserMapper.selectByExample(example);
if (list != null && list.size() > 0) {
return list.get(0);
}
return null;
}
@Override @Override
public HighUser findByUnionId(String unionId) { public HighUser findByUnionId(String unionId) {
HighUserExample example = new HighUserExample(); HighUserExample example = new HighUserExample();

Loading…
Cancel
Save