package com.bonus.warningManage.controller; import java.util.HashMap; import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import com.bonus.ma.service.MachineService; import com.bonus.warningManage.beans.CheckWarningBean; import com.bonus.warningManage.beans.DirectAssignBean; import com.bonus.warningManage.service.CheckWarningService; import com.bonus.sys.AjaxRes; import com.bonus.sys.BaseController; import com.bonus.sys.GlobalConst; import com.bonus.sys.Page; import com.bonus.sys.UserShiroHelper; @Controller @RequestMapping("/backstage/checkWarning/") public class CheckWarningController extends BaseController { /*@Autowired private DirectAssignService service; @Autowired private SendNoticeService snService;*/ @Autowired private MachineService maservice; @Autowired private CheckWarningService warnService; @RequestMapping("list") public String index(Model model) { return "/warningManage/checkWarningList"; } /** * @Author 无畏 * @Date 2019-05-20 * @function 获得预警列表 * @param o * @return */ @RequestMapping(value = "findByPage", method = RequestMethod.POST) @ResponseBody public AjaxRes findByPage(Page page, CheckWarningBean o) { AjaxRes ar = getAjaxRes(); try { String companyId = UserShiroHelper.getRealCurrentUser().getCompanyId(); o.setOrgId(companyId); Page result = warnService.findByPage(o, page); Map p = new HashMap(); p.put("list", result); ar.setSucceed(page); } catch (Exception e) { logger.error(e.toString(), e); ar.setFailMsg(GlobalConst.DATA_FAIL); } return ar; } @RequestMapping(value = "updatearray", method = RequestMethod.POST) @ResponseBody public AjaxRes test(@RequestParam(value = "check_val[]") String[] check_val,HttpServletRequest request){ AjaxRes ar = getAjaxRes(); try { String nowchecktime = request.getParameter("nowchecktime"); String nextchecktime = request.getParameter("nextchecktime"); System.out.println(nowchecktime + nextchecktime); boolean flag = true; for(int i=0;i