fanxw 5 meses atrás
pai
commit
1510d93a1e

+ 23 - 6
src/main/java/com/chinaitop/depot/business/mapper/BusinessNoticeReceiveMapper.xml

@@ -43,6 +43,7 @@
43 43
     <result column="is_sheet" property="isSheet" jdbcType="INTEGER" />
44 44
     <result column="cblx" property="cblx" jdbcType="VARCHAR" />
45 45
     <result column="ysid" property="ysid" jdbcType="VARCHAR" />
46
+    <result column="ytzdid" property="ytzdid" jdbcType="VARCHAR" />
46 47
      
47 48
   </resultMap>
48 49
   <sql id="Example_Where_Clause" >
@@ -117,7 +118,7 @@
117 118
     id, notice_number, crktype, contract_number, ywtype, house_id, ware_house_id, grain_kind, 
118 119
     grain_grade, count, outgoing_period, forwarding_unit, receive_unit, resion, in_application, 
119 120
     org_id, grain_attribute, grain_detail_kind, receive_time,input_time,grain_annual,productive_year,grain_producing_area,
120
-    lsxzzbdh,lssl,hzqlsxzdm,hzrq,ccshr,zjshr,tjshr,kjshr,ldshr,bz,audit_state,is_notice,pzmc,is_sheet,htbh,cblx,ysid
121
+    lsxzzbdh,lssl,hzqlsxzdm,hzrq,ccshr,zjshr,tjshr,kjshr,ldshr,bz,audit_state,is_notice,pzmc,is_sheet,htbh,cblx,ysid, ytzdid
121 122
   </sql>
122 123
   <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.business.model.BusinessNoticeReceiveExample" >
123 124
     select
@@ -157,7 +158,8 @@
157 158
       receive_unit, resion, in_application, 
158 159
       org_id, grain_attribute, grain_detail_kind, 
159 160
       receive_time,input_time,grain_annual,productive_year,grain_producing_area,
