diff --git a/api/test.data/chart.selection.go b/api/test.data/chart.selection.go index b8fb413..93ad32c 100644 --- a/api/test.data/chart.selection.go +++ b/api/test.data/chart.selection.go @@ -70,3 +70,39 @@ func (S *ChartSelectionService) PBISelection(c *gin.Context) { } response.OkWithData(test_data.PBISelection(&r), c) } + +// @Tags 数据分析平台 +// @Summary 查询图表-子批次选项 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.ChartSelection true "查询参数" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"操作成功"}" +// @Router /testData/chart/subBatchSelection [post] +func (S *ChartSelectionService) SubBatchSelection(c *gin.Context) { + r := request.ChartSelection{} + _ = c.ShouldBind(&r) + if msg, ok := utils.ValidateInfo2CN(r); !ok { + response.FailWithMessage(msg, c) + return + } + response.OkWithData(test_data.SubBatchSelection(&r), c) +} + +// @Tags 数据分析平台 +// @Summary 查询图表-片号选项 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.ChartSelection true "查询参数" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"操作成功"}" +// @Router /testData/chart/waferIDSelection [post] +func (S *ChartSelectionService) WaferIDSelection(c *gin.Context) { + r := request.ChartSelection{} + _ = c.ShouldBind(&r) + if msg, ok := utils.ValidateInfo2CN(r); !ok { + response.FailWithMessage(msg, c) + return + } + response.OkWithData(test_data.WaferIDSelection(&r), c) +} diff --git a/config.yml b/config.yml index c425958..38cf07f 100644 --- a/config.yml +++ b/config.yml @@ -3,21 +3,21 @@ dbType: mysql # postgres or mysql Basedb: # mysql配置 user: root password: 123456 - host: 192.168.0.219:3306 + host: 192.168.0.172:3306 dbname: sys_base charset: utf8mb4 Wip: user: root password: 123456 - host: 192.168.0.219:3306 + host: 192.168.0.172:3306 dbname: wip charset: utf8mb4 Bug: user: root password: 123456 - host: 192.168.0.219:3306 + host: 192.168.0.172:3306 dbname: bug charset: utf8mb4 @@ -46,14 +46,14 @@ AttendanceDB: DataFlowDB: user: root password: 123456 - host: 192.168.0.219:3306 + host: 192.168.0.172:3306 dbname: data_flow charset: utf8mb4 ForumDB: user: root password: 123456 - host: 192.168.0.219:3306 + host: 192.168.0.172:3306 dbname: forum charset: utf8mb4 @@ -67,7 +67,7 @@ postgres: # Postgres配置 redis: # host: redis:6379 # docker-compose 时 - host: 192.168.0.219:6379 + host: 192.168.0.172:6379 db: 10 password: "" @@ -78,7 +78,7 @@ oracle: SID: topprod mongodb: - host: 192.168.0.219 + host: 192.168.0.172 port: 27017 system: diff --git a/repository/test.data/chart.selection.go b/repository/test.data/chart.selection.go index ce957c0..088b81b 100644 --- a/repository/test.data/chart.selection.go +++ b/repository/test.data/chart.selection.go @@ -38,3 +38,21 @@ func PBISelection(r *request.ChartSelection) []string { r.Step, r.Product, r.Lot, startDate, now.Format("Y-m-d")).Group("pbi").Select("pbi").Find(&pbis) return pbis } + +func SubBatchSelection(r *request.ChartSelection) []string { + now := carbon.Now() + startDate := now.SubMonths(12).Format("Y-m-d") + var subBatch []string + global.PostGreSQL.Model(&model.FileHandled{}).Where("step = ? AND product = ? AND lot = ? AND pbi = ? AND created_at BETWEEN Date(?) AND Date(?)", + r.Step, r.Product, r.Lot, r.PBI, startDate, now.Format("Y-m-d")).Group("sub_batch").Select("sub_batch").Find(&subBatch) + return subBatch +} + +func WaferIDSelection(r *request.ChartSelection) []string { + now := carbon.Now() + startDate := now.SubMonths(12).Format("Y-m-d") + var waferIDs []string + global.PostGreSQL.Model(&model.FileHandled{}).Where("step = ? AND product = ? AND lot = ? AND pbi = ? AND created_at BETWEEN Date(?) AND Date(?)", + r.Step, r.Product, r.Lot, r.PBI, startDate, now.Format("Y-m-d")).Group("wafer_id").Select("wafer_id").Find(&waferIDs) + return waferIDs +} diff --git a/request/chart.selection.go b/request/chart.selection.go index c18240d..82b186d 100644 --- a/request/chart.selection.go +++ b/request/chart.selection.go @@ -6,4 +6,5 @@ type ChartSelection struct { Product string `json:"product"` Lot string `json:"lot"` Step string `json:"step"` + PBI string `json:"pbi"` } diff --git a/router/chart.selection.go b/router/chart.selection.go index 0fc2fef..ba11e20 100644 --- a/router/chart.selection.go +++ b/router/chart.selection.go @@ -12,5 +12,7 @@ func InitChartSelectionRouter(R *gin.RouterGroup) { chartSelectionGroup.POST("productSelection", chartSelectionService.ProductSelection) chartSelectionGroup.POST("lotSelection", chartSelectionService.LotSelection) chartSelectionGroup.POST("pbiSelection", chartSelectionService.PBISelection) + chartSelectionGroup.POST("subBatchSelection", chartSelectionService.SubBatchSelection) + chartSelectionGroup.POST("waferIDSelection", chartSelectionService.WaferIDSelection) } }