作者 yangfu
... ... @@ -15,7 +15,8 @@ type CreateCooperationApplicationCommand struct {
// 申请人的id
//ApplicantUid int `json:"userId"`
//
CooperationProjectNumber string `json:"cooperationProjectNumber"`
CooperationProjectId int `json:"cooperationProjectId"`
// CooperationProjectNumber string `json:"cooperationProjectNumber"`
// 附件列表
Attachment []domain.Attachment `json:"attachment"`
}
... ...
... ... @@ -95,11 +95,10 @@ func (srv CooperationApplicationsService) SearchCooperationApplications(applicat
func (srv CooperationApplicationsService) CreateCooperationApplications(createApplicationsCommand *command.CreateCooperationApplicationCommand) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
createApplicationsCommand.Operator)
result, err := creationCooperationGateway.CooperationApplicationAdd(allied_creation_cooperation.ReqCooperationApplicationAdd{
ApplicantUid: strconv.Itoa(int(createApplicationsCommand.Operator.UserId)),
result, err := creationCooperationGateway.ApplyForCooperation(allied_creation_cooperation.ReqApplyForCooperation{
CooperationApplicationDescription: createApplicationsCommand.CooperationApplicationDescription,
CooperationProjectId: createApplicationsCommand.CooperationProjectId,
CooperationApplicationAttachment: createApplicationsCommand.Attachment,
CooperationProjectNumber: createApplicationsCommand.CooperationProjectNumber,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
... ...
... ... @@ -51,7 +51,7 @@ type DividendsEstimateMoneyItem struct {
DepartmentName string `json:"departmentName"`
} `json:"department"` //发起部门
CooperationContractSponsorName string `json:"cooperationContractSponsorName"`
StageAndUndertaker struct {
StageAndUndertaker []struct {
Stage int `json:"stage"` // 分红阶段
Undertakers []struct {
UndertakerId int `json:"undertakerId,string"` // 承接人id
... ... @@ -60,7 +60,7 @@ type DividendsEstimateMoneyItem struct {
UserPhone string `json:"userPhone"` // 用户手机号
} `json:"userInfo"`
} `json:"undertakers"` // 共创承接人
}
} `json:"stageAndUndertaker"`
}
func ToDividendsEstimateMoneyItem(param *allied_creation_cooperation.DataDividendsEstimateSearchMoney) []DividendsEstimateMoneyItem {
... ...
... ... @@ -412,3 +412,34 @@ func (gateway HttplibAlliedCreationCooperation) CooperationApplicationsOneclickA
err = gateway.GetResponseData(result, &data)
return &data, err
}
// ApplyForCooperation 申请共创项目
func (gateway HttplibAlliedCreationCooperation) ApplyForCooperation(param ReqApplyForCooperation) (*DataApplyForCooperation, error) {
url := gateway.baseUrL + "/cooperation-applications/" + strconv.Itoa(param.CooperationProjectId) + "/apply-for-cooperation"
method := "POST"
req := gateway.CreateRequest(url, method)
log.Logger.Debug("向业务模块请求数据:创建共创申请。", map[string]interface{}{
"api": method + ":" + url,
"param": param,
})
req, err := req.JSONBody(param)
if err != nil {
return nil, fmt.Errorf("请求创建共创申请失败:%w", err)
}
byteResult, err := req.Bytes()
if err != nil {
return nil, fmt.Errorf("获取创建共创申请失败:%w", err)
}
log.Logger.Debug("获取业务模块请求数据:创建共创申请。", map[string]interface{}{
"result": string(byteResult),
})
var result service_gateway.GatewayResponse
err = json.Unmarshal(byteResult, &result)
if err != nil {
return nil, fmt.Errorf("解析创建共创申请:%w", err)
}
var data DataApplyForCooperation
err = gateway.GetResponseData(result, &data)
return &data, err
}
... ...
... ... @@ -233,3 +233,20 @@ type (
DataCooperationApplicationOneclickApproval struct {
}
)
//申请共创项目
type (
ReqApplyForCooperation struct {
// 共创申请人uid
// ApplicantUid string `json:"-" `
// 共创申请描述
CooperationApplicationDescription string ` json:"cooperationApplicationDescription"`
// 共创申请描述附件
CooperationApplicationAttachment []domain.Attachment `json:"cooperationApplicationAttachment"`
// 关联的共创项目id
CooperationProjectId int `json:"cooperationProjectId"`
}
DataApplyForCooperation struct {
CooperationApplicationId int `json:"cooperationApplicationId,string"`
}
)
... ...
... ... @@ -17,7 +17,7 @@ type CooperationContract struct {
DepartmentId int `json:"departmentId,string"`
DepartmentName string `json:"departmentName"`
DepartmentNumber string `json:"departmentNumber"`
} `jsopn:"department" json:"department"` //发起部门
} `jsopn:"department"` //发起部门
CooperationContractSponsor struct {
UserId int `json:"userId,string"` //id
UserInfo struct {
... ...
... ... @@ -232,7 +232,8 @@ type (
} `json:"userInfo"`
} `json:"operator"`
//OperateTime time.Time `json:"operateTime"`
Status int `json:"status"`
Status int `json:"status"`
ApplicantCount int `json:"applicantCount"` // 共创申请人计数
}
DataCooperationProjectSearch struct {
List []DataCooperationProjectSearchItem `json:"list"`
... ...
... ... @@ -18,7 +18,7 @@ type (
OrderGoodId int `json:"orderGoodId,string"`
// 共创合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 分红订单号或退货单号
// 分红订单号或退货单号
OrderNumber string `json:"orderNumber"`
// 来源单号
OriginalOrderNum string `json:"originalOrderNum"`
... ... @@ -26,12 +26,13 @@ type (
CustomerName string `json:"customerName"`
// 订单区域
RegionName string `json:"region"`
//货品名称
// 货品名称
OrderGoodName string `json:"orderGoodName"`
// 订单金额
OrderAmount float64 `json:"orderAmount"`
// 订单/退货单日期
OrderDate time.Time `json:"orderDate"`
OrgId int `json:"orgId"`
} `json:"list"`
}
)
... ... @@ -121,7 +122,7 @@ type (
} `json:"department"` //发起部门
// 共创合约发起人
CooperationContractSponsorName string `json:"cooperationContractSponsor"`
StageAndUndertaker struct {
StageAndUndertaker []struct {
Stage int `json:"stage"` // 分红阶段
Undertakers []struct {
UndertakerId int `json:"undertakerId,string"` // 承接人id
... ...
... ... @@ -2,10 +2,9 @@ package allied_creation_cooperation
import "time"
//创建分红退货单
type (
DividendsReturnedOrderGoods struct {
OrderGoodId int64 `json:"orderGoodId,string"` // 订单产品id
OrderGoodId int64 `json:"orderGoodId,string"` //订单产品id
CooperationContractNumber string `json:"cooperationContractNumber"` //关联的共创合约编号
OrderGoodAmount float64 `json:"orderGoodAmount"` //订单产品金额
OrderGoodName string `json:"orderGoodName"` //订单产品名称
... ... @@ -57,6 +56,7 @@ type (
OrderGoodPrice float64 `json:"orderGoodPrice"` //订单产品单价
OrderGoodQuantity float64 `json:"orderGoodQuantity"` //订单产品数量
}
//创建分红退货单
ReqDividendsReturnedOrderAdd struct {
DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"`
DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红单号
... ...