add:手机号
This commit is contained in:
+4
-4
@@ -6,10 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.jero.common.exception.JeroBootException;
|
import com.jero.common.exception.JeroBootException;
|
||||||
import com.jero.common.util.Assert;
|
import com.jero.common.util.*;
|
||||||
import com.jero.common.util.CommonUtils;
|
|
||||||
import com.jero.common.util.PasswordUtil;
|
|
||||||
import com.jero.common.util.RedisUtil;
|
|
||||||
import com.jero.company.service.IPayContactsManagementService;
|
import com.jero.company.service.IPayContactsManagementService;
|
||||||
import com.jero.data.entity.DetailForCaseCommittee;
|
import com.jero.data.entity.DetailForCaseCommittee;
|
||||||
import com.jero.data.entity.PayCaseCommittee;
|
import com.jero.data.entity.PayCaseCommittee;
|
||||||
@@ -99,6 +96,9 @@ public class PayCaseCommitteeServiceImpl extends ServiceImpl<PayCaseCommitteeMap
|
|||||||
if (!password.equals(verifyPassword)) {
|
if (!password.equals(verifyPassword)) {
|
||||||
throw new JeroBootException("新密码和确认密码不一致,请重新输入");
|
throw new JeroBootException("新密码和确认密码不一致,请重新输入");
|
||||||
}
|
}
|
||||||
|
String salt = oConvertUtils.randomGen(8);
|
||||||
|
String passwordEncode = PasswordUtil.encrypt(phone,password,salt);
|
||||||
|
registerSelf.getPayContactsManagement().setPassword(passwordEncode);
|
||||||
payContactsManagementService.addMeeting(registerSelf.getPayContactsManagement());
|
payContactsManagementService.addMeeting(registerSelf.getPayContactsManagement());
|
||||||
redisUtil.del("_verification:_phone:" + phone);
|
redisUtil.del("_verification:_phone:" + phone);
|
||||||
}
|
}
|
||||||
|
|||||||
+136
-114
@@ -1,6 +1,7 @@
|
|||||||
package com.jero.meeting.controller;
|
package com.jero.meeting.controller;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@@ -426,7 +427,6 @@ public class PayMeetingController extends JeroController<PayMeeting, IPayMeeting
|
|||||||
//String publicKey = request.getParameter("publicKey");
|
//String publicKey = request.getParameter("publicKey");
|
||||||
//String token = request.getParameter("token");
|
//String token = request.getParameter("token");
|
||||||
//authenticationUtils.check(token, publicKey);
|
//authenticationUtils.check(token, publicKey);
|
||||||
|
|
||||||
payMeetingService.addStandards(payMeeting);
|
payMeetingService.addStandards(payMeeting);
|
||||||
return Result.OK("合并开票成功!");
|
return Result.OK("合并开票成功!");
|
||||||
}
|
}
|
||||||
@@ -448,121 +448,143 @@ public class PayMeetingController extends JeroController<PayMeeting, IPayMeeting
|
|||||||
* @param id 传入文件id
|
* @param id 传入文件id
|
||||||
* @param response
|
* @param response
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation(value = "企业端会议下载资料", notes = "企业端会议下载资料")
|
||||||
@GetMapping(value = "/userDownload/{id}/{meetingId}")
|
@GetMapping(value = "/userDownload/{id}/{meetingId}")
|
||||||
public void download(@PathVariable String id, @PathVariable String meetingId, HttpServletResponse response, String type) {
|
public void download(@PathVariable String id, @PathVariable String meetingId, HttpServletResponse response, String type) {
|
||||||
// LoginUser sysUser =(LoginUser) SecurityUtils.getSubject().getPrincipal();
|
LoginUser sysUser =(LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
// String sysUserId = sysUser.getId();
|
String sysUserId = sysUser.getId();
|
||||||
// PayMeeting byId = payMeetingService.getById(meetingId);
|
PayMeeting byId = payMeetingService.getById(meetingId);
|
||||||
// if(ObjectUtils.isEmpty(byId)){
|
if(ObjectUtils.isEmpty(byId)){
|
||||||
// throw new JeroBootException("会议不存在..");
|
throw new JeroBootException("会议不存在..");
|
||||||
// }
|
}
|
||||||
// String meetingMinute = byId.getMeetingMinute();
|
String meetingMinute = byId.getMeetingMinute();
|
||||||
// String meetingData = byId.getMeetingData();
|
String meetingData = byId.getMeetingData();
|
||||||
// List<String>
|
List<String> fileList = null;
|
||||||
// if(meetingMinute)
|
if(StringUtils.isNotBlank(meetingMinute)) {
|
||||||
// List<String> meetingMinuteList = Arrays.asList(meetingMinute.split(","));
|
fileList.addAll(Arrays.asList(meetingMinute.split(",")));
|
||||||
// List<String> meetingMinuteList = Arrays.asList(meetingMinute.split(","));
|
}
|
||||||
// // 查询数据表数据是否存在
|
if(StringUtils.isNotBlank(meetingData)) {
|
||||||
// LambdaQueryWrapper<OSSFile> queryWrapper = new LambdaQueryWrapper<>();
|
fileList.addAll(Arrays.asList(meetingData.split(",")));
|
||||||
// queryWrapper.eq(OSSFile::getId,id);
|
}
|
||||||
// OSSFile ossFile = ossFileService.getOne(queryWrapper);
|
if(fileList==null||!fileList.contains(id)){
|
||||||
// if( null == ossFile){
|
throw new JeroBootException("会议无此文件..");
|
||||||
// throw new JeroBootException("文件不存在..");
|
}
|
||||||
// }
|
BigDecimal meetingCosts = byId.getMeetingCosts();
|
||||||
// String fileUrl = ossFile.getUrl();
|
//免费会议
|
||||||
// InputStream inputStream = null;
|
if ("0".equals(meetingCosts.toString())){
|
||||||
// OutputStream outputStream = null;
|
QueryWrapper<PayMeetingSituation> queryWrapper1 = new QueryWrapper<>();
|
||||||
// try {
|
queryWrapper1.eq("meeting_id", meetingId);
|
||||||
// String fileName = "";
|
queryWrapper1.eq("company_contact_id", sysUserId);
|
||||||
// if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)){
|
PayMeetingSituation one = payMeetingSituationService.getOne(queryWrapper1);
|
||||||
// //本地下载
|
if (ObjectUtils.isEmpty(one)) {
|
||||||
// String filePath = uploadpath + File.separator + fileUrl;
|
throw new JeroBootException("会议报名并审核通过后才可查看文件");
|
||||||
// File file = new File(filePath);
|
}
|
||||||
// if(!file.exists()){
|
Integer checkResult = one.getCheckResult();
|
||||||
// response.setStatus(404);
|
if (checkResult != 1) {
|
||||||
// throw new RuntimeException("文件不存在..");
|
throw new JeroBootException("会议报名并审核通过后才可查看文件");
|
||||||
// }
|
}
|
||||||
// // 文件名称
|
}
|
||||||
// fileName = file.getName();
|
// 查询数据表数据是否存在
|
||||||
// inputStream = new BufferedInputStream(new FileInputStream(filePath));
|
LambdaQueryWrapper<OSSFile> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
// }else if(CommonConstant.UPLOAD_TYPE_MINIO.equals(uploadType)){
|
queryWrapper.eq(OSSFile::getId,id);
|
||||||
// // minio 下载
|
OSSFile ossFile = ossFileService.getOne(queryWrapper);
|
||||||
// // 通过MinioUtil查询时 只需要桶后面的路径
|
if( null == ossFile){
|
||||||
// String minioUrl = MinioUtil.getMinioUrl();
|
throw new JeroBootException("文件不存在..");
|
||||||
// // Linux/unix 系统下文件路径分隔符为"/" 获取minio与存储桶的路径
|
}
|
||||||
// minioUrl = minioUrl + MinioUtil.getBucketName() + "/";
|
String fileUrl = ossFile.getUrl();
|
||||||
// String url = fileUrl.replace(minioUrl, "");
|
InputStream inputStream = null;
|
||||||
// // 文件名称
|
OutputStream outputStream = null;
|
||||||
// fileName = ossFile.getFileName();
|
try {
|
||||||
// inputStream = MinioUtil.getMinioFile(MinioUtil.getBucketName(), url);
|
String fileName = "";
|
||||||
// }
|
if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)){
|
||||||
//
|
//本地下载
|
||||||
// ossFileService.updateById(ossFile);
|
String filePath = uploadpath + File.separator + fileUrl;
|
||||||
// LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
File file = new File(filePath);
|
||||||
// if (loginUser.getIsCompanyUser()) {
|
if(!file.exists()){
|
||||||
// Integer integer = ossFileService.searchDownloadTimes(ossFile.getId(), loginUser.getId());
|
response.setStatus(404);
|
||||||
// if (integer >= 5) {
|
throw new RuntimeException("文件不存在..");
|
||||||
// throw new JeroBootException("超出下载次数限制");
|
}
|
||||||
// }
|
// 文件名称
|
||||||
// }
|
fileName = file.getName();
|
||||||
// ossFileService.saveDownloadTimes(ossFile.getId(), loginUser.getId());
|
inputStream = new BufferedInputStream(new FileInputStream(filePath));
|
||||||
//
|
}else if(CommonConstant.UPLOAD_TYPE_MINIO.equals(uploadType)){
|
||||||
// response.addHeader("Content-Disposition", "attachment;fileName=" + new String(fileName.getBytes("UTF-8"),"iso-8859-1"));
|
// minio 下载
|
||||||
// response.setContentType("application/force-download");// 设置强制下载不打开
|
// 通过MinioUtil查询时 只需要桶后面的路径
|
||||||
// if (type == null) {
|
String minioUrl = MinioUtil.getMinioUrl();
|
||||||
// fileName = StringUtils.lowerCase(fileName);
|
// Linux/unix 系统下文件路径分隔符为"/" 获取minio与存储桶的路径
|
||||||
// if (fileName.contains(".jpg") || fileName.contains(".gif") || fileName.contains(".jpeg")) {
|
minioUrl = minioUrl + MinioUtil.getBucketName() + "/";
|
||||||
// response.setContentType("image/jpeg;image/jpg;image/gif;image/png");
|
String url = fileUrl.replace(minioUrl, "");
|
||||||
// } else if (fileName.contains(".png")) {
|
// 文件名称
|
||||||
// response.setContentType("image/png;image/jpg;image/gif;image/jpeg");
|
fileName = ossFile.getFileName();
|
||||||
// }
|
inputStream = MinioUtil.getMinioFile(MinioUtil.getBucketName(), url);
|
||||||
// }
|
}
|
||||||
// outputStream = response.getOutputStream();
|
|
||||||
// byte[] buf = new byte[1024];
|
ossFileService.updateById(ossFile);
|
||||||
// int len;
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
// while ((len = inputStream.read(buf)) > 0) {
|
if (loginUser.getIsCompanyUser()) {
|
||||||
// outputStream.write(buf, 0, len);
|
Integer integer = ossFileService.searchDownloadTimes(ossFile.getId(), loginUser.getId());
|
||||||
// }
|
if (integer >= 5) {
|
||||||
// response.flushBuffer();
|
throw new JeroBootException("超出下载次数限制");
|
||||||
// //统计下载和上传次数
|
}
|
||||||
// if ("download".equals(type)) {
|
}
|
||||||
// Integer downloadNumber = ossFile.getDownloadNumber();
|
ossFileService.saveDownloadTimes(ossFile.getId(), loginUser.getId());
|
||||||
// if (downloadNumber == null) {
|
|
||||||
// ossFile.setDownloadNumber(1);
|
response.addHeader("Content-Disposition", "attachment;fileName=" + new String(fileName.getBytes("UTF-8"),"iso-8859-1"));
|
||||||
// } else {
|
response.setContentType("application/force-download");// 设置强制下载不打开
|
||||||
// ossFile.setDownloadNumber(downloadNumber + 1);
|
if (type == null) {
|
||||||
// }
|
fileName = StringUtils.lowerCase(fileName);
|
||||||
// ossFileService.updateById(ossFile);
|
if (fileName.contains(".jpg") || fileName.contains(".gif") || fileName.contains(".jpeg")) {
|
||||||
// } else {
|
response.setContentType("image/jpeg;image/jpg;image/gif;image/png");
|
||||||
// Integer viewNumber = ossFile.getViewNumber();
|
} else if (fileName.contains(".png")) {
|
||||||
// if (viewNumber == null) {
|
response.setContentType("image/png;image/jpg;image/gif;image/jpeg");
|
||||||
// ossFile.setViewNumber(1);
|
}
|
||||||
// } else {
|
}
|
||||||
// ossFile.setViewNumber(viewNumber + 1);
|
outputStream = response.getOutputStream();
|
||||||
// }
|
byte[] buf = new byte[1024];
|
||||||
// ossFileService.updateAndPush(ossFile);
|
int len;
|
||||||
// }
|
while ((len = inputStream.read(buf)) > 0) {
|
||||||
// } catch (IOException e) {
|
outputStream.write(buf, 0, len);
|
||||||
// log.error("预览文件失败" + e.getMessage());
|
}
|
||||||
// response.setStatus(404);
|
response.flushBuffer();
|
||||||
// e.printStackTrace();
|
//统计下载和上传次数
|
||||||
// } finally {
|
if ("download".equals(type)) {
|
||||||
// if (inputStream != null) {
|
Integer downloadNumber = ossFile.getDownloadNumber();
|
||||||
// try {
|
if (downloadNumber == null) {
|
||||||
// inputStream.close();
|
ossFile.setDownloadNumber(1);
|
||||||
// } catch (IOException e) {
|
} else {
|
||||||
// log.error(e.getMessage(), e);
|
ossFile.setDownloadNumber(downloadNumber + 1);
|
||||||
// }
|
}
|
||||||
// }
|
ossFileService.updateById(ossFile);
|
||||||
// if (outputStream != null) {
|
} else {
|
||||||
// try {
|
Integer viewNumber = ossFile.getViewNumber();
|
||||||
// outputStream.close();
|
if (viewNumber == null) {
|
||||||
// } catch (IOException e) {
|
ossFile.setViewNumber(1);
|
||||||
// log.error(e.getMessage(), e);
|
} 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