Ver código fonte

前后:服务类准入范围对比列表

dubch 5 anos atrás
pai
commit
797107d40e

+ 11 - 0
src/dashoo.cn/backend/api/business/oilsupplier/goodsaptitude/oilgoodsaptitudeService.go

@@ -571,6 +571,17 @@ func (s *OilGoodsAptitudeService) GetTableTotal(where string) (total int64) {
 	return total
 }
 
+func (s *OilGoodsAptitudeService) GetNoSubCntTotal(where string) (total int64) {
+
+	sqlCount := "select count(a.`Name`) as total from OilSupplierCertSub a left join tmp_OilGoodsAptitudeClass b on b.`Name` = a.`Name` where (" + where + ")"
+
+	var totalResult TotalResult
+	s.DBE.SQL(sqlCount).Get(&totalResult)
+	total = totalResult.Total
+
+	return total
+}
+
 func (s *OilGoodsAptitudeService) GetEntityByCode(where string, entityPtr interface{}) (has bool) {
 	sql := "SELECT COUNT((sub.GoodsLevel < goods.GoodsLevel) or null) AS OneTwoCount,COUNT((sub.GoodsLevel > goods.GoodsLevel) or null) AS TwoOneCount FROM OilSupplierCertSub sub LEFT JOIN tmp_OilGoodsAptitude goods ON sub.SubClassId=goods.ClassId where (" + where + ")"
 	s.DBE.SQL(sql).Get(entityPtr)

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

@@ -26,6 +26,7 @@ type OilSupplierCertSub struct {
 	ModifiedOn           time.Time `xorm:"DATETIME"`
 	ModifiedUserId       int       `xorm:"INT(10)"`
 	ModifiedBy           string    `xorm:"VARCHAR(50)"`
+	DueTime           	 string    `xorm:"VARCHAR(50)"`
 	IsQuestion           int       `xorm:"default 0 comment('问题状态,0正常,1有问题') INT(10)"`
 }
 type OilSupplierCertSub1 struct {

+ 124 - 0
src/dashoo.cn/backend/api/business/oilsupplier/technologyservice/oiltechnologyservice.go

@@ -71,6 +71,130 @@ type OilTechnologyService struct {
 	ModifiedBy        string    `xorm:"VARCHAR(50)"`
 }
 
+type OilTechnologyServiceTmp struct {
+	Code             string `xorm:"default '' VARCHAR(50) 'code'"`
+	Name             string `xorm:"default '' VARCHAR(50) 'name'"`
+	Id                int       `xorm:"not null pk autoincr INT(10)"`
+	ClassId           int       `xorm:"not null default '' comment('分类ID') INT(11)"`
+	OrgId             int       `xorm:"default 0 comment('部门ID') INT(10)"`
+	OrgName           string    `xorm:"default '' comment('部门名称') VARCHAR(100)"`
+	F01               string    `xorm:"default '' VARCHAR(2)"`
+	F02               string    `xorm:"default '' VARCHAR(2)"`
+	F03               string    `xorm:"default '' VARCHAR(2)"`
+	F04               string    `xorm:"default '' VARCHAR(2)"`
+	F05               string    `xorm:"default '' VARCHAR(2)"`
+	F06               string    `xorm:"default '' VARCHAR(2)"`
+	F07               string    `xorm:"default '' VARCHAR(2)"`
+	F08               string    `xorm:"default '' VARCHAR(2)"`
+	F09               string    `xorm:"default '' VARCHAR(2)"`
+	F10               string    `xorm:"default '' VARCHAR(2)"`
+	F11               string    `xorm:"default '' VARCHAR(2)"`
+	F12               string    `xorm:"default '' VARCHAR(2)"`
+	F13               string    `xorm:"default '' VARCHAR(2)"`
+	F14               string    `xorm:"default '' VARCHAR(2)"`
+	F15               string    `xorm:"default '' VARCHAR(2)"`
+	F16               string    `xorm:"default '' VARCHAR(2)"`
+	F17               string    `xorm:"default '' VARCHAR(2)"`
+	F18               string    `xorm:"default '' VARCHAR(2)"`
+	F19               string    `xorm:"default '' VARCHAR(2)"`
+	F20               string    `xorm:"default '' VARCHAR(2)"`
+	F21               string    `xorm:"default '' VARCHAR(2)"`
+	F22               string    `xorm:"default '' VARCHAR(2)"`
+	F23               string    `xorm:"default '' VARCHAR(2)"`
+	F24               string    `xorm:"default '' VARCHAR(2)"`
+	F25               string    `xorm:"default '' VARCHAR(2)"`
+	F26               string    `xorm:"default '' VARCHAR(2)"`
+	F27               string    `xorm:"default '' VARCHAR(2)"`
+	F28               string    `xorm:"default '' VARCHAR(2)"`
+	F29               string    `xorm:"default '' VARCHAR(2)"`
+	F30               string    `xorm:"default '' VARCHAR(2)"`
+	F31               string    `xorm:"default '' VARCHAR(2)"`
+	F32               string    `xorm:"default '' VARCHAR(2)"`
+	F33               string    `xorm:"default '' VARCHAR(2)"`
+	F34               string    `xorm:"default '' VARCHAR(2)"`
+	F35               string    `xorm:"default '' VARCHAR(2)"`
+	F36               string    `xorm:"default '' VARCHAR(2)"`
+	F37               string    `xorm:"default '' VARCHAR(2)"`
+	F38               string    `xorm:"default '' VARCHAR(2)"`
+	F39               string    `xorm:"default '' VARCHAR(2)"`
+	F40               string    `xorm:"default '' VARCHAR(2)"`
+	F41               string    `xorm:"default '' VARCHAR(2)"`
+	F42               string    `xorm:"default '' VARCHAR(2)"`
+	F43               string    `xorm:"default '' VARCHAR(2)"`
+	F44               string    `xorm:"default '' VARCHAR(2)"`
+	F45               string    `xorm:"default '' VARCHAR(2)"`
+	F46               string    `xorm:"default '' VARCHAR(2)"`
+	F47               string    `xorm:"default '' VARCHAR(2)"`
+	F48               string    `xorm:"default '' VARCHAR(2)"`
+	F49               string    `xorm:"default '' VARCHAR(2)"`
+	F50               string    `xorm:"default '' VARCHAR(2)"`
+	F51               string    `xorm:"default '' VARCHAR(2)"`
+	F52               string    `xorm:"default '' VARCHAR(2)"`
+
+	TmpF01               string    `json:"tmpF01"`
+	TmpF02               string    `json:"tmpF02"`
+	TmpF03               string    `json:"tmpF03"`
+	TmpF04               string    `json:"tmpF04"`
+	TmpF05               string    `json:"tmpF05"`
+	TmpF06               string    `json:"tmpF06"`
+	TmpF07               string    `json:"tmpF07"`
+	TmpF08               string    `json:"tmpF08"`
+	TmpF09               string    `json:"tmpF09"`
+	TmpF10               string    `json:"tmpF10"`
+	TmpF11               string    `json:"tmpF11"`
+	TmpF12               string    `json:"tmpF12"`
+	TmpF13               string    `json:"tmpF13"`
+	TmpF14               string    `json:"tmpF14"`
+	TmpF15               string    `json:"tmpF15"`
+	TmpF16               string    `json:"tmpF16"`
+	TmpF17               string    `json:"tmpF17"`
+	TmpF18               string    `json:"tmpF18"`
+	TmpF19               string    `json:"tmpF19"`
+	TmpF20               string    `json:"tmpF20"`
+	TmpF21               string    `json:"tmpF21"`
+	TmpF22               string    `json:"tmpF22"`
+	TmpF23               string    `json:"tmpF23"`
+	TmpF24               string    `json:"tmpF24"`
+	TmpF25               string    `json:"tmpF25"`
+	TmpF26               string    `json:"tmpF26"`
+	TmpF27               string    `json:"tmpF27"`
+	TmpF28               string    `json:"tmpF28"`
+	TmpF29               string    `json:"tmpF29"`
+	TmpF30               string    `json:"tmpF30"`
+	TmpF31               string    `json:"tmpF31"`
+	TmpF32               string    `json:"tmpF32"`
+	TmpF33               string    `json:"tmpF33"`
+	TmpF34               string    `json:"tmpF34"`
+	TmpF35               string    `json:"tmpF35"`
+	TmpF36               string    `json:"tmpF36"`
+	TmpF37               string    `json:"tmpF37"`
+	TmpF38               string    `json:"tmpF38"`
+	TmpF39               string    `json:"tmpF39"`
+	TmpF40               string    `json:"tmpF40"`
+	TmpF41               string    `json:"tmpF41"`
+	TmpF42               string    `json:"tmpF42"`
+	TmpF43               string    `json:"tmpF43"`
+	TmpF44               string    `json:"tmpF44"`
+	TmpF45               string    `json:"tmpF45"`
+	TmpF46               string    `json:"tmpF46"`
+	TmpF47               string    `json:"tmpF47"`
+	TmpF48               string    `json:"tmpF48"`
+	TmpF49               string    `json:"tmpF49"`
+	TmpF50               string    `json:"tmpF50"`
+	TmpF51               string    `json:"tmpF51"`
+	TmpF52               string    `json:"tmpF52"`
+	TmpName              string    `json:"tmpName"`
+
+	Remark            string    `xorm:"comment('备注') VARCHAR(500)"`
+	DeletionStateCode int       `xorm:"default 0 comment('删除状态,0正常,1已删除') INT(10)"`
+	CreateOn          time.Time `xorm:"DATETIME"`
+	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)"`
+}
+
 type OilTechnologyServiceView struct {
 	Code                 string `xorm:"default '' VARCHAR(50) 'code'"`
 	Name                 string `xorm:"default '' VARCHAR(50) 'name'"`

+ 218 - 0
src/dashoo.cn/backend/api/business/oilsupplier/technologyservice/oiltechnologyserviceService.go

@@ -13,12 +13,55 @@ type OilTechnologyServiceService struct {
 	MyServiceBase
 }
 
+type TotalResult struct {
+	Total int64 `xorm:"INT(11) 'total'"`
+}
+
 func GetOilTechnologyServiceService(xormEngine *xorm.Engine) *OilTechnologyServiceService {
 	s := new(OilTechnologyServiceService)
 	s.DBE = xormEngine
 	return s
 }
 
+func (s *OilTechnologyServiceService) TruncateTable(tableName string) error {
+	sql := "TRUNCATE TABLE " + tableName
+	_,err := s.DBE.Query(sql)
+	return err
+}
+
+func (s *OilTechnologyServiceService) GetTableTotal(where string, entitiesPtr interface{}) (total int64) {
+
+	sql := "SELECT * FROM OilSupplierCertSub where (" + where + ")"
+	sqlCount := "SELECT count(*) as total FROM OilSupplierCertSub where (" + where + ")"
+
+	s.DBE.SQL(sql).Find(entitiesPtr)
+	//s.DBE.SQL(sqlCount).Get(&totalResult)
+	//total = totalResult.Total
+	var resultsSlice []map[string][]byte
+	resultsSlice, _ = s.DBE.Query(sqlCount)
+
+	if len(resultsSlice) > 0 {
+		results := resultsSlice[0]
+		for _, value := range results {
+			total, _ = strconv.ParseInt(string(value), 10, 64)
+			break
+		}
+	}
+
+	return total
+}
+
+func (s *OilTechnologyServiceService) GetNoSubCntTotal(where string) (total int64) {
+
+	sqlCount := "select count(a.`Name`) as total from OilSupplierCertSub a left join Tmp_OilTechnologyServiceClass b on b.`Name` = a.`Name` LEFT JOIN Tmp_OilTechnologyService c ON c.ClassId = b.Id where (" + where + ")"
+
+	var totalResult TotalResult
+	s.DBE.SQL(sqlCount).Get(&totalResult)
+	total = totalResult.Total
+
+	return total
+}
+
 func (s *OilTechnologyServiceService) GetMyPagingEntitiesWithOrderBytbl(tableName string, pageIndex, itemsPerPage int64, order string, asc bool, entitiesPtr interface{}, where ...string) (total int64) {
 	var err error
 	var resultsSlice []map[string][]byte
@@ -87,4 +130,179 @@ func (s *OilTechnologyServiceService) DeleteTable(tableName, where string) error
 	}
 	_,err := s.DBE.Query(sql)
 	return err
+}
+
+func (s *OilTechnologyServiceService) GetPClassEntities(pageIndex, itemsPerPage int64, orderby string,
+	asc bool, entitiesPtr interface{}, having string, Conditions string) (total int64) {
+
+	var sql string
+	sql = `SELECT a.*,b.*,tmpa.F01 AS tmpF01,tmpa.F02 AS tmpF02,tmpa.F03 AS tmpF03,tmpa.F04 AS tmpF04,tmpa.F05 AS tmpF05,tmpa.F06 AS tmpF06,tmpa.F07 AS tmpF07,
+		 tmpa.F08 AS tmpF08,tmpa.F09 AS tmpF09,tmpa.F10 AS tmpF10,tmpa.F11 AS tmpF11,tmpa.F12 AS tmpF12,tmpa.F13 AS tmpF13,tmpa.F14 AS tmpF14,
+		 tmpa.F15 AS tmpF15,tmpa.F16 AS tmpF16,tmpa.F17 AS tmpF17,tmpa.F18 AS tmpF18,tmpa.F19 AS tmpF19,tmpa.F20 AS tmpF20,tmpa.F21 AS tmpF21,
+		 tmpa.F22 AS tmpF22,tmpa.F23 AS tmpF23,tmpa.F24 AS tmpF24,tmpa.F25 AS tmpF25,tmpa.F26 AS tmpF26,tmpa.F27 AS tmpF27,tmpa.F28 AS tmpF27,
+		 tmpa.F29 AS tmpF29,tmpa.F30 AS tmpF30,tmpa.F31 AS tmpF31,tmpa.F32 AS tmpF32,tmpa.F33 AS tmpF33,tmpa.F34 AS tmpF34,tmpa.F35 AS tmpF35,
+		 tmpa.F36 AS tmpF36,tmpa.F37 AS tmpF37,tmpa.F38 AS tmpF38,tmpa.F39 AS tmpF39,tmpa.F40 AS tmpF40,tmpa.F41 AS tmpF41,tmpa.F42 AS tmpF42,
+  		 tmpa.F42 AS tmpF42,tmpa.F43 AS tmpF43,tmpa.F44 AS tmpF44,tmpa.F45 AS tmpF45,tmpa.F46 AS tmpF46,tmpa.F47 AS tmpF47,tmpa.F48 AS tmpF48,
+  		 tmpa.F49 AS tmpF49,tmpa.F50 AS tmpF50,tmpa.F51 AS tmpF51,tmpa.F52 AS tmpF52,tmpb.Name AS tmpName,
+		if( ((tmpa.F01 is null && a.F01 = 1) or (tmpa.F01 = 1 && (a.F01 is null or a.F01 = 0))) or ((tmpa.F02 is null && a.F02 = 1) or (tmpa.F02 = 1 && (a.F02 is null or a.F02 = 0))) or ((tmpa.F03 is null && a.F03 = 1) or (tmpa.F03 = 1 && (a.F03 is null or a.F03 = 0))) or ((tmpa.F04 is null && a.F04 = 1) or (tmpa.F04 = 1 && (a.F04 is null or a.F04 = 0))) or ((tmpa.F05 is null && a.F05 = 1) or (tmpa.F05 = 1 && (a.F05 is null or a.F05 = 0))) or ((tmpa.F06 is null && a.F06 = 1) or (tmpa.F06 = 1 && (a.F06 is null or a.F06 = 0))) or ((tmpa.F07 is null && a.F07 = 1) or (tmpa.F07 = 1 && (a.F07 is null or a.F07 = 0))) or ((tmpa.F08 is null && a.F08 = 1) or (tmpa.F08 = 1 && (a.F08 is null or a.F08 = 0))) or ((tmpa.F09 is null && a.F09 = 1) or (tmpa.F09 = 1 && (a.F09 is null or a.F09 = 0))) or ((tmpa.F10 is null && a.F10 = 1) or (tmpa.F10 = 1 && (a.F10 is null or a.F10 = 0)))
+			or ((tmpa.F11 is null && a.F11 = 1) or (tmpa.F11 = 1 && (a.F11 is null or a.F11 = 0))) or ((tmpa.F12 is null && a.F12 = 1) or (tmpa.F12 = 1 && (a.F12 is null or a.F12 = 0))) or ((tmpa.F13 is null && a.F13 = 1) or (tmpa.F13 = 1 && (a.F13 is null or a.F13 = 0))) or ((tmpa.F14 is null && a.F14 = 1) or (tmpa.F14 = 1 && (a.F14 is null or a.F14 = 0))) or ((tmpa.F15 is null && a.F15 = 1) or (tmpa.F15 = 1 && (a.F15 is null or a.F15 = 0))) or ((tmpa.F16 is null && a.F16 = 1) or (tmpa.F16 = 1 && (a.F16 is null or a.F16 = 0))) or ((tmpa.F17 is null && a.F17 = 1) or (tmpa.F17 = 1 && (a.F17 is null or a.F17 = 0))) or ((tmpa.F18 is null && a.F18 = 1) or (tmpa.F18 = 1 && (a.F18 is null or a.F18 = 0))) or ((tmpa.F19 is null && a.F19 = 1) or (tmpa.F19 = 1 && (a.F19 is null or a.F19 = 0))) or ((tmpa.F20 is null && a.F20 = 1) or (tmpa.F20 = 1 && (a.F20 is null or a.F20 = 0)))
+			or ((tmpa.F21 is null && a.F21 = 1) or (tmpa.F21 = 1 && (a.F21 is null or a.F21 = 0))) or ((tmpa.F22 is null && a.F22 = 1) or (tmpa.F22 = 1 && (a.F22 is null or a.F22 = 0))) or ((tmpa.F23 is null && a.F23 = 1) or (tmpa.F23 = 1 && (a.F23 is null or a.F23 = 0))) or ((tmpa.F24 is null && a.F24 = 1) or (tmpa.F24 = 1 && (a.F24 is null or a.F24 = 0))) or ((tmpa.F25 is null && a.F25 = 1) or (tmpa.F25 = 1 && (a.F25 is null or a.F25 = 0))) or ((tmpa.F26 is null && a.F26 = 1) or (tmpa.F26 = 1 && (a.F26 is null or a.F26 = 0))) or ((tmpa.F27 is null && a.F27 = 1) or (tmpa.F27 = 1 && (a.F27 is null or a.F27 = 0))) or ((tmpa.F28 is null && a.F28 = 1) or (tmpa.F28 = 1 && (a.F28 is null or a.F28 = 0))) or ((tmpa.F29 is null && a.F29 = 1) or (tmpa.F29 = 1 && (a.F29 is null or a.F29 = 0))) or ((tmpa.F30 is null && a.F30 = 1) or (tmpa.F30 = 1 && (a.F30 is null or a.F30 = 0)))
+			or ((tmpa.F31 is null && a.F31 = 1) or (tmpa.F31 = 1 && (a.F31 is null or a.F31 = 0))) or ((tmpa.F32 is null && a.F32 = 1) or (tmpa.F32 = 1 && (a.F32 is null or a.F32 = 0))) or ((tmpa.F33 is null && a.F33 = 1) or (tmpa.F33 = 1 && (a.F33 is null or a.F33 = 0))) or ((tmpa.F34 is null && a.F34 = 1) or (tmpa.F34 = 1 && (a.F34 is null or a.F34 = 0))) or ((tmpa.F35 is null && a.F35 = 1) or (tmpa.F35 = 1 && (a.F35 is null or a.F35 = 0))) or ((tmpa.F36 is null && a.F36 = 1) or (tmpa.F36 = 1 && (a.F36 is null or a.F36 = 0))) or ((tmpa.F37 is null && a.F37 = 1) or (tmpa.F37 = 1 && (a.F37 is null or a.F37 = 0))) or ((tmpa.F38 is null && a.F38 = 1) or (tmpa.F38 = 1 && (a.F38 is null or a.F38 = 0))) or ((tmpa.F39 is null && a.F39 = 1) or (tmpa.F39 = 1 && (a.F39 is null or a.F39 = 0))) or ((tmpa.F40 is null && a.F40 = 1) or (tmpa.F40 = 1 && (a.F40 is null or a.F40 = 0)))
+			or ((tmpa.F41 is null && a.F41 = 1) or (tmpa.F41 = 1 && (a.F41 is null or a.F41 = 0))) or ((tmpa.F42 is null && a.F42 = 1) or (tmpa.F42 = 1 && (a.F42 is null or a.F42 = 0))) or ((tmpa.F43 is null && a.F43 = 1) or (tmpa.F43 = 1 && (a.F43 is null or a.F43 = 0))) or ((tmpa.F44 is null && a.F44 = 1) or (tmpa.F44 = 1 && (a.F44 is null or a.F44 = 0))) or ((tmpa.F45 is null && a.F45 = 1) or (tmpa.F45 = 1 && (a.F45 is null or a.F45 = 0))) or ((tmpa.F46 is null && a.F46 = 1) or (tmpa.F46 = 1 && (a.F46 is null or a.F46 = 0))) or ((tmpa.F47 is null && a.F47 = 1) or (tmpa.F47 = 1 && (a.F47 is null or a.F47 = 0))) or ((tmpa.F48 is null && a.F48 = 1) or (tmpa.F48 = 1 && (a.F48 is null or a.F48 = 0))) or ((tmpa.F49 is null && a.F49 = 1) or (tmpa.F49 = 1 && (a.F49 is null or a.F49 = 0))) or ((tmpa.F50 is null && a.F50 = 1) or (tmpa.F50 = 1 && (a.F50 is null or a.F50 = 0)))
+			or ((tmpa.F51 is null && a.F51 = 1) or (tmpa.F51 = 1 && (a.F51 is null or a.F51 = 0))) or ((tmpa.F52 is null && a.F52 = 1) or (tmpa.F52 = 1 && (a.F52 is null or a.F52 = 0))) 
+		,true, false) as checked`
+
+	if Conditions == "5" {
+		sql += " FROM Tmp_OilTechnologyService a LEFT JOIN Tmp_OilTechnologyServiceClass b ON b.Id = a.ClassId LEFT JOIN OilTechnologyServiceClassClass tmpb ON tmpb.Name = b.Name LEFT JOIN OilTechnologyServiceClass tmpa ON tmpa.ClassId = tmpb.Id where (" + having + ")"
+	} else {
+		sql += " FROM OilTechnologyService a LEFT JOIN OilTechnologyServiceClass b ON b.Id = a.ClassId LEFT JOIN Tmp_OilTechnologyServiceClass tmpb ON tmpb.Name = b.Name LEFT JOIN Tmp_OilTechnologyService tmpa ON tmpa.ClassId = tmpb.Id where (" + having + ")"
+	}
+	if asc {
+		sql += ` order by b.` + orderby + ` ASC `
+	} else {
+		sql += ` order by b.` + orderby + ` DESC `
+	}
+	sql += ` limit ` + utils.ToStr((pageIndex-1)*itemsPerPage) + "," + utils.ToStr(itemsPerPage)
+
+	sqlCount := "SELECT count(*) FROM OilTechnologyService a LEFT JOIN OilTechnologyServiceClass b ON b.Id = a.ClassId LEFT JOIN Tmp_OilTechnologyServiceClass tmpb ON tmpb.Name = b.Name LEFT JOIN Tmp_OilTechnologyService tmpa ON tmpa.ClassId = tmpb.Id where (" + having + ") "
+	if Conditions == "5" {
+		sqlCount = "SELECT count(*) FROM Tmp_OilTechnologyService a LEFT JOIN Tmp_OilTechnologyServiceClass b ON b.Id = a.ClassId LEFT JOIN OilTechnologyServiceClass tmpb ON tmpb.Name = b.Name LEFT JOIN OilTechnologyService tmpa ON tmpa.ClassId = tmpb.Id where (" + having + ") "
+	}
+
+	//var totalResult TotalResult
+	s.DBE.SQL(sql).Find(entitiesPtr)
+	//s.DBE.SQL(sqlCount).Get(&totalResult)
+	//total = totalResult.Total
+	var resultsSlice []map[string][]byte
+	resultsSlice, _ = s.DBE.Query(sqlCount)
+
+	if len(resultsSlice) > 0 {
+		results := resultsSlice[0]
+		for _, value := range results {
+			total, _ = strconv.ParseInt(string(value), 10, 64)
+			break
+		}
+	}
+
+	return total
+}
+
+func (s *OilTechnologyServiceService) GetPagingTmpCheckedEntities(entitiesPtr interface{}, where string) (total int64) {
+
+	var sql string
+	sql = `SELECT 
+			 a.Id,a.SupplierName,
+			 b.SupplierTypeCode, b.SupplierTypeName,
+			 b.AccessCardNo, a.DepositBank,a.HseTraining,
+			 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,
+			group_concat(DISTINCT header.Code) AS HeaderCodes,
+			min(sub.SubClassId) as MinClassId,
+			(
+			((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.F41)='1' AND LOCATE('F41',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F41) is null) or (max(goods.F41) = ''), TRUE, FALSE)) or
+			(if((max(goods.F42)='1' AND LOCATE('F42',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F42) is null) or (max(goods.F42) = ''), TRUE, FALSE))) AND 
+			if((max(goods.F02)='1' AND LOCATE('F02',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F02) is null) or (max(goods.F02) = ''), TRUE, FALSE) AND
+			if((max(goods.F03)='1' AND LOCATE('F03',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F03) is null) or (max(goods.F03) = ''), TRUE, FALSE) AND
+			if((max(goods.F04)='1' AND LOCATE('F04',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F04) is null) or (max(goods.F04) = ''), TRUE, FALSE) AND
+			if((max(goods.F05)='1' AND LOCATE('F05',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F05) is null) or (max(goods.F05) = ''), TRUE, FALSE) AND
+			if((max(goods.F06)='1' AND LOCATE('F06',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F06) is null) or (max(goods.F06) = ''), TRUE, FALSE) AND
+			if((max(goods.F07)='1' AND LOCATE('F07',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F07) is null) or (max(goods.F07) = ''), TRUE, FALSE) AND
+			if((max(goods.F08)='1' AND LOCATE('F08',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F08) is null) or (max(goods.F08) = ''), TRUE, FALSE) AND
+			if((max(goods.F09)='1' AND LOCATE('F09',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F09) is null) or (max(goods.F09) = ''), TRUE, FALSE) AND
+			if((max(goods.F10)='1' AND LOCATE('F10',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F10) is null) or (max(goods.F10) = ''), TRUE, FALSE) AND
+			if((max(goods.F11)='1' AND LOCATE('F11',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F11) is null) or (max(goods.F11) = ''), TRUE, FALSE) AND
+			if((max(goods.F12)='1' AND LOCATE('F12',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F12) is null) or (max(goods.F12) = ''), TRUE, FALSE) AND
+			if((max(goods.F13)='1' AND LOCATE('F13',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F13) is null) or (max(goods.F13) = ''), TRUE, FALSE) AND
+			if((max(goods.F14)='1' AND LOCATE('F14',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F14) is null) or (max(goods.F14) = ''), TRUE, FALSE) AND
+			if((max(goods.F15)='1' AND LOCATE('F15',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F15) is null) or (max(goods.F15) = ''), TRUE, FALSE) AND
+			if((max(goods.F16)='1' AND LOCATE('F16',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F16) is null) or (max(goods.F16) = ''), TRUE, FALSE) AND
+			if((max(goods.F17)='1' AND LOCATE('F17',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F17) is null) or (max(goods.F17) = ''), TRUE, FALSE) AND
+			if((max(goods.F18)='1' AND LOCATE('F18',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F18) is null) or (max(goods.F18) = ''), TRUE, FALSE) AND
+			if((max(goods.F19)='1' AND LOCATE('F19',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F19) is null) or (max(goods.F19) = ''), TRUE, FALSE) AND
+			if((max(goods.F20)='1' AND LOCATE('F20',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F20) is null) or (max(goods.F20) = ''), TRUE, FALSE) AND
+			if((max(goods.F21)='1' AND LOCATE('F21',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F21) is null) or (max(goods.F21) = ''), TRUE, FALSE) AND
+			if((max(goods.F22)='1' AND LOCATE('F22',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F22) is null) or (max(goods.F22) = ''), TRUE, FALSE) AND
+			if((max(goods.F23)='1' AND LOCATE('F23',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F23) is null) or (max(goods.F23) = ''), TRUE, FALSE) AND
+			if((max(goods.F24)='1' AND LOCATE('F24',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F24) is null) or (max(goods.F24) = ''), TRUE, FALSE) AND
+			if((max(goods.F25)='1' AND LOCATE('F25',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F25) is null) or (max(goods.F25) = ''), TRUE, FALSE) AND
+			if((max(goods.F26)='1' AND LOCATE('F26',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F26) is null) or (max(goods.F26) = ''), TRUE, FALSE) AND
+			if((max(goods.F27)='1' AND LOCATE('F27',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F27) is null) or (max(goods.F27) = ''), TRUE, FALSE) AND
+			if((max(goods.F28)='1' AND LOCATE('F28',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F28) is null) or (max(goods.F28) = ''), TRUE, FALSE) AND
+			if((max(goods.F29)='1' AND LOCATE('F29',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F29) is null) or (max(goods.F29) = ''), TRUE, FALSE) AND
+			if((max(goods.F30)='1' AND LOCATE('F30',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F30) is null) or (max(goods.F30) = ''), TRUE, FALSE) AND
+			if((max(goods.F31)='1' AND LOCATE('F31',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F31) is null) or (max(goods.F31) = ''), TRUE, FALSE) AND
+			if((max(goods.F32)='1' AND LOCATE('F32',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F32) is null) or (max(goods.F32) = ''), TRUE, FALSE) AND
+			if((max(goods.F33)='1' AND LOCATE('F33',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F33) is null) or (max(goods.F33) = ''), TRUE, FALSE) AND
+			if((max(goods.F34)='1' AND LOCATE('F34',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F34) is null) or (max(goods.F34) = ''), TRUE, FALSE) AND
+			if((max(goods.F35)='1' AND LOCATE('F35',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F35) is null) or (max(goods.F35) = ''), TRUE, FALSE) AND
+			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) AND
+			if((max(goods.F37)='1' AND LOCATE('F37',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F37) is null) or (max(goods.F37) = ''), TRUE, FALSE) AND
+			if((max(goods.F38)='1' AND LOCATE('F38',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F38) is null) or (max(goods.F38) = ''), TRUE, FALSE) AND
+			if((max(goods.F39)='1' AND LOCATE('F39',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F39) is null) or (max(goods.F39) = ''), TRUE, FALSE) AND
+			if((max(goods.F40)='1' AND LOCATE('F40',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F40) is null) or (max(goods.F40) = ''), TRUE, FALSE) AND
+			if((max(goods.F43)='1' AND LOCATE('F43',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F43) is null) or (max(goods.F43) = ''), TRUE, FALSE) AND
+			if((max(goods.F44)='1' AND LOCATE('F44',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F44) is null) or (max(goods.F44) = ''), TRUE, FALSE) AND
+			if((max(goods.F45)='1' AND LOCATE('F45',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F45) is null) or (max(goods.F45) = ''), TRUE, FALSE) AND
+			if((max(goods.F46)='1' AND LOCATE('F46',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F46) is null) or (max(goods.F46) = ''), TRUE, FALSE) AND
+			if((max(goods.F47)='1' AND LOCATE('F47',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F47) is null) or (max(goods.F47) = ''), TRUE, FALSE) AND
+			if((max(goods.F48)='1' AND LOCATE('F48',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F48) is null) or (max(goods.F48) = ''), TRUE, FALSE) AND
+			if((max(goods.F49)='1' AND LOCATE('F49',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F49) is null) or (max(goods.F49) = ''), TRUE, FALSE) AND
+			if((max(goods.F50)='1' AND LOCATE('F50',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F50) is null) or (max(goods.F50) = ''), TRUE, FALSE) AND
+			if((max(goods.F51)='1' AND LOCATE('F51',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F51) is null) or (max(goods.F51) = ''), TRUE, FALSE) AND
+			if((max(goods.F52)='1' AND LOCATE('F52',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F52) is null) or (max(goods.F52) = ''), TRUE, FALSE) 
+			) AS checked
+			
+			 FROM OilSupplier a
+			 LEFT JOIN OilSupplierCert b ON a.Id=b.SupplierId
+			 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 and header.CategoryCode = '01'
+			 LEFT JOIN Tmp_OilTechnologyServiceClass class ON sub.Name=class.Name
+			 LEFT JOIN Tmp_OilTechnologyService goods ON class.Id=goods.ClassId
+			 WHERE`
+	sql += where
+	sql += ` GROUP BY a.Id, b.Id `
+	//sql += ` limit ` + utils.ToStr((pageIndex-1)*itemsPerPage) + "," + utils.ToStr(itemsPerPage)
+
+	//sqlCount := "SELECT count(DISTINCT a.Id) as total FROM OilSupplier a LEFT JOIN OilSupplierCert b ON a.Id=b.SupplierId 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 tmp_OilGoodsAptitudeClass class ON sub.Code=class.Code LEFT JOIN tmp_OilGoodsAptitude goods ON class.Id=goods.ClassId WHERE b.SupplierTypeCode='01' AND " + having
+
+	var totalResult TotalResult
+	s.DBE.SQL(sql).Find(entitiesPtr)
+	//s.DBE.SQL(sqlCount).Get(&totalResult)
+	total = totalResult.Total
+
+	return total
+}
+
+func (s *OilTechnologyServiceService) GetPagingTmpSubEntities(pageIndex, itemsPerPage int64, orderby string,
+	asc bool, entitiesPtr interface{}, having string) (total int64) {
+
+	var sql string
+	sql = `SELECT 
+		 a.*,group_concat(DISTINCT header.Code) AS HeaderCodes
+		 FROM OilSupplierCertSub a
+		 LEFT JOIN OilSupplierFile files ON a.SupplierId=files.SupplierId
+		 LEFT JOIN Base_TableHeader header ON files.NeedFileType=header.Name
+		 LEFT JOIN Tmp_OilTechnologyServiceClass class ON a.Name=class.Name
+		 LEFT JOIN Tmp_OilTechnologyService goods ON class.Id=goods.ClassId`
+	sql += " where (" + having + ")"
+	sql += ` GROUP BY a.Id `
+	if asc {
+		sql += ` order by ` + orderby + ` ASC `
+	} else {
+		sql += ` order by ` + orderby + ` DESC `
+	}
+	sql += ` limit ` + utils.ToStr((pageIndex-1)*itemsPerPage) + "," + utils.ToStr(itemsPerPage)
+
+	sqlCount := "SELECT count(*) as total FROM OilSupplierCertSub a LEFT JOIN Tmp_OilTechnologyServiceClass class ON a.Name=class.Name LEFT JOIN Tmp_OilTechnologyService goods ON class.Id=goods.ClassId  where (" + having + ") "
+
+	var totalResult TotalResult
+	s.DBE.SQL(sql).Find(entitiesPtr)
+	s.DBE.SQL(sqlCount).Get(&totalResult)
+	total = totalResult.Total
+
+	return total
 }

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

@@ -6,7 +6,9 @@ import (
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercertsub"
 	"dashoo.cn/backend/api/business/oilsupplier/supplierdataentry"
 	"dashoo.cn/backend/api/business/oilsupplier/supplierfile"
+	"dashoo.cn/backend/api/business/oilsupplier/supplierpausereason"
 	"dashoo.cn/backend/api/business/oilsupplier/tableheader"
+	"dashoo.cn/backend/api/business/oilsupplier/technologyserviceclass"
 	"encoding/json"
 	"fmt"
 	"github.com/tealeg/xlsx"
@@ -1526,31 +1528,6 @@ func (this *OilGoodsAptitudeController) ImportExcel() {
 		} else {
 			elapsed := time.Since(t)
 			log.Println(elapsed)
-			//清空
-			svc.TruncateTable("OilSupplierContrast")
-			// 插入对比列表
-			svc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
-			var list1 []supplier.OilSupplier
-			svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, 0, 0, "Id", false, &list1, " 1=1")
-			svc.DBE.Query("SET unique_checks=0;")
-			svc.DBE.Query("SET autocommit=0;")
-			for _, item := range list1 {
-				var list []supplier.OilSupplierContrast
-				where := "  b.SupplierTypeCode='01' and a.Id = " + strconv.Itoa(item.Id)
-				svc.GetPagingTmpCheckedEntities(&list, where)
-				if list != nil {
-					total := svc.GetTableTotal(" SupplierId = " + strconv.Itoa(item.Id))
-					total1 := svc.GetTableTotal(" SubClassId = 0 and SupplierId = " + strconv.Itoa(item.Id))
-					list[0].SubCnt = int(total)
-					list[0].NoSubCnt = int(total1)
-					svc.InsertEntityBytbl("OilSupplierContrast", list[0])
-					svc.DBE.Query("commit;")
-				}
-			}
-			svc.DBE.Query("SET unique_checks=1;")
-			svc.DBE.Query("SET autocommit=1;")
-			elapsed1 := time.Since(t)
-			log.Println(elapsed1)
 		}
 	}()
 	errorinfo.Code = 0
