...
|
...
|
@@ -91,8 +91,8 @@ func (ptr *PGWorkshopDataConsumeService) Consume(companyId, orgId int, record *d |
|
|
if _, err = deviceRunningRecordRepository.Save(deviceRunningRecord); err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
// 2.保存设备生产记录 (统计车间、员工产能)
|
|
|
if record.DeviceType == domain.DeviceTypeChuanChuanJi && plan != nil {
|
|
|
// 2.保存设备生产记录 (统计车间、员工产能) 批次跟数量不为空
|
|
|
if record.DeviceType == domain.DeviceTypeChuanChuanJi && plan != nil && deviceRunningData.Count > 0 {
|
|
|
|
|
|
productRecord, _ := ptr.newProductRecord(companyId, orgId, workStation, device, deviceRunningData, plan)
|
|
|
//if _, err = deviceRunningRecordRepository.Save(deviceRunningRecord); err != nil {
|
...
|
...
|
@@ -247,8 +247,8 @@ func (ptr *PGWorkshopDataConsumeService) newProductRecord(companyId int, orgId i |
|
|
ProductRecordInfo: &domain.ProductRecordInfo{
|
|
|
ProductDate: data.CollectionTime.Local().Format("2006-01-02"),
|
|
|
Original: float64(data.Count),
|
|
|
Weigh: utils.Round(float64(data.Count)*DefaultCCJUnitQuantity, 1),
|
|
|
WeighBefore: utils.Round(float64(data.Count)*DefaultCCJUnitQuantity, 1),
|
|
|
Weigh: utils.Round(float64(data.Count)*DefaultCCJUnitQuantity, 2),
|
|
|
WeighBefore: utils.Round(float64(data.Count)*DefaultCCJUnitQuantity, 2),
|
|
|
ApproveStatus: domain.AttendanceNotApprove,
|
|
|
ProductPlanId: plan.PlanDispatchRecordExt.ProductPlanId,
|
|
|
PlanProductName: plan.PlanDispatchRecordExt.PlanProductName,
|
...
|
...
|
|