|
@@ -1,5 +1,6 @@
|
|
package org.springblade.sms.controller;
|
|
package org.springblade.sms.controller;
|
|
|
|
|
|
|
|
+import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
@@ -30,6 +31,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
@@ -63,9 +65,11 @@ public class AdsMarketTaskInfoController extends BladeController {
|
|
|
|
|
|
@GetMapping("/test/sms")
|
|
@GetMapping("/test/sms")
|
|
@ApiOperation(value = "测试发短信")
|
|
@ApiOperation(value = "测试发短信")
|
|
- @ApiImplicitParams({ @ApiImplicitParam(name = "taskId", value = "任务ID", dataType = "string", required = true),
|
|
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "taskId", value = "任务ID", dataType = "string", required = true),
|
|
@ApiImplicitParam(name = "mobile", value = "测试手机号", dataType = "string", required = true),
|
|
@ApiImplicitParam(name = "mobile", value = "测试手机号", dataType = "string", required = true),
|
|
- @ApiImplicitParam(name = "isSendSms", value = "是否发送短信(true-发送;false-不发送)", dataType = "boolean", required = true), })
|
|
|
|
|
|
+ @ApiImplicitParam(name = "isSendSms", value = "是否发送短信(true-发送;false-不发送)", dataType = "boolean", required = true),
|
|
|
|
+ })
|
|
public R<Kv> test(String mobile, boolean isSendSms, Long taskId) {
|
|
public R<Kv> test(String mobile, boolean isSendSms, Long taskId) {
|
|
AdsMarketTaskInfo task = adsMarketTaskInfoService.getById(taskId);
|
|
AdsMarketTaskInfo task = adsMarketTaskInfoService.getById(taskId);
|
|
if (task == null) {
|
|
if (task == null) {
|
|
@@ -103,8 +107,10 @@ public class AdsMarketTaskInfoController extends BladeController {
|
|
|
|
|
|
@GetMapping("/check")
|
|
@GetMapping("/check")
|
|
@ApiOperation(value = "任务审核")
|
|
@ApiOperation(value = "任务审核")
|
|
- @ApiImplicitParams({ @ApiImplicitParam(name = "taskId", value = "任务ID", dataType = "string", required = true),
|
|
|
|
- @ApiImplicitParam(name = "status", value = "审核状态(1-通过;2-作废)", dataType = "integer", required = true), })
|
|
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "taskId", value = "任务ID", dataType = "string", required = true),
|
|
|
|
+ @ApiImplicitParam(name = "status", value = "审核状态(1-通过;2-作废)", dataType = "integer", required = true),
|
|
|
|
+ })
|
|
public R<String> check(Long taskId, Integer status) {
|
|
public R<String> check(Long taskId, Integer status) {
|
|
AdsMarketTaskInfo task = adsMarketTaskInfoService.getById(taskId);
|
|
AdsMarketTaskInfo task = adsMarketTaskInfoService.getById(taskId);
|
|
String checkerId = String.valueOf(SecureUtil.getUserId());
|
|
String checkerId = String.valueOf(SecureUtil.getUserId());
|
|
@@ -128,8 +134,10 @@ public class AdsMarketTaskInfoController extends BladeController {
|
|
} else {
|
|
} else {
|
|
checker.setStatus(CheckStatus.no.getValue());
|
|
checker.setStatus(CheckStatus.no.getValue());
|
|
task.setCheckStatus(CheckStatus.no.getValue());
|
|
task.setCheckStatus(CheckStatus.no.getValue());
|
|
|
|
+ task.setCheckTime(new Date());
|
|
adsMarketTaskInfoService.updateById(task);
|
|
adsMarketTaskInfoService.updateById(task);
|
|
}
|
|
}
|
|
|
|
+ checker.setCheckTime(new Date());
|
|
checkerService.updateById(checker);
|
|
checkerService.updateById(checker);
|
|
|
|
|
|
// 所有审核人员是否都审核完成
|
|
// 所有审核人员是否都审核完成
|
|
@@ -138,6 +146,7 @@ public class AdsMarketTaskInfoController extends BladeController {
|
|
boolean isCheckOk = checkerService.isCheckOk(taskId);
|
|
boolean isCheckOk = checkerService.isCheckOk(taskId);
|
|
if (isAllChecked && isCheckOk) {
|
|
if (isAllChecked && isCheckOk) {
|
|
// 全票通过,更新任务审核状态
|
|
// 全票通过,更新任务审核状态
|
|
|
|
+ task.setCheckTime(new Date());
|
|
task.setCheckStatus(CheckStatus.ok.getValue());
|
|
task.setCheckStatus(CheckStatus.ok.getValue());
|
|
adsMarketTaskInfoService.updateById(task);
|
|
adsMarketTaskInfoService.updateById(task);
|
|
|
|
|
|
@@ -182,6 +191,15 @@ public class AdsMarketTaskInfoController extends BladeController {
|
|
if (params.getCheckStatus() != null) {
|
|
if (params.getCheckStatus() != null) {
|
|
where.append(" and t.check_status = " + params.getCheckStatus());
|
|
where.append(" and t.check_status = " + params.getCheckStatus());
|
|
}
|
|
}
|
|
|
|
+ if (params.getTaskType() != null) {
|
|
|
|
+ where.append(" and t.task_type = " + params.getTaskType());
|
|
|
|
+ }
|
|
|
|
+ if (params.getCheckTimeStart() != null) {
|
|
|
|
+ where.append(" and t.check_time >= '" + DateUtil.formatDateTime(params.getCheckTimeStart()) + "'");
|
|
|
|
+ }
|
|
|
|
+ if (params.getCheckTimeEnd() != null) {
|
|
|
|
+ where.append(" and t.check_time <= '" + DateUtil.formatDateTime(params.getCheckTimeEnd()) + "'");
|
|
|
|
+ }
|
|
|
|
|
|
StringBuffer join = new StringBuffer();
|
|
StringBuffer join = new StringBuffer();
|
|
if (StrUtil.isNotBlank(params.getCheckUserName())) {
|
|
if (StrUtil.isNotBlank(params.getCheckUserName())) {
|