|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+package com.zzsmart.qomo.kn.cost.manage.controller;
|
|
|
2
|
+
|
|
|
3
|
+import java.util.Arrays;
|
|
|
4
|
+import java.util.List;
|
|
|
5
|
+import java.util.Map;
|
|
|
6
|
+import java.util.stream.Collectors;
|
|
|
7
|
+import java.io.IOException;
|
|
|
8
|
+import java.io.UnsupportedEncodingException;
|
|
|
9
|
+import java.net.URLDecoder;
|
|
|
10
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
11
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
12
|
+
|
|
|
13
|
+import com.zzsmart.qomo.kn.cost.manage.entity.C7525cost;
|
|
|
14
|
+import com.zzsmart.qomo.kn.cost.manage.service.IC7525costService;
|
|
|
15
|
+import org.jeecg.common.api.vo.Result;
|
|
|
16
|
+import org.jeecg.common.system.query.QueryGenerator;
|
|
|
17
|
+import org.jeecg.common.util.oConvertUtils;
|
|
|
18
|
+
|
|
|
19
|
+
|
|
|
20
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
21
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
22
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
23
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
24
|
+
|
|
|
25
|
+import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
|
26
|
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
|
27
|
+import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
|
28
|
+import org.jeecgframework.poi.excel.entity.ImportParams;
|
|
|
29
|
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
|
|
30
|
+import org.jeecg.common.system.base.controller.JeecgController;
|
|
|
31
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
32
|
+import org.springframework.web.bind.annotation.*;
|
|
|
33
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
34
|
+import org.springframework.web.multipart.MultipartHttpServletRequest;
|
|
|
35
|
+import org.springframework.web.servlet.ModelAndView;
|
|
|
36
|
+import com.alibaba.fastjson.JSON;
|
|
|
37
|
+import io.swagger.annotations.Api;
|
|
|
38
|
+import io.swagger.annotations.ApiOperation;
|
|
|
39
|
+import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
40
|
+import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
41
|
+
|
|
|
42
|
+ /**
|
|
|
43
|
+ * @Description: c7525cost
|
|
|
44
|
+ * @Author: jeecg-boot
|
|
|
45
|
+ * @Date: 2024-06-06
|
|
|
46
|
+ * @Version: V1.0
|
|
|
47
|
+ */
|
|
|
48
|
+@Api(tags="7525单价")
|
|
|
49
|
+@RestController
|
|
|
50
|
+@RequestMapping("//c7525cost")
|
|
|
51
|
+@Slf4j
|
|
|
52
|
+public class C7525costController extends JeecgController<C7525cost, IC7525costService> {
|
|
|
53
|
+ @Autowired
|
|
|
54
|
+ private IC7525costService c7525costService;
|
|
|
55
|
+
|
|
|
56
|
+ /**
|
|
|
57
|
+ * 分页列表查询
|
|
|
58
|
+ *
|
|
|
59
|
+ * @param c7525cost
|
|
|
60
|
+ * @param pageNo
|
|
|
61
|
+ * @param pageSize
|
|
|
62
|
+ * @param req
|
|
|
63
|
+ * @return
|
|
|
64
|
+ */
|
|
|
65
|
+ //@AutoLog(value = "c7525cost-分页列表查询")
|
|
|
66
|
+ @ApiOperation(value="c7525cost-分页列表查询", notes="c7525cost-分页列表查询")
|
|
|
67
|
+ @GetMapping(value = "/list")
|
|
|
68
|
+ public Result<IPage<C7525cost>> queryPageList(C7525cost c7525cost,
|
|
|
69
|
+ @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
70
|
+ @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
|
71
|
+ HttpServletRequest req) {
|
|
|
72
|
+ QueryWrapper<C7525cost> queryWrapper = QueryGenerator.initQueryWrapper(c7525cost, req.getParameterMap());
|
|
|
73
|
+ Page<C7525cost> page = new Page<C7525cost>(pageNo, pageSize);
|
|
|
74
|
+ IPage<C7525cost> pageList = c7525costService.page(page, queryWrapper);
|
|
|
75
|
+ return Result.OK(pageList);
|
|
|
76
|
+ }
|
|
|
77
|
+
|
|
|
78
|
+ /**
|
|
|
79
|
+ * 添加
|
|
|
80
|
+ *
|
|
|
81
|
+ * @param c7525cost
|
|
|
82
|
+ * @return
|
|
|
83
|
+ */
|
|
|
84
|
+ @AutoLog(value = "c7525cost-添加")
|
|
|
85
|
+ @ApiOperation(value="c7525cost-添加", notes="c7525cost-添加")
|
|
|
86
|
+// @RequiresPermissions(":c7525cost:add")
|
|
|
87
|
+ @PostMapping(value = "/add")
|
|
|
88
|
+ public Result<String> add(@RequestBody C7525cost c7525cost) {
|
|
|
89
|
+ c7525costService.save(c7525cost);
|
|
|
90
|
+ return Result.OK("添加成功!");
|
|
|
91
|
+ }
|
|
|
92
|
+
|
|
|
93
|
+ /**
|
|
|
94
|
+ * 编辑
|
|
|
95
|
+ *
|
|
|
96
|
+ * @param c7525cost
|
|
|
97
|
+ * @return
|
|
|
98
|
+ */
|
|
|
99
|
+ @AutoLog(value = "c7525cost-编辑")
|
|
|
100
|
+ @ApiOperation(value="c7525cost-编辑", notes="c7525cost-编辑")
|
|
|
101
|
+// @RequiresPermissions(":c7525cost:edit")
|
|
|
102
|
+ @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
|
103
|
+ public Result<String> edit(@RequestBody C7525cost c7525cost) {
|
|
|
104
|
+ c7525costService.updateById(c7525cost);
|
|
|
105
|
+ return Result.OK("编辑成功!");
|
|
|
106
|
+ }
|
|
|
107
|
+
|
|
|
108
|
+ /**
|
|
|
109
|
+ * 通过id删除
|
|
|
110
|
+ *
|
|
|
111
|
+ * @param id
|
|
|
112
|
+ * @return
|
|
|
113
|
+ */
|
|
|
114
|
+ @AutoLog(value = "c7525cost-通过id删除")
|
|
|
115
|
+ @ApiOperation(value="c7525cost-通过id删除", notes="c7525cost-通过id删除")
|
|
|
116
|
+// @RequiresPermissions(":c7525cost:delete")
|
|
|
117
|
+ @DeleteMapping(value = "/delete")
|
|
|
118
|
+ public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
|
|
119
|
+ c7525costService.removeById(id);
|
|
|
120
|
+ return Result.OK("删除成功!");
|
|
|
121
|
+ }
|
|
|
122
|
+
|
|
|
123
|
+ /**
|
|
|
124
|
+ * 批量删除
|
|
|
125
|
+ *
|
|
|
126
|
+ * @param ids
|
|
|
127
|
+ * @return
|
|
|
128
|
+ */
|
|
|
129
|
+ @AutoLog(value = "c7525cost-批量删除")
|
|
|
130
|
+ @ApiOperation(value="c7525cost-批量删除", notes="c7525cost-批量删除")
|
|
|
131
|
+// @RequiresPermissions(":c7525cost:deleteBatch")
|
|
|
132
|
+ @DeleteMapping(value = "/deleteBatch")
|
|
|
133
|
+ public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
|
134
|
+ this.c7525costService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
135
|
+ return Result.OK("批量删除成功!");
|
|
|
136
|
+ }
|
|
|
137
|
+
|
|
|
138
|
+ /**
|
|
|
139
|
+ * 通过id查询
|
|
|
140
|
+ *
|
|
|
141
|
+ * @param id
|
|
|
142
|
+ * @return
|
|
|
143
|
+ */
|
|
|
144
|
+ //@AutoLog(value = "c7525cost-通过id查询")
|
|
|
145
|
+ @ApiOperation(value="c7525cost-通过id查询", notes="c7525cost-通过id查询")
|
|
|
146
|
+ @GetMapping(value = "/queryById")
|
|
|
147
|
+ public Result<C7525cost> queryById(@RequestParam(name="id",required=true) String id) {
|
|
|
148
|
+ C7525cost c7525cost = c7525costService.getById(id);
|
|
|
149
|
+ if(c7525cost==null) {
|
|
|
150
|
+ return Result.error("未找到对应数据");
|
|
|
151
|
+ }
|
|
|
152
|
+ return Result.OK(c7525cost);
|
|
|
153
|
+ }
|
|
|
154
|
+
|
|
|
155
|
+ /**
|
|
|
156
|
+ * 导出excel
|
|
|
157
|
+ *
|
|
|
158
|
+ * @param request
|
|
|
159
|
+ * @param c7525cost
|
|
|
160
|
+ */
|
|
|
161
|
+// @RequiresPermissions(":c7525cost:exportXls")
|
|
|
162
|
+ @ApiOperation(value="c7525cost-导出excel", notes="c7525cost-导出excel")
|
|
|
163
|
+ @RequestMapping(value = "/exportXls", method = RequestMethod.GET)
|
|
|
164
|
+ public ModelAndView exportXls(HttpServletRequest request, C7525cost c7525cost) {
|
|
|
165
|
+ return super.exportXls(request, c7525cost, C7525cost.class, "c7525cost");
|
|
|
166
|
+ }
|
|
|
167
|
+
|
|
|
168
|
+ /**
|
|
|
169
|
+ * 通过excel导入数据
|
|
|
170
|
+ *
|
|
|
171
|
+ * @param request
|
|
|
172
|
+ * @param response
|
|
|
173
|
+ * @return
|
|
|
174
|
+ */
|
|
|
175
|
+// @RequiresPermissions(":c7525cost:importExcel")
|
|
|
176
|
+ @ApiOperation(value="c7525cost-通过excel导入数据", notes="c7525cost-通过excel导入数据")
|
|
|
177
|
+ @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
|
|
178
|
+ public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
|
|
179
|
+ return super.importExcel(request, response, C7525cost.class);
|
|
|
180
|
+ }
|
|
|
181
|
+
|
|
|
182
|
+}
|