Browse Source

后:对比列表

dubch 5 năm trước cách đây
mục cha
commit
e6e4822360

+ 4 - 55
src/dashoo.cn/backend/api/business/oilsupplier/goodsaptitude/oilgoodsaptitudeService.go

@@ -368,59 +368,8 @@ func (s *OilGoodsAptitudeService) GetPagingTmpCheckedEntities(entitiesPtr interf
 			 a.CompanyType,a.SetupTime,a.Address,a.Province,a.City,a.Street,
 			a.LegalPerson,a.RegCapital,a.Mobile,b.AuditDate,b.ApplyTime,b.InFlag,
 			a.ContactName,a.CommercialNo,a.LinkAddress,a.LinkProvince,
-			a.LinkCity,a.LinkStreet,a.BusinessScope,b.InStyle, b.Id CertId, 
-			COUNT(sub.Id) AS subCnt,
+			a.LinkCity,a.LinkStreet,a.BusinessScope,b.InStyle, b.Id CertId,
 			group_concat(DISTINCT header.Code) AS headerCodes,
-			group_concat(distinct sub.Name) AS subNames,
-			group_concat(distinct sub.Code) certSubCodes,
-			group_concat(DISTINCT sub.SubClassId) AS subClassIds,
-			max(goods.F01) AS F01,
-			max(goods.F02) AS F02,
-			max(goods.F03) AS F03,
-			max(goods.F04) AS F04,
-			max(goods.F05) AS F05,
-			max(goods.F06) AS F06,
-			max(goods.F07) AS F07,
-			max(goods.F08) AS F08,
-			max(goods.F09) AS F09,
-			max(goods.F10) AS F10,
-			max(goods.F11) AS F11,
-			max(goods.F12) AS F12,
-			max(goods.F13) AS F13,
-			max(goods.F14) AS F14,
-			max(goods.F15) AS F15,
-			max(goods.F16) AS F16,
-			max(goods.F17) AS F17,
-			max(goods.F18) AS F18,
-			max(goods.F19) AS F19,
-			max(goods.F20) AS F20,
-			max(goods.F21) AS F21,
-			max(goods.F22) AS F22,
-			max(goods.F23) AS F23,
-			max(goods.F24) AS F24,
-			max(goods.F25) AS F25,
-			max(goods.F26) AS F26,
-			max(goods.F27) AS F27,
-			max(goods.F28) AS F28,
-			max(goods.F29) AS F29,
-			max(goods.F30) AS F30,
-			max(goods.F31) AS F31,
-			max(goods.F32) AS F32,
-			max(goods.F33) AS F33,
-			max(goods.F34) AS F34,
-			max(goods.F35) AS F35,
-			max(goods.F36) AS F36,
-			max(goods.F37) AS F37,
-			max(goods.F38) AS F38,
-			max(goods.F39) AS F39,
-			max(goods.F40) AS F40,
-			max(goods.F41) AS F41,
-			max(goods.F42) AS F42,
-			max(goods.F43) AS F43,
-			max(goods.F44) AS F44,
-			max(goods.F45) AS F45,
-			max(goods.F46) AS F46,
-			
 			(
 			((if((max(goods.F01)='1' AND LOCATE('F01', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F01) is null) or (max(goods.F01) = ''), TRUE, FALSE)) or 
 			(if((max(goods.F36)='1' AND LOCATE('F36',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F36) is null) or (max(goods.F36) = ''), TRUE, FALSE)) or
@@ -472,12 +421,12 @@ func (s *OilGoodsAptitudeService) GetPagingTmpCheckedEntities(entitiesPtr interf
 			
 			 FROM OilSupplier a
 			 LEFT JOIN OilSupplierCert b ON a.Id=b.SupplierId
-			 LEFT JOIN OilSupplierCertSub sub ON b.Id=sub.SupplierCertId and sub.Type in (1, 3) 
+			 LEFT JOIN OilSupplierCertSub sub ON b.Id=sub.SupplierCertId
 			 LEFT JOIN OilSupplierFile files ON a.Id=files.SupplierId
-			 LEFT JOIN Base_TableHeader header ON files.NeedFileType=header.Name
+			 LEFT JOIN Base_TableHeader header ON files.NeedFileType=header.Name and header.CategoryCode = '01'
 			 LEFT JOIN tmp_OilGoodsAptitudeClass class ON sub.Code=class.Code
 			 LEFT JOIN tmp_OilGoodsAptitude goods ON class.Id=goods.ClassId
-			 WHERE b.SupplierTypeCode='01' and `
+			 WHERE`
 	sql += where
 	sql += ` GROUP BY a.Id, b.Id `
 	//sql += ` limit ` + utils.ToStr((pageIndex-1)*itemsPerPage) + "," + utils.ToStr(itemsPerPage)

+ 23 - 0
src/dashoo.cn/backend/api/business/oilsupplier/suppliercertsub/oilsuppliercertsub.go

@@ -26,6 +26,29 @@ type OilSupplierCertSub struct {
 	ModifiedOn           time.Time `xorm:"DATETIME"`
 	ModifiedUserId       int       `xorm:"INT(10)"`
 	ModifiedBy           string    `xorm:"VARCHAR(50)"`
+}
+type OilSupplierCertSub1 struct {
+	Id                   int       `xorm:"not null pk autoincr INT(10)"`
+	SupplierId           int       `xorm:"not null comment('供方基本信息表主键') INT(10)"`
+	SupplierCertId       int       `xorm:"not null comment('供方准入证书信息表主键') INT(10)"`
+	SupplierCertAppendId int       `xorm:"not null comment('增项信息表ID') INT(10)"`
+	GoodsLevel           string    `xorm:"not null default '' comment('级别')"`
+	IsManufacturer       int       `xorm:"not null comment('是否为供应商') INT(11)"`
+	SupplierTypeCode     string    `xorm:"not null default '' comment('准入类别代码') VARCHAR(5)"`
+	SubClassId           int       `xorm:"not null comment('分类表主键(物资类或基建类或技术服务类)') INT(10)"`
+	Code                 string    `xorm:"not null default '' comment('分类编码') VARCHAR(8)"`
+	AppendStatus         string    `xorm:"not null default '' comment('增项审核状态') VARCHAR(10)"`
+	Type                 string    `xorm:"not null default '' comment('类型') VARCHAR(10)"`
+	Name                 string    `xorm:"not null default '' comment('分类名称') VARCHAR(50)"`
+	CertSubStatus        string    `xorm:"null default '1' comment('1:正常2:不良记录暂停') VARCHAR(10)"`
+	Remark               string    `xorm:"comment('备注') VARCHAR(500)"`
+	IsDelete             int       `xorm:"default 0 comment('删除状态,0正常,1已删除') INT(10)"`
+	CreateOn             time.Time `xorm:"DATETIME created"`
+	CreateUserId         int       `xorm:"INT(10)"`
+	CreateBy             string    `xorm:"VARCHAR(50)"`
+	ModifiedOn           time.Time `xorm:"DATETIME"`
+	ModifiedUserId       int       `xorm:"INT(10)"`
+	ModifiedBy           string    `xorm:"VARCHAR(50)"`
 	HeaderCodes           string
 	Checked           int
 	HeaderName           string

+ 7 - 7
src/dashoo.cn/backend/api/controllers/oilsupplier/goodsaptitude.go

@@ -2038,7 +2038,7 @@ func (this *OilGoodsAptitudeController) GetDelCertSubList() {
 	}
 	where = where + " and a.Type in (1, 3)"
 	svc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
-	var list []suppliercertsub.OilSupplierCertSub
+	var list []suppliercertsub.OilSupplierCertSub1
 	//total := svc.GetMyPagingEntitiesWithOrderBytbl(TmpOilSupplierCertSubName, page.CurrentPage, page.Size, orderby, asc, &list, where)
 	//total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierCertSubName, page.CurrentPage, page.Size, orderby, asc, &list, where)
 	total := svc.GetPagingTmpSubEntities(page.CurrentPage, page.Size, orderby, asc, &list, where)
@@ -2103,12 +2103,12 @@ func (this *OilGoodsAptitudeController) DelTmpSupplierCertSub() {
 
 	svc := goodsaptitude.GetOilGoodsAptitudeSession(session)
 
-	wheredel := "1=1 and a.SupplierTypeCode = '01'"
+	wheredel := "1=1 and SupplierTypeCode = '01'"
 	if supplierId != "" {
-		wheredel += " and a.Id=" + supplierId
+		wheredel += " and Id=" + supplierId
 	}
 	if id != "" {
-		wheredel += " and a.Id=" + id
+		wheredel += " and Id=" + id
 	}
 	svc1 := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
 	//svc.GetEntitysByWhere(TmpOilSupplierCertSubName, wheredel, &supplierCertSubList)
@@ -2133,7 +2133,7 @@ func (this *OilGoodsAptitudeController) DelTmpSupplierCertSub() {
 			i := 1
 			for _, value := range code {
 				if i == 36 || i == 37 || i == 1 {
-					if (code[0] == "1" && strings.Index(item.HeaderCodes, "F01") < 0) && (code[35] == "1" && strings.Index(item.HeaderCodes, "F36") < 0) && (code[36] == "1" && strings.Index(item.HeaderCodes, "F37") < 0) {
+					if (code[0] == "1" && strings.Index(item2.HeaderCodes, "F01") < 0) && (code[35] == "1" && strings.Index(item2.HeaderCodes, "F36") < 0) && (code[36] == "1" && strings.Index(item2.HeaderCodes, "F37") < 0) {
 						where := "Id = " + strconv.Itoa(item.Id)
 						err = svc.DeleteEntityBytbl(OilSupplierCertSubName, where)
 						if err != nil {
@@ -2145,7 +2145,7 @@ func (this *OilGoodsAptitudeController) DelTmpSupplierCertSub() {
 						}
 					}
 				} else if i > 10 {
-					if value == "1" && strings.Index(item.HeaderCodes, "F"+strconv.Itoa(i)) < 0 {
+					if value == "1" && strings.Index(item2.HeaderCodes, "F"+strconv.Itoa(i)) < 0 {
 						where := "Id = " + strconv.Itoa(item.Id)
 						err = svc.DeleteEntityBytbl(OilSupplierCertSubName, where)
 						if err != nil {
@@ -2157,7 +2157,7 @@ func (this *OilGoodsAptitudeController) DelTmpSupplierCertSub() {
 						}
 					}
 				} else {
-					if value == "1" && strings.Index(item.HeaderCodes, "F0"+strconv.Itoa(i)) < 0 {
+					if value == "1" && strings.Index(item2.HeaderCodes, "F0"+strconv.Itoa(i)) < 0 {
 						where := "Id = " + strconv.Itoa(item.Id)
 						err = svc.DeleteEntityBytbl(OilSupplierCertSubName, where)
 						if err != nil {