diff --git a/dao/ap/implments/CustDemandVerDetail.dao.impl.go b/dao/ap/implments/CustDemandVerDetail.dao.impl.go index cdb025a..8df2b33 100644 --- a/dao/ap/implments/CustDemandVerDetail.dao.impl.go +++ b/dao/ap/implments/CustDemandVerDetail.dao.impl.go @@ -8,6 +8,7 @@ import ( "leit.com/LAPP_CHEERSSON_BACKEND/grmi" meta "leit.com/LAPP_CHEERSSON_BACKEND/meta/ap" model "leit.com/LAPP_CHEERSSON_BACKEND/models/ap" + baseModel "leit.com/LAPP_CHEERSSON_BACKEND/models/base" "leit.com/LAPP_CHEERSSON_BACKEND/utils" "strings" "xorm.io/core" @@ -463,6 +464,7 @@ func (impl *CustDemandVerDetailDAOImplement) SelectDeviationByVersion(version st ******************************************************************************/ func (impl *CustDemandVerDetailDAOImplement) IssueVersion(CustomerId string,VersionId string) error { entity :=new(model.CustDemandVerDetail) + entity.Status = baseModel.STATUS_INT_YES _, err := impl.session.Table(impl.meta.TableName).Cols("Status").Where("PlantNr = ? and CustomerId = ? and VersionId = ?",impl.plantNr,CustomerId,VersionId).Update(entity) if err != nil { return grmi.NewDataBaseError(err) diff --git a/models/base/Const.go b/models/base/Const.go index e7e4e94..c99f723 100644 --- a/models/base/Const.go +++ b/models/base/Const.go @@ -113,4 +113,7 @@ const ( STATUS_YES = "1" STATUS_NO = "0" + + STATUS_INT_YES = 1 + STATUS_INT_NO = 0 ) diff --git a/services/ap/implments/CustDemandVerHead.service.impl.go b/services/ap/implments/CustDemandVerHead.service.impl.go index 9e38989..3345de6 100644 --- a/services/ap/implments/CustDemandVerHead.service.impl.go +++ b/services/ap/implments/CustDemandVerHead.service.impl.go @@ -1026,11 +1026,11 @@ func (impl *CustDemandVerHeadServiceImplement) ImportFile(user *global.User, cus firstWeek := utils.ZellerFunction2Week(uint16(year), uint16(month), uint16(day)) dayLen := mInfo.WeekDemandDay - firstWeek - nowWeek := utils.WeekByDate(nowDate) - week := utils.WeekByDate(weekDate) - if nowWeek > week { + nowDateTime := utils.GetZeroTime(nowDate) + if nowDateTime.Unix() > weekDate.AddDate(0, 0, dayLen).Unix() { continue } + week := utils.WeekByDate(weekDate) one := model.CustDemandVerDetail{} one.ArtId = ArtId one.CustomerId = customerId @@ -1205,11 +1205,11 @@ func (impl *CustDemandVerHeadServiceImplement) BulkImportFile(user *global.User, firstWeek := utils.ZellerFunction2Week(uint16(year), uint16(month), uint16(day)) dayLen := mInfo.WeekDemandDay - firstWeek - nowWeek := utils.WeekByDate(nowDate) - week := utils.WeekByDate(weekDate) - if nowWeek > week { + nowDateTime := utils.GetZeroTime(nowDate) + if nowDateTime.Unix() > weekDate.AddDate(0, 0, dayLen).Unix() { continue } + week := utils.WeekByDate(weekDate) one := model.CustDemandVerDetail{} one.ArtId = ArtId one.CustomerId = customerId