作者 Your Name

Merge branch 'test' of http://gitlab.fjmaimaimai.com/allied-creation/allied-crea…

…tion-gateway into test
FROM 192.168.0.243:5000/mmm/allied-creation-gateway:20210809
ENV APP_DIR $GOPATH/src/project-20210909
ENV APP_DIR $GOPATH/src/project-20210916
RUN mkdir -p $APP_DIR
WORKDIR $APP_DIR/
COPY ./pkg pkg
... ...
... ... @@ -124,8 +124,8 @@ func (srv CompanyCreditAccountService) CreditAccountPaySearch(cmd *command.Credi
PageSize: cmd.PageSize,
PaymentStatus: 2,
OrgId: cmd.Operator.OrgId,
BeginTime: beginTime,
EndTime: endTime,
PaymentBeginTime: beginTime,
PaymentEndTime: endTime,
CooperationContractNumbers: cooperationContractNumbers,
}
resultMenu, err := gateway.CreditAccountsSearch(req)
... ... @@ -137,10 +137,10 @@ func (srv CompanyCreditAccountService) CreditAccountPaySearch(cmd *command.Credi
"cooperationContractNumbers": cooperationContractNumbers,
}
if cmd.BeginTime > 0 {
queryOptions["beginTime"] = beginTime
queryOptions["paymentBeginTime"] = beginTime
}
if cmd.EndTime > 0 {
queryOptions["endTime"] = endTime
queryOptions["paymentEndTime"] = endTime
}
// 2.分红统计
dividendStatisticsResult, err := gateway.CooperationStatistics(allied_creation_cooperation.CreditAccountStatistics, queryOptions)
... ... @@ -200,10 +200,10 @@ func (srv CompanyCreditAccountService) PaymentHistoryStatistics(cmd *command.Cre
"sortByActuallyPaidAmount": 2,
}
if cmd.BeginTime > 0 {
queryOptions["beginTime"] = time.Unix(cmd.BeginTime/1000, 0)
queryOptions["paymentBeginTime"] = time.Unix(cmd.BeginTime/1000, 0)
}
if cmd.EndTime > 0 {
queryOptions["endTime"] = time.Unix(cmd.EndTime/1000, 0)
queryOptions["paymentEndTime"] = time.Unix(cmd.EndTime/1000, 0)
}
cooperationUsersStatistics, err := gateway.CooperationStatistics(allied_creation_cooperation.CompanyPaymentHistoryStatistics, queryOptions)
if err != nil {
... ...
... ... @@ -25,12 +25,12 @@ func (srv PersonCreditAccountService) CreditAccountPaySearch(cmd *command.Credit
endTime = time.Unix(cmd.EndTime/1000, 0)
}
resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
PageNumber: cmd.PageNumber + 1, //手机序号从0开始的
PageSize: cmd.PageSize,
PaymentStatus: 2,
UserBaseId: cmd.Operator.UserBaseId,
BeginTime: beginTime,
EndTime: endTime,
PageNumber: cmd.PageNumber + 1, //手机序号从0开始的
PageSize: cmd.PageSize,
PaymentStatus: 2,
UserBaseId: cmd.Operator.UserBaseId,
PaymentBeginTime: beginTime,
PaymentEndTime: endTime,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
... ... @@ -39,10 +39,10 @@ func (srv PersonCreditAccountService) CreditAccountPaySearch(cmd *command.Credit
"userBaseId": cmd.Operator.UserBaseId,
}
if cmd.BeginTime > 0 {
queryOptions["beginTime"] = beginTime
queryOptions["paymentBeginTime"] = beginTime
}
if cmd.EndTime > 0 {
queryOptions["endTime"] = endTime
queryOptions["paymentEndTime"] = endTime
}
// 2.分红统计
dividendStatisticsResult, err := gateway.CooperationStatistics(allied_creation_cooperation.CreditAccountStatistics, queryOptions)
... ... @@ -85,10 +85,10 @@ func (srv PersonCreditAccountService) PaymentHistoryStatistics(cmd *command.Cred
"sortByActuallyPaidAmount": 2,
}
if cmd.BeginTime > 0 {
queryOptions["beginTime"] = time.Unix(cmd.BeginTime/1000, 0)
queryOptions["paymentBeginTime"] = time.Unix(cmd.BeginTime/1000, 0)
}
if cmd.EndTime > 0 {
queryOptions["endTime"] = time.Unix(cmd.EndTime/1000, 0)
queryOptions["paymentEndTime"] = time.Unix(cmd.EndTime/1000, 0)
}
cooperationUsersStatistics, err := gateway.CooperationStatistics(allied_creation_cooperation.PersonCompanyPaymentHistoryStatistics, queryOptions)
if err != nil {
... ...
... ... @@ -227,7 +227,7 @@ func (srv ExcelDataService) ImportCompanyUser(importDataCommand *command.ImportD
func (srv ExcelDataService) ImportOrganization(importDataCommand *command.ImportDataCommand) (interface{}, error) {
excelImport := excel.NewExcelImport()
excelImport.RowBegin = 2 //第二行开始读取
excelImport.RowBegin = 3 //第二行开始读取
excelImport.DataFields = []excel.DataField{
{EnName: "OrgCode", CnName: "*部门编码"},
{EnName: "OrgName", CnName: "*部门名称"},
... ... @@ -286,9 +286,10 @@ func (srv ExcelDataService) FileImportTemplate(importDataCommand *command.Import
var mapTemplate = map[string]string{
domain.TemplateCompanyUser: "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/dev_online/20210909/object/1631171021_baB6y5zdpwC2WnsHFQhKC3dkQEaAYMNZ.xlsx",
// 模板待更新
domain.TemplateOrganization: "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/dev_online/20210909/object/1631171021_baB6y5zdpwC2WnsHFQhKC3dkQEaAYMNZ.xlsx",
domain.TemplateCooperationUser: "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/dev_online/20210909/object/1631171021_baB6y5zdpwC2WnsHFQhKC3dkQEaAYMNZ.xlsx",
domain.TemplateDividendsOrders: "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/dev_online/20210909/object/1631171021_baB6y5zdpwC2WnsHFQhKC3dkQEaAYMNZ.xlsx",
domain.TemplateOrganization: "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/dev_online/20210909/object/1631171021_baB6y5zdpwC2WnsHFQhKC3dkQEaAYMNZ.xlsx",
domain.TemplateCooperationUser: "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/dev_online/20210909/object/1631171021_baB6y5zdpwC2WnsHFQhKC3dkQEaAYMNZ.xlsx",
domain.TemplateDividendsOrders: "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/dev_online/20210909/object/1631171021_baB6y5zdpwC2WnsHFQhKC3dkQEaAYMNZ.xlsx",
domain.ImportDividendsReturnOrders: "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/dev_online/20210909/object/1631171021_baB6y5zdpwC2WnsHFQhKC3dkQEaAYMNZ.xlsx",
}
var url string
var ok bool
... ...
... ... @@ -51,25 +51,29 @@ const (
const (
// 导入公司用户
ImportCompanyUser = "ImportCompanyUser"
ImportCompanyUser = "ADMIN_SYSTEM-MANAGE_BASE_USER"
// 导入公司组织
ImportOrganization = "ImportOrganization"
// 导入共创用户
ImportCooperationUser = "ImportCooperationUser"
ImportCooperationUser = "ADMIN_SYSTEM-MANAGE_BASE_ALLIED-USER"
// 导入分红订单
ImportDividendsOrders = "ImportDividendsOrders"
ImportDividendsOrders = "BUSINESS_ALLIED-CREATION_BONUS_ORDER"
// 导入退货订单
ImportDividendsReturnOrders = "BUSINESS_ALLIED-CREATION_BONUS_RETURN"
)
//excel 导入模板
const (
// 导入公司用户
TemplateCompanyUser = "TemplateCompanyUser"
TemplateCompanyUser = "ADMIN_SYSTEM-MANAGE_BASE_USER"
// 导入公司组织
TemplateOrganization = "TemplateOrganization"
// 导入共创用户
TemplateCooperationUser = "TemplateCooperationUser"
TemplateCooperationUser = "ADMIN_SYSTEM-MANAGE_BASE_ALLIED-USER"
// 分红订单模板
TemplateDividendsOrders = "TemplateDividendsOrders"
TemplateDividendsOrders = "BUSINESS_ALLIED-CREATION_BONUS_ORDER"
// 导入退货订单
TemplateDividendsReturnOrders = "BUSINESS_ALLIED-CREATION_BONUS_RETURN"
)
... ...
... ... @@ -90,6 +90,10 @@ type (
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
BeginTime time.Time `json:"beginTime"`
EndTime time.Time `json:"endTime"`
// 支付开始时间
PaymentBeginTime time.Time `json:"paymentBeginTime"`
// 支付结束时间
PaymentEndTime time.Time `json:"paymentEndTime"`
// 合约编号列表
CooperationContractNumbers []string `json:"cooperationContractNumbers"`
}
... ...
... ... @@ -44,7 +44,7 @@ func (controller *ExcelDataController) fieldValueAllEmpty(param map[string]strin
}
//导出公司用户
func (controller *ExcelDataController) ExportCompanyUser() {
func (controller ExcelDataController) ExportCompanyUser() {
excelService := service.NewExcelDataService(nil)
companyUserListQuery := &query.CompanyUserListQuery{}
err := controller.Unmarshal(companyUserListQuery)
... ... @@ -71,7 +71,7 @@ func (controller *ExcelDataController) ExportCompanyUser() {
}
//导出共创用户
func (controller *ExcelDataController) ExportCooperationUser() {
func (controller ExcelDataController) ExportCooperationUser() {
excelService := service.NewExcelDataService(nil)
companyUserListQuery := &query.CompanyUserListQuery{}
err := controller.Unmarshal(companyUserListQuery)
... ... @@ -98,11 +98,11 @@ func (controller *ExcelDataController) ExportCooperationUser() {
}
// ImportDividendsOrder TODO 导入分红订单
func (controller *ExcelDataController) ImportDividendsOrder() {
func (controller ExcelDataController) ImportDividendsOrder() {
importDividendsOrder(controller)
}
func importDividendsOrder(controller *ExcelDataController) {
func importDividendsOrder(controller ExcelDataController) {
fileReader, err := controller.GetExcelFile()
if err != nil {
... ... @@ -110,7 +110,7 @@ func importDividendsOrder(controller *ExcelDataController) {
return
}
excelImport := excel.NewExcelImport()
excelImport.RowBegin = 2 //第2行开始读取
excelImport.RowBegin = 3 //第2行开始读取
excelImport.DataFields = []excel.DataField{
{EnName: "OriginalOrderNum", CnName: "*来源单号"},
{EnName: "DividendsCustomerName", CnName: "*客户名称"},
... ... @@ -161,11 +161,11 @@ func importDividendsOrder(controller *ExcelDataController) {
}
// ImportDividendsReturnedOrder 导入分红退货单
func (controller *ExcelDataController) ImportDividendsReturnedOrder() {
func (controller ExcelDataController) ImportDividendsReturnedOrder() {
importDividendsReturnedOrder(controller)
}
func importDividendsReturnedOrder(controller *ExcelDataController) {
func importDividendsReturnedOrder(controller ExcelDataController) {
fileReader, err := controller.GetExcelFile()
if err != nil {
... ... @@ -173,7 +173,7 @@ func importDividendsReturnedOrder(controller *ExcelDataController) {
return
}
excelImport := excel.NewExcelImport()
excelImport.RowBegin = 2 //第2行表头开始读取
excelImport.RowBegin = 3 //第2行表头开始读取
excelImport.DataFields = []excel.DataField{
{EnName: "OriginalOrderNum", CnName: "*来源单号"},
{EnName: "DividendsReturnedCustomerName", CnName: "*客户名称"},
... ... @@ -223,10 +223,10 @@ func importDividendsReturnedOrder(controller *ExcelDataController) {
controller.Response(result, nil)
}
func (controller *ExcelDataController) ImportCompanyUser() {
func (controller ExcelDataController) ImportCompanyUser() {
importCompanyUser(controller)
}
func importCompanyUser(controller *ExcelDataController) {
func importCompanyUser(controller ExcelDataController) {
excelService := service.NewExcelDataService(nil)
r, err := controller.GetExcelFile()
if err != nil {
... ... @@ -240,10 +240,10 @@ func importCompanyUser(controller *ExcelDataController) {
controller.Response(data, err)
}
func (controller *ExcelDataController) ImportCooperationUser() {
func (controller ExcelDataController) ImportCooperationUser() {
importCooperationUser(controller)
}
func importCooperationUser(controller *ExcelDataController) {
func importCooperationUser(controller ExcelDataController) {
excelService := service.NewExcelDataService(nil)
r, err := controller.GetExcelFile()
if err != nil {
... ... @@ -257,7 +257,7 @@ func importCooperationUser(controller *ExcelDataController) {
controller.Response(data, err)
}
func (controller *ExcelDataController) ImportOrganization() {
func importOrganization(controller ExcelDataController) {
excelService := service.NewExcelDataService(nil)
r, err := controller.GetExcelFile()
if err != nil {
... ... @@ -271,7 +271,11 @@ func (controller *ExcelDataController) ImportOrganization() {
controller.Response(data, err)
}
func (controller *ExcelDataController) FileImport() {
func (controller ExcelDataController) ImportOrganization() {
importOrganization(controller)
}
func (controller ExcelDataController) FileImport() {
// excelService := service.NewExcelDataService(nil)
// r, err := controller.GetExcelFile()
// if err != nil {
... ... @@ -295,13 +299,15 @@ func (controller *ExcelDataController) FileImport() {
importCooperationUser(controller)
case domain.ImportDividendsOrders:
importDividendsOrder(controller)
case domain.ImportOrganization:
case domain.ImportDividendsReturnOrders:
importDividendsReturnedOrder(controller)
case domain.ImportOrganization:
importOrganization(controller)
}
// controller.Response(data, err)
}
func (controller *ExcelDataController) FileImportTemplate() {
func (controller ExcelDataController) FileImportTemplate() {
excelService := service.NewExcelDataService(nil)
cmd := &command.ImportDataCommand{}
... ...