소스 검색

试验数据看板

cr 1 일 전
부모
커밋
c0b41ac5b3
20개의 변경된 파일419개의 추가작업 그리고 1개의 파일을 삭제
  1. 14 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialDataBoardApproveVo.java
  2. 13 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialDataBoardApproveVo1.java
  3. 20 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialDataBoardChartVo.java
  4. 21 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialDataBoardCountVO.java
  5. 9 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialMonthReport.java
  6. 56 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialDataBoardController.java
  7. 2 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/EntrustInfoMapper.java
  8. 16 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/EntrustInfoMapper.xml
  9. 2 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialSampleInfoMapper.java
  10. 16 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialSampleInfoMapper.xml
  11. 8 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialSelfInspectionRecordMapper.java
  12. 57 1
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialSelfInspectionRecordMapper.xml
  13. 1 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/IEntrustInfoService.java
  14. 1 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialSampleInfoService.java
  15. 9 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialSelfInspectionRecordService.java
  16. 17 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/TrialDataBoardService.java
  17. 5 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/EntrustInfoServiceImpl.java
  18. 127 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialDataBoardServiceImpl.java
  19. 5 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSampleInfoServiceImpl.java
  20. 20 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java

+ 14 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialDataBoardApproveVo.java

@@ -0,0 +1,14 @@
+package org.springblade.business.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class TrialDataBoardApproveVo {
+    @ApiModelProperty(value = "委托单审批统计")
+    private List<TrialDataBoardApproveVo1> entrustApproveList;
+    @ApiModelProperty(value = "报告审批统计")
+    private List<TrialDataBoardApproveVo1>reportApproveList;
+}

+ 13 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialDataBoardApproveVo1.java

@@ -0,0 +1,13 @@
+package org.springblade.business.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.models.auth.In;
+import lombok.Data;
+
+@Data
+public class TrialDataBoardApproveVo1 {
+    @ApiModelProperty(value = "状态 1未上报 2待审批 3待试验(委托单才有这状态) 4(委托完成/已审批)")
+    private Integer status;
+    @ApiModelProperty(value = "数量")
+    private Integer count;
+}

+ 20 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialDataBoardChartVo.java

@@ -0,0 +1,20 @@
+package org.springblade.business.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class TrialDataBoardChartVo {
+    @ApiModelProperty(value = "施工自检月度报告")
+    private List<TrialMonthReport> sgMonthReport;
+    @ApiModelProperty(value = "监理自检月度报告")
+    private List<TrialMonthReport>jlMonthReport;
+    @ApiModelProperty(value = "业主自检月度报告")
+    private List<TrialMonthReport>yzMonthReport;
+    @ApiModelProperty(value = "所有报告合格数量")
+    private Integer AllQualifiedCount;
+    @ApiModelProperty(value = "所有报告不合格数量")
+    private Integer AllUnQualifiedCount;
+}

+ 21 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialDataBoardCountVO.java

@@ -0,0 +1,21 @@
+package org.springblade.business.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.annotations.ApiOperation;
+import lombok.Data;
+
+@Data
+public class TrialDataBoardCountVO {
+    @ApiModelProperty(value = "样品数量")
+    private Integer sampleCount;
+    @ApiModelProperty(value = "委托数量")
+    private Integer entrustCount;
+    @ApiModelProperty(value = "报告数量")
+    private Integer reportCount;
+    @ApiModelProperty(value = "合格试验数量")
+    private Integer reportQualifiedCount;
+    @ApiModelProperty(value = "不合格试验数量")
+    private Integer reportUnqualifiedCount;
+    @ApiModelProperty(value = "试验合格率")
+    private String reportRate;
+}

+ 9 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialMonthReport.java

@@ -0,0 +1,9 @@
+package org.springblade.business.vo;
+
+import lombok.Data;
+
+@Data
+public class TrialMonthReport {
+    private String month;
+    private Integer count;
+}

+ 56 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialDataBoardController.java

