...
|
...
|
@@ -12,6 +12,7 @@ import ( |
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/application/noticePersonal/command"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/application/noticePersonal/query"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/domain"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/infrastructure/dao"
|
|
|
)
|
|
|
|
|
|
// 个人消息通知
|
...
|
...
|
@@ -627,6 +628,40 @@ func (noticePersonalService *NoticePersonalService) CreditAccountPayment(creditA |
|
|
return noticePersonal, nil
|
|
|
}
|
|
|
|
|
|
// 设置消息:账期结算消息-分红预算
|
|
|
func (noticePersonalService *NoticePersonalService) ReadNotice(readNoticeCommand *command.ReadNoticeCommand) (interface{}, error) {
|
|
|
if err := readNoticeCommand.ValidateCommand(); err != nil {
|
|
|
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
|
}
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
if err := transactionContext.StartTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
defer func() {
|
|
|
_ = transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
// 共创合约DAO初始化
|
|
|
var noticePersonalDao *dao.NoticePersonalDao
|
|
|
if value, err := factory.CreateNoticePersonalDao(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
}); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
} else {
|
|
|
noticePersonalDao = value
|
|
|
}
|
|
|
_, err = noticePersonalDao.ReadNoticePersonal(int64(readNoticeCommand.UserId),
|
|
|
readNoticeCommand.NoticeId, readNoticeCommand.ReadAll)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
return readNoticeCommand, nil
|
|
|
}
|
|
|
func NewNoticePersonalService(options map[string]interface{}) *NoticePersonalService {
|
|
|
newNoticePersonalService := &NoticePersonalService{}
|
|
|
return newNoticePersonalService
|
...
|
...
|
|