V0 图表参数选项获取(最近三个月文件)

This commit is contained in:
jh_peng 2024-10-24 18:12:44 +08:00
parent af9de292b0
commit 538facc977
5 changed files with 64 additions and 7 deletions

View File

@ -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)
}

View File

@ -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:

View File

@ -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
}

View File

@ -6,4 +6,5 @@ type ChartSelection struct {
Product string `json:"product"`
Lot string `json:"lot"`
Step string `json:"step"`
PBI string `json:"pbi"`
}

View File

@ -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)
}
}