|
|
@@ -46,6 +46,7 @@ public class TaskController {
|
|
|
private RemoteOrgService orgService;
|
|
|
@Autowired
|
|
|
private ISysResumptionService resumptionService;
|
|
|
+
|
|
|
@GetMapping("/dayTask")
|
|
|
public AjaxResult dayTask() {
|
|
|
// //执行周期为每周的履职计划Plan_cycle=0,6
|
|
|
@@ -112,6 +113,12 @@ public class TaskController {
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/updatetaskstatus")
|
|
|
+ public R<Boolean> updateTaskStatus() {
|
|
|
+ Boolean b = taskBusiness.updateTaskStatus();
|
|
|
+ return R.ok(b);
|
|
|
+ }
|
|
|
+
|
|
|
@PostMapping("/createResumption")
|
|
|
public void createResumption(@RequestBody doTaskDto request) {
|
|
|
String time = request.getTime();
|
|
|
@@ -164,6 +171,7 @@ public class TaskController {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
private void saveResumptionByOrgAndPlan(List<Long> orgIdsByPlanListNew, AppPlan plan, List<Long> roleIds, DateTime datetime) {
|
|
|
if (plan.getPlanCycle() == 2) {
|
|
|
//按天生成任务
|
|
|
@@ -194,6 +202,7 @@ public class TaskController {
|
|
|
saveResumptionByHour(orgIdsByPlanListNew, plan, roleIds, datetime);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
private void saveResumptionByHour(List<Long> orgIdsByPlanListNew, AppPlan appPlan, List<Long> roleIds, DateTime dateTime) {
|
|
|
for (final Long orgId : orgIdsByPlanListNew) {
|
|
|
Ymd y = ResumptionType.DAY.toYmd(dateTime);
|
|
|
@@ -255,6 +264,7 @@ public class TaskController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
private void saveResumptionByYear(List<Long> orgIdsByPlanListNew, AppPlan appPlan, List<Long> roleIds, DateTime dateTime) {
|
|
|
DateTime time1 = new DateTime(dateTime);
|
|
|
time1.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
|
|
|
@@ -266,6 +276,7 @@ public class TaskController {
|
|
|
this.resumptionService.newbuild(orgId, ResumptionType.YEAR, dateTime, true, appPlan, null, null, roleIds, planstartTime, planendTime);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
private void saveResumptionByHalfYear(List<Long> orgIdsByPlanListNew, AppPlan appPlan, List<Long> roleIds, DateTime dateTime) {
|
|
|
DateHelper dateHelper = new DateHelper(dateTime);
|
|
|
KeyValue<Integer, Integer> yearHalfYear = new KeyValue<>(DateUtil.year(dateTime), dateHelper.getHalfyear());
|
|
|
@@ -279,6 +290,7 @@ public class TaskController {
|
|
|
this.resumptionService.newbuild(orgId, ResumptionType.HALFYEAR, dateTime, true, appPlan, null, null, roleIds, planstartTime, planendTime);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
private void saveResumptionByQuarter(List<Long> orgIdsByPlanListNew, AppPlan appPlan, List<Long> roleIds, DateTime dateTime) {
|
|
|
KeyValue<Integer, Integer> yearQuarter = new KeyValue<>(DateUtil.year(dateTime), DateUtil.quarter(dateTime));
|
|
|
DateTime time1 = new DateTime(dateTime);
|
|
|
@@ -291,6 +303,7 @@ public class TaskController {
|
|
|
this.resumptionService.newbuild(orgId, ResumptionType.QUARTER, dateTime, true, appPlan, null, null, roleIds, planstartTime, planendTime);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
private void saveResumptionByMonth(List<Long> orgIdsByPlanListNew, AppPlan appPlan, List<Long> roleIds, DateTime dateTime) {
|
|
|
KeyValue<Integer, Integer> yearMonth = new KeyValue<>(DateUtil.year(dateTime), DateUtil.month(dateTime) + 1);
|
|
|
DateTime time1 = new DateTime(dateTime);
|
|
|
@@ -304,6 +317,7 @@ public class TaskController {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
private void saveResumptionByWeek(List<Long> orgIdsByPlanListNew, AppPlan appPlan, List<Long> roleIds, DateTime dateTime) {
|
|
|
KeyValue<Integer, Integer> yearWeek = new KeyValue<>(DateUtil.year(dateTime), DateUtil.weekOfYear(dateTime));
|
|
|
DateTime time1 = new DateTime(dateTime);
|
|
|
@@ -320,6 +334,7 @@ public class TaskController {
|
|
|
this.resumptionService.newbuild(orgId, ResumptionType.WEEK, dateTime, true, appPlan, null, null, roleIds, planstartTime, planendTime);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
private void saveResumptionByDay(List<Long> orgIdsByPlanListNew, AppPlan appPlan, List<Long> roleIds, DateTime dateTime) {
|
|
|
for (Long orgId : orgIdsByPlanListNew) {
|
|
|
Ymd y = ResumptionType.DAY.toYmd(dateTime);
|
|
|
@@ -370,10 +385,11 @@ public class TaskController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
private List<Long> getPlanOrgIds(AppPlan appPlan) {
|
|
|
List<Long> orgIds = null;
|
|
|
- if (appPlan.getExecType()!=null&&appPlan.getExecType() == 0) {//0机构类型需要安类型去机构里查询所以的机构
|
|
|
- orgIds = orgService.findListByOrgType(appPlan.getExecOrgType(),SecurityConstants.INNER).getData();
|
|
|
+ if (appPlan.getExecType() != null && appPlan.getExecType() == 0) {//0机构类型需要安类型去机构里查询所以的机构
|
|
|
+ orgIds = orgService.findListByOrgType(appPlan.getExecOrgType(), SecurityConstants.INNER).getData();
|
|
|
} else {
|
|
|
List<SysOrg> sysOrgs = orgService.selectByOrgType(appPlan.getExecOrgType(), SecurityConstants.INNER);
|
|
|
orgIds = sysOrgs.stream().map(SysOrg::getId).collect(Collectors.toList());
|