作者 yangfu

rebase

... ... @@ -34,7 +34,7 @@ func (dao *WorkshopProductRecordDao) WorkshopProductRecord(companyId, orgId int,
query.Where("org_id = ?", orgId)
query.Where("work_station ->>'workStationId' = ?", workStationId)
query.Where("product_date = ?", productTime.Local().Format("2006-01-02"))
//query.Where("product_record_info ->>'productPlanId' = '?'", planId)
query.Where("product_record_info ->>'productPlanId' = '?'", planId)
if err := query.First(); err != nil {
if err.Error() == "pg: no rows in result set" {
return nil, domain.ErrorNotFound
... ...
... ... @@ -132,12 +132,21 @@ func (ptr *PGProductRecordService) SubmitProductRecord(productRecordType int, qu
}
// 发送Job
if (productRecordType == domain.RecordTypeReceiveMaterial || productRecordType == domain.RecordTypeReturnMaterial) && workstation.SectionName == ProductSection4 {
if productRecordType == domain.RecordTypeReceiveMaterial || productRecordType == domain.RecordTypeReturnMaterial {
// 发送Job
if err = SendProductRecordStaticsJob(record); err != nil {
return nil, err
if workstation.SectionName == ProductSection4 {
if err = SendProductRecordStaticsJob(record); err != nil {
return nil, err
}
}
}
// 二级品需要审核后才能统计
//else {
// // 发送Job
// if err = SendProductRecordStaticsJob(record); err != nil {
// return nil, err
// }
//}
return nil, nil
}
... ...