作者 庄敏学

合并分支 'dev' 到 'test'

成本导入



查看合并请求 !17
... ... @@ -365,7 +365,7 @@ func (srv ExcelDataService) ImportCost(importDataCommand *command.ImportDataComm
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return srv.importResultWithHeader(excelImport.DataFields, *result, len(createCostManagemant.CostManagemants)), nil
return result.Data, nil
}
// 导入结果
... ...
package cost_structured
import (
"encoding/json"
"fmt"
"strings"
"time"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
... ... @@ -36,12 +38,30 @@ func (gateway HttpLibCostStructured) BaseUrl() string {
}
//批量添加成本管理
func (gateway HttpLibCostStructured) BatchCreateCostManagemant(param BatchAddCostManagemantRequest) (*BatchAddCostManagemantResponse, error) {
func (gateway HttpLibCostStructured) BatchCreateCostManagemant(param BatchAddCostManagemantRequest) (*service_gateway.GatewayResponse, error) {
url := fmt.Sprintf("%s%s", gateway.BaseUrl(), "/cost-managemants/batch-create-cost-managemants")
method := "post"
var data BatchAddCostManagemantResponse
err := gateway.FastDoRequest(url, method, param, &data)
return &data, err
//var data BatchAddCostManagemantResponse
//err := gateway.FastDoRequest(url, method, param, &data)
r := gateway.CreateRequest(url, method)
if len(gateway.InOrgIds) > 0 {
r.Header("orgIds", strings.Join(service_gateway.ToArrayString(gateway.InOrgIds), ","))
}
req, err := r.JSONBody(param)
if err != nil {
return nil,err
}
byteResult, err:= req.Bytes()
if err != nil {
return nil,err
}
var result service_gateway.GatewayResponse
err = json.Unmarshal(byteResult, &result)
if err != nil {
return nil,err
}
return &result, nil
}
type BatchAddCostManagemantRequest struct {
*domain.BatchCreateCostManagemant
... ...