Ver código fonte

履职任务管理

jiawuxian 2 anos atrás
pai
commit
0da5582fab
29 arquivos alterados com 1916 adições e 535 exclusões
  1. 16 0
      soc-api/soc-api-system/src/main/java/com/xunmei/system/api/Eto/RoleConditionEto.java
  2. 10 0
      soc-api/soc-api-system/src/main/java/com/xunmei/system/api/RemoteOrgService.java
  3. 7 1
      soc-api/soc-api-system/src/main/java/com/xunmei/system/api/RemoteRoleService.java
  4. 5 0
      soc-api/soc-api-system/src/main/java/com/xunmei/system/api/factory/RemoteOrgFallbackFactory.java
  5. 10 2
      soc-api/soc-api-system/src/main/java/com/xunmei/system/api/factory/RemoteRoleFallbackFactory.java
  6. 4 2
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/vo/IdNameVo.java
  7. 2 2
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/web/domain/PageDto.java
  8. 0 90
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/controller/SysResumptionController.java
  9. 18 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/resumptionRecord/ResumptionNFCDto.java
  10. 44 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/resumptionRecord/ResumptionRecordPageDto.java
  11. 26 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/resumptionRecord/ResumptionRoleDto.java
  12. 3 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/mapper/AppPlanMapper.java
  13. 71 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/mapper/ResumptionRecordMapper.java
  14. 37 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/IResumptionRecordService.java
  15. 440 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/ResumptionRecordServiceImpl.java
  16. 56 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/resumptionRecord/AppResumptionDataInfoVo.java
  17. 31 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/resumptionRecord/NFCRecordVo.java
  18. 33 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/resumptionRecord/ResumptionRecordInfoVo.java
  19. 80 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/resumptionRecord/ResumptionRecordPageVo.java
  20. 16 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/resumptionRecord/ResumptionRecordTempVo.java
  21. 22 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/resumptionRecord/ResumptionRoleVo.java
  22. 6 0
      soc-modules/soc-modules-core/src/main/resources/mapper/resumption/AppPlanMapper.xml
  23. 411 0
      soc-modules/soc-modules-core/src/main/resources/mapper/resumption/ResumptionRecordMapper.xml
  24. 12 0
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysOrgController.java
  25. 11 5
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysRoleController.java
  26. 4 3
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/mapper/SysOrgMapper.java
  27. 3 2
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/ISysRoleService.java
  28. 13 4
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysRoleServiceImpl.java
  29. 525 424
      soc-modules/soc-modules-system/src/main/resources/mapper/system/SysOrgMapper.xml

+ 16 - 0
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/Eto/RoleConditionEto.java

@@ -0,0 +1,16 @@
+package com.xunmei.system.api.Eto;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class RoleConditionEto {
+    List<Long> ids;
+}

+ 10 - 0
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/RemoteOrgService.java

@@ -2,7 +2,9 @@ package com.xunmei.system.api;
 
 import com.xunmei.common.core.constant.SecurityConstants;
 import com.xunmei.common.core.constant.ServiceNameConstants;
+import com.xunmei.common.core.domain.IdName;
 import com.xunmei.common.core.domain.R;
+import com.xunmei.common.core.vo.IdNameVo;
 import com.xunmei.system.api.Eto.OrgListByTypesConditionEto;
 import com.xunmei.system.api.domain.SysOrg;
 import com.xunmei.system.api.factory.RemoteOrgFallbackFactory;
@@ -71,4 +73,12 @@ public interface RemoteOrgService {
      */
     @GetMapping("/org/getUpOrgs/{orgId}")
     List<Long> getUpOrgs(@PathVariable("orgId") Long orgId);
+
+    /**
+     * 获取机构及父级机构的名称
+     * @param ids
+     * @return
+     */
+    @GetMapping("/org/getParentName")
+    List<IdNameVo> getParentName(List<Long> ids);
 }

+ 7 - 1
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/RemoteRoleService.java

@@ -2,14 +2,18 @@ package com.xunmei.system.api;
 
 import com.xunmei.common.core.constant.SecurityConstants;
 import com.xunmei.common.core.constant.ServiceNameConstants;
+import com.xunmei.common.core.domain.IdName;
 import com.xunmei.common.core.domain.R;
+import com.xunmei.common.core.vo.IdNameVo;
+import com.xunmei.system.api.Eto.RoleConditionEto;
 import com.xunmei.system.api.domain.SysRole;
-import com.xunmei.system.api.factory.RemoteRoleFallbackFactory;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestHeader;
 import org.springframework.web.bind.annotation.RequestParam;
 
+import java.util.List;
+
 /**
  * @author :LuoWei
  * @date : 2023/8/25
@@ -20,4 +24,6 @@ public interface RemoteRoleService {
     @GetMapping("/role/getRoleById")
     R<SysRole> getRoleById(@RequestParam("id") Long id, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
 
+    @GetMapping("/role/getNames")
+    List<IdName<Long, String>> getNames(RoleConditionEto condition);
 }

+ 5 - 0
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/factory/RemoteOrgFallbackFactory.java

@@ -1,6 +1,7 @@
 package com.xunmei.system.api.factory;
 
 import com.xunmei.common.core.domain.R;
+import com.xunmei.common.core.vo.IdNameVo;
 import com.xunmei.system.api.Eto.OrgListByTypesConditionEto;
 import com.xunmei.system.api.RemoteOrgService;
 import com.xunmei.system.api.domain.SysOrg;
@@ -95,6 +96,10 @@ public class RemoteOrgFallbackFactory implements FallbackFactory<RemoteOrgServic
             public List<Long> getUpOrgs(@PathVariable("orgId") Long orgId) {
                 return new ArrayList<>();
             }
+            @Override
+            public List<IdNameVo> getParentName(List<Long> ids){
+                return  null;
+            }
         };
     }
 }

+ 10 - 2
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/factory/RemoteRoleFallbackFactory.java

@@ -1,7 +1,10 @@
 package com.xunmei.system.api.factory;
 
 
+import com.xunmei.common.core.domain.IdName;
 import com.xunmei.common.core.domain.R;
+import com.xunmei.common.core.vo.IdNameVo;
+import com.xunmei.system.api.Eto.RoleConditionEto;
 import com.xunmei.system.api.RemoteRoleService;
 import com.xunmei.system.api.domain.SysRole;
 import org.slf4j.Logger;
@@ -9,6 +12,8 @@ import org.slf4j.LoggerFactory;
 import org.springframework.cloud.openfeign.FallbackFactory;
 import org.springframework.stereotype.Component;
 
+import java.util.List;
+
 
 /**
  * @author :LuoWei
@@ -27,8 +32,11 @@ public class RemoteRoleFallbackFactory implements FallbackFactory<RemoteRoleServ
             public R<SysRole> getRoleById(Long id, String source) {
                 return null;
             }
-        };
 
-    
+            @Override
+            public List<IdName<Long, String>> getNames(RoleConditionEto condition) {
+                return null;
+            }
+        };
     }
 }

+ 4 - 2
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/vo/IdNameVo.java

@@ -7,7 +7,9 @@ import lombok.Data;
 @Data
 public class IdNameVo {
     @JsonSerialize(using = ToStringSerializer.class)
-    private  Long id;
+    private Long id;
 
-    private  String name;
+    private String name;
+
+    private String extra;
 }

+ 2 - 2
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/web/domain/PageDto.java

@@ -12,9 +12,9 @@ import lombok.Data;
 @Data
 public class PageDto<T> {
 
-    private int page = 0;
+    private Integer page = 0;
 
-    private int size = 10;
+    private Integer size = 10;
 
     public Page<T> getPageDto(){
         Page<T> mePage = new Page<>();

+ 0 - 90
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/controller/SysResumptionController.java

@@ -1,90 +0,0 @@
-package com.xunmei.core.resumption.controller;
-
-import com.xunmei.core.resumption.domain.SysResumption;
-import com.xunmei.core.resumption.service.ISysResumptionService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.xunmei.common.log.annotation.Log;
-import com.xunmei.common.log.enums.BusinessType;
-import com.xunmei.common.security.annotation.RequiresPermissions;
-import com.xunmei.common.core.web.controller.BaseController;
-import com.xunmei.common.core.web.domain.AjaxResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import com.xunmei.common.core.web.page.TableDataInfo;
-
-/**
- * 【请填写功能名称】Controller
- *
- * @author xunmei
- * @date 2023-08-22
- */
-@Api(tags = {"SysResumption"})
-@RestController
-@RequestMapping("/resumption")
-public class SysResumptionController extends BaseController {
-    @Autowired
-    private ISysResumptionService sysResumptionService;
-
-    /**
-     * 查询【请填写功能名称】列表
-     */
-    @ApiOperation(value = "查询SysResumption列表")
-    @RequiresPermissions("system:resumption:list")
-    @GetMapping("/list")
-    public TableDataInfo list(SysResumption sysResumption) {
-
-        return sysResumptionService.selectPage(sysResumption);
-    }
-
-
-    /**
-     * 获取【请填写功能名称】详细信息
-     */
-    @ApiOperation(value = "获取SysResumption详细信息")
-    @RequiresPermissions("system:resumption:query")
-    @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") String id) {
-        return success(sysResumptionService.selectSysResumptionById(id));
-    }
-
-    /**
-     * 新增【请填写功能名称】
-     */
-    @ApiOperation(value = "新增SysResumption")
-    @RequiresPermissions("system:resumption:add")
-    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody SysResumption sysResumption) {
-        return toAjax(sysResumptionService.insertSysResumption(sysResumption));
-    }
-
-    /**
-     * 修改【请填写功能名称】
-     */
-    @ApiOperation(value = "修改SysResumption")
-    @RequiresPermissions("system:resumption:edit")
-    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody SysResumption sysResumption) {
-        return toAjax(sysResumptionService.updateSysResumption(sysResumption));
-    }
-
-    /**
-     * 删除【请填写功能名称】
-     */
-    @ApiOperation(value = "删除SysResumption")
-    @RequiresPermissions("system:resumption:remove")
-    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable String[] ids) {
-        return toAjax(sysResumptionService.deleteSysResumptionByIds(ids));
-    }
-}

+ 18 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/resumptionRecord/ResumptionNFCDto.java

@@ -0,0 +1,18 @@
+package com.xunmei.core.resumption.dto.resumptionRecord;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author jingyuanchao
+ * @date 2022/6/1 15:24
+ */
+@Data
+public class ResumptionNFCDto {
+
+    @ApiModelProperty("机构id")
+    private Long orgId;
+
+    @ApiModelProperty("履职任务id")
+    private String resumptionId;
+}

+ 44 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/resumptionRecord/ResumptionRecordPageDto.java

@@ -0,0 +1,44 @@
+package com.xunmei.core.resumption.dto.resumptionRecord;
+
+import com.xunmei.common.core.web.domain.PageDto;
+import com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordPageVo;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author jingyuanchao
+ * @date 2022/5/11 15:03
+ */
+@Data
+public class ResumptionRecordPageDto extends PageDto<ResumptionRecordPageVo> {
+
+    @ApiModelProperty(value = "是否下穿查询机构")
+    private Boolean checkSub;
+
+    @NotNull(message = "请选择具体执行周期!")
+    @ApiModelProperty(value = "0:每日 1:每周 2:每月 3:每季度 4:每半年 5:每年 6:每小时")
+    private Integer executeCycle;
+
+    @ApiModelProperty(value = "执行角色")
+    private Long executeRole;
+
+    @ApiModelProperty(value = "状态 0:待履职 1:按时完成 3:未完成 5:补登完成")
+    private Integer status;
+
+    @ApiModelProperty(value = "时间范围")
+    private Date[] range;
+
+    @ApiModelProperty(value = "机构id")
+    private Long orgId;
+
+    @ApiModelProperty(value = "计划id")
+    private Long planId;
+
+    private List<Long> orgIdList;
+
+    private String  orgPath;
+}

+ 26 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/resumptionRecord/ResumptionRoleDto.java

@@ -0,0 +1,26 @@
+package com.xunmei.core.resumption.dto.resumptionRecord;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author jingyuanchao
+ * @date 2022/5/12 16:00
+ */
+@Data
+public class ResumptionRoleDto {
+    @ApiModelProperty("机构id")
+    private Long orgId;
+
+    @ApiModelProperty("执行周期")
+    private Integer  type;
+
+    @ApiModelProperty("机构id")
+    private List<Long> idList;
+
+    private Long roleId;
+    private String orgPath;
+
+}

+ 3 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/mapper/AppPlanMapper.java

@@ -2,6 +2,7 @@ package com.xunmei.core.resumption.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xunmei.common.core.vo.IdNameVo;
 import com.xunmei.core.resumption.domain.AppPlan;
 import com.xunmei.core.resumption.vo.appPlan.AppPlanVo;
 import com.xunmei.core.resumption.vo.appPlan.ObjectDataClass;
@@ -61,4 +62,6 @@ public interface AppPlanMapper extends BaseMapper<AppPlan> {
     AppPlan selectPlanByName(String planName);
 
     String selectPlanNameById(@Param("planId") Long planId);
+
+    List<IdNameVo> selectPlanNames(@Param("ids") List<Long> ids);
 }

