Procházet zdrojové kódy

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

gaodd před 5 roky
rodič
revize
ca9ce39d54

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

@@ -26,6 +26,10 @@
26 26
     <result column="grain_attribute" property="grainAttribute" jdbcType="INTEGER" />
27 27
     <result column="grain_detail_kind" property="grainDetailKind" jdbcType="INTEGER" />
28 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 33
   </resultMap>
30 34
   <sql id="Example_Where_Clause" >
31 35
     <!--
@@ -103,7 +107,7 @@
103 107
     -->
104 108
     id, notice_number, crktype, contract_number, ywtype, house_id, ware_house_id, grain_kind, 
105 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 111
   </sql>
108 112
   <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.business.model.BusinessNoticeReceiveExample" >
109 113
     <!--
@@ -167,14 +171,15 @@
167 171
       count, outgoing_period, forwarding_unit, 
168 172
       receive_unit, resion, in_application, 
169 173
       org_id, grain_attribute, grain_detail_kind, 
170
-      receive_time)
174
+      receive_time,input_time,grain_annual,productive_year,grain_producing_area)
171 175
     values (#{id,jdbcType=INTEGER}, #{noticeNumber,jdbcType=VARCHAR}, #{crktype,jdbcType=VARCHAR}, 
172 176
       #{contractNumber,jdbcType=VARCHAR}, #{ywtype,jdbcType=VARCHAR}, #{houseId,jdbcType=INTEGER}, 
173 177
       #{wareHouseId,jdbcType=INTEGER}, #{grainKind,jdbcType=INTEGER}, #{grainGrade,jdbcType=INTEGER}, 
174 178
       #{count,jdbcType=VARCHAR}, #{outgoingPeriod,jdbcType=VARCHAR}, #{forwardingUnit,jdbcType=VARCHAR}, 
175 179
       #{receiveUnit,jdbcType=VARCHAR}, #{resion,jdbcType=VARCHAR}, #{inApplication,jdbcType=INTEGER}, 
176 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 183
   </insert>
179 184
   <insert id="insertSelective" parameterType="com.chinaitop.depot.business.model.BusinessNoticeReceive" >
180 185
     <!--
@@ -241,6 +246,18 @@
241 246
       <if test="receiveTime != null" >
242 247
         receive_time,
243 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 261
     </trim>
245 262
     <trim prefix="values (" suffix=")" suffixOverrides="," >
246 263
       <if test="id != null" >
@@ -300,6 +317,18 @@
300 317
       <if test="receiveTime != null" >
301 318
         #{receiveTime,jdbcType=TIMESTAMP},
302 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 332
     </trim>
304 333
   </insert>
305 334
   <select id="countByExample" parameterType="com.chinaitop.depot.business.model.BusinessNoticeReceiveExample" resultType="java.lang.Integer" >
@@ -378,6 +407,18 @@
378 407
       <if test="record.receiveTime != null" >
379 408
         receive_time = #{record.receiveTime,jdbcType=TIMESTAMP},
380 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 422
     </set>
382 423
     <if test="_parameter != null" >
383 424
       <include refid="Update_By_Example_Where_Clause" />
@@ -408,7 +449,12 @@
408 449
       org_id = #{record.orgId,jdbcType=INTEGER},
409 450
       grain_attribute = #{record.grainAttribute,jdbcType=INTEGER},
410 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 458
     <if test="_parameter != null" >
413 459
       <include refid="Update_By_Example_Where_Clause" />
414 460
     </if>
@@ -475,6 +521,18 @@
475 521
       <if test="receiveTime != null" >
476 522
         receive_time = #{receiveTime,jdbcType=TIMESTAMP},
477 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 536
     </set>
479 537
     where id = #{id,jdbcType=INTEGER}
480 538
   </update>
@@ -502,7 +560,11 @@
502 560
       org_id = #{orgId,jdbcType=INTEGER},
503 561
       grain_attribute = #{grainAttribute,jdbcType=INTEGER},
504 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 568
     where id = #{id,jdbcType=INTEGER}
507 569
   </update>
508 570
 </mapper>

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

@@ -64,6 +64,46 @@ public class BusinessNoticeReceive {
64 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 108
      * This field was generated by MyBatis Generator.
69 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 16
     @RequestMapping(value = "/Warehouse/getWareDataByHwbm", method = RequestMethod.GET)
17 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 180
                     	}else{
181 181
                           //根据仓房、货位、orgId获取粮食品种等信息
182 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 185
                             Integer grainDetailKind = (Integer) map.get("mxpz"); //明细品种
186 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 198
                             businessNoticeReceive.setGrainKind(grainKind); //品种
188 199
                             businessNoticeReceive.setGrainDetailKind(grainDetailKind); //明细品种
189 200
                             businessNoticeReceive.setGrainGrade(grainGrade); //等级
190 201
                             businessNoticeReceive.setGrainAttribute(grainAttribute); //粮油性质
202
+                            businessNoticeReceive.setInputTime(inputTime);//入库时间
203
+                            businessNoticeReceive.setGrainProducingArea(grainProducingArea);//产地
204
+                           
191 205
                     	}
192 206
                         String  lsyqsl = jsonObject.getString("lsyqsl");
193 207
                         BigDecimal s = new BigDecimal(1000);
@@ -203,6 +217,7 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
203 217
                        businessNoticeReceive.setReceiveTime(new Date());//接收数据的时间
204 218
                        businessNoticeReceiveMapper.insert(businessNoticeReceive);
205 219
                    	
220
+                       
206 221
                        /**
207 222
                         * 修改粮食性质(轮换或者销售进行修改)
208 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 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
 }