소스 검색

销售订单导入漏提交文件

chenw 6 년 전
부모
커밋
116a39150c

+ 110 - 0
applications/sale/sale-server/src/main/resources/mapper/DataImportMapper.xml

@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.sale.mapper.DataImportMapper" >
+  <resultMap id="DetailMap" type="com.usoftchina.saas.commons.po.DataImportDetail" >
+    <id column="dd_id" property="dd_id" jdbcType="INTEGER" />
+    <result column="dd_maindata" property="dd_maindata" jdbcType="VARCHAR" />
+    <result column="dd_detno" property="dd_detno" jdbcType="INTEGER" />
+    <result column="dd_diid" property="dd_diid" jdbcType="INTEGER" />
+    <result column="dd_checked" property="dd_checked" jdbcType="INTEGER" />
+    <result column="dd_success" property="dd_success" jdbcType="INTEGER" />
+    <result column="dd_toformal" property="dd_toformal" jdbcType="INTEGER" />
+    <result column="companyid" property="companyid" jdbcType="INTEGER" />
+    <result column="dd_detaildata" property="dd_detaildata" jdbcType="VARCHAR" />
+    <result column="dd_codevalue" property="dd_codevalue" jdbcType="VARCHAR" />
+  </resultMap>
+
+  <delete id="deleteByCaller">
+  delete from data_import where di_caller=#{caller} and companyid=#{companyid} and
+  il_toformal=0 and il_result is not null
+</delete>
+
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.commons.po.DataImport" >
+    <selectKey  resultType="java.lang.Integer" keyProperty="di_id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
+    insert into data_import
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="di_caller != null" >
+        di_caller,
+      </if>
+      <if test="companyid != null" >
+        companyid,
+      </if>
+      <if test="di_date != null" >
+        di_date,
+      </if>
+      <if test="di_count != null" >
+        di_count,
+      </if>
+      <if test="di_result != null" >
+        di_result,
+      </if>
+      <if test="di_success != null" >
+        di_success,
+      </if>
+      <if test="di_man != null" >
+        di_man,
+      </if>
+      <if test="di_toformal != null" >
+        di_toformal,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="di_caller != null" >
+        #{di_caller,jdbcType=VARCHAR},
+      </if>
+      <if test="companyid != null" >
+        #{companyid,jdbcType=INTEGER},
+      </if>
+      <if test="di_date != null" >
+        #{di_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="di_count != null" >
+        #{di_count,jdbcType=INTEGER},
+      </if>
+      <if test="di_result != null" >
+        #{di_result,jdbcType=VARCHAR},
+      </if>
+      <if test="di_success != null" >
+        #{di_success,jdbcType=INTEGER},
+      </if>
+      <if test="di_man != null" >
+        #{di_man,jdbcType=VARCHAR},
+      </if>
+      <if test="di_toformal != null" >
+        #{di_toformal,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+
+  <update id="updateErr" >
+  update data_import
+  set
+  di_result = #{err},
+  di_success = 0,
+  where di_id = #{id}
+</update>
+
+<select id="selectDataById" resultMap="DetailMap">
+  select * from  data_importdetail
+  where dd_diid = #{id}
+</select>
+
+  <select id="selectMainBycode" resultMap="DetailMap">
+    select * from  data_importdetail
+    where dd_codevalue = #{code} and dd_diid=#{id} and ifnull(dd_success,0)=0 and ifnull(dd_maindata,'')!='' and companyid=#{companyid}
+  </select>
+
+  <select id="selectMainOnly" resultMap="DetailMap">
+    select * from  data_importdetail
+    where dd_diid=#{id} and ifnull(dd_success,0)=0 and ifnull(dd_maindata,'')!='' and companyid=#{companyid}
+  </select>
+
+  <update id="updateDataImport" parameterType="integer">
+    update data_import set di_toformal=1,di_success=1  where di_id=#{id}
+  </update>
+  <update id="updateDataImportError">
+    update data_import set di_toformal=1,di_result=#{err} where di_id=#{id}
+  </update>
+</mapper>

+ 64 - 0
applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml

@@ -747,4 +747,68 @@
     update saledown set sa_salecode=null ,sa_turnstatus=null,sa_turnstatuscode=null,sa_turndate=null
     where sa_saleid= #{id}
   </update>
