作者 yangfu

角色添加修改

@@ -78,6 +78,7 @@ func (srv CooperationApplicationsService) SearchCooperationApplications(applicat @@ -78,6 +78,7 @@ func (srv CooperationApplicationsService) SearchCooperationApplications(applicat
78 CompanyId: int(applicationQuery.Operator.CompanyId), 78 CompanyId: int(applicationQuery.Operator.CompanyId),
79 OrgId: applicationQuery.Operator.OrgId, 79 OrgId: applicationQuery.Operator.OrgId,
80 CooperationApplicationStatus: applicationQuery.Status, 80 CooperationApplicationStatus: applicationQuery.Status,
  81 + IsCanceled: 1,
81 }) 82 })
82 for i := 0; i < len(resultApplications.Grid.List); i++ { 83 for i := 0; i < len(resultApplications.Grid.List); i++ {
83 resultApplications.Grid.List[i].Department.DepartmentID = resultApplications.Grid.List[i].Org.OrgID 84 resultApplications.Grid.List[i].Department.DepartmentID = resultApplications.Grid.List[i].Org.OrgID
@@ -11,6 +11,8 @@ type ImportDataCommand struct { @@ -11,6 +11,8 @@ type ImportDataCommand struct {
11 //操作人 11 //操作人
12 Operator domain.Operator `json:"-"` 12 Operator domain.Operator `json:"-"`
13 Reader io.Reader `json:"-"` 13 Reader io.Reader `json:"-"`
  14 + // 业务编码
  15 + Code string `json:"code"`
14 } 16 }
15 17
16 func (importDataCommand *ImportDataCommand) Valid(validation *validation.Validation) { 18 func (importDataCommand *ImportDataCommand) Valid(validation *validation.Validation) {
@@ -10,6 +10,8 @@ import ( @@ -10,6 +10,8 @@ import (
10 type RoleAddCommand struct { 10 type RoleAddCommand struct {
11 //操作人 11 //操作人
12 Operator domain.Operator `json:"-"` 12 Operator domain.Operator `json:"-"`
  13 + // 组织机构ID
  14 + OrgId int64 `json:"orgId,string"`
13 // 角色名称 15 // 角色名称
14 RoleName string `json:"roleName"` 16 RoleName string `json:"roleName"`
15 // 描述 17 // 描述
@@ -22,6 +22,7 @@ func (rolesService *RolesService) RoleAdd(roleAddCommand *command.RoleAddCommand @@ -22,6 +22,7 @@ func (rolesService *RolesService) RoleAdd(roleAddCommand *command.RoleAddCommand
22 result, err := creationUserGateway.RoleCreate(allied_creation_user.ReqRoleCreate{ 22 result, err := creationUserGateway.RoleCreate(allied_creation_user.ReqRoleCreate{
23 RoleName: roleAddCommand.RoleName, 23 RoleName: roleAddCommand.RoleName,
24 Desc: roleAddCommand.Desc, 24 Desc: roleAddCommand.Desc,
  25 + OrgId: roleAddCommand.OrgId,
25 }) 26 })
26 if err != nil { 27 if err != nil {
27 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 28 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
@@ -102,6 +102,8 @@ type ( @@ -102,6 +102,8 @@ type (
102 //创建角色 102 //创建角色
103 type ( 103 type (
104 ReqRoleCreate struct { 104 ReqRoleCreate struct {
  105 + // 组织ID
  106 + OrgId int64 `cname:"组织ID" json:"orgId"`
105 // 角色名称 107 // 角色名称
106 RoleName string `json:"roleName"` 108 RoleName string `json:"roleName"`
107 // 描述 109 // 描述
@@ -268,3 +268,23 @@ func (controller ExcelDataController) ImportOrganization() { @@ -268,3 +268,23 @@ func (controller ExcelDataController) ImportOrganization() {
268 data, err := excelService.ImportOrganization(cmd) 268 data, err := excelService.ImportOrganization(cmd)
269 controller.Response(data, err) 269 controller.Response(data, err)
270 } 270 }
  271 +
  272 +func (controller ExcelDataController) FileImport() {
  273 + excelService := service.NewExcelDataService(nil)
  274 + r, err := controller.GetExcelFile()
  275 + if err != nil {
  276 + controller.Response(nil, err)
  277 + return
  278 + }
  279 + cmd := &command.ImportDataCommand{}
  280 + //controller.Unmarshal(cmd)
  281 + controller.ParseForm(cmd)
  282 + cmd.Operator = controller.GetOperator()
  283 + cmd.Reader = r
  284 + var data interface{}
  285 + switch cmd.Code {
  286 + case "ImportCompanyUser":
  287 + data, err = excelService.ImportCompanyUser(cmd)
  288 + }
  289 + controller.Response(data, err)
  290 +}
@@ -16,4 +16,6 @@ func init() { @@ -16,4 +16,6 @@ func init() {
16 web.Router("/v1/web/excel/import/dividends-returned-orders", &web_client.ExcelDataController{}, "Post:ImportDividendsReturnedOrder") 16 web.Router("/v1/web/excel/import/dividends-returned-orders", &web_client.ExcelDataController{}, "Post:ImportDividendsReturnedOrder")
17 17
18 web.Router("/v1/web/excel/import/organization", &web_client.ExcelDataController{}, "Post:ImportOrganization") 18 web.Router("/v1/web/excel/import/organization", &web_client.ExcelDataController{}, "Post:ImportOrganization")
  19 +
  20 + web.Router("/v1/web/file-import", &web_client.ExcelDataController{}, "Post:FileImport")
19 } 21 }