|
@@ -120,17 +120,16 @@ public class UploadWorkeCertificate {
|
|
|
for (WorkerBrandAccount wdno: workerWdnos){
|
|
|
uploadFileexc(fileo, filet, fid1, fid2,wdno.getBrandWebsitId(),item);
|
|
|
// 保险数据同步 保险证不在证件表中
|
|
|
- uploadInsureCert(item, wdno,fid3);
|
|
|
+ fid3 = uploadInsureCert(wdno);
|
|
|
}
|
|
|
-
|
|
|
// 文件清除
|
|
|
- delfile(fileo, filet, fid1, fid2,fid3);
|
|
|
+ delfile(fid1, fid2,fid3);
|
|
|
|
|
|
}
|
|
|
log.info("同步师傅证件信息结束: \uF0B7{}",sdf.format(new Date()));
|
|
|
}
|
|
|
|
|
|
- private void delfile(String fileo, String filet, String fid1, String fid2, String file3) {
|
|
|
+ private void delfile(String fid1, String fid2, String file3) {
|
|
|
if (StringUtils.isNotEmpty(fid1)){
|
|
|
new File(fid1).delete();
|
|
|
}
|
|
@@ -140,12 +139,6 @@ public class UploadWorkeCertificate {
|
|
|
if (StringUtils.isNotEmpty(file3)){
|
|
|
new File(file3).delete();
|
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(fileo)){
|
|
|
- new File(fileo).delete();
|
|
|
- }
|
|
|
- if (StringUtils.isNotEmpty(filet)){
|
|
|
- new File(filet).delete();
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -154,7 +147,7 @@ public class UploadWorkeCertificate {
|
|
|
* insure_cert为空 初始化生成
|
|
|
* 不为空正常生成
|
|
|
*/
|
|
|
- private void uploadInsureCert(WorkerCert item, WorkerBrandAccount wdno,String file) throws Exception {
|
|
|
+ private String uploadInsureCert(WorkerBrandAccount wdno) throws Exception {
|
|
|
String fileo ="";
|
|
|
String fid1 = "";
|
|
|
WebsitWorker wk = websitWorkerService.lambdaQuery()
|
|
@@ -170,13 +163,14 @@ public class UploadWorkeCertificate {
|
|
|
}
|
|
|
fileo = fid1;
|
|
|
uploadInitFileexc(fileo, fid1, wdno.getBrandWebsitId(),wk);
|
|
|
- file = fid1;
|
|
|
}
|
|
|
+ return fid1;
|
|
|
}
|
|
|
|
|
|
private Boolean uploadFileexc(String fileo, String filet, String fid1, String fid2,String wdno,WorkerCert item) throws Exception {
|
|
|
Boolean uploadfile = Boolean.TRUE;
|
|
|
Boolean onlyone = Boolean.FALSE;
|
|
|
+ String msg = "";
|
|
|
|
|
|
if (StringUtils.isEmpty(wdno)){
|
|
|
return Boolean.TRUE;
|
|
@@ -198,7 +192,6 @@ public class UploadWorkeCertificate {
|
|
|
// 生成对象
|
|
|
getSaveFileInfo(fid1, resultData, req);
|
|
|
GreeFileSaveHelper responses = greeLogic.greePostSaveFile(req);
|
|
|
-
|
|
|
if (responses.getStatusCode() == 200){
|
|
|
// 保存文件ID responses.getData().getId()
|
|
|
if (StringUtils.isEmpty(filet)){
|
|
@@ -209,7 +202,11 @@ public class UploadWorkeCertificate {
|
|
|
} else {
|
|
|
// 失败
|
|
|
uploadfile = Boolean.FALSE;
|
|
|
- updateWorkCertificateerror(item.getId(),"保存证件正面文件到格力总部失败");
|
|
|
+ msg = "保存证件正面文件到格力总部失败";
|
|
|
+ if (StringUtils.isNotEmpty(responses.getMsg())){
|
|
|
+ msg = msg + responses.getMsg();
|
|
|
+ }
|
|
|
+ updateWorkCertificateerror(item.getId(),msg);
|
|
|
}
|
|
|
} else {
|
|
|
updateWorkCertificateerror(item.getId(),"上传图片到OSS失败");
|
|
@@ -241,7 +238,11 @@ public class UploadWorkeCertificate {
|
|
|
updateWorkCertificatesave(item,responses.getData().getId(),2,uploadfile,onlyone);
|
|
|
} else {
|
|
|
// 失败
|
|
|
- updateWorkCertificateerror(item.getId(),"保存证件反面文件到格力总部失败");
|
|
|
+ msg = "保存证件正面文件到格力总部失败";
|
|
|
+ if (StringUtils.isNotEmpty(responses.getMsg())){
|
|
|
+ msg = msg + responses.getMsg();
|
|
|
+ }
|
|
|
+ updateWorkCertificateerror(item.getId(),msg);
|
|
|
return Boolean.TRUE;
|
|
|
}
|
|
|
} else {
|
|
@@ -312,6 +313,9 @@ public class UploadWorkeCertificate {
|
|
|
v.setId(id);
|
|
|
v.setOutSyncTime(new Date());
|
|
|
v.setOutSyncErrorMsg(msg);
|
|
|
+ if (msg.length()>250){
|
|
|
+ v.setOutSyncErrorMsg(msg.substring(0,250));
|
|
|
+ }
|
|
|
workerCertService.updateById(v);
|
|
|
}
|
|
|
|
|
@@ -340,7 +344,7 @@ public class UploadWorkeCertificate {
|
|
|
req.put("bizType","default");
|
|
|
req.put("accessType","auth");
|
|
|
req.put("url", resultData.getExtData().getDir());
|
|
|
- req.put("name", id1 +".jpeg");
|
|
|
+ req.put("name", id1);
|
|
|
}
|
|
|
|
|
|
|