@@ -1727,10 +1704,24 @@ func (this *OilGoodsAptitudeController) CreateContrast() {
 		where := "  b.SupplierTypeCode='01' and a.Id = " + strconv.Itoa(item.Id)
 		svc.GetPagingTmpCheckedEntities(&list, where)
 		if list != nil {
+			var supplierCertSubList []suppliercertsub.OilSupplierCertSub
 			total := svc.GetTableTotal(" SupplierTypeCode='01' AND SupplierId = " + strconv.Itoa(item.Id))
-			total1 := svc.GetTableTotal(" SupplierTypeCode='01' AND SubClassId = 0 AND SupplierId = " + strconv.Itoa(item.Id))
+			total1 := svc.GetNoSubCntTotal("a.SupplierTypeCode = '03' and b.`Name` is null and a.SupplierId = " + strconv.Itoa(item.Id))
 			list[0].SubCnt = int(total)
+			list[0].MinClassId = "0"
 			list[0].NoSubCnt = int(total1)
+			for _, sub := range supplierCertSubList {
+				var technologyClassList technologyserviceclass.OilTechnologyServiceClass
+				where2 := "Name = '"+ sub.Name + "'"
+				svc.GetEntityByWhere(OilTechnologyServiceClassName, where2, &technologyClassList)
+				if technologyClassList.Id > 0{
+					list[0].MinClassId = strconv.Itoa(technologyClassList.Id)
+				} else {
+					list[0].MinClassId = "0"
+					break
+				}
+			}
+			list[0].SetupTime = time.Now()
 			var oneTwo supplier.OilSupplierContrast
 			svc.GetEntityByCode("SupplierTypeCode = '01' and SupplierId = "+ strconv.Itoa(list[0].Id), &oneTwo)
 			list[0].OneTwoCount = oneTwo.OneTwoCount
@@ -3092,16 +3083,46 @@ func (this *OilGoodsAptitudeController) DeleteSuspend() {
 					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) {
 							err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &subDelete, cols, "Id = " + strconv.Itoa(itemSub.Id))
+							var model1 supplierpausereason.OilSupplierPauseReason
+							model1.SupplierId = item.Id
+							model1.CertSubId = itemSub.Id
+							model1.CertSubStatus = "2"
+							model1.SupplierCertId = itemSub.SupplierCertId
+							model1.BackReason = "老数据导入缺资质"
+							model1.CreateOn = time.Now()
+							model1.CreateBy = this.User.Realname
+							model1.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
+							svc.InsertEntityBytbl(OilSupplierPauseReasonName, &model1)
 							break
 						}
 					} else if i > 10 {
 						if value == "1" && strings.Index(item.HeaderCodes, "F"+strconv.Itoa(i)) < 0 {
 							err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &subDelete, cols, "Id = " + strconv.Itoa(itemSub.Id))
+							var model1 supplierpausereason.OilSupplierPauseReason
+							model1.SupplierId = item.Id
+							model1.CertSubId = itemSub.Id
+							model1.CertSubStatus = "2"
+							model1.SupplierCertId = itemSub.SupplierCertId
+							model1.BackReason = "老数据导入缺资质"
+							model1.CreateOn = time.Now()
+							model1.CreateBy = this.User.Realname
+							model1.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
+							svc.InsertEntityBytbl(OilSupplierPauseReasonName, &model1)
 							break
 						}
 					} else {
 						if value == "1" && strings.Index(item.HeaderCodes, "F0"+strconv.Itoa(i)) < 0 {
 							err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &subDelete, cols, "Id = " + strconv.Itoa(itemSub.Id))
+							var model1 supplierpausereason.OilSupplierPauseReason
+							model1.SupplierId = item.Id
+							model1.CertSubId = itemSub.Id
+							model1.CertSubStatus = "2"
+							model1.SupplierCertId = itemSub.SupplierCertId
+							model1.BackReason = "老数据导入缺资质"
+							model1.CreateOn = time.Now()
+							model1.CreateBy = this.User.Realname
+							model1.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
+							svc.InsertEntityBytbl(OilSupplierPauseReasonName, &model1)
 							break
 						}
 					}

