|
|
@@ -399,7 +399,7 @@ func (this *OilSupplierCertSubController) AddGoodsBus() {
|
|
|
}
|
|
|
|
|
|
var list []supplierfile.OilSupplierFile
|
|
|
- where := "SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
|
|
|
+ where := "SupplierTypeCode in (01,000) and SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
|
|
|
svc.GetEntitysByWhere(OilSupplierFileName, where, &list)
|
|
|
|
|
|
//三证合一或五证合一不需要的字段
|
|
|
@@ -513,7 +513,7 @@ func (this *OilSupplierCertSubController) AddTechBus() {
|
|
|
}
|
|
|
|
|
|
var list []supplierfile.OilSupplierFile
|
|
|
- where := "SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
|
|
|
+ where := "SupplierTypeCode in (03,000) and SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
|
|
|
svc.GetEntitysByWhere(OilSupplierFileName, where, &list)
|
|
|
|
|
|
//三证合一或五证合一不需要的字段
|
|
|
@@ -590,8 +590,13 @@ func (this *OilSupplierCertSubController) AddBusiness() {
|
|
|
where_certsub := " SupplierCertId = " + utils.ToStr(model.SupplierCertId) + " and SupplierTypeCode = 02"
|
|
|
where_certsub += " and SubClassId = '" + utils.ToStr(model.SubClassId) + "'"
|
|
|
has := svc.GetEntityByWhere(OilSupplierCertSubName, where_certsub, &submodel)
|
|
|
+ unitsvc := organize.GetOrganizeService(utils.DBE)
|
|
|
+ unitid := unitsvc.GetMyUnitDepartmentId(this.User.DepartmentId)
|
|
|
if !has {
|
|
|
//添加到准入分类表中
|
|
|
+ if unitid == "100000095" {
|
|
|
+ model.CertSubStatus = "1"
|
|
|
+ }
|
|
|
_, err = svc.InsertEntityBytbl(OilSupplierCertSubName, &model)
|
|
|
} else {
|
|
|
model.Id = submodel.Id
|
|
|
@@ -625,7 +630,7 @@ func (this *OilSupplierCertSubController) AddBusiness() {
|
|
|
|
|
|
if err == nil {
|
|
|
var list []supplierfile.OilSupplierFile
|
|
|
- where := "SupplierId = '" + strconv.Itoa(model.SupplierId) + "'"
|
|
|
+ where := "SupplierTypeCode in (02,000) and SupplierId = '" + strconv.Itoa(model.SupplierId) + "'"
|
|
|
svc.GetEntitysByWhere(OilSupplierFileName, where, &list)
|
|
|
|
|
|
//三证合一或五证合一不需要的字段
|
|
|
@@ -718,7 +723,7 @@ func (this *OilSupplierCertSubController) BusinessDelete() {
|
|
|
|
|
|
//
|
|
|
var CertSublList []suppliercertsub.OilSupplierCertSub
|
|
|
- where := "SupplierId=" + SupplierId + " and Id not in (" + Id + ")" // 没有删除的准入范围
|
|
|
+ where := "SupplierId=" + SupplierId + " and Id not in (" + Id + ") and SupplierTypeCode ="+ SupplierTypeCode// 没有删除的准入范围
|
|
|
svc.GetEntities(&CertSublList, where)
|
|
|
SubClassIds := ""
|
|
|
for _, CertSub := range CertSublList {
|
|
|
@@ -740,6 +745,7 @@ func (this *OilSupplierCertSubController) BusinessDelete() {
|
|
|
for _, CertSub := range SurplusList {
|
|
|
fileNames += CertSub.FileName + ","
|
|
|
}
|
|
|
+ fileNames = strings.Trim(fileNames, ",")
|
|
|
fmt.Println(fileNames)
|
|
|
for i := 0; i < len(Ids); i++ {
|
|
|
var datamain suppliercertsub.OilSupplierCertSub //创建OilSupplierCertSub结构体(映射用)
|
|
|
@@ -780,7 +786,7 @@ func (this *OilSupplierCertSubController) BusinessDelete() {
|
|
|
if flag == 0 && strings.Contains(fileNames, needList[j].FileName+",") {
|
|
|
continue
|
|
|
}
|
|
|
- where := " SupplierId= '" + strconv.Itoa(datamain.SupplierId) + "' and NeedFileType='" + needList[j].FileName + "'" //拼接删除sql
|
|
|
+ where := " SupplierId= '" + strconv.Itoa(datamain.SupplierId) + "' and SupplierTypeCode ="+ SupplierTypeCode + " and NeedFileType='" + needList[j].FileName + "'" //拼接删除sql
|
|
|
err := svc.DeleteEntityBytbl(OilSupplierFileName, where) //删除第j条资质数据
|
|
|
if err == nil {
|
|
|
errinfo.Message = "删除成功"
|
|
|
@@ -794,7 +800,7 @@ func (this *OilSupplierCertSubController) BusinessDelete() {
|
|
|
this.ServeJSON()
|
|
|
}
|
|
|
}
|
|
|
- where = " SupplierId=" + strconv.Itoa(datamain.SupplierId) + " and SubClassId=" + strconv.Itoa(subClassId)
|
|
|
+ where = " SupplierId=" + strconv.Itoa(datamain.SupplierId) + " and SupplierTypeCode ="+ SupplierTypeCode +" and SubClassId=" + strconv.Itoa(subClassId)
|
|
|
err1 := svc.DeleteEntityBytbl(OilSupplierCert2FileName, where)
|
|
|
if err1 == nil {
|
|
|
errinfo.Message = "删除成功"
|
|
|
@@ -807,7 +813,7 @@ func (this *OilSupplierCertSubController) BusinessDelete() {
|
|
|
this.Data["json"] = &errinfo
|
|
|
this.ServeJSON()
|
|
|
}
|
|
|
- where = " Id= " + Ids[i]
|
|
|
+ where = " Id= " + Ids[i]+" and SupplierTypeCode ="+ SupplierTypeCode
|
|
|
err2 := svc.DeleteEntityBytbl(OilSupplierCertSubName, where) //删除OilSupplierCertSub单条准入范围
|
|
|
if err2 == nil {
|
|
|
errinfo.Message = "删除成功"
|