mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-25 01:29:47 +08:00
打印日志
This commit is contained in:
@@ -39,494 +39,500 @@ import java.util.Map;
|
|||||||
@RequestMapping("/uniapp/member")
|
@RequestMapping("/uniapp/member")
|
||||||
public class MemberController extends BaseController {
|
public class MemberController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MemberService memberService;
|
private MemberService memberService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MemberBasicInfoService memberBasicInfoService;
|
private MemberBasicInfoService memberBasicInfoService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PileMerchantInfoService pileMerchantInfoService;
|
private PileMerchantInfoService pileMerchantInfoService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MemberPlateNumberRelationService memberPlateNumberRelationService;
|
private MemberPlateNumberRelationService memberPlateNumberRelationService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下发短信接口 business
|
* 下发短信接口 business
|
||||||
* http://localhost:8080/uniapp/member/sendSMS
|
* http://localhost:8080/uniapp/member/sendSMS
|
||||||
*/
|
*/
|
||||||
@PostMapping("/sendSMS")
|
@PostMapping("/sendSMS")
|
||||||
public RestApiResponse<?> sendSMS(HttpServletRequest request, @RequestBody MemberRegisterAndLoginDTO dto) {
|
public RestApiResponse<?> sendSMS(HttpServletRequest request, @RequestBody MemberRegisterAndLoginDTO dto) {
|
||||||
logger.info("下发短信接口 param:{}", JSONObject.toJSONString(dto));
|
logger.info("下发短信接口 param:{}", JSONObject.toJSONString(dto));
|
||||||
RestApiResponse<?> response = null;
|
RestApiResponse<?> response = null;
|
||||||
try {
|
try {
|
||||||
if (StringUtils.isBlank(dto.getMobileNumber())) {
|
if (StringUtils.isBlank(dto.getMobileNumber())) {
|
||||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||||
}
|
}
|
||||||
String sendSMSResult = SMSUtil.sendSMS(request, dto.getMobileNumber());
|
String sendSMSResult = SMSUtil.sendSMS(request, dto.getMobileNumber());
|
||||||
response = new RestApiResponse<>(sendSMSResult);
|
response = new RestApiResponse<>(sendSMSResult);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("下发短信接口 发生异常 error", e);
|
logger.error("下发短信接口 发生异常 error", e);
|
||||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_SEND_SMS_ERROR);
|
response = new RestApiResponse<>(ReturnCodeEnum.CODE_SEND_SMS_ERROR);
|
||||||
}
|
}
|
||||||
logger.info("下发短信接口 result:{}", JSONObject.toJSONString(response));
|
logger.info("下发短信接口 result:{}", JSONObject.toJSONString(response));
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员登录注册
|
* 会员登录注册
|
||||||
* 登录成功,返回memberToken
|
* 登录成功,返回memberToken
|
||||||
* http://localhost:8080/uniapp/member/memberRegisterAndLogin
|
* http://localhost:8080/uniapp/member/memberRegisterAndLogin
|
||||||
*/
|
*/
|
||||||
@PostMapping("/memberRegisterAndLogin")
|
@PostMapping("/memberRegisterAndLogin")
|
||||||
public RestApiResponse<?> memberRegisterAndLogin(HttpServletRequest request, @RequestBody MemberRegisterAndLoginDTO dto) {
|
public RestApiResponse<?> memberRegisterAndLogin(HttpServletRequest request, @RequestBody MemberRegisterAndLoginDTO dto) {
|
||||||
logger.info("会员登录注册接口 param:{}", JSONObject.toJSONString(dto));
|
logger.info("会员登录注册接口 param:{}", JSONObject.toJSONString(dto));
|
||||||
RestApiResponse<?> response = null;
|
RestApiResponse<?> response = null;
|
||||||
try {
|
try {
|
||||||
String appId = request.getHeader("appId");
|
String appId = request.getHeader("appId");
|
||||||
if (StringUtils.isNotBlank(appId)) {
|
if (StringUtils.isNotBlank(appId)) {
|
||||||
String firstLevelMerchantId = pileMerchantInfoService.getFirstLevelMerchantIdByAppId(appId);
|
String firstLevelMerchantId = pileMerchantInfoService.getFirstLevelMerchantIdByAppId(appId);
|
||||||
if (StringUtils.isNotBlank(firstLevelMerchantId)) {
|
if (StringUtils.isNotBlank(firstLevelMerchantId)) {
|
||||||
dto.setMerchantId(firstLevelMerchantId);
|
dto.setMerchantId(firstLevelMerchantId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 执行登录(查这个手机号在后台有没有数据,如果没有就静默注册)
|
// 执行登录(查这个手机号在后台有没有数据,如果没有就静默注册)
|
||||||
String memberToken = memberService.memberRegisterAndLogin(dto);
|
String memberToken = memberService.memberRegisterAndLogin(dto);
|
||||||
|
|
||||||
// 返回前端成功
|
// 返回前端成功
|
||||||
Map<String, String> map = Maps.newHashMap();
|
Map<String, String> map = Maps.newHashMap();
|
||||||
map.put("memberToken", memberToken);
|
map.put("memberToken", memberToken);
|
||||||
response = new RestApiResponse<>(map);
|
response = new RestApiResponse<>(map);
|
||||||
} catch (ServiceException e) {
|
} catch (ServiceException e) {
|
||||||
logger.warn("会员登录注册接口 warn", e);
|
logger.warn("会员登录注册接口 warn", e);
|
||||||
response = new RestApiResponse<>(e.getMessage());
|
response = new RestApiResponse<>(e.getMessage());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("会员登录注册接口 发生异常 error", e);
|
logger.error("会员登录注册接口 发生异常 error", e);
|
||||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_MEMBER_REGISTER_AND_LOGIN_ERROR);
|
response = new RestApiResponse<>(ReturnCodeEnum.CODE_MEMBER_REGISTER_AND_LOGIN_ERROR);
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信一键登录
|
* 微信一键登录
|
||||||
* http://localhost:8080/uniapp/member/wechatLogin
|
* http://localhost:8080/uniapp/member/wechatLogin
|
||||||
*/
|
*/
|
||||||
@PostMapping("/wechatLogin")
|
@PostMapping("/wechatLogin")
|
||||||
public RestApiResponse<?> wechatLogin(HttpServletRequest request, @RequestBody WechatLoginDTO dto) {
|
public RestApiResponse<?> wechatLogin(HttpServletRequest request, @RequestBody WechatLoginDTO dto) {
|
||||||
RestApiResponse<?> response = null;
|
RestApiResponse<?> response = null;
|
||||||
try {
|
try {
|
||||||
// 获取小程序appid
|
// 获取小程序appid
|
||||||
String appId = request.getHeader("appId");
|
String appId = request.getHeader("appId");
|
||||||
dto.setAppId(appId);
|
dto.setAppId(appId);
|
||||||
String memberToken = memberService.wechatLogin(dto);
|
String memberToken = memberService.wechatLogin(dto);
|
||||||
response = new RestApiResponse<>(ImmutableMap.of("memberToken", memberToken));
|
response = new RestApiResponse<>(ImmutableMap.of("memberToken", memberToken));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("微信登录异常 param:{}",JSON.toJSONString(dto), e);
|
logger.error("微信登录异常 param:{}", JSON.toJSONString(dto), e);
|
||||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_WECHAT_LOGIN_ERROR);
|
response = new RestApiResponse<>(ReturnCodeEnum.CODE_WECHAT_LOGIN_ERROR);
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 接收并处理前端用户信息
|
* 接收并处理前端用户信息
|
||||||
*
|
* <p>
|
||||||
* http://localhost:8080/uniapp/member/saveUserInfo
|
* http://localhost:8080/uniapp/member/saveUserInfo
|
||||||
*/
|
*/
|
||||||
@PostMapping("/saveUserInfo")
|
@PostMapping("/saveUserInfo")
|
||||||
public RestApiResponse<?> saveUserInfo(HttpServletRequest request, @RequestBody MemberRegisterDTO dto) {
|
public RestApiResponse<?> saveUserInfo(HttpServletRequest request, @RequestBody MemberRegisterDTO dto) {
|
||||||
logger.info("接受前端用户信息并处理 param:{}", JSONObject.toJSONString(dto));
|
logger.info("接受前端用户信息并处理 param:{}", JSONObject.toJSONString(dto));
|
||||||
RestApiResponse<?> response = null;
|
RestApiResponse<?> response = null;
|
||||||
try {
|
try {
|
||||||
String memberId = getMemberIdByAuthorization(request);
|
String memberId = getMemberIdByAuthorization(request);
|
||||||
memberService.handleUserInfo(memberId, dto);
|
memberService.handleUserInfo(memberId, dto);
|
||||||
response = new RestApiResponse<>();
|
response = new RestApiResponse<>();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("处理用户信息异常", e);
|
logger.error("处理用户信息异常", e);
|
||||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_HANDLE_USER_INFO_ERROR);
|
response = new RestApiResponse<>(ReturnCodeEnum.CODE_HANDLE_USER_INFO_ERROR);
|
||||||
}
|
}
|
||||||
logger.info("接受前端用户信息并处理 result:{}", response);
|
logger.info("接受前端用户信息并处理 result:{}", response);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询用户账户信息
|
* 查询用户账户信息
|
||||||
* http://localhost:8080/uniapp/member/getMemberInfo
|
* http://localhost:8080/uniapp/member/getMemberInfo
|
||||||
* @return 用户账户信息
|
*
|
||||||
*/
|
* @return 用户账户信息
|
||||||
@GetMapping("/getMemberInfo")
|
*/
|
||||||
public RestApiResponse<?> getMemberInfo(HttpServletRequest request) {
|
@GetMapping("/getMemberInfo")
|
||||||
RestApiResponse<?> response = null;
|
public RestApiResponse<?> getMemberInfo(HttpServletRequest request) {
|
||||||
String memberId = null;
|
RestApiResponse<?> response = null;
|
||||||
try {
|
String memberId = null;
|
||||||
memberId = getMemberIdByAuthorization(request);
|
try {
|
||||||
// logger.info("查询用户账户信息 param memberId:{}", memberId);
|
memberId = getMemberIdByAuthorization(request);
|
||||||
MemberVO memberVO = memberService.getMemberInfoByMemberId(memberId);
|
// logger.info("查询用户账户信息 param memberId:{}", memberId);
|
||||||
response = new RestApiResponse<>(memberVO);
|
MemberVO memberVO = memberService.getMemberInfoByMemberId(memberId);
|
||||||
}catch (BusinessException e) {
|
response = new RestApiResponse<>(memberVO);
|
||||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
} catch (BusinessException e) {
|
||||||
}catch (Exception e) {
|
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||||
logger.error("查询用户账户信息", e);
|
} catch (Exception e) {
|
||||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_MEMBER_ACCOUNT_AMOUNT_ERROR);
|
logger.error("查询用户账户信息", e);
|
||||||
}
|
response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_MEMBER_ACCOUNT_AMOUNT_ERROR);
|
||||||
logger.info("查询用户账户信息 param memberId:{}, result:{}", memberId, response);
|
}
|
||||||
return response;
|
logger.info("查询用户账户信息 param memberId:{}, result:{}", memberId, response);
|
||||||
}
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取openId
|
* 获取openId
|
||||||
* http://localhost:8080/uniapp/member/getOpenId
|
* http://localhost:8080/uniapp/member/getOpenId
|
||||||
*/
|
*/
|
||||||
@PostMapping("/getOpenId")
|
@PostMapping("/getOpenId")
|
||||||
public RestApiResponse<?> getOpenId(HttpServletRequest request, @RequestBody WeixinPayDTO dto) {
|
public RestApiResponse<?> getOpenId(HttpServletRequest request, @RequestBody WeixinPayDTO dto) {
|
||||||
logger.info("获取openId param:{}", dto.toString());
|
logger.info("获取openId param:{}", dto.toString());
|
||||||
RestApiResponse<?> response;
|
RestApiResponse<?> response;
|
||||||
try {
|
try {
|
||||||
getMemberIdByAuthorization(request);
|
getMemberIdByAuthorization(request);
|
||||||
String openId = memberService.getOpenIdByCode(dto.getCode());
|
String openId = memberService.getOpenIdByCode(dto.getCode());
|
||||||
response = new RestApiResponse<>(ImmutableMap.of("openId", openId));
|
response = new RestApiResponse<>(ImmutableMap.of("openId", openId));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("获取openId error", e);
|
logger.error("获取openId error", e);
|
||||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_OPEN_ID_BY_CODE_ERROR);
|
response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_OPEN_ID_BY_CODE_ERROR);
|
||||||
}
|
}
|
||||||
logger.info("获取openId result:{}", response);
|
logger.info("获取openId result:{}", response);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户账户余额变动信息
|
* 获取用户账户余额变动信息
|
||||||
* http://localhost:8080/uniapp/member/getMemberBalanceChanges
|
* http://localhost:8080/uniapp/member/getMemberBalanceChanges
|
||||||
* @param request
|
*
|
||||||
* @param dto
|
* @param request
|
||||||
* @return
|
* @param dto
|
||||||
*/
|
* @return
|
||||||
@PostMapping("/getMemberBalanceChanges")
|
*/
|
||||||
public RestApiResponse<?> getMemberBalanceChanges(HttpServletRequest request, @RequestBody UniAppQueryMemberBalanceDTO dto) {
|
@PostMapping("/getMemberBalanceChanges")
|
||||||
logger.info("查询用户账户余额变动信息 params:{}", JSON.toJSONString(dto));
|
public RestApiResponse<?> getMemberBalanceChanges(HttpServletRequest request, @RequestBody UniAppQueryMemberBalanceDTO dto) {
|
||||||
RestApiResponse<?> response = null;
|
logger.info("查询用户账户余额变动信息 params:{}", JSON.toJSONString(dto));
|
||||||
try {
|
RestApiResponse<?> response = null;
|
||||||
String memberId = getMemberIdByAuthorization(request);
|
try {
|
||||||
dto.setMemberId(memberId);
|
String memberId = getMemberIdByAuthorization(request);
|
||||||
PageResponse pageResponse = memberService.getMemberBalanceChanges(dto);
|
dto.setMemberId(memberId);
|
||||||
// PageResponse pageResponse = memberService.getMemberWalletLog(dto);
|
PageResponse pageResponse = memberService.getMemberBalanceChanges(dto);
|
||||||
// MemberWalletInfoVO memberWalletInfo = memberService.getMemberWalletInfo (dto);
|
// PageResponse pageResponse = memberService.getMemberWalletLog(dto);
|
||||||
response = new RestApiResponse<>(pageResponse);
|
// MemberWalletInfoVO memberWalletInfo = memberService.getMemberWalletInfo (dto);
|
||||||
} catch (Exception e) {
|
response = new RestApiResponse<>(pageResponse);
|
||||||
logger.error("查询用户账户余额变动信息 error:", e);
|
} catch (Exception e) {
|
||||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_BALANCE_CHANGES_ERROR);
|
logger.error("查询用户账户余额变动信息 error:", e);
|
||||||
}
|
response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_BALANCE_CHANGES_ERROR);
|
||||||
logger.info("查询用户账户余额变动信息 result:{}", response);
|
}
|
||||||
return response;
|
logger.info("查询用户账户余额变动信息 result:{}", response);
|
||||||
}
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户账户余额变动信息V2
|
* 获取用户账户余额变动信息V2
|
||||||
* http://localhost:8080/uniapp/member/getMemberBalanceChangesV2
|
* http://localhost:8080/uniapp/member/getMemberBalanceChangesV2
|
||||||
* @param request
|
*
|
||||||
* @param dto
|
* @param request
|
||||||
* @return
|
* @param dto
|
||||||
*/
|
* @return
|
||||||
@PostMapping("/getMemberBalanceChangesV2")
|
*/
|
||||||
public RestApiResponse<?> getMemberBalanceChangesV2(HttpServletRequest request, @RequestBody UniAppQueryMemberBalanceDTO dto) {
|
@PostMapping("/getMemberBalanceChangesV2")
|
||||||
// logger.info("查询用户账户余额变动信息 params:{}", JSON.toJSONString(dto));
|
public RestApiResponse<?> getMemberBalanceChangesV2(HttpServletRequest request, @RequestBody UniAppQueryMemberBalanceDTO dto) {
|
||||||
RestApiResponse<?> response = null;
|
// logger.info("查询用户账户余额变动信息 params:{}", JSON.toJSONString(dto));
|
||||||
String memberId = null;
|
RestApiResponse<?> response = null;
|
||||||
try {
|
String memberId = null;
|
||||||
if (StringUtils.isBlank(dto.getMemberId())) {
|
try {
|
||||||
memberId = getMemberIdByAuthorization(request);
|
if (StringUtils.isBlank(dto.getMemberId())) {
|
||||||
dto.setMemberId(memberId);
|
memberId = getMemberIdByAuthorization(request);
|
||||||
}
|
dto.setMemberId(memberId);
|
||||||
if (StringUtils.isBlank(dto.getMemberId()) || StringUtils.isBlank(dto.getWalletCode())) {
|
}
|
||||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
if (StringUtils.isBlank(dto.getMemberId()) || StringUtils.isBlank(dto.getWalletCode())) {
|
||||||
}
|
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||||
MemberWalletInfoVO memberWalletInfo = memberService.getMemberWalletInfo(dto);
|
}
|
||||||
response = new RestApiResponse<>(memberWalletInfo);
|
MemberWalletInfoVO memberWalletInfo = memberService.getMemberWalletInfo(dto);
|
||||||
} catch (BusinessException e) {
|
response = new RestApiResponse<>(memberWalletInfo);
|
||||||
logger.error("查询用户账户余额变动信息 error:", e);
|
} catch (BusinessException e) {
|
||||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
logger.error("查询用户账户余额变动信息 error:", e);
|
||||||
} catch (Exception e) {
|
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||||
logger.error("查询用户账户余额变动信息 error:", e);
|
} catch (Exception e) {
|
||||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_BALANCE_CHANGES_ERROR);
|
logger.error("查询用户账户余额变动信息 error:", e);
|
||||||
}
|
response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_BALANCE_CHANGES_ERROR);
|
||||||
logger.info("查询用户账户余额变动信息memberId:{}, params:{}, result:{}", memberId, JSON.toJSONString(dto), JSON.toJSONString(response));
|
}
|
||||||
return response;
|
logger.info("查询用户账户余额变动信息memberId:{}, params:{}, result:{}", memberId, JSON.toJSONString(dto), JSON.toJSONString(response));
|
||||||
}
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过 memberId 查询用户绑定车牌信息
|
* 通过 memberId 查询用户绑定车牌信息
|
||||||
* http://localhost:8080/uniapp/member/getMemberCarNoInfo
|
* http://localhost:8080/uniapp/member/getMemberCarNoInfo
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getMemberCarNoInfo")
|
@GetMapping("/getMemberCarNoInfo")
|
||||||
public RestApiResponse<?> getMemberCarNoInfo(HttpServletRequest request){
|
public RestApiResponse<?> getMemberCarNoInfo(HttpServletRequest request) {
|
||||||
String memberId = getMemberIdByAuthorization(request);
|
String memberId = getMemberIdByAuthorization(request);
|
||||||
logger.info("通过 memberId 查询用户个人基本信息 param:{}", memberId);
|
logger.info("通过 memberId 查询用户个人基本信息 param:{}", memberId);
|
||||||
RestApiResponse<?> response = null;
|
RestApiResponse<?> response = null;
|
||||||
try {
|
try {
|
||||||
MemberPlateNumberRelation info = new MemberPlateNumberRelation();
|
MemberPlateNumberRelation info = new MemberPlateNumberRelation();
|
||||||
info.setMemberId(memberId);
|
info.setMemberId(memberId);
|
||||||
List<MemberPlateNumberRelation> resultList = memberPlateNumberRelationService.selectMemberPlateNumberRelationList(info);
|
List<MemberPlateNumberRelation> resultList = memberPlateNumberRelationService.selectMemberPlateNumberRelationList(info);
|
||||||
response = new RestApiResponse<>(resultList);
|
response = new RestApiResponse<>(resultList);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("通过 memberId 查询用户个人基本信息 error", e);
|
logger.error("通过 memberId 查询用户个人基本信息 error", e);
|
||||||
response = new RestApiResponse<>(e);
|
response = new RestApiResponse<>(e);
|
||||||
}
|
}
|
||||||
logger.info("通过 memberId 查询用户个人基本信息 result:{}", response);
|
logger.info("通过 memberId 查询用户个人基本信息 result:{}", response);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户绑定车牌号、vin
|
* 用户绑定车牌号、vin
|
||||||
* http://localhost:8080/uniapp/member/memberBindingCarNo
|
* http://localhost:8080/uniapp/member/memberBindingCarNo
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/memberBindingCarNo")
|
@PostMapping("/memberBindingCarNo")
|
||||||
public RestApiResponse<?> memberBindingCarNo(HttpServletRequest request, @RequestBody BindingCarNoDTO dto){
|
public RestApiResponse<?> memberBindingCarNo(HttpServletRequest request, @RequestBody BindingCarNoDTO dto) {
|
||||||
logger.info("用户绑定车牌号 param:{}", JSONObject.toJSONString(dto));
|
logger.info("用户绑定车牌号 param:{}", JSONObject.toJSONString(dto));
|
||||||
RestApiResponse<?> response = null;
|
RestApiResponse<?> response = null;
|
||||||
try {
|
try {
|
||||||
// 参数校验
|
// 参数校验
|
||||||
if (StringUtils.isBlank(dto.getCarNo())) {
|
if (StringUtils.isBlank(dto.getCarNo())) {
|
||||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||||
}
|
}
|
||||||
String memberId = getMemberIdByAuthorization(request);
|
String memberId = getMemberIdByAuthorization(request);
|
||||||
dto.setMemberId(memberId);
|
dto.setMemberId(memberId);
|
||||||
memberService.memberBindingCarNo(dto);
|
memberService.memberBindingCarNo(dto);
|
||||||
response = new RestApiResponse<>();
|
response = new RestApiResponse<>();
|
||||||
} catch (BusinessException e){
|
} catch (BusinessException e) {
|
||||||
logger.error("用户绑定车牌号 error", e);
|
logger.error("用户绑定车牌号 error", e);
|
||||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||||
} catch (Exception e){
|
} catch (Exception e) {
|
||||||
logger.error("用户绑定车牌号 error", e);
|
logger.error("用户绑定车牌号 error", e);
|
||||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_USER_BINDING_CARNO_ERROR);
|
response = new RestApiResponse<>(ReturnCodeEnum.CODE_USER_BINDING_CARNO_ERROR);
|
||||||
}
|
}
|
||||||
logger.info("用户绑定车牌号 result:{}", response);
|
logger.info("用户绑定车牌号 result:{}", response);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户修改车牌号
|
* 用户修改车牌号
|
||||||
* http://localhost:8080/uniapp/member/memberUpdatePlateNumber
|
* http://localhost:8080/uniapp/member/memberUpdatePlateNumber
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/memberUpdatePlateNumber")
|
@PostMapping("/memberUpdatePlateNumber")
|
||||||
public RestApiResponse<?> memberUpdatePlateNumber(HttpServletRequest request, @RequestBody BindingCarNoDTO dto){
|
public RestApiResponse<?> memberUpdatePlateNumber(HttpServletRequest request, @RequestBody BindingCarNoDTO dto) {
|
||||||
logger.info("用户修改车牌号 params:{}", JSONObject.toJSONString(dto));
|
logger.info("用户修改车牌号 params:{}", JSONObject.toJSONString(dto));
|
||||||
RestApiResponse<?> response = null;
|
RestApiResponse<?> response = null;
|
||||||
try {
|
try {
|
||||||
String memberId = getMemberIdByAuthorization(request);
|
String memberId = getMemberIdByAuthorization(request);
|
||||||
MemberPlateNumberRelation relation = MemberPlateNumberRelation.builder()
|
MemberPlateNumberRelation relation = MemberPlateNumberRelation.builder()
|
||||||
.id(Integer.valueOf(dto.getId()))
|
.id(Integer.valueOf(dto.getId()))
|
||||||
.memberId(memberId)
|
.memberId(memberId)
|
||||||
.licensePlateNumber(dto.getCarNo())
|
.licensePlateNumber(dto.getCarNo())
|
||||||
.build();
|
.build();
|
||||||
if (StringUtils.isNotBlank(dto.getVinCode())) {
|
if (StringUtils.isNotBlank(dto.getVinCode())) {
|
||||||
relation.setVinCode(dto.getVinCode());
|
relation.setVinCode(dto.getVinCode());
|
||||||
}
|
}
|
||||||
int i = memberPlateNumberRelationService.updatePlateNumber(relation);
|
int i = memberPlateNumberRelationService.updatePlateNumber(relation);
|
||||||
response = new RestApiResponse<>(i);
|
response = new RestApiResponse<>(i);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("用户修改车牌号 error", e);
|
logger.error("用户修改车牌号 error", e);
|
||||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_USER_UNBIND_CARNO_ERROR);
|
response = new RestApiResponse<>(ReturnCodeEnum.CODE_USER_UNBIND_CARNO_ERROR);
|
||||||
}
|
}
|
||||||
logger.info("用户修改车牌号 result:{}", response);
|
logger.info("用户修改车牌号 result:{}", response);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户解除绑定
|
* 用户解除绑定
|
||||||
* http://localhost:8080/uniapp/member/memberUnbindCarNo
|
* http://localhost:8080/uniapp/member/memberUnbindCarNo
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/memberUnbindCarNo")
|
@PostMapping("/memberUnbindCarNo")
|
||||||
public RestApiResponse<?> memberUnbindCarNo(@RequestBody BindingCarNoDTO dto){
|
public RestApiResponse<?> memberUnbindCarNo(@RequestBody BindingCarNoDTO dto) {
|
||||||
logger.info("用户解绑车牌号 params:{}", JSONObject.toJSONString(dto));
|
logger.info("用户解绑车牌号 params:{}", JSONObject.toJSONString(dto));
|
||||||
RestApiResponse<?> response = null;
|
RestApiResponse<?> response = null;
|
||||||
try {
|
try {
|
||||||
// String memberId = getMemberIdByAuthorization(request);
|
// String memberId = getMemberIdByAuthorization(request);
|
||||||
// dto.setMemberId(memberId);
|
// dto.setMemberId(memberId);
|
||||||
int i = memberPlateNumberRelationService.deleteCarNoByParams(dto.getIds());
|
int i = memberPlateNumberRelationService.deleteCarNoByParams(dto.getIds());
|
||||||
response = new RestApiResponse<>(i);
|
response = new RestApiResponse<>(i);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("用户解绑车牌号 error", e);
|
logger.error("用户解绑车牌号 error", e);
|
||||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_USER_UNBIND_CARNO_ERROR);
|
response = new RestApiResponse<>(ReturnCodeEnum.CODE_USER_UNBIND_CARNO_ERROR);
|
||||||
}
|
}
|
||||||
logger.info("用户解绑车牌号 result:{}", response);
|
logger.info("用户解绑车牌号 result:{}", response);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户绑定鉴权卡接口
|
* 用户绑定鉴权卡接口
|
||||||
* http://localhost:8080/uniapp/member/memberBindingCard
|
* http://localhost:8080/uniapp/member/memberBindingCard
|
||||||
* @param dto
|
*
|
||||||
* @return
|
* @param dto
|
||||||
*/
|
* @return
|
||||||
@PostMapping("/memberBindingCard")
|
*/
|
||||||
public RestApiResponse<?> memberBindingCard(HttpServletRequest request, @RequestBody BindingCardDTO dto){
|
@PostMapping("/memberBindingCard")
|
||||||
logger.info("用户绑定鉴权卡 param:{}", JSONObject.toJSONString(dto));
|
public RestApiResponse<?> memberBindingCard(HttpServletRequest request, @RequestBody BindingCardDTO dto) {
|
||||||
RestApiResponse<?> response = null;
|
logger.info("用户绑定鉴权卡 param:{}", JSONObject.toJSONString(dto));
|
||||||
try {
|
RestApiResponse<?> response = null;
|
||||||
String memberId = getMemberIdByAuthorization(request);
|
try {
|
||||||
dto.setMemberId(memberId);
|
String memberId = getMemberIdByAuthorization(request);
|
||||||
int i = memberService.memberBindCard(dto);
|
dto.setMemberId(memberId);
|
||||||
response = new RestApiResponse<>(i);
|
int i = memberService.memberBindCard(dto);
|
||||||
} catch (BusinessException e){
|
response = new RestApiResponse<>(i);
|
||||||
logger.error("用户绑定鉴权卡 error", e);
|
} catch (BusinessException e) {
|
||||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
logger.error("用户绑定鉴权卡 error", e);
|
||||||
} catch (Exception e) {
|
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||||
logger.error("用户绑定鉴权卡 error", e);
|
} catch (Exception e) {
|
||||||
response = new RestApiResponse<>(e);
|
logger.error("用户绑定鉴权卡 error", e);
|
||||||
}
|
response = new RestApiResponse<>(e);
|
||||||
logger.info("用户绑定鉴权卡 result:{}", response);
|
}
|
||||||
return response;
|
logger.info("用户绑定鉴权卡 result:{}", response);
|
||||||
}
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户解绑鉴权卡
|
* 用户解绑鉴权卡
|
||||||
* @param request
|
*
|
||||||
* @param dto
|
* @param request
|
||||||
* @return
|
* @param dto
|
||||||
*/
|
* @return
|
||||||
@PostMapping("/memberUnbindingCard")
|
*/
|
||||||
public RestApiResponse<?> memberUnbindingCard(HttpServletRequest request, @RequestBody BindingCardDTO dto) {
|
@PostMapping("/memberUnbindingCard")
|
||||||
logger.info("用户解绑鉴权卡 param:{}", JSONObject.toJSONString(dto));
|
public RestApiResponse<?> memberUnbindingCard(HttpServletRequest request, @RequestBody BindingCardDTO dto) {
|
||||||
RestApiResponse<?> response = null;
|
logger.info("用户解绑鉴权卡 param:{}", JSONObject.toJSONString(dto));
|
||||||
try {
|
RestApiResponse<?> response = null;
|
||||||
String memberId = getMemberIdByAuthorization(request);
|
try {
|
||||||
dto.setMemberId(memberId);
|
String memberId = getMemberIdByAuthorization(request);
|
||||||
int i = memberService.memberUnbindCard(dto);
|
dto.setMemberId(memberId);
|
||||||
response = new RestApiResponse<>(i);
|
int i = memberService.memberUnbindCard(dto);
|
||||||
} catch (BusinessException e) {
|
response = new RestApiResponse<>(i);
|
||||||
logger.error("用户解绑鉴权卡 error", e);
|
} catch (BusinessException e) {
|
||||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
logger.error("用户解绑鉴权卡 error", e);
|
||||||
} catch (Exception e) {
|
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||||
logger.error("用户解绑鉴权卡 error", e);
|
} catch (Exception e) {
|
||||||
response = new RestApiResponse<>(e);
|
logger.error("用户解绑鉴权卡 error", e);
|
||||||
}
|
response = new RestApiResponse<>(e);
|
||||||
logger.info("用户解绑鉴权卡 result:{}", response);
|
}
|
||||||
return response;
|
logger.info("用户解绑鉴权卡 result:{}", response);
|
||||||
}
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增会员发票抬头
|
* 新增会员发票抬头
|
||||||
* http://localhost:8080/uniapp/member/createMemberInvoiceTitle
|
* http://localhost:8080/uniapp/member/createMemberInvoiceTitle
|
||||||
*/
|
*/
|
||||||
@PostMapping("/createMemberInvoiceTitle")
|
@PostMapping("/createMemberInvoiceTitle")
|
||||||
public RestApiResponse<?> createMemberInvoiceTitle(HttpServletRequest request, @RequestBody InvoiceTitleDTO dto) {
|
public RestApiResponse<?> createMemberInvoiceTitle(HttpServletRequest request, @RequestBody InvoiceTitleDTO dto) {
|
||||||
RestApiResponse<?> response = null;
|
RestApiResponse<?> response = null;
|
||||||
try {
|
try {
|
||||||
String memberId = getMemberIdByAuthorization(request);
|
String memberId = getMemberIdByAuthorization(request);
|
||||||
dto.setMemberId(memberId);
|
dto.setMemberId(memberId);
|
||||||
memberService.createMemberInvoiceTitle(dto);
|
memberService.createMemberInvoiceTitle(dto);
|
||||||
response = new RestApiResponse<>();
|
response = new RestApiResponse<>();
|
||||||
} catch (BusinessException e) {
|
} catch (BusinessException e) {
|
||||||
logger.error("新增会员发票抬头 error", e);
|
logger.error("新增会员发票抬头 error", e);
|
||||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("新增会员发票抬头 error", e);
|
logger.error("新增会员发票抬头 error", e);
|
||||||
response = new RestApiResponse<>(e);
|
response = new RestApiResponse<>(e);
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改会员发票抬头
|
* 修改会员发票抬头
|
||||||
* http://localhost:8080/uniapp/member/updateMemberInvoiceTitle
|
* http://localhost:8080/uniapp/member/updateMemberInvoiceTitle
|
||||||
*/
|
*/
|
||||||
@PostMapping("/updateMemberInvoiceTitle")
|
@PostMapping("/updateMemberInvoiceTitle")
|
||||||
public RestApiResponse<?> updateMemberInvoiceTitle(HttpServletRequest request, @RequestBody InvoiceTitleDTO dto) {
|
public RestApiResponse<?> updateMemberInvoiceTitle(HttpServletRequest request, @RequestBody InvoiceTitleDTO dto) {
|
||||||
logger.info("修改会员发票抬头 param:{}", JSONObject.toJSONString(dto));
|
logger.info("修改会员发票抬头 param:{}", JSONObject.toJSONString(dto));
|
||||||
RestApiResponse<?> response = null;
|
RestApiResponse<?> response = null;
|
||||||
try {
|
try {
|
||||||
String memberId = getMemberIdByAuthorization(request);
|
String memberId = getMemberIdByAuthorization(request);
|
||||||
dto.setMemberId(memberId);
|
dto.setMemberId(memberId);
|
||||||
memberService.updateMemberInvoiceTitle(dto);
|
memberService.updateMemberInvoiceTitle(dto);
|
||||||
response = new RestApiResponse<>();
|
response = new RestApiResponse<>();
|
||||||
} catch (BusinessException e) {
|
} catch (BusinessException e) {
|
||||||
logger.error("修改会员发票抬头 error", e);
|
logger.error("修改会员发票抬头 error", e);
|
||||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("修改会员发票抬头 error", e);
|
logger.error("修改会员发票抬头 error", e);
|
||||||
response = new RestApiResponse<>(e);
|
response = new RestApiResponse<>(e);
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除会员发票抬头
|
* 删除会员发票抬头
|
||||||
* @param request
|
*
|
||||||
* @param dto
|
* @param request
|
||||||
* @return
|
* @param dto
|
||||||
*/
|
* @return
|
||||||
@PostMapping("/deleteMemberInvoiceTitle")
|
*/
|
||||||
public RestApiResponse<?> deleteMemberInvoiceTitle(HttpServletRequest request, @RequestBody InvoiceTitleDTO dto) {
|
@PostMapping("/deleteMemberInvoiceTitle")
|
||||||
logger.info("修改会员发票抬头 param:{}", JSONObject.toJSONString(dto));
|
public RestApiResponse<?> deleteMemberInvoiceTitle(HttpServletRequest request, @RequestBody InvoiceTitleDTO dto) {
|
||||||
RestApiResponse<?> response = null;
|
logger.info("修改会员发票抬头 param:{}", JSONObject.toJSONString(dto));
|
||||||
try {
|
RestApiResponse<?> response = null;
|
||||||
String memberId = getMemberIdByAuthorization(request);
|
try {
|
||||||
dto.setMemberId(memberId);
|
String memberId = getMemberIdByAuthorization(request);
|
||||||
memberService.deleteMemberInvoiceTitle(dto);
|
dto.setMemberId(memberId);
|
||||||
response = new RestApiResponse<>();
|
memberService.deleteMemberInvoiceTitle(dto);
|
||||||
} catch (BusinessException e) {
|
response = new RestApiResponse<>();
|
||||||
logger.error("修改会员发票抬头 error", e);
|
} catch (BusinessException e) {
|
||||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
logger.error("修改会员发票抬头 error", e);
|
||||||
} catch (Exception e) {
|
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||||
logger.error("修改会员发票抬头 error", e);
|
} catch (Exception e) {
|
||||||
response = new RestApiResponse<>(e);
|
logger.error("修改会员发票抬头 error", e);
|
||||||
}
|
response = new RestApiResponse<>(e);
|
||||||
return response;
|
}
|
||||||
}
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询会员发票抬头列表
|
* 查询会员发票抬头列表
|
||||||
* http://localhost:8080/uniapp/member/queryMemberInvoiceTitles
|
* http://localhost:8080/uniapp/member/queryMemberInvoiceTitles
|
||||||
*/
|
*/
|
||||||
@GetMapping("/queryMemberInvoiceTitles")
|
@GetMapping("/queryMemberInvoiceTitles")
|
||||||
public RestApiResponse<?> queryMemberInvoiceTitles(HttpServletRequest request) {
|
public RestApiResponse<?> queryMemberInvoiceTitles(HttpServletRequest request) {
|
||||||
RestApiResponse<?> response = null;
|
RestApiResponse<?> response = null;
|
||||||
try {
|
try {
|
||||||
String memberId = getMemberIdByAuthorization(request);
|
String memberId = getMemberIdByAuthorization(request);
|
||||||
List<InvoiceTitleVO> list = memberService.queryMemberInvoiceTitles(memberId);
|
List<InvoiceTitleVO> list = memberService.queryMemberInvoiceTitles(memberId);
|
||||||
response = new RestApiResponse<>(ImmutableMap.of("list", list));
|
response = new RestApiResponse<>(ImmutableMap.of("list", list));
|
||||||
} catch (BusinessException e) {
|
} catch (BusinessException e) {
|
||||||
logger.error("查询会员发票抬头列表 error", e);
|
logger.error("查询会员发票抬头列表 error", e);
|
||||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("查询会员发票抬头列表 error", e);
|
logger.error("查询会员发票抬头列表 error", e);
|
||||||
response = new RestApiResponse<>(e);
|
response = new RestApiResponse<>(e);
|
||||||
}
|
}
|
||||||
logger.info("查询会员发票抬头列表 result:{}", response);
|
logger.info("查询会员发票抬头列表 result:{}", response);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询会员钱包列表
|
* 查询会员钱包列表
|
||||||
* http://localhost:8080/uniapp/member/queryMemberWalletList
|
* http://localhost:8080/uniapp/member/queryMemberWalletList
|
||||||
*/
|
*/
|
||||||
@GetMapping("/queryMemberWalletList")
|
@GetMapping("/queryMemberWalletList")
|
||||||
public RestApiResponse<?> queryMemberWalletList(HttpServletRequest request) {
|
public RestApiResponse<?> queryMemberWalletList(HttpServletRequest request) {
|
||||||
RestApiResponse<?> response = null;
|
RestApiResponse<?> response = null;
|
||||||
try {
|
try {
|
||||||
String memberId = getMemberIdByAuthorization(request);
|
String memberId = getMemberIdByAuthorization(request);
|
||||||
List<MemberWalletVO> list = memberService.queryMemberWalletList(memberId);
|
List<MemberWalletVO> list = memberService.queryMemberWalletList(memberId);
|
||||||
response = new RestApiResponse<>(ImmutableMap.of("list", list));
|
response = new RestApiResponse<>(ImmutableMap.of("list", list));
|
||||||
} catch (BusinessException e) {
|
} catch (BusinessException e) {
|
||||||
logger.error("查询会员钱包列表 error", e);
|
logger.error("查询会员钱包列表 error", e);
|
||||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("查询会员钱包列表 error", e);
|
logger.error("查询会员钱包列表 error", e);
|
||||||
response = new RestApiResponse<>(e);
|
response = new RestApiResponse<>(e);
|
||||||
}
|
}
|
||||||
logger.info("查询会员钱包列表 result:{}", response);
|
logger.info("查询会员钱包列表 result:{}", response);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user