1. 小程序端查询换电站接口
2. 换电站添加时 增加编码验证,避免重复添加 3. 完善全局异常,添加 MethodArgumentNotValidException 异常 4. 预约订单时,添加车辆、人员检查 5. 完善小程序轮播图接口 6. 完善小程序协议接口 7. 小程序人员 openid、手机号脱敏处理
This commit is contained in:
parent
0eb4df7cf9
commit
652fd909df
@ -71,6 +71,13 @@ public class BatteryStation implements Serializable {
|
||||
|
||||
@Schema(description = "联系电话")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "服务车辆类型")
|
||||
private String carTypeCode;
|
||||
|
||||
@Schema(description = "是否适合该车辆")
|
||||
@TableField(exist = false)
|
||||
private Boolean isSuitable;
|
||||
|
||||
@Schema(description = "删除标识:1-已删除,0-未删除")
|
||||
private Integer delFlag;
|
||||
|
||||
@ -64,6 +64,7 @@ public class OrderSwapBatteryPre implements Serializable {
|
||||
private Date reservationTime;
|
||||
|
||||
@Schema(description = "预约换电日期", example = "yyyyMMdd", requiredMode = RequiredMode.REQUIRED)
|
||||
@NotBlank
|
||||
private String swapDay;
|
||||
|
||||
@Schema(description = "预约换电时间段", example = "8:00-10:00")
|
||||
|
||||
@ -45,7 +45,8 @@ public class WechatAgreement implements Serializable {
|
||||
@NotBlank
|
||||
private String content;
|
||||
|
||||
@Schema(description = "版本")
|
||||
@Schema(description = "版本", requiredMode = RequiredMode.REQUIRED)
|
||||
@NotBlank
|
||||
private String version;
|
||||
|
||||
@Schema(description = "状态:1-可用,0-不可用")
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
package com.evotech.hd.common.web.exception;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
import org.springframework.http.converter.HttpMessageNotReadableException;
|
||||
import org.springframework.web.bind.MethodArgumentNotValidException;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
|
||||
@ -32,7 +35,7 @@ public class GlobalExceptionHandler {
|
||||
*/
|
||||
@ExceptionHandler(value = NullPointerException.class)
|
||||
public Result<String> exceptionHandler(HttpServletRequest req, NullPointerException e) {
|
||||
log.error("空指针异常:", e);
|
||||
log.error("\r\n===>>>空指针异常:", e);
|
||||
return new Result<String>().bussinessException(CodeMsg.ERROR.getCode(), e.getMessage(), null);
|
||||
}
|
||||
|
||||
@ -42,7 +45,7 @@ public class GlobalExceptionHandler {
|
||||
*/
|
||||
@ExceptionHandler(value = HttpMessageNotReadableException.class)
|
||||
public Result<String> exceptionHandler(HttpServletRequest req, HttpMessageNotReadableException e) {
|
||||
log.error("http请求参数解析异常:", e);
|
||||
log.error("\r\n===>>>http请求参数解析异常:", e);
|
||||
return new Result<String>().bussinessException(CodeMsg.PARAM_ERROR.getCode(), "http请求参数解析异常", e.getMessage());
|
||||
}
|
||||
|
||||
@ -53,7 +56,7 @@ public class GlobalExceptionHandler {
|
||||
*/
|
||||
@ExceptionHandler(value = MyArgumentException.class)
|
||||
public Result<String> exceptionHandler(HttpServletRequest req, MyArgumentException e) {
|
||||
log.error("请求参数异常:", e);
|
||||
log.error("\r\n===>>>请求参数异常:", e);
|
||||
return new Result<String>().bussinessException(CodeMsg.PARAM_ERROR.getCode(), CodeMsg.PARAM_ERROR.getMsg(), e.getParamArr());
|
||||
}
|
||||
|
||||
@ -66,18 +69,28 @@ public class GlobalExceptionHandler {
|
||||
*/
|
||||
@ExceptionHandler(value = DataIntegrityViolationException.class)
|
||||
public Result<String> exceptionHandler(HttpServletRequest req, DataIntegrityViolationException e) {
|
||||
log.error("sql语句异常:", e);
|
||||
log.error("\r\n===>>>sql语句异常:", e);
|
||||
return new Result<String>().bussinessException(CodeMsg.SQL_RUN_ERROR.getCode(), e.getCause().toString(), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Valid抛出的参数异常
|
||||
*/
|
||||
@ExceptionHandler(value = MethodArgumentNotValidException.class)
|
||||
public Result<String> exceptionHandler(HttpServletRequest req, MethodArgumentNotValidException e) {
|
||||
log.error("\r\n===>>>传参 自动检测出 错误:", e);
|
||||
String param = e.getBindingResult().getFieldErrors().stream().map(i -> i.getField()).collect(Collectors.joining(","));
|
||||
return new Result<String>().bussinessException(CodeMsg.PARAM_ERROR.getCode(), param, e.getBindingResult().getFieldErrors());
|
||||
}
|
||||
|
||||
/**
|
||||
* 自己抛出的运行异常
|
||||
* @param req
|
||||
* @param e
|
||||
*/
|
||||
@ExceptionHandler(value = Exception.class)
|
||||
public Result<String> exceptionHandler(HttpServletRequest req, RuntimeException e) {
|
||||
log.error("捕获运行异常:", e);
|
||||
public Result<String> exceptionHandler(HttpServletRequest req, Exception e) {
|
||||
log.error("\r\n===>>>捕获运行异常:", e);
|
||||
return new Result<String>().bussinessException(CodeMsg.ERROR.getCode(), e instanceof RuntimeException?e.getMessage():e.toString(), null);
|
||||
}
|
||||
|
||||
|
||||
@ -14,9 +14,11 @@ import com.evotech.hd.cloud.entity.request.PageListBatteryStationRequest;
|
||||
import com.evotech.hd.cloud.service.BatteryStationService;
|
||||
import com.evotech.hd.common.core.entity.Result;
|
||||
import com.evotech.hd.common.core.entity.cloud.BatteryStation;
|
||||
import com.evotech.hd.common.core.entity.cloud.vo.BatteryStationVO;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Hidden;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
@ -60,6 +62,13 @@ public class BatteryStationController {
|
||||
return batteryStationService.list(plbsr);
|
||||
}
|
||||
|
||||
@Operation(summary = "查询2")
|
||||
@GetMapping("/liststation")
|
||||
@Hidden
|
||||
public Result<List<BatteryStationVO>> listStation(@RequestParam(required = false) String plateNum) {
|
||||
return batteryStationService.listStation(plateNum);
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "站点秘钥")
|
||||
@PostMapping("/rsa_secret_key")
|
||||
|
||||
@ -6,6 +6,7 @@ import java.util.Map;
|
||||
import com.evotech.hd.cloud.entity.request.PageListBatteryStationRequest;
|
||||
import com.evotech.hd.common.core.entity.Result;
|
||||
import com.evotech.hd.common.core.entity.cloud.BatteryStation;
|
||||
import com.evotech.hd.common.core.entity.cloud.vo.BatteryStationVO;
|
||||
|
||||
public interface BatteryStationService {
|
||||
|
||||
@ -17,6 +18,8 @@ public interface BatteryStationService {
|
||||
|
||||
public Result<List<BatteryStation>> list(PageListBatteryStationRequest plbsr);
|
||||
|
||||
public Result<List<BatteryStationVO>> listStation(String plateNum);
|
||||
|
||||
public Result<Map<String, String>> RsaSecretKey(String stationCode);
|
||||
|
||||
}
|
||||
|
||||
@ -7,17 +7,23 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.evotech.hd.cloud.dao.BatteryStationDao;
|
||||
import com.evotech.hd.cloud.dao.BatteryStationSecretKeyDao;
|
||||
import com.evotech.hd.cloud.dao.VehicleInfoDao;
|
||||
import com.evotech.hd.cloud.entity.BatteryStationSecretKey;
|
||||
import com.evotech.hd.cloud.entity.request.PageListBatteryStationRequest;
|
||||
import com.evotech.hd.cloud.service.BatteryStationService;
|
||||
import com.evotech.hd.common.core.entity.Result;
|
||||
import com.evotech.hd.common.core.entity.cloud.BatteryStation;
|
||||
import com.evotech.hd.common.core.entity.cloud.VehicleInfo;
|
||||
import com.evotech.hd.common.core.entity.cloud.vo.BatteryStationVO;
|
||||
import com.evotech.hd.common.core.enums.CodeMsg;
|
||||
|
||||
import cn.hutool.crypto.KeyUtil;
|
||||
@ -31,10 +37,18 @@ public class BatteryStationServiceImpl implements BatteryStationService {
|
||||
private BatteryStationDao batteryStationDao;
|
||||
@Resource
|
||||
private BatteryStationSecretKeyDao batteryStationSecretKeyDao;
|
||||
@Resource
|
||||
private VehicleInfoDao vehicleInfoDao;
|
||||
|
||||
@Override
|
||||
public Result<Integer> add(BatteryStation bs) {
|
||||
bs.setCtime(new Date());
|
||||
boolean b = batteryStationDao.exists(new QueryWrapper<BatteryStation>()
|
||||
.eq("del_flag", 0)
|
||||
.eq("code", bs.getCode()));
|
||||
if (b) {
|
||||
return new Result<Integer>().error("换电站已存在!");
|
||||
}
|
||||
int n = batteryStationDao.insert(bs);
|
||||
if (n == 1) {
|
||||
return new Result<Integer>().success(n);
|
||||
@ -105,4 +119,37 @@ public class BatteryStationServiceImpl implements BatteryStationService {
|
||||
return new Result<Map<String,String>>().success(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<List<BatteryStationVO>> listStation(String plateNum) {
|
||||
|
||||
List<BatteryStation> list = batteryStationDao.selectList(new QueryWrapper<BatteryStation>().eq("del_flag", 0));
|
||||
if (list.isEmpty()) {
|
||||
return new Result<List<BatteryStationVO>>().error(CodeMsg.DATABASE_RESULT_NULL);
|
||||
}
|
||||
List<BatteryStationVO> res = list.stream().map(i -> {
|
||||
BatteryStationVO vo = new BatteryStationVO();
|
||||
BeanUtils.copyProperties(i, vo);
|
||||
return vo;
|
||||
}).toList();
|
||||
|
||||
if (StringUtils.hasText(plateNum)) {
|
||||
VehicleInfo vi = vehicleInfoDao.selectOne(new QueryWrapper<VehicleInfo>()
|
||||
.eq("del_flag", 0)
|
||||
.eq("plate_num", plateNum));
|
||||
if (vi == null) {
|
||||
return new Result<List<BatteryStationVO>>().error("无车辆信息!");
|
||||
}
|
||||
res = res.stream().map(i -> {
|
||||
if (StringUtils.hasText(i.getCarTypeCode()) && i.getCarTypeCode().contains(vi.getTypeCode())) {
|
||||
i.setIsSuitable(true);
|
||||
}
|
||||
return i;
|
||||
})
|
||||
.sorted((i1, i2) -> i1.getIsSuitable().compareTo(i2.getIsSuitable()))
|
||||
.toList();
|
||||
}
|
||||
|
||||
return new Result<List<BatteryStationVO>>().success(res);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -12,12 +12,16 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.evotech.hd.cloud.dao.OrderSwapBatteryDao;
|
||||
import com.evotech.hd.cloud.dao.OrderSwapBatteryPreDao;
|
||||
import com.evotech.hd.cloud.dao.OrderSwapBatteryStepDao;
|
||||
import com.evotech.hd.cloud.dao.VehicleInfoDao;
|
||||
import com.evotech.hd.cloud.service.OrderSwapBatteryService;
|
||||
import com.evotech.hd.common.core.dao.wechat.WechatUserDao;
|
||||
import com.evotech.hd.common.core.entity.Result;
|
||||
import com.evotech.hd.common.core.entity.cloud.OrderSwapBattery;
|
||||
import com.evotech.hd.common.core.entity.cloud.OrderSwapBatteryPre;
|
||||
import com.evotech.hd.common.core.entity.cloud.OrderSwapBatteryStep;
|
||||
import com.evotech.hd.common.core.entity.cloud.PageListSwapOrderRequest;
|
||||
import com.evotech.hd.common.core.entity.cloud.VehicleInfo;
|
||||
import com.evotech.hd.common.core.entity.wechat.WechatUser;
|
||||
import com.evotech.hd.common.core.enums.CodeMsg;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
@ -31,13 +35,32 @@ public class OrderSwapBatteryServiceImpl implements OrderSwapBatteryService {
|
||||
private OrderSwapBatteryPreDao orderSwapBatteryPreDao;
|
||||
@Resource
|
||||
private OrderSwapBatteryStepDao orderSwapBatteryStepDao;
|
||||
@Resource
|
||||
private VehicleInfoDao vehicleInfoDao;
|
||||
@Resource
|
||||
private WechatUserDao wechatUserDao;
|
||||
|
||||
|
||||
@Override
|
||||
public Result<Integer> addPre(OrderSwapBatteryPre osbp) {
|
||||
// 1. 检查车辆
|
||||
|
||||
boolean b1 = vehicleInfoDao.exists(new QueryWrapper<VehicleInfo>()
|
||||
.eq("del_flag", 0)
|
||||
.eq("plate_num", osbp.getPlateNum()));
|
||||
if (!b1) {
|
||||
return new Result<Integer>().error("车辆未注册!");
|
||||
}
|
||||
// 2. 检查预约人
|
||||
boolean b2 = wechatUserDao.exists(new QueryWrapper<WechatUser>()
|
||||
.ne("phone_number", "")
|
||||
.isNotNull("phone_number")
|
||||
.eq("wuid", osbp.getUcode()));
|
||||
if (!b2) {
|
||||
return new Result<Integer>().error("用户认证信息不全!");
|
||||
}
|
||||
// 是否需要验证人和车绑定关系
|
||||
|
||||
// 是否需要验证公司和车的绑定关系
|
||||
|
||||
// 3. 添加预约
|
||||
Date d = new Date();
|
||||
|
||||
@ -1,6 +1,64 @@
|
||||
package com.evotech.hd.resource.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.evotech.hd.common.core.entity.Result;
|
||||
import com.evotech.hd.common.core.entity.resource.WechatAgreement;
|
||||
import com.evotech.hd.resource.service.WechatAgreementService;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
@Tag(name = "微信协议")
|
||||
@RestController
|
||||
@RequestMapping("/wechat/agreement")
|
||||
@ApiSupport(order = 201)
|
||||
public class WechatAgreementController {
|
||||
|
||||
|
||||
@Resource
|
||||
private WechatAgreementService wechatAgreementService;
|
||||
|
||||
|
||||
@Operation(summary = "增加")
|
||||
@PostMapping("/add")
|
||||
@ApiOperationSupport(order = 1)
|
||||
public Result<Integer> add(@Valid @ParameterObject WechatAgreement wa) {
|
||||
return wechatAgreementService.add(wa);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@PostMapping("/del")
|
||||
@ApiOperationSupport(order = 2)
|
||||
public Result<Integer> delete(@NotNull Integer id) {
|
||||
return wechatAgreementService.delete(id);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping({"/update"})
|
||||
@ApiOperationSupport(order = 3)
|
||||
public Result<Integer> update(@ParameterObject WechatAgreement wa) {
|
||||
return wechatAgreementService.update(wa);
|
||||
}
|
||||
|
||||
@Operation(summary = "查询")
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 4)
|
||||
public Result<List<WechatAgreement>> list(@RequestParam String appid, @RequestParam Integer type, @RequestParam Integer status) {
|
||||
return wechatAgreementService.list(appid, type, status);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,63 @@
|
||||
package com.evotech.hd.resource.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.evotech.hd.common.core.entity.Result;
|
||||
import com.evotech.hd.common.core.entity.resource.WechatSwiper;
|
||||
import com.evotech.hd.resource.service.WechatSwiperService;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
@Tag(name = "微信轮播图")
|
||||
@RestController
|
||||
@RequestMapping("/wechat/swiper")
|
||||
@ApiSupport(order = 202)
|
||||
public class WechatSwiperController {
|
||||
|
||||
@Resource
|
||||
private WechatSwiperService wechatSwiperService;
|
||||
|
||||
|
||||
@Operation(summary = "增加")
|
||||
@PostMapping("/add")
|
||||
@ApiOperationSupport(order = 1)
|
||||
public Result<Integer> add(@Valid @ParameterObject WechatSwiper ws) {
|
||||
return wechatSwiperService.add(ws);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@PostMapping("/del")
|
||||
@ApiOperationSupport(order = 2)
|
||||
public Result<Integer> delete(@NotNull Integer id) {
|
||||
return wechatSwiperService.delete(id);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping({"/update"})
|
||||
@ApiOperationSupport(order = 3)
|
||||
public Result<Integer> update(@ParameterObject WechatSwiper ws) {
|
||||
return wechatSwiperService.update(ws);
|
||||
}
|
||||
|
||||
@Operation(summary = "查询")
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 4)
|
||||
public Result<List<WechatSwiper>> list(@RequestParam String appid, @RequestParam Integer type, @RequestParam Integer status) {
|
||||
return wechatSwiperService.list(appid, type, status);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.evotech.hd.common.core.entity.Result;
|
||||
@ -13,6 +14,7 @@ import com.evotech.hd.common.core.entity.cloud.OrderSwapBattery;
|
||||
import com.evotech.hd.common.core.entity.cloud.OrderSwapBatteryPre;
|
||||
import com.evotech.hd.common.core.entity.cloud.OrderSwapBatteryStep;
|
||||
import com.evotech.hd.common.core.entity.cloud.PageListSwapOrderRequest;
|
||||
import com.evotech.hd.common.core.entity.cloud.vo.BatteryStationVO;
|
||||
import com.evotech.hd.wechat.service.CloudService;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
@ -51,7 +53,7 @@ public class CloudServeController {
|
||||
@Operation(summary = "查询预约")
|
||||
@GetMapping("/order/swap/pre/list")
|
||||
@ApiOperationSupport(order = 3)
|
||||
public Result<List<OrderSwapBatteryPre>> listPre(String plateNum, Integer status, String ucode, String stationCode) {
|
||||
public Result<List<OrderSwapBatteryPre>> listPre(@RequestParam(required = false) String plateNum, @RequestParam(required = false) Integer status, @RequestParam(required = false) String ucode, @RequestParam(required = false) String stationCode) {
|
||||
return cloudService.listPre(plateNum, status, ucode, stationCode);
|
||||
}
|
||||
|
||||
@ -68,5 +70,12 @@ public class CloudServeController {
|
||||
public Result<List<OrderSwapBatteryStep>> listStep(@NotBlank String orderNo) {
|
||||
return cloudService.listStep(orderNo);
|
||||
}
|
||||
|
||||
@Operation(summary = "查询换电站")
|
||||
@GetMapping("/station/list")
|
||||
@ApiOperationSupport(order = 9)
|
||||
public Result<List<BatteryStationVO>> listStation(@RequestParam(required = false) String plateNum) {
|
||||
return cloudService.listStation(plateNum);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -13,6 +13,7 @@ import com.evotech.hd.common.core.entity.cloud.OrderSwapBattery;
|
||||
import com.evotech.hd.common.core.entity.cloud.OrderSwapBatteryPre;
|
||||
import com.evotech.hd.common.core.entity.cloud.OrderSwapBatteryStep;
|
||||
import com.evotech.hd.common.core.entity.cloud.PageListSwapOrderRequest;
|
||||
import com.evotech.hd.common.core.entity.cloud.vo.BatteryStationVO;
|
||||
|
||||
@FeignClient(value = "cloud-server")
|
||||
public interface CloudService {
|
||||
@ -35,6 +36,11 @@ public interface CloudService {
|
||||
|
||||
@GetMapping(value = "/cloud/order/swap/step/list",
|
||||
consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE})
|
||||
public Result<List<OrderSwapBatteryStep>> listStep(String orderNo);
|
||||
public Result<List<OrderSwapBatteryStep>> listStep(@RequestParam String orderNo);
|
||||
|
||||
@GetMapping(value = "/cloud/batterystation/liststation",
|
||||
consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE})
|
||||
public Result<List<BatteryStationVO>> listStation(@RequestParam String plateNum);
|
||||
// public Result<List<BatteryStation>> listStation(@SpringQueryMap BasePageRequest bpr);
|
||||
|
||||
}
|
||||
|
||||
@ -9,6 +9,7 @@ import com.evotech.hd.common.core.entity.wechat.WechatUser;
|
||||
import com.evotech.hd.common.core.enums.CodeMsg;
|
||||
import com.evotech.hd.wechat.service.WechatUserService;
|
||||
|
||||
import cn.hutool.core.util.DesensitizedUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
|
||||
@ -34,6 +35,8 @@ public class WechatUserServiceImpl implements WechatUserService {
|
||||
if (user == null) {
|
||||
return new Result<WechatUser>().error(CodeMsg.DATABASE_RESULT_NULL);
|
||||
}
|
||||
user.setOpenid(DesensitizedUtil.idCardNum(user.getOpenid(), 5, 6));
|
||||
user.setPhoneNumber(DesensitizedUtil.mobilePhone(user.getPhoneNumber()));
|
||||
return new Result<WechatUser>().success(user);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user