+ 571 - 10
src/dashoo.cn/backend/api/controllers/oilsupplier/technologyservice.go

@@ -3,6 +3,7 @@ package oilsupplier
 import (
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
 	"dashoo.cn/backend/api/business/oilsupplier/supplierdataentry"
+	"dashoo.cn/backend/api/business/oilsupplier/supplierpausereason"
 	"dashoo.cn/backend/api/business/oilsupplier/tableheader"
 	"dashoo.cn/backend/api/business/oilsupplier/technologyserviceclass"
 	"dashoo.cn/backend/api/business/workflow"
@@ -1126,9 +1127,10 @@ func (this *OilTechnologyServiceController) ImportExcel() {
 	}()
 
 	codemap := make(map[string]int)
+	arrLength := len(sheet.Rows[1].Cells)
 	for i := 1; i < len(sheet.Rows); i++ {
 		lineNo := strconv.Itoa(i + 1)
-		this.OperationCell(svc, lineNo, columnArr, codemap, sheet.Rows[i].Cells, &errLineNum)
+		this.OperationCell(svc, lineNo, columnArr, codemap, sheet.Rows[i].Cells, &errLineNum, arrLength)
 	}
 	os.Remove(filePath)
 
@@ -1149,7 +1151,7 @@ func (this *OilTechnologyServiceController) ImportExcel() {
 	}
 }
 
