作者 陈志颖

fix:分红退货单增加订单时间

... ... @@ -31,12 +31,6 @@ type CooperationApplicationDto struct {
IsCanceled bool `json:"isCanceled"`
// 公司
Company *Company `json:"company"`
// 创建时间
//CreatedAt time.Time `json:"createdAt"`
// 删除时间
//DeletedAt time.Time `json:"deletedAt"`
// 更新时间
//UpdatedAt time.Time `json:"updatedAt"`
}
// User 用户第三方服务防腐模型
... ...
... ... @@ -446,6 +446,7 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro
defer func() {
_ = transactionContext.RollbackTransaction()
}()
// 共创项目仓储初始化
var cooperationProjectRepository domain.CooperationProjectRepository
if value, err := factory.CreateCooperationProjectRepository(map[string]interface{}{
"transactionContext": transactionContext,
... ... @@ -454,7 +455,14 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro
} else {
cooperationProjectRepository = value
}
cooperationProject, err := cooperationProjectRepository.FindOne(map[string]interface{}{"cooperationProjectId": updateCooperationProjectCommand.CooperationProjectId})
cooperationProjectId, err := strconv.ParseInt(updateCooperationProjectCommand.CooperationProjectId, 10, 64)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创项目编号类型错误")
}
// 查找共创项目
cooperationProject, err := cooperationProjectRepository.FindOne(map[string]interface{}{"cooperationProjectId": cooperationProjectId})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
... ...
... ... @@ -40,6 +40,8 @@ type CreateDividendsReturnedOrderCommand struct {
Remarks string `cname:"备注" json:"remarks" valid:"Required"`
// 退货日期
DividendsReturnedDate time.Time `cname:"退货日期" json:"dividendsReturnedDate" valid:"Required"`
// 订单日期
OrderTime time.Time `cname:"订单日期" json:"orderTime" valid:"Required"`
// 退货区域名称
RegionName string `cname:"退货区域名称" json:"regionName,omitempty"`
// 订单产品列表
... ...
... ... @@ -5,6 +5,7 @@ import (
"github.com/beego/beego/v2/core/validation"
"reflect"
"strings"
"time"
)
type UpdateDividendsReturnedOrderCommand struct {
... ... @@ -22,6 +23,8 @@ type UpdateDividendsReturnedOrderCommand struct {
DividendsReturnedDate string `cname:"退货日期" json:"dividendsReturnedDate" valid:"Required"`
// 退货区域
RegionName string `cname:"退货区域" json:"regionName,omitempty"`
// 订单时间
OrderTime time.Time `cname:"订单日期" json:"orderTime" valid:"Required"`
// 订单产品列表
OrderGoods []*OrderGoods `cname:"订单产品列表" json:"orderGoods,omitempty"`
// 公司ID,通过集成REST上下文获取
... ...
... ... @@ -234,6 +234,9 @@ func (repository *CooperationProjectRepository) Find(queryOptions map[string]int
var cooperationProjectModels []*models.CooperationProject
cooperationProjects := make([]*domain.CooperationProject, 0)
query := sqlbuilder.BuildQuery(tx.Model(&cooperationProjectModels), queryOptions)
if cooperationProjectName, ok := queryOptions["cooperationProjectName"]; ok && cooperationProjectName != "" {
query.Where("cooperation_project_name like ?", fmt.Sprintf("%%%s%%", cooperationProjectName))
}
if companyId, ok := queryOptions["companyId"]; ok && companyId.(int64) != 0 {
query.Where("company->>'companyId' = '?'", companyId)
}
... ...