...
|
...
|
@@ -72,7 +72,7 @@ func (ptr *PGCommonStatisticsService) HourProductiveStatistics(queryOptions map[ |
|
|
if err != nil || workshop == nil {
|
|
|
return nil, nil
|
|
|
}
|
|
|
productRecordDao, _ := dao.NewProductRecordDao(ptr.transactionContext)
|
|
|
productRecordDao, _ := dao.NewDeviceDailyRunningRecordDao(ptr.transactionContext)
|
|
|
|
|
|
var response = make([]interface{}, 0)
|
|
|
var tmpXData = make([]string, 0)
|
...
|
...
|
@@ -243,7 +243,7 @@ func (ptr *PGCommonStatisticsService) WorkshopProductionEfficiencyStatistics(que |
|
|
|
|
|
var response = make(map[string]interface{})
|
|
|
for _, v := range input {
|
|
|
var result = make([]*record, 0)
|
|
|
var result = record{}
|
|
|
if err := productRecordDao.WorkshopProductionEfficiencyStatistics(request.CompanyId, request.OrgId, request.WorkshopId, v.t, &result); err != nil {
|
|
|
log.Logger.Error(err.Error())
|
|
|
return nil, err
|
...
|
...
|
@@ -261,14 +261,14 @@ func (ptr *PGCommonStatisticsService) DeviceRunningStatistics(queryOptions map[s |
|
|
return nil, err
|
|
|
}
|
|
|
|
|
|
workshopRepository, _ := repository.NewWorkshopRepository(ptr.transactionContext)
|
|
|
//workshopRepository, _ := repository.NewWorkshopRepository(ptr.transactionContext)
|
|
|
deviceRepository, _ := repository.NewDeviceRepository(ptr.transactionContext)
|
|
|
deviceRunningRecordRepository, _ := repository.NewDeviceDailyRunningRecordRepository(ptr.transactionContext)
|
|
|
|
|
|
workshop, err := workshopRepository.FindOne(map[string]interface{}{"workshopId": request.WorkshopId})
|
|
|
if err != nil || workshop == nil {
|
|
|
return nil, nil
|
|
|
}
|
|
|
//workshop, err := workshopRepository.FindOne(map[string]interface{}{"workshopId": request.WorkshopId})
|
|
|
//if err != nil || workshop == nil {
|
|
|
// return nil, nil
|
|
|
//}
|
|
|
|
|
|
_, devices, err := deviceRepository.Find(map[string]interface{}{"companyId": request.CompanyId, "orgId": request.OrgId, "workshopId": request.WorkshopId, "lineId": request.LineId})
|
|
|
if err != nil {
|
...
|
...
|
@@ -312,7 +312,7 @@ func (ptr *PGCommonStatisticsService) DeviceRunningStatistics(queryOptions map[s |
|
|
type DeviceRunningStatisticRequest struct {
|
|
|
CompanyId int `json:"companyId" valid:"Required"`
|
|
|
OrgId int `json:"orgId" valid:"Required"`
|
|
|
WorkshopId int `json:"workshopId" valid:"Required"`
|
|
|
WorkshopId int `json:"workshopId"`
|
|
|
LineId int `json:"lineId""`
|
|
|
Date string `json:"date"`
|
|
|
}
|
...
|
...
|
|