Explorar el Código

Merge branch 'bgy' of kn-cost/cost-backend into dev

bgy hace 2 años
padre
commit
fcb9425209

+ 180
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/BudgetPriceController.java Ver fichero

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

+ 78
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/BudgetPrice.java Ver fichero

@@ -0,0 +1,78 @@
1
+package com.zzsmart.qomo.kn.cost.manage.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+import io.swagger.annotations.ApiModel;
7
+import io.swagger.annotations.ApiModelProperty;
8
+import lombok.Data;
9
+import lombok.EqualsAndHashCode;
10
+import lombok.experimental.Accessors;
11
+import org.jeecgframework.poi.excel.annotation.Excel;
12
+
13
+import java.io.Serializable;
14
+import java.math.BigDecimal;
15
+
16
+/**
17
+ * @Description: budget_price
18
+ * @Author: jeecg-boot
19
+ * @Date: 2024-06-11
20
+ * @Version: V1.0
21
+ */
22
+@Data
23
+@TableName("budget_price")
24
+@Accessors(chain = true)
25
+@EqualsAndHashCode(callSuper = false)
26
+@ApiModel(value = "budget_price对象", description = "budget_price")
27
+public class BudgetPrice implements Serializable {
28
+    private static final long serialVersionUID = 1L;
29
+
30
+    /**
31
+     * 主键
32
+     */
33
+    @TableId(type = IdType.ASSIGN_ID)
34
+    @ApiModelProperty(value = "主键")
35
+    private Integer id;
36
+    /**
37
+     * 年份
38
+     */
39
+    @Excel(name = "年份", width = 15)
40
+    @ApiModelProperty(value = "年份")
41
+    private String year;
42
+    /**
43
+     * 物料编码
44
+     */
45
+    @Excel(name = "物料编码", width = 15)
46
+    @ApiModelProperty(value = "物料编码")
47
+    private String materialNumber;
48
+    /**
49
+     * 物料名称
50
+     */
51
+    @Excel(name = "物料名称", width = 15)
52
+    @ApiModelProperty(value = "物料名称")
53
+    private String materialName;
54
+    /**
55
+     * 项目编号
56
+     */
57
+    @Excel(name = "项目编号", width = 15)
58
+    @ApiModelProperty(value = "项目编号")
59
+    private String projectNumber;
60
+    /**
61
+     * 预算价格
62
+     */
63
+    @Excel(name = "预算价格", width = 15)
64
+    @ApiModelProperty(value = "预算价格")
65
+    private BigDecimal price;
66
+    /**
67
+     * dwerk
68
+     */
69
+    @Excel(name = "dwerk", width = 15)
70
+    @ApiModelProperty(value = "dwerk")
71
+    private String dwerk;
72
+    /**
73
+     * posid
74
+     */
75
+    @Excel(name = "posid", width = 15)
76
+    @ApiModelProperty(value = "posid")
77
+    private String posid;
78
+}

+ 14
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/BudgetPriceMapper.java Ver fichero

@@ -0,0 +1,14 @@
1
+package com.zzsmart.qomo.kn.cost.manage.mapper;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.zzsmart.qomo.kn.cost.manage.entity.BudgetPrice;
5
+
6
+/**
7
+ * @Description: budget_price
8
+ * @Author: jeecg-boot
9
+ * @Date: 2024-06-11
10
+ * @Version: V1.0
11
+ */
12
+public interface BudgetPriceMapper extends BaseMapper<BudgetPrice> {
13
+
14
+}

+ 5
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/BudgetPriceMapper.xml Ver fichero

@@ -0,0 +1,5 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.zzsmart.qomo.kn.cost.manage.mapper.BudgetPriceMapper">
4
+
5
+</mapper>

+ 1
- 1
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/HourRateMapper.xml Ver fichero

@@ -1,5 +1,5 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
-<mapper namespace="com.zzsmart.qomo.modules.demo..mapper.HourRateMapper">
3
+<mapper namespace="com.zzsmart.qomo.kn.cost.manage.mapper.HourRateMapper">
4 4
 
5 5
 </mapper>

+ 14
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IBudgetPriceService.java Ver fichero

@@ -0,0 +1,14 @@
1
+package com.zzsmart.qomo.kn.cost.manage.service;
2
+
3
+import com.zzsmart.qomo.kn.cost.manage.entity.BudgetPrice;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+
6
+/**
7
+ * @Description: budget_price
8
+ * @Author: jeecg-boot
9
+ * @Date:   2024-06-11
10
+ * @Version: V1.0
11
+ */
12
+public interface IBudgetPriceService extends IService<BudgetPrice> {
13
+
14
+}

+ 18
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/BudgetPriceServiceImpl.java Ver fichero

@@ -0,0 +1,18 @@
1
+package com.zzsmart.qomo.kn.cost.manage.service.impl;
2
+
3
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4
+import com.zzsmart.qomo.kn.cost.manage.entity.BudgetPrice;
5
+import com.zzsmart.qomo.kn.cost.manage.mapper.BudgetPriceMapper;
6
+import com.zzsmart.qomo.kn.cost.manage.service.IBudgetPriceService;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * @Description: budget_price
11
+ * @Author: jeecg-boot
12
+ * @Date: 2024-06-11
13
+ * @Version: V1.0
14
+ */
15
+@Service
16
+public class BudgetPriceServiceImpl extends ServiceImpl<BudgetPriceMapper, BudgetPrice> implements IBudgetPriceService {
17
+
18
+}