Ver Fonte

后端: 集中评审列表不在查询准入范围

baichengfei há 4 anos atrás
pai
commit
68ce850d18

+ 10 - 11
src/dashoo.cn/backend/api/business/oilsupplier/supplier/oilsupplier.go

@@ -292,16 +292,15 @@ type OilSupplierView struct {
 }
 
 type CompanyList struct {
-	SupplierName        string    `xorm:"comment('企业名称') VARCHAR(255)"`
-	SupplierTypeCode  string
-	SupplierTypeName  string
-	InFlag            string    `xorm:"default '0' comment('准入标识') VARCHAR(10)"`
-	InStyle           string    `xorm:"default '1' comment('准入方式') VARCHAR(10)"`
-	SupplierStatus    string    `xorm:"comment('供应商状态(null:正常,1中止,2终止)') VARCHAR(255)"`
-	Type              string    `xorm:"comment('供应商类型') VARCHAR(255)"`
-	ApplyTime         time.Time `xorm:"comment('年审日期') DATETIME"`
-	BusinessScope     string    `xorm:"comment('营业范围') TEXT"`
-
+	SupplierName     string `xorm:"comment('企业名称') VARCHAR(255)"`
+	SupplierTypeCode string
+	SupplierTypeName string
+	InFlag           string    `xorm:"default '0' comment('准入标识') VARCHAR(10)"`
+	InStyle          string    `xorm:"default '1' comment('准入方式') VARCHAR(10)"`
+	SupplierStatus   string    `xorm:"comment('供应商状态(null:正常,1中止,2终止)') VARCHAR(255)"`
+	Type             string    `xorm:"comment('供应商类型') VARCHAR(255)"`
+	ApplyTime        time.Time `xorm:"comment('年审日期') DATETIME"`
+	BusinessScope    string    `xorm:"comment('营业范围') TEXT"`
 }
 
 type OilSupplierView1 struct {
@@ -347,7 +346,7 @@ type OilSupplierView1 struct {
 	InternalFlag      string    `xorm:"comment('国内采购') VARCHAR(255)"`
 	ImportFlag        string    `xorm:"comment('进口采购') VARCHAR(255)"`
 	OutsideFlog       string    `xorm:"comment('境外项目') VARCHAR(255)"`
-	ThirdAudit        string    `xorm:"comment('备注') VARCHAR(500)"`
+	ThirdAudit        string    `xorm:"comment('专业处室部门id') VARCHAR(500)"`
 	IsDelete          int       `xorm:"default 0 comment('删除状态,0正常,1已删除') INT(10)"`
 	IsRestrict        int       `xorm:"INT(11)"`
 	CommitComId       string    `xorm:"default '0' comment('提交二级单位Id') VARCHAR(50)"`

+ 7 - 6
src/dashoo.cn/backend/api/business/oilsupplier/supplier/oilsupplierService.go

@@ -159,7 +159,7 @@ func (s *OilSupplierService) GetMyPagingEntitiesWithOrderBytbl3(supplierTableNam
 	//获取总记录数
 	sqlCount := `select count(DISTINCT b.Id) from ` + supplierTableName + ` a `
 	sqlCount += ` left join ` + supplierCertTableName + " b on b.SupplierId = a.Id"
-	sqlCount += ` left join OilSupplierCertSub c on c.SupplierCertId = b.Id`
+	//sqlCount += ` left join OilSupplierCertSub c on c.SupplierCertId = b.Id`
 	sqlCount += ` where ` + where
 
 	var sql string
@@ -176,11 +176,12 @@ func (s *OilSupplierService) GetMyPagingEntitiesWithOrderBytbl3(supplierTableNam
 	sql += ` b.SkillerTotal, `
 	sql += ` b.Status, `
 	sql += ` b.RecUnitName, `
-	sql += ` GROUP_CONCAT(CONCAT(c.Code, ':', c.Name)) as CodeName, `
+	sql += ` b.ThirdAudit, `
+	//sql += ` GROUP_CONCAT(CONCAT(c.Code, ':', c.Name)) as CodeName, `
 	sql += ` b.WorkflowId, b.CreateOn ,b.ProcessKey,b.BusinessKey,b.BackRemark,b.IsRestrict,b.Remark`
 	sql += ` from ` + supplierTableName + ` a `
 	sql += ` left join ` + supplierCertTableName + " b on b.SupplierId = a.Id"
-	sql += ` left join OilSupplierCertSub c on c.SupplierCertId = b.Id`
+	//sql += ` left join OilSupplierCertSub c on c.SupplierCertId = b.Id`
 	sql += ` where ` + where
 	sql += ` GROUP BY a.Id,b.Id`
 	if asc {
@@ -438,7 +439,7 @@ func (s *OilSupplierService) GetCertIds(entitiesPtr interface{}, where string) {
 func (s *OilSupplierService) ConverseSupplierTypeToInt(typeCode string) (typeInt int) {
 	if typeCode == "01" {
 		typeInt = 1
-	}else if typeCode == "02" {
+	} else if typeCode == "02" {
 		typeInt = 2
 	} else if typeCode == "03" {
 		typeInt = 3
@@ -462,7 +463,7 @@ func (s *OilSupplierService) ConverseSupplierTypeToInt(typeCode string) (typeInt
 	return typeInt
 }
 
-func (s *OilSupplierService) GetDeleteSub(TableName, where string , entitiesPtr interface{}) {
+func (s *OilSupplierService) GetDeleteSub(TableName, where string, entitiesPtr interface{}) {
 	//var resultsSlice []map[string][]byte
 
 	//获取总记录数
@@ -496,7 +497,7 @@ func (s *OilSupplierService) GetDeleteSub(TableName, where string , entitiesPtr
 	//return total
 }
 
-func (s *OilSupplierService) GetDeleteSub2(TableName, where string , entitiesPtr interface{}, name string) {
+func (s *OilSupplierService) GetDeleteSub2(TableName, where string, entitiesPtr interface{}, name string) {
 
 	sql := `update OilSupplierCertSub a `
 	if TableName == "OilBasisBuild" {

+ 33 - 19
src/dashoo.cn/backend/api/controllers/oilsupplier/supplier.go

@@ -591,6 +591,7 @@ func (this *OilSupplierController) GetJZPSJoinCertEntityList() {
 	BusinessScope := this.GetString("BusinessScope")
 	RecUnitName := this.GetString("RecUnitName")
 	RecUnitId := this.GetString("RecUnitId")
+	ThirdAudit := this.GetString("ThirdAudit")
 
 	if SupplierName != "" {
 		where = where + " and a.SupplierName like '%" + SupplierName + "%'"
@@ -685,6 +686,10 @@ func (this *OilSupplierController) GetJZPSJoinCertEntityList() {
 		where = where + " and b.RecUnitId = '" + RecUnitId + "' "
 	}
 
+	if ThirdAudit != "" {
+		where = where + " and b.ThirdAudit = '" + ThirdAudit + "' "
+	}
+
 	status := this.GetString("Status")
 	if status != "" {
 		where = where + " and b.Status='" + status + "'"
@@ -1297,6 +1302,15 @@ func (this *OilSupplierController) GetDictList() {
 	users = rsvc.GetUserByRole(strconv.Itoa(auditWorkflow.RoleId), this.User.AccCode) //
 	dictList["Auditer"] = users
 
+	// 所有专业处室
+	var allBusDeptList []organize.Base_Organize
+	//where = "Category='Unit' and ParentId in (100000001, 100000128)"
+	//00097005 直属机构 00265300 公司机关 00097004 机关附属机构
+	//where = "Category='Unit' and OuterPhone in (00097005,00265300,00097004)"
+	whereBus := "(Category='Unit' and ParentId in (100000009, 100000004))"
+	orgsvc.GetEntities(&allBusDeptList, whereBus)
+	dictList["AllBusDeptList"] = allBusDeptList
+
 	var datainfo DataInfo
 	datainfo.Items = dictList
 	this.Data["json"] = &datainfo
@@ -2656,7 +2670,7 @@ func (this *OilSupplierController) CheckSupplierFile() {
 
 		idString := ""
 		idString1 := ""
-		for i := 0; i < len(certSubList); i = i+1000 {
+		for i := 0; i < len(certSubList); i = i + 1000 {
 			var ids suppliercertsub.Ids
 			certsubService.GetIds(strconv.Itoa(cert.Id), cert.SupplierTypeCode, &ids, 3, strconv.Itoa(i))
 			if ids.Id != "" {
@@ -2675,7 +2689,7 @@ func (this *OilSupplierController) CheckSupplierFile() {
 			if file.Type == 1 { //制造商
 				idString = ""
 				//如果是制造商,准入范围按照各项准入范围的类型判断
-				for i := 0; i < len(certSubList); i = i+1000 {
+				for i := 0; i < len(certSubList); i = i + 1000 {
 					var ids suppliercertsub.Ids
 					certsubService.GetIds(strconv.Itoa(cert.Id), cert.SupplierTypeCode, &ids, 1, strconv.Itoa(i))
 
@@ -2685,7 +2699,7 @@ func (this *OilSupplierController) CheckSupplierFile() {
 						break
 					}
 				}
-				for i := 0; i < len(certSubList); i = i+1000 {
+				for i := 0; i < len(certSubList); i = i + 1000 {
 					var ids1 suppliercertsub.Ids
 					certsubService.GetIds(strconv.Itoa(cert.Id), cert.SupplierTypeCode, &ids1, 2, strconv.Itoa(i))
 					if ids1.Id != "" {
@@ -2799,7 +2813,7 @@ func (this *OilSupplierController) CheckSupplierFileNew() {
 	certsubService.GetListByCertId(strconv.Itoa(cert.Id), &certSubList)
 	idString := ""
 	idString1 := ""
-	for i := 0; i < len(certSubList); i = i+1000 {
+	for i := 0; i < len(certSubList); i = i + 1000 {
 		var ids suppliercertsub.Ids
 		certsubService.GetIds(strconv.Itoa(cert.Id), cert.SupplierTypeCode, &ids, 3, strconv.Itoa(i))
 		if ids.Id != "" {
@@ -2836,7 +2850,7 @@ func (this *OilSupplierController) CheckSupplierFileNew() {
 		needList = filesvc.GetGoodsNeedFileListNew(idString, "2")
 		if file.Type == 1 { //制造商
 			idString = ""
-			for i := 0; i < len(certSubList); i = i+1000 {
+			for i := 0; i < len(certSubList); i = i + 1000 {
 				var ids suppliercertsub.Ids
 				certsubService.GetIds(strconv.Itoa(cert.Id), cert.SupplierTypeCode, &ids, 1, strconv.Itoa(i))
 				if ids.Id != "" {
@@ -2845,7 +2859,7 @@ func (this *OilSupplierController) CheckSupplierFileNew() {
 					break
 				}
 			}
-			for i := 0; i < len(certSubList); i = i+1000 {
+			for i := 0; i < len(certSubList); i = i + 1000 {
 				var ids1 suppliercertsub.Ids
 				certsubService.GetIds(strconv.Itoa(cert.Id), cert.SupplierTypeCode, &ids1, 2, strconv.Itoa(i))
 				if ids1.Id != "" {
@@ -2976,7 +2990,7 @@ func (this *OilSupplierController) CheckSupplierFileDelete() {
 
 			idString := ""
 			idString1 := ""
-			for i := 0; i < len(certSubList); i = i+1000 {
+			for i := 0; i < len(certSubList); i = i + 1000 {
 				var ids suppliercertsub.Ids
 				certsubService.GetIds(strconv.Itoa(cert.Id), cert.SupplierTypeCode, &ids, 3, strconv.Itoa(i))
 				if ids.Id != "" {
@@ -2995,7 +3009,7 @@ func (this *OilSupplierController) CheckSupplierFileDelete() {
 					//如果是制造商,准入范围按照各项准入范围的类型判断
 					// 制造
 					idString = ""
-					for i := 0; i < len(certSubList); i = i+1000 {
+					for i := 0; i < len(certSubList); i = i + 1000 {
 						var ids suppliercertsub.Ids
 						certsubService.GetIds(strconv.Itoa(cert.Id), cert.SupplierTypeCode, &ids, 1, strconv.Itoa(i))
 						if ids.Id != "" {
@@ -3005,7 +3019,7 @@ func (this *OilSupplierController) CheckSupplierFileDelete() {
 						}
 					}
 					// 非制造
-					for i := 0; i < len(certSubList); i = i+1000 {
+					for i := 0; i < len(certSubList); i = i + 1000 {
 						var ids1 suppliercertsub.Ids
 						certsubService.GetIds(strconv.Itoa(cert.Id), cert.SupplierTypeCode, &ids1, 2, strconv.Itoa(i))
 						if ids1.Id != "" {
@@ -3111,7 +3125,7 @@ func (this *OilSupplierController) CheckSupplierFileDelete() {
 			var supplierCert suppliercert.OilSupplierCert
 			supplierCert.BackRemark = needName
 			cols := []string{"BackRemark"}
-			supplierService.UpdateEntityBywheretbl(OilSupplierCertName, &supplierCert, cols, "Id = " + strconv.Itoa(cert.Id))
+			supplierService.UpdateEntityBywheretbl(OilSupplierCertName, &supplierCert, cols, "Id = "+strconv.Itoa(cert.Id))
 		}
 	}
 	errinfo.Code = 1
@@ -3151,7 +3165,7 @@ func (this *OilSupplierController) CheckSupplierFileList() {
 	var certSubList2 suppliercertsub.OilSupplierCertSub
 	certSubList2.LackFile = ""
 	certSubList2.IsQuestion = 0
-	svcHeader.UpdateEntityBywheretbl(OilSupplierCertSubName, &certSubList2, []string{"LackFile", "IsQuestion"}, "IsQuestion = 2 and SupplierId = " + strconv.Itoa(supplierEntity.Id) + " and SupplierCertId = " + file.CertId)
+	svcHeader.UpdateEntityBywheretbl(OilSupplierCertSubName, &certSubList2, []string{"LackFile", "IsQuestion"}, "IsQuestion = 2 and SupplierId = "+strconv.Itoa(supplierEntity.Id)+" and SupplierCertId = "+file.CertId)
 
 	//对准入范围的判断
 	var certSubList []suppliercertsub.OilSupplierCertSub
@@ -3159,7 +3173,7 @@ func (this *OilSupplierController) CheckSupplierFileList() {
 	certsubService.GetListByCertId(strconv.Itoa(cert.Id), &certSubList)
 	idString := ""
 	idString1 := ""
-	for i := 0; i < len(certSubList); i = i+1000 {
+	for i := 0; i < len(certSubList); i = i + 1000 {
 		var ids suppliercertsub.Ids
 		certsubService.GetIds(strconv.Itoa(cert.Id), cert.SupplierTypeCode, &ids, 3, strconv.Itoa(i))
 		if ids.Id != "" {
@@ -3178,7 +3192,7 @@ func (this *OilSupplierController) CheckSupplierFileList() {
 			//如果是制造商,准入范围按照各项准入范围的类型判断
 			// 制造
 			idString = ""
-			for i := 0; i < len(certSubList); i = i+1000 {
+			for i := 0; i < len(certSubList); i = i + 1000 {
 				var ids suppliercertsub.Ids
 				certsubService.GetIds(strconv.Itoa(cert.Id), cert.SupplierTypeCode, &ids, 1, strconv.Itoa(i))
 				if ids.Id != "" {
@@ -3188,7 +3202,7 @@ func (this *OilSupplierController) CheckSupplierFileList() {
 				}
 			}
 			// 非制造
-			for i := 0; i < len(certSubList); i = i+1000 {
+			for i := 0; i < len(certSubList); i = i + 1000 {
 				var ids1 suppliercertsub.Ids
 				certsubService.GetIds(strconv.Itoa(cert.Id), cert.SupplierTypeCode, &ids1, 2, strconv.Itoa(i))
 				if ids1.Id != "" {
@@ -3268,7 +3282,7 @@ func (this *OilSupplierController) CheckSupplierFileList() {
 	}
 
 	var certSubList1 []suppliercertsub.OilSupplierCertSub
-	total := certsubService.GetPagingEntitiesWithOrderBytbl("", file.CurrentPage, file.Size,"Id", true, &certSubList1, "IsQuestion = 2 and SupplierId = " + strconv.Itoa(supplierEntity.Id) + " and SupplierCertId = " + file.CertId)
+	total := certsubService.GetPagingEntitiesWithOrderBytbl("", file.CurrentPage, file.Size, "Id", true, &certSubList1, "IsQuestion = 2 and SupplierId = "+strconv.Itoa(supplierEntity.Id)+" and SupplierCertId = "+file.CertId)
 
 	var datainfo DataInfo
 	datainfo.CurrentItemCount = total
@@ -3286,8 +3300,8 @@ func (this *OilSupplierController) CheckSupplierFileList() {
 func (this *OilSupplierController) GetSupplierList() {
 
 	//获取分页信息
-	CurrentPage, _ := this.GetInt64("pageIndex",1)
-	Size, _ := this.GetInt64("pageSize",10)
+	CurrentPage, _ := this.GetInt64("pageIndex", 1)
+	Size, _ := this.GetInt64("pageSize", 10)
 	where := " b.InFlag = 1 "
 	orderby := "Id"
 	asc := false
@@ -3336,11 +3350,11 @@ func (this *OilSupplierController) GetSupplierCertId() {
 	Id := this.Ctx.Input.Param(":Id")
 	var certList []suppliercert.OilSupplierCert
 	svc := supplier.GetOilSupplierService(utils.DBE)
-	svc.GetEntitysByWhere(OilSupplierCertName, "SupplierId = " + Id, &certList)
+	svc.GetEntitysByWhere(OilSupplierCertName, "SupplierId = "+Id, &certList)
 
 	var datainfo DataInfo
 	datainfo.Items = certList
 	this.Data["json"] = &datainfo
 	this.ServeJSON()
 
-}
+}