...
|
...
|
@@ -5,6 +5,7 @@ import ( |
|
|
"github.com/linmadan/egglib-go/utils/json"
|
|
|
"github.com/linmadan/egglib-go/web/beego"
|
|
|
"github.com/linmadan/egglib-go/web/beego/utils"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/crontab"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/statistics/query"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/statistics/service"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/constant"
|
...
|
...
|
@@ -46,6 +47,33 @@ func (controller *StatisticsController) CommonStatisticsHandler(actionType strin |
|
|
}
|
|
|
}
|
|
|
|
|
|
func (controller *StatisticsController) TaskHandler() func(ctx *context.Context) {
|
|
|
return func(ctx *context.Context) {
|
|
|
task := ctx.Input.Query(":taskId")
|
|
|
switch task {
|
|
|
case "1":
|
|
|
crontab.AutoApproveProductAttendanceRecord(nil)
|
|
|
break
|
|
|
case "2":
|
|
|
crontab.AutoApproveProductRecord(nil)
|
|
|
break
|
|
|
case "3":
|
|
|
crontab.AutoFlushDeviceDailyRunningRecord(nil)
|
|
|
break
|
|
|
case "4":
|
|
|
crontab.AutoFlushDeviceDailyRunningRecordOEE(nil)
|
|
|
break
|
|
|
case "5":
|
|
|
crontab.AutoWorkshopPlanCompletionRecord(nil)
|
|
|
break
|
|
|
case "6":
|
|
|
crontab.SyncProductPlan(nil)
|
|
|
break
|
|
|
}
|
|
|
Response(ctx, nil, nil)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
func Response(ctx *context.Context, data interface{}, err error) {
|
|
|
var response utils.JsonResponse
|
|
|
if err != nil {
|
...
|
...
|
|