66 lines
1.9 KiB
Plaintext
66 lines
1.9 KiB
Plaintext
package com.bonus.camera.controller;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.Date;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.ui.Model;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import com.bonus.camera.beans.cameraBeans;
|
|
import com.bonus.camera.service.CamersService;
|
|
import com.bonus.seat.service.SeatService;
|
|
import com.bonus.sys.AjaxRes;
|
|
import com.bonus.sys.BaseController;
|
|
import com.bonus.sys.Page;
|
|
|
|
@Controller
|
|
@RequestMapping("/backstage/screen/")
|
|
public class ScreenController extends BaseController<cameraBeans> {
|
|
|
|
@Autowired
|
|
private CamersService service;
|
|
|
|
|
|
@Autowired
|
|
SeatService seatservice;
|
|
|
|
@RequestMapping("list")
|
|
public String List(Model model) {
|
|
return "/screen/cameraList";
|
|
}
|
|
@RequestMapping("findByPage")
|
|
public String findByPage(@RequestBody Page<cameraBeans> page, cameraBeans o, Model model) {
|
|
try {
|
|
o = page.getObj();
|
|
page = service.findByPageOne(o, page);
|
|
if (page.getResults() != null && page.getResults().size() != 0) {
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy");// 设置日期格式
|
|
String date = df.format(new Date());
|
|
for (int i = 0; i < page.getResults().size(); i++) {
|
|
cameraBeans bean = page.getResults().get(i);
|
|
page.getResults().set(i, bean);
|
|
}
|
|
}
|
|
model.addAttribute("page", page);
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
return "/screen/cameraDetails";
|
|
}
|
|
|
|
@RequestMapping("deleteApply")
|
|
@ResponseBody
|
|
public AjaxRes deleteApply(cameraBeans o) {
|
|
AjaxRes ar = getAjaxRes();
|
|
try {
|
|
ar = service.deleteApply(o);
|
|
} catch (Exception e) {
|
|
logger.error(e.toString(), e);
|
|
ar.setFailMsg("删除失败!");
|
|
}
|
|
return ar;
|
|
}
|
|
}
|