@@ -0,0 +1,56 @@
+package org.springblade.business.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springblade.business.service.TrialDataBoardService;
+import org.springblade.business.vo.TrialDataBoardApproveVo;
+import org.springblade.business.vo.TrialDataBoardCountVO;
+import org.springblade.business.vo.TrialDataBoardChartVo;
+import org.springblade.core.tool.api.R;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+@AllArgsConstructor
+@RequestMapping("/trialDataBoard")
+@Api(value = "试验数据看板", tags = "试验数据看板")
+public class TrialDataBoardController {
+
+    private final TrialDataBoardService trialDataBoardService;
+
+    @GetMapping("/trialDataBoardCount")
+    @ApiOperation("试验数据看板-数量统计")
+    public R<TrialDataBoardCountVO> trialDataBoardCount(Long contractId,Long nodeId){
+        return R.data(trialDataBoardService.trialDataBoardCount(contractId,nodeId));
+    }
+
+    @GetMapping("/trialDataBoardChart")
+    @ApiOperation("试验数据看板-图表统计")
+    public R<TrialDataBoardChartVo> trialDataBoardChart(Long contractId, Long nodeId, String year){
+        return R.data(trialDataBoardService.trialDataBoardChart(contractId,nodeId,year));
+    }
+
+    /**
+     *
+     * @param contractId
+     * @param nodeId
+     * @param type 报告查询(1施工 2监理 3业主)
+     * @return
+     */
+    @GetMapping("/trialDataBoardApprove")
+    @ApiOperation("试验数据看板-审批统计")
+    public R<TrialDataBoardApproveVo>trialDataBoardApprove(Long contractId, Long nodeId, Integer type){
+        return R.data(trialDataBoardService.trialDataBoardApprove(contractId,nodeId,type));
+    }
+
+    @GetMapping("/selectAllYear")
+    @ApiOperation("查询所有年份")
+    public R<List<String>>selectAllYear(Long contractId){
+        return R.data(trialDataBoardService.selectAllYear(contractId));
+    }
+}

+ 2 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/EntrustInfoMapper.java

@@ -59,4 +59,6 @@ public interface EntrustInfoMapper extends BaseMapper<EntrustInfo> {
 	List<EntrustInfo> checkDelete(@Param("ids") List<Long> ids);
 
 	List<EntrustInfo> getRfiList(@Param("ids") List<String> ids,@Param("state") String state);
+
+    Integer selectEntrustInfoCount(@Param("contractId") Long contractId, @Param("nodeIds") List<Long> nodeId);
 }

+ 16 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/EntrustInfoMapper.xml

@@ -180,6 +180,22 @@
             #{id}
         </foreach>
     </select>
+    <select id="selectEntrustInfoCount" resultType="java.lang.Integer">
+        SELECT COUNT(1)
+        FROM u_entrust_info
+        WHERE contract_id = #{contractId}
+        AND is_deleted = 0
+        <if test="nodeIds != null and nodeIds.size() > 0">
+            AND node_id IN (
+            <foreach collection="nodeIds" item="nodeId" separator=",">
+                #{nodeId}
+            </foreach>
+            )
+        </if>
+        <if test="nodeIds == null or nodeIds.size() == 0">
+            AND 1 = 0
+        </if>
+    </select>
 
 
     <delete id="delEntrustInfo" >

+ 2 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialSampleInfoMapper.java

@@ -2,6 +2,7 @@ package org.springblade.business.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Param;
 import org.springblade.business.entity.TrialSampleInfo;
 import org.springblade.business.vo.TrialSampleDataInfoVO;
 import org.springblade.business.vo.TrialSampleInfoVO;
@@ -15,4 +16,5 @@ public interface TrialSampleInfoMapper extends BaseMapper<TrialSampleInfo> {
 
     List<TrialSampleInfoVO> trialSamplePage(IPage<TrialSampleInfoVO> page, TrialSampleInfoVO obj);
 
+    Integer selectSampleInfoCount(@Param("contractId") Long contractId, @Param("nodeIds") List<Long> nodeIds);
 }

+ 16 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialSampleInfoMapper.xml

@@ -68,4 +68,20 @@
         </if>
         order by a.sampling_date desc
     </select>
+    <select id="selectSampleInfoCount" parameterType="java.util.Map" resultType="java.lang.Integer">
+        SELECT COUNT(1)
+        FROM u_trial_sample_info
+        WHERE contract_id = #{contractId}
+        AND is_deleted = 0
+        <if test="nodeIds != null and nodeIds.size() > 0">
+            AND node_id IN (
+            <foreach collection="nodeIds" item="nodeId" separator=",">
+                #{nodeId}
+            </foreach>
+            )
+        </if>
+        <if test="nodeIds == null or nodeIds.size() == 0">
+            AND 1 = 0
+        </if>
+    </select>
 </mapper>

+ 8 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialSelfInspectionRecordMapper.java

@@ -48,4 +48,12 @@ public interface TrialSelfInspectionRecordMapper extends BaseMapper<TrialSelfIns
 
     List<Map<String,Object>> getTrialFilePdfRecord(@Param("nodeId") String nodeId,
                                                    @Param("types") List<Integer> types);
