fanxw hai 1 mes
pai
achega
ded003d854

+ 25 - 0
src/main/java/com/chinaitop/depot/business/controller/BusinessDeliveryStorageNoticeController.java

@@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.RestController;
26 26
 import javax.annotation.Resource;
27 27
 import javax.servlet.http.HttpServletRequest;
28 28
 import java.io.IOException;
29
+import java.math.BigDecimal;
29 30
 import java.util.ArrayList;
30 31
 import java.util.HashMap;
31 32
 import java.util.List;
@@ -822,4 +823,28 @@ public class BusinessDeliveryStorageNoticeController {
822 823
         }
823 824
         return modelMap;
824 825
     }
826
+
827
+    @RequestMapping(value="/updateYjssl",produces = MediaType.APPLICATION_JSON_VALUE,  method=RequestMethod.GET)
828
+	@ApiOperation(value="修改通知单已结算数量", notes = "根据id查找")
829
+	@ApiImplicitParams({
830
+		@ApiImplicitParam(name = "tzdid", value = "通知单ID", dataType="int", paramType = "form"),
831
+		@ApiImplicitParam(name = "bcjssl", value = "本次结算数量(吨)", dataType="String", paramType = "form")
832
+	})
833
+    public void updateYjssl(Integer tzdid, String bcjssl) {
834
+        if (tzdid != null) {
835
+        	// 获取当前通知单主数据
836
+        	BusinessDeliveryStorageNotice deliveryStorageNotice = deliveryStorageNoticeService.findById(tzdid);
837
+        	if (null != deliveryStorageNotice) {
838
+        		if (StringUtils.isNotBlank(deliveryStorageNotice.getYjssl())) {
839
+        			BigDecimal y_yjssl = new BigDecimal(deliveryStorageNotice.getYjssl());
840
+        			BigDecimal new_yjssl = y_yjssl.add(new BigDecimal(bcjssl));
841
+        			deliveryStorageNotice.setYjssl(new_yjssl.toString());
842
+        		} else {
843
+        			deliveryStorageNotice.setYjssl(bcjssl);
844
+        		}
845
+        		deliveryStorageNoticeService.update(deliveryStorageNotice, null);
846
+        	}
847
+            
848
+        }
849
+    }
825 850
 }

+ 21 - 6
src/main/java/com/chinaitop/depot/business/mapper/BusinessDeliveryStorageNoticeMapper.xml

@@ -57,6 +57,7 @@
57 57
     <result column="change_content" property="changeContent" jdbcType="VARCHAR" />
58 58
     <result column="lqss" property="lqss" jdbcType="VARCHAR" />
59 59
     <result column="is_merge" property="isMerge" jdbcType="VARCHAR" />
60
+    <result column="yjssl" property="yjssl" jdbcType="VARCHAR" />
60 61
     
61 62
   </resultMap>
62 63
   <sql id="Example_Where_Clause" >
@@ -126,7 +127,7 @@
126 127
     warehouse_id, warehouse_name, creater, create_time, create_unit, create_depot, update_time, 
127 128
     org_id, in_application, creater_id, root_contract_bid, identification, carNumber, 
128 129
     changing, change_record_flag, root_notice_bid, original_notice, original_notice_bid, 
129
-    change_reason, change_time, change_content, lqss, is_merge
130
+    change_reason, change_time, change_content, lqss, is_merge, yjssl
130 131
   </sql>
131 132
   <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.business.model.BusinessDeliveryStorageNoticeExample" >
132 133
     select
@@ -176,7 +177,7 @@
176 177
       root_contract_bid, identification, carNumber, 
177 178
        changing, change_record_flag, 
178 179
       root_notice_bid, original_notice, original_notice_bid, 
179
-      change_reason, change_time, change_content, lqss
180
+      change_reason, change_time, change_content, lqss, yjssl
180 181
       )
181 182
     values (#{id,jdbcType=INTEGER}, #{billType,jdbcType=VARCHAR}, #{billTypeId,jdbcType=INTEGER}, 
182 183
       #{billNumber,jdbcType=VARCHAR}, #{shipingCount,jdbcType=VARCHAR}, #{finishedCount,jdbcType=VARCHAR}, 
@@ -195,7 +196,8 @@
195 196
       #{rootContractBid,jdbcType=INTEGER}, #{identification,jdbcType=VARCHAR}, #{carnumber,jdbcType=VARCHAR}, 
196 197
        #{changing,jdbcType=VARCHAR}, #{changeRecordFlag,jdbcType=VARCHAR}, 
197 198
       #{rootNoticeBid,jdbcType=INTEGER}, #{originalNotice,jdbcType=VARCHAR}, #{originalNoticeBid,jdbcType=INTEGER}, 
198
-      #{changeReason,jdbcType=VARCHAR}, #{changeTime,jdbcType=TIMESTAMP}, #{changeContent,jdbcType=VARCHAR}, #{lqss,jdbcType=VARCHAR}
199
+      #{changeReason,jdbcType=VARCHAR}, #{changeTime,jdbcType=TIMESTAMP}, #{changeContent,jdbcType=VARCHAR}, #{lqss,jdbcType=VARCHAR},
200
+      #{yjssl,jdbcType=VARCHAR}
199 201
       )
