浏览代码

成品粮库存管理添加生产年月

fanxw 3 年之前
父节点
当前提交
081e92ab23

+ 5 - 0
pom.xml

@@ -148,6 +148,11 @@
148
             <version>1.18.22</version>
148
             <version>1.18.22</version>
149
             <scope>provided</scope>
149
             <scope>provided</scope>
150
         </dependency>
150
         </dependency>
151
+        <dependency>
152
+		    <groupId>org.jetbrains</groupId>
153
+		    <artifactId>annotations</artifactId>
154
+		    <version>20.1.0</version>
155
+		</dependency>
151
     </dependencies>
156
     </dependencies>
152
 
157
 
153
     <!-- 导入Spring Cloud的依赖管理 -->
158
     <!-- 导入Spring Cloud的依赖管理 -->

+ 9 - 8
src/main/java/com/chinaitop/depot/business/service/impl/BusinessDrugStorageServiceImpl.java

@@ -1,5 +1,14 @@
1
 package com.chinaitop.depot.business.service.impl;
1
 package com.chinaitop.depot.business.service.impl;
2
 
2
 
3
+import java.util.HashMap;
4
+import java.util.List;
5
+import java.util.Map;
6
+
7
+import javax.annotation.Resource;
8
+
9
+import org.jetbrains.annotations.NotNull;
10
+import org.springframework.stereotype.Service;
11
+
3
 import com.chinaitop.depot.business.mapper.BusinessDrugStorageMapper;
12
 import com.chinaitop.depot.business.mapper.BusinessDrugStorageMapper;
4
 import com.chinaitop.depot.business.model.BusinessDrugInfo;
13
 import com.chinaitop.depot.business.model.BusinessDrugInfo;
5
 import com.chinaitop.depot.business.model.BusinessDrugInfoKey;
14
 import com.chinaitop.depot.business.model.BusinessDrugInfoKey;
@@ -8,14 +17,6 @@ import com.chinaitop.depot.business.model.BusinessDrugStorageExample;
8
 import com.chinaitop.depot.business.service.BusinessDrugInfoService;
17
 import com.chinaitop.depot.business.service.BusinessDrugInfoService;
9
 import com.chinaitop.depot.business.service.BusinessDrugStandingBookService;
18
 import com.chinaitop.depot.business.service.BusinessDrugStandingBookService;
10
 import com.chinaitop.depot.business.service.BusinessDrugStorageService;
19
 import com.chinaitop.depot.business.service.BusinessDrugStorageService;
11
-import org.jetbrains.annotations.NotNull;
12
-import org.springframework.stereotype.Service;
13
-
14
-import javax.annotation.Resource;
15
-import java.util.Date;
16
-import java.util.HashMap;
17
-import java.util.List;
18
-import java.util.Map;
19
 
20
 
20
 
21
 
21
 @Service
22
 @Service

+ 1 - 3
src/main/java/com/chinaitop/depot/product/controller/StorageProductFcbgzController.java

@@ -1,6 +1,5 @@
1
 package com.chinaitop.depot.product.controller;
1
 package com.chinaitop.depot.product.controller;
2
 
2
 
3
-import java.math.BigDecimal;
4
 import java.util.Date;
3
 import java.util.Date;
5
 import java.util.HashMap;
4
 import java.util.HashMap;
6
 import java.util.List;
5
 import java.util.List;
@@ -9,7 +8,6 @@ import java.util.Map;
9
 import javax.annotation.Resource;
8
 import javax.annotation.Resource;
10
 import javax.servlet.http.HttpServletRequest;
9
 import javax.servlet.http.HttpServletRequest;
11
 
10
 
12
-import lombok.extern.slf4j.Slf4j;
13
 import org.springframework.http.MediaType;
11
 import org.springframework.http.MediaType;
14
 import org.springframework.web.bind.annotation.RequestMapping;
12
 import org.springframework.web.bind.annotation.RequestMapping;
15
 import org.springframework.web.bind.annotation.RequestMethod;
13
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -20,7 +18,6 @@ import com.chinaitop.depot.product.model.StorageProductFcbgzExample;
20
 import com.chinaitop.depot.product.model.StorageProductKcsl;
18
 import com.chinaitop.depot.product.model.StorageProductKcsl;
21
 import com.chinaitop.depot.product.service.StorageProductFcbgzService;
19
 import com.chinaitop.depot.product.service.StorageProductFcbgzService;
22
 import com.chinaitop.depot.product.service.StorageProductKcslService;
20
 import com.chinaitop.depot.product.service.StorageProductKcslService;
