|
@@ -2,16 +2,16 @@ package com.management.platform.controller;
|
|
|
|
|
|
import com.management.platform.entity.VisitPlan;
|
|
import com.management.platform.entity.VisitPlan;
|
|
import com.management.platform.service.VisitPlanService;
|
|
import com.management.platform.service.VisitPlanService;
|
|
-import com.management.platform.time.VisitPlanDelayHandler;
|
|
|
|
-import com.management.platform.time.VisitPlanDelayItem;
|
|
|
|
import com.management.platform.util.HttpRespMsg;
|
|
import com.management.platform.util.HttpRespMsg;
|
|
import org.springframework.format.annotation.DateTimeFormat;
|
|
import org.springframework.format.annotation.DateTimeFormat;
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
-import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("/visitPlan")
|
|
@RequestMapping("/visitPlan")
|
|
@@ -35,13 +35,13 @@ public class VisitPlanController {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@PostMapping("/addVisitPlan")
|
|
@PostMapping("/addVisitPlan")
|
|
- public HttpRespMsg testTask(
|
|
|
|
|
|
+ public HttpRespMsg addVisitPlan(
|
|
@RequestParam("planName") String planName,
|
|
@RequestParam("planName") String planName,
|
|
@RequestParam("customId") Integer customId,
|
|
@RequestParam("customId") Integer customId,
|
|
@RequestParam("customName") String customName,
|
|
@RequestParam("customName") String customName,
|
|
@RequestParam("inchargerId") String inchargerId,
|
|
@RequestParam("inchargerId") String inchargerId,
|
|
@RequestParam("visitGoal") Integer visitGoal,
|
|
@RequestParam("visitGoal") Integer visitGoal,
|
|
- @RequestParam("visitTime") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")Date visitTime,
|
|
|
|
|
|
+ @RequestParam("visitTime") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")Date visitTime,
|
|
@RequestParam("remark") String remark,
|
|
@RequestParam("remark") String remark,
|
|
@RequestParam("remindType") Integer remindType,
|
|
@RequestParam("remindType") Integer remindType,
|
|
@RequestParam(value = "remindTime",required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")Date remindTime
|
|
@RequestParam(value = "remindTime",required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")Date remindTime
|
|
@@ -85,7 +85,7 @@ public class VisitPlanController {
|
|
*/
|
|
*/
|
|
@PostMapping("/delayVisitPlan")
|
|
@PostMapping("/delayVisitPlan")
|
|
public HttpRespMsg delayVisitPlan(@RequestParam("planId") Long planId
|
|
public HttpRespMsg delayVisitPlan(@RequestParam("planId") Long planId
|
|
- ,@RequestParam("visitTime") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")Date visitTime
|
|
|
|
|
|
+ ,@RequestParam("visitTime") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")Date visitTime
|
|
, HttpServletRequest request){
|
|
, HttpServletRequest request){
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
httpRespMsg=visitPlanService.delayVisitPlan(planId,visitTime,request);
|
|
httpRespMsg=visitPlanService.delayVisitPlan(planId,visitTime,request);
|
|
@@ -115,30 +115,30 @@ public class VisitPlanController {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@PostMapping("/getPageVisitPlan")
|
|
@PostMapping("/getPageVisitPlan")
|
|
- public HttpRespMsg getPageVisitPlan(@RequestParam Integer pageIndex
|
|
|
|
- , @RequestParam Integer pageSize
|
|
|
|
- ,@RequestParam("calenderTime") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")Date calenderTime
|
|
|
|
|
|
+ public HttpRespMsg getPageVisitPlan(@RequestParam(value = "pageIndex",required = false) Integer pageIndex
|
|
|
|
+ , @RequestParam(value = "pageSize",required = false) Integer pageSize
|
|
|
|
+ ,@RequestParam("calenderDate")String calenderDate
|
|
,HttpServletRequest request){
|
|
,HttpServletRequest request){
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
- httpRespMsg = visitPlanService.getPageVisitPlan(pageIndex,pageSize,calenderTime,request);
|
|
|
|
|
|
+ httpRespMsg = visitPlanService.getPageVisitPlan(pageIndex,pageSize,calenderDate,request);
|
|
return httpRespMsg;
|
|
return httpRespMsg;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- @GetMapping("/getDelayQueue")
|
|
|
|
- public HttpRespMsg getDelayQueue(HttpServletRequest request) {
|
|
|
|
- HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
|
- VisitPlanDelayHandler tool = new VisitPlanDelayHandler();
|
|
|
|
- httpRespMsg.setData(tool.getAll());
|
|
|
|
- Object[] all = tool.getAll();
|
|
|
|
- for (Object obj : all) {
|
|
|
|
- VisitPlanDelayItem item = (VisitPlanDelayItem) obj;
|
|
|
|
- long delay = item.getDelay(TimeUnit.SECONDS);
|
|
|
|
- System.out.println("item== "+item.getVisitPlan().getPlanName()
|
|
|
|
- +",delayTime=== "+item.getDelayTime()
|
|
|
|
- +",delay=== "+delay
|
|
|
|
- );
|
|
|
|
- }
|
|
|
|
- return httpRespMsg;
|
|
|
|
- }
|
|
|
|
|
|
+// @GetMapping("/getDelayQueue")
|
|
|
|
+// public HttpRespMsg getDelayQueue(HttpServletRequest request) {
|
|
|
|
+// HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
|
+// VisitPlanDelayHandler tool = new VisitPlanDelayHandler();
|
|
|
|
+// httpRespMsg.setData(tool.getAll());
|
|
|
|
+// Object[] all = tool.getAll();
|
|
|
|
+// for (Object obj : all) {
|
|
|
|
+// VisitPlanDelayItem item = (VisitPlanDelayItem) obj;
|
|
|
|
+// long delay = item.getDelay(TimeUnit.SECONDS);
|
|
|
|
+// System.out.println("item== "+item.getVisitPlan().getPlanName()
|
|
|
|
+// +",delayTime=== "+item.getDelayTime()
|
|
|
|
+// +",delay=== "+delay
|
|
|
|
+// );
|
|
|
|
+// }
|
|
|
|
+// return httpRespMsg;
|
|
|
|
+// }
|
|
}
|
|
}
|