|  | @@ -7,6 +7,7 @@ import java.util.stream.Collectors;
 | 
											
												
													
														|  |  import cn.hutool.core.date.DateField;
 |  |  import cn.hutool.core.date.DateField;
 | 
											
												
													
														|  |  import cn.hutool.core.date.DateTime;
 |  |  import cn.hutool.core.date.DateTime;
 | 
											
												
													
														|  |  import cn.hutool.core.date.DateUtil;
 |  |  import cn.hutool.core.date.DateUtil;
 | 
											
												
													
														|  | 
 |  | +import cn.hutool.core.util.ObjectUtil;
 | 
											
												
													
														|  |  import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 |  |  import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 | 
											
												
													
														|  |  import com.xunmei.common.core.constant.SecurityConstants;
 |  |  import com.xunmei.common.core.constant.SecurityConstants;
 | 
											
												
													
														|  |  import com.xunmei.common.core.utils.DateUtils;
 |  |  import com.xunmei.common.core.utils.DateUtils;
 | 
											
										
											
												
													
														|  | @@ -62,11 +63,11 @@ public class SysResumptionServiceImpl extends ServiceImpl<SysResumptionMapper, S
 | 
											
												
													
														|  |          QueryWrapper<SysResumption> query = new QueryWrapper<>(sysResumption);
 |  |          QueryWrapper<SysResumption> query = new QueryWrapper<>(sysResumption);
 | 
											
												
													
														|  |          //下穿
 |  |          //下穿
 | 
											
												
													
														|  |          if (sysResumption.getCheckSub()) {
 |  |          if (sysResumption.getCheckSub()) {
 | 
											
												
													
														|  | -            List<Long> ids = orgService.selectCheckSubOrgIdList(sysResumption.getOrgId(),SecurityConstants.INNER);
 |  | 
 | 
											
												
													
														|  | 
 |  | +            List<Long> ids = orgService.selectCheckSubOrgIdList(sysResumption.getOrgId(), SecurityConstants.INNER);
 | 
											
												
													
														|  |  //            if(checkSubOrgIdList.getCode()!=200){
 |  |  //            if(checkSubOrgIdList.getCode()!=200){
 | 
											
												
													
														|  |  ////                return checkSubOrgIdList.getMsg();
 |  |  ////                return checkSubOrgIdList.getMsg();
 | 
											
												
													
														|  |  //            }
 |  |  //            }
 | 
											
												
													
														|  | -          //  List<Long> ids = checkSubOrgIdList.getData();
 |  | 
 | 
											
												
													
														|  | 
 |  | +            //  List<Long> ids = checkSubOrgIdList.getData();
 | 
											
												
													
														|  |              //清空前端传递的org_id
 |  |              //清空前端传递的org_id
 | 
											
												
													
														|  |              sysResumption.setOrgId(null);
 |  |              sysResumption.setOrgId(null);
 | 
											
												
													
														|  |              //添加in条件
 |  |              //添加in条件
 | 
											
										
											
												
													
														|  | @@ -100,16 +101,18 @@ public class SysResumptionServiceImpl extends ServiceImpl<SysResumptionMapper, S
 | 
											
												
													
														|  |      public SysResumption selectSysResumptionById(String id) {
 |  |      public SysResumption selectSysResumptionById(String id) {
 | 
											
												
													
														|  |          return sysResumptionMapper.selectById(id);
 |  |          return sysResumptionMapper.selectById(id);
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  | -    public void deleteResumption(List<String> ids,Integer year, Integer quarter){
 |  | 
 | 
											
												
													
														|  | -        sysResumptionMapper.deleteResumption(ids,year,quarter);
 |  | 
 | 
											
												
													
														|  | 
 |  | +    public void deleteResumption(List<String> ids, Integer year, Integer quarter) {
 | 
											
												
													
														|  | 
 |  | +        sysResumptionMapper.deleteResumption(ids, year, quarter);
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |      @Override
 |  |      @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){
 |  | 
 | 
											
												
													
														|  | 
 |  | +    @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中的数据
 |  |          //筛选出listResumption每个对象的 planId和orgId 同时在planIdAndOrgs中的数据
 | 
											
												
													
														|  |          List<SysResumption> resumptionList = new ArrayList<>();
 |  |          List<SysResumption> resumptionList = new ArrayList<>();
 | 
											
												
													
														|  | -        if(CollectionUtils.isNotEmpty(planIdAndOrgs)&&CollectionUtils.isNotEmpty(listResumption)){
 |  | 
 | 
											
												
													
														|  | 
 |  | +        if (CollectionUtils.isNotEmpty(planIdAndOrgs) && CollectionUtils.isNotEmpty(listResumption)) {
 | 
											
												
													
														|  |              for (SysResumption re : listResumption) {
 |  |              for (SysResumption re : listResumption) {
 | 
											
												
													
														|  |                  for (Map<String, Long> map : planIdAndOrgs) {
 |  |                  for (Map<String, Long> map : planIdAndOrgs) {
 | 
											
												
													
														|  |                      if (!(re.getPlanId().equals(map.get("planId")) && re.getOrgId().equals(map.get("orgId")))) {
 |  |                      if (!(re.getPlanId().equals(map.get("planId")) && re.getOrgId().equals(map.get("orgId")))) {
 | 
											
										
											
												
													
														|  | @@ -117,7 +120,7 @@ public class SysResumptionServiceImpl extends ServiceImpl<SysResumptionMapper, S
 | 
											
												
													
														|  |                      }
 |  |                      }
 | 
											
												
													
														|  |                  }
 |  |                  }
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  | -        }else{
 |  | 
 | 
											
												
													
														|  | 
 |  | +        } else {
 | 
											
												
													
														|  |              resumptionList = listResumption;
 |  |              resumptionList = listResumption;
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |          //this.save(resumptionList);
 |  |          //this.save(resumptionList);
 | 
											
										
											
												
													
														|  | @@ -127,6 +130,7 @@ public class SysResumptionServiceImpl extends ServiceImpl<SysResumptionMapper, S
 | 
											
												
													
														|  |              this.daiban(resumption, resumption.getRoleId(), appPlan, resumption.getOrgId(), Math.toIntExact(resumption.getType()));
 |  |              this.daiban(resumption, resumption.getRoleId(), appPlan, resumption.getOrgId(), Math.toIntExact(resumption.getType()));
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |      /**
 |  |      /**
 | 
											
												
													
														|  |       * 查询【请填写功能名称】列表
 |  |       * 查询【请填写功能名称】列表
 | 
											
												
													
														|  |       *
 |  |       *
 | 
											
										
											
												
													
														|  | @@ -137,13 +141,14 @@ public class SysResumptionServiceImpl extends ServiceImpl<SysResumptionMapper, S
 | 
											
												
													
														|  |      public List<SysResumption> selectSysResumptionList(SysResumption sysResumption) {
 |  |      public List<SysResumption> selectSysResumptionList(SysResumption sysResumption) {
 | 
											
												
													
														|  |          return sysResumptionMapper.selectList(new QueryWrapper<>(sysResumption));
 |  |          return sysResumptionMapper.selectList(new QueryWrapper<>(sysResumption));
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |      @Override
 |  |      @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);
 |  | 
 | 
											
												
													
														|  | 
 |  | +    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
 |  |      @Override
 | 
											
												
													
														|  | -    @Transactional(readOnly= false, rollbackFor = {Exception.class, RuntimeException.class},propagation = Propagation.REQUIRES_NEW)
 |  | 
 | 
											
												
													
														|  | 
 |  | +    @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) {
 |  |      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);
 |  |          Ymd ymd = Ymd.of(dateTime);
 | 
											
												
													
														|  |          //id使用uuid
 |  |          //id使用uuid
 | 
											
										
											
												
													
														|  | @@ -156,11 +161,11 @@ public class SysResumptionServiceImpl extends ServiceImpl<SysResumptionMapper, S
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          for (Long roleId : roleIds) {
 |  |          for (Long roleId : roleIds) {
 | 
											
												
													
														|  |              //结束时间 23:59:59变00:00:00的问题(周,月,季,半年,年)
 |  |              //结束时间 23:59:59变00:00:00的问题(周,月,季,半年,年)
 | 
											
												
													
														|  | -            if (type.getValue() != 1 && type.getValue() !=2) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +            if (type.getValue() != 1 && type.getValue() != 2) {
 | 
											
												
													
														|  |                  planendTime = DateUtil.endOfDay(planendTime).offset(DateField.MILLISECOND, -999);
 |  |                  planendTime = DateUtil.endOfDay(planendTime).offset(DateField.MILLISECOND, -999);
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  |  //            String id = UUID.randomUUID().toString().replaceAll("-", "");
 |  |  //            String id = UUID.randomUUID().toString().replaceAll("-", "");
 | 
											
												
													
														|  | -            SysResumption resumption =new SysResumption();
 |  | 
 | 
											
												
													
														|  | 
 |  | +            SysResumption resumption = new SysResumption();
 | 
											
												
													
														|  |              //resumption.changeWork(isWork);
 |  |              //resumption.changeWork(isWork);
 | 
											
												
													
														|  |              resumption.setStatus((long) 1);
 |  |              resumption.setStatus((long) 1);
 | 
											
												
													
														|  |              resumption.setYmd(ymd);
 |  |              resumption.setYmd(ymd);
 | 
											
										
											
												
													
														|  | @@ -173,7 +178,7 @@ public class SysResumptionServiceImpl extends ServiceImpl<SysResumptionMapper, S
 | 
											
												
													
														|  |              resumption.setYmdHour(Long.valueOf(ymd.getHour()));
 |  |              resumption.setYmdHour(Long.valueOf(ymd.getHour()));
 | 
											
												
													
														|  |              resumption.setYmdQuarter(Long.valueOf(ymd.getQuarter()));
 |  |              resumption.setYmdQuarter(Long.valueOf(ymd.getQuarter()));
 | 
											
												
													
														|  |              resumption.setYmdHalfyear(Long.valueOf(ymd.getHalfyear()));
 |  |              resumption.setYmdHalfyear(Long.valueOf(ymd.getHalfyear()));
 | 
											
												
													
														|  | -            resumption.setPlanId(appPlan.getId());
 |  | 
 | 
											
												
													
														|  | 
 |  | +            resumption.setPlanId((ObjectUtil.equal(appPlan.getParentId(), -1L) || ObjectUtil.isNull(appPlan.getParentId())) ? appPlan.getId() : appPlan.getParentId());
 | 
											
												
													
														|  |              resumption.setOrgId(orgId);
 |  |              resumption.setOrgId(orgId);
 | 
											
												
													
														|  |  //            resumption.setId(id);
 |  |  //            resumption.setId(id);
 | 
											
												
													
														|  |              resumption.setType(type.getValue());
 |  |              resumption.setType(type.getValue());
 | 
											
										
											
												
													
														|  | @@ -197,6 +202,7 @@ public class SysResumptionServiceImpl extends ServiceImpl<SysResumptionMapper, S
 | 
											
												
													
														|  |  //        }
 |  |  //        }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |      public void daiban(SysResumption resumption, Long roleId, AppPlan appPlan, Long orgId, int type) {
 |  |      public void daiban(SysResumption resumption, Long roleId, AppPlan appPlan, Long orgId, int type) {
 | 
											
												
													
														|  |          Todo todo = new Todo();
 |  |          Todo todo = new Todo();
 | 
											
												
													
														|  |          Long appId = 0L; //this.appService.findByNameForApp(IApp.SAFECHECK).getId();
 |  |          Long appId = 0L; //this.appService.findByNameForApp(IApp.SAFECHECK).getId();
 | 
											
										
											
												
													
														|  | @@ -281,6 +287,7 @@ public class SysResumptionServiceImpl extends ServiceImpl<SysResumptionMapper, S
 | 
											
												
													
														|  |          todo.getRoles().add(todoRole);
 |  |          todo.getRoles().add(todoRole);
 | 
											
												
													
														|  |  //        iTodoService.saveTodoAndRoles(todo);
 |  |  //        iTodoService.saveTodoAndRoles(todo);
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |      /**
 |  |      /**
 | 
											
												
													
														|  |       * 新增【请填写功能名称】
 |  |       * 新增【请填写功能名称】
 | 
											
												
													
														|  |       *
 |  |       *
 |