|
|
@@ -317,18 +317,23 @@ func (this *OilSupplierCertSubController) AddBusiness() {
|
|
|
needList := filesvc.GetTechNeedFileList(model.SubClassId)
|
|
|
|
|
|
if err == nil {
|
|
|
- var list []suppliercertsub.OilSupplierCertSub
|
|
|
+ var list []supplierfile.OilSupplierFile
|
|
|
where := "SupplierId = '" + strconv.Itoa(model.SupplierId) + "'"
|
|
|
- where += " and SupplierCertId = '" + strconv.Itoa(model.SupplierCertId) + "'"
|
|
|
- svc.GetEntitysByWhere(OilSupplierCertSubName, where, &list)
|
|
|
+ //where += " and SupplierCertId = '" + strconv.Itoa(model.SupplierCertId) + "'"
|
|
|
+ svc.GetEntitysByWhere(OilSupplierFileName, where, &list)
|
|
|
|
|
|
- if len(list) == 1 { //第一次添加准入项,将共有必备资质写入文件表
|
|
|
+ if len(list) == 0 { //第一次添加准入项,将共有必备资质写入文件表
|
|
|
for i := 0; i < len(needList); i++ {
|
|
|
var entity supplierfile.OilSupplierFile
|
|
|
entity.SupplierId = model.SupplierId
|
|
|
- entity.SupplierTypeCode = model.SupplierTypeCode
|
|
|
+ if i < 4 {
|
|
|
+ entity.SupplierTypeCode = "000"
|
|
|
+ } else {
|
|
|
+ entity.SupplierTypeCode = model.SupplierTypeCode
|
|
|
+ }
|
|
|
entity.NeedFileType = needList[i].FileName
|
|
|
entity.FileType = 1
|
|
|
+ entity.EffectDate = time.Now()
|
|
|
entity.CreateBy = this.User.Realname
|
|
|
entity.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
svc.InsertEntityBytbl(OilSupplierFileName, &entity)
|
|
|
@@ -341,6 +346,7 @@ func (this *OilSupplierCertSubController) AddBusiness() {
|
|
|
entity.SupplierTypeCode = model.SupplierTypeCode
|
|
|
entity.NeedFileType = needList[i].FileName
|
|
|
entity.FileType = 1
|
|
|
+ entity.EffectDate = time.Now()
|
|
|
entity.CreateBy = this.User.Realname
|
|
|
entity.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
svc.InsertEntityBytbl(OilSupplierFileName, &entity)
|