Commit fef7a4231d4e7515b01f0a804f24ee19d8353608

Authored by wangqian
1 parent a1b32268

app首页统计修改

urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/homepage/HomepageSummaryMapper.java
@@ -13,6 +13,7 @@ import com.zteits.urbanops.module.garden.dal.dataobject.departmentcost.Departmen @@ -13,6 +13,7 @@ import com.zteits.urbanops.module.garden.dal.dataobject.departmentcost.Departmen
13 import org.apache.ibatis.annotations.Mapper; 13 import org.apache.ibatis.annotations.Mapper;
14 import org.apache.ibatis.annotations.Param; 14 import org.apache.ibatis.annotations.Param;
15 15
  16 +import java.time.LocalDateTime;
16 import java.util.List; 17 import java.util.List;
17 import java.util.Map; 18 import java.util.Map;
18 19
@@ -137,7 +138,7 @@ public interface HomepageSummaryMapper extends BaseMapperX<DepartmentCostDO> { @@ -137,7 +138,7 @@ public interface HomepageSummaryMapper extends BaseMapperX<DepartmentCostDO> {
137 * @param userId 138 * @param userId
138 * @Return com.baomidou.mybatisplus.core.metadata.IPage<com.zteits.urbanops.module.garden.controller.app.homepage.vo.TaskDetailsRspVo> 139 * @Return com.baomidou.mybatisplus.core.metadata.IPage<com.zteits.urbanops.module.garden.controller.app.homepage.vo.TaskDetailsRspVo>
139 */ 140 */
140 - IPage<TaskDetailsRspVo> queryPendingTaskDetails(IPage<TaskDetailsRspVo> page, @Param("roleIds") List<Long> roleIds, @Param("userId") Long userId, @Param("deptId") Long deptId); 141 + IPage<TaskDetailsRspVo> queryPendingTaskDetails(IPage<TaskDetailsRspVo> page, @Param("roleIds") List<Long> roleIds, @Param("userId") Long userId, @Param("deptId") Long deptId, @Param("currentDate") LocalDateTime currentDate);
141 142
142 /** 143 /**
143 * @Author wangqian 144 * @Author wangqian
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/homepage/HomepageSummaryServiceImpl.java
@@ -114,7 +114,7 @@ public class HomepageSummaryServiceImpl implements HomepageSummaryService{ @@ -114,7 +114,7 @@ public class HomepageSummaryServiceImpl implements HomepageSummaryService{
114 //待办 114 //待办
115 Long deptId = SecurityFrameworkUtils.getDeptId(); 115 Long deptId = SecurityFrameworkUtils.getDeptId();
116 List<Long> roleIds = roleApi.getRoleIdsByUserId(SecurityFrameworkUtils.getLoginUserId()); 116 List<Long> roleIds = roleApi.getRoleIdsByUserId(SecurityFrameworkUtils.getLoginUserId());
117 - mpPage = homepageSummaryMapper.queryPendingTaskDetails(mpPage, roleIds, userId, deptId); 117 + mpPage = homepageSummaryMapper.queryPendingTaskDetails(mpPage, roleIds, userId, deptId, LocalDateTime.now());
118 } 118 }
119 return new PageResult<>(mpPage.getRecords(), mpPage.getTotal()); 119 return new PageResult<>(mpPage.getRecords(), mpPage.getTotal());
120 } 120 }
urbanops-module-garden/src/main/resources/mapper/homepage/HomepageSummaryMapper.xml
@@ -422,8 +422,8 @@ @@ -422,8 +422,8 @@
422 inner join garden_inspection_plan_detail c on a.batch_no=c.batch_no 422 inner join garden_inspection_plan_detail c on a.batch_no=c.batch_no
423 where a.deleted = b.deleted and a.deleted = 0 423 where a.deleted = b.deleted and a.deleted = 0
424 and c.finish_state = 1 424 and c.finish_state = 1
425 - and c.begin_time &lt;= NOW()  
426 - AND c.end_time >= NOW() 425 + and c.begin_time &lt;= #{currentDate}
  426 + AND c.end_time >= #{currentDate}
427 and a.dept_id = #{deptId} 427 and a.dept_id = #{deptId}
428 AND b.role_id IN 428 AND b.role_id IN
429 <foreach collection='roleIds' item='roleId' open='(' close=')' separator=','> 429 <foreach collection='roleIds' item='roleId' open='(' close=')' separator=','>
@@ -433,14 +433,14 @@ @@ -433,14 +433,14 @@
433 union all 433 union all
434 434
435 SELECT 435 SELECT
436 - a.plan_name as taskName,a.begin_time as busiDateTime, null as pressingType 436 + a.plan_name as taskName,c.begin_time as busiDateTime, null as pressingType
437 from garden_maintain_plan a 437 from garden_maintain_plan a
438 INNER JOIN garden_maintain_plan_role b on a.batch_no=b.batch_no 438 INNER JOIN garden_maintain_plan_role b on a.batch_no=b.batch_no
439 inner join garden_maintain_plan_detail c on a.batch_no=c.batch_no 439 inner join garden_maintain_plan_detail c on a.batch_no=c.batch_no
440 where a.deleted=b.deleted and a.deleted = 0 440 where a.deleted=b.deleted and a.deleted = 0
441 and c.finish_state = 1 441 and c.finish_state = 1
442 - and c.begin_time &lt;= NOW()  
443 - AND c.end_time >= NOW() 442 + and c.begin_time &lt;= #{currentDate}
  443 + AND c.end_time >= #{currentDate}
444 and a.dept_id = #{deptId} 444 and a.dept_id = #{deptId}
445 AND b.role_id IN 445 AND b.role_id IN
446 <foreach collection='roleIds' item='roleId' open='(' close=')' separator=','> 446 <foreach collection='roleIds' item='roleId' open='(' close=')' separator=','>