+ 71 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/mapper/ResumptionRecordMapper.java

@@ -0,0 +1,71 @@
+package com.xunmei.core.resumption.mapper;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xunmei.core.resumption.vo.resumptionRecord.AppResumptionDataInfoVo;
+import com.xunmei.core.resumption.dto.resumptionRecord.ResumptionNFCDto;
+import com.xunmei.core.resumption.dto.resumptionRecord.ResumptionRecordPageDto;
+import com.xunmei.core.resumption.vo.resumptionRecord.NFCRecordVo;
+import com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordInfoVo;
+import com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordPageVo;
+import com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordTempVo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * <p>
+ * Mapper 接口
+ * </p>
+ *
+ * @author jingyuanchao
+ * @since 2022-05-11
+ */
+@Mapper
+public interface ResumptionRecordMapper {
+//    @DS(DataSourceName.SHARDING_DATA_SOURCE_NAME)
+    List<ResumptionRecordPageVo> selectListByCondition(@Param("pageDto") ResumptionRecordPageDto pageDto, @Param("hashMap") HashMap<String, Object> hashMap, @Param("isTime") Boolean isTime, @Param("ymdQuarters") Set<Integer> ymdQuarters);
+    //@DS(DataSourceName.SHARDING_DATA_SOURCE_NAME)
+//    @DS(DataSourceName.SHARDING_DATA_SOURCE_NAME)
+    Page<ResumptionRecordPageVo> selectPageByCondition(@Param("page") Page<ResumptionRecordPageVo> page, @Param("pageDto") ResumptionRecordPageDto pageDto, @Param("hashMap") HashMap<String, Object> hashMap, @Param("isTime") Boolean isTime, @Param("ymdQuarters") Set<Integer> ymdQuarters);
+
+    /**
+     * 未使用
+     *
+     * @param resumptionId
+     * @return
+     */
+    List<ResumptionRecordInfoVo> selectInfo(@Param("resumptionId") String resumptionId);
+
+//    List<ResumptionRoleVo> selectResumptionRole(@Param("roleDto") ResumptionRoleDto roleDto);
+//    @DS(DataSourceName.SHARDING_DATA_SOURCE_NAME)
+    List<AppResumptionDataInfoVo> selectResumptionDataList(@Param("resumptionId") String resumptionId);
+//    @DS(DataSourceName.SHARDING_DATA_SOURCE_NAME)
+    List<NFCRecordVo> selectNFCRecord(@Param("dto") ResumptionNFCDto dto);
+
+//    List<SecBookDtInst> selectSecBookDtInstList();
+
+//    List<SecBookDtiInst> selectSecBookDtiInstList(@Param("secBookDtInstId") Long secBookDtInstId);
+//    @DS(DataSourceName.SHARDING_DATA_SOURCE_NAME)
+    List<AppResumptionDataInfoVo> selectDataInfo(@Param("ruleItemId") Long ruleItemId, @Param("resumptionId") String resumptionId);
+
+    List<Long> selectRuleItemIdList(@Param("resumptionId") String resumptionId);
+
+    List<Long> selectRuleItemIdListByResumptionIdList(@Param("resumptionIdList") List<String> resumptionIdList);
+
+    ResumptionRecordInfoVo selectRuleItemInfo(@Param("ruleItemId") Long ruleItemId);
+
+//    List<ResumptionRoleVo> selectResumptionPlan(@Param("planDto") ResumptionRoleDto planDto);
+//    @DS(DataSourceName.SHARDING_DATA_SOURCE_NAME)
+//    RegisterBookItemInfoVo selectData(@Param("id") String id);
+//    @DS(DataSourceName.SHARDING_DATA_SOURCE_NAME)
+    List<Long> selectResumptionDataPointId(@Param("id") String id);
+
+    List<ResumptionRecordTempVo> selectAbnormalData(@Param("ruleItemIdList") List<Long> ruleItemIdList, @Param("resumptionIdList") List<String> resumptionIdList);
+//    @DS(DataSourceName.SHARDING_DATA_SOURCE_NAME)
+    List<Long> selectItemIdList(@Param("resumptionId")String resumptionId);
+
+    List<Long> selectRuleItemIdListNew(@Param("ruleItemIdList") List<Long> ruleItemIdList);
+}

+ 37 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/IResumptionRecordService.java

@@ -0,0 +1,37 @@
+package com.xunmei.core.resumption.service;
+
+import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.core.resumption.dto.resumptionRecord.ResumptionNFCDto;
+import com.xunmei.core.resumption.dto.resumptionRecord.ResumptionRecordPageDto;
+import com.xunmei.core.resumption.dto.resumptionRecord.ResumptionRoleDto;
+import com.xunmei.core.resumption.vo.resumptionRecord.NFCRecordVo;
+import com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordInfoVo;
+import com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRoleVo;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author jingyuanchao
+ * @since 2022-05-11
+ */
+public interface IResumptionRecordService {
+
+    TableDataInfo selectList(ResumptionRecordPageDto pageDto);
+
+    List<ResumptionRecordInfoVo> selectInfo(String resumptionId);
+
+//    List<ResumptionRoleVo> selectResumptionRole(ResumptionRoleDto roleDto);
+
+    List<NFCRecordVo> selectNFCRecord(ResumptionNFCDto dto);
+
+    void export(ResumptionRecordPageDto pageDto, HttpServletResponse response) throws Exception;
+
+//    List<SecBookDtInst> selectSecBookDtInstList();
+
+//    List<ResumptionRoleVo> selectResumptionPlan(ResumptionRoleDto roleDto);
+}

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

