Sfoglia il codice sorgente

工作画像-巡检模块

chenshudong 3 mesi fa
parent
commit
1d2e73d238

+ 23 - 4
airport-check/src/main/java/com/sundot/airport/check/service/impl/CheckLargeScreenServiceImpl.java

@@ -1813,7 +1813,7 @@ public class CheckLargeScreenServiceImpl implements ICheckLargeScreenService {
1813 1813
         Long deptId = dto.getDeptId();
1814 1814
         if (ObjUtil.isNotNull(deptId)) {
1815 1815
             SysDept sysDept = sysDeptService.selectDeptById(deptId);
1816
-            if (!StrUtil.equals(DeptTypeEnum.DEPARTMENT.getCode(), sysDept.getDeptType())) {
1816
+            if (!StrUtil.equals(DeptTypeEnum.BRIGADE.getCode(), sysDept.getDeptType())) {
1817 1817
                 dto.setDeptId(null);
1818 1818
             }
1819 1819
         }
@@ -1851,7 +1851,7 @@ public class CheckLargeScreenServiceImpl implements ICheckLargeScreenService {
1851 1851
         Long deptId = dto.getDeptId();
1852 1852
         if (ObjUtil.isNotNull(deptId)) {
1853 1853
             SysDept sysDept = sysDeptService.selectDeptById(deptId);
1854
-            if (!StrUtil.equals(DeptTypeEnum.DEPARTMENT.getCode(), sysDept.getDeptType())) {
1854
+            if (!StrUtil.equals(DeptTypeEnum.BRIGADE.getCode(), sysDept.getDeptType())) {
1855 1855
                 dto.setDeptId(null);
1856 1856
             }
1857 1857
         }
@@ -1899,13 +1899,32 @@ public class CheckLargeScreenServiceImpl implements ICheckLargeScreenService {
1899 1899
                 }
1900 1900
             });
1901 1901
         }
1902
+        //补充被检查班科室数据
1903
+        List<Long> checkedTeamIdListTemp = all.stream().filter(item -> ObjectUtil.isNull(item.getCheckedDepartmentId())).map(CheckLargeScreenCorrectionPortraitSqlDto::getCheckedTeamId).distinct().collect(Collectors.toList());
1904
+        if (CollUtil.isNotEmpty(checkedTeamIdListTemp)) {
1905
+            List<SysDept> checkedTeamListTemp = sysDeptService.selectDeptByIdList(checkedTeamIdListTemp);
1906
+            if (CollUtil.isNotEmpty(checkedTeamListTemp)) {
1907
+                Map<Long, Long> deptIdMap = checkedTeamListTemp.stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getParentId, (oldValue, newValue) -> newValue));
1908
+                List<Long> checkedDepartmentIdListTemp = checkedTeamListTemp.stream().map(SysDept::getParentId).collect(Collectors.toList());
1909
+                List<SysDept> checkedDepartmentListTemp = sysDeptService.selectDeptByIdList(checkedDepartmentIdListTemp);
1910
+                if (CollUtil.isNotEmpty(checkedDepartmentListTemp)) {
1911
+                    Map<Long, String> deptMap = checkedDepartmentListTemp.stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName, (oldValue, newValue) -> newValue));
1912
+                    all.forEach(item -> {
1913
+                        if (ObjectUtil.isNull(item.getCheckedDepartmentId())) {
1914
+                            item.setCheckedDepartmentId(deptIdMap.getOrDefault(item.getCheckedTeamId(), 0L));
1915
+                            item.setCheckedTeamName(deptMap.getOrDefault(item.getCheckedDepartmentId(), ""));
1916
+                        }
1917
+                    });
1918
+                }
1919
+            }
1920
+        }
1902 1921
 
1903 1922
         // 筛选部门
1904 1923
         Long deptId = dto.getDeptId();
1905 1924
         if (ObjUtil.isNotNull(deptId)) {
1906 1925
             SysDept sysDept = sysDeptService.selectDeptById(deptId);
1907
-            if (StrUtil.equals(DeptTypeEnum.DEPARTMENT.getCode(), sysDept.getDeptType())) {
1908
-                all = all.stream().filter(item -> item.getCheckedDepartmentId().equals(deptId)).collect(Collectors.toList());
1926
+            if (StrUtil.equals(DeptTypeEnum.BRIGADE.getCode(), sysDept.getDeptType())) {
1927
+                all = all.stream().filter(item -> item.getCheckedBrigadeId().equals(deptId)).collect(Collectors.toList());
1909 1928
             }
1910 1929
         }
1911 1930
 

+ 4 - 10
airport-check/src/main/resources/mapper/check/CheckLargeScreenMapper.xml

@@ -716,10 +716,7 @@
716 716
     </select>
717 717
 
718 718
     <select id="managementPromotionRecord" resultType="com.sundot.airport.check.domain.CheckLargeScreenPlanOverviewDto">
719
-        select date_format(case
720
-        when hour(cr.check_time) >= 9 then date(cr.check_time)
721
-        else date_sub(date(cr.check_time), interval 1 day)
722
-        end, '%Y-%m-%d') date,
719
+        select date_format(cr.check_time, '%Y-%m-%d') date,
723 720
         ct.check_category type,
724 721
         ct.check_category_desc typeDesc,
725 722
         count(cr.id) total
@@ -730,16 +727,13 @@
730 727
             and ct.is_self_check=#{isSelfCheck}
731 728
         </if>
732 729
         <if test="deptId != null">
733
-            and cr.checked_department_id=#{deptId}
730
+            and cr.checked_brigade_id=#{deptId}
734 731
         </if>
735 732
         <if test="startDate != null and endDate != null">
736 733
             and (cr.check_time >= #{startDate}
737 734
             and cr.check_time <![CDATA[ < ]]> date_add(#{endDate} , interval 1 day))
738 735
         </if>
739
-        group by date_format(case
740
-        when hour(cr.check_time) >= 9 then date(cr.check_time)
741
-        else date_sub(date(cr.check_time), interval 1 day)
742
-        end, '%Y-%m-%d'), ct.check_category, ct.check_category_desc
736
+        group by date_format(cr.check_time, '%Y-%m-%d'), ct.check_category, ct.check_category_desc
743 737
         order by date desc
744 738
     </select>
745 739
 
@@ -770,7 +764,7 @@
770 764
             and cc.process_status=#{processStatus}
771 765
         </if>
772 766
         <if test="deptId != null">
773
-            and cc.checked_department_id=#{deptId}
767
+            and cc.checked_brigade_id=#{deptId}
774 768
         </if>
775 769
         <if test="startDate != null and endDate != null">
776 770
             and (cc.check_time >= #{startDate}