|
@@ -20,9 +20,7 @@ import com.jeeplus.finance.projectRecords.domain.CwProjectRecords;
|
|
|
import com.jeeplus.finance.projectRecords.service.CwProjectRecordsService;
|
|
|
import com.jeeplus.finance.projectReport.domain.*;
|
|
|
import com.jeeplus.finance.projectReport.mapper.*;
|
|
|
-import com.jeeplus.finance.projectReport.service.dto.CwProjectReportDTO;
|
|
|
-import com.jeeplus.finance.projectReport.service.dto.CwProjectReportSignatureDTO;
|
|
|
-import com.jeeplus.finance.projectReport.service.dto.ProjectReportWorkAttachmentDTO;
|
|
|
+import com.jeeplus.finance.projectReport.service.dto.*;
|
|
|
import com.jeeplus.finance.projectReport.service.mapstruct.CwProjectReportFileWrapper;
|
|
|
import com.jeeplus.finance.projectReportArchive.domain.CwProjectReportArchive;
|
|
|
import com.jeeplus.finance.projectReportArchive.mapper.CwProjectReportArchiveMapper;
|
|
@@ -121,6 +119,22 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
@Resource
|
|
|
private CwProjectReportNumberApplyMapper applyMapper;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private CwProjectReportSignAndIssueMapper signAndIssueMapper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private CwProjectReportOnlineArchivingMapper onlineArchivingMapper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private CwProjectReportPaperArchivingMapper paperArchivingMapper;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取咨询营业收入(万元)的总和
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public String getTotal() {
|
|
|
+ return reportMapper.getTotal();
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 保存项目以及其他相关信息
|
|
@@ -552,6 +566,7 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
public IPage<CwProjectReportData> findList(Page<CwProjectReportData> page, CwProjectReportData projectReportData) throws Exception{
|
|
|
QueryWrapper<CwProjectReportData> queryWrapper = QueryWrapperGenerator.buildQueryCondition (projectReportData,CwProjectReportData.class);
|
|
|
queryWrapper.eq("a.del_flag","0");
|
|
|
+ queryWrapper.eq("b.project_type","1");
|
|
|
// queryWrapper.orderByDesc("a.create_date");
|
|
|
//条件
|
|
|
if (StringUtils.isNotEmpty(projectReportData.getProjectNumber())) {
|
|
@@ -563,81 +578,158 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
if (StringUtils.isNotEmpty(projectReportData.getReportName())) {
|
|
|
queryWrapper.like("a.report_name", projectReportData.getReportName());
|
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(projectReportData.getProjectMasterId())) {
|
|
|
- queryWrapper.eq("b.project_master_id", projectReportData.getProjectMasterId());
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getCreateBy().getId())) {
|
|
|
+ queryWrapper.like("a.create_by_id", projectReportData.getCreateBy().getId()).or().like("d.name", projectReportData.getCreateBy().getId());
|
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(projectReportData.getProjectMaster2Id())) {
|
|
|
- queryWrapper.eq("b.real_header", projectReportData.getProjectMaster2Id());
|
|
|
+ //5、报告文号
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getReportNo())) {
|
|
|
+ queryWrapper.like("new_line.report_no", projectReportData.getReportNo());
|
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(projectReportData.getProjectMasterName())) { // 项目经理1筛选
|
|
|
- queryWrapper.like("e.id", projectReportData.getProjectMasterName());
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getReviewStatus())) {
|
|
|
+ queryWrapper.eq("cw_rev.review_status", projectReportData.getReviewStatus());
|
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(projectReportData.getRealHeaderName())) { // 项目经理2筛选
|
|
|
- queryWrapper.like("f.id", projectReportData.getRealHeaderName());
|
|
|
+ //项目类型
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getProjectType())) {
|
|
|
+ queryWrapper.eq("b.project_type", projectReportData.getProjectType());
|
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(projectReportData.getCreateBy().getId())) {
|
|
|
- queryWrapper.like("a.create_by_id", projectReportData.getCreateBy().getId()).or().like("d.name", projectReportData.getCreateBy().getId());
|
|
|
+ //项目类别
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getProjectCategory())) {
|
|
|
+ queryWrapper.eq("b.report_type", projectReportData.getProjectCategory());
|
|
|
}
|
|
|
- //4、签约时间(区间)
|
|
|
+ //4、创建时间(区间)
|
|
|
String[] contractDates = projectReportData.getContractDates();
|
|
|
if (contractDates != null) {
|
|
|
|
|
|
queryWrapper.between("a.create_time", contractDates[0], contractDates[1]);
|
|
|
}
|
|
|
- //5、报告文号
|
|
|
- if (StringUtils.isNotEmpty(projectReportData.getReportNo())) {
|
|
|
- queryWrapper.like("new_line.report_no", projectReportData.getReportNo());
|
|
|
- }
|
|
|
//6、审计收费
|
|
|
- String[] contractAmounts = projectReportData.getContractAmounts();
|
|
|
- if (contractAmounts != null) {
|
|
|
- if (StringUtils.isNotEmpty(contractAmounts[0])) {
|
|
|
- queryWrapper.ge("a.audit_fees",contractAmounts[0]);
|
|
|
- }
|
|
|
- if (contractAmounts.length>1 && StringUtils.isNotEmpty(contractAmounts[1])) {
|
|
|
- queryWrapper.le("a.audit_fees", contractAmounts[1]);
|
|
|
- }
|
|
|
- }
|
|
|
+// String[] contractAmounts = projectReportData.getContractAmounts();
|
|
|
+// if (contractAmounts != null) {
|
|
|
+// if (StringUtils.isNotEmpty(contractAmounts[0])) {
|
|
|
+// queryWrapper.ge("a.audit_fees",contractAmounts[0]);
|
|
|
+// }
|
|
|
+// if (contractAmounts.length>1 && StringUtils.isNotEmpty(contractAmounts[1])) {
|
|
|
+// queryWrapper.le("a.audit_fees", contractAmounts[1]);
|
|
|
+// }
|
|
|
+// }
|
|
|
if (StringUtils.isNotEmpty(projectReportData.getReviewStatus())) {
|
|
|
queryWrapper.eq("cw_rev.review_status", projectReportData.getReviewStatus());
|
|
|
}
|
|
|
- //报告号签章状态
|
|
|
- if (StringUtils.isNotEmpty(projectReportData.getApplyStatus())) {
|
|
|
- if("0".equals(projectReportData.getApplyStatus())){
|
|
|
- queryWrapper.isNull("cw_na.review_status");
|
|
|
- if(StringUtils.isBlank(projectReportData.getReviewStatus())){
|
|
|
- queryWrapper.eq("cw_rev.review_status","0");
|
|
|
+ String isBmzr = "0";
|
|
|
+ StringBuilder officeIds = new StringBuilder();
|
|
|
+ //UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken ( ));
|
|
|
+// UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
|
+// List<String> manageOfficeIdList= Lists.newArrayList();
|
|
|
+
|
|
|
+// long l1 = System.currentTimeMillis();
|
|
|
+ IPage<CwProjectReportData> list = reportMapper.findList(page,isBmzr, officeIds.toString(), queryWrapper);
|
|
|
+ /*long l2 = System.currentTimeMillis();
|
|
|
+ System.out.println("报告列表查询service方法消耗时间:" + (l2-l1));
|
|
|
+ List<UserDTO> allUserInfo = (List<UserDTO>) RedisUtils.getInstance().get(CacheNames.USER_CACHE_USER_ALL_INFO);
|
|
|
+ if (null == allUserInfo || allUserInfo.size() == 0) {
|
|
|
+ allUserInfo = SpringUtil.getBean(IUserApi.class).getAllUserInfo();
|
|
|
+ }
|
|
|
+ ArrayList<User> users = new ArrayList<>();
|
|
|
+ List<UserDTO> finalAllUserInfo = allUserInfo;
|
|
|
+ list.getRecords().forEach(li->{
|
|
|
+ if (StringUtils.isBlank(li.getProjectMasterName())){
|
|
|
+ //根据项目经理1的id去查项目经理去名称
|
|
|
+ if (StringUtils.isNotBlank(li.getProjectMasterId())){
|
|
|
+ UserDTO matchingUser = null;
|
|
|
+ for (UserDTO user : finalAllUserInfo) {
|
|
|
+ if (li.getProjectMasterId().equals(user.getId())) {
|
|
|
+ matchingUser = user;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (matchingUser != null) {
|
|
|
+ String projectMasterName = matchingUser.getName(); // Assuming the property name is "userName"
|
|
|
+ li.setProjectMasterName(projectMasterName);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(li.getRealHeaderName())) {
|
|
|
+ if (StringUtils.isNotBlank(li.getProjectMaster2Id())){
|
|
|
+ UserDTO matchingUser = null;
|
|
|
+ for (UserDTO user : finalAllUserInfo) {
|
|
|
+ if (li.getProjectMaster2Id().equals(user.getId())) {
|
|
|
+ matchingUser = user;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (matchingUser != null) {
|
|
|
+ String projectMasterName = matchingUser.getName(); // Assuming the property name is "userName"
|
|
|
+ li.setProjectMaster2Name(projectMasterName);
|
|
|
+ }
|
|
|
}
|
|
|
- }else{
|
|
|
- queryWrapper.eq("cw_na.review_status", projectReportData.getApplyStatus());
|
|
|
}
|
|
|
+ if(StringUtils.isEmpty(li.getSignatureAnnotatorStatus())){
|
|
|
+ li.setSignatureAnnotatorStatus("0");
|
|
|
+ }
|
|
|
+ CwSignatureAnnotator sigById = cwSignatureAnnotatorMapper.getSigById(li.getId());
|
|
|
+ if (ObjectUtil.isNotEmpty(sigById)){
|
|
|
+ li.setProcInsSigId(sigById.getProcInsId());
|
|
|
+ li.setSigReason(sigById.getReason());
|
|
|
+ li.setTaskSigId(sigById.getTaskId());
|
|
|
+ }
|
|
|
+ });*/
|
|
|
+ return list;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 工程咨询-项目管理列表
|
|
|
+ * @param page
|
|
|
+ * @param projectReportData
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ public IPage<CwProjectReportData> findList2(Page<CwProjectReportData> page, CwProjectReportData projectReportData) throws Exception{
|
|
|
+ QueryWrapper<CwProjectReportData> queryWrapper = QueryWrapperGenerator.buildQueryCondition (projectReportData,CwProjectReportData.class);
|
|
|
+ queryWrapper.eq("a.del_flag","0");
|
|
|
+ queryWrapper.eq("b.project_type","2");
|
|
|
+// queryWrapper.orderByDesc("a.create_date");
|
|
|
+ //条件
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getProjectNumber())) {
|
|
|
+ queryWrapper.like("b.project_number", projectReportData.getProjectNumber());
|
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(projectReportData.getStatus1())) {
|
|
|
- queryWrapper.eq("cw_prs1.status", projectReportData.getStatus1());
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getProjectName())) {
|
|
|
+ queryWrapper.like("b.project_name", projectReportData.getProjectName());
|
|
|
}
|
|
|
- if (StringUtils.isNotBlank(projectReportData.getFilingType())) {
|
|
|
- List<CwProjectRecords> projectList = cwProjectRecordsService.list(new LambdaQueryWrapper<CwProjectRecords>().eq(CwProjectRecords::getReportType, projectReportData.getFilingType()));
|
|
|
- List<String> projectIdList = projectList.stream().map(CwProjectRecords::getId).collect(Collectors.toList());
|
|
|
- if (CollectionUtil.isNotEmpty(projectIdList)) {
|
|
|
- queryWrapper.in("b.id", projectIdList);
|
|
|
- } else {
|
|
|
- return new Page<>();
|
|
|
- }
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getReportName())) {
|
|
|
+ queryWrapper.like("a.report_name", projectReportData.getReportName());
|
|
|
}
|
|
|
- if (ArrayUtil.isNotEmpty(projectReportData.getCreateDates())) {
|
|
|
- queryWrapper.between("a.create_time", projectReportData.getCreateDates()[0], projectReportData.getCreateDates()[1]);
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getCreateBy().getId())) {
|
|
|
+ queryWrapper.like("a.create_by_id", projectReportData.getCreateBy().getId()).or().like("d.name", projectReportData.getCreateBy().getId());
|
|
|
+ }
|
|
|
+ //5、报告文号
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getReportNo())) {
|
|
|
+ queryWrapper.like("new_line.report_no", projectReportData.getReportNo());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getReviewStatus())) {
|
|
|
+ queryWrapper.eq("cw_rev.review_status", projectReportData.getReviewStatus());
|
|
|
+ }
|
|
|
+ //项目类型
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getProjectType())) {
|
|
|
+ queryWrapper.eq("b.project_type", projectReportData.getProjectType());
|
|
|
+ }
|
|
|
+ //项目类别
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getProjectCategory())) {
|
|
|
+ queryWrapper.eq("b.report_type", projectReportData.getProjectCategory());
|
|
|
+ }
|
|
|
+ //4、创建时间(区间)
|
|
|
+ String[] contractDates = projectReportData.getContractDates();
|
|
|
+ if (contractDates != null) {
|
|
|
+
|
|
|
+ queryWrapper.between("a.create_time", contractDates[0], contractDates[1]);
|
|
|
}
|
|
|
String isBmzr = "0";
|
|
|
StringBuilder officeIds = new StringBuilder();
|
|
|
- //UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken ( ));
|
|
|
-// UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
|
- List<String> manageOfficeIdList= Lists.newArrayList();
|
|
|
-
|
|
|
|
|
|
-
|
|
|
- long l1 = System.currentTimeMillis();
|
|
|
+// long l1 = System.currentTimeMillis();
|
|
|
IPage<CwProjectReportData> list = reportMapper.findList(page,isBmzr, officeIds.toString(), queryWrapper);
|
|
|
- long l2 = System.currentTimeMillis();
|
|
|
+ /*long l2 = System.currentTimeMillis();
|
|
|
System.out.println("报告列表查询service方法消耗时间:" + (l2-l1));
|
|
|
List<UserDTO> allUserInfo = (List<UserDTO>) RedisUtils.getInstance().get(CacheNames.USER_CACHE_USER_ALL_INFO);
|
|
|
if (null == allUserInfo || allUserInfo.size() == 0) {
|
|
@@ -687,12 +779,68 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
li.setSigReason(sigById.getReason());
|
|
|
li.setTaskSigId(sigById.getTaskId());
|
|
|
}
|
|
|
- });
|
|
|
+ });*/
|
|
|
return list;
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 总项目管理列表
|
|
|
+ * @param page
|
|
|
+ * @param projectReportData
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ public IPage<CwProjectReportData> findList3(Page<CwProjectReportData> page, CwProjectReportData projectReportData) throws Exception{
|
|
|
+ QueryWrapper<CwProjectReportData> queryWrapper = QueryWrapperGenerator.buildQueryCondition (projectReportData,CwProjectReportData.class);
|
|
|
+ queryWrapper.eq("a.del_flag","0");
|
|
|
+// queryWrapper.orderByDesc("a.create_date");
|
|
|
+ //条件
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getProjectNumber())) {
|
|
|
+ queryWrapper.like("b.project_number", projectReportData.getProjectNumber());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getProjectName())) {
|
|
|
+ queryWrapper.like("b.project_name", projectReportData.getProjectName());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getReportName())) {
|
|
|
+ queryWrapper.like("a.report_name", projectReportData.getReportName());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getCreateBy().getId())) {
|
|
|
+ queryWrapper.like("a.create_by_id", projectReportData.getCreateBy().getId()).or().like("d.name", projectReportData.getCreateBy().getId());
|
|
|
+ }
|
|
|
+ //5、报告文号
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getReportNo())) {
|
|
|
+ queryWrapper.like("new_line.report_no", projectReportData.getReportNo());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getReviewStatus())) {
|
|
|
+ queryWrapper.eq("cw_rev.review_status", projectReportData.getReviewStatus());
|
|
|
+ }
|
|
|
+ //项目类型
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getProjectType())) {
|
|
|
+ queryWrapper.eq("b.project_type", projectReportData.getProjectType());
|
|
|
+ }
|
|
|
+ //项目类别
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getProjectCategory())) {
|
|
|
+ queryWrapper.eq("b.report_type", projectReportData.getProjectCategory());
|
|
|
+ }
|
|
|
+ //4、创建时间(区间)
|
|
|
+ String[] contractDates = projectReportData.getContractDates();
|
|
|
+ if (contractDates != null) {
|
|
|
+
|
|
|
+ queryWrapper.between("a.create_time", contractDates[0], contractDates[1]);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+// if (ArrayUtil.isNotEmpty(projectReportData.getCreateDates())) {
|
|
|
+// queryWrapper.between("a.create_time", projectReportData.getCreateDates()[0], projectReportData.getCreateDates()[1]);
|
|
|
+// }
|
|
|
+ String isBmzr = "0";
|
|
|
+ StringBuilder officeIds = new StringBuilder();
|
|
|
+ IPage<CwProjectReportData> list = reportMapper.findList(page,isBmzr, officeIds.toString(), queryWrapper);
|
|
|
+ return list;
|
|
|
+
|
|
|
+ }
|
|
|
+ /**
|
|
|
* 修改状态
|
|
|
* @param data
|
|
|
* @return
|
|
@@ -722,6 +870,56 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
return reportData;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据报告签发id查询信息
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public CwProjectReportData queryBySignAndIssueId(String id) {
|
|
|
+
|
|
|
+ CwProjectReportSignAndIssue signAndIssue = signAndIssueMapper.selectById(id);
|
|
|
+
|
|
|
+ CwProjectReportData reportData = reportMapper.queryByIdNew(signAndIssue.getReportId());
|
|
|
+
|
|
|
+ return reportData;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据报告在线归档id查询信息
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public CwProjectReportData queryByOnlineArchivingId(String id) {
|
|
|
+
|
|
|
+ CwProjectReportOnlineArchiving onlineArchiving = onlineArchivingMapper.selectById(id);
|
|
|
+
|
|
|
+ CwProjectReportData reportData = reportMapper.queryByIdNew(onlineArchiving.getReportId());
|
|
|
+
|
|
|
+ return reportData;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 根据报告纸质归档id查询信息
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public CwProjectReportData queryByPaperArchivingId(String id) {
|
|
|
+
|
|
|
+ CwProjectReportPaperArchiving paperArchiving = paperArchivingMapper.selectById(id);
|
|
|
+
|
|
|
+ CwProjectReportData reportData = reportMapper.queryByIdNew(paperArchiving.getReportId());
|
|
|
+ //查询委托方联系人信息
|
|
|
+ if (null != reportData) {
|
|
|
+ List<ProjectContactInfo> contactInfos = reportMapper.getContactInfos(reportData.getProjectId());
|
|
|
+ reportData.setContactInfos(contactInfos);
|
|
|
+ reportData.setConstructionParty(contactInfos);
|
|
|
+ //查询项目报告信息
|
|
|
+ List<ProjectReportInfo> projectReportInfos = reportMapper.getProjectReportInfo(reportData.getId());
|
|
|
+ reportData.setProjectReportInfos(projectReportInfos);
|
|
|
+ }
|
|
|
+
|
|
|
+ return reportData;
|
|
|
+ }
|
|
|
+
|
|
|
public CwProjectReportData queryById(String id) {
|
|
|
|
|
|
CwProjectReportData reportData = reportMapper.queryById(id);
|
|
@@ -3878,4 +4076,210 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ public List<ProjectContactInfo> getContactInfos(String projectId) {
|
|
|
+ return reportMapper.getContactInfos(projectId);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 将复核超期的数据状态改为超期未复核
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public void updateQualityOverdueStatus() {
|
|
|
+ //查询所有的报告信息,生成复核数据,将复核数据的状态改为 超期未复核
|
|
|
+ List<String> reports = reportMapper.getAllInfo();
|
|
|
+ List<CwProjectReviewNew> reviewNews = reviewNewMapper.selectList(new QueryWrapper<CwProjectReviewNew>().eq("del_flag", "0"));
|
|
|
+ //去除掉 已经发起过复核的 报告id数据
|
|
|
+ /*for (CwProjectReviewNew reviewNew : reviewNews) {
|
|
|
+ for (int i = 0; i < reports.size(); i++) {
|
|
|
+ if (reviewNew.getReportId().equals(reports.get(i))) {
|
|
|
+ reports.remove(i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+ Iterator<String> iterator = reports.iterator();
|
|
|
+ while (iterator.hasNext()) {
|
|
|
+ String reportId = iterator.next();
|
|
|
+ for (CwProjectReviewNew reviewNew : reviewNews) {
|
|
|
+ if (reviewNew.getReportId().equals(reportId)) {
|
|
|
+ iterator.remove(); // 使用迭代器删除元素
|
|
|
+ break; // 找到匹配的报告ID后跳出内层循环
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //添加复核数据,将状态改为6 超期未复核
|
|
|
+ for (int i = 0; i < reports.size(); i++) {
|
|
|
+ //生成主键id值
|
|
|
+ String id = UUID.randomUUID().toString().replace("-", "");
|
|
|
+ //获取当前登录人信息
|
|
|
+ UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken ( ));
|
|
|
+ //保存基本信息
|
|
|
+ CwProjectReviewNew info = new CwProjectReviewNew();
|
|
|
+
|
|
|
+ info.setId(id);
|
|
|
+ info.setCreateById(userDTO.getId());
|
|
|
+ info.setCreateTime(new Date());
|
|
|
+ info.setUpdateById(userDTO.getId());
|
|
|
+ info.setUpdateTime(new Date());
|
|
|
+ info.setReportId(reports.get(i));
|
|
|
+// info.setMark("1");
|
|
|
+// info.setReviewStatus("6");
|
|
|
+
|
|
|
+ reviewNewMapper.insert(info);
|
|
|
+ }
|
|
|
+ reportMapper.updateQualityOverdueStatus();
|
|
|
+ }
|
|
|
+
|
|
|
+ public void updateOnlineArchiveStatus() {
|
|
|
+ List<String> reports = reportMapper.getAllInfo();
|
|
|
+ List<CwProjectReportOnlineArchiving> onlineArchivings = onlineArchivingMapper.selectList(new QueryWrapper<CwProjectReportOnlineArchiving>().eq("del_flag", "0"));
|
|
|
+
|
|
|
+ //去除掉 已经在线归档过的的 报告id数据
|
|
|
+ /*for (CwProjectReportOnlineArchiving archiving : onlineArchivings) {
|
|
|
+ for (int i = 0; i < reports.size(); i++) {
|
|
|
+ if (archiving.getReportId().equals(reports.get(i))) {
|
|
|
+ reports.remove(i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+
|
|
|
+ Iterator<String> iterator = reports.iterator();
|
|
|
+ while (iterator.hasNext()) {
|
|
|
+ String reportId = iterator.next();
|
|
|
+ for (CwProjectReportOnlineArchiving archiving : onlineArchivings) {
|
|
|
+ if (archiving.getReportId().equals(reportId)) {
|
|
|
+ iterator.remove(); // 使用迭代器删除元素
|
|
|
+ break; // 找到匹配的报告ID后跳出内层循环
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //添加复核数据,将状态改为6 超期未复核
|
|
|
+ for (int i = 0; i < reports.size(); i++) {
|
|
|
+ //生成主键id值
|
|
|
+ String id = UUID.randomUUID().toString().replace("-", "");
|
|
|
+ //获取当前登录人信息
|
|
|
+ UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken ( ));
|
|
|
+ //保存基本信息
|
|
|
+ CwProjectReportOnlineArchiving info = new CwProjectReportOnlineArchiving();
|
|
|
+
|
|
|
+ info.setId(id);
|
|
|
+ info.setCreateById(userDTO.getId());
|
|
|
+ info.setCreateTime(new Date());
|
|
|
+ info.setUpdateById(userDTO.getId());
|
|
|
+ info.setUpdateTime(new Date());
|
|
|
+ info.setReportId(reports.get(i));
|
|
|
+// info.setMark("1");
|
|
|
+// info.setStatus("6");
|
|
|
+
|
|
|
+ onlineArchivingMapper.insert(info);
|
|
|
+ }
|
|
|
+ reportMapper.updateOnlineArchiveStatus();
|
|
|
+ }
|
|
|
+
|
|
|
+ public void updatePaperArchiveStatus() {
|
|
|
+
|
|
|
+ List<String> reports = reportMapper.getAllInfo();
|
|
|
+ List<CwProjectReportPaperArchiving> paperArchivings = paperArchivingMapper.selectList(new QueryWrapper<CwProjectReportPaperArchiving>().eq("del_flag", "0"));
|
|
|
+
|
|
|
+ //去除掉 已经在线归档过的的 报告id数据
|
|
|
+ /*for (CwProjectReportPaperArchiving archiving : paperArchivings) {
|
|
|
+ for (int i = 0; i < reports.size(); i++) {
|
|
|
+ if (archiving.getReportId().equals(reports.get(i))) {
|
|
|
+ reports.remove(i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+
|
|
|
+ Iterator<String> iterator = reports.iterator();
|
|
|
+ while (iterator.hasNext()) {
|
|
|
+ String reportId = iterator.next();
|
|
|
+ for (CwProjectReportPaperArchiving archiving : paperArchivings) {
|
|
|
+ if (archiving.getReportId().equals(reportId)) {
|
|
|
+ iterator.remove(); // 使用迭代器删除元素
|
|
|
+ break; // 找到匹配的报告ID后跳出内层循环
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //添加复核数据,将状态改为6 超期未复核
|
|
|
+ for (int i = 0; i < reports.size(); i++) {
|
|
|
+ //生成主键id值
|
|
|
+ String id = UUID.randomUUID().toString().replace("-", "");
|
|
|
+ //获取当前登录人信息
|
|
|
+ UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken ( ));
|
|
|
+ //保存基本信息
|
|
|
+ CwProjectReportPaperArchiving info = new CwProjectReportPaperArchiving();
|
|
|
+
|
|
|
+ info.setId(id);
|
|
|
+ info.setCreateById(userDTO.getId());
|
|
|
+ info.setCreateTime(new Date());
|
|
|
+ info.setUpdateById(userDTO.getId());
|
|
|
+ info.setUpdateTime(new Date());
|
|
|
+ info.setReportId(reports.get(i));
|
|
|
+
|
|
|
+ paperArchivingMapper.insert(info);
|
|
|
+ }
|
|
|
+ reportMapper.updateOnlineArchiveStatus();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据id查询项目报告信息
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<ProjectReportInfo> getProjectReportInfo(String id) {
|
|
|
+ return reportMapper.getProjectReportInfo(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 归档信息导出
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<ArchivedReportInfo> archivedInfoExport(CwProjectReportData reportData) {
|
|
|
+ QueryWrapper<ArchivedReportInfo> queryWrapper = new QueryWrapper<>();
|
|
|
+ QueryWrapper<ArchivedReportInfo> queryWrapperNew = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("a.del_flag",0);
|
|
|
+ queryWrapper.eq("dictVal.del_flag",0);
|
|
|
+ queryWrapperNew.eq("a.del_flag",0);
|
|
|
+ queryWrapperNew.eq("dictVal.del_flag",0);
|
|
|
+
|
|
|
+ String[] contractDates = reportData.getContractDates();
|
|
|
+ if (contractDates != null) {
|
|
|
+
|
|
|
+ queryWrapper.between("a.create_time", contractDates[0], contractDates[1]);
|
|
|
+ queryWrapperNew.between("a.create_time", contractDates[0], contractDates[1]);
|
|
|
+ }
|
|
|
+ List<ArchivedReportInfo> archivedReportInfo = new ArrayList<>();
|
|
|
+ if (null != reportData.getArchivingStatus()) {
|
|
|
+ if (reportData.getArchivingStatus().length == 1 && reportData.getArchivingStatus()[0].equals("0")) {
|
|
|
+ queryWrapper.isNull("roa.status");
|
|
|
+ } else if (reportData.getArchivingStatus().length == 0){
|
|
|
+ queryWrapper.eq("roa.status",reportData.getArchivingStatus()[0]);
|
|
|
+ } else {
|
|
|
+ boolean containsZero = false;
|
|
|
+ List<String> nonZeroStatusList = new ArrayList<>();
|
|
|
+ for (String status : reportData.getArchivingStatus()) {
|
|
|
+ if ("0".equals(status)) {
|
|
|
+ containsZero = true;
|
|
|
+ } else {
|
|
|
+ nonZeroStatusList.add(status);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ queryWrapper.in("roa.status",nonZeroStatusList);
|
|
|
+
|
|
|
+ //单独处理
|
|
|
+ if (containsZero) {
|
|
|
+
|
|
|
+ queryWrapperNew.isNull("roa.status");
|
|
|
+ archivedReportInfo = reportMapper.archivedInfoExport(queryWrapperNew);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ List<ArchivedReportInfo> archivedReportInfos = reportMapper.archivedInfoExport(queryWrapper);
|
|
|
+ archivedReportInfos.addAll(archivedReportInfo);
|
|
|
+ return archivedReportInfos;
|
|
|
+ }
|
|
|
}
|