23
-import com.chinaitop.depot.utils.JsonToObjectUtils;
24
 import com.chinaitop.depot.utils.ParameterUtil;
21
 import com.chinaitop.depot.utils.ParameterUtil;
25
 import com.github.pagehelper.PageHelper;
22
 import com.github.pagehelper.PageHelper;
26
 import com.github.pagehelper.PageInfo;
23
 import com.github.pagehelper.PageInfo;
@@ -29,6 +26,7 @@ import io.swagger.annotations.Api;
29
 import io.swagger.annotations.ApiImplicitParam;
26
 import io.swagger.annotations.ApiImplicitParam;
30
 import io.swagger.annotations.ApiImplicitParams;
27
 import io.swagger.annotations.ApiImplicitParams;
31
 import io.swagger.annotations.ApiOperation;
28
 import io.swagger.annotations.ApiOperation;
29
+import lombok.extern.slf4j.Slf4j;
32
 
30
 
33
 /**
31
 /**
34
  * @auther mafy
32
  * @auther mafy

+ 20 - 5
src/main/java/com/chinaitop/depot/product/mapper/StorageProductKcslMapper.xml

@@ -15,6 +15,7 @@
15
     <result column="kcsl" property="kcsl" jdbcType="DECIMAL" />
15
     <result column="kcsl" property="kcsl" jdbcType="DECIMAL" />
16
     <result column="input_time" property="inputTime" jdbcType="TIMESTAMP" />
16
     <result column="input_time" property="inputTime" jdbcType="TIMESTAMP" />
17
     <result column="hdsj" property="hdsj" jdbcType="TIMESTAMP" />
17
     <result column="hdsj" property="hdsj" jdbcType="TIMESTAMP" />
18
+    <result column="scny" property="scny" jdbcType="VARCHAR" />
18
   </resultMap>
19
   </resultMap>
19
   <sql id="Example_Where_Clause" >
20
   <sql id="Example_Where_Clause" >
20
     <where >
21
     <where >
@@ -75,7 +76,7 @@
75
     </where>
76
     </where>
76
   </sql>
77
   </sql>
77
   <sql id="Base_Column_List" >
78
   <sql id="Base_Column_List" >
78
-    id, org_id, house_id, warehouse_id, lypz, lyxz, lydj, lycd, rksj, scrq, kcsl, input_time, hdsj
79
+    id, org_id, house_id, warehouse_id, lypz, lyxz, lydj, lycd, rksj, scrq, kcsl, input_time, hdsj, scny
79
   </sql>
80
   </sql>
80
   <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.product.model.StorageProductKcslExample" >
81
   <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.product.model.StorageProductKcslExample" >
81
     select
82
     select
@@ -111,13 +112,13 @@
111
     insert into storage_product_kcsl (id, org_id, house_id, 
112
     insert into storage_product_kcsl (id, org_id, house_id, 
112
       warehouse_id, lypz, lyxz, 
113
       warehouse_id, lypz, lyxz, 
113
       lydj, lycd, rksj, 
114
       lydj, lycd, rksj, 
114
-      scrq, kcsl, input_time, hdsj
115
+      scrq, kcsl, input_time, hdsj, scny
115
       )
116
       )
116
     values (#{id,jdbcType=VARCHAR}, #{orgId,jdbcType=INTEGER}, #{houseId,jdbcType=INTEGER}, 
117
     values (#{id,jdbcType=VARCHAR}, #{orgId,jdbcType=INTEGER}, #{houseId,jdbcType=INTEGER}, 
117
       #{warehouseId,jdbcType=INTEGER}, #{lypz,jdbcType=INTEGER}, #{lyxz,jdbcType=INTEGER}, 
118
       #{warehouseId,jdbcType=INTEGER}, #{lypz,jdbcType=INTEGER}, #{lyxz,jdbcType=INTEGER}, 
118
       #{lydj,jdbcType=INTEGER}, #{lycd,jdbcType=INTEGER}, #{rksj,jdbcType=TIMESTAMP}, 
119
       #{lydj,jdbcType=INTEGER}, #{lycd,jdbcType=INTEGER}, #{rksj,jdbcType=TIMESTAMP}, 
119
       #{scrq,jdbcType=TIMESTAMP}, #{kcsl,jdbcType=DECIMAL}, #{inputTime,jdbcType=TIMESTAMP},
120
       #{scrq,jdbcType=TIMESTAMP}, #{kcsl,jdbcType=DECIMAL}, #{inputTime,jdbcType=TIMESTAMP},
120
-      #{hdsj,jdbcType=TIMESTAMP})
121
+      #{hdsj,jdbcType=TIMESTAMP}, #{scny,jdbcType=VARCHAR})
121
   </insert>
122
   </insert>
122
   <insert id="insertSelective" parameterType="com.chinaitop.depot.product.model.StorageProductKcsl" >
123
   <insert id="insertSelective" parameterType="com.chinaitop.depot.product.model.StorageProductKcsl" >
123
     insert into storage_product_kcsl
124
     insert into storage_product_kcsl
@@ -161,6 +162,9 @@
161
       <if test="hdsj != null">
162
       <if test="hdsj != null">
162
       	hdsj,
163
       	hdsj,
163
       </if>
164
       </if>
165
+      <if test="scny != null">
166
+      	scny,
167
+      </if>
164
     </trim>
168
     </trim>
165
     <trim prefix="values (" suffix=")" suffixOverrides="," >
169
     <trim prefix="values (" suffix=")" suffixOverrides="," >
166
       <if test="id != null" >
170
       <if test="id != null" >
@@ -202,6 +206,9 @@
202
       <if test="hdsj != null">
206
       <if test="hdsj != null">
203
       	#{hdsj,jdbcType=TIMESTAMP},
207
       	#{hdsj,jdbcType=TIMESTAMP},
204
       </if>
208
       </if>
209
+      <if test="scny != null">
210
+      	#{scny,jdbcType=VARCHAR},
211
+      </if>
205
     </trim>
212
     </trim>
206
   </insert>
213
   </insert>
207
   <select id="countByExample" parameterType="com.chinaitop.depot.product.model.StorageProductKcslExample" resultType="java.lang.Integer" >
214
   <select id="countByExample" parameterType="com.chinaitop.depot.product.model.StorageProductKcslExample" resultType="java.lang.Integer" >
@@ -252,6 +259,9 @@
252
       <if test="record.hdsj != null">
259
       <if test="record.hdsj != null">
253
       	hdsj = #{record.hdsj,jdbcType=TIMESTAMP},
260
       	hdsj = #{record.hdsj,jdbcType=TIMESTAMP},
254
       </if>
261
       </if>
262
+      <if test="record.scny != null">
263
+      	scny = #{record.scny,jdbcType=VARCHAR},
264
+      </if>
255
     </set>
265
     </set>
256
     <if test="_parameter != null" >
266
     <if test="_parameter != null" >
257
       <include refid="Update_By_Example_Where_Clause" />
267
       <include refid="Update_By_Example_Where_Clause" />
@@ -271,7 +281,8 @@
271
       scrq = #{record.scrq,jdbcType=TIMESTAMP},
281
       scrq = #{record.scrq,jdbcType=TIMESTAMP},
272
       kcsl = #{record.kcsl,jdbcType=DECIMAL},
282
       kcsl = #{record.kcsl,jdbcType=DECIMAL},
273
       input_time = #{record.inputTime,jdbcType=TIMESTAMP},
283
       input_time = #{record.inputTime,jdbcType=TIMESTAMP},
274
-      hdsj = #{record.hdsj,jdbcType=TIMESTAMP}
284
+      hdsj = #{record.hdsj,jdbcType=TIMESTAMP},
285
+      scny = #{record.scny,jdbcType=VARCHAR}
275
     <if test="_parameter != null" >
286
     <if test="_parameter != null" >
276
       <include refid="Update_By_Example_Where_Clause" />
287
       <include refid="Update_By_Example_Where_Clause" />
277
     </if>
288
     </if>
@@ -315,6 +326,9 @@
315
       <if test="hdsj != null">
326
       <if test="hdsj != null">
316
       	hdsj = #{hdsj,jdbcType=TIMESTAMP},
327
       	hdsj = #{hdsj,jdbcType=TIMESTAMP},
317
       </if>
328
       </if>
329
+      <if test="scny != null">
330
+      	scny = #{scny,jdbcType=VARCHAR},
331
+      </if>
318
     </set>
332
     </set>
319
     where id = #{id,jdbcType=VARCHAR}
333
     where id = #{id,jdbcType=VARCHAR}
320
   </update>
334
   </update>
@@ -331,7 +345,8 @@
331
       scrq = #{scrq,jdbcType=TIMESTAMP},
345
       scrq = #{scrq,jdbcType=TIMESTAMP},
332
       kcsl = #{kcsl,jdbcType=DECIMAL},
346
       kcsl = #{kcsl,jdbcType=DECIMAL},
333
       input_time = #{inputTime,jdbcType=TIMESTAMP},
347
       input_time = #{inputTime,jdbcType=TIMESTAMP},
334
-      hdsj = #{hdsj,jdbcType=TIMESTAMP}
348
+      hdsj = #{hdsj,jdbcType=TIMESTAMP},
349
+      scny = #{scny,jdbcType=VARCHAR}
335
     where id = #{id,jdbcType=VARCHAR}
350
     where id = #{id,jdbcType=VARCHAR}
336
   </update>
351
   </update>
337
 
352
 

+ 19 - 0
src/main/java/com/chinaitop/depot/product/model/StorageProductKcsl.java

@@ -29,6 +29,8 @@ public class StorageProductKcsl {
29
     private Date inputTime;
29
     private Date inputTime;
30
     
30
     
31
     private Date hdsj;
31
     private Date hdsj;
32
+    
33
+    private String scny;
32
 
34
 
33
     /**
35
     /**
34
      * ID
36
      * ID
@@ -237,4 +239,21 @@ public class StorageProductKcsl {
237
 	public void setHdsj(Date hdsj) {
239
 	public void setHdsj(Date hdsj) {
238
 		this.hdsj = hdsj;
240
 		this.hdsj = hdsj;
239
 	}
241
 	}
242
+
243
+	/**
244
+	 * 生产年月
245
+	 * @return
246
+	 */
247
+	public String getScny() {
248
+		return scny;
249
+	}
250
+
251
+	/**
252
+	 * 生产年月
253
+	 * @param scny
254
+	 */
255
+	public void setScny(String scny) {
256
+		this.scny = scny;
257
+	}
258
+
240
 }
