|
|
package service
|
|
|
|
|
|
import (
|
|
|
"time"
|
|
|
|
|
|
"github.com/linmadan/egglib-go/core/application"
|
|
|
pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/factory"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/dao"
|
|
|
)
|
|
|
|
|
|
//功过看板 展示(员工)
|
|
|
|
|
|
// RewardSummaryPublicNoticeDay 功过看板 日榜
|
|
|
func (srv ProductTroubleService) RewardSummaryPublicNoticeDay() (map[string]interface{}, error) {
|
|
|
func (srv ProductTroubleService) RewardSummaryPublicNoticeDay(operateInfo *domain.OperateInfo) (map[string]interface{}, error) {
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
...
|
...
|
@@ -22,7 +25,8 @@ func (srv ProductTroubleService) RewardSummaryPublicNoticeDay() (map[string]inte |
|
|
transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
rewardSumaryDao, _ := dao.NewRewardSumaryDao(transactionContext.(*pgTransaction.TransactionContext))
|
|
|
sumaryData, err := rewardSumaryDao.SeachRewardSummaryDay(23, 487, "2022-10-29")
|
|
|
nowTime := time.Now().Format("2006-01-02")
|
|
|
sumaryData, err := rewardSumaryDao.SeachRewardSummaryDay(operateInfo.CompanyId, operateInfo.OrgId, nowTime)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
@@ -31,14 +35,14 @@ func (srv ProductTroubleService) RewardSummaryPublicNoticeDay() (map[string]inte |
|
|
}
|
|
|
result := map[string]interface{}{
|
|
|
"list": sumaryData,
|
|
|
"recordDay": "2022-10-29",
|
|
|
"recordDay": nowTime,
|
|
|
}
|
|
|
|
|
|
return result, nil
|
|
|
}
|
|
|
|
|
|
// RewardSummaryPublicNoticeYield 功过看板 产效
|
|
|
func (srv ProductTroubleService) RewardSummaryPublicNoticeYield() (map[string]interface{}, error) {
|
|
|
func (srv ProductTroubleService) RewardSummaryPublicNoticeYield(operateInfo *domain.OperateInfo) (map[string]interface{}, error) {
|
|
|
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
...
|
...
|
@@ -51,7 +55,8 @@ func (srv ProductTroubleService) RewardSummaryPublicNoticeYield() (map[string]in |
|
|
transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
rewardSumaryDao, _ := dao.NewRewardSumaryDao(transactionContext.(*pgTransaction.TransactionContext))
|
|
|
sumaryData, err := rewardSumaryDao.SeachRewardSummaryYield(23, 487, "2022-10-29")
|
|
|
nowTime := time.Now().Format("2006-01-02")
|
|
|
sumaryData, err := rewardSumaryDao.SeachRewardSummaryYield(operateInfo.CompanyId, operateInfo.OrgId, nowTime)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
@@ -67,7 +72,7 @@ func (srv ProductTroubleService) RewardSummaryPublicNoticeYield() (map[string]in |
|
|
}
|
|
|
|
|
|
// RewardSummaryPublicNoticeUpToStandard 功过看板 合格率
|
|
|
func (srv ProductTroubleService) RewardSummaryPublicNoticeUpToStandard() (map[string]interface{}, error) {
|
|
|
func (srv ProductTroubleService) RewardSummaryPublicNoticeUpToStandard(operateInfo *domain.OperateInfo) (map[string]interface{}, error) {
|
|
|
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
...
|
...
|
@@ -80,7 +85,8 @@ func (srv ProductTroubleService) RewardSummaryPublicNoticeUpToStandard() (map[st |
|
|
transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
rewardSumaryDao, _ := dao.NewRewardSumaryDao(transactionContext.(*pgTransaction.TransactionContext))
|
|
|
sumaryData, err := rewardSumaryDao.SeachRewardUpToStandard(23, 487, "2022-10-29")
|
|
|
nowTime := time.Now().Format("2006-01-02")
|
|
|
sumaryData, err := rewardSumaryDao.SeachRewardUpToStandard(operateInfo.CompanyId, operateInfo.OrgId, nowTime)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
@@ -95,7 +101,7 @@ func (srv ProductTroubleService) RewardSummaryPublicNoticeUpToStandard() (map[st |
|
|
}
|
|
|
|
|
|
// RewardSummaryPublicNoticeDay 功过看板 异常
|
|
|
func (srv ProductTroubleService) RewardSummaryPublicNoticeAccident() (map[string]interface{}, error) {
|
|
|
func (srv ProductTroubleService) RewardSummaryPublicNoticeAccident(operateInfo *domain.OperateInfo) (map[string]interface{}, error) {
|
|
|
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
...
|
...
|
@@ -108,7 +114,8 @@ func (srv ProductTroubleService) RewardSummaryPublicNoticeAccident() (map[string |
|
|
transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
rewardSumaryDao, _ := dao.NewRewardSumaryDao(transactionContext.(*pgTransaction.TransactionContext))
|
|
|
sumaryData, err := rewardSumaryDao.SeachRewardAccident(23, 487, "2022-10-29")
|
|
|
nowTime := time.Now().Format("2006-01-02")
|
|
|
sumaryData, err := rewardSumaryDao.SeachRewardAccident(operateInfo.CompanyId, operateInfo.OrgId, nowTime)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
@@ -122,8 +129,7 @@ func (srv ProductTroubleService) RewardSummaryPublicNoticeAccident() (map[string |
|
|
}
|
|
|
|
|
|
// RewardSummaryPublicNoticeDay 功过看板 月榜
|
|
|
func (srv ProductTroubleService) RewardSummaryPublicNoticeMonth() (map[string]interface{}, error) {
|
|
|
|
|
|
func (srv ProductTroubleService) RewardSummaryPublicNoticeMonth(operateInfo *domain.OperateInfo) (map[string]interface{}, error) {
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
...
|
...
|
@@ -135,7 +141,8 @@ func (srv ProductTroubleService) RewardSummaryPublicNoticeMonth() (map[string]in |
|
|
transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
rewardSumaryDao, _ := dao.NewRewardSumaryDao(transactionContext.(*pgTransaction.TransactionContext))
|
|
|
sumaryData, err := rewardSumaryDao.SeachRewardSummaryMonth(23, 487, "2022-10")
|
|
|
nowTime := time.Now().Format("2006-01")
|
|
|
sumaryData, err := rewardSumaryDao.SeachRewardSummaryMonth(operateInfo.CompanyId, operateInfo.OrgId, nowTime)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
|