This commit is contained in:
zhangchenbiao
2024-05-07 17:41:32 +08:00
parent 52e50b6d6e
commit f4e6b41eeb
7 changed files with 34 additions and 27 deletions

View File

@@ -6,6 +6,7 @@ import com.cool.store.enums.NodeNoEnum;
import com.cool.store.mapper.PointAuditRecordMapper;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
@@ -64,4 +65,18 @@ public class PointAuditRecordDAO {
}
return pointAuditRecordMapper.getPointAllAuditRecord(pointId);
}
/**
* 获取提交时间
* @param pointIds
* @return
*/
public Map<Long, Date> getPointSubmitTimeMap(List<Long> pointIds){
if(CollectionUtils.isEmpty(pointIds)){
return Maps.newHashMap();
}
List<PointAuditRecordDO> auditList = pointAuditRecordMapper.getPointSubmitAuditTime(pointIds);
return auditList.stream().collect(Collectors.toMap(k->k.getPointId(), v->v.getFinishTaskTime(), (oldDate, newDate) -> oldDate.compareTo(newDate) > 0 ? oldDate : newDate));
}
}

View File

@@ -64,12 +64,4 @@ public class PointTodoInfoDAO {
}
return pointTodoInfoMapper.getCurNodeNoByPoint(pointId);
}
public Map<Long, Date> getPointSubmitTimeMap(List<Long> pointIds){
if(CollectionUtils.isEmpty(pointIds)){
return Maps.newHashMap();
}
List<PointAuditRecordDO> auditList = pointTodoInfoMapper.getPointSubmitAuditTime(pointIds);
return auditList.stream().collect(Collectors.toMap(k->k.getPointId(), v->v.getFinishTaskTime(), (oldDate, newDate) -> oldDate.compareTo(newDate) > 0 ? oldDate : newDate));
}
}

View File

@@ -4,7 +4,6 @@ import com.cool.store.entity.PointAuditRecordDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.Date;
import java.util.List;
public interface PointAuditRecordMapper extends Mapper<PointAuditRecordDO> {
@@ -38,4 +37,11 @@ public interface PointAuditRecordMapper extends Mapper<PointAuditRecordDO> {
* @return
*/
List<PointAuditRecordDO> getPointAllAuditRecord(@Param("pointId") Long pointId);
/**
* 获取提交时间
* @param pointIds
* @return
*/
List<PointAuditRecordDO> getPointSubmitAuditTime(@Param("pointIds") List<Long> pointIds);
}

View File

@@ -65,10 +65,4 @@ public interface PointTodoInfoMapper extends Mapper<PointTodoInfoDO> {
*/
Integer getCurNodeNoByPoint(@Param("pointId") Long pointId);
/**
* 获取提交时间
* @param pointIds
* @return
*/
List<PointAuditRecordDO> getPointSubmitAuditTime(@Param("pointIds") List<Long> pointIds);
}

View File

@@ -135,4 +135,15 @@
update xfsg_point_audit_record set deleted = 1 where point_id = #{pointId} and cycle_count = #{cycleCount} and audit_status = 0
</update>
<select id="getPointSubmitAuditTime" resultMap="BaseResultMap">
select
point_id, receive_task_time, finish_task_time
from
xfsg_point_audit_record
where node_no = 0 and point_id in
<foreach collection="pointIds" item="pointId" open="(" close=")" separator=",">
#{pointId}
</foreach>
</select>
</mapper>

View File

@@ -100,15 +100,4 @@
select node_no from xfsg_point_todo_info where point_id = #{pointId} and status = 0 and deleted = 0 limit 1
</select>
<select id="getPointSubmitAuditTime" resultMap="BaseResultMap">
select
point_id, receive_task_time, finish_task_time
from
xfsg_point_audit_record
where node_no = 1 and point_id in
<foreach collection="pointIds" item="pointId" open="(" close=")" separator=",">
#{pointId}
</foreach>
</select>
</mapper>

View File

@@ -949,7 +949,7 @@ public class PointServiceImpl implements PointService {
List<Long> regionIds = pointPage.stream().map(PointInfoDO::getRegionId).distinct().collect(Collectors.toList());
List<Long> pointIds = pointPage.stream().map(PointInfoDO::getId).collect(Collectors.toList());
//获取提交时间
Map<Long, Date> submitTimeMap = pointTodoInfoDAO.getPointSubmitTimeMap(pointIds);
Map<Long, Date> submitTimeMap = pointAuditRecordDAO.getPointSubmitTimeMap(pointIds);
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
resultList = PointToDoVO.convertVO(pointPage.getResult(), regionNameMap, submitTimeMap);
}