Browse Source

小程序发送验证码(登录、修改密码、找回密码)

采购退货单编号重复问题修改完成
master
God 9 months ago
parent
commit
33720ff8be
  1. 5
      anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysuser/app/AppSysUserFeign.java
  2. 5
      anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysuser/app/AppSysUserFeignFallback.java
  3. 49
      anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysuser/SysUserService.java
  4. 22
      anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysuser/app/AppSysUserRest.java
  5. 2
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanrepaymentschedule/AppRepaymentHistoryListDetailsWxVo.java
  6. 2
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanrepaymentschedule/AppRepaymentPlanListDetailsWxVo.java
  7. 32
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanrepaymentschedule/LoanRepaymentScheduleService.java
  8. 2
      anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/risk/repaymentplan/RepaymentHistoryListDetailsWxVo.java
  9. 2
      anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/risk/repaymentplan/RepaymentPlanListDetailsWxVo.java
  10. 2
      yxt-pms-biz/src/main/java/com/yxt/pms/biz/pms/pmspurchasebackbill/PmsPurchasebackBillService.java

5
anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysuser/app/AppSysUserFeign.java

@ -42,6 +42,11 @@ public interface AppSysUserFeign {
public ResultBean sendVerificationCodeForApp(@RequestParam("mobile") String mobile, @RequestParam("type") String type,
@RequestParam("appId") String appId);
@ApiOperation(value = "小程序发送验证码(登录、修改密码、找回密码)")
@ResponseBody
@PostMapping("/sendVerificationCodeForWx")
public ResultBean sendVerificationCodeForWx(@RequestParam("mobile") String mobile, @RequestParam("type") String type);
@ApiOperation(value = "我的信息")
@ResponseBody
@GetMapping("/getMyInfo/{userSid}")

5
anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysuser/app/AppSysUserFeignFallback.java

@ -31,6 +31,11 @@ public class AppSysUserFeignFallback implements AppSysUserFeign {
return ResultBean.fireFail().setMsg("网站维护,请稍后再试");
}
@Override
public ResultBean sendVerificationCodeForWx(String mobile, String type) {
return null;
}
@Override
public ResultBean getMyInfo(String userSid) {
return ResultBean.fireFail().setMsg("网站维护,请稍后再试");

49
anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysuser/SysUserService.java

@ -1580,4 +1580,53 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> {
SysUser sysUser = fetchBySid(sid);
return rb.success().setData(sysUser);
}
/**
* 发送小程序端登录验证码
*
* @param mobile
* @param type 1登录2修改密码3找回密码
* @return
*/
public ResultBean sendVerificationCodeForAppWx(String mobile, String type) {
Date date = new Date();
String redisKey = "";
if (type.equals("1")) {
redisKey = "loginCode";
} else if (type.equals("2")) {
redisKey = "updatePwdCode";
} else if (type.equals("3")) {
redisKey = "resetPwdCode";
}
String codeRedis = redisUtil.get(redisKey + mobile);
if (StringUtils.isNotEmpty(codeRedis)) {
//查看请求间隔,默认是一分钟,小于一分钟继续等待,超过一分钟发送短信
String sendTime = codeRedis.substring(4);
long diffSecond = (date.getTime() - Long.parseLong(sendTime)) / 1000;
if (diffSecond < 60) {
return ResultBean.fireFail().setMsg("请等待一分钟后再次重试!");
}
}
String verificationCode = "";
for (int i = 0; i < LENGTH_OF_CODE; i++) {
// 定义随机类
Random random = new Random();
// 返回[0,10)集合中的整数,注意不包括10
int result = random.nextInt(10);
// +1后,[0,10)集合变为[1,11)集合,满足要求
verificationCode = verificationCode + result;
}
String content = "";
if (type.equals("1")) {
content = "登录验证码:" + verificationCode + ",用于登录小程序,有效期5分钟,如非本人操作,请忽略。";
} else {
content = "修改密码验证码:" + verificationCode + ",用于修改登录密码,有效期5分钟,如非本人操作,请忽略。";
}
String res = MsgWs.SendWaitWorkMsg(mobile, content);
// String res = "1";
if (res.equals("1")) {
redisUtil.set(redisKey + mobile, verificationCode + date.getTime(), APP_LOGIN_CODE_TIME_LIMIT);
}
return ResultBean.fireSuccess().setMsg("发送短信验证码成功");
}
}

22
anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysuser/app/AppSysUserRest.java

@ -368,6 +368,28 @@ public class AppSysUserRest implements AppSysUserFeign {
return sysUserService.sendVerificationCodeForApp(mobile, type);
}
/**
* 小程序发送短信验证码
*
* @param mobile
* @param type 1登录2修改密码3找回密码
* @return
*/
@Override
public ResultBean sendVerificationCodeForWx(String mobile, String type) {
if (StringUtils.isBlank(mobile) || !RegexUtil.isMobile(mobile)) {
return new ResultBean().fail().setMsg("请输入正确的手机号");
}
SysUser sysUser = sysUserService.selectByUserNameWx(mobile);
if (null == sysUser) {
sysUser = sysUserService.selectByMobileWx(mobile);
if (sysUser == null) {
return new ResultBean().fail().setMsg("该手机号暂时还未注册,请先注册");
}
}
return sysUserService.sendVerificationCodeForAppWx(mobile, type);
}
/**
* 插入错误的信息
*

2
anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanrepaymentschedule/AppRepaymentHistoryListDetailsWxVo.java

@ -19,5 +19,5 @@ public class AppRepaymentHistoryListDetailsWxVo implements Vo {
@ApiModelProperty("标题")
private List<AppRepaymentHistoryThead> thead;
@ApiModelProperty("表格")
private List<AppRepaymentHistoryRecord> record;
private List<AppRepaymentHistoryRecord> records;
}

2
anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanrepaymentschedule/AppRepaymentPlanListDetailsWxVo.java

@ -35,5 +35,5 @@ public class AppRepaymentPlanListDetailsWxVo implements Vo {
@ApiModelProperty("标题")
private List<AppRepaymentPlanThead> thead;
@ApiModelProperty("表格")
private List<AppRepaymentPlanRecord> record;
private List<AppRepaymentPlanRecord> records;
}

32
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanrepaymentschedule/LoanRepaymentScheduleService.java

@ -6982,23 +6982,15 @@ public class LoanRepaymentScheduleService extends MybatisBaseService<LoanRepayme
appRepaymentPlanListDetailsWxVo.setLenderName(loanRepaymentSchedule.getBorrowerName());
appRepaymentPlanListDetailsWxVo.setSalesName(loanRepaymentSchedule.getStaffName());
appRepaymentPlanListDetailsWxVo.setManagement(loanRepaymentSchedule.getBankName());
appRepaymentPlanListDetailsWxVo.setZcpDate(loanRepaymentSchedule.getMainPeriod() + "/" + loanRepaymentSchedule.getMainRepayDate() + "(首还)");
appRepaymentPlanListDetailsWxVo.setZcpDate(loanRepaymentSchedule.getMainPeriod() + "/" + DateUtil.formatDate(loanRepaymentSchedule.getMainRepayDate()) + "(首还)");
if ("1".equals(loanRepaymentSchedule.getIsOtherPolicy())){//有其他融
appRepaymentPlanListDetailsWxVo.setPtrDate(loanRepaymentSchedule.getOtherPeriod() + "/" + loanRepaymentSchedule.getOtherRepayDate() + "(首还)");
appRepaymentPlanListDetailsWxVo.setPtrDate(loanRepaymentSchedule.getOtherPeriod() + "/" + DateUtil.formatDate(loanRepaymentSchedule.getOtherRepayDate()) + "(首还)");
if ("1".equals(loanRepaymentSchedule.getSameBank())){//其他融资方与主产品相同
appRepaymentPlanListDetailsWxVo.setOtherManagement(appRepaymentPlanListDetailsWxVo.getManagement());
}else {//其他融资方与主产品不相同
List<LoanRepaymentPlanDetails> loanRepaymentPlanDetails = loanRepaymentPlanDetailsService.selByMainSidAndPolicyOrOther(scheduleSid, "1");
appRepaymentPlanListDetailsWxVo.setOtherManagement(loanRepaymentPlanDetails.get(0).getBankName());
}
AppRepaymentPlanThead appRepaymentPlanThead4 = new AppRepaymentPlanThead();
appRepaymentPlanThead4.setName("otherMonthlyPaymentStr");
String[] qtrDate = loanRepaymentSchedule.getOtherRepayDate().toString().split("-");
appRepaymentPlanThead4.setLabel("其他融(" + qtrDate[qtrDate.length - 1] + "日)");
appRepaymentPlanThead4.setWidth("100");
appRepaymentPlanThead4.setEmptyString("-");
appRepaymentPlanThead4.setAlign("center");
appRepaymentPlanTheads.add(appRepaymentPlanThead4);
}
appRepaymentPlanListDetailsWxVo.setVinNo(vinNo);
AppRepaymentPlanThead appRepaymentPlanThead1 = new AppRepaymentPlanThead();
@ -7018,15 +7010,25 @@ public class LoanRepaymentScheduleService extends MybatisBaseService<LoanRepayme
appRepaymentPlanTheads.add(appRepaymentPlanThead2);
AppRepaymentPlanThead appRepaymentPlanThead3 = new AppRepaymentPlanThead();
appRepaymentPlanThead3.setName("monthlyPaymentStr");
String[] zcpDate = loanRepaymentSchedule.getMainRepayDate().toString().split("-");
String[] zcpDate = DateUtil.formatDate(loanRepaymentSchedule.getMainRepayDate()).split("-");
appRepaymentPlanThead3.setLabel("月还(" + zcpDate[zcpDate.length - 1] + "日)");
appRepaymentPlanThead3.setWidth("100");
appRepaymentPlanThead3.setEmptyString("-");
appRepaymentPlanThead3.setAlign("center");
appRepaymentPlanTheads.add(appRepaymentPlanThead3);
if ("1".equals(loanRepaymentSchedule.getIsOtherPolicy())){
AppRepaymentPlanThead appRepaymentPlanThead4 = new AppRepaymentPlanThead();
appRepaymentPlanThead4.setName("otherMonthlyPaymentStr");
String[] qtrDate = DateUtil.formatDate(loanRepaymentSchedule.getOtherRepayDate()).split("-");
appRepaymentPlanThead4.setLabel("其他融(" + qtrDate[qtrDate.length - 1] + "日)");
appRepaymentPlanThead4.setWidth("100");
appRepaymentPlanThead4.setEmptyString("-");
appRepaymentPlanThead4.setAlign("center");
appRepaymentPlanTheads.add(appRepaymentPlanThead4);
}
appRepaymentPlanListDetailsWxVo.setThead(appRepaymentPlanTheads);
List<AppRepaymentPlanRecord> appRepaymentPlanRecords = loanRepaymentPlanDetailsService.selByMainSidAndVinNo(scheduleSid, vinNo);
appRepaymentPlanListDetailsWxVo.setRecord(appRepaymentPlanRecords);
appRepaymentPlanListDetailsWxVo.setRecords(appRepaymentPlanRecords);
return appRepaymentPlanListDetailsWxVo;
}
@ -7038,7 +7040,7 @@ public class LoanRepaymentScheduleService extends MybatisBaseService<LoanRepayme
appRepaymentHistoryThead1.setName("period");
appRepaymentHistoryThead1.setLabel("期数");
appRepaymentHistoryThead1.setFixed(true);
appRepaymentHistoryThead1.setWidth("100");
appRepaymentHistoryThead1.setWidth("80");
appRepaymentHistoryThead1.setEmptyString("-");
appRepaymentHistoryThead1.setAlign("center");
appRepaymentHistoryTheads.add(appRepaymentHistoryThead1);
@ -7052,7 +7054,7 @@ public class LoanRepaymentScheduleService extends MybatisBaseService<LoanRepayme
AppRepaymentHistoryThead appRepaymentHistoryThead3 = new AppRepaymentHistoryThead();
appRepaymentHistoryThead3.setName("actualDate");
appRepaymentHistoryThead3.setLabel("实还日期");
appRepaymentHistoryThead3.setWidth("80");
appRepaymentHistoryThead3.setWidth("120");
appRepaymentHistoryThead3.setEmptyString("-");
appRepaymentHistoryThead3.setAlign("center");
appRepaymentHistoryTheads.add(appRepaymentHistoryThead3);
@ -7072,7 +7074,7 @@ public class LoanRepaymentScheduleService extends MybatisBaseService<LoanRepayme
appRepaymentHistoryTheads.add(appRepaymentHistoryThead5);
appRepaymentHistoryListDetailsWxVo.setThead(appRepaymentHistoryTheads);
List<AppRepaymentHistoryRecord> appRepaymentHistoryRecords = loanRepaymentHistoryService.selSchSidAndVinNo(scheduleSid,vinNo);
appRepaymentHistoryListDetailsWxVo.setRecord(appRepaymentHistoryRecords);
appRepaymentHistoryListDetailsWxVo.setRecords(appRepaymentHistoryRecords);
return appRepaymentHistoryListDetailsWxVo;
}
}

2
anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/risk/repaymentplan/RepaymentHistoryListDetailsWxVo.java

@ -19,5 +19,5 @@ public class RepaymentHistoryListDetailsWxVo implements Vo {
@ApiModelProperty("标题")
private List<RepaymentHistoryThead> thead;
@ApiModelProperty("表格")
private List<RepaymentHistoryRecord> record;
private List<RepaymentHistoryRecord> records;
}

2
anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/risk/repaymentplan/RepaymentPlanListDetailsWxVo.java

@ -35,5 +35,5 @@ public class RepaymentPlanListDetailsWxVo implements Vo {
@ApiModelProperty("标题")
private List<RepaymentPlanThead> thead;
@ApiModelProperty("表格")
private List<RepaymentPlanRecord> record;
private List<RepaymentPlanRecord> records;
}

2
yxt-pms-biz/src/main/java/com/yxt/pms/biz/pms/pmspurchasebackbill/PmsPurchasebackBillService.java

@ -212,7 +212,7 @@ public class PmsPurchasebackBillService extends MybatisBaseService<PmsPurchaseba
billNo = "CGTHD" + organizationVo.getOrgCode() + date;
String j = baseMapper.selectNum(billNo);
if (StringUtils.isNotBlank(j)) {
billNo = Rule.getBillNo(billNo, Integer.valueOf(i).intValue());
billNo = Rule.getBillNo(billNo, Integer.valueOf(j).intValue());
} else {
billNo = Rule.getBillNo(billNo, 0);
}

Loading…
Cancel
Save