严智鑫
2025-11-13 945bc394f40d8af1072a53da9a94f24207124e6d
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
package com.northglass.web.shelf;
 
import java.util.Map;
 
import javax.servlet.ServletRequest;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
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 org.springside.modules.web.Servlets;
 
import com.google.common.collect.Maps;
import com.northglass.entity.ShelfMessage;
import com.northglass.service.loadmachinerack.LoadMachineRackService;
import com.northglass.service.shelf.ShelfMessageService;
import com.northglass.service.shelf.ShelfService;
import com.northglass.service.shelfmanager.ShelfManagerService;
import com.northglass.service.shelfrank.ShelfRankService;
import com.northglass.service.shelftask.ShelfTaskService;
 
@Controller
@RequestMapping(value="/shelf")
public class ShelfController {
    
    @Autowired
    private ShelfService shelfService;
    
    @Autowired
    private ShelfMessageService shelfMessageService;
    
    @Autowired
    private ShelfManagerService shelfManagerService;
    
    @Autowired
    private ShelfRankService shelfRankService;
    
    @Autowired
    private LoadMachineRackService loadMachineRackService;
    
    @Autowired
    private ShelfTaskService shelfTaskService;
    
    @RequestMapping(method=RequestMethod.GET, value="/message/{id}")
    public String message(
            @RequestParam(value="page", defaultValue="1") int pageNumber,
            @RequestParam(value="page.size", defaultValue="15") int pageSize,
            @RequestParam(value="softType", defaultValue="auto") String sortType,
            Model model,
            ServletRequest request,
            @PathVariable("id") Long id) {
        
        Map<String, Object> searchParams = Servlets.getParametersStartingWith(request, "search_");
        Page<ShelfMessage> shelfMessages = shelfMessageService.get(searchParams, pageNumber, pageSize, sortType);
        Map<String, String> sortTypes = Maps.newLinkedHashMap();
        sortTypes.put("auto", "自动");
        
        model.addAttribute("shelfMessages", shelfMessages);
        model.addAttribute("sortType", sortType);
        model.addAttribute("sortTypes", sortTypes);
        model.addAttribute("searchParams", Servlets.encodeParameterStringWithPrefix(searchParams, "search_"));
        
        return "shelf/message";
    }
    
    @RequestMapping(method=RequestMethod.GET, value="/editRankAndHoist")
    public String editRankAndHoist(Model model) {
        model.addAttribute("editShelfRankHtml", shelfService.getEditShelfRankHtml());
        model.addAttribute("editShelfHoistHtml", shelfService.getEditShelfHoistHtml());
        model.addAttribute("ShelfRankNumberList", shelfService.getShelfRankNumber());
        model.addAttribute("shelfRankInfo", shelfManagerService.getNewShelfRankInfo());
        model.addAttribute("loadAndShelfHoistInfo", shelfManagerService.getNewLoadAndShelfHoistInfo());
        return "shelf/editRankAndHoist";
    }
    
    @RequestMapping(method=RequestMethod.GET, value="/findRank/{id}")
    public String findRank(Model model,@ PathVariable("id") String id) {
        model.addAttribute("editShelfRankHtml", shelfService.getEditShelfRankHtml());
        model.addAttribute("editShelfHoistHtml", shelfService.getEditShelfHoistHtml());
        model.addAttribute("ShelfRankNumberList", shelfService.getShelfRankNumber());
        model.addAttribute("findShelfRankInfo", shelfService.getShelfRankInfo(id));
        model.addAttribute("rankUserInfo", shelfService.rankUserInfo(id));
        model.addAttribute("shelfRankInfo", shelfManagerService.getNewShelfRankInfo());
        model.addAttribute("loadAndShelfHoistInfo", shelfManagerService.getNewLoadAndShelfHoistInfo());
        return "shelf/editRankAndHoist";
    }
    
    //禁用料架
    @RequestMapping(method=RequestMethod.GET, value="/taboo/{id}")
    public String taboo(Model model,@ PathVariable("id") String id) {
        shelfService.taboo(id);
        return "redirect:/shelf/editRankAndHoist";
    }
    
  //解除禁用
    @RequestMapping(method=RequestMethod.GET, value="/noTaboo/{id}")
    public String noTaboo(Model model,@ PathVariable("id") String id) {
        shelfService.notaboo(id);
        return "redirect:/shelf/editRankAndHoist";
    }
}