Просмотр исходного кода

Merge remote-tracking branch 'origin/V0.0.3' into V0.0.3

ouyang 1 год назад
Родитель
Сommit
1b06a4fd25

+ 6 - 2
project_data/sql/0.0.3/soc/soc.sql

@@ -400,7 +400,8 @@ ALTER TABLE  core_safety_book_user_id MODIFY COLUMN id bigint auto_increment NOT
 ALTER TABLE  core_safety_dict MODIFY COLUMN id int auto_increment NOT NULL COMMENT '主键';
 
 
-ALTER TABLE  core_safety_exception_data MODIFY COLUMN id bigint  NOT NULL COMMENT '主键';
+alter table core_safety_exception_data modify id bigint auto_increment comment '主键';
+alter table core_safety_exception_data auto_increment = 1;
 ALTER TABLE  core_safety_exception_data MODIFY COLUMN create_time datetime DEFAULT CURRENT_TIMESTAMP  NULL COMMENT '创建时间';
 
 
@@ -822,6 +823,7 @@ update sys_dict_data set dict_label='防盗应急预案'  where dict_type='core_
 update sys_dict_data set dict_label='反诈应急预案'  where dict_type='core_drill_type' and dict_value=3;
 update sys_dict_data set dict_label='消防及疏散应急预案'  where dict_type='core_drill_type' and dict_value=4;
 update sys_dict_data set dict_label='防自然灾害应急预案'  where dict_type='core_drill_type' and dict_value=5;
+INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark) VALUES (6, '其他应急预案', '6', 'core_drill_type', null, 'default', 'N', '0',  null, now(), null, now(), null);
 
 -- 报警控制器
 ALTER TABLE `core_protection_log`
@@ -1049,9 +1051,10 @@ INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value
 -- 修改/新增教育培训类型字典信息
 update sys_dict_data set dict_label='行社安全保卫教育培训' where dict_label='每月安全培训教育' and dict_type='edu_training_type' limit 1;
 update sys_dict_data set dict_label='行社消防安全培训' where dict_label='专项安全培训教育' and dict_type='edu_training_type' limit 1;
-delete from sys_dict_data where dict_type='edu_training_type' and dict_label in ('营业网点安全保卫教育培训','营业网点消防安全培训');
+delete from sys_dict_data where dict_type='edu_training_type' and dict_label in ('营业网点安全保卫教育培训','营业网点消防安全培训','其他');
 INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark) VALUES (2, '营业网点安全保卫教育培训', '2', 'edu_training_type', null, 'default', 'N', '0', null, now(), null, now(), null);
 INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark) VALUES (3, '营业网点消防安全培训', '3', 'edu_training_type', null, 'default', 'N', '0',  null, now(), null, now(), null);
+INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark) VALUES (4, '其他', '4', 'edu_training_type', null, 'default', 'N', '0',  null, now(), null, now(), null);
 
 
 -- 履职任务类型增加其它,履职时间增加工作时间
@@ -1282,5 +1285,6 @@ INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type
 INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1, '使用中', '1', 'letter_status', NULL, 'default', 'N', '0', '超级管理员', '2023-10-13 15:31:04', 'zlsls01', '2023-11-08 11:04:36', NULL);
 INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2, '已过期', '2', 'letter_status', NULL, 'default', 'N', '0', '超级管理员', '2023-10-13 15:31:17', 'zlsls01', '2023-11-08 11:04:41', NULL);
 
+UPDATE sys_dict_data set dict_label='待整改' WHERE dict_type='question_reform_status' and dict_value=10;
 -- 删除多余的表
 drop TABLE if EXISTS sys_bank_physical_defense_construction;

+ 5 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/controller/AppCockpitController.java

@@ -12,11 +12,14 @@ import io.swagger.annotations.ApiResponses;
 import io.swagger.v3.oas.annotations.media.Content;
 import io.swagger.v3.oas.annotations.media.Schema;
 import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
+import javax.validation.Valid;
 import javax.validation.constraints.NotNull;
 import java.util.List;
 import java.util.concurrent.ExecutionException;
