Ver código fonte

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

jingyuanchao 2 anos atrás
pai
commit
68fb82339c

+ 24 - 10
project_data/sql/0.0.2/soc/soc.sql

@@ -1405,23 +1405,37 @@ INSERT INTO `sys_menu` (`id`, `menu_name`, `parent_id`, `order_num`, `path`, `co
 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 (00000000000000002357, '删除', 2317, 5, '', NULL, NULL, 1, 0, 'F', '0', '0', 'core:checkplan:remove', '1', NULL, NULL, '超级管理员', '2023-09-25 11:35:35', '', NULL, '');
 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 (00000000000000002317, '检查计划', 2326, 3, 'check/plan', 'check/index', NULL, 1, 0, 'C', '0', '0', '', '1', 'documentation', NULL, '超级管理员', '2023-09-21 10:35:38', '超级管理员', '2023-09-22 09:42:15', '');
 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 (00000000000000002318, '检查任务', 2326, 4, 'check/task/index', 'check/task/index', NULL, 1, 0, 'C', '0', '0', '', '1', 'documentation', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
+DELETE FROM sys_menu WHERE id IN(2359,2360,2361,2362,2363,2364,2365)
 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 (00000000000000002324, '信息发送管理', 2207, 3, 'send', 'information/send/index', NULL, 1, 1, 'C', '0', '0', 'core:send:list', '1', 'email', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
-
+VALUES (2359, '信息发送管理', 2207, 3, 'send', 'core/send/index', NULL, 1, 1, 'C', '0', '0', 'core:send:list', '1', 'email', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
 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 (01706850786660585473, '新增', 2324, 1, NULL, NULL, NULL, 1, 0, 'F', '0', '0', 'core:send:add', '1', NULL, NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
+VALUES (2360, '新增', 2359, 1, NULL, NULL, NULL, 1, 0, 'F', '0', '0', 'core:send:add', '1', NULL, NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
 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 (01706850961911189505, '删除', 2324, 2, NULL, NULL, NULL, 1, 0, 'F', '0', '0', 'core:send:remove', '1', NULL, NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
+VALUES (2361, '删除', 2359, 2, NULL, NULL, NULL, 1, 0, 'F', '0', '0', 'core:send:remove', '1', NULL, NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
 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 (01706851077007085569, '修改', 2324, 3, NULL, NULL, NULL, 1, 0, 'F', '0', '0', 'core:send:edit', '1', NULL, NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
+VALUES (2362, '修改', 2359, 3, NULL, NULL, NULL, 1, 0, 'F', '0', '0', 'core:send:edit', '1', NULL, NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
 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 (01706851219965743105, '详情', 2324, 4, NULL, NULL, NULL, 1, 0, 'F', '0', '0', 'core:send:query', '1', NULL, NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
-
+VALUES (2363, '详情', 2359, 4, NULL, NULL, NULL, 1, 0, 'F', '0', '0', 'core:send:query', '1', NULL, NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
 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 (01706854057534033922, '履职临期提醒', 2207, 3, 'configuration', 'information/configuration/index', NULL, 1, 1, 'C', '0', '0', 'core:configuration:query', '1', 'dashboard', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
+VALUES (2364, '履职临期提醒', 2207, 3, 'configuration', 'core/configuration/index', NULL, 1, 1, 'C', '0', '0', 'core:configuration:query', '1', 'dashboard', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
 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 (01706854338376241153, '提交', 1706854057534033922, 1, NULL, NULL, NULL, 1, 0, 'F', '0', '0', 'core:configuration:add', '1', NULL, NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
-
+VALUES (2365, '提交', 2364, 1, NULL, NULL, NULL, 1, 0, 'F', '0', '0', 'core:configuration:add', '1', NULL, NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
+delete from sys_role_menu where menu_id in(2359,2360,2361,2362,2363,2364,2365) ;
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (116, 2359);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (116, 2360);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (116, 2361);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (116, 2362);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (116, 2363);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (116, 2364);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (116, 2365);
+
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (120, 2359);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (120, 2360);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (120, 2361);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (120, 2362);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (120, 2363);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (120, 2364);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (120, 2365);
 -- 处理自增id步长问题
 alter table core_drill_dictionary auto_increment = 10000;
 

+ 5 - 2
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/RemoteResumptionTaskService.java

@@ -1,15 +1,16 @@
 package com.xunmei.system.api;
 
+import com.xunmei.common.core.constant.SecurityConstants;
 import com.xunmei.common.core.constant.ServiceNameConstants;
 import com.xunmei.common.core.domain.R;
 import com.xunmei.common.core.web.domain.AjaxResult;
 import com.xunmei.system.api.factory.RemoteEduTrainingFallbackFactory;
 import com.xunmei.system.api.factory.RemoteResumptionTaskFallbackFactory;
 import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.Date;
+import java.util.Map;
 
 /**
  * 教育培训
@@ -45,4 +46,6 @@ public interface RemoteResumptionTaskService {
 
     @GetMapping(value = "resumption/task/updatetaskstatus")
     R<Boolean> updateTaskStatus();
+    @PostMapping("/resumption/dayTaskByWorkTime")
+    void dayTaskByWorkTime(@RequestBody Map<String, Object> param);
 }

+ 6 - 0
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/factory/RemoteResumptionTaskFallbackFactory.java

@@ -11,6 +11,8 @@ import org.springframework.cloud.openfeign.FallbackFactory;
 import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.GetMapping;
 
+import java.util.Map;
+
 /**
  * 字典服务降级处理
  *
@@ -57,6 +59,10 @@ public class RemoteResumptionTaskFallbackFactory implements FallbackFactory<Remo
             public R<Boolean> updateTaskStatus() {
                 return null;
             }
+
+            @Override
+            public void dayTaskByWorkTime(Map<String, Object> param) {
+            }
         };
     }
 

+ 25 - 4
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/information/service/impl/CoreMessageSendServiceImpl.java

@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.xunmei.common.core.constant.SecurityConstants;
 import com.xunmei.common.core.domain.message.domain.CoreAnnouncementNotificationToRole;
 import com.xunmei.common.core.utils.DateUtils;
+import com.xunmei.common.core.utils.SpringUtils;
 import com.xunmei.common.core.web.page.TableDataInfo;
 import com.xunmei.common.security.utils.SecurityUtils;
 import com.xunmei.core.information.domain.CoreMessageCenter;
@@ -26,10 +27,10 @@ import org.springframework.stereotype.Service;
 
 import java.text.SimpleDateFormat;
 import java.time.LocalDate;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
 import java.util.stream.Collectors;
 
 /**
@@ -47,6 +48,7 @@ public class CoreMessageSendServiceImpl extends ServiceImpl<CoreMessageSendMappe
     @Autowired
     private ICoreMessageCenterService coreMessageCenterService;
 
+
     /**
      * 查询【请填写功能名称】
      *
@@ -112,10 +114,29 @@ public class CoreMessageSendServiceImpl extends ServiceImpl<CoreMessageSendMappe
             coreMessageCenterService.saveBatch(coreMessageCenterList);
         } else {
             coreMessageSend.setSendStatus("2");
+            Mytest task=new Mytest();
+            long nowTime=System.currentTimeMillis();
+            Timer timer=new Timer();
+            timer.schedule(task,new Date(nowTime),3000);
         }
         return coreMessageSendMapper.insert(coreMessageSend);
     }
 
+    class Mytest extends TimerTask {
+        @Override
+        public void run() {
+            try {
+                System.out.println("begin timer=" + System.currentTimeMillis());
+                Thread.sleep(1000);
+                System.out.println("end timer" + System.currentTimeMillis());
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
+
+        }
+
+    }
+
     /**
      * 修改【请填写功能名称】
      *

+ 8 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/controller/TaskController.java

@@ -3,6 +3,7 @@ package com.xunmei.core.resumption.controller;
 import cn.hutool.core.date.DateField;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.xunmei.common.core.constant.SecurityConstants;
@@ -12,6 +13,7 @@ import com.xunmei.common.core.utils.KeyValue;
 import com.xunmei.common.core.utils.ResumptionType;
 import com.xunmei.common.core.utils.Ymd;
 import com.xunmei.common.core.web.domain.AjaxResult;
+import com.xunmei.common.security.annotation.InnerAuth;
 import com.xunmei.core.resumption.domain.AppPlan;
 import com.xunmei.core.resumption.dto.doTaskDto;
 import com.xunmei.core.resumption.service.AppPlanService;
@@ -27,6 +29,7 @@ import org.springframework.web.bind.annotation.*;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 import java.util.TimeZone;
 import java.util.stream.Collectors;
 
@@ -133,6 +136,11 @@ public class TaskController {
             this.createNewResumptionByOrgAndPlan(orgIds, planIds, datetime);
         }
     }
+    @InnerAuth
+    @PostMapping ("/dayTaskByWorkTime")
+    public void dayTaskByWorkTime(Map<String,Object> params) {
+         resumptionService.dayTaskByWorkTime(params);
+    }
 
     private void createNewResumptionByOrgAndPlan(List<Long> orgIds, List<Long> planIds, DateTime datetime) {
         //更加计划id获取启用状态的计划

+ 2 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/ResumptionService.java

@@ -44,4 +44,6 @@ public interface ResumptionService extends IService<Resumption> {
     public void deleteResumption(List<String> ids,Integer year, Integer quarter);
 
     List<PanelListVo> selectCurUserTaskList(PanelListDto panelListDto);
+
+    void dayTaskByWorkTime(Map<String, Object> params);
 }

+ 113 - 4
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/ResumptionServiceImpl.java

@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateField;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -15,30 +16,36 @@ import com.xunmei.common.core.utils.DateHelper;
 import com.xunmei.common.core.utils.ResumptionType;
 import com.xunmei.common.core.utils.Ymd;
 import com.xunmei.core.resumption.domain.AppPlan;
+import com.xunmei.core.resumption.domain.AppPlanToRole;
 import com.xunmei.core.resumption.domain.Resumption;
 import com.xunmei.core.resumption.dto.resumptionRegister.ResumptionTaskDataDto;
 import com.xunmei.core.resumption.dto.TaskDetailsDto;
+import com.xunmei.core.resumption.mapper.AppPlanMapper;
+import com.xunmei.core.resumption.mapper.AppPlanToRoleMapper;
 import com.xunmei.core.resumption.mapper.ResumptionMapper;
+import com.xunmei.core.resumption.service.AppPlanService;
 import com.xunmei.core.resumption.service.ResumptionService;
 import com.xunmei.core.resumption.vo.AppRulePointTaskVo;
 import com.xunmei.core.resumption.vo.ResumptionAppVo;
 import com.xunmei.core.resumption.vo.ResumptionTaskNewDto;
 import com.xunmei.core.resumption.vo.WorkChangeResumptionVo;
+import com.xunmei.system.api.domain.SysWorkTime;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 @Service
 public class ResumptionServiceImpl extends ServiceImpl<ResumptionMapper, Resumption> implements ResumptionService {
     @Autowired
     private ResumptionMapper resumptionMapper;
+    @Autowired
+    private AppPlanToRoleMapper appPlanToRoleMapper;
+    @Autowired
+    private AppPlanMapper appPlanMapper;
     @Override
     public List<Map<String, Object>> findDayTaskList(int year, int quarter, String dateTime, Long roleId, Long orgid) {
         return resumptionMapper.findDayTaskList(year,quarter,dateTime, roleId, orgid);
@@ -165,4 +172,106 @@ public class ResumptionServiceImpl extends ServiceImpl<ResumptionMapper, Resumpt
 
         return list;
     }
+
+    @Override
+    public void dayTaskByWorkTime(Map<String, Object> params) {
+        SysWorkTime workTime = (SysWorkTime) params.get("sysWorkTime");
+        List<Long> orgIds = (List<Long>) params.get("orgIds");
+        //按机构删除当天的每日履职
+        QueryWrapper<Resumption> queryWrapper = new QueryWrapper<>();
+        queryWrapper.lambda().eq(Resumption::getYmdDate, workTime.getYmdDate());
+        queryWrapper.lambda().in(Resumption::getOrgId, orgIds);
+        //待履职,进行中
+        //queryWrapper.lambda().in(Resumption::getStatus,  1, 2);
+        //每日任务
+        queryWrapper.lambda().eq(Resumption::getType, 2);
+        List<Resumption> resumptionList = resumptionMapper.selectList(queryWrapper);
+        List<Resumption> resumptionListYlz =resumptionList.stream().filter(item -> item.getStatus()==3).collect(Collectors.toList());
+        if (CollectionUtils.isNotEmpty(resumptionList)) {
+            //取出未履职的数据(待履职,进行中)
+            List<Resumption> resumptionListWlz = resumptionList.stream().filter(item -> item.getStatus() == 1 || item.getStatus() == 2).collect(Collectors.toList());
+            //删除这些数据
+            resumptionMapper.deleteBatchIds(resumptionListWlz.stream().map(Resumption::getId).collect(Collectors.toList()));
+        }
+
+        //营业重新生成任务
+        if (workTime.getIsEnable() == 1) {
+            QueryWrapper<AppPlan> qw = new QueryWrapper<>();
+            qw.lambda().eq(AppPlan::getPlanStatus, 0);
+            qw.lambda().in(AppPlan::getPlanOfOrgId, orgIds);
+            List<AppPlan> listPlans = appPlanMapper.selectList(qw);
+            //通过resumptionListYlz中的planId过滤除已履职的计划
+            List<AppPlan> lists = listPlans.stream().filter(item -> !resumptionListYlz.stream().map(Resumption::getPlanId).collect(
+                    Collectors.toList()).contains(item.getId())).collect(Collectors.toList());
+            //通过计划id获取计划关系的角色
+            if (CollectionUtils.isNotEmpty(lists)) {
+                List<Long> planIds = lists.stream().map(AppPlan::getId).collect(Collectors.toList());
+                List<AppPlanToRole> appPlanToRoles = appPlanToRoleMapper.selectList(new QueryWrapper<AppPlanToRole>().lambda().in(AppPlanToRole::getPlanId, planIds));
+                List<Resumption> newResumptionList = new ArrayList<>();
+                for(AppPlan plan:lists){
+                    //根据计划获取角色
+                    List<AppPlanToRole> planToRoles = appPlanToRoles.stream().filter(item -> item.getPlanId().equals(plan.getId())).collect(Collectors.toList());
+                    List<Resumption> resumptionLista = this.buildResumptions(plan, planToRoles,workTime);
+                    if(CollectionUtils.isNotEmpty(resumptionLista)){
+                        newResumptionList.addAll(resumptionLista);
+                    }
+                }
+                this.saveBatch(newResumptionList);
+            }
+
+
+        }
+    }
+
+    private List<Resumption> buildResumptions(AppPlan appPlan, List<AppPlanToRole> planToRoles, SysWorkTime workTime) {
+        List<Resumption> resumptionList = new ArrayList<>();
+        DateTime dateTime = new DateTime(workTime.getYmdDate());
+        String opentime = workTime.getOpenTime();//营业时间
+        String closetime = workTime.getCloseTime();//营业终了
+        DateTime planstartTime = null;
+        DateTime planendTime = null;
+
+        DateTime time1 = new DateTime(dateTime);
+        time1.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
+        DateTime time2 = new DateTime(dateTime);
+        time2.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
+
+        if (appPlan.getPlanExec() == 1) {//全天 上班时间-下班时间 00:00:00-23:59:59
+            planstartTime = time1.setField(DateField.HOUR_OF_DAY, 0).setField(DateField.MINUTE, 0).setField(DateField.SECOND, 0).setField(DateField.MILLISECOND, 0);
+            planendTime = DateUtil.endOfDay(time2).setField(DateField.MILLISECOND, 0);
+        } else if (appPlan.getPlanExec() == 2) {//营业前 上班时间-营业时间
+            planstartTime = time1.setField(DateField.HOUR_OF_DAY, 0).setField(DateField.MINUTE, 0).setField(DateField.SECOND, 0).setField(DateField.MILLISECOND, 0);
+            planendTime = time2.setField(DateField.HOUR_OF_DAY, Integer.parseInt(opentime.split(":")[0])).setField(DateField.MINUTE, Integer.parseInt(opentime.split(":")[1])).setField(DateField.SECOND, 0).setField(DateField.MILLISECOND, 0);
+        } else if (appPlan.getPlanExec() == 3) {//营业期间 营业时间-营业终了
+            planstartTime = time1.setField(DateField.HOUR_OF_DAY, Integer.parseInt(opentime.split(":")[0])).setField(DateField.MINUTE, Integer.parseInt(opentime.split(":")[1])).setField(DateField.SECOND, 0).setField(DateField.MILLISECOND, 0);
+            planendTime = time2.setField(DateField.HOUR_OF_DAY, Integer.parseInt(closetime.split(":")[0])).setField(DateField.MINUTE, Integer.parseInt(closetime.split(":")[1])).setField(DateField.SECOND, 0).setField(DateField.MILLISECOND, 0);
+        } else if (appPlan.getPlanExec() == 4) {//营业终 营业终了-23.59.59
+            planstartTime = time1.setField(DateField.HOUR_OF_DAY, Integer.parseInt(closetime.split(":")[0])).setField(DateField.MINUTE, Integer.parseInt(closetime.split(":")[1])).setField(DateField.SECOND, 0).setField(DateField.MILLISECOND, 0);
+            planendTime = DateUtil.endOfDay(time2).setField(DateField.MILLISECOND, 0);
+        }
+        for(AppPlanToRole role :planToRoles){
+            Resumption resumption = new Resumption();
+            Ymd ymd = Ymd.of(dateTime);
+            resumption.setStatus( 1);
+            resumption.setYmd(ymd);
+            resumption.setName(appPlan.getPlanName());
+            resumption.setYmdDate(ymd.getDate());
+            resumption.setYmdDay(Long.valueOf(ymd.getDay()));
+            resumption.setYmdMonth(Long.valueOf(ymd.getMonth()));
+            resumption.setYmdWeek(Long.valueOf(ymd.getWeek()));
+            resumption.setYmdYear(Long.valueOf(ymd.getYear()));
+            resumption.setYmdHour(Long.valueOf(ymd.getHour()));
+            resumption.setYmdQuarter(Long.valueOf(ymd.getQuarter()));
+            resumption.setYmdHalfyear(Long.valueOf(ymd.getHalfyear()));
+            resumption.setPlanId((ObjectUtil.equal(appPlan.getParentId(), -1L) || ObjectUtil.isNull(appPlan.getParentId())) ? appPlan.getId() : appPlan.getParentId());
+            resumption.setOrgId(appPlan.getPlanOfOrgId());
+            resumption.setType(appPlan.getPlanType());
+            resumption.setRoleId(role.getRoleId());
+            resumption.setPlanStartTime(planstartTime);
+            resumption.setPlanEndTime(planendTime);
+            resumption.setCreateTime(new Date());
+            resumptionList.add(resumption);
+        }
+        return resumptionList;
+    }
 }

+ 4 - 2
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysUserController.java

@@ -212,11 +212,13 @@ public class SysUserController extends BaseController {
             sysUser.setOrgId(sysUser.getOriginalOrgId());
             List<SysUserRole> userRoles = sysUserRoleService.list(new QueryWrapper<SysUserRole>().eq("user_id", userId));
             sysUser.setRoles(roles);
-            String sex = "";
+            String sex = "-";
             String status = "禁用";
-            if (null != sysUser) {
+            if (null != sysUser&&null!=sysUser.getGender()) {
                 if (sysUser.getGender().equals("1")) {
                     sex = "女";
+                }else {
+                    sex="男";
                 }
                 if (sysUser.getIsLock().equals("0")) {
                     status = "启用";

+ 2 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysWorkTimeController.java

@@ -101,7 +101,8 @@ public class SysWorkTimeController extends BaseController {
     @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
     @PostMapping("/saveOneWorkTime")
     public AjaxResult edit(@RequestBody SysWorkTime sysWorkTime) {
-        return success(sysWorkTimeService.updateSysWorkTime(sysWorkTime));
+        sysWorkTimeService.updateSysWorkTime(sysWorkTime);
+        return success();
     }
 
     /**

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

@@ -65,7 +65,7 @@ public interface ISysWorkTimeService extends IService<SysWorkTime> {
      * @param sysWorkTime 【作息】
      * @return 结果
      */
-    int updateSysWorkTime(SysWorkTime sysWorkTime);
+    void updateSysWorkTime(SysWorkTime sysWorkTime);
 
     /**
      * 批量删除【作息】

+ 14 - 3
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysWorkTimeServiceImpl.java

@@ -14,6 +14,7 @@ import com.xunmei.common.core.utils.DateUtils;
 import com.xunmei.common.core.utils.Ymd;
 import com.xunmei.common.core.web.page.TableDataInfo;
 import com.xunmei.common.security.utils.SecurityUtils;
+import com.xunmei.system.api.RemoteResumptionTaskService;
 import com.xunmei.system.api.domain.SysWorkTime;
 import com.xunmei.system.domain.SysWorkTimeSet;
 import com.xunmei.system.dto.SysWorkTimeDto;
@@ -51,6 +52,9 @@ public class SysWorkTimeServiceImpl extends ServiceImpl<SysWorkTimeMapper, SysWo
     @Autowired
     private ApplicationContext context;
 
+    @Autowired
+    RemoteResumptionTaskService remoteResumptionTaskService;
+
 
     public static Date extractDate(String dateString, String dateFormat) throws ParseException {
         SimpleDateFormat sdf = new SimpleDateFormat(dateFormat, Locale.ENGLISH);
@@ -381,15 +385,22 @@ public class SysWorkTimeServiceImpl extends ServiceImpl<SysWorkTimeMapper, SysWo
      * @return 结果
      */
     @Override
-    public int updateSysWorkTime(SysWorkTime sysWorkTime) {
+    public void updateSysWorkTime(SysWorkTime sysWorkTime) {
 
         sysWorkTime.setUpdateTime(DateUtils.getNowDate());
         sysWorkTime.setModifiedName(SecurityUtils.getUsername());
         sysWorkTime.setModifiedId(SecurityUtils.getUserId());
+
+        sysWorkTimeMapper.updateById(sysWorkTime);
+        //判断日期是否为今天
         if (DateUtil.format(sysWorkTime.getYmdDate(), "yyyy-MM-dd").equals(DateUtil.format(new Date(), "yyyy-MM-dd"))) {
-//            context.publishEvent(WorkChangeEvent.builder().orgIds(Lists.newArrayList(sysWorkTime.getOrgId())).dateTime(DateTime.of(sysWorkTime.getYmdDate())).build());
+            List<Long> orgIds =new ArrayList<>();
+            orgIds.add(sysWorkTime.getOrgId());
+            Map<String,Object> param = new HashMap<>();
+            param.put("orgIds",orgIds);
+            param.put("sysWorkTime",sysWorkTime);
+            remoteResumptionTaskService.dayTaskByWorkTime(param);
         }
-        return sysWorkTimeMapper.updateById(sysWorkTime);
     }
 
     /**