Commit e3f75496 authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/develop' into develop

parents a7077194 47180616
......@@ -78,7 +78,7 @@ public class EmployeeXProjectVO extends RowIndex implements Serializable {
* 是否同步减档(0否;1是)
*/
@ExcelProperty(value ="是否同步减档")
@NotNull(message = "是否同步减档不能为空")
@ExcelAttribute(name = "是否同步减档",isNotEmpty = true, errorInfo = "是否同步减档不能为空",maxLength = 1)
// @NotNull(message = "是否同步减档不能为空")
// @ExcelAttribute(name = "是否同步减档",isNotEmpty = true, errorInfo = "是否同步减档不能为空",maxLength = 1)
private String isLeaveEmployee;
}
......@@ -129,7 +129,7 @@ public class TElecEmployeeInfoController {
@PostMapping("/importZip")
@Operation(summary = "批量导入电子档案", description = "批量导入电子档案")
@SysLog("批量导入电子档案" )
public R<Boolean> importZip(@RequestBody MultipartFile file) {
public R importZip(@RequestBody MultipartFile file) {
return this.tElecEmployeeInfoService.importZip(file);
}
}
......@@ -41,7 +41,7 @@ public interface TElecEmployeeInfoService extends IService<TElecEmployeeInfo> {
* @author: huyc
* @date: 2022/6/24
*/
R<Boolean> importZip(MultipartFile file);
R importZip(MultipartFile file);
/**
* @description: 通过身份证号查询人员档案
......
......@@ -46,6 +46,7 @@ import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import java.io.*;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.List;
import java.util.Map;
......@@ -90,7 +91,7 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
* @date: 2022/6/27
*/
@Override
public R<Boolean> importZip(MultipartFile zipFile){
public R importZip(MultipartFile zipFile){
try {
String pathName = ResourceUtils.getURL("classpath:").getPath() + "unloap/";
String dec = ResourceUtils.getURL("classpath:").getPath() + "unloap/";
......@@ -107,9 +108,7 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
File file = new File(pathName);
zipFile.transferTo(file);
// 获取解压出来的文件名 不带后缀
unZip(file, dec);
//解析完成删除本次解析中生成的文件 删除此目录下的所有文件
deleteFolder(dec);
return unZip(file, dec);
} catch (Exception e) {
e.printStackTrace();
}
......@@ -121,6 +120,9 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
TEmployeeInfo tEmployeeInfo = tEmployeeInfoService.getOne((Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard,idCard)).eq(TEmployeeInfo::getDeleteFlag,CommonConstants.ZERO_STRING));
if (Common.isNotNull(tEmployeeInfo)) {
if (CommonConstants.ONE_INT == tEmployeeInfo.getFileStatus()) {
return R.failed("身份证号对应的档案为已减档");
}
return R.ok(tEmployeeInfo);
}
return R.failed("未找到身份证号对应的档案信息");
......@@ -196,18 +198,18 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
fos.write(buf, 0, len);
}
R<FileVo> fileVo =fileUploadService.uploadImg(fileCovertMultipartFile(targetFile),"", CommonConstants.EIGHT_INT,"");
if (empInfo.length() > empInfo.lastIndexOf("/") + 1) {
String idCard = empInfo.substring(0,empInfo.indexOf("/"));
String dataType = empInfo.substring(empInfo.indexOf("/") +1,empInfo.lastIndexOf("/"));
String empName = "";
TEmployeeInfo tEmployeeInfo = tEmployeeInfoService.getOne((Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard,idCard)));
.eq(TEmployeeInfo::getEmpIdcard,idCard)).eq(TEmployeeInfo::getFileStatus,CommonConstants.ZERO_INT)
.eq(TEmployeeInfo::getDeleteFlag,CommonConstants.ZERO_STRING));
if (Common.isNotNull(tEmployeeInfo)) {
empName = tEmployeeInfo.getEmpName();
}else {
return R.failed("未找到身份证对应的档案信息,身份证号:" + idCard);
}
String attachInfo = empInfo.substring(empInfo.lastIndexOf("/")+1,empInfo.length());
TElecEmployeeInfo tElecEmployeeInfo = new TElecEmployeeInfo();
tElecEmployeeInfo.setEmpIdcard(idCard);
tElecEmployeeInfo.setEmpName(empName);
......@@ -215,7 +217,14 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
tElecEmployeeInfo.setDataType(elecTypeMap.get(dataType));
}
this.save(tElecEmployeeInfo);
//文件上传并保存附件信息
R<FileVo> fileVo =fileUploadService.uploadImg(fileCovertMultipartFile(targetFile),"", CommonConstants.EIGHT_INT,"");
String id = fileVo.getData().getUid();
attaInfoMapper.updateDomainId(tElecEmployeeInfo.getId(), Arrays.asList(id));
}
//解析完成删除本次解析中生成的文件 删除此目录下的所有文件
deleteFolder(destDirPath);
// 关流顺序,先打开的后关闭
fos.close();
is.close();
......
......@@ -204,7 +204,7 @@ public class TEmpBadRecordServiceImpl extends ServiceImpl<TEmpBadRecordMapper, T
@Override
public void listExport(HttpServletResponse response, EmpBadRecordSearchVo searchVo) {
String fileName = "不良记录批量导出" + LocalDateTime.now() + ".xlsx";
String fileName = "不良记录批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TEmpBadRecord> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
......@@ -213,7 +213,7 @@ public class TEmpBadRecordServiceImpl extends ServiceImpl<TEmpBadRecordMapper, T
out = response.getOutputStream();
response.setContentType("multipart/form-data");
response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filename*=utf-8'zh_cn'" + URLEncoder.encode(fileName , "UTF-8"));
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName , "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter excelWriter = EasyExcel.write(out, TEmpBadRecord.class).build();
......
......@@ -16,11 +16,23 @@ spring:
password: yf_zsk
#url: jdbc:mysql://127.0.0.1:3306/yifu_upms?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
url: jdbc:mysql://192.168.1.65:22306/mvp_archives?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
servlet:
multipart:
location: /data/tmp
#法大大生产环境
#fdd:
# app-id: FA05480470
# app-key: GTYGFVFOYUYP3ONRHY91EK8IEAK5L9E7
# server-url: https://openapi.fadada.com/api/v3/
# connect-timeout: 10000
# read-timeout: 10000
# hrms-url: http://2349f6a315.wicp.vip:39468/v1.0/invoke/yifu-archives/method
#法大大沙箱环境配置
fdd:
app-id: FA05480470
app-key: GTYGFVFOYUYP3ONRHY91EK8IEAK5L9E7
server-url: https://openapi.fadada.com/api/v3/
connect-timeout: 10000
read-timeout: 10000
hrms-url: http://2349f6a315.wicp.vip:39468/v1.0/invoke/yifu-archives/method/fdd/notifyUrl
\ No newline at end of file
appId: FA38847543
appKey: HOQBDZAEMEILJM6WU9LY0OPFHNFAMVTQ
serverUrl: https://sandboxapi.fadada.com/api/v3/
connectTimeout: 10000
readTimeout: 10000
hrmsUrl: http://2349f6a315.wicp.vip:39468/v1.0/invoke/yifu-archives/method
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment