fanxw 5 months ago
parent
commit
1510d93a1e

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

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

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

@@ -25,6 +25,7 @@ public class BusinessNoticeReceive {
25
     private String htbh;
25
     private String htbh;
26
     private String cblx;
26
     private String cblx;
27
     private String ysid;
27
     private String ysid;
28
+    private String ytzdid;//原通知单ID
28
 
29
 
29
     /**
30
     /**
30
      * 0是性质转变单
31
      * 0是性质转变单
@@ -857,4 +858,20 @@ public class BusinessNoticeReceive {
857
 		this.ysid = ysid;
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
             if(selectByExample.size()>0){//存在修改(只修改出库期限)
195
             if(selectByExample.size()>0){//存在修改(只修改出库期限)
196
                 BusinessNoticeReceive record = new BusinessNoticeReceive();
196
                 BusinessNoticeReceive record = new BusinessNoticeReceive();
197
                 record.setId(selectByExample.get(0).getId());
197
                 record.setId(selectByExample.get(0).getId());
198
+                String  lsyqsl = jsonObject.getString("lsyqsl");
199
+                record.setCount(lsyqsl); //计划数量(吨)
198
                 record.setOutgoingPeriod(jsonObject.getString("ckqx"));
200
                 record.setOutgoingPeriod(jsonObject.getString("ckqx"));
199
             	int k = businessNoticeReceiveMapper.updateByPrimaryKeySelective(record);
201
             	int k = businessNoticeReceiveMapper.updateByPrimaryKeySelective(record);
200
             	if(k<0){
202
             	if(k<0){
@@ -348,6 +350,11 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
348
                 				businessNoticeReceive.setAuditState(5);//下达未审批
350
                 				businessNoticeReceive.setAuditState(5);//下达未审批
349
                 				businessNoticeReceive.setReceiveTime(new Date());//接收数据的时间
351
                 				businessNoticeReceive.setReceiveTime(new Date());//接收数据的时间
350
                 				//businessNoticeReceive.setSfzswtzd("0"); //接收通知单菜单不展示该数据
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
                 				businessNoticeReceiveMapper.insert(businessNoticeReceive);
358
                 				businessNoticeReceiveMapper.insert(businessNoticeReceive);
352
                             } else {//出库类型
359
                             } else {//出库类型
353
                                 //根据仓房、货位、orgId获取粮食品种等信息
360
                                 //根据仓房、货位、orgId获取粮食品种等信息
@@ -402,6 +409,12 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
402
                     				businessNoticeReceive.setAuditState(0);//下达未审批
409
                     				businessNoticeReceive.setAuditState(0);//下达未审批
403
                     				businessNoticeReceive.setReceiveTime(new Date());//接收数据的时间
410
                     				businessNoticeReceive.setReceiveTime(new Date());//接收数据的时间
404
                     				//businessNoticeReceive.setSfzswtzd("0"); //接收通知单菜单不展示该数据
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
                     				businessNoticeReceiveMapper.insert(businessNoticeReceive);
418
                     				businessNoticeReceiveMapper.insert(businessNoticeReceive);
406
                     			} else {
419
                     			} else {
407
                     				modelMap.put("msg", "根据所传信息没有查到对应库存信息");
420
                     				modelMap.put("msg", "根据所传信息没有查到对应库存信息");
@@ -616,7 +629,7 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
616
 		parameters[1] = receiveNotice.getGrainKind() + "";
629
 		parameters[1] = receiveNotice.getGrainKind() + "";
617
 		parameters[2] = receiveNotice.getGrainDetailKind()+"";//明细品种
630
 		parameters[2] = receiveNotice.getGrainDetailKind()+"";//明细品种
618
 		parameters[3] = receiveNotice.getHouseId() + "";
631
 		parameters[3] = receiveNotice.getHouseId() + "";
619
-		if (StringUtils.isNotBlank(receiveNotice.getWareHouseId()+"")) {//粮仓
632
+		if (receiveNotice.getWareHouseId() != null) {//粮仓
620
 			parameters[4] = receiveNotice.getWareHouseId() + "";
633
 			parameters[4] = receiveNotice.getWareHouseId() + "";
621
 		} else {
634
 		} else {
622
 			parameters[4] = receiveNotice.getHouseId() + "";//油罐
635
 			parameters[4] = receiveNotice.getHouseId() + "";//油罐