作者 yangfu

角色添加修改

... ... @@ -78,6 +78,7 @@ func (srv CooperationApplicationsService) SearchCooperationApplications(applicat
CompanyId: int(applicationQuery.Operator.CompanyId),
OrgId: applicationQuery.Operator.OrgId,
CooperationApplicationStatus: applicationQuery.Status,
IsCanceled: 1,
})
for i := 0; i < len(resultApplications.Grid.List); i++ {
resultApplications.Grid.List[i].Department.DepartmentID = resultApplications.Grid.List[i].Org.OrgID
... ...
... ... @@ -11,6 +11,8 @@ type ImportDataCommand struct {
//操作人
Operator domain.Operator `json:"-"`
Reader io.Reader `json:"-"`
// 业务编码
Code string `json:"code"`
}
func (importDataCommand *ImportDataCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -10,6 +10,8 @@ import (
type RoleAddCommand struct {
//操作人
Operator domain.Operator `json:"-"`
// 组织机构ID
OrgId int64 `json:"orgId,string"`
// 角色名称
RoleName string `json:"roleName"`
// 描述
... ...
... ... @@ -22,6 +22,7 @@ func (rolesService *RolesService) RoleAdd(roleAddCommand *command.RoleAddCommand
result, err := creationUserGateway.RoleCreate(allied_creation_user.ReqRoleCreate{
RoleName: roleAddCommand.RoleName,
Desc: roleAddCommand.Desc,
OrgId: roleAddCommand.OrgId,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ...
... ... @@ -102,6 +102,8 @@ type (
//创建角色
type (
ReqRoleCreate struct {
// 组织ID
OrgId int64 `cname:"组织ID" json:"orgId"`
// 角色名称
RoleName string `json:"roleName"`
// 描述
... ...
... ... @@ -268,3 +268,23 @@ func (controller ExcelDataController) ImportOrganization() {
data, err := excelService.ImportOrganization(cmd)
controller.Response(data, err)
}
func (controller ExcelDataController) FileImport() {
excelService := service.NewExcelDataService(nil)
r, err := controller.GetExcelFile()
if err != nil {
controller.Response(nil, err)
return
}
cmd := &command.ImportDataCommand{}
//controller.Unmarshal(cmd)
controller.ParseForm(cmd)
cmd.Operator = controller.GetOperator()
cmd.Reader = r
var data interface{}
switch cmd.Code {
case "ImportCompanyUser":
data, err = excelService.ImportCompanyUser(cmd)
}
controller.Response(data, err)
}
... ...
... ... @@ -16,4 +16,6 @@ func init() {
web.Router("/v1/web/excel/import/dividends-returned-orders", &web_client.ExcelDataController{}, "Post:ImportDividendsReturnedOrder")
web.Router("/v1/web/excel/import/organization", &web_client.ExcelDataController{}, "Post:ImportOrganization")
web.Router("/v1/web/file-import", &web_client.ExcelDataController{}, "Post:FileImport")
}
... ...