JiangPengLi 2 maanden geleden
bovenliggende
commit
73be8ef12f

+ 5 - 2
projects-service/src/main/java/com/rtrh/projects/modules/projects/enums/SubInfoStatusEnum.java

@@ -4,9 +4,11 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.AllArgsConstructor;
 import lombok.Getter;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 /**
  * 4库 项目状态
@@ -16,6 +18,7 @@ import java.util.stream.Collectors;
 @JsonFormat(shape = JsonFormat.Shape.OBJECT)
 public enum SubInfoStatusEnum {
 
+    DCL("0", "待处理"),
     CB("1", "储备"),
     XJ("2", "新建"),
     ZJ("3", "在建"),
@@ -39,10 +42,10 @@ public enum SubInfoStatusEnum {
     }
 
     public static List<String> getValidCodeList() {
-        return Arrays.stream(values()).filter(x -> !x.equals(REMOVE)).map(x -> x.code).collect(Collectors.toList());
+        return Stream.of(CB, XJ, ZJ, TC).map(x -> x.code).collect(Collectors.toList());
     }
 
     public static List<SubInfoStatusEnum> getValidEnumList() {
-        return Arrays.stream(values()).filter(x -> !x.equals(REMOVE)).collect(Collectors.toList());
+        return Arrays.asList(CB, XJ, ZJ, TC);
     }
 }

+ 2 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/mapper/SubInfoMapper.java

@@ -119,4 +119,6 @@ public interface SubInfoMapper {
     void cancelRemove(@Param("id")String id);
 
     void editStatusRedLight(@Param("vo") SubInfoGxj vo);
+
+    List<Map<String, Object>> querySubInfoStatusByIds(@Param("ids") List<String> ids);
 }

+ 15 - 3
projects-service/src/main/java/com/rtrh/projects/modules/projects/mapper/SubInfoMapper.xml

@@ -257,7 +257,7 @@
                 and s.amt_total >= #{vo.startAmt}
             </if>
             <if test="vo.endAmt!=null and vo.endAmt!=''">
-                and s.amt_total &lt;= #{vo.endAmt}
+                and s.amt_total &lt; #{vo.endAmt}
             </if>
             <if test="vo.sbdw!=null and vo.sbdw!=''">
                 and s.unit_desc = #{vo.sbdw}
@@ -349,7 +349,7 @@
                 and amt_total >= #{vo.startAmt}
             </if>
             <if test="vo.endAmt!=null and vo.endAmt!=''">
-                and amt_total &lt;= #{vo.endAmt}
+                and amt_total &lt; #{vo.endAmt}
             </if>
             <if test="vo.sbdw!=null and vo.sbdw!=''">
                 and unit_desc = #{vo.sbdw}
@@ -588,7 +588,7 @@
                 and sub_info.amt_total >= #{vo.startAmt}
             </if>
             <if test="vo.endAmt!=null and vo.endAmt!=''">
-                and sub_info.amt_total &lt;= #{vo.endAmt}
+                and sub_info.amt_total &lt; #{vo.endAmt}
             </if>
             <if test="vo.sbdw!=null and vo.sbdw!=''">
                 and sub_info.unit_desc = #{vo.sbdw}
@@ -1280,4 +1280,16 @@
         GROUP BY
         a.id
     </select>
+    <select id="querySubInfoStatusByIds" resultType="java.util.Map">
+        select
+            status,
+            sub_id
+        from
+            sub_info
+        where
+            sub_id in
+        <foreach collection="ids" item="id" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </select>
 </mapper>

+ 2 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/service/SubInfoQueryService.java

@@ -359,4 +359,6 @@ public interface SubInfoQueryService {
 	Map<String, Object> queryStatusCount(LoginUserVO loginUser, SubInfoQueryTzVO subInfoQueryTzVO);
 
 	Map<String, Object> problemLightStatistics(LoginUserVO loginUser, SubInfoQueryTzVO queryVO);
+
+	List<Map<String, Object>> querySubInfoStatusByIds(List<String> ids);
 }

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

@@ -1428,6 +1428,11 @@ public class SubInfoQueryServiceImpl implements SubInfoQueryService {
         }};
     }
 
+    @Override
+    public List<Map<String, Object>> querySubInfoStatusByIds(List<String> ids) {
+        return subInfoMapper.querySubInfoStatusByIds(ids);
+    }
+
     private Map<String, Object> getStringObjectMap(List<SubInfoGxj> list) {
         Map<String, Object> resultMap = new HashMap<>();
         if (com.rtrh.common.util.CollectionUtil.isNotEmpty(list)){

+ 30 - 0
projects/src/main/java/com/rtrh/projects/outapi/controller/sync/RemoteRequestController.java

@@ -0,0 +1,30 @@
+package com.rtrh.projects.outapi.controller.sync;
+
+import com.rtrh.core.vo.Message;
+import com.rtrh.projects.modules.projects.service.SubInfoQueryService;
+import com.rtrh.projects.outapi.base.AuthenticateType;
+import com.rtrh.projects.outapi.base.TokenAuthenticate;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+@RestController
+@RequestMapping("/outApi/remote")
+public class RemoteRequestController {
+    @Resource
+    private SubInfoQueryService subInfoQueryService;
+
+    @PostMapping("/querySubInfoStatusByIds")
+    @TokenAuthenticate(AuthenticateType.NONE)
+    public Message querySubInfoStatusByIds(@RequestBody List<String> ids) {
+        List<Map<String,Object>> list = subInfoQueryService.querySubInfoStatusByIds(ids);
+        Message message = new Message();
+        message.setData(list);
+        return message;
+    }
+}

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

@@ -746,7 +746,7 @@ public class SubInfoExportController extends BaseController {
             LinkedHashMap<String, List<SubInfoTotalExcel>> industryList = subInfoTotalExcel.stream().collect(Collectors.groupingBy(SubInfoTotalExcel::getInduskind, LinkedHashMap::new, Collectors.toList()));
 
             //遍历subInfoTotalExcel数据计算总金额
-            BigDecimal totalAmt = subInfoTotalExcel.stream().map(SubInfoTotalExcel::getAmtTotal).reduce(BigDecimal.ZERO, BigDecimal::add);
+            BigDecimal totalAmt = subInfoTotalExcel.stream().map(e->Optional.ofNullable(e.getAmtTotal()).orElse(BigDecimal.ZERO)).reduce(BigDecimal.ZERO, BigDecimal::add);
             Integer totalNum = subInfoTotalExcel.size();
 
             LinkedHashMap<String, List<List<String>>> finalDataMap = new LinkedHashMap<>();
@@ -758,7 +758,7 @@ public class SubInfoExportController extends BaseController {
                 data.add("按属地分");
                 data.add(subInfoListEntry.getKey());
                 data.add(String.valueOf(subInfoListEntry.getValue().size()));
-                data.add(String.valueOf(subInfoListEntry.getValue().stream().map(SubInfoTotalExcel::getAmtTotal).reduce(BigDecimal.ZERO, BigDecimal::add)));
+                data.add(String.valueOf(subInfoListEntry.getValue().stream().map(e->Optional.ofNullable(e.getAmtTotal()).orElse(BigDecimal.ZERO)).reduce(BigDecimal.ZERO, BigDecimal::add)));
                 areaData.add(data);
             }
             finalDataMap.put("按属地划分", areaData);
@@ -770,7 +770,7 @@ public class SubInfoExportController extends BaseController {
                     data.add("按规模划分");
                     data.add(subInfoListEntry.getKey());
                     data.add(String.valueOf(subInfoListEntry.getValue().size()));
-                    data.add(String.valueOf(subInfoListEntry.getValue().stream().map(SubInfoTotalExcel::getAmtTotal).reduce(BigDecimal.ZERO, BigDecimal::add)));
+                    data.add(String.valueOf(subInfoListEntry.getValue().stream().map(e->Optional.ofNullable(e.getAmtTotal()).orElse(BigDecimal.ZERO)).reduce(BigDecimal.ZERO, BigDecimal::add)));
                     moneyData.add(data);
                 }
                 finalDataMap.put("按规模划分", moneyData);
@@ -782,7 +782,7 @@ public class SubInfoExportController extends BaseController {
                 data.add("按行业分");
                 data.add(subInfoListEntry.getKey());
                 data.add(String.valueOf(subInfoListEntry.getValue().size()));
-                data.add(String.valueOf(subInfoListEntry.getValue().stream().map(SubInfoTotalExcel::getAmtTotal).reduce(BigDecimal.ZERO, BigDecimal::add)));
+                data.add(String.valueOf(subInfoListEntry.getValue().stream().map(e->Optional.ofNullable(e.getAmtTotal()).orElse(BigDecimal.ZERO)).reduce(BigDecimal.ZERO, BigDecimal::add)));
                 industryData.add(data);
             }
             finalDataMap.put("按行业划分", industryData);
@@ -1280,7 +1280,9 @@ public class SubInfoExportController extends BaseController {
             statusGroupList.forEach((key, value) -> {
                 SubInfoStatusEnum anEnum = SubInfoStatusEnum.getEnum(key);
                 String statusRate = new BigDecimal(value.size()).multiply(new BigDecimal(100)).divide(new BigDecimal(list.size()), 2, RoundingMode.HALF_UP) + "%";
-                BigDecimal totalAmt = value.stream().map(SubInfoTotalExcel::getAmtTotal).reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP);
+                BigDecimal totalAmt = value.stream()
+                        .map(e->Optional.ofNullable(e.getAmtTotal()).orElse(BigDecimal.ZERO))
+                        .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP);
                 String format = String.format("%s项目%s个,占工业项目总数的%s,计划总投资%s亿元;", anEnum.getDesc(), value.size(), statusRate, totalAmt);
                 statusStrBuilder.append(format);
             });
@@ -1292,7 +1294,9 @@ public class SubInfoExportController extends BaseController {
             Map<String, List<SubInfoTotalExcel>> subjectGroupList = list.stream().collect(Collectors.groupingBy(SubInfoTotalExcel::getSubjectId));
             subjectGroupList.forEach((key, value) -> {
                 String rate = new BigDecimal(value.size()).multiply(new BigDecimal(100)).divide(new BigDecimal(list.size()), 2, RoundingMode.HALF_UP) + "%";
-                BigDecimal totalAmt = value.stream().map(SubInfoTotalExcel::getAmtTotal).reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP);
+                BigDecimal totalAmt = value.stream()
+                        .map(e->Optional.ofNullable(e.getAmtTotal()).orElse(BigDecimal.ZERO))
+                        .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP);
                 String format = String.format("%s%s个,占工业项目总数的%s,计划总投资%s亿元;", jsddMap.get(key), value.size(), rate, totalAmt);
                 subjectStrBuilder.append(format);
             });
@@ -1315,7 +1319,9 @@ public class SubInfoExportController extends BaseController {
             }));
             scaleGroupList.forEach((key, value) -> {
                 String rate = new BigDecimal(value.size()).multiply(new BigDecimal(100)).divide(new BigDecimal(list.size()), 2, RoundingMode.HALF_UP) + "%";
-                BigDecimal totalAmt = value.stream().map(SubInfoTotalExcel::getAmtTotal).reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP);
+                BigDecimal totalAmt = value.stream()
+                        .map(e->Optional.ofNullable(e.getAmtTotal()).orElse(BigDecimal.ZERO))
+                        .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP);
                 String format = String.format("计划总投资%s项目%s个,占工业项目总数的%s,计划总投资%s亿元;", key, value.size(), rate, totalAmt);
                 scaleStrBuilder.append(format);
             });
@@ -1335,7 +1341,9 @@ public class SubInfoExportController extends BaseController {
                     }));
             hyGroupList.forEach((key, value) -> {
                 String rate = new BigDecimal(value.size()).multiply(new BigDecimal(100)).divide(new BigDecimal(list.size()), 2, RoundingMode.HALF_UP) + "%";
-                BigDecimal totalAmt = value.stream().map(SubInfoTotalExcel::getAmtTotal).reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP);
+                BigDecimal totalAmt = value.stream()
+                        .map(e->Optional.ofNullable(e.getAmtTotal()).orElse(BigDecimal.ZERO))
+                        .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP);
                 String format = String.format("%s项目%s个,占工业项目总数的%s,计划总投资%s亿元;", hyflMap.getOrDefault(key, key), value.size(), rate, totalAmt);
                 hyStrBuilder.append(format);
             });
@@ -1834,7 +1842,7 @@ public class SubInfoExportController extends BaseController {
                             jsddMap.getOrDefault(entry.getKey(), entry.getKey()),
                             entry.getValue().size(),
                             entry.getValue().stream()
-                                    .map(SubInfoTotalExcel::getAmtTotal)
+                                    .map(e->Optional.ofNullable(e.getAmtTotal()).orElse(BigDecimal.ZERO))
                                     .reduce(BigDecimal.ZERO, BigDecimal::add)
                                     .divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP)
                     ))
@@ -1874,7 +1882,7 @@ public class SubInfoExportController extends BaseController {
                             entry.getKey(),
                             entry.getValue().size(),
                             entry.getValue().stream()
-                                    .map(SubInfoTotalExcel::getAmtTotal)
+                                    .map(e->Optional.ofNullable(e.getAmtTotal()).orElse(BigDecimal.ZERO))
                                     .reduce(BigDecimal.ZERO, BigDecimal::add)
                                     .divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP)
                     ))
@@ -1908,7 +1916,7 @@ public class SubInfoExportController extends BaseController {
                                     hyflMap.getOrDefault(entry.getKey(), entry.getKey()),
                                     entry.getValue().size(),
                                     entry.getValue().stream()
-                                            .map(SubInfoTotalExcel::getAmtTotal)
+                                            .map(e->Optional.ofNullable(e.getAmtTotal()).orElse(BigDecimal.ZERO))
                                             .reduce(BigDecimal.ZERO, BigDecimal::add)
                                             .divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP)
                             )
@@ -1928,7 +1936,9 @@ public class SubInfoExportController extends BaseController {
             exportData.addAll(ddList);
             exportData.addAll(amtList);
             exportData.addAll(hyList);
-            BigDecimal reduce = list.stream().map(SubInfoTotalExcel::getAmtTotal).reduce(BigDecimal.ZERO, BigDecimal::add);
+            BigDecimal reduce = list.stream()
+                    .map(e->Optional.ofNullable(e.getAmtTotal()).orElse(BigDecimal.ZERO))
+                    .reduce(BigDecimal.ZERO, BigDecimal::add);
             exportData.add(new SubInfoTotalInfoVO("合计", "合计", list.size(), reduce.divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP)));
             // 4.导出
             ExportParams exportParams = null;
@@ -2075,7 +2085,10 @@ public class SubInfoExportController extends BaseController {
         collect.forEach((key, value) -> {
             map.put(key, Collections.singletonList(new LinkedHashMap<String, Object>() {{
                 put("count", value.size());
-                BigDecimal reduce = value.stream().map(SubInfoTotalExcel::getAmtTotal).reduce(BigDecimal.ZERO, BigDecimal::add);
+                BigDecimal reduce = value.stream()
+                        .map(e->Optional.ofNullable(e.getAmtTotal()).orElse(BigDecimal.ZERO))
+                        .map(amt -> Optional.ofNullable(amt).orElse(BigDecimal.ZERO))
+                        .reduce(BigDecimal.ZERO, BigDecimal::add);
                 put("amt", reduce.divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP));
             }}));
         });
@@ -2085,7 +2098,7 @@ public class SubInfoExportController extends BaseController {
 
         // 合计列
         BigDecimal cbAmtSum = statusGroup.stream()
-                .map(SubInfoTotalExcel::getAmtTotal)
+                .map(e->Optional.ofNullable(e.getAmtTotal()).orElse(BigDecimal.ZERO))
                 .reduce(BigDecimal.ZERO, BigDecimal::add);
         rowMap.put("hj", Collections.singletonList(new LinkedHashMap<String, Object>() {{
             put("count", statusGroup.size());
@@ -2138,7 +2151,7 @@ public class SubInfoExportController extends BaseController {
 
             // 写入合计行
             BigDecimal totalAmt = subInfoTotalExcel.stream()
-                    .map(SubInfoFixDetail::getAmtTotal)
+                    .map(e->Optional.ofNullable(e.getAmtTotal()).orElse(BigDecimal.ZERO))
                     .reduce(BigDecimal.ZERO, BigDecimal::add);
             writer.writeRow(CollUtil.newArrayList(
                     "合计(" + subInfoTotalExcel.size() + "个)", "", "", "", totalAmt.toString(), "", "", ""));
@@ -2255,7 +2268,7 @@ public class SubInfoExportController extends BaseController {
 
             // 写入合计行
             BigDecimal totalAmt = subInfoTotalExcel.stream()
-                    .map(SubInfoFixCbDetail::getAmtTotal)
+                    .map(e->Optional.ofNullable(e.getAmtTotal()).orElse(BigDecimal.ZERO))
                     .reduce(BigDecimal.ZERO, BigDecimal::add);
             writer.writeRow(CollUtil.newArrayList(
                     "合计(" + subInfoTotalExcel.size() + "个)", "", "", "", totalAmt.toString(), "", ""));
@@ -2355,7 +2368,7 @@ public class SubInfoExportController extends BaseController {
 
             // 写入合计行
             BigDecimal totalAmt = subInfoTotalExcel.stream()
-                    .map(SubInfoFixZjDetail::getAmtTotal)
+                    .map(e->Optional.ofNullable(e.getAmtTotal()).orElse(BigDecimal.ZERO))
                     .reduce(BigDecimal.ZERO, BigDecimal::add);
             writer.writeRow(CollUtil.newArrayList(
                     "合计(" + subInfoTotalExcel.size() + "个)", "", "", "", totalAmt.toString(), "", ""));

+ 2 - 0
projects/src/main/resources/rtrh-crypto.xml

@@ -19,6 +19,7 @@
 				<value>/outApi/subInfoExport/**</value>
 				<value>/outApi/auth/gxjLogin</value>
 				<value>/outApi/sync/**</value>
+				<value>/outApi/remote/**</value>
 				<value>/pdfHtml/**</value>
 				<value>/api/jumpLogin</value>
 			</list>
@@ -29,6 +30,7 @@
 				<value>/outApi/subInfoExport/**</value>
 				<value>/outApi/auth/gxjLogin</value>
 				<value>/outApi/sync/**</value>
+				<value>/outApi/remote/**</value>
 				<value>/pdfHtml/**</value>
 				<value>/api/jumpLogin</value>
 			</list>

+ 2 - 2
projects/src/main/webapp/vmodules/statics/analysisScreen_four.jsp

@@ -764,8 +764,8 @@
 
                 document.querySelector('#center-center-data7').textContent =  addreData[4].num
                 document.querySelector('#center-center-data8').textContent =  addreData[4].amt
-                document.querySelector('#center-center-light-data7').textContent = addreData[3].num_r
-                document.querySelector('#center-center-light-data8').textContent =  addreData[3].num_h
+                document.querySelector('#center-center-light-data7').textContent = addreData[4].num_r
+                document.querySelector('#center-center-light-data8').textContent =  addreData[4].num_h
                 console.log(addreData[3].num_h+'=====',)
                 // 更新中间总投资数据
                 const totalAmount = (addreData[1].amt)+(addreData[2].amt)+(addreData[3].amt)+(addreData[4].amt);

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

@@ -725,6 +725,7 @@
                     language: 'zn',
                     data: self.subInfoStatusData
                 });
+                console.log(self.subInfoStatusData)
                 layui.laydate.render({
                     elem: '#year',
                     type: 'year',