|
@@ -14,9 +14,11 @@ import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
|
|
|
import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageElectronicSealService;
|
|
|
import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
|
|
|
import com.jeeplus.modules.sys.entity.User;
|
|
|
+import com.jeeplus.modules.sys.service.WorkattachmentService;
|
|
|
import com.jeeplus.modules.sys.utils.UserUtils;
|
|
|
import com.jeeplus.modules.tools.utils.SignaturePostUtil;
|
|
|
import com.jeeplus.modules.workactivity.service.WorkActivityProcessService;
|
|
|
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
|
|
|
import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
|
|
|
import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
|
|
|
import com.jeeplus.modules.workprojectnotify.util.UtilNotify;
|
|
@@ -44,6 +46,8 @@ public class RuralProjectSignatureCallBackController extends BaseController {
|
|
|
protected HistoryService historyService;
|
|
|
@Autowired
|
|
|
private RuralProjectMessageElectronicSealService ruralProjectMessageElectronicSealService;
|
|
|
+ @Autowired
|
|
|
+ private WorkattachmentService workattachmentService;
|
|
|
|
|
|
private ProjectReportDataDao projectReportDataDao = SpringContextHolder.getBean(ProjectReportDataDao.class);
|
|
|
|
|
@@ -153,8 +157,9 @@ public class RuralProjectSignatureCallBackController extends BaseController {
|
|
|
projectReportData.setSignatureContractId(presignCallBack.getContractId());
|
|
|
projectReportData.setSignatureUploadDate(new Date());
|
|
|
//对文件回调路径进行处理并保存
|
|
|
+ String signatureUrl = null;
|
|
|
if(StringUtils.isNotBlank(presignCallBack.getStoragePath())){
|
|
|
- String signatureUrl = presignCallBack.getStoragePath().replace("oss:/","");
|
|
|
+ signatureUrl = presignCallBack.getStoragePath().replace("oss:/","");
|
|
|
projectReportData.setSignatureUrl(signatureUrl);
|
|
|
}
|
|
|
//修改签章对应信息文件
|
|
@@ -164,6 +169,40 @@ public class RuralProjectSignatureCallBackController extends BaseController {
|
|
|
dao.updateApprovalSignature(projectApprovalSignature);
|
|
|
long t2 = System.currentTimeMillis();
|
|
|
System.out.println("审定单回调运行耗时:" + (t2-t1) + " 毫秒");
|
|
|
+
|
|
|
+ //将文件存储到项目审定单列表中
|
|
|
+ //签章完成则进行数据的保存
|
|
|
+
|
|
|
+ //将文件存储到对应的档案信息中的“咨询报告书正文”中
|
|
|
+ WorkClientAttachment attchment = new WorkClientAttachment();
|
|
|
+ attchment.setProjectId(records.getId());
|
|
|
+ attchment.setAttachmentId("058ef76b128a4d629acb039017f19161");
|
|
|
+ attchment.setDivIdType("signature");
|
|
|
+ //删除原有的数据信息
|
|
|
+ workattachmentService.deleteByAttachIdAndProject(attchment);
|
|
|
+ //查询原有文件的数据量
|
|
|
+ Integer fileCount = workattachmentService.getAttachmentCountByAttachmentIdAndProjectId(attchment);
|
|
|
+ if( null == fileCount){
|
|
|
+ fileCount = 0;
|
|
|
+ }
|
|
|
+ fileCount = fileCount + 1;
|
|
|
+ if(StringUtils.isNotBlank(signatureUrl)){
|
|
|
+ String fileName = signatureUrl.substring(signatureUrl.lastIndexOf("/")+1,signatureUrl.length());
|
|
|
+ String fileSuffix = fileName.substring(fileName.lastIndexOf(".")+1,fileName.length());
|
|
|
+ attchment.setFileSize("");
|
|
|
+ User user = UserUtils.get(records.getCreateBy().getId());
|
|
|
+ attchment.setCreateBy(user);
|
|
|
+ attchment.setUpdateBy(user);
|
|
|
+ attchment.setUrl(signatureUrl);
|
|
|
+ attchment.setType(fileSuffix);
|
|
|
+ attchment.setAttachmentUser(records.getCreateBy().getId());
|
|
|
+ attchment.setAttachmentName(fileName);
|
|
|
+ attchment.setAttachmentFlag("100");
|
|
|
+ attchment.setSort(fileCount.toString());
|
|
|
+ workattachmentService.insertOnWorkClientAttachment(attchment);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
return null;
|
|
|
}
|
|
|
|
|
@@ -242,8 +281,9 @@ public class RuralProjectSignatureCallBackController extends BaseController {
|
|
|
records.setReportSignatureContractId(presignCallBack.getContractId());
|
|
|
records.setReportSignatureUploadDate(new Date());
|
|
|
//对文件回调路径进行处理并保存
|
|
|
+ String signatureUrl = null;
|
|
|
if(StringUtils.isNotBlank(presignCallBack.getStoragePath())){
|
|
|
- String signatureUrl = presignCallBack.getStoragePath().replace("oss:/","");
|
|
|
+ signatureUrl = presignCallBack.getStoragePath().replace("oss:/","");
|
|
|
records.setReportSignatureUrl(signatureUrl);
|
|
|
}
|
|
|
//修改签章对应信息文件
|
|
@@ -298,6 +338,35 @@ public class RuralProjectSignatureCallBackController extends BaseController {
|
|
|
|
|
|
long t2 = System.currentTimeMillis();
|
|
|
System.out.println("报告签章回调运行耗时:" + (t2-t1) + " 毫秒");
|
|
|
+
|
|
|
+ if(StringUtils.isNotBlank(signatureUrl)) {
|
|
|
+ String fileName = signatureUrl.substring(signatureUrl.lastIndexOf("/")+1,signatureUrl.length());
|
|
|
+ //将文件存储到对应的档案信息中的“咨询报告书正文”中
|
|
|
+ WorkClientAttachment attchment = new WorkClientAttachment();
|
|
|
+ attchment.setProjectId(records.getId());
|
|
|
+ attchment.setAttachmentId("6c68d29ea00e4cdb8cf17fb54ee30f0f");
|
|
|
+ attchment.setDivIdType("signature");
|
|
|
+ //删除原有的数据信息
|
|
|
+ workattachmentService.deleteByAttachIdAndProject(attchment);
|
|
|
+ //查询原有文件的数据量
|
|
|
+ Integer fileCount = workattachmentService.getAttachmentCountByAttachmentIdAndProjectId(attchment);
|
|
|
+ if (null == fileCount) {
|
|
|
+ fileCount = 0;
|
|
|
+ }
|
|
|
+ fileCount = fileCount + 1;
|
|
|
+ String fileSuffix = fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length());
|
|
|
+ attchment.setFileSize("");
|
|
|
+ User user = UserUtils.get(records.getCreateBy().getId());
|
|
|
+ attchment.setCreateBy(user);
|
|
|
+ attchment.setUpdateBy(user);
|
|
|
+ attchment.setUrl(signatureUrl);
|
|
|
+ attchment.setType(fileSuffix);
|
|
|
+ attchment.setAttachmentUser(records.getCreateBy().getId());
|
|
|
+ attchment.setAttachmentName(fileName);
|
|
|
+ attchment.setAttachmentFlag("100");
|
|
|
+ attchment.setSort(fileCount.toString());
|
|
|
+ workattachmentService.insertOnWorkClientAttachment(attchment);
|
|
|
+ }
|
|
|
return null;
|
|
|
}
|
|
|
|