...
|
...
|
@@ -92,7 +92,10 @@ func (ptr *PGWorkshopDataConsumeService) Consume(companyId, orgId int, record *d |
|
|
if _, err = deviceRunningRecordRepository.Save(deviceRunningRecord); err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
// 2.保存设备生产记录 (统计车间、员工产能) 批次跟数量不为空
|
|
|
|
|
|
// 2.更新 设备每日运行记录(汇总) - redis更新 十分钟异步刷库
|
|
|
if addSuccess := deviceDailyRecord.AddDeviceRunningData(deviceRunningData.CollectionTime, deviceRunningData); addSuccess {
|
|
|
// 3.保存设备生产记录 (统计车间、员工产能) 批次跟数量不为空
|
|
|
if record.DeviceType == domain.DeviceTypeChuanChuanJi && plan != nil && deviceRunningData.Count > 0 {
|
|
|
|
|
|
productRecord, _ := ptr.newProductRecord(companyId, orgId, workStation, device, deviceRunningData, plan)
|
...
|
...
|
@@ -102,9 +105,7 @@ func (ptr *PGWorkshopDataConsumeService) Consume(companyId, orgId int, record *d |
|
|
productRecordService.EmployeeProductStatics(productRecord)
|
|
|
productRecordService.WorkshopProductStatics(productRecord)
|
|
|
}
|
|
|
|
|
|
// 3.更新 设备每日运行记录(汇总) - redis更新 十分钟异步刷库
|
|
|
deviceDailyRecord.AddDeviceRunningData(deviceRunningData.CollectionTime, deviceRunningData)
|
|
|
}
|
|
|
if err = redis.SaveDeviceDailyRunningRecord(deviceDailyRecord); err != nil {
|
|
|
//log.Logger.Error(err.Error())
|
|
|
return nil, err
|
...
|
...
|
|