+
+  <resultMap id="CustomerDTOMap" type="com.usoftchina.saas.document.dto.CustomerDTO">
+    <id column="cu_id" jdbcType="INTEGER" property="id" />
+    <result column="cu_code" jdbcType="VARCHAR" property="cu_code" />
+    <result column="cu_shortname" jdbcType="VARCHAR" property="cu_shortname" />
+    <result column="cu_name" jdbcType="VARCHAR" property="cu_name" />
+    <result column="cu_uu" jdbcType="VARCHAR" property="cu_uu" />
+    <result column="cu_type" jdbcType="VARCHAR" property="cu_type" />
+    <result column="cu_begindate" jdbcType="TIMESTAMP" property="cu_begindate" />
+    <result column="cu_beginaramount" jdbcType="DOUBLE" property="cu_beginaramount" />
+    <result column="cu_beginprerecamount" jdbcType="DOUBLE" property="cu_beginprerecamount" />
+    <result column="cu_promisedays" jdbcType="DOUBLE" property="cu_promisedays" />
+    <result column="cu_taxrate" jdbcType="DOUBLE" property="cu_taxrate" />
+    <result column="cu_sellerid" jdbcType="INTEGER" property="cu_sellerid" />
+    <result column="cu_sellercode" jdbcType="VARCHAR" property="cu_sellercode" />
+    <result column="cu_sellername" jdbcType="VARCHAR" property="cu_sellername" />
+    <result column="cu_credit" jdbcType="DOUBLE" property="cu_credit" />
+    <result column="cu_status" jdbcType="VARCHAR" property="cu_status" />
+    <result column="cu_statuscode" jdbcType="VARCHAR" property="cu_statuscode" />
+    <result column="updatetime" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="cu_text1" jdbcType="VARCHAR" property="cu_text1" />
+    <result column="cu_text2" jdbcType="VARCHAR" property="cu_text2" />
+    <result column="cu_text3" jdbcType="VARCHAR" property="cu_text3" />
+    <result column="cu_text4" jdbcType="VARCHAR" property="cu_text4" />
+    <result column="cu_text5" jdbcType="VARCHAR" property="cu_text5" />
+    <result column="cu_leftamount" jdbcType="DOUBLE" property="cu_leftamount" />
+    <result column="cu_recamount" jdbcType="DOUBLE" property="cu_recamount" />
+    <result column="cu_preamount" jdbcType="DOUBLE" property="cu_preamount" />
+    <result column="cu_remark" jdbcType="VARCHAR" property="cu_remark" />
+    <result column="cu_currency" jdbcType="VARCHAR" property="cu_currency" />
+    <result column="cr_rate" jdbcType="DOUBLE" property="cr_rate" />
+  </resultMap>
+
+  <select id="selectCustByCustCode" resultMap="CustomerDTOMap">
+    select * from customer where cu_code = #{code} and companyId = #{companyId} and cu_status != '已禁用'
+  </select>
+
+  <resultMap id="ProductDTOResultMapper" type="com.usoftchina.saas.document.dto.ProductDTO">
+    <id column="pr_id" property="id" jdbcType="INTEGER"/>
+    <result column="pr_code" property="pr_code" jdbcType="VARCHAR"/>
+    <result column="pr_detail" property="pr_detail" jdbcType="VARCHAR"/>
+    <result column="pr_spec" property="pr_spec" jdbcType="VARCHAR"/>
+    <result column="pr_unit" property="pr_unit" jdbcType="VARCHAR"/>
+    <result column="pr_whid" property="pr_whid" jdbcType="INTEGER"/>
+    <result column="pr_whcode" property="pr_whcode" jdbcType="VARCHAR"/>
+    <result column="pr_whname" property="pr_whname" jdbcType="VARCHAR"/>
+    <!--productonhand-->
+    <result column="po_onhand" property="po_onhand" jdbcType="DOUBLE"/>
+    <result column="po_avprice" property="po_avprice" jdbcType="DOUBLE"/>
+    <!--productonhand-->
+    <result column="pr_kind" property="pr_kind" jdbcType="VARCHAR"/>
+    <result column="pr_orispeccode" property="pr_orispeccode" jdbcType="VARCHAR"/>
+    <result column="pr_brand" property="pr_brand" jdbcType="VARCHAR"/>
+    <result column="pr_vendname" property="pr_vendname" jdbcType="VARCHAR"/>
+    <result column="pr_zxbzs" property="pr_zxbzs" jdbcType="VARCHAR"/>
+    <result column="pr_leadtime" property="pr_leadtime" jdbcType="INTEGER"/>
+    <result column="pr_status" property="pr_status" jdbcType="VARCHAR"/>
+    <result column="pr_statuscode" property="pr_statuscode" jdbcType="VARCHAR"/>
+    <result column="pr_remark" property="pr_remark" jdbcType="VARCHAR"/>
+  </resultMap>
+
+  <select id="selectProductByCode" resultMap="ProductDTOResultMapper">
+    select * from product where pr_code = #{code} and companyId = #{companyId}
+  </select>
 </mapper>