|
@@ -4,6 +4,7 @@ import (
|
|
|
"dashoo.cn/backend/api/business/auditsetting"
|
|
"dashoo.cn/backend/api/business/auditsetting"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/infochange"
|
|
"dashoo.cn/backend/api/business/oilsupplier/infochange"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
|
|
"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
|
|
|
|
|
+ "dashoo.cn/business2/permission"
|
|
|
"dashoo.cn/business2/userRole"
|
|
"dashoo.cn/business2/userRole"
|
|
|
"encoding/json"
|
|
"encoding/json"
|
|
|
"fmt"
|
|
"fmt"
|
|
@@ -22,6 +23,14 @@ type InfoChangeController struct {
|
|
|
BaseController
|
|
BaseController
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+type InfoShenHeModel struct {
|
|
|
|
|
+ InfoId int
|
|
|
|
|
+ SuccessStatus int
|
|
|
|
|
+ AuditorRemark string
|
|
|
|
|
+ Auditer int
|
|
|
|
|
+ SuppId int
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// @Title 获取实体
|
|
// @Title 获取实体
|
|
|
// @Description 获取实体
|
|
// @Description 获取实体
|
|
|
// @Success 200 {object} annualaudit.OilAnnualAudit
|
|
// @Success 200 {object} annualaudit.OilAnnualAudit
|
|
@@ -30,14 +39,329 @@ func (this *InfoChangeController) GetEntity() {
|
|
|
CertId := this.Ctx.Input.Param(":id")
|
|
CertId := this.Ctx.Input.Param(":id")
|
|
|
var model []infochange.OilInfoChangeItem
|
|
var model []infochange.OilInfoChangeItem
|
|
|
svc := infochange.GetInfoChangeService(utils.DBE)
|
|
svc := infochange.GetInfoChangeService(utils.DBE)
|
|
|
- where := " SupplierId = "+CertId
|
|
|
|
|
- svc.GetEntitysByWhere(OilInfoChangeItemName,where,&model)
|
|
|
|
|
|
|
+ where := " SupplierId = " + CertId
|
|
|
|
|
+ svc.GetEntitysByWhere(OilInfoChangeItemName, where, &model)
|
|
|
|
|
+ var datainfo DataInfo
|
|
|
|
|
+ datainfo.Items = model
|
|
|
|
|
+ this.Data["json"] = &datainfo
|
|
|
|
|
+ this.ServeJSON()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// @Title 获取实体
|
|
|
|
|
+// @Description 获取实体
|
|
|
|
|
+// @Success 200 {object} annualaudit.OilAnnualAudit
|
|
|
|
|
+// @router /auditget/:id [get]
|
|
|
|
|
+func (this *InfoChangeController) GetEntityThen() {
|
|
|
|
|
+ InfoId := this.Ctx.Input.Param(":id")
|
|
|
|
|
+ var model []infochange.OilInfoChangeItem
|
|
|
|
|
+ svc := infochange.GetInfoChangeService(utils.DBE)
|
|
|
|
|
+ where := " InfoId = " + InfoId
|
|
|
|
|
+ svc.GetEntitysByWhere(OilInfoChangeItemName, where, &model)
|
|
|
var datainfo DataInfo
|
|
var datainfo DataInfo
|
|
|
datainfo.Items = model
|
|
datainfo.Items = model
|
|
|
this.Data["json"] = &datainfo
|
|
this.Data["json"] = &datainfo
|
|
|
this.ServeJSON()
|
|
this.ServeJSON()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// @Title 获取列表
|
|
|
|
|
+// @Description get user by token
|
|
|
|
|
+// @Success 200 {object} []supplier.OilSupplier
|
|
|
|
|
+// @router /supplist [get]
|
|
|
|
|
+func (this *InfoChangeController) GetSuppList() {
|
|
|
|
|
+
|
|
|
|
|
+ //获取分页信息
|
|
|
|
|
+ page := this.GetPageInfoForm()
|
|
|
|
|
+ where := " 1=1 "
|
|
|
|
|
+ orderby := "Id"
|
|
|
|
|
+ asc := false
|
|
|
|
|
+ Order := this.GetString("Order")
|
|
|
|
|
+ Prop := this.GetString("Prop")
|
|
|
|
|
+ if Order != "" && Prop != "" {
|
|
|
|
|
+ orderby = Prop
|
|
|
|
|
+ if Order == "asc" {
|
|
|
|
|
+ asc = true
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ SupplierName := this.GetString("SupplierName")
|
|
|
|
|
+ OilCertificateNo := this.GetString("OilCertificateNo")
|
|
|
|
|
+ Grade := this.GetString("Grade")
|
|
|
|
|
+ MgrUnit := this.GetString("MgrUnit")
|
|
|
|
|
+ OperType := this.GetString("OperType")
|
|
|
|
|
+ Country := this.GetString("Country")
|
|
|
|
|
+ MaunAgent := this.GetString("MaunAgent")
|
|
|
|
|
+ ConstructTeam := this.GetString("ConstructTeam")
|
|
|
|
|
+ CommercialNo := this.GetString("CommercialNo")
|
|
|
|
|
+ OrganCode := this.GetString("OrganCode")
|
|
|
|
|
+ CountryTaxNo := this.GetString("CountryTaxNo")
|
|
|
|
|
+ LocalTaxNo := this.GetString("LocalTaxNo")
|
|
|
|
|
+ Address := this.GetString("Address")
|
|
|
|
|
+ Province := this.GetString("Province")
|
|
|
|
|
+ City := this.GetString("City")
|
|
|
|
|
+ Street := this.GetString("Street")
|
|
|
|
|
+ HouseNo := this.GetString("HouseNo")
|
|
|
|
|
+ ZipCode := this.GetString("ZipCode")
|
|
|
|
|
+ QualitySystemCert := this.GetString("QualitySystemCert")
|
|
|
|
|
+ ProductQualityCert := this.GetString("ProductQualityCert")
|
|
|
|
|
+ MaunLicense := this.GetString("MaunLicense")
|
|
|
|
|
+ QualifCert := this.GetString("QualifCert")
|
|
|
|
|
+ QualifCertLevel := this.GetString("QualifCertLevel")
|
|
|
|
|
+ SafetyLicense := this.GetString("SafetyLicense")
|
|
|
|
|
+ TechServiceLic := this.GetString("TechServiceLic")
|
|
|
|
|
+ TJInNotify := this.GetString("TJInNotify")
|
|
|
|
|
+ SpecIndustryCert := this.GetString("SpecIndustryCert")
|
|
|
|
|
+ LegalPerson := this.GetString("LegalPerson")
|
|
|
|
|
+ CategoryCode := this.GetString("CategoryCode")
|
|
|
|
|
+ CategoryName := this.GetString("CategoryName")
|
|
|
|
|
+ RegCapital := this.GetString("RegCapital")
|
|
|
|
|
+ Currency := this.GetString("Currency")
|
|
|
|
|
+ ContactName := this.GetString("ContactName")
|
|
|
|
|
+ CompanyType := this.GetString("CompanyType")
|
|
|
|
|
+ SetupTime := this.GetString("SetupTime")
|
|
|
|
|
+ DepositBank := this.GetString("DepositBank")
|
|
|
|
|
+ BankAccount := this.GetString("BankAccount")
|
|
|
|
|
+ EMail := this.GetString("EMail")
|
|
|
|
|
+ BankCreditRating := this.GetString("BankCreditRating")
|
|
|
|
|
+ Mobile := this.GetString("Mobile")
|
|
|
|
|
+ Telphone := this.GetString("Telphone")
|
|
|
|
|
+ Fax := this.GetString("Fax")
|
|
|
|
|
+ CompanyTel := this.GetString("CompanyTel")
|
|
|
|
|
+ QQ := this.GetString("QQ")
|
|
|
|
|
+ CompanyUrl := this.GetString("CompanyUrl")
|
|
|
|
|
+ SpecSupplier := this.GetString("SpecSupplier")
|
|
|
|
|
+ SpecTypeCode := this.GetString("SpecTypeCode")
|
|
|
|
|
+ SpecTypeName := this.GetString("SpecTypeName")
|
|
|
|
|
+ Remark := this.GetString("Remark")
|
|
|
|
|
+ CreateOn := this.GetString("CreateOn")
|
|
|
|
|
+
|
|
|
|
|
+ if SupplierName != "" {
|
|
|
|
|
+ where = where + " and a.SupplierName like '%" + SupplierName + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if OilCertificateNo != "" {
|
|
|
|
|
+ where = where + " and a.OilCertificateNo like '%" + OilCertificateNo + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if Grade != "" {
|
|
|
|
|
+ where = where + " and a.Grade like '%" + Grade + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if MgrUnit != "" {
|
|
|
|
|
+ where = where + " and a.MgrUnit like '%" + MgrUnit + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if OperType != "" {
|
|
|
|
|
+ where = where + " and a.OperType like '%" + OperType + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if Country != "" {
|
|
|
|
|
+ where = where + " and a.Country like '%" + Country + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if MaunAgent != "" {
|
|
|
|
|
+ where = where + " and a.MaunAgent like '%" + MaunAgent + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ConstructTeam != "" {
|
|
|
|
|
+ where = where + " and a.ConstructTeam like '%" + ConstructTeam + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if CommercialNo != "" {
|
|
|
|
|
+ where = where + " and a.CommercialNo like '%" + CommercialNo + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if OrganCode != "" {
|
|
|
|
|
+ where = where + " and a.OrganCode like '%" + OrganCode + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if CountryTaxNo != "" {
|
|
|
|
|
+ where = where + " and a.CountryTaxNo like '%" + CountryTaxNo + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if LocalTaxNo != "" {
|
|
|
|
|
+ where = where + " and a.LocalTaxNo like '%" + LocalTaxNo + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if Address != "" {
|
|
|
|
|
+ where = where + " and a.Address like '%" + Address + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if Province != "" {
|
|
|
|
|
+ where = where + " and a.Province like '%" + Province + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if City != "" {
|
|
|
|
|
+ where = where + " and a.City like '%" + City + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if Street != "" {
|
|
|
|
|
+ where = where + " and a.Street like '%" + Street + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if HouseNo != "" {
|
|
|
|
|
+ where = where + " and a.HouseNo like '%" + HouseNo + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ZipCode != "" {
|
|
|
|
|
+ where = where + " and a.ZipCode like '%" + ZipCode + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if QualitySystemCert != "" {
|
|
|
|
|
+ where = where + " and a.QualitySystemCert like '%" + QualitySystemCert + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ProductQualityCert != "" {
|
|
|
|
|
+ where = where + " and a.ProductQualityCert like '%" + ProductQualityCert + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if MaunLicense != "" {
|
|
|
|
|
+ where = where + " and a.MaunLicense like '%" + MaunLicense + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if QualifCert != "" {
|
|
|
|
|
+ where = where + " and a.QualifCert like '%" + QualifCert + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if QualifCertLevel != "" {
|
|
|
|
|
+ where = where + " and a.QualifCertLevel like '%" + QualifCertLevel + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if SafetyLicense != "" {
|
|
|
|
|
+ where = where + " and a.SafetyLicense like '%" + SafetyLicense + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if TechServiceLic != "" {
|
|
|
|
|
+ where = where + " and a.TechServiceLic like '%" + TechServiceLic + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if TJInNotify != "" {
|
|
|
|
|
+ where = where + " and a.TJInNotify like '%" + TJInNotify + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if SpecIndustryCert != "" {
|
|
|
|
|
+ where = where + " and a.SpecIndustryCert like '%" + SpecIndustryCert + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if LegalPerson != "" {
|
|
|
|
|
+ where = where + " and a.LegalPerson like '%" + LegalPerson + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if CategoryCode != "" {
|
|
|
|
|
+ where = where + " and a.CategoryCode like '%" + CategoryCode + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if CategoryName != "" {
|
|
|
|
|
+ where = where + " and a.CategoryName like '%" + CategoryName + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if RegCapital != "" {
|
|
|
|
|
+ where = where + " and a.RegCapital like '%" + RegCapital + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if Currency != "" {
|
|
|
|
|
+ where = where + " and a.Currency like '%" + Currency + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ContactName != "" {
|
|
|
|
|
+ where = where + " and a.ContactName like '%" + ContactName + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if CompanyType != "" {
|
|
|
|
|
+ where = where + " and a.CompanyType like '%" + CompanyType + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if SetupTime != "" {
|
|
|
|
|
+ where = where + " and a.SetupTime like '%" + SetupTime + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if DepositBank != "" {
|
|
|
|
|
+ where = where + " and a.DepositBank like '%" + DepositBank + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if BankAccount != "" {
|
|
|
|
|
+ where = where + " and a.BankAccount like '%" + BankAccount + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if EMail != "" {
|
|
|
|
|
+ where = where + " and a.EMail like '%" + EMail + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if BankCreditRating != "" {
|
|
|
|
|
+ where = where + " and a.BankCreditRating like '%" + BankCreditRating + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if Mobile != "" {
|
|
|
|
|
+ where = where + " and a.Mobile like '%" + Mobile + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if Telphone != "" {
|
|
|
|
|
+ where = where + " and a.Telphone like '%" + Telphone + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if Fax != "" {
|
|
|
|
|
+ where = where + " and a.Fax like '%" + Fax + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if CompanyTel != "" {
|
|
|
|
|
+ where = where + " and a.CompanyTel like '%" + CompanyTel + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if QQ != "" {
|
|
|
|
|
+ where = where + " and a.QQ like '%" + QQ + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if CompanyUrl != "" {
|
|
|
|
|
+ where = where + " and a.CompanyUrl like '%" + CompanyUrl + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if SpecSupplier != "" {
|
|
|
|
|
+ where = where + " and a.SpecSupplier like '%" + SpecSupplier + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if SpecTypeCode != "" {
|
|
|
|
|
+ where = where + " and a.SpecTypeCode like '%" + SpecTypeCode + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if SpecTypeName != "" {
|
|
|
|
|
+ where = where + " and a.SpecTypeName like '%" + SpecTypeName + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if Remark != "" {
|
|
|
|
|
+ where = where + " and a.Remark like '%" + Remark + "%'"
|
|
|
|
|
+ }
|
|
|
|
|
+ if CreateOn != "" {
|
|
|
|
|
+ dates := strings.Split(CreateOn, ",")
|
|
|
|
|
+ if len(dates) == 2 {
|
|
|
|
|
+ minDate := dates[0]
|
|
|
|
|
+ maxDate := dates[1]
|
|
|
|
|
+ where = where + " and a.CreateOn>='" + minDate + "' and a.CreateOn<='" + maxDate + "'"
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ //企业用户必须加创建人条件
|
|
|
|
|
+ if this.User.IsCompanyUser == 1 {
|
|
|
|
|
+ where = where + " and a.CreateUserId = '" + this.User.Id + "'"
|
|
|
|
|
+ } else {
|
|
|
|
|
+ //超级管理员和有查看所有数据权限的用户不加条件
|
|
|
|
|
+ svcPerm := permission.GetPermissionService(utils.DBE)
|
|
|
|
|
+ isauth := svcPerm.IsAuthorized(this.User.Id, "oil_supplier.marketAccess.AllRecord")
|
|
|
|
|
+ if !svcPerm.IsAdmin(this.User.Id) && !isauth {
|
|
|
|
|
+ where = where + " and a.CreateUserId = '" + this.User.Id + "'"
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ svc := infochange.GetInfoChangeService(utils.DBE)
|
|
|
|
|
+ var list []infochange.SuppModelInfo
|
|
|
|
|
+ total := svc.GetSuppPagingEntitiesWithOrderBytbl(OilSupplierName,OilInfoChangeName, page.CurrentPage, page.Size, orderby, asc, &list, where)
|
|
|
|
|
+ //total := svc.GetPagingEntitiesWithOrderBytbl("", page.CurrentPage, page.Size, orderby, asc, &list, where)
|
|
|
|
|
+ var datainfo DataInfo
|
|
|
|
|
+ datainfo.Items = list
|
|
|
|
|
+ datainfo.CurrentItemCount = total
|
|
|
|
|
+ datainfo.PageIndex = page.CurrentPage
|
|
|
|
|
+ datainfo.ItemsPerPage = page.Size
|
|
|
|
|
+ this.Data["json"] = &datainfo
|
|
|
|
|
+ this.ServeJSON()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
// @Title 获取列表
|
|
// @Title 获取列表
|
|
|
// @Description get user by token
|
|
// @Description get user by token
|
|
|
// @Success 200 {object} []infochange.OilInfoChange
|
|
// @Success 200 {object} []infochange.OilInfoChange
|
|
@@ -111,7 +435,7 @@ func (this *InfoChangeController) GetInfoForItem() {
|
|
|
certId := this.GetString("certId")
|
|
certId := this.GetString("certId")
|
|
|
selctitem := this.GetString("selctitem")
|
|
selctitem := this.GetString("selctitem")
|
|
|
svc := infochange.GetInfoChangeService(utils.DBE)
|
|
svc := infochange.GetInfoChangeService(utils.DBE)
|
|
|
- where := "Id ="+ utils.ToStr(certId)
|
|
|
|
|
|
|
+ where := "Id =" + utils.ToStr(certId)
|
|
|
var selecteditem = svc.GetInfoforItem(""+OilSupplierName, selctitem, where)
|
|
var selecteditem = svc.GetInfoforItem(""+OilSupplierName, selctitem, where)
|
|
|
this.Data["json"] = &selecteditem
|
|
this.Data["json"] = &selecteditem
|
|
|
this.ServeJSON()
|
|
this.ServeJSON()
|
|
@@ -175,7 +499,7 @@ func (this *InfoChangeController) GetMyTaskEntityList() {
|
|
|
where += " and Id in (" + certIdList + ")"
|
|
where += " and Id in (" + certIdList + ")"
|
|
|
//根据部门查询待办任务
|
|
//根据部门查询待办任务
|
|
|
|
|
|
|
|
- total := svc.GetPagingEntitiesWithOrderBytbl("", page.CurrentPage, page.Size,orderby,asc, &list, where)
|
|
|
|
|
|
|
+ total := svc.GetPagingEntitiesWithOrderBytbl("", page.CurrentPage, page.Size, orderby, asc, &list, where)
|
|
|
//total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, page.CurrentPage, page.Size, orderby, asc, &list, where)
|
|
//total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, page.CurrentPage, page.Size, orderby, asc, &list, where)
|
|
|
|
|
|
|
|
var datainfo DataInfo
|
|
var datainfo DataInfo
|
|
@@ -226,7 +550,7 @@ func (this *InfoChangeController) DeleteEntity() {
|
|
|
// @router /addinfochangeitem [post]
|
|
// @router /addinfochangeitem [post]
|
|
|
func (this *InfoChangeController) AddInfoChangeItem() {
|
|
func (this *InfoChangeController) AddInfoChangeItem() {
|
|
|
var model infochange.OilInfoChangeItem
|
|
var model infochange.OilInfoChangeItem
|
|
|
- var jsonBlob= this.Ctx.Input.RequestBody
|
|
|
|
|
|
|
+ var jsonBlob = this.Ctx.Input.RequestBody
|
|
|
svc := infochange.GetInfoChangeService(utils.DBE)
|
|
svc := infochange.GetInfoChangeService(utils.DBE)
|
|
|
json.Unmarshal(jsonBlob, &model)
|
|
json.Unmarshal(jsonBlob, &model)
|
|
|
model.CreateOn = time.Now()
|
|
model.CreateOn = time.Now()
|
|
@@ -260,7 +584,7 @@ func (this *InfoChangeController) GetAuditerByDept() {
|
|
|
rsvc := auditsetting.GetOilAuditSettingService(utils.DBE)
|
|
rsvc := auditsetting.GetOilAuditSettingService(utils.DBE)
|
|
|
//rsvc.GetAuditStepRoleEntity(OilAuditSettingName, Id, workflow.FIRST_TRIAL, &auditWorkflow)
|
|
//rsvc.GetAuditStepRoleEntity(OilAuditSettingName, Id, workflow.FIRST_TRIAL, &auditWorkflow)
|
|
|
var userlist []userRole.Base_User
|
|
var userlist []userRole.Base_User
|
|
|
- where := " CompanyId = "+ Id
|
|
|
|
|
|
|
+ where := " CompanyId = " + Id
|
|
|
rsvc.GetEntities(&userlist, where)
|
|
rsvc.GetEntities(&userlist, where)
|
|
|
|
|
|
|
|
var datainfo ErrorDataInfo
|
|
var datainfo ErrorDataInfo
|
|
@@ -269,6 +593,20 @@ func (this *InfoChangeController) GetAuditerByDept() {
|
|
|
this.ServeJSON()
|
|
this.ServeJSON()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// @Title 获取企业法规处人员
|
|
|
|
|
+// @Description 获取企业法规处人员
|
|
|
|
|
+// @router /getauditer [get]
|
|
|
|
|
+func (this *InfoChangeController) GetAuditer() {
|
|
|
|
|
+ svc := infochange.GetInfoChangeService(utils.DBE)
|
|
|
|
|
+ var users []suppliercert.UserList
|
|
|
|
|
+ where := "OrganizeId=100000178 and AuditStepCode='" + workflow.PROF_REGULATION + "'"
|
|
|
|
|
+ svc.GetEntitysByWhere(OilAuditSettingName, where, &users)
|
|
|
|
|
+ var datainfo ErrorDataInfo
|
|
|
|
|
+ datainfo.Item = users
|
|
|
|
|
+ this.Data["json"] = &datainfo
|
|
|
|
|
+ this.ServeJSON()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// @Title 提交审批
|
|
// @Title 提交审批
|
|
|
// @Description 提交审批
|
|
// @Description 提交审批
|
|
|
// @Success 200 {object} controllers.Request
|
|
// @Success 200 {object} controllers.Request
|
|
@@ -279,8 +617,8 @@ func (this *InfoChangeController) AuditEntity() {
|
|
|
|
|
|
|
|
//取出审批列表
|
|
//取出审批列表
|
|
|
svc := infochange.GetInfoChangeService(utils.DBE)
|
|
svc := infochange.GetInfoChangeService(utils.DBE)
|
|
|
- var infoitems [] infochange.OilInfoChangeItem
|
|
|
|
|
- where := " SupplierId = "+ suppId
|
|
|
|
|
|
|
+ var infoitems []infochange.OilInfoChangeItem
|
|
|
|
|
+ where := " SupplierId = " + suppId
|
|
|
svc.GetEntities(&infoitems, where)
|
|
svc.GetEntities(&infoitems, where)
|
|
|
var infochangeentity infochange.OilInfoChange
|
|
var infochangeentity infochange.OilInfoChange
|
|
|
var infomodel infochange.OilInfoChangeItem
|
|
var infomodel infochange.OilInfoChangeItem
|
|
@@ -300,15 +638,17 @@ func (this *InfoChangeController) AuditEntity() {
|
|
|
}
|
|
}
|
|
|
}()
|
|
}()
|
|
|
var items string
|
|
var items string
|
|
|
- for i:=0 ;i<len(infoitems); i++ {
|
|
|
|
|
- items = fmt.Sprintf("%s %s %s %s",items, infoitems[i].SelectItem , ","+ infoitems[i].BeChangeInfo , ","+ infoitems[i].ChangeInfo +";")
|
|
|
|
|
|
|
+ for i := 0; i < len(infoitems); i++ {
|
|
|
|
|
+ items = fmt.Sprintf("%s %s %s %s", items, infoitems[i].SelectItem, ","+infoitems[i].BeChangeInfo, ","+infoitems[i].ChangeInfo+";")
|
|
|
}
|
|
}
|
|
|
items = strings.Trim(items, ";")
|
|
items = strings.Trim(items, ";")
|
|
|
- infoid,_ := svc.Insertentityinfo(OilInfoChangeName, items)
|
|
|
|
|
-
|
|
|
|
|
- for i:=0; i<len(infoitems); i++ {
|
|
|
|
|
- infomodel.InfoId,_ = strconv.Atoi(strconv.FormatInt(infoid,10))
|
|
|
|
|
- err := svc.UpdateEntityBytbl(OilInfoChangeItemName, infoitems[i].Id, &infomodel, []string{"InfoId"} )
|
|
|
|
|
|
|
+ infoid, _ := svc.Insertentityinfo(OilInfoChangeName, items)
|
|
|
|
|
+ var infoupda infochange.OilInfoChange
|
|
|
|
|
+ infoupda.SupplierId,_ = strconv.Atoi(suppId)
|
|
|
|
|
+ svc.UpdateEntityBytbl(OilInfoChangeName, infoid, &infoupda, []string{"SupplierId"})
|
|
|
|
|
+ for i := 0; i < len(infoitems); i++ {
|
|
|
|
|
+ infomodel.InfoId, _ = strconv.Atoi(strconv.FormatInt(infoid, 10))
|
|
|
|
|
+ err := svc.UpdateEntityBytbl(OilInfoChangeItemName, infoitems[i].Id, &infomodel, []string{"InfoId"})
|
|
|
fmt.Println(err)
|
|
fmt.Println(err)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -361,3 +701,132 @@ func (this *InfoChangeController) AuditEntity() {
|
|
|
svc.UpdateEntityByIdCols(infoid, infochangeentity, cols)
|
|
svc.UpdateEntityByIdCols(infoid, infochangeentity, cols)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// @Title 审批
|
|
|
|
|
+// @Description 审批
|
|
|
|
|
+// @Success 200 {object} controllers.Request
|
|
|
|
|
+// @router /infoaudit [post]
|
|
|
|
|
+func (this *InfoChangeController) InfoAudit() {
|
|
|
|
|
+ svc := infochange.GetInfoChangeService(utils.DBE)
|
|
|
|
|
+ var jsonblob = this.Ctx.Input.RequestBody
|
|
|
|
|
+ var dataother InfoShenHeModel
|
|
|
|
|
+ json.Unmarshal(jsonblob, &dataother)
|
|
|
|
|
+ //取出审批列表
|
|
|
|
|
+ var infoid = dataother.InfoId
|
|
|
|
|
+ var infomodel infochange.OilInfoChange
|
|
|
|
|
+ svc.GetEntityById(utils.ToStr(dataother.InfoId), &infomodel)
|
|
|
|
|
+ var infoitems []infochange.OilInfoChangeItem
|
|
|
|
|
+ where := "SupplierId = "+ utils.ToStr(dataother.SuppId)
|
|
|
|
|
+ svc.GetEntities(&infoitems,where)
|
|
|
|
|
+ var infochanentity infochange.OilInfoChange
|
|
|
|
|
+ var errinfo ErrorDataInfo
|
|
|
|
|
+ defer func() { //finally处理失败的异常
|
|
|
|
|
+ if err := recover(); err != nil {
|
|
|
|
|
+ errinfo.Message = "提交失败," + err.(string)
|
|
|
|
|
+ errinfo.Code = -1
|
|
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
|
|
+ this.ServeJSON()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ //返回正确结果
|
|
|
|
|
+ errinfo.Message = "审核提交成功"
|
|
|
|
|
+ errinfo.Code = 0
|
|
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
|
|
+ this.ServeJSON()
|
|
|
|
|
+ }
|
|
|
|
|
+ }()
|
|
|
|
|
+ step := 2
|
|
|
|
|
+ svcActiviti := workflow.GetActivitiService(utils.DBE)
|
|
|
|
|
+ var ActiComplete workflow.ActiCompleteVM
|
|
|
|
|
+ ActiComplete.ProcessKey = workflow.OIL_INFO_CHANGE
|
|
|
|
|
+ ActiComplete.BusinessKey = utils.ToStr(infoid)
|
|
|
|
|
+ ActiComplete.UserNames = utils.ToStr(dataother.Auditer)
|
|
|
|
|
+ ActiComplete.UserId = this.User.Id
|
|
|
|
|
+ ActiComplete.Remarks = dataother.AuditorRemark
|
|
|
|
|
+ ActiComplete.CallbackUrl = ""
|
|
|
|
|
+ if dataother.SuccessStatus == 1 {
|
|
|
|
|
+ ActiComplete.Result = "1"
|
|
|
|
|
+ if infomodel.Status == "1" {
|
|
|
|
|
+ infochanentity.Status = "2" //二级单位初审
|
|
|
|
|
+ } else if infomodel.Status == "2" {
|
|
|
|
|
+ infochanentity.Status = "3" //企业法规处审批
|
|
|
|
|
+ step = 3
|
|
|
|
|
+ }
|
|
|
|
|
+ receiveVal := svcActiviti.TaskComplete(ActiComplete)
|
|
|
|
|
+ if receiveVal == "true" {
|
|
|
|
|
+ cols := []string{
|
|
|
|
|
+ "Id",
|
|
|
|
|
+ "Status",
|
|
|
|
|
+ "Step",
|
|
|
|
|
+ }
|
|
|
|
|
+ _, err := svc.UpdateEntityByIdCols(infoid, infochanentity, cols)
|
|
|
|
|
+ if err == nil{
|
|
|
|
|
+ //原信息表更新
|
|
|
|
|
+ if infomodel.Status == "2" {
|
|
|
|
|
+ err = this.updatesupplier(dataother.SuppId,infoitems,infomodel)
|
|
|
|
|
+ }
|
|
|
|
|
+ errinfo.Message = "提交成功!"
|
|
|
|
|
+ errinfo.Code = 0
|
|
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
|
|
+ this.ServeJSON()
|
|
|
|
|
+ }else {
|
|
|
|
|
+ errinfo.Message = "提交失败!"
|
|
|
|
|
+ errinfo.Code = -1
|
|
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
|
|
+ this.ServeJSON()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ } else {
|
|
|
|
|
+ errinfo.Message = "工作流异常,请联系管理员!"
|
|
|
|
|
+ errinfo.Code = -1
|
|
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
|
|
+ this.ServeJSON()
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ActiComplete.Result = "0"
|
|
|
|
|
+ if infomodel.Status == "1" {
|
|
|
|
|
+ infochanentity.Status = "-2" //二级单位初审
|
|
|
|
|
+ } else if infomodel.Status == "2" {
|
|
|
|
|
+ infochanentity.Status = "-3" //企业法规处审批
|
|
|
|
|
+ }
|
|
|
|
|
+ receiveVal := svcActiviti.TaskComplete(ActiComplete)
|
|
|
|
|
+ if receiveVal == "true" {
|
|
|
|
|
+ infochanentity.Step = step
|
|
|
|
|
+ cols := []string{
|
|
|
|
|
+ "Id",
|
|
|
|
|
+ "Status",
|
|
|
|
|
+ "Step",
|
|
|
|
|
+ }
|
|
|
|
|
+ _, err := svc.UpdateEntityByIdCols(infoid, infochanentity, cols)
|
|
|
|
|
+ if err == nil {
|
|
|
|
|
+ errinfo.Message = "提交成功!"
|
|
|
|
|
+ errinfo.Code = 0
|
|
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
|
|
+ this.ServeJSON()
|
|
|
|
|
+ }else {
|
|
|
|
|
+ errinfo.Message = "提交失败!"
|
|
|
|
|
+ errinfo.Code = -1
|
|
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
|
|
+ this.ServeJSON()
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ errinfo.Message = "工作流异常,请联系管理员!"
|
|
|
|
|
+ errinfo.Code = -1
|
|
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
|
|
+ this.ServeJSON()
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+//更新供方信息表
|
|
|
|
|
+func (this *InfoChangeController) updatesupplier(suppid int, infoitems []infochange.OilInfoChangeItem, infomodel infochange.OilInfoChange) error {
|
|
|
|
|
+ svc := infochange.GetInfoChangeService(utils.DBE)
|
|
|
|
|
+ var err error
|
|
|
|
|
+ var cols []string
|
|
|
|
|
+ if len(infoitems) >0 {
|
|
|
|
|
+ for i := 0 ; i < len(infoitems); i++ {
|
|
|
|
|
+ cols = append(cols, infoitems[i].SelectItem)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ err = svc.UpdateEntityBytbl(OilSupplierName, suppid, &infomodel, cols)
|
|
|
|
|
+ return err
|
|
|
|
|
+}
|