fix:微信用户绑定公司审核流程
This commit is contained in:
parent
77d09ea71c
commit
8c11459e9c
@ -1,8 +1,6 @@
|
|||||||
package com.evotech.hd.common.core.entity.wechat;
|
package com.evotech.hd.common.core.entity.wechat;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.evotech.hd.common.core.entity.BaseEntity;
|
import com.evotech.hd.common.core.entity.BaseEntity;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
@ -68,4 +66,9 @@ public class WechatUser extends BaseEntity implements Serializable {
|
|||||||
|
|
||||||
@Schema(description = "审核状态:1-待审核,2-审核成功,3-审核失败")
|
@Schema(description = "审核状态:1-待审核,2-审核成功,3-审核失败")
|
||||||
private Integer state;
|
private Integer state;
|
||||||
|
|
||||||
|
@Schema(description = "审核通过时间(即绑定公司时间)")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date bindtime;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -76,6 +76,8 @@ public class CompanyServiceImpl implements CompanyService {
|
|||||||
Map<String, String> m = new HashMap<String, String>();
|
Map<String, String> m = new HashMap<String, String>();
|
||||||
m.put("ccode", one.getCcode());
|
m.put("ccode", one.getCcode());
|
||||||
m.put("cname", one.getCname());
|
m.put("cname", one.getCname());
|
||||||
|
m.put("address", one.getAddress());
|
||||||
|
m.put("phone", one.getPhone());
|
||||||
return new Result<Map<String, String>>().success(m);
|
return new Result<Map<String, String>>().success(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
package com.evotech.hd.cloud.service.impl;
|
package com.evotech.hd.cloud.service.impl;
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -63,8 +67,25 @@ public class WechatUserServiceImpl implements WechatUserService {
|
|||||||
if (!(StringUtils.hasText(wuid) || StringUtils.hasText(state))) {
|
if (!(StringUtils.hasText(wuid) || StringUtils.hasText(state))) {
|
||||||
return new Result<Integer>().error(CodeMsg.PARAM_IS_NULL);
|
return new Result<Integer>().error(CodeMsg.PARAM_IS_NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
WechatUser user = new WechatUser();
|
WechatUser user = new WechatUser();
|
||||||
user.setState(Integer.valueOf(state));
|
user.setState(Integer.valueOf(state));
|
||||||
|
|
||||||
|
Date currentDate = new Date();
|
||||||
|
// 创建一个SimpleDateFormat对象,并设置格式
|
||||||
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
// 格式化Date对象
|
||||||
|
String formattedDate = formatter.format(currentDate);
|
||||||
|
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
try {
|
||||||
|
Date date = dateFormat.parse(formattedDate);
|
||||||
|
user.setBindtime(date);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int n = wechatUserDao.update(user, new QueryWrapper<WechatUser>().eq("wuid", wuid));
|
int n = wechatUserDao.update(user, new QueryWrapper<WechatUser>().eq("wuid", wuid));
|
||||||
if (n == 1) {
|
if (n == 1) {
|
||||||
return new Result<Integer>().success(n);
|
return new Result<Integer>().success(n);
|
||||||
|
|||||||
@ -2,7 +2,11 @@ package com.evotech.hd.wechat.controller;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.evotech.hd.common.core.entity.cloud.Company;
|
||||||
|
import com.evotech.hd.wechat.service.rpc.CloudService;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
import org.springdoc.core.annotations.ParameterObject;
|
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.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@ -29,6 +33,8 @@ public class WechatUserController {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private WechatUserService wechatUserService;
|
private WechatUserService wechatUserService;
|
||||||
|
@Resource
|
||||||
|
private CloudService cloudService;
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "修改")
|
@Operation(summary = "修改")
|
||||||
@ -49,10 +55,11 @@ public class WechatUserController {
|
|||||||
@Operation(summary = "小程序端-绑定公司")
|
@Operation(summary = "小程序端-绑定公司")
|
||||||
@PostMapping("/bindcompany")
|
@PostMapping("/bindcompany")
|
||||||
@ApiOperationSupport(order = 3)
|
@ApiOperationSupport(order = 3)
|
||||||
public Result<Integer> bindCompany(String wuid, String code, String name) {
|
public Result<Integer> bindCompany(String wuid, String pcode, String pname) {
|
||||||
return wechatUserService.bindCompany(wuid, code, name);
|
return wechatUserService.bindCompany(wuid, pcode, pname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "开通钱包账户")
|
@Operation(summary = "开通钱包账户")
|
||||||
@PostMapping("/wallet/open")
|
@PostMapping("/wallet/open")
|
||||||
@ApiOperationSupport(order = 4)
|
@ApiOperationSupport(order = 4)
|
||||||
@ -82,4 +89,12 @@ public class WechatUserController {
|
|||||||
return wechatUserService.isOpenAccount(wuid,request);
|
return wechatUserService.isOpenAccount(wuid,request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Operation(summary = "小程序端-查询公司列表")
|
||||||
|
@GetMapping("/companylist")
|
||||||
|
@ApiOperationSupport(order = 8)
|
||||||
|
public Result<List<Company>> companylist( @ParameterObject BasePageRequest bpr) {
|
||||||
|
return cloudService.companylist(bpr);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,7 +16,7 @@ public interface WechatUserService {
|
|||||||
|
|
||||||
public Result<WechatUser> userByUid(String wuid);
|
public Result<WechatUser> userByUid(String wuid);
|
||||||
|
|
||||||
public Result<Integer> bindCompany(String wuid, String code, String name);
|
public Result<Integer> bindCompany(String wuid, String pcode, String pname);
|
||||||
|
|
||||||
public Result<Integer> openWallet(String wuid, HttpServletRequest request);
|
public Result<Integer> openWallet(String wuid, HttpServletRequest request);
|
||||||
|
|
||||||
|
|||||||
@ -65,11 +65,11 @@ public class WechatUserServiceImpl implements WechatUserService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result<Integer> bindCompany(String wuid, String code, String name) {
|
public Result<Integer> bindCompany(String wuid, String pcode, String pname) {
|
||||||
WechatUser user = new WechatUser();
|
WechatUser user = new WechatUser();
|
||||||
user.setType(2);
|
user.setType(2);
|
||||||
user.setPcode(code);
|
user.setPcode(pcode);
|
||||||
user.setPname(name);
|
user.setPname(pname);
|
||||||
user.setState(1);//用户刚刚申请的时候,待审核状态
|
user.setState(1);//用户刚刚申请的时候,待审核状态
|
||||||
int n = wechatUserDao.update(user, new QueryWrapper<WechatUser>().eq("wuid", wuid));
|
int n = wechatUserDao.update(user, new QueryWrapper<WechatUser>().eq("wuid", wuid));
|
||||||
if (n == 1) {
|
if (n == 1) {
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.evotech.hd.wechat.service.rpc;
|
package com.evotech.hd.wechat.service.rpc;
|
||||||
|
|
||||||
|
import com.evotech.hd.common.core.entity.BasePageRequest;
|
||||||
import com.evotech.hd.common.core.entity.Result;
|
import com.evotech.hd.common.core.entity.Result;
|
||||||
import com.evotech.hd.common.core.entity.cloud.*;
|
import com.evotech.hd.common.core.entity.cloud.*;
|
||||||
import com.evotech.hd.common.core.entity.cloud.request.BatterySwapResponse;
|
import com.evotech.hd.common.core.entity.cloud.request.BatterySwapResponse;
|
||||||
@ -96,4 +97,8 @@ public interface CloudService {
|
|||||||
|
|
||||||
@PostMapping(value = "/wallet/updateName", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE})
|
@PostMapping(value = "/wallet/updateName", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE})
|
||||||
public Result<WechatPayAttach> updateName(@NotBlank WalletAccount wa);
|
public Result<WechatPayAttach> updateName(@NotBlank WalletAccount wa);
|
||||||
|
|
||||||
|
@GetMapping(value = "/company/list",
|
||||||
|
consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE})
|
||||||
|
public Result<List<Company>> companylist(@RequestParam BasePageRequest bpr);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user