|
@@ -24,6 +24,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import java.io.File;
|
|
import java.io.File;
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
@@ -49,7 +50,7 @@ public class UploadWorkeCertificateServiceImpl implements UploadWorkeCertificate
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void procesUploadWorkeCert() {
|
|
public void procesUploadWorkeCert() {
|
|
-
|
|
|
|
|
|
+ SimpleDateFormat sdfs = new SimpleDateFormat("yyyyMM/");
|
|
List<WorkerCert> recs = new ArrayList<>();
|
|
List<WorkerCert> recs = new ArrayList<>();
|
|
List<WorkerBrandAccount> workerWdnos = new ArrayList<>();
|
|
List<WorkerBrandAccount> workerWdnos = new ArrayList<>();
|
|
String fileo ="";
|
|
String fileo ="";
|
|
@@ -96,12 +97,12 @@ public class UploadWorkeCertificateServiceImpl implements UploadWorkeCertificate
|
|
|
|
|
|
// 生成图片 System.getProperty("java.io.tmpdir")
|
|
// 生成图片 System.getProperty("java.io.tmpdir")
|
|
if (StringUtils.isNotEmpty(item.getFileUrl()) && (StringUtils.isEmpty(item.getOutFileUrl()))){
|
|
if (StringUtils.isNotEmpty(item.getFileUrl()) && (StringUtils.isEmpty(item.getOutFileUrl()))){
|
|
- fileo = IdWorker.getIdStr() + ".jpg";
|
|
|
|
|
|
+ fileo = sdfs.format(new Date())+IdWorker.getIdStr() + ".jpg";
|
|
// 下载文件生成新文件 fid1
|
|
// 下载文件生成新文件 fid1
|
|
baseService.saveToFile(ossUtil.getUrlWw(item.getFileUrl()),fileo);
|
|
baseService.saveToFile(ossUtil.getUrlWw(item.getFileUrl()),fileo);
|
|
}
|
|
}
|
|
if (StringUtils.isNotEmpty(item.getFileUrl2()) && (StringUtils.isEmpty(item.getOutFileUrl2()))){
|
|
if (StringUtils.isNotEmpty(item.getFileUrl2()) && (StringUtils.isEmpty(item.getOutFileUrl2()))){
|
|
- filet = IdWorker.getIdStr() + ".jpg";
|
|
|
|
|
|
+ filet = sdfs.format(new Date())+IdWorker.getIdStr() + ".jpg";
|
|
// 下载文件生成新文件 fid2
|
|
// 下载文件生成新文件 fid2
|
|
baseService.saveToFile(ossUtil.getUrlWw(item.getFileUrl2()),filet);
|
|
baseService.saveToFile(ossUtil.getUrlWw(item.getFileUrl2()),filet);
|
|
}
|
|
}
|
|
@@ -163,6 +164,7 @@ public class UploadWorkeCertificateServiceImpl implements UploadWorkeCertificate
|
|
* 不为空正常生成
|
|
* 不为空正常生成
|
|
*/
|
|
*/
|
|
private String uploadInsureCert(WorkerBrandAccount wdno) throws Exception {
|
|
private String uploadInsureCert(WorkerBrandAccount wdno) throws Exception {
|
|
|
|
+ SimpleDateFormat sdfs = new SimpleDateFormat("yyyyMM/");
|
|
String fileo ="";
|
|
String fileo ="";
|
|
String fid1 = "";
|
|
String fid1 = "";
|
|
InsureWorkerRecord wk = insureWorkerRecordService.lambdaQuery()
|
|
InsureWorkerRecord wk = insureWorkerRecordService.lambdaQuery()
|
|
@@ -172,7 +174,7 @@ public class UploadWorkeCertificateServiceImpl implements UploadWorkeCertificate
|
|
if (StringUtils.isEmpty(wk.getOutVoucher())){
|
|
if (StringUtils.isEmpty(wk.getOutVoucher())){
|
|
// 生成图片
|
|
// 生成图片
|
|
if (StringUtils.isEmpty(wk.getVoucher())){
|
|
if (StringUtils.isEmpty(wk.getVoucher())){
|
|
- fid1 = "bx.jpg";
|
|
|
|
|
|
+ fid1 = sdfs.format(new Date())+"bx.jpg";
|
|
baseService.initFile(fid1);
|
|
baseService.initFile(fid1);
|
|
} else {
|
|
} else {
|
|
fid1 = IdWorker.getIdStr() + ".jpg";
|
|
fid1 = IdWorker.getIdStr() + ".jpg";
|