|
@@ -8,14 +8,19 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.EncryptUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.jeeplus.business.finance.util.Global;
|
|
|
import com.jeeplus.business.project.domain.*;
|
|
|
import com.jeeplus.business.project.mapper.*;
|
|
|
import com.jeeplus.business.project.service.dto.*;
|
|
|
import com.jeeplus.business.project.service.mapstruct.*;
|
|
|
+import com.jeeplus.business.project.utils.FileUtils;
|
|
|
+import com.jeeplus.business.project.utils.ImageUtil;
|
|
|
import com.jeeplus.business.useSeal.domain.Signet;
|
|
|
import com.jeeplus.business.useSeal.mapper.SignetMapper;
|
|
|
+import com.jeeplus.business.useSeal.service.dto.SignetDTO;
|
|
|
import com.jeeplus.business.workClientInfo.domain.JyWorkClientInfo;
|
|
|
import com.jeeplus.business.workClientInfo.domain.JyWorkClientLinkman;
|
|
|
import com.jeeplus.business.workClientInfo.mapper.JyWorkClientInfoMapper;
|
|
@@ -36,16 +41,19 @@ import com.jeeplus.sys.feign.IWorkAttachmentApi;
|
|
|
import com.jeeplus.sys.service.dto.DictValueDTO;
|
|
|
import com.jeeplus.sys.service.dto.UserDTO;
|
|
|
import com.jeeplus.sys.service.dto.WorkAttachmentInfoDTO;
|
|
|
+
|
|
|
import org.apache.commons.compress.utils.Lists;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.io.File;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
@@ -56,6 +64,25 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
|
public class JyProjectService {
|
|
|
+ private final String base64Black = "iVBORw0KGgoAAAANSUhEUgAAAQkAAACDCAYAAACeNO5uAAAAAXN\n" +
|
|
|
+ "SR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5m\n" +
|
|
|
+ "H3gAAAGASURBVHhe7dSBAAAADASh+Uv/DI6gILoBBEkASRJAkgSQJAEkSQB\n" +
|
|
|
+ "JEkCSBJAkASRJAEkSQJIEkCQBJEkASRJAkgSQJAEkSQBJEkCSBJAkASRJ\n" +
|
|
|
+ "AEkSQJIEkCQBJEkASRJAkgSQJAEkSQBJEkCSBJAkASRJAEkSQJIEkCQBJE\n" +
|
|
|
+ "kASRJAkgSQJAEkSQBJEkCSBJAkASRJAEkSQJIEkCQBJEkASRJAkgSQJAEk\n" +
|
|
|
+ "SQBJEkCSBJAkASRJAEkSQJIEkCQBJEkASRJAkgSQJAEkSQBJEkCSBJAkAS\n" +
|
|
|
+ "RJAEkSQJIEkCQBJEkASRJAkgSQJAEkSQBJEkCSBJAkASRJAEkSQJIEkCQB\n" +
|
|
|
+ "JEkASRJAkgSQJAEkSQBJEkCSBJAkASRJAEkSQJIEkCQBJEkASRJAkgSQJA\n" +
|
|
|
+ "EkSQBJEkCSBJAkASRJAEkSQJIEkCQBJEkASRJAkgSQJAEkSQBJEkCSBJAkA\n" +
|
|
|
+ "SRJAEkSQJIEkCQBJEkASRJAkgSQJAEkSQBJEkCSBJAkASRJAEkSQNgeLFltOQ4ygBYAAAAASUVORK5CYII=";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 阿里云文件服务器前缀
|
|
|
+ */
|
|
|
+// @Value("${config.accessory.aliyun.aliyunUrl}")
|
|
|
+// private String aliyunUrl;
|
|
|
+// @Value("${config.accessory.aliyun.aliyunDownloadUrl}")
|
|
|
+// private String aliyunDownloadUrl;
|
|
|
|
|
|
@Resource
|
|
|
private JyProjectMapper jyProjectMapper;
|
|
@@ -687,6 +714,11 @@ public class JyProjectService {
|
|
|
//设置项目登记通过的时间
|
|
|
jyProjectAudit.setProjectAgreeTime(byId.getUpdateTime());
|
|
|
jyProjectAuditMapper.updateById(jyProjectAudit);
|
|
|
+ //修改项目登记审核时间
|
|
|
+ JyProject jyProject = new JyProject();
|
|
|
+ jyProject.setAuditTime(new Date());
|
|
|
+ jyProject.setId(byId.getId());
|
|
|
+ jyProjectMapper.updateById(jyProject);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -834,6 +866,12 @@ public class JyProjectService {
|
|
|
jyProjectAudit.setInitialEditOpinion(edit);
|
|
|
jyProjectAudit.setEditOpinion("");
|
|
|
}
|
|
|
+ //审核通过时,将审核通过意见单独进行保存
|
|
|
+ if ("5".equals(jyProjectAuditDTO.getStatus())){
|
|
|
+ if (StringUtils.isNotBlank(jyProjectAuditDTO.getAuditOpinion())){
|
|
|
+ jyProjectAudit.setAuditAgreeOpinion(jyProjectAuditDTO.getAuditOpinion());
|
|
|
+ }
|
|
|
+ }
|
|
|
jyProjectAudit.setAuditPeople(jyProjectAuditDTO.getAuditPeople());
|
|
|
if (StringUtils.isNotBlank(jyProjectAudit.getId())){
|
|
|
jyProjectAuditMapper.updateById(jyProjectAudit);
|
|
@@ -975,6 +1013,19 @@ public class JyProjectService {
|
|
|
data.put("otherPeople","/");
|
|
|
//根据项目id获取到所有的校审信息
|
|
|
List<JyProjectAuditDTO> jyProjectAuditDTOS=jyProjectAuditMapper.getByProjectId(info.getProjectId());
|
|
|
+ //根据项目id查询报告签发信息
|
|
|
+ SignetDTO signet=signetMapper.getByProjectId(info.getProjectId());
|
|
|
+ String auditHandSignet = "";//报告签发最后一级节点审核人手签章
|
|
|
+ Date approvalTime = null;//审核通过时间
|
|
|
+ //signet 不为空时说明报告签发流程审核结束,此时可以获取到最后一个节点审核人及审核通过时间
|
|
|
+ if (ObjectUtil.isNotEmpty(signet)){
|
|
|
+ UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getById(signet.getUpdateById());
|
|
|
+ //判断审核人是否有手签章
|
|
|
+ if (StringUtils.isNotBlank(userDTO.getHandSignatureUrl())){
|
|
|
+ auditHandSignet =base64String(userDTO.getHandSignatureUrl());
|
|
|
+ }
|
|
|
+ approvalTime = signet.getApprovalTime();
|
|
|
+ }
|
|
|
//如果存在审核意见则进行处理
|
|
|
if(null != jyProjectAuditDTOS){
|
|
|
if (jyProjectAuditDTOS.size()>=1){
|
|
@@ -998,8 +1049,11 @@ public class JyProjectService {
|
|
|
//审核人
|
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(0).getAuditPeople())){
|
|
|
data.put("firstAuditPeople",SpringUtil.getBean(IUserApi.class).getById(jyProjectAuditDTOS.get(0).getAuditPeople()).getName());
|
|
|
+ data.put("firstAgreeName",SpringUtil.getBean(IUserApi.class).getById(jyProjectAuditDTOS.get(0).getAuditPeople()).getName());
|
|
|
}else {
|
|
|
data.put("firstAuditPeople","");
|
|
|
+ data.put("firstAgreeName","");
|
|
|
+
|
|
|
|
|
|
}
|
|
|
//日期
|
|
@@ -1007,9 +1061,11 @@ public class JyProjectService {
|
|
|
if (null == jyProjectAuditDTOS.get(0).getUpdateTime()){
|
|
|
data.put("firstAuditDate","");
|
|
|
data.put("firstDate","");
|
|
|
+ data.put("firstAgreeDate","");
|
|
|
}else {
|
|
|
data.put("firstAuditDate",format);
|
|
|
data.put("firstDate",format);
|
|
|
+ data.put("firstAgreeDate",format);
|
|
|
}
|
|
|
//修改意见
|
|
|
ArrayList<String> strings1 = new ArrayList<>();
|
|
@@ -1035,9 +1091,11 @@ public class JyProjectService {
|
|
|
data.put("firstName","");
|
|
|
}
|
|
|
//校核修改结果认可意见及签名和日期
|
|
|
- data.put("firstAgreeOpinion","");
|
|
|
- data.put("firstAgreeName","");
|
|
|
- data.put("firstAgreeDate","");
|
|
|
+ if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(0).getAuditAgreeOpinion())){
|
|
|
+ data.put("firstAgreeOpinion",jyProjectAuditDTOS.get(0).getAuditAgreeOpinion());
|
|
|
+ }else {
|
|
|
+ data.put("firstAgreeOpinion","已复核");
|
|
|
+ }
|
|
|
|
|
|
//审核意见和修改意见长度比较,然后将双方长度变为一致
|
|
|
if (strings.size()<strings1.size()){
|
|
@@ -1078,17 +1136,22 @@ public class JyProjectService {
|
|
|
//审核人
|
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(1).getAuditPeople())){
|
|
|
data.put("secondAuditPeople",SpringUtil.getBean(IUserApi.class).getById(jyProjectAuditDTOS.get(1).getAuditPeople()).getName());
|
|
|
+ data.put("secondAgreeName",SpringUtil.getBean(IUserApi.class).getById(jyProjectAuditDTOS.get(1).getAuditPeople()).getName());
|
|
|
}else {
|
|
|
data.put("secondAuditPeople","");
|
|
|
+ data.put("secondAgreeName","");//审核人
|
|
|
+
|
|
|
}
|
|
|
//日期
|
|
|
String format = sdf.format(jyProjectAuditDTOS.get(1).getUpdateTime());
|
|
|
if (null == jyProjectAuditDTOS.get(1).getUpdateTime()){
|
|
|
data.put("secondAuditDate","");
|
|
|
data.put("secondDate","");
|
|
|
+ data.put("secondAgreeDate","");
|
|
|
}else {
|
|
|
data.put("secondAuditDate",format);
|
|
|
data.put("secondDate",format);
|
|
|
+ data.put("secondAgreeDate",format);//审核同意时间
|
|
|
}
|
|
|
//修改意见
|
|
|
ArrayList<String> strings1 = new ArrayList<>();
|
|
@@ -1113,9 +1176,12 @@ public class JyProjectService {
|
|
|
data.put("secondName","");
|
|
|
}
|
|
|
//校核修改结果认可意见
|
|
|
- data.put("secondAgreeOpinion","");
|
|
|
- data.put("secondAgreeName","");
|
|
|
- data.put("secondAgreeDate","");
|
|
|
+ if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(1).getAuditAgreeOpinion())){
|
|
|
+ data.put("secondAgreeOpinion",jyProjectAuditDTOS.get(1).getAuditAgreeOpinion());
|
|
|
+ }else {
|
|
|
+ data.put("secondAgreeOpinion","已复核");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
//审核意见和修改意见长度比较,然后将双方长度变为一致
|
|
|
if (strings.size()<strings1.size()){
|
|
@@ -1155,17 +1221,25 @@ public class JyProjectService {
|
|
|
//审核人
|
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(2).getAuditPeople())){
|
|
|
data.put("thirdAuditPeople",SpringUtil.getBean(IUserApi.class).getById(jyProjectAuditDTOS.get(2).getAuditPeople()).getName());
|
|
|
+ data.put("thirdAgreeName",SpringUtil.getBean(IUserApi.class).getById(jyProjectAuditDTOS.get(2).getAuditPeople()).getName());
|
|
|
+
|
|
|
}else {
|
|
|
data.put("thirdAuditPeople","");
|
|
|
+ data.put("thirdAgreeName","");
|
|
|
+
|
|
|
}
|
|
|
//日期
|
|
|
String format = sdf.format(jyProjectAuditDTOS.get(2).getUpdateTime());
|
|
|
if (null == jyProjectAuditDTOS.get(2).getUpdateTime()){
|
|
|
data.put("thirdAuditDate","");
|
|
|
data.put("thirdDate","");
|
|
|
+ data.put("thirdAgreeDate","");
|
|
|
+ }else {
|
|
|
+ data.put("thirdAuditDate",format);
|
|
|
+ data.put("thirdDate",format);
|
|
|
+ data.put("thirdAgreeDate",format);
|
|
|
}
|
|
|
- data.put("thirdAuditDate",format);
|
|
|
- data.put("thirdDate",format);
|
|
|
+
|
|
|
//修改意见
|
|
|
ArrayList<String> strings1 = Lists.newArrayList();
|
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(2).getInitialEditOpinion())){
|
|
@@ -1190,9 +1264,12 @@ public class JyProjectService {
|
|
|
data.put("thirdName","");
|
|
|
}
|
|
|
//校核修改结果认可意见
|
|
|
- data.put("thirdAgreeOpinion","");
|
|
|
- data.put("thirdAgreeName","");
|
|
|
- data.put("thirdAgreeDate","");
|
|
|
+ if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(2).getAuditAgreeOpinion())){
|
|
|
+ data.put("thirdAgreeOpinion",jyProjectAuditDTOS.get(2).getAuditAgreeOpinion());
|
|
|
+ }else {
|
|
|
+ data.put("thirdAgreeOpinion","已复核");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
//审核意见和修改意见长度比较,然后将双方长度变为一致
|
|
|
if (strings.size()<strings1.size()){
|
|
@@ -1211,9 +1288,20 @@ public class JyProjectService {
|
|
|
|
|
|
}
|
|
|
//签发人
|
|
|
- data.put("submitPeople","");
|
|
|
+ if (StringUtils.isNotBlank(auditHandSignet)){
|
|
|
+ data.put("submitPeople",auditHandSignet);
|
|
|
+ }else {
|
|
|
+ data.put("submitPeople",base64Black);
|
|
|
+ }
|
|
|
//签发日期
|
|
|
- data.put("submitDate","");
|
|
|
+ if (ObjectUtil.isNotEmpty(approvalTime)){
|
|
|
+ String format = sdf.format(approvalTime);
|
|
|
+ data.put("submitDate",format);
|
|
|
+ }else {
|
|
|
+ data.put("submitDate","");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}else{
|
|
|
//一级复核意见
|
|
|
data.put("firstAuditList","");
|
|
@@ -1278,6 +1366,57 @@ public class JyProjectService {
|
|
|
return data;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ *将用户手签章图片转换为base64字符串输出
|
|
|
+ */
|
|
|
+ public String base64String(String handSignature){
|
|
|
+ String imageStr = "";
|
|
|
+ String path = null;
|
|
|
+ String fileName = null;
|
|
|
+
|
|
|
+ String aliyunUrl = "http://cdn.gangwaninfo.com";
|
|
|
+ String aliDownloadUrl = "http://oss.gangwaninfo.com";
|
|
|
+
|
|
|
+ try {
|
|
|
+ String aliyunUrlStr = aliyunUrl + handSignature;
|
|
|
+ //下载文件
|
|
|
+ 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 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();
|
|
|
+ }
|
|
|
+ SpringUtil.getBean(IWorkAttachmentApi.class).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 = base64Black;
|
|
|
+ }
|
|
|
+ return imageStr;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 根据id查询外审信息
|
|
|
* @param id
|
|
@@ -1348,7 +1487,7 @@ public class JyProjectService {
|
|
|
String workAttachmentDtoInfo = JSON.toJSONString(workAttachmentDto);
|
|
|
String userDTOInfo = JSON.toJSONString(userDTO);
|
|
|
String attachmentId = jyProjectOutinstance.getId();
|
|
|
- String attachmentFlag = "jyProjectOut";
|
|
|
+ String attachmentFlag = item.getAttachmentFlag();
|
|
|
String sortInfo = Integer.toString(sort.get());
|
|
|
map.put("workAttachmentDtoInfo",workAttachmentDtoInfo);
|
|
|
map.put("userDTOInfo",userDTOInfo);
|
|
@@ -1719,7 +1858,7 @@ public class JyProjectService {
|
|
|
* @return
|
|
|
*/
|
|
|
public JyProjectArchiveDTO findByIdArchive(String id) {
|
|
|
- //根据id获取外审信息
|
|
|
+ //根据id获取归档信息
|
|
|
JyProjectArchiveDTO jyProjectArchiveDTO=jyProjectArchiveMapper.findById(id);
|
|
|
|
|
|
if (null != jyProjectArchiveDTO){
|
|
@@ -1750,12 +1889,20 @@ public class JyProjectService {
|
|
|
//代码转化,将dto中的对象赋到实体类中
|
|
|
JyProjectArchive jyProjectArchive = JyProjectArchiveWrapper.INSTANCE.toEntity(jyProjectArchiveDTO);
|
|
|
//获取审核信息
|
|
|
- JyProjectOutinstanceDTO byId = jyProjectOutinstanceMapper.findById(jyProjectArchive.getId());
|
|
|
+ JyProjectArchiveDTO byId = jyProjectArchiveMapper.findById(jyProjectArchive.getId());
|
|
|
if (ObjectUtil.isNotEmpty(byId)){
|
|
|
if (StringUtils.isNotBlank(jyProjectArchive.getRemarks())){
|
|
|
jyProjectArchive.setRemarks(jyProjectArchiveDTO.getRemarks());
|
|
|
}
|
|
|
}
|
|
|
+ //归档盒号
|
|
|
+ if (StringUtils.isNotBlank(jyProjectArchiveDTO.getCaseNumber())){
|
|
|
+ jyProjectArchive.setCaseNumber(jyProjectArchiveDTO.getCaseNumber());
|
|
|
+ }
|
|
|
+ //添加审核时间
|
|
|
+ if ("5".equals(jyProjectArchiveDTO.getStatus())){
|
|
|
+ jyProjectArchive.setAuditTime(new Date());
|
|
|
+ }
|
|
|
if (StringUtils.isNotBlank(jyProjectArchive.getId())){
|
|
|
jyProjectArchiveMapper.updateById(jyProjectArchive);
|
|
|
}else{
|
|
@@ -1847,7 +1994,7 @@ public class JyProjectService {
|
|
|
//代码转化,将dto中的对象赋到实体类中
|
|
|
JyProjectEiaQualification jyProjectEiaQualification = JyProjectEiaQualificationWrapper.INSTANCE.toEntity(jyProjectEiaQualificationDTO);
|
|
|
//获取审核信息
|
|
|
- JyProjectOutinstanceDTO byId = jyProjectOutinstanceMapper.findById(jyProjectEiaQualification.getId());
|
|
|
+ JyProjectEiaQualificationDTO byId=jyProjectEiaQualificationMapper.findById(jyProjectEiaQualification.getId());
|
|
|
if (ObjectUtil.isNotEmpty(byId)){
|
|
|
if (StringUtils.isNotBlank(jyProjectEiaQualification.getRemarks())){
|
|
|
jyProjectEiaQualification.setRemarks(jyProjectEiaQualificationDTO.getRemarks());
|