Kaynağa Gözat

接收的通知单中收获年度和生产年份、产地取自于出入库

gaodd 5 yıl önce
ebeveyn
işleme
ca9ce39d54

+ 67 - 5
src/main/java/com/chinaitop/depot/business/mapper/BusinessNoticeReceiveMapper.xml

@@ -26,6 +26,10 @@
26
     <result column="grain_attribute" property="grainAttribute" jdbcType="INTEGER" />
26
     <result column="grain_attribute" property="grainAttribute" jdbcType="INTEGER" />
27
     <result column="grain_detail_kind" property="grainDetailKind" jdbcType="INTEGER" />
27
     <result column="grain_detail_kind" property="grainDetailKind" jdbcType="INTEGER" />
28
     <result column="receive_time" property="receiveTime" jdbcType="TIMESTAMP" />
28
     <result column="receive_time" property="receiveTime" jdbcType="TIMESTAMP" />
29
+    <result column="input_time" property="inputTime" jdbcType="TIMESTAMP" />
30
+     <result column="grain_annual" property="grainAnnual" jdbcType="INTEGER" />
31
+    <result column="productive_year" property="productiveYear" jdbcType="INTEGER" />
32
+     <result column="grain_producing_area" property="grainProducingArea" jdbcType="INTEGER" />
29
   </resultMap>
33
   </resultMap>
30
   <sql id="Example_Where_Clause" >
34
   <sql id="Example_Where_Clause" >
31
     <!--
35
     <!--
@@ -103,7 +107,7 @@
103
     -->
107
     -->
104
     id, notice_number, crktype, contract_number, ywtype, house_id, ware_house_id, grain_kind, 
108
     id, notice_number, crktype, contract_number, ywtype, house_id, ware_house_id, grain_kind, 
105
     grain_grade, count, outgoing_period, forwarding_unit, receive_unit, resion, in_application, 
109
     grain_grade, count, outgoing_period, forwarding_unit, receive_unit, resion, in_application, 
106
-    org_id, grain_attribute, grain_detail_kind, receive_time
110
+    org_id, grain_attribute, grain_detail_kind, receive_time,input_time,grain_annual,productive_year,grain_producing_area
107
   </sql>
111
   </sql>
108
   <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.business.model.BusinessNoticeReceiveExample" >
112
   <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.business.model.BusinessNoticeReceiveExample" >
109
     <!--
113
     <!--
@@ -167,14 +171,15 @@
167
       count, outgoing_period, forwarding_unit, 
171
       count, outgoing_period, forwarding_unit, 
168
       receive_unit, resion, in_application, 
172
       receive_unit, resion, in_application, 
169
       org_id, grain_attribute, grain_detail_kind, 
173
       org_id, grain_attribute, grain_detail_kind, 
