|
|
@ -134,6 +134,14 @@ func (impl *ArtDemandLstServiceImplement) InsertOne(user *models.Usertab, entity |
|
|
|
if record != nil { |
|
|
|
return grmi.NewBusinessError("已经存在相同主键的记录!") |
|
|
|
} |
|
|
|
baseDao := baseDal.NewArticleDAO(session, user.Pid, user.Userid) |
|
|
|
article, err := baseDao.SelectOne(entity.ArtId) |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
if article == nil { |
|
|
|
return grmi.NewBusinessError("不存在对应的物料,请检查") |
|
|
|
} |
|
|
|
demandTime := entity.DemandTime.Restore() |
|
|
|
entity.DemandYear = demandTime.Year() |
|
|
|
entity.DemandMonth = int(demandTime.Month()) |
|
|
|