作者 Your Name

修复一些错误

... ... @@ -22,7 +22,7 @@ func (srv ProductTroubleService) RewardSummaryPublicNoticeDay() (map[string]inte
transactionContext.RollbackTransaction()
}()
rewardSumaryDao, _ := dao.NewRewardSumaryDao(transactionContext.(*pgTransaction.TransactionContext))
sumaryData, err := rewardSumaryDao.SeachRewardSummaryDay(23, 467, "2022-10-29")
sumaryData, err := rewardSumaryDao.SeachRewardSummaryDay(23, 487, "2022-10-29")
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
... ... @@ -51,7 +51,7 @@ func (srv ProductTroubleService) RewardSummaryPublicNoticeYield() (map[string]in
transactionContext.RollbackTransaction()
}()
rewardSumaryDao, _ := dao.NewRewardSumaryDao(transactionContext.(*pgTransaction.TransactionContext))
sumaryData, err := rewardSumaryDao.SeachRewardSummaryYield(23, 467, "2022-10-29")
sumaryData, err := rewardSumaryDao.SeachRewardSummaryYield(23, 487, "2022-10-29")
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
... ... @@ -80,7 +80,7 @@ func (srv ProductTroubleService) RewardSummaryPublicNoticeUpToStandard() (map[st
transactionContext.RollbackTransaction()
}()
rewardSumaryDao, _ := dao.NewRewardSumaryDao(transactionContext.(*pgTransaction.TransactionContext))
sumaryData, err := rewardSumaryDao.SeachRewardUpToStandard(23, 467, "2022-10-29")
sumaryData, err := rewardSumaryDao.SeachRewardUpToStandard(23, 487, "2022-10-29")
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
... ... @@ -108,7 +108,7 @@ func (srv ProductTroubleService) RewardSummaryPublicNoticeAccident() (map[string
transactionContext.RollbackTransaction()
}()
rewardSumaryDao, _ := dao.NewRewardSumaryDao(transactionContext.(*pgTransaction.TransactionContext))
sumaryData, err := rewardSumaryDao.SeachRewardUpToStandard(23, 467, "2022-10-29")
sumaryData, err := rewardSumaryDao.SeachRewardUpToStandard(23, 487, "2022-10-29")
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
... ...
... ... @@ -30,15 +30,15 @@ type RewardSummaryDay struct {
YieldResult string `json:"yieldResult"` //产效功过结果
UpToStandardResult string `json:"upToStandardResult"` //合格率功过结果
AccidentResult1 string `json:"accidentResult1"` //质量事故功过结果
AccidentResul2 string `json:"accidentResul2"` //安全事故功过结果
AccidentResul3 string `json:"accidentResul3"` //异物 功过结果
AccidentResult2 string `json:"accidentResul2"` //安全事故功过结果
AccidentResult3 string `json:"accidentResul3"` //异物 功过结果
}
// 功过看板-日榜
func (d *RewardSumaryDao) SeachRewardSummaryDay(companyId int, orgId int, recordDate string) ([]RewardSummaryDay, error) {
sqlStr := `SELECT
"id",record_date_str,
work_station->>'sectionName',
work_station->>'sectionName' as section_name,
worker->>'userName' as worker_name,
summary_result,
yield_result,
... ... @@ -46,7 +46,7 @@ func (d *RewardSumaryDao) SeachRewardSummaryDay(companyId int, orgId int, record
accident_result1,
accident_result2,
accident_result3
FROM "reward_summary"
FROM manufacture."reward_summary"
WHERE company_id=?
and org_id=?
and record_date_str=?`
... ... @@ -70,12 +70,12 @@ type RewardSummaryYield struct {
func (d *RewardSumaryDao) SeachRewardSummaryYield(companyId int, orgId int, recordDate string) ([]RewardSummaryYield, error) {
sqlStr := `SELECT
record_date_str,
work_station->>'sectionName',
work_station->>'sectionName' as section_name,
worker->>'userName' as worker_name,
yield_result,
yield,
"24" as yield_max
FROM "reward_summary"
'24' as yield_max
FROM manufacture."reward_summary"
WHERE company_id=?
and org_id=?
and record_date_str=?`
... ... @@ -99,13 +99,13 @@ type RewardSummaryUpToStandard struct {
// 功过看板-合格率
func (d *RewardSumaryDao) SeachRewardUpToStandard(companyId int, orgId int, recordDate string) ([]RewardSummaryUpToStandard, error) {
sqlStr := `SELECT
"id",record_date_str,
work_station->>'sectionName',
record_date_str,
work_station->>'sectionName' as section_name,
worker->>'userName' as worker_name,
up_to_standard_result,
up_to_standard,
'90' as up_to_standard_max
FROM "reward_summary"
FROM manufacture."reward_summary"
WHERE company_id=23
and org_id=487
and record_date_str='2022-10-29'`
... ... @@ -124,20 +124,20 @@ type RewardAccident struct {
YieldResult string `json:"yieldResult"` //产效功过结果
UpToStandardResult string `json:"upToStandardResult"` //合格率功过结果
AccidentResult1 string `json:"accidentResult1"` //质量事故功过结果
AccidentResul2 string `json:"accidentResul2"` //安全事故功过结果
AccidentResul3 string `json:"accidentResul3"` //异物 功过结果
AccidentResult2 string `json:"accidentResul2"` //安全事故功过结果
AccidentResult3 string `json:"accidentResul3"` //异物 功过结果
}
// 功过看板-异常
func (d *RewardSumaryDao) SeachRewardAccident(companyId int, orgId int, recordDate string) ([]RewardAccident, error) {
sqlStr := `SELECT
"id",record_date_str,
work_station->>'sectionName',
work_station->>'sectionName' as section_name,
worker->>'userName' as worker_name,
up_to_standard_result,
up_to_standard,
'90' as up_to_standard_max
FROM "reward_summary"
FROM manufacture."reward_summary"
WHERE company_id=?
and org_id=?
and record_date_str=?`
... ...