luowei há 2 anos atrás
pai
commit
39a69c68f5
21 ficheiros alterados com 1224 adições e 41 exclusões
  1. 6 2
      project_data/sql/0.0.2/soc/soc.sql
  2. 92 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/controller/CoreEvaluatePlanController.java
  3. 33 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/domain/CoreEvaluateContent.java
  4. 122 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/domain/CoreEvaluatePlan.java
  5. 27 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/domain/CoreEvaluatePlanContent.java
  6. 28 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/domain/CoreEvaluateRole.java
  7. 39 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/dto/CoreEvaluatePlanDTO.java
  8. 31 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/dto/EvaluateQueryDTO.java
  9. 17 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/mapper/CoreEvaluateContentMapper.java
  10. 22 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/mapper/CoreEvaluatePlanContentMapper.java
  11. 75 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/mapper/CoreEvaluatePlanMapper.java
  12. 26 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/mapper/CoreEvaluateRoleMapper.java
  13. 78 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/service/ICoreEvaluatePlanService.java
  14. 266 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/service/impl/CoreEvaluatePlanServiceImpl.java
  15. 55 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/vo/CoreEvaluatePlanListVO.java
  16. 38 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/vo/CoreEvaluatePlanVO.java
  17. 24 0
      soc-modules/soc-modules-core/src/main/resources/mapper/evaluate/CoreEvaluateContentMapper.xml
  18. 21 0
      soc-modules/soc-modules-core/src/main/resources/mapper/evaluate/CoreEvaluatePlanContentMapper.xml
  19. 200 0
      soc-modules/soc-modules-core/src/main/resources/mapper/evaluate/CoreEvaluatePlanMapper.xml
  20. 24 0
      soc-modules/soc-modules-core/src/main/resources/mapper/evaluate/CoreEvaluateRoleMapper.xml
  21. 0 39
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysDeviceServiceImpl.java

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

