廖井涛
2025-11-28 67f0be5a1d634ba3274fa9366ceacc3580f056b7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package com.northglass.web.device;
 
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
 
//打印引用 
 
import java.util.List;
import java.util.Map;
 
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
 
import com.northglass.entity.GlassNumberColor;
import com.northglass.service.device.Device;
import com.northglass.service.device.DeviceService;
 
@Controller
@RequestMapping(value = "/device")
public class DeviceController {
    
    @Autowired
    private DeviceService deviceService;
    
 
  //色系
    @RequestMapping(method=RequestMethod.GET, value="/createcolor")
    public String createcolor(Model model) throws IOException {
        model.addAttribute("colorHtml", deviceService.findColorHtml());
        return "device/createcolor";
    }
    
    //添加色系
    @RequestMapping(method=RequestMethod.POST, value="/addcolor")
    public String addcolor(Model model, GlassNumberColor color) throws IOException {
        deviceService.addcolor(color);
        return "redirect:/device/createcolor";
    }
    
    //删除色系deletecolor
    @RequestMapping(method=RequestMethod.GET, value="/deletecolor/{id}")
    public String deletecolor(Model model, @PathVariable("id") String id) throws IOException {
        deviceService.deletecolor(id);
        return "redirect:/device/createcolor";
    }
    
    //机器信息
    @RequestMapping(method=RequestMethod.GET, value="/getstatu")
    public String getstatu(Model model) throws IOException {
        model.addAttribute("shelfstatu", deviceService.getshelfstatu());
        return "device/getstatu";
    }
    
       
       
}