作者 庄敏学

合并分支 'dev' 到 'test'

Dev



查看合并请求 !2
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
... ...
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="Go" enabled="true" />
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/allied-creation-basic.iml" filepath="$PROJECT_DIR$/.idea/allied-creation-basic.iml" />
</modules>
</component>
</project>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
... ...
{"D:\\workspaceGo\\src\\allied-creation-basic\\pkg\\port\\beego":1630467905783651600}
\ No newline at end of file
{"/Users/zhuangmx/work/codes/allied-creation-basic/pkg/port/beego":1653986741097199045}
\ No newline at end of file
... ...
... ... @@ -19,6 +19,11 @@ import (
type NoticePersonalService struct {
}
func NewNoticePersonalService(options map[string]interface{}) *NoticePersonalService {
newNoticePersonalService := &NoticePersonalService{}
return newNoticePersonalService
}
// 设置消息:共创申请审核通过
func (noticePersonalService *NoticePersonalService) AgreeJoinCreationProject(agreeJoinCreationProjectCommand *command.AgreeJoinCreationProjectCommand) (interface{}, error) {
if err := agreeJoinCreationProjectCommand.ValidateCommand(); err != nil {
... ... @@ -701,7 +706,53 @@ func (noticePersonalService *NoticePersonalService) ReadNotice(readNoticeCommand
}
return readNoticeCommand, nil
}
func NewNoticePersonalService(options map[string]interface{}) *NoticePersonalService {
newNoticePersonalService := &NoticePersonalService{}
return newNoticePersonalService
//通用消息接口
func (noticePersonalService *NoticePersonalService) CommonNotice(systemNoticeCommand *command.SystemNoticeCommand) (interface{}, error) {
if err := systemNoticeCommand.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()
}()
// 个人消息存储初始化
extendStr, _ := json.Marshal(systemNoticeCommand.Extend)
noticePersonal := domain.NoticePersonal{
CreatedAt: time.Now(),
UpdatedAt: time.Now(),
Extend: string(extendStr),
CompanyId: systemNoticeCommand.CompanyId,
Content: systemNoticeCommand.Content,
IsRead: domain.NoticePersonalIsNotRead,
Module: domain.Module00,
ModuleAction: domain.Action00_01,
UserBaseId: systemNoticeCommand.UserBaseId,
OrgId: systemNoticeCommand.OrgId,
UserId: systemNoticeCommand.UserId,
}
var noticePersonalRepository domain.NoticePersonalRepository
if value, err := factory.CreateNoticePersonalRepository(map[string]interface{}{
"transactionContext": transactionContext,
}); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
noticePersonalRepository = value
}
_, err = noticePersonalRepository.Save(&noticePersonal)
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 systemNoticeCommand, nil
}
... ...
... ... @@ -72,6 +72,20 @@ var defaultsysSettingList = []SystemSetting{
SettingName: "用户初始化密码",
SettingCode: "XT001",
Description: "用于用户初始化设置初始化密码",
}, {
ControlLevel: "模块级",
ValueType: "字符",
Value: "",
SettingName: "生产报表类型角色配置",
SettingCode: "MK001",
Description: "生产报表类型角色配置,多个角色;隔开",
}, {
ControlLevel: "模块级",
ValueType: "字符",
Value: "",
SettingName: "销售报表类型角色配置",
SettingCode: "MK002",
Description: "销售报表类型角色配置,多个角色;隔开",
},
}
... ...
... ... @@ -17,6 +17,8 @@ func (controller *NoticePersonalController) GetNoticePersonalList() {
err := controller.Unmarshal(getNoticePersonalListQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
cnt, list, err := noticePersonalService.GetNoticePersonalList(getNoticePersonalListQuery)
data := map[string]interface{}{
... ... @@ -32,6 +34,8 @@ func (controller *NoticePersonalController) AgreeJoinCreationProject() {
err := controller.Unmarshal(agreeJoinCreationProjectCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
data, err := noticePersonalService.AgreeJoinCreationProject(agreeJoinCreationProjectCommand)
controller.Response(data, err)
... ... @@ -43,6 +47,8 @@ func (controller *NoticePersonalController) InformExpectedDividends() {
err := controller.Unmarshal(informExpectedDividendsCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
data, err := noticePersonalService.InformExpectedDividends(informExpectedDividendsCommand)
controller.Response(data, err)
... ... @@ -54,6 +60,8 @@ func (controller *NoticePersonalController) RefuseJoinCreationProject() {
err := controller.Unmarshal(refuseJoinCreationProjectCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
data, err := noticePersonalService.RefuseJoinCreationProject(refuseJoinCreationProjectCommand)
controller.Response(data, err)
... ... @@ -65,6 +73,8 @@ func (controller *NoticePersonalController) InformJoinCreationContract() {
err := controller.Unmarshal(informJoinCreationContractCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
data, err := noticePersonalService.InformJoinCreationContract(informJoinCreationContractCommand)
controller.Response(data, err)
... ... @@ -76,6 +86,8 @@ func (controller *NoticePersonalController) CreditAccountEstimate() {
err := controller.Unmarshal(creditAccountEstimateCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
data, err := noticePersonalService.CreditAccountEstimate(creditAccountEstimateCommand)
controller.Response(data, err)
... ... @@ -87,6 +99,8 @@ func (controller *NoticePersonalController) CreditAccountPayment() {
err := controller.Unmarshal(creditAccountPaymentCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
data, err := noticePersonalService.CreditAccountPayment(creditAccountPaymentCommand)
controller.Response(data, err)
... ... @@ -98,6 +112,8 @@ func (controller *NoticePersonalController) ReadNotice() {
err := controller.Unmarshal(readNoticeCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
data, err := noticePersonalService.ReadNotice(readNoticeCommand)
controller.Response(data, err)
... ... @@ -105,5 +121,14 @@ func (controller *NoticePersonalController) ReadNotice() {
//SystemNotice 系统消息
func (controller *NoticePersonalController) SystemNotice() {
noticePersonalService := service.NewNoticePersonalService(nil)
systemNoticeCommand := &command.SystemNoticeCommand{}
err := controller.Unmarshal(systemNoticeCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
data, err := noticePersonalService.CommonNotice(systemNoticeCommand)
controller.Response(data, err)
}
... ...
... ... @@ -14,4 +14,5 @@ func init() {
web.Router("/notice-personal/inform-join-creation-contract", &controllers.NoticePersonalController{}, "Post:InformJoinCreationContract")
web.Router("/notice-personal/credit-account/dividends-estimate", &controllers.NoticePersonalController{}, "Post:CreditAccountEstimate")
web.Router("/notice-personal/notice-personal/credit-account/payment", &controllers.NoticePersonalController{}, "Post:CreditAccountPayment")
web.Router("/notice-personal/system-notice", &controllers.NoticePersonalController{}, "Post:SystemNotice")
}
... ...