Browse Source

物料资料BUG修复

chenw 7 years ago
parent
commit
4a9bb9b846

+ 35 - 35
applications/document/document-server/src/main/resources/mapper/ProductDetailMapper.xml

@@ -268,59 +268,59 @@
         <foreach collection="list" item="item" index="index" separator=";">
             update productdetail
             <set >
-                <if test="pd_prodid != null" >
-                    pd_prodid = #{pd_prodid,jdbcType=INTEGER},
+                <if test="item.pd_prodid != null" >
+                    pd_prodid = #{item.pd_prodid,jdbcType=INTEGER},
                 </if>
-                <if test="pd_prodcode != null" >
-                    pd_prodcode = #{pd_prodcode,jdbcType=VARCHAR},
+                <if test="item.pd_prodcode != null" >
+                    pd_prodcode = #{item.pd_prodcode,jdbcType=VARCHAR},
                 </if>
-                <if test="pd_detno != null" >
-                    pd_detno = #{pd_detno,jdbcType=INTEGER},
+                <if test="item.pd_detno != null" >
+                    pd_detno = #{item.pd_detno,jdbcType=INTEGER},
                 </if>
-                <if test="pd_whcode != null" >
-                    pd_whcode = #{pd_whcode,jdbcType=VARCHAR},
+                <if test="item.pd_whcode != null" >
+                    pd_whcode = #{item.pd_whcode,jdbcType=VARCHAR},
                 </if>
-                <if test="pd_whname != null" >
-                    pd_whname = #{pd_whname,jdbcType=VARCHAR},
+                <if test="item.pd_whname != null" >
+                    pd_whname = #{item.pd_whname,jdbcType=VARCHAR},
                 </if>
-                <if test="pd_whid != null" >
-                    pd_whid = #{pd_whid,jdbcType=INTEGER},
+                <if test="item.pd_whid != null" >
+                    pd_whid = #{item.pd_whid,jdbcType=INTEGER},
                 </if>
-                <if test="pd_price != null" >
-                    pd_price = #{pd_price,jdbcType=DOUBLE},
+                <if test="item.pd_price != null" >
+                    pd_price = #{item.pd_price,jdbcType=DOUBLE},
                 </if>
-                <if test="pd_amount != null" >
-                    pd_amount = #{pd_amount,jdbcType=DOUBLE},
+                <if test="item.pd_amount != null" >
+                    pd_amount = #{item.pd_amount,jdbcType=DOUBLE},
                 </if>
-                <if test="companyId != null" >
-                    companyId = #{companyId,jdbcType=INTEGER},
+                <if test="item.companyId != null" >
+                    companyId = #{item.companyId,jdbcType=INTEGER},
                 </if>
-                <if test="updaterId != null" >
-                    updaterId = #{updaterId,jdbcType=INTEGER},
+                <if test="item.updaterId != null" >
+                    updaterId = #{item.updaterId,jdbcType=INTEGER},
                 </if>
-                <if test="updateTime != null" >
-                    updateTime = #{updateTime,jdbcType=TIMESTAMP},
+                <if test="item.updateTime != null" >
+                    updateTime = #{item.updateTime,jdbcType=TIMESTAMP},
                 </if>
-                <if test="pd_text1 != null" >
-                    pd_text1 = #{pd_text1,jdbcType=VARCHAR},
+                <if test="item.pd_text1 != null" >
+                    pd_text1 = #{item.pd_text1,jdbcType=VARCHAR},
                 </if>
-                <if test="pd_text2 != null" >
-                    pd_text2 = #{pd_text2,jdbcType=VARCHAR},
+                <if test="item.pd_text2 != null" >
+                    pd_text2 = #{item.pd_text2,jdbcType=VARCHAR},
                 </if>
-                <if test="pd_text3 != null" >
-                    pd_text3 = #{pd_text3,jdbcType=VARCHAR},
+                <if test="item.pd_text3 != null" >
+                    pd_text3 = #{item.pd_text3,jdbcType=VARCHAR},
                 </if>
-                <if test="pd_text4 != null" >
-                    pd_text4 = #{pd_text4,jdbcType=VARCHAR},
+                <if test="item.pd_text4 != null" >
+                    pd_text4 = #{item.pd_text4,jdbcType=VARCHAR},
                 </if>
-                <if test="pd_text5 != null" >
-                    pd_text5 = #{pd_text5,jdbcType=VARCHAR},
+                <if test="item.pd_text5 != null" >
+                    pd_text5 = #{item.pd_text5,jdbcType=VARCHAR},
                 </if>
-                <if test="pd_num != null" >
-                    pd_num = #{pd_num,jdbcType=DOUBLE},
+                <if test="item.pd_num != null" >
+                    pd_num = #{item.pd_num,jdbcType=DOUBLE},
                 </if>
             </set>
-            where id = #{id}
+            where id = #{item.id}
         </foreach>
     </update>
     <select id="selectProdidByPrimaryKey" resultType="java.lang.Long">

+ 4 - 4
applications/document/document-server/src/main/resources/mapper/ProductMapper.xml

@@ -504,7 +504,7 @@
         SELECT COUNT(*) FROM BOMDETAIL WHERE BD_SONID=#{id} AND COMPANYID=#{companyId}
     </select>
     <select id="getCountFromProdIO" resultType="int">
-        SELECT COUNT(*) FROM PRODIODETAIL WHERE PD_PRODID=#{id} AND COMPANYID=#{companyId}
+        SELECT COUNT(*) FROM PRODIODETAIL WHERE PD_PRODID=#{id} AND COMPANYID=#{companyId} and pd_piclass!='库存初始化'
     </select>
 
     <insert id="saveProdInOut" parameterType="com.usoftchina.saas.document.entities.ProdInOut">
@@ -905,14 +905,14 @@
 
     <select id="selectOrderCountByProdCode" resultType="java.lang.Integer">
         SELECT COUNT(*) FROM PRODINOUT LEFT JOIN PRODIODETAIL ON PI_ID=PD_PIID AND PRODINOUT.COMPANYID=PRODIODETAIL.COMPANYID
-        WHERE PRODIODETAIL.COMPANYID = #{companyId} AND PD_PRODID = #{id}
+        WHERE PRODIODETAIL.COMPANYID = #{companyId} AND PD_PRODID = #{id} and pd_piclass != '库存初始化';
     </select>
 
     <delete id="deleteProdIOByCode" >
-        DELETE FROM PRODINOUT WHERE PI_TEXT1=#{code} AND COMPANYID = #{companyId}
+        DELETE FROM PRODINOUT WHERE PI_INOUTNO=#{code} AND COMPANYID = #{companyId}
     </delete>
     <delete id="deleteProdIODetailByCode">
-        DELETE FROM PRODIODETAIL WHERE PD_PIID IN (SELECT PI_ID FROM PRODINOUT WHERE PI_TEXT1=#{code} AND PRODINOUT.COMPANYID = #{companyId}) AND PRODIODETAIL.COMPANYID = #{companyId}
+        DELETE FROM PRODIODETAIL WHERE PD_PIID IN (SELECT PI_ID FROM PRODINOUT WHERE PI_INOUTNO=#{code} AND PRODINOUT.COMPANYID = #{companyId}) AND PRODIODETAIL.COMPANYID = #{companyId}
     </delete>
 </mapper>