Browse Source

1.履职、检查的跟踪详情导出Excel新增任务类型;
2.驾驶舱网点机构数据平铺

jingyuanchao 1 year ago
parent
commit
4d9c3c2205

+ 7 - 3
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/service/impl/CockpitServiceImpl.java

@@ -1,7 +1,6 @@
 package com.xunmei.core.board.service.impl;
 
 import cn.hutool.core.date.DateUtil;
-import cn.hutool.core.util.NumberUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.xunmei.common.core.constant.SecurityConstants;
 import com.xunmei.common.core.domain.DateRange;
@@ -13,7 +12,6 @@ import com.xunmei.common.core.utils.NumberUtils;
 import com.xunmei.common.core.utils.StringUtils;
 import com.xunmei.core.board.dto.web.OrgMapDto;
 import com.xunmei.core.board.dto.web.TaskStatisticDto;
-import com.xunmei.core.board.dto.web.WebGA38InfoDto;
 import com.xunmei.core.board.dto.web.WebSyntheticQuestionDto;
 import com.xunmei.core.board.enums.PeriodEnum;
 import com.xunmei.core.board.mapper.CockpitMapper;
@@ -380,7 +378,13 @@ public class CockpitServiceImpl implements CockpitService {
     }
 
     private List<TaskStatisticVo> getTaskChildren(SysOrg parent, List<Integer> hsChildType) {
-        List<SysOrg> children = remoteOrgService.selectChildrenFromDb(parent.getId(), SecurityConstants.INNER);
+        List<SysOrg> children;
+        if (ObjectUtil.equal(OrgTypeEnum.HANG_SHE.getCode(),parent.getType())){
+            children = remoteOrgService.selectByOrgPathAndOrgType(parent.getPath(),OrgTypeEnum.YINGYE_WANGDIAN.getCode(), SecurityConstants.INNER);
+        }else {
+            children = remoteOrgService.selectChildrenFromDb(parent.getId(), SecurityConstants.INNER);
+        }
+
 //        children.sort(Comparator.comparing(SysOrg::getSort));
         List<TaskStatisticVo> list = new ArrayList<>();
 

+ 6 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/ResumptionRecordServiceImpl.java

@@ -7,10 +7,12 @@ import com.alibaba.excel.EasyExcel;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xunmei.common.core.constant.DictConstants;
 import com.xunmei.common.core.constant.SecurityConstants;
 import com.xunmei.common.core.exception.ServiceException;
 import com.xunmei.common.core.vo.IdNameVo;
 import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.common.security.utils.DictUtils;
 import com.xunmei.core.resumption.domain.AppPlanToRole;
 import com.xunmei.core.resumption.domain.Resumption;
 import com.xunmei.core.resumption.dto.resumptionRecord.ResumptionNFCDto;
@@ -149,6 +151,10 @@ public class ResumptionRecordServiceImpl extends ServiceImpl<ResumptionRecordMap
                     vo.setParentOrgName(org.get().getExtra());
                 }
             }*/
+            if (ObjectUtil.isNotEmpty(vo.getTaskType())){
+                vo.setTaskType(DictUtils.getDictLabel(DictConstants.RESUMPTION_PLAN_TYPE,Integer.parseInt(vo.getTaskType())));
+            }
+
 
             List<Long> roleIds = prMapper.stream().filter(pr -> ObjectUtil.equal(pr.getPlanId(), vo.getPlanId()))
                     .map(AppPlanToRole::getRoleId)

+ 17 - 10
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/resumptionRecord/ResumptionRecordPageVo.java

