作者 yangfu
... ... @@ -14,10 +14,10 @@ type CooperationApplicationItem struct {
CooperationProjectNumber string `json:"cooperationProjectNumber"` //共创编号
} `json:"cooperationProject"`
CooperationApplicationApplicant struct {
UserName string `json:"userName"` //申请人名字
UserCode string `json:"userCode"`
UserName string `json:"usersName"` //申请人名字
UserCode string `json:"usersCode"`
DepartmentName string `json:"departmentName"` //申请人部门
Phone string `json:"userPhone"` //申请人电话
Phone string `json:"Phone"` //申请人电话
} `json:"cooperationApplicationApplicant"`
CooperationApplicationAttachment []domain.Attachment `json:"cooperationApplicationAttachment"` //附件
CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //描述
... ... @@ -26,7 +26,6 @@ type CooperationApplicationItem struct {
CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"` //审核描述
CooperationApplicationVerifyTime time.Time `json:"cooperationApplicationVerifyTime"` //审核时间
CooperationApplicationStatus int `json:"cooperationApplicationStatus"` //
Org struct {
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
... ...
... ... @@ -18,8 +18,8 @@ type ListCooperationApplicationQuery struct {
ProjectName string `json:"projectName"`
//申请人名称
ApplicantName string `json:"applicantName"`
//审核状态
VerifyStatus int `json:"verifyStatus"`
//只显示待审核
WaitAuditOnly bool `json:"waitAuditOnly"`
}
func (listCooperationApplicationQuery *ListCooperationApplicationQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -60,10 +60,15 @@ func (cooperationApplicationService *CooperationApplicationService) ListCooperat
if err := listCooperationApplicationQuery.ValidateQuery(); err != nil {
return 0, nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
cooperationApplicationStatus := 0
if listCooperationApplicationQuery.WaitAuditOnly {
cooperationApplicationStatus = 1
}
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(listCooperationApplicationQuery.Operator)
result, err := creationCooperationGateway.CooperationApplicationsSearch(allied_creation_cooperation.ReqCooperationApplicationSearch{
ApplicantName: listCooperationApplicationQuery.ApplicantName,
CooperationApplicationStatus: listCooperationApplicationQuery.VerifyStatus,
CooperationApplicationStatus: cooperationApplicationStatus,
CooperationProjectName: listCooperationApplicationQuery.ProjectName,
PageNumber: listCooperationApplicationQuery.PageNumber,
PageSize: listCooperationApplicationQuery.PageSize,
... ...
... ... @@ -25,7 +25,7 @@ type CreateCooperationContractCommand struct {
// 共创模式编码,
CooperationModeNumber string `json:"cooperationModeNumber"`
// 共创合约发起人uid
SponsorUid string `json:"sponsorUserId"`
SponsorUid string `json:"sponsorUid"`
} `json:"cooperationContract"`
// 业绩分红激励规则列表
DividendsIncentivesRules []struct {
... ...
... ... @@ -14,6 +14,8 @@ type ListCooperationContractQuery struct {
PageNumber int `json:"pageNumber"`
// 查询限制
PageSize int `json:"pageSize" valid:"Required"`
CooperationContractNumber string `json:"cooperationContractNumber"`
SponsorName string `json:"sponsorName"`
}
func (listCooperationContractQuery *ListCooperationContractQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -114,6 +114,8 @@ func (cooperationContractService *CooperationContractService) ListCooperationCon
result, err := creationCooperationGateway.CooperationContractSearch(allied_creation_cooperation.ReqCooperationContractSearch{
PageNumber: listCooperationContractQuery.PageNumber,
PageSize: listCooperationContractQuery.PageSize,
SponsorName: listCooperationContractQuery.SponsorName,
CooperationContractNumber: listCooperationContractQuery.CooperationContractNumber,
})
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ...
... ... @@ -15,7 +15,7 @@ type DividendsOrder struct {
DividendTime int64 `json:"dividendTime"` //分红订单分红时间
DividendsOrderAmount float64 `json:"dividendsOrderAmount"` //分红订单金额
DividendsOrderID int `json:"dividendsOrderId"` //分红订单
DividendsOrderNumber int `json:"dividendsOrderNumber"` //分红订单号
DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红订单号
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号
OrderSalesman struct { //订单业务员
Department struct {
... ...
package query
import "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
type SelectorDividendsOrderQuery struct {
Operator domain.Operator `json:"-"`
DividendsOrderNumber string `json:"DividendsOrderNumber"`
}
... ...
... ... @@ -84,6 +84,31 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) UpdateDivide
return updateDividendsReturnedOrderCommand, nil
}
// 更新分红退货单服务
func (dividendsReturnedOrderService *DividendsReturnedOrderService) SelectorDividendsOrder(selectorDividendsOrderQuery *query.SelectorDividendsOrderQuery) (
int, interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(selectorDividendsOrderQuery.Operator)
result, err := creationCooperationGateway.DividendsOrderSearch(allied_creation_cooperation.ReqDividendsOrderSearch{
DividendsOrderNumber: selectorDividendsOrderQuery.DividendsOrderNumber,
PageNumber: 1,
PageSize: 999,
})
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
listData := []map[string]interface{}{}
for _, v := range result.Gride.List {
m := map[string]interface{}{
"dividendsOrderNumber": v.DividendsOrderNumber,
"dividendsOriginalOrderNum": v.DividendsOriginalOrderNum,
"dividendsOrderId": strconv.Itoa(v.DividendsOrderID),
"dividendTime": v.DividendTime.Unix(),
}
listData = append(listData, m)
}
return result.Gride.Total, listData, nil
}
func NewDividendsReturnedOrderService(options map[string]interface{}) *DividendsReturnedOrderService {
newDividendsReturnedOrderService := &DividendsReturnedOrderService{}
return newDividendsReturnedOrderService
... ...
... ... @@ -161,10 +161,10 @@ type (
MoneyIncentivesRules []MoneyIncentivesRule `json:"moneyIncentivesRules"` // 金额激励规则列表
Undertakers []Undertaker `json:"undertakers"` // 承接方列表
RelevantIds []string `json:"relevantIds"` //关联业务员
CompanyId int `json:"companyId,string"`
OrgId int `json:"orgId,string"` // 组织机构ID
UserId int ` json:"userId,string"` // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserBaseId int `json:"userBaseId,string" ` // 用户基础数据id
CompanyId int `json:"-"`
OrgId int `json:"-"` // 组织机构ID
UserId int `json:"-"` // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserBaseId int `json:"-" ` // 用户基础数据id
}
DataCooperationContractAdd struct {
... ...
... ... @@ -15,7 +15,7 @@ type DividendsOrder struct {
DividendTime time.Time `json:"dividendTime"` //分红订单分红时间
DividendsOrderAmount float64 `json:"dividendsOrderAmount"` //分红订单金额
DividendsOrderID int `json:"dividendsOrderId"` //分红订单
DividendsOrderNumber int `json:"dividendsOrderNumber"` //分红订单号
DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红订单号
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号
OrderSalesman struct { //订单业务员
Department struct {
... ...
... ... @@ -88,10 +88,10 @@ func (controller *BaseController) GetOperator() domain.Operator {
}
// TODO:测试数据后期删除
if op.UserId == 0 {
op.UserId = 9
op.UserId = 23
op.CompanyId = 23
op.OrgId = 45
op.UserBaseId = 5
op.UserBaseId = 23
}
// TODO:打印测试日志
log.Logger.Debug("operator " + json.MarshalToString(op))
... ...
... ... @@ -70,3 +70,15 @@ func (controller *DividendsReturnedOrderController) SearchDividendsReturnedOrder
cnt, data, err := dividendsReturnedOrderService.SearchDividendsReturnedOrder(searchDividendsReturnedOrderQuery)
controller.ReturnPageListData(int64(cnt), data, err, searchDividendsReturnedOrderQuery.PageNumber)
}
func (controller *DividendsReturnedOrderController) SelectorDividendsOrder() {
dividendsReturnedOrderService := service.NewDividendsReturnedOrderService(nil)
selectorDividendsOrderQuery := &query.SelectorDividendsOrderQuery{}
err := controller.Unmarshal(selectorDividendsOrderQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
selectorDividendsOrderQuery.Operator = controller.GetOperator()
cnt, data, err := dividendsReturnedOrderService.SelectorDividendsOrder(selectorDividendsOrderQuery)
controller.ReturnPageListData(int64(cnt), data, err, 0)
}
... ...
package routers
import (
"github.com/beego/beego/v2/server/web"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/controllers/web_client"
)
func init() {
web.Router("/v1/web/dividends-order/", &web_client.DividendsOrderController{}, "Post:CreateDividendsOrder")
web.Router("/v1/web/dividends-order/:orderId", &web_client.DividendsOrderController{}, "Put:UpdateDividendsOrder")
web.Router("/v1/web/dividends-order/remove", &web_client.DividendsOrderController{}, "Post:RemoveDividendsOrder")
web.Router("/v1/web/dividends-order/:orderId", &web_client.DividendsOrderController{}, "Get:GetDividendsOrder")
web.Router("/v1/web/dividends-order/search", &web_client.DividendsOrderController{}, "Post:SearchDividendsOrder")
}
... ...
... ... @@ -11,4 +11,5 @@ func init() {
web.Router("/v1/web/dividends-returned-order/:projectId", &web_client.DividendsReturnedOrderController{}, "Delete:RemoveDividendsReturnedOrder")
web.Router("/v1/web/dividends-returned-order/:projectId", &web_client.DividendsReturnedOrderController{}, "Get:GetDividendsReturnedOrder")
web.Router("/v1/web/dividends-returned-order/search", &web_client.DividendsReturnedOrderController{}, "Post:SearchDividendsReturnedOrder")
web.Router("/v1/web/dividends-returned-order/selector/dividends-order", &web_client.DividendsReturnedOrderController{}, "Post:SelectorDividendsOrder")
}
... ...