|
@@ -2,11 +2,10 @@ package com.jeeplus.modules.ruralprojectrecords.service.yanChengSignature;
|
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Maps;
|
|
import com.google.common.collect.Maps;
|
|
|
|
+import com.jeeplus.common.config.Global;
|
|
|
|
+import com.jeeplus.common.oss.OSSClientUtil;
|
|
import com.jeeplus.common.service.CrudService;
|
|
import com.jeeplus.common.service.CrudService;
|
|
-import com.jeeplus.common.utils.IdGen;
|
|
|
|
-import com.jeeplus.common.utils.ImageUtil;
|
|
|
|
-import com.jeeplus.common.utils.MyBeanUtils;
|
|
|
|
-import com.jeeplus.common.utils.ResponseUtil;
|
|
|
|
|
|
+import com.jeeplus.common.utils.*;
|
|
import com.jeeplus.modules.act.entity.Act;
|
|
import com.jeeplus.modules.act.entity.Act;
|
|
import com.jeeplus.modules.act.service.ActTaskService;
|
|
import com.jeeplus.modules.act.service.ActTaskService;
|
|
import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
|
|
import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
|
|
@@ -47,7 +46,9 @@ import com.jeeplus.modules.workcontractinfo.service.WorkContractInfoService;
|
|
import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
|
|
import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
|
|
import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
|
|
import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
|
|
import com.jeeplus.modules.workprojectnotify.util.UtilNotify;
|
|
import com.jeeplus.modules.workprojectnotify.util.UtilNotify;
|
|
|
|
+import com.jeeplus.modules.workstaff.entity.WorkStaffBasicInfo;
|
|
import com.jeeplus.modules.workstaff.entity.WorkStaffCertificate;
|
|
import com.jeeplus.modules.workstaff.entity.WorkStaffCertificate;
|
|
|
|
+import com.jeeplus.modules.workstaff.service.WorkStaffBasicInfoService;
|
|
import org.activiti.engine.RuntimeService;
|
|
import org.activiti.engine.RuntimeService;
|
|
import org.activiti.engine.runtime.ProcessInstance;
|
|
import org.activiti.engine.runtime.ProcessInstance;
|
|
import org.apache.commons.lang3.StringEscapeUtils;
|
|
import org.apache.commons.lang3.StringEscapeUtils;
|
|
@@ -73,6 +74,16 @@ import java.util.regex.Pattern;
|
|
@Service
|
|
@Service
|
|
@Transactional(readOnly = true)
|
|
@Transactional(readOnly = true)
|
|
public class RuralProjectMessageElectronicSealYCService extends CrudService<RuralProjectMessageElectronicSealDao, ProjectReportSignatureInfo> {
|
|
public class RuralProjectMessageElectronicSealYCService extends CrudService<RuralProjectMessageElectronicSealDao, ProjectReportSignatureInfo> {
|
|
|
|
+ //空白图片的base64参数
|
|
|
|
+ private final String blankBase64 = "iVBORw0KGgoAAAANSUhEUgAAAIIAAAA/CAYAAAAsVxBWAAAAAXNSR0IArs4c6QAAAARnQU1BAACx\n" +
|
|
|
|
+ "jwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAACPSURBVHhe7dIBDQAwEMSg+Td9+1QHaOANjghE\n" +
|
|
|
|
+ "BCICEYGIQEQgIhARiAhEBCICEYGIQEQgIhARiAhEBCICEYGIQEQgIhARiAhEBCICEYGIQEQgIhAR\n" +
|
|
|
|
+ "iAhEBCICEYGIQEQgIhARiAhEBCICEYGIQEQgIhARiAhEBCICEYGIQEQgIhARiAhEBCICEYGIQETg\n" +
|
|
|
|
+ "bB/QoX96EpAulQAAAABJRU5ErkJggg==";
|
|
|
|
+ /**
|
|
|
|
+ * 阿里云文件服务器前缀
|
|
|
|
+ */
|
|
|
|
+ private final static String aliyunUrl = Global.getConfig("aliyunUrl");
|
|
|
|
|
|
//生产环境域名
|
|
//生产环境域名
|
|
@Value("${serverDomain}")
|
|
@Value("${serverDomain}")
|
|
@@ -112,6 +123,8 @@ public class RuralProjectMessageElectronicSealYCService extends CrudService<Rura
|
|
private WorkattachmentService workattachmentService;
|
|
private WorkattachmentService workattachmentService;
|
|
@Autowired
|
|
@Autowired
|
|
private WorkClientAttachmentDao workClientAttachmentDao;
|
|
private WorkClientAttachmentDao workClientAttachmentDao;
|
|
|
|
+ @Autowired
|
|
|
|
+ private WorkStaffBasicInfoService workStaffBasicInfoService;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 根据项目id查询审定单是否存在送审信息
|
|
* 根据项目id查询审定单是否存在送审信息
|
|
@@ -1650,6 +1663,30 @@ public class RuralProjectMessageElectronicSealYCService extends CrudService<Rura
|
|
//约定作业期
|
|
//约定作业期
|
|
data.put("promiseTime",promiseTime);
|
|
data.put("promiseTime",promiseTime);
|
|
data.put("projectMaster",ruralProjectRecords.getLeaderNameStr());
|
|
data.put("projectMaster",ruralProjectRecords.getLeaderNameStr());
|
|
|
|
+ //如果项目负责人不为空,则对项目负责人(第一个)进行获取签字章并存储
|
|
|
|
+ if(StringUtils.isNotBlank(ruralProjectRecords.getProjectMasterId())){
|
|
|
|
+ String base64String = base64String(ruralProjectRecords.getProjectMasterId());
|
|
|
|
+ data.put("handSignature3",base64String);
|
|
|
|
+ }else{
|
|
|
|
+ data.put("handSignature3","");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //查询杨荣华杨所的用户信息
|
|
|
|
+ User yrhUser = UserUtils.getByUserName("杨荣华");
|
|
|
|
+ if(StringUtils.isNotBlank(yrhUser.getId())){
|
|
|
|
+ String base64String = base64String(yrhUser.getId());
|
|
|
|
+ data.put("handSignature1",base64String);
|
|
|
|
+ }else{
|
|
|
|
+ data.put("handSignature1","");
|
|
|
|
+ }
|
|
|
|
+ //查询陈红星陈总的用户信息
|
|
|
|
+ User chxUser = UserUtils.getByUserName("陈红星");
|
|
|
|
+ if(StringUtils.isNotBlank(chxUser.getId())){
|
|
|
|
+ String base64String = base64String(chxUser.getId());
|
|
|
|
+ data.put("handSignature2",base64String);
|
|
|
|
+ }else{
|
|
|
|
+ data.put("handSignature2","");
|
|
|
|
+ }
|
|
|
|
|
|
//咨询员信息
|
|
//咨询员信息
|
|
if(null != consultants && consultants.size()>0){
|
|
if(null != consultants && consultants.size()>0){
|
|
@@ -1666,6 +1703,14 @@ public class RuralProjectMessageElectronicSealYCService extends CrudService<Rura
|
|
RuralReportConsultant consultantUserConsultant = new RuralReportConsultant();
|
|
RuralReportConsultant consultantUserConsultant = new RuralReportConsultant();
|
|
User consultantUser = UserUtils.get(projectReportSignatureInfo.getConsultant());
|
|
User consultantUser = UserUtils.get(projectReportSignatureInfo.getConsultant());
|
|
data.put("consultantName1",consultantUser.getName());
|
|
data.put("consultantName1",consultantUser.getName());
|
|
|
|
+ //如果咨询员不为空,则对项咨询员进行获取签字章并存储
|
|
|
|
+ if(StringUtils.isNotBlank(consultantUser.getId())){
|
|
|
|
+ String base64String = base64String(consultantUser.getId());
|
|
|
|
+ data.put("handSignature4",base64String);
|
|
|
|
+ }else{
|
|
|
|
+ data.put("handSignature4","");
|
|
|
|
+ }
|
|
|
|
+
|
|
data.put("zixunyuanName",consultantUser.getName());
|
|
data.put("zixunyuanName",consultantUser.getName());
|
|
data.put("consultantProfession1","");
|
|
data.put("consultantProfession1","");
|
|
data.put("consultantQualification1","");
|
|
data.put("consultantQualification1","");
|
|
@@ -2425,4 +2470,60 @@ public class RuralProjectMessageElectronicSealYCService extends CrudService<Rura
|
|
String id = dao.findZXYByName(Name);
|
|
String id = dao.findZXYByName(Name);
|
|
return id;
|
|
return id;
|
|
}
|
|
}
|
|
|
|
+ /**
|
|
|
|
+ * 根据用户id获取用户手签章并转换为base64字符串输出
|
|
|
|
+ * @param userIds
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public String base64String(String userIds){
|
|
|
|
+ String imageStr = "";
|
|
|
|
+ String path = null;
|
|
|
|
+ String fileName = null;
|
|
|
|
+ try {
|
|
|
|
+ String[] split = userIds.split(",");
|
|
|
|
+ List<String> userList = Arrays.asList(split);
|
|
|
|
+ WorkStaffBasicInfo workStaffBasicInfo = workStaffBasicInfoService.getWorkStaffBasicInfoByUserId(userList.get(0));
|
|
|
|
+ //判断人员的手签章是否存在
|
|
|
|
+ if(StringUtils.isNotBlank(workStaffBasicInfo.getHandSignature())){
|
|
|
|
+ String aliyunUrlStr = aliyunUrl + workStaffBasicInfo.getHandSignature();
|
|
|
|
+ //下载文件
|
|
|
|
+ if(System.getProperty("os.name").toLowerCase().contains("win")){
|
|
|
|
+ path = "D:/attachment-file/handSignature/";
|
|
|
|
+ }else{
|
|
|
|
+ path = "/attachment-file/handSignature/";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ String file = aliyunUrlStr;
|
|
|
|
+ file = file.replace("amp;","");
|
|
|
|
+ fileName = file.substring(file.lastIndexOf("/") + 1, file.length());
|
|
|
|
+ String aliyunUrl = Global.getAliyunUrl();
|
|
|
|
+ String aliDownloadUrl = Global.getAliDownloadUrl();
|
|
|
|
+ String cons = "";
|
|
|
|
+ if (file.contains(aliyunUrl)){
|
|
|
|
+ cons = aliyunUrl;
|
|
|
|
+ }else if (file.contains("http://gangwan-app.oss-cn-hangzhou.aliyuncs.com")){
|
|
|
|
+ cons = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com";
|
|
|
|
+ }else {
|
|
|
|
+ cons = aliDownloadUrl;
|
|
|
|
+ }
|
|
|
|
+ String ossKey = file.split(cons+"/")[1];
|
|
|
|
+ File filePath = new File(path);
|
|
|
|
+ if (!filePath.mkdirs()) {
|
|
|
|
+ filePath.mkdirs();
|
|
|
|
+ }
|
|
|
|
+ new OSSClientUtil().downByStreamSaveLocal(ossKey,fileName,path+fileName);
|
|
|
|
+ imageStr = ImageUtil.getImageStr(path+fileName);
|
|
|
|
+ }
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ e.getMessage();
|
|
|
|
+ }finally {
|
|
|
|
+ FileUtils.delFile(path+fileName);
|
|
|
|
+ }
|
|
|
|
+ if(StringUtils.isBlank(imageStr)){
|
|
|
|
+ imageStr = blankBase64;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return imageStr;
|
|
|
|
+ }
|
|
}
|
|
}
|