Selaa lähdekoodia

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

wangqiong123 2 vuotta sitten
vanhempi
commit
cd00c1611e

+ 182
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/C7525costController.java Näytä tiedosto

@@ -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
+}

+ 54
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/C7525cost.java Näytä tiedosto

@@ -0,0 +1,54 @@
1
+package com.zzsmart.qomo.kn.cost.manage.entity;
2
+
3
+import java.io.Serializable;
4
+import java.io.UnsupportedEncodingException;
5
+import java.util.Date;
6
+import java.math.BigDecimal;
7
+
8
+import com.baomidou.mybatisplus.annotation.*;
9
+import lombok.Data;
10
+import com.fasterxml.jackson.annotation.JsonFormat;
11
+import org.springframework.format.annotation.DateTimeFormat;
12
+import org.jeecgframework.poi.excel.annotation.Excel;
13
+import org.jeecg.common.aspect.annotation.Dict;
14
+import io.swagger.annotations.ApiModel;
15
+import io.swagger.annotations.ApiModelProperty;
16
+import lombok.EqualsAndHashCode;
17
+import lombok.experimental.Accessors;
18
+
19
+/**
20
+ * @Description: c7525cost
21
+ * @Author: jeecg-boot
22
+ * @Date:   2024-06-06
23
+ * @Version: V1.0
24
+ */
25
+@Data
26
+@TableName("c7525cost")
27
+@Accessors(chain = true)
28
+@EqualsAndHashCode(callSuper = false)
29
+@ApiModel(value="c7525cost对象", description="c7525cost")
30
+public class C7525cost implements Serializable {
31
+    private static final long serialVersionUID = 1L;
32
+
33
+	/**年份*/
34
+	@Excel(name = "年份", width = 15)
35
+    @ApiModelProperty(value = "年份")
36
+    private String year;
37
+	/**门控料号(物料id)*/
38
+	@Excel(name = "门控料号(物料id)", width = 15)
39
+    @ApiModelProperty(value = "门控料号(物料id)")
40
+    private String materialNumber;
41
+	/**物料规格信息*/
42
+	@Excel(name = "物料规格信息", width = 15)
43
+    @ApiModelProperty(value = "物料规格信息")
44
+    private String zzggxh;
45
+	/**价格*/
46
+	@Excel(name = "价格", width = 15)
47
+    @ApiModelProperty(value = "价格")
48
+    @TableField(value = "price_7525")
49
+    private BigDecimal price7525;
50
+	/**id*/
51
+	@TableId(type = IdType.ASSIGN_ID)
52
+    @ApiModelProperty(value = "id")
53
+    private Integer id;
54
+}

+ 18
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/C7525costMapper.java Näytä tiedosto

@@ -0,0 +1,18 @@
1
+package com.zzsmart.qomo.kn.cost.manage.mapper;
2
+
3
+import java.util.List;
4
+
5
+import com.zzsmart.qomo.kn.cost.manage.entity.C7525cost;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
9
+
10
+/**
11
+ * @Description: c7525cost
12
+ * @Author: jeecg-boot
13
+ * @Date:   2024-06-06
14
+ * @Version: V1.0
15
+ */
16
+public interface C7525costMapper extends BaseMapper<C7525cost> {
17
+
18
+}

+ 5
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/C7525costMapper.xml Näytä tiedosto

@@ -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.C7525costMapper">
4
+
5
+</mapper>

+ 15
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IC7525costService.java Näytä tiedosto

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

+ 20
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/C7525costServiceImpl.java Näytä tiedosto

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