提交 | 用户 | 时间
|
1ac2bc
|
1 |
package cn.stylefeng.guns.modular.zsx.bs.productRouteChildInfo.controller; |
懒 |
2 |
|
|
3 |
import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo; |
|
4 |
import cn.stylefeng.guns.modular.zsx.bs.productBomInfo.entity.ProductBomInfo; |
|
5 |
import cn.stylefeng.guns.modular.zsx.bs.productRouteChildInfo.entity.ProductRouteChildInfo; |
|
6 |
import cn.stylefeng.guns.modular.zsx.bs.productRouteChildInfo.model.params.ProductRouteChildInfoParam; |
|
7 |
import cn.stylefeng.guns.modular.zsx.bs.productRouteChildInfo.service.ProductRouteChildInfoService; |
|
8 |
import cn.stylefeng.guns.modular.zsx.bs.productRouteInfo.entity.ProductRouteInfo; |
|
9 |
import cn.stylefeng.guns.modular.zsx.bs.productRouteInfo.service.ProductRouteInfoService; |
|
10 |
import cn.stylefeng.roses.core.base.controller.BaseController; |
|
11 |
import cn.stylefeng.roses.core.mutidatasource.annotion.DataSource; |
|
12 |
import cn.stylefeng.roses.kernel.model.exception.RequestEmptyException; |
|
13 |
import cn.stylefeng.roses.kernel.model.response.ResponseData; |
|
14 |
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
15 |
import org.springframework.beans.factory.annotation.Autowired; |
|
16 |
import org.springframework.stereotype.Controller; |
|
17 |
import org.springframework.ui.Model; |
|
18 |
import org.springframework.web.bind.annotation.RequestMapping; |
|
19 |
import org.springframework.web.bind.annotation.RequestParam; |
|
20 |
import org.springframework.web.bind.annotation.ResponseBody; |
|
21 |
|
|
22 |
|
|
23 |
/** |
|
24 |
* 工艺路线子信息控制器 |
|
25 |
* |
|
26 |
* @author ruimin |
|
27 |
* @Date 2023-08-24 16:26:51 |
|
28 |
*/ |
|
29 |
@Controller |
|
30 |
@RequestMapping("/productRouteChildInfo") |
|
31 |
public class ProductRouteChildInfoController extends BaseController { |
|
32 |
|
|
33 |
private String PREFIX = "/modular/bs/productRouteChildInfo"; |
|
34 |
|
|
35 |
@Autowired |
|
36 |
private ProductRouteChildInfoService productRouteChildInfoService; |
|
37 |
|
|
38 |
@Autowired |
|
39 |
private ProductRouteInfoService productRouteInfoService; |
|
40 |
|
|
41 |
/** |
|
42 |
* 跳转到主页面 |
|
43 |
* |
|
44 |
* @author ruimin |
|
45 |
* @Date 2023-08-24 |
|
46 |
*/ |
|
47 |
@RequestMapping("") |
|
48 |
@DataSource(name = "self") |
|
49 |
public String index(@RequestParam("routeCode") String routeInfoCode, Model model) { |
|
50 |
model.addAttribute("routeInfoCode", routeInfoCode); |
|
51 |
ProductRouteInfo routeCode = productRouteInfoService.getOne(new QueryWrapper<ProductRouteInfo>().eq("route_code", routeInfoCode)); |
|
52 |
if (routeCode == null) { |
|
53 |
throw new RequestEmptyException(); |
|
54 |
} |
|
55 |
return PREFIX + "/productRouteChildInfo.html"; |
|
56 |
} |
|
57 |
|
|
58 |
/** |
|
59 |
* 新增页面 |
|
60 |
* |
|
61 |
* @author ruimin |
|
62 |
* @Date 2023-08-24 |
|
63 |
*/ |
|
64 |
@RequestMapping("/add") |
|
65 |
@DataSource(name = "self") |
|
66 |
public String add(@RequestParam("routeInfoCode") String routeInfoCode, Model model) { |
|
67 |
model.addAttribute("routeInfoCode", routeInfoCode); |
|
68 |
ProductRouteInfo routeCode = productRouteInfoService.getOne(new QueryWrapper<ProductRouteInfo>().eq("route_code", routeInfoCode)); |
|
69 |
if (routeCode == null) { |
|
70 |
throw new RequestEmptyException(); |
|
71 |
} |
|
72 |
return PREFIX + "/productRouteChildInfo_add.html"; |
|
73 |
} |
|
74 |
|
|
75 |
/** |
|
76 |
* 编辑页面 |
|
77 |
* |
|
78 |
* @author ruimin |
|
79 |
* @Date 2023-08-24 |
|
80 |
*/ |
|
81 |
@RequestMapping("/edit") |
|
82 |
public String edit() { |
|
83 |
return PREFIX + "/productRouteChildInfo_edit.html"; |
|
84 |
} |
|
85 |
|
|
86 |
/** |
|
87 |
* 新增接口 |
|
88 |
* |
|
89 |
* @author ruimin |
|
90 |
* @Date 2023-08-24 |
|
91 |
*/ |
|
92 |
@RequestMapping("/addItem") |
|
93 |
@ResponseBody |
|
94 |
@DataSource(name = "self") |
|
95 |
public ResponseData addItem(ProductRouteChildInfoParam productRouteChildInfoParam) { |
|
96 |
this.productRouteChildInfoService.add(productRouteChildInfoParam); |
|
97 |
return ResponseData.success(); |
|
98 |
} |
|
99 |
|
|
100 |
/** |
|
101 |
* 编辑接口 |
|
102 |
* |
|
103 |
* @author ruimin |
|
104 |
* @Date 2023-08-24 |
|
105 |
*/ |
|
106 |
@RequestMapping("/editItem") |
|
107 |
@ResponseBody |
|
108 |
@DataSource(name = "self") |
|
109 |
public ResponseData editItem(ProductRouteChildInfoParam productRouteChildInfoParam) { |
|
110 |
this.productRouteChildInfoService.update(productRouteChildInfoParam); |
|
111 |
return ResponseData.success(); |
|
112 |
} |
|
113 |
|
|
114 |
/** |
|
115 |
* 删除接口 |
|
116 |
* |
|
117 |
* @author ruimin |
|
118 |
* @Date 2023-08-24 |
|
119 |
*/ |
|
120 |
@RequestMapping("/delete") |
|
121 |
@ResponseBody |
|
122 |
@DataSource(name = "self") |
|
123 |
public ResponseData delete(ProductRouteChildInfoParam productRouteChildInfoParam) { |
|
124 |
this.productRouteChildInfoService.delete(productRouteChildInfoParam); |
|
125 |
return ResponseData.success(); |
|
126 |
} |
|
127 |
|
|
128 |
/** |
|
129 |
* 查看详情接口 |
|
130 |
* |
|
131 |
* @author ruimin |
|
132 |
* @Date 2023-08-24 |
|
133 |
*/ |
|
134 |
@RequestMapping("/detail") |
|
135 |
@ResponseBody |
|
136 |
@DataSource(name = "self") |
|
137 |
public ResponseData detail(ProductRouteChildInfoParam productRouteChildInfoParam) { |
|
138 |
ProductRouteChildInfo detail = this.productRouteChildInfoService.getById(productRouteChildInfoParam.getId()); |
|
139 |
return ResponseData.success(detail); |
|
140 |
} |
|
141 |
|
|
142 |
/** |
|
143 |
* 查询列表 |
|
144 |
* |
|
145 |
* @author ruimin |
|
146 |
* @Date 2023-08-24 |
|
147 |
*/ |
|
148 |
@ResponseBody |
|
149 |
@RequestMapping("/list") |
|
150 |
@DataSource(name = "self") |
|
151 |
public LayuiPageInfo list(ProductRouteChildInfoParam productRouteChildInfoParam) { |
|
152 |
return this.productRouteChildInfoService.findPageBySpec(productRouteChildInfoParam); |
|
153 |
} |
|
154 |
|
|
155 |
} |
|
156 |
|
|
157 |
|