Browse Source

【界面标准化】【销售订单】【新增sa_delivery交货日期字段】【后端处理】

rainco 7 years ago
parent
commit
a869b9b25e

+ 3 - 0
applications/purchase/purchase-server/src/main/resources/mapper/PurchaseMapper.xml

@@ -372,6 +372,9 @@
       <if test="pu_currency != null" >
         pu_currency = #{pu_currency,jdbcType=VARCHAR},
       </if>
+      <if test="sa_delivery!=null">
+        sa_delivery = #{sa_delivery,jdbcType=TIMESTAMP},
+      </if>
     </set>
     where pu_id = #{id,jdbcType=INTEGER}
   </update>

+ 2 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/SaleDTO.java

@@ -65,4 +65,6 @@ public class SaleDTO extends CommonBaseDTO{
     private String sa_currency;
 
     private Double sa_nettotal;
+
+    private Date sa_delivery;
 }

+ 2 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/SaleMapper.java

@@ -68,4 +68,6 @@ public interface SaleMapper extends CommonBaseMapper<Sale> {
 
     void updateAudit(@Param("id") Long id, @Param("status") String status, @Param("statuscode") String statuscode, @Param("format") String format,
                      @Param("name") String name);
+
+    void updateDelivery(@Param("id")Long id);
 }

+ 2 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/Sale.java

@@ -64,4 +64,6 @@ public class Sale extends CommonBaseEntity{
     private String sa_currency;
 
     private Double sa_nettotal;
+
+    private Date sa_delivery;
 }

+ 2 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java

@@ -188,6 +188,8 @@ public class SaleServiceImpl implements SaleService{
             saledetailMapper.batchUpdate(updateDetails);
         }
         baseDTO = getBaseDTOById(sa_id);
+        //明细需求日期为空时==主表交货日期
+        saleMapper.updateDelivery(sa_id);
         //更新销售金额
         updateTotal(sa_id);
         //更新从表总额

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

@@ -159,6 +159,9 @@
       <if test="sa_nettotal != null">
         sa_nettotal,
       </if>
+      <if test="sa_delivery != null">
+        sa_delivery,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="sa_code != null" >
@@ -245,6 +248,9 @@
       <if test="sa_nettotal != null" >
         #{sa_nettotal,jdbcType=DOUBLE},
       </if>
+      <if test="sa_delivery != null" >
+        #{sa_delivery,jdbcType=TIMESTAMP},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.sale.po.Sale" >
@@ -706,4 +712,8 @@
     </if>
 
   </select>
+
+  <update id="updateDelivery" parameterType="long">
+    update saledetail set sd_delivery = (select sa_delivery from sale where sa_id=#{id}) where sdsaid=#{id} and sa_delivery is null
+  </update>
 </mapper>