作者 Your Name

修复一些错误

@@ -22,7 +22,7 @@ func (srv ProductTroubleService) RewardSummaryPublicNoticeDay() (map[string]inte @@ -22,7 +22,7 @@ func (srv ProductTroubleService) RewardSummaryPublicNoticeDay() (map[string]inte
22 transactionContext.RollbackTransaction() 22 transactionContext.RollbackTransaction()
23 }() 23 }()
24 rewardSumaryDao, _ := dao.NewRewardSumaryDao(transactionContext.(*pgTransaction.TransactionContext)) 24 rewardSumaryDao, _ := dao.NewRewardSumaryDao(transactionContext.(*pgTransaction.TransactionContext))
25 - sumaryData, err := rewardSumaryDao.SeachRewardSummaryDay(23, 467, "2022-10-29") 25 + sumaryData, err := rewardSumaryDao.SeachRewardSummaryDay(23, 487, "2022-10-29")
26 if err != nil { 26 if err != nil {
27 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 27 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
28 } 28 }
@@ -51,7 +51,7 @@ func (srv ProductTroubleService) RewardSummaryPublicNoticeYield() (map[string]in @@ -51,7 +51,7 @@ func (srv ProductTroubleService) RewardSummaryPublicNoticeYield() (map[string]in
51 transactionContext.RollbackTransaction() 51 transactionContext.RollbackTransaction()
52 }() 52 }()
53 rewardSumaryDao, _ := dao.NewRewardSumaryDao(transactionContext.(*pgTransaction.TransactionContext)) 53 rewardSumaryDao, _ := dao.NewRewardSumaryDao(transactionContext.(*pgTransaction.TransactionContext))
54 - sumaryData, err := rewardSumaryDao.SeachRewardSummaryYield(23, 467, "2022-10-29") 54 + sumaryData, err := rewardSumaryDao.SeachRewardSummaryYield(23, 487, "2022-10-29")
55 if err != nil { 55 if err != nil {
56 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 56 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
57 } 57 }
@@ -80,7 +80,7 @@ func (srv ProductTroubleService) RewardSummaryPublicNoticeUpToStandard() (map[st @@ -80,7 +80,7 @@ func (srv ProductTroubleService) RewardSummaryPublicNoticeUpToStandard() (map[st
80 transactionContext.RollbackTransaction() 80 transactionContext.RollbackTransaction()
81 }() 81 }()
82 rewardSumaryDao, _ := dao.NewRewardSumaryDao(transactionContext.(*pgTransaction.TransactionContext)) 82 rewardSumaryDao, _ := dao.NewRewardSumaryDao(transactionContext.(*pgTransaction.TransactionContext))
83 - sumaryData, err := rewardSumaryDao.SeachRewardUpToStandard(23, 467, "2022-10-29") 83 + sumaryData, err := rewardSumaryDao.SeachRewardUpToStandard(23, 487, "2022-10-29")
84 if err != nil { 84 if err != nil {
85 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 85 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
86 } 86 }
@@ -108,7 +108,7 @@ func (srv ProductTroubleService) RewardSummaryPublicNoticeAccident() (map[string @@ -108,7 +108,7 @@ func (srv ProductTroubleService) RewardSummaryPublicNoticeAccident() (map[string
108 transactionContext.RollbackTransaction() 108 transactionContext.RollbackTransaction()
109 }() 109 }()
110 rewardSumaryDao, _ := dao.NewRewardSumaryDao(transactionContext.(*pgTransaction.TransactionContext)) 110 rewardSumaryDao, _ := dao.NewRewardSumaryDao(transactionContext.(*pgTransaction.TransactionContext))
111 - sumaryData, err := rewardSumaryDao.SeachRewardUpToStandard(23, 467, "2022-10-29") 111 + sumaryData, err := rewardSumaryDao.SeachRewardUpToStandard(23, 487, "2022-10-29")
112 if err != nil { 112 if err != nil {
113 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 113 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
114 } 114 }
@@ -30,15 +30,15 @@ type RewardSummaryDay struct { @@ -30,15 +30,15 @@ type RewardSummaryDay struct {
30 YieldResult string `json:"yieldResult"` //产效功过结果 30 YieldResult string `json:"yieldResult"` //产效功过结果
31 UpToStandardResult string `json:"upToStandardResult"` //合格率功过结果 31 UpToStandardResult string `json:"upToStandardResult"` //合格率功过结果
32 AccidentResult1 string `json:"accidentResult1"` //质量事故功过结果 32 AccidentResult1 string `json:"accidentResult1"` //质量事故功过结果
33 - AccidentResul2 string `json:"accidentResul2"` //安全事故功过结果  
34 - AccidentResul3 string `json:"accidentResul3"` //异物 功过结果 33 + AccidentResult2 string `json:"accidentResul2"` //安全事故功过结果
  34 + AccidentResult3 string `json:"accidentResul3"` //异物 功过结果
35 } 35 }
36 36
37 // 功过看板-日榜 37 // 功过看板-日榜
38 func (d *RewardSumaryDao) SeachRewardSummaryDay(companyId int, orgId int, recordDate string) ([]RewardSummaryDay, error) { 38 func (d *RewardSumaryDao) SeachRewardSummaryDay(companyId int, orgId int, recordDate string) ([]RewardSummaryDay, error) {
39 sqlStr := `SELECT 39 sqlStr := `SELECT
40 "id",record_date_str, 40 "id",record_date_str,
41 - work_station->>'sectionName', 41 + work_station->>'sectionName' as section_name,
42 worker->>'userName' as worker_name, 42 worker->>'userName' as worker_name,
43 summary_result, 43 summary_result,
44 yield_result, 44 yield_result,
@@ -46,7 +46,7 @@ func (d *RewardSumaryDao) SeachRewardSummaryDay(companyId int, orgId int, record @@ -46,7 +46,7 @@ func (d *RewardSumaryDao) SeachRewardSummaryDay(companyId int, orgId int, record
46 accident_result1, 46 accident_result1,
47 accident_result2, 47 accident_result2,
48 accident_result3 48 accident_result3
49 - FROM "reward_summary" 49 + FROM manufacture."reward_summary"
50 WHERE company_id=? 50 WHERE company_id=?
51 and org_id=? 51 and org_id=?
52 and record_date_str=?` 52 and record_date_str=?`
@@ -70,12 +70,12 @@ type RewardSummaryYield struct { @@ -70,12 +70,12 @@ type RewardSummaryYield struct {
70 func (d *RewardSumaryDao) SeachRewardSummaryYield(companyId int, orgId int, recordDate string) ([]RewardSummaryYield, error) { 70 func (d *RewardSumaryDao) SeachRewardSummaryYield(companyId int, orgId int, recordDate string) ([]RewardSummaryYield, error) {
71 sqlStr := `SELECT 71 sqlStr := `SELECT
72 record_date_str, 72 record_date_str,
73 - work_station->>'sectionName', 73 + work_station->>'sectionName' as section_name,
74 worker->>'userName' as worker_name, 74 worker->>'userName' as worker_name,
75 yield_result, 75 yield_result,
76 yield, 76 yield,
77 - "24" as yield_max  
78 - FROM "reward_summary" 77 + '24' as yield_max
  78 + FROM manufacture."reward_summary"
79 WHERE company_id=? 79 WHERE company_id=?
80 and org_id=? 80 and org_id=?
81 and record_date_str=?` 81 and record_date_str=?`
@@ -99,13 +99,13 @@ type RewardSummaryUpToStandard struct { @@ -99,13 +99,13 @@ type RewardSummaryUpToStandard struct {
99 // 功过看板-合格率 99 // 功过看板-合格率
100 func (d *RewardSumaryDao) SeachRewardUpToStandard(companyId int, orgId int, recordDate string) ([]RewardSummaryUpToStandard, error) { 100 func (d *RewardSumaryDao) SeachRewardUpToStandard(companyId int, orgId int, recordDate string) ([]RewardSummaryUpToStandard, error) {
101 sqlStr := `SELECT 101 sqlStr := `SELECT
102 - "id",record_date_str,  
103 - work_station->>'sectionName', 102 + record_date_str,
  103 + work_station->>'sectionName' as section_name,
104 worker->>'userName' as worker_name, 104 worker->>'userName' as worker_name,
105 up_to_standard_result, 105 up_to_standard_result,
106 up_to_standard, 106 up_to_standard,
107 '90' as up_to_standard_max 107 '90' as up_to_standard_max
108 - FROM "reward_summary" 108 + FROM manufacture."reward_summary"
109 WHERE company_id=23 109 WHERE company_id=23
110 and org_id=487 110 and org_id=487
111 and record_date_str='2022-10-29'` 111 and record_date_str='2022-10-29'`
@@ -124,20 +124,20 @@ type RewardAccident struct { @@ -124,20 +124,20 @@ type RewardAccident struct {
124 YieldResult string `json:"yieldResult"` //产效功过结果 124 YieldResult string `json:"yieldResult"` //产效功过结果
125 UpToStandardResult string `json:"upToStandardResult"` //合格率功过结果 125 UpToStandardResult string `json:"upToStandardResult"` //合格率功过结果
126 AccidentResult1 string `json:"accidentResult1"` //质量事故功过结果 126 AccidentResult1 string `json:"accidentResult1"` //质量事故功过结果
127 - AccidentResul2 string `json:"accidentResul2"` //安全事故功过结果  
128 - AccidentResul3 string `json:"accidentResul3"` //异物 功过结果 127 + AccidentResult2 string `json:"accidentResul2"` //安全事故功过结果
  128 + AccidentResult3 string `json:"accidentResul3"` //异物 功过结果
129 } 129 }
130 130
131 // 功过看板-异常 131 // 功过看板-异常
132 func (d *RewardSumaryDao) SeachRewardAccident(companyId int, orgId int, recordDate string) ([]RewardAccident, error) { 132 func (d *RewardSumaryDao) SeachRewardAccident(companyId int, orgId int, recordDate string) ([]RewardAccident, error) {
133 sqlStr := `SELECT 133 sqlStr := `SELECT
134 "id",record_date_str, 134 "id",record_date_str,
135 - work_station->>'sectionName', 135 + work_station->>'sectionName' as section_name,
136 worker->>'userName' as worker_name, 136 worker->>'userName' as worker_name,
137 up_to_standard_result, 137 up_to_standard_result,
138 up_to_standard, 138 up_to_standard,
139 '90' as up_to_standard_max 139 '90' as up_to_standard_max
140 - FROM "reward_summary" 140 + FROM manufacture."reward_summary"
141 WHERE company_id=? 141 WHERE company_id=?
142 and org_id=? 142 and org_id=?
143 and record_date_str=?` 143 and record_date_str=?`