|
@@ -12,14 +12,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.jeeplus.assess.workContract.mapper.WorkContractInfoMapper;
|
|
import com.jeeplus.assess.workContract.mapper.WorkContractInfoMapper;
|
|
import com.jeeplus.business.project.domain.*;
|
|
import com.jeeplus.business.project.domain.*;
|
|
import com.jeeplus.business.project.mapper.*;
|
|
import com.jeeplus.business.project.mapper.*;
|
|
-import com.jeeplus.business.project.service.dto.JyProjectAuditDTO;
|
|
|
|
-import com.jeeplus.business.project.service.dto.JyProjectDTO;
|
|
|
|
-import com.jeeplus.business.project.service.dto.JyProjectOutinstanceDTO;
|
|
|
|
|
|
+import com.jeeplus.business.project.service.dto.*;
|
|
|
|
+import com.jeeplus.business.project.service.mapstruct.JyProjectArchiveWrapper;
|
|
import com.jeeplus.business.project.service.mapstruct.JyProjectAuditWrapper;
|
|
import com.jeeplus.business.project.service.mapstruct.JyProjectAuditWrapper;
|
|
import com.jeeplus.business.project.service.mapstruct.JyProjectOutInstanceWrapper;
|
|
import com.jeeplus.business.project.service.mapstruct.JyProjectOutInstanceWrapper;
|
|
import com.jeeplus.business.useSeal.domain.Signet;
|
|
import com.jeeplus.business.useSeal.domain.Signet;
|
|
import com.jeeplus.business.useSeal.mapper.SignetMapper;
|
|
import com.jeeplus.business.useSeal.mapper.SignetMapper;
|
|
-import com.jeeplus.business.useSeal.service.SignetService;
|
|
|
|
|
|
+import com.jeeplus.business.workClientInfo.domain.JyWorkClientInfo;
|
|
import com.jeeplus.business.workClientInfo.domain.JyWorkClientLinkman;
|
|
import com.jeeplus.business.workClientInfo.domain.JyWorkClientLinkman;
|
|
import com.jeeplus.business.workClientInfo.mapper.JyWorkClientInfoMapper;
|
|
import com.jeeplus.business.workClientInfo.mapper.JyWorkClientInfoMapper;
|
|
import com.jeeplus.business.workClientInfo.mapper.JyWorkClientLinkmanMapper;
|
|
import com.jeeplus.business.workClientInfo.mapper.JyWorkClientLinkmanMapper;
|
|
@@ -30,6 +29,7 @@ import com.jeeplus.business.workContractInfo.service.dto.JyWorkContractInfoDto;
|
|
import com.jeeplus.common.TokenProvider;
|
|
import com.jeeplus.common.TokenProvider;
|
|
import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
import com.jeeplus.flowable.feign.IFlowableApi;
|
|
import com.jeeplus.flowable.feign.IFlowableApi;
|
|
|
|
+import com.jeeplus.pubmodules.oss.domain.WorkAttachment;
|
|
import com.jeeplus.sys.domain.DictValue;
|
|
import com.jeeplus.sys.domain.DictValue;
|
|
import com.jeeplus.sys.domain.WorkAttachmentInfo;
|
|
import com.jeeplus.sys.domain.WorkAttachmentInfo;
|
|
import com.jeeplus.sys.feign.IUserApi;
|
|
import com.jeeplus.sys.feign.IUserApi;
|
|
@@ -95,6 +95,15 @@ public class JyProjectService {
|
|
@Resource
|
|
@Resource
|
|
private JyProjectOutInstanceFileMapper jyProjectOutInstanceFileMapper;
|
|
private JyProjectOutInstanceFileMapper jyProjectOutInstanceFileMapper;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private JyProjectReportsSubmitMapper jyProjectReportsSubmitMapper;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private JyProjectArchiveMapper jyProjectArchiveMapper;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private JyProjectArchiveFileMapper jyProjectArchiveFileMapper;
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* 项目登记列表
|
|
* 项目登记列表
|
|
@@ -141,8 +150,8 @@ public class JyProjectService {
|
|
wrapper.like("a.contract_name",info.getContractName());
|
|
wrapper.like("a.contract_name",info.getContractName());
|
|
}
|
|
}
|
|
//委托方
|
|
//委托方
|
|
- if (StringUtils.isNotBlank(info.getClientName())){
|
|
|
|
- wrapper.like("a.client_name",info.getClientName());
|
|
|
|
|
|
+ if (StringUtils.isNotBlank(info.getPrimaryLinkman())){
|
|
|
|
+ wrapper.like("wci.primary_linkman",info.getPrimaryLinkman());
|
|
}
|
|
}
|
|
//登记状态
|
|
//登记状态
|
|
if (StringUtils.isNotBlank(info.getStatus())){
|
|
if (StringUtils.isNotBlank(info.getStatus())){
|
|
@@ -157,12 +166,12 @@ public class JyProjectService {
|
|
wrapper.eq("po.status", info.getOutInstance());
|
|
wrapper.eq("po.status", info.getOutInstance());
|
|
}
|
|
}
|
|
//报批签发
|
|
//报批签发
|
|
- if (StringUtils.isNotBlank(info.getReportSubmit())){
|
|
|
|
- wrapper.eq("a.report_submit", info.getReportSubmit());
|
|
|
|
|
|
+ if (StringUtils.isNotBlank(info.getReportsSubmit())){
|
|
|
|
+ wrapper.eq("a.reports_submit", info.getReportsSubmit());
|
|
}
|
|
}
|
|
//归档状态
|
|
//归档状态
|
|
if (StringUtils.isNotBlank(info.getReviewStatus())){
|
|
if (StringUtils.isNotBlank(info.getReviewStatus())){
|
|
- wrapper.eq("a.review_status", info.getReviewStatus());
|
|
|
|
|
|
+ wrapper.eq("par.status", info.getReviewStatus());
|
|
}
|
|
}
|
|
IPage<JyProject> pageList = jyProjectMapper.findPageList(page, wrapper);
|
|
IPage<JyProject> pageList = jyProjectMapper.findPageList(page, wrapper);
|
|
pageList.getRecords().stream().forEach(item ->{
|
|
pageList.getRecords().stream().forEach(item ->{
|
|
@@ -175,7 +184,6 @@ public class JyProjectService {
|
|
//合同名称及委托方联系人
|
|
//合同名称及委托方联系人
|
|
if (StringUtils.isEmpty(item.getContractName())){
|
|
if (StringUtils.isEmpty(item.getContractName())){
|
|
item.setContractName("暂无合同");
|
|
item.setContractName("暂无合同");
|
|
- item.setPrimaryLinkman(item.getClientName());
|
|
|
|
}
|
|
}
|
|
//获取用印id
|
|
//获取用印id
|
|
List<Signet> signets = signetMapper.selectList(new QueryWrapper<Signet>());
|
|
List<Signet> signets = signetMapper.selectList(new QueryWrapper<Signet>());
|
|
@@ -191,6 +199,25 @@ public class JyProjectService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //获取报批签发信息
|
|
|
|
+ List<JyProjectReportsSubmit> jyProjectReportsSubmits = jyProjectReportsSubmitMapper.selectList(new QueryWrapper<JyProjectReportsSubmit>());
|
|
|
|
+ for (JyProjectReportsSubmit jyProjectReportsSubmit : jyProjectReportsSubmits) {
|
|
|
|
+ if (StringUtils.isNotBlank(jyProjectReportsSubmit.getProjectId())){
|
|
|
|
+ String[] split = jyProjectReportsSubmit.getProjectId().split(",");
|
|
|
|
+ for (String s : split) {
|
|
|
|
+ if (StringUtils.isNotBlank(s)){
|
|
|
|
+ if (s.equals(item.getId())){
|
|
|
|
+ item.setReportsSubmitId(jyProjectReportsSubmit.getId());
|
|
|
|
+ item.setProcInsIdReports(jyProjectReportsSubmit.getProcInsId());
|
|
|
|
+ item.setReportsSubmit(jyProjectReportsSubmit.getStatus());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
});
|
|
});
|
|
return pageList;
|
|
return pageList;
|
|
}
|
|
}
|
|
@@ -256,11 +283,11 @@ public class JyProjectService {
|
|
String projectNo = "";
|
|
String projectNo = "";
|
|
|
|
|
|
String id = UUID.randomUUID().toString().replace("-", "");
|
|
String id = UUID.randomUUID().toString().replace("-", "");
|
|
|
|
+ JyWorkContractInfo byId = jyWorkContractInfoMapper.findById(dto.getContractId());
|
|
//生成项目编号
|
|
//生成项目编号
|
|
if (dto.getContractStatus().equals("0")){
|
|
if (dto.getContractStatus().equals("0")){
|
|
projectNo = SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyProjectDTO.BIZ_CODE,currentToken);
|
|
projectNo = SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyProjectDTO.BIZ_CODE,currentToken);
|
|
}else {
|
|
}else {
|
|
- JyWorkContractInfo byId = jyWorkContractInfoMapper.findById(dto.getContractId());
|
|
|
|
Integer projectNum=jyProjectMapper.getProByContractId(dto.getContractId());
|
|
Integer projectNum=jyProjectMapper.getProByContractId(dto.getContractId());
|
|
Integer count=0;
|
|
Integer count=0;
|
|
if (projectNum == 0){
|
|
if (projectNum == 0){
|
|
@@ -281,7 +308,7 @@ public class JyProjectService {
|
|
List<JyWorkClientLinkman> clientList = dto.getClientList();
|
|
List<JyWorkClientLinkman> clientList = dto.getClientList();
|
|
for (JyWorkClientLinkman jyWorkClientLinkman : clientList) {
|
|
for (JyWorkClientLinkman jyWorkClientLinkman : clientList) {
|
|
jyProject.setClient(jyWorkClientLinkman.getId());//联系人id
|
|
jyProject.setClient(jyWorkClientLinkman.getId());//联系人id
|
|
- jyProject.setClientName(jyWorkClientLinkman.getName());//联系人姓名
|
|
|
|
|
|
+ jyProject.setClientName(jyWorkClientLinkman.getClientName());//联系人姓名
|
|
}
|
|
}
|
|
jyProject.setProjectLeader(dto.getProjectLeader());//项目负责人
|
|
jyProject.setProjectLeader(dto.getProjectLeader());//项目负责人
|
|
jyProject.setProjectPlace(dto.getProjectPlace());//项目所在地
|
|
jyProject.setProjectPlace(dto.getProjectPlace());//项目所在地
|
|
@@ -333,6 +360,11 @@ public class JyProjectService {
|
|
jyProjectOutinstance.setStatus("0");
|
|
jyProjectOutinstance.setStatus("0");
|
|
jyProjectOutinstanceMapper.insert(jyProjectOutinstance);
|
|
jyProjectOutinstanceMapper.insert(jyProjectOutinstance);
|
|
|
|
|
|
|
|
+ //归档添加
|
|
|
|
+ JyProjectArchive jyProjectArchive = new JyProjectArchive();
|
|
|
|
+ jyProjectArchive.setProjectId(jyProject.getId());
|
|
|
|
+ jyProjectArchive.setStatus("0");
|
|
|
|
+ jyProjectArchiveMapper.insert(jyProjectArchive);
|
|
|
|
|
|
// 保存附件信息
|
|
// 保存附件信息
|
|
if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
|
if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
|
@@ -345,9 +377,33 @@ public class JyProjectService {
|
|
String currentToken = TokenProvider.getCurrentToken();
|
|
String currentToken = TokenProvider.getCurrentToken();
|
|
//获取当前登录人信息
|
|
//获取当前登录人信息
|
|
UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
|
|
UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
|
|
|
|
+ String projectNo = "";
|
|
|
|
+ //获取合同编号
|
|
|
|
+ JyWorkContractInfo contractInfo = jyWorkContractInfoMapper.findById(dto.getContractId());
|
|
// 修改项目管理列表主表信息
|
|
// 修改项目管理列表主表信息
|
|
|
|
+ if (dto.getContractStatus().equals("1")){
|
|
|
|
+ //获取项目编号
|
|
|
|
+ JyProject project = jyProjectMapper.getById(dto.getId());
|
|
|
|
+ Integer projectNum=jyProjectMapper.getProByContractId(dto.getContractId());
|
|
|
|
+ //生成新的项目编号 合同编号+合同下的项目数量+(项目编号)
|
|
|
|
+ Integer count=0;
|
|
|
|
+ //判断当前合同下是否有项目
|
|
|
|
+ if (projectNum==0){
|
|
|
|
+ projectNo=contractInfo.getNo()+"-0"+(count+1)+"("+project.getNo()+")";
|
|
|
|
+ }else {
|
|
|
|
+ projectNo=contractInfo.getNo()+"-0"+(projectNum+1)+"("+project.getNo()+")";
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ projectNo = SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyProjectDTO.BIZ_CODE,currentToken);
|
|
|
|
+ }
|
|
JyProject jyProject = new JyProject();
|
|
JyProject jyProject = new JyProject();
|
|
BeanUtils.copyProperties(dto, jyProject);
|
|
BeanUtils.copyProperties(dto, jyProject);
|
|
|
|
+ List<JyWorkClientLinkman> clientList = dto.getClientList();
|
|
|
|
+ for (JyWorkClientLinkman jyWorkClientLinkman : clientList) {
|
|
|
|
+ jyProject.setClient(jyWorkClientLinkman.getId());//联系人id
|
|
|
|
+ jyProject.setClientName(jyWorkClientLinkman.getClientName());//联系人姓名
|
|
|
|
+ }
|
|
|
|
+ jyProject.setNo(projectNo);
|
|
jyProject.setUpdateById(userDTO.getId());
|
|
jyProject.setUpdateById(userDTO.getId());
|
|
jyProject.setUpdateTime(new Date());
|
|
jyProject.setUpdateTime(new Date());
|
|
jyProject.setDelFlag(0);
|
|
jyProject.setDelFlag(0);
|
|
@@ -576,6 +632,36 @@ public class JyProjectService {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * 获取当前登录人外审通过的项目
|
|
|
|
+ * @param page
|
|
|
|
+ * @param info
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public IPage<JyProject> getByCreateOut(Page<JyProject> page, JyProject info) throws Exception {
|
|
|
|
+ //获取当前登录人信息
|
|
|
|
+ UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
|
|
|
|
+ QueryWrapper<JyProject> wrapper = QueryWrapperGenerator.buildQueryCondition(info, JyProject.class);
|
|
|
|
+ wrapper.eq("a.create_by_id",userDTO.getId());
|
|
|
|
+ wrapper.eq("po.status","5");
|
|
|
|
+ //创建时间
|
|
|
|
+ if (info.getCreateDates() != null && info.getCreateDates().length > 0) {
|
|
|
|
+ wrapper.between("a.create_time", info.getCreateDates()[0], info.getCreateDates()[1]);
|
|
|
|
+ }
|
|
|
|
+ //项目编号
|
|
|
|
+ if (StringUtils.isNotBlank(info.getNo())){
|
|
|
|
+ wrapper.like("a.no",info.getNo());
|
|
|
|
+ }
|
|
|
|
+ //项目名称
|
|
|
|
+ if (StringUtils.isNotBlank(info.getName())){
|
|
|
|
+ wrapper.like("a.name",info.getName());
|
|
|
|
+ }
|
|
|
|
+ IPage<JyProject> projectIPage=jyProjectMapper.getByCreateOut(userDTO.getId(),page,wrapper);
|
|
|
|
+ return projectIPage;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
* 获取三级校审信息
|
|
* 获取三级校审信息
|
|
* @param id
|
|
* @param id
|
|
* @return
|
|
* @return
|
|
@@ -682,6 +768,11 @@ public class JyProjectService {
|
|
jyProjectAudit.setId(dto.getId());
|
|
jyProjectAudit.setId(dto.getId());
|
|
jyProjectAudit.setStatus(dto.getStatus());
|
|
jyProjectAudit.setStatus(dto.getStatus());
|
|
jyProjectAuditMapper.update(jyProjectAudit,new QueryWrapper<JyProjectAudit>().lambda().eq(JyProjectAudit::getId,jyProjectAudit.getId()));
|
|
jyProjectAuditMapper.update(jyProjectAudit,new QueryWrapper<JyProjectAudit>().lambda().eq(JyProjectAudit::getId,jyProjectAudit.getId()));
|
|
|
|
+ //修改逾期完成的校审状态
|
|
|
|
+ JyProjectAuditDTO byIdAudit = jyProjectAuditMapper.findByIdAudit(dto.getId());
|
|
|
|
+ if (byIdAudit.getExceedTimeStatus().equals("1") && dto.getStatus().equals("5")){
|
|
|
|
+ jyProjectAuditMapper.updateStatus2(byIdAudit.getId());
|
|
|
|
+ }
|
|
return "操作成功";
|
|
return "操作成功";
|
|
}
|
|
}
|
|
|
|
|
|
@@ -690,7 +781,46 @@ public class JyProjectService {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public List<JyProjectAudit> selectAudit() {
|
|
public List<JyProjectAudit> selectAudit() {
|
|
- List<JyProjectAudit> list=jyProjectAuditMapper.selectAudit();
|
|
|
|
|
|
+ //获取一个月前的时间
|
|
|
|
+ //创建时间格式化对象
|
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ //获取当前时间
|
|
|
|
+ Date currentDate = new Date();
|
|
|
|
+ //将当前时间转化为字符串
|
|
|
|
+ String format = simpleDateFormat.format(currentDate);
|
|
|
|
+ //创建calendar对象
|
|
|
|
+ Calendar instance = Calendar.getInstance();
|
|
|
|
+ //将日期设置为当前时间
|
|
|
|
+ instance.setTime(currentDate);
|
|
|
|
+ //将日期往前推一个月
|
|
|
|
+ instance.add(Calendar.MONTH,-1);
|
|
|
|
+ //获取推送后的日期
|
|
|
|
+ Date newDate = instance.getTime();
|
|
|
|
+ List<JyProjectAudit> list=jyProjectAuditMapper.selectAudit(newDate);
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询项目一级校审中逾期未发起的项目
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public List<JyProjectAudit> selectAuditInTime() {
|
|
|
|
+ //获取一个月前的时间
|
|
|
|
+ //创建时间格式化对象
|
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ //获取当前时间
|
|
|
|
+ Date currentDate = new Date();
|
|
|
|
+ //将当前时间转化为字符串
|
|
|
|
+ String format = simpleDateFormat.format(currentDate);
|
|
|
|
+ //创建calendar对象
|
|
|
|
+ Calendar instance = Calendar.getInstance();
|
|
|
|
+ //将日期设置为当前时间
|
|
|
|
+ instance.setTime(currentDate);
|
|
|
|
+ //将日期往前推一个月
|
|
|
|
+ instance.add(Calendar.MONTH,-1);
|
|
|
|
+ //获取推送后的日期
|
|
|
|
+ Date newDate = instance.getTime();
|
|
|
|
+ List<JyProjectAudit> list=jyProjectAuditMapper.selectAuditInTime(newDate);
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -698,22 +828,8 @@ public class JyProjectService {
|
|
* 修改一级校审逾期状态
|
|
* 修改一级校审逾期状态
|
|
* @param
|
|
* @param
|
|
*/
|
|
*/
|
|
- public void updateStatus(String id) {
|
|
|
|
- JyProjectAuditDTO data = jyProjectAuditMapper.findByIdAudit(id);
|
|
|
|
- //判断一级校审是否发起
|
|
|
|
- if (StringUtils.isNotBlank(data.getStatus())){
|
|
|
|
- if (data.getStatus().equals("0")){
|
|
|
|
- jyProjectAuditMapper.updateStatus(data.getId());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- //判断一级校审是否在规定期限内完成
|
|
|
|
- if (StringUtils.isNotBlank(data.getExceedTimeStatus())){
|
|
|
|
- if (data.getExceedTimeStatus().equals("1")){
|
|
|
|
- if (data.getStatus().equals("5")){
|
|
|
|
- jyProjectAuditMapper.updateStatus2(data.getId());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ public void updateStatus(String id,String status,String exceedTimeStatus) {
|
|
|
|
+ jyProjectAuditMapper.updateStatus(id,status,exceedTimeStatus);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -768,8 +884,8 @@ public class JyProjectService {
|
|
if(null != jyProjectAuditDTOS){
|
|
if(null != jyProjectAuditDTOS){
|
|
if (jyProjectAuditDTOS.size()>=1){
|
|
if (jyProjectAuditDTOS.size()>=1){
|
|
//审核意见
|
|
//审核意见
|
|
|
|
+ ArrayList<String> strings = new ArrayList<>();
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(0).getInitialAuditOpinion())){
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(0).getInitialAuditOpinion())){
|
|
- ArrayList<String> strings = new ArrayList<>();
|
|
|
|
if (jyProjectAuditDTOS.get(0).getInitialAuditOpinion().contains("<br/>")){
|
|
if (jyProjectAuditDTOS.get(0).getInitialAuditOpinion().contains("<br/>")){
|
|
String[] split = jyProjectAuditDTOS.get(0).getInitialAuditOpinion().split("<br/>");
|
|
String[] split = jyProjectAuditDTOS.get(0).getInitialAuditOpinion().split("<br/>");
|
|
//将审核意见放入集合中
|
|
//将审核意见放入集合中
|
|
@@ -781,7 +897,8 @@ public class JyProjectService {
|
|
}
|
|
}
|
|
data.put("firstAuditList",strings);
|
|
data.put("firstAuditList",strings);
|
|
}else {
|
|
}else {
|
|
- data.put("firstAuditList","");
|
|
|
|
|
|
+ strings.add("");
|
|
|
|
+ data.put("firstAuditList",strings);
|
|
}
|
|
}
|
|
//审核人
|
|
//审核人
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(0).getAuditPeople())){
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(0).getAuditPeople())){
|
|
@@ -800,19 +917,21 @@ public class JyProjectService {
|
|
data.put("firstDate",format);
|
|
data.put("firstDate",format);
|
|
}
|
|
}
|
|
//修改意见
|
|
//修改意见
|
|
|
|
+ ArrayList<String> strings1 = new ArrayList<>();
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(0).getInitialEditOpinion())){
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(0).getInitialEditOpinion())){
|
|
- ArrayList<String> strings = new ArrayList<>();
|
|
|
|
|
|
+
|
|
if (jyProjectAuditDTOS.get(0).getInitialEditOpinion().contains("<br/>")){
|
|
if (jyProjectAuditDTOS.get(0).getInitialEditOpinion().contains("<br/>")){
|
|
String[] split = jyProjectAuditDTOS.get(0).getInitialEditOpinion().split("<br/>");
|
|
String[] split = jyProjectAuditDTOS.get(0).getInitialEditOpinion().split("<br/>");
|
|
for (String s : split) {
|
|
for (String s : split) {
|
|
- strings.add(s);
|
|
|
|
|
|
+ strings1.add(s);
|
|
}
|
|
}
|
|
}else {
|
|
}else {
|
|
- strings.add(jyProjectAuditDTOS.get(0).getInitialEditOpinion());
|
|
|
|
|
|
+ strings1.add(jyProjectAuditDTOS.get(0).getInitialEditOpinion());
|
|
}
|
|
}
|
|
- data.put("firstEditList",strings);
|
|
|
|
|
|
+ data.put("firstEditList",strings1);
|
|
}else {
|
|
}else {
|
|
- data.put("firstEditList","");
|
|
|
|
|
|
+ strings1.add("");
|
|
|
|
+ data.put("firstEditList",strings1);
|
|
}
|
|
}
|
|
//签名
|
|
//签名
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(0).getCreateById())){
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(0).getCreateById())){
|
|
@@ -828,8 +947,9 @@ public class JyProjectService {
|
|
}
|
|
}
|
|
if (jyProjectAuditDTOS.size()>=2){
|
|
if (jyProjectAuditDTOS.size()>=2){
|
|
//审核意见
|
|
//审核意见
|
|
|
|
+ ArrayList<String> strings = new ArrayList<>();
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(1).getInitialAuditOpinion())){
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(1).getInitialAuditOpinion())){
|
|
- ArrayList<String> strings = new ArrayList<>();
|
|
|
|
|
|
+
|
|
if (jyProjectAuditDTOS.get(1).getInitialAuditOpinion().contains("<br/>")){
|
|
if (jyProjectAuditDTOS.get(1).getInitialAuditOpinion().contains("<br/>")){
|
|
String[] split = jyProjectAuditDTOS.get(1).getInitialAuditOpinion().split("<br/>");
|
|
String[] split = jyProjectAuditDTOS.get(1).getInitialAuditOpinion().split("<br/>");
|
|
//将审核意见放入集合中
|
|
//将审核意见放入集合中
|
|
@@ -841,7 +961,8 @@ public class JyProjectService {
|
|
}
|
|
}
|
|
data.put("secondAuditList",strings);
|
|
data.put("secondAuditList",strings);
|
|
}else {
|
|
}else {
|
|
- data.put("secondAuditList","");
|
|
|
|
|
|
+ strings.add("");
|
|
|
|
+ data.put("secondAuditList",strings);
|
|
|
|
|
|
}
|
|
}
|
|
//审核人
|
|
//审核人
|
|
@@ -860,19 +981,20 @@ public class JyProjectService {
|
|
data.put("secondDate",format);
|
|
data.put("secondDate",format);
|
|
}
|
|
}
|
|
//修改意见
|
|
//修改意见
|
|
|
|
+ ArrayList<String> strings1 = new ArrayList<>();
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(1).getInitialEditOpinion())){
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(1).getInitialEditOpinion())){
|
|
- ArrayList<String> strings = new ArrayList<>();
|
|
|
|
if (jyProjectAuditDTOS.get(1).getInitialEditOpinion().contains("<br/>")){
|
|
if (jyProjectAuditDTOS.get(1).getInitialEditOpinion().contains("<br/>")){
|
|
String[] split = jyProjectAuditDTOS.get(1).getInitialEditOpinion().split("<br/>");
|
|
String[] split = jyProjectAuditDTOS.get(1).getInitialEditOpinion().split("<br/>");
|
|
for (String s : split) {
|
|
for (String s : split) {
|
|
- strings.add(s);
|
|
|
|
|
|
+ strings1.add(s);
|
|
}
|
|
}
|
|
}else {
|
|
}else {
|
|
- strings.add(jyProjectAuditDTOS.get(1).getInitialEditOpinion());
|
|
|
|
|
|
+ strings1.add(jyProjectAuditDTOS.get(1).getInitialEditOpinion());
|
|
}
|
|
}
|
|
- data.put("secondEditList",strings);
|
|
|
|
|
|
+ data.put("secondEditList",strings1);
|
|
}else {
|
|
}else {
|
|
- data.put("secondEditList","");
|
|
|
|
|
|
+ strings1.add("");
|
|
|
|
+ data.put("secondEditList",strings1);
|
|
}
|
|
}
|
|
//签名及日期
|
|
//签名及日期
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(1).getCreateById())){
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(1).getCreateById())){
|
|
@@ -889,8 +1011,8 @@ public class JyProjectService {
|
|
}
|
|
}
|
|
if (jyProjectAuditDTOS.size()>=3){
|
|
if (jyProjectAuditDTOS.size()>=3){
|
|
//审核意见
|
|
//审核意见
|
|
|
|
+ ArrayList<String> strings = new ArrayList<>();
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(2).getInitialAuditOpinion())){
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(2).getInitialAuditOpinion())){
|
|
- ArrayList<String> strings = new ArrayList<>();
|
|
|
|
if (jyProjectAuditDTOS.get(2).getInitialAuditOpinion().contains("<br/>")){
|
|
if (jyProjectAuditDTOS.get(2).getInitialAuditOpinion().contains("<br/>")){
|
|
String[] split = jyProjectAuditDTOS.get(2).getInitialAuditOpinion().split("<br/>");
|
|
String[] split = jyProjectAuditDTOS.get(2).getInitialAuditOpinion().split("<br/>");
|
|
//将审核意见放入集合中
|
|
//将审核意见放入集合中
|
|
@@ -902,7 +1024,8 @@ public class JyProjectService {
|
|
}
|
|
}
|
|
data.put("thirdAuditList",strings);
|
|
data.put("thirdAuditList",strings);
|
|
}else {
|
|
}else {
|
|
- data.put("thirdAuditList","");
|
|
|
|
|
|
+ strings.add("");
|
|
|
|
+ data.put("thirdAuditList",strings);
|
|
}
|
|
}
|
|
//审核人
|
|
//审核人
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(2).getAuditPeople())){
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(2).getAuditPeople())){
|
|
@@ -919,21 +1042,21 @@ public class JyProjectService {
|
|
data.put("thirdAuditDate",format);
|
|
data.put("thirdAuditDate",format);
|
|
data.put("thirdDate",format);
|
|
data.put("thirdDate",format);
|
|
//修改意见
|
|
//修改意见
|
|
- ArrayList<String> strings = Lists.newArrayList();
|
|
|
|
|
|
+ ArrayList<String> strings1 = Lists.newArrayList();
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(2).getInitialEditOpinion())){
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(2).getInitialEditOpinion())){
|
|
// ArrayList<String> strings = new ArrayList<>();
|
|
// ArrayList<String> strings = new ArrayList<>();
|
|
if (jyProjectAuditDTOS.get(2).getInitialEditOpinion().contains("<br/>")){
|
|
if (jyProjectAuditDTOS.get(2).getInitialEditOpinion().contains("<br/>")){
|
|
String[] split = jyProjectAuditDTOS.get(2).getInitialEditOpinion().split("<br/>");
|
|
String[] split = jyProjectAuditDTOS.get(2).getInitialEditOpinion().split("<br/>");
|
|
for (String s : split) {
|
|
for (String s : split) {
|
|
- strings.add(s);
|
|
|
|
|
|
+ strings1.add(s);
|
|
}
|
|
}
|
|
}else {
|
|
}else {
|
|
- strings.add(jyProjectAuditDTOS.get(2).getInitialEditOpinion());
|
|
|
|
|
|
+ strings1.add(jyProjectAuditDTOS.get(2).getInitialEditOpinion());
|
|
}
|
|
}
|
|
- data.put("thirdEditList",strings);
|
|
|
|
|
|
+ data.put("thirdEditList",strings1);
|
|
}else {
|
|
}else {
|
|
strings.add("");
|
|
strings.add("");
|
|
- data.put("thirdEditList",strings);
|
|
|
|
|
|
+ data.put("thirdEditList",strings1);
|
|
}
|
|
}
|
|
//签名
|
|
//签名
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(2).getCreateById())){
|
|
if (StringUtils.isNotBlank(jyProjectAuditDTOS.get(2).getCreateById())){
|
|
@@ -1067,6 +1190,10 @@ public class JyProjectService {
|
|
}else{
|
|
}else{
|
|
jyProjectOutinstanceMapper.insert(jyProjectOutinstance);
|
|
jyProjectOutinstanceMapper.insert(jyProjectOutinstance);
|
|
}
|
|
}
|
|
|
|
+ JyProject jyProject = new JyProject();
|
|
|
|
+ jyProject.setId(jyProjectOutinstance.getProjectId());
|
|
|
|
+ jyProject.setOutInstance(jyProjectOutinstanceDTO.getStatus());
|
|
|
|
+ jyProjectMapper.updateById(jyProject);
|
|
//附件
|
|
//附件
|
|
if (ObjectUtil.isNotEmpty(jyProjectOutinstanceDTO)) {
|
|
if (ObjectUtil.isNotEmpty(jyProjectOutinstanceDTO)) {
|
|
SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByAttachmentId(jyProjectOutinstance.getId());
|
|
SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByAttachmentId(jyProjectOutinstance.getId());
|
|
@@ -1111,6 +1238,438 @@ public class JyProjectService {
|
|
jyProjectOutinstance.setId(dto.getId());
|
|
jyProjectOutinstance.setId(dto.getId());
|
|
jyProjectOutinstance.setStatus(dto.getStatus());
|
|
jyProjectOutinstance.setStatus(dto.getStatus());
|
|
jyProjectOutinstanceMapper.update(jyProjectOutinstance,new QueryWrapper<JyProjectOutinstance>().lambda().eq(JyProjectOutinstance::getId,jyProjectOutinstance.getId()) );
|
|
jyProjectOutinstanceMapper.update(jyProjectOutinstance,new QueryWrapper<JyProjectOutinstance>().lambda().eq(JyProjectOutinstance::getId,jyProjectOutinstance.getId()) );
|
|
|
|
+ //修改项目外审状态
|
|
|
|
+ JyProject jyProject = new JyProject();
|
|
|
|
+ jyProject.setId(jyProjectOutinstance.getProjectId());
|
|
|
|
+ jyProject.setOutInstance(dto.getStatus());
|
|
|
|
+ jyProjectMapper.updateById(jyProject);
|
|
|
|
+ return "操作成功";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public JyProjectReportsSubmitDTO queryReportsById(String id) {
|
|
|
|
+ JyProjectReportsSubmitDTO jyProjectReportsSubmitDTO = new JyProjectReportsSubmitDTO();
|
|
|
|
+ JyProjectReportsSubmitDTO dto = jyProjectReportsSubmitMapper.findById(id);
|
|
|
|
+ BeanUtils.copyProperties(dto, jyProjectReportsSubmitDTO);
|
|
|
|
+ //查询项目信息
|
|
|
|
+ if (StringUtils.isNotBlank(dto.getProjectId())){
|
|
|
|
+ String[] split = dto.getProjectId().split(",");
|
|
|
|
+ ArrayList<JyProject> signetDTOS = new ArrayList<>();
|
|
|
|
+ for (String s : split) {
|
|
|
|
+ JyProject jyProject=jyProjectMapper.getById(s);
|
|
|
|
+ signetDTOS.add(jyProject);
|
|
|
|
+ }
|
|
|
|
+ jyProjectReportsSubmitDTO.setProjectList(signetDTOS);
|
|
|
|
+ }
|
|
|
|
+ List<String> stringList = new ArrayList<>();
|
|
|
|
+ if (com.jeeplus.utils.StringUtils.isNotBlank(dto.getType())){
|
|
|
|
+ stringList.add(dto.getFirstType());
|
|
|
|
+ stringList.add(dto.getType());
|
|
|
|
+ }else {
|
|
|
|
+ stringList.add(dto.getFirstType());
|
|
|
|
+ }
|
|
|
|
+ jyProjectReportsSubmitDTO.setTypes(stringList);
|
|
|
|
+ jyProjectReportsSubmitDTO.setCreateById(dto.getCreateById());
|
|
|
|
+ // 查询附件信息
|
|
|
|
+ List<WorkAttachmentInfo> files = jyWorkContractInfoMapper.findDtos(id);
|
|
|
|
+ if (CollectionUtils.isNotEmpty(files)) {
|
|
|
|
+ for (WorkAttachmentInfo i : files) {
|
|
|
|
+ i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
|
|
|
|
+ }
|
|
|
|
+ jyProjectReportsSubmitDTO.setFiles(files);
|
|
|
|
+ }
|
|
|
|
+ return jyProjectReportsSubmitDTO;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 保存或修改报批签发
|
|
|
|
+ * @param dto
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public String saveReportsSubmit(JyProjectReportsSubmitDTO dto) throws Exception {
|
|
|
|
+ UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken (TokenProvider.getCurrentToken ( ));
|
|
|
|
+ if (com.jeeplus.utils.StringUtils.isNotEmpty(dto.getId())) {
|
|
|
|
+ return updateReportsSubmit(dto, userDTO);
|
|
|
|
+ } else {
|
|
|
|
+ return addReportsSubmit(dto, userDTO);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public synchronized String addReportsSubmit(JyProjectReportsSubmitDTO dto, UserDTO userDTO) throws Exception{
|
|
|
|
+ // 生成id
|
|
|
|
+ String id = UUID.randomUUID().toString().replace("-", "");
|
|
|
|
+ // 保存基础信息表信息
|
|
|
|
+ JyProjectReportsSubmit jyProjectReportsSubmit = new JyProjectReportsSubmit();
|
|
|
|
+ BeanUtils.copyProperties(dto, jyProjectReportsSubmit);
|
|
|
|
+ jyProjectReportsSubmit.setId(id);
|
|
|
|
+ jyProjectReportsSubmit.setCreateById(userDTO.getId());
|
|
|
|
+ jyProjectReportsSubmit.setCreateTime(new Date());
|
|
|
|
+ jyProjectReportsSubmit.setUpdateById(userDTO.getId());
|
|
|
|
+ jyProjectReportsSubmit.setUpdateTime(new Date());
|
|
|
|
+ jyProjectReportsSubmit.setDelFlag(0);
|
|
|
|
+ //保存关联项目信息
|
|
|
|
+ String projectId="";
|
|
|
|
+ if (ObjectUtil.isNotEmpty(dto.getProjectList())){
|
|
|
|
+ for (JyProject jyProject : dto.getProjectList()) {
|
|
|
|
+
|
|
|
|
+ projectId+=jyProject.getProjectId()+",";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ jyProjectReportsSubmit.setProjectId(projectId);
|
|
|
|
+ //保存用印类型
|
|
|
|
+ if (null != dto.getTypes()&&dto.getTypes().size()>0){
|
|
|
|
+ if (dto.getTypes().size()==1){
|
|
|
|
+ jyProjectReportsSubmit.setFirstType(dto.getTypes().get(0));
|
|
|
|
+ }else {
|
|
|
|
+ jyProjectReportsSubmit.setFirstType(dto.getTypes().get(0));
|
|
|
|
+ jyProjectReportsSubmit.setType(dto.getTypes().get(1));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ jyProjectReportsSubmit.setRemarks(dto.getRemarks());//说明
|
|
|
|
+ jyProjectReportsSubmit.setStatus(dto.getStatus());//状态
|
|
|
|
+ jyProjectReportsSubmit.setNumber(dto.getNumber()); //份数
|
|
|
|
+ jyProjectReportsSubmit.setFirstSubmitTime(new Date()); //初次发起时间
|
|
|
|
+ jyProjectReportsSubmitMapper.insert(jyProjectReportsSubmit);
|
|
|
|
+ // 保存附件列表信息
|
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
|
|
|
+ saveReportsFiles(dto.getFiles(), userDTO, id);
|
|
|
|
+ }
|
|
|
|
+ //修改项目中的报批签发状态
|
|
|
|
+ if (com.jeeplus.utils.StringUtils.isNotBlank(projectId)){
|
|
|
|
+ String[] split = projectId.split(",");
|
|
|
|
+ for (String s : split) {
|
|
|
|
+ if (com.jeeplus.utils.StringUtils.isNotBlank(s)){
|
|
|
|
+ jyProjectMapper.updateReportsSubmit(s,jyProjectReportsSubmit.getStatus());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return id;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public String updateReportsSubmit(JyProjectReportsSubmitDTO dto, UserDTO userDTO) {
|
|
|
|
+ JyProjectReportsSubmit jyProjectReportsSubmit = new JyProjectReportsSubmit();
|
|
|
|
+ BeanUtils.copyProperties(dto, jyProjectReportsSubmit);
|
|
|
|
+ jyProjectReportsSubmit.setUpdateTime(new Date());
|
|
|
|
+ //保存关联项目信息
|
|
|
|
+ String projectId="";
|
|
|
|
+ if (ObjectUtil.isNotEmpty(dto.getProjectList())){
|
|
|
|
+ for (JyProject jyProject : dto.getProjectList()) {
|
|
|
|
+ projectId=jyProject.getId()+",";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ jyProjectReportsSubmit.setProjectId(projectId);
|
|
|
|
+ //保存用印类型
|
|
|
|
+ if (ObjectUtil.isNotEmpty(dto.getTypes())){
|
|
|
|
+ if (StringUtils.isNotBlank(dto.getTypes().get(1))){
|
|
|
|
+ jyProjectReportsSubmit.setType(dto.getTypes().get(1));
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotBlank(dto.getTypes().get(0))){
|
|
|
|
+ jyProjectReportsSubmit.setFirstType(dto.getTypes().get(0));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ jyProjectReportsSubmit.setRemarks(dto.getRemarks());//说明
|
|
|
|
+ jyProjectReportsSubmit.setStatus(dto.getStatus());//状态
|
|
|
|
+ jyProjectReportsSubmit.setNumber(dto.getNumber()); //份数
|
|
|
|
+ jyProjectReportsSubmitMapper.updateById(jyProjectReportsSubmit);
|
|
|
|
+ // 修改附件信息
|
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
|
|
|
+ updateReportsFiles(dto.getFiles(), userDTO, dto.getId());
|
|
|
|
+ }
|
|
|
|
+ //修改项目中的报批签发状态
|
|
|
|
+ if (com.jeeplus.utils.StringUtils.isNotBlank(projectId)){
|
|
|
|
+ String[] split = projectId.split(",");
|
|
|
|
+ for (String s : split) {
|
|
|
|
+ if (com.jeeplus.utils.StringUtils.isNotBlank(s)){
|
|
|
|
+ jyProjectMapper.updateReportsSubmit(s,jyProjectReportsSubmit.getStatus());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return dto.getId();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 保存附件信息
|
|
|
|
+ * @param list 待保存的附件列表
|
|
|
|
+ * @param userDTO 当前登录用户
|
|
|
|
+ * @param id 关联id
|
|
|
|
+ */
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public void saveReportsFiles(List<WorkAttachmentInfo> list, UserDTO userDTO, String id) {
|
|
|
|
+ int j = 1;
|
|
|
|
+ for (WorkAttachmentInfo dto : list) {
|
|
|
|
+ WorkAttachment i = new WorkAttachment();
|
|
|
|
+ //包含了url、size、name
|
|
|
|
+ i.setId(UUID.randomUUID().toString().replace("-", ""));
|
|
|
|
+// i.getCreateBy().setId(userDTO.getId());
|
|
|
|
+ i.setCreateTime(new Date());
|
|
|
|
+// i.getUpdateBy().setId(userDTO.getId());
|
|
|
|
+ i.setUpdateTime(new Date());
|
|
|
|
+ i.setDelFlag(0);
|
|
|
|
+ i.setUrl(dto.getUrl());
|
|
|
|
+ //文件类型处理
|
|
|
|
+ List<String> strings = Arrays.asList(dto.getName().split("\\."));
|
|
|
|
+ if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(strings)) {
|
|
|
|
+ i.setType(strings.get(1));
|
|
|
|
+ }
|
|
|
|
+ i.setAttachmentId(id);
|
|
|
|
+ i.setAttachmentName(dto.getName());
|
|
|
|
+ i.setAttachmentFlag("jyReportsSubmit");
|
|
|
|
+ i.setFileSize(dto.getSize());
|
|
|
|
+ i.setSort(j);
|
|
|
|
+ Map<String,String> map = new HashMap<>();
|
|
|
|
+ String workAttachment = JSON.toJSONString((i));
|
|
|
|
+ String userDTOInfo = JSON.toJSONString((userDTO));
|
|
|
|
+ map.put("workAttachment",workAttachment);
|
|
|
|
+ map.put("userDTO",userDTOInfo);
|
|
|
|
+ SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
|
|
|
|
+// ossServiceMapper.insertWorkAttachment(i, userDTO);
|
|
|
|
+ j++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 修改附件信息
|
|
|
|
+ * @param list 待修改的附件列表
|
|
|
|
+ * @param userDTO 当前登录用户
|
|
|
|
+ * @param id 关联id
|
|
|
|
+ */
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public void updateReportsFiles(List<WorkAttachmentInfo> list, UserDTO userDTO, String id) {
|
|
|
|
+ int j = 1;
|
|
|
|
+ String names = new String();
|
|
|
|
+ //表中存在,但是传过来不存在,说明已删除,表中数据也要删除
|
|
|
|
+ for (WorkAttachmentInfo dto : list) {
|
|
|
|
+ names = names + "," +dto.getUrl();
|
|
|
|
+ }
|
|
|
|
+ //查询保存的附件信息
|
|
|
|
+ List<WorkAttachmentInfo> infoList = signetMapper.findFileList(id);
|
|
|
|
+ if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(infoList)) {
|
|
|
|
+ for (WorkAttachmentInfo i : infoList) {
|
|
|
|
+ if (!names.contains(i.getUrl())) {
|
|
|
|
+// ossServiceMapper.deleteById(i.getId());
|
|
|
|
+ SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteById(i.getId());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //保存信息
|
|
|
|
+ for (WorkAttachmentInfo dto : list) {
|
|
|
|
+ //判断是否存在
|
|
|
|
+ Integer isExit = signetMapper.findIsExit(id, dto.getName());
|
|
|
|
+ if (isExit == 0) {
|
|
|
|
+ WorkAttachment i = new WorkAttachment();
|
|
|
|
+ //包含了url、size、name
|
|
|
|
+ i.setId(UUID.randomUUID().toString().replace("-", ""));
|
|
|
|
+// i.getCreateBy().setId(userDTO.getId());
|
|
|
|
+ i.setCreateTime(new Date());
|
|
|
|
+// i.getUpdateBy().setId(userDTO.getId());
|
|
|
|
+ i.setUpdateTime(new Date());
|
|
|
|
+ i.setDelFlag(0);
|
|
|
|
+ i.setUrl(dto.getUrl());
|
|
|
|
+ //文件类型处理
|
|
|
|
+ List<String> strings = Arrays.asList(dto.getName().split("\\."));
|
|
|
|
+ if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(strings)) {
|
|
|
|
+ i.setType(strings.get(1));
|
|
|
|
+ }
|
|
|
|
+ i.setAttachmentId(id);
|
|
|
|
+ i.setAttachmentName(dto.getName());
|
|
|
|
+ i.setAttachmentFlag("jyReportsSubmit");
|
|
|
|
+ i.setFileSize(dto.getSize());
|
|
|
|
+ i.setSort(j);
|
|
|
|
+ Map<String,String> map = new HashMap<>();
|
|
|
|
+ String workAttachment = JSON.toJSONString((i));
|
|
|
|
+ String userDTOInfo = JSON.toJSONString((userDTO));
|
|
|
|
+ map.put("workAttachment",workAttachment);
|
|
|
|
+ map.put("userDTO",userDTOInfo);
|
|
|
|
+ SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
|
|
|
|
+// ossServiceMapper.insertWorkAttachment(i, userDTO);
|
|
|
|
+ j++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 根据id修改状态
|
|
|
|
+ * @param id
|
|
|
|
+ * @param status
|
|
|
|
+ */
|
|
|
|
+ public void updateReportsSubmitById(String id, String status) {
|
|
|
|
+ JyProjectReportsSubmitDTO byId = jyProjectReportsSubmitMapper.findById(id);
|
|
|
|
+ String submitStatus="";
|
|
|
|
+ //判断报批签发是否逾期
|
|
|
|
+ if (StringUtils.isNotBlank(byId.getExceedTimeStatus())){
|
|
|
|
+ if (byId.getExceedTimeStatus().equals("1") && status.equals("5")){
|
|
|
|
+ submitStatus="7";
|
|
|
|
+ }else {
|
|
|
|
+ submitStatus = status;
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ submitStatus = status;
|
|
|
|
+ }
|
|
|
|
+ jyProjectReportsSubmitMapper.updateReportsSubmitById(id,submitStatus);
|
|
|
|
+
|
|
|
|
+ if (ObjectUtil.isNotEmpty(byId)){
|
|
|
|
+ String[] split = byId.getProjectId().split(",");
|
|
|
|
+ for (String s : split) {
|
|
|
|
+ if (StringUtils.isNotBlank(s)){
|
|
|
|
+ jyProjectMapper.updateReportsSubmit(s,status);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public List<JyProjectReportsSubmit> findReportsSubmitListExccedTime() {
|
|
|
|
+ //创建时间格式化对象
|
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ //获取当前时间
|
|
|
|
+ Date currentDate = new Date();
|
|
|
|
+ //将当前时间转化为字符串
|
|
|
|
+ String format = simpleDateFormat.format(currentDate);
|
|
|
|
+ //创建calendar对象
|
|
|
|
+ Calendar instance = Calendar.getInstance();
|
|
|
|
+ //将日期设置为当前时间
|
|
|
|
+ instance.setTime(currentDate);
|
|
|
|
+ //将日期往前推两个月
|
|
|
|
+ instance.add(Calendar.MONTH,-2);
|
|
|
|
+ //获取推送后的日期
|
|
|
|
+ Date newDate = instance.getTime();
|
|
|
|
+ //找出初次发起报批签发时间超过两个月的数据
|
|
|
|
+ List<JyProjectReportsSubmit> jyProjectReportsSubmits=jyProjectReportsSubmitMapper.findReportsSubmitListExccedTime(newDate);
|
|
|
|
+ return jyProjectReportsSubmits;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public void updateExceedTimeStatus(String id, String status, String exceedTimeStatus) {
|
|
|
|
+ jyProjectReportsSubmitMapper.updateExceedTimeStatus(id,status,exceedTimeStatus);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public List<JyProjectReportsSubmit> findReportsSubmitListInTime() {
|
|
|
|
+ //创建时间格式化对象
|
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ //获取当前时间
|
|
|
|
+ Date currentDate = new Date();
|
|
|
|
+ //将当前时间转化为字符串
|
|
|
|
+ String format = simpleDateFormat.format(currentDate);
|
|
|
|
+ //创建calendar对象
|
|
|
|
+ Calendar instance = Calendar.getInstance();
|
|
|
|
+ //将日期设置为当前时间
|
|
|
|
+ instance.setTime(currentDate);
|
|
|
|
+ //将日期往前推两个月
|
|
|
|
+ instance.add(Calendar.MONTH,-2);
|
|
|
|
+ //获取推送后的日期
|
|
|
|
+ Date newDate = instance.getTime();
|
|
|
|
+ List<JyProjectReportsSubmit> jyProjectReportsSubmits=jyProjectReportsSubmitMapper.findReportsSubmitListInTime(newDate);
|
|
|
|
+ jyProjectReportsSubmits.stream().forEach(item->{
|
|
|
|
+ String[] split = item.getProjectId().split(",");
|
|
|
|
+ String pName="";
|
|
|
|
+ for (String s : split) {
|
|
|
|
+ if (StringUtils.isNotBlank(s)){
|
|
|
|
+ JyProject byId = jyProjectMapper.getById(s);
|
|
|
|
+ pName+=byId.getName();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ item.setProjectName(pName);
|
|
|
|
+ });
|
|
|
|
+ return jyProjectReportsSubmits;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 根据id查询归档信息
|
|
|
|
+ * @param id
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public JyProjectArchiveDTO findByIdArchive(String id) {
|
|
|
|
+ //根据id获取外审信息
|
|
|
|
+ JyProjectArchiveDTO jyProjectArchiveDTO=jyProjectArchiveMapper.findById(id);
|
|
|
|
+
|
|
|
|
+ if (null != jyProjectArchiveDTO){
|
|
|
|
+ List<WorkAttachmentInfoDTO> fileList =Lists.newArrayList();
|
|
|
|
+ // 查询附件信息
|
|
|
|
+ List<WorkAttachmentInfoDTO> files = jyProjectArchiveMapper.findDtos(id);
|
|
|
|
+ if (CollectionUtils.isNotEmpty(files)) {
|
|
|
|
+ for (WorkAttachmentInfoDTO i : files) {
|
|
|
|
+ i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ fileList.addAll(files);
|
|
|
|
+ jyProjectArchiveDTO.setFileList(fileList);
|
|
|
|
+ //获取项目信息
|
|
|
|
+ JyProjectDTO byId = findById(jyProjectArchiveDTO.getProjectId());
|
|
|
|
+ jyProjectArchiveDTO.setJyProjectList(byId);
|
|
|
|
+ }
|
|
|
|
+ return jyProjectArchiveDTO;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 新增/修改归档
|
|
|
|
+ * @param jyProjectArchiveDTO
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public String saveFormArchive(JyProjectArchiveDTO jyProjectArchiveDTO) {
|
|
|
|
+ UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
|
|
|
|
+ //代码转化,将dto中的对象赋到实体类中
|
|
|
|
+ JyProjectArchive jyProjectArchive = JyProjectArchiveWrapper.INSTANCE.toEntity(jyProjectArchiveDTO);
|
|
|
|
+ //获取审核信息
|
|
|
|
+ JyProjectOutinstanceDTO byId = jyProjectOutinstanceMapper.findById(jyProjectArchive.getId());
|
|
|
|
+ if (ObjectUtil.isNotEmpty(byId)){
|
|
|
|
+ if (StringUtils.isNotBlank(jyProjectArchive.getRemarks())){
|
|
|
|
+ jyProjectArchive.setRemarks(jyProjectArchiveDTO.getRemarks());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotBlank(jyProjectArchive.getId())){
|
|
|
|
+ jyProjectArchiveMapper.updateById(jyProjectArchive);
|
|
|
|
+ }else{
|
|
|
|
+ jyProjectArchiveMapper.insert(jyProjectArchive);
|
|
|
|
+ }
|
|
|
|
+ JyProject jyProject = new JyProject();
|
|
|
|
+ jyProject.setId(jyProjectArchive.getProjectId());
|
|
|
|
+ jyProject.setOutInstance(jyProjectArchive.getStatus());
|
|
|
|
+ jyProjectMapper.updateById(jyProject);
|
|
|
|
+ //附件
|
|
|
|
+ if (ObjectUtil.isNotEmpty(jyProjectArchiveDTO)) {
|
|
|
|
+ SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByAttachmentId(jyProjectArchiveDTO.getId());
|
|
|
|
+ AtomicInteger sort = new AtomicInteger(1);
|
|
|
|
+ jyProjectArchiveDTO.getFileList().stream().forEach(item->{
|
|
|
|
+ //保存附件信息
|
|
|
|
+ WorkAttachmentInfo workAttachmentDto = new WorkAttachmentInfo();
|
|
|
|
+ workAttachmentDto.setName(item.getName());
|
|
|
|
+ workAttachmentDto.setSize(item.getSize());
|
|
|
|
+ workAttachmentDto.setUrl(item.getUrl());
|
|
|
|
+ Map<String,String> map = new HashMap<>();
|
|
|
|
+ String workAttachmentDtoInfo = JSON.toJSONString(workAttachmentDto);
|
|
|
|
+ String userDTOInfo = JSON.toJSONString(userDTO);
|
|
|
|
+ String attachmentId = jyProjectArchiveDTO.getId();
|
|
|
|
+ String attachmentFlag = "jyProjectArchive";
|
|
|
|
+ String sortInfo = Integer.toString(sort.get());
|
|
|
|
+ map.put("workAttachmentDtoInfo",workAttachmentDtoInfo);
|
|
|
|
+ map.put("userDTOInfo",userDTOInfo);
|
|
|
|
+ map.put("attachmentId",attachmentId);
|
|
|
|
+ map.put("attachmentFlag",attachmentFlag);
|
|
|
|
+ map.put("sortInfo",sortInfo);
|
|
|
|
+ String fileId = SpringUtil.getBean ( IWorkAttachmentApi.class ).saveFile(map);
|
|
|
|
+ sort.getAndIncrement();
|
|
|
|
+
|
|
|
|
+ //保存附件类型
|
|
|
|
+ JyProjectArchiveFile jyProjectArchiveFile = new JyProjectArchiveFile();
|
|
|
|
+ jyProjectArchiveFile.setFileType(item.getJyFileType());
|
|
|
|
+ jyProjectArchiveFile.setWorkAttachmentId(fileId);
|
|
|
|
+ jyProjectArchiveFileMapper.insert(jyProjectArchiveFile);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ return jyProjectArchive.getId();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 根据id修改归档状态
|
|
|
|
+ * @param dto
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public String updateStatusByArchiveId(JyProjectArchiveDTO dto) {
|
|
|
|
+ JyProjectArchive jyProjectArchive = new JyProjectArchive();
|
|
|
|
+ jyProjectArchive.setId(dto.getId());
|
|
|
|
+ jyProjectArchive.setStatus(dto.getStatus());
|
|
|
|
+ jyProjectArchiveMapper.update(jyProjectArchive,new QueryWrapper<JyProjectArchive>().lambda().eq(JyProjectArchive::getId,jyProjectArchive.getId()) );
|
|
return "操作成功";
|
|
return "操作成功";
|
|
}
|
|
}
|
|
}
|
|
}
|