This commit is contained in:
admin-lmm
2023-07-04 14:28:29 +08:00
9 changed files with 266 additions and 161 deletions

View File

@@ -13,26 +13,14 @@ import com.jsowell.common.response.RestApiResponse;
import com.jsowell.common.util.SMSUtil; import com.jsowell.common.util.SMSUtil;
import com.jsowell.common.util.StringUtils; import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.MemberPlateNumberRelation; import com.jsowell.pile.domain.MemberPlateNumberRelation;
import com.jsowell.pile.dto.BindingCarNoDTO; import com.jsowell.pile.dto.*;
import com.jsowell.pile.dto.BindingCardDTO;
import com.jsowell.pile.dto.InvoiceTitleDTO;
import com.jsowell.pile.dto.MemberRegisterAndLoginDTO;
import com.jsowell.pile.dto.MemberRegisterDTO;
import com.jsowell.pile.dto.UniAppQueryMemberBalanceDTO;
import com.jsowell.pile.dto.WechatLoginDTO;
import com.jsowell.pile.dto.WeixinPayDTO;
import com.jsowell.pile.service.IMemberBasicInfoService; import com.jsowell.pile.service.IMemberBasicInfoService;
import com.jsowell.pile.service.IMemberPlateNumberRelationService; import com.jsowell.pile.service.IMemberPlateNumberRelationService;
import com.jsowell.pile.vo.MemberPlateNumberVO;
import com.jsowell.pile.vo.uniapp.InvoiceTitleVO; import com.jsowell.pile.vo.uniapp.InvoiceTitleVO;
import com.jsowell.pile.vo.uniapp.MemberVO; import com.jsowell.pile.vo.uniapp.MemberVO;
import com.jsowell.service.MemberService; import com.jsowell.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.List; import java.util.List;
@@ -146,7 +134,6 @@ public class MemberController extends BaseController {
/** /**
* 查询用户账户信息 * 查询用户账户信息
*
* http://localhost:8080/uniapp/member/getMemberInfo * http://localhost:8080/uniapp/member/getMemberInfo
* @return 用户账户信息 * @return 用户账户信息
*/ */

View File

@@ -42,10 +42,8 @@ import com.jsowell.pile.vo.base.OrderPeriodAmountVO;
import com.jsowell.pile.vo.base.PileInfoVO; import com.jsowell.pile.vo.base.PileInfoVO;
import com.jsowell.pile.vo.base.StationInfoVO; import com.jsowell.pile.vo.base.StationInfoVO;
import com.jsowell.pile.vo.uniapp.*; import com.jsowell.pile.vo.uniapp.*;
import com.jsowell.pile.vo.web.BillingTemplateVO; import com.jsowell.pile.vo.uniapp.InvoiceRecordVO;
import com.jsowell.pile.vo.web.OrderDetailInfoVO; import com.jsowell.pile.vo.web.*;
import com.jsowell.pile.vo.web.PileStationVO;
import com.jsowell.pile.vo.web.UpdateMemberBalanceDTO;
import com.jsowell.wxpay.dto.WeChatRefundDTO; import com.jsowell.wxpay.dto.WeChatRefundDTO;
import com.jsowell.wxpay.response.WechatPayNotifyParameter; import com.jsowell.wxpay.response.WechatPayNotifyParameter;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
@@ -1129,10 +1127,11 @@ public class OrderService {
List<PayModeVO> result = Lists.newArrayList(); List<PayModeVO> result = Lists.newArrayList();
// 查询会员在站点是否是白名单用户 // 查询会员在站点是否是白名单用户
PileStationWhitelist whitelist = pileStationWhitelistService.queryWhitelistByMemberId(dto.getStationId(), dto.getMemberId()); PileStationWhitelist whitelist = pileStationWhitelistService.queryWhitelistByMemberId(dto.getStationId(), dto.getMemberId());
boolean flag = false;
if (whitelist != null) { // 查询是否为平台测试员
flag = true; PlatformTesterVO platformTesterVO = memberBasicInfoService.selectPlatformTesterStatus(dto.getMemberId());
}
boolean flag = whitelist != null || StringUtils.equals(platformTesterVO.getStatus(), Constants.ONE);
if (flag) { if (flag) {
result.add( result.add(

View File

@@ -1,5 +1,6 @@
package com.jsowell.web.controller.pile; package com.jsowell.web.controller.pile;
import com.alibaba.fastjson2.JSON;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.jsowell.common.annotation.Log; import com.jsowell.common.annotation.Log;
@@ -8,9 +9,12 @@ import com.jsowell.common.core.domain.AjaxResult;
import com.jsowell.common.core.page.TableDataInfo; import com.jsowell.common.core.page.TableDataInfo;
import com.jsowell.common.enums.BusinessType; import com.jsowell.common.enums.BusinessType;
import com.jsowell.common.enums.uniapp.BalanceChangesEnum; import com.jsowell.common.enums.uniapp.BalanceChangesEnum;
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.util.StringUtils; import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.MemberBasicInfo; import com.jsowell.pile.domain.MemberBasicInfo;
import com.jsowell.pile.domain.MemberPlateNumberRelation; import com.jsowell.pile.domain.MemberPlateNumberRelation;
import com.jsowell.pile.dto.PlatformTesterDTO;
import com.jsowell.pile.dto.UniAppQueryMemberBalanceDTO; import com.jsowell.pile.dto.UniAppQueryMemberBalanceDTO;
import com.jsowell.pile.service.IMemberBasicInfoService; import com.jsowell.pile.service.IMemberBasicInfoService;
import com.jsowell.pile.service.IMemberPlateNumberRelationService; import com.jsowell.pile.service.IMemberPlateNumberRelationService;
@@ -18,6 +22,7 @@ import com.jsowell.pile.service.IMemberTransactionRecordService;
import com.jsowell.pile.vo.uniapp.MemberVO; import com.jsowell.pile.vo.uniapp.MemberVO;
import com.jsowell.pile.vo.uniapp.MemberWalletLogVO; import com.jsowell.pile.vo.uniapp.MemberWalletLogVO;
import com.jsowell.pile.vo.web.MemberTransactionVO; import com.jsowell.pile.vo.web.MemberTransactionVO;
import com.jsowell.pile.vo.web.PlatformTesterVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@@ -76,7 +81,7 @@ public class MemberBasicInfoController extends BaseController {
@PreAuthorize("@ss.hasPermi('member:info:query')") @PreAuthorize("@ss.hasPermi('member:info:query')")
@GetMapping(value = "/getMemberPersonPileInfo/{memberId}") @GetMapping(value = "/getMemberPersonPileInfo/{memberId}")
public AjaxResult getMemberPersonPileInfo(@PathVariable("memberId") String memberId){ public AjaxResult getMemberPersonPileInfo(@PathVariable("memberId") String memberId) {
return AjaxResult.success(memberBasicInfoService.getMemberPersonPileInfo(memberId)); return AjaxResult.success(memberBasicInfoService.getMemberPersonPileInfo(memberId));
} }
@@ -156,13 +161,14 @@ public class MemberBasicInfoController extends BaseController {
/** /**
* 修改车牌号信息 * 修改车牌号信息
*
* @param relation * @param relation
* @return * @return
*/ */
@PreAuthorize("@ss.hasPermi('member:info:edit')") @PreAuthorize("@ss.hasPermi('member:info:edit')")
@Log(title = "修改车牌号信息", businessType = BusinessType.UPDATE) @Log(title = "修改车牌号信息", businessType = BusinessType.UPDATE)
@PostMapping("/updatePlateNumber") @PostMapping("/updatePlateNumber")
public AjaxResult updatePlateNumber(@RequestBody MemberPlateNumberRelation relation){ public AjaxResult updatePlateNumber(@RequestBody MemberPlateNumberRelation relation) {
int i = memberPlateNumberRelationService.updatePlateNumber(relation); int i = memberPlateNumberRelationService.updatePlateNumber(relation);
logger.info("后管修改用户:{} 的车牌号:{}", relation.getMemberId(), relation.getLicensePlateNumber()); logger.info("后管修改用户:{} 的车牌号:{}", relation.getMemberId(), relation.getLicensePlateNumber());
return toAjax(i); return toAjax(i);
@@ -174,7 +180,7 @@ public class MemberBasicInfoController extends BaseController {
@PreAuthorize("@ss.hasPermi('member:info:remove')") @PreAuthorize("@ss.hasPermi('member:info:remove')")
@Log(title = "会员绑定的车牌号信息", businessType = BusinessType.DELETE) @Log(title = "会员绑定的车牌号信息", businessType = BusinessType.DELETE)
@PostMapping("/deletePlateNumber") @PostMapping("/deletePlateNumber")
public AjaxResult deletePlateNumber(@RequestBody MemberPlateNumberRelation relation){ public AjaxResult deletePlateNumber(@RequestBody MemberPlateNumberRelation relation) {
int i = memberPlateNumberRelationService.unbindingPlateNumber(relation.getMemberId(), relation.getLicensePlateNumber()); int i = memberPlateNumberRelationService.unbindingPlateNumber(relation.getMemberId(), relation.getLicensePlateNumber());
logger.info("后管解除绑定用户:{} 的车牌号:{}", relation.getMemberId(), relation.getLicensePlateNumber()); logger.info("后管解除绑定用户:{} 的车牌号:{}", relation.getMemberId(), relation.getLicensePlateNumber());
return toAjax(i); return toAjax(i);
@@ -182,10 +188,41 @@ public class MemberBasicInfoController extends BaseController {
/** /**
* 修改平台测试员状态 * 修改平台测试员状态
* * http://localhost:8080/member/info/updatePlatformTester
*/ */
public AjaxResult updatePlatformTester() { @PostMapping("/updatePlatformTester")
AjaxResult result = new AjaxResult(); public AjaxResult updatePlatformTester(@RequestBody PlatformTesterDTO dto) {
AjaxResult result;
try {
if (StringUtils.isBlank(dto.getMemberId()) || StringUtils.isBlank(dto.getStatus())) {
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
}
memberBasicInfoService.updatePlatformTester(dto);
result = AjaxResult.success();
} catch (BusinessException e) {
logger.error("修改平台测试员状态error param:{}", JSON.toJSONString(dto), e);
result = AjaxResult.error(e.getMessage());
}
return result;
}
/**
* 查询平台测试员状态
* http://localhost:8080/member/info/selectPlatformTesterStatus
*/
@PostMapping("/selectPlatformTesterStatus")
public AjaxResult selectPlatformTesterStatus(@RequestBody PlatformTesterDTO dto) {
AjaxResult result;
try {
if (StringUtils.isBlank(dto.getMemberId())) {
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
}
PlatformTesterVO platformTesterVO = memberBasicInfoService.selectPlatformTesterStatus(dto.getMemberId());
result = AjaxResult.success(platformTesterVO);
} catch (BusinessException e) {
logger.error("查询平台测试员状态error param:{}", JSON.toJSONString(dto), e);
result = AjaxResult.error(e.getMessage());
}
return result; return result;
} }
} }

View File

@@ -6,10 +6,6 @@ package com.jsowell.common.constant;
* @author jsowell * @author jsowell
*/ */
public class CacheConstants { public class CacheConstants {
/**
*
*/
public static final int cache_expire_time_1m = 60; public static final int cache_expire_time_1m = 60;
@@ -23,6 +19,8 @@ public class CacheConstants {
public static final int cache_expire_time_1d = 60 * 60 * 24; public static final int cache_expire_time_1d = 60 * 60 * 24;
public static final String PLATFORM_TESTER = "platform_tester:";
public static final String GET_PILE_MODEL_INFO_BY_MODEL_ID = "get_pile_model_info_by_model_id:"; public static final String GET_PILE_MODEL_INFO_BY_MODEL_ID = "get_pile_model_info_by_model_id:";
// 根据站点id查询充电桩列表 // 根据站点id查询充电桩列表

View File

@@ -0,0 +1,21 @@
package com.jsowell.pile.dto;
import lombok.*;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class PlatformTesterDTO {
/**
* 会员id
*/
private String memberId;
/**
* 平台测试员状态
* 1-是0-否
*/
private String status;
}

View File

@@ -1,10 +1,11 @@
package com.jsowell.pile.service; package com.jsowell.pile.service;
import com.jsowell.pile.domain.MemberBasicInfo; import com.jsowell.pile.domain.MemberBasicInfo;
import com.jsowell.pile.dto.BindingCarNoDTO; import com.jsowell.pile.dto.PlatformTesterDTO;
import com.jsowell.pile.vo.uniapp.MemberVO; import com.jsowell.pile.vo.uniapp.MemberVO;
import com.jsowell.pile.vo.uniapp.MemberWalletLogVO; import com.jsowell.pile.vo.uniapp.MemberWalletLogVO;
import com.jsowell.pile.vo.uniapp.PersonalPileInfoVO; import com.jsowell.pile.vo.uniapp.PersonalPileInfoVO;
import com.jsowell.pile.vo.web.PlatformTesterVO;
import com.jsowell.pile.vo.web.UpdateMemberBalanceDTO; import com.jsowell.pile.vo.web.UpdateMemberBalanceDTO;
import java.util.List; import java.util.List;
@@ -117,4 +118,7 @@ public interface IMemberBasicInfoService {
*/ */
List<PersonalPileInfoVO> getMemberPersonPileInfo(String memberId); List<PersonalPileInfoVO> getMemberPersonPileInfo(String memberId);
void updatePlatformTester(PlatformTesterDTO dto);
PlatformTesterVO selectPlatformTesterStatus(String memberId);
} }

View File

@@ -1,12 +1,16 @@
package com.jsowell.pile.service.impl; package com.jsowell.pile.service.impl;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.jsowell.common.constant.CacheConstants;
import com.jsowell.common.constant.Constants;
import com.jsowell.common.core.redis.RedisCache;
import com.jsowell.common.util.DateUtils; import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.StringUtils; import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.MemberBasicInfo; import com.jsowell.pile.domain.MemberBasicInfo;
import com.jsowell.pile.domain.MemberPlateNumberRelation; import com.jsowell.pile.domain.MemberPlateNumberRelation;
import com.jsowell.pile.domain.MemberWalletInfo; import com.jsowell.pile.domain.MemberWalletInfo;
import com.jsowell.pile.domain.MemberWalletLog; import com.jsowell.pile.domain.MemberWalletLog;
import com.jsowell.pile.dto.PlatformTesterDTO;
import com.jsowell.pile.mapper.MemberBasicInfoMapper; import com.jsowell.pile.mapper.MemberBasicInfoMapper;
import com.jsowell.pile.mapper.MemberPlateNumberRelationMapper; import com.jsowell.pile.mapper.MemberPlateNumberRelationMapper;
import com.jsowell.pile.mapper.MemberWalletInfoMapper; import com.jsowell.pile.mapper.MemberWalletInfoMapper;
@@ -16,6 +20,7 @@ import com.jsowell.pile.service.IPileBasicInfoService;
import com.jsowell.pile.vo.uniapp.MemberVO; import com.jsowell.pile.vo.uniapp.MemberVO;
import com.jsowell.pile.vo.uniapp.MemberWalletLogVO; import com.jsowell.pile.vo.uniapp.MemberWalletLogVO;
import com.jsowell.pile.vo.uniapp.PersonalPileInfoVO; import com.jsowell.pile.vo.uniapp.PersonalPileInfoVO;
import com.jsowell.pile.vo.web.PlatformTesterVO;
import com.jsowell.pile.vo.web.UpdateMemberBalanceDTO; import com.jsowell.pile.vo.web.UpdateMemberBalanceDTO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
@@ -49,6 +54,9 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
@Autowired @Autowired
private MemberPlateNumberRelationMapper memberPlateNumberRelationMapper; private MemberPlateNumberRelationMapper memberPlateNumberRelationMapper;
@Autowired
private RedisCache redisCache;
/** /**
* 查询会员基础信息 * 查询会员基础信息
* *
@@ -282,5 +290,35 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
return pileBasicInfoService.getPileInfoByMemberId(memberId); return pileBasicInfoService.getPileInfoByMemberId(memberId);
} }
@Override
public void updatePlatformTester(PlatformTesterDTO dto) {
if (StringUtils.isBlank(dto.getMemberId()) || StringUtils.isBlank(dto.getStatus())) {
return;
}
String redisKey = CacheConstants.PLATFORM_TESTER + dto.getMemberId();
if (StringUtils.equals(dto.getStatus(), Constants.ONE)) {
// 放缓存
redisCache.setCacheObject(redisKey, Constants.ONE);
} else {
// 清缓存
redisCache.deleteObject(redisKey);
}
}
@Override
public PlatformTesterVO selectPlatformTesterStatus(String memberId) {
PlatformTesterVO vo = new PlatformTesterVO();
String redisKey = CacheConstants.PLATFORM_TESTER + memberId;
String status = redisCache.getCacheObject(redisKey);
if (StringUtils.isNotBlank(status)) {
vo.setStatus(status);
} else {
vo.setStatus(Constants.ZERO);
}
vo.setMemberId(memberId);
return vo;
}
} }

View File

@@ -0,0 +1,21 @@
package com.jsowell.pile.vo.web;
import lombok.*;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class PlatformTesterVO {
/**
* 会员id
*/
private String memberId;
/**
* 平台测试员状态
* 1-是0-否
*/
private String status;
}

View File

@@ -24,7 +24,7 @@
<div class="pull-right">{{ user.email }}</div> <div class="pull-right">{{ user.email }}</div>
</li> </li>
<li class="list-group-item"> <li class="list-group-item">
<svg-icon icon-class="tree" />所属部门 <svg-icon icon-class="tree" />所属运营商
<div class="pull-right" v-if="user.dept">{{ user.dept.deptName }} / {{ postGroup }}</div> <div class="pull-right" v-if="user.dept">{{ user.dept.deptName }} / {{ postGroup }}</div>
</li> </li>
<li class="list-group-item"> <li class="list-group-item">