|
|
@@ -9,52 +9,65 @@ import org.springframework.data.repository.query.Param;
|
|
|
import org.springframework.stereotype.Repository;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.sql.SQLException;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Set;
|
|
|
|
|
|
/**
|
|
|
- * Created by dongbw on 17/03/07 14:10.
|
|
|
+ * 招标单信息
|
|
|
+ * @author dongbw
|
|
|
+ * @date 17/03/07 14:10
|
|
|
*/
|
|
|
@Repository
|
|
|
public interface PurchaseTenderDao extends JpaSpecificationExecutor<PurchaseTender>, JpaRepository<PurchaseTender, Long> {
|
|
|
|
|
|
+ /**
|
|
|
+ * 通过企业UU和编号查询招标单信息
|
|
|
+ * @param uu 企业UU
|
|
|
+ * @param code 编号
|
|
|
+ * @return List<PurchaseTender>
|
|
|
+ */
|
|
|
List<PurchaseTender> findByEnUUAndCode(Long uu, String code);
|
|
|
|
|
|
/**
|
|
|
* 获得待评标的数量
|
|
|
*
|
|
|
* @param ids 单据id
|
|
|
- * @return
|
|
|
+ * @return 数量
|
|
|
*/
|
|
|
@Query("select count(p) from PurchaseTender p where p.id in :ids and p.overdue = 1 and p.status = '待评标' and p.result <> 1")
|
|
|
- public Integer getEvaluationCount(@Param("ids") List<Long> ids);
|
|
|
+ Integer getEvaluationCount(@Param("ids") List<Long> ids);
|
|
|
|
|
|
/**
|
|
|
* 获得待投标的数量
|
|
|
*
|
|
|
* @param ids 单据id
|
|
|
- * @return
|
|
|
+ * @param vendUU 供应商UU
|
|
|
+ * @return 数量
|
|
|
*/
|
|
|
@Query("select count(p) from SaleTender p where p.ptId in :ids and p.overdue <> 1 and p.status = '待投标' and p.vendUU = :vendUU and p.isPublish = 1")
|
|
|
- public Integer getTenterCount(@Param("ids") List<Long> ids, @Param("vendUU") Long vendUU);
|
|
|
+ Integer getTenterCount(@Param("ids") List<Long> ids, @Param("vendUU") Long vendUU);
|
|
|
|
|
|
/**
|
|
|
- * 全包定标时,修改招标单
|
|
|
- * @param tenderIds
|
|
|
- * @param modified
|
|
|
+ * 全部定标时,修改招标单
|
|
|
+ *
|
|
|
+ * @param tenderIds 招标单id
|
|
|
+ * @param modified 单据最后时间
|
|
|
*/
|
|
|
- @Modifying@Transactional
|
|
|
+ @Modifying
|
|
|
+ @Transactional(rollbackFor = SQLException.class)
|
|
|
@Query("update PurchaseTender p set p.modified = :modified,p.auditStatus = 0 where p.id in :tenderIds")
|
|
|
void updateTenderDecide(@Param("tenderIds") Set<Long> tenderIds, @Param("modified") Date modified);
|
|
|
|
|
|
/**
|
|
|
* 全包定标时,修改投标明细
|
|
|
- * @param applyStatus
|
|
|
- * @param reason
|
|
|
- * @param saleTenderId
|
|
|
+ * @param applyStatus 中标状态
|
|
|
+ * @param reason 说明
|
|
|
+ * @param saleTenderId 投标主表
|
|
|
*/
|
|
|
- @Modifying@Transactional
|
|
|
+ @Modifying
|
|
|
+ @Transactional(rollbackFor = SQLException.class)
|
|
|
@Query("update SaleTenderItem s set s.applyStatus = :applyStatus,s.description = :reason where s.saleTender.id = :saleTenderId")
|
|
|
void updateSaleTenderItemDecide(@Param("applyStatus") Short applyStatus, @Param("reason") String reason, @Param("saleTenderId") Long saleTenderId);
|
|
|
}
|