- add remark on table promotion

This commit is contained in:
gazebo
2018-11-07 20:07:06 +08:00
parent a5d22c3655
commit b013d0ab53
3 changed files with 14 additions and 8 deletions

View File

@@ -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)

View File

@@ -36,6 +36,7 @@ const (
FieldSpecQuality = "SpecQuality"
FieldSpecUnit = "SpecUnit"
FieldName = "Name"
FieldRemark = "Remark"
)
type ModelIDCUL struct {

View File

@@ -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() {