|
@@ -21,8 +21,8 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
-import java.time.LocalTime;
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -82,8 +82,9 @@ public class FosterwxCashWorkClientController {
|
|
|
if (null == fosterwxCashWorkwxMobile) return AjaxResult.error("该账号未划入变现分组");
|
|
if (null == fosterwxCashWorkwxMobile) return AjaxResult.error("该账号未划入变现分组");
|
|
|
|
|
|
|
|
LocalDate now = LocalDate.now();
|
|
LocalDate now = LocalDate.now();
|
|
|
- LocalDateTime firstDateTime = LocalDateTime.of(now, LocalTime.MIN);
|
|
|
|
|
LocalDateTime lastDateTime = LocalDateTime.now();
|
|
LocalDateTime lastDateTime = LocalDateTime.now();
|
|
|
|
|
+ // 只获取一个小时前的
|
|
|
|
|
+ LocalDateTime firstDateTime = lastDateTime.minusHours(1);
|
|
|
|
|
|
|
|
LambdaQueryWrapper<FosterwxCashScheduleTaskList> fosterwxCashScheduleTaskListLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<FosterwxCashScheduleTaskList> fosterwxCashScheduleTaskListLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
// 企微任务
|
|
// 企微任务
|
|
@@ -98,7 +99,7 @@ public class FosterwxCashWorkClientController {
|
|
|
List<FosterwxCashScheduleTaskList> fosterwxCashScheduleTaskListList = fosterwxCashScheduleTaskListService.list(fosterwxCashScheduleTaskListLambdaQueryWrapper);
|
|
List<FosterwxCashScheduleTaskList> fosterwxCashScheduleTaskListList = fosterwxCashScheduleTaskListService.list(fosterwxCashScheduleTaskListLambdaQueryWrapper);
|
|
|
|
|
|
|
|
List<FosterwxCashBoxClientInfo> fosterwxCashBoxClientInfoList = new ArrayList<>();
|
|
List<FosterwxCashBoxClientInfo> fosterwxCashBoxClientInfoList = new ArrayList<>();
|
|
|
- fosterwxCashScheduleTaskListList.forEach(fosterwxCashScheduleTaskList -> {
|
|
|
|
|
|
|
+ for (FosterwxCashScheduleTaskList fosterwxCashScheduleTaskList : fosterwxCashScheduleTaskListList) {
|
|
|
// fosterwxCashScheduleTaskListService.updateById(new FosterwxCashScheduleTaskList() {{
|
|
// fosterwxCashScheduleTaskListService.updateById(new FosterwxCashScheduleTaskList() {{
|
|
|
// setId(fosterwxCashScheduleTaskList.getId());
|
|
// setId(fosterwxCashScheduleTaskList.getId());
|
|
|
// setStatus(5);
|
|
// setStatus(5);
|
|
@@ -112,6 +113,13 @@ public class FosterwxCashWorkClientController {
|
|
|
fosterwxCashScheduleTaskMobile.setCreateAt(LocalDateTime.now());
|
|
fosterwxCashScheduleTaskMobile.setCreateAt(LocalDateTime.now());
|
|
|
fosterwxCashScheduleTaskMobile.setUpdateAt(LocalDateTime.now());
|
|
fosterwxCashScheduleTaskMobile.setUpdateAt(LocalDateTime.now());
|
|
|
|
|
|
|
|
|
|
+ // 如果已经获取到任务过了就不在获取
|
|
|
|
|
+ if (fosterwxCashScheduleTaskMobileService.count(new LambdaQueryWrapper<FosterwxCashScheduleTaskMobile>().
|
|
|
|
|
+ eq(FosterwxCashScheduleTaskMobile::getTaskId, fosterwxCashScheduleTaskList.getId()).
|
|
|
|
|
+ eq(FosterwxCashScheduleTaskMobile::getGroupId, fosterwxCashScheduleTaskList.getGroupId()).
|
|
|
|
|
+ eq(FosterwxCashScheduleTaskMobile::getMobileId, fosterwxMobile.getId())) > 0)
|
|
|
|
|
+ continue;
|
|
|
|
|
+
|
|
|
fosterwxCashScheduleTaskMobileService.save(fosterwxCashScheduleTaskMobile);
|
|
fosterwxCashScheduleTaskMobileService.save(fosterwxCashScheduleTaskMobile);
|
|
|
|
|
|
|
|
// 获取任务详情
|
|
// 获取任务详情
|
|
@@ -122,8 +130,9 @@ public class FosterwxCashWorkClientController {
|
|
|
last("LIMIT 1"));
|
|
last("LIMIT 1"));
|
|
|
FosterwxCashBoxClientInfo fosterwxCashBoxClientInfo = new FosterwxCashBoxClientInfo();
|
|
FosterwxCashBoxClientInfo fosterwxCashBoxClientInfo = new FosterwxCashBoxClientInfo();
|
|
|
fosterwxCashBoxClientInfo.setTaskType(fosterwxCashScheduleTaskList.getTaskType());
|
|
fosterwxCashBoxClientInfo.setTaskType(fosterwxCashScheduleTaskList.getTaskType());
|
|
|
|
|
+ fosterwxCashBoxClientInfo.setId(fosterwxCashScheduleTaskMobile.getId());
|
|
|
if (3 == fosterwxCashScheduleTaskList.getTaskType()) {
|
|
if (3 == fosterwxCashScheduleTaskList.getTaskType()) {
|
|
|
- LambdaQueryWrapper<FosterwxCashWorkBoxClientInfo> fosterwxCashWorkBoxClientInfoLambdaQueryWrapper = new LambdaQueryWrapper<FosterwxCashWorkBoxClientInfo>();
|
|
|
|
|
|
|
+ LambdaQueryWrapper<FosterwxCashWorkBoxClientInfo> fosterwxCashWorkBoxClientInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
// fosterwxCashWorkBoxClientInfoLambdaQueryWrapper.like(FosterwxCashWorkBoxClientInfo::getWxid, fosterwxCashScheduleTaskList.getBoxGhid());
|
|
// fosterwxCashWorkBoxClientInfoLambdaQueryWrapper.like(FosterwxCashWorkBoxClientInfo::getWxid, fosterwxCashScheduleTaskList.getBoxGhid());
|
|
|
switch (fosterwxCashWorkwxTaskList.getBoxType()) {
|
|
switch (fosterwxCashWorkwxTaskList.getBoxType()) {
|
|
|
case 8:
|
|
case 8:
|
|
@@ -175,7 +184,7 @@ public class FosterwxCashWorkClientController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
fosterwxCashBoxClientInfoList.add(fosterwxCashBoxClientInfo);
|
|
fosterwxCashBoxClientInfoList.add(fosterwxCashBoxClientInfo);
|
|
|
- });
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
return AjaxResult.success(fosterwxCashBoxClientInfoList);
|
|
return AjaxResult.success(fosterwxCashBoxClientInfoList);
|
|
|
}
|
|
}
|
|
@@ -269,10 +278,13 @@ public class FosterwxCashWorkClientController {
|
|
|
return "新增修改成功!";
|
|
return "新增修改成功!";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @PostMapping(value = "/changeTaskMobileStatus", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
|
|
|
|
|
|
|
+ @PostMapping(value = "/changeStatus", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
|
|
|
@ApiOperation(value = "客户端返回发送状态 根据id更新状态<br>状态(1:待发送;2:发送中;3:已发送;4:已过期;5:发送失败)")
|
|
@ApiOperation(value = "客户端返回发送状态 根据id更新状态<br>状态(1:待发送;2:发送中;3:已发送;4:已过期;5:发送失败)")
|
|
|
public Object changeTaskMobileStatus(FosterwxCashScheduleTaskMobile fosterwxCashScheduleTaskMobile) {
|
|
public Object changeTaskMobileStatus(FosterwxCashScheduleTaskMobile fosterwxCashScheduleTaskMobile) {
|
|
|
- fosterwxCashScheduleTaskMobileService.updateById(fosterwxCashScheduleTaskMobile);
|
|
|
|
|
|
|
+ Arrays.asList(fosterwxCashScheduleTaskMobile.getIds().split(",")).forEach(id -> {
|
|
|
|
|
+ fosterwxCashScheduleTaskMobile.setId(Integer.valueOf(id));
|
|
|
|
|
+ fosterwxCashScheduleTaskMobileService.updateById(fosterwxCashScheduleTaskMobile);
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
return AjaxResult.success("更新成功!");
|
|
return AjaxResult.success("更新成功!");
|
|
|
}
|
|
}
|