瀏覽代碼

修改需求

luowei 2 年之前
父節點
當前提交
a46dbf0eb7
共有 21 個文件被更改,包括 218 次插入193 次删除
  1. 1 1
      project_data/sql/0.0.2/soc/soc.sql
  2. 2 2
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/retrieval/vo/CoreMonitoringRetrievalTaskVo.java
  3. 6 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/controller/TMonitoringRetrievalPlanController.java
  4. 2 2
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/domain/TMonitoringRetrievalPlan.java
  5. 3 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/service/ITMonitoringRetrievalPlanService.java
  6. 119 165
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/service/impl/TMonitoringRetrievalPlanServiceImpl.java
  7. 2 3
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/vo/TMonitoringRetrievalPlanVO.java
  8. 1 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/mapper/CoreEvaluateTaskContentMapper.java
  9. 1 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/service/ICoreEvaluateTaskService.java
  10. 1 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/service/impl/CoreEvaluatePlanServiceImpl.java
  11. 26 12
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/service/impl/CoreEvaluateTaskServiceImpl.java
  12. 21 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/vo/CoreEvaluateContentVO.java
  13. 1 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/vo/CoreEvaluatePlanVO.java
  14. 4 2
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/vo/CoreEvaluateTaskVO.java
  15. 1 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/retrieval/mapper/CoreMonitoringRetrievalTaskMapper.java
  16. 6 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/retrieval/service/ICoreMonitoringRetrievalTaskService.java
  17. 6 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/retrieval/service/impl/CoreMonitoringRetrievalTaskServiceImpl.java
  18. 1 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/weather/controller/WeatherWarningController.java
  19. 3 0
      soc-modules/soc-modules-core/src/main/resources/mapper/evaluate/CoreEvaluateTaskContentMapper.xml
  20. 10 0
      soc-modules/soc-modules-core/src/main/resources/mapper/retrieval/CoreMonitoringRetrievalTaskMapper.xml
  21. 1 1
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysDeviceServiceImpl.java

+ 1 - 1
project_data/sql/0.0.2/soc/soc.sql

