package implments
//
//import (
//	dal "LAPP_LF_MOM_BACKEND/dao/base"
//	"LAPP_LF_MOM_BACKEND/db"
//	"LAPP_LF_MOM_BACKEND/infra/logger"
//	model "LAPP_LF_MOM_BACKEND/models/base"
//	"LAPP_LF_MOM_BACKEND/services/schedule"
//)
//
//
///******************************************************************************
// *
// * @Struct Name              : SchedulerServiceImplement
// *-----------------------------------------------------------------------------
// *
// * @Description              : scheduler的服务实现
// *
// * @Author                   : zhangxin
// *
// * @Date                     : 2021-05-18
// *
// ******************************************************************************/
//type SchedulerServiceImplement struct {
//}
//
///******************************************************************************
// *
// * @Function Name            : NewSchedulerServiceImplement
// *-----------------------------------------------------------------------------
// *
// * @Description              : 创建一个SchedulerServiceImplement实例
// *
// * @Return Value             : SchedulerServiceImplement实例
// *
// * @Author                   : zhangxin
// *
// * @Date                     : 2021-05-18
// *
// ******************************************************************************/
//func NewSchedulerServiceImplement() *SchedulerServiceImplement {
//	return &SchedulerServiceImplement{}
//}
//
///******************************************************************************
// *
// * @Reference LAPP_LF_MOM_BACKEND/services/scheduler/SchedulerService.ApsRelease
// *
// ******************************************************************************/
//func (impl *SchedulerServiceImplement) ApsRelease(plantNr int) {
//	user := "crontab"
//	log, _ := logger.NewLogger(user, "Scheduler")
//	master := db.Eloquent.Master()
//	session := master.NewSession()
//	workLineDao := dal.NewWorkLineDAO(session, plantNr, user)
//	workLineLi, err := workLineDao.SelectAll()
//	if err != nil {
//		log.Error("ApsRelease get all work line failed, error:" + err.Error())
//		return
//	}
//	for _, workLine := range workLineLi {
//		_ = impl.StartWorkLineRelease(workLine, plantNr)
//	}
//}
//
///******************************************************************************
// *
// * @Reference LAPP_LF_MOM_BACKEND/services/scheduler/SchedulerService.StartWorkLineRelease
// *
// ******************************************************************************/
//func (impl *SchedulerServiceImplement) StartWorkLineRelease(workLine model.WorkLine, plantNr int) error {
//	user := "crontab"
//	log, _ := logger.NewLogger(user, "Scheduler")
//	schedulerSrv := schedule.SchedulerSrv{
//		PlantNr: plantNr,
//	}
//	// 加载项目主数据
//	err := schedulerSrv.LoadProjectData()
//	if err != nil {
//		log.Error("StartWorkLineRelease load project data failed, error:" + err.Error(), "workLineId: " + workLine.WorkLineid)
//		return err
//	}
//	// 加载产线主数据
//	err = schedulerSrv.LoadWorklineData(workLine.LineType)
//	if err != nil {
//		log.Error("StartWorkLineRelease load work line data, error:" + err.Error(), "workLineId: " + workLine.WorkLineid)
//		return err
//	}
//	// 生产派工
//	err = schedulerSrv.ReleaseSchedule(workLine.WorkLineid)
//	if err != nil {
//		log.Error("StartWorkLineRelease release schedule failed, error:" + err.Error(), "workLineId: " + workLine.WorkLineid)
//		return err
//	}
//	return nil
//}