fix:企业端分标委
This commit is contained in:
@@ -112,7 +112,6 @@ public class Assert {
|
||||
* @param s 待检查手机号
|
||||
*/
|
||||
public static boolean isTel(String s) {
|
||||
|
||||
Pattern pattern = Pattern.compile(ConstantUtils.TEL_PHONE);
|
||||
Matcher matcher = pattern.matcher(s);
|
||||
if (!matcher.find()) {
|
||||
|
||||
+7
-1
@@ -365,10 +365,16 @@ public class CompanyLoginController {
|
||||
@GetMapping(value = "/sendVerificationCode")
|
||||
public Result<?> sendVerificationCode(@RequestParam(name="phone") String phone,
|
||||
@RequestParam(name="codeType") String codeType) {
|
||||
if("3".equals(codeType)) {
|
||||
sysBaseAPI.sendVerificationCode(phone,codeType,"300",null);
|
||||
String string = redisUtil.get("_verification:_phone:" + phone).toString();
|
||||
return Result.OK(string);
|
||||
|
||||
}
|
||||
LambdaQueryWrapper<PayContactsManagement> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PayContactsManagement::getPhone, PasswordUtil.encrypt(phone));
|
||||
PayContactsManagement contactsManagement = payContactsManagementService.getOne(queryWrapper);
|
||||
if (Objects.isNull(contactsManagement)){
|
||||
if (Objects.isNull(contactsManagement)) {
|
||||
throw new JeroBootException("手机号不是企业联系人");
|
||||
}
|
||||
sysBaseAPI.sendVerificationCode(phone,codeType,"300",null);
|
||||
|
||||
@@ -11,7 +11,6 @@ public class RegisterSelf {
|
||||
/**手机号*/
|
||||
@ApiModelProperty(value = "手机号")
|
||||
@NotEmpty(message = "手机号不能为空!")
|
||||
@Pattern(regexp = "^((13[0-9])|(14[579])|(15([0-3]|[5-9]))|(17[0135678])|(18[0-9])|(19[8|9])|(16[6]))\\d{8}$",message = "手机号码格式错误")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
|
||||
+40
-11
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.util.Assert;
|
||||
import com.jero.common.util.CommonUtils;
|
||||
import com.jero.common.util.PasswordUtil;
|
||||
import com.jero.common.util.RedisUtil;
|
||||
@@ -17,9 +18,11 @@ import com.jero.data.mapper.PayCaseCommitteeMapper;
|
||||
import com.jero.data.mapper.PayCaseCommitteeSubitemMapper;
|
||||
import com.jero.data.service.IPayCaseCommitteeService;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.model.SysLoginVO;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@@ -74,22 +77,25 @@ public class PayCaseCommitteeServiceImpl extends ServiceImpl<PayCaseCommitteeMap
|
||||
try {
|
||||
password = CommonUtils.decryptBtRsaPriKey(password, RSAPrivateKey);
|
||||
verifyPassword = CommonUtils.decryptBtRsaPriKey(verifyPassword, RSAPrivateKey);
|
||||
phone = CommonUtils.decryptBtRsaPriKey(phone, RSAPrivateKey);
|
||||
if(!Assert.isTel(phone)){
|
||||
throw new JeroBootException("手机号格式错误");
|
||||
}
|
||||
registerSelf.getPayContactsManagement().setPhone(phone);
|
||||
registerSelf.setPassword(password);
|
||||
registerSelf.setVerifyPassword(verifyPassword);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// //处理手机获取验证码的逻辑
|
||||
// Object obj = redisUtil.get("_verification:_phone:" + phone);
|
||||
// if (obj == null) {
|
||||
// throw new JeroBootException("验证码失效,请重新发送");
|
||||
// }
|
||||
// String code = obj.toString();
|
||||
// if (!registerSelf.getVerifyCode().equals(code)) {
|
||||
// throw new JeroBootException("验证码错误!");
|
||||
// }
|
||||
|
||||
//处理手机获取验证码的逻辑
|
||||
Object obj = redisUtil.get("_verification:_phone:" + phone);
|
||||
if (obj == null) {
|
||||
throw new JeroBootException("验证码失效,请重新发送");
|
||||
}
|
||||
String code = obj.toString();
|
||||
if (!registerSelf.getVerifyCode().equals(code)) {
|
||||
throw new JeroBootException("验证码错误!");
|
||||
}
|
||||
if (!password.equals(verifyPassword)) {
|
||||
throw new JeroBootException("新密码和确认密码不一致,请重新输入");
|
||||
}
|
||||
@@ -111,4 +117,27 @@ public class PayCaseCommitteeServiceImpl extends ServiceImpl<PayCaseCommitteeMap
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 忘记密码校验
|
||||
* @param user
|
||||
*/
|
||||
private void fPRuleCheck(RegisterSelf user){
|
||||
if(ObjectUtils.isEmpty(user.getPhone())){
|
||||
throw new JeroBootException("手机号为必填");
|
||||
}else if(!Assert.isTel(user.getPhone())){
|
||||
throw new JeroBootException("请输入正确的手机号");
|
||||
}
|
||||
if(ObjectUtils.isEmpty(user.getVerifyCode())){
|
||||
throw new JeroBootException("验证码为必填");
|
||||
}else if(user.getVerifyCode().length()>50){
|
||||
throw new JeroBootException("验证码长度不超过50个字符");
|
||||
}
|
||||
if(ObjectUtils.isEmpty(user.getPassword())){
|
||||
throw new JeroBootException("新密码为必填");
|
||||
}
|
||||
if(ObjectUtils.isEmpty(user.getVerifyPassword())){
|
||||
throw new JeroBootException("确认密码为必填");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+155
-25
@@ -1,23 +1,23 @@
|
||||
package com.jero.meeting.controller;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.service.SendMessageService;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.AuthenticationUtils;
|
||||
import com.jero.common.util.PasswordUtil;
|
||||
import com.jero.common.util.ValidUtil;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.common.util.*;
|
||||
import com.jero.company.service.IPayContactsManagementService;
|
||||
import com.jero.data.entity.PayCaseCommittee;
|
||||
import com.jero.data.service.IPayCaseCommitteeService;
|
||||
@@ -43,10 +43,12 @@ import com.jero.util.QrcodeUtil;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -89,6 +91,12 @@ public class PayMeetingController extends JeroController<PayMeeting, IPayMeeting
|
||||
private Environment env;
|
||||
@Resource
|
||||
private SendMessageService sendMessageService;
|
||||
@Value(value = "${jero.uploadType}")
|
||||
private String uploadType;
|
||||
@Value(value = "${jero.path.upload}")
|
||||
private String uploadpath;
|
||||
@Resource
|
||||
private IOSSFileService ossFileService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
@@ -116,7 +124,7 @@ public class PayMeetingController extends JeroController<PayMeeting, IPayMeeting
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String contactId = sysUser.getId();
|
||||
Page<PayMeeting> page = new Page<>(pageNo, pageSize);
|
||||
IPage<PayMeeting> pageList = payMeetingService.pageListContract(page, payMeeting, request,sysUser);
|
||||
IPage<PayMeeting> pageList = payMeetingService.pageListContract(page, payMeeting, request, sysUser);
|
||||
for (PayMeeting meeting : pageList.getRecords()) {
|
||||
//查询会议负责人
|
||||
LoginUser user = sysBaseAPI.getUserById(meeting.getDirectorId());
|
||||
@@ -130,7 +138,7 @@ public class PayMeetingController extends JeroController<PayMeeting, IPayMeeting
|
||||
//wrapper.eq(PayMeetingSituation::getMeetingId, meeting.getId());
|
||||
//wrapper.eq(PayMeetingSituation::getCompanyContactId, contactId);
|
||||
//PayMeetingSituation meetingSituation = payMeetingSituationService.getOne(wrapper);
|
||||
if (meetingSituation!=null) {
|
||||
if (meetingSituation != null) {
|
||||
meeting.setMeetingSignUpType(2);
|
||||
Integer registerCheckResult = meetingSituation.getRegisterCheckResult();
|
||||
meeting.setRegisterCheckResult(registerCheckResult);
|
||||
@@ -140,29 +148,29 @@ public class PayMeetingController extends JeroController<PayMeeting, IPayMeeting
|
||||
String paymentRecord = meetingSituation.getPaymentRecord();
|
||||
Integer checkIn = meetingSituation.getCheckIn();
|
||||
//报名信息审核中:非成员单位需要审核的
|
||||
if (Objects.equals(registerCheckResult,0)){
|
||||
if (Objects.equals(registerCheckResult, 0)) {
|
||||
meeting.setSignUpStatus(1);
|
||||
// 凭证审核中:非成员单位审核通过/不是非成员单位,来款方式为:汇款/线上缴费上传完凭证的;
|
||||
}else if (Objects.equals(registerCheckResult,1)
|
||||
&&StringUtils.isNotBlank(paymentRecord)
|
||||
&&Objects.equals(checkResult,0)){
|
||||
// 凭证审核中:非成员单位审核通过/不是非成员单位,来款方式为:汇款/线上缴费上传完凭证的;
|
||||
} else if (Objects.equals(registerCheckResult, 1)
|
||||
&& StringUtils.isNotBlank(paymentRecord)
|
||||
&& Objects.equals(checkResult, 0)) {
|
||||
meeting.setSignUpStatus(2);
|
||||
// 不可参会:非成员单位审核拒绝的
|
||||
}else if (Objects.equals(registerCheckResult,2)){
|
||||
// 不可参会:非成员单位审核拒绝的
|
||||
} else if (Objects.equals(registerCheckResult, 2)) {
|
||||
meeting.setSignUpStatus(3);
|
||||
// 待上传凭证:来款方式为:汇款/线上缴费。需要上传审核凭证的
|
||||
}else if (Objects.equals(registerCheckResult,1)
|
||||
&&StringUtils.isBlank(paymentRecord)
|
||||
&&!Objects.equals(checkResult,1)){
|
||||
// 待上传凭证:来款方式为:汇款/线上缴费。需要上传审核凭证的
|
||||
} else if (Objects.equals(registerCheckResult, 1)
|
||||
&& StringUtils.isBlank(paymentRecord)
|
||||
&& !Objects.equals(checkResult, 1)) {
|
||||
meeting.setSignUpStatus(4);
|
||||
// 凭证被拒绝:来款方式为:汇款/线上缴费。上传审核凭证被拒绝的
|
||||
}else if (Objects.equals(checkResult,2)){
|
||||
// 凭证被拒绝:来款方式为:汇款/线上缴费。上传审核凭证被拒绝的
|
||||
} else if (Objects.equals(checkResult, 2)) {
|
||||
meeting.setSignUpStatus(5);
|
||||
//签到成功的
|
||||
}else if (Objects.equals(checkIn,1)){
|
||||
//签到成功的
|
||||
} else if (Objects.equals(checkIn, 1)) {
|
||||
meeting.setSignUpStatus(7);
|
||||
// 报名成功:不需要审核直接报名成功的;审核凭证通过的
|
||||
}else if (Objects.equals(checkResult,1)){
|
||||
} else if (Objects.equals(checkResult, 1)) {
|
||||
meeting.setSignUpStatus(6);
|
||||
}
|
||||
|
||||
@@ -230,7 +238,6 @@ public class PayMeetingController extends JeroController<PayMeeting, IPayMeeting
|
||||
//}*/
|
||||
|
||||
|
||||
|
||||
///**
|
||||
// * 批量删除
|
||||
// */
|
||||
@@ -264,7 +271,7 @@ public class PayMeetingController extends JeroController<PayMeeting, IPayMeeting
|
||||
String meetingType = meeting.getMeetingType().toString();
|
||||
//String meetingType1 = sysBaseAPI.translateDict("meeting_type", meetingType);
|
||||
payMeetingVO.setMeetingType(meetingType);
|
||||
if (meeting.getTbMeetingType()!=null) {
|
||||
if (meeting.getTbMeetingType() != null) {
|
||||
payMeetingVO.setTbMeetingType(meeting.getTbMeetingType().toString());
|
||||
}
|
||||
//payMeetingVO.setHotelContactsList(new ArrayList<>());
|
||||
@@ -282,7 +289,7 @@ public class PayMeetingController extends JeroController<PayMeeting, IPayMeeting
|
||||
String workingGroupId = meeting.getWorkingGroupId();
|
||||
PayWorkingGroup workingGroup = payWorkingGroupService.getById(workingGroupId);
|
||||
payMeetingVO.setWorkingGroupName(workingGroup.getWorkingGroupProject());
|
||||
}else if (meetingType.equals(MeetingCommon.COMMITTEE_MEETING)) {
|
||||
} else if (meetingType.equals(MeetingCommon.COMMITTEE_MEETING)) {
|
||||
String caseCommitteeId = meeting.getCaseCommitteeId();
|
||||
PayCaseCommittee caseCommittee = payCaseCommitteeService.getById(caseCommitteeId);
|
||||
payMeetingVO.setCaseCommitteeName(caseCommittee.getName());
|
||||
@@ -435,4 +442,127 @@ public class PayMeetingController extends JeroController<PayMeeting, IPayMeeting
|
||||
return Result.OK("新增会议文件成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 预览图片&下载文件
|
||||
*
|
||||
* @param id 传入文件id
|
||||
* @param response
|
||||
*/
|
||||
@GetMapping(value = "/userDownload/{id}/{meetingId}")
|
||||
public void download(@PathVariable String id, @PathVariable String meetingId, HttpServletResponse response, String type) {
|
||||
// LoginUser sysUser =(LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// String sysUserId = sysUser.getId();
|
||||
// PayMeeting byId = payMeetingService.getById(meetingId);
|
||||
// if(ObjectUtils.isEmpty(byId)){
|
||||
// throw new JeroBootException("会议不存在..");
|
||||
// }
|
||||
// String meetingMinute = byId.getMeetingMinute();
|
||||
// String meetingData = byId.getMeetingData();
|
||||
// List<String>
|
||||
// if(meetingMinute)
|
||||
// List<String> meetingMinuteList = Arrays.asList(meetingMinute.split(","));
|
||||
// List<String> meetingMinuteList = Arrays.asList(meetingMinute.split(","));
|
||||
// // 查询数据表数据是否存在
|
||||
// LambdaQueryWrapper<OSSFile> queryWrapper = new LambdaQueryWrapper<>();
|
||||
// queryWrapper.eq(OSSFile::getId,id);
|
||||
// OSSFile ossFile = ossFileService.getOne(queryWrapper);
|
||||
// if( null == ossFile){
|
||||
// throw new JeroBootException("文件不存在..");
|
||||
// }
|
||||
// String fileUrl = ossFile.getUrl();
|
||||
// InputStream inputStream = null;
|
||||
// OutputStream outputStream = null;
|
||||
// try {
|
||||
// String fileName = "";
|
||||
// if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)){
|
||||
// //本地下载
|
||||
// String filePath = uploadpath + File.separator + fileUrl;
|
||||
// File file = new File(filePath);
|
||||
// if(!file.exists()){
|
||||
// response.setStatus(404);
|
||||
// throw new RuntimeException("文件不存在..");
|
||||
// }
|
||||
// // 文件名称
|
||||
// fileName = file.getName();
|
||||
// inputStream = new BufferedInputStream(new FileInputStream(filePath));
|
||||
// }else if(CommonConstant.UPLOAD_TYPE_MINIO.equals(uploadType)){
|
||||
// // minio 下载
|
||||
// // 通过MinioUtil查询时 只需要桶后面的路径
|
||||
// String minioUrl = MinioUtil.getMinioUrl();
|
||||
// // Linux/unix 系统下文件路径分隔符为"/" 获取minio与存储桶的路径
|
||||
// minioUrl = minioUrl + MinioUtil.getBucketName() + "/";
|
||||
// String url = fileUrl.replace(minioUrl, "");
|
||||
// // 文件名称
|
||||
// fileName = ossFile.getFileName();
|
||||
// inputStream = MinioUtil.getMinioFile(MinioUtil.getBucketName(), url);
|
||||
// }
|
||||
//
|
||||
// ossFileService.updateById(ossFile);
|
||||
// LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// if (loginUser.getIsCompanyUser()) {
|
||||
// Integer integer = ossFileService.searchDownloadTimes(ossFile.getId(), loginUser.getId());
|
||||
// if (integer >= 5) {
|
||||
// throw new JeroBootException("超出下载次数限制");
|
||||
// }
|
||||
// }
|
||||
// ossFileService.saveDownloadTimes(ossFile.getId(), loginUser.getId());
|
||||
//
|
||||
// response.addHeader("Content-Disposition", "attachment;fileName=" + new String(fileName.getBytes("UTF-8"),"iso-8859-1"));
|
||||
// response.setContentType("application/force-download");// 设置强制下载不打开
|
||||
// if (type == null) {
|
||||
// fileName = StringUtils.lowerCase(fileName);
|
||||
// if (fileName.contains(".jpg") || fileName.contains(".gif") || fileName.contains(".jpeg")) {
|
||||
// response.setContentType("image/jpeg;image/jpg;image/gif;image/png");
|
||||
// } else if (fileName.contains(".png")) {
|
||||
// response.setContentType("image/png;image/jpg;image/gif;image/jpeg");
|
||||
// }
|
||||
// }
|
||||
// outputStream = response.getOutputStream();
|
||||
// byte[] buf = new byte[1024];
|
||||
// int len;
|
||||
// while ((len = inputStream.read(buf)) > 0) {
|
||||
// outputStream.write(buf, 0, len);
|
||||
// }
|
||||
// response.flushBuffer();
|
||||
// //统计下载和上传次数
|
||||
// if ("download".equals(type)) {
|
||||
// Integer downloadNumber = ossFile.getDownloadNumber();
|
||||
// if (downloadNumber == null) {
|
||||
// ossFile.setDownloadNumber(1);
|
||||
// } else {
|
||||
// ossFile.setDownloadNumber(downloadNumber + 1);
|
||||
// }
|
||||
// ossFileService.updateById(ossFile);
|
||||
// } else {
|
||||
// Integer viewNumber = ossFile.getViewNumber();
|
||||
// if (viewNumber == null) {
|
||||
// ossFile.setViewNumber(1);
|
||||
// } else {
|
||||
// ossFile.setViewNumber(viewNumber + 1);
|
||||
// }
|
||||
// ossFileService.updateAndPush(ossFile);
|
||||
// }
|
||||
// } catch (IOException e) {
|
||||
// log.error("预览文件失败" + e.getMessage());
|
||||
// response.setStatus(404);
|
||||
// e.printStackTrace();
|
||||
// } finally {
|
||||
// if (inputStream != null) {
|
||||
// try {
|
||||
// inputStream.close();
|
||||
// } catch (IOException e) {
|
||||
// log.error(e.getMessage(), e);
|
||||
// }
|
||||
// }
|
||||
// if (outputStream != null) {
|
||||
// try {
|
||||
// outputStream.close();
|
||||
// } catch (IOException e) {
|
||||
// log.error(e.getMessage(), e);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user