@@ -2015,7 +2015,7 @@ UPDATE `sys_dict_data` SET `dict_sort` = 700 WHERE `dict_value` = '10' and `dict
 UPDATE `sys_dict_data` SET `dict_sort` = 500 WHERE `dict_value` = '8' and `dict_type` = 'sys_org_type';
 UPDATE `sys_dict_data` SET `dict_sort` = 400 WHERE `dict_value` = '7' and `dict_type` = 'sys_org_type';
 UPDATE `sys_dict_data` SET `dict_sort` = 1000 WHERE `dict_value` = '9' and `dict_type` = 'sys_org_type';
-
+update `sys_dict_data` SET dict_label='已逾期' WHERE dict_type='retrieval_task_status' AND dict_label='已超期'
 -- 演练任务状态字典排序修改
 UPDATE sys_dict_data t SET t.dict_sort = 2 WHERE  t.dict_type = 'edu_training_do_status' and t.dict_value=1;
 UPDATE sys_dict_data t SET t.dict_sort = 1 WHERE  t.dict_type = 'edu_training_do_status' and t.dict_value=4;

+ 2 - 2
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/retrieval/vo/CoreMonitoringRetrievalTaskVo.java

@@ -104,14 +104,14 @@ public class CoreMonitoringRetrievalTaskVo extends BaseEntity {
     /**
      * 开始时间
      */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     @ApiModelProperty(value = "开始时间")
     private Date planStartTime;
 
     /**
      * 结束时间
      */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     @ApiModelProperty(value = "结束时间")
     private Date planEndTime;
 

+ 6 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/controller/TMonitoringRetrievalPlanController.java

@@ -11,7 +11,9 @@ import com.xunmei.common.security.annotation.RequiresPermissions;
 import com.xunmei.common.security.utils.SecurityUtils;
 import com.xunmei.core.access.domain.TMonitoringRetrievalPlan;
 import com.xunmei.core.access.service.ITMonitoringRetrievalPlanService;
+import com.xunmei.system.api.RemoteOrgService;
 import com.xunmei.system.api.RemoteRoleService;
+import com.xunmei.system.api.domain.SysOrg;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -33,7 +35,8 @@ public class TMonitoringRetrievalPlanController extends BaseController {
     private ITMonitoringRetrievalPlanService tMonitoringRetrievalPlanService;
     @Autowired
     private RemoteRoleService remoteRoleService;
-
+    @Autowired
+    private RemoteOrgService remoteOrgService;
     /**
      * 查询监控调阅计划列表
      */
@@ -46,6 +49,7 @@ public class TMonitoringRetrievalPlanController extends BaseController {
         ajax.put("data", tMonitoringRetrievalPlanTableDataInfo);
         boolean admin = false;
         String s = remoteRoleService.selectRoleNameByUserId(SecurityUtils.getUserId(), SecurityConstants.INNER);
+        SysOrg sysOrg = remoteOrgService.selectSysOrgById(SecurityUtils.getLoginUser().getOrgId(), SecurityConstants.INNER);
         if (StringUtils.isNotEmpty(s)) {
             int i = s.indexOf(",");
             if (i >= 0) {
@@ -63,6 +67,7 @@ public class TMonitoringRetrievalPlanController extends BaseController {
             admin = true;
         }
         ajax.put("check", admin);
+        ajax.put("isEdit",sysOrg.getId());
         return ajax;
     }
 

+ 2 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/domain/TMonitoringRetrievalPlan.java

@@ -37,11 +37,11 @@ public class TMonitoringRetrievalPlan extends BaseEntity {
     @JsonSerialize(using = ToStringSerializer.class)
     @TableId(type = IdType.AUTO)
     private Long id;
-    @JsonSerialize(using = ToStringSerializer.class)
 
     /**
      * 上级id
      */
+    @JsonSerialize(using = ToStringSerializer.class)
     @ApiModelProperty(value = "上级id")
     private Long parentId;
     /**
@@ -63,7 +63,7 @@ private String isDistribute;
     @ApiModelProperty(value = "结束时间")
    // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date endTime;
-    @ApiModelProperty(value = "下发类型0自建1下发")
+    @ApiModelProperty(value = "下发类型0不能做任务1可以直接做任务")
     private Integer createType;
     /**
      * 计划归属机构

+ 3 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/service/ITMonitoringRetrievalPlanService.java

@@ -3,6 +3,8 @@ package com.xunmei.core.access.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.xunmei.common.core.web.page.TableDataInfo;
 import com.xunmei.core.access.domain.TMonitoringRetrievalPlan;
+import com.xunmei.core.access.vo.TMonitoringRetrievalPlanVO;
+
 import java.util.List;
 
 
@@ -19,7 +21,7 @@ public interface ITMonitoringRetrievalPlanService extends IService<TMonitoringRe
      * @param id 监控调阅计划主键
      * @return 监控调阅计划
      */
-    TMonitoringRetrievalPlan selectTMonitoringRetrievalPlanById(Long id);
+    TMonitoringRetrievalPlanVO selectTMonitoringRetrievalPlanById(Long id);
 
     /**
      * 下发

+ 119 - 165
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/service/impl/TMonitoringRetrievalPlanServiceImpl.java

@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
 import com.xunmei.common.core.constant.SecurityConstants;
+import com.xunmei.common.core.domain.retrieval.domain.CoreMonitoringRetrievalTask;
 import com.xunmei.common.core.exception.ServiceException;
 import com.xunmei.common.core.util.BeanHelper;
 import com.xunmei.common.core.utils.DateUtils;
@@ -19,6 +20,7 @@ import com.xunmei.common.security.utils.SecurityUtils;
 import com.xunmei.core.access.domain.TMonitoringRetrievalPlan;
 import com.xunmei.core.access.mapper.TMonitoringRetrievalPlanMapper;
 import com.xunmei.core.access.service.ITMonitoringRetrievalPlanService;
+
 import com.xunmei.core.access.vo.TMonitoringRetrievalPlanVO;
 import com.xunmei.core.retrieval.service.ICoreMonitoringRetrievalTaskService;
 
@@ -102,29 +104,23 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
         query.orderByAsc("parent_id");
         query.orderByDesc("create_time");
         //获取数据
-       // query.isNull(PARENT_ID);
+        // query.isNull(PARENT_ID);
         page = tMonitoringRetrievalPlanMapper.selectPage(page, query);
-//        List<TMonitoringRetrievalPlan> records = page.getRecords();
-//        List<TMonitoringRetrievalPlanVO> tMonitoringRetrievalPlanVOS = BeanHelper.copyProperties(records, TMonitoringRetrievalPlanVO.class);
-//        for (TMonitoringRetrievalPlanVO monitoringRetrievalPlan : tMonitoringRetrievalPlanVOS) {
-//            dealData(monitoringRetrievalPlan, tMonitoringRetrievalPlanVOS);
-//        }
-//        //抓换为TableDataInfo适配前端
-//        TableDataInfo<TMonitoringRetrievalPlanVO> tableDataInfo = new TableDataInfo();
-//        tableDataInfo.setMsg("操作成功");
-//        tableDataInfo.setCode(200);
-//        tableDataInfo.setTotal(page.getTotal());
-//        tableDataInfo.setRows(tMonitoringRetrievalPlanVOS);
-       // return tableDataInfo;
+        List<TMonitoringRetrievalPlan> records = page.getRecords();
+        List<TMonitoringRetrievalPlanVO>tMonitoringRetrievalPlanVOS = null;
+        SysOrg sysOrg = remoteOrgService.selectSysOrgById(SecurityUtils.getLoginUser().getOrgId(), SecurityConstants.INNER);
+  /*      for (TMonitoringRetrievalPlan r:records){
+            TMonitoringRetrievalPlanVO tMonitoringRetrievalPlanVO=new TMonitoringRetrievalPlanVO();
+            BeanUtils.copyProperties(r,tMonitoringRetrievalPlanVO);
+            if (r.getOrgId().equals(sysOrg.getId())||r.getParentId().equals(sysOrg.getId())){
+                tMonitoringRetrievalPlanVO.setIsEdit(Boolean.TRUE);
+            }
+            tMonitoringRetrievalPlanVOS.add(tMonitoringRetrievalPlanVO);
+        }*/
+      //  page.setRecords(tMonitoringRetrievalPlanVOS);
         return TableDataInfo.build(page);
     }
 
-    private void dealData(TMonitoringRetrievalPlanVO record, List<TMonitoringRetrievalPlanVO> records) {
-        record.setNo(records.indexOf(record) + 1);
-        List<TMonitoringRetrievalPlan> tMonitoringRetrievalPlans = tMonitoringRetrievalPlanMapper.selectList(new LambdaQueryWrapper<TMonitoringRetrievalPlan>().eq(TMonitoringRetrievalPlan::getParentId, record.getId()));
-        List<TMonitoringRetrievalPlanVO> children = BeanHelper.copyProperties(tMonitoringRetrievalPlans, TMonitoringRetrievalPlanVO.class);
-        record.setChildren(children);
-    }
 
     /**
      * 查询监控调阅计划
@@ -133,8 +129,19 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
      * @return 监控调阅计划
      */
     @Override
-    public TMonitoringRetrievalPlan selectTMonitoringRetrievalPlanById(Long id) {
-        return tMonitoringRetrievalPlanMapper.selectById(id);
+    public TMonitoringRetrievalPlanVO selectTMonitoringRetrievalPlanById(Long id) {
+        TMonitoringRetrievalPlanVO tMonitoringRetrievalPlanVO = new TMonitoringRetrievalPlanVO();
+        TMonitoringRetrievalPlan plan = tMonitoringRetrievalPlanMapper.selectById(id);
+        BeanUtils.copyProperties(plan, tMonitoringRetrievalPlanVO);
+        //1:
+        SysOrg sysOrg = remoteOrgService.selectSysOrgById(plan.getOrgId(), SecurityConstants.INNER);
+        SysOrg sysOrg1 = remoteOrgService.selectSysOrgById(SecurityUtils.getLoginUser().getOrgId(), SecurityConstants.INNER);
+        boolean isEdit = false;
+        if (plan.getParentId()!=null) {
+            isEdit = true;
+        }
+        tMonitoringRetrievalPlanVO.setIsEdit(isEdit);
+        return tMonitoringRetrievalPlanVO;
     }
 
     @Transactional
@@ -154,72 +161,60 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
             throw new ServiceException("请勿重复下发");
         }
         SysOrg topOrg = remoteOrgService.selectSysOrgById(tMonitoringRetrievalPlan.getOrgId(), SecurityConstants.INNER);
-        SysOrg org = new SysOrg();
-        org.setType(3);
-        org.setPath(topOrg.getPath());
-        //查询符合的机构,需求是先把行社加入
-        List<SysOrg> list = remoteOrgService.listByParentIdAndType(org, SecurityConstants.INNER);
-        Integer i = ZERO;
+        //判断当前登录人下发是母还是子,母生成行社子计划,子直接下发任务
+        //如果顶级
         List<TMonitoringRetrievalPlan> tMonitoringRetrievalPlans = new ArrayList<>();
-        for (SysOrg l : list) {
-            TMonitoringRetrievalPlan monitoringRetrievalPlan = new TMonitoringRetrievalPlan();
-            BeanUtils.copyProperties(tMonitoringRetrievalPlan, monitoringRetrievalPlan);
-            monitoringRetrievalPlan.setPlanName(tMonitoringRetrievalPlan.getPlanName());
-            monitoringRetrievalPlan.setOrgId(l.getId());
-            monitoringRetrievalPlan.setOrgName(l.getShortName());
-            monitoringRetrievalPlan.setRoleId(tMonitoringRetrievalPlan.getRoleId());
-            monitoringRetrievalPlan.setRoleName(tMonitoringRetrievalPlan.getRoleName());
-            monitoringRetrievalPlan.setOrgPath(l.getPath());
-            monitoringRetrievalPlan.setOrgType(tMonitoringRetrievalPlan.getOrgType());
-            monitoringRetrievalPlan.setPlanCycle(tMonitoringRetrievalPlan.getPlanCycle());
-            monitoringRetrievalPlan.setPlanFrequency(tMonitoringRetrievalPlan.getPlanFrequency());
-            monitoringRetrievalPlan.setPlanStatus(ZERO);
-            monitoringRetrievalPlan.setCreateBy(SecurityUtils.getUsername());
-            monitoringRetrievalPlan.setUpdateTime(DateUtils.getNowDate());
-            monitoringRetrievalPlan.setUpdateBy(SecurityUtils.getUsername());
-            monitoringRetrievalPlan.setCreateTime(DateUtils.getNowDate());
-            monitoringRetrievalPlan.setDescription(tMonitoringRetrievalPlan.getDescription());
-            monitoringRetrievalPlan.setCreateType(ZERO);
-            monitoringRetrievalPlan.setId(IdWorker.getId());
-            monitoringRetrievalPlan.setParentId(tMonitoringRetrievalPlan.getId());
-            monitoringRetrievalPlan.setIsDistribute("1");
-            i = tMonitoringRetrievalPlanMapper.insert(monitoringRetrievalPlan);
-            //如果是行社直接新增,如果不是就要查询下面的机构
-            if (tMonitoringRetrievalPlan.getOrgType().equals("3")) {
-                tMonitoringRetrievalPlans.add(monitoringRetrievalPlan);
-            } else {
-                SysOrg sysOrg = new SysOrg();
-                sysOrg.setPath(l.getPath());
-                sysOrg.setType(Integer.valueOf(tMonitoringRetrievalPlan.getOrgType()));
-                List<SysOrg> sysOrgs = remoteOrgService.listByParentIdAndType(sysOrg, SecurityConstants.INNER);
-                for (SysOrg s : sysOrgs) {
-                    TMonitoringRetrievalPlan plan = new TMonitoringRetrievalPlan();
-                    BeanUtils.copyProperties(monitoringRetrievalPlan, plan);
-                    plan.setPlanName(tMonitoringRetrievalPlan.getPlanName());
-                    plan.setOrgId(s.getId());
-                    plan.setOrgName(s.getShortName());
-                    plan.setRoleId(tMonitoringRetrievalPlan.getRoleId());
-                    plan.setRoleName(tMonitoringRetrievalPlan.getRoleName());
-                    plan.setOrgPath(s.getPath());
-                    plan.setOrgType(tMonitoringRetrievalPlan.getOrgType());
-                    plan.setPlanCycle(tMonitoringRetrievalPlan.getPlanCycle());
-                    plan.setPlanFrequency(tMonitoringRetrievalPlan.getPlanFrequency());
-                    plan.setPlanStatus(ZERO);
-                    plan.setCreateBy(SecurityUtils.getUsername());
-                    plan.setUpdateTime(DateUtils.getNowDate());
-                    plan.setUpdateBy(SecurityUtils.getUsername());
-                    plan.setCreateTime(DateUtils.getNowDate());
-                    plan.setDescription(tMonitoringRetrievalPlan.getDescription());
-                    plan.setCreateType(1);
-                    plan.setId(IdWorker.getId());
-                    plan.setParentId(tMonitoringRetrievalPlan.getId());
-                    plan.setIsDistribute("1");
-                    i = tMonitoringRetrievalPlanMapper.insert(plan);
-                    tMonitoringRetrievalPlans.add(plan);
+        Integer i = ZERO;
+        if (topOrg.getType() == 1) {
+            SysOrg org = new SysOrg();
+            org.setType(3);
+            org.setPath(topOrg.getPath());
+            //查询符合的机构,需求是先把行社加入
+            List<SysOrg> list = remoteOrgService.listByParentIdAndType(org, SecurityConstants.INNER);
+            for (SysOrg l : list) {
+                TMonitoringRetrievalPlan tMonitoringRetrievalPlan1 = new TMonitoringRetrievalPlan();
+                BeanUtils.copyProperties(tMonitoringRetrievalPlan, tMonitoringRetrievalPlan1);
+                tMonitoringRetrievalPlan1.setOrgId(l.getId());
+                tMonitoringRetrievalPlan1.setOrgPath(l.getPath());
+                tMonitoringRetrievalPlan1.setParentId(id);
+                if (tMonitoringRetrievalPlan.getOrgType().equals("3")) {
+                    tMonitoringRetrievalPlan1.setIsDistribute("1");
                 }
+                tMonitoringRetrievalPlan1.setCreateType(1);
+                i = insertTMonitoringRetrievalPlan(tMonitoringRetrievalPlan1);
             }
-            if (i < ZERO) {
-                return i;
+        } else {
+            SysOrg sysOrg = new SysOrg();
+            sysOrg.setPath(tMonitoringRetrievalPlan.getOrgPath());
+            sysOrg.setType(Integer.valueOf(tMonitoringRetrievalPlan.getOrgType()));
+            List<SysOrg> sysOrgs = remoteOrgService.listByParentIdAndType(sysOrg, SecurityConstants.INNER);
+            tMonitoringRetrievalPlan.setIsDistribute("1");
+            tMonitoringRetrievalPlan.setCreateType(1);
+            tMonitoringRetrievalPlanMapper.updateById(tMonitoringRetrievalPlan);
+            for (SysOrg s : sysOrgs) {
+                TMonitoringRetrievalPlan plan = new TMonitoringRetrievalPlan();
+                BeanUtils.copyProperties(tMonitoringRetrievalPlan, plan);
+                plan.setPlanName(tMonitoringRetrievalPlan.getPlanName());
+                plan.setOrgId(s.getId());
+                plan.setOrgName(s.getShortName());
+                plan.setRoleId(tMonitoringRetrievalPlan.getRoleId());
+                plan.setRoleName(tMonitoringRetrievalPlan.getRoleName());
+                plan.setOrgPath(s.getPath());
+                plan.setOrgType(tMonitoringRetrievalPlan.getOrgType());
+                plan.setPlanCycle(tMonitoringRetrievalPlan.getPlanCycle());
+                plan.setPlanFrequency(tMonitoringRetrievalPlan.getPlanFrequency());
+                plan.setPlanStatus(ZERO);
+                plan.setCreateBy(SecurityUtils.getUsername());
+                plan.setUpdateTime(DateUtils.getNowDate());
+                plan.setUpdateBy(SecurityUtils.getUsername());
+                plan.setCreateTime(DateUtils.getNowDate());
+                plan.setDescription(tMonitoringRetrievalPlan.getDescription());
+                plan.setCreateType(1);
+                plan.setId(tMonitoringRetrievalPlan.getId());
+                plan.setParentId(tMonitoringRetrievalPlan.getId());
+                plan.setIsDistribute("1");
+                //   i = tMonitoringRetrievalPlanMapper.insert(plan);
+                tMonitoringRetrievalPlans.add(plan);
             }
         }
         if (tMonitoringRetrievalPlan.getPlanCycle().equals(ZERO.toString()) && CollectionUtils.isNotEmpty(tMonitoringRetrievalPlans)) {
@@ -253,9 +248,16 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
     public int insertTMonitoringRetrievalPlan(TMonitoringRetrievalPlan tMonitoringRetrievalPlan) {
         tMonitoringRetrievalPlan.setCreateTime(DateUtils.getNowDate());
         SysUser sysUser = remoteUserService.getUserById(SecurityUtils.getUserId(), SecurityConstants.INNER);
-        SysOrg data = remoteOrgService.selectSysOrgById(sysUser.getOrgId(), SecurityConstants.INNER);
+        SysOrg data;
+        if (null != tMonitoringRetrievalPlan.getOrgId()) {
+            data = remoteOrgService.selectSysOrgById(tMonitoringRetrievalPlan.getOrgId(), SecurityConstants.INNER);
+        } else {
+            data = remoteOrgService.selectSysOrgById(sysUser.getOrgId(), SecurityConstants.INNER);
+        }
         tMonitoringRetrievalPlan.setOrgName(data.getShortName());
-        tMonitoringRetrievalPlan.setOrgId(sysUser.getOrgId());
+        if (null == tMonitoringRetrievalPlan.getOrgId()) {
+            tMonitoringRetrievalPlan.setOrgId(sysUser.getOrgId());
+        }
         tMonitoringRetrievalPlan.setCreateBy(SecurityUtils.getUsername());
         tMonitoringRetrievalPlan.setUpdateTime(DateUtils.getNowDate());
         tMonitoringRetrievalPlan.setUpdateBy(SecurityUtils.getUsername());
@@ -265,47 +267,12 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
         tMonitoringRetrievalPlan.setId(id);
         tMonitoringRetrievalPlan.setOrgPath(data.getPath());
         SysOrg sysOrg1 = remoteOrgService.selectSysOrgById(sysUser.getOrgId(), SecurityConstants.INNER);
-
-        if (sysOrg1.getType() == 1) {
-            tMonitoringRetrievalPlan.setCreateType(ZERO);
-            tMonitoringRetrievalPlan.setIsDistribute(ZERO.toString());
-        } else {
-            tMonitoringRetrievalPlan.setIsDistribute("1");
+        if (sysOrg1.getType() == 3) {
             tMonitoringRetrievalPlan.setCreateType(1);
-            SysOrg sysOrg = new SysOrg();
-            sysOrg.setPath(sysOrg1.getPath());
-            sysOrg.setType(Integer.valueOf(tMonitoringRetrievalPlan.getOrgType()));
-            List<SysOrg> sysOrgs = remoteOrgService.listByParentIdAndType(sysOrg, SecurityConstants.INNER);
-            List<TMonitoringRetrievalPlan> tMonitoringRetrievalPlans = new ArrayList<>();
-            for (SysOrg l : sysOrgs) {
-                TMonitoringRetrievalPlan monitoringRetrievalPlan = new TMonitoringRetrievalPlan();
-                BeanUtils.copyProperties(tMonitoringRetrievalPlan, monitoringRetrievalPlan);
-                monitoringRetrievalPlan.setOrgId(l.getId());
-                monitoringRetrievalPlan.setOrgName(l.getShortName());
-                monitoringRetrievalPlan.setRoleId(tMonitoringRetrievalPlan.getRoleId());
-                monitoringRetrievalPlan.setRoleName(tMonitoringRetrievalPlan.getRoleName());
-                monitoringRetrievalPlan.setOrgPath(l.getPath());
-                monitoringRetrievalPlan.setOrgType("6");
-                monitoringRetrievalPlan.setRoleId(tMonitoringRetrievalPlan.getRoleId());
-                monitoringRetrievalPlan.setPlanCycle(tMonitoringRetrievalPlan.getPlanCycle());
-                monitoringRetrievalPlan.setPlanFrequency(tMonitoringRetrievalPlan.getPlanFrequency());
-                monitoringRetrievalPlan.setPlanStatus(ZERO);
-                monitoringRetrievalPlan.setCreateBy(SecurityUtils.getUsername());
-                monitoringRetrievalPlan.setUpdateTime(DateUtils.getNowDate());
-                monitoringRetrievalPlan.setUpdateBy(SecurityUtils.getUsername());
-                monitoringRetrievalPlan.setCreateTime(DateUtils.getNowDate());
-                monitoringRetrievalPlan.setDescription(tMonitoringRetrievalPlan.getDescription());
-                monitoringRetrievalPlan.setCreateType(1);
-                monitoringRetrievalPlan.setId(IdWorker.getId());
-                monitoringRetrievalPlan.setParentId(tMonitoringRetrievalPlan.getId());
-                tMonitoringRetrievalPlanMapper.insert(monitoringRetrievalPlan);
-                tMonitoringRetrievalPlans.add(monitoringRetrievalPlan);
-
-            }
-            if (tMonitoringRetrievalPlan.getPlanCycle().equals(ZERO.toString()) && tMonitoringRetrievalPlan.getPlanStatus() == 0) {
-                iCoreMonitoringRetrievalTaskService.noCycleTask(tMonitoringRetrievalPlans);
-            }
+        } else {
+            tMonitoringRetrievalPlan.setCreateType(ZERO);
         }
+        tMonitoringRetrievalPlan.setIsDistribute(ZERO.toString());
         return tMonitoringRetrievalPlanMapper.insert(tMonitoringRetrievalPlan);
     }
 
@@ -317,31 +284,38 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
      */
     @Override
     public int updateTMonitoringRetrievalPlan(TMonitoringRetrievalPlan tMonitoringRetrievalPlan) {
+        List<CoreMonitoringRetrievalTask> coreMonitoringRetrievalTasks = iCoreMonitoringRetrievalTaskService.selectComplete(tMonitoringRetrievalPlan.getId());
+        if (CollectionUtils.isNotEmpty(coreMonitoringRetrievalTasks)) {
+            throw new ServiceException("下发任务已做完,不能修改");
+        }
+        iCoreMonitoringRetrievalTaskService.updateDeleteTaskByPlanId(tMonitoringRetrievalPlan.getId(), 1);
         tMonitoringRetrievalPlan.setUpdateTime(DateUtils.getNowDate());
         tMonitoringRetrievalPlan.setUpdateBy(SecurityUtils.getUsername());
         TMonitoringRetrievalPlan plan = baseMapper.selectById(tMonitoringRetrievalPlan.getId());
-        if (plan.getPlanStatus() != tMonitoringRetrievalPlan.getPlanStatus()) {
+/*        if (plan.getPlanStatus() != tMonitoringRetrievalPlan.getPlanStatus()) {
             if (tMonitoringRetrievalPlan.getPlanStatus() == 1) {
                 //删除任务
                 iCoreMonitoringRetrievalTaskService.updateDeleteTaskByPlanId(tMonitoringRetrievalPlan.getId(), 1);
                 //禁用子任务
-                if(null==plan.getParentId()){
-                    baseMapper.updatePlanStatus(1,tMonitoringRetrievalPlan.getId());
+                if (null == plan.getParentId()) {
+                    baseMapper.updatePlanStatus(1, tMonitoringRetrievalPlan.getId());
                 }
             } else {
                 //还原任务
                 iCoreMonitoringRetrievalTaskService.updateDeleteTaskByPlanId(tMonitoringRetrievalPlan.getId(), 0);
-                if(null==plan.getParentId()){
-                    baseMapper.updatePlanStatus(0,tMonitoringRetrievalPlan.getId());
+                if (null == plan.getParentId()) {
+                    baseMapper.updatePlanStatus(0, tMonitoringRetrievalPlan.getId());
                 }
             }
-        }
-        if (tMonitoringRetrievalPlan.getOrgType().equals("1")) {
+        }*/
+        BeanUtils.copyProperties(tMonitoringRetrievalPlan, plan);
+ /*       if (tMonitoringRetrievalPlan.getOrgType().equals("1")) {
             tMonitoringRetrievalPlan.setCreateType(ZERO);
         } else {
             tMonitoringRetrievalPlan.setCreateType(1);
-        }
-        return tMonitoringRetrievalPlanMapper.updateById(tMonitoringRetrievalPlan);
+        }*/
+        plan.setIsDistribute("0");
+        return tMonitoringRetrievalPlanMapper.updateById(plan);
     }
 
     /**
@@ -358,40 +332,20 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
             tMonitoringRetrievalPlan.setIsDeleted(2L);
             tMonitoringRetrievalPlan.setId(id);
             TMonitoringRetrievalPlan monitoringRetrievalPlan = tMonitoringRetrievalPlanMapper.selectById(id);
+            List<CoreMonitoringRetrievalTask> coreMonitoringRetrievalTasks = iCoreMonitoringRetrievalTaskService.selectComplete(id);
+            if (CollectionUtils.isNotEmpty(coreMonitoringRetrievalTasks)) {
+                throw new ServiceException("下发任务已做完,不能删除");
+            }
             //如果是下发的任务
-            if (monitoringRetrievalPlan.getParentId() != null) {
+      /*      if (monitoringRetrievalPlan.getParentId() != null) {
                 //不能删除
                 throw new ServiceException("子任务,不能删除");
-            } else {
-                if (monitoringRetrievalPlan.getCreateType() == 0) {
-//                    QueryWrapper queryWrapper = new QueryWrapper();
-//                    queryWrapper.eq(PARENT_ID, monitoringRetrievalPlan.getId());
-//                    List<TMonitoringRetrievalPlan> list = tMonitoringRetrievalPlanMapper.selectList(queryWrapper);
-//                    list.add(monitoringRetrievalPlan);
-//                    List<Long> planIds = new ArrayList<>();
-//                    for (TMonitoringRetrievalPlan p : list) {
-//                        CoreMonitoringRetrievalTask coreMonitoringRetrievalTask = new CoreMonitoringRetrievalTask();
-//                        coreMonitoringRetrievalTask.setPlanId(p.getId());
-//                        coreMonitoringRetrievalTask.setStatus("0");
-//                        //根据计划查询未完成的任务
-//                        List<CoreMonitoringRetrievalTask> coreMonitoringRetrievalTasks = iCoreMonitoringRetrievalTaskService.selectCoreMonitoringRetrievalTaskList(coreMonitoringRetrievalTask);
-//                        List<Long> collect = coreMonitoringRetrievalTasks.stream().map(CoreMonitoringRetrievalTask::getId).distinct().collect(Collectors.toList());
-//                        if (CollectionUtils.isNotEmpty(collect)) {
-//                            planIds.addAll(collect);
-//                        }
-//                        p.setIsDeleted(2L);
-//                        i = tMonitoringRetrievalPlanMapper.updateTMonitoringRetrievalPlan(p);
-//                        if (i < 1) {
-//                            return i;
-//                        }
-//                    }
-//                    Long[] arr = new Long[planIds.size()];
-//                    planIds.toArray(arr);
-//                    iCoreMonitoringRetrievalTaskService.deleteCoreMonitoringRetrievalTaskByIds(arr);
-                    i = tMonitoringRetrievalPlanMapper.updatePlan(monitoringRetrievalPlan);
-                    iCoreMonitoringRetrievalTaskService.deleteWaitTaskByPlanId(id);
-                }
-            }
+            } else {*/
+            //   if (monitoringRetrievalPlan.getCreateType() == 0) {
+            i = tMonitoringRetrievalPlanMapper.updatePlan(monitoringRetrievalPlan);
+            iCoreMonitoringRetrievalTaskService.deleteWaitTaskByPlanId(id);
+            // }
+            // }
         }
         return i;
     }

+ 2 - 3
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/vo/TMonitoringRetrievalPlanVO.java

@@ -12,7 +12,6 @@ import java.util.List;
  */
 @Data
 public class TMonitoringRetrievalPlanVO extends TMonitoringRetrievalPlan {
-    @ApiModelProperty(value = "序号")
-    private Integer no;
-    private List<TMonitoringRetrievalPlanVO> children;
+    @ApiModelProperty(value = "是否可以编辑")
+    private Boolean isEdit;
 }

+ 1 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/mapper/CoreEvaluateTaskContentMapper.java

@@ -14,4 +14,5 @@ import java.util.List;
 @Mapper
 public interface CoreEvaluateTaskContentMapper extends BaseMapper<CoreEvaluateTaskContent> {
   List<CoreEvaluateTaskContent>  selectByTaskId(Long taskId);
+  int deleteByTaskId(Long taskId);
 }

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/service/ICoreEvaluateTaskService.java

@@ -44,7 +44,7 @@ public interface ICoreEvaluateTaskService extends IService<CoreEvaluateTask> {
     /**
      * 修改外包评价任务
      *
-     * @param coreEvaluateTask 外包评价任务
+     * @param evaluateTaskContentDTO 外包评价任务
      * @return 结果
      */
     int updateCoreEvaluateTask(EvaluateTaskContentDTO evaluateTaskContentDTO);

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

@@ -273,6 +273,7 @@ public class CoreEvaluatePlanServiceImpl extends ServiceImpl<CoreEvaluatePlanMap
                 coreEvaluateTask.setCreateBy(coreEvaluatePlan.getCreateBy());
                 coreEvaluateTask.setStartTime(DateUtils.getNowDate());
                 coreEvaluateTask.setEndTime(endTime);
+                coreEvaluateTask.setEvaluateCycle(coreEvaluatePlan.getEvaluateCycle());
                 List<Long> roleList = coreEvaluateRoleMapper.getRoleByEvaluateId(id);
                 StringBuilder sb = new StringBuilder();
                 for (Long r : roleList) {

+ 26 - 12
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/service/impl/CoreEvaluateTaskServiceImpl.java

@@ -21,6 +21,7 @@ import com.xunmei.core.evaluate.mapper.CoreEvaluateTaskContentMapper;
 import com.xunmei.core.evaluate.mapper.CoreEvaluateTaskMapper;
 import com.xunmei.core.evaluate.service.ICoreEvaluatePlanService;
 import com.xunmei.core.evaluate.service.ICoreEvaluateTaskService;
+import com.xunmei.core.evaluate.vo.CoreEvaluateContentVO;
 import com.xunmei.core.evaluate.vo.CoreEvaluatePlanListVO;
 import com.xunmei.core.evaluate.vo.CoreEvaluatePlanVO;
 import com.xunmei.core.evaluate.vo.CoreEvaluateTaskVO;
@@ -81,8 +82,8 @@ public class CoreEvaluateTaskServiceImpl extends ServiceImpl<CoreEvaluateTaskMap
         }
         page = baseMapper.selectPageList(page, evaluateTaskDTO);
         List<CoreEvaluateTaskVO> records = page.getRecords();
-       // List<CoreEvaluateTaskVO> coreEvaluateTaskVOS = new ArrayList<>();
-        for (CoreEvaluateTaskVO c : records) {
+        // List<CoreEvaluateTaskVO> coreEvaluateTaskVOS = new ArrayList<>();
+/*        for (CoreEvaluateTaskVO c : records) {
             CoreEvaluateTaskVO coreEvaluateTaskVO = new CoreEvaluateTaskVO();
             BeanUtils.copyProperties(c, coreEvaluateTaskVO);
             List<Long> roleIds = new ArrayList<>();
@@ -95,7 +96,7 @@ public class CoreEvaluateTaskServiceImpl extends ServiceImpl<CoreEvaluateTaskMap
                 }
             }
      c.setRoleList(roleIds);
-        }
+        }*/
         //抓换为TableDataInfo适配前端
         return TableDataInfo.build(page);
     }
@@ -134,16 +135,29 @@ public class CoreEvaluateTaskServiceImpl extends ServiceImpl<CoreEvaluateTaskMap
         CoreEvaluateTaskVO coreEvaluateTaskVO = new CoreEvaluateTaskVO();
         CoreEvaluateTask coreEvaluateTask = coreEvaluateTaskMapper.selectById(id);
         BeanUtils.copyProperties(coreEvaluateTask, coreEvaluateTaskVO);
-        List<CoreEvaluateContent> coreEvaluateContentList = new ArrayList<>();
+        switch ( coreEvaluateTaskVO.getEvaluateCycle()){
+            case "0":
+                coreEvaluateTaskVO.setEvaluateCycle("每月");
+                break;
+            case "1":
+                coreEvaluateTaskVO.setEvaluateCycle("每季度");
+                break;
+            default:
+                coreEvaluateTaskVO.setEvaluateCycle("每年");
+                break;
+        }
+
+        List<CoreEvaluateTaskContent> coreEvaluateContentList = new ArrayList<>();
+        //已完成
         if (coreEvaluateTask.getStatus().equals("2")) {
-            List<CoreEvaluateTaskContent> coreEvaluateTaskContents = coreEvaluateTaskContentMapper.selectByTaskId(id);
-            for (CoreEvaluateTaskContent c : coreEvaluateTaskContents) {
-                CoreEvaluateContent coreEvaluateContent = new CoreEvaluateContent();
-                BeanUtils.copyProperties(c, coreEvaluateContent);
-                coreEvaluateContentList.add(coreEvaluateContent);
-            }
+            coreEvaluateContentList = coreEvaluateTaskContentMapper.selectByTaskId(id);
         } else {
-            coreEvaluateContentList = coreEvaluateContentMapper.getByEvaluateId(coreEvaluateTask.getPlanId());
+            List<CoreEvaluateContent> byEvaluateId = coreEvaluateContentMapper.getByEvaluateId(coreEvaluateTask.getPlanId());
+            for (CoreEvaluateContent c : byEvaluateId) {
+                CoreEvaluateTaskContent coreEvaluateTaskContent = new CoreEvaluateTaskContent();
+                BeanUtils.copyProperties(c, coreEvaluateTaskContent);
+                coreEvaluateContentList.add(coreEvaluateTaskContent);
+            }
         }
         coreEvaluateTaskVO.setCoreEvaluateContentList(coreEvaluateContentList);
         return coreEvaluateTaskVO;
@@ -185,7 +199,6 @@ public class CoreEvaluateTaskServiceImpl extends ServiceImpl<CoreEvaluateTaskMap
         if (!SecurityUtils.getLoginUser().getOrgId().equals(coreEvaluateTask.getOrgId())) {
             throw new RuntimeException("您没有该任务的评价权限");
         }
-        // CoreEvaluatePlanVO coreEvaluatePlanVO = coreEvaluatePlanService.selectCoreEvaluatePlanById(coreEvaluateTask.getPlanId());
         List<Long> roleByEvaluateId = coreEvaluateRoleMapper.getRoleByEvaluateId(coreEvaluateTask.getPlanId());
         List<SysRole> roleByUserId = remoteRoleService.getRoleByUserId(SecurityUtils.getUserId(), SecurityConstants.INNER);
         List<Long> collect = roleByUserId.stream().map(SysRole::getId).collect(Collectors.toList());
@@ -201,6 +214,7 @@ public class CoreEvaluateTaskServiceImpl extends ServiceImpl<CoreEvaluateTaskMap
         if (!admin) {
             throw new RuntimeException("您没有该任务的评价权限");
         }
+        coreEvaluateTaskContentMapper.deleteByTaskId(evaluateTaskContentDTO.getId());
         evaluateTaskContentDTO.getCoreEvaluateTaskContentList().forEach(e -> {
             e.setTaskId(evaluateTaskContentDTO.getId());
             coreEvaluateTaskContentMapper.insert(e);

+ 21 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/vo/CoreEvaluateContentVO.java

@@ -0,0 +1,21 @@
+package com.xunmei.core.evaluate.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author :LuoWei
+ * @date : 2023/10/13
+ */
+@Data
+public class CoreEvaluateContentVO {
+    @ApiModelProperty(value = "前端id")
+    private String uId;
+    @ApiModelProperty(value = "编号")
+    private Long code;
+    @ApiModelProperty(value = "内容类型")
+    private String contentType;
+    @ApiModelProperty(value = "内容")
+    private String content;
+    private String score;
+}

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

@@ -42,4 +42,5 @@ public class CoreEvaluatePlanVO {
     private String evaluateCycle;
     @ApiModelProperty(value = "内容")
     private List<CoreEvaluateContent> coreEvaluateContentList;
+
 }

+ 4 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/vo/CoreEvaluateTaskVO.java

@@ -2,6 +2,8 @@ package com.xunmei.core.evaluate.vo;
 
 import com.xunmei.core.evaluate.domain.CoreEvaluateContent;
 import com.xunmei.core.evaluate.domain.CoreEvaluateTask;
+import com.xunmei.core.evaluate.domain.CoreEvaluateTaskContent;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.util.List;
@@ -12,6 +14,6 @@ import java.util.List;
  */
 @Data
 public class CoreEvaluateTaskVO extends CoreEvaluateTask {
-    List<CoreEvaluateContent> coreEvaluateContentList;
-    List<Long>roleList;
+    @ApiModelProperty(value = "内容")
+    List<CoreEvaluateTaskContent> coreEvaluateContentList;
 }

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/retrieval/mapper/CoreMonitoringRetrievalTaskMapper.java

@@ -99,7 +99,7 @@ public interface CoreMonitoringRetrievalTaskMapper extends BaseMapper<CoreMonito
     List<Long>selectTaskByTime(String dateTime);
     void deleteTaskByPlanId(@Param("planId") Long planId);
 
-
+    List<CoreMonitoringRetrievalTask> selectCompleteByPlanId(Long planId);
     void deleteWaitTaskByPlanId(@Param("planId") Long planId);
 
     void updateDeleteTaskByPlanId(@Param("planId") Long planId, @Param("isDeleted") Integer isDeleted);

+ 6 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/retrieval/service/ICoreMonitoringRetrievalTaskService.java

@@ -33,6 +33,12 @@ public interface ICoreMonitoringRetrievalTaskService extends IService<CoreMonito
     public CoreMonitoringRetrievalTask selectCoreMonitoringRetrievalTaskById(Long id);
 
     /**
+     * 根据计划id查询已完成任务
+     * @param planId
+     * @return
+     */
+    public List<CoreMonitoringRetrievalTask>selectComplete(Long planId);
+    /**
      * 查询监控调阅任务列表
      *
      * @param CoreMonitoringRetrievalTask 监控调阅任务

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

@@ -159,6 +159,12 @@ public class CoreMonitoringRetrievalTaskServiceImpl extends ServiceImpl<CoreMoni
         return coreMonitoringRetrievalTaskMapper.selectById(id);
     }
 
+    @Override
+    public List<CoreMonitoringRetrievalTask> selectComplete(Long planId) {
+
+        return coreMonitoringRetrievalTaskMapper.selectCompleteByPlanId(planId);
+    }
+
     /**
      * 查询监控调阅任务列表
      *

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/weather/controller/WeatherWarningController.java

@@ -11,7 +11,7 @@ import com.xunmei.common.core.web.domain.AjaxResult;
 import com.xunmei.common.core.web.page.TableDataInfo;
 import com.xunmei.common.security.annotation.InnerAuth;
 import com.xunmei.common.security.annotation.RequiresPermissions;
-import com.xunmei.core.access.vo.TMonitoringRetrievalPlanVO;
+
 import com.xunmei.core.weather.service.IWeatherWarningService;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.web.bind.annotation.*;

+ 3 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/evaluate/CoreEvaluateTaskContentMapper.xml

@@ -3,6 +3,9 @@
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.xunmei.core.evaluate.mapper.CoreEvaluateTaskContentMapper">
+    <delete id="deleteByTaskId">
+        DELETE FROM core_evaluate_task_content WHERE task_id=#{taskId}
+    </delete>
 
 
     <select id="selectByTaskId" resultType="com.xunmei.core.evaluate.domain.CoreEvaluateTaskContent">

+ 10 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/retrieval/CoreMonitoringRetrievalTaskMapper.xml

@@ -483,4 +483,14 @@
                              where i.situation = 1) t1 on trm.id=t1.mid
         where t.plan_end_time <![CDATA[<]]> #{time}
     </select>
+    <select id="selectCompleteByPlanId"
+            resultType="com.xunmei.common.core.domain.retrieval.domain.CoreMonitoringRetrievalTask">
+        SELECT
+            *
+        FROM
+            core_monitoring_retrieval_task
+        WHERE
+            plan_id = #{planId}
+          AND `status` =2
+    </select>
 </mapper>

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

@@ -274,7 +274,7 @@ public class SysDeviceServiceImpl extends ServiceImpl<SysDeviceMapper, SysDevice
             remoteProtectionService.addByDevice(protectionDTO, SecurityConstants.INNER);
         }
         SysDevice sysDevice1 = this.checkName(sysDevice.getOrgId(), sysDevice.getDeviceName());
-        if (null != sysDevice1) {
+        if (null != sysDevice1 && !sysDevice1.getId().equals(sysDevice.getId())) {
             throw new RuntimeException("设备名称重复");
         }
         return sysDeviceMapper.updateById(sysDevice);