Explorar el Código

档案原生数字化没有文件统计案卷

qianxb hace 2 años
padre
commit
6ebd970f8b

+ 60 - 25
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/ArchiveFileClientImpl.java

@@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.AllArgsConstructor;
 import org.apache.commons.lang.StringUtils;
+import org.springblade.archive.entity.ArchivesAuto;
+import org.springblade.archive.vo.ArchivesAutoVO;
 import org.springblade.business.entity.ArchiveFile;
 import org.springblade.business.feign.ArchiveFileClient;
 import org.springblade.business.mapper.ArchiveFileMapper;
@@ -132,34 +134,67 @@ public class ArchiveFileClientImpl implements ArchiveFileClient {
         List<ArchiveFileVO> list = fileMapper.getAllArchiveFileByContractType(projectId);
         List<ContractInfo> infos = contractClient.queryContractListByIds(Arrays.asList(projectId));
         int key1 = 0, key2 = 0, key3 = 0;
-        //判断案卷属于1施工,2监理,还是3业主
-        for (ArchiveFileVO l : list) {
-            String type = l.getContractType();
-            if (StringUtils.isBlank(type)) {
-                //业主
-                key3++;
-            } else if ("S".equals(type)) {
-                //监理
-                key2++;
-            } else if ("C".equals(type)) {
-                //施工
-                key1++;
-            } else if (type.length() > 10) {
-                for (ContractInfo info : infos) {
-                    if (type.equals(info.getId() + "")) {
-                        Integer t = info.getContractType();
-                        if (t == 1) {
-                            key1++;
-                        } else if (t == 2) {
-                            key2++;
-                        } else {
-                            key3++;
+        //判断文件属于1施工,2监理,还是3业主
+        if (list != null && list.size() > 0) {
+            for (ArchiveFileVO l : list) {
+                String type = l.getContractType();
+                if (StringUtils.isBlank(type)) {
+                    //业主
+                    key3++;
+                } else if ("S".equals(type)) {
+                    //监理
+                    key2++;
+                } else if ("C".equals(type)) {
+                    //施工
+                    key1++;
+                } else if (type.length() > 10) {
+                    for (ContractInfo info : infos) {
+                        if (type.equals(info.getId() + "")) {
+                            Integer t = info.getContractType();
+                            if (t == 1) {
+                                key1++;
+                            } else if (t == 2) {
+                                key2++;
+                            } else {
+                                key3++;
+                            }
+                            break;
                         }
-                        break;
                     }
+                } else {
+                    System.out.println(type);
+                }
+            }
+        }else {
+            List<ArchivesAutoVO> autos = fileMapper.getAllArchiveAutoByContractType(projectId);
+            for (ArchivesAutoVO l : autos) {
+                String type = l.getContractType();
+                if (StringUtils.isBlank(type)) {
+                    //业主
+                    key3++;
+                } else if ("S".equals(type)) {
+                    //监理
+                    key2++;
+                } else if ("C".equals(type)) {
+                    //施工
+                    key1++;
+                } else if (type.length() > 10) {
+                    for (ContractInfo info : infos) {
+                        if (type.equals(info.getId() + "")) {
+                            Integer t = info.getContractType();
+                            if (t == 1) {
+                                key1++;
+                            } else if (t == 2) {
+                                key2++;
+                            } else {
+                                key3++;
+                            }
+                            break;
+                        }
+                    }
+                } else {
+                    System.out.println(type);
                 }
-            } else {
-                System.out.println(type);
             }
         }
         List<Map<String, Object>> mapList = new ArrayList<>();

+ 3 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/ArchiveFileMapper.java

@@ -17,6 +17,8 @@
 package org.springblade.business.mapper;
 
 import org.apache.ibatis.annotations.Param;
+import org.springblade.archive.entity.ArchivesAuto;
+import org.springblade.archive.vo.ArchivesAutoVO;
 import org.springblade.business.entity.ArchiveFile;
 import org.springblade.business.vo.ArchiveFileVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -94,4 +96,5 @@ public interface ArchiveFileMapper extends BaseMapper<ArchiveFile> {
     List<ArchiveFile> getListByContractId(@Param("contractId") Long contractId);
 
 
+    List<ArchivesAutoVO> getAllArchiveAutoByContractType(@Param("projectId") Long projectId);
 }

+ 6 - 1
blade-service/blade-business/src/main/java/org/springblade/business/mapper/ArchiveFileMapper.xml

@@ -395,5 +395,10 @@
         from u_archive_file
         where contract_id = #{contractId} and is_deleted = 0 and source_type = 1;
     </select>
-
+    <select id="getAllArchiveAutoByContractType" resultType="org.springblade.archive.vo.ArchivesAutoVO">
+        SELECT uaa.*, matc.tree_code as 'contractType'
+        FROM u_archives_auto uaa
+                 left join m_archive_tree_contract matc on uaa.node_id = matc.id
+        WHERE uaa.project_id = #{projectId} and uaa.is_deleted = 0
+    </select>
 </mapper>

+ 3 - 0
blade-service/blade-control/src/main/java/org/springblade/control/service/impl/ProjectCostBudgetServiceImpl.java

@@ -29,6 +29,7 @@ import org.springframework.transaction.annotation.Transactional;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.time.LocalDate;
+import java.time.LocalDateTime;
 import java.time.temporal.ChronoUnit;
 import java.time.temporal.TemporalAdjusters;
 import java.util.*;
@@ -1205,6 +1206,8 @@ public class ProjectCostBudgetServiceImpl extends BaseServiceImpl<ProjectCostBud
      */
     @Override
     public void taskFinishedStats(Long PlanId, LocalDate practicalFinishTime) {
+        System.out.println("计划实际结束时间"+practicalFinishTime);
+        System.out.println("今天"+ LocalDateTime.now());
         if (practicalFinishTime == null){
             throw new ServiceException("请传入任务完成时间");
         }