-func (this *OilTechnologyServiceController) OperationCell(svc *technologyservice.OilTechnologySession, lineNo string, columnArr []string, codemap map[string]int, cellsArr []*xlsx.Cell, errLineNum *string) {
+func (this *OilTechnologyServiceController) OperationCell(svc *technologyservice.OilTechnologySession, lineNo string, columnArr []string, codemap map[string]int, cellsArr []*xlsx.Cell, errLineNum *string, arrLength int) {
 
 	defer func() {
 		if err := recover(); err != nil {
@@ -1159,20 +1161,24 @@ func (this *OilTechnologyServiceController) OperationCell(svc *technologyservice
 	}()
 	parentId := 0
 	classId := 0
-	cellsArrLen := len(cellsArr)
+	//cellsArrLen := len(cellsArr)
+	cellsArrLen := arrLength
 	var valstr = ""
 
-	for i := 2; i < cellsArrLen; {
-		if i < 10 {
+	for i := 0; i < cellsArrLen; {
+		if i < 8 {
 			var entity technologyserviceclass.Tmp_OilTechnologyServiceClass
 			cellval := strings.TrimSpace(cellsArr[i].String())
 			fmt.Println(cellval)
 			if cellval != "" {
 				_, has := codemap[cellval]
 				if !has {
-					if i != 2 {
+					if i > 2 {
 						upcode := cellsArr[i-2].String()
 						parentId = codemap[upcode]
+					} else {
+						upcode := cellsArr[0].String()
+						parentId = codemap[upcode]
 					}
 					entity.Code = cellval
 					entity.Name = strings.TrimSpace(cellsArr[i+1].String())
@@ -1193,8 +1199,8 @@ func (this *OilTechnologyServiceController) OperationCell(svc *technologyservice
 				}
 			}
 		}
-		if i >= 10 {
-			valstr += "'" + cellsArr[i].String() + "',"
+		if i >= 8 {
+			valstr += "'" + strings.TrimLeft(cellsArr[i].String(), " ") + "',"
 			i++
 		} else {
 			i += 2
@@ -1204,12 +1210,15 @@ func (this *OilTechnologyServiceController) OperationCell(svc *technologyservice
 	valstr = strings.Replace(valstr, "是", "1", -1)
 	log.Println(cellsArr[0].String() + "==" + valstr)
 	var columnstr = ""
-	for l := 0; l < cellsArrLen-9; l++ {
+	for l := 0; l < cellsArrLen-7; l++ {
 		columnstr += columnArr[l] + ","
 	}
 	columnstr = strings.Trim(columnstr, ",")
 	valstr = strconv.Itoa(classId) + "," + valstr
-	err := svc.InsertTmpTechnology(columnstr, valstr)
+	var err error
+	if classId > 0 {
+		err = svc.InsertTmpTechnology(columnstr, valstr)
+	}
 	if err != nil {
 		panic(err)
 	}
@@ -1660,3 +1669,555 @@ func (this *OilTechnologyServiceController) TruncateImport() {
 
 }
 
+// @Title 导出到execl
+// @Description 导出到execl
+// @Success	200	{object} controllers.Request
+// @router /exportexecl [post]
+func (this *OilTechnologyServiceController) ExeclExport() {
+	// 填物资类信息表首页信息
+	svcActiviti := workflow.GetActivitiService(utils.DBE)
+	svc := technologyservice.GetOilTechnologyServiceService(utils.DBE)
+	var list2 []supplier.OilSupplierContrast
+	where := " 1=1"
+	svc.GetMyPagingEntitiesWithOrderBytbl("OilSupplierTecContrast", 0,0, "Id", false, &list2, where)
+
+	fileName := "资质导入对比表.xlsx"
+	Url := utils.Cfg.MustValue("workflow", "ContrastExcel")
+
+	var datamap = make(map[string]interface{})
+	datamap["data"] = list2
+	retDocUrl := svcActiviti.ContrastExcel(datamap, Url, fileName)
+	var datainfo ErrorDataInfo
+	datainfo.Code = 0
+	datainfo.Item = retDocUrl
+	datainfo.Message = "打印成功"
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+
+}
+
+// @Title 新导入资质后,比对不合格的准入用户
+// @Description 对比列表
+// @Success 200 {object} []supplier.OilSupplierSelect
+// @router /get-compare-tmp-supplier [get]
+func (this *OilTechnologyServiceController) GetCompareTmpSupplier() {
+	//获取分页信息
+	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")
+	SupplierId := this.GetString("SupplierId")
+	SupplierCertId := this.GetString("SupplierCertId")
+	SupplierTypeCode := this.GetString("SupplierTypeCode")
+	Code := this.GetString("Code")
+	Name := this.GetString("Name")
+	Remark := this.GetString("Remark")
+	IsDelete := this.GetString("IsDelete")
+	CreateOn := this.GetString("CreateOn")
+	CreateUserId := this.GetString("CreateUserId")
+	CreateBy := this.GetString("CreateBy")
+	ModifiedOn := this.GetString("ModifiedOn")
+	ModifiedUserId := this.GetString("ModifiedUserId")
+	ModifiedBy := this.GetString("ModifiedBy")
+
+	if Id != "" {
+		where = where + " and Id like '%" + Id + "%'"
+	}
+
+	if SupplierId != "" {
+		where = where + " and SupplierId like '%" + SupplierId + "%'"
+	}
+
+	if SupplierCertId != "" {
+		where = where + " and SupplierCertId = '" + SupplierCertId + "'"
+	}
+
+	if SupplierTypeCode != "" {
+		where = where + " and SupplierTypeCode = '" + SupplierTypeCode + "'"
+	}
+
+	if Code != "" {
+		where = where + " and Code like '%" + Code + "%'"
+	}
+
+	if Name != "" {
+		where = where + " and Name like '%" + Name + "%'"
+	}
+
+	if Remark != "" {
+		where = where + " and Remark like '%" + Remark + "%'"
+	}
+
+	if IsDelete != "" {
+		where = where + " and IsDelete like '%" + IsDelete + "%'"
+	}
+
+	if CreateUserId != "" {
+		where = where + " and CreateUserId like '%" + CreateUserId + "%'"
+	}
+
+	if CreateBy != "" {
+		where = where + " and CreateBy like '%" + CreateBy + "%'"
+	}
+
+	if ModifiedOn != "" {
+		where = where + " and ModifiedOn like '%" + ModifiedOn + "%'"
+	}
+
+	if ModifiedUserId != "" {
+		where = where + " and ModifiedUserId like '%" + ModifiedUserId + "%'"
+	}
+
+	if ModifiedBy != "" {
+		where = where + " and ModifiedBy like '%" + ModifiedBy + "%'"
+	}
+
+	if CreateOn != "" {
+		dates := strings.Split(CreateOn, ",")
+		if len(dates) == 2 {
+			minDate := dates[0]
+			maxDate := dates[1]
+			where = where + " and CreateOn>='" + minDate + "' and CreateOn<='" + maxDate + "'"
+		}
+	}
+	svc := technologyservice.GetOilTechnologyServiceService(utils.DBE)
+	var list2 []supplier.OilSupplierContrast
+
+	total := svc.GetMyPagingEntitiesWithOrderBytbl("OilSupplierTecContrast", page.CurrentPage, page.Size, orderby, asc, &list2, where)
+	var datainfo DataInfo
+	datainfo.Items = list2
+	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} []goodsaptitude.OilGoodsAptitude
+// @router /comparelist [get]
+func (this *OilTechnologyServiceController) GetCompareList() {
+
+	//获取分页信息
+	page := this.GetPageInfoForm()
+	where := " 1=1 "
+	orderby := "Code"
+	asc := true
+	Order := this.GetString("Order")
+	Prop := this.GetString("Prop")
+	Conditions := this.GetString("Conditions")
+	if Conditions == "1" {
+		// 匹配上
+		where += " and b.Name = tmpb.Name"
+	} else if Conditions == "4" {
+		// 旧表有新表没
+		where += " and tmpb.Name is null"
+	} else if Conditions == "5" {
+		// 新表有,旧表没
+		where += " and tmpb.Name is null"
+	} else if Conditions == "6" {
+		// 资质+级别匹配
+		where += " and b.Name = tmpb.Name and (a.F01 = tmpa.F01 or (tmpa.F01 = '' && a.F01 is null)) and (a.F02 = tmpa.F02 or (tmpa.F02 = '' && a.F02 is null)) and (a.F03 = tmpa.F03 or (tmpa.F03 = '' && a.F03 is null)) and (a.F04 = tmpa.F04 or (tmpa.F04 = '' && a.F04 is null)) and (a.F05 = tmpa.F05 or (tmpa.F05 = '' && a.F05 is null)) and (a.F06 = tmpa.F06 or (tmpa.F06 = '' && a.F06 is null)) and (a.F07 = tmpa.F07 or (tmpa.F07 = '' && a.F07 is null)) and (a.F08 = tmpa.F08 or (tmpa.F08 = '' && a.F08 is null)) and (a.F09 = tmpa.F09 or (tmpa.F09 = '' && a.F09 is null)) and (a.F10 = tmpa.F10 or (tmpa.F10 = '' && a.F10 is null))" +
+			" and (a.F11 = tmpa.F11 or (tmpa.F11 = '' && a.F11 is null)) and (a.F12 = tmpa.F12 or (tmpa.F12 = '' && a.F12 is null)) and (a.F13 = tmpa.F13 or (tmpa.F13 = '' && a.F13 is null)) and (a.F14 = tmpa.F14 or (tmpa.F14 = '' && a.F14 is null)) and (a.F15 = tmpa.F15 or (tmpa.F15 = '' && a.F15 is null)) and (a.F16 = tmpa.F16 or (tmpa.F16 = '' && a.F16 is null)) and (a.F17 = tmpa.F17 or (tmpa.F17 = '' && a.F17 is null)) and (a.F18 = tmpa.F18 or (tmpa.F18 = '' && a.F18 is null)) and (a.F19 = tmpa.F19 or (tmpa.F19 = '' && a.F19 is null)) and (a.F20 = tmpa.F20 or (tmpa.F20 = '' && a.F20 is null))" +
+			" and (a.F21 = tmpa.F21 or (tmpa.F21 = '' && a.F21 is null)) and (a.F22 = tmpa.F22 or (tmpa.F22 = '' && a.F22 is null)) and (a.F23 = tmpa.F23 or (tmpa.F23 = '' && a.F23 is null)) and (a.F24 = tmpa.F24 or (tmpa.F24 = '' && a.F24 is null)) and (a.F25 = tmpa.F25 or (tmpa.F25 = '' && a.F25 is null)) and (a.F26 = tmpa.F26 or (tmpa.F26 = '' && a.F26 is null)) and (a.F27 = tmpa.F27 or (tmpa.F27 = '' && a.F27 is null)) and (a.F28 = tmpa.F28 or (tmpa.F28 = '' && a.F28 is null)) and (a.F29 = tmpa.F29 or (tmpa.F29 = '' && a.F29 is null)) and (a.F30 = tmpa.F30 or (tmpa.F30 = '' && a.F30 is null))" +
+			" and (a.F31 = tmpa.F31 or (tmpa.F31 = '' && a.F31 is null)) and (a.F32 = tmpa.F32 or (tmpa.F32 = '' && a.F32 is null)) and (a.F33 = tmpa.F33 or (tmpa.F33 = '' && a.F33 is null)) and (a.F34 = tmpa.F34 or (tmpa.F34 = '' && a.F34 is null)) and (a.F35 = tmpa.F35 or (tmpa.F35 = '' && a.F35 is null)) and (a.F36 = tmpa.F36 or (tmpa.F36 = '' && a.F36 is null)) and (a.F37 = tmpa.F37 or (tmpa.F37 = '' && a.F37 is null)) and (a.F38 = tmpa.F38 or (tmpa.F38 = '' && a.F38 is null)) and (a.F39 = tmpa.F39 or (tmpa.F39 = '' && a.F39 is null)) and (a.F40 = tmpa.F40 or (tmpa.F40 = '' && a.F40 is null))" +
+			" and (a.F41 = tmpa.F41 or (tmpa.F41 = '' && a.F41 is null)) and (a.F42 = tmpa.F42 or (tmpa.F42 = '' && a.F42 is null)) and (a.F43 = tmpa.F43 or (tmpa.F43 = '' && a.F43 is null)) and (a.F44 = tmpa.F44 or (tmpa.F44 = '' && a.F44 is null)) and (a.F45 = tmpa.F45 or (tmpa.F45 = '' && a.F45 is null)) and (a.F46 = tmpa.F46 or (tmpa.F46 = '' && a.F46 is null)) and (a.F47 = tmpa.F47 or (tmpa.F47 = '' && a.F47 is null)) and (a.F48 = tmpa.F48 or (tmpa.F48 = '' && a.F48 is null)) and (a.F49 = tmpa.F49 or (tmpa.F49 = '' && a.F49 is null)) and (a.F50 = tmpa.F50 or (tmpa.F50 = '' && a.F50 is null))" +
+			" and (a.F51 = tmpa.F51 or (tmpa.F51 = '' && a.F51 is null)) and (a.F52 = tmpa.F52 or (tmpa.F52 = '' && a.F52 is null))"
+		}
+	if Order != "" && Prop != "" {
+		orderby = Prop
+		if Order == "asc" {
+			asc = true
+		} else {
+			asc = false
+		}
+	}
+	CreateOn := this.GetString("CreateOn")
+	Code := this.GetString("Code")
+	Name := this.GetString("Name")
+	BigClassName := this.GetString("BigClassName")
+	BigClassCode := this.GetString("BigClassCode")
+	MiddleClassName := this.GetString("MiddleClassName")
+	SmallClassName := this.GetString("SmallClassName")
+	GoodsName := this.GetString("GoodsName")
+	GoodsLevel := this.GetString("GoodsLevel")
+	GoodsDesc := this.GetString("GoodsDesc")
+	Standard := this.GetString("Standard")
+	CompanyType := this.GetString("CompanyType")
+
+	if Code != "" {
+		where = where + " and b.Code like '%" + Code + "%'"
+	}
+
+	if Name != "" {
+		where = where + " and b.Name like '%" + Name + "%'"
+	}
+
+	if BigClassName != "" {
+		where = where + " and Name1 like '%" + BigClassName + "%'"
+	}
+
+	if BigClassCode != "" {
+		where = where + " and Code1 like '%" + BigClassCode + "%'"
+	}
+
+	if MiddleClassName != "" {
+		where = where + " and Name2 like '%" + MiddleClassName + "%'"
+	}
+
+	if SmallClassName != "" {
+		where = where + " and  Name3 like '%" + SmallClassName + "%'"
+	}
+
+	if GoodsName != "" {
+		where = where + " and Name4 like '%" + GoodsName + "%'"
+	}
+
+	if GoodsLevel != "" {
+		where = where + " and GoodsLevel like '%" + GoodsLevel + "%'"
+	}
+
+	if GoodsDesc != "" {
+		where = where + " and GoodsDesc like '%" + GoodsDesc + "%'"
+	}
+
+	if Standard != "" {
+		where = where + " and  Standard '%" + Standard + "%'"
+	}
+
+	if CompanyType != "" {
+		where = where + " and  CompanyType '%" + CompanyType + "%'"
+	}
+
+	if CreateOn != "" {
+		dates := strings.Split(CreateOn, ",")
+		if len(dates) == 2 {
+			minDate := dates[0]
+			maxDate := dates[1]
+			where = where + " and CreateOn>='" + minDate + "' and CreateOn<='" + maxDate + "'"
+		}
+	}
+
+	svc := technologyservice.GetOilTechnologyServiceService(utils.DBE)
+	var list []technologyservice.OilTechnologyServiceTmp
+	total := svc.GetPClassEntities(page.CurrentPage, page.Size, orderby, asc, &list, where, Conditions)
+	var datainfo DataInfo
+	datainfo.Items = list
+	datainfo.CurrentItemCount = total
+	datainfo.PageIndex = page.CurrentPage
+	datainfo.ItemsPerPage = page.Size
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}
+
+// @Title get 生成对比列表
+// @Description get SampleType by token
+// @Success 200 {object} sampletype.SampleType
+// @router /create-contrast [get]
+func (this *OilTechnologyServiceController) CreateContrast() {
+	svc := technologyservice.GetOilTechnologyServiceService(utils.DBE)
+	svc.TruncateTable("OilSupplierTecContrast")
+	// 插入对比列表
+	var list1 []supplier.OilSupplier
+	svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, 0, 0, "Id", false, &list1, " 1=1")
+	svc.DBE.Query("SET unique_checks=0;")
+	svc.DBE.Query("SET autocommit=0;")
+	for _, item := range list1 {
+		var list []supplier.OilSupplierContrast
+		where := "  b.SupplierTypeCode='03' and a.Id = " + strconv.Itoa(item.Id)
+		svc.GetPagingTmpCheckedEntities(&list, where)
+		if list != nil {
+			var supplierCertSubList []suppliercertsub.OilSupplierCertSub
+			total := svc.GetTableTotal(" SupplierTypeCode='03' AND SupplierId = " + strconv.Itoa(item.Id), &supplierCertSubList)
+			total1 := svc.GetNoSubCntTotal("a.SupplierTypeCode = '03' and c.ClassId is null and a.SupplierId = " + strconv.Itoa(item.Id))
+			list[0].SubCnt = int(total)
+			list[0].MinClassId = "0"
+			list[0].NoSubCnt = int(total1)
+			for _, sub := range supplierCertSubList {
+				var technologyClassList technologyserviceclass.OilTechnologyServiceClass
+				where2 := "Name = '"+ sub.Name + "'"
+				svc.GetEntityByWhere(Tmp_TechnologyClassName, where2, &technologyClassList)
+				if technologyClassList.Id > 0{
+					list[0].MinClassId = strconv.Itoa(technologyClassList.Id)
+				} else {
+					list[0].MinClassId = "0"
+					break
+				}
+			}
+			list[0].SetupTime = time.Now()
+			svc.InsertEntityBytbl("OilSupplierTecContrast", list[0])
+			svc.DBE.Query("commit;")
+		}
+	}
+	svc.DBE.Query("SET unique_checks=1;")
+	svc.DBE.Query("SET autocommit=1;")
+	var errorinfo ErrorInfo
+	errorinfo.Code = 0
+	errorinfo.Message = "成功!"
+	this.Data["json"] = &errorinfo
+	this.ServeJSON()
+}
+
+// @Title 查看对比列表的准入范围 2020-12-18
+// @Description get user by token
+// @Success 200 {object} []suppliercertsub.OilSupplierCertSub
+// @router /delcertsublist [get]
+func (this *OilTechnologyServiceController) GetDelCertSubList() {
+	//获取分页信息
+	page := this.GetPageInfoForm()
+	where := " 1=1 "
+	orderby := "a.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")
+	SupplierId := this.GetString("SupplierId")
+	SupplierCertId := this.GetString("SupplierCertId")
+	SupplierTypeCode := this.GetString("SupplierTypeCode")
+	Code := this.GetString("Code")
+	Name := this.GetString("Name")
+	Remark := this.GetString("Remark")
+	IsDelete := this.GetString("IsDelete")
+	CreateOn := this.GetString("CreateOn")
+	CreateUserId := this.GetString("CreateUserId")
+	CreateBy := this.GetString("CreateBy")
+	ModifiedOn := this.GetString("ModifiedOn")
+	ModifiedUserId := this.GetString("ModifiedUserId")
+	ModifiedBy := this.GetString("ModifiedBy")
+
+	if Id != "" {
+		where = where + " and a.Id like '%" + Id + "%'"
+	}
+
+	if SupplierId != "" {
+		where = where + " and a.SupplierId like '%" + SupplierId + "%'"
+	}
+
+	if SupplierCertId != "" {
+		where = where + " and a.SupplierCertId = '" + SupplierCertId + "'"
+	}
+
+	if SupplierTypeCode != "" {
+		where = where + " and a.SupplierTypeCode = '" + SupplierTypeCode + "'"
+	}
+
+	if Code != "" {
+		where = where + " and a.Code like '%" + Code + "%'"
+	}
+
+	if Name != "" {
+		where = where + " and a.Name like '%" + Name + "%'"
+	}
+
+	if Remark != "" {
+		where = where + " and a.Remark like '%" + Remark + "%'"
+	}
+
+	if IsDelete != "" {
+		where = where + " and a.IsDelete like '%" + IsDelete + "%'"
+	}
+
+	if CreateUserId != "" {
+		where = where + " and a.CreateUserId like '%" + CreateUserId + "%'"
+	}
+
+	if CreateBy != "" {
+		where = where + " and a.CreateBy like '%" + CreateBy + "%'"
+	}
+
+	if ModifiedOn != "" {
+		where = where + " and a.ModifiedOn like '%" + ModifiedOn + "%'"
+	}
+
+	if ModifiedUserId != "" {
+		where = where + " and a.ModifiedUserId like '%" + ModifiedUserId + "%'"
+	}
+
+	if ModifiedBy != "" {
+		where = where + " and a.ModifiedBy like '%" + ModifiedBy + "%'"
+	}
+
+	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 + "'"
+		}
+	}
+	where = where + " and a.Type in (1, 3)"
+	svc := technologyservice.GetOilTechnologyServiceService(utils.DBE)
+	var list []suppliercertsub.OilSupplierCertSub1
+	var co supplier.OilSupplierContrast
+	svc.GetEntityById(SupplierId, &co)
+	if co.IsDelete == 1 {
+		where += " and a.IsQuestion = 1"
+	}
+	total := svc.GetPagingTmpSubEntities(page.CurrentPage, page.Size, orderby, asc, &list, where)
+	a := 0
+	for _, item := range list {
+		sql := "SELECT CONCAT_WS(',',IF(ifnull(F01, '') = '', '', F01),IF(ifnull(F02, '') = '', '', F02),IF(ifnull(F03, '') = '', '', F03),IF(ifnull(F04, '') = '', '', F04),IF(ifnull(F05, '') = '', '', F05),IF(ifnull(F06, '') = '', '', F06),IF(ifnull(F07, '') = '', '', F07),IF(ifnull(F08, '') = '', '', F08),IF(ifnull(F09, '') = '', '', F09),IF(ifnull(F10, '') = '', '', F10),IF(ifnull(F11, '') = '', '', F11),IF(ifnull(F12, '') = '', '', F12),IF(ifnull(F13, '') = '', '', F13),IF(ifnull(F14, '') = '', '', F14),IF(ifnull(F15, '') = '', '', F15),IF(ifnull(F16, '') = '', '', F16),IF(ifnull(F17, '') = '', '', F17),IF(ifnull(F18, '') = '', '', F18),IF(ifnull(F19, '') = '', '', F19),IF(ifnull(F20, '') = '', '', F20),IF(ifnull(F21, '') = '', '', F21),IF(ifnull(F22, '') = '', '', F22),IF(ifnull(F23, '') = '', '', F23),IF(ifnull(F24, '') = '', '', F24),IF(ifnull(F25, '') = '', '', F25),IF(ifnull(F26, '') = '', '', F26),IF(ifnull(F27, '') = '', '', F27),IF(ifnull(F28, '') = '', '', F28),IF(ifnull(F29, '') = '', '', F29),IF(ifnull(F30, '') = '', '', F30),IF(ifnull(F31, '') = '', '', F31),IF(ifnull(F32, '') = '', '', F32),IF(ifnull(F33, '') = '', '', F33),IF(ifnull(F34, '') = '', '', F34),IF(ifnull(F35, '') = '', '', F35),IF(ifnull(F36, '') = '', '', F36),IF(ifnull(F37, '') = '', '', F37),IF(ifnull(F38, '') = '', '', F38),IF(ifnull(F39, '') = '', '', F39),IF(ifnull(F40, '') = '', '', F40),IF(ifnull(F41, '') = '', '', F41),IF(ifnull(F42, '') = '', '', F42),IF(ifnull(F43, '') = '', '', F43),IF(ifnull(F44, '') = '', '', F44),IF(ifnull(F45, '') = '', '', F45),IF(ifnull(F46, '') = '', '', F46),IF(ifnull(F47, '') = '', '', F47),IF(ifnull(F48, '') = '', '', F48),IF(ifnull(F49, '') = '', '', F49),IF(ifnull(F50, '') = '', '', F50),IF(ifnull(F51, '') = '', '', F51),IF(ifnull(F52, '') = '', '', F52)) AS Codes FROM Tmp_OilTechnologyService a LEFT JOIN Tmp_OilTechnologyServiceClass class ON a.ClassId = class.Id"
+		sql += " where class.Name = '"+ item.Name + "'"
+		model, _ := svc.DBE.QueryString(sql)
+		if model != nil {
+			code := strings.Split(model[0]["Codes"], ",")
+			i := 1
+			for _, value := range code {
+				if i == 41 || i == 42 || i == 1 {
+					if (code[0] == "1" && strings.Index(item.HeaderCodes, "F01") < 0) && (code[40] == "1" && strings.Index(item.HeaderCodes, "F41") < 0) && (code[41] == "1" && strings.Index(item.HeaderCodes, "F42") < 0) {
+						list[a].Checked = 1
+						sql1 := "select Name from Base_TableHeader where Code = 'F01' and CategoryCode = '03'"
+						model1, _ := svc.DBE.QueryString(sql1)
+						if strings.Index(list[a].HeaderName, model1[0]["Name"]) == -1 {
+							list[a].HeaderName += model1[0]["Name"] + " "
+						}
+					}
+				} else if i > 10 {
+					if value == "1" && strings.Index(item.HeaderCodes, "F"+strconv.Itoa(i)) < 0 {
+						list[a].Checked = 1
+						sql1 := "select Name from Base_TableHeader where Code = 'F"+strconv.Itoa(i)+"' and CategoryCode = '03'"
+						model1, _ := svc.DBE.QueryString(sql1)
+						list[a].HeaderName += model1[0]["Name"]+ " "
+					}
+				} else {
+					if value == "1" && strings.Index(item.HeaderCodes, "F0"+strconv.Itoa(i)) < 0 {
+						list[a].Checked = 1
+						sql1 := "select Name from Base_TableHeader where Code = 'F0"+strconv.Itoa(i)+"' and CategoryCode = '03'"
+						model1, _ := svc.DBE.QueryString(sql1)
+						list[a].HeaderName += model1[0]["Name"]+ " "
+					}
+				}
+				i += 1
+			}
+		} else {
+			list[a].MinClassId = "0"
+		}
+		a += 1
+	}
+	var datainfo DataInfo
+	datainfo.Items = list
+	datainfo.CurrentItemCount = total
+	datainfo.PageIndex = page.CurrentPage
+	datainfo.ItemsPerPage = page.Size
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}
+
+// @Title 确认更新后的删除/暂停企业准入范围 2020-12-18
+// @Description 修改实体
+// @Success	200	{object} controllers.Request
+// @router /delete-suspend [post]
+func (this *OilTechnologyServiceController) DeleteSuspend() {
+	var errinfo ErrorInfo
+	var err error
+	var list []supplier.OilSupplierContrast
+	svc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
+	//svc.GetEntitysByWhere("OilSupplierContrast", "TwoOneCount = 0", &list)
+	svc.GetEntitysByWhere("OilSupplierTecContrast", "1=1", &list)
+	for _,item := range list{
+		var sub []suppliercertsub.OilSupplierCertSub
+		svc.GetEntitysByWhere("OilSupplierCertSub", "SupplierTypeCode = '03' and SupplierId = " + strconv.Itoa(item.Id), &sub)
+		for _, itemSub := range sub {
+			sql := "SELECT CONCAT_WS(',',IF(ifnull(F01, '') = '', '', F01),IF(ifnull(F02, '') = '', '', F02),IF(ifnull(F03, '') = '', '', F03),IF(ifnull(F04, '') = '', '', F04),IF(ifnull(F05, '') = '', '', F05),IF(ifnull(F06, '') = '', '', F06),IF(ifnull(F07, '') = '', '', F07),IF(ifnull(F08, '') = '', '', F08),IF(ifnull(F09, '') = '', '', F09),IF(ifnull(F10, '') = '', '', F10),IF(ifnull(F11, '') = '', '', F11),IF(ifnull(F12, '') = '', '', F12),IF(ifnull(F13, '') = '', '', F13),IF(ifnull(F14, '') = '', '', F14),IF(ifnull(F15, '') = '', '', F15),IF(ifnull(F16, '') = '', '', F16),IF(ifnull(F17, '') = '', '', F17),IF(ifnull(F18, '') = '', '', F18),IF(ifnull(F19, '') = '', '', F19),IF(ifnull(F20, '') = '', '', F20),IF(ifnull(F21, '') = '', '', F21),IF(ifnull(F22, '') = '', '', F22),IF(ifnull(F23, '') = '', '', F23),IF(ifnull(F24, '') = '', '', F24),IF(ifnull(F25, '') = '', '', F25),IF(ifnull(F26, '') = '', '', F26),IF(ifnull(F27, '') = '', '', F27),IF(ifnull(F28, '') = '', '', F28),IF(ifnull(F29, '') = '', '', F29),IF(ifnull(F30, '') = '', '', F30),IF(ifnull(F31, '') = '', '', F31),IF(ifnull(F32, '') = '', '', F32),IF(ifnull(F33, '') = '', '', F33),IF(ifnull(F34, '') = '', '', F34),IF(ifnull(F35, '') = '', '', F35),IF(ifnull(F36, '') = '', '', F36),IF(ifnull(F37, '') = '', '', F37),IF(ifnull(F38, '') = '', '', F38),IF(ifnull(F39, '') = '', '', F39),IF(ifnull(F40, '') = '', '', F40),IF(ifnull(F41, '') = '', '', F41),IF(ifnull(F42, '') = '', '', F42),IF(ifnull(F43, '') = '', '', F43),IF(ifnull(F44, '') = '', '', F44),IF(ifnull(F45, '') = '', '', F45),IF(ifnull(F46, '') = '', '', F46),IF(ifnull(F47, '') = '', '', F47),IF(ifnull(F48, '') = '', '', F48),IF(ifnull(F49, '') = '', '', F49),IF(ifnull(F50, '') = '', '', F50),IF(ifnull(F51, '') = '', '', F51),IF(ifnull(F52, '') = '', '', F52)) AS Codes,Code FROM Tmp_OilTechnologyService a LEFT JOIN Tmp_OilTechnologyServiceClass class ON a.ClassId = class.Id"
+			sql += " where class.Name = '"+ itemSub.Name + "'"
+			model, _ := svc.DBE.QueryString(sql)
+			var subDelete suppliercertsub.OilSupplierCertSub
+			if model != nil {
+				code := strings.Split(model[0]["Codes"], ",")
+				cols := []string{"Code"}
+				subDelete.Code = model[0]["Code"]
+
+				// 修改
+				err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &subDelete, cols, "Id = "+strconv.Itoa(itemSub.Id))
+				cols = append(cols, "DueTime")
+				cols = append(cols, "CertSubStatus")
+				subDelete.CertSubStatus = "2"
+				//subDelete.DueTime = "2021-06-06 00:00:00"
+				paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
+				subDelete.DueTime = paramSvc.GetBaseparameterMessage("GFZT", "paramset", "Suspend")
+				i := 1
+				//暂停
+				for _, value := range code {
+					if i == 41 || i == 42 || i == 1 {
+						if (code[0] == "1" && strings.Index(item.HeaderCodes, "F01") < 0) && (code[40] == "1" && strings.Index(item.HeaderCodes, "F41") < 0) && (code[41] == "1" && strings.Index(item.HeaderCodes, "F42") < 0) {
+							err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &subDelete, cols, "Id = " + strconv.Itoa(itemSub.Id))
+							var model1 supplierpausereason.OilSupplierPauseReason
+							model1.SupplierId = item.Id
+							model1.CertSubId = itemSub.Id
+							model1.CertSubStatus = "2"
+							model1.SupplierCertId = itemSub.SupplierCertId
+							model1.BackReason = "老数据导入缺资质"
+							model1.CreateOn = time.Now()
+							model1.CreateBy = this.User.Realname
+							model1.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
+							svc.InsertEntityBytbl(OilSupplierPauseReasonName, &model1)
+							break
+						}
+					} else if i > 10 {
+						if value == "1" && strings.Index(item.HeaderCodes, "F"+strconv.Itoa(i)) < 0 {
+							err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &subDelete, cols, "Id = " + strconv.Itoa(itemSub.Id))
+							var model1 supplierpausereason.OilSupplierPauseReason
+							model1.SupplierId = item.Id
+							model1.CertSubId = itemSub.Id
+							model1.CertSubStatus = "2"
+							model1.SupplierCertId = itemSub.SupplierCertId
+							model1.BackReason = "老数据导入缺资质"
+							model1.CreateOn = time.Now()
+							model1.CreateBy = this.User.Realname
+							model1.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
+							svc.InsertEntityBytbl(OilSupplierPauseReasonName, &model1)
+							break
+						}
+					} else {
+						if value == "1" && strings.Index(item.HeaderCodes, "F0"+strconv.Itoa(i)) < 0 {
+							err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &subDelete, cols, "Id = " + strconv.Itoa(itemSub.Id))
+							var model1 supplierpausereason.OilSupplierPauseReason
+							model1.SupplierId = item.Id
+							model1.CertSubId = itemSub.Id
+							model1.CertSubStatus = "2"
+							model1.SupplierCertId = itemSub.SupplierCertId
+							model1.BackReason = "老数据导入缺资质"
+							model1.CreateOn = time.Now()
+							model1.CreateBy = this.User.Realname
+							model1.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
+							svc.InsertEntityBytbl(OilSupplierPauseReasonName, &model1)
+							break
+						}
+					}
+					i += 1
+				}
+			} else {
+				// 删除
+				err = svc.DeleteEntityById(itemSub.Id, &subDelete)
+			}
+		}
+		//err = svc.DeleteTable("OilSupplierTecContrast", "Id = " + strconv.Itoa(item.Id))
+	}
+	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()
+	}
+}

+ 32 - 2
src/dashoo.cn/backend/api/controllers/tmpzcgf/tmpzcgf.go

@@ -434,7 +434,7 @@ func (this *TmpzcgfController) UpdateCertSubclassID() {
 	svc.GetEntities(&basisBuildList, where1)
 	for _, item := range basisBuildList {
 		sql := "UPDATE OilSupplierCertSub SET SubClassId = " + strconv.Itoa(item.Id)  +
-			" WHERE SupplierTypeCode = '02' and Code = '" + item.Code + "'"
+			" WHERE SupplierTypeCode = '02' and Name = '" + item.Name + "'"
 		svc.DBE.Query(sql)
 		svc.DBE.Query("COMMIT;")
 	}
@@ -444,7 +444,7 @@ func (this *TmpzcgfController) UpdateCertSubclassID() {
 	svc.GetEntities(&technologyServiceClassList, where2)
 	for _, item := range technologyServiceClassList {
 		sql := "UPDATE OilSupplierCertSub SET SubClassId = " + strconv.Itoa(item.Id)  +
-			" WHERE SupplierTypeCode = '03' and Code = '" + item.Code + "'"
+			" WHERE SupplierTypeCode = '03' and Name = '" + item.Name + "'"
 		svc.DBE.Query(sql)
 		svc.DBE.Query("COMMIT;")
 	}
@@ -903,3 +903,33 @@ func (this *TmpzcgfController) InsertAll() {
 	this.Data["json"] = &errinfo
 	this.ServeJSON()
 }
+
+
+// @Title 一键执行准入范围导入
+// @Description get user by token
+// @Success 200 {object}
+// @router /insertSubAll [get]
+func (this *TmpzcgfController) InsertSubAll() {
+	go func() {
+		svc := tmpzcgf.GetTmpzcgtService(utils.DBE)
+		sql := "truncate table OilSupplierCertSub"
+		svc.DBE.Query(sql)
+		this.InsertCertSub() // 准入
+		this.UpdateOilSupplierCertSub()
+		this.UpdateCertSubclassID()
+		var certsub suppliercertsub.OilSupplierCertSub
+		certsub.Remark = ""
+		certsub.ModifiedBy = ""
+		colssub := []string{
+			"Remark",
+			"ModifiedBy",
+		}
+		svc.UpdateEntityBywheretbl("OilSupplierCertSub", certsub, colssub, "")
+	}()
+
+	var errinfo ErrorInfo
+	errinfo.Message = "导入命令下达成功,详情请看后台运行日志,注意不要重复点击!"
+	errinfo.Code = 0
+	this.Data["json"] = &errinfo
+	this.ServeJSON()
+}

+ 12 - 0
src/dashoo.cn/frontend_web/src/api/oilsupplier/goodsaptitude.js

@@ -191,5 +191,17 @@ export default {
       method: 'get',
       params: params
     })
+  },
+  deleteSuspend (myAxios) {
+    return myAxios({
+      url: '/goodsaptitude/delete-suspend',
+      method: 'POST'
+    })
+  },
+  createContrast (myAxios) {
+    return myAxios({
+      url: '/goodsaptitude/create-contrast',
+      method: 'GET'
+    })
   }
 }

+ 32 - 0
src/dashoo.cn/frontend_web/src/api/oilsupplier/technologyservice.js

@@ -111,5 +111,37 @@ export default {
       url: '/technologyservice/exportpdf/' + tbid + '/' + typecode,
       method: 'post'
     })
+  },
+  execlexport (myAxios) {
+    return myAxios({
+      url: '/technologyservice/exportexecl/',
+      method: 'post'
+    })
+  },
+  getCompareTmpSupplier (params, myAxios) {
+    return myAxios({
+      url: '/technologyservice/get-compare-tmp-supplier',
+      method: 'get',
+      params: params
+    })
+  },
+  getCompareList (CreateOn, params, myAxios) {
+    return myAxios({
+      url: '/technologyservice/comparelist?CreateOn=' + CreateOn,
+      method: 'GET',
+      params: params
+    })
+  },
+  deleteSuspend (myAxios) {
+    return myAxios({
+      url: '/technologyservice/delete-suspend',
+      method: 'POST'
+    })
+  },
+  createContrast (myAxios) {
+    return myAxios({
+      url: '/technologyservice/create-contrast',
+      method: 'GET'
+    })
   }
 }

