|
|
@@ -453,17 +453,17 @@ func (this *OilSupplierCertSubController) AddGoodsByFilter() {
|
|
|
// 查询出已有哪些资质
|
|
|
supplierId := dataother.SupplierId
|
|
|
supplierTypeCode := dataother.SupplierTypeCode
|
|
|
- var tableheaderList []tableheader.BaseTableheader
|
|
|
+ var tableheaderList []supplierfile.OilSupplierFile
|
|
|
|
|
|
- fileSql := "SELECT b.* from OilSupplierFile a LEFT JOIN Base_TableHeader b on a.NeedFileType=b.Name AND "
|
|
|
- fileSql += " a.SupplierTypeCode=b.CategoryCode WHERE a.SupplierId='" + strconv.Itoa(supplierId) + "'"
|
|
|
- fileSql += " AND (a.SupplierTypeCode='" + supplierTypeCode + "' or a.SupplierTypeCode='000')"
|
|
|
+ fileSql := "SELECT * from OilSupplierFile WHERE SupplierId='" + strconv.Itoa(supplierId) + "'"
|
|
|
+ fileSql += " AND (SupplierTypeCode='" + supplierTypeCode + "' or SupplierTypeCode='000')"
|
|
|
|
|
|
svcHeader := tableheader.GetTableHeaderService(utils.DBE)
|
|
|
svcHeader.DBE.SQL(fileSql).Find(&tableheaderList)
|
|
|
+
|
|
|
var companyHasHeaders string
|
|
|
for _, tableheader := range tableheaderList {
|
|
|
- companyHasHeaders += tableheader.Name + ","
|
|
|
+ companyHasHeaders += tableheader.NeedFileType + ","
|
|
|
}
|
|
|
var supplierModel supplier.OilSupplier
|
|
|
svcSupplier := supplier.GetOilSupplierService(utils.DBE)
|
|
|
@@ -1061,16 +1061,29 @@ func (this *OilSupplierCertSubController) UpdateStatus() {
|
|
|
// @Description
|
|
|
// @router /modify-manufacturer/:id [post]
|
|
|
func (this *OilSupplierCertSubController) SetManufacturer() {
|
|
|
- certSubId, error := strconv.Atoi(this.Ctx.Input.Param(":id"))
|
|
|
+ // certSubId, error := strconv.Atoi(this.Ctx.Input.Param(":id"))
|
|
|
+ certSubId := this.Ctx.Input.Param(":id")
|
|
|
|
|
|
var manufacturerChangeDTO suppliercertsub.ManufacturerChangeDTO
|
|
|
var jsonblob = this.Ctx.Input.RequestBody
|
|
|
json.Unmarshal(jsonblob, &manufacturerChangeDTO)
|
|
|
|
|
|
+ /**
|
|
|
manufacturerChangeDTO.CertSubIdList = [] int{certSubId}
|
|
|
invalidCertMsg := setManufacturerHandler(manufacturerChangeDTO)
|
|
|
+ */
|
|
|
+ svc := suppliercertsub.GetOilSupplierCertSubService(utils.DBE)
|
|
|
+ strIsManufacturer := strconv.Itoa(manufacturerChangeDTO.IsManufacturer)
|
|
|
+ sqlStr := "update OilSupplierCertSub set IsManufacturer='" + strIsManufacturer + "' where Id='" + certSubId + "'"
|
|
|
+ svc.DBE.Exec(sqlStr)
|
|
|
|
|
|
var errinfo ErrorDataInfo
|
|
|
+ errinfo.Message = "修改成功!"
|
|
|
+ errinfo.Code = 0
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+
|
|
|
+ /*var errinfo ErrorDataInfo
|
|
|
if error == nil && invalidCertMsg == "" {
|
|
|
errinfo.Message = "修改成功!"
|
|
|
errinfo.Code = 0
|
|
|
@@ -1081,7 +1094,7 @@ func (this *OilSupplierCertSubController) SetManufacturer() {
|
|
|
errinfo.Code = -1
|
|
|
this.Data["json"] = &errinfo
|
|
|
this.ServeJSON()
|
|
|
- }
|
|
|
+ }*/
|
|
|
}
|
|
|
|
|
|
// @Title 批量修改是否为供应商
|