作者 tangxuhui

更新

... ... @@ -448,7 +448,7 @@ func (srv AuthService) CompanySignUp(companySignUpCommand *command.CompanySignUp
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
//}
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{})
result, err := creationUserGateway.AuthCompanySignUp(allied_creation_user.ReqAuthCompanySignUp{
_, err := creationUserGateway.AuthCompanySignUp(allied_creation_user.ReqAuthCompanySignUp{
CompanyName: companySignUpCommand.CompanyName,
Phone: companySignUpCommand.Phone,
Password: companySignUpCommand.Password,
... ... @@ -459,7 +459,7 @@ func (srv AuthService) CompanySignUp(companySignUpCommand *command.CompanySignUp
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return result, err
return companySignUpCommand, err
}
// ResetPassword 重置密码(找回密码)
... ...
package command
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
)
type AuditAllCooperationApplicationCommand struct {
//操作人
Operator domain.Operator `json:"-"`
// 审核动作,1同意,2拒绝
CooperationApplicationStatus int `json:"cooperationApplicationStatus" valid:"Required"`
// 共创申请审核描述
CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription" valid:"Required"`
}
func (listCooperationApplicationQuery *AuditAllCooperationApplicationCommand) Valid(validation *validation.Validation) {
}
func (listCooperationApplicationQuery *AuditAllCooperationApplicationCommand) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(listCooperationApplicationQuery)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
... ... @@ -156,3 +156,18 @@ func (srv CooperationApplicationsService) PersonSearchCooperationApplications(ap
// }
return resultApplications, nil
}
// CooperationApplicationsOneclickApproval 企业一键审核申请
func (srv CooperationApplicationsService) CooperationApplicationsOneclickApproval(auditCommand *command.AuditAllCooperationApplicationCommand) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
auditCommand.Operator)
_, err := creationCooperationGateway.CooperationApplicationsOneclickApproval(
allied_creation_cooperation.ReqCooperationApplicationOneclickApproval{
CooperationApplicationDescription: auditCommand.CooperationApplicationVerifyDescription,
Action: auditCommand.CooperationApplicationStatus,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return auditCommand, nil
}
... ...
... ... @@ -139,7 +139,7 @@ func (cooperationModeService *CooperationModeService) EnableCooperationMode(upda
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return nil, nil
return updateCooperationModeCommand, nil
}
func NewCooperationModeService(options map[string]interface{}) *CooperationModeService {
... ...
... ... @@ -12,18 +12,12 @@ type CreateDividendsOrderCommand struct {
Operator domain.Operator `json:"-"`
//客户名称
CustomerName string `json:"customerName" valid:"Required"`
//分红订单金额
DividendsOrderAmount float64 `json:"dividendsOrderAmount" valid:"Required"`
//分红订单号
DividendsOrderNumber string `json:"dividendsOrderNumber" valid:"Required"`
//分红订单原单号
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum" valid:"Required"`
//订单产生时间 时间戳 秒
OrderTime int64 `json:"orderTime" valid:"Required"`
//备注
Remarks string `json:"remarks" valid:"Required"`
//订单业务员uid
SalesmanUid string `json:"salesmanUid"`
//订单操作人uid
OperatorUid string `json:"operatorUid"`
//区域名称
... ...
... ... @@ -36,13 +36,10 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD
result, err := creationCooperationGateway.DividendsOrderAdd(allied_creation_cooperation.ReqDividendsOrderAdd{
CompanyId: int(createDividendsOrderCommand.Operator.CompanyId),
CustomerName: createDividendsOrderCommand.CustomerName,
DividendsOrderAmount: createDividendsOrderCommand.DividendsOrderAmount,
DividendsOrderNumber: createDividendsOrderCommand.DividendsOrderNumber,
DividendsOriginalOrderNum: createDividendsOrderCommand.DividendsOriginalOrderNum,
OperatorUid: int(createDividendsOrderCommand.Operator.UserId),
OrderTime: t,
Remarks: createDividendsOrderCommand.Remarks,
SalesmanUid: createDividendsOrderCommand.SalesmanUid,
RegionName: createDividendsOrderCommand.RegionName,
OrderGoods: orderGoods,
})
... ...
... ... @@ -64,14 +64,11 @@ type (
ReqDividendsOrderAdd struct {
CompanyId int `json:"companyId"`
CustomerName string `json:"customerName"` //客户名称
DividendsOrderAmount float64 `json:"dividendsOrderAmount"` //分红订单金额
DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红订单号
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号
OperatorUid int `json:"operatorUid"` //订单操作人id
OrderGoods []DividendsOrderGoods `json:"orderGoods"` //订单产品列表
OrderTime time.Time `json:"orderTime"` //订单产生时间
Remarks string `json:"remarks"` //备注
SalesmanUid string `json:"salesmanUid"` //订单业务员uid
UserId int `json:"userId"` //
RegionName string `json:"regionName"` //区域名称
}
... ...
... ... @@ -66,6 +66,20 @@ func (controller *CooperationController) AuditCooperationApplication() {
controller.Response(data, err)
}
//AuditAllCooperationApplication 公司一键审核申请
func (controller *CooperationController) AuditAllCooperationApplication() {
svr := service.CooperationApplicationsService{}
cmd := &command.AuditAllCooperationApplicationCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
controller.Response(nil, err)
return
}
cmd.Operator = controller.GetOperator()
data, err := svr.CooperationApplicationsOneclickApproval(cmd)
controller.Response(data, err)
}
func (controller *CooperationController) SearchCooperationApplication() {
svr := service.CooperationApplicationsService{}
cmd := &command.ListCooperationApplicationQuery{}
... ...
... ... @@ -13,6 +13,7 @@ func init() {
/***** 共创申请服务 企业端 *****/
web.Router("/v1/app/cooperation-applications/:applicationId", &mobile_client.CooperationController{}, "Get:GetCooperationApplication")
web.Router("/v1/app/cooperation-applications/audit", &mobile_client.CooperationController{}, "Put:AuditCooperationApplication")
web.Router("/v1/app/cooperation-applications/oneclick-approval", &mobile_client.CooperationController{}, "Post:AuditAllCooperationApplication")
web.Router("/v1/app/cooperation-applications/search", &mobile_client.CooperationController{}, "Post:SearchCooperationApplication")
/***** 共创申请服务 共创用户端 *****/
... ...