|
@@ -11,6 +11,9 @@ import io.swagger.annotations.ApiParam;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/workflow/task/")
|
|
@@ -46,7 +49,8 @@ public class PlanManageController {
|
|
|
@ApiParam(value = "任务内容", required = true) @RequestParam(required = true) String taskContent,
|
|
|
@ApiParam(value = "任务区域坐标", required = true) @RequestParam(required = true) String taskAreaShape,
|
|
|
@ApiParam(value = "任务区域名称", required = true) @RequestParam(required = true) String taskAreaName,
|
|
|
- @ApiParam(value = "创建者ID", required = true) @RequestParam(required = true) String createBy) {
|
|
|
+ @ApiParam(value = "创建者ID", required = true) @RequestParam(required = true) String createBy,
|
|
|
+ @ApiParam(value = "租户编号", required = true) @RequestParam(required = true) String tenantId) {
|
|
|
String planId=DatesUtil.formatDate(new Date(),"yyyyMMddHHmmss")+String.valueOf((int) (Math.random()*(9999-1000)+1000));
|
|
|
PlanManage record = new PlanManage();
|
|
|
record.setUserId(userId);
|
|
@@ -61,11 +65,32 @@ public class PlanManageController {
|
|
|
record.setTaskAreaShape(taskAreaShape);
|
|
|
record.setTaskAreaName(taskAreaName);
|
|
|
record.setCreateBy(createBy);
|
|
|
- record.setDateCreate(new Date(System.currentTimeMillis()));
|
|
|
+ record.setTenantId(tenantId);
|
|
|
+ record.setDateCreate(DatesUtil.parseDate(DatesUtil.formatNow(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
int rows = planManageService.insertSelective(record);
|
|
|
if(rows > 0) {
|
|
|
return new AjaxMessage(ResultStatus.OK);
|
|
|
}
|
|
|
return new AjaxMessage(ResultStatus.ERROR);
|
|
|
}
|
|
|
-}
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping("/plan/select")
|
|
|
+ @ApiOperation(value = "查询巡检计划")
|
|
|
+ public AjaxMessage<List<PlanManage>> selectPlan(
|
|
|
+ @ApiParam(value = "租户编号", required = true) @RequestParam(required = true) String tenantId,
|
|
|
+ @ApiParam(value = "计划单号或计划名称", required = true) @RequestParam(required = false) String key,
|
|
|
+ @ApiParam(value = "计划安排起始日期", required = true) @RequestParam(required = false) String startDate,
|
|
|
+ @ApiParam(value = "计划安排截至日期", required = true) @RequestParam(required = false) String endDate){
|
|
|
+
|
|
|
+ Map<String,Object> map =new HashMap<String,Object>();
|
|
|
+ map.put("tenantId",tenantId);
|
|
|
+ map.put("key",key);
|
|
|
+ map.put("startDate",startDate);
|
|
|
+ map.put("endDate",endDate);
|
|
|
+ List<PlanManage> list = planManageService.selectPlanByIdAndDate(map);
|
|
|
+
|
|
|
+ return new AjaxMessage<List<PlanManage>>(ResultStatus.OK,list);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|