作者 yangfu
正在显示 23 个修改的文件 包含 275 行增加165 行删除
... ... @@ -116,6 +116,7 @@ func (cooperationProjectService *CooperationProjectService) ListCooperationProje
DepartmentName: listCooperationProjectQuery.DepartmentName,
//项目名
CooperationProjectName: listCooperationProjectQuery.CooperationProjectName,
CompanyId: listCooperationProjectQuery.Operator.CompanyId,
})
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ...
package command
import (
"fmt"
"strconv"
"github.com/beego/beego/v2/core/validation"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
)
... ... @@ -12,13 +8,13 @@ type CreateDividendsOrderCommand struct {
//操作人
Operator domain.Operator `json:"-"`
//客户名称
CustomerName string `json:"customerName" valid:"Required"`
CustomerName string `json:"customerName"`
//分红订单原单号
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum" valid:"Required"`
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"`
//订单产生时间 时间戳 毫秒
OrderTime int64 `json:"orderTime" valid:"Required"`
OrderTime int64 `json:"orderTime"`
//备注
Remarks string `json:"remarks" valid:"Required"`
Remarks string `json:"remarks"`
//订单操作人uid
OperatorUid string `json:"operatorUid"`
//区域名称
... ... @@ -35,25 +31,25 @@ type CreateDividendsOrderCommand struct {
} `json:"orderGoods"`
}
func (createDividendsOrderCommand *CreateDividendsOrderCommand) Valid(validation *validation.Validation) {
// 162 92522 89000
orderTimeStr := strconv.Itoa(int(createDividendsOrderCommand.OrderTime))
orderTimeStrRune := []rune(orderTimeStr)
if len(orderTimeStrRune) != 13 {
validation.AddError("订单产生时间", "格式错误")
}
}
// func (createDividendsOrderCommand *CreateDividendsOrderCommand) Valid(validation *validation.Validation) {
// // 162 92522 89000
// orderTimeStr := strconv.Itoa(int(createDividendsOrderCommand.OrderTime))
// orderTimeStrRune := []rune(orderTimeStr)
// if len(orderTimeStrRune) != 13 {
// validation.AddError("订单产生时间", "格式错误")
// }
// }
func (createDividendsOrderCommand *CreateDividendsOrderCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(createDividendsOrderCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
// func (createDividendsOrderCommand *CreateDividendsOrderCommand) ValidateCommand() error {
// valid := validation.Validation{}
// b, err := valid.Valid(createDividendsOrderCommand)
// if err != nil {
// return err
// }
// if !b {
// for _, validErr := range valid.Errors {
// return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
// }
// }
// return nil
// }
... ...
package command
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
)
... ... @@ -11,23 +8,23 @@ type RemoveDividendsOrderCommand struct {
//操作人
Operator domain.Operator `json:"-"`
// 分红订单ID
DividendsOrderId []string `json:"dividendsOrderId" valid:"Required"`
DividendsOrderId []string `json:"dividendsOrderId"`
}
func (removeDividendsOrderCommand *RemoveDividendsOrderCommand) Valid(validation *validation.Validation) {
// func (removeDividendsOrderCommand *RemoveDividendsOrderCommand) Valid(validation *validation.Validation) {
}
// }
func (removeDividendsOrderCommand *RemoveDividendsOrderCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(removeDividendsOrderCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
// func (removeDividendsOrderCommand *RemoveDividendsOrderCommand) ValidateCommand() error {
// valid := validation.Validation{}
// b, err := valid.Valid(removeDividendsOrderCommand)
// if err != nil {
// return err
// }
// if !b {
// for _, validErr := range valid.Errors {
// return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
// }
// }
// return nil
// }
... ...
package command
import (
"fmt"
"strconv"
"github.com/beego/beego/v2/core/validation"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
)
... ... @@ -14,15 +10,15 @@ type UpdateDividendsOrderCommand struct {
//分红订单
DividendsOrderID int `json:"dividendsOrderId"`
//客户名称
CustomerName string `json:"customerName" valid:"Required"`
CustomerName string `json:"customerName"`
//分红订单金额
DividendsOrderAmount float64 `json:"dividendsOrderAmount" valid:"Required"`
DividendsOrderAmount float64 `json:"dividendsOrderAmount"`
//分红订单原单号
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum" valid:"Required"`
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"`
//订单产生时间 时间戳 毫秒
OrderTime int64 `json:"orderTime" valid:"Required"`
OrderTime int64 `json:"orderTime" `
//备注
Remarks string `json:"remarks" valid:"Required"`
Remarks string `json:"remarks"`
//区域名称
RegionName string `json:"regionName"`
//订单产品列表
... ... @@ -37,25 +33,25 @@ type UpdateDividendsOrderCommand struct {
} `json:"orderGoods"`
}
func (updateDividendsOrderCommand *UpdateDividendsOrderCommand) Valid(validation *validation.Validation) {
// 162 92522 89000
orderTimeStr := strconv.Itoa(int(updateDividendsOrderCommand.OrderTime))
orderTimeStrRune := []rune(orderTimeStr)
if len(orderTimeStrRune) != 13 {
validation.AddError("订单产生时间", "格式错误")
}
}
// func (updateDividendsOrderCommand *UpdateDividendsOrderCommand) Valid(validation *validation.Validation) {
// // 162 92522 89000
// orderTimeStr := strconv.Itoa(int(updateDividendsOrderCommand.OrderTime))
// orderTimeStrRune := []rune(orderTimeStr)
// if len(orderTimeStrRune) != 13 {
// validation.AddError("订单产生时间", "格式错误")
// }
// }
func (updateDividendsOrderCommand *UpdateDividendsOrderCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(updateDividendsOrderCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
// func (updateDividendsOrderCommand *UpdateDividendsOrderCommand) ValidateCommand() error {
// valid := validation.Validation{}
// b, err := valid.Valid(updateDividendsOrderCommand)
// if err != nil {
// return err
// }
// if !b {
// for _, validErr := range valid.Errors {
// return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
// }
// }
// return nil
// }
... ...
package query
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
)
... ... @@ -14,20 +11,20 @@ type GetDividendsOrderQuery struct {
DividendsOrderId int `json:"dividendsOrderId,string" valid:"Required"`
}
func (getDividendsOrderQuery *GetDividendsOrderQuery) Valid(validation *validation.Validation) {
// func (getDividendsOrderQuery *GetDividendsOrderQuery) Valid(validation *validation.Validation) {
}
// }
func (getDividendsOrderQuery *GetDividendsOrderQuery) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(getDividendsOrderQuery)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
// func (getDividendsOrderQuery *GetDividendsOrderQuery) ValidateQuery() error {
// valid := validation.Validation{}
// b, err := valid.Valid(getDividendsOrderQuery)
// if err != nil {
// return err
// }
// if !b {
// for _, validErr := range valid.Errors {
// return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
// }
// }
// return nil
// }
... ...
package query
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
)
type ListDividendsOrdersQuery struct {
// 页码
PageNumber int `json:"pageNumber"`
... ... @@ -13,20 +7,20 @@ type ListDividendsOrdersQuery struct {
PageSize int `json:"pageSize"`
}
func (listDividendsOrdersQuery *ListDividendsOrdersQuery) Valid(validation *validation.Validation) {
// func (listDividendsOrdersQuery *ListDividendsOrdersQuery) Valid(validation *validation.Validation) {
}
// }
func (listDividendsOrdersQuery *ListDividendsOrdersQuery) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(listDividendsOrdersQuery)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
// func (listDividendsOrdersQuery *ListDividendsOrdersQuery) ValidateQuery() error {
// valid := validation.Validation{}
// b, err := valid.Valid(listDividendsOrdersQuery)
// if err != nil {
// return err
// }
// if !b {
// for _, validErr := range valid.Errors {
// return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
// }
// }
// return nil
// }
... ...
package query
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
)
... ... @@ -20,20 +17,20 @@ type SearchDividendsOrderQuery struct {
PageSize int `json:"pageSize"`
}
func (searchDividendsOrderQuery *SearchDividendsOrderQuery) Valid(validation *validation.Validation) {
// func (searchDividendsOrderQuery *SearchDividendsOrderQuery) Valid(validation *validation.Validation) {
}
// }
func (searchDividendsOrderQuery *SearchDividendsOrderQuery) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(searchDividendsOrderQuery)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
// func (searchDividendsOrderQuery *SearchDividendsOrderQuery) ValidateQuery() error {
// valid := validation.Validation{}
// b, err := valid.Valid(searchDividendsOrderQuery)
// if err != nil {
// return err
// }
// if !b {
// for _, validErr := range valid.Errors {
// return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
// }
// }
// return nil
// }
... ...
... ... @@ -16,9 +16,9 @@ type DividendsOrderService struct {
// 创建分红订单实体对象
func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createDividendsOrderCommand *command.CreateDividendsOrderCommand) (interface{}, error) {
if err := createDividendsOrderCommand.ValidateCommand(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
// if err := createDividendsOrderCommand.ValidateCommand(); err != nil {
// return nil, application.ThrowError(application.ARG_ERROR, err.Error())
// }
orderGoods := []allied_creation_cooperation.DividendsOrderGoodAdd{}
for _, v := range createDividendsOrderCommand.OrderGoods {
good := allied_creation_cooperation.DividendsOrderGoodAdd{
... ... @@ -53,9 +53,9 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD
// 返回分红订单实体对象
func (dividendsOrderService *DividendsOrderService) GetDividendsOrder(getDividendsOrderQuery *query.GetDividendsOrderQuery) (interface{}, error) {
if err := getDividendsOrderQuery.ValidateQuery(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
// if err := getDividendsOrderQuery.ValidateQuery(); err != nil {
// return nil, application.ThrowError(application.ARG_ERROR, err.Error())
// }
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(getDividendsOrderQuery.Operator)
result, err := creationCooperationGateway.DividendsOrderGet(allied_creation_cooperation.ReqDividendsOrderGet{
DividendsOrderId: getDividendsOrderQuery.DividendsOrderId,
... ... @@ -68,9 +68,9 @@ func (dividendsOrderService *DividendsOrderService) GetDividendsOrder(getDividen
// 移除分红订单实体对象
func (dividendsOrderService *DividendsOrderService) RemoveDividendsOrder(removeDividendsOrderCommand *command.RemoveDividendsOrderCommand) (interface{}, error) {
if err := removeDividendsOrderCommand.ValidateCommand(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
// if err := removeDividendsOrderCommand.ValidateCommand(); err != nil {
// return nil, application.ThrowError(application.ARG_ERROR, err.Error())
// }
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(removeDividendsOrderCommand.Operator)
_, err := creationCooperationGateway.DividendsOrderBatchRemove(allied_creation_cooperation.ReqDividendsOrderBatchRemove{
... ... @@ -84,9 +84,9 @@ func (dividendsOrderService *DividendsOrderService) RemoveDividendsOrder(removeD
// 查询分红订单方法
func (dividendsOrderService *DividendsOrderService) SearchDividendsOrder(searchDividendsOrderQuery *query.SearchDividendsOrderQuery) (int, interface{}, error) {
if err := searchDividendsOrderQuery.ValidateQuery(); err != nil {
return 0, nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
// if err := searchDividendsOrderQuery.ValidateQuery(); err != nil {
// return 0, nil, application.ThrowError(application.ARG_ERROR, err.Error())
// }
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(searchDividendsOrderQuery.Operator)
result, err := creationCooperationGateway.DividendsOrderSearch(allied_creation_cooperation.ReqDividendsOrderSearch{
PageNumber: searchDividendsOrderQuery.PageNumber,
... ... @@ -107,9 +107,9 @@ func (dividendsOrderService *DividendsOrderService) SearchDividendsOrder(searchD
// 更新分红订单实体对象
func (dividendsOrderService *DividendsOrderService) UpdateDividendsOrder(updateDividendsOrderCommand *command.UpdateDividendsOrderCommand) (interface{}, error) {
if err := updateDividendsOrderCommand.ValidateCommand(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
// if err := updateDividendsOrderCommand.ValidateCommand(); err != nil {
// return nil, application.ThrowError(application.ARG_ERROR, err.Error())
// }
orderGoods := []allied_creation_cooperation.DividendsOrderGoods{}
for _, v := range updateDividendsOrderCommand.OrderGoods {
good := allied_creation_cooperation.DividendsOrderGoods{
... ...
... ... @@ -2,7 +2,6 @@ package command
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 CreateDividendsReturnedOrderCommand struct {
... ... @@ -11,9 +10,14 @@ type CreateDividendsReturnedOrderCommand struct {
DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"` //退货客户
DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红单号
OriginalOrderNum string `json:"originalOrderNum"` //源单号
//货品
OrderGoods []allied_creation_cooperation.DividendsReturnedOrderGoods `json:"orderGoods"`
OrderGoods []struct {
OrderGoodId int64 `json:"orderGoodId,string"` // 订单产品id
CooperationContractNumber string `json:"cooperationContractNumber"` //关联的共创合约编号
// OrderGoodAmount float64 `json:"orderGoodAmount"` //订单产品金额
OrderGoodName string `json:"orderGoodName"` //订单产品名称
OrderGoodPrice float64 `json:"orderGoodPrice"` //订单产品单价
OrderGoodQuantity int `json:"orderGoodQuantity"` //订单产品数量
} `json:"orderGoods"` //货品
DividendsReturnedDate int64 `json:"dividendsReturnedDate"` //退货日期
OrderDate int64 `json:"orderDate"` //订单日期
Remarks string `json:"remarks"` //
... ...
... ... @@ -2,7 +2,6 @@ package command
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 UpdateDividendsReturnedOrderCommand struct {
... ... @@ -12,9 +11,14 @@ type UpdateDividendsReturnedOrderCommand struct {
DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"` //退货客户
DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红单号
OriginalOrderNum string `json:"originalOrderNum"` //源单号
//货品
OrderGoods []allied_creation_cooperation.DividendsReturnedOrderGoods `json:"orderGoods"`
OrderGoods []struct {
OrderGoodId int64 `json:"orderGoodId,string"` // 订单产品id
CooperationContractNumber string `json:"cooperationContractNumber"` //关联的共创合约编号
// OrderGoodAmount float64 `json:"orderGoodAmount"` //订单产品金额
OrderGoodName string `json:"orderGoodName"` //订单产品名称
OrderGoodPrice float64 `json:"orderGoodPrice"` //订单产品单价
OrderGoodQuantity int `json:"orderGoodQuantity"` //订单产品数量
} `json:"orderGoods"` //货品
DividendsReturnedDate int64 `json:"dividendsReturnedDate"` //退货日期
OrderDate int64 `json:"orderDate"` //订单日期
... ...
... ... @@ -20,11 +20,23 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) CreateDivide
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createDividendsReturnedOrderCommand.Operator)
dividendsReturnedDate := time.Unix(createDividendsReturnedOrderCommand.DividendsReturnedDate/1e3, 0)
orderDate := time.Unix(createDividendsReturnedOrderCommand.OrderDate/1e3, 0)
var orderGooods []allied_creation_cooperation.ReqDividendsReturnedOrderGood
for _, v := range createDividendsReturnedOrderCommand.OrderGoods {
good := allied_creation_cooperation.ReqDividendsReturnedOrderGood{
CooperationContractNumber: v.CooperationContractNumber,
OrderGoodAmount: 0,
OrderGoodName: v.OrderGoodName,
OrderGoodPrice: v.OrderGoodPrice,
OrderGoodQuantity: v.OrderGoodQuantity,
}
good.OrderGoodPrice = good.OrderGoodPrice * float64(good.OrderGoodQuantity)
orderGooods = append(orderGooods, good)
}
result, err := creationCooperationGateway.DividendsReturnedOrderAdd(allied_creation_cooperation.ReqDividendsReturnedOrderAdd{
DividendsReturnedCustomerName: createDividendsReturnedOrderCommand.DividendsReturnedCustomerName,
DividendsOrderNumber: createDividendsReturnedOrderCommand.DividendsOrderNumber,
OriginalOrderNum: createDividendsReturnedOrderCommand.OriginalOrderNum,
OrderGoods: createDividendsReturnedOrderCommand.OrderGoods,
OrderGoods: orderGooods,
DividendsReturnedDate: dividendsReturnedDate,
OrderData: orderDate,
OrgId: int(createDividendsReturnedOrderCommand.Operator.OrgId),
... ... @@ -86,12 +98,24 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) UpdateDivide
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateDividendsReturnedOrderCommand.Operator)
dividendsReturnedDate := time.Unix(updateDividendsReturnedOrderCommand.DividendsReturnedDate/1e3, 0)
orderDate := time.Unix(updateDividendsReturnedOrderCommand.OrderDate/1e3, 0)
var orderGooods []allied_creation_cooperation.ReqDividendsReturnedOrderGood
for _, v := range updateDividendsReturnedOrderCommand.OrderGoods {
good := allied_creation_cooperation.ReqDividendsReturnedOrderGood{
CooperationContractNumber: v.CooperationContractNumber,
OrderGoodAmount: 0,
OrderGoodName: v.OrderGoodName,
OrderGoodPrice: v.OrderGoodPrice,
OrderGoodQuantity: v.OrderGoodQuantity,
}
good.OrderGoodPrice = good.OrderGoodPrice * float64(good.OrderGoodQuantity)
orderGooods = append(orderGooods, good)
}
_, err := creationCooperationGateway.DividendsReturnedOrderUpdate(allied_creation_cooperation.ReqDividendsReturnedOrderUpdate{
DividendsReturnedOrderID: updateDividendsReturnedOrderCommand.DividendsReturnedOrderID,
DividendsReturnedCustomerName: updateDividendsReturnedOrderCommand.DividendsReturnedCustomerName,
DividendsOrderNumber: updateDividendsReturnedOrderCommand.DividendsOrderNumber,
OriginalOrderNum: updateDividendsReturnedOrderCommand.OriginalOrderNum,
OrderGoods: updateDividendsReturnedOrderCommand.OrderGoods,
OrderGoods: orderGooods,
DividendsReturnedDate: dividendsReturnedDate,
OrderData: orderDate,
OrgId: int(updateDividendsReturnedOrderCommand.Operator.OrgId),
... ...
package domain
import "testing"
func TestTokenParse(t *testing.T) {
tk := LoginToken{}
str := "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2Mjk4NzY3OTcsImlhdCI6MTYyOTg2OTU5NywiaXNzIjoiYWxsaWVkX2NyZWF0aW9uX2dhdGV3YXkiLCJuYmYiOjE2Mjk4Njk1OTcsInVzZXJJZCI6MSwidXNlckJhc2VJZCI6MSwiYWNjb3VudCI6IjE4ODYwMTgzMDUwIiwicGxhdGZvcm0iOiJhcHAiLCJjb21wYW55SWQiOjEsIm9yZ0lkIjoxLCJvcmdJZHMiOlsxLDU2XSwic2Vzc2lvbk1vZGUiOjF9.aDxfLwOpZCYWRhKa4GeKRh8sXsy2WOyt4X92uEEEXKg"
err := tk.ParseToken(str)
if err != nil {
t.Error(err)
}
t.Log("tk.Account=", tk.Account, " tk.CompanyId=", tk.CompanyId, " tk.OrgId=", tk.OrgId)
}
... ...
... ... @@ -70,7 +70,7 @@ type (
CooperationModeNumber string `json:"cooperationModeNumber"`
PublisherUid int `json:"publisherUid,string"`
SponsorUid int `json:"sponsorUid,string"`
DepartmentId int `json:"departmentId,string"`
DepartmentId int `json:"departmentId"`
CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerTypes"`
Attachment []*domain.Attachment `json:"attachment"`
}
... ... @@ -118,7 +118,7 @@ type (
// 共创项目描述
CooperationProjectDescription string `json:"cooperationProjectDescription"`
Attachment []domain.Attachment `json:"attachment"`
DepartmentId int `json:"departmentId,string"`
DepartmentId int `json:"departmentId"`
}
DataCooperationProjectUpdate struct {
... ... @@ -159,6 +159,7 @@ type (
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId"`
OrgIds []string `json:"orgIds"`
CompanyId int64 `json:"companyId"`
CooperationProjectNumberLike string `json:"cooperationProjectNumberLike"`
//OffsetLimitFlag bool `json:"offsetLimitFlag"`
// 用户基础数据id
... ...
... ... @@ -129,7 +129,7 @@ type (
//创建账期结算
type (
ReqCreditAccountsAdd struct {
DividendsEstimateIds []string `json:"dividendsEstimateIdss"`
DividendsEstimateIds []string `json:"dividendsEstimateIds"`
}
DataCreditAccountsAdd []struct {
... ...
... ... @@ -46,11 +46,19 @@ type (
Goods []DividendsReturnedOrderGoods `json:"goods"` //货品
}
//
ReqDividendsReturnedOrderGood struct {
CooperationContractNumber string `json:"cooperationContractNumber"` //关联的共创合约编号
OrderGoodAmount float64 `json:"orderGoodAmount"` //订单产品金额
OrderGoodName string `json:"orderGoodName"` //订单产品名称
OrderGoodPrice float64 `json:"orderGoodPrice"` //订单产品单价
OrderGoodQuantity int `json:"orderGoodQuantity"` //订单产品数量
}
ReqDividendsReturnedOrderAdd struct {
DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"`
DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红单号
OriginalOrderNum string `json:"originalOrderNum"`
OrderGoods []DividendsReturnedOrderGoods `json:"orderGoods"`
OrderGoods []ReqDividendsReturnedOrderGood `json:"orderGoods"`
DividendsReturnedDate time.Time `json:"dividendsReturnedDate"`
OrderData time.Time `json:"orderData"`
OrgId int `json:"orgId"`
... ... @@ -70,7 +78,7 @@ type (
DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"`
DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红单号
OriginalOrderNum string `json:"originalOrderNum"`
OrderGoods []DividendsReturnedOrderGoods `json:"orderGoods"`
OrderGoods []ReqDividendsReturnedOrderGood `json:"orderGoods"`
DividendsReturnedDate time.Time `json:"dividendsReturnedDate"`
OrderData time.Time `json:"orderData"`
OrgId int `json:"orgId"`
... ...
... ... @@ -27,6 +27,8 @@ func (controller *CooperationApplicationController) ListCooperationApplication()
err := controller.Unmarshal(listCooperationApplicationQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
listCooperationApplicationQuery.Operator = controller.GetOperator()
cnt, data, err := cooperationApplicationService.ListCooperationApplication(listCooperationApplicationQuery)
... ... @@ -39,6 +41,8 @@ func (controller *CooperationApplicationController) AuditCooperationApplication(
err := controller.Unmarshal(auditCooperationApplicationCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
auditCooperationApplicationCommand.Operator = controller.GetOperator()
data, err := cooperationApplicationService.AuditCooperationApplication(auditCooperationApplicationCommand)
... ...
... ... @@ -17,6 +17,8 @@ func (controller *CooperationContractController) CreateCooperationContract() {
err := controller.Unmarshal(createCooperationContractCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
createCooperationContractCommand.Operator = controller.GetOperator()
data, err := cooperationContractService.CreateCooperationContract(createCooperationContractCommand)
... ... @@ -29,6 +31,8 @@ func (controller *CooperationContractController) UpdateCooperationContract() {
err := controller.Unmarshal(updateCooperationContractCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
contractId, _ := controller.GetInt(":contractId")
updateCooperationContractCommand.Operator = controller.GetOperator()
... ... @@ -53,6 +57,8 @@ func (controller *CooperationContractController) ListCooperationContract() {
err := controller.Unmarshal(listCooperationContractQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
listCooperationContractQuery.Operator = controller.GetOperator()
cnt, data, err := cooperationContractService.ListCooperationContract(listCooperationContractQuery)
... ... @@ -65,6 +71,8 @@ func (controller *CooperationContractController) EnableCooperationContract() {
err := controller.Unmarshal(enableCooperationContractCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
data, err := cooperationContractService.EnableCooperationContract(enableCooperationContractCommand)
controller.Response(data, err)
... ... @@ -76,6 +84,8 @@ func (controller *CooperationContractController) SearchCooperationContractsByUnd
err := controller.Unmarshal(listCooperationContractQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
listCooperationContractQuery.Operator = controller.GetOperator()
cnt, data, err := cooperationContractService.SearchCooperationContractsByUndertake(listCooperationContractQuery)
... ... @@ -88,6 +98,8 @@ func (controller *CooperationContractController) RemoveCooperationContract() {
err := controller.Unmarshal(removeCooperationContractCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
data, err := cooperationContractService.RemoveCooperationContract(removeCooperationContractCommand)
controller.Response(data, err)
... ...
... ... @@ -17,6 +17,8 @@ func (controller *CooperationModeController) CreateCooperationMode() {
err := controller.Unmarshal(createCooperationModeCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
createCooperationModeCommand.Operator = controller.GetOperator()
data, err := cooperationModeService.CreateCooperationMode(createCooperationModeCommand)
... ... @@ -29,6 +31,8 @@ func (controller *CooperationModeController) UpdateCooperationMode() {
err := controller.Unmarshal(updateCooperationModeCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
modeId, _ := controller.GetInt(":modeId")
updateCooperationModeCommand.Operator = controller.GetOperator()
... ... @@ -53,6 +57,8 @@ func (controller *CooperationModeController) RemoveCooperationMode() {
err := controller.Unmarshal(removeCooperationModeCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
removeCooperationModeCommand.Operator = controller.GetOperator()
... ... @@ -66,6 +72,8 @@ func (controller *CooperationModeController) SearchCooperationMode() {
err := controller.Unmarshal(listCooperationModeQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
listCooperationModeQuery.Operator = controller.GetOperator()
cnt, data, err := cooperationModeService.ListCooperationMode(listCooperationModeQuery)
... ... @@ -78,6 +86,8 @@ func (controller *CooperationModeController) ListCooperationMode() {
err := controller.Unmarshal(listCooperationModeQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
listCooperationModeQuery.Operator = controller.GetOperator()
listCooperationModeQuery.PageNumber = 1
... ... @@ -92,6 +102,8 @@ func (controller *CooperationModeController) EnableCooperationMode() {
err := controller.Unmarshal(removeCooperationModeCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
removeCooperationModeCommand.Operator = controller.GetOperator()
... ...
... ... @@ -17,6 +17,8 @@ func (controller *CooperationProjectController) CreateCooperationProject() {
err := controller.Unmarshal(createCooperationProjectCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
createCooperationProjectCommand.Operator = controller.GetOperator()
data, err := cooperationProjectService.CreateCooperationProject(createCooperationProjectCommand)
... ... @@ -29,6 +31,8 @@ func (controller *CooperationProjectController) UpdateCooperationProject() {
err := controller.Unmarshal(updateCooperationProjectCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
projectId := controller.GetString(":projectId")
updateCooperationProjectCommand.CooperationProjectId = projectId
... ... @@ -55,6 +59,8 @@ func (controller *CooperationProjectController) ListCooperationProject() {
err := controller.Unmarshal(listCooperationProjectQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
listCooperationProjectQuery.Operator = controller.GetOperator()
cnt, data, err := cooperationProjectService.ListCooperationProject(listCooperationProjectQuery)
... ... @@ -67,6 +73,8 @@ func (controller *CooperationProjectController) SelectorCooperationProject() {
err := controller.Unmarshal(listCooperationProjectQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
listCooperationProjectQuery.Operator = controller.GetOperator()
cnt, data, err := cooperationProjectService.ListCooperationProjectSelector(listCooperationProjectQuery)
... ... @@ -79,6 +87,8 @@ func (controller *CooperationProjectController) EndCooperationProject() {
err := controller.Unmarshal(endCooperationProjectCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
endCooperationProjectCommand.Operator = controller.GetOperator()
data, err := cooperationProjectService.EndCooperationProject(endCooperationProjectCommand)
... ...
... ... @@ -18,6 +18,8 @@ func (controller *CreditAccountController) ListCreditAccount() {
err := controller.Unmarshal(listQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
listQuery.Operator = controller.GetOperator()
cnt, data, err := creditAccountService.ListCreditAccount(listQuery)
... ... @@ -43,6 +45,8 @@ func (controller *CreditAccountController) PayCreditAccount() {
err := controller.Unmarshal(payCreditAccountCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
payCreditAccountCommand.Operator = controller.GetOperator()
data, err := creditAccountService.PayCreditAccount(payCreditAccountCommand)
... ... @@ -56,6 +60,8 @@ func (controller *CreditAccountController) RemoveCreditAccount() {
err := controller.Unmarshal(removeCreditAccountCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
removeCreditAccountCommand.Operator = controller.GetOperator()
data, err := creditAccountService.RemoveCreditAccount(removeCreditAccountCommand)
... ...
... ... @@ -18,6 +18,8 @@ func (controller *DividendsEstimateController) CancelDividendsEstimate() {
err := controller.Unmarshal(cancelDividendsEstimateCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
cancelDividendsEstimateCommand.Operator = controller.GetOperator()
data, err := dividendsEstimateService.CancelDividendsEstimate(cancelDividendsEstimateCommand)
... ... @@ -31,6 +33,8 @@ func (controller *DividendsEstimateController) SearchDividendsEstimate() {
err := controller.Unmarshal(searchDividendsEstimateQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
searchDividendsEstimateQuery.Operator = controller.GetOperator()
cnt, data, err := dividendsEstimateService.SearchDividendsEstimate(searchDividendsEstimateQuery)
... ... @@ -44,6 +48,8 @@ func (controller *DividendsEstimateController) SearchDividendsIncentives() {
err := controller.Unmarshal(searchDividendsIncentivesQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
searchDividendsIncentivesQuery.Operator = controller.GetOperator()
cnt, data, err := dividendsEstimateService.SearchDividendsIncentives(searchDividendsIncentivesQuery)
... ... @@ -57,6 +63,8 @@ func (controller *DividendsEstimateController) SearchMoneyIncentives() {
err := controller.Unmarshal(searchMoneyIncentivesQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
searchMoneyIncentivesQuery.Operator = controller.GetOperator()
cnt, data, err := dividendsEstimateService.SearchMoneyIncentives(searchMoneyIncentivesQuery)
... ... @@ -70,6 +78,8 @@ func (controller *DividendsEstimateController) EstimateMoneyIncentives() {
err := controller.Unmarshal(estimateMoneyIncentivesCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
estimateMoneyIncentivesCommand.Operator = controller.GetOperator()
data, err := dividendsEstimateService.EstimateMoneyIncentives(estimateMoneyIncentivesCommand)
... ... @@ -83,6 +93,8 @@ func (controller *DividendsEstimateController) EstimateDividendsIncentives() {
err := controller.Unmarshal(estimateDividendsIncentivesCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
estimateDividendsIncentivesCommand.Operator = controller.GetOperator()
data, err := dividendsEstimateService.EstimateDividendsIncentives(estimateDividendsIncentivesCommand)
... ... @@ -96,6 +108,8 @@ func (controller *DividendsEstimateController) MoneyIncentivesSelector() {
err := controller.Unmarshal(moneyIncentivesSelectorQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
moneyIncentivesSelectorQuery.Operator = controller.GetOperator()
data, err := dividendsEstimateService.MoneyIncentivesSelector(moneyIncentivesSelectorQuery)
... ... @@ -109,6 +123,8 @@ func (controller *DividendsEstimateController) ConfimDividendsEstimate() {
err := controller.Unmarshal(confimDividendsEstimateCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
confimDividendsEstimateCommand.Operator = controller.GetOperator()
data, err := dividendsEstimateService.ConfimDividendsEstimate(confimDividendsEstimateCommand)
... ...
... ... @@ -17,6 +17,8 @@ func (controller *DividendsOrderController) CreateDividendsOrder() {
err := controller.Unmarshal(createDividendsOrderCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
createDividendsOrderCommand.Operator = controller.GetOperator()
data, err := dividendsOrderService.CreateDividendsOrder(createDividendsOrderCommand)
... ... @@ -29,6 +31,8 @@ func (controller *DividendsOrderController) UpdateDividendsOrder() {
err := controller.Unmarshal(updateDividendsOrderCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
orderId, _ := controller.GetInt(":orderId")
updateDividendsOrderCommand.Operator = controller.GetOperator()
... ... @@ -43,6 +47,8 @@ func (controller *DividendsOrderController) RemoveDividendsOrder() {
err := controller.Unmarshal(removeDividendsOrderCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
removeDividendsOrderCommand.Operator = controller.GetOperator()
... ... @@ -66,6 +72,8 @@ func (controller *DividendsOrderController) SearchDividendsOrder() {
err := controller.Unmarshal(searchDividendsOrderQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
searchDividendsOrderQuery.Operator = controller.GetOperator()
cnt, data, err := dividendsOrderService.SearchDividendsOrder(searchDividendsOrderQuery)
... ...
... ... @@ -17,6 +17,8 @@ func (controller *DividendsReturnedOrderController) CreateDividendsReturnedOrder
err := controller.Unmarshal(createDividendsReturnedOrderCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
createDividendsReturnedOrderCommand.Operator = controller.GetOperator()
data, err := dividendsReturnedOrderService.CreateDividendsReturnedOrder(createDividendsReturnedOrderCommand)
... ... @@ -29,6 +31,8 @@ func (controller *DividendsReturnedOrderController) UpdateDividendsReturnedOrder
err := controller.Unmarshal(updateDividendsReturnedOrderCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
projectId, _ := controller.GetInt(":projectId")
updateDividendsReturnedOrderCommand.DividendsReturnedOrderID = projectId
... ... @@ -43,6 +47,8 @@ func (controller *DividendsReturnedOrderController) RemoveDividendsReturnedOrder
err := controller.Unmarshal(removeDividendsReturnedOrderCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
removeDividendsReturnedOrderCommand.Operator = controller.GetOperator()
data, err := dividendsReturnedOrderService.RemoveDividendsReturnedOrder(removeDividendsReturnedOrderCommand)
... ... @@ -65,6 +71,8 @@ func (controller *DividendsReturnedOrderController) SearchDividendsReturnedOrder
err := controller.Unmarshal(searchDividendsReturnedOrderQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
searchDividendsReturnedOrderQuery.Operator = controller.GetOperator()
cnt, data, err := dividendsReturnedOrderService.SearchDividendsReturnedOrder(searchDividendsReturnedOrderQuery)
... ... @@ -77,6 +85,8 @@ func (controller *DividendsReturnedOrderController) SelectorDividendsOrder() {
err := controller.Unmarshal(selectorDividendsOrderQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
selectorDividendsOrderQuery.Operator = controller.GetOperator()
cnt, data, err := dividendsReturnedOrderService.SelectorDividendsOrder(selectorDividendsOrderQuery)
... ...