浏览代码

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

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

+ 5 - 0
pom.xml

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

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

@@ -1,5 +1,14 @@
1 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 12
 import com.chinaitop.depot.business.mapper.BusinessDrugStorageMapper;
4 13
 import com.chinaitop.depot.business.model.BusinessDrugInfo;
5 14
 import com.chinaitop.depot.business.model.BusinessDrugInfoKey;
@@ -8,14 +17,6 @@ import com.chinaitop.depot.business.model.BusinessDrugStorageExample;
8 17
 import com.chinaitop.depot.business.service.BusinessDrugInfoService;
9 18
 import com.chinaitop.depot.business.service.BusinessDrugStandingBookService;
10 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 22
 @Service

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

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

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

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

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

@@ -29,6 +29,8 @@ public class StorageProductKcsl {
29 29
     private Date inputTime;
30 30
     
31 31
     private Date hdsj;
32
+    
33
+    private String scny;
32 34
 
33 35
     /**
34 36
      * ID
@@ -237,4 +239,21 @@ public class StorageProductKcsl {
237 239
 	public void setHdsj(Date hdsj) {
238 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 23
 import com.chinaitop.depot.product.model.StorageProductKcsl;
24 24
 import com.chinaitop.depot.product.model.StorageProductKcslExample;
25 25
 import com.chinaitop.depot.product.service.StorageProductKcslService;
26
+import com.chinaitop.depot.utils.ParameterUtil;
27
+
26 28
 import org.springframework.transaction.annotation.Transactional;
27 29
 
28 30
 @Service
@@ -129,6 +131,9 @@ public class StorageProductKcslServiceImpl implements StorageProductKcslService
129 131
 		String crk_bz = ""; //0出库,1入库
130 132
 		if (null != kcsl) {
131 133
 			kcsl.setHdsj(new Date());
134
+			String scny = ParameterUtil.datetime2string(fcbgz.getProductionDate());
135
+			scny = scny.substring(0, 7);//只要年和月
136
+			kcsl.setScny(scny);
132 137
 			kcs = kcsl.getKcsl();
133 138
 
134 139
 			//入库
@@ -175,6 +180,9 @@ public class StorageProductKcslServiceImpl implements StorageProductKcslService
175 180
 			kcsl.setRksj(fcbgz.getRecordDate());
176 181
 			kcsl.setScrq(fcbgz.getProductionDate());
177 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 187
 			if (StringUtils.isNotBlank(fcbgz.getStorageQuantity()) && !"0".equals(fcbgz.getStorageQuantity())) {
180 188
 				BigDecimal rksl = new BigDecimal(fcbgz.getStorageQuantity());