作者 Your Name

更新

@@ -213,7 +213,7 @@ func (srv ExcelDataService) BatchAddAttendance(operate domain.OperateInfo, param @@ -213,7 +213,7 @@ func (srv ExcelDataService) BatchAddAttendance(operate domain.OperateInfo, param
213 } 213 }
214 //检查工位 214 //检查工位
215 var workStation *domain.WorkStation 215 var workStation *domain.WorkStation
216 - workStationName := param[i].WorkerName + "/" + param[i].LineName + "/" + param[i].SectionName 216 + workStationName := param[i].WorkshopName + "/" + param[i].LineName + "/" + param[i].SectionName
217 if v, ok := workStationMap[workStationName]; ok { 217 if v, ok := workStationMap[workStationName]; ok {
218 workStation = v 218 workStation = v
219 } else { 219 } else {
@@ -428,7 +428,7 @@ func (srv *ProductRecordService) BatchAddProductCapacities(operate *domain.Opera @@ -428,7 +428,7 @@ func (srv *ProductRecordService) BatchAddProductCapacities(operate *domain.Opera
428 } 428 }
429 //检查工位 429 //检查工位
430 var workStation *domain.WorkStation 430 var workStation *domain.WorkStation
431 - workStationName := dataList[i].WorkerName + "/" + dataList[i].LineName + "/" + dataList[i].SectionName 431 + workStationName := dataList[i].WorkshopName + "/" + dataList[i].LineName + "/" + dataList[i].SectionName
432 if v, ok := workStationMap[workStationName]; ok { 432 if v, ok := workStationMap[workStationName]; ok {
433 workStation = v 433 workStation = v
434 } else { 434 } else {
@@ -110,7 +110,13 @@ func (srv ProductTroubleService) SaveProductTrouble(operateInfo *domain.OperateI @@ -110,7 +110,13 @@ func (srv ProductTroubleService) SaveProductTrouble(operateInfo *domain.OperateI
110 if err != nil { 110 if err != nil {
111 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 111 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
112 } 112 }
113 - 113 + if param.SaveAndApprove {
  114 + summaryServe, _ := domainService.NewPGRewardSummaryStaticService(transactionContext.(*pgTransaction.TransactionContext))
  115 + err = summaryServe.CreateRewardSummaryByProductTrouble(troubleData)
  116 + if err != nil {
  117 + return nil, application.ThrowError(application.ARG_ERROR, "计算功过奖惩明细失败,"+err.Error())
  118 + }
  119 + }
114 if err := transactionContext.CommitTransaction(); err != nil { 120 if err := transactionContext.CommitTransaction(); err != nil {
115 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 121 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
116 } 122 }
@@ -385,7 +391,7 @@ func (srv ProductTroubleService) BatchAddProductTrouble(operateInfo *domain.Oper @@ -385,7 +391,7 @@ func (srv ProductTroubleService) BatchAddProductTrouble(operateInfo *domain.Oper
385 } 391 }
386 //检查工位 392 //检查工位
387 var workStation *domain.WorkStation 393 var workStation *domain.WorkStation
388 - workStationName := param[i].WorkerName + "/" + param[i].LineName + "/" + param[i].SectionName 394 + workStationName := param[i].WorkshopName + "/" + param[i].LineName + "/" + param[i].SectionName
389 if v, ok := workStationMap[workStationName]; ok { 395 if v, ok := workStationMap[workStationName]; ok {
390 workStation = v 396 workStation = v
391 } else { 397 } else {
@@ -250,7 +250,14 @@ func (ptr *PGProductRecordService) personalProductStatics(productPlan *domain.Pr @@ -250,7 +250,14 @@ func (ptr *PGProductRecordService) personalProductStatics(productPlan *domain.Pr
250 if employeeProductRecord, err = employeeProductRecordRepository.Save(employeeProductRecord); err != nil { 250 if employeeProductRecord, err = employeeProductRecordRepository.Save(employeeProductRecord); err != nil {
251 log.Logger.Error(fmt.Sprintf("生产记录:[%v] 员工:[%v] 处理异常:%v", productRecord.ProductRecordId, productRecord.ProductWorker.UserId, err.Error())) 251 log.Logger.Error(fmt.Sprintf("生产记录:[%v] 员工:[%v] 处理异常:%v", productRecord.ProductRecordId, productRecord.ProductWorker.UserId, err.Error()))
252 } 252 }
  253 +
253 //TODO 记录奖惩明细 254 //TODO 记录奖惩明细
  255 +
  256 + rewardSummarySrv, _ := NewPGRewardSummaryStaticService(ptr.transactionContext)
  257 + err = rewardSummarySrv.CreateRewardSummaryByEmployeeProductRecord(employeeProductRecord)
  258 + if err != nil {
  259 + log.Logger.Error(fmt.Sprintf("记录奖惩明细,生产记录:[%v] 员工:[%v] 处理异常:%v", productRecord.ProductRecordId, productRecord.ProductWorker.UserId, err.Error()))
  260 + }
254 return nil, nil 261 return nil, nil
255 } 262 }
256 263