切换导航条
此项目
正在载入...
登录
allied-creation
/
allied-creation-gateway
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
差异文件
浏览文件
作者
yangfu
3 years ago
提交
05d818ca19fd21da8d651eab04d191a864b70d6b
2 个父辈
ac4cc085
d8364328
Merge branch 'dev' of
http://gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway
into dev
隐藏空白字符变更
内嵌
并排对比
正在显示
12 个修改的文件
包含
109 行增加
和
51 行删除
pkg/application/mobile/cooperation/service/cooperation_applications.go
pkg/application/web/contractChangeLog/dto/dto.go
pkg/application/web/contractChangeLog/service/service.go
pkg/application/web/cooperationMode/service/cooperation_mode.go
pkg/application/web/cooperationProject/query/cooperation_project_selector.go
pkg/application/web/cooperationProject/service/cooperation_project.go
pkg/infrastructure/service_gateway/allied_creation_cooperation/param_cooperation_application.go
pkg/infrastructure/service_gateway/allied_creation_cooperation/param_cooperation_mode.go
pkg/infrastructure/service_gateway/allied_creation_cooperation/param_cooperation_project.go
pkg/port/beego/controllers/web_client/contract_change_log_controller.go
pkg/port/beego/controllers/web_client/excel_data_controller.go
pkg/port/beego/routers/web_contract_change_log.go
pkg/application/mobile/cooperation/service/cooperation_applications.go
查看文件 @
05d818c
...
...
@@ -180,9 +180,9 @@ func (srv CooperationApplicationsService) CooperationApplicationsOneclickApprova
auditCommand
.
Operator
)
_
,
err
:=
creationCooperationGateway
.
CooperationApplicationsOneclickApproval
(
allied_creation_cooperation
.
ReqCooperationApplicationOneclickApproval
{
CooperationApplicationDescription
:
auditCommand
.
CooperationApplicationVerifyDescription
,
Action
:
auditCommand
.
CooperationApplicationStatus
,
Code
:
"a1-2"
,
CooperationApplicationVerifyDescription
:
auditCommand
.
CooperationApplicationVerifyDescription
,
Action
:
auditCommand
.
CooperationApplicationStatus
,
Code
:
"a1-2"
,
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
BUSINESS_ERROR
,
err
.
Error
())
...
...
pkg/application/web/contractChangeLog/dto/dto.go
0 → 100644
查看文件 @
05d818c
package
dto
import
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
type
ContractChangeLogItem
struct
{
CooperationContractNumber
string
`json:"cooperationContractNumber"`
CreatedAt
string
`json:"createdAt"`
IncentivesRule
string
`json:"incentivesRule"`
IncentivesRuleDetail
string
`json:"incentivesRuleDetail"`
Operation
string
`json:"operation"`
OperationType
int
`json:"operationType"`
Undertakers
string
`json:"undertakers"`
UpdatedAt
string
`json:"updatedAt"`
}
func
ToContractChangeLogList
(
param
*
allied_creation_cooperation
.
DataContractChangeLogsSearch
)
[]
ContractChangeLogItem
{
listData
:=
[]
ContractChangeLogItem
{}
for
_
,
v
:=
range
param
.
Grid
.
List
{
item
:=
ContractChangeLogItem
{
CooperationContractNumber
:
v
.
CooperationContractNumber
,
CreatedAt
:
v
.
CreatedAt
.
Format
(
"2006-01-02 15:04:05"
),
IncentivesRule
:
v
.
IncentivesRule
,
IncentivesRuleDetail
:
v
.
IncentivesRuleDetail
,
Operation
:
v
.
Operator
.
UserName
,
OperationType
:
int
(
v
.
OperationType
),
Undertakers
:
v
.
Undertakers
,
UpdatedAt
:
v
.
UpdatedAt
.
Format
(
"2006-01-02 15:04:05"
),
}
listData
=
append
(
listData
,
item
)
}
return
listData
}
...
...
pkg/application/web/contractChangeLog/service/service.go
查看文件 @
05d818c
package
service
import
(
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/contractChangeLog/dto"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/contractChangeLog/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
...
...
@@ -12,7 +13,7 @@ func NewContractChangeLogService(options map[string]interface{}) *ContractChange
return
newContractChangeLogService
}
func
(
srv
ContractChangeLogService
)
ContractChangeLogSearch
(
queryParam
*
query
.
ListContractChangeLogQuery
)
(
interface
{},
error
)
{
func
(
srv
ContractChangeLogService
)
ContractChangeLogSearch
(
queryParam
*
query
.
ListContractChangeLogQuery
)
(
int
,
int
erface
{},
error
)
{
creationCooperationGateway
:=
allied_creation_cooperation
.
NewHttplibAlliedCreationCooperation
(
queryParam
.
Operator
)
result
,
err
:=
creationCooperationGateway
.
CooperationContractChangeLogsSearch
(
allied_creation_cooperation
.
ReqContractChangeLogsSearch
{
PageNumber
:
queryParam
.
PageNumber
,
...
...
@@ -20,5 +21,6 @@ func (srv ContractChangeLogService) ContractChangeLogSearch(queryParam *query.Li
CooperationContractNumber
:
queryParam
.
CooperationContractNumber
,
OperationType
:
queryParam
.
OperationType
,
})
return
result
,
err
listData
:=
dto
.
ToContractChangeLogList
(
result
)
return
result
.
Grid
.
Total
,
listData
,
err
}
...
...
pkg/application/web/cooperationMode/service/cooperation_mode.go
查看文件 @
05d818c
...
...
@@ -66,6 +66,7 @@ func (cooperationModeService *CooperationModeService) ListCooperationMode(listCo
OrganizationName
:
listCooperationModeQuery
.
OrganizationName
,
CompanyId
:
listCooperationModeQuery
.
Operator
.
CompanyId
,
UserId
:
0
,
OrgIds
:
listCooperationModeQuery
.
Operator
.
OrgIds
,
OrgId
:
0
,
UserBaseId
:
0
,
})
...
...
pkg/application/web/cooperationProject/query/cooperation_project_selector.go
查看文件 @
05d818c
...
...
@@ -7,5 +7,5 @@ import (
type
CooperationProjectSelectorQuery
struct
{
//操作人
Operator
domain
.
Operator
`json:"-"`
MatchCooperationProjectNumber
string
`json:"matchCooperationProjectNumber"`
//匹配项目编号
MatchCooperationProjectNumber
string
`json:"matchCooperationProjectNumber"`
//匹配项目编号
matchCooperationProjectNumber
}
...
...
pkg/application/web/cooperationProject/service/cooperation_project.go
查看文件 @
05d818c
...
...
@@ -102,6 +102,7 @@ func (cooperationProjectService *CooperationProjectService) ListCooperationProje
//项目名
CooperationProjectName
:
listCooperationProjectQuery
.
CooperationProjectName
,
CompanyId
:
listCooperationProjectQuery
.
Operator
.
CompanyId
,
OrgIds
:
listCooperationProjectQuery
.
Operator
.
OrgIds
,
})
if
err
!=
nil
{
return
0
,
nil
,
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
err
.
Error
())
...
...
@@ -146,16 +147,11 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro
func
(
cooperationProjectService
*
CooperationProjectService
)
ListCooperationProjectSelector
(
listCooperationProjectQuery
*
query
.
CooperationProjectSelectorQuery
)
(
int64
,
interface
{},
error
)
{
creationCooperationGateway
:=
allied_creation_cooperation
.
NewHttplibAlliedCreationCooperation
(
listCooperationProjectQuery
.
Operator
)
orgIds
:=
[]
string
{}
for
_
,
v
:=
range
listCooperationProjectQuery
.
Operator
.
OrgIds
{
idStr
:=
strconv
.
Itoa
(
int
(
v
))
orgIds
=
append
(
orgIds
,
idStr
)
}
result
,
err
:=
creationCooperationGateway
.
CooperationProjectsSearch
(
allied_creation_cooperation
.
ReqCooperationProjectSearch
{
PageSize
:
999
,
CooperationProjectNumber
:
listCooperationProjectQuery
.
MatchCooperationProjectNumber
,
CompanyId
:
listCooperationProjectQuery
.
Operator
.
CompanyId
,
OrgIds
:
o
rgIds
,
OrgIds
:
listCooperationProjectQuery
.
Operator
.
O
rgIds
,
})
if
err
!=
nil
{
return
0
,
nil
,
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
err
.
Error
())
...
...
pkg/infrastructure/service_gateway/allied_creation_cooperation/param_cooperation_application.go
查看文件 @
05d818c
...
...
@@ -223,9 +223,9 @@ type (
//共创申请一键审核
type
(
ReqCooperationApplicationOneclickApproval
struct
{
CooperationApplicationDescription
string
`json:"cooperationApplicationDescription"`
//审核描述
Action
int
`json:"action"`
//审核动作,1同意,2拒绝
Code
string
`cname:"菜单编码" json:"code" valid:"Required"`
CooperationApplicationVerifyDescription
string
`json:"cooperationApplicationVerifyDescription"`
//审核描述
Action
int
`json:"action"`
//审核动作,1同意,2拒绝
Code
string
`cname:"菜单编码" json:"code" valid:"Required"`
}
DataCooperationApplicationOneclickApproval
struct
{
...
...
pkg/infrastructure/service_gateway/allied_creation_cooperation/param_cooperation_mode.go
查看文件 @
05d818c
...
...
@@ -160,11 +160,12 @@ type (
//模式名称
CooperationModeName
string
`json:"cooperationModeName"`
//组织名称
OrganizationName
string
`json:"organizationName"`
CompanyId
int64
`json:"companyId"`
OrgId
int64
`json:"orgId"`
UserId
int64
`json:"userId"`
UserBaseId
int64
`json:"userBaseId"`
OrganizationName
string
`json:"organizationName"`
CompanyId
int64
`json:"companyId"`
OrgId
int64
`json:"orgId"`
UserId
int64
`json:"userId"`
UserBaseId
int64
`json:"userBaseId"`
OrgIds
[]
int64
`json:"orgIds"`
//模式编码列表
CooperationModeNumbers
[]
string
`cname:"模式编码列表" json:"cooperationModeNumbers,omitempty"`
}
...
...
pkg/infrastructure/service_gateway/allied_creation_cooperation/param_cooperation_project.go
查看文件 @
05d818c
...
...
@@ -157,10 +157,10 @@ type (
// 共创项目状态,1招标中,2结束 0 全部
Status
int
`json:"status"`
// 组织机构ID
OrgId
int64
`cname:"组织机构ID" json:"orgId"`
OrgIds
[]
string
`json:"orgIds"`
CompanyId
int64
`json:"companyId"`
CooperationProjectNumber
string
`json:"cooperationProjectNumber"`
OrgId
int64
`cname:"组织机构ID" json:"orgId"`
OrgIds
[]
int64
`json:"orgIds"`
CompanyId
int64
`json:"companyId"`
CooperationProjectNumber
string
`json:"cooperationProjectNumber"`
//OffsetLimitFlag bool `json:"offsetLimitFlag"`
// 用户基础数据id
UserBaseId
int64
`cname:"用户基础数据ID" json:"userBaseId"`
...
...
pkg/port/beego/controllers/web_client/contract_change_log_controller.go
查看文件 @
05d818c
...
...
@@ -20,6 +20,6 @@ func (controller *ContractChangeLogController) ContractChangeLogSearch() {
return
}
listContractChangeLogQuery
.
Operator
=
controller
.
GetOperator
()
data
,
err
:=
cooperationContractService
.
ContractChangeLogSearch
(
listContractChangeLogQuery
)
controller
.
Response
(
data
,
err
)
cnt
,
listData
,
err
:=
cooperationContractService
.
ContractChangeLogSearch
(
listContractChangeLogQuery
)
controller
.
ReturnPageListData
(
int64
(
cnt
),
listData
,
err
,
listContractChangeLogQuery
.
PageNumber
)
}
...
...
pkg/port/beego/controllers/web_client/excel_data_controller.go
查看文件 @
05d818c
package
web_client
import
(
"
gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/excelData/command
"
"
errors
"
"path/filepath"
"strings"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/excelData/command"
"github.com/beego/beego/v2/server/web/context"
"github.com/linmadan/egglib-go/utils/excel"
...
...
@@ -29,6 +32,17 @@ func (controller *ExcelDataController) responseExcelByFile(ctx *context.Context,
return
nil
}
func
(
controller
*
ExcelDataController
)
fieldValueAllEmpty
(
param
map
[
string
]
string
)
bool
{
isAllEmpty
:=
true
for
_
,
v
:=
range
param
{
value
:=
strings
.
TrimSpace
(
v
)
if
len
(
value
)
>
0
{
isAllEmpty
=
false
}
}
return
isAllEmpty
}
//导出公司用户
func
(
controller
ExcelDataController
)
ExportCompanyUser
()
{
excelService
:=
service
.
NewExcelDataService
(
nil
)
...
...
@@ -91,12 +105,14 @@ func (controller ExcelDataController) ImportDividendsOrder() {
controller
.
Response
(
nil
,
err
)
return
}
if
filepath
.
Ext
(
fileHeader
.
Filename
)
==
"
"
{
if
filepath
.
Ext
(
fileHeader
.
Filename
)
!=
".xlsx
"
{
//TODO 判断文件类型
log
.
Logger
.
Error
(
"获取到的文件:"
+
fileHeader
.
Filename
)
controller
.
Response
(
nil
,
errors
.
New
(
"上传到的文件类型错误"
))
return
}
excelImport
:=
excel
.
NewExcelImport
()
excelImport
.
RowBegin
=
3
//第三
行开始读取
excelImport
.
RowBegin
=
2
//第2
行开始读取
excelImport
.
DataFields
=
[]
excel
.
DataField
{
{
EnName
:
"OriginalOrderNum"
,
CnName
:
"*来源单号"
},
{
EnName
:
"DividendsCustomerName"
,
CnName
:
"*客户名称"
},
...
...
@@ -117,17 +133,21 @@ func (controller ExcelDataController) ImportDividendsOrder() {
//订单数据
var
returnedOrderData
[]
allied_creation_cooperation
.
ImportDividendsOrderData
for
_
,
v
:=
range
excelData
{
if
allEmpty
:=
controller
.
fieldValueAllEmpty
(
v
);
allEmpty
{
//以全字段空跳过
continue
}
//TODO 按需转化
item
:=
allied_creation_cooperation
.
ImportDividendsOrderData
{
OriginalOrderNum
:
v
[
"OriginalOrderNum"
],
DividendsCustomerName
:
v
[
"DividendsCustomerName"
],
OrderGoodName
:
v
[
"OrderGoodName"
],
OrderTime
:
v
[
"OrderTime"
],
RegionName
:
v
[
"RegionName"
],
OrderGoodQuantity
:
v
[
"OrderGoodQuantity"
],
OrderGoodPrice
:
v
[
"OrderGoodPrice"
],
Expense
:
v
[
"Expense"
],
CooperationContractNumber
:
v
[
"CooperationContractNumber"
],
OriginalOrderNum
:
strings
.
TrimSpace
(
v
[
"OriginalOrderNum"
]),
DividendsCustomerName
:
strings
.
TrimSpace
(
v
[
"DividendsCustomerName"
]),
OrderGoodName
:
strings
.
TrimSpace
(
v
[
"OrderGoodName"
]),
OrderTime
:
strings
.
TrimSpace
(
v
[
"OrderTime"
]),
RegionName
:
strings
.
TrimSpace
(
v
[
"RegionName"
]),
OrderGoodQuantity
:
strings
.
TrimSpace
(
v
[
"OrderGoodQuantity"
]),
OrderGoodPrice
:
strings
.
TrimSpace
(
v
[
"OrderGoodPrice"
]),
Expense
:
strings
.
TrimSpace
(
v
[
"Expense"
]),
CooperationContractNumber
:
strings
.
TrimSpace
(
v
[
"CooperationContractNumber"
]),
}
returnedOrderData
=
append
(
returnedOrderData
,
item
)
}
...
...
@@ -150,12 +170,14 @@ func (controller ExcelDataController) ImportDividendsReturnedOrder() {
controller
.
Response
(
nil
,
err
)
return
}
if
filepath
.
Ext
(
fileHeader
.
Filename
)
==
"
"
{
if
filepath
.
Ext
(
fileHeader
.
Filename
)
!=
".xlsx
"
{
//TODO 判断文件类型
log
.
Logger
.
Error
(
"获取到的文件:"
+
fileHeader
.
Filename
)
log
.
Logger
.
Error
(
"获取到的文件:"
+
filepath
.
Ext
(
fileHeader
.
Filename
))
controller
.
Response
(
nil
,
errors
.
New
(
"上传的文件类型错误"
))
return
}
excelImport
:=
excel
.
NewExcelImport
()
excelImport
.
RowBegin
=
3
//第三行
开始读取
excelImport
.
RowBegin
=
2
//第2行表头
开始读取
excelImport
.
DataFields
=
[]
excel
.
DataField
{
{
EnName
:
"OriginalOrderNum"
,
CnName
:
"*来源单号"
},
{
EnName
:
"DividendsReturnedCustomerName"
,
CnName
:
"*客户名称"
},
...
...
@@ -176,17 +198,21 @@ func (controller ExcelDataController) ImportDividendsReturnedOrder() {
//退货单数据
returnedOrderData
:=
[]
allied_creation_cooperation
.
ImportDividendsReturnedOrderData
{}
for
_
,
v
:=
range
excelData
{
if
allEmpty
:=
controller
.
fieldValueAllEmpty
(
v
);
allEmpty
{
//以全字段空跳过
continue
}
//TODO 按需转化
item
:=
allied_creation_cooperation
.
ImportDividendsReturnedOrderData
{
OriginalOrderNum
:
v
[
"OriginalOrderNum"
],
DividendsReturnedCustomerName
:
v
[
"DividendsReturnedCustomerName"
],
OrderGoodName
:
v
[
"OrderGoodName"
],
DividendsReturnedDate
:
v
[
"DividendsReturnedDate"
],
OrderTime
:
v
[
"OrderTime"
],
RegionName
:
v
[
"RegionName"
],
OrderGoodQuantity
:
v
[
"OrderGoodQuantity"
],
OrderGoodPrice
:
v
[
"OrderGoodPrice"
],
CooperationContractNumber
:
v
[
"CooperationContractNumber"
],
OriginalOrderNum
:
strings
.
TrimSpace
(
v
[
"OriginalOrderNum"
]),
DividendsReturnedCustomerName
:
strings
.
TrimSpace
(
v
[
"DividendsReturnedCustomerName"
]),
OrderGoodName
:
strings
.
TrimSpace
(
v
[
"OrderGoodName"
]),
DividendsReturnedDate
:
strings
.
TrimSpace
(
v
[
"DividendsReturnedDate"
]),
OrderTime
:
strings
.
TrimSpace
(
v
[
"OrderTime"
]),
RegionName
:
strings
.
TrimSpace
(
v
[
"RegionName"
]),
OrderGoodQuantity
:
strings
.
TrimSpace
(
v
[
"OrderGoodQuantity"
]),
OrderGoodPrice
:
strings
.
TrimSpace
(
v
[
"OrderGoodPrice"
]),
CooperationContractNumber
:
strings
.
TrimSpace
(
v
[
"CooperationContractNumber"
]),
}
returnedOrderData
=
append
(
returnedOrderData
,
item
)
}
...
...
pkg/port/beego/routers/web_contract_change_log.go
查看文件 @
05d818c
...
...
@@ -6,5 +6,5 @@ import (
)
func
init
()
{
web
.
Router
(
"/v1/web/contract-change-logs/search"
,
&
web_client
.
ContractChangeLogController
{},
"P
u
t:ContractChangeLogSearch"
)
web
.
Router
(
"/v1/web/contract-change-logs/search"
,
&
web_client
.
ContractChangeLogController
{},
"P
os
t:ContractChangeLogSearch"
)
}
...
...
请
注册
或
登录
后发表评论