Переглянути джерело

履职定时任务业务部分

luojun 2 роки тому
батько
коміт
12cd4f20e9
22 змінених файлів з 290 додано та 22 видалено
  1. 4 1
      soc-modules/soc-modules-system/src/main/java/com/xunmei/resumption/domain/SysResumption.java
  2. 2 1
      soc-modules/soc-modules-system/src/main/java/com/xunmei/resumption/mapper/AppRulePointMapper.java
  3. 7 0
      soc-modules/soc-modules-system/src/main/java/com/xunmei/resumption/mapper/SysResumptionMapper.java
  4. 2 1
      soc-modules/soc-modules-system/src/main/java/com/xunmei/resumption/service/IAppRulePointService.java
  5. 12 1
      soc-modules/soc-modules-system/src/main/java/com/xunmei/resumption/service/ISysResumptionService.java
  6. 5 4
      soc-modules/soc-modules-system/src/main/java/com/xunmei/resumption/service/impl/AppRulePointServiceImpl.java
  7. 177 4
      soc-modules/soc-modules-system/src/main/java/com/xunmei/resumption/service/impl/SysResumptionServiceImpl.java
  8. 11 1
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/domain/SysConfig.java
  9. 1 0
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/mapper/SysConfigMapper.java
  10. 2 0
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/mapper/SysOrgMapper.java
  11. 1 0
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/mapper/SysWorkTimeMapper.java
  12. 1 0
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/ISysConfigService.java
  13. 1 0
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/ISysOrgService.java
  14. 3 1
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/ISysWorkTimeService.java
  15. 4 1
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysConfigServiceImpl.java
  16. 4 1
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysOrgServiceImpl.java
  17. 18 4
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysWorkTimeServiceImpl.java
  18. 7 1
      soc-modules/soc-modules-system/src/main/resources/mapper/resumption/AppRulePointMapper.xml
  19. 19 0
      soc-modules/soc-modules-system/src/main/resources/mapper/resumption/SysResumptionMapper.xml
  20. 1 1
      soc-modules/soc-modules-system/src/main/resources/mapper/system/SysConfigMapper.xml
  21. 4 0
      soc-modules/soc-modules-system/src/main/resources/mapper/system/SysOrgMapper.xml
  22. 4 0
      soc-modules/soc-modules-system/src/main/resources/mapper/system/SysWorkTimeMapper.xml

+ 4 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/resumption/domain/SysResumption.java

@@ -2,7 +2,9 @@ package com.xunmei.resumption.domain;
 
 import java.util.Date;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.xunmei.system.util.Ymd;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
