查询用户账户交易记录

master
胡锐 3 months ago
parent b66846f011
commit 4ddc978edf
  1. 3
      bweb/src/main/java/com/hfkj/config/AuthConfig.java
  2. 3
      cweb/src/main/java/com/hfkj/config/AuthConfig.java
  3. 3
      cweb/src/main/java/com/hfkj/controller/ClientController.java
  4. 86
      cweb/src/main/java/com/hfkj/controller/UserAccountController.java
  5. 5
      cweb/src/main/java/com/hfkj/controller/UserController.java
  6. 3
      service/src/main/java/com/hfkj/common/security/SecUserCenter.java
  7. 2
      service/src/main/java/com/hfkj/common/security/UserCenter.java
  8. 4
      service/src/main/java/com/hfkj/service/sec/impl/SecUserServiceImpl.java
  9. 2
      service/src/main/java/com/hfkj/service/user/impl/BsUserAccountRecordServiceImpl.java
  10. 3
      service/src/main/java/com/hfkj/service/user/impl/BsUserServiceImpl.java

@ -8,6 +8,7 @@ import com.hfkj.common.security.UserCenter;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.HttpMessageConverter;
@ -27,7 +28,7 @@ public class AuthConfig implements WebMvcConfigurer {
private static Logger log = LoggerFactory.getLogger(AuthConfig.class);
@Resource
@Autowired
private SecUserCenter userCenter;
/**

@ -7,6 +7,7 @@ import com.hfkj.common.security.UserCenter;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.HttpMessageConverter;
@ -26,7 +27,7 @@ public class AuthConfig implements WebMvcConfigurer {
private static Logger log = LoggerFactory.getLogger(AuthConfig.class);
@Resource
@Autowired
private UserCenter userCenter;
/**

@ -15,6 +15,7 @@ import com.hfkj.sysenum.user.UserLoginType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@ -38,7 +39,7 @@ public class ClientController {
private BsUserService userService;
@Resource
private RedisUtil redisUtil;
@Resource
@Autowired
private UserCenter userCenter;
@RequestMapping(value = "/smsLogin", method = RequestMethod.POST)

@ -0,0 +1,86 @@
package com.hfkj.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.RedisUtil;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.model.ResponseData;
import com.hfkj.model.UserSessionObject;
import com.hfkj.service.user.BsUserAccountRecordService;
import com.hfkj.service.user.BsUserAccountService;
import com.hfkj.service.user.BsUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
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 java.util.HashMap;
import java.util.Map;
/**
* @className: ClientController
* @author: HuRui
* @date: 2024/9/6
**/
@Controller
@RequestMapping(value="/userAccount")
@Api(value="客户端业务")
public class UserAccountController {
@Resource
private BsUserAccountService userAccountService;
@Resource
private BsUserAccountRecordService userAccountRecordService;
@Autowired
private UserCenter userCenter;
@RequestMapping(value = "/getAccount", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询用户账户信息")
public ResponseData getAccount() {
try {
// 用户session
UserSessionObject session = userCenter.getSessionModel(UserSessionObject.class);
Map<String,Object> param = new HashMap<>();
// 用户信息
param.put("account", userAccountService.getAccount(session.getUser().getId()));
return ResponseMsgUtil.success(param);
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getRecordList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询账户记录")
public ResponseData getRecordList(@RequestParam(value = "type" , required = false) Integer type,
@RequestParam(value = "sourceType" , required = false) Integer sourceType,
@RequestParam(value = "pageNum" , required = true) Integer pageNum,
@RequestParam(value = "pageSize" , required = true) Integer pageSize) {
try {
// 用户session
UserSessionObject session = userCenter.getSessionModel(UserSessionObject.class);
Map<String,Object> param = new HashMap<>();
param.put("useId", session.getUser().getId());
param.put("type", type);
param.put("sourceType", sourceType);
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(userAccountRecordService.getList(param)));
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
}

@ -17,6 +17,7 @@ import com.hfkj.sysenum.user.UserLoginType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@ -41,10 +42,10 @@ public class UserController {
private BsUserService userService;
@Resource
private RedisUtil redisUtil;
@Resource
@Autowired
private UserCenter userCenter;
@RequestMapping(value = "/getUser", method = RequestMethod.POST)
@RequestMapping(value = "/getUser", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询用户信息")
public ResponseData getUser() {

@ -9,12 +9,13 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
@Component
@Component()
public class SecUserCenter {
private static Logger log = LoggerFactory.getLogger(SecUserCenter.class);

@ -14,7 +14,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
@Component
@Component()
public class UserCenter {
private static Logger log = LoggerFactory.getLogger(UserCenter.class);

@ -6,7 +6,6 @@ import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.AESEncodeUtil;
import com.hfkj.common.security.SecUserCenter;
import com.hfkj.common.security.SessionObject;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.MD5Util;
import com.hfkj.dao.SecUserMapper;
import com.hfkj.entity.*;
@ -21,6 +20,7 @@ import com.hfkj.sysenum.sec.SecUserObjectTypeEnum;
import com.hfkj.sysenum.sec.SecUserStatusEnum;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
@ -41,7 +41,7 @@ public class SecUserServiceImpl implements SecUserService {
@Resource
private SecUserMapper secUserMapper;
@Resource
@Autowired
private SecUserCenter userCenter;
@Resource
private SecUserLoginLogService secUserLoginLogService;

@ -5,6 +5,7 @@ import com.hfkj.entity.BsUserAccountRecord;
import com.hfkj.entity.BsUserAccountRecordExample;
import com.hfkj.service.user.BsUserAccountRecordService;
import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
@ -16,6 +17,7 @@ import java.util.Map;
* @author: HuRui
* @date: 2024/9/8
**/
@Service("userAccountRecordService")
public class BsUserAccountRecordServiceImpl implements BsUserAccountRecordService {
@Resource
private BsUserAccountRecordMapper userAccountRecordMapper;

@ -19,6 +19,7 @@ import com.hfkj.sysenum.user.UserLoginType;
import com.hfkj.sysenum.user.UserStatusEnum;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@ -42,7 +43,7 @@ public class BsUserServiceImpl implements BsUserService {
private BsUserMapper userMapper;
@Resource
private RedisUtil redisUtil;
@Resource
@Autowired
private UserCenter userCenter;
@Resource
private BsUserLoginLogService userLoginLogService;

Loading…
Cancel
Save