|
@@ -20,8 +20,8 @@ import java.util.List;
|
20
|
20
|
|
21
|
21
|
/**
|
22
|
22
|
* <p>
|
23
|
|
- * 销售批次表 前端控制器
|
24
|
|
- * </p>
|
|
23
|
+ * 销售批次表 前端控制器
|
|
24
|
+ * </p>
|
25
|
25
|
*
|
26
|
26
|
* @author jobob
|
27
|
27
|
* @since 2020-02-10
|
|
@@ -38,26 +38,27 @@ public class TaSalesBatchController extends BaseController {
|
38
|
38
|
|
39
|
39
|
/**
|
40
|
40
|
* 分页查询列表
|
|
41
|
+ *
|
41
|
42
|
* @param pageNum
|
42
|
43
|
* @param pageSize
|
43
|
44
|
* @return
|
44
|
45
|
*/
|
45
|
|
- @RequestMapping(value="/admin/taSalesBatch",method= RequestMethod.GET)
|
46
|
|
- public ResponseBean taSalesBatchList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
|
47
|
|
- @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
|
48
|
|
- @RequestParam(value ="salesBatchName", required = false) String salesBatchName,
|
49
|
|
- @RequestParam(value ="buildingId", required = false) String buildingId,
|
50
|
|
- @RequestParam(value = "status", required = false) Integer status, HttpServletRequest request){
|
|
46
|
+ @RequestMapping(value = "/admin/taSalesBatch", method = RequestMethod.GET)
|
|
47
|
+ public ResponseBean taSalesBatchList(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
|
48
|
+ @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
|
49
|
+ @RequestParam(value = "salesBatchName", required = false) String salesBatchName,
|
|
50
|
+ @RequestParam(value = "buildingId", required = false) String buildingId,
|
|
51
|
+ @RequestParam(value = "status", required = false) Integer status, HttpServletRequest request) {
|
51
|
52
|
ResponseBean responseBean = new ResponseBean();
|
52
|
53
|
try {
|
53
|
54
|
//使用分页插件
|
54
|
|
- IPage<TaSalesBatch> pg = new Page<>(pageNum, pageSize);
|
|
55
|
+ IPage<TaSalesBatch> pg = new Page<>(pageNum, pageSize);
|
55
|
56
|
|
56
|
57
|
IPage<TaSalesBatch> result = iTaSalesBatchService.selectByCondition(pg, salesBatchName, buildingId, status, getOrgId(request));
|
57
|
58
|
responseBean.addSuccess(result);
|
58
|
|
- }catch (Exception e){
|
|
59
|
+ } catch (Exception e) {
|
59
|
60
|
e.printStackTrace();
|
60
|
|
- logger.error("taSalesBatchList -=- {}",e.toString());
|
|
61
|
+ logger.error("taSalesBatchList -=- {}", e.toString());
|
61
|
62
|
responseBean.addError(e.getMessage());
|
62
|
63
|
}
|
63
|
64
|
return responseBean;
|
|
@@ -65,24 +66,25 @@ public class TaSalesBatchController extends BaseController {
|
65
|
66
|
|
66
|
67
|
/**
|
67
|
68
|
* 保存对象
|
|
69
|
+ *
|
68
|
70
|
* @param taSalesBatch 实体对象
|
69
|
71
|
* @return
|
70
|
72
|
*/
|
71
|
|
- @RequestMapping(value="/admin/taSalesBatch",method= RequestMethod.POST)
|
72
|
|
- public ResponseBean taSalesBatchAdd(@RequestBody TaSalesBatch taSalesBatch, HttpServletRequest request){
|
|
73
|
+ @RequestMapping(value = "/admin/taSalesBatch", method = RequestMethod.POST)
|
|
74
|
+ public ResponseBean taSalesBatchAdd(@RequestBody TaSalesBatch taSalesBatch, HttpServletRequest request) {
|
73
|
75
|
ResponseBean responseBean = new ResponseBean();
|
74
|
76
|
try {
|
75
|
77
|
taSalesBatch.setOrgId(getOrgId(request));
|
76
|
78
|
taSalesBatch.setCreateDate(LocalDateTime.now());
|
77
|
79
|
taSalesBatch.setUpdateTime(LocalDateTime.now());
|
78
|
|
- if (iTaSalesBatchService.save(taSalesBatch)){
|
|
80
|
+ if (iTaSalesBatchService.save(taSalesBatch)) {
|
79
|
81
|
responseBean.addSuccess(taSalesBatch);
|
80
|
|
- }else {
|
|
82
|
+ } else {
|
81
|
83
|
responseBean.addError("fail");
|
82
|
84
|
}
|
83
|
|
- }catch (Exception e){
|
|
85
|
+ } catch (Exception e) {
|
84
|
86
|
e.printStackTrace();
|
85
|
|
- logger.error("taSalesBatchAdd -=- {}",e.toString());
|
|
87
|
+ logger.error("taSalesBatchAdd -=- {}", e.toString());
|
86
|
88
|
responseBean.addError(e.getMessage());
|
87
|
89
|
}
|
88
|
90
|
return responseBean;
|
|
@@ -108,21 +110,22 @@ public class TaSalesBatchController extends BaseController {
|
108
|
110
|
|
109
|
111
|
/**
|
110
|
112
|
* 根据id删除对象
|
111
|
|
- * @param id 实体ID
|
|
113
|
+ *
|
|
114
|
+ * @param id 实体ID
|
112
|
115
|
*/
|
113
|
116
|
@ResponseBody
|
114
|
|
- @RequestMapping(value="/admin/taSalesBatch/{id}", method= RequestMethod.DELETE)
|
115
|
|
- public ResponseBean taSalesBatchDelete(@PathVariable Integer id){
|
|
117
|
+ @RequestMapping(value = "/admin/taSalesBatch/{id}", method = RequestMethod.DELETE)
|
|
118
|
+ public ResponseBean taSalesBatchDelete(@PathVariable Integer id) {
|
116
|
119
|
ResponseBean responseBean = new ResponseBean();
|
117
|
120
|
try {
|
118
|
|
- if(iTaSalesBatchService.removeById(id)){
|
|
121
|
+ if (iTaSalesBatchService.removeById(id)) {
|
119
|
122
|
responseBean.addSuccess("success");
|
120
|
|
- }else {
|
|
123
|
+ } else {
|
121
|
124
|
responseBean.addError("fail");
|
122
|
125
|
}
|
123
|
|
- }catch (Exception e){
|
|
126
|
+ } catch (Exception e) {
|
124
|
127
|
e.printStackTrace();
|
125
|
|
- logger.error("taSalesBatchDelete -=- {}",e.toString());
|
|
128
|
+ logger.error("taSalesBatchDelete -=- {}", e.toString());
|
126
|
129
|
responseBean.addError(e.getMessage());
|
127
|
130
|
}
|
128
|
131
|
return responseBean;
|
|
@@ -130,24 +133,25 @@ public class TaSalesBatchController extends BaseController {
|
130
|
133
|
|
131
|
134
|
/**
|
132
|
135
|
* 修改对象
|
133
|
|
- * @param id 实体ID
|
|
136
|
+ *
|
|
137
|
+ * @param id 实体ID
|
134
|
138
|
* @param taSalesBatch 实体对象
|
135
|
139
|
* @return
|
136
|
140
|
*/
|
137
|
|
- @RequestMapping(value="/admin/taSalesBatch/{id}",method= RequestMethod.PUT)
|
|
141
|
+ @RequestMapping(value = "/admin/taSalesBatch/{id}", method = RequestMethod.PUT)
|
138
|
142
|
public ResponseBean taSalesBatchUpdate(@PathVariable Integer id,
|
139
|
|
- @RequestBody TaSalesBatch taSalesBatch){
|
|
143
|
+ @RequestBody TaSalesBatch taSalesBatch) {
|
140
|
144
|
ResponseBean responseBean = new ResponseBean();
|
141
|
145
|
try {
|
142
|
146
|
taSalesBatch.setSalesBatchId(id);
|
143
|
|
- if (iTaSalesBatchService.updateById(taSalesBatch)){
|
|
147
|
+ if (iTaSalesBatchService.updateById(taSalesBatch)) {
|
144
|
148
|
responseBean.addSuccess(taSalesBatch);
|
145
|
|
- }else {
|
|
149
|
+ } else {
|
146
|
150
|
responseBean.addError("fail");
|
147
|
151
|
}
|
148
|
|
- }catch (Exception e){
|
|
152
|
+ } catch (Exception e) {
|
149
|
153
|
e.printStackTrace();
|
150
|
|
- logger.error("taSalesBatchUpdate -=- {}",e.toString());
|
|
154
|
+ logger.error("taSalesBatchUpdate -=- {}", e.toString());
|
151
|
155
|
responseBean.addError(e.getMessage());
|
152
|
156
|
}
|
153
|
157
|
return responseBean;
|
|
@@ -155,16 +159,35 @@ public class TaSalesBatchController extends BaseController {
|
155
|
159
|
|
156
|
160
|
/**
|
157
|
161
|
* 根据id查询对象
|
158
|
|
- * @param id 实体ID
|
|
162
|
+ *
|
|
163
|
+ * @param id 实体ID
|
159
|
164
|
*/
|
160
|
|
- @RequestMapping(value="/admin/taSalesBatch/{id}",method= RequestMethod.GET)
|
161
|
|
- public ResponseBean taSalesBatchGet(@PathVariable Integer id){
|
|
165
|
+ @RequestMapping(value = "/admin/taSalesBatch/{id}", method = RequestMethod.GET)
|
|
166
|
+ public ResponseBean taSalesBatchGet(@PathVariable Integer id) {
|
162
|
167
|
ResponseBean responseBean = new ResponseBean();
|
163
|
168
|
try {
|
164
|
169
|
responseBean.addSuccess(iTaSalesBatchService.getById(id));
|
165
|
|
- }catch (Exception e){
|
|
170
|
+ } catch (Exception e) {
|
|
171
|
+ e.printStackTrace();
|
|
172
|
+ logger.error("taSalesBatchDelete -=- {}", e.toString());
|
|
173
|
+ responseBean.addError(e.getMessage());
|
|
174
|
+ }
|
|
175
|
+ return responseBean;
|
|
176
|
+ }
|
|
177
|
+
|
|
178
|
+ /**
|
|
179
|
+ * 根据id查询对象-小程序端
|
|
180
|
+ *
|
|
181
|
+ * @param id 实体ID
|
|
182
|
+ */
|
|
183
|
+ @RequestMapping(value = "/wx/taSalesBatch/{id}", method = RequestMethod.GET)
|
|
184
|
+ public ResponseBean taSalesBatchGetForMiniApp(@PathVariable Integer id) {
|
|
185
|
+ ResponseBean responseBean = new ResponseBean();
|
|
186
|
+ try {
|
|
187
|
+ responseBean.addSuccess(iTaSalesBatchService.getById(id));
|
|
188
|
+ } catch (Exception e) {
|
166
|
189
|
e.printStackTrace();
|
167
|
|
- logger.error("taSalesBatchDelete -=- {}",e.toString());
|
|
190
|
+ logger.error("taSalesBatchGetForMiniApp -=- {}", e.toString());
|
168
|
191
|
responseBean.addError(e.getMessage());
|
169
|
192
|
}
|
170
|
193
|
return responseBean;
|