fix:小程序申请绑定公司,公司登录后审核
This commit is contained in:
parent
796e72cbfd
commit
94d499ab28
@ -84,4 +84,7 @@ public class WechatUser implements Serializable {
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||
private Date uptime;
|
||||
|
||||
@Schema(description = "审核状态:1-待审核,2-审核成功,3-审核失败")
|
||||
private Integer state;
|
||||
}
|
||||
|
||||
@ -42,11 +42,17 @@ public class WechatUserController {
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "关联公司")
|
||||
@Operation(summary = "pc-微信用户-关联公司")
|
||||
@PostMapping("/companyrelation")
|
||||
public Result<Integer> companyRelation(String wuid, String pcode, String pname) {
|
||||
return wechatUserService.companyRelation(wuid, pcode, pname);
|
||||
}
|
||||
|
||||
@Operation(summary = "处理待审核数据")
|
||||
@PostMapping("/alterState")
|
||||
public Result<Integer> alterState(String wuid, String state) {
|
||||
return wechatUserService.alterState(wuid, state);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -165,4 +165,11 @@ public class OrderSwapBatteryController {
|
||||
return orderSwapBatteryService.getStartSwap(wuid,orderId);
|
||||
}
|
||||
|
||||
@Operation(summary = "未完成订单查询:plateNum")
|
||||
@GetMapping("/checkList")
|
||||
@ApiOperationSupport(order = 18)
|
||||
public Result<Integer> checkList(@ParameterObject PageListSwapOrderRequest plsor) {
|
||||
return orderSwapBatteryService.checkList(plsor);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -42,4 +42,7 @@ public class PageListVehicleRequest extends BasePageRequest {
|
||||
@Schema(description = "公司编码")
|
||||
private String ccode;
|
||||
|
||||
@Schema(description = "运营商Id")
|
||||
private String proxyOperaterId;
|
||||
|
||||
}
|
||||
|
||||
@ -49,4 +49,6 @@ public interface OrderSwapBatteryService {
|
||||
public Result<Boolean> startSwap(String wuid,String orderId);
|
||||
|
||||
public Result<BatterySwapResponse> getStartSwap(String wuid, String orderId);
|
||||
|
||||
public Result<Integer> checkList(PageListSwapOrderRequest plsor);
|
||||
}
|
||||
|
||||
@ -16,4 +16,6 @@ public interface WechatUserService {
|
||||
|
||||
|
||||
public WechatUser selectUcode(String phone, String uname);
|
||||
|
||||
public Result<Integer> alterState(String wuid, String state);
|
||||
}
|
||||
|
||||
@ -566,4 +566,46 @@ public class OrderSwapBatteryServiceImpl implements OrderSwapBatteryService {
|
||||
return new Result<BatterySwapResponse>().error("系统获取换电状态时发生异常");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Result<Integer> checkList(PageListSwapOrderRequest plsor) {
|
||||
|
||||
Page<OrderSwapBattery> page = new Page<OrderSwapBattery>(plsor.getPageNo(), plsor.getPageSize());
|
||||
List<Integer> statusList = new ArrayList<Integer>();
|
||||
String strs= "1,2,3,4,5,6";
|
||||
if (StringUtils.hasText(strs)) {//订单状态”已完成“之前的状态
|
||||
statusList = Arrays.asList(strs.split(",")).stream().map(Integer::valueOf).toList();
|
||||
}
|
||||
|
||||
page = orderSwapBatteryDao.selectPage(page, new QueryWrapper<OrderSwapBattery>()
|
||||
.eq(StringUtils.hasText(plsor.getOrderNo()), "order_no", plsor.getOrderNo())
|
||||
.eq(StringUtils.hasText(plsor.getPlateNum()), "plate_num", plsor.getPlateNum())
|
||||
.in(!statusList.isEmpty(), "status", statusList)
|
||||
.ge(plsor.getOrderTimeBegin() != null, "order_time", plsor.getOrderTimeBegin())
|
||||
.le(plsor.getOrderTimeEnd() != null, "order_time", plsor.getOrderTimeEnd())
|
||||
.eq(StringUtils.hasText(plsor.getStationCode()), "station_code", plsor.getStationCode())
|
||||
.like(StringUtils.hasText(plsor.getStationName()), "station_name", plsor.getStationName())
|
||||
.eq(StringUtils.hasText(plsor.getUserId()), "order_pre_uid", plsor.getUserId())
|
||||
.eq(StringUtils.hasText(plsor.getTradeNo()), "trade_no", plsor.getTradeNo())
|
||||
.ne("del_flag", 1)
|
||||
.orderByDesc("pk_id"));
|
||||
if (!page.getRecords().isEmpty()) {
|
||||
return new Result<Integer>().error("该车辆有未结算的订单,请确认后重试!");
|
||||
}
|
||||
|
||||
|
||||
/*Page<OrderSwapBatteryPre> page1 = new Page<OrderSwapBatteryPre>(plsor.getPageNo(), plsor.getPageSize());
|
||||
page1 = orderSwapBatteryPreDao.selectPage(page1, new QueryWrapper<OrderSwapBatteryPre>()
|
||||
.eq(StringUtils.hasText("1"), "status", "1")
|
||||
.eq(StringUtils.hasText(plsor.getPlateNum()), "plate_num", plsor.getPlateNum())
|
||||
.orderByDesc("pk_id"));
|
||||
if (!page1.getRecords().isEmpty()) {
|
||||
return new Result<Integer>().error("该车辆有预约成功的订单,请处理后重试!");
|
||||
}*/
|
||||
|
||||
|
||||
return new Result<Integer>().success(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -58,6 +58,21 @@ public class WechatUserServiceImpl implements WechatUserService {
|
||||
return new Result<Integer>().error("修改微信用户信息出错!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Integer> alterState(String wuid, String state) {
|
||||
if (!(StringUtils.hasText(wuid) || StringUtils.hasText(state))) {
|
||||
return new Result<Integer>().error(CodeMsg.PARAM_IS_NULL);
|
||||
}
|
||||
WechatUser user = new WechatUser();
|
||||
user.setState(Integer.valueOf(state));
|
||||
int n = wechatUserDao.update(user, new QueryWrapper<WechatUser>().eq("wuid", wuid));
|
||||
if (n == 1) {
|
||||
return new Result<Integer>().success(n);
|
||||
}
|
||||
|
||||
return new Result<Integer>().error("修改微信用户信息出错!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Integer> companyRelation(String wuid, String pcode, String pname) {
|
||||
if (!(StringUtils.hasText(pcode) && StringUtils.hasText(pname))) {
|
||||
|
||||
@ -46,7 +46,7 @@ public class WechatUserController {
|
||||
return wechatUserService.userByUid(wuid);
|
||||
}
|
||||
|
||||
@Operation(summary = "绑定公司")
|
||||
@Operation(summary = "小程序端-绑定公司")
|
||||
@PostMapping("/bindcompany")
|
||||
@ApiOperationSupport(order = 3)
|
||||
public Result<Integer> bindCompany(String wuid, String code, String name) {
|
||||
|
||||
@ -65,6 +65,7 @@ public class WechatUserServiceImpl implements WechatUserService {
|
||||
user.setType(2);
|
||||
user.setPcode(code);
|
||||
user.setPname(name);
|
||||
user.setState(1);//用户刚刚申请的时候,待审核状态
|
||||
int n = wechatUserDao.update(user, new QueryWrapper<WechatUser>().eq("wuid", wuid));
|
||||
if (n == 1) {
|
||||
return new Result<Integer>().success(1);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user