+ 10 - 3
src/dashoo.cn/frontend_web/src/pages/oilcontract/contract-import/index.vue

@@ -267,7 +267,7 @@
             style="width: 100%">
            <el-table-column type="index"  min-width="70" label="序号" align="center" show-overflow-tooltip></el-table-column>
            <el-table-column  prop="SourceSupplierName"  min-width="110" label="企业名称" align="center" show-overflow-tooltip></el-table-column>
-           <el-table-column  prop="SupplierName"  min-width="110" label="选择企业名称" align="center" show-overflow-tooltip >
+           <el-table-column  prop="SupplierName"  width="250" label="选择企业名称" align="center" show-overflow-tooltip >
              <template slot-scope="scope">
                <el-form-item  style="margin-bottom: 0px;" :prop="'tableData.' + scope.$index + '.SupplierId'" :rules="rules.name">
                  <el-select size="small" v-model="scope.row.SupplierId" ref="supplierIdSelect" placeholder="请选择" @change="onSelectContractClass(scope.$index)">
@@ -277,7 +277,7 @@
              </template>
            </el-table-column>
            <el-table-column  prop="SourceContractClass"  min-width="110" label="合同类别" align="center" show-overflow-tooltip></el-table-column>
-           <el-table-column  prop="ContractClass"  width="250" label="选择合同类别" align="center" show-overflow-tooltip >
+           <el-table-column  prop="ContractClass"  min-width="110" label="选择合同类别" align="center" show-overflow-tooltip >
              <template slot-scope="scope">
                 <el-form-item  style="margin-bottom: 0px;" :prop="'tableData.' + scope.$index + '.ContractClass'" :rules="rules.ContractClass">
                   <el-select size="small" v-model="scope.row.ContractClass" placeholder="请选择" style="width: 100%" >