@@ -33,7 +35,8 @@ public class SysResumption extends BaseEntity {
      * $column.columnComment
      */
     private String id;
-
+    @TableField(exist = false)
+    private Ymd ymd;
     /**
      * 最后修改人id
      */

+ 2 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/resumption/mapper/AppRulePointMapper.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.xunmei.resumption.domain.AppRulePoint;
 import com.xunmei.resumption.dto.appRulePoint.AppRulePointDetailDto;
 import com.xunmei.resumption.dto.appRulePoint.AppRulePointInfoDto;
+import com.xunmei.resumption.vo.AppRulePointTaskVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -27,7 +28,7 @@ public interface AppRulePointMapper extends BaseMapper<AppRulePoint> {
 
     List<AppRulePointInfoDto> selectPointListByIdList(@Param("pointIds") List<Long> pointIds, @Param("normIdList") List<Long> planIdList);
 
-//    List<AppRulePointTaskVo> findPointByPlan(Long planid);
+    List<AppRulePointTaskVo> findPointByPlan(Long planid);
 
     List<Map<String, Object>> findAreaListPlan(Long planid);
 

+ 7 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/resumption/mapper/SysResumptionMapper.java

@@ -1,9 +1,12 @@
 package com.xunmei.resumption.mapper;
 
+import java.util.Date;
 import java.util.List;
 
 import com.xunmei.resumption.domain.SysResumption;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.xunmei.resumption.vo.WorkChangeResumptionVo;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 【请填写功能名称】Mapper接口
@@ -59,4 +62,8 @@ public interface SysResumptionMapper extends BaseMapper<SysResumption> {
      * @return 结果
      */
     public int deleteSysResumptionByIds(String[] ids);
+
+    List<WorkChangeResumptionVo> findResumptionList(@Param("orgIds") List<Long> orgIds, @Param("date") Date date, @Param("type") Integer type, @Param("status") Integer status, @Param("year") Integer year, @Param("quarter") Integer quarter);
+
+    void deleteResumption(@Param("ids") List<String> ids,@Param("year") Integer year, @Param("quarter") Integer quarter);
 }

+ 2 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/resumption/service/IAppRulePointService.java

@@ -2,6 +2,7 @@ package com.xunmei.resumption.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.xunmei.resumption.domain.AppRulePoint;
+import com.xunmei.resumption.vo.AppRulePointTaskVo;
 
 import java.util.List;
 import java.util.Map;
@@ -16,7 +17,7 @@ import java.util.Map;
  */
 public interface IAppRulePointService extends IService<AppRulePoint> {
 
-//    List<AppRulePointTaskVo> findPointByPlan(Long id);
+    List<AppRulePointTaskVo> findPointByPlan(Long id);
 
     List<Map<String, Object>> findAreaListPlan(Long planid);
 

+ 12 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/resumption/service/ISysResumptionService.java

@@ -1,11 +1,19 @@
 package com.xunmei.resumption.service;
 
+import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
+import cn.hutool.core.date.DateTime;
+import com.xunmei.resumption.domain.AppPlan;
 import com.xunmei.resumption.domain.SysResumption;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.resumption.vo.AppRulePointTaskVo;
+import com.xunmei.resumption.vo.WorkChangeResumptionVo;
+import com.xunmei.system.util.ResumptionType;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 【请填写功能名称】Service接口
@@ -21,7 +29,10 @@ public interface ISysResumptionService extends IService<SysResumption> {
      * @return 【请填写功能名称】
      */
     public SysResumption selectSysResumptionById(String id);
-
+    public void newbuild( Long orgId,  ResumptionType type,  Date dateTime,  Boolean isWork, AppPlan appPlan, List<Object> nfcList, List<AppRulePointTaskVo> pointList, List<Long> roleIds, DateTime planstartTime, DateTime planendTime) ;
+    public List<WorkChangeResumptionVo> findResumptionList( List<Long> orgIds, Date date,Integer type,Integer status, Integer year, Integer quarter);
+    public void saveResumption(List<SysResumption> listResumption, List<AppPlan> appPlanList,List<Map<String,Long>> planIdAndOrgs);
+    public void deleteResumption(List<String> ids,Integer year, Integer quarter);
     /**
      * 查询【请填写功能名称】列表
      *

+ 5 - 4
soc-modules/soc-modules-system/src/main/java/com/xunmei/resumption/service/impl/AppRulePointServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.xunmei.resumption.domain.AppRulePoint;
 import com.xunmei.resumption.mapper.AppRulePointMapper;
 import com.xunmei.resumption.service.IAppRulePointService;
+import com.xunmei.resumption.vo.AppRulePointTaskVo;
 import org.springframework.stereotype.Service;
 
 import java.util.HashMap;
@@ -21,10 +22,10 @@ import java.util.Map;
 @Service
 public class AppRulePointServiceImpl extends ServiceImpl<AppRulePointMapper, AppRulePoint> implements IAppRulePointService {
 
-//    @Override
-//    public List<AppRulePointTaskVo> findPointByPlan(Long planid) {
-//        return baseMapper.findPointByPlan(planid);
-//    }
+    @Override
+    public List<AppRulePointTaskVo> findPointByPlan(Long planid) {
+        return baseMapper.findPointByPlan(planid);
+    }
 
     @Override
     public List<Map<String, Object>> findAreaListPlan(Long planid) {

+ 177 - 4
soc-modules/soc-modules-system/src/main/java/com/xunmei/resumption/service/impl/SysResumptionServiceImpl.java

@@ -1,21 +1,36 @@
 package com.xunmei.resumption.service.impl;
 
-import java.util.List;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.stream.Collectors;
 
+import cn.hutool.core.date.DateField;
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.xunmei.common.core.utils.DateUtils;
+import com.xunmei.resumption.domain.AppPlan;
 import com.xunmei.resumption.domain.SysResumption;
+import com.xunmei.resumption.domain.Todo;
+import com.xunmei.resumption.domain.TodoRole;
 import com.xunmei.resumption.mapper.SysResumptionMapper;
 import com.xunmei.resumption.service.ISysResumptionService;
+import com.xunmei.resumption.vo.AppRulePointTaskVo;
+import com.xunmei.resumption.vo.WorkChangeResumptionVo;
+import com.xunmei.system.util.ResumptionStatus;
+import com.xunmei.system.util.ResumptionType;
+import com.xunmei.system.util.Ymd;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.xunmei.system.service.ISysOrgService;
 
-import java.util.Arrays;
-
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.xunmei.common.core.web.page.TableDataInfo;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
 
 /**
  * 【请填写功能名称】Service业务层处理
@@ -81,7 +96,33 @@ public class SysResumptionServiceImpl extends ServiceImpl<SysResumptionMapper, S
     public SysResumption selectSysResumptionById(String id) {
         return sysResumptionMapper.selectById(id);
     }
-
+    @Override
+    public void deleteResumption(List<String> ids,Integer year, Integer quarter){
+        sysResumptionMapper.deleteResumption(ids,year,quarter);
+    }
+    @Override
+    @Transactional(readOnly= false, rollbackFor = {Exception.class, RuntimeException.class},propagation = Propagation.REQUIRES_NEW)
+    public void saveResumption(List<SysResumption> listResumption, List<AppPlan> appPlanList,List<Map<String,Long>> planIdAndOrgs){
+        //筛选出listResumption每个对象的 planId和orgId 同时在planIdAndOrgs中的数据
+        List<SysResumption> resumptionList = new ArrayList<>();
+        if(CollectionUtils.isNotEmpty(planIdAndOrgs)&&CollectionUtils.isNotEmpty(listResumption)){
+            for (SysResumption re : listResumption) {
+                for (Map<String, Long> map : planIdAndOrgs) {
+                    if (!(re.getPlanId().equals(map.get("planId")) && re.getOrgId().equals(map.get("orgId")))) {
+                        resumptionList.add(re);
+                    }
+                }
+            }
+        }else{
+            resumptionList = listResumption;
+        }
+        //this.save(resumptionList);
+        this.saveBatch(resumptionList);
+        for (SysResumption resumption : resumptionList) {
+            AppPlan appPlan = appPlanList.stream().filter(r -> r.getId().equals(resumption.getPlanId())).collect(Collectors.toList()).get(0);
+            this.daiban(resumption, resumption.getRoleId(), appPlan, resumption.getOrgId(), Math.toIntExact(resumption.getType()));
+        }
+    }
     /**
      * 查询【请填写功能名称】列表
      *
@@ -92,7 +133,139 @@ public class SysResumptionServiceImpl extends ServiceImpl<SysResumptionMapper, S
     public List<SysResumption> selectSysResumptionList(SysResumption sysResumption) {
         return sysResumptionMapper.selectList(new QueryWrapper<>(sysResumption));
     }
+    @Override
+    public List<WorkChangeResumptionVo> findResumptionList(List<Long> orgIds,Date date,Integer type,Integer status, Integer year,Integer quarter) {
+        return sysResumptionMapper.findResumptionList(orgIds,date,type,status,year,quarter);
+    }
+
+    @Override
+    @Transactional(readOnly= false, rollbackFor = {Exception.class, RuntimeException.class},propagation = Propagation.REQUIRES_NEW)
+    public void newbuild(Long orgId, ResumptionType type, final Date dateTime, final Boolean isWork, AppPlan appPlan, List<Object> nfcList, List<AppRulePointTaskVo> pointList, List<Long> roleIds, DateTime planstartTime, DateTime planendTime) {
+        Ymd ymd = Ymd.of(dateTime);
+        //id使用uuid
+        // final Resumption resumption = this.findOrCreate(id,()-> Resumption.newof(orgId,type,ymd,appPlan.getId(), id));
+        // 原来的id根据规则参数,可以根据规则产生和数据库里已存在的id,
+        // 现在使用uuid,数据库中肯定不存在,故不需要拿id去数据库查询,直接创建新的对象
+        List<SysResumption> resumptions = new ArrayList<>();
+        Date time = new Date();
+        for (Long roleId : roleIds) {
+            //结束时间 23:59:59变00:00:00的问题(周,月,季,半年,年)
+            if (type.ordinal() != 0 && type.ordinal() != 6) {
+                planendTime = DateUtil.endOfDay(planendTime).offset(DateField.MILLISECOND, -999);
+            }
+            String id = UUID.randomUUID().toString().replaceAll("-", "");
+            SysResumption resumption =new SysResumption();
+            //resumption.changeWork(isWork);
+            resumption.setStatus((long) ResumptionStatus.WAIT.ordinal());
+            resumption.setYmd(ymd);
+            resumption.setPlanId(appPlan.getId());
+            resumption.setOrgId(orgId);
+            resumption.setId(id);
+            resumption.setType((long) type.ordinal());
+            resumption.setRoleId(roleId);
+            resumption.setPlanStartTime(planstartTime);
+            resumption.setPlanEndTime(planendTime);
+            resumption.setCreateTime(time);
+            resumptions.add(resumption);
+        }
+        //resumptions = this.save(resumptions);
+        for (SysResumption s :
+                resumptions) {
+            sysResumptionMapper.insert(s);
+        }
 
+        //resumption = this.save(resumption);
+        //插入履职数据
+        for (SysResumption resumption : resumptions) {
+            //生成代办
+            daiban(resumption, resumption.getRoleId(), appPlan, orgId, type.ordinal());
+        }
+
+    }
+    public void daiban(SysResumption resumption, Long roleId, AppPlan appPlan, Long orgId, int type) {
+        Todo todo = new Todo();
+        Long appId = 0L; //this.appService.findByNameForApp(IApp.SAFECHECK).getId();
+        todo.setId(resumption.getId());
+        todo.setOrgId(orgId);
+
+        String name = appPlan.getPlanName();
+        if (type == 6) {
+            todo.setTitle("每小时履职");
+            SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
+            sdf.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
+            name = appPlan.getPlanName() + sdf.format(resumption.getPlanStartTime()) + "-" + sdf.format(resumption.getPlanEndTime());
+//            appId = this.appService.findByNameForApp(IApp.MRLZ).getId();
+        }
+        if (type == 0) {
+            todo.setTitle("每日履职");
+            //SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
+            int planexec = appPlan.getPlanExec();
+            String strplanexec = "";
+            switch (planexec) {
+                case 0:
+                    strplanexec = "(全天)";
+                    break;
+                case 1:
+                    strplanexec = "(营业前)";
+                    break;
+                case 2:
+                    strplanexec = "(营业期间)";
+                    break;
+                case 3:
+                    strplanexec = "(营业终了)";
+                    break;
+            }
+            name = appPlan.getPlanName() + strplanexec;//sdf.format(resumption.getPlanStartTime())+"-"+
+//            appId = this.appService.findByNameForApp(IApp.MRLZ).getId();
+        }
+        if (type == 1) {
+            todo.setTitle("每周履职");
+            name = resumption.getYmd().getYear() + "年第" + resumption.getYmd().getWeek() + "周-" + appPlan.getPlanName();
+//            appId = this.appService.findByNameForApp(IApp.MYLZ).getId();
+        }
+        if (type == 2) {
+            todo.setTitle("每月履职");
+            name = resumption.getYmd().getYear() + "年第" + resumption.getYmd().getMonth() + "月-" + appPlan.getPlanName();
+//            appId = this.appService.findByNameForApp(IApp.MYLZ).getId();
+        }
+        if (type == 3) {
+            todo.setTitle("季度履职");
+            name = resumption.getYmd().getYear() + "年第" + resumption.getYmd().getQuarter() + "季度-" + appPlan.getPlanName();
+//            appId = this.appService.findByNameForApp(IApp.MNLZ).getId();
+        }
+        if (type == 4) {
+            todo.setTitle("半年履职");
+            String strhalfyear = "";
+            switch (resumption.getYmd().getHalfyear()) {
+                case 1:
+                    strhalfyear = "上半年";
+                    break;
+                case 2:
+                    strhalfyear = "下半年";
+                    break;
+            }
+            name = resumption.getYmd().getYear() + "年" + strhalfyear + "-" + appPlan.getPlanName();
+//            appId = this.appService.findByNameForApp(IApp.MNLZ).getId();
+        }
+        if (type == 5) {
+            todo.setTitle("年度履职");
+            name = resumption.getYmd().getYear() + "年-" + appPlan.getPlanName();
+//            appId = this.appService.findByNameForApp(IApp.MNLZ).getId();
+        }
+
+        todo.setContent(String.format("%s-等待履职", name));
+        todo.setDate(resumption.getPlanStartTime());
+        //Date endDate=DateUtils.addMilliseconds( DateUtil.endOfDay(resumption.getPlanEndTime()),-1);
+        todo.setEndDate(DateUtil.endOfDay(resumption.getPlanEndTime()));
+        todo.setOverDate(DateUtil.endOfDay(resumption.getPlanEndTime()));
+        todo.setAppId(appId);
+        todo.setRoles(new ArrayList<>());
+        TodoRole todoRole = new TodoRole();
+        todoRole.setTodoId(todo.getId());
+        todoRole.setRoleId(roleId);
+        todo.getRoles().add(todoRole);
+//        iTodoService.saveTodoAndRoles(todo);
+    }
     /**
      * 新增【请填写功能名称】
      *

+ 11 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/domain/SysConfig.java

@@ -1,5 +1,6 @@
 package com.xunmei.system.domain;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.xunmei.common.core.web.domain.BaseEntity;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
@@ -18,7 +19,8 @@ public class SysConfig extends BaseEntity
 
     /** 参数主键 */
     private Long configId;
-
+    @TableField(exist = false)
+    private String value;
     /** 参数名称 */
     private String configName;
 
@@ -39,6 +41,14 @@ public class SysConfig extends BaseEntity
         return configId;
     }
 
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
     public void setConfigId(Long configId)
     {
         this.configId = configId;

+ 1 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/mapper/SysConfigMapper.java

@@ -76,4 +76,5 @@ public interface SysConfigMapper extends BaseMapper<SysConfig>
      * @return 结果
      */
     public int deleteConfigByIds(Long[] configIds);
+
 }

+ 2 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/mapper/SysOrgMapper.java

@@ -61,4 +61,6 @@ public interface SysOrgMapper extends BaseMapper<SysOrg> {
      * @return 结果
      */
     public int deleteSysOrgByIds(Long[] ids);
+
+    List<Long> findListByOrgType(@Param("execOrgType") Integer execOrgType);
 }

+ 1 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/mapper/SysWorkTimeMapper.java

@@ -32,6 +32,7 @@ public interface SysWorkTimeMapper extends BaseMapper<SysWorkTime> {
     List<SysWorkTime> findByOrgAndMonth(SysWorkTime request);
     List<SysWorkTime> findByYmd( @Param("orgIds") List<Long> orgIds,@Param("date") String date);
     List<SysWorkTime> getOrgWorkTimeByMonth(@Param("map") Map<String, Object> map);
+    List<Long> findOrgIdsByYmd(@Param("date")String date);
     /**
      * 查询【请填写功能名称】列表
      *

+ 1 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/ISysConfigService.java

@@ -21,6 +21,7 @@ public interface ISysConfigService extends IService<SysConfig>
      * @return Page
      */
     public TableDataInfo selectPage(SysConfig sysAreaCheck);
+    public SysConfig findFirstByCode(String code);
     /**
      * 查询参数配置信息
      * 

+ 1 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/ISysOrgService.java

@@ -21,6 +21,7 @@ public interface ISysOrgService extends IService<SysOrg> {
      */
     SysOrg selectSysOrgById(Long id);
     List<Long> selectCheckSubOrgIdList(Long orgId);
+    public List<Long> findListByOrgType(Integer execOrgType);
     /**
      * 查询【请填写功能名称】列表
      *

+ 3 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/ISysWorkTimeService.java

@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.xunmei.common.core.web.page.TableDataInfo;
 import com.xunmei.system.domain.SysWorkTimeSet;
 import com.xunmei.system.domain.SysWorkTimeSetDayofweek;
+import com.xunmei.system.util.Ymd;
 
 /**
  * 【请填写功能名称】Service接口
@@ -24,8 +25,9 @@ public interface ISysWorkTimeService extends IService<SysWorkTime> {
      * @param id 【请填写功能名称】主键
      * @return 【请填写功能名称】
      */
+    public SysWorkTime findWorkTimeByYmd( Long orgId,  Ymd ymd,  boolean isEnable);
     public SysWorkTime selectSysWorkTimeById(String id);
-
+    public List<Long> findOrgIdsByYmd(String toYmd);
     public void handleTodayChanged(List<Long> orgIdList, List<SysWorkTime> workTimeList, List<SysWorkTime> exists, Date today);
     public List<SysWorkTime> findByYmd(List<Long> orgIds, Date ymd);
     public List<SysWorkTime> findByOrgAndMonth(SysWorkTime sysWorkTime);

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

@@ -46,7 +46,10 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
     {
         loadingConfigCache();
     }
-
+    @Override
+    public SysConfig findFirstByCode(String code) {
+        return configMapper.selectOne(new QueryWrapper<SysConfig>().eq("code", code));
+    }
     @Override
     public TableDataInfo selectPage(SysConfig sysConfig) {
 

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

@@ -83,7 +83,10 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
     public SysOrg selectSysOrgById(Long id) {
         return sysOrgMapper.selectSysOrgById(id);
     }
-
+    @Override
+    public List<Long> findListByOrgType(Integer execOrgType){
+        return sysOrgMapper.findListByOrgType(execOrgType);
+    }
     /**
      * 查询【请填写功能名称】列表
      *

+ 18 - 4
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysWorkTimeServiceImpl.java

@@ -19,6 +19,7 @@ import com.xunmei.system.domain.SysWorkTimeSet;
 import com.xunmei.system.dto.SysWorkTimeDto;
 import com.xunmei.system.mapper.SysWorkTimeSetMapper;
 import com.xunmei.system.util.WorkChangeEvent;
+import com.xunmei.system.util.Ymd;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -54,8 +55,6 @@ public class SysWorkTimeServiceImpl extends ServiceImpl<SysWorkTimeMapper, SysWo
     private ApplicationContext context;
 
 
-
-
     @Override
     public TableDataInfo selectPage(SysWorkTime sysWorkTime) {
 
@@ -77,7 +76,7 @@ public class SysWorkTimeServiceImpl extends ServiceImpl<SysWorkTimeMapper, SysWo
         if (sysWorkTime.getOrgId() != null && !sysWorkTime.getCheckSub()) {
             query.eq("t.org_id", sysWorkTime.getOrgId());
         }
-        if (sysWorkTime.getModifiedName() != null ) {
+        if (sysWorkTime.getModifiedName() != null) {
             query.eq("t.modified_name", sysWorkTime.getModifiedName());
         }
         //下穿
@@ -183,7 +182,20 @@ public class SysWorkTimeServiceImpl extends ServiceImpl<SysWorkTimeMapper, SysWo
         return map;
     }
 
+    @Override
+    public List<Long> findOrgIdsByYmd(String toYmd) {
+        return this.baseMapper.findOrgIdsByYmd(toYmd);
+    }
 
+    @Override
+    public SysWorkTime findWorkTimeByYmd( Long orgId,  Ymd ymd,  boolean isEnable) {
+        List<SysWorkTime> workTimes = this.baseMapper.selectList(new QueryWrapper<SysWorkTime>().eq("orgId", orgId).eq("ymd", ymd).eq("isEnable", isEnable) );
+        if (workTimes != null && workTimes.size() > 0) {
+            return workTimes.get(0);
+        } else {
+            return null;
+        }
+    }
     /**
      * 查询【请填写功能名称】
      *
@@ -193,17 +205,19 @@ public class SysWorkTimeServiceImpl extends ServiceImpl<SysWorkTimeMapper, SysWo
     @Override
     public SysWorkTime selectSysWorkTimeById(String id) {
         SysWorkTime sysWorkTime = sysWorkTimeMapper.selectById(id);
-        if (sysWorkTime!=null) {
+        if (sysWorkTime != null) {
             sysWorkTime.setOrgName(orgService.selectSysOrgById(sysWorkTime.getOrgId()).getName());
         }
         return sysWorkTime;
     }
+
     private boolean timesetIsEqual(SysWorkTime workTime, SysWorkTime dto) {
         return workTime.getIsEnable().equals(dto.getIsEnable())
                 && StringUtils.equals(workTime.getOpenTime(), dto.getOpenTime()) && StringUtils.equals(workTime.getWorkTime(), dto.getWorkTime())
                 && StringUtils.equals(workTime.getNoonbreakStart(), dto.getNoonbreakStart()) && StringUtils.equals(workTime.getNoonbreakEnd(), dto.getNoonbreakEnd())
                 && StringUtils.equals(workTime.getWorkOffTime(), dto.getWorkOffTime()) && StringUtils.equals(workTime.getCloseTime(), dto.getCloseTime());
     }
+
     @Override
     public void handleTodayChanged(List<Long> orgIdList, List<SysWorkTime> workTimeList, List<SysWorkTime> exists, Date today) {
 //        Optional<SysWorkTimeSet> todaySet = workTimeList.stream().filter(t -> DateUtil.beginOfDay(t.getDate()).equals(today)).findFirst();

+ 7 - 1
soc-modules/soc-modules-system/src/main/resources/mapper/resumption/AppRulePointMapper.xml

@@ -68,7 +68,13 @@
             </foreach>
         </if>
     </select>
-
+    <select id="findPointByPlan" parameterType="Long" resultType="com.xunmei.resumption.vo.AppRulePointTaskVo">
+        SELECT a.*, b.point_scan
+        from sys_rule_point a
+                 LEFT JOIN t_app_plan_to_item b ON a.id = b.item_id
+                 LEFT JOIN t_app_plan c ON b.plan_id = c.id
+        WHERE c.id = #{planid}
+    </select>
     <select id="selectPointListByIdList" resultType="com.xunmei.resumption.dto.appRulePoint.AppRulePointInfoDto"
             parameterType="java.util.List">
         select

+ 19 - 0
soc-modules/soc-modules-system/src/main/resources/mapper/resumption/SysResumptionMapper.xml

@@ -119,6 +119,18 @@
             <include refid="selectSysResumptionVo"/>
             where id = #{id}
     </select>
+    <select id="findResumptionList" resultType="com.xunmei.resumption.vo.WorkChangeResumptionVo">
+        select a.id,b.id as planId,b.plan_exec as planExec,a.status,a.org_id as orgId
+        from sys_resumption a left join t_app_plan b on a.plan_id =b.id
+        where a.ymd_year = #{year} and a.ymd_quarter=#{quarter} and a.ymd_date=#{date} and `type`=#{type} and b.plan_exec not in (4,5,6) and a.org_id in
+        <foreach collection="orgIds" item="item" open="(" separator="," close=")">
+            #{item}
+        </foreach>
+        <if test="status!=null">
+            and a.status=#{status}
+        </if>
+
+    </select>
 
     <insert id="insertSysResumption" parameterType="com.xunmei.resumption.domain.SysResumption">
         insert into sys_resumption
@@ -325,4 +337,11 @@
             #{id}
         </foreach>
     </delete>
+    <delete id="deleteResumption">
+        delete from sys_resumption where ymd_year = #{year} and ymd_quarter=#{quarter} and id in
+        <foreach collection="ids" item="item" open="(" separator="," close=")">
+            #{item}
+        </foreach>
+
+    </delete>
 </mapper>

+ 1 - 1
soc-modules/soc-modules-system/src/main/resources/mapper/system/SysConfigMapper.xml

@@ -68,7 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectConfigVo"/>
         where config_key = #{configKey} limit 1
     </select>
-    
+
     <insert id="insertConfig" parameterType="com.xunmei.system.domain.SysConfig">
         insert into sys_config (
 			<if test="configName != null and configName != '' ">config_name,</if>

+ 4 - 0
soc-modules/soc-modules-system/src/main/resources/mapper/system/SysOrgMapper.xml

@@ -171,6 +171,10 @@
         where path like concat((select path from sys_org where id = #{orgId}), '%')
           and deleted = 0
     </select>
+    <select id="findListByOrgType" resultType="java.lang.Long">
+        select a.id from sys_org a where a.type = #{execOrgType} and a.deleted=0 and a.is_lock=0 and a.temporarily_closed=0
+
+    </select>
     <insert id="insertSysOrg" parameterType="com.xunmei.system.api.domain.SysOrg"            useGeneratedKeys="true" keyProperty="id">
         insert into sys_org
         <trim prefix="(" suffix=")" suffixOverrides=",">

+ 4 - 0
soc-modules/soc-modules-system/src/main/resources/mapper/system/SysWorkTimeMapper.xml

@@ -158,6 +158,10 @@
 
 
     </select>
+    <select id="findOrgIdsByYmd" resultType="java.lang.Long">
+        select org_id from sys_work_time where ymd_date=#{data} and is_enable=1
+
+    </select>
 
     <insert id="insertSysWorkTime" parameterType="com.xunmei.system.domain.SysWorkTime">
         insert into sys_work_time