Ver código fonte

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

wangqiong123 2 anos atrás
pai
commit
a74d7656cc

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

@@ -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
+
13
+import com.zzsmart.qomo.kn.cost.manage.entity.LatestPurchasePrice;
14
+import com.zzsmart.qomo.kn.cost.manage.service.ILatestPurchasePriceService;
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: latest_purchase_price
44
+ * @Author: jeecg-boot
45
+ * @Date:   2024-06-11
46
+ * @Version: V1.0
47
+ */
48
+@Api(tags="最新采购价")
49
+@RestController
50
+@RequestMapping("//latestPurchasePrice")
51
+@Slf4j
52
+public class LatestPurchasePriceController extends JeecgController<LatestPurchasePrice, ILatestPurchasePriceService> {
53
+	@Autowired
54
+	private ILatestPurchasePriceService latestPurchasePriceService;
55
+	
56
+	/**
57
+	 * 分页列表查询
58
+	 *
59
+	 * @param latestPurchasePrice
60
+	 * @param pageNo
61
+	 * @param pageSize
62
+	 * @param req
63
+	 * @return
64
+	 */
65
+	//@AutoLog(value = "latest_purchase_price-分页列表查询")
66
+	@ApiOperation(value="latest_purchase_price-分页列表查询", notes="latest_purchase_price-分页列表查询")
67
+	@GetMapping(value = "/list")
68
+	public Result<IPage<LatestPurchasePrice>> queryPageList(LatestPurchasePrice latestPurchasePrice,
69
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
70
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
71
+								   HttpServletRequest req) {
72
+		QueryWrapper<LatestPurchasePrice> queryWrapper = QueryGenerator.initQueryWrapper(latestPurchasePrice, req.getParameterMap());
73
+		Page<LatestPurchasePrice> page = new Page<LatestPurchasePrice>(pageNo, pageSize);
74
+		IPage<LatestPurchasePrice> pageList = latestPurchasePriceService.page(page, queryWrapper);
75
+		return Result.OK(pageList);
76
+	}
77
+	
78
+	/**
79
+	 *   添加
80
+	 *
81
+	 * @param latestPurchasePrice
82
+	 * @return
83
+	 */
84
+	@AutoLog(value = "latest_purchase_price-添加")
85
+	@ApiOperation(value="latest_purchase_price-添加", notes="latest_purchase_price-添加")
86
+//	@RequiresPermissions(":latest_purchase_price:add")
87
+	@PostMapping(value = "/add")
88
+	public Result<String> add(@RequestBody LatestPurchasePrice latestPurchasePrice) {
89
+		latestPurchasePriceService.save(latestPurchasePrice);
90
+		return Result.OK("添加成功!");
91
+	}
92
+	
93
+	/**
94
+	 *  编辑
95
+	 *
96
+	 * @param latestPurchasePrice
97
+	 * @return
98
+	 */
99
+	@AutoLog(value = "latest_purchase_price-编辑")
100
+	@ApiOperation(value="latest_purchase_price-编辑", notes="latest_purchase_price-编辑")
101
+//	@RequiresPermissions(":latest_purchase_price:edit")
102
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
103
+	public Result<String> edit(@RequestBody LatestPurchasePrice latestPurchasePrice) {
104
+		latestPurchasePriceService.updateById(latestPurchasePrice);
105
+		return Result.OK("编辑成功!");
106
+	}
107
+	
108
+	/**
109
+	 *   通过id删除
110
+	 *
111
+	 * @param id
112
+	 * @return
113
+	 */
114
+	@AutoLog(value = "latest_purchase_price-通过id删除")
115
+	@ApiOperation(value="latest_purchase_price-通过id删除", notes="latest_purchase_price-通过id删除")
116
+//	@RequiresPermissions(":latest_purchase_price:delete")
117
+	@DeleteMapping(value = "/delete")
118
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
119
+		latestPurchasePriceService.removeById(id);
120
+		return Result.OK("删除成功!");
121
+	}
122
+	
123
+	/**
124
+	 *  批量删除
125
+	 *
126
+	 * @param ids
127
+	 * @return
128
+	 */
129
+	@AutoLog(value = "latest_purchase_price-批量删除")
130
+	@ApiOperation(value="latest_purchase_price-批量删除", notes="latest_purchase_price-批量删除")
131
+//	@RequiresPermissions(":latest_purchase_price:deleteBatch")
132
+	@DeleteMapping(value = "/deleteBatch")
133
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
134
+		this.latestPurchasePriceService.removeByIds(Arrays.asList(ids.split(",")));
135
+		return Result.OK("批量删除成功!");
136
+	}
137
+	
138
+	/**
139
+	 * 通过id查询
140
+	 *
141
+	 * @param id
142
+	 * @return
143
+	 */
144
+	//@AutoLog(value = "latest_purchase_price-通过id查询")
145
+	@ApiOperation(value="latest_purchase_price-通过id查询", notes="latest_purchase_price-通过id查询")
146
+	@GetMapping(value = "/queryById")
147
+	public Result<LatestPurchasePrice> queryById(@RequestParam(name="id",required=true) String id) {
148
+		LatestPurchasePrice latestPurchasePrice = latestPurchasePriceService.getById(id);
149
+		if(latestPurchasePrice==null) {
150
+			return Result.error("未找到对应数据");
151
+		}
152
+		return Result.OK(latestPurchasePrice);
153
+	}
154
+
155
+    /**
156
+    * 导出excel
157
+    *
158
+    * @param request
159
+    * @param latestPurchasePrice
160
+    */
161
+    @RequiresPermissions(":latest_purchase_price:exportXls")
162
+    @RequestMapping(value = "/exportXls", method = RequestMethod.GET)
163
+    public ModelAndView exportXls(HttpServletRequest request, LatestPurchasePrice latestPurchasePrice) {
164
+        return super.exportXls(request, latestPurchasePrice, LatestPurchasePrice.class, "latest_purchase_price");
165
+    }
166
+
167
+    /**
168
+      * 通过excel导入数据
169
+    *
170
+    * @param request
171
+    * @param response
172
+    * @return
173
+    */
174
+//    @RequiresPermissions(":latest_purchase_price:importExcel")
175
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
176
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
177
+        return super.importExcel(request, response, LatestPurchasePrice.class);
178
+    }
179
+
180
+}

