|
|
@@ -32,11 +32,6 @@ type SupplierlogService struct {
|
|
|
MyServiceBase
|
|
|
}
|
|
|
|
|
|
-//type SupplierBaseInfo struct {
|
|
|
-// BaseInfo string `json:"baseInfo"` // OilSupplier
|
|
|
-// ChangeItems string `json:"changeItems"` //OilAppendChangeItem
|
|
|
-//}
|
|
|
-
|
|
|
type SupplierAppendBaseInfo struct {
|
|
|
BaseInfo supplier.OilSupplier
|
|
|
ChangeItems []suppliercertappendsub.OilAppendChangeItem
|
|
|
@@ -109,6 +104,7 @@ func (s *SupplierlogService) SaveSupplierLogForAccess(supplierId int, supplierCe
|
|
|
|
|
|
// json 化数据
|
|
|
supplierBaseInfo, _ := json.Marshal(supplierEntity)
|
|
|
+ accessCertInfo, _ := json.Marshal(supplierCertEntity)
|
|
|
agencyManufacture, _ := json.Marshal(manufList)
|
|
|
inspectionReport, _ := json.Marshal(sceneFileList)
|
|
|
majorEquipment, _ := json.Marshal(majorEquipmentList)
|
|
|
@@ -125,6 +121,7 @@ func (s *SupplierlogService) SaveSupplierLogForAccess(supplierId int, supplierCe
|
|
|
model.NewSupplierName = supplierEntity.SupplierName
|
|
|
model.NewCommercialNo = supplierEntity.CommercialNo
|
|
|
model.OperType = 1
|
|
|
+ model.ApplyInfo = string(accessCertInfo)
|
|
|
model.BaseInfo = string(supplierBaseInfo)
|
|
|
model.AgencyManufacture = string(agencyManufacture)
|
|
|
model.InspectionReport = string(inspectionReport)
|
|
|
@@ -186,6 +183,7 @@ func (s *SupplierlogService) SaveSupplierLogForAppend(supplierId int, supplierCe
|
|
|
appendBaseInfo.BaseInfo = supplierEntity
|
|
|
appendBaseInfo.ChangeItems = changeInfoItems
|
|
|
baseInfo, _ := json.Marshal(appendBaseInfo)
|
|
|
+ appendCertInfo, _ := json.Marshal(appendCertEntity)
|
|
|
|
|
|
// 插入日志信息
|
|
|
var model OilSupplierLog
|
|
|
@@ -194,6 +192,7 @@ func (s *SupplierlogService) SaveSupplierLogForAppend(supplierId int, supplierCe
|
|
|
model.NewSupplierName = supplierEntity.SupplierName
|
|
|
model.NewCommercialNo = supplierEntity.CommercialNo
|
|
|
model.OperType = 2
|
|
|
+ model.ApplyInfo = string(appendCertInfo)
|
|
|
model.BaseInfo = string(baseInfo)
|
|
|
model.CertFile = string(certFile)
|
|
|
model.CertSub = string(certSub)
|
|
|
@@ -222,6 +221,10 @@ func (s *SupplierlogService) SaveSupplierLogForAnnual(supplierId int, annualId i
|
|
|
supplierSrv := supplier.GetOilSupplierService(utils.DBE)
|
|
|
var supplierEntity supplier.OilSupplier
|
|
|
supplierSrv.GetEntityById(annualEntity.SupplierId, &supplierEntity)
|
|
|
+ // 基本准入信息 为获取人员结构信息
|
|
|
+ accessCertSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
+ var accessCertEntity suppliercert.OilSupplierCert
|
|
|
+ accessCertSrv.GetEntityById(annualEntity.CerId, &accessCertEntity)
|
|
|
// 企业基本信息 变更项
|
|
|
var changeInfoItems []infochange.OilAnnualChangeItem
|
|
|
whereAnnual := " InfoId = " + strconv.Itoa(annualId)
|
|
|
@@ -258,14 +261,14 @@ func (s *SupplierlogService) SaveSupplierLogForAnnual(supplierId int, annualId i
|
|
|
certSubSrv.GetEntitysByWhere("OilSupplierCertSub", whereSupplier+" and "+whereSupplierCert+" and SupplierTypeCode="+annualEntity.SupplierTypeName, &certSubList)
|
|
|
|
|
|
// json 化数据
|
|
|
- //supplierBaseInfo, _ := json.Marshal(supplierEntity)
|
|
|
- //supplierBaseInfoChangeItem, _ := json.Marshal(changeInfoItems)
|
|
|
+ annualInfo, _ := json.Marshal(annualEntity)
|
|
|
majorEquipment, _ := json.Marshal(majorEquipmentList)
|
|
|
threeYearsPerformance, _ := json.Marshal(threeYearsPerformanceList)
|
|
|
patentTech, _ := json.Marshal(patentTechList)
|
|
|
winingPro, _ := json.Marshal(winingProList)
|
|
|
certFile, _ := json.Marshal(annualCertFileList)
|
|
|
certSub, _ := json.Marshal(certSubList)
|
|
|
+ accessInfo, _ := json.Marshal(accessCertEntity)
|
|
|
|
|
|
var annualBaseInfo SupplierAnnualBaseInfo
|
|
|
annualBaseInfo.BaseInfo = supplierEntity
|
|
|
@@ -280,6 +283,8 @@ func (s *SupplierlogService) SaveSupplierLogForAnnual(supplierId int, annualId i
|
|
|
model.NewCommercialNo = supplierEntity.CommercialNo
|
|
|
model.OperType = 3 // 年审
|
|
|
model.BaseInfo = string(baseInfo)
|
|
|
+ model.ApplyInfo = string(annualInfo)
|
|
|
+ model.AnnualToCertInfo = string(accessInfo)
|
|
|
model.Equipment = string(majorEquipment)
|
|
|
model.Performance = string(threeYearsPerformance)
|
|
|
model.Patent = string(patentTech)
|
|
|
@@ -332,6 +337,7 @@ func (s *SupplierlogService) SaveSupplierLogForInfoChange(supplierId int, infoCh
|
|
|
infoChangeBaseInfo.BaseInfo = supplierEntity
|
|
|
infoChangeBaseInfo.ChangeItems = changeInfoItems
|
|
|
baseInfo, _ := json.Marshal(infoChangeBaseInfo)
|
|
|
+ changeInfo, _ := json.Marshal(infoChangeEntity)
|
|
|
|
|
|
// 插入日志信息
|
|
|
var model OilSupplierLog
|
|
|
@@ -341,6 +347,7 @@ func (s *SupplierlogService) SaveSupplierLogForInfoChange(supplierId int, infoCh
|
|
|
model.NewCommercialNo = supplierEntity.CommercialNo
|
|
|
model.OperType = 4
|
|
|
model.BaseInfo = string(baseInfo)
|
|
|
+ model.ApplyInfo = string(changeInfo)
|
|
|
model.CertFile = string(certFile)
|
|
|
model.CreateOn = time.Now()
|
|
|
_, err := s.InsertEntity(&model)
|