|
|
@@ -50,6 +50,7 @@ import com.zhongzheng.modules.goods.vo.UserNewGoodsVo;
|
|
|
import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
|
|
|
import com.zhongzheng.modules.grade.service.IClassGradeUserService;
|
|
|
import com.zhongzheng.modules.grade.vo.ClassGradeUserGoodsVo;
|
|
|
+import com.zhongzheng.modules.grade.vo.ClassPeriodStudentExportListVo;
|
|
|
import com.zhongzheng.modules.order.bo.OrderQueryBo;
|
|
|
import com.zhongzheng.modules.order.service.IOrderService;
|
|
|
import com.zhongzheng.modules.order.vo.OrderListVo;
|
|
|
@@ -1769,33 +1770,112 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
userBo.setSex(ObjectUtil.isNotNull(user.getSex()) && user.getSex() == 1?"男":"女");
|
|
|
userBo.setUserPhone(EncryptHandler.decrypt(user.getTelphone()));
|
|
|
userBo.setUserCard(EncryptHandler.decrypt(user.getIdCard()));
|
|
|
+ List<ClassPeriodStudentExportListVo> listVideoUserPeriod = iClassGradeUserService.getListVideoUserPeriod(userId);
|
|
|
+ listVideoUserPeriod.forEach(item->{
|
|
|
+ userBo.setGoodsName(item.getGoodsName());
|
|
|
+ userBo.setGoodsYear(item.getGoodsYear());
|
|
|
+ userBo.setBusinessName(item.getBusinessName());
|
|
|
+ userBo.setMajor(item.getCategoryName());
|
|
|
+ userBo.setClassName(item.getClassName());
|
|
|
+ userBo.setClassHours(item.getClassHours());
|
|
|
+ userBo.setProcess(item.getProcess());
|
|
|
+ userBo.setPeriodStatus(item.getPeriodStatus());
|
|
|
+ });
|
|
|
+ UserUsbRecordBo recordBo1 = new UserUsbRecordBo();
|
|
|
+ recordBo1.setUserId(user.getUserId());
|
|
|
+ List<UserUsbRecordVo> usbRecordVos = iClassGradeUserService.getListUserSubscribe(recordBo1);
|
|
|
+ if (!CollectionUtils.isEmpty(usbRecordVos)){
|
|
|
+ usbRecordVos.forEach(item -> {
|
|
|
+ if (ObjectUtils.isNotNull(item.getApplyTime())){
|
|
|
+ userBo.setApplyTimeStr(String.format("%s (%s-%s)",DateUtils.timestampToDateFormat(item.getApplyTime(),"yyyy-MM-dd")
|
|
|
+ ,item.getApplyStarTime(),item.getApplyEndTime()));
|
|
|
+ }
|
|
|
+ userBo.setSubscribeStatusStr(item.getSubscribeStatus() == 1 ? "已预约":"已取消");
|
|
|
+ userBo.setCreateTimeStr(DateUtils.timestampToDateFormat(item.getCreateTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
+ userBo.setApplyAddress(item.getApplyAddress());
|
|
|
+ if (item.getSubscribeStatus() == 1){
|
|
|
+ if (ObjectUtils.isNull(item.getApplyTime())){
|
|
|
+ userBo.setSubscribeStatusStr("已过期");
|
|
|
+ }else {
|
|
|
+ Long aLong = DateUtils.dateTimeSec("HH:mm", item.getApplyEndTime());
|
|
|
+ Long time = item.getApplyTime()+aLong;
|
|
|
+ if (DateUtils.getNowTime() > time){
|
|
|
+ userBo.setSubscribeStatusStr("已过期");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ UserApplyRecordBo applyRecordBo = new UserApplyRecordBo();
|
|
|
+ applyRecordBo.setUserId(user.getUserId());
|
|
|
+ List<UserApplyRecordVo> applyRecordVoList = iUserSubscribeService.listUserApply(applyRecordBo);
|
|
|
+ if (!CollectionUtils.isEmpty(applyRecordVoList)){
|
|
|
+ applyRecordVoList.forEach(item -> {
|
|
|
+ userBo.setApplyNewStr(item.getApplyNew() == 1 ? "是":"否");
|
|
|
+ if (ObjectUtils.isNotNull(item.getExamStatus())){
|
|
|
+ switch (item.getExamStatus()){
|
|
|
+ case 1:
|
|
|
+ userBo.setExamStatusStr("正常");
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ userBo.setExamStatusStr("缺考");
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ userBo.setExamStatusStr("作弊");
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ userBo.setExamStatusStr("替考");
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ userBo.setExamStatusStr("其他");
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ userBo.setApplyStatusStr(ObjectUtils.isNotNull(item.getApplyStatus()) && item.getApplyStatus() == 1 ? "通过":"不通过");
|
|
|
+ if (ObjectUtils.isNotNull(item.getPerformance())){
|
|
|
+ userBo.setPerformanceStr(String.format("%s分",item.getPerformance()));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
userList.add(userBo);
|
|
|
+ if (!bo.getUserIds().isEmpty()&&bo.getTypes().equals(1)){
|
|
|
+ //学员信息
|
|
|
+ if (!CollectionUtils.isEmpty(userList) && userList.size() > 1){
|
|
|
+ ExcelUtil<UserDataExcelBo> list = new ExcelUtil<>(UserDataExcelBo.class);
|
|
|
+ String path = toPath + "/"+"学员列表.xlsx";
|
|
|
+ list.exportEasyExcelUtil(userList, UserDataExcelBo.class,path);
|
|
|
+ }
|
|
|
+ }
|
|
|
String userPath = toPath + "/" +user.getRealname()+EncryptHandler.decrypt(user.getIdCard());
|
|
|
+ String userNoZipPath = user.getRealname()+EncryptHandler.decrypt(user.getIdCard());
|
|
|
+ String userImgPath = toPath+"/"+"证件照及身份证预览"+"/"+user.getRealname()+EncryptHandler.decrypt(user.getIdCard());
|
|
|
+ String userPromiseImgPath = toPath+"/"+"承诺书预览"+"/"+user.getRealname()+EncryptHandler.decrypt(user.getIdCard());
|
|
|
File file = new File(userPath);
|
|
|
if (!file.exists()) {
|
|
|
file.mkdirs();
|
|
|
}
|
|
|
for (Integer type : bo.getTypes()) {
|
|
|
switch (type){
|
|
|
- case 1://个人资料
|
|
|
+ case 2://个人资料
|
|
|
UserDataExcelBo excelBo = BeanUtil.toBean(user, UserDataExcelBo.class);
|
|
|
excelBo.setRegisterTime(DateUtils.timestampToDateFormat(user.getCreateTime(),"yyyy/MM/dd HH:mm:ss"));
|
|
|
excelBo.setSex(ObjectUtil.isNotNull(user.getSex()) && user.getSex() == 1?"男":"女");
|
|
|
excelBo.setUserPhone(EncryptHandler.decrypt(user.getTelphone()));
|
|
|
excelBo.setUserCard(EncryptHandler.decrypt(user.getIdCard()));
|
|
|
ExcelUtil<UserDataExcelBo> util = new ExcelUtil<>(UserDataExcelBo.class);
|
|
|
- String path1 = userPath + "/"+"个人资料.xlsx";
|
|
|
+ String path1 = userPath+"/个人资料.xlsx";
|
|
|
List<UserDataExcelBo> excelBoList = new ArrayList<>();
|
|
|
excelBoList.add(excelBo);
|
|
|
util.exportEasyExcelUtil(excelBoList, UserDataExcelBo.class,path1);
|
|
|
- break;
|
|
|
- case 2://证件照
|
|
|
- //获取个人近照
|
|
|
+ File userImgFile = new File(toPath+"/"+"证件照及身份证预览"+"/"+excelBo.getRealname()+EncryptHandler.decrypt(user.getIdCard()));
|
|
|
+ if (!userImgFile.exists()) {
|
|
|
+ userImgFile.mkdirs();
|
|
|
+ }
|
|
|
if (ObjectUtils.isNotNull(user.getOneInchPhotos())){
|
|
|
try {
|
|
|
InputStream inputStream = ossService.getStreamByObject(user.getOneInchPhotos());
|
|
|
//写入本地文件
|
|
|
- String inchPath = userPath + "/证件照.jpg";
|
|
|
+ String inchPath = userImgPath + "/证件照.jpg";
|
|
|
FileOutputStream fileOutputStream = new FileOutputStream(inchPath);
|
|
|
byte[] buffer = new byte[1024];
|
|
|
int len = 0;
|
|
|
@@ -1804,44 +1884,36 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
}
|
|
|
inputStream.close();
|
|
|
fileOutputStream.close();
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
- case 3://身份证照片
|
|
|
- //获取身份证照片
|
|
|
- try {
|
|
|
- if (ObjectUtils.isNotNull(user.getIdCardImg1())){
|
|
|
- InputStream inputStream = ossService.getStreamByObject(user.getIdCardImg1());
|
|
|
- //写入本地文件
|
|
|
- String inchPath = userPath + "/身份证正面.jpg";
|
|
|
- FileOutputStream fileOutputStream = new FileOutputStream(inchPath);
|
|
|
- byte[] buffer = new byte[1024];
|
|
|
- int len = 0;
|
|
|
- while ((len = inputStream.read(buffer)) != -1) {
|
|
|
- fileOutputStream.write(buffer, 0, len);
|
|
|
+ if (ObjectUtils.isNotNull(user.getIdCardImg1())){
|
|
|
+ InputStream inputStream1 = ossService.getStreamByObject(user.getIdCardImg1());
|
|
|
+ //写入本地文件
|
|
|
+ String inchPath1 = userImgPath + "/身份证正面.jpg";
|
|
|
+ FileOutputStream fileOutputStream1 = new FileOutputStream(inchPath1);
|
|
|
+ byte[] buffer1 = new byte[1024];
|
|
|
+ int len1 = 0;
|
|
|
+ while ((len1 = inputStream1.read(buffer1)) != -1) {
|
|
|
+ fileOutputStream.write(buffer1, 0, len1);
|
|
|
+ }
|
|
|
+ inputStream1.close();
|
|
|
+ fileOutputStream1.close();
|
|
|
}
|
|
|
- inputStream.close();
|
|
|
- fileOutputStream.close();
|
|
|
- }
|
|
|
- if (ObjectUtils.isNotNull(user.getIdCardImg2())){
|
|
|
- InputStream inputStream2 = ossService.getStreamByObject(user.getIdCardImg2());
|
|
|
- String inchPath2 = userPath + "/身份证反面.jpg";
|
|
|
- FileOutputStream fileOutputStream2 = new FileOutputStream(inchPath2);
|
|
|
- byte[] buffer2 = new byte[1024];
|
|
|
- int len2 = 0;
|
|
|
- while ((len2 = inputStream2.read(buffer2)) != -1) {
|
|
|
- fileOutputStream2.write(buffer2, 0, len2);
|
|
|
+ if (ObjectUtils.isNotNull(user.getIdCardImg2())){
|
|
|
+ InputStream inputStream2 = ossService.getStreamByObject(user.getIdCardImg2());
|
|
|
+ String inchPath2 = userImgPath+ "/身份证反面.jpg";
|
|
|
+ FileOutputStream fileOutputStream2 = new FileOutputStream(inchPath2);
|
|
|
+ byte[] buffer2 = new byte[1024];
|
|
|
+ int len2 = 0;
|
|
|
+ while ((len2 = inputStream2.read(buffer2)) != -1) {
|
|
|
+ fileOutputStream2.write(buffer2, 0, len2);
|
|
|
+ }
|
|
|
+ inputStream2.close();
|
|
|
+ fileOutputStream2.close();
|
|
|
}
|
|
|
- inputStream2.close();
|
|
|
- fileOutputStream2.close();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
}
|
|
|
- break;
|
|
|
- case 4://订单记录
|
|
|
+ case 3://订单记录
|
|
|
OrderQueryBo queryBo = new OrderQueryBo();
|
|
|
queryBo.setStatus(new Integer[]{0,1});
|
|
|
queryBo.setUserId(user.getUserId());
|
|
|
@@ -1892,31 +1964,31 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
}
|
|
|
}
|
|
|
ExcelUtil<OrderListVo> util2 = new ExcelUtil<>(OrderListVo.class);
|
|
|
- String path2 = userPath + "/"+"订单记录.xlsx";
|
|
|
+ String path2 = userNoZipPath+"/订单记录.xlsx";
|
|
|
util2.exportEasyExcelUtil(orderListVos, OrderListVo.class,path2);
|
|
|
}
|
|
|
break;
|
|
|
- case 5://报名记录
|
|
|
- iClassGradeUserService.exportListBKUserPeriod(userId,userPath);
|
|
|
+ case 4://报名记录
|
|
|
+ iClassGradeUserService.exportListBKUserPeriod(userId,userNoZipPath);
|
|
|
break;
|
|
|
- case 6://网课记录
|
|
|
+ case 5://网课记录
|
|
|
iClassGradeUserService.exportListVideoUserPeriod(userId,userPath);
|
|
|
break;
|
|
|
- case 7://题库记录
|
|
|
+ case 6://题库记录
|
|
|
iClassGradeUserService.exportExamStudyList(userId,userPath);
|
|
|
break;
|
|
|
- case 8://直播记录
|
|
|
+ case 7://直播记录
|
|
|
iClassGradeUserService.exportLiveStudyList(userId,userPath);
|
|
|
break;
|
|
|
- case 9://资料记录
|
|
|
- iClassGradeUserService.exportHandoutsStudyList(userId,userPath);
|
|
|
+ case 8://资料记录
|
|
|
+ iClassGradeUserService.exportHandoutsStudyList(userId,userNoZipPath);
|
|
|
break;
|
|
|
- case 10://约考记录
|
|
|
+ case 9://约考记录
|
|
|
UserUsbRecordBo recordBo = new UserUsbRecordBo();
|
|
|
recordBo.setUserId(user.getUserId());
|
|
|
- List<UserUsbRecordVo> usbRecordVos = iClassGradeUserService.getListUserSubscribe(recordBo);
|
|
|
- if (!CollectionUtils.isEmpty(usbRecordVos)){
|
|
|
- usbRecordVos.forEach(item -> {
|
|
|
+ List<UserUsbRecordVo> usbRecordVoList = iClassGradeUserService.getListUserSubscribe(recordBo);
|
|
|
+ if (!CollectionUtils.isEmpty(usbRecordVoList)){
|
|
|
+ usbRecordVoList.forEach(item -> {
|
|
|
if (ObjectUtils.isNotNull(item.getApplyTime())){
|
|
|
item.setApplyTimeStr(String.format("%s (%s-%s)",DateUtils.timestampToDateFormat(item.getApplyTime(),"yyyy-MM-dd")
|
|
|
,item.getApplyStarTime(),item.getApplyEndTime()));
|
|
|
@@ -1940,14 +2012,14 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
}
|
|
|
});
|
|
|
ExcelUtil<UserUsbRecordVo> util3 = new ExcelUtil<>(UserUsbRecordVo.class);
|
|
|
- String path3 = userPath + "/"+"约考记录.xlsx";
|
|
|
- util3.exportEasyExcelUtil(usbRecordVos, UserUsbRecordVo.class,path3);
|
|
|
+ String path3 = userNoZipPath+"/约考记录.xlsx";
|
|
|
+ util3.exportEasyExcelUtil(usbRecordVoList, UserUsbRecordVo.class,path3);
|
|
|
}
|
|
|
break;
|
|
|
- case 11://考试记录
|
|
|
- UserApplyRecordBo applyRecordBo = new UserApplyRecordBo();
|
|
|
- applyRecordBo.setUserId(user.getUserId());
|
|
|
- List<UserApplyRecordVo> applyRecordVos = iUserSubscribeService.listUserApply(applyRecordBo);
|
|
|
+ case 10://考试记录
|
|
|
+ UserApplyRecordBo applyRecordBo1 = new UserApplyRecordBo();
|
|
|
+ applyRecordBo1.setUserId(user.getUserId());
|
|
|
+ List<UserApplyRecordVo> applyRecordVos = iUserSubscribeService.listUserApply(applyRecordBo1);
|
|
|
if (!CollectionUtils.isEmpty(applyRecordVos)){
|
|
|
applyRecordVos.forEach(item -> {
|
|
|
item.setRealname(user.getRealname());
|
|
|
@@ -1982,14 +2054,14 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
}
|
|
|
});
|
|
|
ExcelUtil<UserApplyRecordVo> util4 = new ExcelUtil<>(UserApplyRecordVo.class);
|
|
|
- String path4 = userPath + "/"+"考试记录.xlsx";
|
|
|
+ String path4 = userNoZipPath + "/"+"考试记录.xlsx";
|
|
|
util4.exportEasyExcelUtil(applyRecordVos, UserApplyRecordVo.class,path4);
|
|
|
}
|
|
|
break;
|
|
|
- case 12://证书/证明
|
|
|
+ case 11://证书/证明
|
|
|
iClassGradeUserService.exportCertificateList(userId,userPath);
|
|
|
break;
|
|
|
- case 13://承诺书
|
|
|
+ case 12://承诺书
|
|
|
UserPromiseRecordBo userPromiseRecordBo = new UserPromiseRecordBo();
|
|
|
userPromiseRecordBo.setUserId(user.getUserId());
|
|
|
List<UserPromiseRecordVo> recordVos = iUserSubscribeService.listPromise(userPromiseRecordBo);
|
|
|
@@ -2034,7 +2106,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
try {
|
|
|
InputStream inputStream = ossService.getStreamByObject(path);
|
|
|
//写入本地文件
|
|
|
- String inchPath = commitmentPath + "/"+String.format("承诺书%s.jpg",DateUtils.getNowTime());
|
|
|
+ String inchPath = userPromiseImgPath + "/"+String.format("承诺书%s.jpg",DateUtils.getNowTime());
|
|
|
FileOutputStream fileOutputStream = new FileOutputStream(inchPath);
|
|
|
byte[] buffer = new byte[1024];
|
|
|
int len = 0;
|
|
|
@@ -2053,13 +2125,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- if (!CollectionUtils.isEmpty(userList) && userList.size() > 1){
|
|
|
- ExcelUtil<UserDataExcelBo> list = new ExcelUtil<>(UserDataExcelBo.class);
|
|
|
- String path = toPath + "/"+"学员列表.xlsx";
|
|
|
- list.exportEasyExcelUtil(userList, UserDataExcelBo.class,path);
|
|
|
- }
|
|
|
-
|
|
|
//压缩上传oss
|
|
|
String zipPath = zhiyuan + "/zhongzheng-admin/src/main/resources/danganzip" + "/" + "档案下载"+DateUtils.getNowTime() + ".zip";
|
|
|
File desc = new File(zipPath);
|
|
|
@@ -2099,6 +2164,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
public Map<String, Object> accountLogin(UserAppAccountLoginBo bo) {
|
|
|
if(Validator.isEmpty(bo.getAccount())){
|