|
|
@@ -363,6 +363,7 @@ func (this *OilSupplierCertSubController) AddGoodsBus() {
|
|
|
svcSupplier := supplier.GetOilSupplierService(utils.DBE)
|
|
|
svcSupplier.GetEntityById(datamain.SupplierId, &supplierModel)
|
|
|
|
|
|
+ LABEL1:
|
|
|
for n := 0; n < len(dataother.CheckList); n++ {
|
|
|
where_sub := "SupplierTypeCode = 01 and SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
|
|
|
where_sub += " and SupplierCertId = '" + strconv.Itoa(dataother.SupplierCertId) + "'"
|
|
|
@@ -372,6 +373,11 @@ func (this *OilSupplierCertSubController) AddGoodsBus() {
|
|
|
has := svc.GetEntityByWhere(OilSupplierCertSubName, where_sub, &model)
|
|
|
|
|
|
if !has {
|
|
|
+ if supplierModel.OperType == "制造商" {
|
|
|
+ datamain.IsManufacturer = 1
|
|
|
+ } else {
|
|
|
+ datamain.IsManufacturer = 2
|
|
|
+ }
|
|
|
datamain.SubClassId, _ = utils.StrTo(dataother.CheckList[n].Id).Int()
|
|
|
datamain.Code = dataother.CheckList[n].Code
|
|
|
datamain.Name = dataother.CheckList[n].Name
|
|
|
@@ -382,14 +388,32 @@ func (this *OilSupplierCertSubController) AddGoodsBus() {
|
|
|
datamain.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
unitsvc := organize.GetOrganizeService(utils.DBE)
|
|
|
unitid := unitsvc.GetMyUnitDepartmentId(this.User.DepartmentId)
|
|
|
- if unitid == "100000095" {
|
|
|
+ if unitid == "100000095" { // 100000095 企管法规处(内控与风险管理处)
|
|
|
datamain.CertSubStatus = "1"
|
|
|
}
|
|
|
- svc.InsertEntityBytbl(OilSupplierCertSubName, &datamain)
|
|
|
|
|
|
- paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
|
|
|
filesvc := supplierfile.GetSupplierfileService(utils.DBE)
|
|
|
- needList := filesvc.GetGoodsNeedFileList(dataother.CheckList[n].Id, "2")
|
|
|
+ needList := filesvc.GetGoodsNeedFileList(dataother.CheckList[n].Id, strconv.Itoa(datamain.IsManufacturer)) // 需要的资质
|
|
|
+ paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
|
|
|
+
|
|
|
+ //isContinue := false
|
|
|
+ if datamain.IsManufacturer == 2 {
|
|
|
+ needList1 := filesvc.GetGoodsNeedFileList(dataother.CheckList[n].Id, "1") // 需要的资质--制造类
|
|
|
+ // 中油集团公司产品质量认可证书
|
|
|
+ CNPCrenkezhengshu := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "CNPCrenkezhengshu")
|
|
|
+ for _, item := range needList1 {
|
|
|
+ if item.FileName == CNPCrenkezhengshu {
|
|
|
+ continue LABEL1
|
|
|
+ //isContinue = true
|
|
|
+ //break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //if isContinue {
|
|
|
+ // break
|
|
|
+ //}
|
|
|
+ svc.InsertEntityBytbl(OilSupplierCertSubName, &datamain)
|
|
|
+
|
|
|
if supplierCertModel.InStyle == "4" {
|
|
|
var needFile supplierfile.FileList
|
|
|
//战略合作协议扫描件
|
|
|
@@ -397,15 +421,16 @@ func (this *OilSupplierCertSubController) AddGoodsBus() {
|
|
|
needList = append(needList, needFile)
|
|
|
}
|
|
|
|
|
|
- var list []supplierfile.OilSupplierFile
|
|
|
+ var Havelist []supplierfile.OilSupplierFile // 已经有的资质
|
|
|
where := "SupplierTypeCode in (01,000) and IsManuf in ('0','2', '') and SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
|
|
|
- svc.GetEntitysByWhere(OilSupplierFileName, where, &list)
|
|
|
+ svc.GetEntitysByWhere(OilSupplierFileName, where, &Havelist)
|
|
|
|
|
|
//三证合一或五证合一不需要的字段
|
|
|
mergerCertSkipField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MergerCertSkipFieldName")
|
|
|
//"营业执照,组织代码,组织机构代码证,税务登记证,税务登记,开户许可,银行开户许可证,承诺书,诚信合规承诺书,企业信息系统截图,战略合作协议扫描件,"
|
|
|
mustField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MustFieldName")
|
|
|
|
|
|
+
|
|
|
for i := 0; i < len(needList); i++ {
|
|
|
var entity supplierfile.OilSupplierFile
|
|
|
entity.SupplierId = dataother.SupplierId
|
|
|
@@ -418,7 +443,7 @@ func (this *OilSupplierCertSubController) AddGoodsBus() {
|
|
|
cert2File.SupplierId = dataother.SupplierId
|
|
|
cert2File.SupplierCertId = dataother.SupplierCertId
|
|
|
cert2File.SupplierTypeCode = dataother.SupplierTypeCode
|
|
|
- cert2File.IsManuf = "2"
|
|
|
+ cert2File.IsManuf = strconv.Itoa(datamain.IsManufacturer)
|
|
|
cert2File.SubClassId, _ = utils.StrTo(dataother.CheckList[n].Id).Int()
|
|
|
cert2File.Code = dataother.CheckList[n].Code
|
|
|
cert2File.Name = dataother.CheckList[n].Name
|
|
|
@@ -430,7 +455,7 @@ func (this *OilSupplierCertSubController) AddGoodsBus() {
|
|
|
entity.IsManuf = "0"
|
|
|
} else {
|
|
|
entity.SupplierTypeCode = dataother.SupplierTypeCode
|
|
|
- entity.IsManuf = "2"
|
|
|
+ entity.IsManuf = strconv.Itoa(datamain.IsManufacturer)
|
|
|
}
|
|
|
entity.NeedFileType = needList[i].FileName
|
|
|
entity.FileType = 1
|
|
|
@@ -440,8 +465,8 @@ func (this *OilSupplierCertSubController) AddGoodsBus() {
|
|
|
entity.SupType = 1
|
|
|
|
|
|
isRepeat := false
|
|
|
- for j := 0; j < len(list); j++ {
|
|
|
- if list[j].NeedFileType == needList[i].FileName {
|
|
|
+ for j := 0; j < len(Havelist); j++ {
|
|
|
+ if Havelist[j].NeedFileType == needList[i].FileName {
|
|
|
isRepeat = true
|
|
|
break
|
|
|
}
|
|
|
@@ -1125,6 +1150,7 @@ func (this *OilSupplierCertSubController) UpdateManufacturer() {
|
|
|
_, error = svc.DBE.Exec("update " + OilSupplierCertSubName + " set IsManufacturer =1 where Id=" + Id + "")
|
|
|
} else if IsManufacturer == "1" {
|
|
|
var errinfo ErrorInfo
|
|
|
+
|
|
|
//根据Id查出OilSupplierCertSub的SubClassId
|
|
|
filesvc := supplierfile.GetSupplierfileService(utils.DBE)
|
|
|
paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
|
|
|
@@ -1172,6 +1198,17 @@ func (this *OilSupplierCertSubController) UpdateManufacturer() {
|
|
|
var needList []supplierfile.FileList //定义存储所拥有资质名称的数组
|
|
|
needList = filesvc.GetGoodsNeedFileList(strconv.Itoa(subClassId), IsManufacturer) //通过准入范围Id获得资质名称并填充数组
|
|
|
|
|
|
+ CNPCrenkezhengshu := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "CNPCrenkezhengshu")
|
|
|
+ for _, item := range needList {
|
|
|
+ if CNPCrenkezhengshu == item.FileName {
|
|
|
+ errinfo.Message = "该准入项不能修改为非制造类!"
|
|
|
+ errinfo.Code = -2
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
var mustField string
|
|
|
mustField = paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MustFieldName") //必需的资质
|
|
|
|