170
-      receive_time)
174
+      receive_time,input_time,grain_annual,productive_year,grain_producing_area)
171
     values (#{id,jdbcType=INTEGER}, #{noticeNumber,jdbcType=VARCHAR}, #{crktype,jdbcType=VARCHAR}, 
175
     values (#{id,jdbcType=INTEGER}, #{noticeNumber,jdbcType=VARCHAR}, #{crktype,jdbcType=VARCHAR}, 
172
       #{contractNumber,jdbcType=VARCHAR}, #{ywtype,jdbcType=VARCHAR}, #{houseId,jdbcType=INTEGER}, 
176
       #{contractNumber,jdbcType=VARCHAR}, #{ywtype,jdbcType=VARCHAR}, #{houseId,jdbcType=INTEGER}, 
173
       #{wareHouseId,jdbcType=INTEGER}, #{grainKind,jdbcType=INTEGER}, #{grainGrade,jdbcType=INTEGER}, 
177
       #{wareHouseId,jdbcType=INTEGER}, #{grainKind,jdbcType=INTEGER}, #{grainGrade,jdbcType=INTEGER}, 
174
       #{count,jdbcType=VARCHAR}, #{outgoingPeriod,jdbcType=VARCHAR}, #{forwardingUnit,jdbcType=VARCHAR}, 
178
       #{count,jdbcType=VARCHAR}, #{outgoingPeriod,jdbcType=VARCHAR}, #{forwardingUnit,jdbcType=VARCHAR}, 
175
       #{receiveUnit,jdbcType=VARCHAR}, #{resion,jdbcType=VARCHAR}, #{inApplication,jdbcType=INTEGER}, 
179
       #{receiveUnit,jdbcType=VARCHAR}, #{resion,jdbcType=VARCHAR}, #{inApplication,jdbcType=INTEGER}, 
176
       #{orgId,jdbcType=INTEGER}, #{grainAttribute,jdbcType=INTEGER}, #{grainDetailKind,jdbcType=INTEGER}, 
180
       #{orgId,jdbcType=INTEGER}, #{grainAttribute,jdbcType=INTEGER}, #{grainDetailKind,jdbcType=INTEGER}, 
177
-      #{receiveTime,jdbcType=TIMESTAMP})
181
+      #{receiveTime,jdbcType=TIMESTAMP},#{inputTime,jdbcType=TIMESTAMP},#{grainAnnual,jdbcType=INTEGER},
182
+      #{productiveYear,jdbcType=INTEGER},#{grainProducingArea,jdbcType=INTEGER})
178
   </insert>
183
   </insert>
179
   <insert id="insertSelective" parameterType="com.chinaitop.depot.business.model.BusinessNoticeReceive" >
184
   <insert id="insertSelective" parameterType="com.chinaitop.depot.business.model.BusinessNoticeReceive" >
180
     <!--
185
     <!--
@@ -241,6 +246,18 @@
241
       <if test="receiveTime != null" >
246
       <if test="receiveTime != null" >
242
         receive_time,
247
         receive_time,
243
       </if>
248
       </if>
249
+      <if test="inputTime != null" >
250
+        input_time,
251
+      </if>
252
+      <if test="grainAnnual != null" >
253
+        grain_annual,
254
+      </if>
255
+      <if test="productiveYear != null" >
256
+        productive_year,
257
+      </if>
258
+      <if test="grainProducingArea != null" >
259
+        grain_producing_area,
260
+      </if>
244
     </trim>
261
     </trim>
245
     <trim prefix="values (" suffix=")" suffixOverrides="," >
262
     <trim prefix="values (" suffix=")" suffixOverrides="," >
246
       <if test="id != null" >
263
       <if test="id != null" >
@@ -300,6 +317,18 @@
300
       <if test="receiveTime != null" >
317
       <if test="receiveTime != null" >
301
         #{receiveTime,jdbcType=TIMESTAMP},
318
         #{receiveTime,jdbcType=TIMESTAMP},
302
       </if>
319
       </if>
320
+      <if test="inputTime != null" >
321
+        #{inputTime,jdbcType=TIMESTAMP},
322
+      </if>
323
+      <if test="grainAnnual != null" >
324
+        #{grainAnnual,jdbcType=INTEGER},
325
+      </if>
326
+      <if test="productiveYear != null" >
327
+        #{productiveYear,jdbcType=INTEGER},
328
+      </if>
329
+      <if test="grainProducingArea != null" >
330
+        #{grainProducingArea,jdbcType=INTEGER},
331
+      </if>
303
     </trim>
332
     </trim>
304
   </insert>
333
   </insert>
305
   <select id="countByExample" parameterType="com.chinaitop.depot.business.model.BusinessNoticeReceiveExample" resultType="java.lang.Integer" >
334
   <select id="countByExample" parameterType="com.chinaitop.depot.business.model.BusinessNoticeReceiveExample" resultType="java.lang.Integer" >
@@ -378,6 +407,18 @@
378
       <if test="record.receiveTime != null" >
407
       <if test="record.receiveTime != null" >
379
         receive_time = #{record.receiveTime,jdbcType=TIMESTAMP},
408
         receive_time = #{record.receiveTime,jdbcType=TIMESTAMP},
380
       </if>
409
       </if>
410
+      <if test="record.inputTime != null" >
411
+        input_time = #{record.inputTime,jdbcType=TIMESTAMP},
412
+      </if>
413
+      <if test="record.grainAnnual != null" >
414
+        grain_annual = #{record.grainAnnual,jdbcType=INTEGER},
415
+      </if>
416
+      <if test="record.productiveYear!= null" >
417
+        productive_year = #{record.productiveYear,jdbcType=INTEGER},
418
+      </if>
419
+      <if test="record.grainProducingArea != null" >
420
+        grain_producing_area = #{record.grainProducingArea,jdbcType=INTEGER},
421
+      </if>
381
     </set>
422
     </set>
382
     <if test="_parameter != null" >
423
     <if test="_parameter != null" >
383
       <include refid="Update_By_Example_Where_Clause" />
424
       <include refid="Update_By_Example_Where_Clause" />
@@ -408,7 +449,12 @@
408
       org_id = #{record.orgId,jdbcType=INTEGER},
449
       org_id = #{record.orgId,jdbcType=INTEGER},
409
       grain_attribute = #{record.grainAttribute,jdbcType=INTEGER},
450
       grain_attribute = #{record.grainAttribute,jdbcType=INTEGER},
410
       grain_detail_kind = #{record.grainDetailKind,jdbcType=INTEGER},
451
       grain_detail_kind = #{record.grainDetailKind,jdbcType=INTEGER},
411
-      receive_time = #{record.receiveTime,jdbcType=TIMESTAMP}
452
+      receive_time = #{record.receiveTime,jdbcType=TIMESTAMP},
453
+      input_time = #{record.inputTime,jdbcType=TIMESTAMP},
454
+      grain_annual = #{record.grainAnnual,jdbcType=INTEGER},
455
+      productive_year = #{record.productiveYear,jdbcType=INTEGER},
456
+      grain_producing_area = #{record.grainProducingArea,jdbcType=INTEGER}
457
+      
412
     <if test="_parameter != null" >
458
     <if test="_parameter != null" >
413
       <include refid="Update_By_Example_Where_Clause" />
459
       <include refid="Update_By_Example_Where_Clause" />
414
     </if>
460
     </if>
@@ -475,6 +521,18 @@
475
       <if test="receiveTime != null" >
521
       <if test="receiveTime != null" >
476
         receive_time = #{receiveTime,jdbcType=TIMESTAMP},
522
         receive_time = #{receiveTime,jdbcType=TIMESTAMP},
477
       </if>
523
       </if>
524
+      <if test="receiveTime != null" >
525
+        input_time = #{inputTime,jdbcType=TIMESTAMP},
526
+      </if>
527
+      <if test="grainAnnual != null" >
528
+        grain_annual = #{grainAnnual,jdbcType=INTEGER},
529
+      </if>
530
+      <if test="productiveYear != null" >
531
+        productive_year = #{productiveYear,jdbcType=INTEGER},
532
+      </if>
533
+      <if test="grainProducingArea != null" >
534
+        grain_producing_area = #{grainProducingArea,jdbcType=INTEGER},
535
+      </if>
478
     </set>
536
     </set>
479
     where id = #{id,jdbcType=INTEGER}
537
     where id = #{id,jdbcType=INTEGER}
480
   </update>
538
   </update>
@@ -502,7 +560,11 @@
502
       org_id = #{orgId,jdbcType=INTEGER},
560
       org_id = #{orgId,jdbcType=INTEGER},
503
       grain_attribute = #{grainAttribute,jdbcType=INTEGER},
561
       grain_attribute = #{grainAttribute,jdbcType=INTEGER},
504
       grain_detail_kind = #{grainDetailKind,jdbcType=INTEGER},
562
       grain_detail_kind = #{grainDetailKind,jdbcType=INTEGER},
505
-      receive_time = #{receiveTime,jdbcType=TIMESTAMP}
563
+      receive_time = #{receiveTime,jdbcType=TIMESTAMP},
564
+      input_time = #{inputTime,jdbcType=TIMESTAMP},
565
+      grain_annual = #{grainAnnual,jdbcType=INTEGER},
566
+      productive_year = #{productiveYear,jdbcType=INTEGER},
567
+      grain_producing_area = #{grainProducingArea,jdbcType=INTEGER}
506
     where id = #{id,jdbcType=INTEGER}
568
     where id = #{id,jdbcType=INTEGER}
507
   </update>
569
   </update>
508
 </mapper>
570
 </mapper>

+ 40 - 0
src/main/java/com/chinaitop/depot/business/model/BusinessNoticeReceive.java

@@ -64,6 +64,46 @@ public class BusinessNoticeReceive {
64
 			this.outRemainingNumber = outRemainingNumber;
64
 			this.outRemainingNumber = outRemainingNumber;
65
 		}
65
 		}
66
 		
66
 		
67
+		//表里面新增的字段
68
+		private Integer grainAnnual;//收获年度
69
+		private Integer productiveYear;//生产年份
70
+		private Integer grainProducingArea;//粮油产地
71
+		private Date inputTime;//入库时间
72
+		
73
+		
74
+		 public Integer getGrainAnnual() {
75
+		        return grainAnnual;
76
+		 }
77
+
78
+		 public void setGrainAnnual(Integer grainAnnual) {
79
+		        this.grainAnnual = grainAnnual;
80
+		 }
81
+		 public Integer getProductiveYear() {
82
+		        return productiveYear;
83
+		 }
84
+
85
+		 public void setProductiveYear(Integer productiveYear) {
86
+		        this.productiveYear = productiveYear;
87
+		 }
88
+		 public Integer getGrainProducingArea() {
89
+		        return grainProducingArea;
90
+		 }
91
+
92
+		 public void setGrainProducingArea(Integer grainProducingArea) {
93
+		        this.grainProducingArea = grainProducingArea;
94
+		 }
95
+
96
+		 public Date getInputTime() {
97
+		        return inputTime;
98
+		 }
99
+
100
+		 public void setInputTime(Date inputTime) {
101
+		        this.inputTime = inputTime;
102
+		 }
103
+		    
104
+		
105
+		
106
+		
67
     /**
107
     /**
68
      * This field was generated by MyBatis Generator.
108
      * This field was generated by MyBatis Generator.
69
      * This field corresponds to the database column business_notice_receive.id
109
      * This field corresponds to the database column business_notice_receive.id

+ 4 - 0
src/main/java/com/chinaitop/depot/business/service/FeignBasicService.java

@@ -15,5 +15,9 @@ public interface FeignBasicService {
15
 
15
 
16
     @RequestMapping(value = "/Warehouse/getWareDataByHwbm", method = RequestMethod.GET)
16
     @RequestMapping(value = "/Warehouse/getWareDataByHwbm", method = RequestMethod.GET)
17
     Map<String, Object> getWareDataByHwbm(@RequestParam(value = "hwbm") String hwbm);
17
     Map<String, Object> getWareDataByHwbm(@RequestParam(value = "hwbm") String hwbm);
18
+    
19
+    
20
+    @RequestMapping(value = "/Enum/getIdByNameAndParentId", method = RequestMethod.GET)
21
+    Map<String, Object> getIdByNameAndParentId(@RequestParam(value = "parentId") Integer parentId,@RequestParam(value = "enumName") String enumName);
18
 
22
 
19
 }
23
 }

+ 17 - 2
src/main/java/com/chinaitop/depot/business/service/impl/ReceiveNoticeServiceImpl.java

@@ -180,14 +180,28 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
180
                     	}else{
180
                     	}else{
181
                           //根据仓房、货位、orgId获取粮食品种等信息
181
                           //根据仓房、货位、orgId获取粮食品种等信息
182
                             Map<String, Object> map = feignAgileService.getDateByChHwh(orgId, houseId, wareHouseId);
182
                             Map<String, Object> map = feignAgileService.getDateByChHwh(orgId, houseId, wareHouseId);
183
-                             grainAttribute = (Integer) map.get("hwxz"); //粮油性质
184
-                             grainKind = (Integer) map.get("pz"); //品种
183
+                            grainAttribute = (Integer) map.get("hwxz"); //粮油性质
184
+                            grainKind = (Integer) map.get("pz"); //品种
185
                             Integer grainDetailKind = (Integer) map.get("mxpz"); //明细品种
185
                             Integer grainDetailKind = (Integer) map.get("mxpz"); //明细品种
186
                             Integer grainGrade = (Integer) map.get("dj"); //等级
186
                             Integer grainGrade = (Integer) map.get("dj"); //等级
187
+                            Date inputTime = (Date) map.get("rq"); //入库时间
188
+                            if(inputTime!=null){
189
+                            	String year=String.format("%tY", inputTime);
190
+                                Map<String, Object> basicMap = feignBasicService.getIdByNameAndParentId(1004, year);//1004是生产年份的父ID
191
+                                Integer productiveYear = (Integer) basicMap.get("enumId");
192
+                                businessNoticeReceive.setProductiveYear(productiveYear);//生产年份
193
+                                businessNoticeReceive.setGrainAnnual(productiveYear);//收获年度
194
+                            }
195
+                            
196
+                            Integer grainProducingArea = (Integer) map.get("gb"); //产地
197
+                            
187
                             businessNoticeReceive.setGrainKind(grainKind); //品种
198
                             businessNoticeReceive.setGrainKind(grainKind); //品种
188
                             businessNoticeReceive.setGrainDetailKind(grainDetailKind); //明细品种
199
                             businessNoticeReceive.setGrainDetailKind(grainDetailKind); //明细品种
189
                             businessNoticeReceive.setGrainGrade(grainGrade); //等级
200
                             businessNoticeReceive.setGrainGrade(grainGrade); //等级
190
                             businessNoticeReceive.setGrainAttribute(grainAttribute); //粮油性质
201
                             businessNoticeReceive.setGrainAttribute(grainAttribute); //粮油性质
202
+                            businessNoticeReceive.setInputTime(inputTime);//入库时间
203
+                            businessNoticeReceive.setGrainProducingArea(grainProducingArea);//产地
204
+                           
191
                     	}
205
                     	}
192
                         String  lsyqsl = jsonObject.getString("lsyqsl");
206
                         String  lsyqsl = jsonObject.getString("lsyqsl");
193
                         BigDecimal s = new BigDecimal(1000);
207
                         BigDecimal s = new BigDecimal(1000);
@@ -203,6 +217,7 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
203
                        businessNoticeReceive.setReceiveTime(new Date());//接收数据的时间
217
                        businessNoticeReceive.setReceiveTime(new Date());//接收数据的时间
204
                        businessNoticeReceiveMapper.insert(businessNoticeReceive);
218
                        businessNoticeReceiveMapper.insert(businessNoticeReceive);
205
                    	
219
                    	
220
+                       
206
                        /**
221
                        /**
207
                         * 修改粮食性质(轮换或者销售进行修改)
222
                         * 修改粮食性质(轮换或者销售进行修改)
208
                         *   parameters[0] = ;     //单位ID
223
                         *   parameters[0] = ;     //单位ID

+ 7 - 0
src/main/java/com/chinaitop/depot/utils/HelloServiceHystrix.java

@@ -78,4 +78,11 @@ public class HelloServiceHystrix implements FeignAgileService,FeignBasicService{
78
 		return null;
78
 		return null;
79
 	}
79
 	}
80
 
80
 
81
+	@Override
82
+	public Map<String, Object> getIdByNameAndParentId(Integer parentId, String enumName) {
83
+		// TODO Auto-generated method stub
84
+		logger.info("获取生产年度的ID失败!");
85
+		return null;
86
+	}
87
+
81
 }
88
 }