|
|
@@ -661,26 +661,36 @@ type Ermcp3Contract struct {
|
|
|
MERUSERNAME string `json:"merusername"` // 跟单员名称
|
|
|
|
|
|
// 筛选条件
|
|
|
- QryType int32 `json:"-"` // 查询类型 1-未提交 2-待审核 3-履约中 4-已完成
|
|
|
- UserType int32 `json:"-"` // 用户类型 2-管理员 7-企业成员
|
|
|
- OwnUserId int64 `json:"-"` // 登录用户id
|
|
|
+ QryType string `json:"-"` // 查询类型(逗号隔开,如1,2,3) 1-未提交 2-待审核 3-履约中 4-已完成
|
|
|
+ UserType int32 `json:"-"` // 用户类型 2-管理员 7-企业成员
|
|
|
+ OwnUserId int64 `json:"-"` // 登录用户id
|
|
|
}
|
|
|
|
|
|
func (r *Ermcp3Contract) getQryTypeStatus() string {
|
|
|
- var status string
|
|
|
- switch r.QryType {
|
|
|
- case 1: // 未提交
|
|
|
- status = "0,4,6"
|
|
|
- case 2: // 待审核
|
|
|
- status = "1"
|
|
|
- case 3: // 履约中
|
|
|
- status = "2"
|
|
|
- case 4: // 已完成
|
|
|
- status = "3,5"
|
|
|
- default:
|
|
|
- status = "0,1,2,3,4,5,6"
|
|
|
+ r.QryType = strings.TrimSpace(r.QryType)
|
|
|
+ r.QryType = strings.Trim(r.QryType, " ")
|
|
|
+
|
|
|
+ sTmp := make([]string, 0)
|
|
|
+ for _, v := range r.QryType {
|
|
|
+ var status string
|
|
|
+ switch v {
|
|
|
+ case '1': // 未提交
|
|
|
+ status = "0,4,6"
|
|
|
+ case '2': // 待审核
|
|
|
+ status = "1"
|
|
|
+ case '3': // 履约中
|
|
|
+ status = "2"
|
|
|
+ case '4': // 已完成
|
|
|
+ status = "3,5"
|
|
|
+ }
|
|
|
+ if status != "" {
|
|
|
+ sTmp = append(sTmp, status)
|
|
|
+ }
|
|
|
}
|
|
|
- return status
|
|
|
+
|
|
|
+ newStatus := strings.Join(sTmp, ",")
|
|
|
+
|
|
|
+ return newStatus
|
|
|
}
|
|
|
|
|
|
func (r *Ermcp3Contract) calc() {
|
|
|
@@ -767,7 +777,7 @@ SELECT to_char(t.SPOTCONTRACTID) SPOTCONTRACTID,
|
|
|
sqlId.AndEx("t.CONTRACTTYPE", r.CONTRACTTYPE, r.CONTRACTTYPE != 0)
|
|
|
// 用户条件
|
|
|
sqlId.Join(fmt.Sprintf(" and %v in(t.userid, t.saleuserid, t.tradeuserid, t.meruserid, l.userid)", r.OwnUserId))
|
|
|
- if r.QryType > 0 {
|
|
|
+ if len(r.QryType) > 0 {
|
|
|
status := r.getQryTypeStatus()
|
|
|
if len(status) > 0 {
|
|
|
sqlId.Join(fmt.Sprintf(" and t.contractstatus in (%v)", status))
|