|
@@ -1,4 +1,4 @@
|
|
|
-package service
|
|
|
+package mysql
|
|
|
|
|
|
import (
|
|
|
"app.yhyue.com/moapp/jybase/date"
|
|
@@ -6,7 +6,6 @@ import (
|
|
|
"fmt"
|
|
|
"github.com/gogf/gf/v2/util/gconv"
|
|
|
IC "jyBXCore/rpc/init"
|
|
|
- "jyBXCore/rpc/model/mysql"
|
|
|
"jyBXCore/rpc/util"
|
|
|
"strings"
|
|
|
"time"
|
|
@@ -20,13 +19,11 @@ type ParStage struct {
|
|
|
Stage string //参标、终止参标(划转没有记录)
|
|
|
}
|
|
|
|
|
|
-func NewParStage(entId, entUserId, positionId int64, projectId, stage string) *ParStage {
|
|
|
+func NewParStage(entId int64, projectId, stage string) *ParStage {
|
|
|
return &ParStage{
|
|
|
- EntId: entId,
|
|
|
- EntUserId: entUserId,
|
|
|
- PositionId: positionId,
|
|
|
- ProjectId: projectId,
|
|
|
- Stage: stage,
|
|
|
+ EntId: entId,
|
|
|
+ ProjectId: projectId,
|
|
|
+ Stage: stage,
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -34,10 +31,8 @@ func (p *ParStage) UpdateStage() {
|
|
|
var (
|
|
|
recordsMap = map[string]string{}
|
|
|
updateInsertMap = map[string]interface{}{
|
|
|
- "ent_id": p.EntId,
|
|
|
- "ent_user_id": p.EntUserId,
|
|
|
- "position_id": p.PositionId,
|
|
|
- "project_id": p.ProjectId,
|
|
|
+ "ent_id": p.EntId,
|
|
|
+ "project_id": p.ProjectId,
|
|
|
}
|
|
|
now = time.Now()
|
|
|
createDate string
|
|
@@ -95,19 +90,19 @@ func (p *ParStage) UpdateStage() {
|
|
|
return
|
|
|
}
|
|
|
updateInsertMap["stage"] = string(jsonData)
|
|
|
- if c := IC.BaseMysql.Count(mysql.ParticipateStage, map[string]interface{}{
|
|
|
- "position_id": p.PositionId,
|
|
|
- "project_id": p.ProjectId,
|
|
|
+ if c := IC.BaseMysql.Count(ParticipateStage, map[string]interface{}{
|
|
|
+ "ent_id": p.EntId,
|
|
|
+ "project_id": p.ProjectId,
|
|
|
}); c > 0 {
|
|
|
updateInsertMap["update_date"] = createDate
|
|
|
- IC.BaseMysql.UpdateOrDeleteBySql(mysql.ParticipateStage, map[string]interface{}{
|
|
|
- "position_id": p.PositionId,
|
|
|
- "project_id": p.ProjectId,
|
|
|
+ IC.BaseMysql.UpdateOrDeleteBySql(ParticipateStage, map[string]interface{}{
|
|
|
+ "ent_id": p.EntId,
|
|
|
+ "project_id": p.ProjectId,
|
|
|
}, updateInsertMap)
|
|
|
} else {
|
|
|
updateInsertMap["create_date"] = date.FormatDate(&now, date.Date_Full_Layout)
|
|
|
updateInsertMap["update_date"] = createDate
|
|
|
- IC.BaseMysql.Insert(mysql.ParticipateStage, updateInsertMap)
|
|
|
+ IC.BaseMysql.Insert(ParticipateStage, updateInsertMap)
|
|
|
}
|
|
|
}
|
|
|
}
|