diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/AppMenuDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/AppMenuDTO.java new file mode 100644 index 000000000..8fc61be7c --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/AppMenuDTO.java @@ -0,0 +1,118 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto; + +import java.io.Serializable; +import java.util.Date; + +import com.elink.esua.epdc.commons.tools.utils.TreeNode; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import org.hibernate.validator.constraints.Range; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + + +/** + * APP菜单管理 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@Data +public class AppMenuDTO extends TreeNode implements Serializable { + + private static final long serialVersionUID = -319379699436244053L; + + /** + * id + */ + @NotNull(message = "{id.require}", groups = UpdateGroup.class) + private Long id; + + /** + * 上级ID,一级菜单为0 + */ + @NotNull(message = "{sysmenu.pid.require}", groups = DefaultGroup.class) + private Long pid; + + /** + * 菜单URL + */ + private String url; + + /** + * 类型 0:菜单 1:按钮 + */ + @Range(min = 0, max = 1, message = "{sysmenu.type.range}", groups = DefaultGroup.class) + private Integer type; + + /** + * 菜单图标 + */ + private String icon; + + /** + * 权限标识,如:sys:menu:save + */ + private String permissions; + + /** + * 排序 + */ + @Min(value = 0, message = "{sort.number}", groups = DefaultGroup.class) + private Integer sort; + + /** + * 删除标识 0:未删除 1:删除 + */ + private Integer delFlag; + + /** + * 创建者 + */ + private Long creator; + + /** + * 创建时间 + */ + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Date createDate; + + /** + * 更新者 + */ + private Long updater; + + /** + * 更新时间 + */ + private Date updateDate; + + /** + * 菜单编码 + */ + private String menuCode; + + @NotBlank(message = "{sysmenu.name.require}", groups = DefaultGroup.class) + private String name; +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/AppRoleMenuDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/AppRoleMenuDTO.java new file mode 100644 index 000000000..ada6890e2 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/AppRoleMenuDTO.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto; + +import java.io.Serializable; +import java.util.Date; + +import lombok.Data; + + +/** + * APP角色菜单关系 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@Data +public class AppRoleMenuDTO implements Serializable { + + private static final long serialVersionUID = 9222960342198691097L; + + /** + * id + */ + private Long id; + + /** + * 角色ID + */ + private Long roleId; + + /** + * 菜单ID + */ + private Long menuId; + + /** + * 创建者 + */ + private Long creator; + + /** + * 创建时间 + */ + private Date createDate; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/enums/MenuTableEnum.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/enums/MenuTableEnum.java new file mode 100644 index 000000000..6a1b53042 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/enums/MenuTableEnum.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.enums; + +/** + * 菜单表枚举 + * + * @author work@yujt.net.cn + * @date 2019/11/19 13:56 + */ +public enum MenuTableEnum { + /** + * 菜单资源 + */ + SYS("sys_menu"), + /** + * 非菜单资源 + */ + APP("sys_app_menu"); + + private String value; + + MenuTableEnum(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/AppMenuController.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/AppMenuController.java new file mode 100644 index 000000000..81dda8e8d --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/AppMenuController.java @@ -0,0 +1,109 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.exception.ErrorCode; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.AppMenuDTO; +import com.elink.esua.epdc.excel.AppMenuExcel; +import com.elink.esua.epdc.service.AppMenuService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * APP菜单管理 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@RestController +@RequestMapping("appmenu") +public class AppMenuController { + + @Autowired + private AppMenuService appMenuService; + + /** + * 获取APP菜单列表 + * + * @param type 菜单类型 0:菜单 1:按钮 null:全部 + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author work@yujt.net.cn + * @date 2019/11/19 13:26 + */ + @GetMapping("list") + public Result> list(Integer type) { + List list = appMenuService.getAppMenuList(type); + return new Result>().ok(list); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id) { + AppMenuDTO data = appMenuService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody AppMenuDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + appMenuService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody AppMenuDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + appMenuService.update(dto); + return new Result(); + } + + @DeleteMapping("{id}") + public Result delete(@PathVariable("id") Long id){ + //效验数据 + AssertUtils.isNull(id, "id"); + + //判断是否有子菜单或按钮 + if(appMenuService.hasChileMenu(id)){ + return new Result().error(ErrorCode.SUB_MENU_EXIST); + } + + appMenuService.delete(id); + + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = appMenuService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, AppMenuExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/AppRoleMenuController.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/AppRoleMenuController.java new file mode 100644 index 000000000..c80d91952 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/AppRoleMenuController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.AppRoleMenuDTO; +import com.elink.esua.epdc.excel.AppRoleMenuExcel; +import com.elink.esua.epdc.service.AppRoleMenuService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * APP角色菜单关系 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@RestController +@RequestMapping("approlemenu") +public class AppRoleMenuController { + + @Autowired + private AppRoleMenuService appRoleMenuService; + + @GetMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = appRoleMenuService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id) { + AppRoleMenuDTO data = appRoleMenuService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody AppRoleMenuDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + appRoleMenuService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody AppRoleMenuDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + appRoleMenuService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + appRoleMenuService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = appRoleMenuService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, AppRoleMenuExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/AppMenuDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/AppMenuDao.java new file mode 100644 index 000000000..596a0520e --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/AppMenuDao.java @@ -0,0 +1,48 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.AppMenuDTO; +import com.elink.esua.epdc.entity.AppMenuEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 菜单管理 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@Mapper +public interface AppMenuDao extends BaseDao { + + + /** + * 获取app菜单列表 + * + * @param type 菜单类型 + * @param language 语言 + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/11/19 13:43 + */ + List selectListAppMenu(@Param("type") Integer type, @Param("language") String language); +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/AppRoleMenuDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/AppRoleMenuDao.java new file mode 100644 index 000000000..568ef8e95 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/AppRoleMenuDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.AppRoleMenuEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 角色菜单关系 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@Mapper +public interface AppRoleMenuDao extends BaseDao { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/AppMenuEntity.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/AppMenuEntity.java new file mode 100644 index 000000000..cd878c267 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/AppMenuEntity.java @@ -0,0 +1,97 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * APP菜单管理 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("sys_app_menu") +public class AppMenuEntity extends BaseEntity { + + private static final long serialVersionUID = 8343477172739451636L; + + + /** + * 上级ID,一级菜单为0 + */ + private Long pid; + + /** + * 菜单URL + */ + private String url; + + /** + * 类型 0:菜单 1:按钮 + */ + private Integer type; + + /** + * 菜单图标 + */ + private String icon; + + /** + * 权限标识,如:sys:menu:save + */ + private String permissions; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标识 0:未删除 1:删除 + */ + @TableField(fill = FieldFill.INSERT) + private Integer delFlag; + + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updater; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateDate; + + /** + * 菜单编码 + */ + private String menuCode; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/AppRoleMenuEntity.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/AppRoleMenuEntity.java new file mode 100644 index 000000000..4b41cb665 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/AppRoleMenuEntity.java @@ -0,0 +1,49 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * APP角色菜单关系 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("sys_app_role_menu") +public class AppRoleMenuEntity extends BaseEntity { + + private static final long serialVersionUID = 5439181968297858519L; + + /** + * 角色ID + */ + private Long roleId; + + /** + * 菜单ID + */ + private Long menuId; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/excel/AppMenuExcel.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/excel/AppMenuExcel.java new file mode 100644 index 000000000..0f0eafba8 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/excel/AppMenuExcel.java @@ -0,0 +1,74 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 菜单管理 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@Data +public class AppMenuExcel { + + @Excel(name = "id") + private Long id; + + @Excel(name = "上级ID,一级菜单为0") + private Long pid; + + @Excel(name = "菜单URL") + private String url; + + @Excel(name = "类型 0:菜单 1:按钮") + private Integer type; + + @Excel(name = "菜单图标") + private String icon; + + @Excel(name = "权限标识,如:sys:menu:save") + private String permissions; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "删除标识 0:未删除 1:删除") + private Integer delFlag; + + @Excel(name = "创建者") + private Long creator; + + @Excel(name = "创建时间") + private Date createDate; + + @Excel(name = "更新者") + private Long updater; + + @Excel(name = "更新时间") + private Date updateDate; + + @Excel(name = "菜单编码") + private String menuCode; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/excel/AppRoleMenuExcel.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/excel/AppRoleMenuExcel.java new file mode 100644 index 000000000..1634de87e --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/excel/AppRoleMenuExcel.java @@ -0,0 +1,50 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 角色菜单关系 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@Data +public class AppRoleMenuExcel { + + @Excel(name = "id") + private Long id; + + @Excel(name = "角色ID") + private Long roleId; + + @Excel(name = "菜单ID") + private Long menuId; + + @Excel(name = "创建者") + private Long creator; + + @Excel(name = "创建时间") + private Date createDate; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/AppMenuRedis.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/AppMenuRedis.java new file mode 100644 index 000000000..500b7376e --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/AppMenuRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 菜单管理 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@Component +public class AppMenuRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/AppRoleMenuRedis.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/AppRoleMenuRedis.java new file mode 100644 index 000000000..558ca3286 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/AppRoleMenuRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 角色菜单关系 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@Component +public class AppRoleMenuRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/AppMenuService.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/AppMenuService.java new file mode 100644 index 000000000..f02bed2ef --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/AppMenuService.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.AppMenuDTO; +import com.elink.esua.epdc.entity.AppMenuEntity; + +import java.util.List; +import java.util.Map; + +/** + * APP菜单管理 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +public interface AppMenuService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-11-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-11-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return AppMenuDTO + * @author generator + * @date 2019-11-19 + */ + AppMenuDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-11-19 + */ + void save(AppMenuDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-11-19 + */ + void update(AppMenuDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-11-19 + */ + void delete(String[] ids); + + + /** + * 获取APP菜单列表 + * + * @param type 菜单类型 0:菜单 1:按钮 null:全部 + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/11/19 13:27 + */ + List getAppMenuList(Integer type); + + /** + * 根据ID删除 + * + * @param id 菜单ID + * @return void + * @author work@yujt.net.cn + * @date 2019/11/19 14:31 + */ + void delete(Long id); + + /** + * 判断是否有子级菜单 + * + * @param id 菜单ID + * @return boolean + * @author work@yujt.net.cn + * @date 2019/11/19 14:30 + */ + boolean hasChileMenu(Long id); +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/AppRoleMenuService.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/AppRoleMenuService.java new file mode 100644 index 000000000..b1dac5a2f --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/AppRoleMenuService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.AppRoleMenuDTO; +import com.elink.esua.epdc.entity.AppRoleMenuEntity; + +import java.util.List; +import java.util.Map; + +/** + * APP角色菜单关系 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +public interface AppRoleMenuService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-11-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-11-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return AppRoleMenuDTO + * @author generator + * @date 2019-11-19 + */ + AppRoleMenuDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-11-19 + */ + void save(AppRoleMenuDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-11-19 + */ + void update(AppRoleMenuDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-11-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/AppMenuServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/AppMenuServiceImpl.java new file mode 100644 index 000000000..97258fec1 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/AppMenuServiceImpl.java @@ -0,0 +1,132 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.enums.DelFlagEnum; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.utils.HttpContextUtils; +import com.elink.esua.epdc.commons.tools.utils.TreeUtils; +import com.elink.esua.epdc.dao.AppMenuDao; +import com.elink.esua.epdc.dto.AppMenuDTO; +import com.elink.esua.epdc.entity.AppMenuEntity; +import com.elink.esua.epdc.enums.MenuTableEnum; +import com.elink.esua.epdc.service.AppMenuService; +import com.elink.esua.epdc.service.SysLanguageService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * APP菜单管理 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@Service +public class AppMenuServiceImpl extends BaseServiceImpl implements AppMenuService { + + @Autowired + private SysLanguageService sysLanguageService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, AppMenuDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + return ConvertUtils.sourceToTarget(entityList, AppMenuDTO.class); + } + + @Override + public List getAppMenuList(Integer type) { + List menuList = baseDao.selectListAppMenu(type, HttpContextUtils.getLanguage()); + return TreeUtils.build(menuList, Constant.MENU_ROOT); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public AppMenuDTO get(String id) { + AppMenuEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, AppMenuDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(AppMenuDTO dto) { + AppMenuEntity entity = ConvertUtils.sourceToTarget(dto, AppMenuEntity.class); + insert(entity); + + sysLanguageService.saveOrUpdate(MenuTableEnum.APP.value(), entity.getId(), "name", dto.getName(), HttpContextUtils.getLanguage()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(AppMenuDTO dto) { + AppMenuEntity entity = ConvertUtils.sourceToTarget(dto, AppMenuEntity.class); + updateById(entity); + + sysLanguageService.saveOrUpdate(MenuTableEnum.APP.value(), entity.getId(), "name", dto.getName(), HttpContextUtils.getLanguage()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 物理删除(没有使用@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public void delete(Long id) { + baseDao.deleteById(id); + } + + @Override + public boolean hasChileMenu(Long id) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("pid", id) + .eq(FieldConstant.DEL_FLAG, DelFlagEnum.NORMAL.value()); + Integer selectCount = baseDao.selectCount(wrapper); + return selectCount > NumConstant.ZERO; + } +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/AppRoleMenuServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/AppRoleMenuServiceImpl.java new file mode 100644 index 000000000..6d7722cb2 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/AppRoleMenuServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.dao.AppRoleMenuDao; +import com.elink.esua.epdc.dto.AppRoleMenuDTO; +import com.elink.esua.epdc.entity.AppRoleMenuEntity; +import com.elink.esua.epdc.redis.AppRoleMenuRedis; +import com.elink.esua.epdc.service.AppRoleMenuService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * APP角色菜单关系 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@Service +public class AppRoleMenuServiceImpl extends BaseServiceImpl implements AppRoleMenuService { + + @Autowired + private AppRoleMenuRedis appRoleMenuRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, AppRoleMenuDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, AppRoleMenuDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public AppRoleMenuDTO get(String id) { + AppRoleMenuEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, AppRoleMenuDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(AppRoleMenuDTO dto) { + AppRoleMenuEntity entity = ConvertUtils.sourceToTarget(dto, AppRoleMenuEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(AppRoleMenuDTO dto) { + AppRoleMenuEntity entity = ConvertUtils.sourceToTarget(dto, AppRoleMenuEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysMenuServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysMenuServiceImpl.java index dd4e1f9b3..7acfa2417 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysMenuServiceImpl.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysMenuServiceImpl.java @@ -1,8 +1,8 @@ /** * Copyright (c) 2018 人人开源 All rights reserved. - * + *

* https://www.renren.io - * + *

* 版权所有,侵权必究! */ @@ -21,6 +21,7 @@ import com.elink.esua.epdc.commons.tools.utils.TreeUtils; import com.elink.esua.epdc.dao.SysMenuDao; import com.elink.esua.epdc.dto.SysMenuDTO; import com.elink.esua.epdc.entity.SysMenuEntity; +import com.elink.esua.epdc.enums.MenuTableEnum; import com.elink.esua.epdc.enums.MenuTypeEnum; import com.elink.esua.epdc.redis.SysMenuRedis; import com.elink.esua.epdc.service.SysLanguageService; @@ -84,7 +85,7 @@ public class SysMenuServiceImpl extends BaseServiceImpl menuList; //系统管理员,拥有最高权限 - if(userDetail.getSuperAdmin() == SuperAdminEnum.YES.value()){ + if (userDetail.getSuperAdmin() == SuperAdminEnum.YES.value()) { menuList = baseDao.getMenuList(type, HttpContextUtils.getLanguage()); - }else { + } else { menuList = baseDao.getUserMenuList(userDetail.getId(), type, HttpContextUtils.getLanguage()); } @@ -140,7 +141,7 @@ public class SysMenuServiceImpl extends BaseServiceImpl getUserMenuNavList(UserDetail userDetail) { List menuList = sysMenuRedis.getUserMenuNavList(userDetail.getId()); - if(menuList == null){ + if (menuList == null) { menuList = getUserMenuList(userDetail, MenuTypeEnum.MENU.value()); sysMenuRedis.setUserMenuNavList(userDetail.getId(), menuList); @@ -153,21 +154,21 @@ public class SysMenuServiceImpl extends BaseServiceImpl getUserPermissions(UserDetail userDetail) { //用户权限列表 Set permsSet = sysMenuRedis.getUserPermissions(userDetail.getId()); - if(permsSet != null){ + if (permsSet != null) { return permsSet; } //超级管理员,拥有最高权限 List menuList; - if(userDetail.getSuperAdmin() == SuperAdminEnum.YES.value()){ + if (userDetail.getSuperAdmin() == SuperAdminEnum.YES.value()) { menuList = baseDao.getMenuList(MenuTypeEnum.BUTTON.value(), HttpContextUtils.getLanguage()); - }else{ + } else { menuList = baseDao.getUserMenuList(userDetail.getId(), MenuTypeEnum.BUTTON.value(), HttpContextUtils.getLanguage()); } permsSet = new HashSet<>(); - for(SysMenuEntity menu : menuList){ - if(StringUtils.isNotBlank(menu.getPermissions())){ + for (SysMenuEntity menu : menuList) { + if (StringUtils.isNotBlank(menu.getPermissions())) { permsSet.add(menu.getPermissions()); } } @@ -185,8 +186,8 @@ public class SysMenuServiceImpl extends BaseServiceImpl + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/AppRoleMenuDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/AppRoleMenuDao.xml new file mode 100644 index 000000000..924801dca --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/AppRoleMenuDao.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiWorkIssueController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiWorkIssueController.java index 8d9f87ef5..45a97c50b 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiWorkIssueController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiWorkIssueController.java @@ -3,6 +3,7 @@ package com.elink.esua.epdc.controller; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.category.EventCategoryDTO; +import com.elink.esua.epdc.dto.events.form.EpdcEventsReviewFormDTO; import com.elink.esua.epdc.dto.events.result.EventAppDetailResultDTO; import com.elink.esua.epdc.dto.issue.form.IssuePendingResponseFormDTO; import com.elink.esua.epdc.dto.issue.form.IssueStateStatisticsFormDTO; @@ -33,7 +34,6 @@ public class ApiWorkIssueController { @GetMapping("issue/statistics") public Result statistics(@RequestBody IssueStateStatisticsFormDTO formDto) { return workIssueService.stateStatistics(formDto); - } /** @@ -46,7 +46,6 @@ public class ApiWorkIssueController { return workIssueService.listIssuePendingResponse(formDto); } - /** *事件详情 * @param id @@ -67,4 +66,12 @@ public class ApiWorkIssueController { } + /** + *事件审核 + * @return + */ + @PostMapping("event/review") + public Result review(EpdcEventsReviewFormDTO dto) { + return workIssueService.review(dto); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiWorkUserController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiWorkUserController.java index a53d1bc4b..57b2a5bf2 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiWorkUserController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiWorkUserController.java @@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; +import java.util.Map; /** * 工作端,用户登录,用户管理相关接口 @@ -72,9 +73,20 @@ public class ApiWorkUserController { * @date 2019/11/18 13:53 */ @GetMapping("list") - public Result> getUserList(@LoginUser TokenDto userDetail, EpdcWorkUserFromDTO - workUserFromDto) { - + public Result> getUserList(@LoginUser TokenDto userDetail, EpdcWorkUserFromDTO workUserFromDto) { return workUserService.listWorkLlist(userDetail, workUserFromDto); } + + /*** + * 查询待认证用户数量 + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author qushutong + * @date 2019/11/19 10:54 + */ + @GetMapping("unauthorizedAmount") + public Result unauthorizedAmount(@LoginUser TokenDto userDetail,@RequestParam Map params){ + return workUserService.getUnauthorizedAmount(userDetail,params); + } + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java index 4c3c38467..dc259bd98 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java @@ -11,12 +11,10 @@ import com.elink.esua.epdc.dto.epdc.result.EpdcWorkUserResultDTO; import com.elink.esua.epdc.feign.fallback.UserFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.*; import java.util.List; +import java.util.Map; /** * appuser端接口 @@ -277,6 +275,7 @@ public interface UserFeignClient { */ @GetMapping("app-user/epdc-app/user/partyMemberDetail/{userId}") Result partyMemberDetail(@PathVariable("userId")String userId); + /*** * 用户列表 * @param workUserFromDto @@ -286,4 +285,15 @@ public interface UserFeignClient { */ @GetMapping("app-user/epdc-app/user/list") Result> getWorkUserList(EpdcWorkUserFromDTO workUserFromDto); + + + /*** + * 查询待认证用户数量 + * @param parame + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author qushutong + * @date 2019/11/19 11:02 + */ + @GetMapping("app-user/epdc-app/user/unauthorizedAmount") + Result getUnauthorizedAmount(@RequestParam Map parame); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/WorkIssueFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/WorkIssueFeignClient.java index 869408ae0..16239ca8a 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/WorkIssueFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/WorkIssueFeignClient.java @@ -3,6 +3,7 @@ package com.elink.esua.epdc.feign; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.category.EventCategoryDTO; +import com.elink.esua.epdc.dto.events.form.EpdcEventsReviewFormDTO; import com.elink.esua.epdc.dto.events.result.EventAppDetailResultDTO; import com.elink.esua.epdc.dto.issue.form.*; import com.elink.esua.epdc.dto.issue.result.*; @@ -11,6 +12,7 @@ import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; import java.util.List; @@ -49,4 +51,12 @@ public interface WorkIssueFeignClient { @GetMapping(value = "events/epdc-app/work/issue/categoryList", consumes = MediaType.APPLICATION_JSON_VALUE) Result> categoryList(); + /** + * 事件审核 + * @param dto + * @return + */ + @PostMapping(value = "events/epdc-app/work/event/review", consumes = MediaType.APPLICATION_JSON_VALUE) + Result review(EpdcEventsReviewFormDTO dto); + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java index 99e2b138f..04eef4c2e 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java @@ -12,6 +12,7 @@ import com.elink.esua.epdc.feign.UserFeignClient; import org.springframework.stereotype.Component; import java.util.List; +import java.util.Map; /** * @author yujintao @@ -140,4 +141,9 @@ public class UserFeignClientFallback implements UserFeignClient { public Result> getWorkUserList(EpdcWorkUserFromDTO workUserFromDto) { return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "getWorkUserList", workUserFromDto); } + + @Override + public Result getUnauthorizedAmount(Map parame) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "getUnauthorizedAmount", parame); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/WorkIssueFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/WorkIssueFeignClientFallback.java index bffef0cb7..fbc4251e2 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/WorkIssueFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/WorkIssueFeignClientFallback.java @@ -5,6 +5,7 @@ import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.category.EventCategoryDTO; import com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO; +import com.elink.esua.epdc.dto.events.form.EpdcEventsReviewFormDTO; import com.elink.esua.epdc.dto.events.result.EventAppDetailResultDTO; import com.elink.esua.epdc.dto.issue.form.*; import com.elink.esua.epdc.dto.issue.result.*; @@ -40,4 +41,9 @@ public class WorkIssueFeignClientFallback implements WorkIssueFeignClient { public Result> categoryList() { return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "categoryList", ""); } + + @Override + public Result review(EpdcEventsReviewFormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "review", dto); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/WorkIssueService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/WorkIssueService.java index 52600ce0c..ce29267b8 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/WorkIssueService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/WorkIssueService.java @@ -20,6 +20,7 @@ package com.elink.esua.epdc.service; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.category.EventCategoryDTO; +import com.elink.esua.epdc.dto.events.form.EpdcEventsReviewFormDTO; import com.elink.esua.epdc.dto.events.result.EventAppDetailResultDTO; import com.elink.esua.epdc.dto.issue.form.IssuePendingResponseFormDTO; import com.elink.esua.epdc.dto.issue.form.IssueStateStatisticsFormDTO; @@ -56,4 +57,11 @@ public interface WorkIssueService { * @return */ Result> categoryList(); + + /** + * 事件审核 + * @param dto + * @return + */ + Result review(EpdcEventsReviewFormDTO dto); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/WorkUserService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/WorkUserService.java index ff0971241..1a0a200f2 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/WorkUserService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/WorkUserService.java @@ -9,6 +9,7 @@ import com.elink.esua.epdc.dto.epdc.form.EpdcWorkUserFromDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcWorkUserResultDTO; import java.util.List; +import java.util.Map; /** * 工作端,用户登录、用户管理 相关业务接口 @@ -45,4 +46,13 @@ public interface WorkUserService { * @date 2019/11/18 13:39 */ Result> listWorkLlist(TokenDto userDetail, EpdcWorkUserFromDTO workUserFromDto); + + /*** + * 查询待认证用户数量 + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author qushutong + * @date 2019/11/19 10:56 + */ + Result getUnauthorizedAmount(TokenDto userDetail, Map parame); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/WorkIssueServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/WorkIssueServiceImpl.java index 30dee26a1..3df8b7e2a 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/WorkIssueServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/WorkIssueServiceImpl.java @@ -19,6 +19,7 @@ package com.elink.esua.epdc.service.impl; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.category.EventCategoryDTO; +import com.elink.esua.epdc.dto.events.form.EpdcEventsReviewFormDTO; import com.elink.esua.epdc.dto.events.result.EventAppDetailResultDTO; import com.elink.esua.epdc.dto.issue.form.IssuePendingResponseFormDTO; import com.elink.esua.epdc.dto.issue.form.IssueStateStatisticsFormDTO; @@ -76,4 +77,14 @@ public class WorkIssueServiceImpl implements WorkIssueService { public Result> categoryList() { return workIssueFeignClient.categoryList(); } + + /** + * 事件审核 + * @param dto + * @return + */ + @Override + public Result review(EpdcEventsReviewFormDTO dto) { + return workIssueFeignClient.review(dto); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/WorkUserServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/WorkUserServiceImpl.java index 332bebd9e..05dfc20b3 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/WorkUserServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/WorkUserServiceImpl.java @@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; +import java.util.Map; /** * 工作端,用户登录、用户管理 相关业务实现 @@ -69,6 +70,14 @@ public class WorkUserServiceImpl implements WorkUserService { @Override public Result> listWorkLlist(TokenDto userDetail, EpdcWorkUserFromDTO workUserFromDto) { workUserFromDto.setUserId(userDetail.getUserId()); + workUserFromDto.setDeptId(userDetail.getGridId()); return userFeignClient.getWorkUserList(workUserFromDto); } + + @Override + public Result getUnauthorizedAmount(TokenDto userDetail, Map parame) { + parame.put("userId",userDetail.getUserId()); + parame.put("deptId",userDetail.getGridId()); + return userFeignClient.getUnauthorizedAmount(parame); + } } diff --git a/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/java/com/elink/esua/epdc/controller/ImportInShiBeiController.java b/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/java/com/elink/esua/epdc/controller/ImportInShiBeiController.java deleted file mode 100644 index 7db253462..000000000 --- a/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/java/com/elink/esua/epdc/controller/ImportInShiBeiController.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.elink.esua.epdc.controller; - -import cn.afterturn.easypoi.excel.ExcelImportUtil; -import cn.afterturn.easypoi.excel.entity.ImportParams; -import com.alibaba.fastjson.JSONObject; -import com.elink.esua.epdc.commons.tools.utils.Result; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.codec.CharEncoding; -import org.apache.http.HttpEntity; -import org.apache.http.HttpStatus; -import org.apache.http.ParseException; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.util.EntityUtils; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; - -import java.io.*; -import java.util.List; -import java.util.Map; - -/** - * @author work@yujt.net.cn - * @date 1 1 - */ -@Slf4j -@RestController -@RequestMapping("inshibei") -public class ImportInShiBeiController { - - - @GetMapping("coterie/batchSave") - public Result importExcel(MultipartFile file, String userId, String token) { - ImportParams importParams = new ImportParams(); - importParams.setHeadRows(1); - try { - List> articleList = ExcelImportUtil.importExcel(file.getInputStream(), Map.class, importParams); - - for (Map objectMap : articleList) { - postWithParam(userId, token, objectMap.get("content"), objectMap.get("type")); - } - } catch (Exception e) { - e.printStackTrace(); - } - return new Result(); - } - - private void postWithParam(String userId, String token, String detail, String type) throws Exception { - CloseableHttpClient httpClient = HttpClients.createDefault(); - - JSONObject json = new JSONObject(); - json.put("userId", userId); - json.put("token", token); - json.put("detail", detail); - json.put("coterieType", type); - - HttpPost httpPost = new HttpPost("http://hxb.elinkit.com.cn/InShiBei/rest/coterie/save"); - StringEntity stringEntity = new StringEntity(json.toJSONString(), CharEncoding.UTF_8); - stringEntity.setContentEncoding(CharEncoding.UTF_8); - // 发送json数据需要设置contentType - stringEntity.setContentType(MediaType.APPLICATION_JSON_UTF8_VALUE); - httpPost.setEntity(stringEntity); - - getStringResult(httpClient.execute(httpPost)); - } - - - private static String getStringResult(CloseableHttpResponse response) { - String result = null; - try { - if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { - HttpEntity httpEntity = response.getEntity(); - result = EntityUtils.toString(httpEntity, CharEncoding.UTF_8); - } else { - log.error("拉取失败,错误编码为:" + response.getStatusLine().getStatusCode()); - } - } catch (ParseException e) { - log.error("getResult方法格式转换异常ParseException"); - e.printStackTrace(); - } catch (IOException e) { - log.error("getResult方法IO异常IOException"); - e.printStackTrace(); - } finally { - try { - if (null != response) { - response.close(); - } - } catch (IOException e) { - e.printStackTrace(); - } - } - return result; - } -} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/constant/ImageConstant.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/constant/ImageConstant.java index eae9328ae..b55e5a770 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/constant/ImageConstant.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/constant/ImageConstant.java @@ -21,4 +21,9 @@ public interface ImageConstant { * 图片类型-事件拒绝 */ public final static String TYPE_IMAGE_BIZ_EVENTS_REJECT = "eventsReject"; + + /** + * 图片类型-议题处理 + */ + public final static String TYPE_IMAGE_BIZ_ISSUE_HANDLE = "issueHandle"; } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/form/EpdcEventsReviewFormDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/form/EpdcEventsReviewFormDTO.java index 0aac98d74..104e371bd 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/form/EpdcEventsReviewFormDTO.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/form/EpdcEventsReviewFormDTO.java @@ -6,6 +6,7 @@ import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import java.io.Serializable; +import java.util.List; /** * 审核事件提交表单DTO @@ -35,4 +36,6 @@ public class EpdcEventsReviewFormDTO implements Serializable { */ @Size(min = 1, max = 500, message = "处理意见在500字以内") private String advice; + + private List images; } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/controller/EpdcAppWorkEventsController.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/controller/EpdcAppWorkEventsController.java index c6fdb6347..e9619907d 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/controller/EpdcAppWorkEventsController.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/controller/EpdcAppWorkEventsController.java @@ -2,13 +2,12 @@ package com.elink.esua.epdc.modules.events.controller; import com.elink.esua.epdc.commons.tools.constant.Constant; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; import com.elink.esua.epdc.dto.events.EpdcEventsDetailDTO; +import com.elink.esua.epdc.dto.events.form.EpdcEventsReviewFormDTO; import com.elink.esua.epdc.modules.events.service.EpdcEventsService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; @RestController @RequestMapping(Constant.EPDC_APP + "work/event") @@ -27,4 +26,17 @@ public class EpdcAppWorkEventsController { EpdcEventsDetailDTO data = epdcEventsService.getEvent(id); return new Result().ok(data); } + + /** + * 事件审核 + * @Params: [dto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result + * @Author: liuchuang + * @Date: 2019/9/5 9:02 + */ + @PostMapping("review") + public Result eventReview(@RequestBody EpdcEventsReviewFormDTO dto) { + ValidatorUtils.validateEntity(dto); + return epdcEventsService.eventReview(dto); + } } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java index 88c549220..137a30eb1 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java @@ -176,6 +176,9 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl> + * @return com.elink.esua.epdc.commons.tools.utils.Result> * @params [formDto] * @author liuchuang * @since 2019/10/23 16:22 @@ -254,6 +255,7 @@ public class EpdcAppUserController { /** * 获取居民详情(已认证或待认证(提交信息待审核)的居民用户) + * * @param userId 用户Id * @return */ @@ -264,23 +266,26 @@ public class EpdcAppUserController { /** * 获取党员详情(已认证或未认证的党员用户) + * * @param userId * @return */ @GetMapping("partyMemberDetail/{userId}") - public Result partyMemberDetail(@PathVariable("userId") String userId){ + public Result partyMemberDetail(@PathVariable("userId") String userId) { return userService.partyMemberDetail(userId); } - /** - * 认证用户(用户信息审核) - * @param formDTO - * @return - */ + /** + * 认证用户(用户信息审核) + * + * @param formDTO + * @return + */ @PostMapping("authenticateResident") public Result authenticateResident(@RequestBody EpdcAppAuthenticateResidentFormDTO formDTO) { return userService.authenticateResident(formDTO); } + /*** * 用户列表 * @param workUserFromDto @@ -289,7 +294,20 @@ public class EpdcAppUserController { * @date 2019/11/18 13:47 */ @GetMapping("list") - public Result> getWorkUserList(@RequestBody EpdcWorkUserFromDTO workUserFromDto){ + public Result> getWorkUserList(@RequestBody EpdcWorkUserFromDTO workUserFromDto) { return userService.getWorkUserList(workUserFromDto); } + + + /*** + * 查询待认证用户数量 + * @param params + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author qushutong + * @date 2019/11/19 13:25 + */ + @GetMapping("unauthorizedAmount") + public Result unauthorizedAmount(@RequestParam Map params) { + return userService.getAnauthorizedAmount(params); + } } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java index 1963576cf..aec66459e 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java @@ -104,38 +104,51 @@ public interface UserDao extends BaseDao { /** * 获取居民详情(已认证或待认证(提交信息待审核)的居民用户) + * * @param userId 用户Id * @return */ - EpdcResidentDetailResultDTO residentDetailByUserId(@Param("userId")String userId); + EpdcResidentDetailResultDTO residentDetailByUserId(@Param("userId") String userId); /** * 获取党员详情(已认证或未认证的党员用户) + * * @param userId * @return */ - EpdcPartyMemberDetailDto partyMemberDetailByUserId(@Param("userId")String userId); + EpdcPartyMemberDetailDto partyMemberDetailByUserId(@Param("userId") String userId); /** * 未认证的党员用户 + * * @param userId * @return */ - EpdcPartyMemberDetailDto partyMemberDetailFaild(@Param("userId")String userId); + EpdcPartyMemberDetailDto partyMemberDetailFaild(@Param("userId") String userId); /** * 通过用户ID获取党员身份证号 + * * @param userId * @return */ - String getPartyMemberIdNoByUserID(@Param("userId")String userId); - - /*** - * 用户党员待审核列表 - * @param workUserFromDto - * @return java.util.List - * @author qushutong - * @date 2019/11/18 19:28 - */ + String getPartyMemberIdNoByUserID(@Param("userId") String userId); + + /*** + * 用户党员待审核列表 + * @param workUserFromDto + * @return java.util.List + * @author qushutong + * @date 2019/11/18 19:28 + */ List selectWorkUserList(EpdcWorkUserFromDTO workUserFromDto); + + /*** + * 查询待认证用户数量 + * @param params + * @return java.lang.Integer + * @author qushutong + * @date 2019/11/19 13:31 + */ + Integer selectOneAnauthorizedAmount(Map params); } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java index 9d65abbd3..1c1c32b9e 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java @@ -229,4 +229,14 @@ public interface UserService extends BaseService { * @date 2019/11/18 14:00 */ Result> getWorkUserList(EpdcWorkUserFromDTO workUserFromDto); + + /*** + * 查询待认证用户数量 + * @param params + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author qushutong + * @date 2019/11/19 13:28 + */ + Result getAnauthorizedAmount(Map params); + } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java index 88b9325fb..d3ffb5f55 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java @@ -580,4 +580,9 @@ public class UserServiceImpl extends BaseServiceImpl implem return new Result>().ok(epdcWorkUserResultDTOS); } + + @Override + public Result getAnauthorizedAmount(Map params) { + return new Result().ok(baseDao.selectOneAnauthorizedAmount(params)); + } } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml index 108015949..3d0870983 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml @@ -62,35 +62,43 @@ - + @@ -99,7 +107,7 @@ - + @@ -127,53 +135,53 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + - - + + @@ -274,4 +282,48 @@ AND eu.id = #{userId} + + + + + +