春风项目四线(合箱线、总装线)
wujian
2024-01-25 c6e06980cccbb86fa224633d3585f9164295bff1
提交 | 用户 | 时间
d9cf6b 1 package com.jcdm.main.bs.orderScheduling.controller;
J 2
766c03 3 import java.util.ArrayList;
d9cf6b 4 import java.util.List;
J 5 import javax.servlet.http.HttpServletResponse;
766c03 6
c6e069 7 import com.jcdm.common.core.domain.R;
766c03 8 import com.jcdm.common.utils.StringUtils;
c6e069 9 import com.jcdm.main.bs.orderScheduling.vo.LineChartVO;
d9cf6b 10 import org.springframework.security.access.prepost.PreAuthorize;
J 11 import org.springframework.beans.factory.annotation.Autowired;
12 import org.springframework.web.bind.annotation.GetMapping;
13 import org.springframework.web.bind.annotation.PostMapping;
14 import org.springframework.web.bind.annotation.PutMapping;
15 import org.springframework.web.bind.annotation.DeleteMapping;
16 import org.springframework.web.bind.annotation.PathVariable;
17 import org.springframework.web.bind.annotation.RequestBody;
18 import org.springframework.web.bind.annotation.RequestMapping;
19 import org.springframework.web.bind.annotation.RestController;
20 import com.jcdm.common.annotation.Log;
21 import com.jcdm.common.core.controller.BaseController;
22 import com.jcdm.common.core.domain.AjaxResult;
23 import com.jcdm.common.enums.BusinessType;
24 import com.jcdm.main.bs.orderScheduling.domain.BsOrderScheduling;
25 import com.jcdm.main.bs.orderScheduling.service.IBsOrderSchedulingService;
26 import com.jcdm.common.utils.poi.ExcelUtil;
27 import com.jcdm.common.core.page.TableDataInfo;
28
29 /**
30  * 订单排产Controller
31  * 
32  * @author jiang
2aea64 33  * @date 2024-01-13
d9cf6b 34  */
J 35 @RestController
36 @RequestMapping("/bs/orderScheduling")
37 public class BsOrderSchedulingController extends BaseController
38 {
39     @Autowired
40     private IBsOrderSchedulingService bsOrderSchedulingService;
41
42     /**
43      * 查询订单排产列表
44      */
45     @PreAuthorize("@ss.hasPermi('bs:orderScheduling:list')")
46     @GetMapping("/list")
47     public TableDataInfo list(BsOrderScheduling bsOrderScheduling)
48     {
29d394 49         startPage();
d9cf6b 50         List<BsOrderScheduling> list = bsOrderSchedulingService.selectBsOrderSchedulingList(bsOrderScheduling);
J 51         return getDataTable(list);
52     }
53
c6e069 54     /**
W 55      * 查询下线数量
56      */
57     @PreAuthorize("@ss.hasPermi('bs:orderScheduling:list')")
58     @GetMapping("/getOffLineNum")
59     public TableDataInfo getOffLineNum(BsOrderScheduling bsOrderScheduling)
60     {
61
62         List<LineChartVO> vo = bsOrderSchedulingService.getOffLineNum();
63         return getDataTable(vo);
64     }
65
6eaf05 66     @PreAuthorize("@ss.hasPermi('bs:orderScheduling:list')")
W 67     @GetMapping("/list2")
68     public TableDataInfo list2(BsOrderScheduling bsOrderScheduling)
69     {
b849f1 70 //        startPage();
766c03 71         List<BsOrderScheduling> list = new ArrayList<>();
C 72         if (StringUtils.isNotEmpty(bsOrderScheduling.getOrderNo())){
73             list = bsOrderSchedulingService.selectBsOrderSchedulingList(bsOrderScheduling);
74         }
d9cf6b 75         return getDataTable(list);
J 76     }
77
78     /**
79      * 导出订单排产列表
80      */
81     @PreAuthorize("@ss.hasPermi('bs:orderScheduling:export')")
82     @Log(title = "订单排产", businessType = BusinessType.EXPORT)
83     @PostMapping("/export")
84     public void export(HttpServletResponse response, BsOrderScheduling bsOrderScheduling)
85     {
86         List<BsOrderScheduling> list = bsOrderSchedulingService.selectBsOrderSchedulingList(bsOrderScheduling);
87         ExcelUtil<BsOrderScheduling> util = new ExcelUtil<BsOrderScheduling>(BsOrderScheduling.class);
88         util.exportExcel(response, list, "订单排产数据");
89     }
90
91     /**
92      * 获取订单排产详细信息
93      */
94     @PreAuthorize("@ss.hasPermi('bs:orderScheduling:query')")
2aea64 95     @GetMapping(value = "/{id}")
J 96     public AjaxResult getInfo(@PathVariable("id") Long id)
d9cf6b 97     {
2aea64 98         return success(bsOrderSchedulingService.selectBsOrderSchedulingById(id));
d9cf6b 99     }
J 100
101     /**
102      * 新增订单排产
103      */
104     @PreAuthorize("@ss.hasPermi('bs:orderScheduling:add')")
105     @Log(title = "订单排产", businessType = BusinessType.INSERT)
106     @PostMapping
107     public AjaxResult add(@RequestBody BsOrderScheduling bsOrderScheduling)
108     {
109         return toAjax(bsOrderSchedulingService.insertBsOrderScheduling(bsOrderScheduling));
110     }
111
112     /**
113      * 修改订单排产
114      */
115     @PreAuthorize("@ss.hasPermi('bs:orderScheduling:edit')")
116     @Log(title = "订单排产", businessType = BusinessType.UPDATE)
117     @PutMapping
118     public AjaxResult edit(@RequestBody BsOrderScheduling bsOrderScheduling)
119     {
120         return toAjax(bsOrderSchedulingService.updateBsOrderScheduling(bsOrderScheduling));
121     }
122
123     /**
124      * 删除订单排产
125      */
126     @PreAuthorize("@ss.hasPermi('bs:orderScheduling:remove')")
127     @Log(title = "订单排产", businessType = BusinessType.DELETE)
2aea64 128     @DeleteMapping("/{ids}")
J 129     public AjaxResult remove(@PathVariable Long[] ids)
d9cf6b 130     {
2aea64 131         return toAjax(bsOrderSchedulingService.deleteBsOrderSchedulingByIds(ids));
d9cf6b 132     }
J 133 }