|
|
@@ -9,20 +9,20 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.xunmei.common.core.constant.SecurityConstants;
|
|
|
import com.xunmei.common.core.domain.R;
|
|
|
+import com.xunmei.common.core.enums.CycleCommonEnum;
|
|
|
import com.xunmei.common.core.enums.OrgTypeEnum;
|
|
|
import com.xunmei.common.core.utils.*;
|
|
|
import com.xunmei.common.core.utils.snowId.DateHelper;
|
|
|
+import com.xunmei.core.TaskCreatingServiceImplBase;
|
|
|
import com.xunmei.core.resumption.domain.AppPlan;
|
|
|
import com.xunmei.core.resumption.domain.Resumption;
|
|
|
-import com.xunmei.core.resumption.domain.Resumption;
|
|
|
+import com.xunmei.core.resumption.mapper.AppPlanMapper;
|
|
|
import com.xunmei.core.resumption.service.AppPlanService;
|
|
|
import com.xunmei.core.resumption.service.IAppRulePointService;
|
|
|
import com.xunmei.core.resumption.service.ResumptionService;
|
|
|
import com.xunmei.core.resumption.vo.AppRulePointTaskVo;
|
|
|
import com.xunmei.core.resumption.vo.WorkChangeResumptionVo;
|
|
|
import com.xunmei.system.api.Eto.OrgListByTypesConditionEto;
|
|
|
-import com.xunmei.system.api.RemoteConfigService;
|
|
|
-import com.xunmei.system.api.RemoteLogService;
|
|
|
import com.xunmei.system.api.RemoteOrgService;
|
|
|
import com.xunmei.system.api.RemoteWorkTimeService;
|
|
|
import com.xunmei.system.api.domain.SysOrg;
|
|
|
@@ -34,7 +34,6 @@ import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import javax.annotation.Resource;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -44,7 +43,7 @@ import java.util.stream.Collectors;
|
|
|
*/
|
|
|
@Slf4j
|
|
|
@Component
|
|
|
-public class ResumptionTaskBusiness {
|
|
|
+public class ResumptionTaskBusiness extends TaskCreatingServiceImplBase<AppPlanMapper,AppPlan> {
|
|
|
|
|
|
@Autowired
|
|
|
private ResumptionService resumptionService;
|
|
|
@@ -72,126 +71,126 @@ public class ResumptionTaskBusiness {
|
|
|
// @Resource
|
|
|
// RemoteLogService remoteLogService;
|
|
|
|
|
|
- @Async
|
|
|
- public void syncHour(final DateTime dateTime, int plancycle) {//plancycle==6
|
|
|
- //获取履职计划
|
|
|
- List<AppPlan> appPlanList = appPlanService.list((new QueryWrapper<AppPlan>()).lambda()
|
|
|
- .eq(AppPlan::getPlanStatus, 0)
|
|
|
- .eq(AppPlan::getPlanCycle, plancycle)
|
|
|
- .eq(AppPlan::getPlanType, 0)
|
|
|
- .notIn(AppPlan::getPlanExec, canteenPlanExec));//findExecOrgByPlan(6);
|
|
|
- for (AppPlan appPlan : appPlanList) {
|
|
|
- //获取履职计划中对应的检查要点
|
|
|
- List<AppRulePointTaskVo> pointList = appRulePointService.findPointByPlan(appPlan.getId());
|
|
|
- if (pointList.size() <= 0) {//没有检查项不生成履职任务
|
|
|
-// RESUMPTIONLOG.error("error:该计划ID:{}没有检查项", appPlan.getId());
|
|
|
- continue;
|
|
|
- }
|
|
|
- //根据计划获取履职任务执行机构
|
|
|
- List<Long> orgIds = getPlanOrgIds(appPlan);
|
|
|
- if (orgIds == null || orgIds.size() <= 0) {//没有检查项不生成履职任务
|
|
|
-// RESUMPTIONLOG.error("error:该计划ID:{}没有执行机构", appPlan.getId());
|
|
|
- continue;
|
|
|
- }
|
|
|
- //获取履职角色
|
|
|
- List<Long> roleIds = appPlanService.findRoleByPlan(appPlan.getId());
|
|
|
- if (roleIds.size() <= 0) {//没有检查项不生成履职任务
|
|
|
-// RESUMPTIONLOG.error("error:该计划ID:{}没有履职角色", appPlan.getId());
|
|
|
- continue;
|
|
|
- }
|
|
|
- //获取所有要点中的区域id
|
|
|
- Set<Long> nfcBindIdList = new HashSet<>();
|
|
|
- for (AppRulePointTaskVo p : pointList) {
|
|
|
- if (p.getNfcBindId() != null && p.getPointScan() == 1) {
|
|
|
- nfcBindIdList.add(p.getNfcBindId());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //根据区域获取区域内绑定的nfc
|
|
|
- /* NFCBindJobDto jobDto = new NFCBindJobDto();
|
|
|
- jobDto.setAreaIds(new ArrayList(areaList));
|
|
|
- List<NFCBindPageVo> nfcList = nfcBindService.all(jobDto,NFCBindPageVo::to);*/
|
|
|
- //获取有 作息的机构id
|
|
|
- R<List<Long>> listR = workTimeService.findOrgIdsByYmd(dateTime.toString().substring(0, 10), SecurityConstants.INNER);
|
|
|
- List<Long> orgIdsNew = new ArrayList<>();
|
|
|
- if (listR.getCode() == 200) {
|
|
|
- orgIdsNew = listR.getData();
|
|
|
- }
|
|
|
- List<Long> finalOrgIdsNew = orgIdsNew;
|
|
|
- List<Long> orgIdList = orgIds.stream().filter(r -> finalOrgIdsNew.contains(r)).collect(Collectors.toList());
|
|
|
- //List<Long> orgIdsNew = StreamHelper.filter(orgIds,(v)->workTimeList.contains(v));
|
|
|
- for (final Long orgId : orgIdList) {
|
|
|
- //获取当天的作息
|
|
|
- /*NFCBindJobDto jobDto = new NFCBindJobDto();
|
|
|
- jobDto.setNfcBindIdList(new ArrayList(nfcBindIdList));
|
|
|
- jobDto.setOrgId(orgId);
|
|
|
- List<NFCBindPageVo> nfcList = nfcBindService.all(jobDto,NFCBindPageVo::to);*/
|
|
|
- Ymd ymd = toYmd(dateTime, "DAY");
|
|
|
- ymd.setOrgId(orgId);
|
|
|
- ymd.setEnable(true);
|
|
|
- SysWorkTime workTime = workTimeService.findWorkTimeByYmd(ymd).getData();
|
|
|
- if (workTime != null) {
|
|
|
- List<String[]> workTimes = new ArrayList<>();
|
|
|
- if (appPlan.getNotResumptionOnRest() != null && appPlan.getNotResumptionOnRest() == 1 &&
|
|
|
- StringUtils.isNotEmpty(workTime.getNoonbreakStart()) && StringUtils.isNotEmpty(workTime.getNoonbreakEnd())) {
|
|
|
- workTimes.add(new String[]{workTime.getOpenTime(), workTime.getNoonbreakStart()});
|
|
|
- workTimes.add(new String[]{workTime.getNoonbreakEnd(), workTime.getCloseTime()});
|
|
|
- } else {
|
|
|
- workTimes.add(new String[]{workTime.getOpenTime(), workTime.getCloseTime()});
|
|
|
- }
|
|
|
- for (int ti = 0; ti < workTimes.size(); ti++) {
|
|
|
- String[] time = workTimes.get(ti);
|
|
|
- String openStr = time[0];
|
|
|
- String closeStr = time[1];
|
|
|
- String[] openArr = openStr.split(":");
|
|
|
- String[] closeArr = closeStr.split(":");
|
|
|
- /*如果营业前是00:00-09:00,营业后是17:00-24:00,
|
|
|
- 当前每小时履职任务是10:00-16:00,少了09:00-10:00和16:00-17:00的任务,
|
|
|
- 建议这2个时间段也生成履职任务*/
|
|
|
- //如果有午休,要考虑分段第一段往前移1个小时第二段不移
|
|
|
- int openHour = 0;
|
|
|
- if (ti == 0) {
|
|
|
- openHour = Integer.parseInt(openArr[0]) - 1;
|
|
|
- } else {
|
|
|
- openHour = Integer.parseInt(openArr[0]);
|
|
|
- }
|
|
|
- int openMinute = Integer.parseInt(openArr[1]);
|
|
|
- int closeHour = Integer.parseInt(closeArr[0]);
|
|
|
- //int closeHour = Integer.parseInt(closeArr[0])+1;
|
|
|
- int closeMinute = Integer.parseInt(closeArr[1]);
|
|
|
- if (openMinute < closeMinute) {
|
|
|
- closeHour += 1;
|
|
|
- }
|
|
|
- int len = closeHour - openHour;
|
|
|
- if (len > 1) {
|
|
|
- int i = ti == 0 ? 1 : 0;
|
|
|
- for (; i < len; i++) {//为每个作息点生成履职任务
|
|
|
- dateTime.setField(DateField.HOUR_OF_DAY, openHour + i);
|
|
|
- dateTime.setField(DateField.MINUTE, openMinute);
|
|
|
- //this.resumptionService.build(orgId, ResumptionType.HOUR, dateTime, true);
|
|
|
- //每个作息点的开始时间和结束时间,不能直接操作dateTime,后面的操作会覆盖前面的操作
|
|
|
- DateTime time1 = new DateTime(dateTime);
|
|
|
- time1.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
|
|
|
- DateTime time2 = new DateTime(dateTime);
|
|
|
- time2.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
|
|
|
- DateTime planstartTime = time1.setField(DateField.HOUR_OF_DAY, openHour + i).setField(DateField.MINUTE, openMinute).setField(DateField.SECOND, 0).setField(DateField.MILLISECOND, 0);
|
|
|
- DateTime planendTime = time2.setField(DateField.HOUR_OF_DAY, openHour + i + 1).setField(DateField.MINUTE, openMinute).setField(DateField.SECOND, 0).setField(DateField.MILLISECOND, 0);
|
|
|
- //for(Long roleId:roleIds){
|
|
|
- resumptionService.newbuild(orgId, ResumptionType.HOUR, dateTime, true, appPlan, null, pointList, roleIds, planstartTime, planendTime);
|
|
|
- // }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- } else {
|
|
|
-// RESUMPTIONLOG.error("{} 没有作息", ResumptionType.DAY.toYmd(dateTime));
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
+// @Async
|
|
|
+// public void syncHour(final DateTime dateTime, int plancycle) {//plancycle==6
|
|
|
+// //获取履职计划
|
|
|
+// List<AppPlan> appPlanList = appPlanService.list((new QueryWrapper<AppPlan>()).lambda()
|
|
|
+// .eq(AppPlan::getPlanStatus, 0)
|
|
|
+// .eq(AppPlan::getPlanCycle, plancycle)
|
|
|
+// .eq(AppPlan::getPlanType, 0)
|
|
|
+// .notIn(AppPlan::getPlanExec, canteenPlanExec));//findExecOrgByPlan(6);
|
|
|
+// for (AppPlan appPlan : appPlanList) {
|
|
|
+// //获取履职计划中对应的检查要点
|
|
|
+// List<AppRulePointTaskVo> pointList = appRulePointService.findPointByPlan(appPlan.getId());
|
|
|
+// if (pointList.size() <= 0) {//没有检查项不生成履职任务
|
|
|
+//// RESUMPTIONLOG.error("error:该计划ID:{}没有检查项", appPlan.getId());
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+// //根据计划获取履职任务执行机构
|
|
|
+// List<Long> orgIds = getPlanOrgIds(appPlan);
|
|
|
+// if (orgIds == null || orgIds.size() <= 0) {//没有检查项不生成履职任务
|
|
|
+//// RESUMPTIONLOG.error("error:该计划ID:{}没有执行机构", appPlan.getId());
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+// //获取履职角色
|
|
|
+// List<Long> roleIds = appPlanService.findRoleByPlan(appPlan.getId());
|
|
|
+// if (roleIds.size() <= 0) {//没有检查项不生成履职任务
|
|
|
+//// RESUMPTIONLOG.error("error:该计划ID:{}没有履职角色", appPlan.getId());
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+// //获取所有要点中的区域id
|
|
|
+// Set<Long> nfcBindIdList = new HashSet<>();
|
|
|
+// for (AppRulePointTaskVo p : pointList) {
|
|
|
+// if (p.getNfcBindId() != null && p.getPointScan() == 1) {
|
|
|
+// nfcBindIdList.add(p.getNfcBindId());
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// //根据区域获取区域内绑定的nfc
|
|
|
+// /* NFCBindJobDto jobDto = new NFCBindJobDto();
|
|
|
+// jobDto.setAreaIds(new ArrayList(areaList));
|
|
|
+// List<NFCBindPageVo> nfcList = nfcBindService.all(jobDto,NFCBindPageVo::to);*/
|
|
|
+// //获取有 作息的机构id
|
|
|
+// R<List<Long>> listR = workTimeService.findOrgIdsByYmd(dateTime.toString().substring(0, 10), SecurityConstants.INNER);
|
|
|
+// List<Long> orgIdsNew = new ArrayList<>();
|
|
|
+// if (listR.getCode() == 200) {
|
|
|
+// orgIdsNew = listR.getData();
|
|
|
+// }
|
|
|
+// List<Long> finalOrgIdsNew = orgIdsNew;
|
|
|
+// List<Long> orgIdList = orgIds.stream().filter(r -> finalOrgIdsNew.contains(r)).collect(Collectors.toList());
|
|
|
+// //List<Long> orgIdsNew = StreamHelper.filter(orgIds,(v)->workTimeList.contains(v));
|
|
|
+// for (final Long orgId : orgIdList) {
|
|
|
+// //获取当天的作息
|
|
|
+// /*NFCBindJobDto jobDto = new NFCBindJobDto();
|
|
|
+// jobDto.setNfcBindIdList(new ArrayList(nfcBindIdList));
|
|
|
+// jobDto.setOrgId(orgId);
|
|
|
+// List<NFCBindPageVo> nfcList = nfcBindService.all(jobDto,NFCBindPageVo::to);*/
|
|
|
+// Ymd ymd = toYmd(dateTime, "DAY");
|
|
|
+// ymd.setOrgId(orgId);
|
|
|
+// ymd.setEnable(true);
|
|
|
+// SysWorkTime workTime = workTimeService.findWorkTimeByYmd(ymd).getData();
|
|
|
+// if (workTime != null) {
|
|
|
+// List<String[]> workTimes = new ArrayList<>();
|
|
|
+// if (appPlan.getNotResumptionOnRest() != null && appPlan.getNotResumptionOnRest() == 1 &&
|
|
|
+// StringUtils.isNotEmpty(workTime.getNoonbreakStart()) && StringUtils.isNotEmpty(workTime.getNoonbreakEnd())) {
|
|
|
+// workTimes.add(new String[]{workTime.getOpenTime(), workTime.getNoonbreakStart()});
|
|
|
+// workTimes.add(new String[]{workTime.getNoonbreakEnd(), workTime.getCloseTime()});
|
|
|
+// } else {
|
|
|
+// workTimes.add(new String[]{workTime.getOpenTime(), workTime.getCloseTime()});
|
|
|
+// }
|
|
|
+// for (int ti = 0; ti < workTimes.size(); ti++) {
|
|
|
+// String[] time = workTimes.get(ti);
|
|
|
+// String openStr = time[0];
|
|
|
+// String closeStr = time[1];
|
|
|
+// String[] openArr = openStr.split(":");
|
|
|
+// String[] closeArr = closeStr.split(":");
|
|
|
+// /*如果营业前是00:00-09:00,营业后是17:00-24:00,
|
|
|
+// 当前每小时履职任务是10:00-16:00,少了09:00-10:00和16:00-17:00的任务,
|
|
|
+// 建议这2个时间段也生成履职任务*/
|
|
|
+// //如果有午休,要考虑分段第一段往前移1个小时第二段不移
|
|
|
+// int openHour = 0;
|
|
|
+// if (ti == 0) {
|
|
|
+// openHour = Integer.parseInt(openArr[0]) - 1;
|
|
|
+// } else {
|
|
|
+// openHour = Integer.parseInt(openArr[0]);
|
|
|
+// }
|
|
|
+// int openMinute = Integer.parseInt(openArr[1]);
|
|
|
+// int closeHour = Integer.parseInt(closeArr[0]);
|
|
|
+// //int closeHour = Integer.parseInt(closeArr[0])+1;
|
|
|
+// int closeMinute = Integer.parseInt(closeArr[1]);
|
|
|
+// if (openMinute < closeMinute) {
|
|
|
+// closeHour += 1;
|
|
|
+// }
|
|
|
+// int len = closeHour - openHour;
|
|
|
+// if (len > 1) {
|
|
|
+// int i = ti == 0 ? 1 : 0;
|
|
|
+// for (; i < len; i++) {//为每个作息点生成履职任务
|
|
|
+// dateTime.setField(DateField.HOUR_OF_DAY, openHour + i);
|
|
|
+// dateTime.setField(DateField.MINUTE, openMinute);
|
|
|
+// //this.resumptionService.build(orgId, ResumptionType.HOUR, dateTime, true);
|
|
|
+// //每个作息点的开始时间和结束时间,不能直接操作dateTime,后面的操作会覆盖前面的操作
|
|
|
+// DateTime time1 = new DateTime(dateTime);
|
|
|
+// time1.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
|
|
|
+// DateTime time2 = new DateTime(dateTime);
|
|
|
+// time2.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
|
|
|
+// DateTime planstartTime = time1.setField(DateField.HOUR_OF_DAY, openHour + i).setField(DateField.MINUTE, openMinute).setField(DateField.SECOND, 0).setField(DateField.MILLISECOND, 0);
|
|
|
+// DateTime planendTime = time2.setField(DateField.HOUR_OF_DAY, openHour + i + 1).setField(DateField.MINUTE, openMinute).setField(DateField.SECOND, 0).setField(DateField.MILLISECOND, 0);
|
|
|
+// //for(Long roleId:roleIds){
|
|
|
+// resumptionService.newbuild(orgId, ResumptionType.HOUR, dateTime, true, appPlan, null, pointList, roleIds, planstartTime, planendTime);
|
|
|
+// // }
|
|
|
+//
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// } else {
|
|
|
+//// RESUMPTIONLOG.error("{} 没有作息", ResumptionType.DAY.toYmd(dateTime));
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -395,19 +394,19 @@ public class ResumptionTaskBusiness {
|
|
|
nfcBindIdList.add(p.getNfcBindId());
|
|
|
}
|
|
|
}
|
|
|
+ Map<Long, Boolean> workingMap=orgWorkTimeStatusMap(new Date(), CycleCommonEnum.WEEKLY,orgIds);
|
|
|
for (Long orgId : orgIds) {
|
|
|
//根据区域获取区域内绑定的nfc
|
|
|
/*NFCBindJobDto jobDto = new NFCBindJobDto();
|
|
|
jobDto.setNfcBindIdList(new ArrayList(nfcBindIdList));
|
|
|
jobDto.setOrgId(orgId);
|
|
|
List<NFCBindPageVo> nfcList = nfcBindService.all(jobDto,NFCBindPageVo::to);*/
|
|
|
- // 判断这周是否有作息
|
|
|
- boolean isExist = workTimeService.existByYmd(Ymd.builder().year(yearWeek.getKey()).week(yearWeek.getValue()).orgId(orgId).isEnable(true).build()).getData();
|
|
|
-// final boolean isExist = false;
|
|
|
+
|
|
|
// 应该用周的第一天, 不然页面查是查询不到的
|
|
|
//dateTime即为本周第一天
|
|
|
//final Date dateTime = DateHelper.getFirstDayOfWeek(yearWeek.getKey(), yearWeek.getValue());
|
|
|
// for(Long roleId:roleIds){
|
|
|
+ boolean isExist=workingMap.containsKey(orgId) && workingMap.get(orgId);
|
|
|
this.resumptionService.newbuild(orgId, ResumptionType.WEEK, dateTime, isExist, appPlan, null, pointList, roleIds, planstartTime, planendTime);
|
|
|
//}
|
|
|
|
|
|
@@ -470,6 +469,7 @@ public class ResumptionTaskBusiness {
|
|
|
/* NFCBindJobDto jobDto = new NFCBindJobDto();
|
|
|
jobDto.setAreaIds(new ArrayList(areaList));
|
|
|
List<NFCBindPageVo> nfcList = nfcBindService.all(jobDto,NFCBindPageVo::to);*/
|
|
|
+ Map<Long, Boolean> workingMap=orgWorkTimeStatusMap(new Date(), CycleCommonEnum.MONTHLY,orgIds);
|
|
|
for (Long orgId : orgIds) {
|
|
|
/* NFCBindJobDto jobDto = new NFCBindJobDto();
|
|
|
jobDto.setNfcBindIdList(new ArrayList(nfcBindIdList));
|
|
|
@@ -477,12 +477,14 @@ public class ResumptionTaskBusiness {
|
|
|
List<NFCBindPageVo> nfcList = nfcBindService.all(jobDto,NFCBindPageVo::to);*/
|
|
|
// 判断这月是否有作息
|
|
|
// final boolean isExist = this.workTimeService.existByYmd(orgId, Ymd.builder().year(yearMonth.getKey()).month(yearMonth.getValue()).build(), true);
|
|
|
- final boolean isExist = workTimeService.existByYmd(Ymd.builder().year(yearMonth.getKey()).week(yearMonth.getValue()).orgId(orgId).isEnable(true).build()).getData();
|
|
|
+// final boolean isExist = workTimeService.existByYmd(Ymd.builder().year(yearMonth.getKey()).week(yearMonth.getValue()).orgId(orgId).isEnable(true).build())
|
|
|
+// .getData();
|
|
|
|
|
|
// 应该用月的第一天, 不然页面查是查询不到的
|
|
|
//dateTime即为本月第一天
|
|
|
//final Date dateTime = DateHelper.getFirstDayOfMonth(yearMonth.getKey(), yearMonth.getValue());
|
|
|
//for(Long roleId:roleIds){
|
|
|
+ boolean isExist=workingMap.containsKey(orgId) && workingMap.get(orgId);
|
|
|
this.resumptionService.newbuild(orgId, ResumptionType.MONTH, dateTime, isExist, appPlan, null, pointList, roleIds, planstartTime, planendTime);
|
|
|
// }
|
|
|
|
|
|
@@ -543,6 +545,7 @@ public class ResumptionTaskBusiness {
|
|
|
/* NFCBindJobDto jobDto = new NFCBindJobDto();
|
|
|
jobDto.setAreaIds(new ArrayList(areaList));
|
|
|
List<NFCBindPageVo> nfcList = nfcBindService.all(jobDto,NFCBindPageVo::to);*/
|
|
|
+ Map<Long, Boolean> workingMap=orgWorkTimeStatusMap(new Date(), CycleCommonEnum.QUARTERLY,orgIds);
|
|
|
for (Long orgId : orgIds) {
|
|
|
/* NFCBindJobDto jobDto = new NFCBindJobDto();
|
|
|
jobDto.setNfcBindIdList(new ArrayList(nfcBindIdList));
|
|
|
@@ -554,7 +557,8 @@ public class ResumptionTaskBusiness {
|
|
|
//dateTime即为本季度第一天
|
|
|
//final Date dateTime = DateHelper.getFirstDayOfQuarter(yearQuarter.getKey(), yearQuarter.getValue());
|
|
|
// for(Long roleId:roleIds){
|
|
|
- this.resumptionService.newbuild(orgId, ResumptionType.QUARTER, dateTime, true, appPlan, null, pointList, roleIds, planstartTime, planendTime);
|
|
|
+ boolean isExist=workingMap.containsKey(orgId) && workingMap.get(orgId);
|
|
|
+ this.resumptionService.newbuild(orgId, ResumptionType.QUARTER, dateTime, isExist, appPlan, null, pointList, roleIds, planstartTime, planendTime);
|
|
|
// }
|
|
|
}
|
|
|
}
|
|
|
@@ -613,13 +617,15 @@ public class ResumptionTaskBusiness {
|
|
|
/* NFCBindJobDto jobDto = new NFCBindJobDto();
|
|
|
jobDto.setAreaIds(new ArrayList(areaList));
|
|
|
List<NFCBindPageVo> nfcList = nfcBindService.all(jobDto,NFCBindPageVo::to);*/
|
|
|
+ Map<Long, Boolean> workingMap=orgWorkTimeStatusMap(new Date(), CycleCommonEnum.HALF_YEARLY,orgIds);
|
|
|
for (Long orgId : orgIds) {
|
|
|
/* NFCBindJobDto jobDto = new NFCBindJobDto();
|
|
|
jobDto.setNfcBindIdList(new ArrayList(nfcBindIdList));
|
|
|
jobDto.setOrgId(orgId);
|
|
|
List<NFCBindPageVo> nfcList = nfcBindService.all(jobDto,NFCBindPageVo::to);*/
|
|
|
//for(Long roleId:roleIds){
|
|
|
- this.resumptionService.newbuild(orgId, ResumptionType.HALFYEAR, dateTime, true, appPlan, null, pointList, roleIds, planstartTime, planendTime);
|
|
|
+ boolean isExist=workingMap.containsKey(orgId) && workingMap.get(orgId);
|
|
|
+ this.resumptionService.newbuild(orgId, ResumptionType.HALFYEAR, dateTime, isExist, appPlan, null, pointList, roleIds, planstartTime, planendTime);
|
|
|
// }
|
|
|
}
|
|
|
}
|
|
|
@@ -675,13 +681,15 @@ public class ResumptionTaskBusiness {
|
|
|
/* NFCBindJobDto jobDto = new NFCBindJobDto();
|
|
|
jobDto.setAreaIds(new ArrayList(areaList));
|
|
|
List<NFCBindPageVo> nfcList = nfcBindService.all(jobDto,NFCBindPageVo::to);*/
|
|
|
+ Map<Long, Boolean> workingMap=orgWorkTimeStatusMap(new Date(), CycleCommonEnum.YEARLY,orgIds);
|
|
|
for (Long orgId : orgIds) {
|
|
|
/*NFCBindJobDto jobDto = new NFCBindJobDto();
|
|
|
jobDto.setNfcBindIdList(new ArrayList(nfcBindIdList));
|
|
|
jobDto.setOrgId(orgId);
|
|
|
List<NFCBindPageVo> nfcList = nfcBindService.all(jobDto,NFCBindPageVo::to);*/
|
|
|
// for(Long roleId:roleIds){
|
|
|
- this.resumptionService.newbuild(orgId, ResumptionType.YEAR, dateTime, true, appPlan, null, pointList, roleIds, planstartTime, planendTime);
|
|
|
+ boolean isExist=workingMap.containsKey(orgId) && workingMap.get(orgId);
|
|
|
+ this.resumptionService.newbuild(orgId, ResumptionType.YEAR, dateTime, isExist, appPlan, null, pointList, roleIds, planstartTime, planendTime);
|
|
|
//}
|
|
|
|
|
|
}
|