diff --git a/hai-bweb/src/main/resources/pre/application.yml b/hai-bweb/src/main/resources/pre/application.yml index f945f8c0..4c2e5f66 100644 --- a/hai-bweb/src/main/resources/pre/application.yml +++ b/hai-bweb/src/main/resources/pre/application.yml @@ -9,7 +9,7 @@ debug: false #datasource数据源设置 spring: datasource: - url: jdbc:mysql://122.9.135.148:3306/hsg?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://139.159.177.244:3306/hsg_pre?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false username: root password: HF123456. type: com.alibaba.druid.pool.DruidDataSource diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighUserController.java b/hai-cweb/src/main/java/com/cweb/controller/HighUserController.java index 821d39c5..efb82c4f 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighUserController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighUserController.java @@ -5,6 +5,7 @@ import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.security.*; +import com.hai.common.utils.RedisUtil; import com.hai.common.utils.ResponseMsgUtil; import com.hai.entity.HighOrder; import com.hai.entity.HighUser; @@ -57,6 +58,9 @@ public class HighUserController { @Resource private HighUserPayPasswordService highUserPayPasswordService; + @Resource + private RedisUtil redisUtil; + @RequestMapping(value = "/findUser", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据id查询详情") @@ -201,5 +205,40 @@ public class HighUserController { } } + @RequestMapping(value="/setUserParam",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "设置用户参数") + public ResponseData setUserParam(@RequestParam(name = "param", required = true) String param,HttpServletRequest request) { + try { + // 用户 + SessionObject sessionObject = userCenter.getSessionObject(request); + HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); + + redisUtil.hset("USER_PARAM", userInfoModel.getHighUser().getPhone(), param, 60*60*60); + return ResponseMsgUtil.success(redisUtil.hget("USER_PARAM", userInfoModel.getHighUser().getPhone())); + + } catch (Exception e) { + log.error("CommonController --> getDictionaryByCodeTypeAndValue() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getUserParam",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "获取设置用户参数") + public ResponseData getUserParam(HttpServletRequest request) { + try { + // 用户 + SessionObject sessionObject = userCenter.getSessionObject(request); + HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); + + return ResponseMsgUtil.success(redisUtil.hget("USER_PARAM", userInfoModel.getHighUser().getPhone())); + + } catch (Exception e) { + log.error("CommonController --> getDictionaryByCodeTypeAndValue() error!", e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java index d805413f..a9d50c1c 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java @@ -130,14 +130,13 @@ public class OutRechargeOrderController { } HighUserCard highUserCard = highUserCardService.getUserHtlCardNo(userInfoModel.getHighUser().getId()); - + if (highUserCard != null) { + outRechargeOrder.setIdCard(highUserCard.getCardNo()); + } outRechargeOrder.setRemarks(remarks); outRechargeOrder.setRechargeName(remarks); outRechargeOrder.setOrderNo("CZ" + DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(5)); outRechargeOrder.setUserId(userInfoModel.getHighUser().getId()); - if (highUserCard != null) { - outRechargeOrder.setIdCard(highUserCard.getCardNo()); - } outRechargeOrder.setUserName(userInfoModel.getHighUser().getName()); outRechargeOrder.setUserPhone(userInfoModel.getHighUser().getPhone()); diff --git a/hai-cweb/src/main/resources/pre/application.yml b/hai-cweb/src/main/resources/pre/application.yml index f425a243..1012ea5c 100644 --- a/hai-cweb/src/main/resources/pre/application.yml +++ b/hai-cweb/src/main/resources/pre/application.yml @@ -9,7 +9,7 @@ debug: false #datasource数据源设置 spring: datasource: - url: jdbc:mysql://122.9.135.148:3306/hsg?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://139.159.177.244:3306/hsg_pre?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false username: root password: HF123456. type: com.alibaba.druid.pool.DruidDataSource