From 50f135f64a83d8386db16623c6f550a5c1cfa1a5 Mon Sep 17 00:00:00 2001
From: songhuangfeng123 <shf18767906695@163.com>
Date: 星期五, 19 八月 2022 18:58:10 +0800
Subject: [PATCH] 目标统计fix

---
 goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/service/impl/RewardPunishmentDetailServiceImpl.java |   43 ++++++++++++++++++++++++++++++++++++-------
 1 files changed, 36 insertions(+), 7 deletions(-)

diff --git a/goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/service/impl/RewardPunishmentDetailServiceImpl.java b/goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/service/impl/RewardPunishmentDetailServiceImpl.java
index 481ac94..814f4f1 100644
--- a/goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/service/impl/RewardPunishmentDetailServiceImpl.java
+++ b/goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/service/impl/RewardPunishmentDetailServiceImpl.java
@@ -1,10 +1,16 @@
 package com.gkhy.safePlatform.targetDuty.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gkhy.safePlatform.targetDuty.entity.ExamineMng;
+import com.gkhy.safePlatform.targetDuty.entity.ExamineTemplate;
+import com.gkhy.safePlatform.targetDuty.entity.RewardPunishmentStandard;
+import com.gkhy.safePlatform.targetDuty.model.dto.resp.ExamineMngDto;
 import com.gkhy.safePlatform.targetDuty.repository.RewardPunishmentDetailRepository;
 import com.gkhy.safePlatform.targetDuty.entity.RewardPunishmentDetail;
+import com.gkhy.safePlatform.targetDuty.repository.RewardPunishmentStandardRepository;
 import com.gkhy.safePlatform.targetDuty.service.RewardPunishmentDetailService;
 import org.springframework.stereotype.Service;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -17,6 +23,7 @@
 import com.gkhy.safePlatform.targetDuty.utils.QueryHelpPlus;
 import com.gkhy.safePlatform.commons.utils.BeanCopyUtils;
 
+import java.io.Serializable;
 import java.util.List;
 
 /**
@@ -30,25 +37,27 @@
 
     @Autowired
     private RewardPunishmentDetailRepository rewardPunishmentDetailRepository;
-    
+
+    @Autowired
+    private RewardPunishmentStandardRepository rewardPunishmentStandardRepository;
     
 	
 	@Override
     public ResultVO queryAll(PageQuery<RewardPunishmentDetailQueryCriteria> pageQuery) {
         Long pageIndex = pageQuery.getPageIndex();
         Long pageSize = pageQuery.getPageSize();
-        IPage<RewardPunishmentDetail> page = new Page<>(pageIndex, pageSize);
+        IPage<RewardPunishmentDetailDto> page = new Page<>(pageIndex, pageSize);
 
-        page = baseMapper.selectPage(page,
-                QueryHelpPlus.getPredicate(RewardPunishmentDetail.class, pageQuery.getSearchParams()));
-        List<RewardPunishmentDetailDto> respList = BeanCopyUtils.copyBeanList(page.getRecords(), RewardPunishmentDetailDto.class);
+        page = baseMapper.queryAll(page,
+                pageQuery.getSearchParams().getPersonId());
+//        List<RewardPunishmentDetailDto> respList = BeanCopyUtils.copyBeanList(page.getRecords(), RewardPunishmentDetailDto.class);
 
         return new SearchResultVO<>(
                 true,
                 pageIndex,
-                pageSize,
+                pageSize,page.getPages(),
                 page.getTotal(),
-                respList,
+                page.getRecords(),
                 ResultCodes.OK
         );
     }
@@ -58,4 +67,24 @@
     public List<RewardPunishmentDetail> queryAll(RewardPunishmentDetailQueryCriteria criteria) {
         return baseMapper.selectList(QueryHelpPlus.getPredicate(RewardPunishmentDetail.class, criteria));
     }
+
+
+    @Override
+    public List<RewardPunishmentDetail> queryAllRelation(RewardPunishmentDetailQueryCriteria criteria) {
+        return baseMapper.queryAll(criteria.getPersonId());
+    }
+
+    @Override
+    public RewardPunishmentDetailDto selectOne(Serializable id) {
+        RewardPunishmentDetail info = this.getById(id);
+        if(info == null){
+            return null;
+        }
+
+        RewardPunishmentDetailDto dto = BeanCopyUtils.copyBean(info, RewardPunishmentDetailDto.class);
+
+        RewardPunishmentStandard standard = rewardPunishmentStandardRepository.selectOne(new QueryWrapper<RewardPunishmentStandard>().eq("id",dto.getRewardPunishmentStandardId()));
+        dto.setRewardPunishmentStandardName(standard.getqName());
+        return dto;
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.2