259
 }

+ 8 - 0
src/main/java/com/chinaitop/depot/product/service/impl/StorageProductKcslServiceImpl.java

@@ -23,6 +23,8 @@ import com.chinaitop.depot.product.model.StorageProductFcbgz;
23
 import com.chinaitop.depot.product.model.StorageProductKcsl;
23
 import com.chinaitop.depot.product.model.StorageProductKcsl;
24
 import com.chinaitop.depot.product.model.StorageProductKcslExample;
24
 import com.chinaitop.depot.product.model.StorageProductKcslExample;
25
 import com.chinaitop.depot.product.service.StorageProductKcslService;
25
 import com.chinaitop.depot.product.service.StorageProductKcslService;
26
+import com.chinaitop.depot.utils.ParameterUtil;
27
+
26
 import org.springframework.transaction.annotation.Transactional;
28
 import org.springframework.transaction.annotation.Transactional;
27
 
29
 
28
 @Service
30
 @Service
@@ -129,6 +131,9 @@ public class StorageProductKcslServiceImpl implements StorageProductKcslService
129
 		String crk_bz = ""; //0出库,1入库
131
 		String crk_bz = ""; //0出库,1入库
130
 		if (null != kcsl) {
132
 		if (null != kcsl) {
131
 			kcsl.setHdsj(new Date());
133
 			kcsl.setHdsj(new Date());
134
+			String scny = ParameterUtil.datetime2string(fcbgz.getProductionDate());
135
+			scny = scny.substring(0, 7);//只要年和月
136
+			kcsl.setScny(scny);
132
 			kcs = kcsl.getKcsl();
137
 			kcs = kcsl.getKcsl();
133
 
138
 
134
 			//入库
139
 			//入库
@@ -175,6 +180,9 @@ public class StorageProductKcslServiceImpl implements StorageProductKcslService
175
 			kcsl.setRksj(fcbgz.getRecordDate());
180
 			kcsl.setRksj(fcbgz.getRecordDate());
176
 			kcsl.setScrq(fcbgz.getProductionDate());
181
 			kcsl.setScrq(fcbgz.getProductionDate());
177
 			kcsl.setOrgId(fcbgz.getOrgId());
182
 			kcsl.setOrgId(fcbgz.getOrgId());
183
+			String scny = ParameterUtil.datetime2string(fcbgz.getProductionDate());
184
+			scny = scny.substring(0, 7);//只要年和月
185
+			kcsl.setScny(scny);
178
 			//入库
186
 			//入库
179
 			if (StringUtils.isNotBlank(fcbgz.getStorageQuantity()) && !"0".equals(fcbgz.getStorageQuantity())) {
187
 			if (StringUtils.isNotBlank(fcbgz.getStorageQuantity()) && !"0".equals(fcbgz.getStorageQuantity())) {
180
 				BigDecimal rksl = new BigDecimal(fcbgz.getStorageQuantity());
188
 				BigDecimal rksl = new BigDecimal(fcbgz.getStorageQuantity());