作者 yangfu

用户消息、账期结算、合约分红修改

正在显示 26 个修改的文件 包含 228 行增加85 行删除
... ... @@ -10,11 +10,12 @@ import (
type CreditAccountPayCommand struct {
//操作人
Operator domain.Operator `json:"-"`
CreditAccountId int
CreditAccountId int `json:"creditAccountId"`
// 账期结算实付金额
ActuallyPaidAmount float64 `cname:"账期结算实付金额" json:"actuallyPaidAmount" valid:"Required"`
// 备注
Remarks string `cname:"备注" json:"remarks" valid:"Required"`
Remarks string `cname:"备注" json:"remark"`
Attachment domain.Attachment `json:"paymentDocumentAttachment"` //附件
}
func (cmd *CreditAccountPayCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -16,6 +16,10 @@ type CreditAccountPaySearchCommand struct {
PageSize int64 `json:"pageSize" valid:"Required"`
// 账期结算支付状态,1待支付,2已支付 0全部
PaymentStatus int32 `json:"paymentStatus"`
// 开始时间
BeginTime int `json:"beginTime"`
// 结算时间
EndTime int `json:"beginTime"`
}
func (cmd *CreditAccountPaySearchCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -14,6 +14,8 @@ type SearchFeedbackCommand struct {
PageNumber int64 `cname:"页码" json:"pageNumber,omitempty"`
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
// 查询关键词
MatchWord string `cname:"查询关键词" json:"matchWord,omitempty"`
}
func (cmd *SearchFeedbackCommand) Valid(validation *validation.Validation) {
... ...
package dto
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
type CreditAccountItem struct {
CreditAccountId int `json:"creditAccountId"` // 账期结算单ID
ActuallyPaidAmount float64 `json:"actuallyPaidAmount"` // 账期结算实付金额
CreditAccountOrderNum string `json:"creditAccountOrderNum"` // 账期结算单号
PaymentStatus int `json:"paymentStatus"` // 账期结算支付状态,1待支付,2已支付
PaymentTime int64 `json:"paymentTime"` // 共创账期结算支付时间
SettlementAmount float64 `json:"settlementAmount"` // 账期结算金额
SettlementTime int64 `json:"settlementTime"` // 共创账期结算时间
CooperationContractNumber string `json:"cooperationContractNumber"` // 关联共创合约编号
Participator struct {
UserName string `json:"userName"` // 用户姓名
UserPhone string `json:"userPhone"` // 用户手机号
UserType int `json:"userType"` // 用户类型,1员工,2共创用户,3公开
UserInfo struct {
// 用户姓名
UserName string `json:"userName,omitempty"`
// 手机号码
UserPhone string `json:"userPhone,omitempty"`
// 头像
//Avatar string `json:"avatar,omitempty"`
// 邮箱
//Email string `json:"email,omitempty"`
} `json:"userInfo"`
} `json:"participator"` // 参与人
ParticipateType string `json:"participateType"` // 参与类型
PaymentDocumentAttachment domain.Attachment `json:"paymentDocumentAttachment"` // 支付凭证附件
Org domain.Org `json:"org"` // 数据所属组织机构
Company domain.CompanyData `json:"company"` // 公司
CreatedAt int64 `json:"createdAt"` // 创建时间
UpdatedAt int64 `json:"updatedAt"` // 更新时间
AccountDetail []struct {
DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"`
DividendsType string `json:"dividendsType"`
DividendsAmount float64 `json:"dividendsAmount"`
} `json:"accountDetail"` //结算明细
}
func ToCreditAccountItem(param *allied_creation_cooperation.CreditAccount) *CreditAccountItem {
data := CreditAccountItem{
CreditAccountId: param.CreditAccountId,
ActuallyPaidAmount: param.ActuallyPaidAmount,
CreditAccountOrderNum: param.CreditAccountOrderNum,
PaymentStatus: param.PaymentStatus,
PaymentTime: param.PaymentTime.Unix() * 1000,
SettlementAmount: param.SettlementAmount,
SettlementTime: param.SettlementTime.Unix() * 1000,
CooperationContractNumber: param.CooperationContractNumber,
ParticipateType: param.ParticipateType, // 参与类型
PaymentDocumentAttachment: param.PaymentDocumentAttachment, // 支付凭证附件
Org: param.Org, // 数据所属组织机构
Company: param.Company, // 公司
CreatedAt: param.CreatedAt.Unix() * 1000, // 创建时间
UpdatedAt: param.UpdatedAt.Unix() * 1000, // 更新时间
AccountDetail: param.AccountDetail,
}
data.Participator.UserInfo.UserName = param.Participator.UserName
data.Participator.UserInfo.UserPhone = param.Participator.UserPhone
data.Participator.UserType = param.Participator.UserType
return &data
}
... ...
... ... @@ -7,7 +7,7 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
// 企业端分红服务
// 企业端分红服务 【50%】
type CompanyDividendsService struct {
}
... ...
... ... @@ -7,7 +7,7 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
// 企业端分红服务
// 企业端分红服务 【50%】
type PersonDividendsService struct {
}
... ...
... ... @@ -8,7 +8,7 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
// CooperationApplicationsService 共创申请服务
// CooperationApplicationsService 共创申请服务 【80%】
type CooperationApplicationsService struct {
}
... ... @@ -135,6 +135,7 @@ func (srv CooperationApplicationsService) PersonCancelCooperationApplications(ca
cancelCommand.Operator)
_, err := creationCooperationGateway.CooperationApplicationCancel(allied_creation_cooperation.ReqCooperationApplicationCancel{
ApplicationId: cancelCommand.CooperationApplicationId,
Code: "code", //TODO: 菜单编码?
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
... ...
... ... @@ -9,7 +9,7 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
// CooperationProjectService 共创项目服务
// CooperationProjectService 共创项目服务 【完成】
type CooperationProjectService struct {
}
... ... @@ -19,12 +19,6 @@ func (srv CooperationProjectService) CreateCooperationProject(createCooperationP
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createCooperationProjectCommand.Operator)
//var images []domain.Attachment
//for _, v := range createCooperationProjectCommand.Attachment {
// images = append(images, domain.Attachment{
// Url: v,
// })
//}
result, err := creationCooperationGateway.CooperationProjectAdd(allied_creation_cooperation.ReqCooperationProjectAdd{
CooperationProjectDescription: createCooperationProjectCommand.CooperationProjectDescription,
CooperationModeNumber: createCooperationProjectCommand.CooperationModeNumber,
... ... @@ -38,13 +32,6 @@ func (srv CooperationProjectService) CreateCooperationProject(createCooperationP
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
// data := struct {
// CooperationProjectId int `json:"cooperationProjectId"`
// command.CreateCooperationProjectCommand
// }{
// CooperationProjectId: result.CooperationProjectId,
// CreateCooperationProjectCommand: *createCooperationProjectCommand,
// }
return dto.ToCooperationProjectInfo(&result.CooperationProject), nil
}
... ... @@ -65,12 +52,6 @@ func (srv CooperationProjectService) GetCooperationProject(projectQuery *command
// UpdateCooperationProject 更新项目
func (srv CooperationProjectService) UpdateCooperationProject(updateCooperationProjectCommand *command.UpdateCooperationProjectCommand) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateCooperationProjectCommand.Operator)
//var images []domain.Attachment
//for _, v := range updateCooperationProjectCommand.Images {
// images = append(images, domain.Attachment{
// Url: v,
// })
//}
_, err := creationCooperationGateway.CooperationProjectUpdate(allied_creation_cooperation.ReqCooperationProjectUpdate{
CooperationProjectId: updateCooperationProjectCommand.CooperationProjectId,
CooperationProjectName: updateCooperationProjectCommand.CooperationProjectName,
... ... @@ -117,11 +98,6 @@ func (srv CooperationProjectService) SearchCooperationProject(projectQuery *comm
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
//var dataList []dto.CooperationProjectItem
//for i := range result.List {
// item := dto.ToCooperationProjectItem(&result.List[i])
// dataList = append(dataList, *item)
//}
return int(result.Total), result.List, nil
}
... ... @@ -138,10 +114,5 @@ func (srv CooperationProjectService) PersonSearchCooperationProject(projectQuery
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
//var dataList []dto.CooperationProjectItem
//for i := range result.List {
// item := dto.ToCooperationProjectItem(&result.List[i])
// dataList = append(dataList, *item)
//}
return int(result.Total), result.List, nil
}
... ...
... ... @@ -3,15 +3,16 @@ package service
import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/dto"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
// CompanyCreditAccountService 企业端账期结算
// CompanyCreditAccountService 企业端账期结算 【50%】
type CompanyCreditAccountService struct {
}
// CreditAccountSearch 企业的账期结算列表
func (srv CompanyCreditAccountService) CreditAccountSearch(cmd *command.CreditAccountSearchCommand) (interface{}, error) {
func (srv CompanyCreditAccountService) CreditAccountSearch(cmd *command.CreditAccountSearchCommand) (int64, interface{}, error) {
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
... ... @@ -20,9 +21,13 @@ func (srv CompanyCreditAccountService) CreditAccountSearch(cmd *command.CreditAc
PaymentStatus: cmd.PaymentStatus,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return resultMenu, nil
var items []*dto.CreditAccountItem
for i := 0; i < len(resultMenu.Grid.List); i++ {
items = append(items, dto.ToCreditAccountItem(&resultMenu.Grid.List[i]))
}
return int64(len(items)), items, nil
}
// CreditAccountGet 企业的账期结算明细
... ... @@ -35,7 +40,12 @@ func (srv CompanyCreditAccountService) CreditAccountGet(cmd *command.CreditAccou
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return resultMenu, nil
result := map[string]interface{}{
"creditAccount": dto.ToCreditAccountItem(&resultMenu.CreditAccount),
//TODO:dividendsEstimate 结算明细
"dividendsEstimate": []struct{}{},
}
return result, nil
}
// CreditAccountDelete 企业的账期结算删除
... ... @@ -56,7 +66,10 @@ func (srv CompanyCreditAccountService) CreditAccountPay(cmd *command.CreditAccou
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
resultMenu, err := gateway.CreditAccountsPay(allied_creation_cooperation.ReqCreditAccountsPay{
CreditAccountId: cmd.CreditAccountId,
CreditAccountId: cmd.CreditAccountId,
ActuallyPaidAmount: cmd.ActuallyPaidAmount,
Remarks: cmd.Remarks,
Attachment: cmd.Attachment,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
... ... @@ -72,14 +85,20 @@ func (srv CompanyCreditAccountService) CreditAccountPaySearch(cmd *command.Credi
PageNumber: cmd.PageNumber,
PageSize: cmd.PageSize,
PaymentStatus: 2,
//TODO:时间段过滤
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
var items []*dto.CreditAccountItem
for i := 0; i < len(resultMenu.Grid.List); i++ {
items = append(items, dto.ToCreditAccountItem(&resultMenu.Grid.List[i]))
}
return map[string]interface{}{
"grid": map[string]interface{}{
"list": resultMenu.Grid.List,
"sum": 6000,
"list": items,
//TODO:sum 时间段支付金额
"sum": 6000,
},
}, nil
}
... ...
... ... @@ -6,18 +6,16 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
// PersonCreditAccountService 企业端账期结算
// PersonCreditAccountService 企业端账期结算 【0%】
type PersonCreditAccountService struct {
}
//// CreditAccountSearch 企业的账期结算列表
//func (srv PersonCreditAccountService) CreditAccountSearch(cmd *command.CreditAccountSearchCommand) (interface{}, error) {
// CreditAccountGet 企业的账期结算明细
//func (srv PersonCreditAccountService) CreditAccountGet(cmd *command.CreditAccountGetCommand) (interface{}, error) {
// gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
// cmd.Operator)
// resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
// PageNumber: cmd.PageNumber,
// PageSize: cmd.PageSize,
// PaymentStatus: cmd.PaymentStatus,
// resultMenu, err := gateway.CreditAccountGet(allied_creation_cooperation.ReqCreditAccountGet{
// CreditAccountId: cmd.CreditAccountId,
// })
// if err != nil {
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
... ... @@ -25,19 +23,6 @@ type PersonCreditAccountService struct {
// return resultMenu, nil
//}
// CreditAccountGet 企业的账期结算明细
func (srv PersonCreditAccountService) CreditAccountGet(cmd *command.CreditAccountGetCommand) (interface{}, error) {
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
resultMenu, err := gateway.CreditAccountGet(allied_creation_cooperation.ReqCreditAccountGet{
CreditAccountId: cmd.CreditAccountId,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return resultMenu, nil
}
//// CreditAccountDelete 企业的账期结算删除
//func (srv PersonCreditAccountService) CreditAccountDelete(cmd *command.CreditAccountGetCommand) (interface{}, error) {
// gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
... ... @@ -72,13 +57,16 @@ func (srv PersonCreditAccountService) CreditAccountPaySearch(cmd *command.Credit
PageNumber: cmd.PageNumber,
PageSize: cmd.PageSize,
PaymentStatus: 2,
// TODO:时间段过滤,用户过滤
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"list": resultMenu,
"sum": 6000,
"grid": map[string]interface{}{
"list": resultMenu.Grid.List,
"sum": 6000,
},
}, nil
}
... ...
... ... @@ -4,7 +4,7 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
)
// 企业端统计
// 企业端统计 【0%】
type CompanyStatisticsService struct {
}
... ...
... ... @@ -4,7 +4,7 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
)
// 个人端统计
// 个人端统计 【0%】
type PersonStatisticsService struct {
}
... ... @@ -25,9 +25,9 @@ func (srv PersonStatisticsService) IndexStatistics(userMenusCommand *command.Ind
"companySum": 6,
},
"dividendStatistics": map[string]interface{}{
"creditAccount": 1000,
"dividendsEstimate": 2000,
"orderAmount": 7000,
"dividendAmount": 9000,
"paidAmount": 2000,
"unPaidAmount": 7000,
},
}, nil
}
... ...
... ... @@ -6,17 +6,18 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
// UndertakerFeedbackService 承接反馈服务
// UndertakerFeedbackService 承接反馈服务 【完成】
type UndertakerFeedbackService struct {
}
// CreateCooperationProject TODO:承接反馈列表
// SearchFeedback 承接反馈列表
func (srv UndertakerFeedbackService) SearchFeedback(cmd *command.SearchFeedbackCommand) (interface{}, error) {
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
resultMenu, err := gateway.ContractUndertakerFeedbackSearch(allied_creation_cooperation.ReqContractUndertakerFeedbackSearch{
PageNumber: cmd.PageNumber,
PageSize: cmd.PageSize,
MatchWord: cmd.MatchWord,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
... ... @@ -24,7 +25,7 @@ func (srv UndertakerFeedbackService) SearchFeedback(cmd *command.SearchFeedbackC
return resultMenu, nil
}
// CreateCooperationProject TODO:创建承接反馈
// CreateFeedback 创建承接反馈
func (srv UndertakerFeedbackService) CreateFeedback(cmd *command.CreateFeedbackCommand) (interface{}, error) {
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
... ...
package dto
import (
"math/rand"
"time"
)
type MessageDto struct {
MsgId int `json:"msgId"`
MsgContent string `json:"msgContent"`
MsgTime int64 `json:"msgTime"`
MsgType int `json:"msgType"`
MsgIcon string `json:"msgIcon"`
Read int `json:"read"`
DynamicId int `json:"dynamicId"`
}
func NewMessageDto() *MessageDto {
return &MessageDto{
MsgId: rand.Intn(10000),
MsgContent: "消息",
MsgTime: time.Now().Unix() * 1000,
MsgType: 1,
Read: 1,
}
}
... ...
package query
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
)
//获取自定义菜单列表
type MessagesListQuery struct {
//操作人
//操作人
Operator domain.Operator `json:"-"`
PageNumber int `json:"pageNumber"`
PageSize int `json:"pageSize"`
}
func (departmentsUsersQuery *MessagesListQuery) Valid(validation *validation.Validation) {
}
func (departmentsUsersQuery *MessagesListQuery) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(departmentsUsersQuery)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
... ... @@ -164,3 +164,12 @@ func (srv UserService) DepartmentsUsers(departmentsUsersQuery *query.Departments
}
return departmentUsersDto, nil
}
//MessagesList 消息列表
func (srv UserService) MessagesList(messagesListQuery *query.MessagesListQuery) (int64, interface{}, error) {
var results []*dto.MessageDto
for i := 0; i < 5; i++ {
results = append(results, dto.NewMessageDto())
}
return 2, results, nil
}
... ...
... ... @@ -102,8 +102,8 @@ func (usersService *UsersService) CompanyUserGet(companyUserGetQuery *query.Comp
func (usersService *UsersService) CompanyUserAdd(companyUserAddCommand *command.CompanyUserAddCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
companyUserAddCommand.Operator)
departmentId, _ := strconv.Atoi(companyUserAddCommand.OrgId)
orgId, _ := strconv.Atoi(companyUserAddCommand.OrgId)
departmentId, _ := strconv.Atoi(companyUserAddCommand.DepartmentId)
userOrg := []int64{}
userRole := []int64{}
initPassword, _, err := usersService.GetInitPassword(companyUserAddCommand.Operator)
... ...
... ... @@ -105,7 +105,7 @@ func (gateway HttplibAlliedCreationCooperation) CooperationApplicationsApproval(
// CooperationApplicationCancel 取消共创申请
func (gateway HttplibAlliedCreationCooperation) CooperationApplicationCancel(param ReqCooperationApplicationCancel) (*DataCooperationApplicationCancel, error) {
url := gateway.baseUrL + "/cooperation-applications/" + strconv.Itoa(param.ApplicationId) + "/cancel-application"
url := gateway.baseUrL + "/cooperation-applications/cancel-application"
method := "POST"
req := gateway.CreateRequest(url, method)
log.Logger.Debug("向业务模块请求数据:取消共创申请。", map[string]interface{}{
... ...
... ... @@ -41,6 +41,8 @@ type (
PageSize int64 `json:"pageSize"`
UndertakerName string `json:"undertakerName"`
CooperationContractName string `json:"cooperationContractName"`
// 查询关键词
MatchWord string `cname:"查询关键词" json:"matchWord,omitempty"`
}
DataContractUndertakerFeedbackSearch struct {
... ...
... ... @@ -103,7 +103,9 @@ type (
//取消共创申请
type (
ReqCooperationApplicationCancel struct {
ApplicationId int `json:"applicationId"`
ApplicationId int `json:"cooperationApplicationId,string"`
// 菜单编码,APP端必须
Code string `cname:"菜单编码" json:"code" valid:"Required"`
}
DataCooperationApplicationCancel struct {
... ...
... ... @@ -42,10 +42,10 @@ type CreditAccount struct {
//支付账期结算
type (
ReqCreditAccountsPay struct {
CreditAccountId int `json:"creditAccountId"`
CreditAccountId int `json:"creditAccountId,string"`
ActuallyPaidAmount float64 `json:"actuallyPaidAmount"` //实际支付金额
Remarks string `json:"remarks"`
Attachment domain.Attachment `json:"attachment"` //附件
Attachment domain.Attachment `json:"paymentDocumentAttachment"` //附件
}
DataCreditAccountsPay struct {
... ... @@ -99,7 +99,7 @@ type (
//返回账期结算单详情
type (
ReqCreditAccountGet struct {
CreditAccountId int `json:"creditAccountId"`
CreditAccountId int `json:"creditAccountId,string"`
}
DataCreditAccountGet struct {
... ...
... ... @@ -33,7 +33,7 @@ func init() {
}
filters.SecureKeyMap["token"] = "x-mmm-accesstoken"
//TODO:token验证改为 /v1
web.InsertFilterChain("/v1/app/*", middleware.CheckAccessToken)
web.InsertFilterChain("/v1/app11/*", middleware.CheckAccessToken)
web.InsertFilter("/*", web.BeforeRouter, filters.AllowCors())
web.InsertFilter("/*", web.BeforeRouter, filters.CreateRequstLogFilter(log.Logger))
web.InsertFilter("/*", web.AfterExec, filters.CreateResponseLogFilter(log.Logger), web.WithReturnOnOutput(false))
... ...
... ... @@ -12,7 +12,7 @@ type CooperationController struct {
}
/***** CooperationApplicationsService 共创申请服务 *****/
//SearchFeedback 承接人反馈
//SearchFeedback 承接人反馈CreditAccountSearch
func (controller *CooperationController) SearchFeedback() {
svr := service.UndertakerFeedbackService{}
cmd := &command.SearchFeedbackCommand{}
... ... @@ -236,8 +236,8 @@ func (controller *CooperationController) CreditAccountSearch() {
log.Logger.Error(err.Error())
}
cmd.Operator = controller.GetOperator()
data, err := svr.CreditAccountSearch(cmd)
controller.Response(data, err)
total, data, err := svr.CreditAccountSearch(cmd)
controller.ReturnPageListData(total, data, err, int(cmd.PageNumber))
}
func (controller *CooperationController) CreditAccountGet() {
... ... @@ -277,7 +277,7 @@ func (controller *CooperationController) CreditAccountPaySearch() {
controller.Response(data, err)
}
func (controller *CooperationController) DeleteAccountPaySearch() {
func (controller *CooperationController) DeleteCreditAccountPay() {
svr := service.CompanyCreditAccountService{}
cmd := &command.CreditAccountGetCommand{}
err := controller.Unmarshal(cmd)
... ...
... ... @@ -98,3 +98,16 @@ func (controller *UserController) DepartmentUsers() {
data, err := orgService.DepartmentsUsers(departmentsUsersQuery)
controller.Response(data, err)
}
func (controller *UserController) Messages() {
svr := service.UserService{}
messagesListQuery := &query.MessagesListQuery{}
err := controller.Unmarshal(messagesListQuery)
if err != nil {
controller.Response(nil, err)
return
}
messagesListQuery.Operator = controller.GetOperator()
total, data, err := svr.MessagesList(messagesListQuery)
controller.ReturnPageListData(total, data, err, messagesListQuery.PageNumber)
}
... ...
... ... @@ -39,7 +39,8 @@ func init() {
/***** CompanyDividends 账期结算 *****/
web.Router("/v1/app/company/credit-accounts/search", &mobile_client.CooperationController{}, "Post:CreditAccountSearch")
web.Router("/v1/app/company/credit-accounts/:creditId", &mobile_client.CooperationController{}, "Get:CreditAccountGet")
web.Router("/v1/app/company/credit-accounts/:creditAccountId", &mobile_client.CooperationController{}, "Get:CreditAccountGet")
web.Router("/v1/app/company/credit-accounts/:creditAccountId", &mobile_client.CooperationController{}, "Delete:DeleteCreditAccountPay")
web.Router("/v1/app/company/credit-accounts/pay", &mobile_client.CooperationController{}, "Post:CreditAccountPay")
web.Router("/v1/app/company/credit-accounts/pay/search", &mobile_client.CooperationController{}, "Post:CreditAccountPaySearch")
web.Router("/v1/app/company/credit-accounts/payment-history/statistics", &mobile_client.CooperationController{}, "Post:PaymentHistoryStatistics")
... ...
... ... @@ -18,6 +18,8 @@ func init() {
web.Router("/v1/user/personal", &mobile_client.UserController{}, "Post:UpdateUserInfo")
web.Router("/v1/user/destroy-account", &mobile_client.UserController{}, "Post:DestroyAccount")
web.Router("/v1/user/department-users", &mobile_client.UserController{}, "Post:DepartmentUsers")
web.Router("/v1/user/msgs", &mobile_client.UserController{}, "Post:Messages")
web.Router("/v1/user/msgs/mark-read", &mobile_client.UserController{}, "Post:Messages")
// 特殊处理
web.Router("/v1/app/orgs/department-users", &mobile_client.UserController{}, "Post:DepartmentUsers")
... ...