作者 yangfu

Merge branch 'dev' of http://gitlab.fjmaimaimai.com/allied-creation/allied-creat…

…ion-cooperation into dev
正在显示 61 个修改的文件 包含 274 行增加233 行删除
... ... @@ -16,11 +16,11 @@ type GetContractUndertakerFeedbackQuery struct {
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
OrgId int64 `cname:"组织机构ID" json:"orgId"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
}
func (getContractUndertakerFeedbackQuery *GetContractUndertakerFeedbackQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -18,11 +18,13 @@ type ListContractUndertakerFeedbackQuery struct {
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
OrgId int64 `cname:"组织机构ID" json:"orgId"`
// 关联的组织机构ID列表
OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
}
func (listContractUndertakerFeedbackQuery *ListContractUndertakerFeedbackQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -10,11 +10,13 @@ import (
type SearchContractUndertakerFeedbackQuery struct {
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
OrgId int64 `cname:"组织机构ID" json:"orgId"`
// 关联的组织机构ID列表
OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"`
// 共创合约名称
... ...
... ... @@ -14,13 +14,15 @@ type ListCooperationApplicationQuery struct {
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
OrgId int64 `cname:"组织机构ID" json:"orgId"`
// 关联的组织机构ID列表
OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
}
func (listCooperationApplicationQuery *ListCooperationApplicationQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -24,11 +24,13 @@ type SearchCooperationApplicationQuery struct {
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
OrgId int64 `cname:"组织机构ID" json:"orgId"`
// 关联的组织机构ID列表
OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
}
func (searchCooperationApplicationQuery *SearchCooperationApplicationQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -16,11 +16,13 @@ type ListCooperationContractQuery struct {
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
OrgId int64 `cname:"组织机构ID" json:"orgId"`
// 关联的组织机构ID列表
OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
}
func (listCooperationContractQuery *ListCooperationContractQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -18,13 +18,13 @@ type SearchCooperationContractQuery struct {
// 发起人姓名
SponsorName string `cname:"发起人姓名" json:"sponsorName,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
OrgId int64 `cname:"组织机构ID" json:"orgId"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
}
func (searchCooperationContractQuery *SearchCooperationContractQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -18,13 +18,13 @@ type SearchCooperationContractByUndertakerQuery struct {
// 项目发起人姓名
SponsorName string `cname:"项目发起人姓名" json:"sponsorName,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
OrgId int64 `cname:"组织机构ID" json:"orgId"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
}
func (searchCooperationContractByUndertakerQuery *SearchCooperationContractByUndertakerQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -14,13 +14,15 @@ type ListCooperationContractChangeLogQuery struct {
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
OrgId int64 `cname:"组织机构ID" json:"orgId"`
// 关联的组织机构ID列表
OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
}
func (listCooperationContractChangeLogQuery *ListCooperationContractChangeLogQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -18,13 +18,15 @@ type SearchCooperationContractChangeLogQuery struct {
// 页面大小
PageNumber int64 `cname:"页码" json:"pageNumber,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
OrgId int64 `cname:"组织机构ID" json:"orgId"`
// 关联的组织机构ID列表
OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
}
func (searchCooperationContractChangeLogQuery *SearchCooperationContractChangeLogQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -14,11 +14,13 @@ type ListCooperationModeQuery struct {
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
OrgId int64 `cname:"组织机构ID" json:"orgId"`
// 关联的组织机构ID列表
OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据is" json:"userBaseId"`
}
... ...
... ... @@ -18,11 +18,13 @@ type SearchCooperationModeQuery struct {
// 组织机构名称
OrganizationName string `cname:"组织机构名称" json:"organizationName,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
OrgId int64 `cname:"组织机构ID" json:"orgId"`
// 关联的组织机构ID列表
OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
}
... ...
... ... @@ -115,6 +115,7 @@ func (cooperationModeService *CooperationModeService) CreateCooperationMode(crea
CooperationModeName: createCooperationModeCommand.CooperationModeName,
CooperationModeNumber: createCooperationModeCommand.CooperationModeNumber,
Remarks: createCooperationModeCommand.Remarks,
Status: 1,
Company: company,
Org: organization,
Operator: operator,
... ...
... ... @@ -13,16 +13,18 @@ type ListCooperationProjectQuery struct {
PageNumber int64 `cname:"页码" json:"pageNumber,omitempty"`
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
// 项目状态 1招标中,2结束 0全部
Status int32 `json:"status"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId"`
// 关联的组织机构ID列表
OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
}
func (listCooperationProjectQuery *ListCooperationProjectQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -20,13 +20,15 @@ type SearchCooperationProjectQuery struct {
// 共创项目状态,根据共创项目状态筛选项目数据
Status int32 `cname:"共创项目状态" json:"status,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
OrgId int64 `cname:"组织机构ID" json:"orgId"`
// 关联的组织机构ID列表
OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
}
func (searchCooperationProjectQuery *SearchCooperationProjectQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -238,14 +238,39 @@ func (cooperationProjectService *CooperationProjectService) GetCooperationProjec
} else {
cooperationProjectDao = value
}
// 获取可删除的承接对象类型
undertakerTypesUncheckedAvailable, err := cooperationProjectDao.CheckUndertakerTypesUncheckedAvailable(map[string]interface{}{
// 可以去除勾选的承接人对象列表
var undertakerTypesUncheckedAvailable []int32
// 判断承接对象是否存在员工
gotUser, err := cooperationProjectDao.CheckUndertakerTypesUncheckedAvailable(map[string]interface{}{
"cooperationProjectNumber": cooperationProject.CooperationProjectNumber,
"cooperationProjectUndertakerTypes": cooperationProject.CooperationProjectUndertakerTypes,
"user": true,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
if !gotUser {
undertakerTypesUncheckedAvailable = append(undertakerTypesUncheckedAvailable, 1)
}
// 判断承接对象是否存在共创用户
gotPartner, err := cooperationProjectDao.CheckUndertakerTypesUncheckedAvailable(map[string]interface{}{
"cooperationProjectNumber": cooperationProject.CooperationProjectNumber,
"partner": true,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
if !gotPartner {
undertakerTypesUncheckedAvailable = append(undertakerTypesUncheckedAvailable, 2)
}
// 判断承接人是否存在公开用户
if !gotUser && !gotPartner {
undertakerTypesUncheckedAvailable = append(undertakerTypesUncheckedAvailable, 3)
}
cooperationProjectDto := &dto.CooperationProjectsDto{}
if err := cooperationProjectDto.LoadDto(cooperationProject, nil, undertakerTypesUncheckedAvailable); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
... ... @@ -283,39 +308,10 @@ func (cooperationProjectService *CooperationProjectService) ListCooperationProje
if count, cooperationProjects, err := cooperationProjectRepository.Find(tool_funs.SimpleStructToMap(listCooperationProjectQuery)); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
//var cooperationModeRepository domain.CooperationModeRepository
//if value, err := factory.CreateCooperationProjectRepository(map[string]interface{}{
// "transactionContext": transactionContext,
//}); err != nil {
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
//} else {
// cooperationProjectRepository = value
//}
//var modeMap = make(map[string]*domain.CooperationMode)
//if _, cooperationProjects, err := cooperationModeRepository.Find(map[string]interface{}{"companyId":listCooperationProjectQuery.CompanyId,"orgId":listCooperationProjectQuery.OrgId}); err != nil {
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
//}else{
// for i:=range cooperationProjects{
// p :=cooperationProjects[i]
// modeMap[p.CooperationModeNumber]=p
// }
//}
//
//var res []*dto.CooperationProjectsDto
//for i := range cooperationProjects {
// p := cooperationProjects[i]
// tp := &dto.CooperationProjectsDto{}
// tp.LoadDto(p, &domain.CooperationMode{})
// res = append(res, tp)
//}
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return map[string]interface{}{
//"grid": map[string]interface{}{
//"total": count,
//"list": res,
//},
"list": cooperationProjects,
"total": count,
}, nil
... ...
... ... @@ -14,13 +14,15 @@ type ListCreditAccountQuery struct {
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
OrgId int64 `cname:"组织机构ID" json:"orgId"`
// 关联的组织机构ID列表
OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
}
func (listCreditAccountQuery *ListCreditAccountQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -18,18 +18,20 @@ type SearchCreditAccountQuery struct {
CreditAccountOrderNum string `cname:"账期结算单号" json:"creditAccountOrderNum,omitempty"`
// 参与人姓名
ParticipatorName string `cname:"参与人姓名" json:"participatorName,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"`
// 账期结算支付状态,1待支付,2已支付,APP端结算记录返回已结算的账期结算单
PaymentStatus int32 `cname:"账期结算支付状态" json:"paymentStatus"`
// 结算周期,按年“2021”或者按月结算”2021-07“
Period time.Time `cname:"结算周期" json:"period,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId"`
// 关联的组织机构ID列表
OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
}
func (searchCreditAccountQuery *SearchCreditAccountQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -112,13 +112,36 @@ func (creditAccountService *CreditAccountService) CreateCreditAccount(createCred
} else {
dividendsEstimateRepository = value
}
dividendsEstimateIds, _ := utils.SliceAtoi(createCreditAccountCommand.DividendsEstimateIds)
// 批量转换分红预算单号列表
dividendsEstimateIds, err := utils.SliceAtoi(createCreditAccountCommand.DividendsEstimateIds)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "分红预算单号错误")
}
// 获取所选分红预算单
if _, dividendsEstimates, err := dividendsEstimateRepository.Find(map[string]interface{}{
"dividendsEstimateIds": dividendsEstimateIds,
}); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
// 校验共创用户是否一致
for i, _ := range dividendsEstimates {
if dividendsEstimates[i].DividendsUser.UserId != dividendsEstimates[i+1].DividendsUser.UserId {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "请勾选同一个共创用户进行结算")
}
}
// 校验分红预算单是否可以进行预算
for _, dividendsEstimate := range dividendsEstimates {
if dividendsEstimate.DividendsAccountStatus == 2 {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "请勾选“待结算”的分红单结算")
}
if dividendsEstimate.IsCanceled {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "请勾选未取消的分红单结算")
}
}
// 预算操作
var creditAccounts []*domain.CreditAccount
for _, dividendsEstimate := range dividendsEstimates {
// 生成账期结算单号
... ...
... ... @@ -18,6 +18,8 @@ type DividendsIncentivesEstimateDto struct {
CustomerName string `json:"customerName"`
// 订单区域
RegionName string `json:"region"`
// 订单产品名称
OrderGoodName string `json:"orderGoodName"`
// 订单金额
OrderAmount float64 `json:"orderAmount"`
// 订单/退货单日期
... ... @@ -31,6 +33,7 @@ func (dto *DividendsIncentivesEstimateDto) LoadDto(orderGood *domain.OrderGood,
dto.OriginalOrderNum = originalOrderNum
dto.CustomerName = customerName
dto.RegionName = regionName
dto.OrderGoodName = orderGood.OrderGoodName
dto.OrderAmount = orderGood.OrderGoodAmount
dto.OrderDate = orderDate
return nil
... ...
... ... @@ -15,13 +15,15 @@ type ListDividendsEstimateQuery struct {
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
OrgId int64 `cname:"组织机构ID" json:"orgId"`
// 关联的组织机构ID列表
OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
}
func (listDividendsEstimateQuery *ListDividendsEstimateQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -15,13 +15,15 @@ type ListDividendsIncentivesEstimateQuery struct {
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
OrgId int64 `cname:"组织机构ID" json:"orgId"`
// 关联的组织机构ID列表
OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
}
func (listDividendsIncentivesEstimateQuery *ListDividendsIncentivesEstimateQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -14,16 +14,18 @@ type ListMoneyIncentivesEstimateQuery struct {
PageNumber int64 `cname:"页码" json:"pageNumber,omitempty"`
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
// 激励方式
IncentivesType int32 `cname:"激励方式" json:"incentivesType,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
OrgId int64 `cname:"组织机构ID" json:"orgId"`
// 关联的组织机构ID列表
OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"`
// 激励方式
IncentivesType int32 `cname:"激励方式" json:"incentivesType,omitempty"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
}
func (listMoneyIncentivesEstimateQuery *ListMoneyIncentivesEstimateQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -15,13 +15,15 @@ type SearchDividendsEstimateQuery struct {
// 分红类型,1订单分红,2退货冲销,3金额激励
DividendsType int32 `cname:"分红类型" json:"dividendsType,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
OrgId int64 `cname:"组织机构ID" json:"orgId"`
// 关联的组织机构ID列表
OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
// 页面大小
PageNumber int64 `cname:"页码" json:"pageNumber,omitempty"`
// 页面大小
... ...
... ... @@ -15,13 +15,15 @@ type SearchDividendsIncentivesEstimateQuery struct {
// 分红订单号/退货单号
OrderOrReturnedOrderNum string `cname:"分红订单号/退货单号" json:"orderOrReturnedOrderNum,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
OrgId int64 `cname:"组织机构ID" json:"orgId"`
// 关联的组织机构ID列表
OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
// 页面大小
PageNumber int64 `cname:"页码" json:"pageNumber,omitempty"`
// 页面大小
... ...
... ... @@ -15,13 +15,15 @@ type SearchMoneyIncentivesEstimateQuery struct {
// 发起部门名称
DepartmentName string `cname:"发起部门名称" json:"departmentName,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
OrgId int64 `cname:"组织机构ID" json:"orgId"`
// 关联的组织机构ID列表
OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
// 页面大小
PageNumber int64 `cname:"页码" json:"pageNumber,omitempty"`
// 页面大小
... ...
... ... @@ -140,6 +140,8 @@ func (dividendsEstimateService *DividendsEstimateService) ListMoneyIncentivesEst
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
// TODO 判断承接人是否已分红
// 数据传输对象
var moneyIncentivesEstimateDtos []*dto.MoneyIncentivesEstimateDto
for _, cooperationContract := range cooperationContracts {
moneyIncentivesEstimateDto := &dto.MoneyIncentivesEstimateDto{}
... ...
... ... @@ -14,13 +14,15 @@ type ListDividendsOrdersQuery struct {
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
OrgId int64 `cname:"组织机构ID" json:"orgId"`
// 关联的组织机构ID列表
OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
}
func (listDividendsOrdersQuery *ListDividendsOrdersQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -18,13 +18,15 @@ type SearchDividendsOrderQuery struct {
// 页面大小
PageNumber int64 `cname:"页码" json:"pageNumber,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
OrgId int64 `cname:"组织机构ID" json:"orgId"`
// 关联的组织机构ID列表
OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
}
func (searchDividendsOrderQuery *SearchDividendsOrderQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -12,13 +12,15 @@ type SearchDividendsOrderNumberQuery struct {
// 分红订单号
DividendsOrderNumber string `cname:"分红订单号" json:"dividendsOrderNumber,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
OrgId int64 `cname:"组织机构ID" json:"orgId"`
// 关联的组织机构ID列表
OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
// 页面大小
PageNumber int64 `cname:"页码" json:"pageNumber,omitempty"`
// 页面大小
... ...
... ... @@ -19,7 +19,7 @@ import (
type DividendsOrderService struct {
}
// CreateDividendsOrder 创建分红订单实体对象
// CreateDividendsOrder 新增分红订单实体对象
func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createDividendsOrderCommand *command.CreateDividendsOrderCommand) (interface{}, error) {
if err := createDividendsOrderCommand.ValidateCommand(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
... ... @@ -140,6 +140,7 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD
orderTimeInt, _ := strconv.ParseInt(createDividendsOrderCommand.OrderTime, 10, 64)
orderTime := utils.TransformTimestampToTime(orderTimeInt)
// 新增分红订单
newDividendsOrder := &domain.DividendsOrder{
DividendsOrderId: 0,
DividendsOrderNumber: dividendsOrderNumber,
... ...
... ... @@ -45,3 +45,11 @@ func CreateConfirmMoneyIncentivesEstimateService(options map[string]interface{})
}
return domain_service.NewConfirmMoneyIncentivesEstimateService(transactionContext)
}
func CreateCancelDividendsEstimateService(options map[string]interface{}) (*domain_service.CancelDividendsEstimateService, error) {
var transactionContext *pgTransaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pgTransaction.TransactionContext)
}
return domain_service.NewCancelDividendsEstimateService(transactionContext)
}
... ...
package service
import (
coreDomain "github.com/linmadan/egglib-go/core/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
)
type CancelDividendsEstimate interface {
CancelEstimate()
coreDomain.DomainEventPublisher
CancelEstimate(dividendsEstimateId int64, operatorId int64) ([]*domain.DividendsEstimate, error)
}
... ...
... ... @@ -35,10 +35,42 @@ func (dao *CooperationProjectDao) GenerateProjectNumber() (string, error) {
}
}
// CheckUndertakerTypesUncheckedAvailable TODO 校验项目承接对象是否可以删除
func (dao *CooperationProjectDao) CheckUndertakerTypesUncheckedAvailable(queryOptions map[string]interface{}) ([]int32, error) {
return []int32{}, nil
// CheckUndertakerTypesUncheckedAvailable 校验项目承接对象是否可以删除
func (dao *CooperationProjectDao) CheckUndertakerTypesUncheckedAvailable(queryOptions map[string]interface{}) (bool, error) {
tx := dao.transactionContext.PgTx
var cooperationContractModels []*models.CooperationContract
// 获取和项目关联的合约
query := tx.Model(&cooperationContractModels)
if cooperationProjectNumber, ok := queryOptions["cooperationProjectNumber"]; ok && cooperationProjectNumber != "" {
query = query.Where("cooperation_project_number = ?", cooperationProjectNumber)
}
if companyId, ok := queryOptions["companyId"]; ok && companyId.(int64) != 0 {
query = query.Where(`cooperation_contract.company @> '{"companyId":"?"}'`, companyId)
}
if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 {
query = query.Where(`cooperation_contract.org @> '{"orgId":"?"}'`, orgId)
}
if user, ok := queryOptions["user"]; ok && user.(bool) != false {
query = query.Where("user_type = ?", 1)
}
if partner, ok := queryOptions["partner"]; ok && partner.(bool) != false {
query = query.Where("user_type = ?", 2)
}
if count, err := query.SelectAndCount(); err != nil {
return false, err
} else {
if count > 0 {
for _, cooperationContractModel := range cooperationContractModels {
// 获取合约相关承接人
var cooperationContractUndertakerModels []*models.CooperationContractUndertaker
queryUndertaker := tx.Model(&cooperationContractUndertakerModels)
queryUndertaker.Where("cooperation_contract_number = ?", cooperationContractModel.CooperationContractNumber)
ok, err2 := queryUndertaker.Exists()
return !ok, err2
}
}
}
return false, nil
}
// CheckProjectNumberAvailable 校验项目编号唯一性
... ...
... ... @@ -4,6 +4,7 @@ import (
"fmt"
coreDomain "github.com/linmadan/egglib-go/core/domain"
pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
)
type CancelDividendsEstimateService struct {
... ... @@ -11,8 +12,8 @@ type CancelDividendsEstimateService struct {
transactionContext *pgTransaction.TransactionContext
}
func (c *CancelDividendsEstimateService) CancelEstimate() {
panic("implement me")
func (domainService *CancelDividendsEstimateService) CancelEstimate(dividendsEstimateId int64, operatorId int64) ([]*domain.DividendsEstimate, error) {
return nil, nil
}
func NewCancelDividendsEstimateService(transactionContext *pgTransaction.TransactionContext) (*CancelDividendsEstimateService, error) {
... ...
... ... @@ -8,7 +8,7 @@ import (
type ContractUndertakerFeedback struct {
tableName string `comment:"承接人反馈信息" pg:"contract_undertaker_feedbacks,alias:contract_undertaker_feedback"`
// 合约承接方反馈记录ID
FeedbackId int64 `comment:"合约承接方反馈记录ID" pg:",pk:feedback_id"`
FeedbackId int64 `comment:"合约承接方反馈记录ID" pg:",pk"`
// 合约承接方反馈内容附件
FeedbackAttachment []*domain.Attachment `comment:"合约承接方反馈内容附件"`
// 合约承接方反馈内容
... ...
... ... @@ -8,7 +8,7 @@ import (
type CooperationApplication struct {
tableName string `comment:"共创申请实体" pg:"cooperation_applications,alias:cooperation_application"`
// 共创申请ID
CooperationApplicationId int64 `comment:"共创申请ID" pg:",pk:cooperation_application_id"`
CooperationApplicationId int64 `comment:"共创申请ID" pg:",pk"`
// 共创申请人
CooperationApplicationApplicant *domain.User `comment:"共创申请人"`
// 共创申请描述附件
... ...
... ... @@ -8,7 +8,7 @@ import (
type CooperationContract struct {
tableName string `comment:"共创项目合约实体" pg:"cooperation_contracts,alias:cooperation_contract"`
// 共创合约ID
CooperationContractId int64 `comment:"共创合约ID" pg:",pk:cooperation_contract_id"`
CooperationContractId int64 `comment:"共创合约ID" pg:",pk"`
// 共创合约描述
CooperationContractDescription string `comment:"共创合约描述"`
// 共创合约名称
... ...
... ... @@ -8,7 +8,7 @@ import (
type CooperationContractChangeLog struct {
tableName string `comment:"共创合约变更日志" pg:"cooperation_contract_change_logs,alias:cooperation_contract_change_log"`
// 共创合约变更记录id
CooperationContractChangeLogId int64 `comment:"共创合约变更记录id" pg:",pk:cooperation_contract_change_log_id"`
CooperationContractChangeLogId int64 `comment:"共创合约变更记录id" pg:",pk"`
// 激励规则
IncentivesRule string `comment:"激励规则"`
// 激励规则明细
... ...
... ... @@ -8,7 +8,7 @@ import (
type CooperationContractRelevant struct {
tableName string `comment:"共创合约相关人" pg:"cooperation_contract_relevants,alias:cooperation_contract_relevant"`
// 共创合约相关人id
CooperationContractRelevantId int64 `comment:"共创合约相关人id" pg:",pk:cooperation_contract_relevant_id"`
CooperationContractRelevantId int64 `comment:"共创合约相关人id" pg:",pk"`
// 共创合约编号
CooperationContractNumber string `comment:"共创合约编号"`
// 合约人userId
... ...
... ... @@ -8,7 +8,7 @@ import (
type CooperationContractUndertaker struct {
tableName string `comment:"共创合约承接人" pg:"cooperation_contract_undertakers,alias:cooperation_contract_undertaker"`
// 共创合约承接人id
CooperationContractUndertakerId int64 `comment:"共创合约承接人id" pg:",pk:cooperation_contract_undertaker_id"`
CooperationContractUndertakerId int64 `comment:"共创合约承接人id" pg:",pk"`
// 共创合约编号
CooperationContractNumber string `comment:"共创合约编号"`
// 共创合约承接人uid
... ...
... ... @@ -8,7 +8,7 @@ import (
type CooperationMode struct {
tableName string `comment:"共创模式实体" pg:"cooperation_modes,alias:cooperation_mode"`
// 共创模式ID
CooperationModeId int64 `comment:"共创模式ID" pg:",pk:cooperation_mode_id"`
CooperationModeId int64 `comment:"共创模式ID" pg:",pk"`
// 共创模式编码,唯一确定
CooperationModeNumber string `comment:"共创模式编码,唯一确定"`
// 模式名称,唯一确定
... ...
... ... @@ -8,7 +8,7 @@ import (
type CooperationProject struct {
tableName string `comment:"共创项目实体" pg:"cooperation_projects,alias:cooperation_project"`
// 共创项目ID
CooperationProjectId int64 `comment:"共创项目ID" pg:",pk:cooperation_project_id"`
CooperationProjectId int64 `comment:"共创项目ID" pg:",pk"`
// 共创项目编号
CooperationProjectNumber string `comment:"共创项目编号"`
// 共创项目描述
... ...
... ... @@ -8,7 +8,7 @@ import (
type CreditAccount struct {
tableName string `comment:"账期结算单实体" pg:"credit_accounts,alias:credit_account"`
// 账期结算单ID
CreditAccountId int64 `comment:"账期结算单ID" pg:"pk:credit_account_id"`
CreditAccountId int64 `comment:"账期结算单ID" pg:",pk"`
// 账期结算实付金额
ActuallyPaidAmount float64 `comment:"账期结算实付金额"`
// 账期结算单号
... ...
... ... @@ -8,7 +8,7 @@ import (
type DividendsEstimate struct {
tableName string `comment:"分红预算实体" pg:"dividends_estimates,alias:dividends_estimate"`
// 承接人分红预算记录ID
DividendsEstimateId int64 `comment:"承接人分红预算记录ID" pg:",pk:dividends_estimate_id"`
DividendsEstimateId int64 `comment:"承接人分红预算记录ID" pg:",pk"`
// 分红结算状态
DividendsAccountStatus int32 `comment:"分红结算状态"`
// 分红金额
... ...
... ... @@ -8,7 +8,7 @@ import (
type DividendsIncentivesRule struct {
tableName string `comment:"金额激励规则实体" pg:"dividends_incentives_rules,alias:dividends_incentives_rule"`
// 分红规则ID
DividendsIncentivesRuleId int64 `comment:"分红规则ID" pg:",pk:dividends_incentives_rule_id"`
DividendsIncentivesRuleId int64 `comment:"分红规则ID" pg:",pk"`
// 关联的项目合约编号
CooperationContractNumber string `comment:"关联的项目合约编号"`
// 推荐人抽成比例
... ...
... ... @@ -8,7 +8,7 @@ import (
type DividendsOrder struct {
tableName string `comment:"分红订单实体" pg:"dividends_orders,alias:dividends_order"`
// 分红订单ID
DividendsOrderId int64 `comment:"分红订单ID" pg:"pk:dividends_order_id"`
DividendsOrderId int64 `comment:"分红订单ID" pg:",pk"`
// 分红订单号
DividendsOrderNumber string `comment:"分红订单号"`
// 分红订单原单号
... ...
... ... @@ -8,7 +8,7 @@ import (
type DividendsReturnedOrder struct {
tableName string `comment:"分红退货单实体" pg:"dividends_returned_orders,alias:dividends_returned_order"`
// 分红退货单记录ID
DividendsReturnedOrderId int64 `comment:"分红退货单记录ID" pg:"pk:dividends_returned_order_id"`
DividendsReturnedOrderId int64 `comment:"分红退货单记录ID" pg:",pk"`
// 分红退货单号
DividendsReturnedOrderNumber string `comment:"分红退货单号"`
// 退货金额
... ...
... ... @@ -8,7 +8,7 @@ import (
type MoneyIncentivesRule struct {
tableName string `comment:"金额激励规则实体" pg:"money_incentives_rules,alias:money_incentives_rule"`
// 金额激励规则ID
MoneyIncentivesRuleId int64 `comment:"金额激励规则ID" pg:",pk:money_incentives_rule_id"`
MoneyIncentivesRuleId int64 `comment:"金额激励规则ID" pg:",pk"`
// 关联的共创合约编号
CooperationContractNumber string `comment:"关联的共创合约编号"`
// 激励金额
... ...
... ... @@ -5,7 +5,7 @@ import "time"
type OrderGood struct {
tableName string `comment:"订单产品领域实体(包括分红订单、分红退货单)" pg:"order_goods,alias:order_good"`
// 订单产品
OrderGoodId int64 `comment:"订单产品" pg:"pk:order_good_id"`
OrderGoodId int64 `comment:"订单产品" pg:",pk"`
// 订单产品金额
OrderGoodAmount float64 `comment:"订单产品金额"`
// 订单产品名称
... ...
... ... @@ -13,20 +13,6 @@ func TransformToContractUndertakerFeedbackDomainModelFromPgModels(
FeedbackContent: contractUndertakerFeedbackModel.FeedbackContent,
CooperationContractNumber: contractUndertakerFeedbackModel.CooperationContractNumber,
ContractUndertaker: contractUndertakerFeedbackModel.ContractUndertaker,
//CooperationMode: &domain.CooperationMode{
// CooperationModeId: cooperationMode.CooperationModeId,
// CooperationModeNumber: cooperationMode.CooperationModeNumber,
// CooperationModeName: cooperationMode.CooperationModeName,
// Status: cooperationMode.Status,
// Org: cooperationMode.Org,
// Company: cooperationMode.Company,
// Remarks: cooperationMode.Remarks,
// Operator: cooperationMode.Operator,
// OperateTime: cooperationMode.OperateTime,
// UpdatedAt: cooperationMode.UpdatedAt,
// DeletedAt: cooperationMode.DeletedAt,
// CreatedAt: cooperationMode.CreatedAt,
//},
Org: contractUndertakerFeedbackModel.Org,
Company: contractUndertakerFeedbackModel.Company,
UpdatedAt: contractUndertakerFeedbackModel.UpdatedAt,
... ...
... ... @@ -71,11 +71,6 @@ func (controller *ContractUndertakerFeedbackController) SearchContractUndertaker
contractUndertakerFeedbackService := service.NewContractUndertakerFeedbackService(nil)
searchContractUndertakerFeedbackQuery := &query.SearchContractUndertakerFeedbackQuery{}
_ = controller.Unmarshal(searchContractUndertakerFeedbackQuery)
header := controller.GetRequestHeader(controller.Ctx)
searchContractUndertakerFeedbackQuery.CompanyId = header.CompanyId
searchContractUndertakerFeedbackQuery.OrgId = header.OrgId
searchContractUndertakerFeedbackQuery.UserId = header.UserId
searchContractUndertakerFeedbackQuery.UserBaseId = header.UserBaseId
data, err := contractUndertakerFeedbackService.SearchContractUndertakerFeedback(searchContractUndertakerFeedbackQuery)
controller.Response(data, err)
}
... ...
... ... @@ -137,15 +137,6 @@ func (controller *CooperationApplicationController) RemoveCooperationApplication
func (controller *CooperationApplicationController) SearchCooperationApplication() {
cooperationApplicationService := service.NewCooperationApplicationService(nil)
searchCooperationApplicationQuery := &query.SearchCooperationApplicationQuery{}
header := controller.GetRequestHeader(controller.Ctx)
searchCooperationApplicationQuery.CompanyId = header.CompanyId
searchCooperationApplicationQuery.OrgId = header.OrgId
searchCooperationApplicationQuery.UserId = header.UserId
searchCooperationApplicationQuery.UserBaseId = header.UserBaseId
pageSize, _ := controller.GetInt64("pageSize")
searchCooperationApplicationQuery.PageSize = pageSize
pageNumber, _ := controller.GetInt64("pageNumber")
searchCooperationApplicationQuery.PageNumber = pageNumber
data, err := cooperationApplicationService.SearchCooperationApplication(searchCooperationApplicationQuery)
controller.Response(data, err)
}
... ...
... ... @@ -87,11 +87,6 @@ func (controller *CooperationContractChangeLogController) SearchCooperationContr
cooperationContractChangeLogService := service.NewCooperationContractChangeLogService(nil)
searchCooperationContractChangeLogQuery := &query.SearchCooperationContractChangeLogQuery{}
_ = controller.Unmarshal(searchCooperationContractChangeLogQuery)
header := controller.GetRequestHeader(controller.Ctx)
searchCooperationContractChangeLogQuery.CompanyId = header.CompanyId
searchCooperationContractChangeLogQuery.OrgId = header.OrgId
searchCooperationContractChangeLogQuery.UserId = header.UserId
searchCooperationContractChangeLogQuery.UserBaseId = header.UserBaseId
data, err := cooperationContractChangeLogService.SearchCooperationContractChangeLog(searchCooperationContractChangeLogQuery)
controller.Response(data, err)
}
... ...
... ... @@ -122,15 +122,6 @@ func (controller *CooperationContractController) SearchCooperationContract() {
func (controller *CooperationContractController) SearchCooperationContractByUndertaker() {
cooperationContractService := service.NewCooperationContractService(nil)
searchCooperationContractByUndertakerQuery := &query.SearchCooperationContractByUndertakerQuery{}
header := controller.GetRequestHeader(controller.Ctx)
searchCooperationContractByUndertakerQuery.CompanyId = header.CompanyId
searchCooperationContractByUndertakerQuery.OrgId = header.OrgId
searchCooperationContractByUndertakerQuery.UserId = header.UserId
searchCooperationContractByUndertakerQuery.UserBaseId = header.UserBaseId
pageSize, _ := controller.GetInt64("pageSize")
searchCooperationContractByUndertakerQuery.PageSize = pageSize
pageNumber, _ := controller.GetInt64("pageNumber")
searchCooperationContractByUndertakerQuery.PageNumber = pageNumber
data, err := cooperationContractService.SearchCooperationContractByUndertaker(searchCooperationContractByUndertakerQuery)
controller.Response(data, err)
}
... ...
... ... @@ -84,11 +84,6 @@ func (controller *CooperationModeController) SearchCooperationMode() {
cooperationModeService := service.NewCooperationModeService(nil)
searchCooperationModeQuery := &query.SearchCooperationModeQuery{}
_ = controller.Unmarshal(searchCooperationModeQuery)
header := controller.GetRequestHeader(controller.Ctx)
searchCooperationModeQuery.CompanyId = header.CompanyId
searchCooperationModeQuery.OrgId = header.OrgId
searchCooperationModeQuery.UserId = header.UserId
searchCooperationModeQuery.UserBaseId = header.UserBaseId
data, err := cooperationModeService.SearchCooperationMode(searchCooperationModeQuery)
controller.Response(data, err)
}
... ...
... ... @@ -84,11 +84,6 @@ func (controller *CooperationProjectController) SearchCooperationProject() {
cooperationProjectService := service.NewCooperationProjectService(nil)
searchCooperationProjectQuery := &query.SearchCooperationProjectQuery{}
_ = controller.Unmarshal(searchCooperationProjectQuery)
header := controller.GetRequestHeader(controller.Ctx)
searchCooperationProjectQuery.CompanyId = header.CompanyId
searchCooperationProjectQuery.OrgId = header.OrgId
searchCooperationProjectQuery.UserId = header.UserId
searchCooperationProjectQuery.UserBaseId = header.UserBaseId
data, err := cooperationProjectService.SearchCooperationProject(searchCooperationProjectQuery)
controller.Response(data, err)
}
... ...
... ... @@ -70,11 +70,6 @@ func (controller *CreditAccountController) RemoveCreditAccount() {
func (controller *CreditAccountController) SearchCreditAccount() {
creditAccountService := service.NewCreditAccountService(nil)
searchCreditAccountQuery := &query.SearchCreditAccountQuery{}
header := controller.GetRequestHeader(controller.Ctx)
searchCreditAccountQuery.CompanyId = header.CompanyId
searchCreditAccountQuery.OrgId = header.OrgId
searchCreditAccountQuery.UserId = header.UserId
searchCreditAccountQuery.UserBaseId = header.UserBaseId
data, err := creditAccountService.SearchCreditAccount(searchCreditAccountQuery)
controller.Response(data, err)
}
... ...
... ... @@ -106,15 +106,6 @@ func (controller *DividendsEstimateController) SearchDividendsEstimate() {
dividendsEstimateService := service.NewDividendsEstimateService(nil)
searchDividendsEstimateQuery := &query.SearchDividendsEstimateQuery{}
_ = controller.Unmarshal(searchDividendsEstimateQuery)
header := controller.GetRequestHeader(controller.Ctx)
searchDividendsEstimateQuery.CompanyId = header.CompanyId
searchDividendsEstimateQuery.OrgId = header.OrgId
searchDividendsEstimateQuery.UserId = header.UserId
searchDividendsEstimateQuery.UserBaseId = header.UserBaseId
pageSize, _ := controller.GetInt64("pageSize")
searchDividendsEstimateQuery.PageSize = pageSize
pageNumber, _ := controller.GetInt64("pageNumber")
searchDividendsEstimateQuery.PageNumber = pageNumber
data, err := dividendsEstimateService.SearchDividendsEstimate(searchDividendsEstimateQuery)
controller.Response(data, err)
}
... ...
... ... @@ -84,11 +84,6 @@ func (controller *DividendsOrderController) SearchDividendsOrder() {
dividendsOrderService := service.NewDividendsOrderService(nil)
searchDividendsOrderQuery := &query.SearchDividendsOrderQuery{}
_ = controller.Unmarshal(searchDividendsOrderQuery)
header := controller.GetRequestHeader(controller.Ctx)
searchDividendsOrderQuery.CompanyId = header.CompanyId
searchDividendsOrderQuery.OrgId = header.OrgId
searchDividendsOrderQuery.UserId = header.UserId
searchDividendsOrderQuery.UserBaseId = header.UserBaseId
data, err := dividendsOrderService.SearchDividendsOrder(searchDividendsOrderQuery)
controller.Response(data, err)
}
... ...
... ... @@ -84,11 +84,6 @@ func (controller *DividendsReturnedOrderController) SearchDividendsReturnedOrder
dividendsReturnedOrderService := service.NewDividendsReturnedOrderService(nil)
searchDividendsReturnedOrderQuery := &query.SearchDividendsReturnedOrderQuery{}
_ = controller.Unmarshal(searchDividendsReturnedOrderQuery)
header := controller.GetRequestHeader(controller.Ctx)
searchDividendsReturnedOrderQuery.CompanyId = header.CompanyId
searchDividendsReturnedOrderQuery.OrgId = header.OrgId
searchDividendsReturnedOrderQuery.UserId = header.UserId
searchDividendsReturnedOrderQuery.UserBaseId = header.UserBaseId
data, err := dividendsReturnedOrderService.SearchDividendsReturnedOrder(searchDividendsReturnedOrderQuery)
controller.Response(data, err)
}
... ...