+
+    List<TrialSelfInspectionRecord> seleclListByContractIdAndNodeId(@Param("contractId") Long contractId, @Param("nodeIds") List<Long> nodeIds);
+
+    List<Map<String, Object>> countByTypeAndMonth(Long contractId, List<Long> nodeIds, String year);
+
+    List<TrialSelfInspectionRecord> selectCountByYear(Long contractId, List<Long> nodeIds, String year);
+
+    List<String> selectAllYear(@Param("contractId") Long contractId);
 }

+ 57 - 1
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialSelfInspectionRecordMapper.xml

@@ -114,5 +114,61 @@
            #{type}
        </foreach>
     </select>
-
+    <select id="seleclListByContractIdAndNodeId"
+            resultType="org.springblade.business.entity.TrialSelfInspectionRecord">
+        SELECT id,detection_result
+        FROM u_trial_self_inspection_record
+        WHERE contract_id = #{contractId}
+        AND is_deleted = 0
+        AND task_status= '已审批'
+        <if test="nodeIds != null and nodeIds.size() > 0">
+            AND node_id IN (
+            <foreach collection="nodeIds" item="nodeId" separator=",">
+                #{nodeId}
+            </foreach>
+            )
+        </if>
+        <if test="nodeIds == null or nodeIds.size() == 0">
+            AND 1 = 0
+        </if>
+    </select>
+    <select id="countByTypeAndMonth" resultType="java.util.Map">
+        SELECT
+            type,
+            MONTH(report_date) AS month,
+            COUNT(1) AS count
+        FROM u_trial_self_inspection_record
+        WHERE contract_id = #{contractId}
+        <foreach collection="nodeIds" item="id" separator=",">
+            #{id}
+        </foreach>
+          AND task_status = '已审批'
+          AND is_deleted = 0
+          AND DATE_FORMAT(report_date, '%Y') = #{year}
+        GROUP BY type, MONTH(report_date)
+        ORDER BY type, month;
+    </select>
+    <select id="selectCountByYear" resultType="org.springblade.business.entity.TrialSelfInspectionRecord">
+        SELECT
+            id,
+            detection_result
+        FROM u_trial_self_inspection_record
+        WHERE contract_id = #{contractId}
+        <foreach collection="nodeIds" item="id" separator=",">
+            #{id}
+        </foreach>
+          AND task_status = '已审批'
+          AND is_deleted = 0
+          AND DATE_FORMAT(report_date, '%Y') = #{year}
+    </select>
+    <select id="selectAllYear" parameterType="java.lang.Long" resultType="java.lang.String">
+        SELECT DISTINCT DATE_FORMAT(report_date, '%Y') AS year
+        FROM u_trial_self_inspection_record
+        WHERE contract_id = #{contractId}
+        AND task_status = '已审批'
+        AND is_deleted = 0
+        AND report_date IS NOT NULL
+        GROUP BY DATE_FORMAT(report_date, '%Y')
+        ORDER BY year DESC;
+    </select>
 </mapper>

+ 1 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/IEntrustInfoService.java

@@ -78,4 +78,5 @@ public interface IEntrustInfoService extends BaseService<EntrustInfo> {
 
     R annul(String id);
 
+    Integer selectEntrustInfoCount(Long contractId, List<Long> nodeIds);
 }

+ 1 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialSampleInfoService.java

@@ -32,4 +32,5 @@ public interface ITrialSampleInfoService extends BaseService<TrialSampleInfo> {
 
     List<TrialSampleInfoVO3> sampleListInfo(Long nodeId, Long id, Long contractId);
 
+    Integer selectSampleInfoCount(Long contractId, List<Long>nodeIds);
 }

+ 9 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialSelfInspectionRecordService.java

@@ -12,6 +12,7 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.servlet.http.HttpServletResponse;
 import java.io.FileNotFoundException;
 import java.util.List;
+import java.util.Map;
 
 public interface ITrialSelfInspectionRecordService extends BaseService<TrialSelfInspectionRecord> {
 
@@ -53,4 +54,12 @@ public interface ITrialSelfInspectionRecordService extends BaseService<TrialSelf
     void updateSort(TrialSelfInspectionRecordPageDTO dto);
 
     void download(String ids, Integer classify, Integer type, HttpServletResponse response);
+
+    List<TrialSelfInspectionRecord> seleclListByContractIdAndNodeId(Long contractId, List<Long> nodeIds);
+
+    List<Map<String, Object>> countByTypeAndMonth(Long contractId, List<Long> nodeIds, String year);
+
+    List<TrialSelfInspectionRecord> selectCountByYear(Long contractId, List<Long> nodeIds, String year);
+
+    List<String> selectAllYear(Long contractId);
 }

