소스 검색

巡检填报速度优化-保养标准优化

guarantee-lsq 2 년 전
부모
커밋
15210c5a99

+ 2 - 0
platform-dao/src/main/java/com/platform/dao/mapper/fill/FillGatherTaskDetailMapper.java

@@ -27,4 +27,6 @@ public interface FillGatherTaskDetailMapper extends MyMapper<FillGatherTaskDetai
 
     List<FillGatherTaskDetailVO> selectVOByTaskId(String taskId);
 
+    List<FillGatherTaskDetail> selectListSortNum(FillGatherTaskDetailDTO dto);
+
 }

+ 11 - 0
platform-dao/src/main/resources/mapper/fill/FillGatherTaskDetailMapper.xml

@@ -103,4 +103,15 @@
         </foreach>
 
     </select>
+
+    <select id="selectListSortNum" parameterType="com.platform.dao.dto.fill.FillGatherTaskDetailDTO"
+            resultType="com.platform.dao.entity.fill.FillGatherTaskDetail">
+        select * from t_fill_gather_task_detail
+        <where>
+            <if test="taskId != null and taskId != ''">
+                and task_id = #{taskId}
+            </if>
+        </where>
+        order by sort_num asc
+    </select>
 </mapper>

+ 12 - 9
platform-rest/src/main/java/com/platform/rest/task/FillGatherTaskTask.java

@@ -4,6 +4,7 @@ import com.platform.common.cache.ConfigCache;
 import com.platform.common.constant.RedisKeyConstants;
 import com.platform.common.util.*;
 import com.platform.dao.dto.fill.FillGatherTaskDTO;
+import com.platform.dao.dto.fill.FillGatherTaskDetailDTO;
 import com.platform.dao.entity.fill.FillGatherInfo;
 import com.platform.dao.entity.fill.FillGatherTask;
 import com.platform.dao.entity.fill.FillGatherTaskDetail;
@@ -141,9 +142,9 @@ public class FillGatherTaskTask {
 
     private void saveDetails(String content,String newTaskId,String taskId){
         List<FillGatherTaskDetail> details = new ArrayList<>();
-        FillGatherTaskDetail queryDetail = new FillGatherTaskDetail();
+        FillGatherTaskDetailDTO queryDetail = new FillGatherTaskDetailDTO();
         queryDetail.setTaskId(taskId);
-        List<FillGatherTaskDetail> detailVOs = fillGatherTaskDetailMapper.select(queryDetail);
+        List<FillGatherTaskDetail> detailVOs = fillGatherTaskDetailMapper.selectListSortNum(queryDetail);
         //List<FillGatherTaskDetailVO> detailVOs = fillGatherTaskDetailMapper.selectVOByTaskId(taskId);
         for(FillGatherTaskDetail vo : detailVOs){
             FillGatherTaskDetail detail = new FillGatherTaskDetail();
@@ -164,13 +165,15 @@ public class FillGatherTaskTask {
         details.forEach(item->{
             FillGatherTaskDetailVO vo = BeanConverterUtil.copyObjectProperties(item,FillGatherTaskDetailVO.class);
             SbInfo sb = sbInfoMapper.selectByPrimaryKey(item.getSbId());
-            vo.setSbName(sb.getName());
-            vo.setSbNo(sb.getNo());
-            vo.setPositionNo(sb.getPositionNo());
-            if(StringUtils.isNotBlank(sb.getPositionId())){
-                SbPosition sbPosition = sbPositionMapper.selectByPrimaryKey(sb.getPositionId());
-                if(sbPosition != null){
-                    vo.setPositionName(sbPosition.getName());
+            if(sb != null){
+                vo.setSbName(sb.getName());
+                vo.setSbNo(sb.getNo());
+                vo.setPositionNo(sb.getPositionNo());
+                if(StringUtils.isNotBlank(sb.getPositionId())){
+                    SbPosition sbPosition = sbPositionMapper.selectByPrimaryKey(sb.getPositionId());
+                    if(sbPosition != null){
+                        vo.setPositionName(sbPosition.getName());
+                    }
                 }
             }
             detailRedis.add(vo);

+ 1 - 1
platform-service/src/main/java/com/platform/service/fill/impl/FillGatherTaskDetailServiceImpl.java

@@ -90,7 +90,7 @@ public class FillGatherTaskDetailServiceImpl extends BaseServiceImpl<FillGatherT
         for(FillGatherTaskDetailVO item : list){
             if(record.getStatus() != null){
                 // 状态校验
-                if(item.getStatus() != record.getStatus()){
+                if(item.getStatus().intValue() != record.getStatus().intValue()){
                     continue;
                 }
             }