2
3
Prechádzať zdrojové kódy

集中评审的查询

yuedefeng 6 rokov pred
rodič
commit
904576c70d

+ 18 - 0
src/dashoo.cn/backend/api/business/workflow/ActivitiService.go

@@ -254,6 +254,24 @@ func (this *ActivitiService) GetHistoryMyTasks(processKey string, userId string)
 	return string(p)
 }
 
+func (this *ActivitiService) GetAllMyTasks(processKey string, userId string) string {
+	var ActiMyTasks ActiMyTasksVM
+	ActiMyTasks.ProcessKey = processKey
+	ActiMyTasks.UserId = userId
+	json, err := json.Marshal(ActiMyTasks)
+	if err != nil {
+		fmt.Println(err, "生成json字符串错误")
+	}
+	params := string(json)
+	fmt.Println(params)
+	//token = Authorization(this.Username, this.Password)
+	retVal := this.Post("/my-tasks-finished", params, "")
+	p, _ := ioutil.ReadAll(retVal.Body)
+	retVal2 := this.Post("/my-tasks", params, "")
+	p2, _ := ioutil.ReadAll(retVal2.Body)
+	return string(p) + "," + string(p2)
+}
+
 func (this *ActivitiService) ExcelToPdf(addressUrl string) string {
 	var aposeVM AposeVM
 	aposeVM.AddressUrl = addressUrl

+ 366 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/supplier.go

@@ -685,6 +685,372 @@ func (this *OilSupplierController) GetJoinCertEntityList() {
 	this.ServeJSON()
 }
 
+
+// @Title 获取集中评审列表
+// @Description get user by token
+// @Success 200 {object} []supplier.OilSupplier
+// @router /jzps_certlist [get]
+func (this *OilSupplierController) GetJZPSJoinCertEntityList() {
+
+	//获取分页信息
+	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
+		}
+	}
+	Id := this.GetString("Id")
+	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")
+	SupplierTypeCode := this.GetString("SupplierTypeCode")
+	status := this.GetString("Status")
+
+	if status != "" {
+		where = where + " and b.Status='" + status + "'"
+	}
+	if Id != "" {
+		where = where + " and a.Id like '%" + Id + "%'"
+	}
+
+	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 SupplierTypeCode != "" {
+		where = where + " and b.SupplierTypeCode = '" + SupplierTypeCode + "'"
+	}
+
+	//企业用户必须加创建人条件
+	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 {
+			//根据工作流查找
+			//集中评审相关人可看数据
+			actisvc := workflow.GetActivitiService(utils.DBE)
+			//找出待办任务===准入
+			var certIdList string
+			ids := actisvc.GetAllMyTasks(workflow.OIL_SUPPLIER_APPLY, this.User.Id)
+			if len(strings.Trim(ids, ",")) > 0 {
+				certIdList += strings.Trim(ids, ",")+ ","
+			}
+			ids = actisvc.GetAllMyTasks(workflow.OIL_FIRST_SUPPLIER_APPLY, this.User.Id)
+			if len(strings.Trim(ids, ",")) > 0 {
+				certIdList += strings.Trim(ids, ",")+ ","
+			}
+
+			ids = actisvc.GetAllMyTasks(workflow.OIL_SECOND_SUPPLIER_APPLY, this.User.Id)
+			if len(strings.Trim(ids, ",")) > 0 {
+				certIdList += strings.Trim(ids, ",")+ ","
+			}
+
+			ids = actisvc.GetAllMyTasks(workflow.OIL_ENUSER_SUPPLIER_APPLY, this.User.Id)
+			if len(strings.Trim(ids, ",")) > 0 {
+				certIdList += strings.Trim(ids, ",")+ ","
+			}
+
+			ids = actisvc.GetAllMyTasks(workflow.OIL_FIRST_ENUSER_SUPPLIER_APPLY, this.User.Id)
+			if len(strings.Trim(ids, ",")) > 0 {
+				certIdList += strings.Trim(ids, ",")+ ","
+			}
+
+			ids = actisvc.GetAllMyTasks(workflow.OIL_SECOND_ENUSER_SUPPLIER_APPLY, this.User.Id)
+			if len(strings.Trim(ids, ",")) > 0 {
+				certIdList += strings.Trim(ids, ",")+ ","
+			}
+
+			certIdList = strings.Trim(certIdList, ",")
+			certIdarr := strings.Split(certIdList, ",")
+			for i, item := range certIdarr {
+				idx := strings.Index(item, "-")
+				if idx >= 0 {
+					certIdarr[i] = strings.Split(item, "-")[0]
+				}
+			}
+			certIdList = strings.Join(certIdarr, ",")
+
+			if certIdList != "" {
+				where += " and ( b.Id in (" + certIdList + ")" + " or a.CreateUserId = '" + this.User.Id + "')"
+			} else {
+				where = where + " and a.CreateUserId = '" + this.User.Id + "'"
+			}
+		} else {
+			where = where + " and a.CreateUserId = '" + this.User.Id + "'"
+		}
+	}
+
+	svc := supplier.GetOilSupplierService(utils.DBE)
+	var list []supplier.OilSupplierView
+
+	total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, 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 企业入库列表
 // @Description get user by token
 // @Success 200 {object} []supplier.OilSupplier

+ 7 - 0
src/dashoo.cn/frontend_web/src/api/oilsupplier/supplier.js

@@ -13,6 +13,13 @@ export default {
       params: params
     })
   },
+  getJZPSCertList (CreateOn, params, myAxios) {
+    return myAxios({
+      url: '/supplier/jzps_certlist?CreateOn=' + CreateOn,
+      method: 'GET',
+      params: params
+    })
+  },
   getStoreList (CreateOn, params, myAxios) {
     return myAxios({
       url: '/supplier/storelist?CreateOn=' + CreateOn,

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierps/basislist.vue

@@ -929,7 +929,7 @@
         //查询条件
         Object.assign(params, this.searchForm)
         //访问接口
-        api.getCertList(myCreateOn.join(','), params, this.$axios).then(res => {
+        api.getJZPSCertList(myCreateOn.join(','), params, this.$axios).then(res => {
           this.entityList = res.data.items
           this.currentItemCount = res.data.currentItemCount
         }).catch(err => {

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierps/goodslist.vue

@@ -926,7 +926,7 @@
         //查询条件
         Object.assign(params, this.searchForm)
         //访问接口
-        api.getCertList(myCreateOn.join(','), params, this.$axios).then(res => {
+        api.getJZPSCertList(myCreateOn.join(','), params, this.$axios).then(res => {
           this.entityList = res.data.items
           this.currentItemCount = res.data.currentItemCount
         }).catch(err => {

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierps/techlist.vue

@@ -933,7 +933,7 @@
         //查询条件
         Object.assign(params, this.searchForm)
         //访问接口
-        api.getCertList(myCreateOn.join(','), params, this.$axios).then(res => {
+        api.getJZPSCertList(myCreateOn.join(','), params, this.$axios).then(res => {
           this.entityList = res.data.items
           this.currentItemCount = res.data.currentItemCount
         }).catch(err => {