JiangPengLi 3 months ago
parent
commit
748922877f

+ 12 - 1
projects-service/src/main/java/com/rtrh/projects/modules/projects/mapper/SubInfoMapper.java

@@ -106,7 +106,16 @@ public interface SubInfoMapper {
     @Update("update sub_info set amt_comp = #{sub.amtComp}, yb_content = #{sub.ybContent} where id = #{sub.id}")
     void update(@Param("sub") SubInfo subInfo);
 
-    List<SmzkDetailVo> exportSmzkDetailExcel(@Param("subName") String subName,@Param("subjectId") String subjectId,@Param("indusKinds") List<String> indusKinds,@Param("startAmt") String startAmt,@Param("endAmt") String endAmt, @Param("sbdw") String sbdw, @Param("subjectIds") List<String> subjectIds);
+    List<SmzkDetailVo> exportSmzkDetailExcel(@Param("subName") String subName,
+                                             @Param("subjectId") String subjectId,
+                                             @Param("indusKinds") List<String> indusKinds,
+                                             @Param("startAmt") String startAmt,
+                                             @Param("endAmt") String endAmt,
+                                             @Param("sbdw") String sbdw,
+                                             @Param("subjectIds") List<String> subjectIds,
+                                             @Param("statusRed")  String statusRed,
+                                             @Param("statusList") List<String> statusList
+    );
 
     
     void batchUpdate(@Param("list") List<SmzkDetailVo> list);
@@ -121,4 +130,6 @@ public interface SubInfoMapper {
     void editStatusRedLight(@Param("vo") SubInfoGxj vo);
 
     List<Map<String, Object>> querySubInfoStatusByIds(@Param("ids") List<String> ids);
+
+    List<String> queryIds();
 }

+ 20 - 1
projects-service/src/main/java/com/rtrh/projects/modules/projects/mapper/SubInfoMapper.xml

@@ -82,6 +82,22 @@
         <if test="endAmt != null and endAmt != ''">
             AND sub_info.amt_total &lt;= #{endAmt}
         </if>
+        <if test="statusList!=null and statusList.size()>0">
+            and sub_info.status IN
+            <foreach collection="statusList" item="item" separator="," open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="statusRed!=null and statusRed!=''">
+            <choose>
+                <when test="statusRed==0">
+                    and (sub_info.status_red = '0' or sub_info.status_red is null)
+                </when>
+                <otherwise>
+                    and sub_info.status_red = #{statusRed}
+                </otherwise>
+            </choose>
+        </if>
     </select>
 
 
@@ -322,7 +338,7 @@
     </select>
     <select id="queryStatistics" resultType="com.rtrh.projects.modules.projects.po.SubInfoGxj">
         select
-            status,abc,subject_id subjectId,indus_kind indusKind,is_rg AS boolRg,
+            sub_id subId,status,abc,subject_id subjectId,indus_kind indusKind,is_rg AS boolRg,
             status_red statusRed
         from sub_info
         <where>
@@ -1308,4 +1324,7 @@
             #{id}
         </foreach>
     </select>
+    <select id="queryIds" resultType="java.lang.String">
+        select id from sub_info
+    </select>
 </mapper>

+ 14 - 2
projects-service/src/main/java/com/rtrh/projects/modules/projects/service/impl/SubCameraServiceImpl.java

@@ -9,9 +9,11 @@ import java.util.Map;
 import java.util.Objects;
 import java.util.stream.Collectors;
 
+import com.alibaba.fastjson.JSON;
 import com.rtrh.projects.modules.projects.mapper.SubCameraMapper;
 import com.rtrh.projects.modules.projects.mapper.SubInfoMapper;
 import com.rtrh.projects.modules.projects.po.SubInfoGxj;
+import com.rtrh.projects.util.HttpClientUtil;
 import com.rtrh.projects.util.TargetDataSource;
 import org.hibernate.criterion.Criterion;
 import org.hibernate.criterion.DetachedCriteria;
@@ -282,12 +284,17 @@ public class SubCameraServiceImpl implements SubCameraService {
     }
 
     @Override
-    @TargetDataSource(value = "secondary")
+    // @TargetDataSource(value = "secondary")
     public SubInfoCameraVO getListBySubIdNew(String subId) {
         SubInfoCameraVO subInfoCameraVO=new SubInfoCameraVO();
         SubInfo subInfo=  subInfoMapper.findByFgwId(subId);
         BeanUtils.copyProperties(subInfo,subInfoCameraVO);
-        List<SubCamera> list=subCameraMapper.getListCameraBySubId(subId);
+        Object o = HttpClientUtil.fgwGetRequest("/outApi/remote/getListCameraBySubId?subId=" + subId);
+        List<SubCamera> list = new ArrayList<>();
+        if (o != null) {
+             list = JSON.parseArray(JSON.toJSONString(o), SubCamera.class);
+        }
+        // List<SubCamera> list=subCameraMapper.getListCameraBySubId(subId);
         subInfoCameraVO.setList(list);
         return subInfoCameraVO;
     }
@@ -388,6 +395,11 @@ public class SubCameraServiceImpl implements SubCameraService {
     public List<Map<String, Object>> cameraTreeNew(String subId) {
         List<Map<String, Object>> result = new ArrayList<>();
         List<CameraTreeVO> cameraTreeData = subCameraMapper.cameraTreeNew(subId);
+        // List<CameraTreeVO> cameraTreeData = new ArrayList<>();
+        // Object o = HttpClientUtil.fgwGetRequest("/outApi/remote/cameraTreeNew?subId=" + subId);
+        // if (o != null) {
+        //     cameraTreeData = JSON.parseArray(JSON.toJSONString(o), CameraTreeVO.class);
+        // }
         if(CollectionUtil.isNotEmpty(cameraTreeData)) {
             Map<String, List<CameraTreeVO>> collect = cameraTreeData.stream().collect(Collectors.groupingBy(CameraTreeVO::getSubId));
             collect.keySet().forEach(item->{

+ 1 - 1
projects-service/src/main/java/com/rtrh/projects/modules/projects/service/impl/SubInfoQueryServiceImpl.java

@@ -1453,7 +1453,7 @@ public class SubInfoQueryServiceImpl implements SubInfoQueryService {
 
     @Override
     public List<String> queryIds() {
-        return null;
+        return (List<String>) subInfoDao.queryForObjListBySql("select id from sub_info");
     }
 
     private Map<String, Object> getStringObjectMap(List<SubInfoGxj> list) {

+ 46 - 6
projects-service/src/main/java/com/rtrh/projects/modules/projects/service/impl/SubInfoServiceImpl.java

@@ -7,8 +7,11 @@ import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.time.LocalDate;
 import java.util.*;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 
+import cn.hutool.core.collection.CollUtil;
+import com.alibaba.fastjson.JSON;
 import com.rtrh.core.vo.Message;
 import com.rtrh.projects.modules.projects.dao.*;
 import com.rtrh.projects.modules.projects.dto.QTDTO;
@@ -24,7 +27,9 @@ import com.rtrh.projects.modules.system.po.*;
 import com.rtrh.projects.modules.system.service.ISubInduService;
 import com.rtrh.projects.modules.utils.DateUtils;
 import com.rtrh.projects.outapi.vo.StaticsVO;
+import com.rtrh.projects.util.HttpClientUtil;
 import com.rtrh.projects.util.TargetDataSource;
+import com.rtrh.projects.vo.RemoteRequestDto;
 import com.rtrh.projects.vo.SubIdVO;
 import com.rtrh.projects.vo.subject.MoveDbParamVo;
 import com.rtrh.projects.vo.subject.SubinfoPreQueryVo;
@@ -5344,10 +5349,34 @@ public class SubInfoServiceImpl implements SubInfoService {
         return list;
     }
 
-    @TargetDataSource("secondary")
+    // @TargetDataSource("secondary")
     @Override
     public List<WorkBenchVO> queryExceedMonthlySize(String lastMonth) {
-        return subInfoMapper.queryExceedMonthly(lastMonth);
+        List<SubInfoGxj> list = subInfoMapper.queryStatistics(new SubInfoQueryTzVO().setStatus("3"));
+        if (CollUtil.isNotEmpty(list)){
+            List<String> ids = new ArrayList<>();
+            Map<String, SubInfoGxj> map = list.stream()
+                    .peek(e -> ids.add(e.getSubId()))
+                    .collect(Collectors.toMap(SubInfoGxj::getSubId, Function.identity(), (v1, v2) -> v1));
+            RemoteRequestDto dto = new RemoteRequestDto()
+                    .setMonth(lastMonth)
+                    .setIds(ids);
+            Object o = HttpClientUtil.fgwPostRequest("/outApi/remote/queryExceedMonthly", dto);
+            if (o != null) {
+                List<WorkBenchVO> list1 = JSON.parseArray(JSON.toJSONString(o), WorkBenchVO.class);
+                list1.forEach(e->{
+                    SubInfoGxj subInfoGxj = map.get(e.getId());
+                    if (subInfoGxj != null) {
+                        e.setSubjectId(subInfoGxj.getSubjectId());
+                        e.setIndusKind(subInfoGxj.getIndusKind());
+                        e.setAmtTotal(subInfoGxj.getAmtTotal());
+                    }
+                });
+                return list1;
+            }
+        }
+        return new ArrayList<>();
+        // return subInfoMapper.queryExceedMonthly(lastMonth);
     }
 
     @Override
@@ -5362,11 +5391,11 @@ public class SubInfoServiceImpl implements SubInfoService {
      * 月报超期
      */
     @Override
-    @TargetDataSource("secondary")
+    // @TargetDataSource("secondary")
     public Map<String, Object> queryExceedMonthly(LoginUserVO loginUser, PreWarnDataQueryVO queryVO) {
         String lastMonth = DateUtil.format(DateUtil.offsetMonth(DateUtil.date(), -1), "yyyyMM");
         int dayOfMonth = DateUtil.dayOfMonth(new Date());
-        List<WorkBenchVO> list;
+        List<WorkBenchVO> list = new ArrayList<>();
         if (dayOfMonth < 5) {
             return new HashMap<String, Object>(){{
                 put("listSubject", new ArrayList<>());
@@ -5374,7 +5403,8 @@ public class SubInfoServiceImpl implements SubInfoService {
                 put("listIndusKind", new ArrayList<>());
             }};
         }else {
-            list = subInfoMapper.queryExceedMonthly(lastMonth);
+            list = this.queryExceedMonthlySize(lastMonth);
+            // list = subInfoMapper.queryExceedMonthly(lastMonth);
             return getStringObjectMapSecond(list);
         }
     }
@@ -5443,7 +5473,17 @@ public class SubInfoServiceImpl implements SubInfoService {
 
         // 查询所有的重点项目信息,若结果为空则初始化为一个空列表
         List<SmzkDetailVo> dataList = Optional.ofNullable(
-                subInfoMapper.exportSmzkDetailExcel(vo.getSubName(),vo.getSubjectId(),indusKinds,vo.getStartAmt(),vo.getEndAmt(),vo.getSbdw(),subjectIds)
+                subInfoMapper.exportSmzkDetailExcel(
+                        vo.getSubName(),
+                        vo.getSubjectId(),
+                        indusKinds,
+                        vo.getStartAmt(),
+                        vo.getEndAmt(),
+                        vo.getSbdw(),
+                        subjectIds,
+                        vo.getStatusRed(),
+                        vo.getStatusList()
+                )
         ).orElse(Collections.emptyList());
 
 

+ 4 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/vo/LogOperateVO.java

@@ -24,4 +24,8 @@ public class LogOperateVO extends LogOperate {
     private String subjectId;
     private String indusKind;
     private BigDecimal amtTotal;
+
+    public BigDecimal getAmtTotal() {
+        return amtTotal == null ? BigDecimal.ZERO : amtTotal;
+    }
 }

+ 2 - 1
projects-service/src/main/java/com/rtrh/projects/vo/RemoteRequestDto.java

@@ -19,6 +19,7 @@ public class RemoteRequestDto implements Serializable {
     private Page page;
     private SubinfoPreQueryVo queryVO;
     private LoginUserVO userVO;
-    private List<String> subIds;
+    private List<String> ids;
+    private String month;
 
 }

+ 1 - 1
projects/src/main/java/com/rtrh/projects/web/controller/subject/SubInfoExportController.java

@@ -1311,7 +1311,7 @@ public class SubInfoExportController extends BaseController {
             groupBoundaries.put("50-100亿元", new BigDecimal("1000000"));
             Map<String, List<SubInfoTotalExcel>> scaleGroupList = list.stream().collect(Collectors.groupingBy(transaction -> {
                 for (Map.Entry<String, BigDecimal> entry : groupBoundaries.entrySet()) {
-                    if (transaction.getAmtTotal().compareTo(entry.getValue()) < 0) {
+                    if ((transaction.getAmtTotal() == null?BigDecimal.ZERO:transaction.getAmtTotal()).compareTo(entry.getValue()) < 0) {
                         return entry.getKey();
                     }
                 }

+ 12 - 12
projects/src/main/java/com/rtrh/projects/web/controller/subject/api/SubInfoApiController.java

@@ -1356,19 +1356,19 @@ public class SubInfoApiController extends BaseController {
     public ListMessage pageQueryRreDepartment(@RequestBody Page page, @RequestBody SubinfoPreQueryVo queryVO) {
         ListMessage message = new ListMessage();
         try {
-            List<String> subIds = subInfoQueryService.queryIds();
-            Object o = HttpClientUtil.fgwPostRequest("/outApi/remote/pageQueryRreDepartment",
-                    new RemoteRequestDto()
-                            .setPage(page)
-                            .setQueryVO(queryVO)
-                            .setUserVO(getCurUser().getLoginUser())
-                            .setSubIds(subIds)
-            );
-            if (o!=null){
-                Page pageData = JSON.parseObject(JSON.toJSONString(o), Page.class);
-                // Page pageData = subInfoService.pageQueryRreDepartment(page, queryVO, getCurUser().getLoginUser());
+            // List<String> subIds = subInfoQueryService.queryIds();
+            // Object o = HttpClientUtil.fgwPostRequest("/outApi/remote/pageQueryRreDepartment",
+            //         new RemoteRequestDto()
+            //                 .setPage(page)
+            //                 .setQueryVO(queryVO)
+            //                 .setUserVO(getCurUser().getLoginUser())
+            //                 .setSubIds(subIds)
+            // );
+            // if (o!=null){
+            //     Page pageData = JSON.parseObject(JSON.toJSONString(o), Page.class);
+                Page pageData = subInfoService.pageQueryRreDepartment(page, queryVO, getCurUser().getLoginUser());
                 message.add(pageData.getList(), pageData.getTotalCount());
-            }
+            // }
 
         } catch (Exception e) {
             logger.error("", e);

+ 3 - 0
projects/src/main/webapp/vmodules/subject/subInfo/tz/xmzk.jsp

@@ -908,6 +908,7 @@
             getData: function () {
                 var self = this;
                 var param = this.getSearchParams();
+                console.log("param====getData",param)
                 param.pageNo = this.pageNo;
                 param.pageSize = this.pageSize;
                 param.orderBy = this.sort.field;
@@ -978,6 +979,7 @@
             },
             getStatusName: function (status) {
                 const statusMap = {
+                    '0': '待处理',
                     '1': '储备',
                     '2': '新建',
                     '3': '在建',
@@ -1195,6 +1197,7 @@
             },
             exportFixDetailExcel: function () {
                 var param = this.getSearchParams();
+                console.log("param====",param)
                 App.common.utils.downFile(App.getUrl("/subInfoExport/exportXmzkDetailExcel"), "POST", param, "项目明细表(总库).xlsx", "导出失败");
             },
             exportAnalysis: function () {