@@ -73,7 +76,7 @@ public class AppCockpitController extends BaseController {
      */
     @ApiOperation(value = "综合数据-履职", response = AppSyntheticResumptionVo.class)
     @GetMapping("/synthetic/resumption")
-    public AjaxResult syntheticResumption(@NotNull Date month) {
+    public AjaxResult syntheticResumption(@NotNull @Validated Date month) {
         AppSyntheticResumptionVo vo = appCockpitService.syntheticResumption(month);
         return success(vo);
     }
@@ -93,7 +96,7 @@ public class AppCockpitController extends BaseController {
      */
     @ApiOperation(value = "综合数据-安全检查", response = AppSyntheticSafetycheckVo.class)
     @GetMapping("/synthetic/safethcheck")
-    public AjaxResult syntheticSafetycheck(Date month) {
+    public AjaxResult syntheticSafetycheck(@RequestParam @Valid Date month) {
         AppSyntheticSafetycheckVo vo = appCockpitService.syntheticSafetyCheck(month);
         return success(vo);
     }

+ 10 - 5
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/service/impl/AppCockpitServiceImpl.java

@@ -151,8 +151,8 @@ public class AppCockpitServiceImpl implements AppCockpitService {
         vo.getSecurityPeopleInfo().put("未配备", baseInfoDto.getBankingCount() - baseInfoDto.getOrgWithSecurityCount());
 
         vo.setOnlineATMPropertyRight(new LinkedHashMap<>());
-        vo.getOnlineATMPropertyRight().put("穿墙式设备", baseInfoDto.getOffATMWallDeviceCount());
-        vo.getOnlineATMPropertyRight().put("大堂式设备", baseInfoDto.getOffATMObbyDeviceCount());
+        vo.getOnlineATMPropertyRight().put("穿墙式设备", baseInfoDto.getBankingWallDeviceCount());
+        vo.getOnlineATMPropertyRight().put("大堂式设备", baseInfoDto.getBankingObbyDeviceCount());
 
         vo.setOfflineATMPropertyRight(new LinkedHashMap<>());
         vo.getOfflineATMPropertyRight().put("穿墙式设备", baseInfoDto.getOffATMWallDeviceCount());
@@ -266,8 +266,8 @@ public class AppCockpitServiceImpl implements AppCockpitService {
         predicate3.test(Arrays.asList("1", "2", "3"), "每日履职", null);
         predicate3.test(Arrays.asList("4"), "报警测试", null);
         predicate3.test(Arrays.asList("5"), "UPS维护", null);
-        predicate3.test(Arrays.asList("6"), "夜间值守", null);
-        predicate3.test(Arrays.asList("7"), "离行巡检", null);
+        predicate3.test(Arrays.asList("7"), "夜间值守", null);
+        predicate3.test(Arrays.asList("6"), "离行巡检", null);
         predicate3.test(Arrays.asList("8"), "其它履职", null);
         return vo;
     }
@@ -320,11 +320,12 @@ public class AppCockpitServiceImpl implements AppCockpitService {
             List<AppSyntheticTaskCategoryDto> used = taskCategoryDtos.stream().filter(d -> types.contains(d.getPlanType())).collect(Collectors.toList());
             int total = used.stream().mapToInt(AppSyntheticTaskCategoryDto::getTotal).sum();
             int completed = used.stream().mapToInt(AppSyntheticTaskCategoryDto::getCompleted).sum();
+            int exceptionCount = used.stream().mapToInt(AppSyntheticTaskCategoryDto::getExceptionCount).sum();
             Float rate = computeRate(total, completed);
 
             vo.getRateByType().put(label, rate);
             vo.getTaskInfoByType().put(label, AppSyntheticSafetycheckTaskVo.builder()
-                    .questionCount(completed)
+                    .questionCount(exceptionCount)
                     .shouldCheckCount(total)
                     .checkedCount(completed)
                     .completedRate(rate)
@@ -485,4 +486,8 @@ public class AppCockpitServiceImpl implements AppCockpitService {
             return (divisor.floatValue() / total.floatValue());
         }
     }
+
+//    private void throwIfNull(Date date){
+//
+//    }
 }

+ 2 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/task/ResumptionTaskBusiness.java

@@ -347,7 +347,7 @@ public class ResumptionTaskBusiness extends TaskCreatingServiceImplBase<Resumpti
 //                List<AppPlanToRole> planToRoles = appPlanToRoles.stream().filter(item -> item.getPlanId().equals(plan.getId())).collect(Collectors.toList());
 
                 List<Short> executedOrders = executedResumptionList.stream()
-                        .filter(r -> ObjectUtil.equal(r.getOrgId(), orgId) && ObjectUtil.equal(r.getPlanId(), plan.getParentId()))
+                        .filter(r -> ObjectUtil.equal(r.getOrgId(), orgId) && ObjectUtil.equal(r.getPlanId(), plan.getId()))
                         .map(Resumption::getTimes)
                         .collect(Collectors.toList());
 
@@ -456,7 +456,7 @@ public class ResumptionTaskBusiness extends TaskCreatingServiceImplBase<Resumpti
                     .setField(DateField.SECOND, 0).setField(DateField.MILLISECOND, 0);
         }
 
-        return buildResumptions(appPlan, execOrg, planstartTime, planendTime, new ArrayList<>(), workTimes);
+        return buildResumptions(appPlan, execOrg, planstartTime, planendTime, executedOrders, workTimes);
     }
 
     private List<Resumption> buildResumptions(AppPlan appPlan, SysOrg execOrg, Date planStartTime, Date planEndTime, List<Short> executedOrders, List<SysWorkTime> workTimes) {

+ 5 - 8
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/CoreSafetyTaskServiceImpl.java

@@ -99,12 +99,12 @@ public class CoreSafetyTaskServiceImpl extends ServiceImpl<CoreSafetyTaskMapper,
             page.getRecords().forEach(r -> {
                 if (ObjectUtil.notEqual(r.getSourceType(), SafetyTaskSourceType.TempTask.getCode().longValue())) {
                     List<SafetyPlanRoleVo> roles = planRoles.stream().filter(pr -> ObjectUtil.equal(r.getPlanId(), pr.getPlanId())).collect(Collectors.toList());
-                    if (coreSafetyTask.getRoleId() != null) {
-                        roles = roles.stream().filter(e -> e.getRoleId().equals(coreSafetyTask.getRoleId())).collect(Collectors.toList());
+//                    if (coreSafetyTask.getRoleId() != null) {
+//                        roles = roles.stream().filter(e -> e.getRoleId().equals(coreSafetyTask.getRoleId())).collect(Collectors.toList());
                         r.setRoles(roles);
-                    } else {
-                        r.setRoles(roles);
-                    }
+//                    } else {
+//                        r.setRoles(roles);
+//                    }
                 } else {
                     Optional<IdNameVo> opt = tempTaskRoles.stream().filter(role -> ObjectUtil.equal(r.getRoleId(), role.getId())).findFirst();
                     if (opt.isPresent()) {
@@ -116,9 +116,6 @@ public class CoreSafetyTaskServiceImpl extends ServiceImpl<CoreSafetyTaskMapper,
                     }
                 }
             });
-
-
-            page.setRecords(page.getRecords().stream().filter(e -> e.getRoles().size() > 0).collect(Collectors.toList()));
         }
 
         //抓换为TableDataInfo适配前端

+ 17 - 29
soc-modules/soc-modules-core/src/main/resources/mapper/board/AppCockpitMapper.xml

@@ -108,32 +108,23 @@
                sum(if(oh.org_id is null, 1, 0))                      as unreachedCount,
                sum(if(o.type = 4, 1, 0))                             as bankingCount,
                sum(if(o.type = 5, 1, 0))                             as offATMCount,
-               sum(if(o.type = 4 and oh.ga382021 is not null, 1, 0)) as bankingGA382021,
-               sum(if(o.type = 4 and oh.ga382015 is not null, 1, 0)) as bankingGA382015,
-               sum(if(o.type = 5 and oh.ga382021 is not null, 1, 0)) as offATMGA382021,
-               sum(if(o.type = 5 and oh.ga382015 is not null, 1, 0)) as offATMGA382015,
-               sum(if(oe.business_library_type = 1, 1, 0))           as businessLibraryOne,
-               sum(if(oe.business_library_type = 2, 1, 0))           as businessLibraryTwo,
-               sum(if(oe.business_library_type = 3, 1, 0))           as businessLibraryThree,
-               sum(if(oe.business_library_type = 4, 1, 0))           as businessLibraryFour,
-               sum(if(oe.askari = 1, 1, 0))                          as orgWithSecurityCount,
-               sum(if(o.type = 4 and oe.lobby_equipment is not null, oe.lobby_equipment,
-                      0))                                            as bankingObbyDeviceCount,
-               sum(if(o.type = 4 and oe.wall_penetrating_equipment is not null, oe.wall_penetrating_equipment,
-                      0))                                            as bankingWallDeviceCount,
-               sum(if(o.type = 5 and oe.lobby_equipment is not null, oe.lobby_equipment,
-                      0))                                            as offATMObbyDeviceCount,
-               sum(if(o.type = 5 and oe.wall_penetrating_equipment is not null, oe.wall_penetrating_equipment,
-                      0))                                            as offATMWallDeviceCount
+               sum(if(o.type = 4, oh.ga382021, 0)) as bankingGA382021,
+               sum(if(o.type = 4, oh.ga382015, 0)) as bankingGA382015,
+               sum(if(o.type = 5, oh.ga382021, 0)) as offATMGA382021,
+               sum(if(o.type = 5, oh.ga382015 , 0)) as offATMGA382015,
+               sum(oe.business_library_type = 1)           as businessLibraryOne,
+               sum(oe.business_library_type = 2)           as businessLibraryTwo,
+               sum(oe.business_library_type = 3)           as businessLibraryThree,
+               sum(oe.business_library_type = 4)           as businessLibraryFour,
+               sum(if(oe.askari = 1, 1, 0))                             as orgWithSecurityCount,
+               sum(if(o.type = 4, oe.lobby_equipment,0))    as bankingObbyDeviceCount,
+               sum(if(o.type = 4, oe.wall_penetrating_equipment,0))     as bankingWallDeviceCount,
+               sum(if(o.type = 5, oe.lobby_equipment,0))    as offATMObbyDeviceCount,
+               sum(if(o.type = 5, oe.wall_penetrating_equipment,0))     as offATMWallDeviceCount
         FROM sys_org o
                  LEFT JOIN (SELECT org_id,
-                                   IF
-                                       (standard = 1, 1, 0) AS ga382021,
-
-
-                                   IF
-                                       (standard = 2, 1, 0) AS ga382015
-
+                                   sum(standard = 1) AS ga382021,
+                                   sum(standard = 2) AS ga382015
                             FROM sys_org_physical_defense_construction
                             WHERE type = 1
                                OR type = 3
@@ -141,8 +132,7 @@
                  LEFT JOIN sys_org_extend oe on o.id = oe.org_id
         WHERE o.deleted = 0
           and path like concat(#{orgPath}, '%')
-          AND (
-                    o.type = 4
+          AND ( o.type = 4
                 OR o.type = 5)
     </select>
     <select id="selectSyntheticResumption" resultType="com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto">
@@ -176,9 +166,7 @@
     <select id="selectSyntheticDrill" resultType="com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto">
         SELECT r.type                            as plan_type,
                count(0)                          AS total,
-               sum(
-                       IF
-                           (r.STATUS = 3, 1, 0)) AS completed
+               sum(r.STATUS = 3) AS completed
         FROM core_drill_task r
         WHERE r.start_date BETWEEN #{startDate}
             AND #{endDate}

+ 4 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/safetycheck/CoreSafetyTaskMapper.xml

@@ -224,10 +224,14 @@
         LEFT JOIN sys_org o2 ON o2.id = t.check_org_id
         LEFT JOIN sys_user u1 ON u1.id = t.submit_by
         LEFT JOIN sys_role r1 ON r1.id = t.role_id
+        left join core_safecheck_plan_to_role csptr on csptr.plan_id = t.plan_id
         WHERE t.deleted = 0
         <if test="task.title != null  and task.title != ''">
             and t.title like concat('%', #{task.title}, '%')
         </if>
+        <if test="task.roleId != null  and task.roleId != ''">
+            and csptr.role_id =#{task.roleId}
+        </if>
         <if test="task.planStartTime != null ">
             and DATE_FORMAT(t.plan_start_time, '%Y-%m-%d') = DATE_FORMAT(#{task.planStartTime}, '%Y-%m-%d')
         </if>