+ 3
- 2
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/ProduceBatchController.java Ver arquivo

@@ -1,5 +1,6 @@
1 1
 package com.zzsmart.qomo.kn.cost.manage.controller;
2 2
 
3
+import java.util.ArrayList;
3 4
 import java.util.Arrays;
4 5
 import java.util.List;
5 6
 import java.util.Map;
@@ -134,7 +135,7 @@ public class ProduceBatchController extends JeecgController<ProduceBatch, IProdu
134 135
 		this.produceBatchService.removeByIds(Arrays.asList(ids.split(",")));
135 136
 		return Result.OK("批量删除成功!");
136 137
 	}
137
-	
138
+
138 139
 	/**
139 140
 	 * 通过id查询
140 141
 	 *
@@ -171,7 +172,7 @@ public class ProduceBatchController extends JeecgController<ProduceBatch, IProdu
171 172
     * @param response
172 173
     * @return
173 174
     */
174
-    @RequiresPermissions(":produce_batch:importExcel")
175
+//    @RequiresPermissions(":produce_batch:importExcel")
175 176
     @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
176 177
     public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
177 178
         return super.importExcel(request, response, ProduceBatch.class);

+ 107
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/LatestPurchasePrice.java Ver arquivo

@@ -0,0 +1,107 @@
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
+import com.baomidou.mybatisplus.annotation.IdType;
8
+import com.baomidou.mybatisplus.annotation.TableId;
9
+import com.baomidou.mybatisplus.annotation.TableName;
10
+import com.baomidou.mybatisplus.annotation.TableLogic;
11
+import lombok.Data;
12
+import com.fasterxml.jackson.annotation.JsonFormat;
13
+import org.springframework.format.annotation.DateTimeFormat;
14
+import org.jeecgframework.poi.excel.annotation.Excel;
15
+import org.jeecg.common.aspect.annotation.Dict;
16
+import io.swagger.annotations.ApiModel;
17
+import io.swagger.annotations.ApiModelProperty;
18
+import lombok.EqualsAndHashCode;
19
+import lombok.experimental.Accessors;
20
+
21
+/**
22
+ * @Description: latest_purchase_price
23
+ * @Author: jeecg-boot
24
+ * @Date:   2024-06-11
25
+ * @Version: V1.0
26
+ */
27
+@Data
28
+@TableName("latest_purchase_price")
29
+@Accessors(chain = true)
30
+@EqualsAndHashCode(callSuper = false)
31
+@ApiModel(value="latest_purchase_price对象", description="latest_purchase_price")
32
+public class LatestPurchasePrice implements Serializable {
33
+    private static final long serialVersionUID = 1L;
34
+
35
+	/**门控料号(物料id)*/
36
+	@Excel(name = "门控料号(物料id)", width = 15)
37
+    @ApiModelProperty(value = "门控料号(物料id)")
38
+    private String materialNumber;
39
+	/**产品名称*/
40
+	@Excel(name = "产品名称", width = 15)
41
+    @ApiModelProperty(value = "产品名称")
42
+    private String name;
43
+	/**规格*/
44
+	@Excel(name = "规格", width = 15)
45
+    @ApiModelProperty(value = "规格")
46
+    private String norms;
47
+	/**单位*/
48
+	@Excel(name = "单位", width = 15)
49
+    @ApiModelProperty(value = "单位")
50
+    private String unit;
51
+	/**latestInvoiceNo*/
52
+	@Excel(name = "latestInvoiceNo", width = 15)
53
+    @ApiModelProperty(value = "latestInvoiceNo")
54
+    private String latestInvoiceNo;
55
+	/**估算日期*/
56
+	@Excel(name = "估算日期", width = 15, format = "yyyy-MM-dd")
57
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
58
+    @DateTimeFormat(pattern="yyyy-MM-dd")
59
+    @ApiModelProperty(value = "估算日期")
60
+    private Date latestInvoiceDate;
61
+	/**latestInvoiceSupplier*/
62
+	@Excel(name = "latestInvoiceSupplier", width = 15)
63
+    @ApiModelProperty(value = "latestInvoiceSupplier")
64
+    private String latestInvoiceSupplier;
65
+	/**latestInvoicePrice*/
66
+	@Excel(name = "latestInvoicePrice", width = 15)
67
+    @ApiModelProperty(value = "latestInvoicePrice")
68
+    private BigDecimal latestInvoicePrice;
69
+	/**不含税价格*/
70
+	@Excel(name = "不含税价格", width = 15)
71
+    @ApiModelProperty(value = "不含税价格")
72
+    private BigDecimal unitPriceWithoutTax;
73
+	/**interExamCost*/
74
+	@Excel(name = "interExamCost", width = 15)
75
+    @ApiModelProperty(value = "interExamCost")
76
+    private BigDecimal interExamCost;
77
+	/**工厂代号(工厂id)*/
78
+	@Excel(name = "工厂代号(工厂id)", width = 15)
79
+    @ApiModelProperty(value = "工厂代号(工厂id)")
80
+    private String factory;
81
+	/**维护人*/
82
+	@Excel(name = "维护人", width = 15)
83
+    @ApiModelProperty(value = "维护人")
84
+    private String guardian;
85
+	/**维护时间*/
86
+	@Excel(name = "维护时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
87
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
88
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
89
+    @ApiModelProperty(value = "维护时间")
90
+    private Date maintenanceTime;
91
+	/**isadd*/
92
+	@Excel(name = "isadd", width = 15)
93
+    @ApiModelProperty(value = "isadd")
94
+    private Integer isadd;
95
+	/**采购类型*/
96
+	@Excel(name = "采购类型", width = 15)
97
+    @ApiModelProperty(value = "采购类型")
98
+    private String purchaseType;
99
+	/**是否启用*/
100
+	@Excel(name = "是否启用", width = 15)
101
+    @ApiModelProperty(value = "是否启用")
102
+    private Integer isinvalid;
103
+	/**id*/
104
+	@TableId(type = IdType.ASSIGN_ID)
105
+    @ApiModelProperty(value = "id")
106
+    private String id;
107
+}

+ 5
- 1
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/ProduceBatch.java Ver arquivo

@@ -55,7 +55,11 @@ public class ProduceBatch implements Serializable {
55 55
     @ApiModelProperty(value = "维护时间")
56 56
     private Date maintenanceTime;
57 57
 	/**aufnr*/
58
-	@Excel(name = "aufnr", width = 15)
58
+//	@Excel(name = "aufnr", width = 15)
59 59
     @ApiModelProperty(value = "aufnr")
60 60
     private String aufnr;
61
+    /**主键*/
62
+    @TableId(type = IdType.ASSIGN_ID)
63
+    @ApiModelProperty(value = "主键")
64
+    private String id;
61 65
 }

+ 18
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/LatestPurchasePriceMapper.java Ver arquivo

@@ -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.LatestPurchasePrice;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
9
+
10
+/**
11
+ * @Description: latest_purchase_price
12
+ * @Author: jeecg-boot
13
+ * @Date:   2024-06-11
14
+ * @Version: V1.0
15
+ */
16
+public interface LatestPurchasePriceMapper extends BaseMapper<LatestPurchasePrice> {
17
+
18
+}

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

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

+ 15
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/ILatestPurchasePriceService.java Ver arquivo

@@ -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.LatestPurchasePrice;
6
+
7
+/**
8
+ * @Description: latest_purchase_price
9
+ * @Author: jeecg-boot
10
+ * @Date:   2024-06-11
11
+ * @Version: V1.0
12
+ */
13
+public interface ILatestPurchasePriceService extends IService<LatestPurchasePrice> {
14
+
15
+}

+ 20
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/LatestPurchasePriceServiceImpl.java Ver arquivo

@@ -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.LatestPurchasePrice;
5
+import com.zzsmart.qomo.kn.cost.manage.mapper.LatestPurchasePriceMapper;
6
+import com.zzsmart.qomo.kn.cost.manage.service.ILatestPurchasePriceService;
7
+import org.springframework.stereotype.Service;
8
+
9
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
10
+
11
+/**
12
+ * @Description: latest_purchase_price
13
+ * @Author: jeecg-boot
14
+ * @Date:   2024-06-11
15
+ * @Version: V1.0
16
+ */
17
+@Service
18
+public class LatestPurchasePriceServiceImpl extends ServiceImpl<LatestPurchasePriceMapper, LatestPurchasePrice> implements ILatestPurchasePriceService {
19
+
20
+}