|
|
@@ -26,7 +26,7 @@ type AuditContractModel struct {
|
|
|
}
|
|
|
|
|
|
// 组装查询普通待审核合同Sql
|
|
|
-func (r *AuditContractModel) buildSql(accountId uint64, contractType int32) string {
|
|
|
+func (r *AuditContractModel) buildSql(accountIDs string, contractType int32) string {
|
|
|
str := "select to_char(s.spotcontractid) spotcontractid," +
|
|
|
" u.customername," +
|
|
|
" s.accountid," +
|
|
|
@@ -42,16 +42,16 @@ func (r *AuditContractModel) buildSql(accountId uint64, contractType int32) stri
|
|
|
" on u2.userid = s.customeruserid" +
|
|
|
" where s.contracttype = %v" +
|
|
|
" and s.applystatus in(0,2)" +
|
|
|
- " and s.accountid = %v"
|
|
|
+ " and s.accountid in(%v)"
|
|
|
|
|
|
- return fmt.Sprintf(str, contractType, accountId)
|
|
|
+ return fmt.Sprintf(str, contractType, accountIDs)
|
|
|
}
|
|
|
|
|
|
// 获取待审核的合同
|
|
|
-func (r *AuditContractModel) GetData(accountId uint64, contractType int32) ([]AuditContractModel, error) {
|
|
|
+func (r *AuditContractModel) GetData(accountIDs string, contractType int32) ([]AuditContractModel, error) {
|
|
|
sAC := make([]AuditContractModel, 0)
|
|
|
e := db.GetEngine()
|
|
|
- s := e.SQL(r.buildSql(accountId, contractType))
|
|
|
+ s := e.SQL(r.buildSql(accountIDs, contractType))
|
|
|
if err := s.Find(&sAC); err != nil {
|
|
|
logger.GetLogger().Errorf("query pending contract fail:%v", err)
|
|
|
return sAC, err
|
|
|
@@ -74,7 +74,7 @@ type AutditContractHGModel struct {
|
|
|
SignDate string `json:"signdate" xorm:"'SIGNDATE'"` // 签订日期
|
|
|
}
|
|
|
|
|
|
-func (r *AutditContractHGModel) buildSql(accountId uint64) string {
|
|
|
+func (r *AutditContractHGModel) buildSql(accountIDs string) string {
|
|
|
sqlId := "select to_char(t.wrrcontractid) spotcontractid," +
|
|
|
" t.accountid," +
|
|
|
" t.contractqty," +
|
|
|
@@ -96,16 +96,16 @@ func (r *AutditContractHGModel) buildSql(accountId uint64) string {
|
|
|
" left join enumdicitem ec" +
|
|
|
" on w.unitid = ec.enumitemname" +
|
|
|
" and ec.enumdiccode = 'goodsunit'" +
|
|
|
- " where t.accountid = %v" +
|
|
|
+ " where t.accountid in(%v)" +
|
|
|
" and t.applystatus in (0, 2)"
|
|
|
|
|
|
- return fmt.Sprintf(sqlId, accountId)
|
|
|
+ return fmt.Sprintf(sqlId, accountIDs)
|
|
|
}
|
|
|
|
|
|
-func (r *AutditContractHGModel) GetData(accountId uint64) ([]AutditContractHGModel, error) {
|
|
|
+func (r *AutditContractHGModel) GetData(accountIDs string) ([]AutditContractHGModel, error) {
|
|
|
sAC := make([]AutditContractHGModel, 0)
|
|
|
e := db.GetEngine()
|
|
|
- s := e.SQL(r.buildSql(accountId))
|
|
|
+ s := e.SQL(r.buildSql(accountIDs))
|
|
|
if err := s.Find(&sAC); err != nil{
|
|
|
logger.GetLogger().Errorf("query hg pending contract fail:%v", err)
|
|
|
return sAC, err
|