|
@@ -6,19 +6,31 @@ package com.jeeplus.modules.workfullmanage.service;
|
|
import com.google.common.base.Strings;
|
|
import com.google.common.base.Strings;
|
|
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.mapper.JsonMapper;
|
|
import com.jeeplus.common.mapper.JsonMapper;
|
|
|
|
+import com.jeeplus.common.oss.OSSClientUtil;
|
|
import com.jeeplus.common.persistence.Page;
|
|
import com.jeeplus.common.persistence.Page;
|
|
import com.jeeplus.common.service.CrudService;
|
|
import com.jeeplus.common.service.CrudService;
|
|
-import com.jeeplus.common.utils.MenuStatusEnum;
|
|
|
|
-import com.jeeplus.common.utils.StringUtils;
|
|
|
|
|
|
+import com.jeeplus.common.utils.*;
|
|
|
|
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
|
|
|
|
+import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
|
|
|
|
+import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectMessageElectronicSealDao;
|
|
|
|
+import com.jeeplus.modules.ruralprojectrecords.entity.ProjectReportSignatureInfo;
|
|
|
|
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
|
|
|
|
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralReportConsultant;
|
|
|
|
+import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageNewService;
|
|
|
|
+import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
|
|
import com.jeeplus.modules.sys.dao.AreaDao;
|
|
import com.jeeplus.modules.sys.dao.AreaDao;
|
|
import com.jeeplus.modules.sys.dao.RoleDao;
|
|
import com.jeeplus.modules.sys.dao.RoleDao;
|
|
import com.jeeplus.modules.sys.entity.Area;
|
|
import com.jeeplus.modules.sys.entity.Area;
|
|
|
|
+import com.jeeplus.modules.sys.entity.MainDictDetail;
|
|
import com.jeeplus.modules.sys.entity.User;
|
|
import com.jeeplus.modules.sys.entity.User;
|
|
import com.jeeplus.modules.sys.service.OfficeService;
|
|
import com.jeeplus.modules.sys.service.OfficeService;
|
|
|
|
+import com.jeeplus.modules.sys.service.UserService;
|
|
import com.jeeplus.modules.sys.service.WorkattachmentService;
|
|
import com.jeeplus.modules.sys.service.WorkattachmentService;
|
|
import com.jeeplus.modules.sys.utils.DictUtils;
|
|
import com.jeeplus.modules.sys.utils.DictUtils;
|
|
import com.jeeplus.modules.sys.utils.UserUtils;
|
|
import com.jeeplus.modules.sys.utils.UserUtils;
|
|
|
|
+import com.jeeplus.modules.tools.utils.TwoDimensionCode;
|
|
import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
|
|
import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
|
|
import com.jeeplus.modules.workclientinfo.dao.WorkClientLinkmanDao;
|
|
import com.jeeplus.modules.workclientinfo.dao.WorkClientLinkmanDao;
|
|
import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
|
|
import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
|
|
@@ -28,6 +40,7 @@ import com.jeeplus.modules.workclientinfo.service.WorkClientInfoService;
|
|
import com.jeeplus.modules.workcontractinfo.dao.WorkContractAnnexDao;
|
|
import com.jeeplus.modules.workcontractinfo.dao.WorkContractAnnexDao;
|
|
import com.jeeplus.modules.workcontractinfo.dao.WorkContractInfoDao;
|
|
import com.jeeplus.modules.workcontractinfo.dao.WorkContractInfoDao;
|
|
import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
|
|
import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
|
|
|
|
+import com.jeeplus.modules.workcontractinfo.service.WorkContractInfoService;
|
|
import com.jeeplus.modules.workfullexecute.dao.WorkFullExecuteDao;
|
|
import com.jeeplus.modules.workfullexecute.dao.WorkFullExecuteDao;
|
|
import com.jeeplus.modules.workfullexecute.entity.WorkFullExecute;
|
|
import com.jeeplus.modules.workfullexecute.entity.WorkFullExecute;
|
|
import com.jeeplus.modules.workfullmanage.dao.WorkFullConstructDao;
|
|
import com.jeeplus.modules.workfullmanage.dao.WorkFullConstructDao;
|
|
@@ -37,14 +50,20 @@ import com.jeeplus.modules.workfullmanage.dao.WorkFullSurveyDao;
|
|
import com.jeeplus.modules.workfullmanage.entity.WorkFullManage;
|
|
import com.jeeplus.modules.workfullmanage.entity.WorkFullManage;
|
|
import com.jeeplus.modules.workproject.entity.WorkProject;
|
|
import com.jeeplus.modules.workproject.entity.WorkProject;
|
|
import com.jeeplus.modules.workreimbursement.utils.VarStr;
|
|
import com.jeeplus.modules.workreimbursement.utils.VarStr;
|
|
|
|
+import com.jeeplus.modules.workstaff.entity.WorkStaffBasicInfo;
|
|
|
|
+import com.jeeplus.modules.workstaff.entity.WorkStaffCertificate;
|
|
|
|
+import com.jeeplus.modules.workstaff.service.WorkStaffBasicInfoService;
|
|
|
|
+import org.apache.commons.lang3.StringEscapeUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.HashMap;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
+import java.io.File;
|
|
|
|
+import java.math.BigDecimal;
|
|
|
|
+import java.text.DecimalFormat;
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -55,7 +74,20 @@ import java.util.Map;
|
|
@Service
|
|
@Service
|
|
@Transactional(readOnly = true)
|
|
@Transactional(readOnly = true)
|
|
public class WorkFullManageService extends CrudService<WorkFullManageDao, WorkFullManage> {
|
|
public class WorkFullManageService extends CrudService<WorkFullManageDao, WorkFullManage> {
|
|
|
|
+ //空白图片的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}")
|
|
|
|
+ private String serverDomain;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private WorkFullManageDao workFullManageDao;
|
|
private WorkFullManageDao workFullManageDao;
|
|
@@ -86,6 +118,22 @@ public class WorkFullManageService extends CrudService<WorkFullManageDao, WorkFu
|
|
@Autowired
|
|
@Autowired
|
|
private AreaDao areaDao;
|
|
private AreaDao areaDao;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private ProjectReportDataService projectReportDataService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private RuralProjectRecordsService ruralProjectRecordsService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private WorkContractInfoService workContractInfoService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private RuralProjectMessageNewService ruralProjectMessageNewService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private UserService userService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private WorkStaffBasicInfoService workStaffBasicInfoService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private RuralProjectMessageElectronicSealDao ruralProjectMessageElectronicSealDao;
|
|
|
|
+
|
|
public WorkFullManage getSimpleWorkFullManage(String id){
|
|
public WorkFullManage getSimpleWorkFullManage(String id){
|
|
return super.get(id);
|
|
return super.get(id);
|
|
}
|
|
}
|
|
@@ -468,4 +516,405 @@ public class WorkFullManageService extends CrudService<WorkFullManageDao, WorkFu
|
|
String resultJsonStr = JsonMapper.toJsonString(resultList);
|
|
String resultJsonStr = JsonMapper.toJsonString(resultList);
|
|
return resultJsonStr;
|
|
return resultJsonStr;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 质量流程控制单文件数据处理
|
|
|
|
+ * @param projectReportData
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public Map<String,Object> disposeProjectReportdata(ProjectReportData projectReportData){
|
|
|
|
+ //freemarker参数值准备
|
|
|
|
+ Map<String,Object> data = new LinkedHashMap<>();
|
|
|
|
+ //获取报告信息
|
|
|
|
+ projectReportData = projectReportDataService.findByNum(projectReportData.getNumber());
|
|
|
|
+ //获取项目信息
|
|
|
|
+ RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(projectReportData.getProject().getId());
|
|
|
|
+ ruralProjectRecordsService.queryProjectDetail(ruralProjectRecords);
|
|
|
|
+ // 将项目负责人替换为项目中的负责人
|
|
|
|
+ if(org.apache.commons.lang3.StringUtils.isNotBlank(ruralProjectRecords.getProjectMasterId())){
|
|
|
|
+ User user = UserUtils.get(ruralProjectRecords.getProjectMasterId());
|
|
|
|
+ projectReportData.setPrincipal(user);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //获取合同信息
|
|
|
|
+ WorkContractInfo workContractInfo = workContractInfoService.get(ruralProjectRecords.getWorkContractInfo().getId());
|
|
|
|
+ //无合同状态下,获取委托方的名称
|
|
|
|
+ if (workContractInfo == null) {
|
|
|
|
+ ruralProjectRecordsService.queryLinkmanInfos(ruralProjectRecords);
|
|
|
|
+ if (ruralProjectRecords.getWorkClientLinkmanList() != null && ruralProjectRecords.getWorkClientLinkmanList().size() > 0) {
|
|
|
|
+ WorkClientLinkman linkman = ruralProjectRecords.getWorkClientLinkmanList().get(0);
|
|
|
|
+ workContractInfo = new WorkContractInfo();
|
|
|
|
+ workContractInfo.setClient(linkman.getClientId());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ List<RuralReportConsultant> consultants = Lists.newArrayList();
|
|
|
|
+ //将自己添加到咨询员数据中
|
|
|
|
+ //根据用户查询技能信息(项目负责人信息)
|
|
|
|
+ RuralReportConsultant currentConsultant = new RuralReportConsultant();
|
|
|
|
+ //查询总审人员信息
|
|
|
|
+ RuralReportConsultant bzshbConsultant = new RuralReportConsultant();
|
|
|
|
+ List<WorkStaffCertificate> userCertificateList = Lists.newArrayList();
|
|
|
|
+ if(org.apache.commons.lang3.StringUtils.isNotBlank(ruralProjectRecords.getProjectMasterId())){
|
|
|
|
+ userCertificateList = ruralProjectMessageNewService.getCertificateByUser(ruralProjectRecords.getProjectMasterId());
|
|
|
|
+ }
|
|
|
|
+ //获取专业类型
|
|
|
|
+ List<MainDictDetail> certificateMajor = DictUtils.getMainDictList("certificate_major");
|
|
|
|
+ for (WorkStaffCertificate certificateInfo: userCertificateList) {
|
|
|
|
+ currentConsultant.setZhucezigezhID(certificateInfo.getNum());
|
|
|
|
+ currentConsultant.setZhucezigezhKey(certificateInfo.getName());
|
|
|
|
+ for (MainDictDetail type : certificateMajor) {
|
|
|
|
+ if(certificateInfo.getMajor().equals(type.getValue())){
|
|
|
|
+ currentConsultant.setMajor(type.getLabel());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ User currentUser=userService.get(ruralProjectRecords.getProjectMasterId());
|
|
|
|
+ currentConsultant.setZixunyuanName(currentUser.getName());
|
|
|
|
+ currentConsultant.setZixunyuan(currentUser.getId());
|
|
|
|
+ currentConsultant.setRole("负责人");
|
|
|
|
+ consultants.add(currentConsultant);
|
|
|
|
+ }
|
|
|
|
+ //根据项目id查找报告咨询员信息
|
|
|
|
+ List<RuralReportConsultant> consultantList = ruralProjectMessageNewService.getConsultantsList(ruralProjectRecords.getId());
|
|
|
|
+ Iterator<RuralReportConsultant> it = consultantList.iterator();
|
|
|
|
+ while(it.hasNext()){
|
|
|
|
+ RuralReportConsultant consultant = it.next();
|
|
|
|
+ String auditOpinion = consultant.getAuditOpinion().replaceAll(" ","");
|
|
|
|
+ consultant.setAuditOpinion(auditOpinion);
|
|
|
|
+ if(consultant.getZixunyuan().equals(currentConsultant.getZixunyuan())){
|
|
|
|
+ try {
|
|
|
|
+ MyBeanUtils.copyBeanNotNull2Bean(consultant, currentConsultant);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ it.remove();
|
|
|
|
+ }else if(consultant.getZixunyuan().equals(projectReportData.getBzshbUserId())){
|
|
|
|
+ List<WorkStaffCertificate> bzshbCertificateList = ruralProjectMessageNewService.getCertificateByUser(projectReportData.getBzshbUserId());
|
|
|
|
+ for (WorkStaffCertificate certificateInfo: bzshbCertificateList) {
|
|
|
|
+ bzshbConsultant.setZhucezigezhID(certificateInfo.getNum());
|
|
|
|
+ bzshbConsultant.setZhucezigezhKey(certificateInfo.getName());
|
|
|
|
+ for (MainDictDetail dictType : certificateMajor) {
|
|
|
|
+ if(certificateInfo.getMajor().equals(dictType.getValue())){
|
|
|
|
+ bzshbConsultant.setMajor(dictType.getLabel());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ User bzshbUser=userService.get(projectReportData.getBzshbUserId());
|
|
|
|
+ bzshbConsultant.setZixunyuanName(bzshbUser.getName());
|
|
|
|
+ bzshbConsultant.setZixunyuan(bzshbUser.getId());
|
|
|
|
+ bzshbConsultant.setRole("技术负责人");
|
|
|
|
+ }
|
|
|
|
+ try {
|
|
|
|
+ MyBeanUtils.copyBeanNotNull2Bean(consultant, bzshbConsultant);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ it.remove();
|
|
|
|
+ }else{
|
|
|
|
+ //根据用户查询技能信息
|
|
|
|
+ List<WorkStaffCertificate> certificateList = ruralProjectMessageNewService.getCertificateByUser(consultant.getZixunyuan());
|
|
|
|
+ for (WorkStaffCertificate certificateInfo: certificateList) {
|
|
|
|
+ if(certificateInfo.getName().equals(consultant.getZhucezigezhKey())){
|
|
|
|
+ consultant.setZhucezigezhID(certificateInfo.getNum());
|
|
|
|
+ }
|
|
|
|
+ for (MainDictDetail type : certificateMajor) {
|
|
|
|
+ if(certificateInfo.getMajor().equals(type.getValue())){
|
|
|
|
+ consultant.setMajor(type.getLabel());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ User user=userService.get(consultant.getZixunyuan());
|
|
|
|
+ consultant.setZixunyuanName(user.getName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ consultants.addAll(consultantList);
|
|
|
|
+
|
|
|
|
+ //如果项目负责人名称为空
|
|
|
|
+ if(org.apache.commons.lang3.StringUtils.isBlank(bzshbConsultant.getZixunyuanName())){
|
|
|
|
+ User user=userService.get(projectReportData.getBzshbUserId());
|
|
|
|
+ if(null == user){
|
|
|
|
+ bzshbConsultant.setZixunyuanName("");
|
|
|
|
+ }else{
|
|
|
|
+ bzshbConsultant.setZixunyuanName(user.getName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /*//获取专业类型
|
|
|
|
+ List<MainDictDetail> certificateMajor = DictUtils.getMainDictList("certificate_major");*/
|
|
|
|
+ //根据 职业资格名称查询字典表并比对当前人员是否已添加该职业资格信息
|
|
|
|
+ List<MainDictDetail> certificateType = DictUtils.getMainDictList("certificate_type");
|
|
|
|
+ for (RuralReportConsultant entity: consultants) {
|
|
|
|
+ for (MainDictDetail type : certificateType) {
|
|
|
|
+ if(entity.getZhucezigezhKey().equals(type.getValue())){
|
|
|
|
+ entity.setZhucezigezh(type.getLabel());
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(org.apache.commons.lang3.StringUtils.isBlank(entity.getZhucezigezh())){
|
|
|
|
+ entity.setZhucezigezh("");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<MainDictDetail> mainDictList = Lists.newArrayList();
|
|
|
|
+ //工程咨询
|
|
|
|
+ if("1".equals(ruralProjectRecords.getProjectType())){
|
|
|
|
+ mainDictList = DictUtils.getMainDictList("attachment_project_sort");
|
|
|
|
+ //造价审核
|
|
|
|
+ } else if("2".equals(ruralProjectRecords.getProjectType())){
|
|
|
|
+ mainDictList = DictUtils.getMainDictList("attachment_project_sort_cost");
|
|
|
|
+ }
|
|
|
|
+ data.put("projectType","");
|
|
|
|
+ if(StringUtils.isNotBlank(ruralProjectRecords.getAttachmentProjectSort())){
|
|
|
|
+ //处理项目类别
|
|
|
|
+ for (MainDictDetail info: mainDictList) {
|
|
|
|
+ if(ruralProjectRecords.getAttachmentProjectSort().equals(info.getValue())){
|
|
|
|
+ data.put("projectType",info.getLabel());
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ String consultType = "";
|
|
|
|
+ if(StringUtils.isNotBlank(ruralProjectRecords.getAttachmentProjectSort())){
|
|
|
|
+ //处理项目类别
|
|
|
|
+ for (MainDictDetail info: mainDictList) {
|
|
|
|
+ if(ruralProjectRecords.getAttachmentProjectSort().equals(info.getValue())){
|
|
|
|
+ consultType = info.getLabel();
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(org.apache.commons.lang3.StringUtils.isBlank(projectReportData.getNumber())){
|
|
|
|
+ data.put("number","");
|
|
|
|
+ }else{
|
|
|
|
+ data.put("number",projectReportData.getNumber()+" 号");
|
|
|
|
+ }
|
|
|
|
+ //项目名称含html转义字符的进行处理
|
|
|
|
+ String newJson = StringEscapeUtils.unescapeHtml4(ruralProjectRecords.getProjectName());
|
|
|
|
+ data.put("projectName",newJson);
|
|
|
|
+ //咨询类别
|
|
|
|
+ data.put("consultType",consultType);
|
|
|
|
+ //委托单位
|
|
|
|
+ if(null != workContractInfo){
|
|
|
|
+ if (null != workContractInfo.getClient()) {
|
|
|
|
+ if(org.apache.commons.lang3.StringUtils.isNotBlank(workContractInfo.getClient().getName())){
|
|
|
|
+ data.put("entrustUnit",workContractInfo.getClient().getName());
|
|
|
|
+ data.put("entrustingParty",workContractInfo.getClient().getName());
|
|
|
|
+ }else{
|
|
|
|
+ data.put("entrustUnit","");
|
|
|
|
+ data.put("entrustingParty","");
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ data.put("entrustUnit","");
|
|
|
|
+ data.put("entrustingParty","");
|
|
|
|
+ }
|
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isNotBlank(workContractInfo.getContractNum())){
|
|
|
|
+ data.put("contractNumber",workContractInfo.getContractNum());
|
|
|
|
+ }else{
|
|
|
|
+ data.put("contractNumber","");
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ data.put("entrustUnit","");
|
|
|
|
+ data.put("contractNumber","");
|
|
|
|
+ }
|
|
|
|
+ data.put("projectMaster",ruralProjectRecords.getLeaderNameStr());
|
|
|
|
+ //如果项目负责人不为空,则对项目负责人(第一个)进行获取签字章并存储
|
|
|
|
+ if(org.apache.commons.lang3.StringUtils.isNotBlank(ruralProjectRecords.getProjectMasterId())){
|
|
|
|
+ String base64String = base64String(ruralProjectRecords.getProjectMasterId());
|
|
|
|
+ data.put("handSignature3",base64String);
|
|
|
|
+ }else{
|
|
|
|
+ data.put("handSignature3",blankBase64);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //查询杨荣华杨所的用户信息
|
|
|
|
+ User yrhUser = UserUtils.getByUserName("杨荣华");
|
|
|
|
+ if(org.apache.commons.lang3.StringUtils.isNotBlank(yrhUser.getId())){
|
|
|
|
+ String base64String = base64String(yrhUser.getId());
|
|
|
|
+ data.put("handSignature1",base64String);
|
|
|
|
+ }else{
|
|
|
|
+ data.put("handSignature1",blankBase64);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //查询陈红星陈总的用户信息
|
|
|
|
+ User chxUser = UserUtils.getByUserName("陈红星");
|
|
|
|
+ if(org.apache.commons.lang3.StringUtils.isNotBlank(chxUser.getId())){
|
|
|
|
+ String base64String = base64String(chxUser.getId());
|
|
|
|
+ data.put("handSignature2",base64String);
|
|
|
|
+ }else{
|
|
|
|
+ data.put("handSignature2",blankBase64);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //咨询员信息
|
|
|
|
+ if(null != consultants && consultants.size()>0){
|
|
|
|
+ data.put("consultantName0",consultants.get(0).getZixunyuanName());
|
|
|
|
+ data.put("consultantProfession0",consultants.get(0).getMajor());
|
|
|
|
+ data.put("consultantQualification0",consultants.get(0).getZhucezigezh());
|
|
|
|
+ }else{
|
|
|
|
+ data.put("consultantName0","");
|
|
|
|
+ data.put("consultantProfession0","");
|
|
|
|
+ data.put("consultantQualification0","");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //查询签章数据信息
|
|
|
|
+ ProjectReportSignatureInfo projectReportSignatureInfo = ruralProjectMessageElectronicSealDao.get(projectReportData.getNumber());
|
|
|
|
+
|
|
|
|
+ //根据咨询员id查询咨询员信息以及咨询员的专业和资格
|
|
|
|
+ if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getConsultant())){
|
|
|
|
+ RuralReportConsultant consultantUserConsultant = new RuralReportConsultant();
|
|
|
|
+ User consultantUser = UserUtils.get(projectReportSignatureInfo.getConsultant());
|
|
|
|
+ data.put("consultantName1",consultantUser.getName());
|
|
|
|
+
|
|
|
|
+ //如果咨询员不为空,则对项咨询员进行获取签字章并存储
|
|
|
|
+ if(org.apache.commons.lang3.StringUtils.isNotBlank(consultantUser.getId())){
|
|
|
|
+ String base64String = base64String(consultantUser.getId());
|
|
|
|
+ data.put("handSignature4",base64String);
|
|
|
|
+ }else{
|
|
|
|
+ data.put("handSignature4","");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ data.put("zixunyuanName",consultantUser.getName());
|
|
|
|
+ data.put("consultantProfession1","");
|
|
|
|
+ data.put("consultantQualification1","");
|
|
|
|
+ List<WorkStaffCertificate> certificateByUser = ruralProjectMessageNewService.getCertificateByUser(consultantUser.getId());
|
|
|
|
+ for (WorkStaffCertificate certificateInfo: certificateByUser) {
|
|
|
|
+ consultantUserConsultant.setZhucezigezhID(certificateInfo.getNum());
|
|
|
|
+ consultantUserConsultant.setZhucezigezhKey(certificateInfo.getName());
|
|
|
|
+ for (MainDictDetail type : certificateMajor) {
|
|
|
|
+ if(certificateInfo.getMajor().equals(type.getValue())){
|
|
|
|
+ data.put("consultantProfession1",type.getLabel());
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for (MainDictDetail type : certificateType) {
|
|
|
|
+ if(consultantUserConsultant.getZhucezigezhKey().equals(type.getValue())){
|
|
|
|
+ data.put("consultantQualification1",type.getLabel());
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ data.put("zixunyuanName","");
|
|
|
|
+ data.put("consultantName1","");
|
|
|
|
+ data.put("consultantProfession1","");
|
|
|
|
+ data.put("consultantQualification1","");
|
|
|
|
+ data.put("handSignature4",blankBase64);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //咨询报告日期
|
|
|
|
+ if(null != projectReportSignatureInfo && null != projectReportSignatureInfo.getStampDate()){
|
|
|
|
+ data.put("projectReportDate",dateStr(projectReportSignatureInfo.getStampDate()));
|
|
|
|
+ }else{
|
|
|
|
+ data.put("projectReportDate","");
|
|
|
|
+ }
|
|
|
|
+ //咨询作业期处理
|
|
|
|
+ data.put("consultOperationalPeriod","");
|
|
|
|
+ if(null != projectReportSignatureInfo && null!= projectReportSignatureInfo.getAgreedStartDate() && null != projectReportSignatureInfo.getAgreedEndDate()){
|
|
|
|
+ String startDateStr = dateStr(projectReportSignatureInfo.getAgreedStartDate());
|
|
|
|
+ String endingDateStr = dateStr(projectReportSignatureInfo.getAgreedEndDate());
|
|
|
|
+ data.put("consultOperationalPeriod",startDateStr + "至" + endingDateStr);
|
|
|
|
+ }else{
|
|
|
|
+ data.put("consultOperationalPeriod","");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(null != currentConsultant && org.apache.commons.lang3.StringUtils.isNotBlank(currentConsultant.getZixunyuanName())){
|
|
|
|
+ //项目负责人
|
|
|
|
+ data.put("projectMaster",currentConsultant.getZixunyuanName());
|
|
|
|
+ }else{
|
|
|
|
+ //项目负责人
|
|
|
|
+ data.put("projectMaster","");
|
|
|
|
+ }
|
|
|
|
+ //咨询项目委托方全称
|
|
|
|
+ data.put("querySite","ccpm.xgccpm.com");
|
|
|
|
+
|
|
|
|
+ String querySite = serverDomain+"/ruralProject/ruralProjectRecords/getDownloadProjectView?id="+projectReportData.getProject().getId();
|
|
|
|
+ //生成二维码图片和doc文档 缓存文件的共用名称
|
|
|
|
+ String commonFileName = UUID.randomUUID().toString();
|
|
|
|
+ String tempPath = this.getClass().getResource("/").getPath()+"/temp/";
|
|
|
|
+ File temP = new File(tempPath);
|
|
|
|
+ if(!temP.exists()){
|
|
|
|
+ temP.mkdirs();
|
|
|
|
+ }
|
|
|
|
+ String qrCodePath = tempPath + commonFileName + ".png";
|
|
|
|
+ TwoDimensionCode.encoderQRCode(querySite, qrCodePath, "png");//执行生成二维码
|
|
|
|
+ String imageStr = ImageUtil.getImageStr(qrCodePath);
|
|
|
|
+ data.put("qrcode",imageStr);
|
|
|
|
+
|
|
|
|
+ return data;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 根据用户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(org.apache.commons.lang3.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(org.apache.commons.lang3.StringUtils.isBlank(imageStr)){
|
|
|
|
+ imageStr = blankBase64;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return imageStr;
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * date转String
|
|
|
|
+ * @param date
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ private String dateStr(Date date){
|
|
|
|
+ String pattern = "yyyy年MM月dd日";
|
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);
|
|
|
|
+ String format = simpleDateFormat.format(date);
|
|
|
|
+ return format;
|
|
|
|
+ }
|
|
}
|
|
}
|