Browse Source
# Conflicts: # esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/application.ymldev
94 changed files with 5149 additions and 84 deletions
@ -0,0 +1,20 @@ |
|||||
|
# 基础镜像 |
||||
|
FROM openjdk:8u242-jdk-buster |
||||
|
# 作者 |
||||
|
MAINTAINER rongchao@elink-cn.com |
||||
|
# 对应pom.xml文件中的dockerfile-maven-plugin插件JAR_FILE的值 |
||||
|
ARG JAR_FILE |
||||
|
# 对应pom.xml文件中的dockerfile-maven-plugin插件JAR_NAME的值 |
||||
|
ARG JAR_NAME |
||||
|
# 对应pom.xml文件中的dockerfile-maven-plugin插件SERVER_PORT的值 |
||||
|
ARG SERVER_PORT |
||||
|
# 复制打包完成后的jar文件到/opt目录下 |
||||
|
ENV JAR_PATH /mnt/epdc/${JAR_NAME}.jar |
||||
|
ADD ${JAR_FILE} $JAR_PATH |
||||
|
# /data设为环境变量 |
||||
|
ENV DATAPATH /data |
||||
|
# 挂载/data目录到主机 |
||||
|
VOLUME $DATAPATH |
||||
|
# 启动容器时执行 |
||||
|
ENTRYPOINT java -jar -Xmx1024m $JAR_PATH |
||||
|
EXPOSE ${SERVER_PORT} |
||||
@ -0,0 +1,141 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.dto; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
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; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 菜单管理 |
||||
|
* |
||||
|
* @author elink elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-25 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SysAnalysisMenuDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* id |
||||
|
*/ |
||||
|
@NotNull(message = "{id.require}", groups = UpdateGroup.class) |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 上级ID,一级菜单为0 |
||||
|
*/ |
||||
|
@NotNull(message = "{sysmenu.pid.require}", groups = DefaultGroup.class) |
||||
|
private Long pid; |
||||
|
|
||||
|
/** |
||||
|
* 类型 0:菜单 1:按钮 |
||||
|
*/ |
||||
|
@Range(min = 0, max = 1, message = "{sysmenu.type.range}", groups = DefaultGroup.class) |
||||
|
private Integer type; |
||||
|
|
||||
|
/** |
||||
|
* 菜单图标 |
||||
|
*/ |
||||
|
private String icon; |
||||
|
|
||||
|
/** |
||||
|
* 样式名称 |
||||
|
*/ |
||||
|
private String className; |
||||
|
|
||||
|
/** |
||||
|
* 排序 |
||||
|
*/ |
||||
|
@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; |
||||
|
|
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
private String remark; |
||||
|
|
||||
|
/** |
||||
|
* 子模板ID |
||||
|
*/ |
||||
|
private String templateId; |
||||
|
|
||||
|
@NotBlank(message = "{sysmenu.name.require}", groups = DefaultGroup.class) |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 是否显示数字 0否 1是 |
||||
|
*/ |
||||
|
private String numFlag; |
||||
|
|
||||
|
//虚字段
|
||||
|
|
||||
|
/** |
||||
|
* 上级菜单名称 |
||||
|
*/ |
||||
|
private String parentName; |
||||
|
|
||||
|
/** |
||||
|
* 模块名称 |
||||
|
*/ |
||||
|
private String modelname; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,61 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.dto; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 角色菜单关系 |
||||
|
* |
||||
|
* @author elink elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-25 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SysAnalysisRoleMenuDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* id |
||||
|
*/ |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 角色ID |
||||
|
*/ |
||||
|
private Long roleId; |
||||
|
|
||||
|
/** |
||||
|
* 菜单ID |
||||
|
*/ |
||||
|
private Long menuId; |
||||
|
|
||||
|
/** |
||||
|
* 创建者 |
||||
|
*/ |
||||
|
private Long creator; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createDate; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,132 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.controller; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.exception.ErrorCode; |
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.commons.tools.security.user.UserDetail; |
||||
|
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.*; |
||||
|
import com.elink.esua.epdc.dto.epdc.result.EpdcAppChildNavResultDTO; |
||||
|
import com.elink.esua.epdc.excel.*; |
||||
|
import com.elink.esua.epdc.service.SysAnalysisMenuService; |
||||
|
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; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 菜单管理 |
||||
|
* |
||||
|
* @author elink elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-25 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("analysismenu") |
||||
|
public class SysAnalysisMenuController { |
||||
|
|
||||
|
@Autowired |
||||
|
private SysAnalysisMenuService sysAnalysisMenuService; |
||||
|
|
||||
|
/** |
||||
|
* 获取APP菜单列表 |
||||
|
* |
||||
|
* @param type 菜单类型 0:菜单 1:按钮 null:全部 |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < com.elink.esua.epdc.dto.AppMenuDTO>> |
||||
|
* @author work@yujt.net.cn |
||||
|
* @date 2019/11/19 13:26 |
||||
|
*/ |
||||
|
@GetMapping("list") |
||||
|
public Result<List<AppMenuDTO>> list(Integer type) { |
||||
|
List<AppMenuDTO> list = sysAnalysisMenuService.getAnalysisMenuList(type); |
||||
|
return new Result<List<AppMenuDTO>>().ok(list); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<SysAnalysisMenuDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<SysAnalysisMenuDTO> page = sysAnalysisMenuService.page(params); |
||||
|
return new Result<PageData<SysAnalysisMenuDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("{id}") |
||||
|
public Result<SysAnalysisMenuDTO> get(@PathVariable("id") String id){ |
||||
|
SysAnalysisMenuDTO data = sysAnalysisMenuService.get(id); |
||||
|
return new Result<SysAnalysisMenuDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody SysAnalysisMenuDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
sysAnalysisMenuService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
@GetMapping("select") |
||||
|
public Result<List<AppMenuDTO>> select(UserDetail userDetail) { |
||||
|
List<AppMenuDTO> list = sysAnalysisMenuService.getUserMenuList(userDetail, null); |
||||
|
|
||||
|
return new Result<List<AppMenuDTO>>().ok(list); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
public Result update(@RequestBody SysAnalysisMenuDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
sysAnalysisMenuService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping("{id}") |
||||
|
public Result delete(@PathVariable("id") Long id){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isNull(id, "id"); |
||||
|
//判断是否有子菜单或按钮
|
||||
|
if(sysAnalysisMenuService.hasChileMenu(id)){ |
||||
|
return new Result().error(ErrorCode.SUB_MENU_EXIST); |
||||
|
} |
||||
|
sysAnalysisMenuService.delete(id); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<SysAnalysisMenuDTO> list = sysAnalysisMenuService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, SysAnalysisMenuExcel.class); |
||||
|
} |
||||
|
/** |
||||
|
* @param userId |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < com.elink.esua.epdc.dto.epdc.result.EpdcAppChildNavResultDTO>> |
||||
|
* @Author lpf |
||||
|
* @Description 首页面板 获取数据端APP菜单 |
||||
|
* @Date 2020/03/18 10:42 |
||||
|
**/ |
||||
|
@GetMapping("/analysisIndexPanel/{userId}") |
||||
|
public Result<List<EpdcAppChildNavResultDTO>> analysisIndexPanel(@PathVariable("userId") String userId) { |
||||
|
return sysAnalysisMenuService.getAnalysisIndexPanel(userId); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,94 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
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.*; |
||||
|
import com.elink.esua.epdc.excel.*; |
||||
|
import com.elink.esua.epdc.service.SysAnalysisRoleMenuService; |
||||
|
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; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 角色菜单关系 |
||||
|
* |
||||
|
* @author elink elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-25 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("analysisrolemenu") |
||||
|
public class SysAnalysisRoleMenuController { |
||||
|
|
||||
|
@Autowired |
||||
|
private SysAnalysisRoleMenuService sysAnalysisRoleMenuService; |
||||
|
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<SysAnalysisRoleMenuDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<SysAnalysisRoleMenuDTO> page = sysAnalysisRoleMenuService.page(params); |
||||
|
return new Result<PageData<SysAnalysisRoleMenuDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("{id}") |
||||
|
public Result<SysAnalysisRoleMenuDTO> get(@PathVariable("id") String id){ |
||||
|
SysAnalysisRoleMenuDTO data = sysAnalysisRoleMenuService.get(id); |
||||
|
return new Result<SysAnalysisRoleMenuDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody SysAnalysisRoleMenuDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
sysAnalysisRoleMenuService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
public Result update(@RequestBody SysAnalysisRoleMenuDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
sysAnalysisRoleMenuService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
sysAnalysisRoleMenuService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<SysAnalysisRoleMenuDTO> list = sysAnalysisRoleMenuService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, SysAnalysisRoleMenuExcel.class); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,84 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
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.dto.SysAnalysisMenuDTO; |
||||
|
import com.elink.esua.epdc.dto.epdc.result.EpdcAppChildNavResultDTO; |
||||
|
import com.elink.esua.epdc.entity.AppMenuEntity; |
||||
|
import com.elink.esua.epdc.entity.SysAnalysisMenuEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 菜单管理 |
||||
|
* |
||||
|
* @author elink elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-25 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface SysAnalysisMenuDao extends BaseDao<SysAnalysisMenuEntity> { |
||||
|
|
||||
|
/** |
||||
|
* @param userId |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < com.elink.esua.epdc.dto.epdc.result.EpdcAppChildNavResultDTO>> |
||||
|
* @Author lpf |
||||
|
* @Description 首页面板 获取数据端APP菜单 |
||||
|
* @Date 2020/03/18 10:42 |
||||
|
**/ |
||||
|
List<EpdcAppChildNavResultDTO> getAnalysisIndexPanel(String userId); |
||||
|
|
||||
|
/** |
||||
|
* 获取菜单详细信息 |
||||
|
* @param id |
||||
|
* @return |
||||
|
*/ |
||||
|
SysAnalysisMenuDTO selectByIdDIY(@Param("id") String id, @Param("language") String language); |
||||
|
|
||||
|
/** |
||||
|
* 查询所有菜单列表 |
||||
|
* |
||||
|
* @param type 菜单类型 |
||||
|
* @param language 语言 |
||||
|
*/ |
||||
|
List<AppMenuEntity> getMenuList(@Param("type") Integer type, @Param("language") String language); |
||||
|
|
||||
|
/** |
||||
|
* 查询用户菜单列表 |
||||
|
* |
||||
|
* @param userId 用户ID |
||||
|
* @param type 菜单类型 |
||||
|
* @param language 语言 |
||||
|
*/ |
||||
|
List<AppMenuEntity> getUserMenuList(@Param("userId") Long userId, @Param("type") Integer type, @Param("language") String language); |
||||
|
|
||||
|
/** |
||||
|
* 获取app菜单列表 |
||||
|
* |
||||
|
* @param type 菜单类型 |
||||
|
* @param language 语言 |
||||
|
* @return java.util.List<com.elink.esua.epdc.dto.AppMenuDTO> |
||||
|
* @author work@yujt.net.cn |
||||
|
* @date 2019/11/19 13:43 |
||||
|
*/ |
||||
|
List<AppMenuDTO> selectListAppMenu(@Param("type") Integer type, @Param("language") String language); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,50 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.dao; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
||||
|
import com.elink.esua.epdc.entity.SysAnalysisRoleMenuEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 角色菜单关系 |
||||
|
* |
||||
|
* @author elink elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-25 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface SysAnalysisRoleMenuDao extends BaseDao<SysAnalysisRoleMenuEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 根据角色id,删除角色数据权限关系 |
||||
|
* |
||||
|
* @param roleId 角色id |
||||
|
*/ |
||||
|
void deleteByRoleId(Long roleId); |
||||
|
|
||||
|
/** |
||||
|
* 根据角色ID,获取菜单ID列表 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return |
||||
|
*/ |
||||
|
List<Long> getAnalysisMenuIdList(Long id); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,120 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
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 com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 菜单管理 |
||||
|
* |
||||
|
* @author elink elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-25 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("sys_analysis_menu") |
||||
|
public class SysAnalysisMenuEntity extends BaseEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 上级ID,一级菜单为0 |
||||
|
*/ |
||||
|
private Long pid; |
||||
|
|
||||
|
/** |
||||
|
* 菜单名称 |
||||
|
*/ |
||||
|
@TableField(exist = false) |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 类型 0:菜单 1:按钮 |
||||
|
*/ |
||||
|
private Integer type; |
||||
|
|
||||
|
/** |
||||
|
* 菜单图标 |
||||
|
*/ |
||||
|
private String icon; |
||||
|
|
||||
|
/** |
||||
|
* 样式名称 |
||||
|
*/ |
||||
|
private String className; |
||||
|
|
||||
|
/** |
||||
|
* 排序 |
||||
|
*/ |
||||
|
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; |
||||
|
|
||||
|
/** |
||||
|
* 上级菜单名称 |
||||
|
*/ |
||||
|
@TableField(exist = false) |
||||
|
private String parentName; |
||||
|
|
||||
|
/** |
||||
|
* 菜单编码 |
||||
|
*/ |
||||
|
private String menuCode; |
||||
|
|
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
private String remark; |
||||
|
|
||||
|
/** |
||||
|
* 子模板ID |
||||
|
*/ |
||||
|
private String templateId; |
||||
|
|
||||
|
/** |
||||
|
* 是否显示数字 0否 1是 |
||||
|
*/ |
||||
|
private String numFlag; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,63 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity; |
||||
|
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 角色菜单关系 |
||||
|
* |
||||
|
* @author elink elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-25 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("sys_analysis_role_menu") |
||||
|
public class SysAnalysisRoleMenuEntity extends BaseEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 角色ID |
||||
|
*/ |
||||
|
private Long roleId; |
||||
|
|
||||
|
/** |
||||
|
* 菜单ID |
||||
|
*/ |
||||
|
private Long menuId; |
||||
|
|
||||
|
/** |
||||
|
* 创建者 |
||||
|
*/ |
||||
|
private Long creator; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createDate; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,83 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 菜单管理 |
||||
|
* |
||||
|
* @author elink elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-25 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SysAnalysisMenuExcel { |
||||
|
|
||||
|
@Excel(name = "id") |
||||
|
private Long id; |
||||
|
|
||||
|
@Excel(name = "上级ID,一级菜单为0") |
||||
|
private Long pid; |
||||
|
|
||||
|
@Excel(name = "类型 0:菜单 1:按钮") |
||||
|
private Integer type; |
||||
|
|
||||
|
@Excel(name = "模块名称") |
||||
|
private String modelname; |
||||
|
|
||||
|
@Excel(name = "菜单图标") |
||||
|
private String icon; |
||||
|
|
||||
|
@Excel(name = "样式名称") |
||||
|
private String className; |
||||
|
|
||||
|
@Excel(name = "菜单编码(议题管理-待回应:10001,议题管理-待处理:10002,项目管理-待处理:10003,用户管理-待认证居民:10004,消息:10005)") |
||||
|
private String menuCode; |
||||
|
|
||||
|
@Excel(name = "模板ID") |
||||
|
private String templateId; |
||||
|
|
||||
|
@Excel(name = "是否显示数字 0否 1是") |
||||
|
private String numFlag; |
||||
|
|
||||
|
@Excel(name = "排序") |
||||
|
private Integer sort; |
||||
|
|
||||
|
@Excel(name = "备注") |
||||
|
private String remark; |
||||
|
|
||||
|
@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; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,50 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 角色菜单关系 |
||||
|
* |
||||
|
* @author elink elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-25 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SysAnalysisRoleMenuExcel { |
||||
|
|
||||
|
@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; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,47 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
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 elink elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-25 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class SysAnalysisMenuRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,47 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
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 elink elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-25 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class SysAnalysisRoleMenuRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,125 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
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.commons.tools.security.user.UserDetail; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.dto.epdc.result.EpdcAppChildNavResultDTO; |
||||
|
import com.elink.esua.epdc.entity.SysAnalysisMenuEntity; |
||||
|
import com.elink.esua.epdc.dto.*; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 菜单管理 |
||||
|
* |
||||
|
* @author elink elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-25 |
||||
|
*/ |
||||
|
public interface SysAnalysisMenuService extends BaseService<SysAnalysisMenuEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<SysAnalysisMenuDTO> |
||||
|
* @author generator |
||||
|
* @date 2020-03-25 |
||||
|
*/ |
||||
|
PageData<SysAnalysisMenuDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<SysAnalysisMenuDTO> |
||||
|
* @author generator |
||||
|
* @date 2020-03-25 |
||||
|
*/ |
||||
|
List<SysAnalysisMenuDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 判断是否有子级菜单 |
||||
|
* |
||||
|
* @param id 菜单ID |
||||
|
* @return boolean |
||||
|
* @author work@yujt.net.cn |
||||
|
* @date 2019/11/19 14:30 |
||||
|
*/ |
||||
|
boolean hasChileMenu(Long id); |
||||
|
|
||||
|
List<AppMenuDTO> getAnalysisMenuList(Integer type); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return SysAnalysisMenuDTO |
||||
|
* @author generator |
||||
|
* @date 2020-03-25 |
||||
|
*/ |
||||
|
SysAnalysisMenuDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2020-03-25 |
||||
|
*/ |
||||
|
void save(SysAnalysisMenuDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2020-03-25 |
||||
|
*/ |
||||
|
void update(SysAnalysisMenuDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 用户app端菜单列表 |
||||
|
* |
||||
|
* @param userDetail 用户信息 |
||||
|
* @param type 菜单类型 |
||||
|
*/ |
||||
|
List<AppMenuDTO> getUserMenuList(UserDetail userDetail, Integer type); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2020-03-25 |
||||
|
*/ |
||||
|
void delete(Long id); |
||||
|
/** |
||||
|
* @param userId |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < com.elink.esua.epdc.dto.epdc.result.EpdcAppChildNavResultDTO>> |
||||
|
* @Author lpf |
||||
|
* @Description 首页面板 获取数据端APP菜单 |
||||
|
* @Date 2020/03/18 10:42 |
||||
|
**/ |
||||
|
Result<List<EpdcAppChildNavResultDTO>> getAnalysisIndexPanel(String userId); |
||||
|
} |
||||
@ -0,0 +1,111 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
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.*; |
||||
|
import com.elink.esua.epdc.entity.SysAnalysisRoleMenuEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 角色菜单关系 |
||||
|
* |
||||
|
* @author elink elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-25 |
||||
|
*/ |
||||
|
public interface SysAnalysisRoleMenuService extends BaseService<SysAnalysisRoleMenuEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<SysAnalysisRoleMenuDTO> |
||||
|
* @author generator |
||||
|
* @date 2020-03-25 |
||||
|
*/ |
||||
|
PageData<SysAnalysisRoleMenuDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<SysAnalysisRoleMenuDTO> |
||||
|
* @author generator |
||||
|
* @date 2020-03-25 |
||||
|
*/ |
||||
|
List<SysAnalysisRoleMenuDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 保存或修改 |
||||
|
* |
||||
|
* @param roleId 角色ID |
||||
|
* @param analysisMenuIdList 菜单ID列表 |
||||
|
*/ |
||||
|
void saveOrUpdate(Long roleId, List<Long> analysisMenuIdList); |
||||
|
|
||||
|
/** |
||||
|
* 根据角色id,删除角色数据权限关系 |
||||
|
* |
||||
|
* @param roleId 角色id |
||||
|
*/ |
||||
|
void deleteByRoleId(Long roleId); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return SysAnalysisRoleMenuDTO |
||||
|
* @author generator |
||||
|
* @date 2020-03-25 |
||||
|
*/ |
||||
|
SysAnalysisRoleMenuDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2020-03-25 |
||||
|
*/ |
||||
|
void save(SysAnalysisRoleMenuDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2020-03-25 |
||||
|
*/ |
||||
|
void update(SysAnalysisRoleMenuDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2020-03-25 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
List<Long> getAnalysisMenuIdList(Long id); |
||||
|
} |
||||
@ -0,0 +1,162 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
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.enums.SuperAdminEnum; |
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.commons.tools.security.user.UserDetail; |
||||
|
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.Result; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.TreeUtils; |
||||
|
import com.elink.esua.epdc.dao.SysAnalysisMenuDao; |
||||
|
import com.elink.esua.epdc.dto.*; |
||||
|
import com.elink.esua.epdc.dto.epdc.result.EpdcAppChildNavResultDTO; |
||||
|
import com.elink.esua.epdc.entity.AppMenuEntity; |
||||
|
import com.elink.esua.epdc.entity.SysAnalysisMenuEntity; |
||||
|
import com.elink.esua.epdc.enums.MenuTableEnum; |
||||
|
import com.elink.esua.epdc.redis.SysAnalysisMenuRedis; |
||||
|
import com.elink.esua.epdc.service.SysAnalysisMenuService; |
||||
|
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; |
||||
|
|
||||
|
/** |
||||
|
* 菜单管理 |
||||
|
* |
||||
|
* @author elink elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-25 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class SysAnalysisMenuServiceImpl extends BaseServiceImpl<SysAnalysisMenuDao, SysAnalysisMenuEntity> implements SysAnalysisMenuService { |
||||
|
|
||||
|
@Autowired |
||||
|
private SysAnalysisMenuRedis sysAnalysisMenuRedis; |
||||
|
@Autowired |
||||
|
private SysLanguageService sysLanguageService; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<SysAnalysisMenuDTO> page(Map<String, Object> params) { |
||||
|
IPage<SysAnalysisMenuEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, SysAnalysisMenuDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<SysAnalysisMenuDTO> list(Map<String, Object> params) { |
||||
|
List<SysAnalysisMenuEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, SysAnalysisMenuDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<SysAnalysisMenuEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<SysAnalysisMenuEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
@Override |
||||
|
public List<AppMenuDTO> getAnalysisMenuList(Integer type) { |
||||
|
List<AppMenuDTO> menuList = baseDao.selectListAppMenu(type, HttpContextUtils.getLanguage()); |
||||
|
return TreeUtils.build(menuList, Constant.MENU_ROOT); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public SysAnalysisMenuDTO get(String id) { |
||||
|
SysAnalysisMenuDTO dto = baseDao.selectByIdDIY(id,HttpContextUtils.getLanguage()); |
||||
|
return dto; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(SysAnalysisMenuDTO dto) { |
||||
|
SysAnalysisMenuEntity entity = ConvertUtils.sourceToTarget(dto, SysAnalysisMenuEntity.class); |
||||
|
insert(entity); |
||||
|
sysLanguageService.saveOrUpdate(MenuTableEnum.ANALYSIS.value(), entity.getId(), "name", dto.getName(), HttpContextUtils.getLanguage()); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(SysAnalysisMenuDTO dto) { |
||||
|
SysAnalysisMenuEntity entity = ConvertUtils.sourceToTarget(dto, SysAnalysisMenuEntity.class); |
||||
|
updateById(entity); |
||||
|
sysLanguageService.saveOrUpdate(MenuTableEnum.ANALYSIS.value(), entity.getId(), "name", dto.getName(), HttpContextUtils.getLanguage()); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(Long id) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteById(id); |
||||
|
} |
||||
|
@Override |
||||
|
public boolean hasChileMenu(Long id) { |
||||
|
QueryWrapper<SysAnalysisMenuEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq("pid", id) |
||||
|
.eq(FieldConstant.DEL_FLAG, DelFlagEnum.NORMAL.value()); |
||||
|
Integer selectCount = baseDao.selectCount(wrapper); |
||||
|
return selectCount > NumConstant.ZERO; |
||||
|
} |
||||
|
/** |
||||
|
* 用户app端菜单列表 |
||||
|
* |
||||
|
* @param userDetail 用户信息 |
||||
|
* @param type 菜单类型 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<AppMenuDTO> getUserMenuList(UserDetail userDetail, Integer type) { |
||||
|
List<AppMenuEntity> menuList; |
||||
|
|
||||
|
//系统管理员,拥有最高权限
|
||||
|
if (userDetail.getSuperAdmin() == SuperAdminEnum.YES.value()) { |
||||
|
menuList = baseDao.getMenuList(type, HttpContextUtils.getLanguage()); |
||||
|
} else { |
||||
|
menuList = baseDao.getUserMenuList(userDetail.getId(), type, HttpContextUtils.getLanguage()); |
||||
|
} |
||||
|
|
||||
|
List<AppMenuDTO> dtoList = ConvertUtils.sourceToTarget(menuList, AppMenuDTO.class); |
||||
|
|
||||
|
return TreeUtils.build(dtoList); |
||||
|
} |
||||
|
@Override |
||||
|
public Result<List<EpdcAppChildNavResultDTO>> getAnalysisIndexPanel(String userId) { |
||||
|
if (StringUtils.isBlank(userId)) { |
||||
|
return new Result().error("用户Id不能为空"); |
||||
|
} |
||||
|
List<EpdcAppChildNavResultDTO> list = this.baseDao.getAnalysisIndexPanel(userId); |
||||
|
return new Result().ok(list); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,150 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.service.impl; |
||||
|
|
||||
|
import cn.hutool.core.collection.CollUtil; |
||||
|
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.SysAnalysisRoleMenuDao; |
||||
|
import com.elink.esua.epdc.dto.*; |
||||
|
import com.elink.esua.epdc.entity.SysAnalysisRoleMenuEntity; |
||||
|
import com.elink.esua.epdc.redis.SysAnalysisRoleMenuRedis; |
||||
|
import com.elink.esua.epdc.service.SysAnalysisRoleMenuService; |
||||
|
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; |
||||
|
|
||||
|
/** |
||||
|
* 角色菜单关系 |
||||
|
* |
||||
|
* @author elink elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-25 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class SysAnalysisRoleMenuServiceImpl extends BaseServiceImpl<SysAnalysisRoleMenuDao, SysAnalysisRoleMenuEntity> implements SysAnalysisRoleMenuService { |
||||
|
|
||||
|
@Autowired |
||||
|
private SysAnalysisRoleMenuRedis sysAnalysisRoleMenuRedis; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<SysAnalysisRoleMenuDTO> page(Map<String, Object> params) { |
||||
|
IPage<SysAnalysisRoleMenuEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, SysAnalysisRoleMenuDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<SysAnalysisRoleMenuDTO> list(Map<String, Object> params) { |
||||
|
List<SysAnalysisRoleMenuEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, SysAnalysisRoleMenuDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<SysAnalysisRoleMenuEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<SysAnalysisRoleMenuEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
/** |
||||
|
* 保存或修改 |
||||
|
* |
||||
|
* @param roleId 角色ID |
||||
|
* @param appMenuIdList 菜单ID列表 |
||||
|
*/ |
||||
|
@Override |
||||
|
public void saveOrUpdate(Long roleId, List<Long> analysisMenuIdList) { |
||||
|
//先删除角色菜单权限关系
|
||||
|
deleteByRoleId(roleId); |
||||
|
|
||||
|
//角色没有一个菜单权限的情况
|
||||
|
if (CollUtil.isEmpty(analysisMenuIdList)) { |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
//保存角色菜单权限关系
|
||||
|
for (Long menuId : analysisMenuIdList) { |
||||
|
SysAnalysisRoleMenuEntity appRoleMenuEntity = new SysAnalysisRoleMenuEntity(); |
||||
|
appRoleMenuEntity.setMenuId(menuId); |
||||
|
appRoleMenuEntity.setRoleId(roleId); |
||||
|
|
||||
|
//保存
|
||||
|
insert(appRoleMenuEntity); |
||||
|
} |
||||
|
} |
||||
|
/** |
||||
|
* 根据角色id,删除角色数据权限关系 |
||||
|
* |
||||
|
* @param roleId 角色id |
||||
|
*/ |
||||
|
@Override |
||||
|
public void deleteByRoleId(Long roleId) { |
||||
|
baseDao.deleteByRoleId(roleId); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public SysAnalysisRoleMenuDTO get(String id) { |
||||
|
SysAnalysisRoleMenuEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, SysAnalysisRoleMenuDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(SysAnalysisRoleMenuDTO dto) { |
||||
|
SysAnalysisRoleMenuEntity entity = ConvertUtils.sourceToTarget(dto, SysAnalysisRoleMenuEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(SysAnalysisRoleMenuDTO dto) { |
||||
|
SysAnalysisRoleMenuEntity entity = ConvertUtils.sourceToTarget(dto, SysAnalysisRoleMenuEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
/** |
||||
|
* 根据角色ID,获取菜单ID列表 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<Long> getAnalysisMenuIdList(Long id) { |
||||
|
return baseDao.getAnalysisMenuIdList(id); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,132 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.elink.esua.epdc.dao.SysAnalysisMenuDao"> |
||||
|
|
||||
|
<resultMap type="com.elink.esua.epdc.entity.SysAnalysisMenuEntity" id="sysAnalysisMenuMap"> |
||||
|
<result property="id" column="id"/> |
||||
|
<result property="pid" column="pid"/> |
||||
|
<result property="type" column="type"/> |
||||
|
<result property="modelname" column="modelName"/> |
||||
|
<result property="icon" column="icon"/> |
||||
|
<result property="className" column="class_name"/> |
||||
|
<result property="menuCode" column="menu_code"/> |
||||
|
<result property="templateId" column="template_id"/> |
||||
|
<result property="numFlag" column="num_flag"/> |
||||
|
<result property="sort" column="sort"/> |
||||
|
<result property="remark" column="remark"/> |
||||
|
<result property="delFlag" column="del_flag"/> |
||||
|
<result property="creator" column="creator"/> |
||||
|
<result property="createDate" column="create_date"/> |
||||
|
<result property="updater" column="updater"/> |
||||
|
<result property="updateDate" column="update_date"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<select id="selectListAppMenu" resultType="com.elink.esua.epdc.dto.AppMenuDTO"> |
||||
|
SELECT |
||||
|
m.*, |
||||
|
l.field_value AS `NAME` |
||||
|
FROM |
||||
|
sys_analysis_menu m |
||||
|
LEFT JOIN sys_language l ON m.id = l.table_id AND l.table_name = 'sys_analysis_menu' AND l.field_name = 'name' AND l.LANGUAGE = #{language} |
||||
|
WHERE m.del_flag = 0 |
||||
|
<if test="type != null">AND m.type = #{type}</if> |
||||
|
ORDER BY m.sort ASC |
||||
|
</select> |
||||
|
<select id="selectByIdDIY" resultType="com.elink.esua.epdc.dto.SysAnalysisMenuDTO"> |
||||
|
SELECT |
||||
|
m.*, |
||||
|
l.field_value AS `NAME`, |
||||
|
ll.field_value as parentName |
||||
|
FROM |
||||
|
sys_analysis_menu m |
||||
|
LEFT JOIN sys_language ll ON m.pid = ll.table_id |
||||
|
LEFT JOIN sys_language l ON m.id = l.table_id AND l.table_name = 'sys_analysis_menu' AND l.field_name = 'name' AND l.LANGUAGE = #{language} |
||||
|
WHERE m.del_flag = 0 |
||||
|
AND m.id = #{id} |
||||
|
</select> |
||||
|
<select id="getMenuList" resultType="com.elink.esua.epdc.entity.AppMenuEntity"> |
||||
|
select t1.*, ( |
||||
|
SELECT |
||||
|
lang.field_value |
||||
|
FROM |
||||
|
sys_language lang |
||||
|
WHERE |
||||
|
lang.table_name = 'sys_analysis_menu' |
||||
|
AND lang.field_name = 'name' |
||||
|
AND lang.table_id = t1.id |
||||
|
AND lang.LANGUAGE = #{language} |
||||
|
) as name |
||||
|
from sys_analysis_menu t1 |
||||
|
where t1.del_flag = 0 |
||||
|
<if test="type != null"> |
||||
|
and t1.type = #{type} |
||||
|
</if> |
||||
|
order by t1.sort asc |
||||
|
</select> |
||||
|
|
||||
|
<select id="getUserMenuList" resultType="com.elink.esua.epdc.entity.AppMenuEntity"> |
||||
|
select t3.*,( |
||||
|
SELECT |
||||
|
lang.field_value |
||||
|
FROM |
||||
|
sys_language lang |
||||
|
WHERE |
||||
|
lang.table_name = 'sys_analysis_menu' |
||||
|
AND lang.field_name = 'name' |
||||
|
AND lang.table_id = t3.id |
||||
|
AND lang.LANGUAGE = #{language} |
||||
|
) as name |
||||
|
from sys_role_user t1 |
||||
|
left join sys_analysis_role_menu t2 on t1.role_id = t2.role_id |
||||
|
left join sys_analysis_menu t3 on t2.menu_id = t3.id |
||||
|
where t1.user_id = #{userId} and t3.del_flag = 0 |
||||
|
<if test="type != null"> |
||||
|
and t3.type = #{type} |
||||
|
</if> |
||||
|
order by t3.sort asc |
||||
|
</select> |
||||
|
|
||||
|
<resultMap id="AnalysisIndexPanelResultDTOMap" type="com.elink.esua.epdc.dto.epdc.result.EpdcAppChildNavResultDTO"> |
||||
|
<id column="label" property="label"/> |
||||
|
<result column="navCode" property="navCode"/> |
||||
|
<result column="remark" property="remark"/> |
||||
|
<result column="icon" property="icon"/> |
||||
|
<result column="className" property="className"/> |
||||
|
<result column="numFlag" property="numFlag"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<select id="getAnalysisIndexPanel" resultMap="AnalysisIndexPanelResultDTOMap"> |
||||
|
SELECT |
||||
|
lc.field_value AS label, |
||||
|
mc.menu_code AS navCode, |
||||
|
mc.remark, |
||||
|
mc.class_name AS className, |
||||
|
mc.icon, |
||||
|
mc.num_flag as numFlag |
||||
|
FROM |
||||
|
sys_analysis_menu mp |
||||
|
LEFT JOIN sys_language lp ON lp.table_id = mp.id |
||||
|
LEFT JOIN sys_analysis_menu mc ON mp.id = mc.pid |
||||
|
LEFT JOIN sys_language lc ON lc.table_id = mc.id |
||||
|
WHERE |
||||
|
mc.id IN ( |
||||
|
SELECT |
||||
|
m.id meauId |
||||
|
FROM |
||||
|
sys_user u |
||||
|
LEFT JOIN sys_role_user ru ON ru.user_id = u.id |
||||
|
LEFT JOIN sys_analysis_role_menu am ON am.role_id = ru.role_id |
||||
|
LEFT JOIN sys_analysis_menu m ON am.menu_id = m.id and m.del_flag = 0 |
||||
|
LEFT JOIN sys_analysis_menu m1 ON m1.id = m.pid and m1.del_flag = 0 |
||||
|
WHERE |
||||
|
u.id =#{userId} |
||||
|
and u.del_flag = 0 |
||||
|
and am.menu_id IS NOT NULL |
||||
|
AND m.pid != 0 |
||||
|
and m1.menu_code = 10010 |
||||
|
)order by mp.sort asc,mc.sort asc |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,21 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.elink.esua.epdc.dao.SysAnalysisRoleMenuDao"> |
||||
|
|
||||
|
<resultMap type="com.elink.esua.epdc.entity.SysAnalysisRoleMenuEntity" id="sysAnalysisRoleMenuMap"> |
||||
|
<result property="id" column="id"/> |
||||
|
<result property="roleId" column="role_id"/> |
||||
|
<result property="menuId" column="menu_id"/> |
||||
|
<result property="creator" column="creator"/> |
||||
|
<result property="createDate" column="create_date"/> |
||||
|
</resultMap> |
||||
|
<delete id="deleteByRoleId"> |
||||
|
delete from sys_analysis_role_menu where role_id = #{value} |
||||
|
</delete> |
||||
|
|
||||
|
<select id="getAnalysisMenuIdList" resultType="long"> |
||||
|
select menu_id from sys_analysis_role_menu where role_id = #{value} |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,146 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.dto.user; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 网格开通情况 |
||||
|
* |
||||
|
* @author qu elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-25 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class MetaUserGridOpiningDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 网格id |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 用户总数 |
||||
|
*/ |
||||
|
private int registerCount; |
||||
|
|
||||
|
/** |
||||
|
* 党员数 |
||||
|
*/ |
||||
|
private int partyCount; |
||||
|
|
||||
|
/** |
||||
|
* 已注册居民 |
||||
|
*/ |
||||
|
private int residentCount; |
||||
|
|
||||
|
/** |
||||
|
* 未注册居民 |
||||
|
*/ |
||||
|
private int unAuthorizedCount; |
||||
|
|
||||
|
/** |
||||
|
* 新闻发布数 |
||||
|
*/ |
||||
|
private int newsCount; |
||||
|
|
||||
|
/** |
||||
|
* 社群数 |
||||
|
*/ |
||||
|
private int communityCount; |
||||
|
|
||||
|
/** |
||||
|
* 群成员数 |
||||
|
*/ |
||||
|
private int communityMemberCount; |
||||
|
|
||||
|
/** |
||||
|
* 群话题数 |
||||
|
*/ |
||||
|
private int communityTopicCount; |
||||
|
|
||||
|
/** |
||||
|
* 议题总数 |
||||
|
*/ |
||||
|
private int eventCount; |
||||
|
|
||||
|
/** |
||||
|
* 项目数 |
||||
|
*/ |
||||
|
private int itemCount; |
||||
|
|
||||
|
/** |
||||
|
* 项目已解决数 |
||||
|
*/ |
||||
|
private int itemCloseCount; |
||||
|
|
||||
|
/** |
||||
|
* 好评数 |
||||
|
*/ |
||||
|
private int itemPraiseCount; |
||||
|
|
||||
|
/** |
||||
|
* 网格名称 |
||||
|
*/ |
||||
|
private String allDeptName; |
||||
|
|
||||
|
/** |
||||
|
* 网格党建指导员姓名 |
||||
|
*/ |
||||
|
private String gridLeader; |
||||
|
|
||||
|
/** |
||||
|
* 删除标记 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 注册时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,127 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.dto.user; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* 党员排行 |
||||
|
* |
||||
|
* @author qu elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-26 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class MetaUserPartyRankDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 街道id |
||||
|
*/ |
||||
|
private String streetId; |
||||
|
|
||||
|
/** |
||||
|
* 街道名称 |
||||
|
*/ |
||||
|
private String streetName; |
||||
|
|
||||
|
/** |
||||
|
* 已注册党员数量(已认证) |
||||
|
*/ |
||||
|
private Integer partyMemberCount; |
||||
|
|
||||
|
/** |
||||
|
* 年龄超过50岁党员数量 |
||||
|
*/ |
||||
|
private Integer oldCount; |
||||
|
|
||||
|
/** |
||||
|
* 老龄化比例 |
||||
|
*/ |
||||
|
private BigDecimal oldPercent; |
||||
|
|
||||
|
/** |
||||
|
* 年龄50岁以下的党员数量 |
||||
|
*/ |
||||
|
private Integer youngCount; |
||||
|
|
||||
|
/** |
||||
|
* 年轻化比例 |
||||
|
*/ |
||||
|
private BigDecimal youngPercent; |
||||
|
|
||||
|
/** |
||||
|
* 男 |
||||
|
*/ |
||||
|
private Integer maleCount; |
||||
|
|
||||
|
/** |
||||
|
* 女 |
||||
|
*/ |
||||
|
private Integer femaleCount; |
||||
|
|
||||
|
/** |
||||
|
* 未知性别 |
||||
|
*/ |
||||
|
private Integer unknownSexCount; |
||||
|
|
||||
|
/** |
||||
|
* 党员认证失败数 |
||||
|
*/ |
||||
|
private Integer partyAuthFailureCount; |
||||
|
|
||||
|
/** |
||||
|
* 删除标记 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 注册时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,137 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.dto.user; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* 用户注册排行 |
||||
|
* |
||||
|
* @author qu elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-26 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class MetaUserRegisterRankDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 街道id |
||||
|
*/ |
||||
|
private String streetId; |
||||
|
|
||||
|
/** |
||||
|
* 街道名称 |
||||
|
*/ |
||||
|
private String streetName; |
||||
|
|
||||
|
/** |
||||
|
* 用户总数 |
||||
|
*/ |
||||
|
private Integer userCount; |
||||
|
|
||||
|
/** |
||||
|
* 党员数 |
||||
|
*/ |
||||
|
private Integer partyMemberCount; |
||||
|
|
||||
|
/** |
||||
|
* 已注册居民 |
||||
|
*/ |
||||
|
private Integer residentCount; |
||||
|
|
||||
|
/** |
||||
|
* 为注册居民 |
||||
|
*/ |
||||
|
private Integer unAuthorizedCount; |
||||
|
|
||||
|
/** |
||||
|
* 年龄超过50岁 |
||||
|
*/ |
||||
|
private Integer oldCount; |
||||
|
|
||||
|
/** |
||||
|
* 老龄化比例 |
||||
|
*/ |
||||
|
private BigDecimal oldPercent; |
||||
|
|
||||
|
/** |
||||
|
* 50岁以下用户数量 |
||||
|
*/ |
||||
|
private Integer youngCount; |
||||
|
|
||||
|
/** |
||||
|
* 年轻化比例 |
||||
|
*/ |
||||
|
private BigDecimal youngPercent; |
||||
|
|
||||
|
/** |
||||
|
* 男 |
||||
|
*/ |
||||
|
private Integer maleCount; |
||||
|
|
||||
|
/** |
||||
|
* 女 |
||||
|
*/ |
||||
|
private Integer femaleCount; |
||||
|
|
||||
|
/** |
||||
|
* 未知性别 |
||||
|
*/ |
||||
|
private Integer unknownSexCount; |
||||
|
|
||||
|
/** |
||||
|
* 删除标记 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 注册时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,24 @@ |
|||||
|
package com.elink.esua.epdc.dto.user.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
@Data |
||||
|
public class ExportOperationFormDTO implements Serializable { |
||||
|
|
||||
|
private String operationStartTime; |
||||
|
|
||||
|
private String operationEndTime; |
||||
|
|
||||
|
/** |
||||
|
* 所有部门列表 |
||||
|
*/ |
||||
|
private List<Long[]> allDeptIdsShow; |
||||
|
|
||||
|
private List<Long> allStreetIds; |
||||
|
|
||||
|
private String endTime; |
||||
|
} |
||||
@ -0,0 +1,81 @@ |
|||||
|
package com.elink.esua.epdc.dto.user.result; |
||||
|
|
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @author: qushutong |
||||
|
* @Date: 2020/3/23 14:47 |
||||
|
* @Description: 运营导出数据 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ExportOperationDataResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -798787916350968587L; |
||||
|
|
||||
|
/** |
||||
|
* 居民数 |
||||
|
*/ |
||||
|
private int registerCount = 0; |
||||
|
|
||||
|
/** |
||||
|
* 未认证用户数 |
||||
|
*/ |
||||
|
private int unAuthorizedCount = 0; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 党员数 |
||||
|
*/ |
||||
|
private int partyCount = 0; |
||||
|
|
||||
|
/** |
||||
|
* 新闻发布数 |
||||
|
*/ |
||||
|
private int newsCount = 0; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 议题数 |
||||
|
*/ |
||||
|
private int eventCount = 0; |
||||
|
|
||||
|
/** |
||||
|
* 项目数 |
||||
|
*/ |
||||
|
private int itemCount = 0; |
||||
|
|
||||
|
/** |
||||
|
* 项目解决数 |
||||
|
*/ |
||||
|
private int itemCloseCount = 0; |
||||
|
|
||||
|
/** |
||||
|
* 社群数 |
||||
|
*/ |
||||
|
private int communityCount = 0; |
||||
|
|
||||
|
/** |
||||
|
* 社群成员数 |
||||
|
*/ |
||||
|
private int communityMemberCount = 0; |
||||
|
|
||||
|
/** |
||||
|
* 社群话题数 |
||||
|
*/ |
||||
|
private int communityTopicCount = 0; |
||||
|
|
||||
|
/** |
||||
|
* 街道 |
||||
|
*/ |
||||
|
private String streetName; |
||||
|
|
||||
|
/** |
||||
|
* 企业数 |
||||
|
*/ |
||||
|
private int enterpriseCount = 0; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,55 @@ |
|||||
|
package com.elink.esua.epdc.excel; |
||||
|
|
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @author: qushutong |
||||
|
* @Date: 2020/3/23 14:47 |
||||
|
* @Description: 运营导出数据 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ExportOperationDataExcel implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 4935348597474149310L; |
||||
|
|
||||
|
@Excel(name = "街道") |
||||
|
private String streetName; |
||||
|
|
||||
|
@Excel(name = "居民数") |
||||
|
private int registerCount = 0; |
||||
|
|
||||
|
@Excel(name = "企业数") |
||||
|
private int enterpriseCount = 0; |
||||
|
|
||||
|
@Excel(name = "已认证党员数") |
||||
|
private int partyCount = 0; |
||||
|
|
||||
|
@Excel(name = "新闻发布数") |
||||
|
private int newsCount = 0; |
||||
|
|
||||
|
|
||||
|
@Excel(name = "议题数") |
||||
|
private int eventCount = 0; |
||||
|
|
||||
|
@Excel(name = "项目数") |
||||
|
private int itemCount = 0; |
||||
|
|
||||
|
@Excel(name = "项目结案数") |
||||
|
private int itemCloseCount = 0; |
||||
|
|
||||
|
@Excel(name = "社群数") |
||||
|
private int communityCount = 0; |
||||
|
|
||||
|
@Excel(name = "社群成员数") |
||||
|
private int communityMemberCount = 0; |
||||
|
|
||||
|
@Excel(name = "社群话题数") |
||||
|
private int communityTopicCount = 0; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,104 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.modules.user.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.user.MetaUserGridOpiningDTO; |
||||
|
import com.elink.esua.epdc.dto.user.result.GridOpeningResultDTO; |
||||
|
import com.elink.esua.epdc.modules.user.excel.MetaUserGridOpiningExcel; |
||||
|
import com.elink.esua.epdc.modules.user.service.MetaUserGridOpiningService; |
||||
|
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; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 网格开通情况 |
||||
|
* |
||||
|
* @author qu elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-25 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("metausergridopining") |
||||
|
public class MetaUserGridOpiningController { |
||||
|
|
||||
|
@Autowired |
||||
|
private MetaUserGridOpiningService metaUserGridOpiningService; |
||||
|
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<MetaUserGridOpiningDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<MetaUserGridOpiningDTO> page = metaUserGridOpiningService.page(params); |
||||
|
return new Result<PageData<MetaUserGridOpiningDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("{id}") |
||||
|
public Result<MetaUserGridOpiningDTO> get(@PathVariable("id") String id){ |
||||
|
MetaUserGridOpiningDTO data = metaUserGridOpiningService.get(id); |
||||
|
return new Result<MetaUserGridOpiningDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody MetaUserGridOpiningDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
metaUserGridOpiningService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
public Result update(@RequestBody MetaUserGridOpiningDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
metaUserGridOpiningService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
metaUserGridOpiningService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<MetaUserGridOpiningDTO> list = metaUserGridOpiningService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, MetaUserGridOpiningExcel.class); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @author: qushutong |
||||
|
* @Date: 2020/3/25 10:35 |
||||
|
* @Description: 临时表导入 |
||||
|
*/ |
||||
|
@GetMapping("tolead") |
||||
|
public Result<List<GridOpeningResultDTO>> tolead() { |
||||
|
return metaUserGridOpiningService.createUserAnalysisData(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,107 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.modules.user.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.user.MetaUserPartyRankDTO; |
||||
|
import com.elink.esua.epdc.modules.user.excel.MetaUserPartyRankExcel; |
||||
|
import com.elink.esua.epdc.modules.user.service.MetaUserPartyRankService; |
||||
|
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; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 党员排行 |
||||
|
* |
||||
|
* @author qu elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-26 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("metauserpartyrank") |
||||
|
public class MetaUserPartyRankController { |
||||
|
|
||||
|
@Autowired |
||||
|
private MetaUserPartyRankService metaUserPartyRankService; |
||||
|
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<MetaUserPartyRankDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<MetaUserPartyRankDTO> page = metaUserPartyRankService.page(params); |
||||
|
return new Result<PageData<MetaUserPartyRankDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("{id}") |
||||
|
public Result<MetaUserPartyRankDTO> get(@PathVariable("id") String id){ |
||||
|
MetaUserPartyRankDTO data = metaUserPartyRankService.get(id); |
||||
|
return new Result<MetaUserPartyRankDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody MetaUserPartyRankDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
metaUserPartyRankService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
public Result update(@RequestBody MetaUserPartyRankDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
metaUserPartyRankService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
metaUserPartyRankService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<MetaUserPartyRankDTO> list = metaUserPartyRankService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, MetaUserPartyRankExcel.class); |
||||
|
} |
||||
|
|
||||
|
/*** |
||||
|
* 定时任务导入 |
||||
|
* @param |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
||||
|
* @author qushutong |
||||
|
* @date 2020/3/26 18:22 |
||||
|
*/ |
||||
|
@GetMapping("toLeadPartyRankData") |
||||
|
public Result toLeadPartyRankData(){ |
||||
|
|
||||
|
return metaUserPartyRankService.toLeadPartyRankData(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,104 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.modules.user.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.user.MetaUserRegisterRankDTO; |
||||
|
import com.elink.esua.epdc.modules.user.excel.MetaUserRegisterRankExcel; |
||||
|
import com.elink.esua.epdc.modules.user.service.MetaUserRegisterRankService; |
||||
|
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; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 用户注册排行 |
||||
|
* |
||||
|
* @author qu elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-26 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("metauserregisterrank") |
||||
|
public class MetaUserRegisterRankController { |
||||
|
|
||||
|
@Autowired |
||||
|
private MetaUserRegisterRankService metaUserRegisterRankService; |
||||
|
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<MetaUserRegisterRankDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<MetaUserRegisterRankDTO> page = metaUserRegisterRankService.page(params); |
||||
|
return new Result<PageData<MetaUserRegisterRankDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("{id}") |
||||
|
public Result<MetaUserRegisterRankDTO> get(@PathVariable("id") String id){ |
||||
|
MetaUserRegisterRankDTO data = metaUserRegisterRankService.get(id); |
||||
|
return new Result<MetaUserRegisterRankDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody MetaUserRegisterRankDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
metaUserRegisterRankService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
public Result update(@RequestBody MetaUserRegisterRankDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
metaUserRegisterRankService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
metaUserRegisterRankService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<MetaUserRegisterRankDTO> list = metaUserRegisterRankService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, MetaUserRegisterRankExcel.class); |
||||
|
} |
||||
|
/*** |
||||
|
* 定时任务用户注册排行导入数据 |
||||
|
* @param |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
||||
|
* @author qushutong |
||||
|
* @date 2020/3/26 13:44 |
||||
|
*/ |
||||
|
@GetMapping("toLeadUserRegisterRandData") |
||||
|
public Result toLeadUserRegisterRandData(){ |
||||
|
return metaUserRegisterRankService.toLeadUserRegisterRandData(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,45 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.modules.user.dao; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.modules.user.entity.MetaUserGridOpiningEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 网格开通情况 |
||||
|
* |
||||
|
* @author qu elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-25 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface MetaUserGridOpiningDao extends BaseDao<MetaUserGridOpiningEntity> { |
||||
|
|
||||
|
/*** |
||||
|
* 列表 |
||||
|
* @param params |
||||
|
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.modules.user.entity.MetaUserGridOpiningEntity> |
||||
|
* @author qushutong |
||||
|
* @date 2020/3/25 17:30 |
||||
|
*/ |
||||
|
List<MetaUserGridOpiningEntity> pageselectListPage(Map<String,Object> params); |
||||
|
} |
||||
@ -0,0 +1,46 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.modules.user.dao; |
||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
|
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
||||
|
import com.elink.esua.epdc.modules.user.entity.MetaUserPartyRankEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 党员排行 |
||||
|
* |
||||
|
* @author qu elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-26 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface MetaUserPartyRankDao extends BaseDao<MetaUserPartyRankEntity> { |
||||
|
|
||||
|
/*** |
||||
|
* 分页 |
||||
|
* @param params |
||||
|
* @return java.util.List<com.elink.esua.epdc.modules.user.entity.MetaUserPartyRankEntity> |
||||
|
* @author qushutong |
||||
|
* @date 2020/3/26 18:36 |
||||
|
*/ |
||||
|
List<MetaUserPartyRankEntity> selectPagePartyRank(Map<String,Object> params); |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,55 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.modules.user.dao; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
|
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
||||
|
import com.elink.esua.epdc.modules.user.entity.MetaUserRegisterRankEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 用户注册排行 |
||||
|
* |
||||
|
* @author qu elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-26 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface MetaUserRegisterRankDao extends BaseDao<MetaUserRegisterRankEntity> { |
||||
|
|
||||
|
/*** |
||||
|
* 分页 |
||||
|
* @param params |
||||
|
* @return java.util.List<com.elink.esua.epdc.modules.user.entity.MetaUserRegisterRankEntity> |
||||
|
* @author qushutong |
||||
|
* @date 2020/3/26 15:41 |
||||
|
*/ |
||||
|
List<MetaUserRegisterRankEntity> selectPageUserRegisterRank(Map<String,Object> params); |
||||
|
|
||||
|
|
||||
|
/*** |
||||
|
* 获取当前用户拥有权限的街道id |
||||
|
* @param params |
||||
|
* @return java.util.List<java.lang.String> |
||||
|
* @author qushutong |
||||
|
* @date 2020/3/26 16:54 |
||||
|
*/ |
||||
|
List<String> selectListStreetId(Map<String,Object> params); |
||||
|
} |
||||
@ -0,0 +1,116 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.modules.user.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 网格开通情况 |
||||
|
* |
||||
|
* @author qu elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-25 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("meta_epdc_user_grid_opining") |
||||
|
public class MetaUserGridOpiningEntity extends BaseEpdcEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 网格id |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 用户总数 |
||||
|
*/ |
||||
|
private int registerCount; |
||||
|
|
||||
|
/** |
||||
|
* 党员数 |
||||
|
*/ |
||||
|
private int partyCount; |
||||
|
|
||||
|
/** |
||||
|
* 已注册居民 |
||||
|
*/ |
||||
|
private int residentCount; |
||||
|
|
||||
|
/** |
||||
|
* 未注册居民 |
||||
|
*/ |
||||
|
private int unAuthorizedCount; |
||||
|
|
||||
|
/** |
||||
|
* 新闻发布数 |
||||
|
*/ |
||||
|
private int newsCount; |
||||
|
|
||||
|
/** |
||||
|
* 社群数 |
||||
|
*/ |
||||
|
private int communityCount; |
||||
|
|
||||
|
/** |
||||
|
* 群成员数 |
||||
|
*/ |
||||
|
private int communityMemberCount; |
||||
|
|
||||
|
/** |
||||
|
* 群话题数 |
||||
|
*/ |
||||
|
private int communityTopicCount; |
||||
|
|
||||
|
/** |
||||
|
* 议题总数 |
||||
|
*/ |
||||
|
private int eventCount; |
||||
|
|
||||
|
/** |
||||
|
* 项目数 |
||||
|
*/ |
||||
|
private int itemCount; |
||||
|
|
||||
|
/** |
||||
|
* 项目已解决数 |
||||
|
*/ |
||||
|
private int itemCloseCount; |
||||
|
|
||||
|
/** |
||||
|
* 好评数 |
||||
|
*/ |
||||
|
private int itemPraiseCount; |
||||
|
|
||||
|
/** |
||||
|
* 网格名称 |
||||
|
*/ |
||||
|
private String allDeptName; |
||||
|
|
||||
|
/** |
||||
|
* 网格党建指导员姓名 |
||||
|
*/ |
||||
|
private String gridLeader; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,97 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.modules.user.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 党员排行 |
||||
|
* |
||||
|
* @author qu elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-26 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("meta_epdc_user_party_rank") |
||||
|
public class MetaUserPartyRankEntity extends BaseEpdcEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 街道id |
||||
|
*/ |
||||
|
private String streetId; |
||||
|
|
||||
|
/** |
||||
|
* 街道名称 |
||||
|
*/ |
||||
|
private String streetName; |
||||
|
|
||||
|
/** |
||||
|
* 已注册党员数量(已认证) |
||||
|
*/ |
||||
|
private Integer partyMemberCount; |
||||
|
|
||||
|
/** |
||||
|
* 年龄超过50岁党员数量 |
||||
|
*/ |
||||
|
private Integer oldCount; |
||||
|
|
||||
|
/** |
||||
|
* 老龄化比例 |
||||
|
*/ |
||||
|
private BigDecimal oldPercent; |
||||
|
|
||||
|
/** |
||||
|
* 年龄50岁以下的党员数量 |
||||
|
*/ |
||||
|
private Integer youngCount; |
||||
|
|
||||
|
/** |
||||
|
* 年轻化比例 |
||||
|
*/ |
||||
|
private BigDecimal youngPercent; |
||||
|
|
||||
|
/** |
||||
|
* 男 |
||||
|
*/ |
||||
|
private Integer maleCount; |
||||
|
|
||||
|
/** |
||||
|
* 女 |
||||
|
*/ |
||||
|
private Integer femaleCount; |
||||
|
|
||||
|
/** |
||||
|
* 未知性别 |
||||
|
*/ |
||||
|
private Integer unknownSexCount; |
||||
|
|
||||
|
/** |
||||
|
* 党员认证失败数 |
||||
|
*/ |
||||
|
private Integer partyAuthFailureCount; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,107 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.modules.user.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 用户注册排行 |
||||
|
* |
||||
|
* @author qu elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-26 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("meta_epdc_user_register_rank") |
||||
|
public class MetaUserRegisterRankEntity extends BaseEpdcEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 街道id |
||||
|
*/ |
||||
|
private String streetId; |
||||
|
|
||||
|
/** |
||||
|
* 街道名称 |
||||
|
*/ |
||||
|
private String streetName; |
||||
|
|
||||
|
/** |
||||
|
* 用户总数 |
||||
|
*/ |
||||
|
private Integer userCount; |
||||
|
|
||||
|
/** |
||||
|
* 党员数 |
||||
|
*/ |
||||
|
private Integer partyMemberCount; |
||||
|
|
||||
|
/** |
||||
|
* 已注册居民 |
||||
|
*/ |
||||
|
private Integer residentCount; |
||||
|
|
||||
|
/** |
||||
|
* 为注册居民 |
||||
|
*/ |
||||
|
private Integer unAuthorizedCount; |
||||
|
|
||||
|
/** |
||||
|
* 年龄超过50岁 |
||||
|
*/ |
||||
|
private Integer oldCount; |
||||
|
|
||||
|
/** |
||||
|
* 老龄化比例 |
||||
|
*/ |
||||
|
private BigDecimal oldPercent; |
||||
|
|
||||
|
/** |
||||
|
* 50岁以下用户数量 |
||||
|
*/ |
||||
|
private Integer youngCount; |
||||
|
|
||||
|
/** |
||||
|
* 年轻化比例 |
||||
|
*/ |
||||
|
private BigDecimal youngPercent; |
||||
|
|
||||
|
/** |
||||
|
* 男 |
||||
|
*/ |
||||
|
private Integer maleCount; |
||||
|
|
||||
|
/** |
||||
|
* 女 |
||||
|
*/ |
||||
|
private Integer femaleCount; |
||||
|
|
||||
|
/** |
||||
|
* 未知性别 |
||||
|
*/ |
||||
|
private Integer unknownSexCount; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,80 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.modules.user.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 网格开通情况 |
||||
|
* |
||||
|
* @author qu elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-25 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class MetaUserGridOpiningExcel { |
||||
|
|
||||
|
@Excel(name = "网格名称") |
||||
|
private String allDeptNames; |
||||
|
|
||||
|
@Excel(name = "网格党建指导员姓名") |
||||
|
private String gridLeader; |
||||
|
|
||||
|
@Excel(name = "用户总数") |
||||
|
private int registerCount; |
||||
|
|
||||
|
@Excel(name = "党员数") |
||||
|
private int partyCount; |
||||
|
|
||||
|
@Excel(name = "已注册居民") |
||||
|
private int residentCount; |
||||
|
|
||||
|
@Excel(name = "未注册居民") |
||||
|
private int unAuthorizedCount; |
||||
|
|
||||
|
@Excel(name = "新闻发布数") |
||||
|
private String newsCount; |
||||
|
|
||||
|
@Excel(name = "社群数") |
||||
|
private int communityCount; |
||||
|
|
||||
|
@Excel(name = "群成员数") |
||||
|
private int communityMemberCount; |
||||
|
|
||||
|
@Excel(name = "群话题数") |
||||
|
private int communityTopicCount; |
||||
|
|
||||
|
@Excel(name = "议题总数") |
||||
|
private int eventCount; |
||||
|
|
||||
|
@Excel(name = "项目数") |
||||
|
private int itemCount; |
||||
|
|
||||
|
@Excel(name = "项目已解决数") |
||||
|
private int itemCloseCount; |
||||
|
|
||||
|
@Excel(name = "好评数") |
||||
|
private int itemPraiseCount; |
||||
|
|
||||
|
@Excel(name = "更新时间", format = "yyyy-MM-dd HH:mm:ss") |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,70 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.modules.user.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 党员排行 |
||||
|
* |
||||
|
* @author qu elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-26 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class MetaUserPartyRankExcel { |
||||
|
|
||||
|
|
||||
|
@Excel(name = "街道名称") |
||||
|
private String streetName; |
||||
|
|
||||
|
@Excel(name = "已注册党员数量(已认证)") |
||||
|
private Integer partyMemberCount; |
||||
|
|
||||
|
@Excel(name = "年龄超过50岁党员数量") |
||||
|
private Integer oldCount; |
||||
|
|
||||
|
@Excel(name = "老龄化比例") |
||||
|
private BigDecimal oldPercent; |
||||
|
|
||||
|
@Excel(name = "年龄50岁以下的党员数量") |
||||
|
private Integer youngCount; |
||||
|
|
||||
|
@Excel(name = "年轻化比例") |
||||
|
private BigDecimal youngPercent; |
||||
|
|
||||
|
@Excel(name = "男") |
||||
|
private Integer maleCount; |
||||
|
|
||||
|
@Excel(name = "女") |
||||
|
private Integer femaleCount; |
||||
|
|
||||
|
@Excel(name = "未知性别") |
||||
|
private Integer unknownSexCount; |
||||
|
|
||||
|
@Excel(name = "党员认证失败数") |
||||
|
private Integer partyAuthFailureCount; |
||||
|
|
||||
|
@Excel(name = "更新时间", format = "yyyy-MM-dd HH:mm:ss") |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,76 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.modules.user.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 用户注册排行 |
||||
|
* |
||||
|
* @author qu elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-26 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class MetaUserRegisterRankExcel { |
||||
|
|
||||
|
|
||||
|
@Excel(name = "街道名称") |
||||
|
private String streetName; |
||||
|
|
||||
|
@Excel(name = "用户总数") |
||||
|
private Integer userCount; |
||||
|
|
||||
|
@Excel(name = "党员数") |
||||
|
private Integer partyMemberCount; |
||||
|
|
||||
|
@Excel(name = "已注册居民") |
||||
|
private Integer residentCount; |
||||
|
|
||||
|
@Excel(name = "为注册居民") |
||||
|
private Integer unAuthorizedCount; |
||||
|
|
||||
|
@Excel(name = "年龄超过50岁") |
||||
|
private Integer oldCount; |
||||
|
|
||||
|
@Excel(name = "老龄化比例") |
||||
|
private BigDecimal oldPercent; |
||||
|
|
||||
|
@Excel(name = "50岁以下用户数量") |
||||
|
private Integer youngCount; |
||||
|
|
||||
|
@Excel(name = "年轻化比例") |
||||
|
private BigDecimal youngPercent; |
||||
|
|
||||
|
@Excel(name = "男") |
||||
|
private Integer maleCount; |
||||
|
|
||||
|
@Excel(name = "女") |
||||
|
private Integer femaleCount; |
||||
|
|
||||
|
@Excel(name = "未知性别") |
||||
|
private Integer unknownSexCount; |
||||
|
|
||||
|
@Excel(name = "更新时间", format = "yyyy-MM-dd HH:mm:ss") |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,107 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.modules.user.service; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.dto.user.MetaUserGridOpiningDTO; |
||||
|
import com.elink.esua.epdc.modules.user.entity.MetaUserGridOpiningEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 网格开通情况 |
||||
|
* |
||||
|
* @author qu elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-25 |
||||
|
*/ |
||||
|
public interface MetaUserGridOpiningService extends BaseService<MetaUserGridOpiningEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<MetaUserGridOpiningDTO> |
||||
|
* @author generator |
||||
|
* @date 2020-03-25 |
||||
|
*/ |
||||
|
PageData<MetaUserGridOpiningDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<MetaUserGridOpiningDTO> |
||||
|
* @author generator |
||||
|
* @date 2020-03-25 |
||||
|
*/ |
||||
|
List<MetaUserGridOpiningDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return MetaUserGridOpiningDTO |
||||
|
* @author generator |
||||
|
* @date 2020-03-25 |
||||
|
*/ |
||||
|
MetaUserGridOpiningDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2020-03-25 |
||||
|
*/ |
||||
|
void save(MetaUserGridOpiningDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2020-03-25 |
||||
|
*/ |
||||
|
void update(MetaUserGridOpiningDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2020-03-25 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
|
||||
|
|
||||
|
|
||||
|
/*** |
||||
|
* 网格开通数据生成临时表导入 |
||||
|
* @param |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
||||
|
* @author qushutong |
||||
|
* @date 2020/3/25 10:42 |
||||
|
*/ |
||||
|
Result createUserAnalysisData(); |
||||
|
} |
||||
@ -0,0 +1,105 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.modules.user.service; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.dto.user.MetaUserPartyRankDTO; |
||||
|
import com.elink.esua.epdc.modules.user.entity.MetaUserPartyRankEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 党员排行 |
||||
|
* |
||||
|
* @author qu elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-26 |
||||
|
*/ |
||||
|
public interface MetaUserPartyRankService extends BaseService<MetaUserPartyRankEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<MetaUserPartyRankDTO> |
||||
|
* @author generator |
||||
|
* @date 2020-03-26 |
||||
|
*/ |
||||
|
PageData<MetaUserPartyRankDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<MetaUserPartyRankDTO> |
||||
|
* @author generator |
||||
|
* @date 2020-03-26 |
||||
|
*/ |
||||
|
List<MetaUserPartyRankDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return MetaUserPartyRankDTO |
||||
|
* @author generator |
||||
|
* @date 2020-03-26 |
||||
|
*/ |
||||
|
MetaUserPartyRankDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2020-03-26 |
||||
|
*/ |
||||
|
void save(MetaUserPartyRankDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2020-03-26 |
||||
|
*/ |
||||
|
void update(MetaUserPartyRankDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2020-03-26 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
|
||||
|
/*** |
||||
|
* 定时任务导入党员排行 |
||||
|
* @param |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
||||
|
* @author qushutong |
||||
|
* @date 2020/3/26 18:23 |
||||
|
*/ |
||||
|
Result toLeadPartyRankData(); |
||||
|
} |
||||
@ -0,0 +1,105 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.modules.user.service; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.dto.user.MetaUserRegisterRankDTO; |
||||
|
import com.elink.esua.epdc.modules.user.entity.MetaUserRegisterRankEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 用户注册排行 |
||||
|
* |
||||
|
* @author qu elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-26 |
||||
|
*/ |
||||
|
public interface MetaUserRegisterRankService extends BaseService<MetaUserRegisterRankEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<MetaUserRegisterRankDTO> |
||||
|
* @author generator |
||||
|
* @date 2020-03-26 |
||||
|
*/ |
||||
|
PageData<MetaUserRegisterRankDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<MetaUserRegisterRankDTO> |
||||
|
* @author generator |
||||
|
* @date 2020-03-26 |
||||
|
*/ |
||||
|
List<MetaUserRegisterRankDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return MetaUserRegisterRankDTO |
||||
|
* @author generator |
||||
|
* @date 2020-03-26 |
||||
|
*/ |
||||
|
MetaUserRegisterRankDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2020-03-26 |
||||
|
*/ |
||||
|
void save(MetaUserRegisterRankDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2020-03-26 |
||||
|
*/ |
||||
|
void update(MetaUserRegisterRankDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2020-03-26 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
|
||||
|
/*** |
||||
|
* 导入用户注册 |
||||
|
* @param |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
||||
|
* @author qushutong |
||||
|
* @date 2020/3/26 13:26 |
||||
|
*/ |
||||
|
Result toLeadUserRegisterRandData(); |
||||
|
} |
||||
@ -0,0 +1,138 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.modules.user.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; |
||||
|
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.commons.tools.utils.DateUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.LocalDateUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.datasources.DataSourceNames; |
||||
|
import com.elink.esua.epdc.datasources.annotation.DataSource; |
||||
|
import com.elink.esua.epdc.dto.user.MetaUserGridOpiningDTO; |
||||
|
import com.elink.esua.epdc.dto.user.result.GridOpeningResultDTO; |
||||
|
import com.elink.esua.epdc.modules.user.dao.MetaUserGridOpiningDao; |
||||
|
import com.elink.esua.epdc.modules.user.entity.MetaUserGridOpiningEntity; |
||||
|
import com.elink.esua.epdc.modules.user.service.MetaUserGridOpiningService; |
||||
|
import com.elink.esua.epdc.modules.user.service.UserAnalysisService; |
||||
|
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.text.ParseException; |
||||
|
import java.text.SimpleDateFormat; |
||||
|
import java.util.*; |
||||
|
|
||||
|
/** |
||||
|
* 网格开通情况 |
||||
|
* |
||||
|
* @author qu elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-25 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class MetaUserGridOpiningServiceImpl extends BaseServiceImpl<MetaUserGridOpiningDao, MetaUserGridOpiningEntity> implements MetaUserGridOpiningService { |
||||
|
@Autowired |
||||
|
private UserAnalysisService userAnalysisService; |
||||
|
|
||||
|
@Override |
||||
|
@DataSource(name = DataSourceNames.TWELVE) |
||||
|
public PageData<MetaUserGridOpiningDTO> page(Map<String, Object> params) { |
||||
|
IPage<MetaUserGridOpiningEntity> page = getPage(params); |
||||
|
List<MetaUserGridOpiningEntity> metaUserGridOpiningEntityList = getMetaUserGridOpiningEntities(params); |
||||
|
return getPageData(metaUserGridOpiningEntityList,page.getTotal(), MetaUserGridOpiningDTO.class); |
||||
|
} |
||||
|
|
||||
|
private List<MetaUserGridOpiningEntity> getMetaUserGridOpiningEntities(Map<String, Object> params) { |
||||
|
// 获取所有网格
|
||||
|
List<GridOpeningResultDTO> gridOpeningResultDTOS = userAnalysisService.selectListGridHasMaCode(params); |
||||
|
List<String> deptIdList = new ArrayList<>(); |
||||
|
for(GridOpeningResultDTO item:gridOpeningResultDTOS){ |
||||
|
deptIdList.add(item.getGridId()); |
||||
|
} |
||||
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
||||
|
params.put("deptIdList",deptIdList); |
||||
|
String time = (String) params.get("createdTime"); |
||||
|
if(StringUtils.isBlank(time)){ |
||||
|
String createdTime = format.format(new Date()); |
||||
|
params.put("createdTime",createdTime); |
||||
|
}else { |
||||
|
String createdTime = DateUtils.dealDateFormat(time); |
||||
|
params.put("createdTime",createdTime); |
||||
|
} |
||||
|
return baseDao.pageselectListPage(params); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@DataSource(name = DataSourceNames.TWELVE) |
||||
|
public List<MetaUserGridOpiningDTO> list(Map<String, Object> params) { |
||||
|
List<MetaUserGridOpiningEntity> entityList = getMetaUserGridOpiningEntities(params); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, MetaUserGridOpiningDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<MetaUserGridOpiningEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<MetaUserGridOpiningEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public MetaUserGridOpiningDTO get(String id) { |
||||
|
MetaUserGridOpiningEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, MetaUserGridOpiningDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(MetaUserGridOpiningDTO dto) { |
||||
|
MetaUserGridOpiningEntity entity = ConvertUtils.sourceToTarget(dto, MetaUserGridOpiningEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(MetaUserGridOpiningDTO dto) { |
||||
|
MetaUserGridOpiningEntity entity = ConvertUtils.sourceToTarget(dto, MetaUserGridOpiningEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
@DataSource(name = DataSourceNames.TWELVE) |
||||
|
public Result createUserAnalysisData() { |
||||
|
List<GridOpeningResultDTO> list = userAnalysisService.getToLeadGridOpenings(new HashMap<>()); |
||||
|
List<MetaUserGridOpiningEntity> metaUserGridOpiningEntities = ConvertUtils.sourceToTarget(list, MetaUserGridOpiningEntity.class); |
||||
|
boolean b = insertBatch(metaUserGridOpiningEntities); |
||||
|
return b?new Result<>():new Result().error("录入失败"); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,140 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.modules.user.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.enums.YesOrNoEnum; |
||||
|
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.DateUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.datasources.DataSourceNames; |
||||
|
import com.elink.esua.epdc.datasources.annotation.DataSource; |
||||
|
import com.elink.esua.epdc.dto.user.MetaUserPartyRankDTO; |
||||
|
import com.elink.esua.epdc.dto.user.result.UserDataRankResultDTO; |
||||
|
import com.elink.esua.epdc.modules.user.dao.MetaUserPartyRankDao; |
||||
|
import com.elink.esua.epdc.modules.user.entity.MetaUserPartyRankEntity; |
||||
|
import com.elink.esua.epdc.modules.user.service.MetaUserPartyRankService; |
||||
|
import com.elink.esua.epdc.modules.user.service.MetaUserRegisterRankService; |
||||
|
import com.elink.esua.epdc.modules.user.service.UserAnalysisService; |
||||
|
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.text.SimpleDateFormat; |
||||
|
import java.util.*; |
||||
|
|
||||
|
/** |
||||
|
* 党员排行 |
||||
|
* |
||||
|
* @author qu elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-26 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class MetaUserPartyRankServiceImpl extends BaseServiceImpl<MetaUserPartyRankDao, MetaUserPartyRankEntity> implements MetaUserPartyRankService { |
||||
|
|
||||
|
@Autowired |
||||
|
private UserAnalysisService userAnalysisService; |
||||
|
|
||||
|
@Autowired |
||||
|
private MetaUserRegisterRankServiceImpl metaUserRegisterRankService; |
||||
|
|
||||
|
@Override |
||||
|
@DataSource(name = DataSourceNames.TWELVE) |
||||
|
public PageData<MetaUserPartyRankDTO> page(Map<String, Object> params) { |
||||
|
IPage<MetaUserPartyRankEntity> page = getPage(params); |
||||
|
List<MetaUserPartyRankEntity> metaUserRegisterRankEntities = getMetaUserPartyRankEntities(params); |
||||
|
return getPageData(metaUserRegisterRankEntities,page.getTotal(), MetaUserPartyRankDTO.class); |
||||
|
} |
||||
|
|
||||
|
private List<MetaUserPartyRankEntity> getMetaUserPartyRankEntities(Map<String, Object> params) { |
||||
|
// 获取权限下的街道id
|
||||
|
List<String> streetIdList = metaUserRegisterRankService.getListStreetId(); |
||||
|
params.put("streetIdList",streetIdList); |
||||
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
||||
|
String time = (String) params.get("createdTime"); |
||||
|
if(StringUtils.isBlank(time)){ |
||||
|
String createdTime = format.format(new Date()); |
||||
|
params.put("createdTime",createdTime); |
||||
|
}else { |
||||
|
String createdTime = DateUtils.dealDateFormat(time); |
||||
|
params.put("createdTime",createdTime); |
||||
|
} |
||||
|
return baseDao.selectPagePartyRank(params); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@DataSource(name = DataSourceNames.TWELVE) |
||||
|
public List<MetaUserPartyRankDTO> list(Map<String, Object> params) { |
||||
|
List<MetaUserPartyRankEntity> entityList = getMetaUserPartyRankEntities(params); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, MetaUserPartyRankDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<MetaUserPartyRankEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<MetaUserPartyRankEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public MetaUserPartyRankDTO get(String id) { |
||||
|
MetaUserPartyRankEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, MetaUserPartyRankDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(MetaUserPartyRankDTO dto) { |
||||
|
MetaUserPartyRankEntity entity = ConvertUtils.sourceToTarget(dto, MetaUserPartyRankEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(MetaUserPartyRankDTO dto) { |
||||
|
MetaUserPartyRankEntity entity = ConvertUtils.sourceToTarget(dto, MetaUserPartyRankEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@DataSource(name = DataSourceNames.TWELVE) |
||||
|
public Result toLeadPartyRankData() { |
||||
|
// 获取导出数据
|
||||
|
Map<String,Object> params = new HashMap<>(); |
||||
|
params.put("partyFlag", YesOrNoEnum.YES.value()); |
||||
|
List<UserDataRankResultDTO> toLeadUserRegisterRandData = userAnalysisService.getToLeadUserRegisterRandData(params); |
||||
|
List<MetaUserPartyRankEntity> metaUserPartyRankEntities = ConvertUtils.sourceToTarget(toLeadUserRegisterRandData, MetaUserPartyRankEntity.class); |
||||
|
return insertBatch(metaUserPartyRankEntities)? new Result(): new Result().error("导入党员排行失败") ; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,147 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.modules.user.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.security.user.SecurityUser; |
||||
|
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.DateUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.datasources.DataSourceNames; |
||||
|
import com.elink.esua.epdc.datasources.annotation.DataSource; |
||||
|
import com.elink.esua.epdc.dto.user.MetaUserRegisterRankDTO; |
||||
|
import com.elink.esua.epdc.dto.user.result.UserDataRankResultDTO; |
||||
|
import com.elink.esua.epdc.modules.user.dao.MetaUserRegisterRankDao; |
||||
|
import com.elink.esua.epdc.modules.user.entity.MetaUserRegisterRankEntity; |
||||
|
import com.elink.esua.epdc.modules.user.service.MetaUserRegisterRankService; |
||||
|
import com.elink.esua.epdc.modules.user.service.UserAnalysisService; |
||||
|
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.text.SimpleDateFormat; |
||||
|
import java.util.*; |
||||
|
|
||||
|
/** |
||||
|
* 用户注册排行 |
||||
|
* |
||||
|
* @author qu elink@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-26 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class MetaUserRegisterRankServiceImpl extends BaseServiceImpl<MetaUserRegisterRankDao, MetaUserRegisterRankEntity> implements MetaUserRegisterRankService { |
||||
|
|
||||
|
@Autowired |
||||
|
private UserAnalysisService userAnalysisService; |
||||
|
@Override |
||||
|
@DataSource(name = DataSourceNames.TWELVE) |
||||
|
public PageData<MetaUserRegisterRankDTO> page(Map<String, Object> params) { |
||||
|
IPage<MetaUserRegisterRankEntity> page = getPage(params); |
||||
|
List<MetaUserRegisterRankEntity> metaUserRegisterRankEntities = getMetaUserRegisterRankEntities(params); |
||||
|
return getPageData(metaUserRegisterRankEntities,page.getTotal(), MetaUserRegisterRankDTO.class); |
||||
|
} |
||||
|
|
||||
|
private List<MetaUserRegisterRankEntity> getMetaUserRegisterRankEntities(Map<String, Object> params) { |
||||
|
// 获取权限下的街道id
|
||||
|
List<String> streetIdList = getListStreetId(); |
||||
|
params.put("streetIdList",streetIdList); |
||||
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
||||
|
String time = (String) params.get("createdTime"); |
||||
|
if(StringUtils.isBlank(time)){ |
||||
|
String createdTime = format.format(new Date()); |
||||
|
params.put("createdTime",createdTime); |
||||
|
}else { |
||||
|
String createdTime = DateUtils.dealDateFormat(time); |
||||
|
params.put("createdTime",createdTime); |
||||
|
} |
||||
|
return baseDao.selectPageUserRegisterRank(params); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@DataSource(name = DataSourceNames.TWELVE) |
||||
|
public List<MetaUserRegisterRankDTO> list(Map<String, Object> params) { |
||||
|
List<MetaUserRegisterRankEntity> entityList = getMetaUserRegisterRankEntities(params); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, MetaUserRegisterRankDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<MetaUserRegisterRankEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<MetaUserRegisterRankEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public MetaUserRegisterRankDTO get(String id) { |
||||
|
MetaUserRegisterRankEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, MetaUserRegisterRankDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(MetaUserRegisterRankDTO dto) { |
||||
|
MetaUserRegisterRankEntity entity = ConvertUtils.sourceToTarget(dto, MetaUserRegisterRankEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(MetaUserRegisterRankDTO dto) { |
||||
|
MetaUserRegisterRankEntity entity = ConvertUtils.sourceToTarget(dto, MetaUserRegisterRankEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@DataSource(name = DataSourceNames.TWELVE) |
||||
|
public Result toLeadUserRegisterRandData() { |
||||
|
// 获取导出数据
|
||||
|
List<UserDataRankResultDTO> toLeadUserRegisterRandData = userAnalysisService.getToLeadUserRegisterRandData(new HashMap<>()); |
||||
|
// 导入数据
|
||||
|
List<MetaUserRegisterRankEntity> metaUserRegisterRankEntities = ConvertUtils.sourceToTarget(toLeadUserRegisterRandData, MetaUserRegisterRankEntity.class); |
||||
|
return insertBatch(metaUserRegisterRankEntities) ? new Result():new Result().error("导入注册用户排行失败"); |
||||
|
} |
||||
|
|
||||
|
/*** |
||||
|
* 获取当前用户拥有权限的街道id |
||||
|
* @param |
||||
|
* @return java.util.List<java.lang.String> |
||||
|
* @author qushutong |
||||
|
* @date 2020/3/26 16:57 |
||||
|
*/ |
||||
|
public List<String> getListStreetId() { |
||||
|
Map params = new HashMap(); |
||||
|
params.put("deptIdList", SecurityUser.getUser().getDeptIdList()); |
||||
|
return baseDao.selectListStreetId(params); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,48 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.elink.esua.epdc.modules.user.dao.MetaUserGridOpiningDao"> |
||||
|
|
||||
|
<resultMap type="com.elink.esua.epdc.modules.user.entity.MetaUserGridOpiningEntity" id="metaUserGridOpiningMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="gridId" column="GRID_ID"/> |
||||
|
<result property="registerCount" column="REGISTER_COUNT"/> |
||||
|
<result property="partyCount" column="PARTY_COUNT"/> |
||||
|
<result property="residentCount" column="RESIDENT_COUNT"/> |
||||
|
<result property="unAuthorizedCount" column="UN_AUTHORIZED_COUNT"/> |
||||
|
<result property="newsCount" column="NEWS_COUNT"/> |
||||
|
<result property="communityCount" column="COMMUNITY_COUNT"/> |
||||
|
<result property="communityMemberCount" column="COMMUNITY_MEMBER_COUNT"/> |
||||
|
<result property="communityTopicCount" column="COMMUNITY_TOPIC_COUNT"/> |
||||
|
<result property="eventCount" column="EVENT_COUNT"/> |
||||
|
<result property="itemCount" column="ITEM_COUNT"/> |
||||
|
<result property="itemCloseCount" column="ITEM_CLOSE_COUNT"/> |
||||
|
<result property="itemPraiseCount" column="ITEM_PRAISE_COUNT"/> |
||||
|
<result property="allDeptName" column="ALL_DEPT_NAME"/> |
||||
|
<result property="gridLeader" column="GRID_LEADER"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<result property="revision" column="REVISION"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
</resultMap> |
||||
|
<select id="pageselectListPage" resultMap="metaUserGridOpiningMap"> |
||||
|
SELECT |
||||
|
* |
||||
|
FROM |
||||
|
meta_epdc_user_grid_opining op |
||||
|
WHERE |
||||
|
del_flag = '0' |
||||
|
<if test="deptIdList!=null and deptIdList.size()>0"> |
||||
|
and op.GRID_ID in |
||||
|
<foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")"> |
||||
|
#{deptId} |
||||
|
</foreach> |
||||
|
</if> |
||||
|
<if test="createdTime!=null and createdTime != ''"> |
||||
|
and op.CREATED_TIME like concat('%', #{createdTime}, '%') |
||||
|
</if> |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,48 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.elink.esua.epdc.modules.user.dao.MetaUserPartyRankDao"> |
||||
|
|
||||
|
<resultMap type="com.elink.esua.epdc.modules.user.entity.MetaUserPartyRankEntity" id="metaUserPartyRankMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="streetId" column="STREET_ID"/> |
||||
|
<result property="streetName" column="STREET_NAME"/> |
||||
|
<result property="partyMemberCount" column="PARTY_MEMBER_COUNT"/> |
||||
|
<result property="oldCount" column="OLD_COUNT"/> |
||||
|
<result property="oldPercent" column="OLD_PERCENT"/> |
||||
|
<result property="youngCount" column="YOUNG_COUNT"/> |
||||
|
<result property="youngPercent" column="YOUNG_PERCENT"/> |
||||
|
<result property="maleCount" column="MALE_COUNT"/> |
||||
|
<result property="femaleCount" column="FEMALE_COUNT"/> |
||||
|
<result property="unknownSexCount" column="UNKNOWN_SEX_COUNT"/> |
||||
|
<result property="partyAuthFailureCount" column="PARTY_AUTH_FAILURE_COUNT"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<result property="revision" column="REVISION"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<select id="selectPagePartyRank" resultMap="metaUserPartyRankMap"> |
||||
|
SELECT |
||||
|
* |
||||
|
FROM |
||||
|
meta_epdc_user_party_rank pr |
||||
|
WHERE |
||||
|
del_flag = '0' |
||||
|
<if test="streetId!=null and streetId != ''"> |
||||
|
and pr.STREET_ID = #{streetId} |
||||
|
</if> |
||||
|
<if test="createdTime!=null and createdTime != ''"> |
||||
|
and pr.CREATED_TIME like concat('%', #{createdTime}, '%') |
||||
|
</if> |
||||
|
<if test="streetIdList!=null and streetIdList.size()>0"> |
||||
|
and pr.STREET_ID in |
||||
|
<foreach collection="streetIdList" index="index" item="streetId" open="(" separator="," close=")"> |
||||
|
#{streetId} |
||||
|
</foreach> |
||||
|
</if> |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,71 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.elink.esua.epdc.modules.user.dao.MetaUserRegisterRankDao"> |
||||
|
|
||||
|
<resultMap type="com.elink.esua.epdc.modules.user.entity.MetaUserRegisterRankEntity" id="metaUserRegisterRankMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="streetId" column="STREET_ID"/> |
||||
|
<result property="streetName" column="STREET_NAME"/> |
||||
|
<result property="userCount" column="USER_COUNT"/> |
||||
|
<result property="partyMemberCount" column="PARTY_MEMBER_COUNT"/> |
||||
|
<result property="residentCount" column="RESIDENT_COUNT"/> |
||||
|
<result property="unAuthorizedCount" column="UN_AUTHORIZED_COUNT"/> |
||||
|
<result property="oldCount" column="OLD_COUNT"/> |
||||
|
<result property="oldPercent" column="OLD_PERCENT"/> |
||||
|
<result property="youngCount" column="YOUNG_COUNT"/> |
||||
|
<result property="youngPercent" column="YOUNG_PERCENT"/> |
||||
|
<result property="maleCount" column="MALE_COUNT"/> |
||||
|
<result property="femaleCount" column="FEMALE_COUNT"/> |
||||
|
<result property="unknownSexCount" column="UNKNOWN_SEX_COUNT"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<result property="revision" column="REVISION"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
</resultMap> |
||||
|
<select id="selectPageUserRegisterRank" resultMap="metaUserRegisterRankMap"> |
||||
|
SELECT |
||||
|
* |
||||
|
FROM |
||||
|
meta_epdc_user_register_rank rr |
||||
|
WHERE |
||||
|
del_flag = '0' |
||||
|
<if test="streetId!=null and streetId != ''"> |
||||
|
and rr.STREET_ID = #{streetId} |
||||
|
</if> |
||||
|
<if test="createdTime!=null and createdTime != ''"> |
||||
|
and rr.CREATED_TIME like concat('%', #{createdTime}, '%') |
||||
|
</if> |
||||
|
<if test="streetIdList!=null and streetIdList.size()>0"> |
||||
|
and rr.STREET_ID in |
||||
|
<foreach collection="streetIdList" index="index" item="streetId" open="(" separator="," close=")"> |
||||
|
#{streetId} |
||||
|
</foreach> |
||||
|
</if> |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectListStreetId" resultType="String"> |
||||
|
SELECT |
||||
|
ad2.id streetId |
||||
|
FROM |
||||
|
esua_epdc_user.epdc_user uu |
||||
|
LEFT JOIN esua_epdc_admin.sys_dept ad ON uu.DEPT_ID = ad.ID |
||||
|
AND ad.type_key = 'grid_party' |
||||
|
LEFT JOIN esua_epdc_admin.sys_dept ad1 ON ad1.id = ad.pid |
||||
|
LEFT JOIN esua_epdc_admin.sys_dept ad2 ON ad2.id = ad1.pid |
||||
|
WHERE |
||||
|
uu.DEL_FLAG = '0' |
||||
|
<if test="deptIdList!=null and deptIdList.size()>0"> |
||||
|
and ad2.ID in |
||||
|
<foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")"> |
||||
|
#{deptId} |
||||
|
</foreach> |
||||
|
</if> |
||||
|
AND ad.id IS NOT NULL |
||||
|
AND ad2.id IS NOT NULL |
||||
|
GROUP BY |
||||
|
ad2.id |
||||
|
</select> |
||||
|
</mapper> |
||||
@ -0,0 +1,41 @@ |
|||||
|
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.feign.fallback.UserFeignClintFallback; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
|
||||
|
/** |
||||
|
* @author: qushutong |
||||
|
* @Date: 2020/3/25 10:20 |
||||
|
* @Description: 用户数据分析 |
||||
|
*/ |
||||
|
@FeignClient(name = ServiceConstant.EPDC_ANALYSIS_SERVER, fallback = UserFeignClintFallback.class) |
||||
|
public interface UserFeignClint { |
||||
|
|
||||
|
/*** |
||||
|
* 生成用户分析数据导入临时表 |
||||
|
* @param |
||||
|
* @return void |
||||
|
* @author qushutong |
||||
|
* @date 2020/3/25 10:19 |
||||
|
*/ |
||||
|
@GetMapping("analysis/metausergridopining/tolead") |
||||
|
Result createUserAnalysisData(); |
||||
|
|
||||
|
/*** |
||||
|
* 用户注册排行导入数据 |
||||
|
* @param |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
||||
|
* @author qushutong |
||||
|
* @date 2020/3/26 17:45 |
||||
|
*/ |
||||
|
@GetMapping("analysis/metauserregisterrank/toLeadUserRegisterRandData") |
||||
|
Result toLeadUserRegisterRandData(); |
||||
|
|
||||
|
|
||||
|
@GetMapping("analysis/metauserpartyrank/toLeadPartyRankData") |
||||
|
Result toLeadPartyRankData(); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,31 @@ |
|||||
|
package com.elink.esua.epdc.feign.fallback; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.feign.UserFeignClint; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* @author: qushutong |
||||
|
* @Date: 2020/3/25 10:22 |
||||
|
* @Description: 用户数据分析 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class UserFeignClintFallback implements UserFeignClint { |
||||
|
|
||||
|
@Override |
||||
|
public Result createUserAnalysisData() { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.EPDC_ANALYSIS_SERVER, "createUserAnalysisData", ""); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result toLeadUserRegisterRandData() { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.EPDC_ANALYSIS_SERVER, "toLeadUserRegisterRandData", ""); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result toLeadPartyRankData() { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.EPDC_ANALYSIS_SERVER, "toLeadPartyRankData", ""); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
package com.elink.esua.epdc.service; |
||||
|
|
||||
|
/** |
||||
|
* @author: qushutong |
||||
|
* @Date: 2020/3/25 10:18 |
||||
|
* @Description: 用户数据分析 |
||||
|
*/ |
||||
|
public interface ScheduleJobUserService { |
||||
|
|
||||
|
/*** |
||||
|
* 生成用户分析数据导入临时表 |
||||
|
* @param |
||||
|
* @return void |
||||
|
* @author qushutong |
||||
|
* @date 2020/3/25 10:19 |
||||
|
*/ |
||||
|
void createUserAnalysisData(); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,29 @@ |
|||||
|
package com.elink.esua.epdc.service.impl; |
||||
|
|
||||
|
import com.elink.esua.epdc.feign.UserFeignClint; |
||||
|
import com.elink.esua.epdc.service.ScheduleJobUserService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
/** |
||||
|
* @author: qushutong |
||||
|
* @Date: 2020/3/25 10:15 |
||||
|
* @Description: 用户数据数据分析 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class ScheduleJobUserServiceImpl implements ScheduleJobUserService { |
||||
|
@Autowired |
||||
|
private UserFeignClint userFeignClint; |
||||
|
|
||||
|
@Override |
||||
|
public void createUserAnalysisData() { |
||||
|
// 网格开通
|
||||
|
userFeignClint.createUserAnalysisData(); |
||||
|
// 用户注册
|
||||
|
userFeignClint.toLeadUserRegisterRandData(); |
||||
|
|
||||
|
// 党员排行绑
|
||||
|
userFeignClint.toLeadPartyRankData(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,18 @@ |
|||||
|
package com.elink.esua.epdc.task.analysis; |
||||
|
|
||||
|
/** |
||||
|
* @author: qushutong |
||||
|
* @Date: 2020/3/25 10:04 |
||||
|
* @Description: 用户分析 |
||||
|
*/ |
||||
|
public interface UserAnalysisTask { |
||||
|
|
||||
|
/*** |
||||
|
* 网格开通情况 |
||||
|
* @param |
||||
|
* @return void |
||||
|
* @author qushutong |
||||
|
* @date 2020/3/25 10:11 |
||||
|
*/ |
||||
|
void run(String params); |
||||
|
} |
||||
@ -0,0 +1,21 @@ |
|||||
|
package com.elink.esua.epdc.task.analysis; |
||||
|
|
||||
|
import com.elink.esua.epdc.service.ScheduleJobUserService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* @author: qushutong |
||||
|
* @Date: 2020/3/25 10:12 |
||||
|
* @Description: |
||||
|
*/ |
||||
|
@Component("UserAnalysisTask") |
||||
|
public class UserAnalysisTaskImpl implements UserAnalysisTask { |
||||
|
@Autowired |
||||
|
private ScheduleJobUserService scheduleJobUserService; |
||||
|
|
||||
|
@Override |
||||
|
public void run(String params) { |
||||
|
scheduleJobUserService.createUserAnalysisData(); |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue