Ver código fonte

集采订单同步销售订单

ms-blue 1 mês atrás
pai
commit
32f1e223d9

+ 1 - 1
src/main/java/com/jsh/erp/service/SyncTescoSystemService.java

@@ -190,7 +190,7 @@ public class SyncTescoSystemService {
 
     private DepotHeadXsddRequestVO initSalesOrder(ErpXsddReqVO erpXsddReqVO) throws Exception {
         DepotHeadXsddRequestVO order = new DepotHeadXsddRequestVO();
-        order.setType("其");
+        order.setType("其");
         order.setSubType("销售订单");
         order.setLinkTesco(erpXsddReqVO.getOrderSn());
 

+ 15 - 2
src/main/java/com/jsh/erp/service/impl/DepotItemServiceImpl.java

@@ -269,6 +269,19 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
         return result;
     }
 
+    public int insertDepotItem(DepotItem depotItem)throws Exception {
+        int result =0;
+        try{
+            depotItemMapper.insertSelective(depotItem);
+        }catch(Exception e){
+            JshException.readFail(logger, e);
+        }
+        return result;
+    }
+
+
+
+
     @Override
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     public int updateDepotItemWithObj(DepotItem depotItem)throws Exception {
@@ -801,8 +814,8 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
             for (DepotItemXsddRequestVO item : itemList) {
                 DepotItem depotItem = new DepotItem();
                 BeanUtils.copyProperties(item, depotItem);
-
-                this.insertDepotItemWithObj(depotItem);
+                depotItem.setHeaderId(depotHead.getId());
+                this.insertDepotItem(depotItem);
                 // 更新当前库存
                 updateCurrentStock(depotItem);
             }

+ 36 - 0
src/main/resources/mapper_xml/DepotHeadMapper.xml

@@ -265,6 +265,18 @@
       <if test="goodsTypeCount != null">
         goods_type_count,
       </if>
+      <if test="linkTesco != null">
+        link_tesco,
+      </if>
+      <if test="receiverName != null">
+        receiver_name,
+      </if>
+      <if test="receiverPhone != null">
+        receiver_phone,
+      </if>
+      <if test="receiverAddress != null">
+        receiver_address,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -372,6 +384,18 @@
       <if test="goodsTypeCount != null">
         #{goodsTypeCount,jdbcType=INTEGER},
       </if>
+      <if test="linkTesco != null">
+        #{linkTesco,jdbcType=VARCHAR},
+      </if>
+      <if test="receiverName != null">
+        #{receiverName,jdbcType=VARCHAR}
+      </if>
+      <if test="receiverPhone != null">
+        #{receiverPhone,jdbcType=VARCHAR}
+      </if>
+      <if test="receiverAddress != null">
+        #{receiverAddress,jdbcType=VARCHAR}
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultType="java.lang.Long">
@@ -627,6 +651,18 @@
       <if test="goodsTypeCount != null">
         goods_type_count = #{goodsTypeCount,jdbcType=INTEGER},
       </if>
+      <if test="linkTesco != null">
+        link_tesco =#{linkTesco,jdbcType=VARCHAR},
+      </if>
+      <if test="receiverName != null">
+        receiver_name = #{receiverName,jdbcType=VARCHAR}
+      </if>
+      <if test="receiverPhone != null">
+        receiver_phone = #{receiverPhone,jdbcType=VARCHAR}
+      </if>
+      <if test="receiverAddress != null">
+        receiver_address = #{receiverAddress,jdbcType=VARCHAR}
+      </if>
     </set>
     where id = #{id,jdbcType=BIGINT}
   </update>

+ 2 - 2
src/main/resources/mapper_xml/DepotItemMapper.xml

@@ -150,7 +150,7 @@
       #{deleteFlag,jdbcType=VARCHAR})
   </insert>
 
-  <insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.DepotItem">
+  <insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.DepotItem" useGeneratedKeys="true" keyProperty="id">
     insert into jsh_depot_item
     <trim prefix="(" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -337,7 +337,7 @@
       </if>
     </trim>
   </insert>
-  <select id="countByExample" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultType="java.lang.Long">
+    <select id="countByExample" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultType="java.lang.Long">
     select count(*) from jsh_depot_item
     <if test="_parameter != null">
       <include refid="Example_Where_Clause" />