|
@@ -3,6 +3,7 @@ package com.ruoyi.demo.controller;
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
import cn.dev33.satoken.annotation.SaIgnore;
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import com.ruoyi.common.core.domain.R;
|
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
import com.ruoyi.common.core.validate.AddGroup;
|
|
@@ -17,6 +18,7 @@ import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.validation.constraints.NotBlank;
|
|
|
+import java.util.Date;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/plan")
|
|
@@ -60,6 +62,27 @@ public class PlanController {
|
|
|
public R planDetail(@PathVariable String planId){
|
|
|
return R.ok(planService.getPlanDetail(planId));
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 修改广告计划时间段
|
|
|
+ * @param planId 广告计划id
|
|
|
+ * @param planStartTime 广告开始时间
|
|
|
+ * @param planEndTime 广告结束时间
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @SaCheckPermission("szzs:planManage:update")
|
|
|
+ @PutMapping("/update/time")
|
|
|
+ public R planUpdateTime(@NotBlank(message = "广告id不能为空") String planId,
|
|
|
+ String planStartTime,
|
|
|
+ String planEndTime){
|
|
|
+ if (planId == null)
|
|
|
+ return R.fail("广告id不能为空");
|
|
|
+ int i = planService.updateTime(planId, DateUtil.parse(planStartTime), DateUtil.parse(planEndTime));
|
|
|
+ if (i == 1)
|
|
|
+ return R.ok("修改成功");
|
|
|
+ if (i == -1)
|
|
|
+ return R.fail("无效广告id");
|
|
|
+ return R.fail("修改失败");
|
|
|
+ }
|
|
|
/**
|
|
|
* 投放广告计划
|
|
|
* @param equipmentCode 设备编号
|