|
@@ -1,97 +1,145 @@
|
|
|
package com.bofeng.wx.controller;
|
|
|
|
|
|
-import com.baomidou.mybatisplus.toolkit.IdWorker;
|
|
|
-import com.bofeng.Consts;
|
|
|
-import com.bofeng.JwtHelper;
|
|
|
-import com.bofeng.dao.UserOpenMapper;
|
|
|
+
|
|
|
import com.bofeng.entity.*;
|
|
|
import com.bofeng.service.*;
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
-import com.google.common.collect.Maps;
|
|
|
import com.yvan.Model;
|
|
|
import com.yvan.ModelOps;
|
|
|
-import com.yvan.mvc.JsonBody;
|
|
|
import com.yvan.mvc.Pd;
|
|
|
import com.yvan.platform.JsonWapper;
|
|
|
-import com.yvan.platform.YvanUtil;
|
|
|
-import lombok.val;
|
|
|
-import lombok.var;
|
|
|
-import me.chanjar.weixin.mp.bean.result.WxMpUser;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
-import javax.annotation.PreDestroy;
|
|
|
import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+
|
|
|
+import com.yvan.platform.JsonWapper;
|
|
|
|
|
|
@RestController
|
|
|
public class HomeController {
|
|
|
|
|
|
- @Autowired
|
|
|
- private HomeService homeService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private QzTaskService qzTaskService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private QzTaskReplyService qzTaskReplyService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private MsReportService msReportService;
|
|
|
-
|
|
|
-
|
|
|
- @GetMapping("/home/home.html")
|
|
|
- public ModelAndView home(ModelMap model) throws JsonProcessingException {
|
|
|
- model.put("user", new JsonWapper("{\"www\": \"er\"}"));
|
|
|
- //初始化今日日报
|
|
|
- UserOpen userOpen = homeService.getUserOpen();
|
|
|
- Long userId = userOpen.getUserId();
|
|
|
- // Long userId = 1224706869998772226L;
|
|
|
- MsReport msReport = msReportService.getReportByDateNow(userId);
|
|
|
- model.put("msReport", new JsonWapper(msReport));
|
|
|
- return new ModelAndView("/home/home.ftl", model);
|
|
|
+ @Autowired
|
|
|
+ private HomeService homeService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private QzTaskService qzTaskService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private QzTaskReplyService qzTaskReplyService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private MsReportService msReportService;
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping("/home/home.html")
|
|
|
+ public ModelAndView home(ModelMap model) throws JsonProcessingException {
|
|
|
+ model.put("user", new JsonWapper("{\"www\": \"er\"}"));
|
|
|
+ //初始化今日日报
|
|
|
+ UserOpen userOpen = homeService.getUserOpen();
|
|
|
+ Long userId = userOpen.getUserId();
|
|
|
+ // Long userId = 1224706869998772226L;
|
|
|
+ MsReport msReport = msReportService.getReportByDateNow(userId);
|
|
|
+ model.put("msReport", new JsonWapper(msReport));
|
|
|
+ return new ModelAndView("/home/home.ftl", model);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //家庭求助
|
|
|
+ @GetMapping("/home/home/addFimaly")
|
|
|
+ public ModelOps family(@Pd(name = "taskTitle") String taskTitle,
|
|
|
+ @Pd(name = "taskTarget") String taskTarget,
|
|
|
+ @Pd(name = "remark") String remark,
|
|
|
+ @Pd(name = "userId", required = false) Long userId) {
|
|
|
+ return ModelOps.newSuccess(qzTaskService.addHelp(taskTitle, taskTarget, remark, userId));
|
|
|
+ }
|
|
|
+
|
|
|
+ //我的在求助的展示
|
|
|
+ @GetMapping("/home/home/queryQzTask")
|
|
|
+ public Model<List<QzTask>> queryQzTask(@Pd(name = "taskStatus", required = false) Integer taskStatus,
|
|
|
+ @Pd(name = "taskTitle", required = false) String taskTitle,
|
|
|
+ @Pd(name = "userId", required = false) Long userId) {
|
|
|
+ return Model.newSuccess(qzTaskService.queryQzTask(taskStatus, taskTitle, userId));
|
|
|
+ }
|
|
|
+
|
|
|
+ //我的在求助的展示
|
|
|
+ @GetMapping("/home/home/queryQzTaskxq")
|
|
|
+ public Model<List<QzTask>> queryQzTaskxq(@Pd(name = "userId", required = false) Long userId) {
|
|
|
+ return Model.newSuccess(qzTaskService.queryQzTaskxq(userId));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //页面存储taskId
|
|
|
+ @GetMapping("/home/qiuzhu/reply.json")
|
|
|
+ public ModelOps taskQueryTaskId(@RequestParam(value = "taskId") Long taskId) {
|
|
|
+ int i = qzTaskService.taskQueryTaskId(taskId);
|
|
|
+ return ModelOps.newSuccess(i);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //小区求助的查看
|
|
|
+ @GetMapping("/home/home/taskQuery")
|
|
|
+ public Model<QzTask> taskQuery(@Pd(name = "taskId") Long taskId) {
|
|
|
+ return Model.newSuccess(qzTaskService.queryByTaskId(taskId));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/home/home_new.html")
|
|
|
+ public ModelAndView hmoe_new(ModelMap model) {
|
|
|
+ model.put("user", new JsonWapper("{\"www\": \"er\"}"));
|
|
|
+ return new ModelAndView("/home/home_new.ftl", model);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/quzhu/home/quxiao.html")
|
|
|
+ public ModelAndView quxiao(@Pd(name = "taskId") Long taskId, @Pd(name = "userId") Long userId, ModelMap model) throws JsonProcessingException {
|
|
|
+ QzTask task = qzTaskService.queryByTaskId(taskId);
|
|
|
+
|
|
|
+ //回复人的id
|
|
|
+ QzTaskReply qzTaskReply = qzTaskReplyService.selectId(taskId);
|
|
|
+ Long userId1 = null;
|
|
|
+ if (qzTaskReply != null) {
|
|
|
+ userId1 = qzTaskReply.getUserId();
|
|
|
}
|
|
|
|
|
|
|
|
|
- //家庭求助
|
|
|
- @GetMapping("/home/home/addFimaly")
|
|
|
- public ModelOps family(@Pd(name = "taskTitle") String taskTitle,
|
|
|
- @Pd(name = "taskTarget") String taskTarget,
|
|
|
- @Pd(name = "remark") String remark,
|
|
|
- @Pd(name = "userId", required = false) Long userId) {
|
|
|
- return ModelOps.newSuccess(qzTaskService.addHelp(taskTitle, taskTarget, remark, userId));
|
|
|
- }
|
|
|
-
|
|
|
- //我的在求助的展示
|
|
|
- @GetMapping("/home/home/queryQzTask")
|
|
|
- public Model<List<QzTask>> queryQzTask(@Pd(name = "taskStatus", required = false) Integer taskStatus,
|
|
|
- @Pd(name = "taskTitle", required = false) String taskTitle,
|
|
|
- @Pd(name = "userId", required = false) Long userId) {
|
|
|
- return Model.newSuccess(qzTaskService.queryQzTask(taskStatus, taskTitle, userId));
|
|
|
+// A业委会,B居委会,C物业,D志愿者
|
|
|
+ StringBuffer target = new StringBuffer();
|
|
|
+ if (task.getTaskTarget().equals("A")) {
|
|
|
+ target.append("业委会");
|
|
|
+ } else if (task.getTaskTarget().equals("B")) {
|
|
|
+ if (target.length() > 0) {
|
|
|
+ target.append("、居委会");
|
|
|
+ } else {
|
|
|
+ target.append("居委会");
|
|
|
+ }
|
|
|
+ } else if (task.getTaskTarget().equals("C")) {
|
|
|
+ if (target.length() > 0) {
|
|
|
+ target.append("、物业");
|
|
|
+ } else {
|
|
|
+ target.append("物业");
|
|
|
+ }
|
|
|
+ } else if (task.getTaskTarget().equals("D")) {
|
|
|
+ if (target.length() > 0) {
|
|
|
+ target.append("、志愿者");
|
|
|
+ } else {
|
|
|
+ target.append("志愿者");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+ task.setTaskTarget(target.toString());
|
|
|
|
|
|
- //页面存储taskId
|
|
|
- @GetMapping("/home/qiuzhu/reply.json")
|
|
|
- public ModelOps taskQueryTaskId(@RequestParam(value = "taskId") Long taskId) {
|
|
|
- int i = qzTaskService.taskQueryTaskId(taskId);
|
|
|
- return ModelOps.newSuccess(i);
|
|
|
- }
|
|
|
+ model.put("taskJson", new JsonWapper(task));
|
|
|
+ model.put("task", task);
|
|
|
+ model.put("userId", "\"" + userId + "\"");
|
|
|
+ model.put("YeuserId", "\"" + userId1 + "\"");
|
|
|
+ return new ModelAndView("/home/htlpXq.ftl", model);
|
|
|
+ }
|
|
|
|
|
|
- //小区求助的查看
|
|
|
- @GetMapping("/home/home/taskQuery")
|
|
|
- public Model<List<QzTaskReply>> taskQuery(@Pd(name = "taskId") Long taskId) {
|
|
|
- return Model.newSuccess(qzTaskReplyService.taskQuery(taskId));
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping("/home/home_new.html")
|
|
|
- public ModelAndView hmoe_new(ModelMap model) {
|
|
|
- model.put("user", new JsonWapper("{\"www\": \"er\"}"));
|
|
|
- return new ModelAndView("/home/home_new.ftl", model);
|
|
|
- }
|
|
|
+ @PostMapping("home/qiuzhu/getData")
|
|
|
+ public Model<List<QzTaskReply>> getData(@Pd(name = "taskId") Long taskId) {
|
|
|
+ return Model.newSuccess(qzTaskReplyService.taskQuery(taskId));
|
|
|
+ }
|
|
|
}
|