@@ -0,0 +1,440 @@
+package com.xunmei.core.resumption.service.impl;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.poi.excel.ExcelReader;
+import cn.hutool.poi.excel.ExcelUtil;
+import cn.hutool.poi.excel.ExcelWriter;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xunmei.common.core.constant.SecurityConstants;
+import com.xunmei.common.core.domain.IdName;
+import com.xunmei.common.core.vo.IdNameVo;
+import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.core.resumption.domain.AppResumptionTaskDataRemarkimg;
+import com.xunmei.core.resumption.dto.resumptionRecord.ResumptionNFCDto;
+import com.xunmei.core.resumption.dto.resumptionRecord.ResumptionRecordPageDto;
+import com.xunmei.core.resumption.mapper.AppPlanMapper;
+import com.xunmei.core.resumption.mapper.AppResumptionTaskDataRemarkimgMapper;
+import com.xunmei.core.resumption.mapper.ResumptionRecordMapper;
+import com.xunmei.core.resumption.service.AppPlanService;
+import com.xunmei.core.resumption.service.IResumptionRecordService;
+import com.xunmei.core.resumption.vo.resumptionRecord.*;
+import com.xunmei.system.api.Eto.RoleConditionEto;
+import com.xunmei.system.api.RemoteOrgService;
+import com.xunmei.system.api.RemoteRoleService;
+import com.xunmei.system.api.domain.Org;
+import io.netty.util.internal.StringUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.BoundValueOperations;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.io.InputStream;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * <p>
+ * 服务实现类
+ * </p>
+ *
+ * @author jingyuanchao
+ * @since 2022-05-11
+ */
+@Slf4j
+@Service
+public class ResumptionRecordServiceImpl implements IResumptionRecordService {
+    @Resource
+    private ResumptionRecordMapper resumptionRecordMapper;
+    @Resource
+    private RemoteOrgService orgService;
+    //    @Resource
+//    private OrgRepository orgRepository;
+//    @Autowired
+//    IFileService fileService;
+//    @Resource
+//    private ObjectMapper objectMapper;
+    @Resource
+    private AppResumptionTaskDataRemarkimgMapper taskDataRemarkimgMapper;
+    @Resource
+    private RedisTemplate<String, String> redisTemplate;
+
+    @Resource
+    private RemoteRoleService roleService;
+    @Resource
+    private AppPlanService appPlanService;
+
+    @Resource
+    AppPlanMapper appPlanMapper;
+
+    @Override
+    public TableDataInfo selectList(ResumptionRecordPageDto pageDto) {
+        Page<ResumptionRecordPageVo> page = pageDto.getPageDto();
+
+        Boolean isPage = Boolean.FALSE;
+
+        String strDate = DateUtil.format(new Date(), "yyyy-MM-dd");
+ /*       String orgKey = "resumptionRecordOrgList" + strDate;
+        Object objOrg = redisTemplate.opsForValue().get(orgKey);
+        List<Org> orgList = null;
+        if (ObjectUtil.isNotEmpty(objOrg)) {
+            orgList = JSON.parseArray(objOrg.toString(), Org.class);
+        } else {
+            orgList = orgService.all();
+            if (CollectionUtils.isNotEmpty(orgList)) {
+                this.redisTemplate.opsForValue().set(orgKey, JSON.toJSONString(orgList));
+                //设置过期时间24小时
+                this.redisTemplate.expire(orgKey, 24, TimeUnit.HOURS);
+            }
+        }*/
+        List<Long> orgList = orgService.selectCheckSubOrgIdList(pageDto.getOrgId(), SecurityConstants.INNER);
+        pageDto.setOrgIdList(orgList);
+//        if (pageDto.getCheckSub() && ObjectUtil.isNotEmpty(pageDto.getOrgId())) {
+//            final Org org = orgService.find(pageDto.getOrgId());
+//            pageDto.setOrgId(null);
+//            List<Long> orgIds = new ArrayList<>();
+//            orgList.forEach(org1 -> {
+//                if (org1.getPath().contains(org.getPath())) {
+//                    orgIds.add(org1.getId());
+//                }
+//            });
+//            pageDto.setOrgIdList(orgIds);
+//        }
+        final HashMap<String, Object> hashMap = new HashMap<>();
+        Set<Integer> ymdQuarters = new HashSet<>();
+        Boolean isTime = Boolean.FALSE;
+        if (ObjectUtil.isNotNull(pageDto.getRange()) && ObjectUtil.isAllNotEmpty(pageDto.getRange()[0], pageDto.getRange()[1])) {
+            isTime = Boolean.TRUE;
+            Date[] range = pageDto.getRange();
+            Date startDate = DateUtil.date(range[0]);
+            Date endDate = DateUtil.date(range[1]);
+            Calendar startCalendar = Calendar.getInstance();
+            Calendar endCalendar = Calendar.getInstance();
+            startCalendar.setTime(startDate);
+            endCalendar.setTime(endDate);
+            int startYear = DateUtil.year(startDate);
+            int endYear = DateUtil.year(endDate);
+            //计算startDate和endDate相差多少个月
+            int yearDiff = endCalendar.get(Calendar.YEAR) - startCalendar.get(Calendar.YEAR);
+            int monthDiff = endCalendar.get(Calendar.MONTH) - startCalendar.get(Calendar.MONTH);
+            int totalMonths = yearDiff * 12 + monthDiff;
+            if (totalMonths < 0) {
+                throw new RuntimeException("开始时间不能大于结束时间");
+            }
+            for (int i = 0; i <= totalMonths; i++) {
+                ymdQuarters.add(DateUtil.quarter(DateUtil.offsetMonth(startDate, i)));
+            }
+            hashMap.put("startYear", startYear);
+            hashMap.put("endYear", endYear);
+            hashMap.put("startDate", DateUtil.formatDate(startDate));
+            hashMap.put("endDate", DateUtil.formatDate(endDate));
+            switch (pageDto.getExecuteCycle()) {
+                case 1:
+                case 2:
+                 /*   hashMap.put("startDate", DateUtil.formatDate(startDate));
+                    hashMap.put("endDate", DateUtil.formatDate(endDate));*/
+                    break;
+                case 3:
+                    //每周履职
+                    startCalendar.setMinimalDaysInFirstWeek(6);
+                    int startWeek = startCalendar.get(Calendar.WEEK_OF_YEAR);
+                    hashMap.put("startWeek", String.valueOf(startWeek));
+                    //hashMap.put("endWeek", String.valueOf(endWeek));
+                    break;
+                case 4:
+                    //每月履职
+                    int startMonth = startCalendar.get(Calendar.MONTH) + 1;
+                    int endMonth = endCalendar.get(Calendar.MONTH) + 1;
+                   /* hashMap.put("startMonth", String.valueOf(startMonth));
+                    hashMap.put("endMonth", String.valueOf(endMonth));*/
+                    hashMap.put("startMonth", DateUtil.format(startCalendar.getTime(), "yyyy-MM-dd"));
+                    hashMap.put("endMonth", DateUtil.format(endCalendar.getTime(), "yyyy-MM-dd"));
+                    break;
+                case 5:
+                    //每季度履职
+                    int startQuarter = getCurrentQuarter(startDate);
+                    int endQuarter = getCurrentQuarter(endDate);
+                    hashMap.put("startQuarter", String.valueOf(startQuarter));
+                    hashMap.put("endQuarter", String.valueOf(endQuarter));
+                    break;
+                case 6:
+                    //每半年履职
+                    int startHalfYear = getCurrentHalfYear(startDate);
+                    int endHalfYear = getCurrentHalfYear(endDate);
+                    hashMap.put("startHalfYear", String.valueOf(startHalfYear));
+                    hashMap.put("endHalfYear", String.valueOf(endHalfYear));
+                    break;
+                default:
+                    break;
+            }
+        }
+
+//        if (isPage) {
+//            RESUMPTIONOVERVIEWLOG.info("履职记录查询,查询条件: pageDto: {},hashMap:{},isTime:{}", JSON.toJSONString(pageDto), JSON.toJSONString(hashMap), isTime);
+        page = resumptionRecordMapper.selectPageByCondition(page, pageDto, hashMap, isTime, ymdQuarters);
+        dealData(page.getRecords());
+        return TableDataInfo.success(page);
+//        } else {
+////            RESUMPTIONOVERVIEWLOG.info("履职记录导出,查询条件: pageDto: {},hashMap:{}", JSON.toJSONString(pageDto), JSON.toJSONString(hashMap));
+//            final List<ResumptionRecordPageVo> list = resumptionRecordMapper.selectListByCondition(pageDto, hashMap, isTime, ymdQuarters);
+//            dealData(list, orgList, strDate);
+//            return list;
+//        }
+    }
+
+
+    private void dealData(List<ResumptionRecordPageVo> list) {
+        if (list.size() < 1) {
+            return;
+        }
+//        String roleKey = "resumptionRecordRoleList" + strDate;
+//        BoundValueOperations<String, String> boundValueOps = redisTemplate.boundValueOps(roleKey);
+//        String s = boundValueOps.get();
+//        List<Role> roleList = null;
+//        if (ObjectUtil.isNotEmpty(s)) {
+//            roleList = JSON.parseArray(s, Role.class);
+//        } else {
+//            roleList = objectMapper.selectAllRole();
+//            if (CollectionUtils.isNotEmpty(list)) {
+//                boundValueOps.set(JSON.toJSONString(roleList));
+//                boundValueOps.expireAt(DateUtil.endOfDay(new Date()));
+//            }
+//        }
+
+   /*=    String planKey = "resumptionRecordPlanList"+strDate;
+        BoundValueOperations<String, String> operations = redisTemplate.boundValueOps(planKey);
+        String objPlan = operations.get();
+        List<AppPlan> planList =null;
+        if(ObjectUtil.isNotEmpty(objPlan)) {
+            planList = JSON.parseArray(objPlan,AppPlan.class);
+        }else{
+            planList =objectMapper.selectAllPlan();
+            if(CollectionUtils.isNotEmpty(list)){
+                operations.set(JSON.toJSONString(list));
+                operations.expireAt(DateUtil.endOfDay(new Date()));
+            }
+        }*/
+
+        List<IdNameVo> planList = appPlanMapper.selectPlanNames(list.stream().map(i -> i.getPlanId()).distinct().collect(Collectors.toList()));
+        List<IdNameVo> orgNames = orgService.getParentName(list.stream().map(i -> i.getOrgId()).distinct().collect(Collectors.toList()));
+        List<IdName<Long,String>> roleNames= roleService.getNames(RoleConditionEto
+                .builder()
+                .ids(list.stream().map(i -> i.getRoleId()).distinct().collect(Collectors.toList())).build());
+        list.stream().filter(pageVo -> ObjectUtil.equal(pageVo.getStatus(), "1")).forEach(pageVo -> pageVo.setSubmitter(null));
+
+        //List<Org> orgList = orgService.all();
+        for (ResumptionRecordPageVo vo : list) {
+            Optional<IdNameVo> org = orgNames.stream().filter(i -> ObjectUtil.equal(vo.getOrgId(), i.getId())).findFirst();
+            if (org.isPresent()) {
+                vo.setOrgName(org.get().getName());
+                vo.setParentOrgName(org.get().getExtra());
+            }
+            Optional<IdNameVo> plan=planList.stream().filter(i -> ObjectUtil.equal(vo.getPlanId(), i.getId())).findFirst();
+            if (plan.isPresent()) {
+                vo.setPlanName(plan.get().getName());
+            }
+
+            Optional<IdName<Long,String>>  role = roleNames.stream().filter(r -> r.getId().equals(vo.getRoleId())).findFirst();
+            if (role.isPresent()) {
+                vo.setRoleName(role.get().getName());
+            }
+        }
+    }
+
+//    @Override
+//    public List<SecBookDtInst> selectSecBookDtInstList() {
+//        return resumptionRecordMapper.selectSecBookDtInstList();
+//
+//    }
+
+    @Override
+    public List<ResumptionRecordInfoVo> selectInfo(String resumptionId) {
+//        final List<SecBookDtInst> secBookDtList = selectSecBookDtInstList();
+
+        List<ResumptionRecordInfoVo> arrayList = new ArrayList<>();
+        List<Long> ItemidList = resumptionRecordMapper.selectItemIdList(resumptionId);
+        //List<Long> ruleItemIdList = resumptionRecordMapper.selectRuleItemIdList(resumptionId);
+        List<Long> ruleItemIdList = new ArrayList<>();
+        if (CollectionUtil.isNotEmpty(ItemidList)) {
+            ruleItemIdList = resumptionRecordMapper.selectRuleItemIdListNew(ItemidList);
+        }
+        for (Long ruleItemId : ruleItemIdList) {
+            ResumptionRecordInfoVo info = resumptionRecordMapper.selectRuleItemInfo(ruleItemId);
+            arrayList.add(info);
+            List<AppResumptionDataInfoVo> dataInfoList = resumptionRecordMapper.selectDataInfo(ruleItemId, resumptionId);
+            info.setDataInfoList(dataInfoList);
+        }
+        final ArrayList<Long> list = new ArrayList<>();
+        for (ResumptionRecordInfoVo infoVo : arrayList) {
+            infoVo.getDataInfoList().stream().map(AppResumptionDataInfoVo::getDataId).forEach(list::add);
+        }
+
+        if (list.size() > 0) {
+            //  final List<AppResumptionDataImg> dataImgList = dataImgMapper.selectList(new LambdaQueryWrapper<AppResumptionDataImg>().in(AppResumptionDataImg::getDataId, list));
+            final List<AppResumptionTaskDataRemarkimg> taskDataRemarkimgList = taskDataRemarkimgMapper.selectList(new LambdaQueryWrapper<AppResumptionTaskDataRemarkimg>().in(AppResumptionTaskDataRemarkimg::getTaskDataId, list));
+
+            for (ResumptionRecordInfoVo infoVo : arrayList) {
+                for (AppResumptionDataInfoVo dataInfoVo : infoVo.getDataInfoList()) {
+                    final List<AppResumptionTaskDataRemarkimg> imgList = taskDataRemarkimgList.stream().filter(appResumptionDataImg -> appResumptionDataImg.getTaskDataId().equals(dataInfoVo.getDataId())).collect(Collectors.toList());
+                    dataInfoVo.setAppResumptionDataImgList(imgList);
+                    final String executeResult = dataInfoVo.getExecuteResult();
+                    if (StringUtils.isNotEmpty(executeResult)) {
+                        final Long dataTypeId = dataInfoVo.getDataTypeId();
+//                        final SecBookDtInst secBookDtInst = secBookDtList.stream().filter(sec -> sec.getId().equals(dataTypeId)).findFirst().orElse(null);
+//                        if (secBookDtInst != null) {
+//                            final List<SecBookDtiInst> dataItemList = secBookDtInst.getDataItemList();
+//                            final SecBookDtiInst secBookDtiInst = dataItemList.stream().filter(sec -> String.valueOf(sec.getDataItemValue()).equals(executeResult)).findFirst().orElse(null);
+//                            dataInfoVo.setExecuteResult(secBookDtiInst == null ? "" : secBookDtiInst.getDataItemName());
+//                            dataInfoVo.setExecuteFlag(secBookDtiInst == null ? "" : secBookDtiInst.getDataItemNumb());
+//
+//                        }
+                    }
+
+//                    final Set<String> keys = redisTemplate.keys("dict_config_check_type*");
+//                    if (ObjectUtil.isNotNull(keys) && keys.size() > 0) {
+//                        for (String key : keys) {
+//                            final String code = key.split("_")[4];
+//                            final String safeType = dataInfoVo.getSafeType();
+//                            if (safeType == null) {
+//                                continue;
+//                            }
+//                            if (dataInfoVo.getSafeType().equals(code)) {
+//                                final String name = redisTemplate.opsForValue().get(key);
+//                                dataInfoVo.setSafeType(name);
+//                                break;
+//                            }
+//                        }
+//                    }
+                }
+            }
+        }
+        return arrayList;
+    }
+
+//    @Override
+//    public List<ResumptionRoleVo> selectResumptionRole(ResumptionRoleDto roleDto) {
+//        // 1.12.1版本性能优化,此接口不再从履职数据中获取,根据履职计划查询
+//        /*final Org org = orgService.find(roleDto.getOrgId());
+//        roleDto.setOrgPath(org.getPath());
+//        return resumptionRecordMapper.selectResumptionRole(roleDto);*/
+//        return objectMapper.selectResumptionRoleIdAndName(roleDto);
+//    }
+//
+//    @Override
+//    public List<ResumptionRoleVo> selectResumptionPlan(ResumptionRoleDto planDto) {
+//        /*final Org org = orgService.find(planDto.getOrgId());
+//        planDto.setOrgPath(org.getPath());
+//        return resumptionRecordMapper.selectResumptionPlan(planDto);*/
+//        final List<ResumptionRoleVo> list = objectMapper.selectResumptionPlanIdAndName(planDto);
+//        if (ObjectUtil.equal(planDto.getType(), 0)) {
+//            planDto.setType(6);
+//            list.addAll(objectMapper.selectResumptionPlanIdAndName(planDto));
+//        }
+//        return list;
+//    }
+
+    @Override
+    public List<NFCRecordVo> selectNFCRecord(ResumptionNFCDto dto) {
+        return resumptionRecordMapper.selectNFCRecord(dto);
+    }
+
+
+    @Override
+    public void export(ResumptionRecordPageDto pageDto, HttpServletResponse response) throws Exception {
+//        Org org = orgService.find(pageDto.getOrgId());
+//        if (org == null) {
+//            throw new RuntimeException("请选择机构再导出数据");
+//        }
+//        pageDto.setPage(null);
+//        pageDto.setSize(null);
+//        final List<ResumptionRecordPageVo> data = (List<ResumptionRecordPageVo>) this.selectList(pageDto);
+//        if (data.size() == 0) {
+//            throw new RuntimeException("暂无可用数据导出!");
+//        }
+//        String newFile = "【" + org.getName() + "】-履职记录" + DateHelper.getDateString(new Date()) + ".et";
+//        InputStream stream = FileExportUtils.getTemplateExcel("ResumptionRecord");
+//        ExcelReader er = ExcelUtil.getReader(stream);
+//
+//        ExcelWriter ew = er.getWriter();
+//        int len = ew.getColumnCount();
+//        int r = 1;
+//        for (ResumptionRecordPageVo rowData : data) {
+//            Row row = ew.getOrCreateRow(r);
+//            for (int i = 0; i < len; i++) {
+//                Cell cell = row.createCell(i);
+//                switch (i) {
+//                    case 0:
+//                        cell.setCellValue(rowData.getPlanName());
+//                        break;
+//                    case 1:
+//                        cell.setCellValue(DateHelper.toStr(rowData.getPlanStartTime()));
+//                        break;
+//                    case 2:
+//                        cell.setCellValue(DateHelper.toStr(rowData.getPlanEndTime()));
+//                        break;
+//                    case 3:
+//                        String status = StringUtil.EMPTY_STRING;
+//                        switch (rowData.getStatus()) {
+//                            case 0:
+//                                status = "待履职";
+//                                break;
+//                            case 1:
+//                                status = "按时完成";
+//                                break;
+//                            case 3:
+//                                status = "未完成";
+//                                break;
+//                            case 5:
+//                                status = "补登完成";
+//                                break;
+//                            default:
+//                                break;
+//                        }
+//                        cell.setCellValue(status);
+//                        break;
+//                    case 4:
+//                        cell.setCellValue(rowData.getParentOrgName());
+//                        break;
+//                    case 5:
+//                        cell.setCellValue(rowData.getOrgName());
+//                        break;
+//                    case 6:
+//                        cell.setCellValue(rowData.getRoleName());
+//                        break;
+//                    case 7:
+//                        cell.setCellValue(DateHelper.toStr(rowData.getSubmitTime()));
+//                        break;
+//                    case 8:
+//                        cell.setCellValue(rowData.getSubmitter());
+//                        break;
+//                    case 9:
+//                        cell.setCellValue(rowData.getAbnormalDataNums());
+//                        break;
+//                    default:
+//                        break;
+//                }
+//            }
+//            r++;
+//        }
+//        ew.autoSizeColumnAll();
+//        FileExportUtils.downloadExcelStream(response, ew, newFile);
+    }
+
+    private int getCurrentQuarter(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        return calendar.get(Calendar.MONTH) / 3 + 1;
+    }
+
+    private int getCurrentHalfYear(Date date) {
+        return DateUtil.dayOfMonth(date) <= 6 ? 1 : 2;
+
+    }
+}

+ 56 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/resumptionRecord/AppResumptionDataInfoVo.java