+ 17 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/TrialDataBoardService.java

@@ -0,0 +1,17 @@
+package org.springblade.business.service;
+
+import org.springblade.business.vo.TrialDataBoardApproveVo;
+import org.springblade.business.vo.TrialDataBoardCountVO;
+import org.springblade.business.vo.TrialDataBoardChartVo;
+
+import java.util.List;
+
+public interface TrialDataBoardService {
+    TrialDataBoardCountVO trialDataBoardCount(Long contractId,Long nodeId);
+
+    TrialDataBoardChartVo trialDataBoardChart(Long contractId, Long nodeId, String year);
+
+    List<String> selectAllYear(Long contractId);
+
+    TrialDataBoardApproveVo trialDataBoardApprove(Long contractId, Long nodeId, Integer type);
+}

+ 5 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/EntrustInfoServiceImpl.java

@@ -328,4 +328,9 @@ public class EntrustInfoServiceImpl extends BaseServiceImpl<EntrustInfoMapper, E
         }
         return R.success("操作成功");
     }
+
+	@Override
+	public Integer selectEntrustInfoCount(Long contractId, List<Long> nodeIds) {
+		return baseMapper.selectEntrustInfoCount(contractId, nodeIds);
+	}
 }

+ 127 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialDataBoardServiceImpl.java

@@ -0,0 +1,127 @@
+package org.springblade.business.service.impl;
+
+import lombok.AllArgsConstructor;
+import org.springblade.business.entity.TrialSelfInspectionRecord;
+import org.springblade.business.service.IEntrustInfoService;
+import org.springblade.business.service.ITrialSampleInfoService;
+import org.springblade.business.service.ITrialSelfInspectionRecordService;
+import org.springblade.business.service.TrialDataBoardService;
+import org.springblade.business.vo.TrialDataBoardApproveVo;
+import org.springblade.business.vo.TrialDataBoardCountVO;
+import org.springblade.business.vo.TrialDataBoardChartVo;
+import org.springblade.business.vo.TrialMonthReport;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@Service
+@AllArgsConstructor
+public class TrialDataBoardServiceImpl implements TrialDataBoardService {
+
+    private final ITrialSampleInfoService trialSampleInfoService;
+    private final IEntrustInfoService entrustInfoService;
+    private final ITrialSelfInspectionRecordService trialSelfInspectionRecordService;
+    private final JdbcTemplate jdbcTemplate;
+
+    @Override
+    public TrialDataBoardCountVO trialDataBoardCount(Long contractId,Long nodeId) {
+        List<Long> nodeIds = selectAllNodeIds(nodeId);
+        Integer sampleInfoCount = trialSampleInfoService.selectSampleInfoCount(contractId,nodeIds);
+        Integer entrustInfoCount = entrustInfoService.selectEntrustInfoCount(contractId,nodeIds);
+        List<TrialSelfInspectionRecord> list=trialSelfInspectionRecordService.seleclListByContractIdAndNodeId(contractId,nodeIds);
+        TrialDataBoardCountVO vo = new TrialDataBoardCountVO();
+        vo.setSampleCount(sampleInfoCount);
+        vo.setEntrustCount(entrustInfoCount);
+        vo.setReportCount(list.size());
+        int qualifiedCountCount = (int) list.stream().filter(trialSelfInspectionRecord -> trialSelfInspectionRecord.getDetectionResult() == 1).count();
+        int unQualifiedCountCount = (int) list.stream().filter(trialSelfInspectionRecord -> trialSelfInspectionRecord.getDetectionResult() == 0).count();
+        vo.setReportQualifiedCount(qualifiedCountCount);
+        vo.setReportUnqualifiedCount(unQualifiedCountCount);
+        if (!list.isEmpty()) {
+            int rate = (qualifiedCountCount * 100) / list.size();
+            vo.setReportRate(rate + "%");
+        } else {
+            vo.setReportRate("0%");
+        }
+        return vo;
+    }
+
+    @Override
+    public TrialDataBoardChartVo trialDataBoardChart(Long contractId, Long nodeId, String year) {
+        // 1. 参数校验
+        if (contractId == null || nodeId == null || year == null || year.length() != 4) {
+            throw new IllegalArgumentException("参数异常:contractId、nodeId、year不能为空,且year为4位年份");
+        }
+        List<Long> nodeIds = selectAllNodeIds(nodeId);
+
+        // 2. 查询原始统计数据
+        List<Map<String, Object>> rawData = trialSelfInspectionRecordService.countByTypeAndMonth(contractId, nodeIds, year);
+        // 3. 初始化返回VO
+        TrialDataBoardChartVo vo = new TrialDataBoardChartVo();
+        // 4. 拆分数据到三个类型的列表,并补全12个月数据
+        vo.setSgMonthReport(buildMonthReport(rawData, 1)); // 施工:type=1
+        vo.setJlMonthReport(buildMonthReport(rawData, 2)); // 监理:type=2
+        vo.setYzMonthReport(buildMonthReport(rawData, 3)); // 业主:type=3
+        //5 统计所有合格/不合格数量数量
+        List<TrialSelfInspectionRecord>list=trialSelfInspectionRecordService.selectCountByYear(contractId, nodeIds, year);
+        if(!list.isEmpty()){
+            vo.setAllQualifiedCount((int)list.stream().filter(trialSelfInspectionRecord -> trialSelfInspectionRecord.getDetectionResult() == 1).count());
+            vo.setAllUnQualifiedCount((int)list.stream().filter(trialSelfInspectionRecord -> trialSelfInspectionRecord.getDetectionResult() == 0).count());
+        }
+        return vo;
+    }
+
+    @Override
+    public List<String> selectAllYear(Long contractId) {
+        return trialSelfInspectionRecordService.selectAllYear(contractId);
+    }
+
+    @Override
+    public TrialDataBoardApproveVo trialDataBoardApprove(Long contractId, Long nodeId, Integer type) {
+        return null;
+    }
+
+    private List<TrialMonthReport> buildMonthReport(List<Map<String, Object>> rawData, Integer type) {
+        // 过滤当前类型数据,转为{月份:数量}的Map(月份为1-12的字符串)
+        Map<String, Integer> typeMonthCountMap = rawData.stream()
+                .filter(item -> type.equals(item.get("type")))
+                .collect(Collectors.toMap(
+                        item -> item.get("month").toString(),
+                        item -> Integer.parseInt(item.get("count").toString()),
+                        (v1, v2) -> v1
+                ));
+
+        // 生成12个月数据,month返回1/2/.../12
+        List<TrialMonthReport> monthReports = new ArrayList<>();
+        for (int i = 1; i <= 12; i++) {
+            String month = String.valueOf(i);
+            TrialMonthReport report = new TrialMonthReport();
+            report.setMonth(month);
+            report.setCount(typeMonthCountMap.getOrDefault(month, 0));
+            monthReports.add(report);
+        }
+        return monthReports;
+    }
+    public List<Long> selectAllNodeIds(Long nodeId) {
+        String sql = "SELECT p_key_id " +
+                "FROM m_wbs_tree_private " +
+                "WHERE is_deleted = 0 " +
+                "  AND ( " +
+                "       p_key_id = ? " +
+                "       OR ( " +
+                "           ancestors_p_id IS NOT NULL " +
+                "           AND CONCAT(',', ancestors_p_id, ',') LIKE CONCAT('%,', ?, ',%') " +
+                "       ) " +
+                "  )";
+        return jdbcTemplate.query(
+                sql,
+                new Object[]{nodeId, nodeId},
+                (rs, rowNum) -> rs.getLong("p_key_id")
+        );
+    }
+}

