Browse Source

loadData eq

kptcwq911 2 years ago
parent
commit
bf1d8fb5c3

+ 3 - 3
apiserver/model/buydetail.go

@@ -19,11 +19,11 @@ type BigBuyDetail struct {
 	ProviderID   int       `gorm:"column:providerId"`
 	ProviderID   int       `gorm:"column:providerId"`
 	Statu        int       `gorm:"column:statu"`   // 到货状态
 	Statu        int       `gorm:"column:statu"`   // 到货状态
 	ZeroCou      int       `gorm:"column:zeroCou"` //配单数量
 	ZeroCou      int       `gorm:"column:zeroCou"` //配单数量
-	SapNumber    string    `gorm:"column:sapNumber"`
-	SapStatus    int       `gorm:"column:sapStatus"`
+	SapNumber    string    `gorm:"column:sapNumber"`  //sap采购单号
+	SapStatus    int       `gorm:"column:sapStatus"` // 同步状态
+	SapError     string    `gorm:"column:sapError"`  // sap接口错误信息
 	SrmStatus    int       `gorm:"column:srmStatus"`
 	SrmStatus    int       `gorm:"column:srmStatus"`
 	SrmNumber    string    `gorm:"column:srmNumber"`
 	SrmNumber    string    `gorm:"column:srmNumber"`
-	SapError     string    `gorm:"column:sapError"`
 	SrmError     string    `gorm:"column:srmError"`
 	SrmError     string    `gorm:"column:srmError"`
 }
 }
 type BuyDetail struct {
 type BuyDetail struct {

+ 61 - 64
apiserver/model/equipment.go

@@ -3,69 +3,66 @@ package model
 import "time"
 import "time"
 
 
 type Equipment struct {
 type Equipment struct {
-	PastureId      int    `gorm:"column:pastureId"`
-	PastureName    string `gorm:"column:pastureName"`
-	EqName         string `gorm:"column:eqName"`
-	AssetCode      string `gorm:"column:assetCode"`
-	EqClassName    string `gorm:"column:eqClassName"`
-	Specification  string `gorm:"column:specification"`
-	DepartmentId   string `gorm:"column:departmentId"`
-	DepartmentName string `gorm:"column:departmentName"`
-	EntranceDate   string `gorm:"column:entranceDate"`
-	Purpose        string `gorm:"column:purpose"`
-	Yuanzhi        string `gorm:"column:yuanzhi"`
+	PastureId        int       `gorm:"column:pastureId" json:"pastureId"`
+	PastureName      string    `gorm:"column:pastureName" json:"pastureName"`
+	EqName           string    `gorm:"column:eqName" json:"eqName"`
+	AssetCode        string    `gorm:"column:assetCode" json:"assetCode"`
+	EqClassName      string    `gorm:"column:eqClassName" json:"eqClassName"`
+	Specification    string    `gorm:"column:specification" json:"specification"`
+	DepartmentId     string    `gorm:"column:departmentId" json:"departmentId"`
+	DepartmentName   string    `gorm:"column:departmentName" json:"departmentName"`
+	EntranceDate     string    `gorm:"column:entranceDate" json:"entranceDate"`
+	Purpose          string    `gorm:"column:purpose" json:"purpose"`
+	Yuanzhi          string    `gorm:"column:yuanzhi" json:"yuanzhi"`
+	Id               int       `gorm:"column:id" json:"id"`
+	EqCode           string    `gorm:"column:eqCode" json:"eqCode"`
+	EqClassId        int       `gorm:"column:eqClassId" json:"eqClassId"`
+	FinanceCode      string    `gorm:"column:financeCode" json:"financeCode"`
+	ProName          string    `gorm:"column:proName" json:"proName"`
+	ProId            int       `gorm:"column:proId" json:"proId"`
+	BrandId          string    `gorm:"column:brandId" json:"brandId"`
+	Brand            string    `gorm:"column:brand" json:"brand"`
+	PurchaseDate     string    `gorm:"column:purchaseDate" json:"purchaseDate"`
+	Subtractvalue    string    `gorm:"column:subtractvalue" json:"subtractvalue"`
+	Salvage          string    `gorm:"column:salvage" json:"salvage"`
+	Upkeepgrade      string    `gorm:"column:upkeepgrade" json:"upkeepgrade"`
+	YearMaintainCost string    `gorm:"column:yearMaintainCost" json:"yearMaintainCost"`
+	YearUpkeepCost   string    `gorm:"column:yearUpkeepCost" json:"yearUpkeepCost"`
+	Status           int       `gorm:"column:status" json:"status"`
+	EmployeName      string    `gorm:"column:employeName" json:"employeName"`
+	EmployeeId       string    `gorm:"column:employeeId" json:"employeeId"`
+	InputDatetime    string    `gorm:"column:inputDatetime" json:"inputDatetime"`
+	LeaveDate        time.Time `gorm:"column:leaveDate" json:"leaveDate"`
+	InputUser        string    `gorm:"column:inputUser" json:"inputUser"`
+	EnabledTime      time.Time `gorm:"column:enabledTime" json:"enabledTime"`
+	BlockTime        time.Time `gorm:"column:blockTime" json:"blockTime"`
+	ChangeStatue     string    `gorm:"column:changeStatue" json:"changeStatue"`
+	EnabledPerson    int       `gorm:"column:enabledPerson" json:"enabledPerson"`
+	BlockPerson      int       `gorm:"column:blockPerson" json:"blockPerson"`
+	SttId            int       `gorm:"column:sttId" json:"sttId"`
+	BaseHours        string    `gorm:"column:baseHours" json:"baseHours"`
+	ApplicatId       int       `gorm:"column:applicatId" json:"applicatId"`
+	ApplicatDate     time.Time `gorm:"column:applicatDate" json:"applicatDate"`
+	WorkflowId       int       `gorm:"column:workflowId" json:"workflowId"`
+	FlowCompeleted   int       `gorm:"column:flowCompeleted" json:"flowCompeleted"`
+	Enable           int       `gorm:"column:enable" json:"enable"`
+	ChangeTime       time.Time `gorm:"column:changeTime" json:"changeTime"`
+	SSTstatue        string    `gorm:"column:SSTstatue" json:"SSTstatue"`
+	SHStatus         int       `gorm:"column:SHStatus" json:"SHStatus"`
+	ChargeId         int       `gorm:"column:chargeId" json:"chargeId"`
+	ChargeDate       time.Time `gorm:"column:chargeDate" json:"chargeDate"`
+	WorkflowNote     string    `gorm:"column:workflowNote" json:"workflowNote"`
+	Picpath          string    `gorm:"column:picpath" json:"picpath"`
+	Depreciation     string    `gorm:"column:depreciation" json:"depreciation"`
+	Statue           int       `gorm:"column:statue" json:"statue"`
+	ModifyTime       time.Time `gorm:"column:modifyTime" json:"modifyTime"`
+	CompanyCode      string    `gorm:"column:companyCode" json:"companyCode"`
 
 
-	Id           int    `gorm:"column:id"`
-	EqCode       string `gorm:"column:eqCode"`
-	EqClassId    int    `gorm:"column:eqClassId"`
-	FinanceCode  string `gorm:"column:financeCode"`
-	ProName      string `gorm:"column:proName"`
-	ProId        int    `gorm:"column:proId"`
-	BrandId      string `gorm:"column:brandId"`
-	Brand        string `gorm:"column:brand"`
-	PurchaseDate string `gorm:"column:purchaseDate"`
-
-	Subtractvalue    string    `gorm:"column:subtractvalue"`
-	Salvage          string    `gorm:"column:salvage"`
-	Upkeepgrade      string    `gorm:"column:upkeepgrade"`
-	YearMaintainCost string    `gorm:"column:yearMaintainCost"`
-	YearUpkeepCost   string    `gorm:"column:yearUpkeepCost"`
-	Status           int       `gorm:"column:status"`
-	EmployeName      string    `gorm:"column:employeName"`
-	EmployeeId       string    `gorm:"column:employeeId"`
-	InputDatetime    string    `gorm:"column:inputDatetime"`
-	LeaveDate        time.Time `gorm:"column:leaveDate"`
-	InputUser        string    `gorm:"column:inputUser"`
-	EnabledTime      time.Time `gorm:"column:enabledTime"`
-	BlockTime        time.Time `gorm:"column:blockTime"`
-	ChangeStatue     string    `gorm:"column:changeStatue"`
-	EnabledPerson    int       `gorm:"column:enabledPerson"`
-	BlockPerson      int       `gorm:"column:blockPerson"`
-	SttId            int       `gorm:"column:sttId"`
-	BaseHours        string    `gorm:"column:baseHours"`
-	ApplicatId       int       `gorm:"column:applicatId"`
-	ApplicatDate     time.Time `gorm:"column:applicatDate"`
-	WorkflowId       int       `gorm:"column:workflowId"`
-	FlowCompeleted   int       `gorm:"column:flowCompeleted"`
-	Enable           int       `gorm:"column:enable"`
-	ChangeTime       time.Time `gorm:"column:changeTime"`
-	SSTstatue        string    `gorm:"column:SSTstatue"`
-	SHStatus         int       `gorm:"column:SHStatus"`
-	ChargeId         int       `gorm:"column:chargeId"`
-	ChargeDate       time.Time `gorm:"column:chargeDate"`
-	WorkflowNote     string    `gorm:"column:workflowNote"`
-	Picpath          string    `gorm:"column:picpath"`
-	Depreciation     string    `gorm:"column:depreciation"`
-
-	Statue       int       `gorm:"column:statue"`
-	ModifyTime   time.Time `gorm:"column:modifyTime"`
-	CreatedAt    time.Time `gorm:"column:created_at"`
-	UpdatedAt    time.Time `gorm:"column:updated_at"`
-	CompanyCode  string    `gorm:"column:companyCode"`
-	Quantity     string    `gorm:"column:quantity"`
-	CostCenter   string    `gorm:"column:costCenter"`
-	Unit         string    `gorm:"column:unit"`
-	ProfitCenter string    `gorm:"column:profitCenter"`
-
-	SonCode string `gorm:"column:sonCode"`
+	CreatedAt    time.Time `gorm:"column:created_at" json:"created_at"`
+	UpdatedAt    time.Time `gorm:"column:updated_at" json:"updated_at"`
+	Quantity     string    `gorm:"column:quantity" json:"quantity"`
+	CostCenter   string    `gorm:"column:costCenter" json:"costCenter"`
+	Unit         string    `gorm:"column:unit" json:"unit"`
+	ProfitCenter string    `gorm:"column:profitCenter" json:"profitCenter"`
+	SonCode      string    `gorm:"column:sonCode" json:"sonCode"`
 }
 }

+ 16 - 7
apiserver/model/http/asset.go

@@ -47,14 +47,23 @@ type Company struct {
 	Code string `json:"BUKRS"`
 	Code string `json:"BUKRS"`
 }
 }
 type AssetReqData struct {
 type AssetReqData struct {
-	BudatB      string        `json:"BUDAT_B"` //查询开始日期	YYYYMMDD,资产创建/变更
-	BudatE      string        `json:"BUDAT_E"` //查询结束日期	YYYYMMDD,资产创建/变更
-	CompanyCode []Company     `json:"TBUKRS"`  //公司代码	现代牧业的法人
-	Codes       []TANLN1      `json:"TANLN1"`  //主资产号	财务资产码
-	EqType      []interface{} `json:"TANLKL"`  //资产类	设备类别
-	Tord41      []interface{} `json:"TORD41"`  //资产状态	在用/转移/报废
-	Tzugdt      []interface{} `json:"TZUGDT"`  //购置日期	购置日期(首次)
+	BudatB      string    `json:"BUDAT_B"` //查询开始日期	YYYYMMDD,资产创建/变更
+	BudatE      string    `json:"BUDAT_E"` //查询结束日期	YYYYMMDD,资产创建/变更
+	CompanyCode []Company `json:"TBUKRS"`  //公司代码	现代牧业的法人
+	Codes       []TANLN1  `json:"TANLN1"`  //主资产号	财务资产码
+	EqType      []ANLKL   `json:"TANLKL"`  //资产类	设备类别
+	Tord41      []ORD41   `json:"TORD41"`  //资产状态	在用/转移/报废
+	Tzugdt      []ZUGDT   `json:"TZUGDT"`  //购置日期	购置日期(首次)
 }
 }
 type TANLN1 struct {
 type TANLN1 struct {
 	Code string `json:"ANLN1"` //主资产号,	财务资产码
 	Code string `json:"ANLN1"` //主资产号,	财务资产码
 }
 }
+type ANLKL struct {
+	ANLKL string `json:"ANLKL"`
+}
+type ORD41 struct {
+	ORD41 string `json:"ORD41"`
+}
+type ZUGDT struct {
+	ZUGDT string `json:"ZUGDT"`
+}

+ 5 - 4
apiserver/model/http/order.go

@@ -6,10 +6,11 @@ type OrderResp struct {
 }
 }
 
 
 type OrderRespData struct {
 type OrderRespData struct {
-	Status    string `json:"MSGTY"`
-	MsgText   string `json:"MSGTX"`
-	EqNumber  string `json:"EXT01"`
-	SapNumber string `json:"EXT02"`
+	Status    string `json:"MSGTY"` //消息类型	S:成功,E:失败
+	MsgText   string `json:"MSGTX"` //消息文本	成功/失败信息
+	EqNumber  string `json:"EXT01"` //设备管理平台单号
+	SapNumber string `json:"EXT02"` //SAP单号
+
 }
 }
 type SapOrderReq struct {
 type SapOrderReq struct {
 	Dest `json:"DEST"`
 	Dest `json:"DEST"`

+ 5 - 7
apiserver/model/http/transfer.go

@@ -11,8 +11,6 @@ type TransferMaster struct {
 	PostDate     string           `json:"BUDAT"`  //过账日期	YYYYMMDD
 	PostDate     string           `json:"BUDAT"`  //过账日期	YYYYMMDD
 	Group        string           `json:"EKGRP"`  //采购组
 	Group        string           `json:"EKGRP"`  //采购组
 	Detail       []TransferDetail `json:"TEKPO"`  //行项目
 	Detail       []TransferDetail `json:"TEKPO"`  //行项目
-	// SupplierCode string           `json:"LIFNR"` //供应商编码
-	// Organization string           `json:"EKGRP"`
 }
 }
 type TransferDetail struct {
 type TransferDetail struct {
 	RowNumber    string `json:"EBELP"` //行号
 	RowNumber    string `json:"EBELP"` //行号
@@ -21,11 +19,11 @@ type TransferDetail struct {
 	Unit         string `json:"MEINS"` //单位
 	Unit         string `json:"MEINS"` //单位
 	NetPrice     string `json:"NETPR"` //净价
 	NetPrice     string `json:"NETPR"` //净价
 	DeliverDate  string `json:"EINDT"` // 交货日期
 	DeliverDate  string `json:"EINDT"` // 交货日期
-	Per          string `json:"PEINH"`
-	OutFactory   string `json:"UMWRK"` //出厂工厂
-	OutLocation  string `json:"UMLGO"` //出厂库
-	InFactory    string `json:"WERKS"` //入厂工厂
-	InLocation   string `json:"LGORT"` //入厂库
+	Per          string `json:"PEINH"`  //每
+	OutFactory   string `json:"UMWRK"` //出厂工厂 ,对应sap的供应商
+	OutLocation  string `json:"UMLGO"` //出厂
+	InFactory    string `json:"WERKS"` //入厂工厂,对应sap的供应商
+	InLocation   string `json:"LGORT"` //入厂
 	TaxCode      string `json:"MWSKZ"` //税代码
 	TaxCode      string `json:"MWSKZ"` //税代码
 }
 }
 
 

+ 0 - 10
apiserver/model/part.go

@@ -2,8 +2,6 @@ package model
 
 
 import (
 import (
 	"time"
 	"time"
-	// "kpt.xdmy/apiserver/model/http"
-	// "kpt.xdmy/apiserver/model/http"
 )
 )
 
 
 type Parts struct {
 type Parts struct {
@@ -35,11 +33,3 @@ type Parts struct {
 	ModifyTime     time.Time `gorm:"column:modifyTime"`
 	ModifyTime     time.Time `gorm:"column:modifyTime"`
 	ChargeDate     time.Time `gorm:"column:chargeDate"`
 	ChargeDate     time.Time `gorm:"column:chargeDate"`
 }
 }
-
-// func (p *Parts) Update() error {
-// 	m := util.NewMap("partcode", p.PartCode)
-// 	return d.UpdateDB("parts", m, p)
-// }
-// func (p *Parts) Insert() error {
-// 	return d.InsertDB("parts", p)
-// }

+ 3 - 3
apiserver/model/transfer.go

@@ -25,9 +25,9 @@ type BigPartTransfer struct {
 	ApplyDate time.Time `gorm:"column:applyDate"`
 	ApplyDate time.Time `gorm:"column:applyDate"`
 	CreatDate time.Time `gorm:"column:creatDate"`
 	CreatDate time.Time `gorm:"column:creatDate"`
 	Statue    int       `gorm:"column:statue"` //'调拨状态(0调拨中,1调拨完成,2驳回中,3已退回)',
 	Statue    int       `gorm:"column:statue"` //'调拨状态(0调拨中,1调拨完成,2驳回中,3已退回)',
-	DeptId    int       `gorm:"column:deptId"`
-	SapStatus int       `gorm:"column:sapStatus"`
-	SapText   string    `gorm:"column:sapText"`
+	DeptId    int       `gorm:"column:deptId"` 
+	SapStatus int       `gorm:"column:sapStatus"` // sap同步状态
+	SapText   string    `gorm:"column:sapText"`  //同步信息
 }
 }
 type PartTransfer struct {
 type PartTransfer struct {
 	// 调拨明细
 	// 调拨明细

+ 2 - 0
apiserver/service/equipment.go

@@ -0,0 +1,2 @@
+package service
+

+ 58 - 0
apiserver/service/loadData.go

@@ -1,11 +1,13 @@
 package service
 package service
 
 
 import (
 import (
+	"encoding/json"
 	"fmt"
 	"fmt"
 	"strconv"
 	"strconv"
 	"time"
 	"time"
 
 
 	"gorm.io/gorm"
 	"gorm.io/gorm"
+	"kpt.xdmy/apiserver/model"
 	"kpt.xdmy/pkg/util"
 	"kpt.xdmy/pkg/util"
 
 
 	log "github.com/sirupsen/logrus"
 	log "github.com/sirupsen/logrus"
@@ -183,3 +185,59 @@ type sqlScan struct {
 	id         string
 	id         string
 	contractid string
 	contractid string
 }
 }
+
+func (s *Service) EqInsert() {
+
+	// f, e := excelize.OpenFile("/Users/desire/Downloads/eq.xlsx")
+	f, e := excelize.OpenFile("eq.xlsx")
+	if e != nil {
+		log.Error("excle open  :%d", e)
+	}
+	defer func() {
+		if err := f.Close(); err != nil {
+			fmt.Println(err)
+		}
+	}()
+	slist := f.GetSheetList()
+	rows, err := f.GetRows(slist[0])
+	if err != nil {
+		fmt.Println(err)
+		return
+	}
+	names := []string{"pastureName", "eqClassName", "eqName", "eqCode", "specification",
+		"brand", "proName", "purpose", "status", "purchaseDate",
+		"entranceDate", "depreciation", "financeCode", "yuanzhi", "salvage",
+		"departmentName", "employeName", "inputUser"}
+	esl := []model.Equipment{}
+	for i, row := range rows {
+		if i < 2 {
+			continue
+		}
+		m := make(map[string]interface{})
+		eq := new(model.Equipment)
+		for j, v := range row {
+			m[names[j]] = v
+		}
+		// if status, e := strconv.ParseInt(m["status"].(string), 10, 32); e != nil {
+		// 	log.Error(e)
+		// } else {
+		// 	m["status"] = status
+		// }
+		if m["status"] == "正常" {
+			m["status"] = 17
+		}
+		if b, e := json.Marshal(m); e != nil {
+			log.Error(e)
+		} else {
+			if e := json.Unmarshal(b, eq); e != nil {
+				log.Error(e)
+			} else {
+				esl = append(esl, *eq)
+			}
+		}
+	}
+	log.Infof("len==%v", len(esl))
+	// s.d.DB.CreateInBatches(esl, 100)
+	r := s.d.DB.Create(&esl)
+	log.Infof("rows==%v", r.RowsAffected)
+}

BIN
client/main


+ 1 - 1
client/pro_test_dp.sh

@@ -1,3 +1,3 @@
 GOOS=linux go build main.go
 GOOS=linux go build main.go
 scp -r -P 11022 main  root@eam.modernfarming.cn:/usr/local/eq
 scp -r -P 11022 main  root@eam.modernfarming.cn:/usr/local/eq
-# scp -r -P 11022 /Users/desire/Downloads/part_insert.xlsx  root@eam.modernfarming.cn:/usr/local/eq
+# scp -r -P 11022 /Users/desire/Downloads/eq.xlsx  root@eam.modernfarming.cn:/usr/local/eq

+ 1 - 1
cmd/conf/conf.toml

@@ -1,6 +1,6 @@
 [db]
 [db]
 # dsn = "eq:Xdmy@1234@tcp(192.168.61.42:3306)/eq?charset=utf8&parseTime=True&loc=Local"
 # dsn = "eq:Xdmy@1234@tcp(192.168.61.42:3306)/eq?charset=utf8&parseTime=True&loc=Local"
-dsn = "root:kepaiteng!QAZ@tcp(222.73.129.15:31306)/eq?charset=utf8&parseTime=True&loc=Local"
+dsn = "root:kepaiteng!QAZ@tcp(222.73.129.15:31306)/eq2?charset=utf8&parseTime=True&loc=Local"
 idle = 5
 idle = 5
 idle_timeout = 3600
 idle_timeout = 3600
 [http]
 [http]

File diff suppressed because it is too large
+ 0 - 0
cmd/sh/updist/index.html


File diff suppressed because it is too large
+ 0 - 0
cmd/sh/updist/static/css/app.21c8e4f0.css


File diff suppressed because it is too large
+ 0 - 0
cmd/sh/updist/static/js/app.c01b9814.js


File diff suppressed because it is too large
+ 0 - 0
cmd/sh/updist/static/js/app.c8194af0.js


File diff suppressed because it is too large
+ 0 - 0
cmd/sh/updist/static/js/chunk-libs.7a1a2d58.js


File diff suppressed because it is too large
+ 0 - 0
cmd/sh/updist/static/js/chunk-libs.aa16f9f2.js


+ 17 - 7
doc/sql/a.sql

@@ -18,12 +18,18 @@ select * from warehouse where warehosetName='test-001';
 
 
 insert into warehouse_provider  (warehouseId,providerId) values(27177,2954);
 insert into warehouse_provider  (warehouseId,providerId) values(27177,2954);
 
 
-alter table equipment
-add column CompanyCode  varchar(50) not null default '' ,   
-add column Quantity       varchar(50) not null default 0 ,    
-add column CostCenter    varchar(50) not null default '' ,     
-add column Unit             varchar(50) not null default '' ,   
-add column ProfitCenter     varchar(50) not null default '' 
+
+alter table equipment add column modifyTime datetime ;
+alter table equipment add column CompanyCode  varchar(50) not null default '' ;
+alter table equipment add column Quantity       varchar(50) not null default 0 ;
+alter table equipment add column CostCenter    varchar(50) not null default ''  ;
+alter table equipment add column Unit             varchar(50) not null default '' ;
+alter table equipment add column ProfitCenter     varchar(50) not null default '';
+alter table equipment add column created_at    datetime;
+alter table equipment add column updated_at    datetime;
+alter table equipment add column sonCode     varchar(50) not null default '';
+
+
 
 
 alter table BigPartUse 
 alter table BigPartUse 
 add column ProofCode  varchar(50) not null default '' 
 add column ProofCode  varchar(50) not null default '' 
@@ -137,4 +143,8 @@ alter table part_class add column new_partcode varchar(50) default '';
 
 
 alter table BigPartTransfer add column deptId integer default 0;
 alter table BigPartTransfer add column deptId integer default 0;
 alter table BigPartTransfer add column sapStatus integer default 0;
 alter table BigPartTransfer add column sapStatus integer default 0;
-alter table BigPartTransfer add column sapText text default '';
+alter table BigPartTransfer add column sapText text default '';
+alter table emp add index(pastureId)
+-- alter table equipment modify column employeeId bigint(50) 
+alter table equipment add index(employeName)
+

+ 12 - 3
doc/sql/s.sql

@@ -20,8 +20,8 @@ or sqlname ='updatePartRepertoryTK'  --(还需要前端 修改参数)
 -- sqlname ='insertBigPartquit' 
 -- sqlname ='insertBigPartquit' 
 -- or sqlname ='insertPartquit' 
 -- or sqlname ='insertPartquit' 
 -- or sqlname ='updatePartUseQuit'
 -- or sqlname ='updatePartUseQuit'
-
-select sqlname,sqlstr,params from apisql where  sqlname ='checkDeviceId';
+ select * from dictlist where value= '正常'
+select sqlname,sqlstr,params from apisql where  sqlname ='getAssetList';
 select sqlname,sqlstr,params from apisql where  sqlname ='insertParttTransfer'
 select sqlname,sqlstr,params from apisql where  sqlname ='insertParttTransfer'
 
 
 
 
@@ -532,4 +532,13 @@ update partapply  set bigid =210634 order by bigid desc limit 1
  select bigid from partapply order by  bigid desc limit 1;
  select bigid from partapply order by  bigid desc limit 1;
 select id from bigpartapply order by  id desc limit 1;
 select id from bigpartapply order by  id desc limit 1;
 
 
-select bigid from partuse order by  bigid desc limit 1;select id from bigpartuse order by  id desc limit 1;
+select bigid from partuse order by  bigid desc limit 1;select id from bigpartuse order by  id desc limit 1;
+
+
+
+update equipment e join pasture p on e.pastureName =p.name  set e.pastureid =p.id where e.created_at >'2022-10-13';
+update equipment e join eqclass p on e.eqClassName =p.typeName  set e.eqClassId =p.id where e.created_at >'2022-10-13';
+update equipment e join brand p on e.brand =p.brandname  set e.brandid =p.id where e.created_at >'2022-10-13';
+update equipment e join provider p on e.proName =p.providerName  set e.proid =p.id where e.created_at >'2022-10-13';
+update equipment e join emp p on e.employeName =p.empname  set e.employeeId =CAST(p.id as char) where e.created_at >'2022-10-13' and p.pastureId =554;
+update equipment e join department p on e.departmentName =p.name  set e.departmentId =p.id where e.created_at >'2022-10-13' and p.pastureId =554;

+ 7 - 0
doc/sql/yh.sql

@@ -1,5 +1,7 @@
 update  apisql set sqlname='getNoMesList_bk' where  sqlname ='getNoMesList';
 update  apisql set sqlname='getNoMesList_bk' where  sqlname ='getNoMesList';
 update  apisql set sqlname='getNoMesCount_bk' where  sqlname ='getNoMesCount';
 update  apisql set sqlname='getNoMesCount_bk' where  sqlname ='getNoMesCount';
+update  apisql set sqlname='getNoMesList' where  sqlname ='getNoMesList_bk';
+update  apisql set sqlname='getNoMesCount' where  sqlname ='getNoMesCount_bk';
 
 
 alter table buydetail  modify column contractId  bigint(50) ;
 alter table buydetail  modify column contractId  bigint(50) ;
 alter table part_repertory  modify column contractId  bigint(50) ;
 alter table part_repertory  modify column contractId  bigint(50) ;
@@ -9,3 +11,8 @@ alter table partuse   modify column contractId  bigint(50) ;
 alter table  part_repertory  drop index partcode
 alter table  part_repertory  drop index partcode
 alter table  part_repertory  add unique index (locationId ,providerId ,price,partCode,contractId)
 alter table  part_repertory  add unique index (locationId ,providerId ,price,partCode,contractId)
 
 
+
+{"name":"updateMenu","params":["35","备件退库","备件退库","Retreat","custom/retreat/index","备件退库","","10","menu",1,"127"]}
+
+
+select * from menu where name ='备件退库'

+ 3 - 10
test/service.go

@@ -4,17 +4,10 @@ import (
 	"kpt.xdmy/apiserver/routers/restful"
 	"kpt.xdmy/apiserver/routers/restful"
 )
 )
 
 
-func DataUpdate() {
-	// s.PartUpdate()
-	s.PartInsert()
-}
-
-func RepertoryUpdate() {
-	s.RepertoryUpdate()
-}
+func DataBatch() {
+	// s.PartInsert()
+	s.EqInsert()
 
 
-func EasBatch() {
-	s.EasBatch()
 }
 }
 func Sqlx() {
 func Sqlx() {
 	restful.Sqlx()
 	restful.Sqlx()

+ 4 - 3
test/test.go

@@ -19,10 +19,10 @@ import (
 var s *service.Service
 var s *service.Service
 
 
 func Test() {
 func Test() {
-	TestJob()
+	// TestJob()
 	// TestSap()
 	// TestSap()
 	// logInit()
 	// logInit()
-	// EasBatch()
+	DataBatch()
 
 
 	// DataUpdate()
 	// DataUpdate()
 	// RepertoryUpdate()
 	// RepertoryUpdate()
@@ -35,10 +35,11 @@ func TestJob() {
 }
 }
 func Init() {
 func Init() {
 	var path string
 	var path string
-	path = "/Users/desire/kptdev/xdmy_mod/cmd/"
+	// path = "/Users/desire/kptdev/xdmy_mod/cmd/"
 
 
 	flag.Parse()
 	flag.Parse()
 	setting.Setup(path)
 	setting.Setup(path)
+
 	dao.Setup()
 	dao.Setup()
 	logging.Setup()
 	logging.Setup()
 	// util.InitWebS(setting.ServerSetting.EasName, setting.ServerSetting.EasPassword, setting.ServerSetting.EasUrl)
 	// util.InitWebS(setting.ServerSetting.EasName, setting.ServerSetting.EasPassword, setting.ServerSetting.EasUrl)

Some files were not shown because too many files changed in this diff