160
-      lsxzzbdh,lssl,hzqlsxzdm,hzrq,ccshr,zjshr,tjshr,kjshr,ldshr,bz,audit_state,is_notice,pzmc,is_sheet,htbh,cblx,ysid)
161
+      lsxzzbdh,lssl,hzqlsxzdm,hzrq,ccshr,zjshr,tjshr,kjshr,ldshr,bz,audit_state,is_notice,pzmc,is_sheet,htbh,cblx,ysid,
162
+      ytzdid)
161 163
     values (#{id,jdbcType=INTEGER}, #{noticeNumber,jdbcType=VARCHAR}, #{crktype,jdbcType=VARCHAR}, 
162 164
       #{contractNumber,jdbcType=VARCHAR}, #{ywtype,jdbcType=VARCHAR}, #{houseId,jdbcType=INTEGER}, 
163 165
       #{wareHouseId,jdbcType=INTEGER}, #{grainKind,jdbcType=INTEGER}, #{grainGrade,jdbcType=INTEGER}, 
@@ -169,8 +171,9 @@
169 171
       #{lsxzzbdh,jdbcType=VARCHAR},#{lssl,jdbcType=VARCHAR},#{hzqlsxzdm,jdbcType=INTEGER},
170 172
       #{hzrq,jdbcType=TIMESTAMP},#{ccshr,jdbcType=VARCHAR},#{zjshr,jdbcType=VARCHAR},
171 173
       #{tjshr,jdbcType=VARCHAR},#{kjshr,jdbcType=VARCHAR},#{ldshr,jdbcType=VARCHAR},
172
-      #{bz,jdbcType=VARCHAR},#{auditState,jdbcType=INTEGER},#{isNotice,jdbcType=INTEGER},#{pzmc,jdbcType=VARCHAR}
173
-      ,#{isSheet,jdbcType=INTEGER},#{htbh,jdbcType=VARCHAR},#{cblx,jdbcType=VARCHAR},#{ysid,jdbcType=VARCHAR})
174
+      #{bz,jdbcType=VARCHAR},#{auditState,jdbcType=INTEGER},#{isNotice,jdbcType=INTEGER},#{pzmc,jdbcType=VARCHAR},
175
+      #{isSheet,jdbcType=INTEGER},#{htbh,jdbcType=VARCHAR},#{cblx,jdbcType=VARCHAR},#{ysid,jdbcType=VARCHAR},
176
+      #{ytzdid,jdbcType=VARCHAR})
174 177
   </insert>
175 178
   <insert id="insertSelective" parameterType="com.chinaitop.depot.business.model.BusinessNoticeReceive" >
176 179
     insert into business_notice_receive
@@ -295,6 +298,9 @@
295 298
       <if test="ysid != null">
296 299
         ysid,
297 300
       </if>
301
+      <if test="ytzdid != null">
302
+        ytzdid,
303
+      </if>
298 304
     </trim>
299 305
     <trim prefix="values (" suffix=")" suffixOverrides="," >
300 306
       <if test="id != null" >
@@ -417,6 +423,9 @@
417 423
       <if test="ysid != null">
418 424
         #{ysid,jdbcType=VARCHAR},
419 425
       </if>
426
+      <if test="ytzdid != null">
427
+        #{ytzdid,jdbcType=VARCHAR},
428
+      </if>
420 429
     </trim>
421 430
   </insert>
422 431
   <select id="countByExample" parameterType="com.chinaitop.depot.business.model.BusinessNoticeReceiveExample" resultType="java.lang.Integer" >
@@ -548,6 +557,9 @@
548 557
       <if test="record.ysid != null">
549 558
         ysid = #{record.ysid,jdbcType=VARCHAR},
550 559
       </if>
560
+      <if test="record.ytzdid != null">
561
+        ytzdid = #{record.ytzdid,jdbcType=VARCHAR},
562
+      </if>
551 563
     </set>
552 564
     <if test="_parameter != null" >
553 565
       <include refid="Update_By_Example_Where_Clause" />
@@ -594,7 +606,8 @@
594 606
       is_sheet = #{record.isSheet,jdbcType=INTEGER},
595 607
       htbh = #{record.htbh,jdbcType=VARCHAR},
596 608
       cblx = #{record.cblx,jdbcType=VARCHAR},
597
-      ysid = #{record.ysid,jdbcType=VARCHAR}
609
+      ysid = #{record.ysid,jdbcType=VARCHAR},
610
+      ytzdid = #{record.ytzdid,jdbcType=VARCHAR}
598 611
       
599 612
     <if test="_parameter != null" >
600 613
       <include refid="Update_By_Example_Where_Clause" />
@@ -720,6 +733,9 @@
720 733
       <if test="ysid != null">
721 734
         ysid = #{ysid,jdbcType=VARCHAR},
722 735
       </if>
736
+      <if test="ytzdid != null">
737
+        ytzdid = #{ytzdid,jdbcType=VARCHAR},
738
+      </if>
723 739
     </set>
724 740
     where id = #{id,jdbcType=INTEGER}
725 741
   </update>
@@ -763,7 +779,8 @@
763 779
       is_sheet = #{isSheet,jdbcType=INTEGER},
764 780
       htbh = #{htbh,jdbcType=VARCHAR},
765 781
       cblx = #{cblx,jdbcType=VARCHAR},
766
-      ysid = #{ysid,jdbcType=VARCHAR}
782
+      ysid = #{ysid,jdbcType=VARCHAR},
783
+      ytzdid = #{ytzdid,jdbcType=VARCHAR}
767 784
     where id = #{id,jdbcType=INTEGER}
768 785
   </update>
769 786
   

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

@@ -25,6 +25,7 @@ public class BusinessNoticeReceive {
25 25
     private String htbh;
26 26
     private String cblx;
27 27
     private String ysid;
28
+    private String ytzdid;//原通知单ID
28 29
 
29 30
     /**
30 31
      * 0是性质转变单
@@ -857,4 +858,20 @@ public class BusinessNoticeReceive {
857 858
 		this.ysid = ysid;
858 859
 	}
859 860
 
861
+	/**
862
+	 * 原通知单ID
863
+	 * @return
864
+	 */
865
+	public String getYtzdid() {
866
+		return ytzdid;
867
+	}
868
+
869
+	/**
870
+	 * 原通知单ID
871
+	 * @param ytzdid
872
+	 */
873
+	public void setYtzdid(String ytzdid) {
874
+		this.ytzdid = ytzdid;
875
+	}
876
+
860 877
 }

+ 14 - 1
src/main/java/com/chinaitop/depot/business/service/impl/ReceiveNoticeServiceImpl.java

@@ -195,6 +195,8 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
195 195
             if(selectByExample.size()>0){//存在修改(只修改出库期限)
196 196
                 BusinessNoticeReceive record = new BusinessNoticeReceive();
197 197
                 record.setId(selectByExample.get(0).getId());
198
+                String  lsyqsl = jsonObject.getString("lsyqsl");
199
+                record.setCount(lsyqsl); //计划数量(吨)
198 200
                 record.setOutgoingPeriod(jsonObject.getString("ckqx"));
199 201
             	int k = businessNoticeReceiveMapper.updateByPrimaryKeySelective(record);
200 202
             	if(k<0){
@@ -348,6 +350,11 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
348 350
                 				businessNoticeReceive.setAuditState(5);//下达未审批
349 351
                 				businessNoticeReceive.setReceiveTime(new Date());//接收数据的时间
350 352
                 				//businessNoticeReceive.setSfzswtzd("0"); //接收通知单菜单不展示该数据
353
+                				String ytzdid = jsonObject.getString("ytzdid");
354
+                				if (StringUtils.isNotBlank(ytzdid)) {//有值的话就代表是变更的通知单,不需要生成性质转变单
355
+                					businessNoticeReceive.setIsSheet(1);//这是属于通知单变更,不需要重新生成性质转变单
356
+                					businessNoticeReceive.setYtzdid(ytzdid);
357
+                				}
351 358
                 				businessNoticeReceiveMapper.insert(businessNoticeReceive);
352 359
                             } else {//出库类型
353 360
                                 //根据仓房、货位、orgId获取粮食品种等信息
@@ -402,6 +409,12 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
402 409
                     				businessNoticeReceive.setAuditState(0);//下达未审批
403 410
                     				businessNoticeReceive.setReceiveTime(new Date());//接收数据的时间
404 411
                     				//businessNoticeReceive.setSfzswtzd("0"); //接收通知单菜单不展示该数据
412
+                    				String ytzdid = jsonObject.getString("ytzdid");
413
+                    				if (StringUtils.isNotBlank(ytzdid)) {//有值的话就代表是变更的通知单,不需要生成性质转变单
414
+                    					businessNoticeReceive.setIsSheet(1);//这是属于通知单变更,不需要重新生成性质转变单
415
+                    					businessNoticeReceive.setYtzdid(ytzdid);
416
+                    					businessNoticeReceive.setAuditState(5);//状态设置为审批通过
417
+                    				}
405 418
                     				businessNoticeReceiveMapper.insert(businessNoticeReceive);
406 419
                     			} else {
407 420
                     				modelMap.put("msg", "根据所传信息没有查到对应库存信息");
@@ -616,7 +629,7 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
616 629
 		parameters[1] = receiveNotice.getGrainKind() + "";
617 630
 		parameters[2] = receiveNotice.getGrainDetailKind()+"";//明细品种
618 631
 		parameters[3] = receiveNotice.getHouseId() + "";
619
-		if (StringUtils.isNotBlank(receiveNotice.getWareHouseId()+"")) {//粮仓
632
+		if (receiveNotice.getWareHouseId() != null) {//粮仓
620 633
 			parameters[4] = receiveNotice.getWareHouseId() + "";
621 634
 		} else {
622 635
 			parameters[4] = receiveNotice.getHouseId() + "";//油罐