|
|
@@ -3,8 +3,6 @@ package models
|
|
|
|
|
|
import (
|
|
|
"mtp2_if/db"
|
|
|
- "strconv"
|
|
|
- "strings"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
|
@@ -154,31 +152,3 @@ func AddSpotContractApply(spotContractApply Erms3SpotContractApply) error {
|
|
|
|
|
|
return err
|
|
|
}
|
|
|
-
|
|
|
-// GetSpotContractByParams 根据参数来获取合同.
|
|
|
-func GetSpotContractByParams(accountids string, contracttype int32, contractmode int32, status int32) ([]Erms3Spotcontract, error) {
|
|
|
- engine := db.GetEngine()
|
|
|
- strids := strings.Split(accountids, ",")
|
|
|
- ids := make([]int64, len(strids))
|
|
|
- for i := range strids {
|
|
|
- id, err := strconv.ParseInt(strids[i], 10, 64)
|
|
|
- if err != nil {
|
|
|
- return nil, err
|
|
|
- }
|
|
|
-
|
|
|
- ids[i] = id
|
|
|
- }
|
|
|
-
|
|
|
- scs := make([]Erms3Spotcontract, 0)
|
|
|
- err := engine.Where("CONTRACTMODE = ? and CONTRACTTYPE = ? and CLOSESTATUS = ?", contractmode, contracttype, status).In("ACCOUNTID", ids).Find(&scs)
|
|
|
-
|
|
|
- return scs, err
|
|
|
-}
|
|
|
-
|
|
|
-// GetSpotContractDetailByID 根据合同ID来获取明细.
|
|
|
-func GetSpotContractDetailByID(spotcontractids []string) ([]Erms3Spotcontractdetail, error) {
|
|
|
- engine := db.GetEngine()
|
|
|
- details := make([]Erms3Spotcontractdetail, 0)
|
|
|
- err := engine.In("SPOTCONTRACTID", spotcontractids).Find(&details)
|
|
|
- return details, err
|
|
|
-}
|