@@ -35,19 +35,26 @@ public class ResumptionRecordPageVo {
     @ColumnWidth(30)
     private String name;
 
+    /**
+     * 任务名称
+     */
+    @ExcelProperty(value = "任务类型",index = 2)
+    @ColumnWidth(30)
+    private String taskType;
+
     @ApiModelProperty("计划id")
     @ExcelIgnore
     private Long planId;
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @ApiModelProperty("任务开始时间")
-    @ExcelProperty(value ="开始时间",index=7)
+    @ExcelProperty(value ="开始时间",index=8)
     @ColumnWidth(30)
     private Date planStartTime;
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @ApiModelProperty(value ="截止时间")
-    @ExcelProperty(value ="截止时间",index = 8)
+    @ExcelProperty(value ="截止时间",index = 9)
     @ColumnWidth(30)
     private Date planEndTime;
 
@@ -62,18 +69,18 @@ public class ResumptionRecordPageVo {
     private String parentOrgName;
 
     @ApiModelProperty("地区")
-    @ExcelProperty(value="地区",index = 2)
+    @ExcelProperty(value="地区",index = 3)
     @ColumnWidth(20)
     private String affiliatedArea;
 
     @ApiModelProperty("行社名称")
-    @ExcelProperty(value="行社名称",index = 3)
+    @ExcelProperty(value="行社名称",index = 4)
     @ColumnWidth(20)
     private String affiliatedBank;
 
 
     @ApiModelProperty("机构名称")
-    @ExcelProperty(value="履职机构",index = 4)
+    @ExcelProperty(value="履职机构",index = 5)
     @ColumnWidth(20)
     private String orgName;
 
@@ -82,23 +89,23 @@ public class ResumptionRecordPageVo {
     private Long roleId;
 
     @ApiModelProperty("履职角色")
-    @ExcelProperty(value="履职人员",index = 5)
+    @ExcelProperty(value="履职人员",index = 6)
     @ColumnWidth(20)
     private String roleName;
 
     @ApiModelProperty("提交人")
-    @ExcelProperty(value = "登记人",index = 9)
+    @ExcelProperty(value = "登记人",index = 10)
     @ColumnWidth(15)
     private String submitter;
 
     @ApiModelProperty("提交时间")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    @ExcelProperty(value = "登记时间",index = 10)
+    @ExcelProperty(value = "登记时间",index = 11)
     @ColumnWidth(20)
     private Date submitTime;
 
     @ApiModelProperty("隐患数量")
-    @ExcelProperty(value = "隐患问题数",index = 11)
+    @ExcelProperty(value = "隐患问题数",index = 12)
     @ColumnWidth(15)
     private Integer abnormalDataNums;
 
@@ -107,7 +114,7 @@ public class ResumptionRecordPageVo {
     private String status;
 
     @JsonIgnore
-    @ExcelProperty(value = "任务进度",index = 6)
+    @ExcelProperty(value = "任务进度",index = 7)
     @ColumnWidth(15)
     private String statusText;
 

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

@@ -270,6 +270,7 @@ public class CoreSafetyTaskServiceImpl extends ServiceImpl<CoreSafetyTaskMapper,
         if (ObjectUtil.isNotEmpty(list)) {
             List<Long> idList = list.stream().map(CoreSafetyTaskExport::getPlanId).collect(Collectors.toList());
 
+
             LambdaQueryWrapper<CoreSafecheckPlanToRole> roleWrapper = new LambdaQueryWrapper<>();
             roleWrapper.in(CoreSafecheckPlanToRole::getPlanId, idList);
 
@@ -286,7 +287,9 @@ public class CoreSafetyTaskServiceImpl extends ServiceImpl<CoreSafetyTaskMapper,
             for (CoreSafetyTaskExport task : list) {
                 task.setIndex(list.indexOf(task) + 1);
                 List<CoreSafecheckPlanToRole> toRoleList = roleList.stream().filter(r -> ObjectUtil.equal(r.getPlanId(), task.getPlanId())).collect(Collectors.toList());
-
+                if (ObjectUtil.isNotEmpty(task.getTaskType())){
+                    task.setTaskType(DictUtils.getDictLabel(DictConstants.CHECK_TYPE,Integer.parseInt(task.getTaskType())));
+                }
                 if (ObjectUtil.isNotEmpty(toRoleList)) {
                     List<IdNameVo> finalNames = names;
                     String roleNames = toRoleList

+ 15 - 10
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/vo/CoreSafetyTaskExport.java

@@ -27,21 +27,26 @@ public class CoreSafetyTaskExport {
     @ColumnWidth(30)
     private String title;
 
+    @ApiModelProperty(value = "任务类型")
+    @ExcelProperty(value = "任务类型", index = 2)
+    @ColumnWidth(30)
+    private String taskType;
+
     @ApiModelProperty(value = "检查主体")
-    @ExcelProperty(value = "检查主体", index = 2)
+    @ExcelProperty(value = "检查主体", index = 3)
     @ColumnWidth(25)
     private String checkOrgName;
 
     @ApiModelProperty(value = "检查人员角色")
-    @ExcelProperty(value = "检查人员", index = 3)
+    @ExcelProperty(value = "检查人员", index = 4)
     private String submitName;
 
     @ApiModelProperty(value = "登记人")
-    @ExcelProperty(value = "登记人", index = 4)
+    @ExcelProperty(value = "登记人", index = 5)
     private String submitUserName;
 
     @ApiModelProperty(value = "0待检查,1检查完成")
-    @ExcelProperty(value = "任务进度", index = 5,converter = SafeStatusConverter.class)
+    @ExcelProperty(value = "任务进度", index = 6,converter = SafeStatusConverter.class)
     private String status;
 
     @ExcelIgnore
@@ -51,7 +56,7 @@ public class CoreSafetyTaskExport {
      * 受检机构所属地区
      */
     @ApiModelProperty(value = "受检机构所属地区")
-    @ExcelProperty(value = "地区", index = 6)
+    @ExcelProperty(value = "地区", index = 7)
     @ColumnWidth(15)
     private String affiliatedArea;
 
@@ -59,24 +64,24 @@ public class CoreSafetyTaskExport {
      * 受检机构所属行社
      */
     @ApiModelProperty(value = "受检机构所属行社")
-    @ExcelProperty(value = "行社名称", index = 7)
+    @ExcelProperty(value = "行社名称", index = 8)
     @ColumnWidth(20)
     private String affiliatedBank;
 
     @ApiModelProperty(value = "受检机构")
-    @ExcelProperty(value = "受检机构", index = 8)
+    @ExcelProperty(value = "受检机构", index = 9)
     @ColumnWidth(25)
     private String orgName;
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @ApiModelProperty(value = "开始日期")
-    @ExcelProperty(value = "开始日期", index = 9)
+    @ExcelProperty(value = "开始日期", index = 10)
     @ColumnWidth(20)
     private Date planStartTime;
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @ApiModelProperty(value = "截止日期")
-    @ExcelProperty(value = "截止日期", index = 10)
+    @ExcelProperty(value = "截止日期", index = 11)
     @ColumnWidth(20)
     private Date planEndTime;
 
@@ -98,6 +103,6 @@ public class CoreSafetyTaskExport {
     private Long planId;
 
     @ApiModelProperty(value = "异常数目")
-    @ExcelProperty(value = "隐患问题数", index = 11)
+    @ExcelProperty(value = "隐患问题数", index = 12)
     private String exceptionCount;
 }

+ 3 - 1
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/ResumptionRecordMapper.xml

@@ -122,8 +122,10 @@
         r.plan_end_time as planEndTime,
         o.short_name as org_name,
         o.affiliated_area ,
-        o.affiliated_bank
+        o.affiliated_bank,
+        ifnull(p.plan_type,'') as taskType
         from core_resumption r
+        left join core_resumption_plan p on p.id=r.plan_id
         inner join sys_org o on r.org_id=o.id
         <where>
             <if test="isTime==true">

+ 3 - 1
soc-modules/soc-modules-core/src/main/resources/mapper/safetycheck/CoreSafetyTaskMapper.xml

@@ -929,9 +929,11 @@
         t.exception_count,
         o1.affiliated_area,
         o1.affiliated_bank,
-        t.submit_by as submitUserName
+        t.submit_by as submitUserName,
+        ifnull(p.check_type,'') as taskType
         FROM
         core_safety_task t
+        left join core_safecheck_plan p on t.plan_id=p.id
         LEFT JOIN sys_org o1 ON o1.id = t.org_id
         LEFT JOIN core_safecheck_plan_to_role pr ON pr.plan_id = t.plan_id
         LEFT JOIN sys_role r ON r.id = pr.role_id