diff --git a/hai-cweb/src/main/java/com/cweb/controller/CommonController.java b/hai-cweb/src/main/java/com/cweb/controller/CommonController.java index e671ded5..bd7a8438 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/CommonController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/CommonController.java @@ -285,7 +285,9 @@ public class CommonController { ) { try { - return ResponseMsgUtil.success(commonService.findByLatAndLng(lng , lat)); + JSONObject object = commonService.findByLatAndLng(lng , lat); + + return ResponseMsgUtil.success(object); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighUserCommonController.java b/hai-cweb/src/main/java/com/cweb/controller/HighUserCommonController.java index 5c9fffb6..e9ee316e 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighUserCommonController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighUserCommonController.java @@ -55,6 +55,7 @@ public class HighUserCommonController { @ApiOperation(value = "登录接口【用户不存在会自动注册】") public ResponseData login(@RequestParam(value = "phone", required = true) String phone, @RequestParam(value = "code", required = true) String code, + @RequestParam(value = "openId", required = false) String openId, @RequestParam(value = "popularizeUserId", required = false) Long popularizeUserId, @RequestParam(value = "regionId", required = false) String regionId, HttpServletRequest request, HttpServletResponse response) { @@ -70,12 +71,16 @@ public class HighUserCommonController { redisUtil.del("SMS_"+phone); HighUser user = highUserService.findByPhone(phone); + + + if(user == null) { user = new HighUser(); user.setName("用户" + IDGenerator.nextId(5)); user.setPhone(phone); user.setRegTime(new Date()); user.setGold(0); + user.setOpenIdH5(openId); user.setStatus(1); // 用户信息完整状态 // 0:完整 @@ -84,6 +89,9 @@ public class HighUserCommonController { user.setInfoCompleteStatus(1); highUserService.insertUser(user , popularizeUserId , regionId); + } else { + user.setOpenIdH5(openId); + highUserService.updateUser(user); } HighUserModel highUserModel = new HighUserModel(); diff --git a/hai-service/src/main/java/com/hai/service/HighUserService.java b/hai-service/src/main/java/com/hai/service/HighUserService.java index 4f1d896b..89d38d05 100644 --- a/hai-service/src/main/java/com/hai/service/HighUserService.java +++ b/hai-service/src/main/java/com/hai/service/HighUserService.java @@ -57,6 +57,16 @@ public interface HighUserService { **/ 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 diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index 60a91e61..c21b82d6 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -1395,6 +1395,10 @@ public class HighOrderServiceImpl implements HighOrderService { // 扣预存款 this.redisTemplate.boundListOps(MsgTopic.MerStoreAccount.getName()).leftPush(pushParam); } + + // 打印小票 + printGasOrder(highChildOrder.getGoodsId(), order, false); + } else if (store.getSourceType().equals(2)) { // 推送团油订单 Map paramMap = new HashMap<>(); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java index d3d2814e..884935a7 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java @@ -143,6 +143,17 @@ public class HighUserServiceImpl implements HighUserService { return null; } + @Override + public HighUser findByOpenIdH5(String openId) { + HighUserExample example = new HighUserExample(); + example.createCriteria().andOpenIdH5EqualTo(openId).andStatusEqualTo(1); + List list = highUserMapper.selectByExample(example); + if (list != null && list.size() > 0) { + return list.get(0); + } + return null; + } + @Override public HighUser findByUnionId(String unionId) { HighUserExample example = new HighUserExample();