Browse Source

预计需求增加创建周与创建年

feature_custDemandHead
yehongyang 3 years ago
parent
commit
9e55a0c07b
4 changed files with 13 additions and 1 deletions
  1. +4
    -0
      dao/ap/implments/CustDemandHead.dao.impl.go
  2. +5
    -1
      meta/ap/CustDemandHead.meta.go
  3. +2
    -0
      models/ap/CustDemandHead.model.go
  4. +2
    -0
      services/ap/implments/CustDemandHead.service.impl.go

+ 4
- 0
dao/ap/implments/CustDemandHead.dao.impl.go View File

@ -8,6 +8,8 @@ import (
"leit.com/LAPP_CHEERSSON_BACKEND/grmi"
meta "leit.com/LAPP_CHEERSSON_BACKEND/meta/ap"
model "leit.com/LAPP_CHEERSSON_BACKEND/models/ap"
"leit.com/LAPP_CHEERSSON_BACKEND/utils"
"time"
"xorm.io/core"
)
@ -60,6 +62,8 @@ func NewCustDemandHeadDAOImplement(session *xorm.Session, plantNr int, userid st
func (impl *CustDemandHeadDAOImplement) InsertOne(entity *model.CustDemandHead) error {
entity.PlantNr = impl.plantNr
entity.LastUser = impl.userid
entity.CreateYear = time.Now().Year()
entity.CreateWeek = utils.WeekByDate(time.Now())
_, err := impl.session.Table(impl.meta.TableName).Insert(entity)
if err != nil {
return grmi.NewDataBaseError(err)


+ 5
- 1
meta/ap/CustDemandHead.meta.go View File

@ -34,6 +34,8 @@ var CustDemandHead_CtrlTime2 = grmi.NewField("CtrlTime2", "[AP_CustDemandHead].C
var CustDemandHead_LastModify = grmi.NewField("LastModify", "[AP_CustDemandHead].LastModify", "lastmodify", grmi.TypeDateTime)
var CustDemandHead_LastUser = grmi.NewField("LastUser", "[AP_CustDemandHead].LastUser", "lastuser", grmi.TypeString)
var CustDemandHead_CreateTime = grmi.NewField("CreateTime", "[AP_CustDemandHead].CreateTime", "createtime", grmi.TypeDateTime)
var CustDemandHead_CreateYear = grmi.NewField("CreateYear", "[AP_CustDemandHead].CreateYear", "createyear", grmi.TypeDateTime)
var CustDemandHead_CreateWeek = grmi.NewField("CreateWeek", "[AP_CustDemandHead].CreateWeek", "createweek", grmi.TypeDateTime)
/******************************************************************************
*
@ -66,6 +68,8 @@ var CustDemandHead = grmi.NewEntity(
CustDemandHead_LastModify.Name: CustDemandHead_LastModify,
CustDemandHead_LastUser.Name: CustDemandHead_LastUser,
CustDemandHead_CreateTime.Name: CustDemandHead_CreateTime,
CustDemandHead_CreateYear.Name: CustDemandHead_CreateYear,
CustDemandHead_CreateWeek.Name: CustDemandHead_CreateWeek,
},
[]string{"PlantNr"},
[]string{"Descr", "Status", "PlanReleaseTime", "ActualReleaseTime", "CreateMode", "CreateUser", "CtrlPara1", "CtrlPara2", "CtrlStr1", "CtrlStr2", "CtrlTime1", "CtrlTime2", "LastUser"})
[]string{"Descr", "Status", "PlanReleaseTime", "ActualReleaseTime", "CreateMode", "CreateUser", "CtrlPara1", "CtrlPara2", "CtrlStr1", "CtrlStr2", "CtrlTime1", "CtrlTime2", "LastUser", "CreateYear", "CreateWeek"})

+ 2
- 0
models/ap/CustDemandHead.model.go View File

@ -38,6 +38,8 @@ type CustDemandHead struct {
LastModify grmi.DateTime `xorm:"datetime 'LastModify' not null updated" json:"AP_CustDemandHead-LastModify"`
LastUser string `xorm:"nvarchar(20) 'LastUser' not null" json:"AP_CustDemandHead-LastUser"`
CreateTime grmi.DateTime `xorm:"datetime 'CreateTime' not null created" json:"AP_CustDemandHead-CreateTime"`
CreateYear int `xorm:"int 'CreateYear'" json:"AP_CustDemandHead-CreateYear"`
CreateWeek int `xorm:"int 'CreateWeek'" json:"AP_CustDemandHead-CreateWeek"`
}
/******************************************************************************


+ 2
- 0
services/ap/implments/CustDemandHead.service.impl.go View File

@ -39,6 +39,8 @@ var DefaultConditionOfCustDemandHead = grmi.NewCondition(
meta.CustDemandHead_LastModify.UrlParameterName: grmi.NewConditionItem(meta.CustDemandHead_LastModify, grmi.Approximate, false),
meta.CustDemandHead_LastUser.UrlParameterName: grmi.NewConditionItem(meta.CustDemandHead_LastUser, grmi.Equal, false),
meta.CustDemandHead_CreateTime.UrlParameterName: grmi.NewConditionItem(meta.CustDemandHead_CreateTime, grmi.Approximate, false),
meta.CustDemandHead_CreateWeek.UrlParameterName: grmi.NewConditionItem(meta.CustDemandHead_CreateWeek, grmi.Equal, false),
meta.CustDemandHead_CreateYear.UrlParameterName: grmi.NewConditionItem(meta.CustDemandHead_CreateYear, grmi.Equal, false),
},
nil,
)


Loading…
Cancel
Save