@@ -0,0 +1,56 @@
+package com.xunmei.core.resumption.vo.resumptionRecord;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.xunmei.core.resumption.domain.AppResumptionTaskDataRemarkimg;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author jingyuanchao
+ * @date 2022/5/12 17:43
+ */
+@Data
+public class AppResumptionDataInfoVo {
+
+    @ApiModelProperty("检查点编号")
+    private Integer rulePointNum;
+
+    @ApiModelProperty("履职任务详情id")
+    private Long dataId;
+
+    @ApiModelProperty("检查点名称")
+    private String rulePointName;
+
+//    @ApiModelProperty(value = "安防类型,字典表")
+//    private String safeType;
+
+    @ApiModelProperty(value = "检查区域,区域表id")
+    private String checkAreaName;
+
+    @ApiModelProperty(value = "执行结果")
+    private String executeResult;
+
+    @ApiModelProperty(value = "标记,仅供前端页面渲染字体颜色使用")
+    private String executeFlag;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    @ApiModelProperty(value = "执行时间")
+    private Date executeTime;
+
+    @ApiModelProperty(value = "描述")
+    private String resRemark;
+
+    @ApiModelProperty(value = "图片数组")
+   // private List<AppResumptionDataImg> appResumptionDataImgList;
+    private List<AppResumptionTaskDataRemarkimg> appResumptionDataImgList;
+
+    @ApiModelProperty(value = "状态")
+    private Integer executeStatus;
+
+    @ApiModelProperty("数据类型id")
+    private Long dataTypeId;
+
+}

+ 31 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/resumptionRecord/NFCRecordVo.java

@@ -0,0 +1,31 @@
+package com.xunmei.core.resumption.vo.resumptionRecord;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author jingyuanchao
+ * @date 2022/5/13 10:16
+ */
+@Data
+public class NFCRecordVo {
+    @ApiModelProperty("区域名称")
+    private String areaName;
+
+    @ApiModelProperty("采集点名称")
+    private String collectionAreaName;
+
+    @ApiModelProperty("执行人")
+    private String executor;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    @ApiModelProperty("执行时间")
+    private Date executeTime;
+
+    private  int scanMethod;
+
+    private String img;
+}

+ 33 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/resumptionRecord/ResumptionRecordInfoVo.java

@@ -0,0 +1,33 @@
+package com.xunmei.core.resumption.vo.resumptionRecord;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author jingyuanchao
+ * @date 2022/5/12 10:50
+ */
+@Data
+public class ResumptionRecordInfoVo {
+    @ApiModelProperty(value = "任务id")
+    private String resumptionId;
+
+    @ApiModelProperty(value = "检查项id")
+    private Long itemId;
+
+    @ApiModelProperty(value = "检查项编号")
+    private Integer itemNum;
+
+    @ApiModelProperty(value = "检查项名称")
+    private String itemName;
+
+    @ApiModelProperty(value = "检查项标准及要求")
+    private String itemDesc;
+
+    @ApiModelProperty(value = "标题")
+    private String planName;
+
+    private List<AppResumptionDataInfoVo> dataInfoList;
+}

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

