|
@@ -32,6 +32,26 @@ type SupplierlogService struct {
|
|
|
MyServiceBase
|
|
MyServiceBase
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+//type SupplierBaseInfo struct {
|
|
|
|
|
+// BaseInfo string `json:"baseInfo"` // OilSupplier
|
|
|
|
|
+// ChangeItems string `json:"changeItems"` //OilAppendChangeItem
|
|
|
|
|
+//}
|
|
|
|
|
+
|
|
|
|
|
+type SupplierAppendBaseInfo struct {
|
|
|
|
|
+ BaseInfo supplier.OilSupplier
|
|
|
|
|
+ ChangeItems []suppliercertappendsub.OilAppendChangeItem
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+type SupplierAnnualBaseInfo struct {
|
|
|
|
|
+ BaseInfo supplier.OilSupplier
|
|
|
|
|
+ ChangeItems []infochange.OilAnnualChangeItem
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+type SupplierInfoChangeBaseInfo struct {
|
|
|
|
|
+ BaseInfo supplier.OilSupplier
|
|
|
|
|
+ ChangeItems []infochange.OilInfoChangeItem
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
func GetSupplierLogService(xormEngine *xorm.Engine) *SupplierlogService {
|
|
func GetSupplierLogService(xormEngine *xorm.Engine) *SupplierlogService {
|
|
|
s := new(SupplierlogService)
|
|
s := new(SupplierlogService)
|
|
|
s.DBE = xormEngine
|
|
s.DBE = xormEngine
|
|
@@ -61,7 +81,7 @@ func (s *SupplierlogService) SaveSupplierLogForAccess(supplierId int, supplierCe
|
|
|
// 现场考察报告列表
|
|
// 现场考察报告列表
|
|
|
sceneFileSrv := supplierscenefile.GetSupplierScenefileService(utils.DBE)
|
|
sceneFileSrv := supplierscenefile.GetSupplierScenefileService(utils.DBE)
|
|
|
var sceneFileList []supplierscenefile.OilSupplierSceneFile
|
|
var sceneFileList []supplierscenefile.OilSupplierSceneFile
|
|
|
- sceneFileSrv.GetEntitysByWhere("OilSupplierFile", whereSupplier, &sceneFileList)
|
|
|
|
|
|
|
+ sceneFileSrv.GetEntitysByWhere("`OilSupplierSceneFile`", whereSupplier, &sceneFileList)
|
|
|
// 主要设备
|
|
// 主要设备
|
|
|
majorEquipmentSrv := majorequip.GetMajorequipService(utils.DBE)
|
|
majorEquipmentSrv := majorequip.GetMajorequipService(utils.DBE)
|
|
|
var majorEquipmentList []majorequip.OilEnterpriseMajorEquipment
|
|
var majorEquipmentList []majorequip.OilEnterpriseMajorEquipment
|
|
@@ -85,7 +105,7 @@ func (s *SupplierlogService) SaveSupplierLogForAccess(supplierId int, supplierCe
|
|
|
// 准入范围
|
|
// 准入范围
|
|
|
certSubSrv := suppliercertsub.GetOilSupplierCertSubService(utils.DBE)
|
|
certSubSrv := suppliercertsub.GetOilSupplierCertSubService(utils.DBE)
|
|
|
var certSubList []suppliercertsub.OilSupplierCertSub
|
|
var certSubList []suppliercertsub.OilSupplierCertSub
|
|
|
- certSubSrv.GetEntitysByWhere("OilSupplierCertSub", whereSupplier+" and Type=1 and "+whereSupplierCert+" and TypeCode="+supplierCertEntity.SupplierTypeCode, &certSubList)
|
|
|
|
|
|
|
+ certSubSrv.GetEntitysByWhere("OilSupplierCertSub", whereSupplier+" and Type=1 and "+whereSupplierCert+" and SupplierTypeCode="+supplierCertEntity.SupplierTypeCode, &certSubList)
|
|
|
|
|
|
|
|
// json 化数据
|
|
// json 化数据
|
|
|
supplierBaseInfo, _ := json.Marshal(supplierEntity)
|
|
supplierBaseInfo, _ := json.Marshal(supplierEntity)
|
|
@@ -152,16 +172,20 @@ func (s *SupplierlogService) SaveSupplierLogForAppend(supplierId int, supplierCe
|
|
|
appendWhere := " a.SupplierId = " + strconv.Itoa(supplierId)
|
|
appendWhere := " a.SupplierId = " + strconv.Itoa(supplierId)
|
|
|
appendWhere = appendWhere + " and a.SupplierTypeCode in ( '000', '" + appendCertEntity.AppendType + "')"
|
|
appendWhere = appendWhere + " and a.SupplierTypeCode in ( '000', '" + appendCertEntity.AppendType + "')"
|
|
|
appendCertSubSrv := suppliercertappendsub.GetOilSupplierCertAppendSubService(utils.DBE)
|
|
appendCertSubSrv := suppliercertappendsub.GetOilSupplierCertAppendSubService(utils.DBE)
|
|
|
- appendCertSubSrv.GetQualPagingEntities("OilSupplierFile", "OilAppendChangeDetail", 1, 100, "a.Id", true, &appendCertFileList, appendWhere, strconv.Itoa(supplierCertAppendId))
|
|
|
|
|
|
|
+ appendCertSubSrv.GetQualPagingEntities("OilSupplierFile", "OilAppendChangeDetail", 1, 1000, "a.Id", true, &appendCertFileList, appendWhere, strconv.Itoa(supplierCertAppendId))
|
|
|
// 准入范围 Type是3的就是本次新增的
|
|
// 准入范围 Type是3的就是本次新增的
|
|
|
certSubSrv := suppliercertsub.GetOilSupplierCertSubService(utils.DBE)
|
|
certSubSrv := suppliercertsub.GetOilSupplierCertSubService(utils.DBE)
|
|
|
var certSubList []suppliercertsub.OilSupplierCertSub
|
|
var certSubList []suppliercertsub.OilSupplierCertSub
|
|
|
- certSubSrv.GetEntitysByWhere("OilSupplierCertSub", whereSupplier+" and "+whereSupplierCertAppend+" and Type IN ('1', '3') and SupplierTypeCode IN ('000', '"+appendCertEntity.AppendType+"')", &certSubList)
|
|
|
|
|
|
|
+ certSubSrv.GetEntitysByWhere("OilSupplierCertSub", whereSupplier+" and "+whereSupplierCertAppend+" and SupplierTypeCode IN ('000', '"+appendCertEntity.AppendType+"')", &certSubList)
|
|
|
// json 化数据 SupplierTypeCode
|
|
// json 化数据 SupplierTypeCode
|
|
|
- supplierBaseInfo, _ := json.Marshal(supplierEntity)
|
|
|
|
|
- supplierBaseInfoChangeItem, _ := json.Marshal(changeInfoItems)
|
|
|
|
|
|
|
+ //supplierBaseInfo, _ := json.Marshal(supplierEntity)
|
|
|
|
|
+ //supplierBaseInfoChangeItem, _ := json.Marshal(changeInfoItems)
|
|
|
certFile, _ := json.Marshal(appendCertFileList)
|
|
certFile, _ := json.Marshal(appendCertFileList)
|
|
|
certSub, _ := json.Marshal(certSubList)
|
|
certSub, _ := json.Marshal(certSubList)
|
|
|
|
|
+ var appendBaseInfo SupplierAppendBaseInfo
|
|
|
|
|
+ appendBaseInfo.BaseInfo = supplierEntity
|
|
|
|
|
+ appendBaseInfo.ChangeItems = changeInfoItems
|
|
|
|
|
+ baseInfo, _ := json.Marshal(appendBaseInfo)
|
|
|
|
|
|
|
|
// 插入日志信息
|
|
// 插入日志信息
|
|
|
var model OilSupplierLog
|
|
var model OilSupplierLog
|
|
@@ -170,7 +194,7 @@ func (s *SupplierlogService) SaveSupplierLogForAppend(supplierId int, supplierCe
|
|
|
model.NewSupplierName = supplierEntity.SupplierName
|
|
model.NewSupplierName = supplierEntity.SupplierName
|
|
|
model.NewCommercialNo = supplierEntity.CommercialNo
|
|
model.NewCommercialNo = supplierEntity.CommercialNo
|
|
|
model.OperType = 2
|
|
model.OperType = 2
|
|
|
- model.BaseInfo = string(supplierBaseInfo) + "&& " + string(supplierBaseInfoChangeItem)
|
|
|
|
|
|
|
+ model.BaseInfo = string(baseInfo)
|
|
|
model.CertFile = string(certFile)
|
|
model.CertFile = string(certFile)
|
|
|
model.CertSub = string(certSub)
|
|
model.CertSub = string(certSub)
|
|
|
model.CreateOn = time.Now()
|
|
model.CreateOn = time.Now()
|
|
@@ -208,7 +232,7 @@ func (s *SupplierlogService) SaveSupplierLogForAnnual(supplierId int, annualId i
|
|
|
annualWhere := " a.SupplierId = " + strconv.Itoa(supplierId)
|
|
annualWhere := " a.SupplierId = " + strconv.Itoa(supplierId)
|
|
|
annualWhere = annualWhere + " and a.SupplierTypeCode in ( '000', '" + annualEntity.SupplierTypeName + "')"
|
|
annualWhere = annualWhere + " and a.SupplierTypeCode in ( '000', '" + annualEntity.SupplierTypeName + "')"
|
|
|
annualCertSubSrv := suppliercertappendsub.GetOilSupplierCertAppendSubService(utils.DBE)
|
|
annualCertSubSrv := suppliercertappendsub.GetOilSupplierCertAppendSubService(utils.DBE)
|
|
|
- annualCertSubSrv.GetQualPagingEntities("OilSupplierFile", "OilAnnualChangeDetail", 1, 100, "a.Id", true, &annualCertFileList, annualWhere, strconv.Itoa(annualId))
|
|
|
|
|
|
|
+ annualCertSubSrv.GetQualPagingEntities("OilSupplierFile", "OilAnnualChangeDetail", 1, 1000, "a.Id", true, &annualCertFileList, annualWhere, strconv.Itoa(annualId))
|
|
|
|
|
|
|
|
whereSupplierCert := "SupplierCertId=" + strconv.Itoa(annualEntity.CerId)
|
|
whereSupplierCert := "SupplierCertId=" + strconv.Itoa(annualEntity.CerId)
|
|
|
// 主要设备
|
|
// 主要设备
|
|
@@ -227,15 +251,26 @@ func (s *SupplierlogService) SaveSupplierLogForAnnual(supplierId int, annualId i
|
|
|
winningProSrv := winning.GetWinningService(utils.DBE)
|
|
winningProSrv := winning.GetWinningService(utils.DBE)
|
|
|
var winingProList []winning.OilWinningProject
|
|
var winingProList []winning.OilWinningProject
|
|
|
winningProSrv.GetEntitysByWhere("OilWinningProject", whereSupplierCert, &winingProList)
|
|
winningProSrv.GetEntitysByWhere("OilWinningProject", whereSupplierCert, &winingProList)
|
|
|
|
|
+ // 准入范围
|
|
|
|
|
+ whereSupplier := "SupplierId=" + strconv.Itoa(annualEntity.SupplierId)
|
|
|
|
|
+ certSubSrv := suppliercertsub.GetOilSupplierCertSubService(utils.DBE)
|
|
|
|
|
+ var certSubList []suppliercertsub.OilSupplierCertSub
|
|
|
|
|
+ certSubSrv.GetEntitysByWhere("OilSupplierCertSub", whereSupplier+" and "+whereSupplierCert+" and SupplierTypeCode="+annualEntity.SupplierTypeName, &certSubList)
|
|
|
|
|
|
|
|
// json 化数据
|
|
// json 化数据
|
|
|
- supplierBaseInfo, _ := json.Marshal(supplierEntity)
|
|
|
|
|
- supplierBaseInfoChangeItem, _ := json.Marshal(changeInfoItems)
|
|
|
|
|
|
|
+ //supplierBaseInfo, _ := json.Marshal(supplierEntity)
|
|
|
|
|
+ //supplierBaseInfoChangeItem, _ := json.Marshal(changeInfoItems)
|
|
|
majorEquipment, _ := json.Marshal(majorEquipmentList)
|
|
majorEquipment, _ := json.Marshal(majorEquipmentList)
|
|
|
threeYearsPerformance, _ := json.Marshal(threeYearsPerformanceList)
|
|
threeYearsPerformance, _ := json.Marshal(threeYearsPerformanceList)
|
|
|
patentTech, _ := json.Marshal(patentTechList)
|
|
patentTech, _ := json.Marshal(patentTechList)
|
|
|
winingPro, _ := json.Marshal(winingProList)
|
|
winingPro, _ := json.Marshal(winingProList)
|
|
|
certFile, _ := json.Marshal(annualCertFileList)
|
|
certFile, _ := json.Marshal(annualCertFileList)
|
|
|
|
|
+ certSub, _ := json.Marshal(certSubList)
|
|
|
|
|
+
|
|
|
|
|
+ var annualBaseInfo SupplierAnnualBaseInfo
|
|
|
|
|
+ annualBaseInfo.BaseInfo = supplierEntity
|
|
|
|
|
+ annualBaseInfo.ChangeItems = changeInfoItems
|
|
|
|
|
+ baseInfo, _ := json.Marshal(annualBaseInfo)
|
|
|
|
|
|
|
|
// 插入日志信息
|
|
// 插入日志信息
|
|
|
var model OilSupplierLog
|
|
var model OilSupplierLog
|
|
@@ -244,12 +279,13 @@ func (s *SupplierlogService) SaveSupplierLogForAnnual(supplierId int, annualId i
|
|
|
model.NewSupplierName = supplierEntity.SupplierName
|
|
model.NewSupplierName = supplierEntity.SupplierName
|
|
|
model.NewCommercialNo = supplierEntity.CommercialNo
|
|
model.NewCommercialNo = supplierEntity.CommercialNo
|
|
|
model.OperType = 3 // 年审
|
|
model.OperType = 3 // 年审
|
|
|
- model.BaseInfo = string(supplierBaseInfo) + "&" + string(supplierBaseInfoChangeItem)
|
|
|
|
|
|
|
+ model.BaseInfo = string(baseInfo)
|
|
|
model.Equipment = string(majorEquipment)
|
|
model.Equipment = string(majorEquipment)
|
|
|
model.Performance = string(threeYearsPerformance)
|
|
model.Performance = string(threeYearsPerformance)
|
|
|
model.Patent = string(patentTech)
|
|
model.Patent = string(patentTech)
|
|
|
model.AwardProject = string(winingPro)
|
|
model.AwardProject = string(winingPro)
|
|
|
model.CertFile = string(certFile)
|
|
model.CertFile = string(certFile)
|
|
|
|
|
+ model.CertSub = string(certSub)
|
|
|
model.CreateOn = time.Now()
|
|
model.CreateOn = time.Now()
|
|
|
_, err := s.InsertEntity(&model)
|
|
_, err := s.InsertEntity(&model)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -289,9 +325,13 @@ func (s *SupplierlogService) SaveSupplierLogForInfoChange(supplierId int, infoCh
|
|
|
allCertSubSrv.GetQualPagingEntities("OilSupplierFile", "OilQualChangeDetail", 1, 1000, "a.Id", true, &allCertFileList, changeWhere, strconv.Itoa(infoChangeId))
|
|
allCertSubSrv.GetQualPagingEntities("OilSupplierFile", "OilQualChangeDetail", 1, 1000, "a.Id", true, &allCertFileList, changeWhere, strconv.Itoa(infoChangeId))
|
|
|
|
|
|
|
|
// json 化数据
|
|
// json 化数据
|
|
|
- supplierBaseInfo, _ := json.Marshal(supplierEntity)
|
|
|
|
|
- supplierBaseInfoChangeItem, _ := json.Marshal(changeInfoItems)
|
|
|
|
|
|
|
+ //supplierBaseInfo, _ := json.Marshal(supplierEntity)
|
|
|
|
|
+ //supplierBaseInfoChangeItem, _ := json.Marshal(changeInfoItems)
|
|
|
certFile, _ := json.Marshal(allCertFileList)
|
|
certFile, _ := json.Marshal(allCertFileList)
|
|
|
|
|
+ var infoChangeBaseInfo SupplierInfoChangeBaseInfo
|
|
|
|
|
+ infoChangeBaseInfo.BaseInfo = supplierEntity
|
|
|
|
|
+ infoChangeBaseInfo.ChangeItems = changeInfoItems
|
|
|
|
|
+ baseInfo, _ := json.Marshal(infoChangeBaseInfo)
|
|
|
|
|
|
|
|
// 插入日志信息
|
|
// 插入日志信息
|
|
|
var model OilSupplierLog
|
|
var model OilSupplierLog
|
|
@@ -300,7 +340,7 @@ func (s *SupplierlogService) SaveSupplierLogForInfoChange(supplierId int, infoCh
|
|
|
model.NewSupplierName = supplierEntity.SupplierName
|
|
model.NewSupplierName = supplierEntity.SupplierName
|
|
|
model.NewCommercialNo = supplierEntity.CommercialNo
|
|
model.NewCommercialNo = supplierEntity.CommercialNo
|
|
|
model.OperType = 4
|
|
model.OperType = 4
|
|
|
- model.BaseInfo = string(supplierBaseInfo) + "&" + string(supplierBaseInfoChangeItem)
|
|
|
|
|
|
|
+ model.BaseInfo = string(baseInfo)
|
|
|
model.CertFile = string(certFile)
|
|
model.CertFile = string(certFile)
|
|
|
model.CreateOn = time.Now()
|
|
model.CreateOn = time.Now()
|
|
|
_, err := s.InsertEntity(&model)
|
|
_, err := s.InsertEntity(&model)
|