Răsfoiți Sursa

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

jingyuanchao 1 an în urmă
părinte
comite
60ac5ac51a

+ 3 - 0
project_data/sql/0.0.5/soc/soc.sql

@@ -124,3 +124,6 @@ VALUES (10, '监控中心', '10', 'monitor_org', null, 'default', 'N', '0',  nul
 delete  from `sys_menu` where  id=01719892877586239490;
 INSERT INTO `sys_menu` (`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
 VALUES (01719892877586239490, '外包履职评价统计表', 1719287834364436482, 2, 'evaluateTable', 'evaluateTable/index', NULL, 1, 1, 'C', '0', '0', 'core:evaluateTask:statistics', '1', 'chart', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
+
+
+UPDATE sys_menu set menu_type='C',perms='appquestion:list' WHERE platform_type=0 and menu_name='隐患问题清单';

+ 3 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/mapper/QuestionFlowMapper.java

@@ -4,6 +4,7 @@ import java.util.List;
 
 import com.xunmei.core.question.domain.QuestionFlow;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 隐患问题审批流程Mapper接口
@@ -59,4 +60,6 @@ public interface QuestionFlowMapper extends BaseMapper<QuestionFlow> {
      * @return 结果
      */
     int deleteCoreQuestionFlowByIds(Long[] ids);
+
+    int deleteBySrc(@Param("srcType") int srcType,@Param("taskIds") List<Long> taskIds);
 }

+ 9 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/service/IQuestionService.java

@@ -5,6 +5,7 @@ import com.xunmei.common.core.domain.panel.dto.PanelListDto;
 import com.xunmei.common.core.domain.panel.vo.PanelListVo;
 import com.xunmei.common.core.domain.panel.vo.WebPanelResult;
 import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.core.question.QuestionSrcType;
 import com.xunmei.core.question.domain.Question;
 import com.xunmei.core.question.dto.QuestionConfirmDto;
 import com.xunmei.core.question.dto.QuestionPageDto;
@@ -40,6 +41,14 @@ public interface IQuestionService extends IService<Question> {
     Question handleQuestion(Question question);
 
     /**
+     * 按任务删除问题
+     * @param srcType
+     * @param taskIds
+     * @return
+     */
+    int delete(QuestionSrcType srcType,List<Long> taskIds);
+
+    /**
      * 查询隐患问题清单分页数据
      *
      * @param query  查询条件对象

+ 25 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/service/impl/QuestionServiceImpl.java

@@ -3,6 +3,7 @@ package com.xunmei.core.question.service.impl;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.util.CollectionUtils;
 import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.C;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -221,6 +222,28 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
     }
 
     /**
+     * 按任务删除问题
+     *
+     * @param srcType
+     * @param taskIds
+     * @return
+     */
+    @Override
+    public int delete(QuestionSrcType srcType, List<Long> taskIds) {
+        if (ObjectUtil.isNull(srcType) || CollectionUtils.isEmpty(taskIds)) {
+            return 0;
+        }
+
+        questionFlowMapper.deleteBySrc(srcType.getValue(), taskIds);
+
+        LambdaQueryWrapper<Question> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(Question::getSrcType, srcType.getValue())
+                .in(Question::getSrcTaskId, taskIds);
+
+        return baseMapper.delete(wrapper);
+    }
+
+    /**
      * 确认
      *
      * @return
@@ -418,7 +441,8 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
         }
 
         if (ownPermission.contains(dissentButton)) {
-            wrapper.or(w -> w.eq(Question::getSubmitorId, SecurityUtils.getUserId()).eq(Question::getConfirmStatus, QuestionConfirmEnum.Dissent.getValue()));
+            wrapper.or(w -> w.eq(Question::getSubmitorId, SecurityUtils.getUserId())
+                    .eq(Question::getConfirmStatus, QuestionConfirmEnum.Dissent.getValue()));
         }
 
         return wrapper;

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

@@ -4,6 +4,7 @@ import com.xunmei.common.core.web.domain.PageDto;
 import com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordPageVo;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.apache.http.annotation.Obsolete;
 
 import javax.validation.constraints.NotNull;
 import java.util.Date;
@@ -35,9 +36,16 @@ public class ResumptionRecordPageDto extends PageDto<ResumptionRecordPageVo> {
     @ApiModelProperty(value = "机构id")
     private Long orgId;
 
+    /**
+     * 需求变更,暂无此条件
+     */
     @ApiModelProperty(value = "计划id")
+    @Obsolete
     private Long planId;
 
+    @ApiModelProperty(value = "任务名称")
+    private String taskName;
+
     private List<Long> orgIdList;
 
     private String  orgPath;

+ 38 - 20
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppPlanServiceImpl.java

@@ -28,6 +28,8 @@ import com.xunmei.common.core.utils.DateUtils;
 import com.xunmei.common.core.utils.IDHelper;
 import com.xunmei.common.core.web.domain.AjaxResult;
 import com.xunmei.common.security.utils.SecurityUtils;
+import com.xunmei.core.question.QuestionSrcType;
+import com.xunmei.core.question.service.IQuestionService;
 import com.xunmei.core.registerbook.service.ICoreRegisterBookPdfService;
 import com.xunmei.core.resumption.domain.*;
 import com.xunmei.core.resumption.dto.DistributeDto;
@@ -103,6 +105,9 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
     @Autowired
     ICoreRegisterBookPdfService coreRegisterBookPdfService;
 
+    @Autowired
+    IQuestionService questionService;
+
     @Override
     public List<Long> selectItemIdsByPlanId(Long id) {
         return appPlanToItemMapper.selectItemIdsByPlanId(id);
@@ -120,24 +125,33 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
         Page<ResumptionPlanPageVo> result = info.getPageDto();
         result = baseMapper.selectPage(result, info);
         for (ResumptionPlanPageVo record : result.getRecords()) {
-            if (ObjectUtil.equal(record.getPlanStatus(), PlanStatus.DRAFT.getCode())) {
-                record.setHasTaskCurrentCycle(false);
-            } else if (ObjectUtil.equal(record.getPlanStatus(), PlanStatus.USING.getCode())) {
-                record.setHasTaskCurrentCycle(!new Date().before(record.getEffectiveTime()));
-            } else if (ObjectUtil.equal(record.getPlanStatus(), PlanStatus.DELETED.getCode())) {
-                if (ObjectUtil.isNull(record.getEffectiveTime()) || ObjectUtil.isNull(record.getWithdrawTime())) {
-                    record.setHasTaskCurrentCycle(false);
-                } else {
-                    boolean b = !new Date().before(record.getEffectiveTime());
-                    DateRange dr = DateUtils.getStartAndEnd(new Date(), record.getPlanCycle());
-                    b &= (!record.getWithdrawTime().before(dr.getStartTime()));
-                    record.setHasTaskCurrentCycle(b);
-                }
-            }
+            Boolean b = getHasTaskCurrentCycle(record.getPlanStatus(), record.getPlanCycle(), record.getEffectiveTime(), record.getWithdrawTime());
+            record.setHasTaskCurrentCycle(b);
         }
         return result;
     }
 
+    private Boolean getHasTaskCurrentCycle(Integer planStatus, Integer planCycle, Date effectiveTime, Date withDrawTime) {
+        if (ObjectUtil.equal(planStatus, PlanStatus.DRAFT.getCode())) {
+            return false;
+        } else if (ObjectUtil.equal(planStatus, PlanStatus.USING.getCode())) {
+            return !new Date().before(effectiveTime);
+        } else if (ObjectUtil.equal(planStatus, PlanStatus.DELETED.getCode())) {
+            return true;
+            //匆删,按需求撤回状态的要提示。
+//            if (ObjectUtil.isNull(effectiveTime) || ObjectUtil.isNull(withDrawTime)) {
+//                return false;
+//            } else {
+//                boolean b = !new Date().before(effectiveTime);
+//                DateRange dr = DateUtils.getStartAndEnd(new Date(), planCycle);
+//                b &= (!withDrawTime.before(dr.getStartTime()));
+//                return b;
+//            }
+        } else {
+            return false;
+        }
+    }
+
     @Override
     public List<Long> findExecOrgByPlan(Long plan_id) {
         return baseMapper.findExecOrgByPlan(plan_id);
@@ -414,6 +428,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
         for (Long completedId : completedIds) {
             coreRegisterBookPdfService.deleteWithFile(completedId);
         }
+        questionService.delete(QuestionSrcType.Resumption, completedIds);
     }
 
     /**
@@ -558,7 +573,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 
                     child = baseMapper.selectById(newChildPlanId);
                 }
-                if (needRebuildOnEdit(child)) {
+                if (needRebuildOnEdit(existPlan)) {
                     needRebuildPlans.add(child);
                 }
 
@@ -698,8 +713,6 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 
                 appPlanToExecOrgMapper.insert(execOrg);
             }
-            //更新任务的名称
-            resumptionMapper.updateNameByPlanId(existPlan.getPlanName(), app.getPlanName(), app.getId());
 
             //最后处理本计划
             plan.setUpdateTime(new Date());
@@ -711,7 +724,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
             plan.setPlanCreateOrgName(null);
             baseMapper.updateById(plan);
 
-            if (needRebuildOnEdit(plan)) {
+            if (needRebuildOnEdit(existPlan)) {
                 needRebuildPlans.add(baseMapper.selectById(plan.getId()));
             }
             resumptionTaskBusiness.rebuildCurrentCycleTask(needRebuildPlans);
@@ -766,8 +779,9 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
      * @return
      */
     private Boolean needRebuildOnEdit(AppPlan plan) {
-        if (ObjectUtil.equal(plan.getPlanStatus(), PlanStatus.USING.getCode()) && ObjectUtil.equal(plan.getPlanOfOrgType(), OrgTypeEnum.HANG_SHE.getCode())
-                && (ObjectUtil.isNull(plan.getTaskHasCompleted()) || ObjectUtil.equal(plan.getPlanStatus(), 0))
+        if (ObjectUtil.equal(plan.getPlanStatus(), PlanStatus.USING.getCode())
+                && ObjectUtil.equal(plan.getPlanOfOrgType(), OrgTypeEnum.HANG_SHE.getCode())
+                && (ObjectUtil.isNull(plan.getTaskHasCompleted()) || ObjectUtil.equal(plan.getTaskHasCompleted(), 0))
                 && !new Date().before(plan.getEffectiveTime())) {
             return true;
         }
@@ -849,6 +863,9 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
     @Transactional(rollbackFor = Exception.class)
     public void deleted(Long id) throws Exception {
         AppPlan plan = baseMapper.selectById(id);
+        if (ObjectUtil.isNull(plan)) {
+            throw new ServiceException("任务不存在");
+        }
         List<AppPlan> plans = baseMapper.selectList(new LambdaQueryWrapper<AppPlan>()
                 .eq(AppPlan::getId, id).or().eq(AppPlan::getParentId, id)
                 .select(AppPlan::getId, AppPlan::getSolidId));
@@ -909,6 +926,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
         plan.setPlanOfOrgId(app.getPlanOfOrgId());
         plan.setPlanOfOrgType(app.getPlanOfOrgType());
         plan.setTaskHasCompleted(app.getTaskHasCompleted());
+        plan.setHasTaskCurrentCycle(getHasTaskCurrentCycle(app.getPlanStatus(), app.getPlanCycle(), app.getEffectiveTime(), app.getWithdrawTime()));
         return plan;
     }
 

+ 3 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/appPlan/AppPlanVo.java

@@ -104,6 +104,9 @@ public class AppPlanVo extends PageDto<AppPlan> {
      */
     private Integer notResumptionOnRest;
 
+    @ApiModelProperty("查询时间所在的周期是否有任务")
+    private Boolean hasTaskCurrentCycle;
+
     /**
      * 要点列表
      */

+ 33 - 32
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/CoreSafecheckPlanServiceImpl.java

@@ -27,6 +27,8 @@ import com.xunmei.common.core.exception.SystemException;
 import com.xunmei.common.core.utils.DateHelper;
 import com.xunmei.common.core.utils.DateUtils;
 import com.xunmei.common.security.utils.SecurityUtils;
+import com.xunmei.core.question.QuestionSrcType;
+import com.xunmei.core.question.service.IQuestionService;
 import com.xunmei.core.registerbook.service.ICoreRegisterBookPdfService;
 import com.xunmei.core.resumption.domain.AppPlan;
 import com.xunmei.core.resumption.domain.Resumption;
@@ -98,6 +100,9 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
     ICoreRegisterBookPdfService coreRegisterBookPdfService;
 
     @Autowired
+    IQuestionService questionService;
+
+    @Autowired
     private CoreSafecheckPlanToCheckOrgTypeMapper coreSafecheckPlanToCheckOrgTypeMapper;
 
     @Override
@@ -115,42 +120,33 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
         //获取数据
         page = coreSafecheckPlanMapper.selectCoreSafecheckPlanPage(page, coreSafecheckPlan);
         for (CoreSafecheckPlan record : page.getRecords()) {
-            if (ObjectUtil.equal(record.getPlanStatus(), PlanStatus.DRAFT.getCode())) {
-                record.setHasTaskCurrentCycle(false);
-            } else if (ObjectUtil.equal(record.getPlanStatus(), PlanStatus.USING.getCode())) {
-                record.setHasTaskCurrentCycle(!new Date().before(record.getEffectiveTime()));
-            } else if (ObjectUtil.equal(record.getPlanStatus(), PlanStatus.DELETED.getCode())) {
-                if (ObjectUtil.isNull(record.getEffectiveTime()) || ObjectUtil.isNull(record.getWithdrawTime())) {
-                    record.setHasTaskCurrentCycle(false);
-                } else {
-                    boolean b = !new Date().before(record.getEffectiveTime());
-                    DateRange dr = DateUtils.getStartAndEnd(new Date(), record.getPlanCycle());
-                    b &= (!record.getWithdrawTime().before(dr.getStartTime()));
-                    record.setHasTaskCurrentCycle(b);
-                }
-            }
+            Boolean b = getHasTaskCurrentCycle(record.getPlanStatus(), record.getPlanCycle(), record.getEffectiveTime(), record.getWithdrawTime());
+            record.setHasTaskCurrentCycle(b);
         }
 
-//        coreSafecheckPlan.setParentIds(page.getRecords().stream().map(CoreSafecheckPlan::getId).collect(Collectors.toList()));
-//        List<CoreSafecheckPlan> allChildren = new ArrayList<>();
-//        if (CollectionUtil.isNotEmpty(coreSafecheckPlan.getParentIds())) {
-//            allChildren = baseMapper.selectChildren(coreSafecheckPlan);
-//        }
-//        Long order = ((coreSafecheckPlan.getPageNum() - 1) * coreSafecheckPlan.getPageSize()) + 1;
-//        for (CoreSafecheckPlan r : page.getRecords()) {
-//            r.setIndex(order++);
-//            Long childOrder = 1L;
-//            List<CoreSafecheckPlan> children = allChildren.stream().filter(c -> ObjectUtil.equal(c.getParentId(), r.getId())).collect(Collectors.toList());
-//            for (CoreSafecheckPlan child : children) {
-//
-//                child.setIndex(childOrder++);
-//            }
-//            r.setChildren(children);
-//        }
         //抓换为TableDataInfo适配前端
         return TableDataInfo.build(page);
+    }
 
-
+    private Boolean getHasTaskCurrentCycle(Integer planStatus, Integer planCycle, Date effectiveTime, Date withDrawTime) {
+        if (ObjectUtil.equal(planStatus, PlanStatus.DRAFT.getCode())) {
+            return false;
+        } else if (ObjectUtil.equal(planStatus, PlanStatus.USING.getCode())) {
+            return !new Date().before(effectiveTime);
+        } else if (ObjectUtil.equal(planStatus, PlanStatus.DELETED.getCode())) {
+            return true;
+            //匆删,按需求撤回状态的要提示。
+//            if (ObjectUtil.isNull(effectiveTime) || ObjectUtil.isNull(withDrawTime)) {
+//                return false;
+//            } else {
+//                boolean b = !new Date().before(effectiveTime);
+//                DateRange dr = DateUtils.getStartAndEnd(new Date(), planCycle);
+//                b &= (!withDrawTime.before(dr.getStartTime()));
+//                return b;
+//            }
+        } else {
+            return false;
+        }
     }
 
     @Override
@@ -472,6 +468,8 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
         for (Long completedId : completedIds) {
             coreRegisterBookPdfService.deleteWithFile(completedId);
         }
+
+        questionService.delete(QuestionSrcType.SafetyCheck,completedIds);
     }
 
     /**
@@ -503,6 +501,9 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
         CoreSafecheckPlan plan = coreSafecheckPlanMapper.selectOne(new LambdaQueryWrapper<CoreSafecheckPlan>().eq(CoreSafecheckPlan::getId, coreSafecheckPlan.getParentId()).eq(CoreSafecheckPlan::getIsDeleted, 0));
         //如果没获取到父计划则默认最低为1
         coreSafecheckPlan.setParentCount(Math.toIntExact(plan == null ? 1 : plan.getCount()));
+        Boolean b = getHasTaskCurrentCycle(coreSafecheckPlan.getPlanStatus(), coreSafecheckPlan.getPlanCycle(),
+                coreSafecheckPlan.getEffectiveTime(), coreSafecheckPlan.getWithdrawTime());
+        coreSafecheckPlan.setHasTaskCurrentCycle(b);
         return coreSafecheckPlan;
     }
 
@@ -807,7 +808,7 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
     private Boolean needRebuildOnEdit(CoreSafecheckPlan plan, Integer planStatus) {
         if (ObjectUtil.equal(planStatus, PlanStatus.USING.getCode())
                 && (ObjectUtil.equal(plan.getPlanOfOrgType(), OrgTypeEnum.HANG_SHE.getCode()) || ObjectUtil.equal(plan.getExecOrgType(), OrgTypeEnum.BAN_SHI_CHU.getCode()) || ObjectUtil.equal(plan.getExecOrgType(), OrgTypeEnum.SHEGN_LIAN_SHE.getCode()))
-                && (ObjectUtil.isNull(plan.getTaskHasCompleted()) || ObjectUtil.equal(plan.getPlanStatus(), 0))
+                && (ObjectUtil.isNull(plan.getTaskHasCompleted()) || ObjectUtil.equal(plan.getTaskHasCompleted(), 0))
                 && !new Date().before(plan.getEffectiveTime())) {
             return true;
         }

+ 8 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/question/QuestionFlowMapper.xml

@@ -122,4 +122,12 @@
             #{id}
         </foreach>
     </delete>
+
+    <delete id="deleteBySrc">
+        delete  from core_question_flow where  question_id in (
+            select  id from core_question where src_type=#{srcType} and src_task_id in
+        <foreach collection="taskIds" item="taskId" close=")" open="(" separator=",">
+            #{taskId}
+        </foreach> )
+    </delete>
 </mapper>

+ 51 - 47
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/ResumptionRecordMapper.xml

@@ -130,16 +130,16 @@
                     #{item}
                 </foreach>
                 and ((
-                #{hashMap.startDate}  &lt;= r.plan_start_time
+                #{hashMap.startDate} &lt;= r.plan_start_time
                 and #{hashMap.endDate} >= r.plan_start_time
                 )
                 or (
-                #{hashMap.startDate}   &lt;= r.plan_end_time
+                #{hashMap.startDate} &lt;= r.plan_end_time
                 and #{hashMap.endDate} >= r.plan_end_time
                 )
                 or (
                 #{hashMap.startDate} >= r.plan_start_time
-                and #{hashMap.endDate} &lt;=  r.plan_end_time
+                and #{hashMap.endDate} &lt;= r.plan_end_time
                 ))
             </if>
             <if test="pageDto.status !=null ">
@@ -154,16 +154,18 @@
                     #{orgId}
                 </foreach>
             </if>
+            <if test="pageDto.taskName!=null and pageDto.taskName.length()>0">
+                and r.name like concat('%',#{pageDto.taskName},'%')
+            </if>
             <if test="pageDto.executeRole !=null ">
                 and r.plan_id in (select plan_id from core_resumption_plan_to_role where role_id=#{pageDto.executeRole})
             </if>
-            <if test="pageDto.planId !=null ">
-                and r.parent_plan_id = #{pageDto.planId}
-            </if>
+            <!--            <if test="pageDto.planId !=null ">-->
+            <!--                and r.parent_plan_id = #{pageDto.planId}-->
+            <!--            </if>-->
             <!--            <if test="pageDto.checkSub == true">-->
             <!--                and o.path like concat(#{pageDto.orgPath},'%')-->
             <!--            </if>-->
-
         </where>
         order by r.plan_start_time desc, r.name desc ,r.id desc
     </select>
@@ -207,16 +209,16 @@
                        where pti.plan_id in (select plan_id from core_resumption where id = #{resumptionId}))
     </select>
 
-<!--    <select id="selectResumptionRole" resultType="com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRoleVo">-->
-<!--        select distinct tr.id as id, tr.name as name-->
-<!--        from core_resumption r-->
-<!--        inner join sys_role tr on r.role_id = tr.id-->
-<!--        inner join sys_org o on r.org_id = o.id and o.deleted=0-->
-<!--        where o.path like concat(#{roleDto.orgPath},'%')-->
-<!--        <if test="roleDto.type != null">-->
-<!--            and r.type = #{roleDto.type}-->
-<!--        </if>-->
-<!--    </select>-->
+    <!--    <select id="selectResumptionRole" resultType="com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRoleVo">-->
+    <!--        select distinct tr.id as id, tr.name as name-->
+    <!--        from core_resumption r-->
+    <!--        inner join sys_role tr on r.role_id = tr.id-->
+    <!--        inner join sys_org o on r.org_id = o.id and o.deleted=0-->
+    <!--        where o.path like concat(#{roleDto.orgPath},'%')-->
+    <!--        <if test="roleDto.type != null">-->
+    <!--            and r.type = #{roleDto.type}-->
+    <!--        </if>-->
+    <!--    </select>-->
 
     <select id="selectNFCRecord" resultType="com.xunmei.core.resumption.vo.resumptionRecord.NFCRecordVo">
         select distinct a.name as areaName,
@@ -265,24 +267,24 @@
     <!--    </select>-->
 
     <select id="selectDataInfo" resultType="com.xunmei.core.resumption.vo.resumptionRecord.AppResumptionDataInfoVo">
-        SELECT p.name  AS pointName,
-               case a.`name` when null then '其它' else a.`name` end      AS areaName,
-               ch.check_name as check_name,
-               d.res_value   AS executeResult,
-               d.submit_time AS executeTime,
-               d.res_remark  AS resRemark,
-               d.res_status  AS executeStatus,
-               d.id          AS dataId,
+        SELECT p.name                                              AS pointName,
+               case a.`name` when null then '其它' else a.`name` end AS areaName,
+               ch.check_name                                       as check_name,
+               d.res_value                                         AS executeResult,
+               d.submit_time                                       AS executeTime,
+               d.res_remark                                        AS resRemark,
+               d.res_status                                        AS executeStatus,
+               d.id                                                AS dataId,
                d.item_id,
                d.res_value,
                d.submit_name
         FROM core_resumption_data d
                  INNER JOIN core_resumption_rule_point p ON d.item_id = p.id
                  LEFT JOIN sys_area a ON a.id = d.area_id
-                 LEFT JOIN sys_area_check ch on ch.id=d.check_id
+                 LEFT JOIN sys_area_check ch on ch.id = d.check_id
         WHERE d.resumption_id = #{resumptionId}
           and p.item_id = #{ruleItemId}
-            order by d.item_id
+        order by d.item_id
     </select>
 
     <select id="selectRuleItemIdList" resultType="java.lang.Long">
@@ -306,24 +308,24 @@
         where id = #{ruleItemId}
     </select>
 
-<!--    <select id="selectResumptionPlan" resultType="com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRoleVo">-->
-<!--        select distinct p.id as id, p.plan_name as name, p.plan_status as status-->
-<!--        from core_resumption_plan p INNER JOIN core_resumption r on r.plan_id = p.id and p.plan_type = 0-->
-<!--        inner join core_resumption_plan_to_role pr on p.id = pr.plan_id-->
-<!--        INNER JOIN sys_org o on o.id=r.org_id-->
-<!--        where o.path like concat(#{planDto.orgPath},'%')-->
-<!--        <choose>-->
-<!--            <when test="planDto.type != null and planDto.type ==0">-->
-<!--                and r.type in (0,6)-->
-<!--            </when>-->
-<!--            <otherwise>-->
-<!--                and r.type = #{planDto.type}-->
-<!--            </otherwise>-->
-<!--        </choose>-->
-<!--        <if test="planDto.roleId != null">-->
-<!--            and pr.role_id = #{planDto.roleId}-->
-<!--        </if>-->
-<!--    </select>-->
+    <!--    <select id="selectResumptionPlan" resultType="com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRoleVo">-->
+    <!--        select distinct p.id as id, p.plan_name as name, p.plan_status as status-->
+    <!--        from core_resumption_plan p INNER JOIN core_resumption r on r.plan_id = p.id and p.plan_type = 0-->
+    <!--        inner join core_resumption_plan_to_role pr on p.id = pr.plan_id-->
+    <!--        INNER JOIN sys_org o on o.id=r.org_id-->
+    <!--        where o.path like concat(#{planDto.orgPath},'%')-->
+    <!--        <choose>-->
+    <!--            <when test="planDto.type != null and planDto.type ==0">-->
+    <!--                and r.type in (0,6)-->
+    <!--            </when>-->
+    <!--            <otherwise>-->
+    <!--                and r.type = #{planDto.type}-->
+    <!--            </otherwise>-->
+    <!--        </choose>-->
+    <!--        <if test="planDto.roleId != null">-->
+    <!--            and pr.role_id = #{planDto.roleId}-->
+    <!--        </if>-->
+    <!--    </select>-->
 
     <!--    <select id="selectData" resultType="com.xunmei.core.resumption.vo.registerBook.RegisterBookItemInfoVo">-->
     <!--        select distinct o.name as orgName, r.start_time as date, #{id} as resumptionId-->
@@ -385,7 +387,8 @@
                 #{id}
             </foreach>
             or p.plan_create_org_id in (select id from sys_org
-            where type in ('1','2','3','4','11') and deleted=0 and path like concat((select path from sys_org where id=#{query.orgId}),'%'))
+            where type in ('1','2','3','4','11') and deleted=0 and path like concat((select path from sys_org where
+            id=#{query.orgId}),'%'))
             )
         </if>
     </select>
@@ -405,7 +408,8 @@
                 #{id}
             </foreach>
             or plan_create_org_id in (select id from sys_org
-            where type in ('1','2','3') and deleted=0 and path like concat((select path from sys_org where id=#{query.orgId}),'%'))
+            where type in ('1','2','3') and deleted=0 and path like concat((select path from sys_org where
+            id=#{query.orgId}),'%'))
             )
         </if>
     </select>

+ 2 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysWorkTimeSetServiceImpl.java

@@ -131,6 +131,8 @@ public class SysWorkTimeSetServiceImpl extends ServiceImpl<SysWorkTimeSetMapper,
             sysWorkTimeSet.setOrgId(null);
             //添加in条件
             query.in("t.org_id", ids);
+        }else{
+            query.eq("t.org_id",sysWorkTimeSet.getOrgId());
         }
         if(sysWorkTimeSet.getOrgType()!=null){
             query.eq("o.type", sysWorkTimeSet.getOrgType());