1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- package model
- import (
- modernPb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/xdmy"
- "time"
- )
- type BigPartPurchase struct {
- Id int64 `gorm:"column:id"`
- PastureId int64 `gorm:"column:pastureId"`
- OrderNumber string `gorm:"column:orderNumber"`
- DepartmentId int64 `gorm:"column:departmentId"`
- EmployeId int64 `gorm:"column:employeId"`
- CreateTime time.Time `gorm:"column:createTime"`
- IsUrgent int32 `gorm:"column:isUrgent"`
- WorkflowId int64 `gorm:"column:workflowId"`
- FlowCompeleted int32 `gorm:"column:flowCompeleted"`
- FlowWorkNote string `gorm:"column:flowworkNote"`
- BuyStatue int32 `gorm:"column:buyStatu"`
- KGChargeId int32 `gorm:"column:KGChargeId"`
- KGChargeDate time.Time `gorm:"column:KGChargedate"`
- ChargeId int64 `gorm:"column:chargeId"`
- ChargeDate time.Time `gorm:"column:chargeDate"`
- CGChargeId int64 `gorm:"column:CGChargeId"`
- CGChargeDate time.Time `gorm:"column:CGChargeDate"`
- WorkflowNote string `gorm:"column:workflowNote"`
- Statue int32 `gorm:"column:statue"`
- MatchCode string `gorm:"column:matchCode"`
- ProviderId int64 `gorm:"column:providerId"`
- Equipment string `gorm:"column:equipment"`
- EquipmentDate time.Time `gorm:"column:equipmentDate"`
- Field string `gorm:"column:field"`
- FieldDate time.Time `gorm:"column:fieldDate"`
- PurchaseType modernPb.PurchaseType_Kind `gorm:"column:purchase_type"`
- FunderId int64 `gorm:"column:funder_id"`
- ProviderName string `gorm:"column:providerName"`
- }
- func (b *BigPartPurchase) TableName() string {
- return "bigpartpurchase"
- }
- var Location, _ = time.LoadLocation("Asia/Shanghai")
- func NewBigPartPurchase(pastureId, departmentId, employeeId, providerId, funderId int64,
- purchaseType modernPb.PurchaseType_Kind, orderNumber, createdTime, providerName string,
- ) *BigPartPurchase {
- var statue int32 = 2
- if purchaseType == modernPb.PurchaseType_Complimentary_Item {
- statue = 13
- }
- createTime, _ := time.ParseInLocation("2006-01-02 15:04:05", createdTime, Location)
- return &BigPartPurchase{
- PastureId: pastureId,
- OrderNumber: orderNumber,
- DepartmentId: departmentId,
- EmployeId: employeeId,
- CreateTime: createTime,
- IsUrgent: 0,
- FlowCompeleted: 1,
- FlowWorkNote: "",
- BuyStatue: 0,
- WorkflowNote: "",
- Statue: statue,
- ProviderId: providerId,
- ProviderName: providerName,
- PurchaseType: purchaseType,
- FunderId: funderId,
- }
- }
|