2
3
lining 6 жил өмнө
parent
commit
69867a5167

+ 17 - 1
src/dashoo.cn/backend/api/business/oilsupplier/infochange/infochange.go

@@ -182,7 +182,23 @@ type Del_OilInfoChange struct {
 type OilInfoChangeItem struct {
 	Id               int       `xorm:"not null pk autoincr INT(10)"`
 	InfoId           int       `xorm:"comment('信息变更主表Id') INT(10)"`
-	SupplierTypeCode string    `xorm:"comment('1 年审 2 信息变更') VARCHAR(5)"`
+	SupplierId       int       `xorm:"comment('供方Id') INT(10)"`
+	SelectItem       string    `xorm:"comment('变更字段名') VARCHAR(50)"`
+	SelectItemName   string    `xorm:"comment('变更字段名') VARCHAR(255)"`
+	BeChangeInfo     string    `xorm:"comment('变更前内容') VARCHAR(255)"`
+	ChangeInfo       string    `xorm:"comment('变更后内容') VARCHAR(255)"`
+	ChangeStatus     int       `xorm:"comment('变更状态') INT(10)"`
+	CreateOn         time.Time `xorm:"DATETIME"`
+	CreateUserId     int       `xorm:"INT(10)"`
+	CreateBy         string    `xorm:"VARCHAR(50)"`
+	ModifiedOn       time.Time `xorm:"DATETIME"`
+	ModifiedUserId   int       `xorm:"INT(10)"`
+	ModifiedBy       string    `xorm:"VARCHAR(50)"`
+}
+
+type OilAnnualChangeItem struct {
+	Id               int       `xorm:"not null pk autoincr INT(10)"`
+	InfoId           int       `xorm:"comment('年审主表Id') INT(10)"`
 	SupplierId       int       `xorm:"comment('供方Id') INT(10)"`
 	SelectItem       string    `xorm:"comment('变更字段名') VARCHAR(50)"`
 	SelectItemName   string    `xorm:"comment('变更字段名') VARCHAR(255)"`

+ 7 - 8
src/dashoo.cn/backend/api/controllers/oilsupplier/annualaudit.go

@@ -1031,7 +1031,7 @@ func (this *AnnualAuditController) AnnualAudit() {
 			} else {
 				auditmodel.Status = suppliercert.ALL_PASE_STATUS
 			}
-			var infoitems []infochange.OilInfoChangeItem
+			var infoitems []infochange.OilAnnualChangeItem
 			where := "SupplierId = " + utils.ToStr(supplierEntity.Id) +" and InfoId = " +utils.ToStr(list.Id)
 			svc.GetEntities(&infoitems, where)
 			this.updatesupplier(OilSupplierName, supplierEntity.Id, infoitems)
@@ -1127,7 +1127,7 @@ func (this *AnnualAuditController) GetChangeEntity() {
 	svc.GetEntityByIdBytbl(OilSupplierName, Id, &model)
 	models[0] = model
 
-	var infoitems []infochange.OilInfoChangeItem
+	var infoitems []infochange.OilAnnualChangeItem
 	where := " SupplierId = " + Id +" and InfoId ="+InfoId
 	where = where + " and ChangeStatus = 0"
 	svc.GetEntitysByWhere(OilInfoChangeItemName, where, &infoitems)
@@ -1176,20 +1176,19 @@ func (this *AnnualAuditController) AddInfoChangeItemCh() {
 	where := " SupplierId = " + model.SupplierId
 	where = where + " and InfoId = " + model.MInfoId
 
-	var deleteEntity infochange.OilInfoChangeItem
+	var deleteEntity infochange.OilAnnualChangeItem
 	delMainId, _ := strconv.Atoi(model.MInfoId)
 	deleteEntity.InfoId = delMainId
 	svc.DBE.Delete(deleteEntity)
 
-	var infoitementitys []infochange.OilInfoChangeItem
+	var infoitementitys []infochange.OilAnnualChangeItem
 	for i := 0; i < len(model.InfochangeForm); i++ {
-		var infoitementity infochange.OilInfoChangeItem
+		var infoitementity infochange.OilAnnualChangeItem
 		infoitementity.SelectItem = model.InfochangeForm[i].SelectItem
 		infoitementity.SelectItemName = model.InfochangeForm[i].SelectItemName
 		infoitementity.ChangeInfo = model.InfochangeForm[i].ChangeInfo
 		infoitementity.BeChangeInfo = model.InfochangeForm[i].BeChangeInfo
 		infoitementity.ChangeStatus = 0
-		infoitementity.SupplierTypeCode = "2"
 		infoitementity.SupplierId, _ = strconv.Atoi(model.SupplierId)
 		infoitementity.InfoId, _ = strconv.Atoi(model.MInfoId)
 		infoitementity.CreateOn = time.Now()
@@ -1221,7 +1220,7 @@ func (this *AnnualAuditController) AddInfoChangeItemCh() {
 // @router /auditget/:id [get]
 func (this *AnnualAuditController) GetEntityThen() {
 	InfoId := this.Ctx.Input.Param(":id")
-	var model []infochange.OilInfoChangeItem
+	var model []infochange.OilAnnualChangeItem
 	svc := infochange.GetInfoChangeService(utils.DBE)
 	where := " InfoId = " + InfoId
 	svc.GetEntitysByWhere(OilInfoChangeItemName, where, &model)
@@ -1232,7 +1231,7 @@ func (this *AnnualAuditController) GetEntityThen() {
 }
 
 //更新供方信息表
-func (this *AnnualAuditController) updatesupplier(supname string, suppid int, infoitems []infochange.OilInfoChangeItem) error {
+func (this *AnnualAuditController) updatesupplier(supname string, suppid int, infoitems []infochange.OilAnnualChangeItem) error {
 	svc := infochange.GetInfoChangeService(utils.DBE)
 	var err error
 	if len(infoitems) > 0 {

+ 0 - 1
src/dashoo.cn/backend/api/controllers/oilsupplier/infochange.go

@@ -760,7 +760,6 @@ func (this *InfoChangeController) AddInfoChangeItemCh() {
 		infoitementity.ChangeInfo = model.InfochangeForm[i].ChangeInfo
 		infoitementity.BeChangeInfo = model.InfochangeForm[i].BeChangeInfo
 		infoitementity.ChangeStatus = 0
-		infoitementity.SupplierTypeCode = "2"
 		infoitementity.SupplierId, _ = strconv.Atoi(model.SupplierId)
 		infoitementity.InfoId, _ = strconv.Atoi(model.MInfoId)
 		infoitementity.CreateOn = time.Now()