|
|
@@ -1,16 +1,13 @@
|
|
|
package com.mokamrp.privates.controller.pangu;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.mokamrp.privates.entity.pangu.FosterwxCashBoxClientInfo;
|
|
|
import com.mokamrp.privates.entity.pangu.FosterwxWorkServeHandle;
|
|
|
import com.mokamrp.privates.help.AjaxResult;
|
|
|
-import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashMobile;
|
|
|
-import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashScheduleTaskList;
|
|
|
-import com.mokamrp.privates.mapper.pangu.pojo.FosterwxMobile;
|
|
|
+import com.mokamrp.privates.mapper.pangu.pojo.*;
|
|
|
import com.mokamrp.privates.mapper.pojo.Corp;
|
|
|
import com.mokamrp.privates.service.CorpService;
|
|
|
-import com.mokamrp.privates.service.pangu.FosterwxCashMobileService;
|
|
|
-import com.mokamrp.privates.service.pangu.FosterwxCashScheduleTaskListService;
|
|
|
-import com.mokamrp.privates.service.pangu.FosterwxMobileService;
|
|
|
+import com.mokamrp.privates.service.pangu.*;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -23,6 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.LocalTime;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
@@ -48,6 +46,12 @@ public class FosterwxCashWorkClientController {
|
|
|
@Autowired
|
|
|
private FosterwxCashMobileService fosterwxCashMobileService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private FosterwxCashWorkBoxClientInfoService fosterwxCashWorkBoxClientInfoService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private FosterwxCashWorkwxTaskListService fosterwxCashWorkwxTaskListService;
|
|
|
+
|
|
|
|
|
|
@PostMapping("/getTaskInfo")
|
|
|
@ApiOperation(value = "返回凌晨到当前时间的未发送的数据,主体 昵称/团队id 昵称 两两一组必须有数据")
|
|
|
@@ -85,12 +89,49 @@ public class FosterwxCashWorkClientController {
|
|
|
|
|
|
List<FosterwxCashScheduleTaskList> fosterwxCashScheduleTaskListList = fosterwxCashScheduleTaskListService.list(fosterwxCashScheduleTaskListLambdaQueryWrapper);
|
|
|
|
|
|
+ List<FosterwxCashBoxClientInfo> fosterwxCashBoxClientInfoList = new ArrayList<>();
|
|
|
fosterwxCashScheduleTaskListList.forEach(fosterwxCashScheduleTaskList -> {
|
|
|
fosterwxCashScheduleTaskListService.updateById(new FosterwxCashScheduleTaskList() {{
|
|
|
setId(fosterwxCashScheduleTaskList.getId());
|
|
|
setStatus(5);
|
|
|
setUpdateAt(LocalDateTime.now());
|
|
|
}});
|
|
|
+
|
|
|
+ // 获取任务详情
|
|
|
+ FosterwxCashWorkwxTaskList fosterwxCashWorkwxTaskList = fosterwxCashWorkwxTaskListService.getOne(new LambdaQueryWrapper<FosterwxCashWorkwxTaskList>().
|
|
|
+ eq(FosterwxCashWorkwxTaskList::getTemplateId, fosterwxCashScheduleTaskList.getTemplateId()).
|
|
|
+ eq(FosterwxCashWorkwxTaskList::getCatalogId, fosterwxCashScheduleTaskList.getTaskId()).
|
|
|
+ eq(FosterwxCashWorkwxTaskList::getId, fosterwxCashScheduleTaskList.getChildTaskId()).
|
|
|
+ last("LIMIT 1"));
|
|
|
+ FosterwxCashBoxClientInfo fosterwxCashBoxClientInfo = new FosterwxCashBoxClientInfo();
|
|
|
+ if (1 == fosterwxCashScheduleTaskList.getTaskType() || 3 == fosterwxCashScheduleTaskList.getTaskType()) {
|
|
|
+ FosterwxCashWorkBoxClientInfo fosterwxCashWorkBoxClientInfo = fosterwxCashWorkBoxClientInfoService.getOne(new LambdaQueryWrapper<FosterwxCashWorkBoxClientInfo>().eq(FosterwxCashWorkBoxClientInfo::getGhid, fosterwxCashScheduleTaskList.getBoxGhid()));
|
|
|
+ FosterwxCashBoxClientInfo.BoxInfo boxInfo = fosterwxCashBoxClientInfo.new BoxInfo();
|
|
|
+ boxInfo.setGhid(fosterwxCashWorkBoxClientInfo.getGhid());
|
|
|
+ boxInfo.setWxid(fosterwxCashWorkBoxClientInfo.getWxid());
|
|
|
+ boxInfo.setName(fosterwxCashWorkBoxClientInfo.getName());
|
|
|
+ boxInfo.setTitle(fosterwxCashWorkwxTaskList.getTitle());
|
|
|
+ boxInfo.setEnterpoint(fosterwxCashScheduleTaskList.getBoxUrl());
|
|
|
+ boxInfo.setHeadimg(fosterwxCashWorkBoxClientInfo.getHeadimg());
|
|
|
+ boxInfo.setImage_key1(fosterwxCashWorkBoxClientInfo.getImageKey1());
|
|
|
+ boxInfo.setImage_key2(fosterwxCashWorkBoxClientInfo.getImageKey2());
|
|
|
+ boxInfo.setImage_key3(fosterwxCashWorkBoxClientInfo.getImageKey3());
|
|
|
+ boxInfo.setImageSize(fosterwxCashWorkBoxClientInfo.getImageSize());
|
|
|
+ boxInfo.setAppType(fosterwxCashWorkBoxClientInfo.getAppType());
|
|
|
+ boxInfo.setDesc(fosterwxCashWorkBoxClientInfo.getDesc());
|
|
|
+
|
|
|
+ fosterwxCashBoxClientInfo.setBoxInfo(boxInfo);
|
|
|
+ } else if (2 == fosterwxCashScheduleTaskList.getTaskType()) {
|
|
|
+ FosterwxCashBoxClientInfo.UrlInfo urlInfo = fosterwxCashBoxClientInfo.new UrlInfo();
|
|
|
+ urlInfo.setTitle(fosterwxCashWorkwxTaskList.getUrlTitle());
|
|
|
+ urlInfo.setDesc(fosterwxCashWorkwxTaskList.getUrlDesc());
|
|
|
+ urlInfo.setUrl(fosterwxCashScheduleTaskList.getSendUrl());
|
|
|
+ urlInfo.setImage_url(fosterwxCashWorkwxTaskList.getUrlImage());
|
|
|
+
|
|
|
+ fosterwxCashBoxClientInfo.setUrlInfo(urlInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+ fosterwxCashBoxClientInfoList.add(fosterwxCashBoxClientInfo);
|
|
|
});
|
|
|
|
|
|
return AjaxResult.success(fosterwxCashScheduleTaskListList);
|
|
|
@@ -165,4 +206,12 @@ public class FosterwxCashWorkClientController {
|
|
|
|
|
|
return "参数没有设置全,无法根据现有信息获取任务";
|
|
|
}
|
|
|
+
|
|
|
+ @PostMapping("saveBoxInfo")
|
|
|
+ @ApiOperation(value = "保存小程序信息,已经保存过的小程序更新处理")
|
|
|
+ public Object saveBoxInfo(@RequestBody FosterwxCashWorkBoxClientInfo fosterwxCashWorkBoxClientInfo) {
|
|
|
+ fosterwxCashWorkBoxClientInfoService.saveOrUpdate(fosterwxCashWorkBoxClientInfo);
|
|
|
+
|
|
|
+ return "新增修改成功!";
|
|
|
+ }
|
|
|
}
|