|
|
@@ -1,9 +1,9 @@
|
|
|
package oilsupplier
|
|
|
|
|
|
import (
|
|
|
- msg2 "dashoo.cn/backend/api/business/msg"
|
|
|
"dashoo.cn/backend/api/business/audithistory"
|
|
|
"dashoo.cn/backend/api/business/baseUser"
|
|
|
+ msg2 "dashoo.cn/backend/api/business/msg"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/infochange"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
|
|
|
"dashoo.cn/backend/api/business/organize"
|
|
|
@@ -296,6 +296,38 @@ func (this *AnnualAuditController) GetEntity() {
|
|
|
this.ServeJSON()
|
|
|
}
|
|
|
|
|
|
+// @Title 获取公司信息
|
|
|
+// @Description 根据创建用户Id和增项类别号获取公司信息
|
|
|
+// @Success 200 {object}
|
|
|
+// @router /getsupplier [get]
|
|
|
+func (this *AnnualAuditController) GetSupplier() {
|
|
|
+ SuppTypeCode := this.GetString("SuppTypeCode")
|
|
|
+ svc := annualaudit.GetOilAnnualAuditService(utils.DBE)
|
|
|
+ where := "1=1 "
|
|
|
+ if SuppTypeCode != "" {
|
|
|
+ where = " WHERE b.Id is NOT NULL AND a.SupplierTypeCode = '" + SuppTypeCode + "' and (a.InFlag='1' or a.InFlag='2')"
|
|
|
+ }else {
|
|
|
+ where = " WHERE b.Id is NOT NULL AND (a.InFlag='1' or a.InFlag='2')"
|
|
|
+ }
|
|
|
+ var registerUser register.OilCorporateInfo
|
|
|
+ sql := " UserName='" + this.User.Username + "'"
|
|
|
+ svc.GetEntity(®isterUser,sql)
|
|
|
+ //企业用户必须加创建人条件
|
|
|
+ if this.User.IsCompanyUser == 1 {
|
|
|
+ where = where + " and (b.CreateUserId = '" + this.User.Id + "' or b.CommercialNo='"+registerUser.CommercialNo+"')"
|
|
|
+ //if this.User.IsCompanyUser == 1 {
|
|
|
+ // where = where + " and b.CreateUserId = '" + this.User.Id + "'"
|
|
|
+ }
|
|
|
+
|
|
|
+ sqlStr := "SELECT b.Id AS SupplierId, a.Id AS SupplierCertId, b.SupplierName AS SupplierName FROM OilSupplierCert AS a LEFT JOIN OilSupplier AS b ON a.SupplierId = b.Id "
|
|
|
+ sqlStr = sqlStr + where
|
|
|
+
|
|
|
+ model, _ := svc.DBE.QueryString(sqlStr)
|
|
|
+
|
|
|
+ this.Data["json"] = &model
|
|
|
+ this.ServeJSON()
|
|
|
+}
|
|
|
+
|
|
|
// @Title 添加
|
|
|
// @Description 直接新增年审
|
|
|
// @Success 200 {object} controllers.Request
|