@@ -7,7 +7,10 @@ DROP TABLE
 CREATE TABLE `core_evaluate_plan` (
                                       `id` BIGINT NOT NULL,
                                       `org_id` BIGINT DEFAULT NULL COMMENT '机构id',
-                                      `u_id` VARCHAR ( 255 ) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '前端需要的',
+                                      `status` VARCHAR ( 2 ) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '状态',
+                                      `org_path` VARCHAR ( 255 ) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '机构路径',
+                                      `is_distribute` VARCHAR ( 2 ) CHARACTER
+                                          SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 0 COMMENT '是否下发0未1已',
                                       `org_name` VARCHAR ( 255 ) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '机构名称',
                                       `org_type` VARCHAR ( 2 ) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '机构类型',
                                       `evaluate_name` VARCHAR ( 255 ) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '外包评价名称',
@@ -15,7 +18,7 @@ CREATE TABLE `core_evaluate_plan` (
                                       `create_time` DATETIME NULL DEFAULT NULL COMMENT '创建时间',
                                       `update_time` DATETIME NULL DEFAULT NULL COMMENT '修改时间',
                                       `is_deleted` VARCHAR ( 1 ) CHARACTER
-                                          SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '\0' COMMENT '是否删除',
+                                          SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 0 COMMENT '是否删除',
                                       `create_by` VARCHAR ( 255 ) CHARACTER
                                           SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
                                       `update_by` VARCHAR ( 32 ) CHARACTER
@@ -38,6 +41,7 @@ DROP TABLE
     EXISTS `core_evaluate_content`;
 CREATE TABLE `core_evaluate_content` (
                                          `id` BIGINT NOT NULL,
+                                         `u_id` VARCHAR ( 255 ) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '前端需要的',
                                          `code` BIGINT DEFAULT NULL COMMENT '编号',
                                          `content_type` VARCHAR ( 2 ) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '评价类型',
                                          `content` VARCHAR ( 1000 ) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '内容',

+ 92 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/controller/CoreEvaluatePlanController.java

@@ -0,0 +1,92 @@
+package com.xunmei.core.evaluate.controller;
+
+
+import com.xunmei.common.core.web.controller.BaseController;
+import com.xunmei.common.core.web.domain.AjaxResult;
+import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.common.log.annotation.Log;
+import com.xunmei.common.log.enums.BusinessType;
+import com.xunmei.common.security.annotation.RequiresPermissions;
+import com.xunmei.core.evaluate.domain.CoreEvaluatePlan;
+import com.xunmei.core.evaluate.dto.CoreEvaluatePlanDTO;
+import com.xunmei.core.evaluate.dto.EvaluateQueryDTO;
+import com.xunmei.core.evaluate.service.ICoreEvaluatePlanService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 外包评价计划Controller
+ *
+ * @author xunmei
+ * @date 2023-10-10
+ */
+@Api(tags = {"CoreEvaluatePlan" })
+@RestController
+@RequestMapping("/evaluatePlan")
+public class CoreEvaluatePlanController extends BaseController {
+    @Autowired
+    private ICoreEvaluatePlanService coreEvaluatePlanService;
+
+/**
+ * 查询外包评价计划列表
+ */
+@ApiOperation(value = "查询CoreEvaluatePlan列表")
+@RequiresPermissions("core:evaluatePlan:list")
+@GetMapping("/list")
+    public TableDataInfo list(EvaluateQueryDTO coreEvaluatePlan) {
+        return coreEvaluatePlanService. selectPage(coreEvaluatePlan);
+    }
+
+
+
+    /**
+     * 获取外包评价计划详细信息
+     */
+    @ApiOperation(value = "获取CoreEvaluatePlan详细信息")
+    @RequiresPermissions("core:evaluatePlan:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(coreEvaluatePlanService.selectCoreEvaluatePlanById(id));
+    }
+    @ApiOperation(value = "修改状态")
+    @RequiresPermissions("core:evaluatePlan:edit")
+    @PostMapping(value = "/updateStatus")
+    public AjaxResult updateStatus(@RequestBody CoreEvaluatePlan coreEvaluatePlan) {
+        return success(coreEvaluatePlanService.updateStatus(coreEvaluatePlan));
+    }
+    /**
+     * 新增外包评价计划
+     */
+    @ApiOperation(value = "新增CoreEvaluatePlan")
+    @RequiresPermissions("core:evaluatePlan:add")
+    @Log(title = "外包评价计划" , businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CoreEvaluatePlanDTO coreEvaluatePlan) {
+        return toAjax(coreEvaluatePlanService.insertCoreEvaluatePlan(coreEvaluatePlan));
+    }
+
+    /**
+     * 修改外包评价计划
+     */
+    @ApiOperation(value = "修改CoreEvaluatePlan")
+    @RequiresPermissions("core:evaluatePlan:edit")
+    @Log(title = "外包评价计划" , businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody CoreEvaluatePlanDTO coreEvaluatePlan) {
+        return toAjax(coreEvaluatePlanService.updateCoreEvaluatePlan(coreEvaluatePlan));
+    }
+
+
+    /**
+     * 删除外包评价计划
+     */
+    @ApiOperation(value = "删除CoreEvaluatePlan")
+    @RequiresPermissions("core:evaluatePlan:remove")
+    @Log(title = "外包评价计划" , businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(coreEvaluatePlanService.deleteCoreEvaluatePlanByIds(ids));
+    }
+}

+ 33 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/domain/CoreEvaluateContent.java

@@ -0,0 +1,33 @@
+package com.xunmei.core.evaluate.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.xunmei.common.core.web.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @author :LuoWei
+ * @date : 2023/10/10
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("core_evaluate_content")
+@ApiModel(value = "CoreEvaluateContent对象" , description = "外包评价内容")
+public class CoreEvaluateContent extends BaseEntity {
+    private static final long serialVersionUID=1L;
+
+    @ApiModelProperty(value = "id")
+    private Long id;
+    @ApiModelProperty(value = "前端id")
+    private String uId;
+    @ApiModelProperty(value = "编号")
+    private Long code;
+    @ApiModelProperty(value = "内容类型")
+    private String contentType;
+    @ApiModelProperty(value = "内容")
+    private String content;
+}

+ 122 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/domain/CoreEvaluatePlan.java

@@ -0,0 +1,122 @@
+package com.xunmei.core.evaluate.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import com.xunmei.common.core.web.domain.BaseEntity;
+
+/**
+ * 外包评价计划对象 core_evaluate_plan
+ *
+ * @author xunmei
+ * @date 2023-10-10
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("core_evaluate_plan")
+@ApiModel(value = "CoreEvaluatePlan对象", description = "外包评价计划")
+public class CoreEvaluatePlan extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * $column.columnComment
+     */
+    private Long id;
+
+    /**
+     * 机构id
+     */
+    @ApiModelProperty(value = "机构id")
+    private Long orgId;
+    /**
+     * 调阅机构
+     */
+    private String orgPath;
+    /**
+     * 状态
+     */
+    @ApiModelProperty(value = "状态")
+    private String status;
+    /**
+     * 是否下发
+     */
+    @ApiModelProperty(value = "是否下发")
+    private String isDistribute;
+    /**
+     * 机构名称
+     */
+    @ApiModelProperty(value = "机构名称")
+    private String orgName;
+
+    /**
+     * 机构类型
+     */
+    @ApiModelProperty(value = "机构类型")
+    private String orgType;
+
+    /**
+     * 外包评价名称
+     */
+    @ApiModelProperty(value = "外包评价名称")
+    private String evaluateName;
+
+    /**
+     * 周期
+     */
+    @ApiModelProperty(value = "周期")
+    private String evaluateCycle;
+
+    /**
+     * 是否删除
+     */
+    @ApiModelProperty(value = "是否删除")
+    private String isDeleted;
+
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+
+
+                .append("id", getId())
+
+                .append("orgPath", getOrgPath())
+                .append("orgId", getOrgId())
+
+                .append("status", getStatus())
+                .append("orgName", getOrgName())
+
+
+                .append("orgType", getOrgType())
+
+
+                .append("evaluateName", getEvaluateName())
+
+
+                .append("evaluateCycle", getEvaluateCycle())
+
+
+                .append("createTime", getCreateTime())
+
+
+                .append("updateTime", getUpdateTime())
+
+
+                .append("isDeleted", getIsDeleted())
+
+
+                .append("createBy", getCreateBy())
+
+
+                .append("updateBy", getUpdateBy())
+                .toString();
+    }
+}

+ 27 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/domain/CoreEvaluatePlanContent.java

@@ -0,0 +1,27 @@
+package com.xunmei.core.evaluate.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @author :LuoWei
+ * @date : 2023/10/10
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("core_evaluate_plan_content")
+@ApiModel(value = "CoreEvaluatePlanContent对象", description = "外包评价计划和内容绑定")
+public class CoreEvaluatePlanContent {
+    private static final long serialVersionUID = 1L;
+    @ApiModelProperty(value = "id")
+    private Long id;
+    @ApiModelProperty(value = "评价计划Id")
+    private Long evaluateId;
+    @ApiModelProperty(value = "内容Id")
+    private Long contentId;
+}

+ 28 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/domain/CoreEvaluateRole.java

@@ -0,0 +1,28 @@
+package com.xunmei.core.evaluate.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.xunmei.common.core.web.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @author :LuoWei
+ * @date : 2023/10/10
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("core_evaluate_role")
+@ApiModel(value = "CoreEvaluateRole对象" , description = "外包评价计划和角色绑定")
+public class CoreEvaluateRole {
+    private static final long serialVersionUID=1L;
+    @ApiModelProperty(value = "id")
+    private Long id;
+    @ApiModelProperty(value = "评价计划Id")
+    private Long evaluateId;
+    @ApiModelProperty(value = "角色Id")
+    private Long  roleId;
+}

+ 39 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/dto/CoreEvaluatePlanDTO.java

@@ -0,0 +1,39 @@
+package com.xunmei.core.evaluate.dto;
+
+import com.xunmei.core.evaluate.domain.CoreEvaluateContent;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author :LuoWei
+ * @date : 2023/10/10
+ */
+@Data
+public class CoreEvaluatePlanDTO {
+    private Long id;
+    /**
+     * 机构类型
+     */
+    @ApiModelProperty(value = "机构类型")
+    private String orgType;
+
+    /**
+     * 外包评价名称
+     */
+    @ApiModelProperty(value = "外包评价名称")
+    private String evaluateName;
+    /**
+     * 角色
+     */
+    @ApiModelProperty(value = "角色")
+    private List<Long> roleIds;
+    /**
+     * 周期
+     */
+    @ApiModelProperty(value = "周期")
+    private String evaluateCycle;
+    @ApiModelProperty(value = "内容")
+    private List<CoreEvaluateContent> coreEvaluateContentList;
+}

+ 31 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/dto/EvaluateQueryDTO.java

@@ -0,0 +1,31 @@
+package com.xunmei.core.evaluate.dto;
+
+import com.xunmei.common.core.web.domain.BaseEntity;
+import com.xunmei.common.core.web.domain.PageRequest;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author :LuoWei
+ * @date : 2023/10/10
+ */
+@Data
+public class EvaluateQueryDTO extends BaseEntity {
+    @ApiModelProperty(value = "机构id")
+    private Long orgId;
+    @ApiModelProperty(value = "机构路径")
+    private String orgPath;
+    @ApiModelProperty(value = "外包评价名称")
+    private String evaluateName;
+    @ApiModelProperty(value = "状态")
+    private String status;
+    @ApiModelProperty(value = "机构类型")
+    private String orgType;
+    /**
+     * 角色
+     */
+    @ApiModelProperty(value = "角色")
+    private Long roleId;
+}

+ 17 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/mapper/CoreEvaluateContentMapper.java

@@ -0,0 +1,17 @@
+package com.xunmei.core.evaluate.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.xunmei.core.evaluate.domain.CoreEvaluateContent;
+import com.xunmei.core.evaluate.domain.CoreEvaluatePlanContent;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+
+/**
+ * @author :LuoWei
+ * @date : 2023/10/10
+ */
+public interface CoreEvaluateContentMapper extends BaseMapper<CoreEvaluateContent> {
+    List<CoreEvaluateContent> getByEvaluateId(@Param("evaluateId") Long evaluateId);
+}

+ 22 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/mapper/CoreEvaluatePlanContentMapper.java

@@ -0,0 +1,22 @@
+package com.xunmei.core.evaluate.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xunmei.common.core.domain.retrieval.dto.RetrievalTaskPageDto;
+import com.xunmei.common.core.domain.retrieval.vo.CoreMonitoringRetrievalTaskVo;
+import com.xunmei.core.evaluate.domain.CoreEvaluatePlanContent;
+import com.xunmei.core.evaluate.dto.EvaluateQueryDTO;
+import com.xunmei.core.evaluate.vo.CoreEvaluatePlanListVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author :LuoWei
+ * @date : 2023/10/10
+ */
+public interface CoreEvaluatePlanContentMapper extends BaseMapper<CoreEvaluatePlanContent> {
+    int deleteByEvaluateIdInt(@Param("evaluateId") Long evaluateId);
+
+
+}

+ 75 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/mapper/CoreEvaluatePlanMapper.java

@@ -0,0 +1,75 @@
+package com.xunmei.core.evaluate.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xunmei.core.evaluate.domain.CoreEvaluatePlan;
+import com.xunmei.core.evaluate.dto.EvaluateQueryDTO;
+import com.xunmei.core.evaluate.vo.CoreEvaluatePlanListVO;
+import com.xunmei.core.information.domain.CoreMessageCenter;
+import com.xunmei.core.information.dto.CoreMessageCenterDTO;
+import com.xunmei.core.information.vo.CoreMessageCenterVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 外包评价计划Mapper接口
+ *
+ * @author xunmei
+ * @date 2023-10-10
+ */
+public interface CoreEvaluatePlanMapper extends BaseMapper<CoreEvaluatePlan> {
+    /**
+     * 查询外包评价计划
+     *
+     * @param id 外包评价计划主键
+     * @return 外包评价计划
+     */
+    CoreEvaluatePlan selectCoreEvaluatePlanById(Long id);
+
+    /**
+     * 查询外包评价计划列表
+     *
+     * @param coreEvaluatePlan 外包评价计划
+     * @return 外包评价计划集合
+     */
+    List<CoreEvaluatePlan> selectCoreEvaluatePlanList(CoreEvaluatePlan coreEvaluatePlan);
+
+    /**
+     * 新增外包评价计划
+     *
+     * @param coreEvaluatePlan 外包评价计划
+     * @return 结果
+     */
+    int insertCoreEvaluatePlan(CoreEvaluatePlan coreEvaluatePlan);
+
+    /**
+     * 修改外包评价计划
+     *
+     * @param coreEvaluatePlan 外包评价计划
+     * @return 结果
+     */
+    int updateCoreEvaluatePlan(CoreEvaluatePlan coreEvaluatePlan);
+
+    /**
+     * 删除外包评价计划
+     *
+     * @param id 外包评价计划主键
+     * @return 结果
+     */
+    int deleteCoreEvaluatePlanById(Long id);
+
+    /**
+     * 批量删除外包评价计划
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteCoreEvaluatePlanByIds(Long[] ids);
+
+   // Page<CoreEvaluatePlanListVO> selectByPage(Page<CoreEvaluatePlan> page, @Param("request") EvaluateQueryDTO request);
+
+    Page<CoreEvaluatePlanListVO> selectPageList(@Param("page") Page<CoreEvaluatePlanListVO> page, @Param("request") EvaluateQueryDTO request);
+
+}

+ 26 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/mapper/CoreEvaluateRoleMapper.java

@@ -0,0 +1,26 @@
+package com.xunmei.core.evaluate.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.xunmei.core.evaluate.domain.CoreEvaluatePlan;
+import com.xunmei.core.evaluate.domain.CoreEvaluateRole;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author :LuoWei
+ * @date : 2023/10/10
+ */
+public interface CoreEvaluateRoleMapper extends BaseMapper<CoreEvaluateRole> {
+    /**
+     * 通过评价计划id删除
+     */
+    int deleteByEvaluateId(@Param("evaluateId") Long evaluateId);
+
+    /**
+     * 通过评价id查询关联角色
+     * @param evaluateId
+     * @return
+     */
+    List<Long>getRoleByEvaluateId(@Param("evaluateId") Long evaluateId);
+}

+ 78 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/service/ICoreEvaluatePlanService.java

@@ -0,0 +1,78 @@
+package com.xunmei.core.evaluate.service;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.core.evaluate.domain.CoreEvaluatePlan;
+import com.xunmei.core.evaluate.dto.CoreEvaluatePlanDTO;
+import com.xunmei.core.evaluate.dto.EvaluateQueryDTO;
+import com.xunmei.core.evaluate.vo.CoreEvaluatePlanListVO;
+import com.xunmei.core.evaluate.vo.CoreEvaluatePlanVO;
+
+import java.util.List;
+
+/**
+ * 外包评价计划Service接口
+ *
+ * @author xunmei
+ * @date 2023-10-10
+ */
+public interface ICoreEvaluatePlanService extends IService<CoreEvaluatePlan> {
+    /**
+     * 查询外包评价计划
+     *
+     * @param id 外包评价计划主键
+     * @return 外包评价计划
+     */
+    CoreEvaluatePlanVO selectCoreEvaluatePlanById(Long id);
+
+    int updateStatus(CoreEvaluatePlan coreEvaluatePlan);
+
+    /**
+     * 查询外包评价计划列表
+     *
+     * @param coreEvaluatePlan 外包评价计划
+     * @return 外包评价计划集合
+     */
+    List<CoreEvaluatePlan> selectCoreEvaluatePlanList(CoreEvaluatePlan coreEvaluatePlan);
+
+    /**
+     * 新增外包评价计划
+     *
+     * @param coreEvaluatePlanDTO 外包评价计划
+     * @return 结果
+     */
+    int insertCoreEvaluatePlan(CoreEvaluatePlanDTO coreEvaluatePlanDTO);
+
+    /**
+     * 修改外包评价计划
+     *
+     * @param coreEvaluatePlanDTO 外包评价计划
+     * @return 结果
+     */
+    int updateCoreEvaluatePlan(CoreEvaluatePlanDTO coreEvaluatePlanDTO);
+
+    /**
+     * 批量删除外包评价计划
+     *
+     * @param ids 需要删除的外包评价计划主键集合
+     * @return 结果
+     */
+    int deleteCoreEvaluatePlanByIds(Long[] ids);
+
+    /**
+     * 删除外包评价计划信息
+     *
+     * @param id 外包评价计划主键
+     * @return 结果
+     */
+    int deleteCoreEvaluatePlanById(Long id);
+
+    /**
+     * 查询外包评价计划分页数据
+     *
+     * @param coreEvaluatePlan 查询条件对象
+     * @return Page
+     */
+     TableDataInfo<CoreEvaluatePlanListVO> selectPage(EvaluateQueryDTO evaluateQueryDTO);
+}

+ 266 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/service/impl/CoreEvaluatePlanServiceImpl.java

@@ -0,0 +1,266 @@
+package com.xunmei.core.evaluate.service.impl;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xunmei.common.core.constant.ErrorMsgConstants;
+import com.xunmei.common.core.constant.SecurityConstants;
+import com.xunmei.common.core.utils.DateUtils;
+import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.common.security.utils.SecurityUtils;
+import com.xunmei.core.evaluate.domain.CoreEvaluateContent;
+import com.xunmei.core.evaluate.domain.CoreEvaluatePlan;
+import com.xunmei.core.evaluate.domain.CoreEvaluatePlanContent;
+import com.xunmei.core.evaluate.domain.CoreEvaluateRole;
+import com.xunmei.core.evaluate.dto.CoreEvaluatePlanDTO;
+import com.xunmei.core.evaluate.dto.EvaluateQueryDTO;
+import com.xunmei.core.evaluate.mapper.CoreEvaluateContentMapper;
+import com.xunmei.core.evaluate.mapper.CoreEvaluatePlanContentMapper;
+import com.xunmei.core.evaluate.mapper.CoreEvaluatePlanMapper;
+import com.xunmei.core.evaluate.mapper.CoreEvaluateRoleMapper;
+import com.xunmei.core.evaluate.service.ICoreEvaluatePlanService;
+import com.xunmei.core.evaluate.vo.CoreEvaluatePlanListVO;
+import com.xunmei.core.evaluate.vo.CoreEvaluatePlanVO;
+import com.xunmei.system.api.RemoteOrgService;
+import com.xunmei.system.api.RemoteUserService;
+import com.xunmei.system.api.domain.SysOrg;
+import com.xunmei.system.api.domain.SysUser;
+import com.xunmei.system.api.function.RemoteCallHandlerExecutor;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 外包评价计划Service业务层处理
+ *
+ * @author xunmei
+ * @date 2023-10-10
+ */
+@Service
+public class CoreEvaluatePlanServiceImpl extends ServiceImpl<CoreEvaluatePlanMapper, CoreEvaluatePlan> implements ICoreEvaluatePlanService {
+    @Autowired
+    private CoreEvaluatePlanMapper coreEvaluatePlanMapper;
+    @Autowired
+    private RemoteOrgService remoteOrgService;
+    @Autowired
+    private RemoteUserService remoteUserService;
+    @Autowired
+    private CoreEvaluateRoleMapper coreEvaluateRoleMapper;
+    @Autowired
+    private CoreEvaluateContentMapper coreEvaluateContentMapper;
+    @Autowired
+    private CoreEvaluatePlanContentMapper coreEvaluatePlanContentMapper;
+    @Resource
+    private RemoteOrgService orgService;
+/*    @Override
+    public TableDataInfo<CoreEvaluatePlan> selectPage(CoreEvaluatePlan coreEvaluatePlan) {
+        //未删除
+        coreEvaluatePlan.setDeleted(0L);
+        Page<CoreEvaluatePlan> page;
+        //分页
+        if (coreEvaluatePlan.getPageNum()!=null&&coreEvaluatePlan.getPageSize()!=null)
+        {
+            page = new Page<>(coreEvaluatePlan.getPageNum(), coreEvaluatePlan.getPageSize());
+        }else{
+            page = new Page<>();
+        }
+        //查询条件
+        QueryWrapper<CoreEvaluatePlan> query = new QueryWrapper<>(coreEvaluatePlan);
+        //下穿
+        if (coreEvaluatePlan.getCheckSub()){
+            List<Long> ids = orgService.selectCheckSubOrgIdList(coreEvaluatePlan.getOrgId());
+            //清空前端传递的org_id
+            coreEvaluatePlan.setOrgId(null);
+            //添加in条件
+            query.in("org_id",ids);
+        }
+        //时间范围查询
+        if (coreEvaluatePlan.getParams().get("beginTime")!=null&&coreEvaluatePlan.getParams().get("endTime")!=null){
+            query.between("create_time", coreEvaluatePlan.getParams().get("beginTime"), coreEvaluatePlan.getParams().get("endTime"));
+        }
+        //获取数据
+        page = coreEvaluatePlanMapper.selectPage(page, query);
+        //抓换为TableDataInfo适配前端
+        return TableDataInfo.build(page);
+    }*/
+
+
+    /**
+     * 查询外包评价计划
+     *
+     * @param id 外包评价计划主键
+     * @return 外包评价计划
+     */
+    @Override
+    public CoreEvaluatePlanVO selectCoreEvaluatePlanById(Long id) {
+        CoreEvaluatePlanVO coreEvaluatePlanVO = new CoreEvaluatePlanVO();
+        CoreEvaluatePlan coreEvaluatePlan = coreEvaluatePlanMapper.selectById(id);
+        BeanUtils.copyProperties(coreEvaluatePlan, coreEvaluatePlanVO);
+        List<Long> roleList = coreEvaluateRoleMapper.getRoleByEvaluateId(id);
+        coreEvaluatePlanVO.setRoleIds(roleList);
+        List<CoreEvaluateContent> byEvaluateId = coreEvaluateContentMapper.getByEvaluateId(id);
+        coreEvaluatePlanVO.setCoreEvaluateContentList(byEvaluateId);
+        return coreEvaluatePlanVO;
+    }
+
+    @Override
+    public int updateStatus(CoreEvaluatePlan coreEvaluatePlan) {
+        CoreEvaluatePlan coreEvaluatePlan1 = coreEvaluatePlanMapper.selectById(coreEvaluatePlan.getId());
+        coreEvaluatePlan1.setStatus(coreEvaluatePlan.getStatus());
+        return coreEvaluatePlanMapper.updateById(coreEvaluatePlan1);
+    }
+
+    /**
+     * 查询外包评价计划列表
+     *
+     * @param coreEvaluatePlan 外包评价计划
+     * @return 外包评价计划
+     */
+    @Override
+    public List<CoreEvaluatePlan> selectCoreEvaluatePlanList(CoreEvaluatePlan coreEvaluatePlan) {
+        return coreEvaluatePlanMapper.selectList(new QueryWrapper<>(coreEvaluatePlan));
+    }
+
+    /**
+     * 新增外包评价计划
+     *
+     * @param coreEvaluatePlanDTO 外包评价计划
+     * @return 结果
+     */
+    @Override
+    public int insertCoreEvaluatePlan(CoreEvaluatePlanDTO coreEvaluatePlanDTO) {
+        CoreEvaluatePlan coreEvaluatePlan = new CoreEvaluatePlan();
+        BeanUtils.copyProperties(coreEvaluatePlanDTO, coreEvaluatePlan);
+        coreEvaluatePlan.setStatus("0");
+        coreEvaluatePlan.setCreateTime(DateUtils.getNowDate());
+        SysUser sysUser = remoteUserService.getUserById(SecurityUtils.getUserId(), SecurityConstants.INNER);
+        SysOrg sysOrg = remoteOrgService.selectSysOrgById(sysUser.getOrgId(), SecurityConstants.INNER);
+        coreEvaluatePlan.setCreateBy(SecurityUtils.getUsername());
+        coreEvaluatePlan.setOrgId(sysUser.getOrgId());
+        coreEvaluatePlan.setOrgName(sysOrg.getShortName());
+        coreEvaluatePlan.setIsDeleted("0");
+        long planId = IdWorker.getId();
+        coreEvaluatePlan.setId(planId);
+        int insert = 0;
+        //主体
+        insert = coreEvaluatePlanMapper.insert(coreEvaluatePlan);
+        //角色
+        coreEvaluatePlanDTO.getRoleIds().forEach(r -> {
+            CoreEvaluateRole coreEvaluateRole = new CoreEvaluateRole();
+            coreEvaluateRole.setRoleId(r);
+            coreEvaluateRole.setEvaluateId(planId);
+            coreEvaluateRoleMapper.insert(coreEvaluateRole);
+        });
+        //内容和计划绑定
+        coreEvaluatePlanDTO.getCoreEvaluateContentList().forEach(c -> {
+            long contentId = IdWorker.getId();
+            c.setId(contentId);
+            coreEvaluateContentMapper.insert(c);
+            CoreEvaluatePlanContent coreEvaluatePlanContent = new CoreEvaluatePlanContent();
+            coreEvaluatePlanContent.setContentId(contentId);
+            coreEvaluatePlanContent.setEvaluateId(planId);
+            coreEvaluatePlanContentMapper.insert(coreEvaluatePlanContent);
+        });
+        return insert;
+    }
+
+    /**
+     * 修改外包评价计划
+     *
+     * @param coreEvaluatePlanDTO 外包评价计划
+     * @return 结果
+     */
+    @Override
+    public int updateCoreEvaluatePlan(CoreEvaluatePlanDTO coreEvaluatePlanDTO) {
+        //todo
+        //删除未完成任务
+        CoreEvaluatePlan coreEvaluatePlan = new CoreEvaluatePlan();
+        BeanUtils.copyProperties(coreEvaluatePlanDTO, coreEvaluatePlan);
+        coreEvaluatePlan.setUpdateTime(DateUtils.getNowDate());
+        coreEvaluatePlan.setUpdateBy(SecurityUtils.getUsername());
+        //主体
+        int i = coreEvaluatePlanMapper.updateById(coreEvaluatePlan);
+        //角色
+        //先删除再新增
+        coreEvaluateRoleMapper.deleteByEvaluateId(coreEvaluatePlanDTO.getId());
+        coreEvaluatePlanDTO.getRoleIds().forEach(r -> {
+            CoreEvaluateRole coreEvaluateRole = new CoreEvaluateRole();
+            coreEvaluateRole.setRoleId(r);
+            coreEvaluateRole.setEvaluateId(coreEvaluatePlanDTO.getId());
+            coreEvaluateRoleMapper.insert(coreEvaluateRole);
+        });
+        //内容
+        coreEvaluatePlanContentMapper.deleteByEvaluateIdInt(coreEvaluatePlanDTO.getId());
+        coreEvaluatePlanDTO.getCoreEvaluateContentList().forEach(c -> {
+            CoreEvaluatePlanContent coreEvaluatePlanContent = new CoreEvaluatePlanContent();
+            if (null == c.getId()) {
+                long contentId = IdWorker.getId();
+                c.setId(contentId);
+                coreEvaluateContentMapper.insert(c);
+                coreEvaluatePlanContent.setContentId(contentId);
+            } else {
+                coreEvaluatePlanContent.setContentId(c.getId());
+            }
+            coreEvaluatePlanContent.setEvaluateId(coreEvaluatePlanDTO.getId());
+            coreEvaluatePlanContentMapper.insert(coreEvaluatePlanContent);
+        });
+        return i;
+    }
+
+    /**
+     * 批量删除外包评价计划
+     *
+     * @param ids 需要删除的外包评价计划主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCoreEvaluatePlanByIds(Long[] ids) {
+        int delete = 1;
+        for (int i = 0; i < ids.length; i++) {
+            CoreEvaluatePlan coreEvaluatePlan1 = coreEvaluatePlanMapper.selectById(ids[i]);
+            coreEvaluatePlan1.setIsDeleted("1");
+            delete = coreEvaluatePlanMapper.updateById(coreEvaluatePlan1);
+            if (delete < 1) {
+                return delete;
+            }
+        }
+        return delete;
+    }
+
+    /**
+     * 删除外包评价计划信息
+     *
+     * @param id 外包评价计划主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCoreEvaluatePlanById(Long id) {
+        return coreEvaluatePlanMapper.deleteById(id);
+    }
+
+    @Override
+    public TableDataInfo<CoreEvaluatePlanListVO> selectPage(EvaluateQueryDTO evaluateQueryDTO) {
+        Page<CoreEvaluatePlanListVO> page;
+        //分页
+        if (evaluateQueryDTO.getPageNum() != null && evaluateQueryDTO.getPageSize() != null) {
+            page = new Page<>(evaluateQueryDTO.getPageNum(), evaluateQueryDTO.getPageSize());
+        } else {
+            page = new Page<>();
+        }
+        //下穿
+        if (evaluateQueryDTO.getCheckSub()) {
+            SysOrg sysOrg = RemoteCallHandlerExecutor.executeRemoteCall(() -> orgService.selectSysOrgById(evaluateQueryDTO.getOrgId(), SecurityConstants.INNER), ErrorMsgConstants.QUERY_ORG_DATA_ERROR);
+            evaluateQueryDTO.setOrgPath(sysOrg.getPath());
+            evaluateQueryDTO.setOrgId(null);
+        }
+        page = coreEvaluatePlanMapper.selectPageList(page, evaluateQueryDTO);
+        //抓换为TableDataInfo适配前端
+        return TableDataInfo.build(page);
+    }
+}

+ 55 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/vo/CoreEvaluatePlanListVO.java

@@ -0,0 +1,55 @@
+package com.xunmei.core.evaluate.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author :LuoWei
+ * @date : 2023/10/10
+ */
+@Data
+public class CoreEvaluatePlanListVO {
+    private Long id;
+    private Long orgId;
+    private String orgName;
+    /**
+     * 外包评价名称
+     */
+    @ApiModelProperty(value = "外包评价名称")
+    private String evaluateName;
+    /**
+     * 机构类型
+     */
+    @ApiModelProperty(value = "机构类型")
+    private String orgType;
+
+    /**
+     * 角色
+     */
+    @ApiModelProperty(value = "角色")
+    private Long roleId;
+    /**
+     * 周期
+     */
+    @ApiModelProperty(value = "周期")
+    private String evaluateCycle;
+    /**
+     * 创建者
+     */
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(value = "创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    @ApiModelProperty(value = "状态")
+    private String status;
+}

+ 38 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/vo/CoreEvaluatePlanVO.java

@@ -0,0 +1,38 @@
+package com.xunmei.core.evaluate.vo;
+
+import com.xunmei.core.evaluate.domain.CoreEvaluateContent;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author :LuoWei
+ * @date : 2023/10/10
+ */
+@Data
+public class CoreEvaluatePlanVO {
+    private Long id;
+    /**
+     * 外包评价名称
+     */
+    @ApiModelProperty(value = "外包评价名称")
+    private String evaluateName;
+    /**
+     * 机构类型
+     */
+    @ApiModelProperty(value = "机构类型")
+    private String orgType;
+    /**
+     * 角色
+     */
+    @ApiModelProperty(value = "角色")
+    private List<Long> roleIds;
+    /**
+     * 周期
+     */
+    @ApiModelProperty(value = "周期")
+    private String evaluateCycle;
+    @ApiModelProperty(value = "内容")
+    private List<CoreEvaluateContent> coreEvaluateContentList;
+}

+ 24 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/evaluate/CoreEvaluateContentMapper.xml

@@ -0,0 +1,24 @@
+<?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.evaluate.mapper.CoreEvaluateContentMapper">
+
+    <resultMap type="com.xunmei.core.evaluate.domain.CoreEvaluateContent" id="CoreEvaluateContentResult">
+        <result property="id" column="id"/>
+        <result property="uId" column="u_id"/>
+        <result property="code" column="code"/>
+        <result property="contentType" column="content_type"/>
+        <result property="content" column="content"/>
+    </resultMap>
+    <select id="getByEvaluateId" resultType="com.xunmei.core.evaluate.domain.CoreEvaluatePlanContent">
+        SELECT
+            a.*
+        FROM
+            core_evaluate_content a
+                LEFT JOIN core_evaluate_plan_content b ON a.id = b.content_id
+        WHERE
+            b.evaluate_id =#{evaluateId}
+    </select>
+
+</mapper>

+ 21 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/evaluate/CoreEvaluatePlanContentMapper.xml

@@ -0,0 +1,21 @@
+<?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.evaluate.mapper.CoreEvaluatePlanContentMapper">
+
+    <resultMap type="com.xunmei.core.evaluate.domain.CoreEvaluatePlanContent" id="CoreEvaluatePlanContentResult">
+        <result property="id" column="id"/>
+        <result property="evaluateId" column="evaluate_id"/>
+        <result property="contentId" column="content_id"/>
+    </resultMap>
+    <delete id="deleteByEvaluateIdInt">
+        DELETE
+        FROM
+            core_evaluate_plan_content
+        WHERE
+            evaluate_id =#{evaluateId}
+    </delete>
+
+
+</mapper>

+ 200 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/evaluate/CoreEvaluatePlanMapper.xml

@@ -0,0 +1,200 @@
+<?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.evaluate.mapper.CoreEvaluatePlanMapper">
+
+    <resultMap type="com.xunmei.core.evaluate.domain.CoreEvaluatePlan" id="CoreEvaluatePlanResult">
+                <result property="id" column="id"/>
+                <result property="orgId" column="org_id"/>
+        <result property="status" column="status"/>
+                <result property="orgName" column="org_name"/>
+                <result property="orgType" column="org_type"/>
+                <result property="evaluateName" column="evaluate_name"/>
+                <result property="evaluateCycle" column="evaluate_cycle"/>
+                <result property="createTime" column="create_time"/>
+                <result property="updateTime" column="update_time"/>
+                <result property="isDeleted" column="is_deleted"/>
+                <result property="createBy" column="create_by"/>
+                <result property="updateBy" column="update_by"/>
+    </resultMap>
+
+    <sql id="selectCoreEvaluatePlanVo">
+        select id, org_id, org_name, org_type, evaluate_name, evaluate_cycle, create_time, update_time, is_deleted, create_by, update_by
+        from core_evaluate_plan
+    </sql>
+
+    <select id="selectCoreEvaluatePlanList" parameterType="com.xunmei.core.evaluate.domain.CoreEvaluatePlan"
+            resultMap="CoreEvaluatePlanResult">
+        <include refid="selectCoreEvaluatePlanVo"/>
+        <where>
+                        <if test="orgId != null ">
+                            and org_id = #{orgId}
+                        </if>
+
+                        <if test="orgName != null  and orgName != ''">
+                            and org_name like concat('%', #{orgName}, '%')
+                        </if>
+                        <if test="orgType != null  and orgType != ''">
+                            and org_type = #{orgType}
+                        </if>
+                        <if test="evaluateName != null  and evaluateName != ''">
+                            and evaluate_name like concat('%', #{evaluateName}, '%')
+                        </if>
+                        <if test="evaluateCycle != null  and evaluateCycle != ''">
+                            and evaluate_cycle = #{evaluateCycle}
+                        </if>
+                        <if test="isDeleted != null  and isDeleted != ''">
+                            and is_deleted = #{isDeleted}
+                        </if>
+        </where>
+    </select>
+
+    <select id="selectCoreEvaluatePlanById" parameterType="Long"
+            resultMap="CoreEvaluatePlanResult">
+            <include refid="selectCoreEvaluatePlanVo"/>
+            where id = #{id}
+    </select>
+    <select id="selectPageList" resultType="com.xunmei.core.evaluate.vo.CoreEvaluatePlanListVO">
+        SELECT
+            a.id,
+            a.org_name,
+            a.evaluate_name,
+            a.org_type,
+            GROUP_CONCAT( c.role_name ),
+            a.evaluate_cycle,
+            a.create_by,
+            a.`status`
+        FROM
+            core_evaluate_plan a
+                LEFT JOIN core_evaluate_role b ON a.id = b.evaluate_id
+                LEFT JOIN sys_role c ON c.id = b.role_id
+        WHERE
+            a.is_deleted =0
+        <if test="request.orgId != null ">
+            and a.org_id = #{request.orgId}
+        </if>
+        <if test="request.orgPath != null  and request.orgPath != ''">
+            and a.org_path like concat( #{request.orgPath}, '%')
+        </if>
+        <if test="request.evaluateName != null  and request.evaluateName != ''">
+            and a.evaluate_name like concat('%', #{request.evaluateName}, '%')
+        </if>
+        <if test="request.status != null ">
+            and a.status = #{request.status}
+        </if>
+        <if test="request.orgType != null ">
+            and a.org_type = #{request.orgType}
+        </if>
+        <if test="request.roleId != null ">
+            and b.role_id = #{request.roleId}
+        </if>
+        ORDER BY a.create_time DESC
+    </select>
+
+    <insert id="insertCoreEvaluatePlan" parameterType="com.xunmei.core.evaluate.domain.CoreEvaluatePlan">
+        insert into core_evaluate_plan
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+                    <if test="id != null">id,
+                    </if>
+                    <if test="orgId != null">org_id,
+                    </if>
+            <if test="status != null">status,
+            </if>
+                    <if test="orgName != null">org_name,
+                    </if>
+                    <if test="orgType != null">org_type,
+                    </if>
+                    <if test="evaluateName != null">evaluate_name,
+                    </if>
+                    <if test="evaluateCycle != null">evaluate_cycle,
+                    </if>
+                    <if test="createTime != null">create_time,
+                    </if>
+                    <if test="updateTime != null">update_time,
+                    </if>
+                    <if test="isDeleted != null">is_deleted,
+                    </if>
+                    <if test="createBy != null">create_by,
+                    </if>
+                    <if test="updateBy != null">update_by,
+                    </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+                    <if test="id != null">#{id},
+                    </if>
+                    <if test="orgId != null">#{orgId},
+                    </if>
+            <if test="status != null">#{status},
+            </if>
+                    <if test="orgName != null">#{orgName},
+                    </if>
+                    <if test="orgType != null">#{orgType},
+                    </if>
+                    <if test="evaluateName != null">#{evaluateName},
+                    </if>
+                    <if test="evaluateCycle != null">#{evaluateCycle},
+                    </if>
+                    <if test="createTime != null">#{createTime},
+                    </if>
+                    <if test="updateTime != null">#{updateTime},
+                    </if>
+                    <if test="isDeleted != null">#{isDeleted},
+                    </if>
+                    <if test="createBy != null">#{createBy},
+                    </if>
+                    <if test="updateBy != null">#{updateBy},
+                    </if>
+        </trim>
+    </insert>
+
+    <update id="updateCoreEvaluatePlan" parameterType="com.xunmei.core.evaluate.domain.CoreEvaluatePlan">
+        update core_evaluate_plan
+        <trim prefix="SET" suffixOverrides=",">
+                    <if test="orgId != null">org_id =
+                        #{orgId},
+                    </if>
+
+                    <if test="orgName != null">org_name =
+                        #{orgName},
+                    </if>
+                    <if test="orgType != null">org_type =
+                        #{orgType},
+                    </if>
+                    <if test="evaluateName != null">evaluate_name =
+                        #{evaluateName},
+                    </if>
+                    <if test="evaluateCycle != null">evaluate_cycle =
+                        #{evaluateCycle},
+                    </if>
+                    <if test="createTime != null">create_time =
+                        #{createTime},
+                    </if>
+                    <if test="updateTime != null">update_time =
+                        #{updateTime},
+                    </if>
+                    <if test="isDeleted != null">is_deleted =
+                        #{isDeleted},
+                    </if>
+                    <if test="createBy != null">create_by =
+                        #{createBy},
+                    </if>
+                    <if test="updateBy != null">update_by =
+                        #{updateBy},
+                    </if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteCoreEvaluatePlanById" parameterType="Long">
+        delete
+        from core_evaluate_plan where id = #{id}
+    </delete>
+
+    <delete id="deleteCoreEvaluatePlanByIds" parameterType="String">
+        delete from core_evaluate_plan where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 24 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/evaluate/CoreEvaluateRoleMapper.xml

@@ -0,0 +1,24 @@
+<?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.evaluate.mapper.CoreEvaluateRoleMapper">
+
+    <resultMap type="com.xunmei.core.evaluate.domain.CoreEvaluateRole" id="CoreEvaluateRoleResult">
+        <result property="id" column="id"/>
+        <result property="evaluateId" column="evaluate_id"/>
+        <result property="roleId" column="role_id"/>
+    </resultMap>
+    <delete id="deleteByEvaluateId">
+        DELETE FROM core_evaluate_role WHERE evaluate_id=#{evaluateId}
+    </delete>
+    <select id="getRoleByEvaluateId" resultType="java.lang.Long">
+        SELECT
+            role_id
+        FROM
+            core_evaluate_role
+        WHERE
+            evaluate_id =#{evaluateId}
+    </select>
+
+</mapper>

+ 0 - 39
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysDeviceServiceImpl.java

@@ -239,24 +239,6 @@ public class SysDeviceServiceImpl extends ServiceImpl<SysDeviceMapper, SysDevice
 
     @Override
     public void downInChargeOfTemplate(HttpServletResponse response) throws IOException{
-//        responseSetting(response, "device", ".xlsx",
-//                "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
-//
-//        InputStream inputStream = null;
-//        OutputStream outputStream = null;
-//        try {
-//            // 读取文件的输入流
-//            inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("templates/device.xlsx");
-//            XSSFWorkbook wb = new XSSFWorkbook(inputStream);
-//            outputStream = response.getOutputStream();
-//            wb.write(outputStream);
-//            outputStream.flush();
-//        } catch (IOException e) {
-//            e.printStackTrace();
-//        } finally {
-//            IoUtil.close(inputStream);
-//            IoUtil.close(outputStream);
-//        }
         response.setContentType("application/vnd.ms-excel");
         response.setCharacterEncoding("utf-8");
         String fileName = URLEncoder.encode("设备导入" + DateHelper.getDateString(new Date()), "UTF-8");
@@ -265,27 +247,6 @@ public class SysDeviceServiceImpl extends ServiceImpl<SysDeviceMapper, SysDevice
         EasyExcel.write(response.getOutputStream(), DeviceExport.class).sheet("Sheet1").doWrite(null);
     }
 
-    public void responseSetting(HttpServletResponse response, String fileName, String suffix, String contentType) {
-        // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
-        String newFileName = null;
-        try {
-            newFileName = URLEncoder.encode(fileName, "UTF-8").replaceAll("\\+", "%20");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-        // 当客户端请求的资源是一个可下载的资源(这里的“可下载”是指浏览器会弹出下载框或者下载界面)时,对这个可下载资源的描述(例如下载框中的文件名称)就是来源于该头域。
-        response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + newFileName + suffix);
-        // 服务器告诉浏览器它发送的数据属于什么文件类型,也就是响应数据的MIME类型
-        response.setContentType(contentType);
-        response.setCharacterEncoding("utf-8");
-        // 关闭缓存(HTTP/1.1)
-        response.setHeader("Cache-Control", "no-store");
-        // 关闭缓存(HTTP/1.0)
-        response.setHeader("Pragma", "no-cache");
-        // 缓存有效时间
-        response.setDateHeader("Expires", 0);
-    }
-
 
     /**
      * 修改【请填写功能名称】