200 202
   </insert>
201 203
   <insert id="insertSelective" parameterType="com.chinaitop.depot.business.model.BusinessDeliveryStorageNotice" >
@@ -366,6 +368,9 @@
366 368
       <if test="isMerge != null">
367 369
         is_merge,
368 370
       </if>
371
+      <if test="yjssl != null">
372
+        yjssl,
373
+      </if>
369 374
     </trim>
370 375
     <trim prefix="values (" suffix=")" suffixOverrides="," >
371 376
       <if test="id != null" >
@@ -533,6 +538,9 @@
533 538
       <if test="isMerge != null">
534 539
         #{isMerge,jdbcType=VARCHAR},
535 540
       </if>
541
+      <if test="yjssl != null">
542
+        #{yjssl,jdbcType=VARCHAR},
543
+      </if>
536 544
     </trim>
537 545
   </insert>
538 546
   <select id="countByExample" parameterType="com.chinaitop.depot.business.model.BusinessDeliveryStorageNoticeExample" resultType="java.lang.Integer" >
@@ -709,6 +717,9 @@
709 717
       <if test="record.isMerge != null">
710 718
         is_merge = #{record.isMerge,jdbcType=VARCHAR},
711 719
       </if>
720
+      <if test="record.yjssl != null">
721
+        yjssl = #{record.yjssl,jdbcType=VARCHAR},
722
+      </if>
712 723
     </set>
713 724
     <if test="_parameter != null" >
714 725
       <include refid="Update_By_Example_Where_Clause" />
@@ -770,7 +781,8 @@
770 781
       change_time = #{record.changeTime,jdbcType=TIMESTAMP},
771 782
       change_content = #{record.changeContent,jdbcType=VARCHAR},
772 783
       lqss = #{record.lqss,jdbcType=VARCHAR},
773
-      is_merge = #{record.isMerge,jdbcType=VARCHAR}
784
+      is_merge = #{record.isMerge,jdbcType=VARCHAR},
785
+      yjssl = #{record.yjssl,jdbcType=VARCHAR}
774 786
      
775 787
     <if test="_parameter != null" >
776 788
       <include refid="Update_By_Example_Where_Clause" />
@@ -941,6 +953,9 @@
941 953
       <if test="isMerge != null">
942 954
         is_merge = #{isMerge,jdbcType=VARCHAR},
943 955
       </if>
956
+      <if test="yjssl != null">
957
+        yjssl = #{yjssl,jdbcType=VARCHAR},
958
+      </if>
944 959
     </set>
945 960
     where id = #{id,jdbcType=INTEGER}
946 961
   </update>
@@ -999,8 +1014,8 @@
999 1014
       change_time = #{changeTime,jdbcType=TIMESTAMP},
1000 1015
       change_content = #{changeContent,jdbcType=VARCHAR},
1001 1016
       lqss = #{lqss,jdbcType=VARCHAR},
1002
-      is_merge = #{isMerge,jdbcType=VARCHAR}
1003
-      
1017
+      is_merge = #{isMerge,jdbcType=VARCHAR},
1018
+      yjssl = #{yjssl,jdbcType=VARCHAR}
1004 1019
     where id = #{id,jdbcType=INTEGER}
1005 1020
   </update>
1006 1021
   

+ 19 - 0
src/main/java/com/chinaitop/depot/business/model/BusinessDeliveryStorageNotice.java

@@ -20,6 +20,9 @@ public class BusinessDeliveryStorageNotice {
20 20
     
21 21
     //业务字段(是否合并过)
22 22
     private String isMerge;
23
+
24
+    //本次结算数量
25
+    private String yjssl;
23 26
     
24 27
     /**
25 28
      * 是否有过合并(0:有过,1:没有)
@@ -1764,4 +1767,20 @@ public class BusinessDeliveryStorageNotice {
1764 1767
         this.lqss = lqss == null ? null : lqss.trim();
1765 1768
     }
1766 1769
 
1770
+    /**
1771
+     * 已结算数量
1772
+     * @return
1773
+     */
1774
+	public String getYjssl() {
1775
+		return yjssl;
1776
+	}
1777
+
1778
+	/**
1779
+	 * 已结算数量
1780
+	 * @param yjssl
1781
+	 */
1782
+	public void setYjssl(String yjssl) {
1783
+		this.yjssl = yjssl == null ? null : yjssl.trim();
1784
+	}
1785
+
1767 1786
 }