package com.bofeng.wx.controller; import com.bofeng.entity.UserHelpAnaly; import com.bofeng.service.QzTaskReplyService; import com.bofeng.service.QzTaskService; import com.bofeng.service.WuYeService; import com.google.common.collect.Maps; import com.yvan.Model; import com.yvan.mvc.Pd; 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.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.servlet.ModelAndView; import java.util.ArrayList; import java.util.List; import java.util.Map; @RestController public class WuYeController { @Autowired private QzTaskService qzTaskService; @Autowired private WuYeService wuYeService; @Autowired private QzTaskReplyService qzTaskReplyService; @GetMapping("/wuye/home.html") public ModelAndView wuye(ModelMap model, @RequestParam(value = "userId", required = false, defaultValue = "0") Long userId) { Map queryParam = Maps.newLinkedHashMap(); queryParam.put("userId", "12345677"); queryParam.put("statistics", "M"); // List taskList = qzTaskService.selectAll(userId); // List rbList = rbService.selectAll(); // model.put("taskList", YvanUtil.toJsonPretty(taskList)); // model.put("rbList", YvanUtil.toJsonPretty(rbList)); return new ModelAndView("/wuye/home.ftl", model); } @GetMapping("/wuye/qiuzhu.html") public ModelAndView wuyeUserHelp(ModelMap model) { // List taskList = qzTaskService.selectAll(); // // model.put("taskList", YvanUtil.toJsonPretty(taskList)); return new ModelAndView("/wuye/qiuzhu.ftl", model); } @GetMapping("/wuye/fabu.html") public ModelAndView wuyePub(ModelMap model) { // List taskList = qzTaskService.selectAll(); // // model.put("taskList", YvanUtil.toJsonPretty(taskList)); return new ModelAndView("/wuye/fabu.ftl", model); } //小区求助的查看 @GetMapping("/wuye/userHelpAnaly") public Model taskQuery(@Pd(name = "queryDate") String queryDate, @Pd(name = "userId") Long userId) { return Model.newSuccess(wuYeService.queryUserHelpAnaly(userId, queryDate)); } @GetMapping("/wuye/userHelpAnaly1") public Model> taskQuery1(@Pd(name = "queryDate") String queryDate, @Pd(name = "userId") Long userId) { List lst = new ArrayList<>(); lst.add(wuYeService.queryUserHelpAnaly(userId, queryDate)); return Model.newSuccess(lst); } }