- add remark on table promotion
This commit is contained in:
@@ -397,16 +397,20 @@ func CreateJdPromotion(ctx *jxcontext.Context, isIDJd bool, isAsync, isContinueW
|
||||
} else if step == 3 {
|
||||
err = promotionHandler.ConfirmPromotion(infoId, "")
|
||||
if err == nil {
|
||||
promotion.Status = model.PromotionStatusRemoteCreated
|
||||
} else {
|
||||
promotion.Status = model.PromotionStatusRemoteFailed
|
||||
db := dao.GetDB()
|
||||
if _, err = dao.UpdateEntityLogically(db, promotion, map[string]interface{}{
|
||||
model.FieldStatus: model.PromotionStatusRemoteCreated,
|
||||
}, ctx.GetUserName(), nil); err == nil {
|
||||
RefreshJdPromotionLockStatus(promotion.ID)
|
||||
}
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
db := dao.GetDB()
|
||||
if _, err = dao.UpdateEntityLogically(db, promotion, map[string]interface{}{
|
||||
"Status": promotion.Status,
|
||||
}, ctx.GetUserName(), nil); err == nil {
|
||||
RefreshJdPromotionLockStatus(promotion.ID)
|
||||
}
|
||||
dao.UpdateEntityLogically(db, promotion, map[string]interface{}{
|
||||
model.FieldStatus: model.PromotionStatusRemoteFailed,
|
||||
model.FieldRemark: err.Error(),
|
||||
}, ctx.GetUserName(), nil)
|
||||
}
|
||||
return nil, err
|
||||
}, 4)
|
||||
|
||||
@@ -36,6 +36,7 @@ const (
|
||||
FieldSpecQuality = "SpecQuality"
|
||||
FieldSpecUnit = "SpecUnit"
|
||||
FieldName = "Name"
|
||||
FieldRemark = "Remark"
|
||||
)
|
||||
|
||||
type ModelIDCUL struct {
|
||||
|
||||
@@ -33,6 +33,7 @@ type Promotion struct {
|
||||
VendorPromotionID string `orm:"size(64);column(vendor_promotion_id);index" json:"vendorPromotionID"`
|
||||
BeginAt time.Time `orm:"type(datetime);index" json:"beginAt"`
|
||||
EndAt time.Time `orm:"type(datetime);index" json:"endAt"`
|
||||
Remark string `orm:"type(text)" json:"-"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
Reference in New Issue
Block a user