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