作者 yangfu
{"D:\\workspaceGo\\src\\allied-creation-gateway\\pkg\\port\\beego\\routers":1628844413608624400}
\ No newline at end of file
... ... @@ -15,7 +15,7 @@ type UpdateCooperationProjectCommand struct {
// 模式编码,唯一确定
CooperationModeNumber string `json:"cooperationModeNumber" valid:"Required"`
// 组织ID
OrgId int64 `json:"departmentId" valid:"Required"`
OrgId int `json:"departmentId" valid:"Required"`
// 共创项目名称
CooperationProjectName string `json:"cooperationProjectName" valid:"Required"`
// 共创发起人id
... ...
... ... @@ -80,7 +80,7 @@ func (srv CooperationProjectService) UpdateCooperationProject(updateCooperationP
PublisherUid: strconv.Itoa(int(updateCooperationProjectCommand.Operator.UserId)),
CooperationProjectDescription: updateCooperationProjectCommand.CooperationProjectDescription,
Attachment: updateCooperationProjectCommand.Attachment,
OrgId: updateCooperationProjectCommand.OrgId,
DepartmentId: updateCooperationProjectCommand.OrgId,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ...
... ... @@ -10,10 +10,10 @@ import (
type CreateCooperationContractCommand struct {
//操作人
Operator domain.Operator `json:"-"`
//合约
CooperationContract struct {
// 共创合约描述
CooperationContractDescription string `json:"cooperationContractDescription"`
// 共创合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 共创项目编号,
CooperationProjectNumber string `json:"cooperationProjectNumber"`
// 共创合约发起部门id
... ... @@ -25,7 +25,8 @@ type CreateCooperationContractCommand struct {
// 共创模式编码,
CooperationModeNumber string `json:"cooperationModeNumber"`
// 共创合约发起人uid
SponsorUid string `json:"sponsorUid"`
SponsorUid string `json:"sponsorUserId"`
} `json:"cooperationContract"`
// 业绩分红激励规则列表
DividendsIncentivesRules []struct {
// 关联的项目合约编号
... ... @@ -37,7 +38,7 @@ type CreateCooperationContractCommand struct {
// 分红规则激励百分点
DividendsIncentivesPercentage float64 `json:"dividendsIncentivesPercentage"`
// 分红规则激励阶段,
DividendsIncentivesStage int64 `json:"dividendsIncentivesStage,string"`
DividendsIncentivesStage int64 `json:"dividendsIncentivesStage,string,"`
// 分红规则激励阶段结束
DividendsIncentivesStageEnd int `json:"dividendsIncentivesStageEnd"`
// 分红规则激励阶段开始
... ... @@ -46,7 +47,7 @@ type CreateCooperationContractCommand struct {
// 金额激励规则列表
MoneyIncentivesRules []struct {
// 金额激励规则ID
MoneyIncentivesRuleId int64 `json:"moneyIncentivesRuleId,string"`
MoneyIncentivesRuleId int64 `json:"moneyIncentivesRuleId,string,"`
// 关联的共创合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 激励金额
... ...
... ... @@ -10,6 +10,7 @@ import (
type UpdateCooperationContractCommand struct {
//操作人
Operator domain.Operator `json:"-"`
CooperationContract struct {
CooperationContractId int `json:"cooperationContractId"`
// 共创合约描述
CooperationContractDescription string `json:"cooperationContractDescription"`
... ... @@ -27,6 +28,7 @@ type UpdateCooperationContractCommand struct {
CooperationModeNumber string `json:"cooperationModeNumber"`
// 共创合约发起人uid
SponsorUid string `json:"sponsorUid"`
} `json:"cooperationContract"`
// 业绩分红激励规则列表
DividendsIncentivesRules []struct {
// 关联的项目合约编号
... ... @@ -38,7 +40,7 @@ type UpdateCooperationContractCommand struct {
// 分红规则激励百分点
DividendsIncentivesPercentage float64 `json:"dividendsIncentivesPercentage"`
// 分红规则激励阶段,
DividendsIncentivesStage int64 `json:"dividendsIncentivesStage,string"`
DividendsIncentivesStage int64 `json:"dividendsIncentivesStage,string,"`
// 分红规则激励阶段结束
DividendsIncentivesStageEnd int `json:"dividendsIncentivesStageEnd"`
// 分红规则激励阶段开始
... ... @@ -47,7 +49,7 @@ type UpdateCooperationContractCommand struct {
// 金额激励规则列表
MoneyIncentivesRules []struct {
// 金额激励规则ID
MoneyIncentivesRuleId int64 `json:"moneyIncentivesRuleId,string"`
MoneyIncentivesRuleId int64 `json:"moneyIncentivesRuleId,string,"`
// 关联的共创合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 激励金额
... ...
... ... @@ -61,14 +61,17 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC
DividendsIncentivesRules: rules1,
Undertakers: underTakers,
RelevantIds: createCooperationContractCommand.RelevantIds,
CooperationContractDescription: createCooperationContractCommand.CooperationContractDescription,
CooperationContractNumber: createCooperationContractCommand.CooperationContractNumber,
CooperationProjectNumber: createCooperationContractCommand.CooperationProjectNumber,
DepartmentId: createCooperationContractCommand.DepartmentId,
CooperationContractUndertakerType: createCooperationContractCommand.CooperationContractUndertakerType,
CooperationContractName: createCooperationContractCommand.CooperationContractName,
CooperationModeNumber: createCooperationContractCommand.CooperationModeNumber,
SponsorUid: createCooperationContractCommand.SponsorUid,
CooperationContractDescription: createCooperationContractCommand.CooperationContract.CooperationContractDescription,
CooperationProjectNumber: createCooperationContractCommand.CooperationContract.CooperationProjectNumber,
DepartmentId: createCooperationContractCommand.CooperationContract.DepartmentId,
CooperationContractUndertakerType: createCooperationContractCommand.CooperationContract.CooperationContractUndertakerType,
CooperationContractName: createCooperationContractCommand.CooperationContract.CooperationContractName,
CooperationModeNumber: createCooperationContractCommand.CooperationContract.CooperationModeNumber,
SponsorUid: createCooperationContractCommand.CooperationContract.SponsorUid,
CompanyId: int(createCooperationContractCommand.Operator.CompanyId),
UserId: int(createCooperationContractCommand.Operator.UserId),
UserBaseId: int(createCooperationContractCommand.Operator.UserBaseId),
OrgId: int(createCooperationContractCommand.Operator.OrgId),
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ... @@ -167,19 +170,23 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC
underTakers = append(underTakers, u)
}
_, err := creationCooperationGateway.CooperationContractUpdate(allied_creation_cooperation.ReqCooperationContractUpdate{
CooperationContractId: updateCooperationContractCommand.CooperationContractId,
CooperationContractId: updateCooperationContractCommand.CooperationContract.CooperationContractId,
MoneyIncentivesRules: rules2,
DividendsIncentivesRules: rules1,
Undertakers: underTakers,
RelevantIds: updateCooperationContractCommand.RelevantIds,
CooperationContractDescription: updateCooperationContractCommand.CooperationContractDescription,
CooperationContractNumber: updateCooperationContractCommand.CooperationContractNumber,
CooperationProjectNumber: updateCooperationContractCommand.CooperationProjectNumber,
DepartmentId: updateCooperationContractCommand.DepartmentId,
CooperationContractUndertakerType: updateCooperationContractCommand.CooperationContractUndertakerType,
CooperationContractName: updateCooperationContractCommand.CooperationContractName,
CooperationModeNumber: updateCooperationContractCommand.CooperationModeNumber,
SponsorUid: updateCooperationContractCommand.SponsorUid,
CooperationContractDescription: updateCooperationContractCommand.CooperationContract.CooperationContractDescription,
CooperationContractNumber: updateCooperationContractCommand.CooperationContract.CooperationContractNumber,
CooperationProjectNumber: updateCooperationContractCommand.CooperationContract.CooperationProjectNumber,
DepartmentId: updateCooperationContractCommand.CooperationContract.DepartmentId,
CooperationContractUndertakerType: updateCooperationContractCommand.CooperationContract.CooperationContractUndertakerType,
CooperationContractName: updateCooperationContractCommand.CooperationContract.CooperationContractName,
CooperationModeNumber: updateCooperationContractCommand.CooperationContract.CooperationModeNumber,
SponsorUid: updateCooperationContractCommand.CooperationContract.SponsorUid,
CompanyId: int(updateCooperationContractCommand.Operator.CompanyId),
UserId: int(updateCooperationContractCommand.Operator.UserId),
UserBaseId: int(updateCooperationContractCommand.Operator.UserBaseId),
OrgId: int(updateCooperationContractCommand.Operator.OrgId),
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ...
... ... @@ -12,14 +12,14 @@ type CreateCooperationProjectCommand struct {
Operator domain.Operator `json:"-"`
// 模式编码,唯一确定
CooperationModeNumber string `json:"cooperationModeNumber" valid:"Required"`
// 发起组织ID
OrgId int64 `json:"departmentId"`
// 发起部门ID
DepartmentId int64 `json:"departmentId,string"`
// 共创项目名称
CooperationProjectName string `json:"cooperationProjectName" valid:"Required"`
// 共创发起人id
CooperationProjectSponsor int `json:"cooperationProjectSponsor,string,"`
// 项目承接对象
CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerTypes"`
CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"`
// 共创项目描述
CooperationProjectDescription string `json:"cooperationProjectDescription" valid:"Required"`
//图片
... ...
... ... @@ -14,8 +14,8 @@ type UpdateCooperationProjectCommand struct {
CooperationProjectId string `json:"cooperationProjectId" valid:"Required"`
// 模式编码,唯一确定
CooperationModeNumber string `json:"cooperationModeNumber" valid:"Required"`
// 组织ID
OrgId int64 `json:"departmentId,string" valid:"Required"`
// 发起部门ID
DepartmentId int `json:"departmentId,string" valid:"Required"`
// 共创项目名称
CooperationProjectName string `json:"cooperationProjectName" valid:"Required"`
// 共创发起人id
... ...
... ... @@ -34,6 +34,7 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro
CooperationModeNumber: createCooperationProjectCommand.CooperationModeNumber,
PublisherUid: int(createCooperationProjectCommand.Operator.UserId),
SponsorUid: createCooperationProjectCommand.CooperationProjectSponsor,
DepartmentId: int(createCooperationProjectCommand.DepartmentId),
CooperationProjectUndertakerType: createCooperationProjectCommand.CooperationProjectUndertakerType,
Attachment: images,
})
... ... @@ -149,9 +150,7 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro
PublisherUid: strconv.Itoa(int(updateCooperationProjectCommand.Operator.UserId)),
CooperationProjectDescription: updateCooperationProjectCommand.CooperationProjectDescription,
Attachment: images,
UserId: updateCooperationProjectCommand.Operator.UserId,
UserBaseId: updateCooperationProjectCommand.Operator.UserBaseId,
OrgId: updateCooperationProjectCommand.OrgId,
DepartmentId: updateCooperationProjectCommand.DepartmentId,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ...
... ... @@ -15,10 +15,10 @@ var HTTP_PORT int = 8083
var ALLIED_CREATION_BASIC_HOST = "http://allied-creation-basic-dev.fjmaimaimai.com"
//天联共创用户模块
var ALLIED_CREATION_USER_HOST = "http://allied-creation-user-dev.fjmaimaimai.com"
var ALLIED_CREATION_USER_HOST = "http://localhost:8081" //"http://allied-creation-user-dev.fjmaimaimai.com"
//天联共创业务模块
var ALLIED_CREATION_COOPERATION_HOST = "http://allied-creation-cooperation-dev.fjmaimaimai.com"
var ALLIED_CREATION_COOPERATION_HOST = "http://localhost:8082" // "http://allied-creation-cooperation-dev.fjmaimaimai.com"
//通用模块短信服务
var SMS_SERVE_HOST = "https://sms.fjmaimaimai.com:9897"
... ...
... ... @@ -153,7 +153,7 @@ type (
CooperationContractNumber string `json:"cooperationContractNumber"` // 共创合约编号
CooperationProjectNumber string `json:"cooperationProjectNumber"` // 共创项目编号,
DepartmentId string `json:"departmentId"` // 共创合约发起部门id
CooperationContractUndertakerType []int `json:"cooperationContractUndertakerType"` // 共创合约承接对象,1员工,2共创用户,3公开
CooperationContractUndertakerType []int `json:"cooperationContractUndertakerTypes"` // 共创合约承接对象,1员工,2共创用户,3公开
CooperationContractName string `json:"cooperationContractName"` // 共创合约名称
CooperationModeNumber string `json:"cooperationModeNumber"` // 共创模式编码,
SponsorUid string `json:"sponsorUid"` // 共创合约发起人uid
... ... @@ -161,6 +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
}
DataCooperationContractAdd struct {
... ... @@ -182,10 +186,12 @@ type (
SponsorUid string `json:"sponsorUid,omitempty,"` // 共创合约发起人uid
DividendsIncentivesRules []DividendsIncentivesRule `json:"dividendsIncentivesRules"` // 金额激励规则列表
MoneyIncentivesRules []MoneyIncentivesRule `json:"moneyIncentivesRules"`
Undertakers []Undertaker `json:"undertakers"` // 承接方列表 // 业绩分红激励规则列表
//关联业务员
RelevantIds []string `json:"relevantIds"`
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
}
DataCooperationContractUpdate struct {
... ...
package allied_creation_cooperation
import (
"time"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/util/jtime"
"time"
)
type ProjectAttachment struct {
... ... @@ -116,12 +117,13 @@ type (
// 共创项目描述
CooperationProjectDescription string `json:"cooperationProjectDescription"`
Attachment []domain.Attachment `json:"attachment"`
DepartmentId int `json:"departmentId,string"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId,string" valid:"Required"`
// OrgId int64 `cname:"组织机构ID" json:"orgId,string" valid:"Required"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId,string" valid:"Required"`
//UserId int64 `cname:"用户ID" json:"userId,string" valid:"Required"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"`
//UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"`
}
DataCooperationProjectUpdate struct {
... ... @@ -268,7 +270,7 @@ type (
// 批量结束项目
type (
ReqCooperationProjectBatchEnd struct {
CooperationProjectIds []string `json:"cooperationProjectId"`
CooperationProjectIds []string `json:"cooperationProjectIds"`
}
DataCooperationProjectBatchEnd struct {
... ...
package web_client
import (
"github.com/linmadan/egglib-go/web/beego"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationContract/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationContract/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationContract/service"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
)
type CooperationContractController struct {
beego.BaseController
baseController
}
func (controller *CooperationContractController) CreateCooperationContract() {
cooperationContractService := service.NewCooperationContractService(nil)
createCooperationContractCommand := &command.CreateCooperationContractCommand{}
controller.Unmarshal(createCooperationContractCommand)
err := controller.Unmarshal(createCooperationContractCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
createCooperationContractCommand.Operator = controller.GetOperator()
data, err := cooperationContractService.CreateCooperationContract(createCooperationContractCommand)
controller.Response(data, err)
}
... ... @@ -22,9 +26,13 @@ func (controller *CooperationContractController) CreateCooperationContract() {
func (controller *CooperationContractController) UpdateCooperationContract() {
cooperationContractService := service.NewCooperationContractService(nil)
updateCooperationContractCommand := &command.UpdateCooperationContractCommand{}
controller.Unmarshal(updateCooperationContractCommand)
err := controller.Unmarshal(updateCooperationContractCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
contractId, _ := controller.GetInt(":contractId")
updateCooperationContractCommand.CooperationContractId = contractId
updateCooperationContractCommand.Operator = controller.GetOperator()
updateCooperationContractCommand.CooperationContract.CooperationContractId = contractId
data, err := cooperationContractService.UpdateCooperationContract(updateCooperationContractCommand)
controller.Response(data, err)
}
... ... @@ -33,6 +41,7 @@ func (controller *CooperationContractController) GetCooperationContract() {
cooperationContractService := service.NewCooperationContractService(nil)
getCooperationContractQuery := &query.GetCooperationContractQuery{}
contractId, _ := controller.GetInt(":contractId")
getCooperationContractQuery.Operator = controller.GetOperator()
getCooperationContractQuery.CooperationContractId = contractId
data, err := cooperationContractService.GetCooperationContract(getCooperationContractQuery)
controller.Response(data, err)
... ... @@ -41,14 +50,22 @@ func (controller *CooperationContractController) GetCooperationContract() {
func (controller *CooperationContractController) ListCooperationContract() {
cooperationContractService := service.NewCooperationContractService(nil)
listCooperationContractQuery := &query.ListCooperationContractQuery{}
_, data, err := cooperationContractService.ListCooperationContract(listCooperationContractQuery)
controller.Response(data, err)
err := controller.Unmarshal(listCooperationContractQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
listCooperationContractQuery.Operator = controller.GetOperator()
cnt, data, err := cooperationContractService.ListCooperationContract(listCooperationContractQuery)
controller.ReturnPageListData(int64(cnt), data, err, listCooperationContractQuery.PageNumber)
}
func (controller *CooperationContractController) EnableCooperationContract() {
cooperationContractService := service.NewCooperationContractService(nil)
enableCooperationContractCommand := &command.EnableCooperationContractCommand{}
controller.Unmarshal(enableCooperationContractCommand)
err := controller.Unmarshal(enableCooperationContractCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
data, err := cooperationContractService.EnableCooperationContract(enableCooperationContractCommand)
controller.Response(data, err)
}
... ...