|
|
@@ -1,7 +1,6 @@
|
|
|
package com.uas.platform.b2b.dao;
|
|
|
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
+import com.uas.platform.b2b.model.SaleSendItem;
|
|
|
import org.springframework.data.jpa.repository.JpaRepository;
|
|
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
|
import org.springframework.data.jpa.repository.Modifying;
|
|
|
@@ -10,10 +9,10 @@ import org.springframework.data.repository.query.Param;
|
|
|
import org.springframework.stereotype.Repository;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import com.uas.platform.b2b.model.SaleSendItem;
|
|
|
+import java.sql.SQLException;
|
|
|
+import java.util.List;
|
|
|
|
|
|
@Repository
|
|
|
-@Transactional
|
|
|
public interface SaleSendItemDao extends JpaSpecificationExecutor<SaleSendItem>, JpaRepository<SaleSendItem, Long> {
|
|
|
|
|
|
/**
|
|
|
@@ -40,6 +39,7 @@ public interface SaleSendItemDao extends JpaSpecificationExecutor<SaleSendItem>,
|
|
|
*/
|
|
|
@Modifying(clearAutomatically = true)
|
|
|
@Query("update SaleSendItem s set s.qty = :qty,s.replyRemark = :remark where s.id= :id")
|
|
|
+ @Transactional(rollbackFor = SQLException.class)
|
|
|
public void updateByReply(@Param("id") long id, @Param("qty") double qty, @Param("remark") String remark);
|
|
|
|
|
|
/**
|
|
|
@@ -50,6 +50,7 @@ public interface SaleSendItemDao extends JpaSpecificationExecutor<SaleSendItem>,
|
|
|
@Modifying(clearAutomatically = true)
|
|
|
@Query(nativeQuery = true,
|
|
|
value = "update sale$senditem si set si_verifyqty = (select sum(siv_qty) from SALE$SENDITEMVERIFY siv where siv.SIV_SENDITEMID = si.SI_ID ), si_okqty = (select sum(siv_okqty) from SALE$SENDITEMVERIFY siv where siv.SIV_SENDITEMID = si.SI_ID ), si_notokqty = (select sum(siv_notokqty) from SALE$SENDITEMVERIFY siv where siv.SIV_SENDITEMID = si.SI_ID ) where si.si_id= :id")
|
|
|
+ @Transactional(rollbackFor = SQLException.class)
|
|
|
public void updateByVerify(@Param("id") long id);
|
|
|
|
|
|
/**
|
|
|
@@ -76,8 +77,16 @@ public interface SaleSendItemDao extends JpaSpecificationExecutor<SaleSendItem>,
|
|
|
*/
|
|
|
@Modifying
|
|
|
@Query("update SaleSendItem s set s.packageQty = :packageQty,s.outBoxQty = :outBoxQty where s.id= :id")
|
|
|
- public void updatePackageQty(@Param("id") long id, @Param("packageQty") Double packageQty, @Param("outBoxQty") Double outBoxQty);
|
|
|
-
|
|
|
-
|
|
|
+ @Transactional(rollbackFor = SQLException.class)
|
|
|
+ void updatePackageQty(@Param("id") long id, @Param("packageQty") Double packageQty, @Param("outBoxQty") Double outBoxQty);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据发货提醒id获取已发货数量
|
|
|
+ *
|
|
|
+ * @param noticeId 发货提醒id
|
|
|
+ * @return 该发货提醒已发货的数量
|
|
|
+ */
|
|
|
+ @Query("select sum(s.qty) from SaleSendItem s where s.noticeId= :noticeId")
|
|
|
+ Double getSendQtyByNoticeId(@Param("noticeId") Long noticeId);
|
|
|
|
|
|
}
|