+ 5 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSampleInfoServiceImpl.java

@@ -122,6 +122,11 @@ public class TrialSampleInfoServiceImpl extends BaseServiceImpl<TrialSampleInfoM
         return list;
     }
 
+    @Override
+    public Integer selectSampleInfoCount(Long contractId, List<Long>nodeIds) {
+        return baseMapper.selectSampleInfoCount(contractId, nodeIds);
+    }
+
     @Override
     public TrialSampleInfo sampleDetail(Long id) {
         return baseMapper.selectById(id);

+ 20 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java

@@ -2706,4 +2706,24 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
         }
     }
 
+    @Override
+    public List<TrialSelfInspectionRecord> seleclListByContractIdAndNodeId(Long contractId, List<Long> nodeIds) {
+        return baseMapper.seleclListByContractIdAndNodeId(contractId, nodeIds);
+    }
+
+    @Override
+    public List<Map<String, Object>> countByTypeAndMonth(Long contractId, List<Long> nodeIds, String year) {
+        return baseMapper.countByTypeAndMonth(contractId,nodeIds,year);
+    }
+
+    @Override
+    public List<TrialSelfInspectionRecord> selectCountByYear(Long contractId, List<Long> nodeIds, String year) {
+        return baseMapper.selectCountByYear(contractId,nodeIds,year);
+    }
+
+    @Override
+    public List<String> selectAllYear(Long contractId) {
+        return baseMapper.selectAllYear(contractId);
+    }
+
 }