|
@@ -1,6 +1,7 @@
|
|
|
package org.springblade.business.controller;
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
+import com.aliyun.oss.ServiceException;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
@@ -27,6 +28,7 @@ import org.springblade.common.utils.SnowFlakeUtil;
|
|
|
import org.springblade.core.mp.support.Condition;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.BeanUtil;
|
|
|
+import org.springblade.core.tool.utils.CollectionUtil;
|
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
|
import org.springblade.manager.entity.ContractInfo;
|
|
|
import org.springblade.manager.entity.WbsFormElement;
|
|
@@ -36,6 +38,7 @@ import org.springblade.manager.feign.ContractClient;
|
|
|
import org.springblade.manager.feign.WbsTreeContractClient;
|
|
|
import org.springblade.manager.feign.WbsTreePrivateClient;
|
|
|
import org.springblade.manager.vo.WbsTreeContractTreeVOS;
|
|
|
+import org.springblade.system.entity.DictBiz;
|
|
|
import org.springframework.core.io.ByteArrayResource;
|
|
|
import org.springframework.core.io.Resource;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
@@ -86,6 +89,12 @@ public class NeiYeController {
|
|
|
@ApiOperation(value = "获取内业台账列表")
|
|
|
public R<IPage<NeiYeLedgerVO>> queryCurrentNodeNeiYeLedger(@RequestBody NeiYeQueryVO queryVO) {
|
|
|
if (queryVO.getWbsIds() != null && queryVO.getWbsIds().size() > 0) {
|
|
|
+ //查询字典 dict_biz code = table_file_type
|
|
|
+ List<DictBiz> dictBiz = jdbcTemplate.query("select * from blade_dict_biz where code = 'table_file_type'", new BeanPropertyRowMapper<>(DictBiz.class));
|
|
|
+ if(CollectionUtil.isEmpty(dictBiz)){
|
|
|
+ throw new ServiceException("table_file_type 字典未查询到数据");
|
|
|
+ }
|
|
|
+ Map<String, String> dictMap = dictBiz.stream().collect(Collectors.toMap(DictBiz::getDictKey, DictBiz::getDictValue));
|
|
|
//生成列表
|
|
|
List<NeiYeLedgerVO> neiYeLedgerVOList = new ArrayList<>();
|
|
|
Integer contractType = 1;
|
|
@@ -117,13 +126,13 @@ public class NeiYeController {
|
|
|
&& !node.getNodeName().contains("开工报告") && !node.getNodeName().contains("质量检验评定表")) {
|
|
|
//非填报节点
|
|
|
if (node.getParentId() == 0) {
|
|
|
- queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractIdTwo("", contractType, contractId);
|
|
|
+ queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractIdTwo("", contractType, contractId, queryVO.getDateIsComplete());
|
|
|
} else {
|
|
|
- queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractIdTwo(node.getPKeyId().toString(), contractType, contractId);
|
|
|
+ queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractIdTwo(node.getPKeyId().toString(), contractType, contractId, queryVO.getDateIsComplete());
|
|
|
}
|
|
|
} else {
|
|
|
//填报节点
|
|
|
- queryDataResult = this.informationQueryService.queryProcessDataByPrimaryKeyIdAndClassify(node.getPKeyId().toString(), contractType);
|
|
|
+ queryDataResult = this.informationQueryService.queryProcessDataByPrimaryKeyIdAndClassify(node.getPKeyId().toString(), contractType, queryVO.getDateIsComplete());
|
|
|
}
|
|
|
|
|
|
if (queryDataResult != null && queryDataResult.size() > 0) {
|
|
@@ -134,6 +143,33 @@ public class NeiYeController {
|
|
|
List<String> stringList = jdbcTemplate.queryForList(sql, String.class);
|
|
|
if (stringList.size() > 0) {
|
|
|
queryDataResult.stream().forEach(qdr -> {
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ if (StringUtils.isEmpty(qdr.getPrivateTableFileType())) {
|
|
|
+ sb.append("后台未配置附件类型");
|
|
|
+ } else {
|
|
|
+ //后台节点配置的附件类型
|
|
|
+ List<String> privateFileType = Arrays.asList(qdr.getPrivateTableFileType().split(","));
|
|
|
+ //附件名称
|
|
|
+ List<String> names = new ArrayList<>();
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(qdr.getContractTableFileType())) {
|
|
|
+ List<String> contractFileType = Arrays.asList(qdr.getContractTableFileType().split(","));
|
|
|
+ //后台配置的与合同段配置的附件类型比较 查到质检未配置的附件名称
|
|
|
+ List<String> collect = privateFileType.stream().filter(fileType -> !contractFileType.contains(fileType)).collect(Collectors.toList());
|
|
|
+ if (CollectionUtil.isNotEmpty(collect)) {
|
|
|
+ collect.forEach(f -> names.add("【" + dictMap.get(f) + "】"));
|
|
|
+ } else {
|
|
|
+ sb.append("报告完整");
|
|
|
+ qdr.setFileType(true);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ privateFileType.forEach(f -> names.add("【" + dictMap.get(f) + "】"));
|
|
|
+ }
|
|
|
+ sb.append("缺少").append(StringUtils.join(names, "、"));
|
|
|
+ }
|
|
|
+
|
|
|
+ qdr.setFileTypeMsg(sb.toString());
|
|
|
+
|
|
|
if (stringList.contains(qdr.getPrimaryKeyId())) {
|
|
|
qdr.setIsExperiment("true");
|
|
|
}
|
|
@@ -145,6 +181,10 @@ public class NeiYeController {
|
|
|
queryDataResult = queryDataResult.stream()
|
|
|
.filter(qdr -> isExperiment.equals(qdr.getIsExperiment())).collect(Collectors.toList());
|
|
|
}
|
|
|
+ //过滤附件
|
|
|
+ if (queryVO.getIsFile() != null) {
|
|
|
+ queryDataResult = queryDataResult.stream().filter(f -> Objects.equals(f.getFileType(), queryVO.getIsFile())).collect(Collectors.toList());
|
|
|
+ }
|
|
|
//设置评定值
|
|
|
queryDataResult.stream().forEach(qdr -> qdr.setEvaluate("false"));
|
|
|
List<QueryProcessDataVO> vos = queryDataResult.stream().filter(qdr -> qdr.getTitle().contains("质量检验评定表"))
|
|
@@ -290,6 +330,7 @@ public class NeiYeController {
|
|
|
neiYeLedgerVO.setDateIsComplete(vo.getDateIsComplete());
|
|
|
neiYeLedgerVO.setInfoQueryName(vo.getInfoQueryName());
|
|
|
neiYeLedgerVO.setPdfUrl(vo.getPdfUrl());
|
|
|
+ neiYeLedgerVO.setFileTypeMsg(vo.getFileTypeMsg());
|
|
|
neiYeLedgerVOList.add(neiYeLedgerVO);
|
|
|
}
|
|
|
//转换为page信息
|