@@ -333,7 +333,7 @@
         <el-row>
           <el-col :span="24">
             <el-upload :limit="1" style="margin-top: 10px;" action="" ref="refuploadattach"
-                       :http-request="uploadrequest" :before-remove="beforeRemove">
+                       :http-request="uploadrequest" :before-remove="beforeRemove" :before-upload="beforeAvatarUpload">
               <el-button size="small" type="primary">点击上传</el-button>
             </el-upload>
           </el-col>
@@ -1046,6 +1046,13 @@
         this.Excelurl = ''
         return true
       },
+      beforeAvatarUpload (file) {
+        if (file.name.indexOf('.xlsx') < 0) {
+          this.$message.error('文件格式必须为.xlsx')
+          return false
+        }
+        return true
+      },
       uploadrequest (option) {
         let _this = this
         if (process.client) {

+ 15 - 7
src/dashoo.cn/frontend_web/src/pages/oilsupplier/goodsaptitude/index.vue

@@ -860,15 +860,15 @@
         this.qualificaListvisible = true
         this.showimportvisible = false
       },
-      updatasuppiercertsub () {
+      deleteSuspend () {
         // this.$confirm('此操作将更新企业资质, 是否继续?', '提示', {
         //   confirmButtonText: '确定',
         //   cancelButtonText: '取消',
         //   type: 'warning'
         // }).then(() => {
-        this.importloading = true
-        api.updataSuppierCertSub(this.$axios).then(res => {
-          this.importloading = false
+        // this.importloading = true
+        api.deleteSuspend(this.$axios).then(res => {
+          // this.importloading = false
           if (res.data.code === 0) {
             this.$message({
               type: 'success',
@@ -912,10 +912,10 @@
             if (res.data.code === 0) {
               this.$message({
                 type: 'success',
-                message: res.data.message
+                message: res.data.message + ' 即将执行一键操作'
               })
               this.initDatas()
-              // this.updatasuppiercertsub()
+              this.deleteSuspend()
             } else {
               this.$message({
                 type: 'warning',
@@ -940,10 +940,11 @@
           if (res.data.code === 0) {
             this.$message({
               type: 'success',
-              message: res.data.message
+              message: res.data.message + " 即将生成对比列表"
             })
             this.importloading = false
             this.initImportDatas()
+            this.createContrast()
           } else if (res.data.code === -1) {
             this.errorDialogVisible = true
             this.textarea = res.data.message
@@ -955,6 +956,13 @@
           }
         })
       },
+      createContrast () {
+        api.createContrast(this.$axios).then(res => {
+
+        }).catch(err => {
+          console.error(err)
+        })
+      },
       uploadrequest (option) {
         let _this = this
         if (process.client) {

+ 12 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/goodsaptitude/tmpsuppliercheck.vue

@@ -88,7 +88,7 @@
                 </el-form>
               </span>
         </div>
-        <el-table :data="certsubList" border size="mini" :row-class-name="subRowClassName" v-loading="certsubListLoading">
+        <el-table :data="certsubList" border size="mini" :row-class-name="subRowClassName" :cell-style="subRowHover" v-loading="certsubListLoading">
 <!--          <el-table-column label="操作" width="160px" align="center" fixed="right" show-overflow-tooltip>-->
 <!--            <template slot-scope="scope">-->
 <!--              <el-button type="text" style="color: #F56C6C" @click="delcertsubbyid(scope.row)" title="删除" size="mini" icon="el-icon-delete" width="90px">删除</el-button>-->
@@ -294,6 +294,17 @@
           return "background-color:lightyellow"
         }
       },
+      subRowHover({row}) {
+        if (row.MinClassId == '0'){
+          return "background-color:pink"
+        }
+        if (row.Checked == "1") {
+          console.log(row.Checked, 'Checked')
+          return "background-color:lightyellow"
+        } else{
+          return "background-color:lightblue"
+        }
+      },
       searchCommand (command) {
         if (command === 'search') {
           this.dialogVisible = true

+ 47 - 12
src/dashoo.cn/frontend_web/src/pages/oilsupplier/technologyservice/index.vue

@@ -15,11 +15,11 @@
           </router-link>
           <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="exportExcel">导出
           </el-button>
-          <el-button type="primary" size="mini" style="margin-left:20px; margin-top: -4px;" @click="showimport">更新编码
+          <el-button type="warning" plain size="mini" style="margin-left:20px; margin-top: -4px;" @click="showimport">更新服务编码
           </el-button>
-          <router-link :to="'/oilsupplier/technologyservice/_opera/showdelcertsub'">
-            <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;">查看待删除准入项</el-button>
-          </router-link>
+<!--          <router-link :to="'/oilsupplier/technologyservice/_opera/showdelcertsub'">-->
+<!--            <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;">查看待删除准入项</el-button>-->
+<!--          </router-link>-->
         </span>
         <el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
           <el-form-item label="时间">
@@ -253,6 +253,10 @@
           </span>
           <span style="float: right;">
             <el-button type="primary" size="mini" style="margin-left:20px; margin-top: -4px;" @click="importExcel">导入</el-button>
+            <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="contrastList()">查看企业对比
+            </el-button>
+            <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="qualificaList()">查看资质对比
+            </el-button>
             <el-button type="warning" size="mini" style="margin-left:10px; margin-top: -4px;" @click="truncateimport()">清空所有导入
             </el-button>
             <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="confirmImport()">确认更新
@@ -304,6 +308,12 @@
         </el-pagination>
       </el-card>
     </el-dialog>
+    <el-dialog title="企业对比列表"  width="95%" top="5vh" :visible.sync="contrastListvisible">
+      <tmp-supplier-check v-if="contrastListvisible"></tmp-supplier-check>
+    </el-dialog>
+    <el-dialog title="资质对比列表"  width="95%" top="5vh" :visible.sync="qualificaListvisible">
+      <tmp-class-check v-if="qualificaListvisible"></tmp-class-check>
+    </el-dialog>
 
     <el-dialog title="高级查询" :visible.sync="importDialogVisible" width="720px">
       <el-form ref="advancedsearchForm" label-width="110px">
@@ -405,7 +415,9 @@
         </el-row>
       </el-form>
     </el-dialog>
-
+    <el-dialog title="导入失败" :visible.sync="errorDialogVisible" :close-on-click-modal = "false" width="720px">
+      <el-input type="textarea" autosize placeholder="请输入内容" v-model="textarea"></el-input>
+    </el-dialog>
   </div>
 </template>
 <script>
@@ -416,6 +428,8 @@
   import setapi from '@/api/oilsupplier/oilclassorgset'
   import axios from 'axios'
   import uploadajax from '@/assets/js/uploadajax.js'
+  import tmpSupplierCheck from './tmpsuppliercheck'
+  import tmpClassCheck from './tmpclasscheck'
 
   export default {
     computed: {
@@ -423,6 +437,10 @@
         authUser: 'authUser'
       })
     },
+    components: {
+      tmpSupplierCheck,
+      tmpClassCheck
+    },
     name: 'oiltechnologyservice',
 
     data() {
@@ -434,6 +452,8 @@
         importDialogVisible: false,
         importloading: false,
         showimportvisible: false,
+        contrastListvisible: false,
+        qualificaListvisible: false,
         loading: false,
         codeeditshow: false,
         classid: '',
@@ -735,6 +755,21 @@
           console.error(err)
         })
       },
+      createContrast () {
+        api.createContrast(this.$axios).then(res => {
+
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+      contrastList () {
+        this.contrastListvisible = true
+        this.showimportvisible = false
+      },
+      qualificaList () {
+        this.qualificaListvisible = true
+        this.showimportvisible = false
+      },
       importExcel () {
         this.uploadshow = true
       },
@@ -760,10 +795,8 @@
           })
         })
       },
-      updatasuppiercertsub () {
-        this.importloading = true
-        api.updataSuppierCertSub(this.$axios).then(res => {
-          this.importloading = false
+      deleteSuspend () {
+        api.deleteSuspend(this.$axios).then(res => {
           if (res.data.code === 0) {
             this.$message({
               type: 'success',
@@ -784,10 +817,11 @@
             if (res.data.code === 0) {
               this.$message({
                 type: 'success',
-                message: res.data.message
+                message: res.data.message + ' 即将执行一键操作'
               })
               this.initDatas()
-              this.updatasuppiercertsub()
+              this.deleteSuspend()
+              // this.updatasuppiercertsub()
             } else {
               this.$message({
                 type: 'warning',
@@ -872,10 +906,11 @@
           if (res.data.code === 0) {
             this.$message({
               type: 'success',
-              message: res.data.message
+              message: res.data.message + " 即将生成对比列表"
             })
             this.importloading = false
             this.initImportDatas()
+            this.createContrast()
           } else if (res.data.code === -1) {
             this.errorDialogVisible = true
             this.textarea = res.data.message

+ 284 - 0
src/dashoo.cn/frontend_web/src/pages/oilsupplier/technologyservice/tmpclasscheck.vue

@@ -0,0 +1,284 @@
+<template>
+  <div>
+    <el-card class="box-card" shadow="never" style="height: calc(100vh - 115px);position:relative">
+      <div slot="header">
+          <span>
+            <i class="icon icon-table2"></i> 资质对比表
+          </span>
+        <span style="float: right;">
+
+          </span>
+        <el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
+          <el-form-item label="编码">
+            <el-input size="mini" v-model="searchForm.Code" style="width:100%" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="名称">
+            <el-input size="mini" v-model="searchForm.Name" style="width:100%" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="筛选条件">
+            <el-select placeholder="请选择" v-model="conditions" style="width: 100%" size="mini">
+              <el-option :key="1" label="名称匹配正确" :value="1"></el-option>
+              <el-option :key="4" label="完全不匹配" :value="4"></el-option>
+              <el-option :key="6" label="完全匹配正确" :value="6"></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item>
+            <el-button type="primary" size="mini" @click="importhandleSearch">查询</el-button>
+          </el-form-item>
+          <el-form-item>
+<!--            <el-button type="primary" size="mini" @click="deleteList" :disabled="isDisable" :loading="deleteloading">删除</el-button>-->
+<!--            <el-button type="primary" size="mini" @click="changeList" v-if="conditions == 2" :disabled="isDisableCh" :loading="changeloading">暂停</el-button>-->
+          </el-form-item>
+        </el-form>
+      </div>
+      <el-table highlight-current-row :data="entityList" id="rebateSetTable" size="mini" border height="calc(100vh - 243px)"
+                style="width: 100%" @sort-change="orderby" v-loading="loading" :row-class-name="tableRowClassName">
+        <el-table-column align="center">
+          <template slot-scope="scope">
+            <el-checkbox :key="scope.row['ClassId']" @change="handleCheckedCitiesChange($event, scope.row['ClassId'])">
+            </el-checkbox>
+          </template>
+        </el-table-column>
+        <el-table-column v-for="column in tableColumns" :prop="column.prop" :width="column.width"
+                         :key="column.Id" :label="column.label" align="center" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <span v-if="(column.prop === 'Name')">{{(scope.row[column.prop])}}|{{(scope.row['tmp'+column.prop])}}</span>
+            <span v-else>{{ (scope.row[column.prop]) }}</span>
+          </template>
+        </el-table-column>
+
+        <!--动态显示的表头-->
+        <el-table-column v-for="column in dynamicTableColumns" :prop="column.prop" sortable :width="320"
+                         :key="column.Id" :label="column.label" align="center" show-overflow-tooltip>
+          <template slot-scope="scope">
+            {{ transferStr2(scope.row[column.prop]) }}|{{ transferStr2(scope.row['tmp'+column.prop]) }}
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+                     :page-sizes="[10, 50, 100, 200, 400]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
+                     :total="currentItemCount">
+      </el-pagination>
+    </el-card>
+
+  </div>
+</template>
+
+<script>
+  import api from '@/api/oilsupplier/technologyservice'
+  import setapi from '@/api/oilsupplier/oilclassorgset'
+  export default {
+    name: 'tmpClassCheck',
+    created () {
+      this.initTableHeader()
+      this.initDatas()
+    },
+    data () {
+      return {
+        entityList: [],
+        conditions: 1,
+        // 分页参数
+        size: 10,
+        currentPage: 1,
+        currentItemCount: 0,
+        // 列表排序
+        Column: {
+          Order: '',
+          Prop: ''
+        },
+        loading: false,
+        deleteloading: false,
+        changeloading: false,
+        searchForm: {
+          Name: '',
+          Code: '',
+          AccessCardNo: '',
+          SupplierName: '',
+          SupplierTypeCode: '',
+          InFlag: '',
+          LegalPerson: '',
+          ContactName: '',
+          CommercialNo: '',
+          RegCapital1: '',
+          RegCapital2: '',
+          CompanyType: '',
+          Province: '',
+          City: '',
+          Street: '',
+          Address: '',
+          LinkProvince: '',
+          LinkCity: '',
+          LinkStreet: '',
+          LinkAddress: '',
+          DepositBank: '',
+          BusinessScope: '',
+          OldSupplierName: '',
+          HseTraining: '',
+          // NeedFileType: [],
+          NeedFileType: '',
+          CerSubName: '',
+          FullName: '',
+          CheckUserName: '',
+          CheckUserId: ''
+        },
+        Id: '',
+        SupplierCertId: '',
+        SupplierTypeCode: '',
+        SupplierName: '',
+        searchFormSub: {
+          Code: '',
+          Name: ''
+        },
+        tableColumns: [{
+          prop: 'Code',
+          label: '编码',
+          width: 120,
+          sort: true
+        },
+
+          {
+            prop: 'Name',
+            label: '名称',
+            width: 260,
+            sort: true
+          },
+          {
+            prop: 'OrgName',
+            label: '部门名称',
+            width: 150,
+            sort: true
+          }
+        ],
+        dynamicTableColumns: [],
+        CreateOn: [],
+        deleteArr: [],
+        isDisable: true,
+        isDisableCh: true
+      }
+    },
+
+    methods: {
+      tableRowClassName({row, rowIndex}) {
+        if (row.checked === 1) {
+          return 'yellow-row'
+        }
+      },
+      // 列表排序功能
+      orderby (column) {
+        if (column.order === 'ascending') {
+          this.Column.Order = 'asc'
+        } else if (column.order === 'descending') {
+          this.Column.Order = 'desc'
+        }
+        this.Column.Prop = column.prop
+        this.initDatas()
+      },
+      clearSearch () {
+        Object.assign(this.searchForm, this.searchFormReset)
+        // this.searchForm = this.searchFormReset;
+        this.CreateOn = ''
+        this.initDatas()
+      },
+      handleCurrentChange (value) {
+        this.currentPage = value
+        this.initDatas()
+      },
+      handleSizeChange (value) {
+        this.size = value
+        this.currentPage = 1
+        this.initDatas()
+      },
+      transferStr (val) {
+        if (val === '01') {
+          return '物资类'
+        } else if (val === '02') {
+          return '基建类'
+        } else if (val === '03') {
+          return '服务类'
+        } else {
+          return val
+        }
+      },
+      transferStr2 (val) {
+        if (val === '1') {
+          return '是'
+        }
+        if (val === '0') {
+          return ''
+        } else {
+          return val
+        }
+      },
+      importhandleSearch () {
+        this.currentPage = 1
+        // this.importDialogVisible = false
+        this.initDatas()
+      },
+      handleCheckedCitiesChange(val, value) {
+        if (val) {
+          this.deleteArr.push(value)
+        } else {
+          let a = this.deleteArr.findIndex(item => item === val)
+          this.deleteArr.splice(a, 1)
+        }
+        console.log(val, this.deleteArr, 'value')
+        if (this.deleteArr.length > 0) {
+          this.isDisable = false
+          this.isDisableCh = false
+        } else {
+          this.isDisable = true
+          this.isDisableCh = true
+        }
+      },
+      initDatas () {
+        this.loading = true
+        // 分页及列表条件
+        let params = {
+          _currentPage: this.currentPage,
+          _size: this.size,
+          Order: this.Column.Order,
+          Prop: this.Column.Prop,
+          Edition: '1',
+          Conditions: this.conditions
+        }
+        let myCreateOn = []
+        // 解析时间
+
+        if (this.CreateOn != null && this.CreateOn.length === 2) {
+          this.CreateOn[1].setHours(23)
+          this.CreateOn[1].setMinutes(59)
+          this.CreateOn[1].setSeconds(59)
+          myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
+          myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
+        }
+        // 查询条件
+        Object.assign(params, this.searchForm)
+        // 访问接口
+        api.getCompareList(myCreateOn, params, this.$axios).then(res => {
+          this.entityList = res.data.items
+          this.currentItemCount = res.data.currentItemCount
+          this.isDisable = true
+          this.isDisableCh = true
+          this.loading = false
+          this.deleteArr = []
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+      search () {
+        this.getCertSub()
+      },
+      initTableHeader () {
+        setapi.initTsTableHeader(this.$axios).then(res => {
+          this.dynamicTableColumns = res.data.items
+        })
+      },
+    }
+
+  }
+</script>
+<style>
+.el-table .yellow-row {
+  background: lightyellow;
+}
+</style>

+ 549 - 0
src/dashoo.cn/frontend_web/src/pages/oilsupplier/technologyservice/tmpsuppliercheck.vue

@@ -0,0 +1,549 @@
+<template>
+  <div>
+    <el-card class="box-card" shadow="never" style="height: calc(100vh - 115px);position:relative">
+      <div slot="header">
+        <span>
+          <i class="icon icon-table2"></i> 企业对比表
+        </span>
+        <el-form :model="searchForm" ref="searchformRef" :inline="true" style="float: right;position:absolute;right:15px;top:10.5px" >
+          <el-form-item label="准入编码">
+            <el-input size="mini" v-model="searchForm.AccessCardNo" placeholder="请输入内容"></el-input>
+          </el-form-item>
+          <el-form-item label="企业名称">
+            <el-input size="mini" v-model="searchForm.SupplierName" placeholder="请输入内容"></el-input>
+          </el-form-item>
+          <el-form-item>
+            <el-button type="primary" size="mini" style="margin-left: 8px" @click="initDatas($event)">查询</el-button>
+          </el-form-item>
+          <el-form-item>
+            <el-button type="warning" size="mini" @click="exportExcel" :loading="loadingExcel">导出</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+
+      <!--内框表格显示-->
+      <el-table id="rebateSetTable1" :data="conList" size="mini" v-loading="loading" border height="calc(100vh - 243px)"
+                style="width: 100%" @sort-change="orderby" :row-class-name="tableRowClassName" :cell-style="hover">
+        <el-table-column label="操作" width="260px" align="center" fixed="right" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-button type="text" @click="opencertsub(scope.row)" title="查看准入范围" size="mini" icon="el-icon-document" width="120px">准入范围</el-button>
+          </template>
+        </el-table-column>
+        <!--内框表格剩余栏显示-->
+        <el-table-column label="状态" prop="InFlag" width="100px" align="center">
+          <template slot-scope="scope">
+            <el-alert v-if="scope.row.InFlag=='1'" :closable="false" style="background:rgba(255,255,255,0.2)" title="准入" type="success" ></el-alert>
+            <el-alert v-if="scope.row.InFlag=='2'" :closable="false" style="background:rgba(255,255,255,0.2)" title="暂停" type="warning" ></el-alert>
+            <el-alert v-if="scope.row.InFlag=='3'" :closable="false" style="background:rgba(255,255,255,0.2)" title="取消" type="error"></el-alert>
+          </template>
+        </el-table-column>
+        <el-table-column label="准入编码" width="100px" prop="AccessCardNo" sortable align="center">
+          <template slot-scope="scope" >
+            <span style="font-family:'黑体';font-size:13px">{{scope.row.AccessCardNo}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="企业名称" min-width="300px" prop="SupplierName" sortable align="center"></el-table-column>
+        <el-table-column label="准入类别" prop="SupplierTypeCode" align="center">
+          <template slot-scope="scope">
+            {{transferStr(scope.row.SupplierTypeCode)}}
+          </template>
+        </el-table-column>
+        <el-table-column label="法人代表"  width="100px" prop="LegalPerson" align="center"></el-table-column>
+        <el-table-column label="注册资金(万元)"  width="170px" prop="RegCapital" sortable align="center"></el-table-column>
+        <el-table-column label="移动电话"  width="120px" prop="Mobile" align="center"></el-table-column>
+        <el-table-column label="准入范围数量"  width="120px" prop="SubCnt" align="center"></el-table-column>
+        <el-table-column label="对不上数量"  width="120px" prop="NoSubCnt" align="center"></el-table-column>
+        <el-table-column label="1级降2级数量"  width="120px" prop="OneTwoCount" align="center"></el-table-column>
+        <el-table-column label="2级升1级数量"  width="120px" prop="TwoOneCount" align="center"></el-table-column>
+        <el-table-column label="是否缺资质" width="130px" prop="Checked" sortable align="center">
+          <template slot-scope="scope" >
+            <span style="font-family:'黑体';font-size:13px">{{stringChecked(scope.row.Checked)}}</span>
+          </template>
+        </el-table-column>
+        <!--<el-table-column label="最后一次年审" width="100px" prop="AuditDate" align="center">-->
+        <!--<template slot-scope="scope">{{ jstimehandle(scope.row.AuditDate) }}</template>-->
+        <!--</el-table-column>-->
+      </el-table>
+
+      <!-- 分页 -->
+      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[10, 15, 20, 25]" :page-size="size"
+                     layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount"></el-pagination>
+    </el-card>
+    <el-dialog :visible.sync="dialogVisibleCertsSub" width="90%" append-to-body>
+      <el-card class="box-card">
+        <div slot="header" class="clearfix">
+          <span style="font-weight: bold">准入范围</span>
+          <span style="float: right;">
+                <el-form ref="form" :inline="true" style="margin-top: -10px">
+                  <el-form-item label="编码">
+                    <el-input size="mini" v-model="searchFormSub.Code" placeholder="请输入内容" style="width: 100%"></el-input>
+                  </el-form-item>
+                  <el-form-item label="名称">
+                    <el-input size="mini" v-model="searchFormSub.Name" placeholder="请输入内容" style="width: 100%"></el-input>
+                  </el-form-item>
+                  <el-form-item>
+                    <el-button type="primary" size="mini" style="margin-left: 8px" @click="search">查询</el-button>
+<!--                    <el-button type="primary" @click="toPdf" size="mini" style="margin-left: 25px">下载待删除准入范围</el-button>-->
+                  </el-form-item>
+                </el-form>
+              </span>
+        </div>
+        <el-table :data="certsubList" border size="mini" :row-class-name="subRowClassName" :cell-style="subRowHover" v-loading="certsubListLoading">
+<!--          <el-table-column label="操作" width="160px" align="center" fixed="right" show-overflow-tooltip>-->
+<!--            <template slot-scope="scope">-->
+<!--              <el-button type="text" style="color: #F56C6C" @click="delcertsubbyid(scope.row)" title="删除" size="mini" icon="el-icon-delete" width="90px">删除</el-button>-->
+<!--            </template>-->
+<!--          </el-table-column>-->
+          <el-table-column prop="Code" label="分类编码" show-overflow-tooltip></el-table-column>
+          <el-table-column prop="Name" label="分类名称" show-overflow-tooltip></el-table-column>
+          <el-table-column prop="HeaderName" label="缺少资质" show-overflow-tooltip></el-table-column>
+          <el-table-column prop="GoodsLevel" label="级别" width="80px" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <span v-if="scope.row.GoodsLevel=='1'">一级</span>
+              <span v-if="scope.row.GoodsLevel=='2'">二级</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="是否为制造商" width="100" v-if="SupplierTypeCode == '01'">
+            <template slot-scope="scope">
+              <el-tag type="info" v-if="scope.row.IsManufacturer == 2">非制造商</el-tag>
+              <el-tag type="success" v-else-if="scope.row.IsManufacturer == 1">制造商</el-tag>
+              <span v-else>——</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="状态"
+                           align="center"
+                           width="100px">
+            <template slot-scope="scope">
+            <span v-if="scope.row.CertSubStatus=='1'"
+                  style="color:#67C23A">准入</span>
+              <span v-else-if="scope.row.CertSubStatus=='2'"
+                    style="color:#E6A23C">暂停</span>
+              <span v-else>——</span>
+            </template>
+          </el-table-column>
+        </el-table>
+        <el-pagination
+          @size-change="handleSizeChangeSub"
+          @current-change="handleCurrentChangeSub"
+          :current-page="currentPageSub"
+          :page-sizes="[10, 50, 100, 200, 400]"
+          :page-size="sizeSub"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="currentItemCountSub"
+        ></el-pagination>
+      </el-card>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import api from '@/api/oilsupplier/technologyservice'
+  import XLSX from "xlsx";
+  export default {
+    name: 'compareTmpSupplier',
+    created () {
+      // Object.assign(this.searchFormReset, this.searchForm)
+      this.initDatas()
+    },
+    data () {
+      return {
+        // 分页参数
+        size: 10,
+        currentPage: 1,
+        currentItemCount: 0,
+        // 列表排序
+        Column: {
+          Order: '',
+          Prop: ''
+        },
+        conList: [],
+        loading: false,
+        dialogVisibleCertsSub: false,
+        certsubListLoading: false,
+        loadingExcel: false,
+        searchForm: {
+          AccessCardNo: '',
+          SupplierName: '',
+          SupplierTypeCode: '',
+          InFlag: '',
+          LegalPerson: '',
+          ContactName: '',
+          CommercialNo: '',
+          RegCapital1: '',
+          RegCapital2: '',
+          CompanyType: '',
+          Province: '',
+          City: '',
+          Street: '',
+          Address: '',
+          LinkProvince: '',
+          LinkCity: '',
+          LinkStreet: '',
+          LinkAddress: '',
+          DepositBank: '',
+          BusinessScope: '',
+          OldSupplierName: '',
+          HseTraining: '',
+          // NeedFileType: [],
+          NeedFileType: '',
+          CerSubName: '',
+          FullName: '',
+          CheckUserName: '',
+          CheckUserId: ''
+        },
+        SupplierId: '',
+        Id: '',
+        SupplierCertId: '',
+        SupplierTypeCode: '',
+        SupplierName: '',
+        searchFormSub: {
+          Code: '',
+          Name: ''
+        },
+        // 分页参数
+        sizeSub: 10,
+        currentPageSub: 1,
+        currentItemCountSub: 0,
+        certsubList: [],
+        showcolumn: [],
+        tableColumns: [
+
+          {
+            prop: 'InFlag',
+            label: '状态',
+            width: 120,
+            sort: true
+          },
+          {
+            prop: 'AccessCardNo',
+            label: '准入编码',
+            width: 150,
+            sort: true
+          },
+
+          {
+            prop: 'SupplierName',
+            label: '企业名称',
+            width: 120,
+            sort: true
+          },
+
+          {
+            prop: 'SupplierTypeCode',
+            label: '准入类别',
+            width: 150,
+            sort: true
+          },
+
+          {
+            prop: 'LegalPerson',
+            label: '法人代表',
+            width: 120,
+            sort: true
+          },
+
+          {
+            prop: 'RegCapital',
+            label: '注册资金',
+            width: 150,
+            sort: true
+          },
+
+          {
+            prop: 'Mobile',
+            label: '移动电话',
+            width: 120,
+            sort: true
+          }
+
+        ],
+        dynamicTableColumns: [],
+      }
+    },
+
+    methods: {
+      tableRowClassName({row, rowIndex}) {
+        if (row.NoSubCnt > 0){
+          return 'green-row'
+        }
+        if (row.Checked == "1") {
+          return 'blue-row'
+        } else{
+          return 'yellow-row'
+        }
+      },
+      subRowClassName({row, rowIndex}) {
+        if (row.MinClassId == '0'){
+          return 'green-row'
+        }
+        if (row.Checked == '1') {
+          return 'yellow-row'
+        } else{
+          return 'blue-row'
+        }
+      },
+      hover({row}) {
+        if (row.NoSubCnt > 0){
+          return "background-color:pink"
+        }
+        if (row.Checked == "1") {
+          return "background-color:lightblue"
+        } else{
+          return "background-color:lightyellow"
+        }
+      },
+      subRowHover({row}) {
+        if (row.MinClassId == '0'){
+          return "background-color:pink"
+        }
+        if (row.Checked == "1") {
+          return "background-color:lightyellow"
+        } else{
+          return "background-color:lightblue"
+        }
+      },
+      searchCommand (command) {
+        if (command === 'search') {
+          this.dialogVisible = true
+        } else if (command === 'clear') {
+          this.clearSearch()
+        }
+      },
+      // 列表排序功能
+      orderby (column) {
+        if (column.order === 'ascending') {
+          this.Column.Order = 'asc'
+        } else if (column.order === 'descending') {
+          this.Column.Order = 'desc'
+        }
+        this.Column.Prop = column.prop
+        this.initDatas()
+      },
+      clearSearch () {
+        Object.assign(this.searchForm, this.searchFormReset)
+        // this.searchForm = this.searchFormReset;
+        this.CreateOn = ''
+        this.initDatas()
+      },
+      handleSearch () {
+        this.currentPage = 1
+        this.dialogVisible = false
+        this.initDatas()
+      },
+      handleCurrentChange (value) {
+        this.currentPage = value
+        this.initDatas()
+      },
+      handleSizeChange (value) {
+        this.size = value
+        this.currentPage = 1
+        this.initDatas()
+      },
+      transferStr (val) {
+        if (val === '01') {
+          return '物资类'
+        } else if (val === '02') {
+          return '基建类'
+        } else if (val === '03') {
+          return '服务类'
+        } else {
+          return val
+        }
+      },
+      stringChecked(val) {
+        if (val === '1') {
+          return '否'
+        }  else {
+          return '是'
+        }
+      },
+      initDatas () {
+        this.loading = true
+        // 分页及列表条件
+        let params = {
+          _currentPage: this.currentPage,
+          _size: this.size,
+          Order: this.Column.Order,
+          Prop: this.Column.Prop,
+          Edition: '1'
+        }
+        let myCreateOn = []
+        // 解析时间
+
+        if (this.CreateOn != null && this.CreateOn.length === 2) {
+          this.CreateOn[1].setHours(23)
+          this.CreateOn[1].setMinutes(59)
+          this.CreateOn[1].setSeconds(59)
+          myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
+          myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
+        }
+        // 查询条件
+        Object.assign(params, this.searchForm)
+        // 访问接口
+        api.getCompareTmpSupplier(params, this.$axios).then(res => {
+          this.conList = res.data.items
+          this.currentItemCount = res.data.currentItemCount
+          this.loading = false
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+      opencertsub (row) {
+        this.currentPageSub = 1
+        this.certsubList = []
+        this.dialogVisibleCertsSub = true
+        this.certsubListLoading = true
+        this.Id = row.Id
+        this.SupplierCertId = row.CertId
+        this.SupplierTypeCode = row.SupplierTypeCode
+        this.SupplierName = row.SupplierName
+        this.getCertSub(row)
+      },
+      getCertSub (row) {
+        let _this = this
+        const params = {
+          SupplierCertId: this.SupplierCertId,
+          SupplierTypeCode: this.SupplierTypeCode,
+          _currentPage: this.currentPageSub,
+          _size: this.sizeSub
+        }
+        Object.assign(params, this.searchFormSub)
+        this.$axios.get('technologyservice/delcertsublist', {
+          params
+        })
+          .then(res => {
+            _this.certsubList = res.data.items
+            _this.currentItemCountSub = res.data.currentItemCount
+            this.certsubListLoading = false
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+      // 分页方法
+      handleCurrentChangeSub (value) {
+        this.currentPageSub = value
+        this.getCertSub()
+      },
+      handleSizeChangeSub (value) {
+        this.sizeSub = value
+        this.currentPageSub = 1
+        this.getCertSub()
+      },
+      // 导出准入范围到pdf
+      toPdf () {
+        api.pdfexport(this.Id, this.SupplierTypeCode, this.$axios)
+          .then(res => {
+            // response
+            if (res.data.code === 0) {
+              // this.$message({
+              //   type: 'success'
+              //   message: res.data.message
+              // })
+              let docurl = res.data.item
+              let pdfurl
+              // 内网服务器专用
+              if (process.client && docurl.indexOf('upfile') === 0) {
+                const myDomain = window.location.host
+                // location.href = 'http://' + myDomain + '/' + docurl
+                pdfurl = 'http://' + process.env.LOCAL_IP + '/' + docurl
+                let requestParams = {
+                  pdfUrl: pdfurl,
+                  watermark: this.SupplierName
+                }
+                this.$axios.post('supplierdataentry/word-to-pdf-watermark', requestParams)
+                  .then(function (res) {
+                    window.open('http://' + myDomain + '/' + res.data)
+                  })
+              } else {
+                // location.href = 'http://' + docurl
+                pdfurl = 'http://' + docurl
+                let requestParams = {
+                  pdfUrl: pdfurl,
+                  watermark: this.SupplierName
+                }
+                this.$axios.post('supplierdataentry/word-to-pdf-watermark', requestParams)
+                  .then(function (res) {
+                    window.open('http://' + res.data)
+                  })
+              }
+            }
+          }).catch(err => {
+          console.error(err)
+        })
+      },
+      search () {
+        this.getCertSub()
+      },
+      delcertsubbyid (row) {
+        console.log(row)
+        this.$confirm('是否删除准入项?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          let params = {
+            Id: row.Id
+          }
+          console.log(params)
+          api.delTmpSupplierCertSub(params, this.$axios).then(res => {
+            console.log(res)
+            if (res.data.code === 0) {
+              this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+              this.getCertSub()
+            } else {
+              this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          })
+        })
+      },
+      exportExcel () {
+        this.loadingExcel = true
+        console.log('111111导出', this.loadingExcel)
+        api.execlexport(this.$axios)
+          .then(res => {
+            // response
+            if (res.data.code === 0) {
+              // this.$message({
+              //    type: 'success'
+              //    message: res.data.message
+              // })
+              let docurl = res.data.item
+              // 内网服务器专用
+              if (process.client && docurl.indexOf('upfile') === 0) {
+                const myDomain = window.location.host
+                location.href = 'http://' + myDomain + '/' + docurl
+              } else {
+                location.href = 'http://' + docurl
+              }
+              this.loadingExcel = false
+            }
+          }).catch(err => {
+          console.error(err)
+        })
+      },
+    }
+
+  }
+</script>
+
+<style>
+.el-table .blue-row {
+  background: lightblue;
+}
+
+.el-table .green-row {
+  background: pink;
+}
+
+.el-table .yellow-row {
+  background: lightyellow;
+}
+</style>

+ 23 - 0
src/dashoo.cn/frontend_web/src/pages/system/tmpzcgf.vue

@@ -194,6 +194,10 @@
                      type="primary"
                      @click="InsertAll"
                      v-loading.fullscreen.lock="fullscreenLoading">导入全部数据,点击后可以关闭页面</el-button>
+          <el-button size="mini"
+                     type="primary"
+                     @click="InsertSubAll"
+                     v-loading.fullscreen.lock="fullscreenLoading">导入准入范围数据,点击后可以关闭页面</el-button>
         </el-col>
       </el-row>
 
@@ -772,6 +776,25 @@ export default {
               });
             })
         })
+    },
+    InsertSubAll () {
+      this.$confirm('导入准入范围历史数据,请打开后台监控日志,确定是否完成,是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          this.fullscreenLoading = true
+          this.$axios.get('tmpzcgf/insertSubAll')
+            .then(res => {
+              this.fullscreenLoading = false
+              this.$notify({
+                title: '成功',
+                message: '全部导入成功!',
+                type: 'success'
+              });
+            })
+        })
     }
   }
 }