2
3
Prechádzať zdrojové kódy

后端: 年审申请添加资质接口,优化检查判断资质已存在的条件

baichengfei 4 rokov pred
rodič
commit
4c59a75b9d

+ 11 - 3
src/dashoo.cn/backend/api/controllers/oilsupplier/annualaudit.go

@@ -1682,8 +1682,8 @@ func (this *AnnualAuditController) FileList() {
 	this.ServeJSON()
 }
 
-// @Title 添加资金
-// @Description 添加资金
+// @Title 年审申请添加资质
+// @Description 年审申请添加资质
 // @Success	200	{object}
 // @router /addqualchange/:id [post]
 func (this *AnnualAuditController) AddQualChange() {
@@ -1703,7 +1703,7 @@ func (this *AnnualAuditController) AddQualChange() {
 	svc := qualchange.GetQualChangeService(utils.DBE)
 
 	var supplierfile supplierfile.OilSupplierFile
-	where := "SupplierId = '" + strconv.Itoa(model.SupplierId) + "' and NeedFileType='" + model.NeedFileType + "'"
+	where := "SupplierId = '" + strconv.Itoa(model.SupplierId) + "' and NeedFileType='" + model.NeedFileType + "'  and a.SupplierTypeCode in ( '000', '" + model.SupplierTypeCode + "')"
 	has := svc.GetEntity(&supplierfile, where)
 
 	var tableHeader tableheader.BaseTableheader
@@ -1956,6 +1956,14 @@ func (this *AnnualAuditController) AddAppChange() {
 	var jsonblob = this.Ctx.Input.RequestBody
 	json.Unmarshal(jsonblob, &model)
 
+	if strings.ReplaceAll(model.FileUrl, " ", "") == "" {
+		errinfo.Message = "资质文件地址错误,请重新上传!"
+		errinfo.Code = -1
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+
 	svc := qualchange.GetQualChangeService(utils.DBE)
 
 	var file supplierfile.OilSupplierFile