@@ -0,0 +1,80 @@
+package com.xunmei.core.resumption.vo.resumptionRecord;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author jingyuanchao
+ * @date 2022/5/11 15:47
+ */
+@Data
+public class ResumptionRecordPageVo {
+    @ApiModelProperty("履职任务id")
+    private String resumptionId;
+
+    /**任务名称*/
+    private String taskName;
+
+    @ApiModelProperty("计划名称")
+    private String planName;
+
+    @ApiModelProperty("计划id")
+    private Long planId;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty("任务开始时间")
+    private Date planStartTime;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty("任务结束时间")
+    private Date planEndTime;
+
+
+    @ApiModelProperty(value = "机构id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long orgId;
+
+    @ApiModelProperty("机构名称")
+    private String orgName;
+
+//    @ApiModelProperty("上级机构编码")
+//    private Long parentOrgId;
+
+    @ApiModelProperty("上级机构")
+    private String parentOrgName;
+
+//    @ApiModelProperty("时间")
+//    private String time;
+
+//    @ApiModelProperty("状态 0:待履职 1:按时完成 3:未完成 5:补登完成")
+    private String status;
+
+    @ApiModelProperty("履职角色id")
+    private Long roleId;
+
+    @ApiModelProperty("履职角色")
+    private String roleName;
+
+    @ApiModelProperty("提交时间")
+    private Date submitTime;
+
+    @ApiModelProperty("提交人")
+    private String submitter;
+/*    @ApiModelProperty("提交时间")
+    private Date executeTime;*/
+
+
+    @ApiModelProperty("异常要点数量")
+    private int abnormalDataNums;
+
+//    @ApiModelProperty("二级机构")
+//    private String secondaryOrgName;
+//
+//    @ApiModelProperty("三级机构")
+//    private String thirdOrgName;
+}

+ 16 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/resumptionRecord/ResumptionRecordTempVo.java

@@ -0,0 +1,16 @@
+package com.xunmei.core.resumption.vo.resumptionRecord;
+
+import lombok.Data;
+
+/**
+ * @author jingyuanchao
+ * @date 2022/6/21 16:52
+ */
+@Data
+public class ResumptionRecordTempVo {
+
+    private String resumptionId;
+
+    private int nums;
+    private int nums2;
+}

+ 22 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/resumptionRecord/ResumptionRoleVo.java

@@ -0,0 +1,22 @@
+package com.xunmei.core.resumption.vo.resumptionRecord;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author jingyuanchao
+ * @date 2022/5/12 16:04
+ */
+@Data
+public class ResumptionRoleVo {
+
+    @ApiModelProperty("角色id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long id;
+    @ApiModelProperty("角色名称")
+    private String name;
+
+    private int status;
+}

+ 6 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/AppPlanMapper.xml

@@ -213,4 +213,10 @@
     <select id="selectPlanNameById" resultType="java.lang.String">
         select plan_name from sys_plan where id = #{planId}
     </select>
+    <select id="selectPlanNames" resultType="com.xunmei.common.core.vo.IdNameVo">
+        select id, plan_name as name from sys_plan where id in
+            <foreach collection="ids" item="id" open="(" close=")" separator=",">
+                #{id}
+            </foreach>
+    </select>
 </mapper>

+ 411 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/ResumptionRecordMapper.xml

@@ -0,0 +1,411 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.xunmei.core.resumption.mapper.ResumptionRecordMapper">
+    <select id="selectListByCondition" resultType="com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordPageVo">
+        select r.id as resumptionId,r.exception_count as abnormalDataNums,
+       <!-- p.plan_name as time,
+        p.plan_name as planName,-->
+        r.plan_id as planId,
+        r.ymd_date as ymdDate,
+        r.status as status,
+        r.role_id as roleId,
+        <!-- o.name as orgName ,
+        ro.name as roleName,-->
+        r.submit_time as submitTime,
+        <!--u.name as submitter,-->
+        r.modified_name as submitter,
+        r.plan_start_time as executeTime,
+        r.plan_start_time as planStartTime,
+        r.plan_end_time as planEndTime,
+        r.org_id as orgId
+        from core_resumption r
+        <!--inner join t_app_plan p on r.plan_id = p.id
+        inner join sys_org o on r.org_id = o.id and o.deleted = 0
+        inner join t_role ro on ro.id = r.role_id
+        left join t_user u on u.id=r.modified_id-->
+        <where>
+            <choose>
+                <when test="pageDto.executeCycle  ==0 ">
+                    r.type in (0,6)
+                </when>
+                <otherwise>
+                    r.type = #{pageDto.executeCycle}
+                </otherwise>
+            </choose>
+            <if test="isTime == true">
+                <choose>
+                    <when test="pageDto.executeCycle==0||pageDto.executeCycle==6">
+                        and r.ymd_year between #{hashMap.startYear} and #{hashMap.endYear}
+                        and r.ymd_date between #{hashMap.startDate} and #{hashMap.endDate}
+                        and r.ymd_quarter in
+                        <foreach collection="ymdQuarters" item="item" index="index" open="(" separator="," close=")">
+                            #{item}
+                        </foreach>
+                    </when>
+                    <when test="pageDto.executeCycle==1">
+                        and r.ymd_year between #{hashMap.startYear} and #{hashMap.endYear}
+                        and r.ymd_week = #{hashMap.startWeek}
+                        and r.ymd_quarter in
+                        <foreach collection="ymdQuarters" item="item" index="index" open="(" separator="," close=")">
+                            #{item}
+                        </foreach>
+                    </when>
+                    <when test="pageDto.executeCycle==2">
+                        and r.ymd_year between #{hashMap.startYear} and #{hashMap.endYear}
+                        <!--and r.ymd_month between #{hashMap.startMonth} and #{hashMap.endMonth}-->
+                        and r.ymd_date between #{hashMap.startDate} and #{hashMap.endDate}
+                        and r.ymd_quarter in
+                        <foreach collection="ymdQuarters" item="item" index="index" open="(" separator="," close=")">
+                            #{item}
+                        </foreach>
+                    </when>
+                    <when test="pageDto.executeCycle==3">
+                        and r.ymd_year between #{hashMap.startYear} and #{hashMap.endYear}
+                        <!--and r.ymd_quarter between #{hashMap.startQuarter} and #{hashMap.endQuarter}-->
+                        and r.ymd_quarter in
+                        <foreach collection="ymdQuarters" item="item" index="index" open="(" separator="," close=")">
+                            #{item}
+                        </foreach>
+                    </when>
+                    <when test="pageDto.executeCycle==4">
+                        and r.ymd_year between #{hashMap.startYear} and #{hashMap.endYear}
+                        and r.ymd_halfyear between #{hashMap.startHalfYear} and #{hashMap.endHalfYear}
+                        and r.ymd_quarter in
+                        <foreach collection="ymdQuarters" item="item" index="index" open="(" separator="," close=")">
+                            #{item}
+                        </foreach>
+                    </when>
+                    <when test="pageDto.executeCycle==5">
+                        and r.ymd_year between #{hashMap.startYear} and #{hashMap.endYear}
+                        and r.ymd_quarter=1
+                    </when>
+                </choose>
+            </if>
+            <if test="pageDto.status !=null ">
+                and r.status = #{pageDto.status}
+            </if>
+            <if test="pageDto.orgId !=null ">
+                and r.org_id = #{pageDto.orgId}
+            </if>
+            <if test="pageDto.executeRole !=null ">
+                and r.role_id = #{pageDto.executeRole}
+            </if>
+            <if test="pageDto.planId !=null ">
+                and r.plan_id = #{pageDto.planId}
+            </if>
+            <!--<if test="pageDto.checkSub == true">
+                and o.path like concat(#{pageDto.orgPath},'%')
+            </if>-->
+            <if test="pageDto.orgIdList!=null and pageDto.orgIdList.size()>0">
+                and r.org_id in
+                <foreach collection="pageDto.orgIdList" item="orgId" open="(" close=")" separator=",">
+                    #{orgId}
+                </foreach>
+            </if>
+        </where>
+        order by r.plan_start_time desc ,r.plan_end_time desc
+    </select>
+    <select id="selectPageByCondition" resultType="com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordPageVo">
+        select r.id as resumptionId,r.exception_count as abnormalDataNums,
+        <!--p.plan_name as time,
+        p.plan_name as planName,-->
+        r.plan_id as planId,
+        <!--        p.plan_exec as planExec,-->
+        r.ymd_date as ymdDate,
+        r.status as status,
+        r.role_id as roleId,
+        <!--o.name as orgName ,-->
+        <!--ro.name as roleName,-->
+        r.submit_time as submitTime,
+        r.modified_name as submitter,
+        <!--u.name as submitter,-->
+        r.org_id as orgId,
+        r.plan_start_time as planStartTime,
+        r.plan_end_time as planEndTime
+        from core_resumption r
+        <!--inner join t_app_plan p on r.plan_id = p.id
+        inner join sys_org o on r.org_id = o.id and o.deleted = 0
+        inner join t_role ro on ro.id = r.role_id
+        eft join t_user u on u.id=r.modified_id-->
+        <where>
+            <choose>
+                <when test="pageDto.executeCycle  ==1">
+                    r.type in (1,2)
+                </when>
+                <otherwise>
+                    r.type = #{pageDto.executeCycle}
+                </otherwise>
+            </choose>
+
+            <if test="isTime==true">
+                <if test="pageDto.executeCycle==1||pageDto.executeCycle==2">
+                    and r.ymd_year between #{hashMap.startYear} and #{hashMap.endYear}
+                    and r.ymd_date between #{hashMap.startDate} and #{hashMap.endDate}
+                    and r.ymd_quarter in
+                    <foreach collection="ymdQuarters" item="item" index="index" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+
+                <if test="pageDto.executeCycle==3">
+                    and r.ymd_year between #{hashMap.startYear} and #{hashMap.endYear}
+                    and r.ymd_date between #{hashMap.startDate} and #{hashMap.endDate}
+                    and r.ymd_week = #{hashMap.startWeek}
+                    and r.ymd_quarter in
+                    <foreach collection="ymdQuarters" item="item" index="index" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+                <if test="pageDto.executeCycle==4">
+                    and r.ymd_year between #{hashMap.startYear} and #{hashMap.endYear}
+                    and r.ymd_date between #{hashMap.startDate} and #{hashMap.endDate}
+                   <!-- and r.ymd_month between #{hashMap.startMonth} and #{hashMap.endMonth}-->
+                    and r.ymd_date between #{hashMap.startMonth} and #{hashMap.endMonth}
+                    and r.ymd_quarter in
+                    <foreach collection="ymdQuarters" item="item" index="index" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+                <if test="pageDto.executeCycle==5">
+                    and r.ymd_year between #{hashMap.startYear} and #{hashMap.endYear}
+                    and r.ymd_date between #{hashMap.startDate} and #{hashMap.endDate}
+                    <!--and r.ymd_quarter between #{hashMap.startQuarter} and #{hashMap.endQuarter}-->
+                    and r.ymd_quarter in
+                    <foreach collection="ymdQuarters" item="item" index="index" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+                <if test="pageDto.executeCycle==6">
+                    and r.ymd_year between #{hashMap.startYear} and #{hashMap.endYear}
+                    and r.ymd_date between #{hashMap.startDate} and #{hashMap.endDate}
+                    and r.ymd_halfyear between #{hashMap.startHalfYear} and #{hashMap.endHalfYear}
+                    and r.ymd_quarter in
+                    <foreach collection="ymdQuarters" item="item" index="index" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+                <if test="pageDto.executeCycle==7">
+                    and r.ymd_year between #{hashMap.startYear} and #{hashMap.endYear}
+                    and r.ymd_date between #{hashMap.startDate} and #{hashMap.endDate}
+                    and r.ymd_quarter=1
+                </if>
+            </if>
+            <if test="pageDto.status !=null ">
+                and r.status = #{pageDto.status}
+            </if>
+            <if test="pageDto.orgId !=null ">
+                and r.org_id = #{pageDto.orgId}
+            </if>
+            <if test="pageDto.executeRole !=null ">
+                and r.role_id = #{pageDto.executeRole}
+            </if>
+            <if test="pageDto.planId !=null ">
+                and r.plan_id = #{pageDto.planId}
+            </if>
+<!--            <if test="pageDto.checkSub == true">-->
+<!--                and o.path like concat(#{pageDto.orgPath},'%')-->
+<!--            </if>-->
+          <if test="pageDto.orgIdList!=null and pageDto.orgIdList.size()>0">
+              and r.org_id in
+              <foreach collection="pageDto.orgIdList" item="orgId" open="(" close=")" separator=",">
+                  #{orgId}
+              </foreach>
+          </if>
+        </where>
+        order by r.plan_start_time desc ,r.plan_end_time desc
+    </select>
+    <select id="selectResumptionDataList" resultType="com.xunmei.core.resumption.vo.resumptionRecord.AppResumptionDataInfoVo">
+        select p.point_num  as rulePointNum,
+               p.point_name as rulePointName,
+               p.safe_type  as safeType,
+               a.name       as checkAreaName,
+               d.res_value  as executeResult,
+               d.res_time   as executeTime,
+               d.res_remark as resRemark,
+               d.res_status as executeStatus,
+               d.id         as dataId,
+               p.data_type  as dataTypeId
+        from core_resumption_data d
+                 inner join core_resumption r on d.resumption_id = r.id
+                 inner join core_resumption_data_rule_point p on d.item_id = p.id
+                 inner join sys_area a on a.id = p.area_id
+        where d.resumption_id = #{resumptionId}
+    </select>
+
+    <resultMap id="infoResultMap" type="com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordInfoVo">
+        <id column="id" jdbcType="BIGINT" javaType="java.lang.Long" property="itemId"/>
+        <result column="item_name" jdbcType="VARCHAR" javaType="java.lang.String" property="itemName"/>
+        <result column="item_desc" jdbcType="VARCHAR" javaType="java.lang.String" property="itemDesc"/>
+        <collection property="dataInfoList"
+                    ofType="com.xunmei.core.resumption.vo.resumptionRecord.AppResumptionDataInfoVo"
+                    select="selectResumptionDataList"
+                    column="{resumptionId=resumptionId}"/>
+    </resultMap>
+
+
+    <select id="selectInfo" parameterType="java.lang.String" resultMap="infoResultMap">
+        select distinct #{resumptionId} as resumptionId,
+                        i.id,
+                        i.item_name,
+                        i.item_desc
+        from core_resumption_rule_item i
+        where i.id in (select item_id
+                       from core_resumption_plan_to_item pti
+                       where pti.plan_id in (select plan_id from core_resumption where id = #{resumptionId}))
+    </select>
+
+    <select id="selectResumptionRole" resultType="com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRoleVo">
+        select distinct tr.id as id, tr.name as name
+        from core_resumption r
+        inner join sys_role tr on r.role_id = tr.id
+        inner join sys_org o on r.org_id = o.id and o.deleted=0
+        where o.path like concat(#{roleDto.orgPath},'%')
+        <if test="roleDto.type != null">
+            and r.type = #{roleDto.type}
+        </if>
+    </select>
+
+    <select id="selectNFCRecord" resultType="com.xunmei.core.resumption.vo.resumptionRecord.NFCRecordVo">
+        select distinct a.name as areaName,
+        b.collection_area_name as collectionAreaName,
+        n.submit_time as executeTime,
+        d.submit_name as executor,
+        n.scan_method as scanMethod,
+        n.img
+        from core_resumption_data_nfc n
+        inner join sys_nfc_bind b on n.nfc_id = b.check_id and b.org_id = #{dto.orgId}
+        inner join sys_area a on a.id = b.area_id
+        <!--INNER JOIN core_resumption_data d on d.resumption_id = n.resumption_id and d.item_id = n.point_id-->
+        INNER JOIN core_resumption_data d on d.resumption_id = n.resumption_id and d.area_id = a.id
+
+        <!--where d.resumption_id = #{dto.resumptionId}-->
+        where n.resumption_id = #{dto.resumptionId}
+    </select>
+
+<!--    <resultMap id="secMap" type="com.isp.dict.domain.SecBookDtInst">-->
+<!--        <id column="ID" jdbcType="BIGINT" javaType="java.lang.Long" property="id"/>-->
+<!--        <result column="DATA_NAME" jdbcType="VARCHAR" javaType="java.lang.String" property="dataName"/>-->
+<!--        <result column="DATA_TYPE" jdbcType="VARCHAR" javaType="java.lang.String" property="dataType"/>-->
+<!--        <result column="DELETE_STATUS" jdbcType="VARCHAR" javaType="java.lang.String" property="deleteStatus"/>-->
+<!--        <result column="IS_VALIE" jdbcType="VARCHAR" javaType="java.lang.String" property="isValie"/>-->
+<!--        <collection property="dataItemList" ofType="com.isp.dict.domain.SecBookDtiInst"-->
+<!--                    select="selectSecBookDtiInstList"-->
+<!--                    column="{secBookDtInstId=ID}">-->
+<!--        </collection>-->
+<!--    </resultMap>-->
+
+<!--    <select id="selectSecBookDtInstList" resultMap="secMap">-->
+<!--        select *-->
+<!--        from sec_book_dt_inst-->
+<!--    </select>-->
+
+<!--    <select id="selectSecBookDtiInstList" resultType="com.isp.dict.domain.SecBookDtiInst">-->
+<!--        select ID                  as id,-->
+<!--               SEC_BOOK_DT_INST_ID as secBookDtInesId,-->
+<!--               DATA_ITEM_NUMB      as dataItemNumb,-->
+<!--               DATA_ITEM_NAME      as dataItemName,-->
+<!--               DATA_ITEM_VALUE     as dataItemValue-->
+<!--        from sec_book_dti_inst-->
+<!--        where SEC_BOOK_DT_INST_ID = #{secBookDtInstId}-->
+<!--    </select>-->
+
+    <select id="selectDataInfo" resultType="com.xunmei.core.resumption.vo.resumptionRecord.AppResumptionDataInfoVo">
+        SELECT p.point_num   AS rulePointNum,
+               p.point_name  AS rulePointName,
+               p.safe_type   AS safeType,
+               a.`name`      AS checkAreaName,
+               d.res_value   AS executeResult,
+               d.submit_time AS executeTime,
+               d.res_remark  AS resRemark,
+               d.res_status  AS executeStatus,
+               d.id          AS dataId,
+               p.data_type   AS dataTypeId
+        FROM core_resumption_data d
+                 INNER JOIN  core_resumption_rule_point p ON d.item_id = p.id
+                 INNER JOIN sys_area a ON a.id = p.area_id
+        WHERE d.resumption_id = #{resumptionId}
+          and p.item_id = #{ruleItemId}
+
+    </select>
+
+    <select id="selectRuleItemIdList" resultType="java.lang.Long">
+        select DISTINCT p.item_id
+        from  core_resumption_rule_point p
+        where id in (select d.item_id from core_resumption_data d where resumption_id = #{resumptionId})
+
+    </select>
+    <select id="selectRuleItemIdListByResumptionIdList" resultType="java.lang.Long">
+        select DISTINCT p.item_id
+        from  core_resumption_rule_point p
+        where id in (select d.item_id from core_resumption_data d where resumption_id IN
+        <foreach collection="resumptionIdList" item="item" open="(" separator="," close=")">
+            #{item}
+        </foreach>
+        )
+        and p.deleted = 0
+    </select>
+    <select id="selectRuleItemInfo" resultType="com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordInfoVo">
+        select i.item_num as itemNum, i.item_name as itemName, i.item_desc as itemDesc, i.id as itemId
+        from  core_resumption_rule_item i
+        where id = #{ruleItemId}
+    </select>
+
+    <select id="selectResumptionPlan" resultType="com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRoleVo">
+        select distinct p.id as id, p.plan_name as name, p.plan_status as status
+        from  core_resumption_plan p INNER JOIN core_resumption r on r.plan_id = p.id and p.plan_type = 0
+        inner join  core_resumption_plan_to_role pr on p.id = pr.plan_id
+        INNER JOIN sys_org o on o.id=r.org_id
+        where o.path like concat(#{planDto.orgPath},'%')
+        <choose>
+            <when test="planDto.type != null and planDto.type ==0">
+                and r.type in (0,6)
+            </when>
+            <otherwise>
+                and r.type = #{planDto.type}
+            </otherwise>
+        </choose>
+        <if test="planDto.roleId != null">
+            and pr.role_id = #{planDto.roleId}
+        </if>
+    </select>
+
+    <select id="selectData" resultType="com.xunmei.core.resumption.vo.registerBook.RegisterBookItemInfoVo">
+        select distinct o.name as orgName, r.start_time as date, #{id} as resumptionId
+        from core_resumption r
+                 inner join sys_org o on r.org_id = o.id
+                 inner join core_resumption_data d on r.id = d.resumption_id
+        where d.resumption_id = #{id}
+    </select>
+
+    <select id="selectResumptionDataPointId" resultType="java.lang.Long">
+        select item_id
+        from core_resumption_data
+        where resumption_id = #{id}
+    </select>
+
+    <select id="selectAbnormalData" resultType="com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordTempVo">
+        SELECT d.resumption_id as resumptionId,count(d.res_value = '1' or null) as nums,count(d.id) as nums2
+        FROM core_resumption_data d
+        INNER JOIN  core_resumption_rule_point p ON d.item_id = p.id
+        where d.resumption_id in
+        <foreach collection="resumptionIdList" item="resumptionId" open="(" separator="," close=")">
+            #{resumptionId}
+        </foreach>
+        and p.item_id in
+        <foreach collection="ruleItemIdList" item="itemId" open="(" separator="," close=")">
+            #{itemId}
+        </foreach>
+        GROUP BY d.resumption_id
+    </select>
+    <select id="selectItemIdList" resultType="java.lang.Long">
+        select d.item_id from core_resumption_data d where resumption_id = #{resumptionId}
+    </select>
+    <select id="selectRuleItemIdListNew" resultType="java.lang.Long">
+        select DISTINCT p.item_id
+        from  core_resumption_rule_point p
+        where id in
+        <foreach collection="ruleItemIdList" item="rulePointId" open="(" separator="," close=")">
+            #{rulePointId}
+        </foreach>
+    </select>
+</mapper>

+ 12 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysOrgController.java

@@ -4,6 +4,7 @@ import cn.hutool.core.util.NumberUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.xunmei.common.core.domain.R;
+import com.xunmei.common.core.vo.IdNameVo;
 import com.xunmei.common.core.web.controller.BaseController;
 import com.xunmei.common.core.web.domain.AjaxResult;
 import com.xunmei.common.core.web.page.TableDataInfo;
@@ -158,4 +159,15 @@ public class SysOrgController extends BaseController {
                 .collect(Collectors.toList());
         return list;
     }
+
+    /**
+     * 获取机构及父级机构的名称
+     *
+     * @param ids
+     * @return
+     */
+    @GetMapping("/org/getParentName")
+    public List<IdNameVo> getParentName(List<Long> ids) {
+        return sysOrgMapper.getParentName(ids);
+    }
 }

+ 11 - 5
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysRoleController.java

@@ -1,6 +1,8 @@
 package com.xunmei.system.controller;
 
+import com.xunmei.common.core.domain.IdName;
 import com.xunmei.common.core.domain.R;
+import com.xunmei.common.core.vo.IdNameVo;
 import com.xunmei.common.core.web.controller.BaseController;
 import com.xunmei.common.core.web.domain.AjaxResult;
 import com.xunmei.common.core.web.page.TableDataInfo;
@@ -9,10 +11,9 @@ import com.xunmei.common.log.enums.BusinessType;
 import com.xunmei.common.security.annotation.InnerAuth;
 import com.xunmei.common.security.annotation.RequiresPermissions;
 import com.xunmei.common.security.utils.SecurityUtils;
-import com.xunmei.system.api.domain.SysDept;
+import com.xunmei.system.api.Eto.RoleConditionEto;
 import com.xunmei.system.api.domain.SysOrg;
 import com.xunmei.system.api.domain.SysRole;
-import com.xunmei.system.api.domain.SysUser;
 import com.xunmei.system.domain.SysUserRole;
 import com.xunmei.system.domain.vo.SysUserVO;
 import com.xunmei.system.service.ISysDeptService;
@@ -43,8 +44,7 @@ public class SysRoleController extends BaseController {
 
     @RequiresPermissions("system:role:list")
     @GetMapping("/list")
-    public TableDataInfo<SysRole> list(SysRole role)
-    {
+    public TableDataInfo<SysRole> list(SysRole role) {
         return roleService.selectRoleList(role);
     }
 
@@ -204,7 +204,7 @@ public class SysRoleController extends BaseController {
      */
     @GetMapping(value = "/all")
     public AjaxResult all() {
-        return success(roleService.selectSimpleRoleAll());
+        return success(roleService.selectSimpleRoleAll(null));
     }
 
     @InnerAuth
@@ -213,4 +213,10 @@ public class SysRoleController extends BaseController {
         SysRole byId = roleService.getById(id);
         return R.ok(byId);
     }
+
+    @InnerAuth
+    @GetMapping("/role/getNames")
+    public List<IdName<Long, String>> getNames(RoleConditionEto condition) {
+        return roleService.selectSimpleRoleAll(condition);
+    }
 }

+ 4 - 3
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/mapper/SysOrgMapper.java

@@ -1,6 +1,7 @@
 package com.xunmei.system.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.xunmei.common.core.vo.IdNameVo;
 import com.xunmei.system.api.domain.SysOrg;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.web.bind.annotation.PathVariable;
@@ -68,9 +69,9 @@ public interface SysOrgMapper extends BaseMapper<SysOrg> {
     SysOrg selectSysOrgByUserId(@Param("userId") Long userId);
 
     /**
-     * 获取当前机构及上级机构
-     * @param orgId
+     * 获取机构及父级机构的名称
+     * @param ids
      * @return
      */
-    List<Long> getUpOrgs(@Param("orgId") Long orgId);
+    List<IdNameVo> getParentName(@Param("ids") List<Long> ids);
 }

+ 3 - 2
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/ISysRoleService.java

@@ -2,7 +2,9 @@ package com.xunmei.system.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.xunmei.common.core.domain.IdName;
+import com.xunmei.common.core.vo.IdNameVo;
 import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.system.api.Eto.RoleConditionEto;
 import com.xunmei.system.api.domain.SysRole;
 import com.xunmei.system.domain.SysUserRole;
 
@@ -182,6 +184,5 @@ public interface ISysRoleService extends IService<SysRole>
      */
     String getRoleName(Long userId);
 
-    List<IdName<Long,String>> selectSimpleRoleAll();
-
+    List<IdName<Long,String>> selectSimpleRoleAll(RoleConditionEto conditionEto);
 }

+ 13 - 4
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysRoleServiceImpl.java

@@ -1,5 +1,6 @@
 package com.xunmei.system.service.impl;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -7,11 +8,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.xunmei.common.core.constant.UserConstants;
 import com.xunmei.common.core.domain.IdName;
 import com.xunmei.common.core.exception.ServiceException;
-import com.xunmei.common.core.utils.SpringUtils;
 import com.xunmei.common.core.utils.StringUtils;
 import com.xunmei.common.core.web.page.TableDataInfo;
 import com.xunmei.common.datascope.annotation.DataScope;
 import com.xunmei.common.security.utils.SecurityUtils;
+import com.xunmei.system.api.Eto.RoleConditionEto;
 import com.xunmei.system.api.domain.SysRole;
 import com.xunmei.system.api.domain.SysUser;
 import com.xunmei.system.domain.*;
@@ -410,10 +411,18 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
     }
 
     @Override
-    public List<IdName<Long, String>> selectSimpleRoleAll() {
+    public List<IdName<Long, String>> selectSimpleRoleAll(RoleConditionEto conditionEto) {
         final LambdaQueryWrapper<SysRole> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(SysRole::getStatus, 0);
-        queryWrapper.eq(SysRole::getDelFlag, 0);
+        queryWrapper.eq(SysRole::getStatus, 0)
+                .eq(SysRole::getDelFlag, 0)
+                .select(SysRole::getId)
+                .select(SysRole::getRoleName);
+
+        if(ObjectUtil.isNotNull(conditionEto)){
+            if(ObjectUtil.isNotEmpty(conditionEto.getIds())){
+                queryWrapper.in(SysRole::getId,conditionEto.getIds());
+            }
+        }
         return roleMapper.selectList(queryWrapper).stream().map(role -> new IdName<>(role.getId(), role.getRoleName())).collect(Collectors.toList());
     }
 }

+ 525 - 424
soc-modules/soc-modules-system/src/main/resources/mapper/system/SysOrgMapper.xml

@@ -3,36 +3,58 @@
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.xunmei.system.mapper.SysOrgMapper">
-
     <resultMap type="com.xunmei.system.api.domain.SysOrg" id="SysOrgResult">
-                <result property="id" column="id"/>
-                <result property="address" column="address"/>
-                <result property="code" column="code"/>
-                <result property="guid" column="guid"/>
-                <result property="isLock" column="is_lock"/>
-                <result property="manager" column="manager"/>
-                <result property="managerPhone" column="manager_phone"/>
-                <result property="name" column="name"/>
-                <result property="parentId" column="parent_id"/>
-                <result property="phone" column="phone"/>
-                <result property="cityCode" column="city_code"/>
-                <result property="type" column="type"/>
-                <result property="createTime" column="create_time"/>
-                <result property="updateTime" column="update_time"/>
-                <result property="path" column="path"/>
-                <result property="parentGuid" column="parent_guid"/>
-                <result property="deleted" column="deleted"/>
-                <result property="sort" column="sort"/>
-                <result property="source" column="source"/>
-                <result property="shortName" column="short_name"/>
-                <result property="remark" column="remark"/>
-                <result property="source" column="source"/>
-                <result property="createBy" column="create_by"/>
-                <result property="updateBy" column="update_by"/>
+        <result property="id" column="id"/>
+        <result property="address" column="address"/>
+        <result property="code" column="code"/>
+        <result property="guid" column="guid"/>
+        <result property="isLock" column="is_lock"/>
+        <result property="manager" column="manager"/>
+        <result property="managerPhone" column="manager_phone"/>
+        <result property="name" column="name"/>
+        <result property="parentId" column="parent_id"/>
+        <result property="phone" column="phone"/>
+        <result property="cityCode" column="city_code"/>
+        <result property="type" column="type"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="path" column="path"/>
+        <result property="parentGuid" column="parent_guid"/>
+        <result property="deleted" column="deleted"/>
+        <result property="sort" column="sort"/>
+        <result property="source" column="source"/>
+        <result property="shortName" column="short_name"/>
+        <result property="remark" column="remark"/>
+        <result property="source" column="source"/>
+        <result property="createBy" column="create_by"/>
+        <result property="updateBy" column="update_by"/>
     </resultMap>
 
     <sql id="selectSysOrgVo">
-        select id, address, code, guid, is_lock, manager, manager_phone, name, parent_id, phone, city_code , type, create_time, update_time, parent_guid, deleted, sort,  create_by, update_by,weather_city_code,org_extend_id,source,short_name,remark
+        select id,
+               address,
+               code,
+               guid,
+               is_lock,
+               manager,
+               manager_phone,
+               name,
+               parent_id,
+               phone,
+               city_code,
+               type,
+               create_time,
+               update_time,
+               parent_guid,
+               deleted,
+               sort,
+               create_by,
+               update_by,
+               weather_city_code,
+               org_extend_id,
+               source,
+               short_name,
+               remark
         from sys_org
     </sql>
 
@@ -40,115 +62,115 @@
             resultMap="SysOrgResult">
         <include refid="selectSysOrgVo"/>
         <where>
-                        <if test="address != null  and address != ''">
-                            and address = #{address}
-                        </if>
-                        <if test="code != null  and code != ''">
-                            and code = #{code}
-                        </if>
-<!--                        <if test="deviceCount != null ">-->
-<!--                            and device_count = #{deviceCount}-->
-<!--                        </if>-->
-                        <if test="guid != null  and guid != ''">
-                            and guid = #{guid}
-                        </if>
-                        <if test="isLock != null ">
-                            and is_lock = #{isLock}
-                        </if>
-                        <if test="manager != null  and manager != ''">
-                            and manager = #{manager}
-                        </if>
-                        <if test="managerPhone != null  and managerPhone != ''">
-                            and manager_phone = #{managerPhone}
-                        </if>
-                        <if test="name != null  and name != ''">
-                            and name like concat('%', #{name}, '%')
-                        </if>
-                        <if test="parentId != null ">
-                            and parent_id = #{parentId}
-                        </if>
-                        <if test="phone != null  and phone != ''">
-                            and phone = #{phone}
-                        </if>
-                        <if test="cityCode != null  and cityCode != ''">
-                            and city_code = #{cityCode}
-                        </if>
-<!--                        <if test="openYear != null ">-->
-<!--                            and open_year = #{openYear}-->
-<!--                        </if>-->
-<!--                        <if test="fitYear != null ">-->
-<!--                            and fit_year = #{fitYear}-->
-<!--                        </if>-->
-<!--                        <if test="floorage != null  and floorage != ''">-->
-<!--                            and floorage = #{floorage}-->
-<!--                        </if>-->
-<!--                        <if test="employee != null ">-->
-<!--                            and employee = #{employee}-->
-<!--                        </if>-->
-<!--                        <if test="isOwnRight != null ">-->
-<!--                            and is_own_right = #{isOwnRight}-->
-<!--                        </if>-->
-<!--                        <if test="isRent != null ">-->
-<!--                            and is_rent = #{isRent}-->
-<!--                        </if>-->
-<!--                        <if test="isOnly != null ">-->
-<!--                            and is_only = #{isOnly}-->
-<!--                        </if>-->
-<!--                        <if test="buildYear != null ">-->
-<!--                            and build_year = #{buildYear}-->
-<!--                        </if>-->
-<!--                        <if test="placeType != null ">-->
-<!--                            and place_type = #{placeType}-->
-<!--                        </if>-->
-<!--                        <if test="buildHeight != null ">-->
-<!--                            and build_height = #{buildHeight}-->
-<!--                        </if>-->
-<!--                        <if test="social != null ">-->
-<!--                            and social = #{social}-->
-<!--                        </if>-->
-<!--                        <if test="naturalEnvir != null ">-->
-<!--                            and natural_envir = #{naturalEnvir}-->
-<!--                        </if>-->
-                        <if test="type != null ">
-                            and type = #{type}
-                        </if>
-                        <if test="updateBy != null  and updateBy != ''">
-                            and update_by like concat('%', #{updateBy}, '%')
-                        </if>
-<!--                        <if test="modifiedId != null ">-->
-<!--                            and modified_id = #{modifiedId}-->
-<!--                        </if>-->
-                        <if test="path != null  and path != ''">
-                            and path = #{path}
-                        </if>
-<!--                        <if test="vid != null ">-->
-<!--                            and vid = #{vid}-->
-<!--                        </if>-->
-<!--                        <if test="level != null ">-->
-<!--                            and level = #{level}-->
-<!--                        </if>-->
-<!--                        <if test="oid != null  and oid != ''">-->
-<!--                            and oid = #{oid}-->
-<!--                        </if>-->
-                        <if test="parentGuid != null  and parentGuid != ''">
-                            and parent_guid = #{parentGuid}
-                        </if>
-                        <if test="deleted != null ">
-                            and deleted = #{deleted}
-                        </if>
-                        <if test="sort != null ">
-                            and sort = #{sort}
-                        </if>
-<!--                        <if test="location != null ">-->
-<!--                            and location = #{location}-->
-<!--                        </if>-->
+            <if test="address != null  and address != ''">
+                and address = #{address}
+            </if>
+            <if test="code != null  and code != ''">
+                and code = #{code}
+            </if>
+            <!--                        <if test="deviceCount != null ">-->
+            <!--                            and device_count = #{deviceCount}-->
+            <!--                        </if>-->
+            <if test="guid != null  and guid != ''">
+                and guid = #{guid}
+            </if>
+            <if test="isLock != null ">
+                and is_lock = #{isLock}
+            </if>
+            <if test="manager != null  and manager != ''">
+                and manager = #{manager}
+            </if>
+            <if test="managerPhone != null  and managerPhone != ''">
+                and manager_phone = #{managerPhone}
+            </if>
+            <if test="name != null  and name != ''">
+                and name like concat('%', #{name}, '%')
+            </if>
+            <if test="parentId != null ">
+                and parent_id = #{parentId}
+            </if>
+            <if test="phone != null  and phone != ''">
+                and phone = #{phone}
+            </if>
+            <if test="cityCode != null  and cityCode != ''">
+                and city_code = #{cityCode}
+            </if>
+            <!--                        <if test="openYear != null ">-->
+            <!--                            and open_year = #{openYear}-->
+            <!--                        </if>-->
+            <!--                        <if test="fitYear != null ">-->
+            <!--                            and fit_year = #{fitYear}-->
+            <!--                        </if>-->
+            <!--                        <if test="floorage != null  and floorage != ''">-->
+            <!--                            and floorage = #{floorage}-->
+            <!--                        </if>-->
+            <!--                        <if test="employee != null ">-->
+            <!--                            and employee = #{employee}-->
+            <!--                        </if>-->
+            <!--                        <if test="isOwnRight != null ">-->
+            <!--                            and is_own_right = #{isOwnRight}-->
+            <!--                        </if>-->
+            <!--                        <if test="isRent != null ">-->
+            <!--                            and is_rent = #{isRent}-->
+            <!--                        </if>-->
+            <!--                        <if test="isOnly != null ">-->
+            <!--                            and is_only = #{isOnly}-->
+            <!--                        </if>-->
+            <!--                        <if test="buildYear != null ">-->
+            <!--                            and build_year = #{buildYear}-->
+            <!--                        </if>-->
+            <!--                        <if test="placeType != null ">-->
+            <!--                            and place_type = #{placeType}-->
+            <!--                        </if>-->
+            <!--                        <if test="buildHeight != null ">-->
+            <!--                            and build_height = #{buildHeight}-->
+            <!--                        </if>-->
+            <!--                        <if test="social != null ">-->
+            <!--                            and social = #{social}-->
+            <!--                        </if>-->
+            <!--                        <if test="naturalEnvir != null ">-->
+            <!--                            and natural_envir = #{naturalEnvir}-->
+            <!--                        </if>-->
+            <if test="type != null ">
+                and type = #{type}
+            </if>
+            <if test="updateBy != null  and updateBy != ''">
+                and update_by like concat('%', #{updateBy}, '%')
+            </if>
+            <!--                        <if test="modifiedId != null ">-->
+            <!--                            and modified_id = #{modifiedId}-->
+            <!--                        </if>-->
+            <if test="path != null  and path != ''">
+                and path = #{path}
+            </if>
+            <!--                        <if test="vid != null ">-->
+            <!--                            and vid = #{vid}-->
+            <!--                        </if>-->
+            <!--                        <if test="level != null ">-->
+            <!--                            and level = #{level}-->
+            <!--                        </if>-->
+            <!--                        <if test="oid != null  and oid != ''">-->
+            <!--                            and oid = #{oid}-->
+            <!--                        </if>-->
+            <if test="parentGuid != null  and parentGuid != ''">
+                and parent_guid = #{parentGuid}
+            </if>
+            <if test="deleted != null ">
+                and deleted = #{deleted}
+            </if>
+            <if test="sort != null ">
+                and sort = #{sort}
+            </if>
+            <!--                        <if test="location != null ">-->
+            <!--                            and location = #{location}-->
+            <!--                        </if>-->
         </where>
     </select>
 
     <select id="selectSysOrgById" parameterType="Long"
             resultMap="SysOrgResult">
-            <include refid="selectSysOrgVo"/>
-            where id = #{id}
+        <include refid="selectSysOrgVo"/>
+        where id = #{id}
     </select>
     <select id="selectCheckSubOrgIdList" resultType="java.lang.Long">
         select id
@@ -157,307 +179,381 @@
           and deleted = 0
     </select>
     <select id="findListByOrgType" resultType="java.lang.Long">
-        select a.id from sys_org a where a.type = #{execOrgType} and a.deleted=0 and a.is_lock=0
-
+        select a.id
+        from sys_org a
+        where a.type = #{execOrgType}
+          and a.deleted = 0
+          and a.is_lock = 0
     </select>
-    <insert id="insertSysOrg" parameterType="com.xunmei.system.api.domain.SysOrg"            useGeneratedKeys="true" keyProperty="id">
+    <insert id="insertSysOrg" parameterType="com.xunmei.system.api.domain.SysOrg" useGeneratedKeys="true"
+            keyProperty="id">
         insert into sys_org
         <trim prefix="(" suffix=")" suffixOverrides=",">
-                    <if test="address != null">address,
-                    </if>
-                    <if test="code != null">code,
-                    </if>
-<!--                    <if test="deviceCount != null">device_count,-->
-<!--                    </if>-->
-                    <if test="guid != null">guid,
-                    </if>
-                    <if test="isLock != null">is_lock,
-                    </if>
-                    <if test="manager != null">manager,
-                    </if>
-                    <if test="managerPhone != null">manager_phone,
-                    </if>
-                    <if test="name != null">name,
-                    </if>
-                    <if test="shortName != null">short_name,
-                    </if>
-                    <if test="parentId != null">parent_id,
-                    </if>
-                    <if test="phone != null">phone,
-                    </if>
-                    <if test="cityCode != null">city_code,
-                    </if>
-<!--                    <if test="openYear != null">open_year,-->
-<!--                    </if>-->
-<!--                    <if test="fitYear != null">fit_year,-->
-<!--                    </if>-->
-<!--                    <if test="floorage != null">floorage,-->
-<!--                    </if>-->
-<!--                    <if test="employee != null">employee,-->
-<!--                    </if>-->
-<!--                    <if test="isOwnRight != null">is_own_right,-->
-<!--                    </if>-->
-<!--                    <if test="isRent != null">is_rent,-->
-<!--                    </if>-->
-<!--                    <if test="isOnly != null">is_only,-->
-<!--                    </if>-->
-<!--                    <if test="buildYear != null">build_year,-->
-<!--                    </if>-->
-<!--                    <if test="placeType != null">place_type,-->
-<!--                    </if>-->
-<!--                    <if test="buildHeight != null">build_height,-->
-<!--                    </if>-->
-<!--                    <if test="social != null">social,-->
-<!--                    </if>-->
-<!--                    <if test="naturalEnvir != null">natural_envir,-->
-<!--                    </if>-->
-                    <if test="type != null">type,
-                    </if>
-                    <if test="createTime != null">create_time,
-                    </if>
-                    <if test="updateBy != null">update_by,
-                    </if>
-                    <if test="updateTime != null">update_time,
-                    </if>
-<!--                    <if test="modifiedId != null">modified_id,-->
-<!--                    </if>-->
-                    <if test="path != null">path,
-                    </if>
-<!--                    <if test="vid != null">vid,-->
-<!--                    </if>-->
-<!--                    <if test="level != null">level,-->
-<!--                    </if>-->
-                    <if test="oid != null">oid,
-                    </if>
-                    <if test="parentGuid != null">parent_guid,
-                    </if>
-                    <if test="deleted != null">deleted,
-                    </if>
-                    <if test="sort != null">sort,
-                    </if>
-                    <if test="source != null">source,
-                    </if>
-                    <if test="remark != null">remark,
-                    </if>
-<!--                    <if test="location != null">location,-->
-<!--                    </if>-->
-                    <if test="createBy != null">create_by,
-                    </if>
-                    <if test="updateBy != null">update_by,
-                    </if>
+            <if test="address != null">
+                address,
+            </if>
+            <if test="code != null">
+                code,
+            </if>
+            <!--                    <if test="deviceCount != null">device_count,-->
+            <!--                    </if>-->
+            <if test="guid != null">
+                guid,
+            </if>
+            <if test="isLock != null">
+                is_lock,
+            </if>
+            <if test="manager != null">
+                manager,
+            </if>
+            <if test="managerPhone != null">
+                manager_phone,
+            </if>
+            <if test="name != null">
+                name,
+            </if>
+            <if test="shortName != null">
+                short_name,
+            </if>
+            <if test="parentId != null">
+                parent_id,
+            </if>
+            <if test="phone != null">
+                phone,
+            </if>
+            <if test="cityCode != null">
+                city_code,
+            </if>
+            <!--                    <if test="openYear != null">open_year,-->
+            <!--                    </if>-->
+            <!--                    <if test="fitYear != null">fit_year,-->
+            <!--                    </if>-->
+            <!--                    <if test="floorage != null">floorage,-->
+            <!--                    </if>-->
+            <!--                    <if test="employee != null">employee,-->
+            <!--                    </if>-->
+            <!--                    <if test="isOwnRight != null">is_own_right,-->
+            <!--                    </if>-->
+            <!--                    <if test="isRent != null">is_rent,-->
+            <!--                    </if>-->
+            <!--                    <if test="isOnly != null">is_only,-->
+            <!--                    </if>-->
+            <!--                    <if test="buildYear != null">build_year,-->
+            <!--                    </if>-->
+            <!--                    <if test="placeType != null">place_type,-->
+            <!--                    </if>-->
+            <!--                    <if test="buildHeight != null">build_height,-->
+            <!--                    </if>-->
+            <!--                    <if test="social != null">social,-->
+            <!--                    </if>-->
+            <!--                    <if test="naturalEnvir != null">natural_envir,-->
+            <!--                    </if>-->
+            <if test="type != null">
+                type,
+            </if>
+            <if test="createTime != null">
+                create_time,
+            </if>
+            <if test="updateBy != null">
+                update_by,
+            </if>
+            <if test="updateTime != null">
+                update_time,
+            </if>
+            <!--                    <if test="modifiedId != null">modified_id,-->
+            <!--                    </if>-->
+            <if test="path != null">
+                path,
+            </if>
+            <!--                    <if test="vid != null">vid,-->
+            <!--                    </if>-->
+            <!--                    <if test="level != null">level,-->
+            <!--                    </if>-->
+            <if test="oid != null">
+                oid,
+            </if>
+            <if test="parentGuid != null">
+                parent_guid,
+            </if>
+            <if test="deleted != null">
+                deleted,
+            </if>
+            <if test="sort != null">
+                sort,
+            </if>
+            <if test="source != null">
+                source,
+            </if>
+            <if test="remark != null">
+                remark,
+            </if>
+            <!--                    <if test="location != null">location,-->
+            <!--                    </if>-->
+            <if test="createBy != null">
+                create_by,
+            </if>
+            <if test="updateBy != null">
+                update_by,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-                    <if test="address != null">#{address},
-                    </if>
-                    <if test="code != null">#{code},
-                    </if>
-<!--                    <if test="deviceCount != null">#{deviceCount},-->
-<!--                    </if>-->
-                    <if test="guid != null">#{guid},
-                    </if>
-                    <if test="isLock != null">#{isLock},
-                    </if>
-                    <if test="manager != null">#{manager},
-                    </if>
-                    <if test="managerPhone != null">#{managerPhone},
-                    </if>
-                    <if test="name != null">#{name},
-                    </if>
-                    <if test="shortName != null">#{shortName},
-                    </if>
-                    <if test="parentId != null">#{parentId},
-                    </if>
-                    <if test="phone != null">#{phone},
-                    </if>
-                    <if test="cityCode != null">#{cityCode},
-                    </if>
-<!--                    <if test="openYear != null">#{openYear},-->
-<!--                    </if>-->
-<!--                    <if test="fitYear != null">#{fitYear},-->
-<!--                    </if>-->
-<!--                    <if test="floorage != null">#{floorage},-->
-<!--                    </if>-->
-<!--                    <if test="employee != null">#{employee},-->
-<!--                    </if>-->
-<!--                    <if test="isOwnRight != null">#{isOwnRight},-->
-<!--                    </if>-->
-<!--                    <if test="isRent != null">#{isRent},-->
-<!--                    </if>-->
-<!--                    <if test="isOnly != null">#{isOnly},-->
-<!--                    </if>-->
-<!--                    <if test="buildYear != null">#{buildYear},-->
-<!--                    </if>-->
-<!--                    <if test="placeType != null">#{placeType},-->
-<!--                    </if>-->
-<!--                    <if test="buildHeight != null">#{buildHeight},-->
-<!--                    </if>-->
-<!--                    <if test="social != null">#{social},-->
-<!--                    </if>-->
-<!--                    <if test="naturalEnvir != null">#{naturalEnvir},-->
-<!--                    </if>-->
-                    <if test="type != null">#{type},
-                    </if>
-                    <if test="createTime != null">#{createTime},
-                    </if>
-                    <if test="updateBy != null">#{updateBy},
-                    </if>
-                    <if test="updateTime != null">#{updateTime},
-                    </if>
-<!--                    <if test="modifiedId != null">#{modifiedId},-->
-<!--                    </if>-->
-                    <if test="path != null">#{path},
-                    </if>
-<!--                    <if test="vid != null">#{vid},-->
-<!--                    </if>-->
-<!--                    <if test="level != null">#{level},-->
-<!--                    </if>-->
-<!--                    <if test="oid != null">#{oid},-->
-<!--                    </if>-->
-                    <if test="parentGuid != null">#{parentGuid},
-                    </if>
-                    <if test="deleted != null">#{deleted},
-                    </if>
-                    <if test="sort != null">#{sort},
-                    </if>
-                    <if test="source != null">#{source},
-                    </if>
-                    <if test="remark != null">#{remark},
-                    </if>
-<!--                    <if test="location != null">#{location},-->
-<!--                    </if>-->
-                    <if test="createBy != null">#{createBy},
-                    </if>
-                    <if test="updateBy != null">#{updateBy},
-                    </if>
+            <if test="address != null">
+                #{address},
+            </if>
+            <if test="code != null">
+                #{code},
+            </if>
+            <!--                    <if test="deviceCount != null">#{deviceCount},-->
+            <!--                    </if>-->
+            <if test="guid != null">
+                #{guid},
+            </if>
+            <if test="isLock != null">
+                #{isLock},
+            </if>
+            <if test="manager != null">
+                #{manager},
+            </if>
+            <if test="managerPhone != null">
+                #{managerPhone},
+            </if>
+            <if test="name != null">
+                #{name},
+            </if>
+            <if test="shortName != null">
+                #{shortName},
+            </if>
+            <if test="parentId != null">
+                #{parentId},
+            </if>
+            <if test="phone != null">
+                #{phone},
+            </if>
+            <if test="cityCode != null">
+                #{cityCode},
+            </if>
+            <!--                    <if test="openYear != null">#{openYear},-->
+            <!--                    </if>-->
+            <!--                    <if test="fitYear != null">#{fitYear},-->
+            <!--                    </if>-->
+            <!--                    <if test="floorage != null">#{floorage},-->
+            <!--                    </if>-->
+            <!--                    <if test="employee != null">#{employee},-->
+            <!--                    </if>-->
+            <!--                    <if test="isOwnRight != null">#{isOwnRight},-->
+            <!--                    </if>-->
+            <!--                    <if test="isRent != null">#{isRent},-->
+            <!--                    </if>-->
+            <!--                    <if test="isOnly != null">#{isOnly},-->
+            <!--                    </if>-->
+            <!--                    <if test="buildYear != null">#{buildYear},-->
+            <!--                    </if>-->
+            <!--                    <if test="placeType != null">#{placeType},-->
+            <!--                    </if>-->
+            <!--                    <if test="buildHeight != null">#{buildHeight},-->
+            <!--                    </if>-->
+            <!--                    <if test="social != null">#{social},-->
+            <!--                    </if>-->
+            <!--                    <if test="naturalEnvir != null">#{naturalEnvir},-->
+            <!--                    </if>-->
+            <if test="type != null">
+                #{type},
+            </if>
+            <if test="createTime != null">
+                #{createTime},
+            </if>
+            <if test="updateBy != null">
+                #{updateBy},
+            </if>
+            <if test="updateTime != null">
+                #{updateTime},
+            </if>
+            <!--                    <if test="modifiedId != null">#{modifiedId},-->
+            <!--                    </if>-->
+            <if test="path != null">
+                #{path},
+            </if>
+            <!--                    <if test="vid != null">#{vid},-->
+            <!--                    </if>-->
+            <!--                    <if test="level != null">#{level},-->
+            <!--                    </if>-->
+            <!--                    <if test="oid != null">#{oid},-->
+            <!--                    </if>-->
+            <if test="parentGuid != null">
+                #{parentGuid},
+            </if>
+            <if test="deleted != null">
+                #{deleted},
+            </if>
+            <if test="sort != null">
+                #{sort},
+            </if>
+            <if test="source != null">
+                #{source},
+            </if>
+            <if test="remark != null">
+                #{remark},
+            </if>
+            <!--                    <if test="location != null">#{location},-->
+            <!--                    </if>-->
+            <if test="createBy != null">
+                #{createBy},
+            </if>
+            <if test="updateBy != null">
+                #{updateBy},
+            </if>
         </trim>
     </insert>
 
     <update id="updateSysOrg" parameterType="com.xunmei.system.api.domain.SysOrg">
         update sys_org
         <trim prefix="SET" suffixOverrides=",">
-                    <if test="address != null">address =
-                        #{address},
-                    </if>
-                    <if test="code != null">code =
-                        #{code},
-                    </if>
-<!--                    <if test="deviceCount != null">device_count =-->
-<!--                        #{deviceCount},-->
-<!--                    </if>-->
-                    <if test="guid != null">guid =
-                        #{guid},
-                    </if>
-                    <if test="isLock != null">is_lock =
-                        #{isLock},
-                    </if>
-                    <if test="manager != null">manager =
-                        #{manager},
-                    </if>
-                    <if test="managerPhone != null">manager_phone =
-                        #{managerPhone},
-                    </if>
-                    <if test="name != null">name =
-                        #{name},
-                    </if>
-                    <if test="shortName != null">short_name =
-                        #{shortName},
-                    </if>
-                    <if test="parentId != null">parent_id =
-                        #{parentId},
-                    </if>
-                    <if test="phone != null">phone =
-                        #{phone},
-                    </if>
-                    <if test="cityCode != null">city_code =
-                        #{cityCode},
-                    </if>
-<!--                    <if test="openYear != null">open_year =-->
-<!--                        #{openYear},-->
-<!--                    </if>-->
-<!--                    <if test="fitYear != null">fit_year =-->
-<!--                        #{fitYear},-->
-<!--                    </if>-->
-<!--                    <if test="floorage != null">floorage =-->
-<!--                        #{floorage},-->
-<!--                    </if>-->
-<!--                    <if test="employee != null">employee =-->
-<!--                        #{employee},-->
-<!--                    </if>-->
-<!--                    <if test="isOwnRight != null">is_own_right =-->
-<!--                        #{isOwnRight},-->
-<!--                    </if>-->
-<!--                    <if test="isRent != null">is_rent =-->
-<!--                        #{isRent},-->
-<!--                    </if>-->
-<!--                    <if test="isOnly != null">is_only =-->
-<!--                        #{isOnly},-->
-<!--                    </if>-->
-<!--                    <if test="buildYear != null">build_year =-->
-<!--                        #{buildYear},-->
-<!--                    </if>-->
-<!--                    <if test="placeType != null">place_type =-->
-<!--                        #{placeType},-->
-<!--                    </if>-->
-<!--                    <if test="buildHeight != null">build_height =-->
-<!--                        #{buildHeight},-->
-<!--                    </if>-->
-<!--                    <if test="social != null">social =-->
-<!--                        #{social},-->
-<!--                    </if>-->
-<!--                    <if test="naturalEnvir != null">natural_envir =-->
-<!--                        #{naturalEnvir},-->
-<!--                    </if>-->
-                    <if test="type != null">type =
-                        #{type},
-                    </if>
-                    <if test="createTime != null">create_time =
-                        #{createTime},
-                    </if>
-                    <if test="updateBy != null">update_by =
-                        #{updateBy},
-                    </if>
-                    <if test="updateTime != null">update_time =
-                        #{updateTime},
-                    </if>
-<!--                    <if test="modifiedId != null">modified_id =-->
-<!--                        #{modifiedId},-->
-<!--                    </if>-->
-                    <if test="path != null">path =
-                        #{path},
-                    </if>
-<!--                    <if test="vid != null">vid =-->
-<!--                        #{vid},-->
-<!--                    </if>-->
-<!--                    <if test="level != null">level =-->
-<!--                        #{level},-->
-<!--                    </if>-->
-<!--                    <if test="oid != null">oid =-->
-<!--                        #{oid},-->
-<!--                    </if>-->
-                    <if test="parentGuid != null">parent_guid =
-                        #{parentGuid},
-                    </if>
-                    <if test="deleted != null">deleted =
-                        #{deleted},
-                    </if>
-                    <if test="sort != null">sort =
-                        #{sort},
-                    </if>
-                    <if test="source != null">source =
-                        #{source},
-                    </if>
-                    <if test="remark != null">remark =
-                        #{remark},
-                    </if>
-<!--                    <if test="location != null">location =-->
-<!--                        #{location},-->
-<!--                    </if>-->
-                    <if test="createBy != null">create_by =
-                        #{createBy},
-                    </if>
-                    <if test="updateBy != null">update_by =
-                        #{updateBy},
-                    </if>
+            <if test="address != null">
+                address =
+                #{address},
+            </if>
+            <if test="code != null">
+                code =
+                #{code},
+            </if>
+            <!--                    <if test="deviceCount != null">device_count =-->
+            <!--                        #{deviceCount},-->
+            <!--                    </if>-->
+            <if test="guid != null">
+                guid =
+                #{guid},
+            </if>
+            <if test="isLock != null">
+                is_lock =
+                #{isLock},
+            </if>
+            <if test="manager != null">
+                manager =
+                #{manager},
+            </if>
+            <if test="managerPhone != null">
+                manager_phone =
+                #{managerPhone},
+            </if>
+            <if test="name != null">
+                name =
+                #{name},
+            </if>
+            <if test="shortName != null">
+                short_name =
+                #{shortName},
+            </if>
+            <if test="parentId != null">
+                parent_id =
+                #{parentId},
+            </if>
+            <if test="phone != null">
+                phone =
+                #{phone},
+            </if>
+            <if test="cityCode != null">
+                city_code =
+                #{cityCode},
+            </if>
+            <!--                    <if test="openYear != null">open_year =-->
+            <!--                        #{openYear},-->
+            <!--                    </if>-->
+            <!--                    <if test="fitYear != null">fit_year =-->
+            <!--                        #{fitYear},-->
+            <!--                    </if>-->
+            <!--                    <if test="floorage != null">floorage =-->
+            <!--                        #{floorage},-->
+            <!--                    </if>-->
+            <!--                    <if test="employee != null">employee =-->
+            <!--                        #{employee},-->
+            <!--                    </if>-->
+            <!--                    <if test="isOwnRight != null">is_own_right =-->
+            <!--                        #{isOwnRight},-->
+            <!--                    </if>-->
+            <!--                    <if test="isRent != null">is_rent =-->
+            <!--                        #{isRent},-->
+            <!--                    </if>-->
+            <!--                    <if test="isOnly != null">is_only =-->
+            <!--                        #{isOnly},-->
+            <!--                    </if>-->
+            <!--                    <if test="buildYear != null">build_year =-->
+            <!--                        #{buildYear},-->
+            <!--                    </if>-->
+            <!--                    <if test="placeType != null">place_type =-->
+            <!--                        #{placeType},-->
+            <!--                    </if>-->
+            <!--                    <if test="buildHeight != null">build_height =-->
+            <!--                        #{buildHeight},-->
+            <!--                    </if>-->
+            <!--                    <if test="social != null">social =-->
+            <!--                        #{social},-->
+            <!--                    </if>-->
+            <!--                    <if test="naturalEnvir != null">natural_envir =-->
+            <!--                        #{naturalEnvir},-->
+            <!--                    </if>-->
+            <if test="type != null">
+                type =
+                #{type},
+            </if>
+            <if test="createTime != null">
+                create_time =
+                #{createTime},
+            </if>
+            <if test="updateBy != null">
+                update_by =
+                #{updateBy},
+            </if>
+            <if test="updateTime != null">
+                update_time =
+                #{updateTime},
+            </if>
+            <!--                    <if test="modifiedId != null">modified_id =-->
+            <!--                        #{modifiedId},-->
+            <!--                    </if>-->
+            <if test="path != null">
+                path =
+                #{path},
+            </if>
+            <!--                    <if test="vid != null">vid =-->
+            <!--                        #{vid},-->
+            <!--                    </if>-->
+            <!--                    <if test="level != null">level =-->
+            <!--                        #{level},-->
+            <!--                    </if>-->
+            <!--                    <if test="oid != null">oid =-->
+            <!--                        #{oid},-->
+            <!--                    </if>-->
+            <if test="parentGuid != null">
+                parent_guid =
+                #{parentGuid},
+            </if>
+            <if test="deleted != null">
+                deleted =
+                #{deleted},
+            </if>
+            <if test="sort != null">
+                sort =
+                #{sort},
+            </if>
+            <if test="source != null">
+                source =
+                #{source},
+            </if>
+            <if test="remark != null">
+                remark =
+                #{remark},
+            </if>
+            <!--                    <if test="location != null">location =-->
+            <!--                        #{location},-->
+            <!--                    </if>-->
+            <if test="createBy != null">
+                create_by =
+                #{createBy},
+            </if>
+            <if test="updateBy != null">
+                update_by =
+                #{updateBy},
+            </if>
         </trim>
         where id = #{id}
     </update>
@@ -481,9 +577,14 @@
                  inner join sys_user suo on so.id = suo.org_id
         where suo.id = #{userId}
     </select>
-    <select id="getUpOrgs" resultType="Long">
-        select so.id
-        from sys_org so where  id in (split((select path from sys_org where id=#{orgId} and deleted=0))) and deleted=0
+    <select id="getParentName" resultType="com.xunmei.common.core.vo.IdNameVo">
+        select so.id,so.name,p.name as extra
+        from sys_org so
+        left join sys_org p on so.parent_id=p.id
+        where id in
+        <foreach collection="ids" item="id" separator="," open="(" close=")">
+            #{id}
+        </foreach>
+        and so.deleted=0 and p.deleted=0
     </select>
-
 </mapper>