diff --git a/esua-epdc/doc/db/dev_youhua/esua_epdc_user.sql b/esua-epdc/doc/db/dev_youhua/esua_epdc_user.sql new file mode 100644 index 000000000..db8f63d20 --- /dev/null +++ b/esua-epdc/doc/db/dev_youhua/esua_epdc_user.sql @@ -0,0 +1,52 @@ +--------标记一下这个已经随工作端上线 +ALTER TABLE esua_epdc_user.epdc_party_authentication_failed MODIFY COLUMN `STATE` VARCHAR(1) NULL COMMENT '状态 0-认证失败'; +ALTER TABLE esua_epdc_user.epdc_party_authentication_failed MODIFY COLUMN `CADRE_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 0 NULL COMMENT '干部下沉标识 0-否,1-是'; +ALTER TABLE esua_epdc_user.epdc_user_authenticate_history ADD AUTHENTICATED_TYPE varchar(2) NOT NULL COMMENT '认证类别(0-居民认证,1-党员认证,2-志愿者认证)'; +------------------------------------------------ + +CREATE TABLE `epdc_handle_category` ( + `ID` varchar(32) NOT NULL COMMENT '主键', + `CATEGORY_VAL` int(11) NOT NULL COMMENT '处理类别值', + `CATEGORY_LABEL` varchar(20) NOT NULL COMMENT '处理类别显示信息', + `AVAILABLE` varchar(1) NOT NULL DEFAULT '1' COMMENT '可用状态(0-不可用,1-可用)', + `SORT` int(11) NOT NULL DEFAULT '0' COMMENT '排序', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识 0:未删除,1:已删除', + `CATEGORY_CODE` varchar(32) NOT NULL COMMENT '处理类型编码', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='处理类别表' + + +CREATE TABLE `epdc_role_category` ( + `ID` varchar(32) NOT NULL COMMENT '主键', + `ROLE_ID` varchar(32) NOT NULL COMMENT '角色ID', + `CATEGORY_ID` varchar(32) NOT NULL COMMENT '处理类别ID', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识 0:未删除,1:已删除', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色和处理类别关系表' + + +ALTER TABLE EPDC_HANDLE_ROLE_CATEGORY COMMENT '角色和处理类别关系表';; +CREATE TABLE EPDC_HANDLE_ROLE_DEPT( + ID VARCHAR(32) NOT NULL COMMENT '主键' , + ROLE_ID VARCHAR(32) NOT NULL COMMENT '角色ID' , + DEPT_ID VARCHAR(32) NOT NULL COMMENT '部门ID' , + DEPT_TYPE VARCHAR(50) NOT NULL COMMENT '部门机构类型' , + REVISION INT COMMENT '乐观锁' , + CREATED_BY VARCHAR(32) COMMENT '创建人' , + CREATED_TIME DATETIME COMMENT '创建时间' , + UPDATED_BY VARCHAR(32) COMMENT '更新人' , + UPDATED_TIME DATETIME COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '处理部门角色权限表 处理部门角色权限表';; + +ALTER TABLE EPDC_HANDLE_ROLE_DEPT COMMENT '处理部门角色权限表';; diff --git a/esua-epdc/docker-compose/prod/master/application/10.5.34.162-master/docker-compose.yml b/esua-epdc/docker-compose/prod/master/application/10.5.34.162-master/docker-compose.yml index 020aa2d1b..d0b0da8af 100644 --- a/esua-epdc/docker-compose/prod/master/application/10.5.34.162-master/docker-compose.yml +++ b/esua-epdc/docker-compose/prod/master/application/10.5.34.162-master/docker-compose.yml @@ -6,8 +6,8 @@ services: - 443:443 volumes: - /mnt/nginx/html:/usr/share/nginx/html - - /mnt/nginx/conf/nginx.conf:/etc/nginx/nginx.conf - - /mnt/nginx/conf.d:/etc/nginx/conf.d + - /mnt/nginx/conf/nginx.conf:/etc/nginx/nginx.conf:ro + - /mnt/nginx/conf.d:/etc/nginx/conf.d:ro - /mnt/nginx/logs:/var/log/nginx restart: always container_name: nginx_master diff --git a/esua-epdc/docker-compose/prod/nginx/docker-compose.yml b/esua-epdc/docker-compose/prod/nginx/docker-compose.yml new file mode 100644 index 000000000..d0b0da8af --- /dev/null +++ b/esua-epdc/docker-compose/prod/nginx/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3.7' +services: + web: + image: nginx + ports: + - 443:443 + volumes: + - /mnt/nginx/html:/usr/share/nginx/html + - /mnt/nginx/conf/nginx.conf:/etc/nginx/nginx.conf:ro + - /mnt/nginx/conf.d:/etc/nginx/conf.d:ro + - /mnt/nginx/logs:/var/log/nginx + restart: always + container_name: nginx_master + diff --git a/esua-epdc/docker-compose/test/nginx/docker-compose.yml b/esua-epdc/docker-compose/test/nginx/docker-compose.yml new file mode 100644 index 000000000..cfbdcd268 --- /dev/null +++ b/esua-epdc/docker-compose/test/nginx/docker-compose.yml @@ -0,0 +1,15 @@ +version: '3.7' +services: + web: + image: nginx + ports: + - 443:443 + volumes: + - /opt/docker/nginx/html:/usr/share/nginx/html + - /opt/docker/nginx/conf/nginx.conf:/etc/nginx/nginx.conf:ro + - /opt/docker/nginx/conf.d:/etc/nginx/conf.d:ro + - /opt/docker/nginx/logs:/var/log/nginx + - /opt/docker/nginx/cert:/etc/nginx/cert:ro + restart: always + container_name: nginx_master + diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/constant/RoleTypeKeyConstant.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/constant/RoleTypeKeyConstant.java new file mode 100644 index 000000000..4ac881e24 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/constant/RoleTypeKeyConstant.java @@ -0,0 +1,15 @@ +package com.elink.esua.epdc.constant; + +/** + * TypeKey 常量 + * + * @author work@yujt.net.cn + * @date 2019/12/18 10:10 + */ +public interface RoleTypeKeyConstant { + + /** + * 角色:网格长 + */ + String ROLE_GRID_LEADER = "gridLeader"; +} diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/DeptLevelAndLeaderDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/DeptLevelAndLeaderDTO.java new file mode 100644 index 000000000..a097e497a --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/DeptLevelAndLeaderDTO.java @@ -0,0 +1,50 @@ +package com.elink.esua.epdc.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 机构层级关系与机构负责人 + * + * @author work@yujt.net.cn + * @date 2019/12/18 10:55 + */ +@Data +public class DeptLevelAndLeaderDTO implements Serializable { + + private static final long serialVersionUID = 8264059305193996215L; + + /** + * 部门ID + */ + private Long deptId; + /** + * 部门名称 + */ + private String deptName; + /** + * 父所有部门ID + */ + private String parentDeptIds; + /** + * 父所有部门 + */ + private String parentDeptNames; + /** + * 所有部门ID + */ + private String allDeptIds; + /** + * 所有部门名称 + */ + private String allDeptNames; + /** + * 部门负责人名称 + */ + private String leaderName; + /** + * 部门负责人名称 + */ + private String typeKey; +} diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysRoleDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysRoleDTO.java index 306b2ebc6..2f234a40c 100644 --- a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysRoleDTO.java +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysRoleDTO.java @@ -72,4 +72,14 @@ public class SysRoleDTO implements Serializable { * app菜单ID列表 */ private List appMenuIdList; + + /** + * 项目处理类型授权id列表 + */ + private List categoryIdList; + + /** + * 吹哨部门id列表 + */ + private List whistleDeptIdList; } diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysSimpleDictDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysSimpleDictDTO.java index 493c0f1cf..4ff6d87c6 100644 --- a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysSimpleDictDTO.java +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysSimpleDictDTO.java @@ -28,4 +28,6 @@ public class SysSimpleDictDTO implements Serializable { @ApiModelProperty(value = "字典值") private String dictValue; -} \ No newline at end of file + @ApiModelProperty(value = "备注") + private String remark; +} diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/UserSysDeptInfoFormDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/UserSysDeptInfoFormDTO.java index 238a6ea6b..3f530eec5 100644 --- a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/UserSysDeptInfoFormDTO.java +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/UserSysDeptInfoFormDTO.java @@ -16,14 +16,10 @@ public class UserSysDeptInfoFormDTO implements Serializable { /** * 主键集合 */ -// @NotEmpty(message = "deptIdList不能为空") -// @Valid private List deptIdList; /** * 部门类型键值 */ -// @NotEmpty(message = "部门类型不能为空") -// @Valid private List typeKeyList; } diff --git a/esua-epdc/epdc-admin/epdc-admin-server/pom.xml b/esua-epdc/epdc-admin/epdc-admin-server/pom.xml index fcf9f2a23..756d7b035 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/pom.xml +++ b/esua-epdc/epdc-admin/epdc-admin-server/pom.xml @@ -62,6 +62,12 @@ feign-httpclient 10.3.0 + + com.esua.epdc + epdc-events-client + 1.0.0 + compile + diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java index 372629e95..cdfe26a50 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java @@ -131,6 +131,7 @@ public class SysDeptController { public Result getCompleteDept(@PathVariable("gridId") String gridId) { return sysDeptService.getCompleteDept(gridId); } + /** * 通过网格ID获取该网格所有上级机构 * @@ -141,7 +142,7 @@ public class SysDeptController { */ @GetMapping("getParentAndAllDept/{deptId}") public Result getParentAndAllDept(@PathVariable("deptId") String deptId) { - return sysDeptService.getParentAndAllDept(deptId); + return new Result().ok(sysDeptService.getParentAndAllDept(deptId)); } /** @@ -234,4 +235,49 @@ public class SysDeptController { PageData page = sysDeptService.listCompleteDeptDTO(params); return new Result>().ok(page); } + + /*** + * 获取所有网格 kpi模块原始数据 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author qushutong + * @date 2019/12/12 17:26 + */ + @GetMapping("listAllGridId") + public Result listAllGridId() { + return sysDeptService.listAllGridId(); + } + + /** + * 按部门类型,分页查询部门列表 + * + * @param typeKey 部门类型 + * @param pageSize 页容量 + * @param pageIndex 页码 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2019/12/17 16:03 + */ + @GetMapping("pageDeptIdByTypeKey/{typeKey}/{pageSize}/{pageIndex}") + public Result> pageDeptIdByTypeKey(@PathVariable("typeKey") String typeKey, + @PathVariable("pageSize") Integer pageSize, + @PathVariable("pageIndex") Integer pageIndex) { + return sysDeptService.pageDeptIdByTypeKey(typeKey, pageSize, pageIndex); + } + + + /** + * 根据部门id,获取部门层级关系,获取部门领导姓名 + * + * @param deptId 部门id + * @param leaderFlag 是否需要查询网格长姓名 0 否 、1 是 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2019/12/18 11:04 + */ + @GetMapping("getDeptInfoById/{deptId}/{leaderFlag}") + public Result getDeptInfoById(@PathVariable("deptId") Long deptId, + @PathVariable("leaderFlag") String leaderFlag) { + DeptLevelAndLeaderDTO dto = sysDeptService.getDeptInfoById(deptId, leaderFlag); + return new Result().ok(dto); + } } diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysRoleController.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysRoleController.java index dcf0b1f25..3845c6a83 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysRoleController.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysRoleController.java @@ -93,6 +93,14 @@ public class SysRoleController { List appMenuIdList = appRoleMenuService.getAppMenuIdList(id); data.setAppMenuIdList(appMenuIdList); + //查询角色对应的项目处理类型权限 + List categoryIdList = sysRoleService.getCategoryIdList(id); + data.setCategoryIdList(categoryIdList); + + //查询角色对应的吹哨部门 + List whistleDeptIdList=sysRoleService.getWhistleDeptIdList(id); + data.setWhistleDeptIdList(whistleDeptIdList); + return new Result().ok(data); } diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java index 38b7f3a57..8193bca28 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java @@ -9,6 +9,7 @@ package com.elink.esua.epdc.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.CompleteDeptDTO; import com.elink.esua.epdc.dto.DeptTreeDTO; import com.elink.esua.epdc.dto.SysDeptDTO; @@ -156,4 +157,39 @@ public interface SysDeptDao extends BaseDao { List selectListCompleteDeptDTO(Map params); List selectListDeptTreeForEpiDemic(); + + + /*** + * 查询所有网格 + * @param + * @return java.util.List + * @author qushutong + * @date 2019/12/12 18:12 + */ + List selectListAllGridId(); + + /** + * 按部门类型,分页查询部门列表 + * + * @param typeKey 部门类型 + * @param pageSize 页容量 + * @param pageIndex 页码 + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/12/17 16:11 + */ + List pageDeptIdByTypeKey(@Param("typeKey") String typeKey, + @Param("pageSize") Integer pageSize, + @Param("pageIndex") Integer pageIndex); + + /** + * 根据部门id,查询该部门指定角色的用户姓名 + * + * @param deptId 部门id + * @param roleType 角色类型 + * @return java.lang.String + * @author work@yujt.net.cn + * @date 2019/12/18 13:45 + */ + String selectDeptLeaderName(@Param("deptId") Long deptId, @Param("roleType") String roleType); } diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysRoleDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysRoleDao.java index 31de4510a..1310c61b0 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysRoleDao.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysRoleDao.java @@ -1,8 +1,8 @@ /** * Copyright (c) 2018 人人开源 All rights reserved. - * + *

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

* 版权所有,侵权必究! */ @@ -12,6 +12,10 @@ import com.elink.esua.epdc.entity.SysRoleEntity; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.entity.SysRoleEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; /** * 角色管理 @@ -22,4 +26,14 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface SysRoleDao extends BaseDao { + /** + * 根据角色类型,获取机构的此类角色数量 + * + * @param roleType + * @param deptIdList + * @return java.util.List> + * @author work@yujt.net.cn + * @date 2019/12/18 10:20 + */ + List> selectAmountByRoleTpye(@Param("roleType") String roleType, @Param("deptIdList") List deptIdList); } diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/feign/EventFeignClient.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/feign/EventFeignClient.java new file mode 100644 index 000000000..e9990896d --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/feign/EventFeignClient.java @@ -0,0 +1,63 @@ +package com.elink.esua.epdc.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.handleroledept.form.HandleRoleDeptFormDTO; +import com.elink.esua.epdc.dto.rulecategory.form.HandleRoleCategoryFormDTO; +import com.elink.esua.epdc.feign.fallback.EventFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + +import java.util.List; + +/** + * @Auther: yinzuomei + * @Date: 2019/12/24 09:28 + * @Description: 事件接口 + */ +@FeignClient(name = ServiceConstant.EPDC_EVENTS_SERVER, fallback = EventFeignClientFallback.class) +public interface EventFeignClient { + + /** + * @param orgTypeFormDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 保存项目处理类型权限 + * @Date 2019/12/24 17:17 + **/ + @PostMapping(value = "events/handlerolecategory/saveOrUpdate", consumes = MediaType.APPLICATION_JSON_VALUE) + Result saveOrUpdateHandleCategory(HandleRoleCategoryFormDTO orgTypeFormDTO); + + /** + * @param roleId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 查询角色对应的项目处理类型权限 + * @Date 2019/12/24 17:17 + **/ + @GetMapping(value = "events/handlerolecategory/queryCategoryIdList/{roleId}") + Result> queryCategoryIdList(@PathVariable("roleId") Long roleId); + + /** + * @param formDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 保存角色对应可吹哨部门权限 + * @Date 2019/12/26 14:09 + **/ + @PostMapping(value = "events/handleroledept/saveOrUpdate", consumes = MediaType.APPLICATION_JSON_VALUE) + Result saveOrUpdateHandleRoleDept(HandleRoleDeptFormDTO formDTO); + + /** + * @param roleId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 查询角色对应可吹哨部门权限 + * @Date 2019/12/26 14:09 + **/ + @GetMapping(value = "events/handleroledept/queryWhistleDeptIdList/{roleId}") + Result> queryWhistleDeptIdList(@PathVariable("roleId")Long roleId); +} diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/feign/fallback/EventFeignClientFallback.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/feign/fallback/EventFeignClientFallback.java new file mode 100644 index 000000000..ecbaa9bf0 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/feign/fallback/EventFeignClientFallback.java @@ -0,0 +1,41 @@ +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.dto.handleroledept.form.HandleRoleDeptFormDTO; +import com.elink.esua.epdc.dto.rulecategory.form.HandleRoleCategoryFormDTO; +import com.elink.esua.epdc.feign.EventFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @Description + * @Author yinzuomei + * @Date 2019/12/24 9:45 + */ +@Component +public class EventFeignClientFallback implements EventFeignClient { + + @Override + public Result saveOrUpdateHandleCategory(HandleRoleCategoryFormDTO orgTypeFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "saveOrUpdate", orgTypeFormDTO); + } + + @Override + public Result> queryCategoryIdList(Long roleId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "queryCategoryIdList", roleId); + } + + @Override + public Result saveOrUpdateHandleRoleDept(HandleRoleDeptFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "saveOrUpdate", formDTO); + } + + @Override + public Result> queryWhistleDeptIdList(Long roleId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "queryWhistleDeptIdList", roleId); + } + +} diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDeptService.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDeptService.java index 0d79a3d9c..d63d7ce34 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDeptService.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDeptService.java @@ -79,11 +79,11 @@ public interface SysDeptService extends BaseService { * 通过网格ID获取该网格所有上级机构 * * @param deptId - * @return com.elink.esua.epdc.commons.tools.utils.Result + * @return com.elink.esua.epdc.dto.CompleteDeptDTO * @author yujintao * @date 2019/9/7 09:13 */ - Result getParentAndAllDept(String deptId); + ParentAndAllDeptDTO getParentAndAllDept(String deptId); /** * 通过街道ID获取项目可流转部门 @@ -172,7 +172,6 @@ public interface SysDeptService extends BaseService { **/ List listUserSysDeptInfoResultDTO(UserSysDeptInfoFormDTO formDTO); - /*** * 组装所有部门 * @param @@ -216,4 +215,36 @@ public interface SysDeptService extends BaseService { * @date 2020/1/28 10:40 */ DeptOption getAllDeptOptionByLoginUser(); + + /*** + * 获取所有网格 + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author qushutong + * @date 2019/12/12 17:29 + */ + Result> listAllGridId(); + + /** + * 按部门类型,分页查询部门列表 + * + * @param typeKey 部门类型 + * @param pageSize 页容量 + * @param pageIndex 页码 + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author work@yujt.net.cn + * @date 2019/12/17 16:05 + */ + Result> pageDeptIdByTypeKey(String typeKey, Integer pageSize, Integer pageIndex); + + /** + * 根据部门id,获取部门层级关系,获取部门领导姓名 + * + * @param deptId 部门id + * @param leaderFlag 是否需要查询网格长姓名 0 否 、1 是 + * @return com.elink.esua.epdc.dto.DeptLevelAndLeaderDTO + * @author work@yujt.net.cn + * @date 2019/12/18 11:05 + */ + DeptLevelAndLeaderDTO getDeptInfoById(Long deptId, String leaderFlag); } diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysRoleService.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysRoleService.java index 1e1ea15ef..7e06254ee 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysRoleService.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysRoleService.java @@ -36,4 +36,7 @@ public interface SysRoleService extends BaseService { void delete(Long[] ids); + List getCategoryIdList(Long id); + + List getWhistleDeptIdList(Long id); } diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java index de54a8349..0f513f06e 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java @@ -18,7 +18,9 @@ import com.elink.esua.epdc.commons.tools.constant.Constant; import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.constant.OrganizationTypeConstant; +import com.elink.esua.epdc.commons.tools.constant.*; import com.elink.esua.epdc.commons.tools.enums.SuperAdminEnum; +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; import com.elink.esua.epdc.commons.tools.exception.ErrorCode; import com.elink.esua.epdc.commons.tools.exception.RenException; import com.elink.esua.epdc.commons.tools.page.PageData; @@ -30,6 +32,7 @@ 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.utils.Result; import com.elink.esua.epdc.commons.tools.utils.TreeUtils; +import com.elink.esua.epdc.constant.RoleTypeKeyConstant; import com.elink.esua.epdc.dao.SysDeptDao; import com.elink.esua.epdc.dto.*; import com.elink.esua.epdc.dto.epdc.GridForLeaderRegisterDTO; @@ -76,6 +79,7 @@ public class SysDeptServiceImpl extends BaseServiceImpl list(Map params) { //普通管理员,只能查询所属部门及子部门的数据 @@ -248,7 +252,7 @@ public class SysDeptServiceImpl extends BaseServiceImpl getParentAndAllDept(String deptId) { + public ParentAndAllDeptDTO getParentAndAllDept(String deptId) { Long deptIdL = null; try { deptIdL = Long.parseLong(deptId.trim()); @@ -256,7 +260,7 @@ public class SysDeptServiceImpl extends BaseServiceImplgetCompleteDept:::部门ID格式转换异常:::deptId->{}", deptId); } if (null == deptIdL) { - return new Result().error("参数格式异常"); + throw new RenException("参数格式异常"); } CompleteDeptDTO completeDept = this.baseDao.getParentAndAllDept(deptIdL); ParentAndAllDeptDTO parentAndAllDeptDTO = new ParentAndAllDeptDTO(); @@ -279,11 +283,11 @@ public class SysDeptServiceImpl extends BaseServiceImpl userDtoList = this.baseDao.selectListCompleteDeptDTO(params); return new PageData<>(userDtoList, iPage.getTotal()); } + + @Override + public Result> listAllGridId() { + List gridIdList = baseDao.selectListAllGridId(); + + return new Result>().ok(gridIdList); + } + + @Override + public Result> pageDeptIdByTypeKey(String typeKey, Integer pageSize, Integer pageIndex) { + if (null == pageSize || null == pageIndex || pageSize < NumConstant.ONE || pageIndex < NumConstant.ONE) { + return new Result().error("参数错误"); + } + pageIndex = (pageIndex - NumConstant.ONE) * pageSize; + List deptIdList = baseDao.pageDeptIdByTypeKey(typeKey, pageSize, pageIndex); + return new Result().ok(deptIdList); + } + + @Override + public DeptLevelAndLeaderDTO getDeptInfoById(Long deptId, String leaderFlag) { + if (null == deptId || null == leaderFlag) { + return null; + } + SysDeptEntity sysDeptEntity = baseDao.selectById(deptId); + if (null == sysDeptEntity) { + return null; + } + String deptName = sysDeptEntity.getName(); + String pids = sysDeptEntity.getPids(); + // 上级机构id + String parentDeptIds = NumConstant.ZERO_STR.equals(pids) ? "" : pids; + // 全部机构id + String allDeptIds = StringUtils.isBlank(pids) ? String.valueOf(deptId) : + pids.concat(StrConstant.COMMA).concat(String.valueOf(deptId)); + + // 上级机构名称 + String parentDeptNames = ""; + if (StringUtils.isNotBlank(parentDeptIds)) { + String[] pidArray = parentDeptIds.split(StrConstant.COMMA); + List deptNameList = Lists.newArrayList(); + SysDeptEntity dept; + for (int i = 0; i < pidArray.length; i++) { + dept = baseDao.selectById(Long.parseLong(pidArray[i])); + deptNameList.add(dept.getName()); + } + parentDeptNames = StringUtils.join(deptNameList, StrConstant.HYPHEN); + } + // 全部机构名称 + String allDeptNames = StringUtils.isBlank(parentDeptNames) ? deptName : parentDeptNames.concat(StrConstant.HYPHEN).concat(deptName); + + DeptLevelAndLeaderDTO deptLevel = new DeptLevelAndLeaderDTO(); + deptLevel.setDeptId(deptId); + deptLevel.setDeptName(deptName); + deptLevel.setParentDeptIds(parentDeptIds); + deptLevel.setParentDeptNames(parentDeptNames); + deptLevel.setAllDeptIds(allDeptIds); + deptLevel.setAllDeptNames(allDeptNames); + deptLevel.setTypeKey(sysDeptEntity.getTypeKey()); + + if (YesOrNoEnum.YES.value().equals(leaderFlag)) { + String leaderName = baseDao.selectDeptLeaderName(deptId, RoleTypeKeyConstant.ROLE_GRID_LEADER); + deptLevel.setLeaderName(leaderName); + } + + redisUtils.set(RedisKeys.getDeptOptionKey(deptId), deptLevel); + return deptLevel; + } } diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDictServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDictServiceImpl.java index b3f79c64a..5b5a69ffa 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDictServiceImpl.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDictServiceImpl.java @@ -134,7 +134,7 @@ public class SysDictServiceImpl extends BaseServiceImpl sdWrapper = new QueryWrapper<>(); - sdWrapper.select("dict_value", "dict_name"); + sdWrapper.select("dict_value", "dict_name","remark"); sdWrapper.eq("dict_type", dictType); sdWrapper.ne("dict_value", ""); sdWrapper.isNotNull("dict_value"); diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysRoleServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysRoleServiceImpl.java index 7a509dc40..9ae9ebaaa 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysRoleServiceImpl.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysRoleServiceImpl.java @@ -8,25 +8,40 @@ 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.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.FieldConstant; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.constant.OrganizationTypeConstant; import com.elink.esua.epdc.commons.tools.enums.SuperAdminEnum; +import com.elink.esua.epdc.commons.tools.exception.RenException; 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.security.user.UserDetail; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dao.SysDeptDao; +import com.elink.esua.epdc.constant.RoleTypeKeyConstant; import com.elink.esua.epdc.dao.SysRoleDao; +import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; import com.elink.esua.epdc.dto.SysRoleDTO; +import com.elink.esua.epdc.dto.handleroledept.HandleRoleDeptDTO; +import com.elink.esua.epdc.dto.handleroledept.form.HandleRoleDeptFormDTO; +import com.elink.esua.epdc.dto.rulecategory.form.HandleRoleCategoryFormDTO; +import com.elink.esua.epdc.entity.SysDeptEntity; import com.elink.esua.epdc.entity.SysRoleEntity; +import com.elink.esua.epdc.feign.EventFeignClient; import com.elink.esua.epdc.service.*; 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.ArrayList; import java.util.List; import java.util.Map; @@ -49,6 +64,12 @@ public class SysRoleServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -101,6 +122,8 @@ public class SysRoleServiceImpl extends BaseServiceImpl deptidList) { + if (RoleTypeKeyConstant.ROLE_GRID_LEADER.equals(roleType)) { + List> resultList = baseDao.selectAmountByRoleTpye(roleType, deptidList); + if (CollUtil.isEmpty(resultList)) { + return; + } + Map map; + String mapValue; + for (int i = 0; i < resultList.size(); i++) { + map = resultList.get(i); + + mapValue = map.get("typeKey").toString(); + if (!mapValue.equals(OrganizationTypeConstant.ORG_TYPE_GRID_PARTY)) { + continue; + } + + mapValue = map.get("amount").toString(); + if (Integer.parseInt(mapValue) <= NumConstant.THREE) { + continue; + } + mapValue = map.get("id").toString(); + ParentAndAllDeptDTO parentAndAllDept = sysDeptService.getParentAndAllDept(mapValue); + throw new RenException("保存失败:" + parentAndAllDept.getAllDeptNames() + ",网格长多于3人"); + } + } } @Override @@ -130,6 +198,15 @@ public class SysRoleServiceImpl extends BaseServiceImpl + * @Author yinzuomei + * @Description 查询角色对应的项目处理类型权限 + * @Date 2019/12/24 16:03 + **/ + @Override + public List getCategoryIdList(Long id) { + Result> result = eventFeignClient.queryCategoryIdList(id); + return result.getData(); + } + + @Override + public List getWhistleDeptIdList(Long id) { + Result> result = eventFeignClient.queryWhistleDeptIdList(id); + return result.getData(); + } + + /** + * @param roleId + * @param whistleDeptIdList + * @return void + * @Author yinzuomei + * @Description + * @Date 2019/12/26 13:22 + **/ + private void saveOrUpdateWhistleDeptId(Long roleId, List whistleDeptIdList) { + HandleRoleDeptFormDTO formDTO = new HandleRoleDeptFormDTO(); + formDTO.setRoleId(roleId.toString()); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.in(FieldConstant.ID, whistleDeptIdList); + List deptEntityList = sysDeptDao.selectList(wrapper); + List formDTOList = new ArrayList<>(); + for (SysDeptEntity dept : deptEntityList) { + HandleRoleDeptDTO handleRoleDeptDTO = new HandleRoleDeptDTO(); + handleRoleDeptDTO.setDeptId(dept.getId().toString()); + handleRoleDeptDTO.setDeptName(dept.getName()); + handleRoleDeptDTO.setDeptType(dept.getTypeKey()); + handleRoleDeptDTO.setRoleId(roleId.toString()); + formDTOList.add(handleRoleDeptDTO); + } + formDTO.setHandleRoleDeptDTOList(formDTOList); + eventFeignClient.saveOrUpdateHandleRoleDept(formDTO); + } } diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysUserServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysUserServiceImpl.java index 51b1c6a02..f9ded4cc9 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysUserServiceImpl.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysUserServiceImpl.java @@ -191,7 +191,7 @@ public class SysUserServiceImpl extends BaseServiceImpl listGridWhileLeaderRegister(String mobile) { - + //TODO:该方法的获取组织结构不灵活,得重构 create by rongchao QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(FieldConstant.MOBILE, mobile) .eq(FieldConstant.DEL_FLAG, DelFlagEnum.NORMAL.value()); diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDeptDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDeptDao.xml index 27e545402..d316d0c1f 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDeptDao.xml +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDeptDao.xml @@ -5,7 +5,7 @@ SELECT - sd.id, - sd.NAME, - sd.pid, - p.NAME AS parentName, - sd.pids, - NULL AS parentNames, - null as street, - null as community, - (case - when sd.type_key='grid_party' then sd.name - else null - end) as grid + sd.id, + sd.NAME, + sd.pid, + p.NAME AS parentName, + sd.pids, + NULL AS parentNames, + null as street, + null as community, + (case + when sd.type_key='grid_party' then sd.name + else null + end) as grid + FROM + sys_dept sd + LEFT JOIN sys_dept p ON ( sd.pid = p.id ) + WHERE + sd.del_flag = '0' + + AND sd.type_key in + + #{typeKey} + + + + AND sd.id IN + + #{deptId} + + + + + + + + + + diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysRoleDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysRoleDao.xml index 9a422e550..c8cc9d182 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysRoleDao.xml +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysRoleDao.xml @@ -3,4 +3,19 @@ + diff --git a/esua-epdc/epdc-commons/epdc-common-clienttoken/pom.xml b/esua-epdc/epdc-commons/epdc-common-clienttoken/pom.xml index dd4f4e01c..07d4a1526 100644 --- a/esua-epdc/epdc-commons/epdc-common-clienttoken/pom.xml +++ b/esua-epdc/epdc-commons/epdc-common-clienttoken/pom.xml @@ -23,6 +23,12 @@ ${project.version} + + com.esua.epdc + epdc-user-client + ${project.version} + + org.springframework.boot spring-boot-starter-web diff --git a/esua-epdc/epdc-commons/epdc-common-clienttoken/src/main/java/com/elink/esua/epdc/common/token/dto/TokenDto.java b/esua-epdc/epdc-commons/epdc-common-clienttoken/src/main/java/com/elink/esua/epdc/common/token/dto/TokenDto.java index b0989145e..b530dc903 100644 --- a/esua-epdc/epdc-commons/epdc-common-clienttoken/src/main/java/com/elink/esua/epdc/common/token/dto/TokenDto.java +++ b/esua-epdc/epdc-commons/epdc-common-clienttoken/src/main/java/com/elink/esua/epdc/common/token/dto/TokenDto.java @@ -1,8 +1,11 @@ package com.elink.esua.epdc.common.token.dto; +import com.elink.esua.epdc.dto.UserTagInfo; import lombok.Data; import java.io.Serializable; +import java.util.Date; +import java.util.List; /** * 用户token @@ -46,7 +49,12 @@ public class TokenDto implements Serializable { private Long gridId; /** - * 党员标识 0:否、1:是 + * 性别(女性-0,男性-1) */ - private String partyFlag; + private String sex; + + /** + * 用户标签信息列表 + */ + private List userTagInfos; } diff --git a/esua-epdc/epdc-commons/epdc-common-clienttoken/src/main/java/com/elink/esua/epdc/common/token/util/IdentityNoAnalysisUtil.java b/esua-epdc/epdc-commons/epdc-common-clienttoken/src/main/java/com/elink/esua/epdc/common/token/util/IdentityNoAnalysisUtil.java new file mode 100644 index 000000000..ca247743e --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-common-clienttoken/src/main/java/com/elink/esua/epdc/common/token/util/IdentityNoAnalysisUtil.java @@ -0,0 +1,178 @@ +package com.elink.esua.epdc.common.token.util; + +import org.apache.commons.lang3.StringUtils; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; + +/** + * 用户工具类 + * + * @author wanggongfeng + * @Date 19-12-16 + */ +public class IdentityNoAnalysisUtil { + /** + * 15位身份证号 + */ + private static final Integer FIFTEEN_ID_CARD=15; + /** + * 18位身份证号 + */ + private static final Integer EIGHTEEN_ID_CARD=18; + private static SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + + /** + * 从身份证号码中获取生日 + * @param idno + * @return null表示idno错误,未获取到生日 + */ + public static Date getBirthDay(String idno){ + if(!isValid(idno)){ + return null; + } + return toBirthDay(idno.substring(6, 14)); + } + + /** + * 根据身份证号获取性别 + * @param IDCard + * @return + */ + public static String getSex(String IDCard){ + String sex =""; + if (StringUtils.isNotBlank(IDCard)){ + //15位身份证号 + if (IDCard.length() == FIFTEEN_ID_CARD){ + if (Integer.parseInt(IDCard.substring(14, 15)) % 2 == 0) { + sex = "女"; + } else { + sex = "男"; + } + //18位身份证号 + }else if(IDCard.length() == EIGHTEEN_ID_CARD){ + // 判断性别 + if (Integer.parseInt(IDCard.substring(16).substring(0, 1)) % 2 == 0) { + sex = "女"; + } else { + sex = "男"; + } + } + } + return sex; + } + + /** + * 根据身份证号获取年龄 + * @param IDCard + * @return + */ + public static Integer getAge(String IDCard){ + Integer age = 0; + Date date = new Date(); + if (StringUtils.isNotBlank(IDCard)&& isValid(IDCard)){ + //15位身份证号 + if (IDCard.length() == FIFTEEN_ID_CARD){ + // 身份证上的年份(15位身份证为1980年前的) + String uyear = "19" + IDCard.substring(6, 8); + // 身份证上的月份 + String uyue = IDCard.substring(8, 10); + // 当前年份 + String fyear = format.format(date).substring(0, 4); + // 当前月份 + String fyue = format.format(date).substring(5, 7); + if (Integer.parseInt(uyue) <= Integer.parseInt(fyue)) { + age = Integer.parseInt(fyear) - Integer.parseInt(uyear) + 1; + // 当前用户还没过生 + } else { + age = Integer.parseInt(fyear) - Integer.parseInt(uyear); + } + //18位身份证号 + }else if(IDCard.length() == EIGHTEEN_ID_CARD){ + // 身份证上的年份 + String year = IDCard.substring(6).substring(0, 4); + // 身份证上的月份 + String yue = IDCard.substring(10).substring(0, 2); + // 当前年份 + String fyear = format.format(date).substring(0, 4); + // 当前月份 + String fyue = format.format(date).substring(5, 7); + // 当前月份大于用户出身的月份表示已过生日 + if (Integer.parseInt(yue) <= Integer.parseInt(fyue)) { + age = Integer.parseInt(fyear) - Integer.parseInt(year) + 1; + // 当前用户还没过生日 + } else { + age = Integer.parseInt(fyear) - Integer.parseInt(year); + } + } + } + return age; + } + + /** + * 身份证验证 + * @param id 号码内容 + * @return 是否有效 + */ + public static boolean isValid(String id){ + Boolean validResult = true; + //校验长度只能为15或18 + int len = id.length(); + if (len != FIFTEEN_ID_CARD && len != EIGHTEEN_ID_CARD){ + validResult = false; + } + //校验生日 + if (!validDate(id)){ + validResult = false; + } + return validResult; + } + + /** + * 校验生日 + * @param id + * @return + */ + private static boolean validDate(String id) + { + try + { + String birth = id.length() == 15 ? "19" + id.substring(6, 12) : id.substring(6, 14); + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); + Date birthDate = sdf.parse(birth); + if (!birth.equals(sdf.format(birthDate))){ + return false; + } + } + catch (ParseException e) + { + return false; + } + return true; + } + + /** + * 转换成日期 + * @param birthday + * @return + */ + private static Date toBirthDay(String birthday){ + try{ + Calendar calendar = Calendar.getInstance(); + calendar.set(Calendar.YEAR, Integer.parseInt(birthday.substring(0, 4))); + calendar.set(Calendar.MONTH, Integer.parseInt(birthday.substring(4, 6)) - 1);//月份从0开始,所以减1 + calendar.set(Calendar.DAY_OF_MONTH, Integer.parseInt(birthday.substring(6, 8))); + //以下设置意义不大 + calendar.set(Calendar.HOUR_OF_DAY, 0); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.MILLISECOND, 0); + + return calendar.getTime(); + }catch (Exception e){ + return null; + } + } +} diff --git a/esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/entity/DeptScope.java b/esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/entity/DeptScope.java new file mode 100644 index 000000000..cc66e73e9 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/entity/DeptScope.java @@ -0,0 +1,36 @@ +package com.elink.esua.epdc.commons.mybatis.entity; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 部门冗余字段基类 + * + * @author rongchao + * @Date 19-12-18 + */ +@Data +public abstract class DeptScope extends BaseEpdcEntity implements Serializable { + + /*** + *所有部门名称 + */ + private String allDeptNames; + + /*** + *所有部门ID + */ + private String allDeptIds; + + /*** + *父所有部门 + */ + private String parentDeptNames; + + /*** + *父所有部门 + */ + private String parentDeptIds; + +} diff --git a/esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/utils/DeptEntityUtils.java b/esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/utils/DeptEntityUtils.java new file mode 100644 index 000000000..b4d4c792e --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/utils/DeptEntityUtils.java @@ -0,0 +1,74 @@ +package com.elink.esua.epdc.commons.mybatis.utils; + +import com.elink.esua.epdc.commons.mybatis.entity.DeptScope; +import lombok.Data; + +/** + * 部门信息实体工具类 + * + * @author rongchao + * @Date 19-12-18 + */ +public class DeptEntityUtils { + + @Data + public static class DeptDto { + /** + * 父所有部门ID + */ + private String parentDeptIds; + /** + * 父所有部门 + */ + private String parentDeptNames; + /** + * 所有部门ID + */ + private String allDeptIds; + /** + * 所有部门 + */ + private String allDeptNames; + } + + /** + * 装载部门信息 + * + * @param dto + * @param entityClass + * @return T + * @author rongchao + * @since 2019-12-18 + */ + public static T loadDeptInfo(DeptDto dto, Class entityClass) { + try { + T t = entityClass.newInstance(); + t.setAllDeptIds(dto.getAllDeptIds()); + t.setAllDeptNames(dto.getAllDeptNames()); + t.setParentDeptIds(dto.getParentDeptIds()); + t.setParentDeptNames(dto.getParentDeptNames()); + return t; + } catch (InstantiationException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + return null; + } + + /** + * 装载部门信息 + * + * @param dto + * @param entity + * @return void + * @author rongchao + * @since 2019-12-18 + */ + public static void loadDeptInfo(DeptDto dto, T entity) { + entity.setAllDeptIds(dto.getAllDeptIds()); + entity.setAllDeptNames(dto.getAllDeptNames()); + entity.setParentDeptIds(dto.getParentDeptIds()); + entity.setParentDeptNames(dto.getParentDeptNames()); + } +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools-wx-ma/pom.xml b/esua-epdc/epdc-commons/epdc-commons-tools-wx-ma/pom.xml index b427bed4b..e7e900877 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools-wx-ma/pom.xml +++ b/esua-epdc/epdc-commons/epdc-commons-tools-wx-ma/pom.xml @@ -31,4 +31,4 @@ - \ No newline at end of file + diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NacosConfigConstant.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NacosConfigConstant.java new file mode 100644 index 000000000..c3c2d716f --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NacosConfigConstant.java @@ -0,0 +1,12 @@ +package com.elink.esua.epdc.commons.tools.constant; + +/** + * Nacos配置中心相关常量 + * + * @author rongchao + * @Date 20-1-15 + */ +public interface NacosConfigConstant { + + String CONFIG_GROUP = "EPDC_CONFIG_GROUP"; +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NumConstant.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NumConstant.java index dc987077c..b7902105d 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NumConstant.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NumConstant.java @@ -9,17 +9,21 @@ package com.elink.esua.epdc.commons.tools.constant; */ public interface NumConstant { + int TWO_NEG = -2; + int ONE_NEG = -1; int ZERO = 0; int ONE = 1; int TWO = 2; int THREE = 3; int FOUR = 4; int SIX = 6; - - int ONE_NEG = -1; - int TWO_NEG = -2; - + int SEVEN = 7; + int EIGHT = 8; + int NINE = 9; int TEN = 10; + int ELEVEN = 11; + int TWELVE = 12; + int FIFTEEN = 15; int TWENTY = 20; int THIRTY = 30; diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/PointsConstant.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/PointsConstant.java new file mode 100644 index 000000000..f5eb87209 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/PointsConstant.java @@ -0,0 +1,13 @@ +package com.elink.esua.epdc.commons.tools.constant; + +/** + * @Auther: yinzuomei + * @Date: 2019/12/16 19:38 + * @Description: 积分用 + */ +public interface PointsConstant { + /** + * 手动调整积分编码 + */ + String ruleCode ="hand_regulation"; +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/ServiceConstant.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/ServiceConstant.java index 1c33d197b..7dd45bf2d 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/ServiceConstant.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/ServiceConstant.java @@ -84,4 +84,14 @@ public interface ServiceConstant { * 定制功能模块 */ String EPDC_CUSTOM_SERVER = "epdc-custom-server"; + + /** + * 积分模块 + */ + String EPDC_POINTS_SERVER = "epdc-points-server"; + + /** + * 开放接口模块 + */ + String EPDC_API_SERVER = "epdc-api-server"; } diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/StrConstant.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/StrConstant.java new file mode 100644 index 000000000..583d683f6 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/StrConstant.java @@ -0,0 +1,41 @@ +package com.elink.esua.epdc.commons.tools.constant; + +import org.apache.commons.codec.CharEncoding; +import org.springframework.http.MediaType; + + +/** + * 字符串常量 + * + * @author work@yujt.net.cn + * @date 2019/12/13 11:19 + */ +public interface StrConstant { + + String UTF_8 = CharEncoding.UTF_8; + + String ISO_8859_1 = CharEncoding.ISO_8859_1; + + String JAVASCRIPT = "javascript"; + + String APPLICATION_JSON_UTF8_VALUE = MediaType.APPLICATION_JSON_UTF8_VALUE; + + String EXCEL_SUFFIX_2003 = ".xls"; + + String EXCEL_SUFFIX_2007 = ".xlsx"; + + /** + * 连字符号、短杠 + */ + String HYPHEN = "-"; + + /** + * 英文逗号 + */ + String COMMA = ","; + + /** + * 冒号 + */ + String COLON = ":"; +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/UserAuthTypeEnum.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/UserAuthTypeEnum.java new file mode 100644 index 000000000..3c372e4f2 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/UserAuthTypeEnum.java @@ -0,0 +1,35 @@ +package com.elink.esua.epdc.commons.tools.enums; + +/** + * 用户认证类别枚举类 + * + * @author rongchao + * @Date 19-12-19 + */ +public enum UserAuthTypeEnum { + + /** + * 居民认证 + */ + RESIDENT_AUTH("0"), + + /** + * 党员认证 + */ + PARTY_AUTH("1"), + + /** + * 志愿者认证 + */ + VOLUNTEER_AUTH("2"); + + private String value; + + UserAuthTypeEnum(String value) { + this.value = value; + } + + public String value() { + return this.value; + } +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/UserTagEnum.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/UserTagEnum.java new file mode 100644 index 000000000..d3471119f --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/UserTagEnum.java @@ -0,0 +1,28 @@ +package com.elink.esua.epdc.commons.tools.enums; + +/** + * @Auther: yinzuomei + * @Date: 2019/12/17 19:11 + * @Description: 用户身份枚举类 + */ +public enum UserTagEnum { + /** + * 党员 + */ + PARTY_MEMBER("partymember"), + + /** + * 志愿者 + */ + VOLUNTEER("volunteer"); + + private String value; + + UserTagEnum(String value) { + this.value = value; + } + + public String value() { + return this.value; + } +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsLimitTimeEnum.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsLimitTimeEnum.java new file mode 100644 index 000000000..a3092ed46 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsLimitTimeEnum.java @@ -0,0 +1,27 @@ +package com.elink.esua.epdc.commons.tools.enums.pointsenum; + +/** + * @Auther: yinzuomei + * @Date: 2019/12/13 09:43 + * @Description: 积分规则限制时限枚举类 + */ +public enum PointsLimitTimeEnum { + /** + * 限制时限(0-分钟,1-小时,2-日,3-月,4-年) + */ + LIMIT_TIME_MINUTE("0"), + LIMIT_TIME_HOUR("1"), + LIMIT_TIME_DAY("2"), + LIMIT_TIME_MONTH("3"), + LIMIT_TIME_YEAR("4"); + + private String value; + + PointsLimitTimeEnum(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsOperationEnum.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsOperationEnum.java new file mode 100644 index 000000000..6aa3fa9e3 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsOperationEnum.java @@ -0,0 +1,24 @@ +package com.elink.esua.epdc.commons.tools.enums.pointsenum; + +/** + * @Auther: yinzuomei + * @Date: 2019/12/13 09:31 + * @Description: 积分操作类型枚举类 + */ +public enum PointsOperationEnum { + /** + * 规则操作类型(0-减积分,1-加积分) + */ + OPERATION_TYPE_ADD("1"), + OPERATION_TYPE_SUBSTRACT("0"); + + private String operationType; + + PointsOperationEnum(String operationType) { + this.operationType = operationType; + } + + public String getOperationType() { + return operationType; + } +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsOperationModeEnum.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsOperationModeEnum.java new file mode 100644 index 000000000..c486cfb7a --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsOperationModeEnum.java @@ -0,0 +1,34 @@ +package com.elink.esua.epdc.commons.tools.enums.pointsenum; + +/** + * @Auther: yinzuomei + * @Date: 2019/12/13 09:33 + * @Description: 积分操作方式枚举类 + */ +public enum PointsOperationModeEnum { + + /** + * user-用户操作 + */ + OPERATION_MODE_USER("user"), + + /** + * admin-管理员操作 + */ + OPERATION_MODE_ADMIN("admin"), + + /** + * sys-系统操作 + */ + OPERATION_MODE_SYS("sys"); + + private String operationMode; + + PointsOperationModeEnum(String operationMode) { + this.operationMode = operationMode; + } + + public String getOperationMode() { + return operationMode; + } +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsRuleAvailableEnum.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsRuleAvailableEnum.java new file mode 100644 index 000000000..0ed15d169 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsRuleAvailableEnum.java @@ -0,0 +1,26 @@ +package com.elink.esua.epdc.commons.tools.enums.pointsenum; + +/** + * @Auther: yinzuomei + * @Date: 2019/12/12 15:04 + * @Description: 积分规则可用标志枚举类 + */ +public enum PointsRuleAvailableEnum { + + + /** + * 可用标记(0-不可用,1-可用) + */ + AVAILABLE_TRUE("1"), + AVAILABLE_FALSE("0"); + + private String value; + + PointsRuleAvailableEnum(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsUpperLimitEnum.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsUpperLimitEnum.java new file mode 100644 index 000000000..d65c768a1 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsUpperLimitEnum.java @@ -0,0 +1,28 @@ +package com.elink.esua.epdc.commons.tools.enums.pointsenum; + +/** + * @Auther: yinzuomei + * @Date: 2019/12/13 09:48 + * @Description: 积分是否有上限限制 枚举类 + */ +public enum PointsUpperLimitEnum { + /** + * 是 + */ + YES("1"), + + /** + * 否 + */ + NO("0"); + + private String value; + + PointsUpperLimitEnum(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/redis/RedisKeys.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/redis/RedisKeys.java index 9fe1ff36a..16bc967c6 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/redis/RedisKeys.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/redis/RedisKeys.java @@ -128,7 +128,7 @@ public class RedisKeys { } /** - * 管理员部门层级关系 + * 管理员有数据权限的部门层级关系 * * @param userId 用户id * @return java.lang.String @@ -151,6 +151,18 @@ public class RedisKeys { return rootPrefix.concat("options:dept:user:all:").concat(String.valueOf(userId)); } + /** + * 存放部门层级关系,主要用于获取拼接后的部门id和部门名称 + * + * @param deptId + * @return java.lang.String + * @author work@yujt.net.cn + * @date 2019/12/20 20:34 + */ + public static String getDeptOptionKey(Long deptId) { + return rootPrefix.concat("options:dept:common:").concat(String.valueOf(deptId)); + } + /** * 事件分类 */ @@ -179,4 +191,46 @@ public class RedisKeys { public static String getAllDeptOptionKeyForEpiDemic() { return rootPrefix.concat("options:dept:epidemic:all:"); } + + /** + * @Author wanggongfeng + * @Description常用语 + */ + public static String getPhraseListKey() { + return rootPrefix.concat("heart:phrase:list"); + } + + /** + * @param ruleCode 积分规则编码 + * @return java.lang.String + * @Author yinzuomei + * @Description 积分规则 + * @Date 2019/12/12 10:02 + **/ + public static String getPointsRuleKey(String ruleCode) { + return rootPrefix.concat("config:points:rule:").concat(ruleCode); + } + + /** + * 按项目分类设置项目响应/关闭时限 + * + * @param categoryId + * @return java.lang.String + * @author work@yujt.net.cn + * @date 2019/12/20 20:38 + */ + public static String getKpiItemTimeLimitKey(String categoryId) { + return rootPrefix.concat("config:kpi:itemtimelimit:").concat(categoryId); + } + + /** + * 存储议题响应/关闭时限 + * + * @return java.lang.String + * @author work@yujt.net.cn + * @date 2019/12/20 20:39 + */ + public static String getKpiIssueTimeLimitKey() { + return rootPrefix.concat("config:kpi:itemtimelimit"); + } } diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/DateUtils.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/DateUtils.java index 3789283f4..0de5d2834 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/DateUtils.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/DateUtils.java @@ -25,11 +25,16 @@ import java.util.Date; * @since 1.0.0 */ public class DateUtils { + /** 时间格式(yyyy-MM-dd) */ public final static String DATE_PATTERN = "yyyy-MM-dd"; + /** 时间格式(yyyy-MM-dd HH:mm:ss) */ public final static String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss"; + /** 时间格式(yyyyMMddHHmmss) */ + public final static String DATE_TIME_NO_SPLIT = "yyyyMMddHHmmss"; + /** * 日期格式化 日期格式为:yyyy-MM-dd * @param date 日期 diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/GPSUtils.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/GPSUtils.java index 4a7b6fecd..ad1e5f979 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/GPSUtils.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/GPSUtils.java @@ -1,146 +1,155 @@ package com.elink.esua.epdc.commons.tools.utils; /** - * @Description TODO + * @Description * @Author yinzuomei * @Date 2019/12/27 10:00 */ public class GPSUtils { - public static double pi = 3.1415926535897932384626; - public static double x_pi = 3.14159265358979324 * 3000.0 / 180.0; - public static double a = 6378245.0; - public static double ee = 0.00669342162296594323; + public static double pi = 3.1415926535897932384626; + public static double x_pi = 3.14159265358979324 * 3000.0 / 180.0; + public static double a = 6378245.0; + public static double ee = 0.00669342162296594323; - public static double transformLat(double x, double y) { - double ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y - + 0.2 * Math.sqrt(Math.abs(x)); - ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0; - ret += (20.0 * Math.sin(y * pi) + 40.0 * Math.sin(y / 3.0 * pi)) * 2.0 / 3.0; - ret += (160.0 * Math.sin(y / 12.0 * pi) + 320 * Math.sin(y * pi / 30.0)) * 2.0 / 3.0; - return ret; - } + public static double transformLat(double x, double y) { + double ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + + 0.2 * Math.sqrt(Math.abs(x)); + ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0; + ret += (20.0 * Math.sin(y * pi) + 40.0 * Math.sin(y / 3.0 * pi)) * 2.0 / 3.0; + ret += (160.0 * Math.sin(y / 12.0 * pi) + 320 * Math.sin(y * pi / 30.0)) * 2.0 / 3.0; + return ret; + } - public static double transformLon(double x, double y) { - double ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 - * Math.sqrt(Math.abs(x)); - ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0; - ret += (20.0 * Math.sin(x * pi) + 40.0 * Math.sin(x / 3.0 * pi)) * 2.0 / 3.0; - ret += (150.0 * Math.sin(x / 12.0 * pi) + 300.0 * Math.sin(x / 30.0 - * pi)) * 2.0 / 3.0; - return ret; - } - public static double[] transform(double lat, double lon) { - if (outOfChina(lat, lon)) { - return new double[]{lat,lon}; - } - double dLat = transformLat(lon - 105.0, lat - 35.0); - double dLon = transformLon(lon - 105.0, lat - 35.0); - double radLat = lat / 180.0 * pi; - double magic = Math.sin(radLat); - magic = 1 - ee * magic * magic; - double sqrtMagic = Math.sqrt(magic); - dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi); - dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi); - double mgLat = lat + dLat; - double mgLon = lon + dLon; - return new double[]{mgLat,mgLon}; - } - public static boolean outOfChina(double lat, double lon) { - if (lon < 72.004 || lon > 137.8347) - return true; - if (lat < 0.8293 || lat > 55.8271) - return true; - return false; - } - /** - * 84 to 火星坐标系 (GCJ-02) World Geodetic System ==> Mars Geodetic System - * - * @param lat - * @param lon - * @return - */ - public static double[] gps84_To_Gcj02(double lat, double lon) { - if (outOfChina(lat, lon)) { - return new double[]{lat,lon}; - } - double dLat = transformLat(lon - 105.0, lat - 35.0); - double dLon = transformLon(lon - 105.0, lat - 35.0); - double radLat = lat / 180.0 * pi; - double magic = Math.sin(radLat); - magic = 1 - ee * magic * magic; - double sqrtMagic = Math.sqrt(magic); - dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi); - dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi); - double mgLat = lat + dLat; - double mgLon = lon + dLon; - return new double[]{mgLat, mgLon}; - } + public static double transformLon(double x, double y) { + double ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 + * Math.sqrt(Math.abs(x)); + ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0; + ret += (20.0 * Math.sin(x * pi) + 40.0 * Math.sin(x / 3.0 * pi)) * 2.0 / 3.0; + ret += (150.0 * Math.sin(x / 12.0 * pi) + 300.0 * Math.sin(x / 30.0 + * pi)) * 2.0 / 3.0; + return ret; + } - /** - * * 火星坐标系 (GCJ-02) to 84 * * @param lon * @param lat * @return - * */ - public static double[] gcj02_To_Gps84(double lat, double lon) { - double[] gps = transform(lat, lon); - double lontitude = lon * 2 - gps[1]; - double latitude = lat * 2 - gps[0]; - return new double[]{latitude, lontitude}; - } - /** - * 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法 将 GCJ-02 坐标转换成 BD-09 坐标 - * - * @param lat - * @param lon - */ - public static double[] gcj02_To_Bd09(double lat, double lon) { - double x = lon, y = lat; - double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi); - double theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi); - double tempLon = z * Math.cos(theta) + 0.0065; - double tempLat = z * Math.sin(theta) + 0.006; - double[] gps = {tempLat,tempLon}; - return gps; - } + public static double[] transform(double lat, double lon) { + if (outOfChina(lat, lon)) { + return new double[]{lat, lon}; + } + double dLat = transformLat(lon - 105.0, lat - 35.0); + double dLon = transformLon(lon - 105.0, lat - 35.0); + double radLat = lat / 180.0 * pi; + double magic = Math.sin(radLat); + magic = 1 - ee * magic * magic; + double sqrtMagic = Math.sqrt(magic); + dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi); + dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi); + double mgLat = lat + dLat; + double mgLon = lon + dLon; + return new double[]{mgLat, mgLon}; + } - /** - * * 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法 * * 将 BD-09 坐标转换成GCJ-02 坐标 * * @param - * bd_lat * @param bd_lon * @return - */ - public static double[] bd09_To_Gcj02(double lat, double lon) { - double x = lon - 0.0065, y = lat - 0.006; - double z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi); - double theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi); - double tempLon = z * Math.cos(theta); - double tempLat = z * Math.sin(theta); - double[] gps = {tempLat,tempLon}; - return gps; - } + public static boolean outOfChina(double lat, double lon) { + if (lon < 72.004 || lon > 137.8347) + return true; + if (lat < 0.8293 || lat > 55.8271) + return true; + return false; + } - /**将gps84转为bd09 - * @param lat - * @param lon - * @return - */ - public static double[] gps84_To_bd09(double lat,double lon){ - double[] gcj02 = gps84_To_Gcj02(lat,lon); - double[] bd09 = gcj02_To_Bd09(gcj02[0],gcj02[1]); - return bd09; - } - public static double[] bd09_To_gps84(double lat,double lon){ - double[] gcj02 = bd09_To_Gcj02(lat, lon); - double[] gps84 = gcj02_To_Gps84(gcj02[0], gcj02[1]); - //保留小数点后六位 - gps84[0] = retain6(gps84[0]); - gps84[1] = retain6(gps84[1]); - return gps84; - } + /** + * 84 to 火星坐标系 (GCJ-02) World Geodetic System ==> Mars Geodetic System + * + * @param lat + * @param lon + * @return + */ + public static double[] gps84_To_Gcj02(double lat, double lon) { + if (outOfChina(lat, lon)) { + return new double[]{lat, lon}; + } + double dLat = transformLat(lon - 105.0, lat - 35.0); + double dLon = transformLon(lon - 105.0, lat - 35.0); + double radLat = lat / 180.0 * pi; + double magic = Math.sin(radLat); + magic = 1 - ee * magic * magic; + double sqrtMagic = Math.sqrt(magic); + dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi); + dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi); + double mgLat = lat + dLat; + double mgLon = lon + dLon; + return new double[]{mgLat, mgLon}; + } - /**保留小数点后六位 - * @param num - * @return - */ - private static double retain6(double num){ - String result = String .format("%.6f", num); - return Double.valueOf(result); - } + /** + * * 火星坐标系 (GCJ-02) to 84 * * @param lon * @param lat * @return + */ + public static double[] gcj02_To_Gps84(double lat, double lon) { + double[] gps = transform(lat, lon); + double lontitude = lon * 2 - gps[1]; + double latitude = lat * 2 - gps[0]; + return new double[]{latitude, lontitude}; + } + + /** + * 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法 将 GCJ-02 坐标转换成 BD-09 坐标 + * + * @param lat + * @param lon + */ + public static double[] gcj02_To_Bd09(double lat, double lon) { + double x = lon, y = lat; + double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi); + double theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi); + double tempLon = z * Math.cos(theta) + 0.0065; + double tempLat = z * Math.sin(theta) + 0.006; + double[] gps = {tempLat, tempLon}; + return gps; + } + + /** + * * 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法 * * 将 BD-09 坐标转换成GCJ-02 坐标 * * @param + * bd_lat * @param bd_lon * @return + */ + public static double[] bd09_To_Gcj02(double lat, double lon) { + double x = lon - 0.0065, y = lat - 0.006; + double z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi); + double theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi); + double tempLon = z * Math.cos(theta); + double tempLat = z * Math.sin(theta); + double[] gps = {tempLat, tempLon}; + return gps; + } + + /** + * 将gps84转为bd09 + * + * @param lat + * @param lon + * @return + */ + public static double[] gps84_To_bd09(double lat, double lon) { + double[] gcj02 = gps84_To_Gcj02(lat, lon); + double[] bd09 = gcj02_To_Bd09(gcj02[0], gcj02[1]); + return bd09; + } + + public static double[] bd09_To_gps84(double lat, double lon) { + double[] gcj02 = bd09_To_Gcj02(lat, lon); + double[] gps84 = gcj02_To_Gps84(gcj02[0], gcj02[1]); + //保留小数点后六位 + gps84[0] = retain6(gps84[0]); + gps84[1] = retain6(gps84[1]); + return gps84; + } + + /** + * 保留小数点后六位 + * + * @param num + * @return + */ + private static double retain6(double num) { + String result = String.format("%.6f", num); + return Double.valueOf(result); + } } diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/LocalDateUtils.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/LocalDateUtils.java new file mode 100644 index 000000000..133340b24 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/LocalDateUtils.java @@ -0,0 +1,51 @@ +package com.elink.esua.epdc.commons.tools.utils; + + +import java.time.*; +import java.util.Date; + +/** + * @author work@yujt.net.cn + * @date 2019/12/13 15:05 + */ +public class LocalDateUtils { + + + public static LocalDateTime dateToLocalDateTime(Date date) { + Instant instant = date.toInstant(); + ZoneId zone = ZoneId.systemDefault(); + return LocalDateTime.ofInstant(instant, zone); + } + + public static LocalDate dateToLocalDate(Date date) { + Instant instant = date.toInstant(); + ZoneId zone = ZoneId.systemDefault(); + LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, zone); + return localDateTime.toLocalDate(); + } + + public static YearMonth dateToYearMonth(Date date) { + LocalDate localDate = dateToLocalDate(date); + return YearMonth.of(localDate.getYear(), localDate.getMonthValue()); + } + + public static LocalTime dateToLocalTime(Date date) { + Instant instant = date.toInstant(); + ZoneId zone = ZoneId.systemDefault(); + LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, zone); + return localDateTime.toLocalTime(); + } + + public static Date localDateTimeToDate(LocalDateTime localDateTime) { + ZoneId zone = ZoneId.systemDefault(); + Instant instant = localDateTime.atZone(zone).toInstant(); + return Date.from(instant); + } + + public static Date localDateToDate(LocalDate localDate) { + ZoneId zone = ZoneId.systemDefault(); + Instant instant = localDate.atStartOfDay().atZone(zone).toInstant(); + return Date.from(instant); + } + +} diff --git a/esua-epdc/epdc-gateway/pom.xml b/esua-epdc/epdc-gateway/pom.xml index 4ccdd4f1b..a153a845b 100644 --- a/esua-epdc/epdc-gateway/pom.xml +++ b/esua-epdc/epdc-gateway/pom.xml @@ -99,12 +99,12 @@ lb://epdc-auth-server - - http://127.0.0.1:9092 + lb://epdc-admin-server + lb://epdc-activiti-server - lb://epdc-api-server - + + http://127.0.0.1:9040 lb://epdc-app-server lb://epdc-heart-server @@ -127,9 +127,11 @@ http://127.0.0.1:9063 lb://epdc-websocket-server - lb://epdc-kpi-server lb://epdc-custom-server + lb://epdc-points-server + + http://127.0.0.1:9069 false 47.104.224.45:8848 @@ -167,9 +169,11 @@ lb://epdc-user-server lb://epdc-demo-server lb://epdc-group-server - lb://epdc-websocket-server + lb://epdc-websocket-server + lb://epdc-kpi-server lb://epdc-custom-server + lb://epdc-points-server true @@ -203,9 +207,11 @@ lb://epdc-user-server lb://epdc-demo-server lb://epdc-group-server - lb://epdc-websocket-server + lb://epdc-websocket-server + lb://epdc-kpi-server lb://epdc-custom-server + lb://epdc-points-server 0 diff --git a/esua-epdc/epdc-gateway/src/main/resources/application.yml b/esua-epdc/epdc-gateway/src/main/resources/application.yml index 6a4882b38..ca31a8f6b 100644 --- a/esua-epdc/epdc-gateway/src/main/resources/application.yml +++ b/esua-epdc/epdc-gateway/src/main/resources/application.yml @@ -160,6 +160,12 @@ spring: order: 17 predicates: - Path=${server.servlet.context-path}/custom/** + #积分管理 + - id: epdc-points-server + uri: @gateway.routes.epdc-points-server.uri@ + order: 18 + predicates: + - Path=${server.servlet.context-path}/points/** filters: - StripPrefix=1 nacos: @@ -214,7 +220,6 @@ renren: - /activiti/service/** - /activiti/editor-app/** - /message/sms/sendCode #发送验证码 - - /heart/** - /oss/file/download - /ws/** workLoginUrls: diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppActUserCancelsignupDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppActUserCancelsignupDTO.java new file mode 100644 index 000000000..f64f33bae --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppActUserCancelsignupDTO.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 取消报名参数 + * + * @author wanggongfeng + * @since v1.0.0 2019-12-17 + */ +@Data +public class EpdcAppActUserCancelsignupDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private String userId; + /** + * 活动ID + */ + private String actId; + /** + * 取消报名原因 + */ + private String failureReason; +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppActUserClockLogDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppActUserClockLogDTO.java new file mode 100644 index 000000000..e63f6ab67 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppActUserClockLogDTO.java @@ -0,0 +1,74 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; + +/** + * 用户打卡参数 + * + * @author wanggongfeng + * @since v1.0.0 2019-12-17 + */ +@Data +public class EpdcAppActUserClockLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private String userId; + /** + * 活动ID + */ + private String actId; + /** + * 打卡描述 + */ + private String clockDesc; + /** + * 打卡位置经度 + */ + private BigDecimal clockLongitude; + /** + * 打卡位置纬度 + */ + private BigDecimal clockLatitude; + /** + * 打卡地址 + */ + private String clockAddress; + /** + * 打卡图片 + */ + private ArrayList images; + /** + * 打卡类型(0-打卡,1-更新打卡) + */ + private String clockType; + /** + * 打卡是否有效(0-否,1-是) + */ + private String effectiveFlag; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcCompleteUserInfoFormDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcCompleteUserInfoFormDTO.java index ca49d2f3e..6c3ccb3ec 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcCompleteUserInfoFormDTO.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcCompleteUserInfoFormDTO.java @@ -23,6 +23,7 @@ public class EpdcCompleteUserInfoFormDTO implements Serializable { * 身份证号码 */ private String identityNo; + /** * 手机号 */ diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppClockListDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppClockListDTO.java new file mode 100644 index 000000000..8cfa70ea3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppClockListDTO.java @@ -0,0 +1,48 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 打卡列表 + * + * @author wanggongfeng + * @since v1.0.0 2019-12-18 + */ +@Data +public class EpdcAppClockListDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 活动打卡人次 + */ + private int clockNum; + + /** + * 打卡列表 + */ + private List clocks; + + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppVolunteerRankDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppVolunteerRankDTO.java new file mode 100644 index 000000000..d589c4f99 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppVolunteerRankDTO.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 志愿者排名 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-18 + */ +@Data +public class EpdcAppVolunteerRankDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 排名 + */ + private Integer sort; + + /** + * 头像 + */ + private String faceImg; + + /** + * 用户名 + */ + private String nickname; + + /** + * 是否党员(0-否,1-是) + */ + private String partyFlag; + + /** + * 爱心时长(单位:小时) + */ + private BigDecimal kindnessTime; + + /** + * 参加次数 + */ + private Integer participationNum; + + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/pom.xml b/esua-epdc/epdc-module/epdc-api/epdc-api-server/pom.xml index 31a3c42d9..49bd4e004 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/pom.xml @@ -13,7 +13,6 @@ jar - @@ -22,35 +21,42 @@ epdc-api-client 1.0.0 + com.esua.epdc epdc-commons-tools 1.0.0 + com.esua.epdc epdc-commons-mybatis 1.0.0 + org.springframework.boot spring-boot-starter-web + org.springframework spring-context-support + de.codecentric spring-boot-admin-starter-client ${spring.boot.admin.version} + com.alibaba.cloud spring-cloud-starter-alibaba-nacos-discovery + com.esua.epdc @@ -86,6 +92,10 @@ 1.0.0 compile + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/ApiApplication.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/ApiApplication.java index 96d647692..cf7c97661 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/ApiApplication.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/ApiApplication.java @@ -1,11 +1,3 @@ -/** - * Copyright (c) 2018 人人开源 All rights reserved. - *

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

- * 版权所有,侵权必究! - */ - package com.elink.esua.epdc; import org.springframework.boot.SpringApplication; @@ -16,8 +8,8 @@ import org.springframework.cloud.openfeign.EnableFeignClients; /** * API模块 * - * @author Mark sunlightcs@gmail.com - * @since 1.0.0 + * @author rongchao + * @Date 20-1-15 */ @SpringBootApplication @EnableDiscoveryClient diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActPhraseController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActPhraseController.java new file mode 100644 index 000000000..0a563cdf9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActPhraseController.java @@ -0,0 +1,47 @@ +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.service.ActPhraseService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * APP常用语相关接口 + * + * @author wanggongfeng + * @date 2019/12/17 10:30 + */ +@RestController +@RequestMapping("heart/phrase") +public class ApiActPhraseController { + + @Autowired + private ActPhraseService actPhraseService; + + /** + * 使用次数加一 + * @param id + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author wanggongfeng + * @date 2019/12/13 14:41 + */ + @PostMapping("sagenumAddOne") + public Result sagenumAddOneById(String id) { + return actPhraseService.sagenumAddOneById(id); + } + + /** + * 获取常用语列表 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author wanggongfeng + * @date 2019/12/13 14:41 + */ + @GetMapping("getPhraseList") + public Result getPhraseList() { + return actPhraseService.getPhraseList(); + + } + + + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java new file mode 100644 index 000000000..a8acaa43b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java @@ -0,0 +1,151 @@ +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.activity.ActUserRelationDTO; +import com.elink.esua.epdc.activity.AppActUserCancelsignupDTO; +import com.elink.esua.epdc.activity.AppActUserClockLogDTO; +import com.elink.esua.epdc.activity.AppClockListDTO; +import com.elink.esua.epdc.activity.result.AppActInfoDTO; +import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.common.token.util.IdentityNoAnalysisUtil; +import com.elink.esua.epdc.commons.tools.annotation.LoginUser; +import com.elink.esua.epdc.commons.tools.enums.UserTagEnum; +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO; +import com.elink.esua.epdc.dto.form.EpdcAppActUserCancelsignupDTO; +import com.elink.esua.epdc.dto.form.EpdcAppActUserClockLogDTO; +import com.elink.esua.epdc.dto.result.EpdcAppClockListDTO; +import com.elink.esua.epdc.service.ActUserRelationService; +import com.elink.esua.epdc.service.AppUserService; +import com.elink.esua.epdc.utils.UserTagUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Date; + +/** + * APP活动相关接口 + * + * @author wanggongfeng + * @date 2019/12/17 10:30 + */ +@RestController +@RequestMapping("heart/act") +public class ApiActUserRelationController { + + @Autowired + private ActUserRelationService actUserRelationService; + + @Autowired + private AppUserService appUserService; + + /** + * 活动报名 + * + * @param tokenDto + * @param actId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author wanggongfeng + * @date 2019/12/13 14:41 + */ + @PostMapping("signup") + public Result activitySignUp(@LoginUser TokenDto tokenDto,String actId) { + //验证是否为志愿者 + Result isVolunteer = appUserService.getVolunteerCountById(tokenDto); + int code = isVolunteer.getCode(); + if(code != 0){ + //不是志愿者 + return isVolunteer; + } + Result userInfo = appUserService.getInfoById(tokenDto); + EpdcUserInfoResultDTO epdcUserInfoResultDTO = userInfo.getData(); + String identityNo = epdcUserInfoResultDTO.getIdentityNo(); + ActUserRelationDTO actUserRelationDTO = new ActUserRelationDTO(); + actUserRelationDTO.setActId(actId); + actUserRelationDTO.setUserId(tokenDto.getUserId()); + actUserRelationDTO.setNickname(tokenDto.getNickname()); + actUserRelationDTO.setFaceImg(tokenDto.getFaceImg()); + if (UserTagUtils.containIdentity(tokenDto.getUserTagInfos(), UserTagEnum.PARTY_MEMBER)) { + actUserRelationDTO.setPartyFlag(YesOrNoEnum.YES.value()); + } else { + actUserRelationDTO.setPartyFlag(YesOrNoEnum.NO.value()); + } + actUserRelationDTO.setRealName(tokenDto.getRealName()); + actUserRelationDTO.setSex(IdentityNoAnalysisUtil.getSex(identityNo)); + actUserRelationDTO.setAge(IdentityNoAnalysisUtil.getAge(identityNo)); + actUserRelationDTO.setMobile(tokenDto.getMobile()); + actUserRelationDTO.setIdentityNo(identityNo); + actUserRelationDTO.setStatus("0"); + actUserRelationDTO.setSignupTime(new Date()); + return actUserRelationService.activitySignUp(actUserRelationDTO); + + } + + /** + * 取消活动报名 + * + * @param tokenDto + * @param epdcAppActUserCancelsignupDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author wanggongfeng + * @date 2019/12/13 14:41 + */ + @PostMapping("cancelsignup") + public Result activityCancelSignUp(@LoginUser TokenDto tokenDto,@RequestBody EpdcAppActUserCancelsignupDTO epdcAppActUserCancelsignupDTO) { + epdcAppActUserCancelsignupDTO.setUserId(tokenDto.getUserId()); + AppActUserCancelsignupDTO actUserCancelsignupDTO = ConvertUtils.sourceToTarget(epdcAppActUserCancelsignupDTO, AppActUserCancelsignupDTO.class); + return actUserRelationService.activityCancelSignUp(actUserCancelsignupDTO); + + } + + /** + * 活动打卡 + * + * @param tokenDto + * @param epdcAppActUserClockLogDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author wanggongfeng + * @date 2019/12/13 14:41 + */ + @PostMapping("clock") + public Result activityClock(@LoginUser TokenDto tokenDto, @RequestBody EpdcAppActUserClockLogDTO epdcAppActUserClockLogDTO) { + AppActUserClockLogDTO appActUserClockLogDTO = ConvertUtils.sourceToTarget(epdcAppActUserClockLogDTO, AppActUserClockLogDTO.class); + appActUserClockLogDTO.setUserId(tokenDto.getUserId()); + return actUserRelationService.activityClock(appActUserClockLogDTO); + + } + + /** + * 获取打卡列表 + * + * @param tokenDto + * @param actId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author wanggongfeng + * @date 2019/12/13 14:41 + */ + @GetMapping("clockList") + public Result getClockList(@LoginUser TokenDto tokenDto, String actId) { + Result result = actUserRelationService.getClockList(actId); + EpdcAppClockListDTO epdcAppClockListDTO = ConvertUtils.sourceToTarget(result.getData(), EpdcAppClockListDTO.class); + Result result1 = new Result(); + result1.setData(epdcAppClockListDTO); + return result1; + + } + + /** + * 获取活动打卡地点详情 + * + * @param actId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author wanggongfeng + * @date 2019/12/13 14:41 + */ + @GetMapping("clockAddressDetail") + public Result clockAddressDetail(String actId) { + return actUserRelationService.clockAddressDetail(actId); + + } +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppActInfoController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppActInfoController.java new file mode 100644 index 000000000..fc5268df8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppActInfoController.java @@ -0,0 +1,100 @@ +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.activity.ActBannerDTO; +import com.elink.esua.epdc.activity.form.ActInfoAppFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoAppResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoDetailAppResultDTO; +import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.annotation.LoginUser; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.item.result.*; +import com.elink.esua.epdc.service.ActInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 移动端接口-项目模块 + * @Author LPF + * @Date 2019/11/18 13:32 + */ +@RestController +@RequestMapping("heart/act") +public class ApiAppActInfoController { + + @Autowired + private ActInfoService actInfoService; + + + /** + * 活动列表 + * @Params: [ formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/11/19 16:34 + */ + @GetMapping("list") + public Result> listItems(ActInfoAppFormDTO formDto, @LoginUser TokenDto tokenDto) { + formDto.setUserId(tokenDto.getUserId()); + return actInfoService.listItems(formDto); + } + /** + * 活动列表 + * @Params: [ formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/11/19 16:34 + */ + @GetMapping("signupList") + public Result> signupListItems(ActInfoAppFormDTO formDto, @LoginUser TokenDto tokenDto) { + formDto.setUserId(tokenDto.getUserId()); + return actInfoService.signupListItems(formDto); + } + + /** + * 项目详情 + * @Params: [id] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result + * @Author: lipengfei + * @Date: 2019/11/19 16:34 + */ + @GetMapping("detail/{id}") + public Result detail(@PathVariable String id, @LoginUser TokenDto tokenDto) { + ActInfoAppFormDTO formDto = new ActInfoAppFormDTO(); + formDto.setId(id); + formDto.setUserId(tokenDto.getUserId()); + return actInfoService.getDetail(formDto); + } + + /** + * 项目详情 + * @Params: [id] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result + * @Author: lipengfei + * @Date: 2019/11/19 16:34 + */ + @GetMapping("rejectDetail/{id}") + public Result rejectDetail(@PathVariable String id, @LoginUser TokenDto tokenDto) { + ActInfoAppFormDTO formDto = new ActInfoAppFormDTO(); + formDto.setId(id); + formDto.setUserId(tokenDto.getUserId()); + return actInfoService.getRejectDetail(formDto); + } + + /** + * 项目详情 + * @Params: [id] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result + * @Author: lipengfei + * @Date: 2019/11/19 16:34 + */ + @GetMapping("cancelDetail/{id}") + public Result cancelDetail(@PathVariable String id) { + return actInfoService.getCancelDetail(id); + } + @GetMapping("banner/list") + public Result> bannerList() { + return actInfoService.getBannerList(); + } +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java index 8c462b1fa..5b411a111 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java @@ -9,8 +9,8 @@ import com.elink.esua.epdc.dto.epdc.result.EpdcUserGridResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO; import com.elink.esua.epdc.dto.epdc.result.UserInvitationRecordResultDTO; import com.elink.esua.epdc.dto.form.*; -import com.elink.esua.epdc.dto.result.EpdcAppRegisterCallbackDTO; import com.elink.esua.epdc.dto.result.EpdcAppAuthorizationDTO; +import com.elink.esua.epdc.dto.result.EpdcAppRegisterCallbackDTO; import com.elink.esua.epdc.dto.result.EpdcCompleteUserInfoDTO; import com.elink.esua.epdc.service.AppUserService; import org.springframework.beans.factory.annotation.Autowired; @@ -22,7 +22,7 @@ import java.util.List; * 用户模块 * * @author yujintao - * @email yujintao@elink-cn.com + * @email yujintao@elink-cn.comuser/completeInfo * @date 2019/9/6 19:30 */ @RestController @@ -106,6 +106,7 @@ public class ApiAppUserController { ValidatorUtils.validateEntity(formDto); return appUserService.checkRegister(formDto); } + /** * 用户生成小程序码 * @@ -127,6 +128,7 @@ public class ApiAppUserController { * @author yujintao * @date 2019/9/9 10:52 */ + @Deprecated @GetMapping("user/mp/getToken") public Result getToken(EpdcAppUserTokenFormDTO formDto) { ValidatorUtils.validateEntity(formDto); @@ -241,6 +243,7 @@ public class ApiAppUserController { public Result prepareCompleteUserInfo(@LoginUser TokenDto tokenDto) { return appUserService.prepareCompleteUserInfo(tokenDto); } + /** * 获取邀请记录 * @@ -264,4 +267,22 @@ public class ApiAppUserController { public Result checkWxUnionId(@LoginUser TokenDto tokenDto) { return appUserService.checkWxUnionId(tokenDto); } + + /** + * 志愿者认证 + * + * @param tokenDto + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author wanggongfeng + * @date 2019/12/13 14:41 + */ + @PostMapping("volunteer/authenticate") + public Result volunteerAuthenticate(@LoginUser TokenDto tokenDto, @RequestBody EpdcCompleteVolunteerInfoFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + return appUserService.volunteerAuthenticate(tokenDto, formDto); + + } + + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScanSwitchController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScanSwitchController.java index 137b8ffb6..5f9443486 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScanSwitchController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScanSwitchController.java @@ -43,7 +43,7 @@ import java.util.Map; @RestController @RequestMapping("ma") public class ApiScanSwitchController { - + @Autowired private ScanSwitchService scanSwitchService; diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiVolunteerRankController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiVolunteerRankController.java new file mode 100644 index 000000000..a0c104bdf --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiVolunteerRankController.java @@ -0,0 +1,42 @@ +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.result.EpdcAppVolunteerRankDTO; +import com.elink.esua.epdc.service.AppVolunteerRankService; +import com.elink.esua.epdc.volunteer.EpdcVolunteerRankDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * APP爱心排名 + * + * @author wanggongfeng + * @date 2019/12/17 10:30 + */ +@RestController +@RequestMapping("heart/volunteer") +public class ApiVolunteerRankController { + + @Autowired + private AppVolunteerRankService appVolunteerRankService; + + /** + * 获取排行榜 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author wanggongfeng + * @date 2019/12/13 14:41 + */ + @GetMapping("leaderboard") + public Result> leaderboard() { + Result> data = appVolunteerRankService.leaderboard(); + List list2 = ConvertUtils.sourceToTarget(data.getData(), EpdcAppVolunteerRankDTO.class); + return new Result().ok(list2); + + } + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/DemoController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/DemoController.java new file mode 100644 index 000000000..aaa4418c6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/DemoController.java @@ -0,0 +1,37 @@ +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.service.DemoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Map; + +/** + * 移动端接口-评论模块 + * + * @Author WJP + * @Date 2019/9/9 09:45 + */ +@RestController +@RequestMapping("demo") +public class DemoController { + + @Autowired + private DemoService demoService; + + /** + * 事务 + * + * @return + */ + @PostMapping("seata") + public Result demo(@RequestBody Map map) { + return demoService.demo(map); + } + + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/ActInfoFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/ActInfoFeignClient.java new file mode 100644 index 000000000..c1ca0968a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/ActInfoFeignClient.java @@ -0,0 +1,75 @@ +package com.elink.esua.epdc.feign; + +import com.elink.esua.epdc.activity.ActBannerDTO; +import com.elink.esua.epdc.activity.form.ActInfoAppFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoAppResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoDetailAppResultDTO; +import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.annotation.LoginUser; +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.config.FeignRequestInterceptor; +import com.elink.esua.epdc.dto.item.ItemEvaluateDeptDTO; +import com.elink.esua.epdc.dto.item.form.*; +import com.elink.esua.epdc.dto.item.result.*; +import com.elink.esua.epdc.feign.fallback.ActInfoFeignClientFallback; +import com.elink.esua.epdc.feign.fallback.WorkItemFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + +import java.util.List; + +/** + * 活动模块调用-移动app端 + * @Author LPF + * @Date 2019/11/18 16:39 + */ +@FeignClient(name = ServiceConstant.EPDC_HEART_SERVER, fallback = ActInfoFeignClientFallback.class, configuration = FeignRequestInterceptor.class) +public interface ActInfoFeignClient { + + + + /** + * 活动列表 + * @Params: [formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/11/19 16:42 + */ + @GetMapping(value = "heart/appactinfo/list", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> listItems(ActInfoAppFormDTO formDto); + + /** + * 活动列表(已报名) + * @Params: [formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/11/19 16:42 + */ + @GetMapping(value = "heart/appactinfo/signupList", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> signupListItems(ActInfoAppFormDTO formDto); + /** + * 活动详情 + * @Params: [formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/11/19 16:42 + */ + @GetMapping(value = "heart/appactinfo/detail", consumes = MediaType.APPLICATION_JSON_VALUE) + Result getDetail(ActInfoAppFormDTO formDto); + + @GetMapping(value = "heart/appactinfo/rejectdetail", consumes = MediaType.APPLICATION_JSON_VALUE) + Result getRejectDetail(ActInfoAppFormDTO formDto); + + @GetMapping(value = "heart/appactinfo/canceldetail/{id}", consumes = MediaType.APPLICATION_JSON_VALUE) + Result getCancelDetail(@PathVariable String id); + + @GetMapping(value = "heart/actbanner/bannerlist", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> getBannerList(); + + + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActPhraseFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActPhraseFeignClient.java new file mode 100644 index 000000000..9115db045 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActPhraseFeignClient.java @@ -0,0 +1,35 @@ +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.AppActPhraseFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; + +/** + * + * 活动报名管理 + * + * @Author:wanggongfeng + * @Date:2019/12/16 17:36 + */ +@FeignClient(name = ServiceConstant.EPDC_HEART_SERVER, fallback = AppActPhraseFeignClientFallback.class) +public interface AppActPhraseFeignClient { + + /** + * 常用语加一 + * + * @param id + * @return + */ + @GetMapping("heart/appactphrase/sagenumAddOneById/{id}") + Result sagenumAddOneById(@PathVariable("id")String id); + + /** + * redis获取常用语列表 + * @return + */ + @GetMapping("heart/appactphrase/getPhraseList") + Result getPhraseList(); +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActUserRelationFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActUserRelationFeignClient.java new file mode 100644 index 000000000..00f257f18 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActUserRelationFeignClient.java @@ -0,0 +1,66 @@ +package com.elink.esua.epdc.feign; + +import com.elink.esua.epdc.activity.ActUserRelationDTO; +import com.elink.esua.epdc.activity.AppActUserCancelsignupDTO; +import com.elink.esua.epdc.activity.AppActUserClockLogDTO; +import com.elink.esua.epdc.activity.AppClockListDTO; +import com.elink.esua.epdc.activity.result.AppActInfoDTO; +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.AppActUserRelationFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; + +/** + * + * 活动报名管理 + * + * @Author:wanggongfeng + * @Date:2019/12/16 17:36 + */ +@FeignClient(name = ServiceConstant.EPDC_HEART_SERVER, fallback = AppActUserRelationFeignClientFallback.class) +public interface AppActUserRelationFeignClient { + + /** + * 活动报名 + * @param actUserRelationDTO + * @return + */ + @GetMapping(value = "heart/appactuserrelation/activitySignUp",consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result activitySignUp(ActUserRelationDTO actUserRelationDTO); + + /** + * 取消活动报名 + * @param epdcAppActUserCancelsignupDTO + * @return + */ + @GetMapping("heart/appactuserrelation/activityCancelSignUp") + Result activityCancelSignUp(AppActUserCancelsignupDTO epdcAppActUserCancelsignupDTO); + + /** + * 活动打卡 + * @param appActUserClockLogDTO + * @return + */ + @GetMapping(value = "heart/appactuserclocklog/activityClock",consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result activityClock(AppActUserClockLogDTO appActUserClockLogDTO); + + /** + * 通过活动ID查询打卡列表 + * @param actId + * @return + */ + @GetMapping(value = "heart/appactuserrelation/selectListActUserRelation/{actId}") + Result selectListActUserRelation(@PathVariable("actId") String actId); + + /** + * 获取活动打卡地点详情 + * @param actId + * @return + */ + @GetMapping("heart/appactinfo/clockAddressDetail/{actId}") + Result clockAddressDetail(@PathVariable("actId") String actId); + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppVolunteerRankFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppVolunteerRankFeignClient.java new file mode 100644 index 000000000..be3999ed3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppVolunteerRankFeignClient.java @@ -0,0 +1,28 @@ +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.AppVolunteerRankFeignClientFallback; +import com.elink.esua.epdc.volunteer.EpdcVolunteerRankDTO; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; + +import java.util.List; + +/** + * + * 活动报名管理 + * + * @Author:wanggongfeng + * @Date:2019/12/16 17:36 + */ +@FeignClient(name = ServiceConstant.EPDC_HEART_SERVER, fallback = AppVolunteerRankFeignClientFallback.class) +public interface AppVolunteerRankFeignClient { + + /** + * 获取排行榜 + * @return + */ + @GetMapping("heart/volunteer/leaderboard") + Result> leaderboard(); +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CommentFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CommentFeignClient.java index dd428c14b..752921c9c 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CommentFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CommentFeignClient.java @@ -3,8 +3,8 @@ package com.elink.esua.epdc.feign; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.comment.CommentStatementFormDTO; -import com.elink.esua.epdc.dto.comment.form.CommentFormDTO; import com.elink.esua.epdc.dto.comment.form.EventCommentsFormDTO; +import com.elink.esua.epdc.dto.comment.form.SubmitCommentFormDTO; import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO; import com.elink.esua.epdc.feign.fallback.CommentFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; @@ -22,7 +22,7 @@ public interface CommentFeignClient { @PostMapping(value = "events/epdc-app/comment/submit", consumes = MediaType.APPLICATION_JSON_VALUE) - Result submit(CommentFormDTO commentFormDTO); + Result submit(SubmitCommentFormDTO submitCommentFormDTO); /** * 评论列表 diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/OssFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/OssFeignClient.java index 875445a57..b79ea6c38 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/OssFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/OssFeignClient.java @@ -2,12 +2,15 @@ package com.elink.esua.epdc.feign; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.UploadDTO; import com.elink.esua.epdc.dto.UploadFormDTO; import com.elink.esua.epdc.dto.UploadToOssDTO; import com.elink.esua.epdc.feign.fallback.OssFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; /** * 文件对象模块 @@ -38,4 +41,14 @@ public interface OssFeignClient { */ @PostMapping(value = "oss/file/uploadFile", consumes = MediaType.APPLICATION_JSON_VALUE) Result uploadFile(UploadToOssDTO uploadToOssDto); + + /** + * @param avatarUrl + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 上传微信头像 + * @Date 2019/12/20 9:33 + **/ + @GetMapping(value="oss/file/saveWeChatFaceImg") + Result saveWeChatFaceImg(@RequestParam("avatarUrl")String avatarUrl); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java index b9854986c..4d71da925 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java @@ -2,16 +2,19 @@ package com.elink.esua.epdc.feign; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.CachingUserInfoDTO; import com.elink.esua.epdc.dto.UserDTO; import com.elink.esua.epdc.dto.UserGridRelationDTO; import com.elink.esua.epdc.dto.UserWxFormIdDTO; import com.elink.esua.epdc.dto.epdc.form.*; import com.elink.esua.epdc.dto.epdc.result.*; -import com.elink.esua.epdc.dto.epdc.result.EpdcWorkUserResultDTO; import com.elink.esua.epdc.feign.fallback.UserFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import java.util.List; @@ -186,7 +189,7 @@ public interface UserFeignClient { * 获取网格长管理的网格列表 * * @param userId - * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @return com.elink.esua.epdc.commons.tools.utils.Result> * @author work@yujt.net.cn * @date 2019/10/23 13:34 */ @@ -237,11 +240,10 @@ public interface UserFeignClient { Result residentDetail(@PathVariable("userId") String userId); /** - * * 获取用户最后一次切换的网格信息 * - * @params [openId] * @return com.elink.esua.epdc.commons.tools.utils.Result + * @params [openId] * @author liuchuang * @since 2019/12/6 11:04 */ @@ -305,12 +307,12 @@ public interface UserFeignClient { * @Date 2019/11/22 14:22 **/ @PostMapping("app-user/epdc-app/usergrid/removeGrid") - Result removeGrid(EpdcAppRemoveGridFormDTO formDto); + Result removeGrid(EpdcAppRemoveGridFormDTO formDto); /** * 获取邀请记录 * - * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @return com.elink.esua.epdc.commons.tools.utils.Result> * @author work@yujt.net.cn * @date 2019/10/23 13:34 */ @@ -324,6 +326,49 @@ public interface UserFeignClient { * @Description 根据openId或者unionId查询用户信息 * @Date 2019/12/7 14:11 **/ - @PostMapping(value="app-user/epdc-app/user/queryUserDto", consumes = MediaType.APPLICATION_JSON_VALUE) + @PostMapping(value = "app-user/epdc-app/user/queryUserDto", consumes = MediaType.APPLICATION_JSON_VALUE) Result queryUserDto(EpdcAppQueryUserInfoFormDTO formDTO); + + /** + * <<<<<<< HEAD + * 需要缓存的用户信息 + * + * @param formDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author rongchao + * @since 2019-12-18 + */ + @PostMapping(value = "app-user/epdc-app/user/needCachingUserInfo", consumes = MediaType.APPLICATION_JSON_VALUE) + Result needCachingUserInfo(EpdcAppQueryUserInfoFormDTO formDTO); + + /** + * 根据用户ID需要缓存的用户信息 + * + * @param userId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author rongchao + * @since 2019-12-19 + */ + @GetMapping(value = "app-user/epdc-app/user/needCachingUserInfoByUserId/{userId}") + Result needCachingUserInfoByUserId(@PathVariable("userId") String userId); + + /** + * 志愿者认证 + * + * @param userId + * @return + */ + @GetMapping("app-user/epdc-app/volunteerinfo/getVolunteerCountById/{userId}") + Result getVolunteerCountById(@PathVariable("userId") String userId); + + /** + * 添加志愿者 + * + * @param epdcCompleteVolunteerInfoFormDTO + * @return + */ + @GetMapping("app-user/epdc-app/volunteerinfo/insertVolunteerInfo") + Result insertVolunteerInfo(EpdcCompleteVolunteerInfoFormDTO epdcCompleteVolunteerInfoFormDTO); + + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/ActInfoFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/ActInfoFeignClientFallback.java new file mode 100644 index 000000000..b83175a18 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/ActInfoFeignClientFallback.java @@ -0,0 +1,54 @@ +package com.elink.esua.epdc.feign.fallback; + +import com.elink.esua.epdc.activity.ActBannerDTO; +import com.elink.esua.epdc.activity.form.ActInfoAppFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoAppResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoDetailAppResultDTO; +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.dto.item.ItemEvaluateDeptDTO; +import com.elink.esua.epdc.dto.item.form.*; +import com.elink.esua.epdc.dto.item.result.*; +import com.elink.esua.epdc.feign.ActInfoFeignClient; +import com.elink.esua.epdc.feign.WorkItemFeignClient; +import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.PathVariable; + +import java.util.List; + +/** + * @Author LPF + * @Date 2019/11/18 16:39 + */ +@Component +public class ActInfoFeignClientFallback implements ActInfoFeignClient { + + + @Override + public Result> listItems(ActInfoAppFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "listItems", formDto); + } + @Override + public Result> signupListItems(ActInfoAppFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "signupListItems", formDto); + } + @Override + public Result getDetail(ActInfoAppFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "getDetail", formDto); + } + @Override + public Result getRejectDetail(ActInfoAppFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "getRejectDetail", formDto); + } + @Override + public Result getCancelDetail(@PathVariable String id) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "getCancelDetail", id); + } + @Override + public Result> getBannerList() { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "getBannerList"); + } + + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActPhraseFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActPhraseFeignClientFallback.java new file mode 100644 index 000000000..145640506 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActPhraseFeignClientFallback.java @@ -0,0 +1,25 @@ +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.AppActPhraseFeignClient; +import org.springframework.stereotype.Component; + +/** + * @Author:wanggongfeng + * @Date:2019/12/16 15:11 + */ +@Component +public class AppActPhraseFeignClientFallback implements AppActPhraseFeignClient { + + @Override + public Result sagenumAddOneById(String id) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "sagenumAddOneById", id); + } + @Override + public Result getPhraseList() { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "getPhraseList"); + } + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActUserRelationFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActUserRelationFeignClientFallback.java new file mode 100644 index 000000000..3954ce303 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActUserRelationFeignClientFallback.java @@ -0,0 +1,44 @@ +package com.elink.esua.epdc.feign.fallback; + +import com.elink.esua.epdc.activity.ActUserRelationDTO; +import com.elink.esua.epdc.activity.AppActUserCancelsignupDTO; +import com.elink.esua.epdc.activity.AppActUserClockLogDTO; +import com.elink.esua.epdc.activity.result.AppActInfoDTO; +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.AppActUserRelationFeignClient; +import org.springframework.stereotype.Component; + +/** + * @Author:wanggongfeng + * @Date:2019/12/16 15:11 + */ +@Component +public class AppActUserRelationFeignClientFallback implements AppActUserRelationFeignClient { + + @Override + public Result activitySignUp(ActUserRelationDTO actUserRelationDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "activitySignUp", actUserRelationDTO); + } + @Override + public Result activityCancelSignUp(AppActUserCancelsignupDTO epdcAppActUserCancelsignupDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "activityCancelSignUp", epdcAppActUserCancelsignupDTO); + } + + @Override + public Result activityClock(AppActUserClockLogDTO appActUserClockLogDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "activityClock", appActUserClockLogDTO); + } + + @Override + public Result selectListActUserRelation(String actId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "selectListActUserRelation", actId); + } + + @Override + public Result clockAddressDetail(String actId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "clockAddressDetail", actId); + } + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppVolunteerRankFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppVolunteerRankFeignClientFallback.java new file mode 100644 index 000000000..831adce1b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppVolunteerRankFeignClientFallback.java @@ -0,0 +1,25 @@ +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.AppVolunteerRankFeignClient; +import com.elink.esua.epdc.volunteer.EpdcVolunteerRankDTO; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @Author:wanggongfeng + * @Date:2019/12/16 15:11 + */ +@Component +public class AppVolunteerRankFeignClientFallback implements AppVolunteerRankFeignClient { + + @Override + public Result> leaderboard() { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "leaderboard"); + } + + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CommentFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CommentFeignClientFallback.java index 1e37ebca4..bfa24b371 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CommentFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CommentFeignClientFallback.java @@ -4,8 +4,8 @@ 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.dto.comment.CommentStatementFormDTO; -import com.elink.esua.epdc.dto.comment.form.CommentFormDTO; import com.elink.esua.epdc.dto.comment.form.EventCommentsFormDTO; +import com.elink.esua.epdc.dto.comment.form.SubmitCommentFormDTO; import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO; import com.elink.esua.epdc.feign.CommentFeignClient; import org.springframework.stereotype.Component; @@ -15,8 +15,8 @@ import org.springframework.stereotype.Component; public class CommentFeignClientFallback implements CommentFeignClient { @Override - public Result submit(CommentFormDTO commentFormDTO) { - return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "submit", commentFormDTO); + public Result submit(SubmitCommentFormDTO submitCommentFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "submit", submitCommentFormDTO); } @Override diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/OssFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/OssFeignClientFallback.java index 8925de8fb..4766822ff 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/OssFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/OssFeignClientFallback.java @@ -3,6 +3,7 @@ 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.dto.UploadDTO; import com.elink.esua.epdc.dto.UploadFormDTO; import com.elink.esua.epdc.dto.UploadToOssDTO; import com.elink.esua.epdc.feign.OssFeignClient; @@ -25,4 +26,9 @@ public class OssFeignClientFallback implements OssFeignClient { public Result uploadFile(UploadToOssDTO uploadToOssDto) { return ModuleUtils.feignConError(ServiceConstant.EPDC_OSS_SERVER, "uploadFile", uploadToOssDto); } + + @Override + public Result saveWeChatFaceImg(String avatarUrl) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_OSS_SERVER, "saveWeChatFaceImg", avatarUrl); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java index 962b5f70b..6e29662d1 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java @@ -3,6 +3,7 @@ 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.dto.CachingUserInfoDTO; import com.elink.esua.epdc.dto.UserDTO; import com.elink.esua.epdc.dto.UserGridRelationDTO; import com.elink.esua.epdc.dto.UserWxFormIdDTO; @@ -150,6 +151,7 @@ public class UserFeignClientFallback implements UserFeignClient { public Result removeGrid(EpdcAppRemoveGridFormDTO formDto) { return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "removeGrid", formDto); } + @Override public Result> invitationRecord() { return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "invitationRecord"); @@ -157,6 +159,26 @@ public class UserFeignClientFallback implements UserFeignClient { @Override public Result queryUserDto(EpdcAppQueryUserInfoFormDTO formDTO) { - return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "queryUserDto",formDTO); + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "queryUserDto", formDTO); + } + + @Override + public Result needCachingUserInfo(EpdcAppQueryUserInfoFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "needCachingUserInfo", formDTO); + } + + @Override + public Result needCachingUserInfoByUserId(String userId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "needCachingUserInfoByUserId", userId); + } + + @Override + public Result getVolunteerCountById(String userId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "getVolunteerCountById", userId); + } + + @Override + public Result insertVolunteerInfo(EpdcCompleteVolunteerInfoFormDTO epdcCompleteVolunteerInfoFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "insertVolunteerInfo", epdcCompleteVolunteerInfoFormDTO); } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/rest/v2/DemoV2Controller.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/rest/v2/DemoV2Controller.java index b6d7d114f..ac1c1f3fe 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/rest/v2/DemoV2Controller.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/rest/v2/DemoV2Controller.java @@ -15,4 +15,5 @@ import org.springframework.web.bind.annotation.RestController; @RequestMapping("/demo" + Constant.VERSION_CONTROL) public class DemoV2Controller { + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActInfoService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActInfoService.java new file mode 100644 index 000000000..ffde98c20 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActInfoService.java @@ -0,0 +1,53 @@ +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.activity.ActBannerDTO; +import com.elink.esua.epdc.activity.form.ActInfoAppFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoAppResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoDetailAppResultDTO; +import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.item.result.*; + +import java.util.List; + +/** + * 项目模块-移动App端 + * @Author LPF + * @Date 2019/11/18 13:34 + */ +public interface ActInfoService { + + + /** + * 活动列表 + * @Params: [userDetail, formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/11/19 16:37 + */ + Result> listItems(ActInfoAppFormDTO formDto); + /** + * 活动列表(已报名) + * @Params: [userDetail, formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/11/19 16:37 + */ + Result> signupListItems(ActInfoAppFormDTO formDto); + /** + * 项目详情 + * @Params: [userDetail, itemId] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result + * @Author: lipengfei + * @Date: 2019/11/19 16:34 + */ + Result getDetail(ActInfoAppFormDTO formDto); + + Result getRejectDetail(ActInfoAppFormDTO formDto); + + Result getCancelDetail(String itemId); + + Result> getBannerList(); + + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActPhraseService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActPhraseService.java new file mode 100644 index 000000000..9d249e4cb --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActPhraseService.java @@ -0,0 +1,30 @@ +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.tools.utils.Result; + +/** + * @author wanggongfeng + * @date 2019/12/17 9:50 + */ +public interface ActPhraseService { + + /** + * 常用语使用次数加一 + * @param id + * @Author wanggongfeng + * @return + */ + Result sagenumAddOneById(String id); + + /** + * redis获取常用语 + * @Author wanggongfeng + * @return + */ + Result getPhraseList(); + + + + + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActUserRelationService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActUserRelationService.java new file mode 100644 index 000000000..d85f6ba4a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActUserRelationService.java @@ -0,0 +1,56 @@ +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.activity.ActUserRelationDTO; +import com.elink.esua.epdc.activity.AppActUserCancelsignupDTO; +import com.elink.esua.epdc.activity.AppActUserClockLogDTO; +import com.elink.esua.epdc.activity.AppClockListDTO; +import com.elink.esua.epdc.activity.result.AppActInfoDTO; +import com.elink.esua.epdc.commons.tools.utils.Result; + +/** + * @author wanggongfeng + * @date 2019/12/17 9:50 + */ +public interface ActUserRelationService { + + /** + * 活动报名 + * @param actUserRelationDTO + * @Author wanggongfeng + * @return + */ + Result activitySignUp(ActUserRelationDTO actUserRelationDTO); + + /** + * 取消活动报名 + * @param epdcAppActUserCancelsignupDTO + * @Author wanggongfeng + * @return + */ + Result activityCancelSignUp(AppActUserCancelsignupDTO epdcAppActUserCancelsignupDTO); + + /** + * 活动打卡 + * @param appActUserClockLogDTO + * @Author wanggongfeng + * @return + */ + Result activityClock(AppActUserClockLogDTO appActUserClockLogDTO); + + /** + * 获取打卡列表 + * @param actId + * @Author wanggongfeng + * @return + */ + Result getClockList(String actId); + + /** + * 获取活动打卡地点详情 + * @param actId + * @Author wanggongfeng + * @return + */ + Result clockAddressDetail(String actId); + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java index 4155c3c28..558c268c2 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java @@ -7,8 +7,8 @@ import com.elink.esua.epdc.dto.epdc.result.EpdcUserGridResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO; import com.elink.esua.epdc.dto.epdc.result.UserInvitationRecordResultDTO; import com.elink.esua.epdc.dto.form.*; -import com.elink.esua.epdc.dto.result.EpdcAppRegisterCallbackDTO; import com.elink.esua.epdc.dto.result.EpdcAppAuthorizationDTO; +import com.elink.esua.epdc.dto.result.EpdcAppRegisterCallbackDTO; import com.elink.esua.epdc.dto.result.EpdcCompleteUserInfoDTO; import java.util.List; @@ -216,4 +216,26 @@ public interface AppUserService { * @Date 2019/12/7 14:32 **/ Result checkWxUnionId(TokenDto tokenDto); + + /** + * 志愿者认证 + * @param tokenDto + * @param formDto + * @Author wanggongfeng + * @return + */ + Result volunteerAuthenticate(TokenDto tokenDto, EpdcCompleteVolunteerInfoFormDTO formDto); + + /** + * 验证是否为志愿者 + * + * @param tokenDto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author wanggongfeng + * @date 2019/12/13 14:41 + */ + Result getVolunteerCountById(TokenDto tokenDto); + + + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppVolunteerRankService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppVolunteerRankService.java new file mode 100644 index 000000000..1457bf53f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppVolunteerRankService.java @@ -0,0 +1,22 @@ +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.volunteer.EpdcVolunteerRankDTO; + +import java.util.List; + +/** + * @author wanggongfeng + * @date 2019/12/17 9:50 + */ +public interface AppVolunteerRankService { + + /** + * 获取排行榜 + * @Author wanggongfeng + * @return + */ + Result> leaderboard(); + + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/DemoService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/DemoService.java new file mode 100644 index 000000000..4f6a10fd5 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/DemoService.java @@ -0,0 +1,26 @@ +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.tools.utils.Result; + +import java.util.Map; + +/** + * Demo + * + * @author yujintao + * @email yujintao@elink-cn.com + * @date 2019/6/5 14:10 + */ +public interface DemoService { + + /** + * 测试分布式事务 + * + * @param map + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author rongchao + * @since 2020-01-09 + */ + Result demo(Map map); + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActInfoServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActInfoServiceImpl.java new file mode 100644 index 000000000..729c15dc3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActInfoServiceImpl.java @@ -0,0 +1,59 @@ +package com.elink.esua.epdc.service.impl; + +import com.elink.esua.epdc.activity.ActBannerDTO; +import com.elink.esua.epdc.activity.form.ActInfoAppFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoAppResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoDetailAppResultDTO; +import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.item.ItemEvaluateDeptDTO; +import com.elink.esua.epdc.dto.item.form.*; +import com.elink.esua.epdc.dto.item.result.*; +import com.elink.esua.epdc.feign.ActInfoFeignClient; +import com.elink.esua.epdc.feign.WorkItemFeignClient; +import com.elink.esua.epdc.service.ActInfoService; +import com.elink.esua.epdc.service.WorkItemService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 项目模块-移动app端 + * @Author LPF + * @Date 2019/11/18 16:34 + */ +@Service +public class ActInfoServiceImpl implements ActInfoService { + + @Autowired + private ActInfoFeignClient actInfoFeignClient; + + + + @Override + public Result> listItems(ActInfoAppFormDTO formDto) { + return actInfoFeignClient.listItems(formDto); + } + @Override + public Result> signupListItems(ActInfoAppFormDTO formDto) { + return actInfoFeignClient.signupListItems(formDto); + } + + @Override + public Result getDetail(ActInfoAppFormDTO formDto) { + return actInfoFeignClient.getDetail(formDto); + } + @Override + public Result getRejectDetail(ActInfoAppFormDTO formDto) { + return actInfoFeignClient.getRejectDetail(formDto); + } + @Override + public Result getCancelDetail(String itemId) { + return actInfoFeignClient.getCancelDetail(itemId); + } + @Override + public Result> getBannerList() { + return actInfoFeignClient.getBannerList(); + } +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActPhraseServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActPhraseServiceImpl.java new file mode 100644 index 000000000..c6e92b1d8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActPhraseServiceImpl.java @@ -0,0 +1,36 @@ +package com.elink.esua.epdc.service.impl; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.feign.AppActPhraseFeignClient; +import com.elink.esua.epdc.service.ActPhraseService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * @author wanggongfeng + * @date 2019/12/16 17:50 + */ +@Slf4j +@Service +public class ActPhraseServiceImpl implements ActPhraseService { + + @Autowired + private AppActPhraseFeignClient appActPhraseFeignClient; + + @Override + public Result sagenumAddOneById(String id) { + Result dataResult = appActPhraseFeignClient.sagenumAddOneById(id); + return dataResult; + } + + @Override + public Result getPhraseList() { + Result dataResult = appActPhraseFeignClient.getPhraseList(); + return dataResult; + } + + + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActUserRelationServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActUserRelationServiceImpl.java new file mode 100644 index 000000000..26d89d255 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActUserRelationServiceImpl.java @@ -0,0 +1,57 @@ +package com.elink.esua.epdc.service.impl; + +import com.elink.esua.epdc.activity.ActUserRelationDTO; +import com.elink.esua.epdc.activity.AppActUserCancelsignupDTO; +import com.elink.esua.epdc.activity.AppActUserClockLogDTO; +import com.elink.esua.epdc.activity.AppClockListDTO; +import com.elink.esua.epdc.activity.result.AppActInfoDTO; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.feign.AppActUserRelationFeignClient; +import com.elink.esua.epdc.service.ActUserRelationService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * @author wanggongfeng + * @date 2019/12/16 17:50 + */ +@Slf4j +@Service +public class ActUserRelationServiceImpl implements ActUserRelationService { + + @Autowired + private AppActUserRelationFeignClient actInfoFeignClient; + + @Override + public Result activitySignUp(ActUserRelationDTO actUserRelationDTO) { + Result dataResult = actInfoFeignClient.activitySignUp(actUserRelationDTO); + return dataResult; + } + + @Override + public Result activityCancelSignUp(AppActUserCancelsignupDTO epdcAppActUserCancelsignupDTO) { + Result dataResult = actInfoFeignClient.activityCancelSignUp(epdcAppActUserCancelsignupDTO); + return dataResult; + } + + @Override + public Result activityClock(AppActUserClockLogDTO appActUserClockLogDTO) { + Result dataResult = actInfoFeignClient.activityClock(appActUserClockLogDTO); + return dataResult; + } + + @Override + public Result getClockList(String actId) { + Result result = actInfoFeignClient.selectListActUserRelation(actId); + return result; + } + + @Override + public Result clockAddressDetail(String actId) { + Result dataResult = actInfoFeignClient.clockAddressDetail(actId); + return dataResult; + } + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java index 92bf20d64..3268a099b 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java @@ -5,8 +5,10 @@ import cn.binarywang.wx.miniapp.bean.WxMaUserInfo; import com.elink.esua.epdc.async.GroupTask; import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.common.token.util.CpUserDetailRedis; +import com.elink.esua.epdc.common.token.util.IdentityNoAnalysisUtil; import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.enums.UserSexEnum; +import com.elink.esua.epdc.commons.tools.enums.UserTagEnum; import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; import com.elink.esua.epdc.commons.tools.exception.RenException; import com.elink.esua.epdc.commons.tools.redis.RedisUtils; @@ -15,20 +17,22 @@ import com.elink.esua.epdc.dto.*; import com.elink.esua.epdc.dto.enums.GroupUserStateEnum; import com.elink.esua.epdc.dto.epdc.EpdcCompleteAppUserDTO; import com.elink.esua.epdc.dto.epdc.EpdcGridLeaderRegisterDTO; -import com.elink.esua.epdc.dto.epdc.form.EpdcGridLeaderRegisterFormDTO; import com.elink.esua.epdc.dto.epdc.GridLeaderRegisterDTO; import com.elink.esua.epdc.dto.epdc.form.*; import com.elink.esua.epdc.dto.epdc.result.EpdcUserGridResultDTO; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserRegisterInfoResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcUserRegisterInfoResultDTO; import com.elink.esua.epdc.dto.epdc.result.UserInvitationRecordResultDTO; import com.elink.esua.epdc.dto.form.*; import com.elink.esua.epdc.dto.group.form.GroupUserFormDTO; import com.elink.esua.epdc.dto.group.form.GroupUserPartyMemberFormDTO; -import com.elink.esua.epdc.dto.result.EpdcAppRegisterCallbackDTO; import com.elink.esua.epdc.dto.result.EpdcAppAuthorizationDTO; +import com.elink.esua.epdc.dto.result.EpdcAppRegisterCallbackDTO; import com.elink.esua.epdc.dto.result.EpdcCompleteUserInfoDTO; -import com.elink.esua.epdc.enums.*; +import com.elink.esua.epdc.enums.AppUserAuditStateEnum; +import com.elink.esua.epdc.enums.AppUserRegisterSourceEnum; +import com.elink.esua.epdc.enums.AppUserRegisterWayEnum; +import com.elink.esua.epdc.enums.AppUserStatesEnum; import com.elink.esua.epdc.feign.AdminFeignClient; import com.elink.esua.epdc.feign.GroupFeignClient; import com.elink.esua.epdc.feign.OssFeignClient; @@ -37,6 +41,7 @@ import com.elink.esua.epdc.jwt.JwtTokenProperties; import com.elink.esua.epdc.jwt.JwtTokenUtils; import com.elink.esua.epdc.redis.AppUserRedis; import com.elink.esua.epdc.service.AppUserService; +import com.elink.esua.epdc.utils.UserTagUtils; import com.elink.esua.epdc.utils.WxMaServiceUtils; import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.common.error.WxErrorException; @@ -86,6 +91,7 @@ public class AppUserServiceImpl implements AppUserService { @Autowired private JwtTokenProperties jwtTokenProperties; + @Autowired private OssFeignClient ossFeignClient; @@ -206,7 +212,7 @@ public class AppUserServiceImpl implements AppUserService { EpdcAppQueryUserInfoFormDTO formDTO = new EpdcAppQueryUserInfoFormDTO(); formDTO.setOpenId(wxMaJscode2SessionResult.getOpenid()); formDTO.setUnionId(wxMaJscode2SessionResult.getUnionid()); - Result userInfoResult = userFeignClient.queryUserDto(formDTO); + Result userInfoResult = userFeignClient.needCachingUserInfo(formDTO); if (!userInfoResult.success()) { return new Result().error(userInfoResult.getMsg()); } @@ -221,7 +227,7 @@ public class AppUserServiceImpl implements AppUserService { * @author work@yujt.net.cn * @date 2019/9/19 19:17 */ - private Result getTokenByUserDto(UserDTO userDto) { + private Result getTokenByUserDto(CachingUserInfoDTO userDto) { EpdcAppAuthorizationDTO authorization = new EpdcAppAuthorizationDTO(); // 用户未注册 @@ -230,10 +236,9 @@ public class AppUserServiceImpl implements AppUserService { return new Result().ok(authorization); } TokenDto tokenDto = ConvertUtils.sourceToTarget(userDto, TokenDto.class); - tokenDto.setUserId(userDto.getId()); String state = userDto.getState(); - authorization = this.packageEpdcAppAuthorization(tokenDto, userDto.getGrid(), userDto.getState()); + authorization = this.packageEpdcAppAuthorization(tokenDto, userDto.getGrid(), state); Result result = new Result().ok(authorization); // 已注册,未完善信息 @@ -283,12 +288,6 @@ public class AppUserServiceImpl implements AppUserService { // 组装用户注册信息 EpdcGridLeaderRegisterDTO gridLeaderRegister = this.packageGridLeaderWhileRegister(leaderRegisterDto.getSysUser(), formDto.getWxCode()); List userGridList = ConvertUtils.sourceToTarget(leaderRegisterDto.getLeaderGridList(), UserGridRelationDTO.class); - for (UserGridRelationDTO item : userGridList) { - item.setAllDeptNames(item.getDistrict() + "-" + item.getStreet() + "-" + item.getCommunity() + "-" + item.getGrid()); - item.setAllDeptIds(item.getDistrictId() + "," + item.getStreetId() + "," + item.getCommunityId() + "," + item.getGridId()); - item.setParentDeptIds(item.getDistrict() + "-" + item.getStreet() + "-" + item.getCommunity()); - item.setParentDeptNames(item.getDistrictId() + "," + item.getStreetId() + "," + item.getCommunityId()); - } EpdcGridLeaderRegisterFormDTO registerDto = new EpdcGridLeaderRegisterFormDTO(); registerDto.setGridLeader(gridLeaderRegister); registerDto.setUserGridList(userGridList); @@ -835,22 +834,23 @@ public class AppUserServiceImpl implements AppUserService { } return new Result().error(completeResult.getMsg()); } - UserDTO user = completeResult.getData(); - tokenDto.setRealName(user.getRealName()); - tokenDto.setNickname(user.getNickname()); - tokenDto.setMobile(user.getMobile()); - tokenDto.setPartyFlag(user.getPartyFlag()); - EpdcAppAuthorizationDTO authorizationDto = this.packageEpdcAppAuthorization(tokenDto, userGrid.getGrid(), user.getState()); + //更新用户缓存信息 + Result cachingUserResult = userFeignClient.needCachingUserInfoByUserId(tokenDto.getUserId()); + CachingUserInfoDTO cachingUserInfoDTO = cachingUserResult.getData(); + TokenDto newTokenDto = ConvertUtils.sourceToTarget(cachingUserInfoDTO, TokenDto.class); + tokenDto.setUserId(userDto.getId()); + EpdcAppAuthorizationDTO authorizationDto = this.packageEpdcAppAuthorization(newTokenDto, userGrid.getGrid(), userDto.getState()); // 更新社群用户党员标识并加入关联的所有网格党员群 - if (NumConstant.ONE_STR.equals(user.getPartyFlag())) { + boolean partyFlag = UserTagUtils.containIdentity(cachingUserInfoDTO.getUserTagInfos(), UserTagEnum.PARTY_MEMBER); + if (partyFlag) { GroupUserPartyMemberFormDTO formDto = new GroupUserPartyMemberFormDTO(); - formDto.setUserId(user.getId()); - formDto.setPartyMember(user.getPartyFlag()); - formDto.setNickname(user.getNickname()); - formDto.setUserAvatar(user.getFaceImg()); - formDto.setMobile(user.getMobile()); - formDto.setDeptId(user.getDeptId()); + formDto.setUserId(cachingUserInfoDTO.getUserId()); + formDto.setPartyMember(partyFlag ? NumConstant.ZERO_STR : NumConstant.ONE_STR); + formDto.setNickname(cachingUserInfoDTO.getNickname()); + formDto.setUserAvatar(cachingUserInfoDTO.getFaceImg()); + formDto.setMobile(cachingUserInfoDTO.getMobile()); + formDto.setDeptId(cachingUserInfoDTO.getGridId()); formDto.setState(GroupUserStateEnum.GROUP_USER_STATE_EXAMINATION_PASSED.getValue()); groupFeignClient.updateUserPartyMember(formDto); @@ -976,7 +976,13 @@ public class AppUserServiceImpl implements AppUserService { UserDTO userDTO = new UserDTO(); userDTO.setId(userDetail.getUserId()); userDTO.setNickname(wxMaUserInfo.getNickName()); - userDTO.setFaceImg(wxMaUserInfo.getAvatarUrl()); + //上传微信头像 + Result uploadDTOResult = ossFeignClient.saveWeChatFaceImg(wxMaUserInfo.getAvatarUrl()); + if (uploadDTOResult.success()) { + userDTO.setFaceImg(uploadDTOResult.getData().getUrl()); + } else { + userDTO.setFaceImg(USER_FACE); + } //微信性别0未知 1:男 2:女 本系统:1男,0女 if (UserSexEnum.WX_MALE.sex().equals(wxMaUserInfo.getGender())) { userDTO.setSex(UserSexEnum.MALE.sex()); @@ -997,7 +1003,7 @@ public class AppUserServiceImpl implements AppUserService { tokenDto.setUserId(userDetail.getUserId()); tokenDto.setGridId(userDetail.getGridId()); tokenDto.setMobile(userDetail.getMobile()); - tokenDto.setPartyFlag(userDetail.getPartyFlag()); + tokenDto.setUserTagInfos(userDetail.getUserTagInfos()); tokenDto.setRealName(userDetail.getRealName()); long expire = cpUserDetailRedis.getExpire(userDetail.getUserId()); cpUserDetailRedis.logout(userDetail.getUserId()); @@ -1082,4 +1088,136 @@ public class AppUserServiceImpl implements AppUserService { } return result; } + + /** + * 志愿者认证 + * + * @param tokenDto + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author wanggongfeng + * @date 2019/12/13 14:41 + */ + @Override + public Result volunteerAuthenticate(TokenDto tokenDto, EpdcCompleteVolunteerInfoFormDTO formDto) { + String sex = IdentityNoAnalysisUtil.getSex(formDto.getIdentityNo()); // 身份证解析性别 + Date birthday = IdentityNoAnalysisUtil.getBirthDay(formDto.getIdentityNo()); // 身份证解析生日 + formDto.setSex(sex); // 性别 + formDto.setBirthday(birthday); // 生日 + formDto.setUserId(tokenDto.getUserId()); // 用户ID + // 验证是否为志愿者 + Result volunteerCountResult = userFeignClient.getVolunteerCountById(tokenDto.getUserId()); + if (!volunteerCountResult.success() || null == volunteerCountResult.getData()) { + return new Result().error("志愿者认证失败"); + } else if (volunteerCountResult.getData() == 0) { + // 添加志愿者 + Result insertCountResult = userFeignClient.insertVolunteerInfo(formDto); + } + + // 调用用户完善个人信息-保存 + EpdcCompleteUserInfoFormDTO epdcCompleteUserInfoFormDTO = ConvertUtils.sourceToTarget(formDto, EpdcCompleteUserInfoFormDTO.class); + if (UserTagUtils.containIdentity(tokenDto.getUserTagInfos(), UserTagEnum.PARTY_MEMBER)) { + epdcCompleteUserInfoFormDTO.setPartyFlag(YesOrNoEnum.YES.value());// 党员标志 + } else { + epdcCompleteUserInfoFormDTO.setPartyFlag(YesOrNoEnum.NO.value()); // 党员标志 + } + Result result = completeUserInfoNoVerifyCode(tokenDto, epdcCompleteUserInfoFormDTO); + + return result; + } + + /** + * 查询是否为志愿者 + * + * @param tokenDto + * @return + */ + @Override + public Result getVolunteerCountById(TokenDto tokenDto) { + Result result = new Result(); + Result volunteerCountResult = userFeignClient.getVolunteerCountById(tokenDto.getUserId()); + if (!volunteerCountResult.success() || null == volunteerCountResult.getData()) { + result.error("志愿者验证错误"); + } else { + if (volunteerCountResult.getData() == 0) { + result.error("该用户不是志愿者"); + } else { + result.setMsg("志愿者认证通过"); + } + } + return result; + } + + public Result completeUserInfoNoVerifyCode(TokenDto tokenDto, EpdcCompleteUserInfoFormDTO infoDto) { + + UserDTO userDto = ConvertUtils.sourceToTarget(infoDto, UserDTO.class); + userDto.setDeptId(Long.valueOf(infoDto.getGridId())); + userDto.setId(tokenDto.getUserId()); + + if (StringUtils.isNotBlank(infoDto.getWxCode())) { + String sessionKey = this.getUserSessionKey(infoDto.getWxCode()); + WxMaUserInfo wxMaUserInfo = wxMaServiceUtils.normalWxMaService().getUserService().getUserInfo(sessionKey, infoDto.getEncryptedData(), infoDto.getIv()); + if (StringUtils.isBlank(wxMaUserInfo.getUnionId())) { + return new Result().error("解析微信开放平台ID失败"); + } + userDto.setWxUnionId(wxMaUserInfo.getUnionId()); + } + + // 党员提交,验证身份证号 + if (YesOrNoEnum.YES.value().equals(userDto.getPartyFlag())) { + String identityNo = userDto.getIdentityNo(); + if (StringUtils.isBlank(identityNo)) { + return new Result().error("身份证号不能为空"); + } else { + String verification = IdentityNoUtils.IdentityNoVerification(identityNo); + if (StringUtils.isNotBlank(verification)) { + return new Result().error(verification); + } + } + } + // 验证手机号验证码 + //this.checkSmsCode(userDto.getMobile(), infoDto.getSmsCode()); + // 验证用户提交的信息 + Result verifyResult = userFeignClient.verifyUserCompleteData(userDto); + if (!verifyResult.success()) { + return new Result().error(verifyResult.getMsg()); + } + String userState = verifyResult.getData(); + + UserGridRelationDTO userGrid = this.packageUserGridRelationInfo(infoDto.getGridId()); + EpdcCompleteAppUserDTO completeAppUserDto = ConvertUtils.sourceToTarget(userDto, EpdcCompleteAppUserDTO.class); + completeAppUserDto = this.packageUserCompleteInfo(completeAppUserDto, userState); + // 组装对象,准备保存用户信息 + EpdcAppUserCompleteInfoFormDTO dto = new EpdcAppUserCompleteInfoFormDTO(); + dto.setCompleteAppUser(completeAppUserDto); + dto.setUserGridRelation(userGrid); + + Result completeResult = userFeignClient.completeUserInfo(dto); + if (!completeResult.success()) { + return new Result().error(completeResult.getMsg()); + } + UserDTO user = completeResult.getData(); + tokenDto.setRealName(user.getRealName()); + tokenDto.setNickname(user.getNickname()); + tokenDto.setMobile(user.getMobile()); + EpdcAppAuthorizationDTO authorizationDto = this.packageEpdcAppAuthorization(tokenDto, userGrid.getGrid(), userDto.getState()); + + // 更新社群用户党员标识并加入关联的所有网格党员群 + if (NumConstant.ONE_STR.equals(user.getPartyFlag())) { + GroupUserPartyMemberFormDTO formDto = new GroupUserPartyMemberFormDTO(); + formDto.setUserId(user.getId()); + formDto.setPartyMember(user.getPartyFlag()); + formDto.setNickname(user.getNickname()); + formDto.setUserAvatar(user.getFaceImg()); + formDto.setMobile(user.getMobile()); + formDto.setDeptId(user.getGridId()); + formDto.setState(GroupUserStateEnum.GROUP_USER_STATE_EXAMINATION_PASSED.getValue()); + + groupTask.updateUserPartyMember(formDto); + } + + return new Result().ok(authorizationDto); + } + + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppVolunteerRankServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppVolunteerRankServiceImpl.java new file mode 100644 index 000000000..2f5012274 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppVolunteerRankServiceImpl.java @@ -0,0 +1,36 @@ +package com.elink.esua.epdc.service.impl; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.feign.AppVolunteerRankFeignClient; +import com.elink.esua.epdc.service.AppVolunteerRankService; +import com.elink.esua.epdc.volunteer.EpdcVolunteerRankDTO; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + + +/** + * @author wanggongfeng + * @date 2019/12/16 17:50 + */ +@Slf4j +@Service +public class AppVolunteerRankServiceImpl implements AppVolunteerRankService { + + @Autowired + private AppVolunteerRankFeignClient appVolunteerRankFeignClient; + + /** + * 获取排行榜 + * @Author wanggongfeng + * @return + */ + @Override + public Result> leaderboard() { + Result> dataResult = appVolunteerRankFeignClient.leaderboard(); + return dataResult; + } + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CommentServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CommentServiceImpl.java index 466c3ab54..d9163414b 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CommentServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CommentServiceImpl.java @@ -3,13 +3,18 @@ package com.elink.esua.epdc.service.impl; import com.elink.esua.epdc.async.WxMaSecCheckTask; import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.enums.UserTagEnum; +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.comment.CommentStatementFormDTO; import com.elink.esua.epdc.dto.comment.form.CommentFormDTO; import com.elink.esua.epdc.dto.comment.form.EventCommentsFormDTO; +import com.elink.esua.epdc.dto.comment.form.SubmitCommentFormDTO; import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO; import com.elink.esua.epdc.feign.CommentFeignClient; import com.elink.esua.epdc.service.CommentService; +import com.elink.esua.epdc.utils.UserTagUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -37,7 +42,13 @@ public class CommentServiceImpl implements CommentService { commentFormDTO.setUserId(userDetail.getUserId()); commentFormDTO.setUserName(userDetail.getNickname()); commentFormDTO.setUserFace(userDetail.getFaceImg()); - return commentFeignClient.submit(commentFormDTO); + SubmitCommentFormDTO submitCommentFormDTO = ConvertUtils.sourceToTarget(commentFormDTO, SubmitCommentFormDTO.class); + if (UserTagUtils.containIdentity(userDetail.getUserTagInfos(), UserTagEnum.PARTY_MEMBER)) { + submitCommentFormDTO.setPartyFlag(YesOrNoEnum.YES.value()); + } else { + submitCommentFormDTO.setPartyFlag(YesOrNoEnum.NO.value()); + } + return commentFeignClient.submit(submitCommentFormDTO); } @Override diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/DemoServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/DemoServiceImpl.java new file mode 100644 index 000000000..530b4205a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/DemoServiceImpl.java @@ -0,0 +1,42 @@ +package com.elink.esua.epdc.service.impl; + +import com.elink.esua.epdc.commons.tools.exception.RenException; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.ScanSwitchDTO; +import com.elink.esua.epdc.feign.DemoFeignClient; +import com.elink.esua.epdc.service.DemoService; +import com.elink.esua.epdc.service.ScanSwitchService; +import io.seata.spring.annotation.GlobalTransactional; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * @author yujintao + * @email yujintao@elink-cn.com + * @date 2019/9/11 9:40 + */ +@Service +public class DemoServiceImpl implements DemoService { + + @Autowired + private ScanSwitchService scanSwitchService; + + @Autowired + private DemoFeignClient demoFeignClient; + + @GlobalTransactional(rollbackFor = Exception.class) + @Override + public Result demo(Map map) { + ScanSwitchDTO dto = new ScanSwitchDTO(); + dto.setId("54185412da2bea73804fc1de69827e18"); + dto.setMaintainInfo(map.get("username").toString()); + scanSwitchService.update(dto); + Result r = demoFeignClient.seata(map.get("username").toString(), Integer.parseInt(map.get("age").toString())); + if (!r.success()) { + throw new RenException("添加失败"); + } + return new Result(); + } +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/GroupServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/GroupServiceImpl.java index 294ed172a..8a91b534d 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/GroupServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/GroupServiceImpl.java @@ -2,20 +2,24 @@ package com.elink.esua.epdc.service.impl; import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.enums.UserTagEnum; +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.dto.CompleteDeptDTO; import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; +import com.elink.esua.epdc.dto.enums.GroupStateEnum; +import com.elink.esua.epdc.dto.enums.GroupUserStateEnum; import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO; import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; -import com.elink.esua.epdc.dto.enums.GroupStateEnum; -import com.elink.esua.epdc.dto.enums.GroupUserStateEnum; import com.elink.esua.epdc.dto.group.form.*; -import com.elink.esua.epdc.dto.group.result.*; +import com.elink.esua.epdc.dto.group.result.GroupDetailForMobileEndResultDTO; +import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; +import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; +import com.elink.esua.epdc.dto.group.result.GroupsOfRecommendResultDTO; import com.elink.esua.epdc.feign.AdminFeignClient; import com.elink.esua.epdc.feign.GroupFeignClient; import com.elink.esua.epdc.service.GroupService; -import org.apache.commons.lang3.StringUtils; +import com.elink.esua.epdc.utils.UserTagUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -63,10 +67,10 @@ public class GroupServiceImpl implements GroupService { groupUserFormDTO.setUserAvatar(userDetail.getFaceImg()); groupUserFormDTO.setMobile(userDetail.getMobile()); // 判断当前用户是否为党员 - if (!NumConstant.ONE_STR.equals(userDetail.getPartyFlag())) { + if (!UserTagUtils.containIdentity(userDetail.getUserTagInfos(), UserTagEnum.PARTY_MEMBER)) { return new Result().error("您当前身份不是党员,不能创建社群"); } - groupUserFormDTO.setPartyMember(userDetail.getPartyFlag()); + groupUserFormDTO.setPartyMember(YesOrNoEnum.YES.value()); groupUserFormDTO.setLordFlag(NumConstant.ONE_STR); groupUserFormDTO.setState(GroupUserStateEnum.GROUP_USER_STATE_EXAMINATION_PASSED.getValue()); formDto.setGroupUserFormDTO(groupUserFormDTO); @@ -187,7 +191,11 @@ public class GroupServiceImpl implements GroupService { formDto.setNickname(userDetail.getNickname()); formDto.setUserAvatar(userDetail.getFaceImg()); formDto.setMobile(userDetail.getMobile()); - formDto.setPartyMember(userDetail.getPartyFlag()); + if (UserTagUtils.containIdentity(userDetail.getUserTagInfos(), UserTagEnum.PARTY_MEMBER)) { + formDto.setPartyMember(YesOrNoEnum.YES.value()); + } else { + formDto.setPartyMember(YesOrNoEnum.NO.value()); + } return groupFeignClient.applyForGroup(formDto); } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/IssueServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/IssueServiceImpl.java index a5575b0db..74c9b43af 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/IssueServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/IssueServiceImpl.java @@ -2,8 +2,9 @@ package com.elink.esua.epdc.service.impl; import com.elink.esua.epdc.async.WxMaSecCheckTask; import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.enums.UserTagEnum; +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.dto.CompleteDeptDTO; import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; import com.elink.esua.epdc.dto.UploadFormDTO; import com.elink.esua.epdc.dto.category.CategoryDTO; @@ -15,9 +16,9 @@ import com.elink.esua.epdc.feign.AdminFeignClient; import com.elink.esua.epdc.feign.IssueFeignClient; import com.elink.esua.epdc.feign.OssFeignClient; import com.elink.esua.epdc.service.IssueService; +import com.elink.esua.epdc.utils.UserTagUtils; import me.chanjar.weixin.mp.api.WxMpMaterialService; import me.chanjar.weixin.mp.api.WxMpService; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -86,7 +87,11 @@ public class IssueServiceImpl implements IssueService { formDto.setUserId(userDetail.getUserId()); formDto.setNickName(userDetail.getNickname()); formDto.setUserFace(userDetail.getFaceImg()); - formDto.setIsPartyMember(userDetail.getPartyFlag()); + if (UserTagUtils.containIdentity(userDetail.getUserTagInfos(), UserTagEnum.PARTY_MEMBER)) { + formDto.setIsPartyMember(YesOrNoEnum.YES.value()); + } else { + formDto.setIsPartyMember(YesOrNoEnum.NO.value()); + } formDto.setMobile(userDetail.getMobile()); return issueFeignClient.submitEvent(formDto); diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/TopicCommentServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/TopicCommentServiceImpl.java index c878f58c5..e3eededb8 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/TopicCommentServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/TopicCommentServiceImpl.java @@ -3,6 +3,8 @@ package com.elink.esua.epdc.service.impl; import com.elink.esua.epdc.async.WxMaSecCheckTask; import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.enums.UserTagEnum; +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.comment.TopicCommentFormDTO; import com.elink.esua.epdc.dto.comment.TopicCommentStatementFormDTO; @@ -10,8 +12,8 @@ import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO; import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO; import com.elink.esua.epdc.feign.TopicCommentFeignClient; import com.elink.esua.epdc.service.TopicCommentService; +import com.elink.esua.epdc.utils.UserTagUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.listener.Topic; import org.springframework.stereotype.Service; /** @@ -38,6 +40,11 @@ public class TopicCommentServiceImpl implements TopicCommentService { topicCommentFormDTO.setUserId(userDetail.getUserId()); topicCommentFormDTO.setUserName(userDetail.getNickname()); topicCommentFormDTO.setUserFace(userDetail.getFaceImg()); + if (UserTagUtils.containIdentity(userDetail.getUserTagInfos(), UserTagEnum.PARTY_MEMBER)) { + topicCommentFormDTO.setPartyFlag(YesOrNoEnum.YES.value()); + } else { + topicCommentFormDTO.setPartyFlag(YesOrNoEnum.NO.value()); + } return topicCommentFeignClient.submit(topicCommentFormDTO); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/TopicServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/TopicServiceImpl.java index 1ca2ad161..a0bd8b78b 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/TopicServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/TopicServiceImpl.java @@ -1,6 +1,8 @@ package com.elink.esua.epdc.service.impl; import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.enums.UserTagEnum; +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; import com.elink.esua.epdc.dto.UploadToOssDTO; @@ -13,6 +15,7 @@ import com.elink.esua.epdc.feign.AdminFeignClient; import com.elink.esua.epdc.feign.OssFeignClient; import com.elink.esua.epdc.feign.TopicFeignClient; import com.elink.esua.epdc.service.TopicService; +import com.elink.esua.epdc.utils.UserTagUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; @@ -58,7 +61,11 @@ public class TopicServiceImpl implements TopicService { formDto.setUserId(userDetail.getUserId()); formDto.setUserFace(userDetail.getFaceImg()); formDto.setNickname(userDetail.getNickname()); - formDto.setPartyMember(userDetail.getPartyFlag()); + if (UserTagUtils.containIdentity(userDetail.getUserTagInfos(), UserTagEnum.PARTY_MEMBER)) { + formDto.setPartyMember(YesOrNoEnum.YES.value()); + } else { + formDto.setPartyMember(YesOrNoEnum.NO.value()); + } formDto.setMobile(userDetail.getMobile()); formDto.setState(TopicStateEnum.TOPIC_STATE_IN_CONVERSATION.getValue()); diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/utils/UserTagUtils.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/utils/UserTagUtils.java new file mode 100644 index 000000000..cdcd3d8b4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/utils/UserTagUtils.java @@ -0,0 +1,55 @@ +package com.elink.esua.epdc.utils; + +import com.elink.esua.epdc.commons.tools.enums.UserTagEnum; +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; +import com.elink.esua.epdc.dto.UserTagInfo; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; + + +/** + * @Description 判断用户身份工具类 + * @Author yinzuomei + * @Date 2019/12/18 17:15 + */ +public class UserTagUtils { + private static Logger logger = LoggerFactory.getLogger(UserTagUtils.class); + +// /** +// * @param userTagInfos +// * @return java.lang.String +// * @Author yinzuomei +// * @Description 党员标识 0:否,1:是 +// * @Date 2019/12/18 17:23 +// **/ +// public static String getUserPartyFlag(List userTagInfos) { +// for (UserTagInfo userTagInfo : userTagInfos) { +// if (UserTagEnum.PARTY_MEMBER.value().equals(userTagInfo.getTagCode())) { +// return YesOrNoEnum.YES.value(); +// } +// } +// return YesOrNoEnum.NO.value(); +// } + + /** + * 判断用户是否有该身份 + * + * @param userTagInfos + * @param userTagEnum + * @return boolean + * @author rongchao + * @since 2019-12-19 + */ + public static boolean containIdentity(List userTagInfos, UserTagEnum userTagEnum) { + boolean flag = Boolean.FALSE; + for (UserTagInfo userTagInfo : userTagInfos) { + if (userTagEnum.value().equals(userTagInfo.getTagCode())) { + flag = Boolean.TRUE; + break; + } + } + return flag; + } +} diff --git a/esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-client/src/main/java/com/elink/esua/epdc/epdc.gitkeep b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application-dev.yml similarity index 100% rename from esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-client/src/main/java/com/elink/esua/epdc/epdc.gitkeep rename to esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application-dev.yml diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application-prod.yml b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application-prod.yml new file mode 100644 index 000000000..cae812087 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application-prod.yml @@ -0,0 +1,3 @@ +nacos: + config: + server-addr: 47.104.224.45:8848 diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application-test.yml b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application-test.yml new file mode 100644 index 000000000..8a46445fc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application-test.yml @@ -0,0 +1,4 @@ +nacos: + config: + server-addr: 47.104.224.45:8848 + namespace: 6a3577b4-7b79-43f6-aebb-9c3f31263f6a diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application.yml index 7cb97f9f8..b3cd162ba 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application.yml +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application.yml @@ -1,131 +1,27 @@ server: - port: @server.port@ + port: 9700 servlet: context-path: /api spring: - main: - allow-bean-definition-overriding: true application: name: epdc-api-server - # 环境 dev|test|prod profiles: - active: dev - messages: - encoding: UTF-8 - basename: i18n/messages,i18n/messages_common - jackson: - time-zone: GMT+8 - date-format: yyyy-MM-dd HH:mm:ss - redis: - database: @spring.redis.index@ - host: @spring.redis.host@ - timeout: 30s - port: @spring.redis.port@ - password: @spring.redis.password@ - datasource: - druid: - driver-class-name: com.mysql.cj.jdbc.Driver - url: @spring.datasource.druid.url@ - username: @spring.datasource.druid.username@ - password: @spring.datasource.druid.password@ + active: @spring.profiles.active@ cloud: nacos: - discovery: - server-addr: @nacos.server-addr@ - register-enabled: @nacos.register-enabled@ - alibaba: - seata: - tx-service-group: epdc-api-server-fescar-service-group - servlet: - multipart: - enabled: true - file-size-threshold: 0 - max-file-size: 10MB - max-request-size: 10MB + config: + server-addr: 47.104.224.45:8848 + namespace: 513d6635-3cfe-401f-b8b6-a04417288f47 + group: EPDC_CONFIG_GROUP + file-exetension: yaml + enabled: true management: endpoints: web: exposure: - include: "*" - endpoint: - health: - show-details: ALWAYS - -feign: - hystrix: - enabled: true - httpclient: - enabled: true - -hystrix: - command: - default: - execution: - isolation: - strategy: SEMAPHORE - thread: - timeoutInMilliseconds: 60000 #缺省为1000 - -ribbon: - ReadTimeout: 300000 - ConnectTimeout: 300000 - -mybatis-plus: - mapper-locations: classpath:/mapper/**/*.xml - #实体扫描,多个package用逗号或者分号分隔 - typeAliasesPackage: com.elink.esua.epdc.entity - global-config: - #数据库相关配置 - db-config: - #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; - id-type: ID_WORKER - #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" - field-strategy: NOT_NULL - #驼峰下划线转换 - column-underline: true - banner: false - #原生配置 - configuration: - map-underscore-to-camel-case: true - cache-enabled: false - call-setters-on-nulls: true - jdbc-type-for-null: 'null' - -wx: - mp: - configs: - - appId: @wx.mp.configs.appId@ - secret: @wx.mp.configs.secret@ - token: @wx.mp.configs.token@ - aesKey: @wx.mp.configs.aesKey@ - ma: - configs: - - appid: @wx.ma.appId@ - secret: @wx.ma.secret@ - token: #微信小程序消息服务器配置的token - aesKey: #微信小程序消息服务器配置的EncodingAESKey - msgDataFormat: JSON - - appid: @work.wx.ma.appId@ - secret: @work.wx.ma.secret@ - token: #微信小程序消息服务器配置的token - aesKey: #微信小程序消息服务器配置的EncodingAESKey - msgDataFormat: JSON - appId: - # 普通居民端的appId - normal: @wx.ma.appId@ - # 工作端的appId - work: @work.wx.ma.appId@ - - - -token: - expire: 21600 + include: * -jwt: - token: - #秘钥 - secret: 7016867071f0ebf1c46f123eaaf4b9d6[elink.epdc] - #token有效时长,默认7天,单位秒 - expire: 604800 +logging: + config: classpath:logback-spring.xml diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/test/java/com/elink/esua/epdc/UserTest.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/test/java/com/elink/esua/epdc/UserTest.java index 5f659ea76..04726e4b2 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/test/java/com/elink/esua/epdc/UserTest.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/test/java/com/elink/esua/epdc/UserTest.java @@ -38,7 +38,6 @@ public class UserTest { tokenDto.setGridId(1169158285790900226L); tokenDto.setMobile("15555555555"); tokenDto.setNickname("测试用户"); - tokenDto.setPartyFlag(YesOrNoEnum.YES.value()); tokenDto.setRealName("无名氏"); String token = jwtTokenUtils.generateToken(tokenDto.getUserId()); diff --git a/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/pom.xml b/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/pom.xml index 15ae7d4c8..cdd6e505f 100644 --- a/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/pom.xml @@ -86,10 +86,6 @@ true - - com.spotify - dockerfile-maven-plugin - diff --git a/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/java/com/elink/esua/epdc/entity/DemoEntity.java b/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/java/com/elink/esua/epdc/entity/DemoEntity.java index 2843c3c65..f5a4c074b 100644 --- a/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/java/com/elink/esua/epdc/entity/DemoEntity.java +++ b/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/java/com/elink/esua/epdc/entity/DemoEntity.java @@ -28,7 +28,7 @@ public class DemoEntity implements Serializable { * 用户ID */ @TableId - private Long id; + private String id; /** * 用户名 */ diff --git a/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/java/com/elink/esua/epdc/service/impl/DemoServiceImpl.java b/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/java/com/elink/esua/epdc/service/impl/DemoServiceImpl.java index b5620cd41..1546e86ce 100644 --- a/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/java/com/elink/esua/epdc/service/impl/DemoServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/java/com/elink/esua/epdc/service/impl/DemoServiceImpl.java @@ -16,7 +16,9 @@ import com.elink.esua.epdc.dao.DemoDao; import com.elink.esua.epdc.dto.DemoDto; import com.elink.esua.epdc.entity.DemoEntity; import com.elink.esua.epdc.service.DemoService; +import io.seata.spring.annotation.GlobalTransactional; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.List; @@ -36,6 +38,6 @@ public class DemoServiceImpl extends BaseServiceImpl implem public Result> demoService() { QueryWrapper demoEntityWrapper = new QueryWrapper<>(); List entityList = baseDao.selectList(demoEntityWrapper); - return new Result().ok(ConvertUtils.sourceToTarget(entityList,DemoDto.class)); + return new Result().ok(ConvertUtils.sourceToTarget(entityList, DemoDto.class)); } } diff --git a/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/test/java/com/elink/esua/epdc/OrikaTest.java b/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/test/java/com/elink/esua/epdc/OrikaTest.java index 59ef3f8a6..a3a158cef 100644 --- a/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/test/java/com/elink/esua/epdc/OrikaTest.java +++ b/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/test/java/com/elink/esua/epdc/OrikaTest.java @@ -29,7 +29,7 @@ public class OrikaTest { @Test public void Test() { DemoEntity demoEntity = new DemoEntity(); - demoEntity.setId(1000L); +// demoEntity.setId(1000L); demoEntity.setName("name"); demoEntity.setAge(19); diff --git a/esua-epdc/epdc-module/epdc-events/db/esua_epdc_events.pdman.json b/esua-epdc/epdc-module/epdc-events/db/esua_epdc_events.pdman.json index 65fe84ba5..b38ef5612 100644 --- a/esua-epdc/epdc-module/epdc-events/db/esua_epdc_events.pdman.json +++ b/esua-epdc/epdc-module/epdc-events/db/esua_epdc_events.pdman.json @@ -2679,8 +2679,361 @@ "defaultValue": "" } ] + }, + { + "title": "EPDC_HANDLE_CATEGORY", + "fields": [ + { + "name": "ID", + "type": "IdOrKey", + "remark": "", + "chnname": "主键", + "pk": true, + "notNull": true + }, + { + "name": "CATEGORY_CODE", + "type": "IdOrKey", + "remark": "", + "chnname": "处理类型编码", + "notNull": true + }, + { + "name": "CATEGORY_VAL", + "type": "Integer", + "remark": "", + "chnname": "处理类别值", + "notNull": true + }, + { + "name": "CATEGORY_LABEL", + "type": "VARCHAR_20", + "remark": "", + "chnname": "处理类别显示信息", + "notNull": true + }, + { + "name": "AVAILABLE", + "type": "YesNo", + "remark": "", + "chnname": "可用状态(0-不可用,1-可用)", + "notNull": true, + "defaultValue": "1" + }, + { + "name": "SORT", + "type": "Integer", + "remark": "", + "chnname": "排序", + "notNull": true, + "defaultValue": "0" + }, + { + "name": "REVISION", + "type": "Integer", + "remark": "", + "chnname": "乐观锁" + }, + { + "name": "CREATED_BY", + "type": "IdOrKey", + "remark": "", + "chnname": "创建人" + }, + { + "name": "CREATED_TIME", + "type": "DateTime", + "remark": "", + "chnname": "创建时间" + }, + { + "name": "UPDATED_BY", + "type": "IdOrKey", + "remark": "", + "chnname": "更新人" + }, + { + "name": "UPDATED_TIME", + "type": "DateTime", + "remark": "", + "chnname": "更新时间" + } + ], + "indexs": [], + "headers": [ + { + "fieldName": "chnname", + "relationNoShow": false + }, + { + "fieldName": "name", + "relationNoShow": false + }, + { + "fieldName": "type", + "relationNoShow": false + }, + { + "fieldName": "dataType", + "relationNoShow": true + }, + { + "fieldName": "remark", + "relationNoShow": true + }, + { + "fieldName": "pk", + "relationNoShow": false + }, + { + "fieldName": "notNull", + "relationNoShow": true + }, + { + "fieldName": "autoIncrement", + "relationNoShow": true + }, + { + "fieldName": "defaultValue", + "relationNoShow": true + }, + { + "fieldName": "relationNoShow", + "relationNoShow": true + }, + { + "fieldName": "uiHint", + "relationNoShow": true + } + ], + "chnname": "处理类别表", + "remark": "处理类别表" + }, + { + "title": "EPDC_HANDLE_ROLE_CATEGORY", + "fields": [ + { + "name": "ID", + "type": "IdOrKey", + "remark": "", + "chnname": "主键", + "pk": true, + "notNull": true + }, + { + "name": "ROLE_ID", + "type": "IdOrKey", + "remark": "", + "chnname": "角色ID", + "notNull": true + }, + { + "name": "CATEGORY_ID", + "type": "IdOrKey", + "remark": "", + "chnname": "处理类别ID", + "notNull": true + }, + { + "name": "REVISION", + "type": "Integer", + "remark": "", + "chnname": "乐观锁" + }, + { + "name": "CREATED_BY", + "type": "IdOrKey", + "remark": "", + "chnname": "创建人" + }, + { + "name": "CREATED_TIME", + "type": "DateTime", + "remark": "", + "chnname": "创建时间" + }, + { + "name": "UPDATED_BY", + "type": "IdOrKey", + "remark": "", + "chnname": "更新人" + }, + { + "name": "UPDATED_TIME", + "type": "DateTime", + "remark": "", + "chnname": "更新时间" + } + ], + "indexs": [], + "headers": [ + { + "fieldName": "chnname", + "relationNoShow": false + }, + { + "fieldName": "name", + "relationNoShow": false + }, + { + "fieldName": "type", + "relationNoShow": false + }, + { + "fieldName": "dataType", + "relationNoShow": true + }, + { + "fieldName": "remark", + "relationNoShow": true + }, + { + "fieldName": "pk", + "relationNoShow": false + }, + { + "fieldName": "notNull", + "relationNoShow": true + }, + { + "fieldName": "autoIncrement", + "relationNoShow": true + }, + { + "fieldName": "defaultValue", + "relationNoShow": true + }, + { + "fieldName": "relationNoShow", + "relationNoShow": true + }, + { + "fieldName": "uiHint", + "relationNoShow": true + } + ], + "chnname": "角色和处理类别关系表", + "remark": "角色和处理类别关系表" + }, + { + "title": "EPDC_HANDLE_ROLE_DEPT", + "fields": [ + { + "name": "ID", + "type": "IdOrKey", + "remark": "", + "chnname": "主键", + "pk": true, + "notNull": true + }, + { + "name": "ROLE_ID", + "type": "IdOrKey", + "remark": "", + "chnname": "角色ID", + "notNull": true + }, + { + "name": "DEPT_ID", + "type": "IdOrKey", + "remark": "", + "chnname": "部门ID", + "notNull": true + }, + { + "name": "DEPT_TYPE", + "type": "VARCHAR_50", + "remark": "", + "chnname": "部门机构类型", + "notNull": true + }, + { + "name": "REVISION", + "type": "Integer", + "remark": "", + "chnname": "乐观锁" + }, + { + "name": "CREATED_BY", + "type": "IdOrKey", + "remark": "", + "chnname": "创建人" + }, + { + "name": "CREATED_TIME", + "type": "DateTime", + "remark": "", + "chnname": "创建时间" + }, + { + "name": "UPDATED_BY", + "type": "IdOrKey", + "remark": "", + "chnname": "更新人" + }, + { + "name": "UPDATED_TIME", + "type": "DateTime", + "remark": "", + "chnname": "更新时间" + } + ], + "indexs": [], + "headers": [ + { + "fieldName": "chnname", + "relationNoShow": false + }, + { + "fieldName": "name", + "relationNoShow": false + }, + { + "fieldName": "type", + "relationNoShow": false + }, + { + "fieldName": "dataType", + "relationNoShow": true + }, + { + "fieldName": "remark", + "relationNoShow": true + }, + { + "fieldName": "pk", + "relationNoShow": false + }, + { + "fieldName": "notNull", + "relationNoShow": true + }, + { + "fieldName": "autoIncrement", + "relationNoShow": true + }, + { + "fieldName": "defaultValue", + "relationNoShow": true + }, + { + "fieldName": "relationNoShow", + "relationNoShow": true + }, + { + "fieldName": "uiHint", + "relationNoShow": true + } + ], + "chnname": "处理部门角色权限表", + "remark": "处理部门角色权限表" } - ] + ], + "graphCanvas": { + "nodes": [], + "edges": [] + }, + "associations": [] } ], "dataTypeDomains": { diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/constant/ItemEvaluationLevel.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/constant/ItemEvaluationLevel.java new file mode 100644 index 000000000..6c964433d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/constant/ItemEvaluationLevel.java @@ -0,0 +1,17 @@ +package com.elink.esua.epdc.constant; + + +/** + * @author: qushutong + * @Date: 2019/12/20 15:53 + * @Description: 评价结果:0-不满意,1-基本满意,2-非常满意 + */ +public interface ItemEvaluationLevel { + + String levaluationLevelBad = "0"; + + String levaluationLevelBetter = "1"; + + String levaluationLevelBest = "2"; + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/comment/form/SubmitCommentFormDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/comment/form/SubmitCommentFormDTO.java new file mode 100644 index 000000000..1f6373f36 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/comment/form/SubmitCommentFormDTO.java @@ -0,0 +1,50 @@ +package com.elink.esua.epdc.dto.comment.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import java.io.Serializable; + +/** + * @Description 议题提交评论DTO + * @Author yinzuomei + * @Date 2019/12/18 16:56 + */ +@Data +public class SubmitCommentFormDTO implements Serializable { + private static final long serialVersionUID = -3253699905608729529L; + + private String issueId; + + private String itemId; + + /** + * 父评论(被评论)ID + */ + private String faCommentId; + + @Size(min = 1, max = 500, message = "评论内容不能超过500字") + private String content; + + /** + * 评论人ID + */ + @NotBlank(message = "评论人ID不能为空") + private String userId; + + /** + * 评论人昵称 + */ + private String userName; + + /** + * 评论人头像 + */ + private String userFace; + + /** + * 党员标识(0-否,1-是) + */ + private String partyFlag; +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/form/EventCountSqlFromDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/form/EventCountSqlFromDTO.java new file mode 100644 index 000000000..8fc8c086b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/form/EventCountSqlFromDTO.java @@ -0,0 +1,32 @@ +package com.elink.esua.epdc.dto.events.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * @author: qushutong + * @Date: 2019/12/16 14:52 + * @Description: 查询参数 + */ +@Data +public class EventCountSqlFromDTO implements Serializable { + private static final long serialVersionUID = 4648104037156856679L; + /*** + * 网格id + */ + private Long gridId; + + /*** + * 月 季 年 0,1,2 + */ + private String type; + + /*** + * 0 是群众反应问题总数 1 群众反应问题响应数 + */ + private String responseType; + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/handlecategory/HandleCategoryDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/handlecategory/HandleCategoryDTO.java new file mode 100644 index 000000000..ba44b3bfc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/handlecategory/HandleCategoryDTO.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto.handlecategory; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + + +/** + * 处理类别表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-20 + */ +@Data +public class HandleCategoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 处理类别值 + */ + private Integer categoryVal; + + /** + * 处理类别显示信息 + */ + @NotBlank(message = "处理类别显示信息不能为空") + private String categoryLabel; + + /** + * 可用状态(0-不可用,1-可用) + */ + private String available; + + /** + * 排序 + */ + private Integer sort; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 处理类型编码 + */ + @NotBlank(message = "处理类型编码不能为空") + private String categoryCode; +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/handlecategory/HandleCategoryTreeDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/handlecategory/HandleCategoryTreeDTO.java new file mode 100644 index 000000000..956d9298a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/handlecategory/HandleCategoryTreeDTO.java @@ -0,0 +1,30 @@ +package com.elink.esua.epdc.dto.handlecategory; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Description 角色授权tree返参dto + * @Author yinzuomei + * @Date 2019/12/24 10:19 + */ +@Data +public class HandleCategoryTreeDTO implements Serializable { + + private static final long serialVersionUID = -445779738699117585L; + + /** + * 主键 + */ + private String id; + + /** + * 处理类别显示信息 + */ + private String name; + + private List children= new ArrayList<>(); +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/handleroledept/HandleRoleDeptDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/handleroledept/HandleRoleDeptDTO.java new file mode 100644 index 000000000..72dc4a4a8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/handleroledept/HandleRoleDeptDTO.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto.handleroledept; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 处理部门角色权限表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-26 + */ +@Data +public class HandleRoleDeptDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 角色ID + */ + private String roleId; + + /** + * 部门ID + */ + private String deptId; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 部门机构类型 + */ + private String deptType; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/handleroledept/form/HandleRoleDeptFormDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/handleroledept/form/HandleRoleDeptFormDTO.java new file mode 100644 index 000000000..65c3a5bb7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/handleroledept/form/HandleRoleDeptFormDTO.java @@ -0,0 +1,24 @@ +package com.elink.esua.epdc.dto.handleroledept.form; + +import com.elink.esua.epdc.dto.handleroledept.HandleRoleDeptDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 保存角色对应的吹哨机构类型 入参DTO + * @Author yinzuomei + * @Date 2019/12/26 13:40 + */ +@Data +public class HandleRoleDeptFormDTO implements Serializable { + private static final long serialVersionUID = -8514999095093073286L; + /** + * 角色ID + */ + private String roleId; + + private List handleRoleDeptDTOList; + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/handleroledept/result/HandleRoleDeptPermissionDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/handleroledept/result/HandleRoleDeptPermissionDTO.java new file mode 100644 index 000000000..7e1e77896 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/handleroledept/result/HandleRoleDeptPermissionDTO.java @@ -0,0 +1,29 @@ +package com.elink.esua.epdc.dto.handleroledept.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 角色对应吹哨部门 + * @Author yinzuomei + * @Date 2019/12/26 14:59 + */ +@Data +public class HandleRoleDeptPermissionDTO implements Serializable { + private static final long serialVersionUID = 8183862671970858166L; + /** + * 部门ID + */ + private String deptId; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 部门机构类型 + */ + private String deptType; +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/rulecategory/HandleRoleCategoryDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/rulecategory/HandleRoleCategoryDTO.java new file mode 100644 index 000000000..540ae4552 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/rulecategory/HandleRoleCategoryDTO.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto.rulecategory; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 角色和处理类别关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-20 + */ +@Data +public class HandleRoleCategoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 角色ID + */ + private String roleId; + + /** + * 处理类别ID + */ + private String categoryId; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标识 0:未删除,1:已删除 + */ + private String delFlag; + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/rulecategory/form/HandleRoleCategoryFormDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/rulecategory/form/HandleRoleCategoryFormDTO.java new file mode 100644 index 000000000..1372b059e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/rulecategory/form/HandleRoleCategoryFormDTO.java @@ -0,0 +1,29 @@ +package com.elink.esua.epdc.dto.rulecategory.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description 保存或修改 角色和处理类别关系 入参DTO + * @Author yinzuomei + * @Date 2019/12/24 12:12 + */ +@Data +public class HandleRoleCategoryFormDTO implements Serializable { + + private static final long serialVersionUID = -3295948468274114972L; + + /** + * 角色ID + */ + @NotBlank(message = "角色id不能为空") + private Long roleId; + + /** + * 处理类别ID + */ + private List categoryIdList; +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/rulecategory/result/HandleRoleCategoryPermissionDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/rulecategory/result/HandleRoleCategoryPermissionDTO.java new file mode 100644 index 000000000..c38cbe969 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/rulecategory/result/HandleRoleCategoryPermissionDTO.java @@ -0,0 +1,29 @@ +package com.elink.esua.epdc.dto.rulecategory.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 角色对应项目处理类别 + * @Author yinzuomei + * @Date 2019/12/26 15:08 + */ +@Data +public class HandleRoleCategoryPermissionDTO implements Serializable { + private static final long serialVersionUID = 1164343443504365039L; + /** + * 主键 + */ + private String id; + + /** + * 处理类别值 + */ + private Integer categoryVal; + + /** + * 处理类别显示信息 + */ + private String categoryLabel; +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/ItemHandleCategoryEnum.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/ItemHandleCategoryEnum.java index b25b09144..ec04877b7 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/ItemHandleCategoryEnum.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/ItemHandleCategoryEnum.java @@ -7,6 +7,7 @@ import java.util.List; /** * 项目处理类型枚举 + * * @Author LC * @Date 2019/9/16 14:00 */ @@ -28,7 +29,7 @@ public enum ItemHandleCategoryEnum { public static List getHandleCategoriesForGird(boolean selected) { List handleResultDTOS = new ArrayList<>(); - for (ItemHandleCategoryEnum e: + for (ItemHandleCategoryEnum e : ItemHandleCategoryEnum.values()) { if (e.getValue() != ItemHandleCategoryEnum.HANDLE_REPORT.getValue()) { ItemHandleResultDTO dto = new ItemHandleResultDTO(); diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/ReferenceTypeEnum.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/ReferenceTypeEnum.java deleted file mode 100644 index 6921bcdd3..000000000 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/ReferenceTypeEnum.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.elink.esua.epdc.enums; - -/** - * 议题或项目枚举 - * - * @author work@yujt.net.cn - * @date 2019/10/21 10:30 - */ -public enum ReferenceTypeEnum { - - /** - * 议题 - */ - ISSUE("issue"), - - /** - * 项目 - */ - ITEM("item"), - - /** - * 事件 - */ - EVENT("event"); - - private String name; - - ReferenceTypeEnum(String name) { - this.name = name; - } - - public String getName() { - return name; - } -} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml index 00fed7324..f05395fb4 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml @@ -13,6 +13,11 @@ jar + + com.esua.epdc + epdc-kpi-client + 1.0.0 + com.esua.epdc epdc-events-client @@ -62,6 +67,10 @@ 1.0.0 compile + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + com.esua.epdc @@ -136,7 +145,7 @@ true - + + <!–小程序配置–> wxdd8530c5f4926766 5bf4fb813145431b3493a10aa7e041e9 - + <!–工作端小程序–> wx29b074840ef4bfd9 4adb1afccc69f205cdf5b521d74e2aca + --> + + 9066 + 47.104.224.45:8848 + 513d6635-3cfe-401f-b8b6-a04417288f47 + EPDC_CONFIG_GROUP + true + dev test - + - - - - wx5d3e97461d248397 - bfed51b731e53db9affb9e6131e7ae12 - - wx9f20a46906ab2c3e - dc13065f79429979d9f687d249eb5c4e + <!–小程序配置–> + wxdd8530c5f4926766 + 5bf4fb813145431b3493a10aa7e041e9 + <!–工作端小程序–> + wx29b074840ef4bfd9 + 4adb1afccc69f205cdf5b521d74e2aca + --> + + 9066 + 47.104.224.45:8848 + 6a3577b4-7b79-43f6-aebb-9c3f31263f6a + EPDC_CONFIG_GROUP + true + test diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/category/controller/CategoryController.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/category/controller/CategoryController.java index 2678142a1..a3d0e2eae 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/category/controller/CategoryController.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/category/controller/CategoryController.java @@ -26,8 +26,8 @@ import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; import com.elink.esua.epdc.dto.category.CategoryDTO; import com.elink.esua.epdc.dto.category.CategoryOption; -import com.elink.esua.epdc.dto.category.form.CategoryInfoFormDTO; -import com.elink.esua.epdc.dto.category.result.CategoryInfoResultDTO; +import com.elink.esua.epdc.dto.form.CategoryInfoFormDTO; +import com.elink.esua.epdc.dto.result.CategoryInfoResultDTO; import com.elink.esua.epdc.modules.category.excel.CategoryExcel; import com.elink.esua.epdc.modules.category.service.CategoryService; import io.swagger.annotations.ApiOperation; @@ -134,7 +134,7 @@ public class CategoryController { /** * @param formDTO - * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @return com.elink.esua.epdc.commons.tools.utils.Result> * @Author yinzuomei * @Description 根据id查询事件分类基本信息 * @Date 2019/12/4 9:43 diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/category/entity/CategoryEntity.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/category/entity/CategoryEntity.java index 79f60d255..f936febab 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/category/entity/CategoryEntity.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/category/entity/CategoryEntity.java @@ -17,13 +17,13 @@ package com.elink.esua.epdc.modules.category.entity; -import com.baomidou.mybatisplus.annotation.*; - +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.io.Serializable; import java.util.Date; /** @@ -69,6 +69,11 @@ public class CategoryEntity extends BaseEntity { */ private Integer sort; + /** + * 第三方平台分类编码 + */ + private String infoCode; + /** * 删除标识 0:未删除 1:删除 */ @@ -99,11 +104,6 @@ public class CategoryEntity extends BaseEntity { @TableField(exist = false) private String label; - /** - * 第三方平台分类编码 - */ - private String infoCode; - /** * 启用标识(0-否,1-是) */ diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/category/service/CategoryService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/category/service/CategoryService.java index 967e6f85e..9165fdb1c 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/category/service/CategoryService.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/category/service/CategoryService.java @@ -21,8 +21,8 @@ import com.elink.esua.epdc.commons.mybatis.service.BaseService; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.category.CategoryDTO; import com.elink.esua.epdc.dto.category.CategoryOption; -import com.elink.esua.epdc.dto.category.form.CategoryInfoFormDTO; -import com.elink.esua.epdc.dto.category.result.CategoryInfoResultDTO; +import com.elink.esua.epdc.dto.form.CategoryInfoFormDTO; +import com.elink.esua.epdc.dto.result.CategoryInfoResultDTO; import com.elink.esua.epdc.modules.category.entity.CategoryEntity; import org.springframework.web.multipart.MultipartFile; @@ -125,7 +125,7 @@ public interface CategoryService extends BaseService { /** * @param formDTO - * @return java.util.List + * @return java.util.List * @Author yinzuomei * @Description 根据id查询事件分类基本信息 * @Date 2019/12/4 9:43 diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/category/service/impl/CategoryServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/category/service/impl/CategoryServiceImpl.java index 8d1c455a7..e975a92f7 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/category/service/impl/CategoryServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/category/service/impl/CategoryServiceImpl.java @@ -17,12 +17,14 @@ package com.elink.esua.epdc.modules.category.service.impl; +import cn.hutool.core.collection.CollUtil; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.constant.StrConstant; import com.elink.esua.epdc.commons.tools.exception.ErrorCode; import com.elink.esua.epdc.commons.tools.exception.RenException; import com.elink.esua.epdc.commons.tools.redis.RedisKeys; @@ -34,8 +36,8 @@ import com.elink.esua.epdc.commons.tools.utils.TreeUtils; import com.elink.esua.epdc.dto.category.CategoryDTO; import com.elink.esua.epdc.dto.category.CategoryOption; import com.elink.esua.epdc.dto.category.CategoryTreeDTO; -import com.elink.esua.epdc.dto.category.form.CategoryInfoFormDTO; -import com.elink.esua.epdc.dto.category.result.CategoryInfoResultDTO; +import com.elink.esua.epdc.dto.form.CategoryInfoFormDTO; +import com.elink.esua.epdc.dto.result.CategoryInfoResultDTO; import com.elink.esua.epdc.modules.category.dao.CategoryDao; import com.elink.esua.epdc.modules.category.entity.CategoryEntity; import com.elink.esua.epdc.modules.category.redis.CategoryRedis; @@ -577,127 +579,141 @@ public class CategoryServiceImpl extends BaseServiceImpl().ok((CategoryOption) obj); } - /** - * @param formDTO - * @return java.util.List - * @Author yinzuomei - * @Description 根据id查询事件分类基本信息 - * @Date 2019/12/4 9:43 - **/ - @Override - public List listCategoryInfo(CategoryInfoFormDTO formDTO) { - List categoryInfoResultDTOList = new ArrayList<>(); - for (Long id : formDTO.getIds()) { - CategoryEntity entity = baseDao.getById(id); - if (null != entity) { - List parentNameList = new ArrayList<>(); - if (StringUtils.isNotBlank(entity.getPids())) { - String[] pidList = entity.getPids().split(","); - for (String pid : pidList) { - CategoryEntity parentEntity = baseDao.getById(Long.valueOf(pid)); - parentNameList.add(parentEntity.getCategoryName()); - } - } - CategoryInfoResultDTO categoryInfoResultDTO = ConvertUtils.sourceToTarget(entity, CategoryInfoResultDTO.class); - categoryInfoResultDTO.setParentNames(parentNameList); - categoryInfoResultDTOList.add(categoryInfoResultDTO); - } - } - return categoryInfoResultDTOList; - } - - /** - * @param - * @return void - * @Author yinzuomei - * @Description 组装事件类别 - * @Date 2019/12/3 18:18 - **/ - @Override - public void packageCategoryOption() { - List dtoList = baseDao.selectListCategoryTreeDTO(); - JSONObject node; - JSONArray headNodes = new JSONArray(); - for (CategoryTreeDTO categoryTreeDto : dtoList) { - - if (categoryTreeDto.getPid().longValue() == NumConstant.ZERO_L) { - node = new JSONObject(); - node.put("value", categoryTreeDto.getId()); - node.put("label", categoryTreeDto.getCategoryName()); - headNodes.add(node); - } - } + /** + * @param formDTO + * @return java.util.List + * @Author yinzuomei + * @Description 根据id查询事件分类基本信息 + * @Date 2019/12/4 9:43 + **/ + @Override + public List listCategoryInfo(CategoryInfoFormDTO formDTO) { + List result = Lists.newArrayList(); + CategoryInfoResultDTO categoryInfoResult; + + for (Long id : formDTO.getIds()) { + CategoryEntity entity = baseDao.getById(id); + if (null == entity) { + continue; + } + if(StringUtils.isBlank(entity.getPids())){ + categoryInfoResult = ConvertUtils.sourceToTarget(entity, CategoryInfoResultDTO.class); + result.add(categoryInfoResult); + continue; + } + List parentNameList = Lists.newArrayList(); + String[] pidList = entity.getPids().split(StrConstant.COMMA); + if (null != pidList && pidList.length > NumConstant.ZERO) { + CategoryEntity parentEntity; + for (int i = 0; i < pidList.length; i++) { + parentEntity = baseDao.getById(Long.valueOf(pidList[i])); + if (null != parentEntity) { + parentNameList.add(parentEntity.getCategoryName()); + } + } + } + categoryInfoResult = ConvertUtils.sourceToTarget(entity, CategoryInfoResultDTO.class); + if (CollUtil.isNotEmpty(parentNameList)) { + categoryInfoResult.setParentNames(StringUtils.join(parentNameList, StrConstant.HYPHEN)); + } + result.add(categoryInfoResult); + } + return result; + } + + /** + * @param + * @return void + * @Author yinzuomei + * @Description 组装事件类别 + * @Date 2019/12/3 18:18 + **/ + @Override + public void packageCategoryOption() { + List dtoList = baseDao.selectListCategoryTreeDTO(); + JSONObject node; + JSONArray headNodes = new JSONArray(); + for (CategoryTreeDTO categoryTreeDto : dtoList) { + + if (categoryTreeDto.getPid().longValue() == NumConstant.ZERO_L) { + node = new JSONObject(); + node.put("value", categoryTreeDto.getId()); + node.put("label", categoryTreeDto.getCategoryName()); + headNodes.add(node); + } + } + + // 用于存放所有父级节点 + JSONArray parent; + // 用于存放所有子级节点 + JSONArray allChildren = new JSONArray(); + JSONArray children; + // 用于存放单个子级节点 + JSONObject childNode; + + parent = headNodes; + // 存放其余未处理的类别(节点) + List others = this.getOtherCategory(dtoList, parent); + + while (!others.isEmpty()) { + for (int i = 0; i < parent.size(); i++) { + node = parent.getJSONObject(i); + children = new JSONArray(); + for (CategoryTreeDTO categoryTreeDto : others) { + if (categoryTreeDto.getPid().equals(node.get("value"))) { + childNode = new JSONObject(); + childNode.put("value", categoryTreeDto.getId()); + childNode.put("label", categoryTreeDto.getCategoryName()); + + children.add(childNode); + allChildren.add(childNode); + } + } + if (!children.isEmpty()) { + node.put("children", children); + } + } + parent = allChildren; + + others = this.getOtherCategory(others, parent); + + } - // 用于存放所有父级节点 - JSONArray parent; - // 用于存放所有子级节点 - JSONArray allChildren = new JSONArray(); - JSONArray children; - // 用于存放单个子级节点 - JSONObject childNode; - - parent = headNodes; - // 存放其余未处理的类别(节点) - List others = this.getOtherCategory(dtoList, parent); - - while (!others.isEmpty()) { - for (int i = 0; i < parent.size(); i++) { - node = parent.getJSONObject(i); - children = new JSONArray(); - for (CategoryTreeDTO categoryTreeDto : others) { - if (categoryTreeDto.getPid().equals(node.get("value"))) { - childNode = new JSONObject(); - childNode.put("value", categoryTreeDto.getId()); - childNode.put("label", categoryTreeDto.getCategoryName()); - - children.add(childNode); - allChildren.add(childNode); - } - } - if (!children.isEmpty()) { - node.put("children", children); - } - } - parent = allChildren; - - others = this.getOtherCategory(others, parent); - - } // JSONObject treeNodes = new JSONObject(); // treeNodes.put("options", headNodes); // logger.info(treeNodes.toJSONString()); - //存放到redis中 - List cache = Lists.newArrayList(); - cache.add(headNodes); - CategoryOption option = new CategoryOption(); - option.setOptions(cache.get(0)); - redisUtils.set(RedisKeys.getEventsCategoryKey(), option); - } - - /* - * @param dtoList 上次进行筛选的分类集合 - * @param parent 已处理过的上级节点 - * @return java.util.List - * @Author yinzuomei - * @Description 组装其余未处理过的分类集合 - * @Date 2019/12/3 17:27 - **/ - private List getOtherCategory(List dtoList, JSONArray parent) { - List already = Lists.newArrayList(); - for (int i = 0; i < parent.size(); i++) { - already.add((Long) parent.getJSONObject(i).get("value")); - } - - List others = Lists.newArrayList(); - - for (CategoryTreeDTO categoryTreeDto : dtoList) { - Long categoryTreeDtoId = categoryTreeDto.getId(); - if (!already.contains(categoryTreeDtoId)) { - others.add(categoryTreeDto); - } - } - return others; - } + //存放到redis中 + List cache = Lists.newArrayList(); + cache.add(headNodes); + CategoryOption option = new CategoryOption(); + option.setOptions(cache.get(0)); + redisUtils.set(RedisKeys.getEventsCategoryKey(), option); + } + + /* + * @param dtoList 上次进行筛选的分类集合 + * @param parent 已处理过的上级节点 + * @return java.util.List + * @Author yinzuomei + * @Description 组装其余未处理过的分类集合 + * @Date 2019/12/3 17:27 + **/ + private List getOtherCategory(List dtoList, JSONArray parent) { + List already = Lists.newArrayList(); + for (int i = 0; i < parent.size(); i++) { + already.add((Long) parent.getJSONObject(i).get("value")); + } + + List others = Lists.newArrayList(); + + for (CategoryTreeDTO categoryTreeDto : dtoList) { + Long categoryTreeDtoId = categoryTreeDto.getId(); + if (!already.contains(categoryTreeDtoId)) { + others.add(categoryTreeDto); + } + } + return others; + } } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/controller/AppEventCommentController.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/controller/AppEventCommentController.java index a0dd8ef59..b488bc82c 100755 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/controller/AppEventCommentController.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/controller/AppEventCommentController.java @@ -21,8 +21,8 @@ import com.elink.esua.epdc.commons.tools.constant.Constant; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; import com.elink.esua.epdc.dto.comment.CommentStatementFormDTO; -import com.elink.esua.epdc.dto.comment.form.CommentFormDTO; import com.elink.esua.epdc.dto.comment.form.EventCommentsFormDTO; +import com.elink.esua.epdc.dto.comment.form.SubmitCommentFormDTO; import com.elink.esua.epdc.dto.comment.form.WorkCommentReplyFormDTO; import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO; import com.elink.esua.epdc.dto.comment.result.WorkEventsCommentsDTO; @@ -48,13 +48,13 @@ public class AppEventCommentController { /**AppTopicCommentController * 提交评论或回复接口 - * @param commentFormDTO + * @param submitCommentFormDTO * @return */ @PostMapping("submit") - public Result submit(@RequestBody CommentFormDTO commentFormDTO){ - ValidatorUtils.validateEntity(commentFormDTO); - return eventCommentService.submit(commentFormDTO); + public Result submit(@RequestBody SubmitCommentFormDTO submitCommentFormDTO){ + ValidatorUtils.validateEntity(submitCommentFormDTO); + return eventCommentService.submit(submitCommentFormDTO); } /** diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/EventCommentService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/EventCommentService.java index 61afb820c..cc3ddf046 100755 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/EventCommentService.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/EventCommentService.java @@ -24,6 +24,7 @@ import com.elink.esua.epdc.dto.comment.EpdcCommentsAndAttitudeFromTopicFormDTO; import com.elink.esua.epdc.dto.comment.EventCommentDTO; import com.elink.esua.epdc.dto.comment.form.CommentFormDTO; import com.elink.esua.epdc.dto.comment.form.EventCommentsFormDTO; +import com.elink.esua.epdc.dto.comment.form.SubmitCommentFormDTO; import com.elink.esua.epdc.dto.comment.form.WorkCommentReplyFormDTO; import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO; import com.elink.esua.epdc.dto.comment.result.WorkEventsCommentsDTO; @@ -105,9 +106,9 @@ public interface EventCommentService extends BaseService { /** * 提交评论或回复接口 - * @param commentFormDTO + * @param submitCommentFormDTO */ - Result submit(CommentFormDTO commentFormDTO); + Result submit(SubmitCommentFormDTO submitCommentFormDTO); /** diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/impl/EventCommentServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/impl/EventCommentServiceImpl.java index 4cb8f8e31..809088684 100755 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/impl/EventCommentServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/impl/EventCommentServiceImpl.java @@ -26,10 +26,9 @@ 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.utils.Result; import com.elink.esua.epdc.constant.EventsNoticeConstant; -import com.elink.esua.epdc.dto.UserDTO; import com.elink.esua.epdc.dto.comment.*; -import com.elink.esua.epdc.dto.comment.form.CommentFormDTO; import com.elink.esua.epdc.dto.comment.form.EventCommentsFormDTO; +import com.elink.esua.epdc.dto.comment.form.SubmitCommentFormDTO; import com.elink.esua.epdc.dto.comment.form.WorkCommentReplyFormDTO; import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO; import com.elink.esua.epdc.dto.comment.result.WorkEventsCommentsDTO; @@ -44,7 +43,6 @@ import com.elink.esua.epdc.modules.comment.entity.EventCommentEntity; import com.elink.esua.epdc.modules.comment.service.EventCommentService; import com.elink.esua.epdc.modules.comment.service.EventCommentUserAttitudeService; import com.elink.esua.epdc.modules.events.service.EpdcEventsService; -import com.elink.esua.epdc.modules.feign.UserFeignClient; import com.elink.esua.epdc.modules.issue.entity.IssueEntity; import com.elink.esua.epdc.modules.issue.service.IssueService; import com.elink.esua.epdc.modules.item.entity.ItemEntity; @@ -87,9 +85,6 @@ public class EventCommentServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -144,7 +139,7 @@ public class EventCommentServiceImpl extends BaseServiceImpl userDTOResult=userFeignClient.getUserInfoById(commentFormDTO.getUserId()); - if(!userDTOResult.success()){ - return new Result().error("获取用户信息失败"); - } - commentEntity.setPartyFlag(userDTOResult.getData().getPartyFlag()); + commentEntity.setPartyFlag(commentFormDTO.getPartyFlag()); boolean isIssue = true; boolean isComment = true; diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/controller/EpdcEventsController.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/controller/EpdcEventsController.java index 602383c9a..2a0d7c505 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/controller/EpdcEventsController.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/controller/EpdcEventsController.java @@ -31,6 +31,8 @@ import com.elink.esua.epdc.dto.events.EpdcRejectEventsDTO; import com.elink.esua.epdc.dto.events.EpdcEventsDTO; import com.elink.esua.epdc.dto.events.EpdcEventsDetailDTO; import com.elink.esua.epdc.dto.events.form.EpdcEventsReviewFormDTO; +import com.elink.esua.epdc.dto.form.KpiMetaDataOfEventsFormDTO; +import com.elink.esua.epdc.dto.result.KpiEventReportAmountResultDTO; import com.elink.esua.epdc.modules.events.excel.EpdcEventsExcel; import com.elink.esua.epdc.modules.events.service.EpdcEventsService; import org.springframework.beans.factory.annotation.Autowired; @@ -56,20 +58,20 @@ public class EpdcEventsController { @GetMapping("page") @DataFilter(tableAlias = "temp", deptId = "grid_id", prefix = "AND", isPendingCreator = false) - public Result> page(@RequestParam Map params){ + public Result> page(@RequestParam Map params) { PageData page = epdcEventsService.listOfPendingReviewEvents(params); return new Result>().ok(page); } @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ + public Result get(@PathVariable("id") String id) { EpdcEventsDetailDTO data = epdcEventsService.getEvent(id); return new Result().ok(data); } @PostMapping - public Result save(@RequestBody EpdcEventsDTO dto){ + public Result save(@RequestBody EpdcEventsDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); @@ -79,7 +81,7 @@ public class EpdcEventsController { } @PutMapping - public Result update(@RequestBody EpdcEventsDTO dto){ + public Result update(@RequestBody EpdcEventsDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); @@ -89,7 +91,7 @@ public class EpdcEventsController { } @DeleteMapping - public Result delete(@RequestBody String[] ids){ + public Result delete(@RequestBody String[] ids) { //效验数据 AssertUtils.isArrayEmpty(ids, "id"); @@ -107,6 +109,7 @@ public class EpdcEventsController { /** * 事件审核 + * * @Params: [dto] * @Return: com.elink.esua.epdc.commons.tools.utils.Result * @Author: liuchuang @@ -120,20 +123,22 @@ public class EpdcEventsController { /** * 已驳回事件列表 + * * @Params: [params] - * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> * @Author: liuchuang * @Date: 2019/9/6 15:11 */ @GetMapping("rejectEvents") @DataFilter(tableAlias = "temp", deptId = "grid_id", prefix = "AND", isPendingCreator = false) - public Result> rejectEvents(@RequestParam Map params){ + public Result> rejectEvents(@RequestParam Map params) { PageData page = epdcEventsService.listOfRejectEvents(params); return new Result>().ok(page); } /** * 已驳回事件详情 + * * @Params: [id] * @Return: com.elink.esua.epdc.commons.tools.utils.Result * @Author: liuchuang @@ -146,11 +151,10 @@ public class EpdcEventsController { } /** - * * 初始化党群议事菜单消息 * - * @params [] * @return com.elink.esua.epdc.commons.tools.utils.Result + * @params [] * @author liuchuang * @since 2019/10/30 13:43 */ @@ -160,4 +164,17 @@ public class EpdcEventsController { return new Result(); } + /*** + * 统计网格指定时间段内事件上报数与事件受理数 + * @param eventReportAmountFormDto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author qushutong + * @date 2019/12/16 14:10 + */ + @PostMapping("statEventReportAmount") + public Result> statEventReportAmount(@RequestBody KpiMetaDataOfEventsFormDTO eventReportAmountFormDto) { + List dtoList = epdcEventsService.statEventReportAmount(eventReportAmountFormDto); + return new Result().ok(dtoList); + } + } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/dao/EpdcEventsDao.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/dao/EpdcEventsDao.java index 04f0c83e9..3576f8cca 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/dao/EpdcEventsDao.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/dao/EpdcEventsDao.java @@ -18,16 +18,16 @@ package com.elink.esua.epdc.modules.events.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; -import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.events.*; import com.elink.esua.epdc.dto.events.result.EventAppDetailResultDTO; +import com.elink.esua.epdc.dto.form.KpiMetaDataOfEventsFormDTO; import com.elink.esua.epdc.dto.issue.form.IssuePendingResponseFormDTO; import com.elink.esua.epdc.dto.issue.result.IssuePendingResponseResultDTO; +import com.elink.esua.epdc.dto.result.KpiEventReportAmountResultDTO; import com.elink.esua.epdc.dto.issue.result.IssueStateStatisticsResultDTO; import com.elink.esua.epdc.modules.events.entity.EpdcEventsEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import org.springframework.web.bind.annotation.RequestBody; import java.util.List; import java.util.Map; @@ -42,38 +42,47 @@ import java.util.Map; public interface EpdcEventsDao extends BaseDao { /** * 根据ID获取事件详情 + * * @Params: [id] * @Return: com.elink.esua.epdc.dto.events.EpdcEventsDetailDTO * @Author: liuchuang * @Date: 2019/9/4 20:31 */ EpdcEventsDetailDTO selectOneOfEventDetailById(@Param("id") String id); + /** * 事件待审核列表 + * * @Params: [params] * @Return: java.util.List * @Author: liuchuang * @Date: 2019/9/5 19:42 */ List selectListOfPendingReviewEvents(Map params); + /** * 已驳回事件列表 + * * @Params: [] * @Return: java.util.List * @Author: liuchuang * @Date: 2019/9/6 15:04 */ List selectListOfRejectEvents(Map params); + /** * 已驳回事件详情 + * * @Params: [] * @Return: com.elink.esua.epdc.dto.events.EpdcRejectEventDetailDTO * @Author: liuchuang * @Date: 2019/9/6 14:46 */ EpdcRejectEventDetailDTO selectOneOfRejectEventDetail(@Param("id") String id); + /** * 评论列表 + * * @Params: [eventId] * @Return: java.util.List * @Author: liuchuang @@ -88,30 +97,35 @@ public interface EpdcEventsDao extends BaseDao { /** * 赞数+1 + * * @param eventId */ void updateApproveNumAdd(String eventId); /** * 踩数+1 + * * @param eventId */ void updateOpposeNumAdd(String eventId); /** * 赞数-1 + * * @param eventId */ void updateApproveNumSubtract(String eventId); /** * 踩数-1 + * * @param eventId */ void updateOpposeNumSubtract(String eventId); /** * 移动端-事件详情 + * * @Params: [eventId] * @Return: com.elink.esua.epdc.dto.events.result.EventAppDetailResultDTO * @Author: liuchuang @@ -120,18 +134,18 @@ public interface EpdcEventsDao extends BaseDao { EventAppDetailResultDTO selectOneOfEventDetail(String eventId); /** - * * 根据网格ID 状态获取事件数量 * - * @params [deptId, state] * @return int + * @params [deptId, state] * @author liuchuang * @since 2019/10/30 12:36 */ int selectCountOfDeptNotice(Long deptId, int state); /** - *根据网格id和状态获取议题状态统计 + * 根据网格id和状态获取议题状态统计 + * * @param deptIdList * @return */ @@ -139,11 +153,19 @@ public interface EpdcEventsDao extends BaseDao { /** * 查询待回应列表 + * * @param formDto * @return */ List listIssuePendingResponse(IssuePendingResponseFormDTO formDto); - - + /** + * 统计网格指定时间内事件上报数与事件受理数 + * + * @param eventReportAmountFormDto + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/12/19 19:01 + */ + List statEventReportAmount(KpiMetaDataOfEventsFormDTO eventReportAmountFormDto); } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/EpdcEventsService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/EpdcEventsService.java index c39f6874d..3e953f92d 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/EpdcEventsService.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/EpdcEventsService.java @@ -24,9 +24,11 @@ import com.elink.esua.epdc.dto.events.*; import com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO; import com.elink.esua.epdc.dto.events.form.EpdcEventsReviewFormDTO; import com.elink.esua.epdc.dto.events.result.EventAppDetailResultDTO; +import com.elink.esua.epdc.dto.form.KpiMetaDataOfEventsFormDTO; import com.elink.esua.epdc.dto.issue.IssueDTO; import com.elink.esua.epdc.dto.issue.form.IssuePendingResponseFormDTO; import com.elink.esua.epdc.dto.issue.result.IssuePendingResponseResultDTO; +import com.elink.esua.epdc.dto.result.KpiEventReportAmountResultDTO; import com.elink.esua.epdc.dto.issue.result.IssueStateStatisticsResultDTO; import com.elink.esua.epdc.modules.events.entity.EpdcEventsEntity; @@ -208,4 +210,15 @@ public interface EpdcEventsService extends BaseService { */ Result topicToIssue(EpdcEventSubmitFormDTO dto); + + + /*** + * 统计网格指定时间内事件上报数与事件受理数 + * @param eventReportAmountFormDto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author qushutong + * @date 2019/12/16 14:17 + */ + List statEventReportAmount(KpiMetaDataOfEventsFormDTO eventReportAmountFormDto); + } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java index b955a02ce..75ac03bef 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java @@ -42,9 +42,11 @@ import com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO; import com.elink.esua.epdc.dto.events.form.EpdcEventsReviewFormDTO; import com.elink.esua.epdc.dto.events.result.EventAppDetailResultDTO; import com.elink.esua.epdc.dto.form.SmsNoticeFormDTO; +import com.elink.esua.epdc.dto.form.KpiMetaDataOfEventsFormDTO; import com.elink.esua.epdc.dto.issue.IssueDTO; import com.elink.esua.epdc.dto.issue.form.IssuePendingResponseFormDTO; import com.elink.esua.epdc.dto.issue.result.IssuePendingResponseResultDTO; +import com.elink.esua.epdc.dto.result.KpiEventReportAmountResultDTO; import com.elink.esua.epdc.dto.issue.result.IssueStateStatisticsResultDTO; import com.elink.esua.epdc.modules.async.IssueOverseeResultsTask; import com.elink.esua.epdc.modules.async.NewsTask; @@ -182,16 +184,16 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl> listIssuePendingResponse(IssuePendingResponseFormDTO formDto) { List list; - if (formDto.getDeptId() > 0){ + if (formDto.getDeptId() > 0) { list = new ArrayList<>(); list.add(formDto.getDeptId()); - }else { + } else { list = SecurityUser.getUser().getDeptIdList(); } formDto.setDeptIdList(list); @@ -482,32 +482,32 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl().ok(issueDTO); } + /** - * * 初始化分类信息 * - * @params [categoryId] * @return com.elink.esua.epdc.dto.events.EventsCategoryDTO + * @params [categoryId] * @author liuchuang * @since 2019/11/29 13:51 */ private EventsCategoryDTO initCategoryInfo(String categoryId) { Long category = Long.parseLong(categoryId); EventsCategoryDTO resultDto = new EventsCategoryDTO(); - CategoryDTO cateDto =categoryService.get(category); + CategoryDTO cateDto = categoryService.get(category); resultDto.setCategoryCode(cateDto.getCategoryCode()); //获取所有父类分类标签 List cateList = categoryService.getPidListById(category); //所选分类标签为多级 - if(cateList != null && cateList.size() > 0) { + if (cateList != null && cateList.size() > 0) { // list第一个为一级分类标签 resultDto.setFirstCategoryCode(cateList.get(0).getCategoryCode()); //分类标签全称拼接:-分割 String name = ""; - for (int i = 0; i < cateList.size(); i++){ - if (i == cateList.size() -1){ + for (int i = 0; i < cateList.size(); i++) { + if (i == cateList.size() - 1) { name = name + cateList.get(i).getCategoryName(); - }else { + } else { name = name + cateList.get(i).getCategoryName() + "-"; } } @@ -523,23 +523,31 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl userMobiles){ + * @return: void + * @Author: zy + * @Date: 2020-01-08 + */ + private void issueSmsNotification(EpdcEventsReviewFormDTO dto, List userMobiles) { // 审核操作发送短信 SmsNoticeFormDTO sms = new SmsNoticeFormDTO(); sms.setMobiles(userMobiles); if (EventIssueItemState.EVENT_REVIEW_PASS == dto.getEventState()) { // 审核通过 sms.setSmsTemplateType(SysSmsTemplateConstant.SMS_TEMPLATE_RESIDENTS_ISSUE_PASSED); - }else { + } else { sms.setSmsTemplateType(SysSmsTemplateConstant.SMS_TEMPLATE_RESIDENTS_ISSUE_NOT_PASS); } issueOverseeResultsTask.sendSmsNotice(sms); } + + @Override + public List statEventReportAmount(KpiMetaDataOfEventsFormDTO eventReportAmountFormDto) { + + List list = baseDao.statEventReportAmount(eventReportAmountFormDto); + + return list; + } } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handlecategory/controller/HandleCategoryController.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handlecategory/controller/HandleCategoryController.java new file mode 100644 index 000000000..6aee55154 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handlecategory/controller/HandleCategoryController.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.handlecategory.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.handlecategory.HandleCategoryDTO; +import com.elink.esua.epdc.dto.handlecategory.HandleCategoryTreeDTO; +import com.elink.esua.epdc.modules.handlecategory.excel.HandleCategoryExcel; +import com.elink.esua.epdc.modules.handlecategory.service.HandleCategoryService; +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 qu@elink-cn.com + * @since v1.0.0 2019-12-20 + */ +@RestController +@RequestMapping("handlecategory") +public class HandleCategoryController { + + @Autowired + private HandleCategoryService handleCategoryService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = handleCategoryService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + HandleCategoryDTO data = handleCategoryService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody HandleCategoryDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return handleCategoryService.save(dto); + } + + @PutMapping + public Result update(@RequestBody HandleCategoryDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + return handleCategoryService.update(dto); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + handleCategoryService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = handleCategoryService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, HandleCategoryExcel.class); + } + + /** + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 角色管理-项目处理类型授权 + * @Date 2019/12/24 10:43 + **/ + @GetMapping("getCategoryList") + public Result> getCategoryList(){ + return handleCategoryService.selectListHandleCategoryDTO(); + } +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handlecategory/dao/HandleCategoryDao.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handlecategory/dao/HandleCategoryDao.java new file mode 100644 index 000000000..d567e2999 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handlecategory/dao/HandleCategoryDao.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.handlecategory.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.handlecategory.HandleCategoryTreeDTO; +import com.elink.esua.epdc.modules.handlecategory.entity.HandleCategoryEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 处理类别表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-20 + */ +@Mapper +public interface HandleCategoryDao extends BaseDao { + + /** + * @param + * @return java.util.List + * @Author yinzuomei + * @Description 角色管理-项目处理类型授权 查询语句 + * @Date 2019/12/24 10:45 + **/ + List selectListHandleCategoryDTO(); +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handlecategory/entity/HandleCategoryEntity.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handlecategory/entity/HandleCategoryEntity.java new file mode 100644 index 000000000..4e9184a98 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handlecategory/entity/HandleCategoryEntity.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.handlecategory.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 qu@elink-cn.com + * @since v1.0.0 2019-12-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_handle_category") +public class HandleCategoryEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 处理类别值 + */ + private Integer categoryVal; + + /** + * 处理类别显示信息 + */ + private String categoryLabel; + + /** + * 可用状态(0-不可用,1-可用) + */ + private String available; + + /** + * 排序 + */ + private Integer sort; + + /** + * 处理类型编码 + */ + private String categoryCode; +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handlecategory/excel/HandleCategoryExcel.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handlecategory/excel/HandleCategoryExcel.java new file mode 100644 index 000000000..5bb45a8d4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handlecategory/excel/HandleCategoryExcel.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.handlecategory.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 处理类别表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-20 + */ +@Data +public class HandleCategoryExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "处理类别值") + private Integer categoryVal; + + @Excel(name = "处理类别显示信息") + private String categoryLabel; + + @Excel(name = "可用状态(0-不可用,1-可用)") + private String available; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handlecategory/redis/HandleCategoryRedis.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handlecategory/redis/HandleCategoryRedis.java new file mode 100644 index 000000000..0aa34a6a8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handlecategory/redis/HandleCategoryRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.handlecategory.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 处理类别表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-20 + */ +@Component +public class HandleCategoryRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handlecategory/service/HandleCategoryService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handlecategory/service/HandleCategoryService.java new file mode 100644 index 000000000..1d6e4587b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handlecategory/service/HandleCategoryService.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.handlecategory.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.handlecategory.HandleCategoryDTO; +import com.elink.esua.epdc.dto.handlecategory.HandleCategoryTreeDTO; +import com.elink.esua.epdc.modules.handlecategory.entity.HandleCategoryEntity; + +import java.util.List; +import java.util.Map; + +/** + * 处理类别表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-20 + */ +public interface HandleCategoryService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return HandleCategoryDTO + * @author generator + * @date 2019-12-20 + */ + HandleCategoryDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-20 + */ + Result save(HandleCategoryDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-20 + */ + Result update(HandleCategoryDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-20 + */ + void delete(String[] ids); + + /** + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 角色管理-项目处理类型授权 + * @Date 2019/12/24 10:44 + **/ + Result> selectListHandleCategoryDTO(); +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handlecategory/service/impl/HandleCategoryServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handlecategory/service/impl/HandleCategoryServiceImpl.java new file mode 100644 index 000000000..4d8b8bb85 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handlecategory/service/impl/HandleCategoryServiceImpl.java @@ -0,0 +1,150 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.handlecategory.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.handlecategory.HandleCategoryDTO; +import com.elink.esua.epdc.dto.handlecategory.HandleCategoryTreeDTO; +import com.elink.esua.epdc.modules.handlecategory.dao.HandleCategoryDao; +import com.elink.esua.epdc.modules.handlecategory.entity.HandleCategoryEntity; +import com.elink.esua.epdc.modules.handlecategory.redis.HandleCategoryRedis; +import com.elink.esua.epdc.modules.handlecategory.service.HandleCategoryService; +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 qu qu@elink-cn.com + * @since v1.0.0 2019-12-20 + */ +@Service +public class HandleCategoryServiceImpl extends BaseServiceImpl implements HandleCategoryService { + + @Autowired + private HandleCategoryRedis handleCategoryRedis; + + @Override + public PageData page(Map params) { + String categoryLabel = (String)params.get("categoryLabel"); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.isNotBlank(categoryLabel), "CATEGORY_LABEL", categoryLabel.trim()); + wrapper.orderByDesc("sort"); + + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + wrapper + ); + return getPageData(page, HandleCategoryDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, HandleCategoryDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public HandleCategoryDTO get(String id) { + HandleCategoryEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, HandleCategoryDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result save(HandleCategoryDTO dto) { + if(!checkCategoryCode(dto)){ + return new Result().error("处理类型编码已存在"); + } + HandleCategoryEntity entity = ConvertUtils.sourceToTarget(dto, HandleCategoryEntity.class); + insert(entity); + return new Result(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result update(HandleCategoryDTO dto) { + if(!checkCategoryCode(dto)){ + return new Result().error("处理类型编码已存在"); + } + HandleCategoryEntity entity = ConvertUtils.sourceToTarget(dto, HandleCategoryEntity.class); + updateById(entity); + return new Result(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 角色管理-项目处理类型授权 + * @Date 2019/12/24 10:44 + **/ + @Override + public Result> selectListHandleCategoryDTO() { + List list = baseDao.selectListHandleCategoryDTO(); + return new Result>().ok(list); + } + + /** + * @param dto + * @return boolean + * @Author yinzuomei + * @Description 校验编码是否唯一 + * @Date 2019/12/20 14:57 + **/ + public boolean checkCategoryCode(HandleCategoryDTO dto) { + boolean flag = true; + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("CATEGORY_CODE", dto.getCategoryCode().trim()) + .ne(StringUtils.isNotBlank(dto.getId()), FieldConstant.ID, dto.getId()); + List list = baseDao.selectList(wrapper); + if (null != list && list.size() > 0) { + flag = false; + } + return flag; + } +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/controller/HandleRoleDeptController.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/controller/HandleRoleDeptController.java new file mode 100644 index 000000000..99ff7b2a2 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/controller/HandleRoleDeptController.java @@ -0,0 +1,119 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.handleroledept.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.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.dto.handleroledept.HandleRoleDeptDTO; +import com.elink.esua.epdc.dto.handleroledept.form.HandleRoleDeptFormDTO; +import com.elink.esua.epdc.modules.handleroledept.excel.HandleRoleDeptExcel; +import com.elink.esua.epdc.modules.handleroledept.service.HandleRoleDeptService; +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 qu@elink-cn.com + * @since v1.0.0 2019-12-26 + */ +@RestController +@RequestMapping("handleroledept") +public class HandleRoleDeptController { + + @Autowired + private HandleRoleDeptService handleRoleDeptService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = handleRoleDeptService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + HandleRoleDeptDTO data = handleRoleDeptService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody HandleRoleDeptDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + handleRoleDeptService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody HandleRoleDeptDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + handleRoleDeptService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + handleRoleDeptService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = handleRoleDeptService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, HandleRoleDeptExcel.class); + } + + /** + * @param formDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 保存角色对应的吹哨机构类型 + * @Date 2019/12/26 13:42 + **/ + @PostMapping("saveOrUpdate") + public Result saveOrUpdate(@RequestBody HandleRoleDeptFormDTO formDTO) { + return handleRoleDeptService.saveOrUpdate(formDTO); + } + + /** + * @param roleId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 查询角色对应的吹哨部门列表 + * @Date 2019/12/26 13:52 + **/ + @GetMapping("queryWhistleDeptIdList/{roleId}") + public Result> queryWhistleDeptIdList(@PathVariable("roleId") Long roleId) { + return handleRoleDeptService.queryWhistleDeptIdList(roleId); + } + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/dao/HandleRoleDeptDao.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/dao/HandleRoleDeptDao.java new file mode 100644 index 000000000..c7f429aae --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/dao/HandleRoleDeptDao.java @@ -0,0 +1,45 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.handleroledept.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.handleroledept.entity.HandleRoleDeptEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 处理部门角色权限表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-26 + */ +@Mapper +public interface HandleRoleDeptDao extends BaseDao { + + /** + * @param roleId + * @return java.util.List + * @Author yinzuomei + * @Description 查询角色对应的吹哨部门列表 + * @Date 2019/12/26 13:57 + **/ + List queryWhistleDeptIdList(String roleId); + + int deleteByRoleId(String roleId); +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/entity/HandleRoleDeptEntity.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/entity/HandleRoleDeptEntity.java new file mode 100644 index 000000000..b310eec6c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/entity/HandleRoleDeptEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.handleroledept.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 qu@elink-cn.com + * @since v1.0.0 2019-12-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_handle_role_dept") +public class HandleRoleDeptEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 角色ID + */ + private String roleId; + + /** + * 部门ID + */ + private String deptId; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 部门机构类型 + */ + private String deptType; + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/excel/HandleRoleDeptExcel.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/excel/HandleRoleDeptExcel.java new file mode 100644 index 000000000..1ded3c949 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/excel/HandleRoleDeptExcel.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.handleroledept.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 处理部门角色权限表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-26 + */ +@Data +public class HandleRoleDeptExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "角色ID") + private String roleId; + + @Excel(name = "部门ID") + private String deptId; + + @Excel(name = "部门名称") + private String deptName; + + @Excel(name = "部门机构类型") + private String deptType; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/redis/HandleRoleDeptRedis.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/redis/HandleRoleDeptRedis.java new file mode 100644 index 000000000..15b458128 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/redis/HandleRoleDeptRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.handleroledept.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 处理部门角色权限表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-26 + */ +@Component +public class HandleRoleDeptRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/service/HandleRoleDeptService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/service/HandleRoleDeptService.java new file mode 100644 index 000000000..7e540df46 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/service/HandleRoleDeptService.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.handleroledept.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.handleroledept.HandleRoleDeptDTO; +import com.elink.esua.epdc.dto.handleroledept.form.HandleRoleDeptFormDTO; +import com.elink.esua.epdc.dto.handleroledept.result.HandleRoleDeptPermissionDTO; +import com.elink.esua.epdc.modules.handleroledept.entity.HandleRoleDeptEntity; + +import java.util.List; +import java.util.Map; + +/** + * 处理部门角色权限表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-26 + */ +public interface HandleRoleDeptService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-26 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-26 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return HandleRoleDeptDTO + * @author generator + * @date 2019-12-26 + */ + HandleRoleDeptDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-26 + */ + void save(HandleRoleDeptDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-26 + */ + void update(HandleRoleDeptDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-26 + */ + void delete(String[] ids); + + /** + * @param formDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 保存角色对应的吹哨机构类型 + * @Date 2019/12/26 13:42 + **/ + Result saveOrUpdate(HandleRoleDeptFormDTO formDTO); + + /** + * @param roleId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 查询角色对应的吹哨部门列表 + * @Date 2019/12/26 13:56 + **/ + Result> queryWhistleDeptIdList(Long roleId); + + /** + * @param roleId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 根据角色id查询用户可吹哨部门信息,供下拉框使用 + * @Date 2019/12/26 15:01 + **/ + Result> listHandleRoleDeptPermission(String roleId); +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/service/impl/HandleRoleDeptServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/service/impl/HandleRoleDeptServiceImpl.java new file mode 100644 index 000000000..f7a7572c4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/service/impl/HandleRoleDeptServiceImpl.java @@ -0,0 +1,167 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.handleroledept.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.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.handleroledept.HandleRoleDeptDTO; +import com.elink.esua.epdc.dto.handleroledept.form.HandleRoleDeptFormDTO; +import com.elink.esua.epdc.dto.handleroledept.result.HandleRoleDeptPermissionDTO; +import com.elink.esua.epdc.modules.handleroledept.dao.HandleRoleDeptDao; +import com.elink.esua.epdc.modules.handleroledept.entity.HandleRoleDeptEntity; +import com.elink.esua.epdc.modules.handleroledept.redis.HandleRoleDeptRedis; +import com.elink.esua.epdc.modules.handleroledept.service.HandleRoleDeptService; +import com.elink.esua.epdc.modules.rolecategory.entity.HandleRoleCategoryEntity; +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 qu qu@elink-cn.com + * @since v1.0.0 2019-12-26 + */ +@Service +public class HandleRoleDeptServiceImpl extends BaseServiceImpl implements HandleRoleDeptService { + + @Autowired + private HandleRoleDeptRedis handleRoleDeptRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, HandleRoleDeptDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, HandleRoleDeptDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public HandleRoleDeptDTO get(String id) { + HandleRoleDeptEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, HandleRoleDeptDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(HandleRoleDeptDTO dto) { + HandleRoleDeptEntity entity = ConvertUtils.sourceToTarget(dto, HandleRoleDeptEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(HandleRoleDeptDTO dto) { + HandleRoleDeptEntity entity = ConvertUtils.sourceToTarget(dto, HandleRoleDeptEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param formDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 保存角色对应的吹哨机构类型 + * @Date 2019/12/26 13:42 + **/ + @Override + public Result saveOrUpdate(HandleRoleDeptFormDTO formDTO) { + //先删除角色吹哨部门权限关系 + deleteByRoleId(formDTO.getRoleId()); + //角色没有一个吹哨部门的情况 + if (CollUtil.isEmpty(formDTO.getHandleRoleDeptDTOList())) { + return new Result(); + } + //保存角色和处理类别关系 + List entityList = ConvertUtils.sourceToTarget(formDTO.getHandleRoleDeptDTOList(), + HandleRoleDeptEntity.class); + this.insertBatch(entityList); + return new Result(); + } + + private void deleteByRoleId(String roleId) { + baseDao.deleteByRoleId(roleId); + } + + /** + * @param roleId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 查询角色对应的吹哨部门列表 + * @Date 2019/12/26 13:56 + **/ + @Override + public Result> queryWhistleDeptIdList(Long roleId) { + List list = baseDao.queryWhistleDeptIdList(roleId.toString()); + return new Result>().ok(list); + } + + /** + * @param roleId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 根据角色id查询用户可吹哨部门信息,供下拉框使用 + * @Date 2019/12/26 15:01 + **/ + @Override + public Result> listHandleRoleDeptPermission(String roleId) { + if (StringUtils.isBlank(roleId)) { + return new Result>().error("角色id不能为空"); + } + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(roleId), "ROLE_ID", roleId); + List handleRoleDeptEntityList = baseDao.selectList(wrapper); + List list = ConvertUtils.sourceToTarget(handleRoleDeptEntityList, HandleRoleDeptPermissionDTO.class); + return new Result>().ok(list); + } + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/ItemController.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/ItemController.java index 80ab40693..914006d57 100755 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/ItemController.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/ItemController.java @@ -27,11 +27,14 @@ 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.events.EpdcEventsCommentsDTO; import com.elink.esua.epdc.dto.events.form.EventDeleteCommentsFormDTO; +import com.elink.esua.epdc.dto.form.KpiMetaDataOfEventsFormDTO; import com.elink.esua.epdc.dto.item.ItemDTO; import com.elink.esua.epdc.dto.item.ItemPendingHandleDTO; import com.elink.esua.epdc.dto.item.form.ItemHandleSubmitFormDTO; import com.elink.esua.epdc.dto.item.result.ItemContentForPCEndResultDTO; import com.elink.esua.epdc.dto.item.result.ItemDetailForPCEndResultDTO; +import com.elink.esua.epdc.dto.result.KpiEvaluationAmountResultDTO; +import com.elink.esua.epdc.dto.result.KpiItemHandleAmountResultDTO; import com.elink.esua.epdc.modules.item.excel.ItemExcel; import com.elink.esua.epdc.modules.item.service.ItemService; import org.springframework.beans.factory.annotation.Autowired; @@ -57,32 +60,34 @@ public class ItemController { /** * 项目列表 + * * @Params: [params] - * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> * @Author: liuchuang * @Date: 2019/9/16 9:56 */ @GetMapping("page") - public Result> page(@RequestParam Map params){ + public Result> page(@RequestParam Map params) { PageData page = itemService.listOfItemsForPCEnd(params); return new Result>().ok(page); } /** * 项目处理详情 + * * @Params: [id] * @Return: com.elink.esua.epdc.commons.tools.utils.Result * @Author: liuchuang * @Date: 2019/9/16 9:56 */ @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ + public Result get(@PathVariable("id") String id) { ItemDetailForPCEndResultDTO data = itemService.getItemDetailById(id); return new Result().ok(data); } @PostMapping - public Result save(@RequestBody ItemDTO dto){ + public Result save(@RequestBody ItemDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); itemService.save(dto); @@ -90,7 +95,7 @@ public class ItemController { } @PutMapping - public Result update(@RequestBody ItemDTO dto){ + public Result update(@RequestBody ItemDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); itemService.update(dto); @@ -98,7 +103,7 @@ public class ItemController { } @DeleteMapping - public Result delete(@RequestBody String[] ids){ + public Result delete(@RequestBody String[] ids) { //效验数据 AssertUtils.isArrayEmpty(ids, "id"); itemService.delete(ids); @@ -113,6 +118,7 @@ public class ItemController { /** * 项目处理提交 + * * @Params: [dto] * @Return: com.elink.esua.epdc.commons.tools.utils.Result * @Author: liuchuang @@ -126,21 +132,23 @@ public class ItemController { /** * 项目内容详情 + * * @Params: [id] * @Return: com.elink.esua.epdc.commons.tools.utils.Result * @Author: liuchuang * @Date: 2019/9/16 9:56 */ @GetMapping("contentDetail/{id}") - public Result getItemContentDetail(@PathVariable("id") String id){ + public Result getItemContentDetail(@PathVariable("id") String id) { ItemContentForPCEndResultDTO data = itemService.getItemContentDetail(id); return new Result().ok(data); } /** * 评论列表 + * * @Params: [params] - * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> * @Author: liuchuang * @Date: 2019/9/6 18:58 */ @@ -152,6 +160,7 @@ public class ItemController { /** * 屏蔽评论 + * * @Params: [commentId] * @Return: com.elink.esua.epdc.commons.tools.utils.Result * @Author: liuchuang @@ -162,4 +171,44 @@ public class ItemController { return itemService.modifyCommentById(eventDeleteCommentsFormDTO.getCommentIds()); } + /*** + * kpi-统计群众对问题处理的满意度 + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author qushutong + * @date 2019/12/18 10:27 + */ + @PostMapping("statPeopleEvaluationMetaData") + public Result> statPeopleEvaluationMetaData(@RequestBody KpiMetaDataOfEventsFormDTO metaDataFormDto) { + List list = itemService.statPeopleEvaluationMetaData(metaDataFormDto); + return new Result().ok(list); + } + + + /** + * kpi- 统计项目处理数 包括:网格呼叫总数,网格呼叫被响应数,网格呼叫被关闭数 + * + * @param metaDataFormDto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author qushutong + * @date 2019/12/18 16:02 + */ + @PostMapping("statItemHandleAmountMetaData") + public Result> statItemHandleAmountMetaData(@RequestBody KpiMetaDataOfEventsFormDTO metaDataFormDto) { + List list = itemService.statItemHandleAmount(metaDataFormDto); + return new Result().ok(list); + } + + /*** + * kpi- 网格对项目处理的评价 不满意 满意 非常满意 统计 + * @param metaDataFormDto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author qushutong + * @date 2019/12/20 15:37 + */ + @PostMapping("statGridEvaluationMetaData") + public Result> statGridEvaluationMetaData(@RequestBody KpiMetaDataOfEventsFormDTO metaDataFormDto) { + List list = itemService.statGridEvaluationMetaData(metaDataFormDto); + return new Result().ok(list); + } } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemDao.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemDao.java index 89358e90a..d63b21455 100755 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemDao.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemDao.java @@ -18,6 +18,8 @@ package com.elink.esua.epdc.modules.item.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.result.KpiItemTimeLimitByDeptResultDTO; +import com.elink.esua.epdc.dto.form.KpiMetaDataOfEventsFormDTO; import com.elink.esua.epdc.dto.item.ItemDTO; import com.elink.esua.epdc.dto.item.ItemPendingHandleDTO; import com.elink.esua.epdc.dto.item.form.ItemCategoryStatisticsFormDTO; @@ -25,6 +27,8 @@ import com.elink.esua.epdc.dto.item.form.ItemDetailFormDTO; import com.elink.esua.epdc.dto.item.form.ItemFormDTO; import com.elink.esua.epdc.dto.item.form.ItemStatisticsFormDTO; import com.elink.esua.epdc.dto.item.result.*; +import com.elink.esua.epdc.dto.result.KpiEvaluationAmountResultDTO; +import com.elink.esua.epdc.dto.result.KpiItemHandleAmountResultDTO; import com.elink.esua.epdc.modules.item.entity.ItemEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -43,6 +47,7 @@ public interface ItemDao extends BaseDao { /** * 根据议题ID获取项目信息 + * * @Params: [issueId] * @Return: com.elink.esua.epdc.dto.item.ItemDTO * @Author: liuchuang @@ -52,6 +57,7 @@ public interface ItemDao extends BaseDao { /** * 移动端-项目列表 + * * @Params: [formDto] * @Return: java.util.List * @Author: liuchuang @@ -60,11 +66,10 @@ public interface ItemDao extends BaseDao { List selectListOfItems(ItemFormDTO formDto, int[] states); /** - * * 移动端-我的项目列表 * - * @params [formDto, states] * @return java.util.List + * @params [formDto, states] * @author liuchuang * @since 2019/10/31 16:28 */ @@ -72,6 +77,7 @@ public interface ItemDao extends BaseDao { /** * 移动端-项目详情 + * * @Params: [formDto] * @Return: com.elink.esua.epdc.dto.item.result.ItemDetailResultDTO * @Author: liuchuang @@ -81,14 +87,17 @@ public interface ItemDao extends BaseDao { /** * 工作端-项目列表 - * @Params: [formDto,deptIdList] + * + * @Params: [formDto, deptIdList] * @Return: java.util.List * @Author: lipengfei * @Date: 2019/11/19 16:50 */ - List selectListOfItemsByWork(ItemFormDTO formDto,List deptIdList); + List selectListOfItemsByWork(ItemFormDTO formDto, List deptIdList); + /** * 工作端-项目详情 + * * @Params: [formDto] * @Return: com.elink.esua.epdc.dto.item.result.ItemDetailResultDTO * @Author: lipengfei @@ -99,6 +108,7 @@ public interface ItemDao extends BaseDao { /** * 移动端-议题分类统计 + * * @Params: [formDTO] * @Return: com.elink.esua.epdc.dto.item.result.ItemCategoryStatisticsResultDTO * @Author: liuchuang @@ -107,9 +117,9 @@ public interface ItemDao extends BaseDao { ItemCategoryStatisticsResultDTO selectOneItemCategoryStatistics(ItemCategoryStatisticsFormDTO formDTO); - /** * PC端项目列表 + * * @Params: [params] * @Return: java.util.List * @Author: liuchuang @@ -119,6 +129,7 @@ public interface ItemDao extends BaseDao { /** * PC端项目详情 + * * @Params: [itemId] * @Return: com.elink.esua.epdc.dto.item.result.ItemDetailForPCEndResultDTO * @Author: liuchuang @@ -128,6 +139,7 @@ public interface ItemDao extends BaseDao { /** * 项目处理进度 + * * @Params: [issueId, itemId, outOrInside(0:内部数据, 1:外部数据)] * @Return: com.elink.esua.epdc.dto.item.result.ItemHandleProgressResultDTO * @Author: liuchuang @@ -137,6 +149,7 @@ public interface ItemDao extends BaseDao { /** * 业务端-项目处理进度 + * * @Params: [itemId] * @Return: com.elink.esua.epdc.dto.item.result.ItemHandleProgressResultDTO * @Author: liuchuang @@ -157,30 +170,29 @@ public interface ItemDao extends BaseDao { /** * 项目内容详情 + * * @Params: [itemId] * @Return: com.elink.esua.epdc.dto.item.result.ItemContentForPCEndResultDTO * @Author: liuchuang * @Date: 2019/9/17 10:37 */ - ItemContentForPCEndResultDTO selectItemContentForPCEnd(String itemId); + ItemContentForPCEndResultDTO selectItemContentForPCEnd(String itemId); /** - * * 项目处理发送菜单消息 * - * @params [deptId, state] * @return int + * @params [deptId, state] * @author liuchuang * @since 2019/10/30 13:28 */ int selectCountOfItemDeptNotice(Long deptId, int state); /** - * * 根据吹哨部门ID统计吹哨部门待处理项目数量 * - * @params [deptId] * @return int + * @params [deptId] * @author liuchuang * @since 2019/10/30 13:33 */ @@ -188,6 +200,7 @@ public interface ItemDao extends BaseDao { /** * 移动端-项目统计 + * * @Params: [formDTO] * @Return: com.elink.esua.epdc.dto.item.result.ItemStatisticsResultDTO * @Author: lipengfei @@ -195,6 +208,68 @@ public interface ItemDao extends BaseDao { */ ItemStatisticsResultDTO selectOneItemStatistics(ItemStatisticsFormDTO formDTO); + /** + * 绩效考核 - 项目 - 根据部门id,查询考核周期内群众满意度 + * + * @param metaDataFormDto + * @return java.util.List + * @author qushutong + * @date 2019/12/20 14:30 + */ + List selectListPeopleEvaluationMetaData(KpiMetaDataOfEventsFormDTO metaDataFormDto); + + /*** + * 绩效考核 - 项目 - 网格对项目处理的评价 不满意 满意 非常满意 统计 + * @param metaDataFormDto + * @return java.util.List + * @author qushutong + * @date 2019/12/20 15:43 + */ + List selectListGridEvaluationMetaData(KpiMetaDataOfEventsFormDTO metaDataFormDto); + + /*** + * 绩效考核 - 项目 - 网格吹哨总数 + * @param metaDataFormDto + * @param metaDataCode 元数据编码,不可变参数 :KpiMetaDataEnum.GRID_CALL_SUPERIOR_AMOUNT.getValue() + * @return java.util.List + * @author qushutong + * @date 2019/12/18 16:23 + */ + List selectListItemGridCallAmount(@Param("metaDataFormDto") KpiMetaDataOfEventsFormDTO metaDataFormDto, + @Param("metaDataCode") String metaDataCode); + + /*** + * 绩效考核 - 项目 - 查询每个部门吹哨的所有项目,与项目吹哨时间 + * @param metaDataFormDto + * @return java.util.List + * @author qushutong + * @date 2019/12/19 17:16 + */ + List selctListItemTimeLimitByDept(KpiMetaDataOfEventsFormDTO metaDataFormDto); + + /** + * 绩效考核 - 项目 - 按部门id查询与项目有效响应时限 网格呼叫被响应总数 + * + * @param kpiItemTimeLimitByDeptList + * @param metaDataCode 元数据编码,不可变参数 :KpiMetaDataEnum.GRID_CALL_SUPERIOR_RESP_AMOUNT.getValue() + * @return java.util.List + * @author qushutong + * @date 2019/12/23 13:27 + */ + List selectListItemRespondAmount(@Param("timeLimitList") List kpiItemTimeLimitByDeptList, + @Param("metaDataCode") String metaDataCode); + + /** + * 绩效考核 - 项目 - 按部门id查询与项目有效办结时限 网格呼叫被办结总数 + * + * @param kpiItemTimeLimitByDeptList + * @param metaDataCode 元数据编码, 不可变参数 : KpiMetaDataEnum.GRID_CALL_SUPERIOR_CLOSE_AMOUNT.getValue() + * @return java.util.List + * @author qushutong + * @date 2019/12/23 13:37 + */ + List selectListItemCloseAmount(@Param("timeLimitList") List kpiItemTimeLimitByDeptList, + @Param("metaDataCode") String metaDataCode); /** * * 删除项目处理进度表历史记录 diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/entity/ItemEvaluateDeptEntity.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/entity/ItemEvaluateDeptEntity.java index 68a1a69cd..25478848d 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/entity/ItemEvaluateDeptEntity.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/entity/ItemEvaluateDeptEntity.java @@ -26,41 +26,41 @@ import lombok.EqualsAndHashCode; import java.util.Date; /** - * 部门满意度评价表 + * 部门满意度评价表 * * @author qu qu@elink-cn.com * @since v1.0.0 2019-09-17 */ @Data -@EqualsAndHashCode(callSuper=false) +@EqualsAndHashCode(callSuper = false) @TableName("epdc_item_evaluate_dept") public class ItemEvaluateDeptEntity extends BaseEpdcEntity { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - /** - * 项目ID - */ - private String itemId; + /** + * 项目ID + */ + private String itemId; /** * 被评价部门ID */ - private Long deptId; + private Long deptId; /** * 被评价部门名称 */ - private String deptName; + private String deptName; /** * 评价满意度 */ - private Integer evaluationLevel; + private Integer evaluationLevel; /** * 操作人部门ID */ - private Long createdDeptId; + private Long createdDeptId; } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java index 7827cfa9f..78d9e3baf 100755 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java @@ -21,10 +21,13 @@ 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.events.EpdcEventsCommentsDTO; +import com.elink.esua.epdc.dto.form.KpiMetaDataOfEventsFormDTO; import com.elink.esua.epdc.dto.item.ItemDTO; import com.elink.esua.epdc.dto.item.ItemPendingHandleDTO; import com.elink.esua.epdc.dto.item.form.*; import com.elink.esua.epdc.dto.item.result.*; +import com.elink.esua.epdc.dto.result.KpiEvaluationAmountResultDTO; +import com.elink.esua.epdc.dto.result.KpiItemHandleAmountResultDTO; import com.elink.esua.epdc.modules.item.entity.ItemEntity; import java.util.List; @@ -50,6 +53,7 @@ public interface ItemService extends BaseService { /** * PC端项目列表 + * * @Params: [params] * @Return: com.elink.esua.epdc.commons.tools.page.PageData * @Author: liuchuang @@ -79,6 +83,7 @@ public interface ItemService extends BaseService { /** * 项目详情 + * * @Params: [id] * @Return: com.elink.esua.epdc.dto.item.result.ItemDetailForPCEndResultDTO * @Author: liuchuang @@ -118,6 +123,7 @@ public interface ItemService extends BaseService { /** * 根据议题ID获取项目信息 + * * @Params: [issueId] * @Return: com.elink.esua.epdc.modules.item.entity.ItemEntity * @Author: liuchuang @@ -127,16 +133,19 @@ public interface ItemService extends BaseService { /** * 移动端-项目列表 + * * @Params: [formDto] - * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> * @Author: liuchuang * @Date: 2019/9/9 16:47 */ Result> listItems(ItemFormDTO formDto); + /** * 项目列表-移动app端用 + * * @Params: [formDto] - * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> * @Author: lipengfei * @Date: 2019/10/19 16:47 */ @@ -144,6 +153,7 @@ public interface ItemService extends BaseService { /** * 移动端-项目详情 + * * @Params: [formDto] * @Return: com.elink.esua.epdc.commons.tools.utils.Result * @Author: liuchuang @@ -153,6 +163,7 @@ public interface ItemService extends BaseService { /** * 工作端-项目详情 + * * @Params: [formDto] * @Return: com.elink.esua.epdc.commons.tools.utils.Result * @Author: lipengfei @@ -163,14 +174,17 @@ public interface ItemService extends BaseService { /** * 工作端-获取满意度评价结果 + * * @Params: [evaluationFormDTO] * @Return: com.elink.esua.epdc.commons.tools.utils.Result { /** * 项目分类统计 + * * @Params: [formDto] * @Return: com.elink.esua.epdc.commons.tools.utils.Result * @Author: liuchuang @@ -188,6 +203,7 @@ public interface ItemService extends BaseService { /** * 项目处理进度 + * * @Params: [itemId, outOrInside(0:内部数据, 1:外部数据)] * @Return: java.util.List * @Author: liuchuang @@ -197,6 +213,7 @@ public interface ItemService extends BaseService { /** * 项目处理提交 + * * @Params: [dto] * @Return: com.elink.esua.epdc.commons.tools.utils.Result * @Author: liuchuang @@ -206,6 +223,7 @@ public interface ItemService extends BaseService { /** * 项目内容详情 + * * @Params: [itemId] * @Return: com.elink.esua.epdc.dto.item.result.ItemContentForPCEndResultDTO * @Author: liuchuang @@ -215,6 +233,7 @@ public interface ItemService extends BaseService { /** * 评论列表 + * * @Params: [params] * @Return: com.elink.esua.epdc.commons.tools.page.PageData * @Author: liuchuang @@ -224,6 +243,7 @@ public interface ItemService extends BaseService { /** * 屏蔽评论 + * * @Params: [commentId] * @Return: com.elink.esua.epdc.commons.tools.utils.Result * @Author: liuchuang @@ -233,30 +253,29 @@ public interface ItemService extends BaseService { /** * 我的项目列表 + * * @Params: [formDTO] - * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> * @Author: liuchuang * @Date: 2019/9/17 13:37 */ Result> listItemsOfMine(ItemOfMineFormDTO formDTO); /** - * * 项目处理发送菜单消息 * - * @params [deptId] * @return void + * @params [deptId] * @author liuchuang * @since 2019/10/30 9:12 */ void sendItemHandleMenuNotice(Long deptId, Long userId); /** - * * 项目处理发送菜单消息-吹哨部门 * - * @params [deptIds] * @return void + * @params [deptIds] * @author liuchuang * @since 2019/10/30 12:26 */ @@ -264,6 +283,7 @@ public interface ItemService extends BaseService { /** * 项目统计 + * * @Params: [formDto] * @Return: com.elink.esua.epdc.commons.tools.utils.Result * @Author: lipengfei @@ -273,6 +293,7 @@ public interface ItemService extends BaseService { /** * 项目处理进度 + * * @Params: [itemId] * @Return: com.elink.esua.epdc.commons.tools.utils.Result * @Author: lipengfei @@ -281,33 +302,30 @@ public interface ItemService extends BaseService { List listOfItemHandleProgressByWork(String itemId); /** - * * 项目处理进度-居民端 * - * @params [itemId] * @return java.util.List + * @params [itemId] * @author liuchuang * @since 2019/12/24 9:03 */ List listOfItemHandleProgressByMobile(String itemId); /** - * * 拉取市北网格化平台项目进度情况 * - * @params [] * @return com.elink.esua.epdc.commons.tools.utils.Result + * @params [] * @author liuchuang * @since 2019/12/25 13:28 */ Result queryItemHandle(); /** - * * 网格化平台处理情况回调 * - * @params [formDto] * @return com.elink.esua.epdc.commons.tools.utils.Result + * @params [formDto] * @author liuchuang * @since 2019/12/26 13:52 */ @@ -321,4 +339,33 @@ public interface ItemService extends BaseService { * @Date 2020/1/13 16:55 **/ Result> queryHandleCategories(); + + + /*** + * kpi查询问题满意度 + * @param metaDataFormDto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author qushutong + * @date 2019/12/18 10:30 + */ + List statPeopleEvaluationMetaData(KpiMetaDataOfEventsFormDTO metaDataFormDto); + + /** + * 统计项目处理数 包括:网格呼叫总数,网格呼叫被响应数,网格呼叫被关闭数 + * + * @param metaDataFormDto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author qushutong + * @date 2019/12/18 16:02 + */ + List statItemHandleAmount(KpiMetaDataOfEventsFormDTO metaDataFormDto); + + /*** + * 绩效考核 - 项目 - 网格对项目处理的评价 不满意 满意 非常满意 统计 + * @param metaDataFormDto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author qushutong + * @date 2019/12/20 15:40 + */ + List statGridEvaluationMetaData(KpiMetaDataOfEventsFormDTO metaDataFormDto); } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemEvaluateDeptServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemEvaluateDeptServiceImpl.java index 4aa40316d..51d2d202a 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemEvaluateDeptServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemEvaluateDeptServiceImpl.java @@ -16,6 +16,7 @@ */ package com.elink.esua.epdc.modules.item.service.impl; + import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; import com.elink.esua.epdc.dto.item.ItemEvaluateDeptDTO; import com.elink.esua.epdc.dto.item.result.ItemDeptEvaluateResultDTO; @@ -30,7 +31,7 @@ import java.util.Arrays; import java.util.List; /** - * 部门满意度评价表 + * 部门满意度评价表 * * @author qu qu@elink-cn.com * @since v1.0.0 2019-09-17 @@ -49,7 +50,7 @@ public class ItemEvaluateDeptServiceImpl extends BaseServiceImpl evaluateDeptDTOS, String itemId, Long createdDeptId) { List evaluateDeptEntities = new ArrayList<>(); - for (ItemEvaluateDeptDTO dto: + for (ItemEvaluateDeptDTO dto : evaluateDeptDTOS) { ItemEvaluateDeptEntity entity = new ItemEvaluateDeptEntity(); entity.setDeptId(dto.getDeptId()); diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java index f5ec9ff71..d971b7eff 100755 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java @@ -28,6 +28,8 @@ import com.elink.esua.epdc.commons.tools.enums.InterfaceLogBusinessTypeEnum; import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; import com.elink.esua.epdc.commons.tools.exception.RenException; import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.redis.RedisKeys; +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; import com.elink.esua.epdc.commons.tools.security.user.UserDetail; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; @@ -43,11 +45,15 @@ import com.elink.esua.epdc.dto.SysDeptDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; import com.elink.esua.epdc.dto.events.EpdcEventsCommentsDTO; import com.elink.esua.epdc.dto.form.SmsNoticeFormDTO; +import com.elink.esua.epdc.dto.result.KpiItemTimeLimitByDeptResultDTO; +import com.elink.esua.epdc.dto.form.KpiMetaDataOfEventsFormDTO; import com.elink.esua.epdc.dto.issue.result.IssueProgressResultDTO; import com.elink.esua.epdc.dto.item.*; import com.elink.esua.epdc.dto.item.form.*; import com.elink.esua.epdc.dto.item.result.*; import com.elink.esua.epdc.enums.ItemGridPlatformHandleStatusEnum; +import com.elink.esua.epdc.dto.result.KpiEvaluationAmountResultDTO; +import com.elink.esua.epdc.dto.result.KpiItemHandleAmountResultDTO; import com.elink.esua.epdc.enums.ItemHandleCategoryEnum; import com.elink.esua.epdc.gird.shibei.api.ShiBeiCityGridApi; import com.elink.esua.epdc.gird.shibei.constant.CommonConstants; @@ -60,6 +66,7 @@ import com.elink.esua.epdc.gird.shibei.dto.form.ReportFile; import com.elink.esua.epdc.gird.shibei.dto.form.SendInputInfoFormDto; import com.elink.esua.epdc.gird.shibei.util.XstreamUtil; import com.elink.esua.epdc.modules.async.IssueOverseeResultsTask; +import com.elink.esua.epdc.enums.KpiMetaDataEnum; import com.elink.esua.epdc.modules.async.NewsTask; import com.elink.esua.epdc.modules.events.dao.ImgDao; import com.elink.esua.epdc.modules.events.entity.ImgEntity; @@ -124,6 +131,10 @@ public class ItemServiceImpl extends BaseServiceImpl implem @Autowired private ImgService imgService; + + @Autowired + private RedisUtils redisUtils; + @Autowired private ImgDao imgDao; @@ -168,10 +179,10 @@ public class ItemServiceImpl extends BaseServiceImpl implem if (OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT.equals(user.getTypeKey())) { if (params.get("streetId") != null && !"".equals(params.get("streetId"))) { Result resultdept = adminFeignClient.getSysDeptInfo(Long.parseLong(params.get("streetId").toString())); - SysDeptDTO dept =resultdept.getData(); + SysDeptDTO dept = resultdept.getData(); Object deptId = params.get("streetId"); if (OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT.equals(dept.getTypeKey())) { - params.put("districtDeptId",deptId); + params.put("districtDeptId", deptId); params.remove("streetId"); } } @@ -256,10 +267,12 @@ public class ItemServiceImpl extends BaseServiceImpl implem List data = baseDao.selectListOfItems(formDto, states); return new Result>().ok(data); } + /** * 项目列表-移动app端用 + * * @Params: [formDto] - * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> * @Author: lipengfei * @Date: 2019/10/19 16:47 */ @@ -270,6 +283,7 @@ public class ItemServiceImpl extends BaseServiceImpl implem List data = baseDao.selectListOfItemsByWork(formDto, SecurityUser.getUser().getDeptIdList()); return new Result>().ok(data); } + @Override public Result getItemDetailByWork(String id) { ItemDetailResultDTO resultDTO = baseDao.selectOneOfItemDetailForWork(id); @@ -430,14 +444,16 @@ public class ItemServiceImpl extends BaseServiceImpl implem return resultDTO; } + /** * 工作端-获取可吹哨部门 + * * @Return: com.elink.esua.epdc.commons.tools.utils.Result * @Author: lipengfei * @Date: 2019/11/19 16:34 */ @Override - public Result> whistlingDept(){ + public Result> whistlingDept() { UserDetail user = SecurityUser.getUser(); List deptResultDTOS = new ArrayList<>(); // 网格-可做操作和可流转部门 @@ -615,10 +631,10 @@ public class ItemServiceImpl extends BaseServiceImpl implem // 发送菜单消息-待处理项目-吹哨部门 this.sendWhistlingDeptItemHandleMenuNotice(deptIds, null); } else if (ItemHandleCategoryEnum.HANDLE_REPORT.getValue() == dto.getHandleCategory()) { - boolean reportFlag = this.checkReport(dto.getId()); - if (reportFlag) { - return new Result().error("当前项目已上报网格化平台"); - } + boolean reportFlag = this.checkReport(dto.getId()); + if (reportFlag) { + return new Result().error("当前项目已上报网格化平台"); + } handleProcessEntity.setState(dto.getHandleCategory()); informationFormDTO.setTitle(EventsNoticeConstant.NOTICE_REPORT); GridDto gridDto = null; @@ -681,7 +697,7 @@ public class ItemServiceImpl extends BaseServiceImpl implem // 通知部门Id(网格) itemInfoDto.setDeptId(entity.getGridId().toString()); itemInformationService.insert(itemInfoDto); - // 街道部门和区直部门 + // 街道部门和区直部门 } else if (OrganizationTypeConstant.ORG_TYPE_STREET_DEPT.equals(user.getTypeKey()) || OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT.equals(user.getTypeKey())) { //插入项目消息表(网格和街道) // 通知部门Id(网格) @@ -689,20 +705,20 @@ public class ItemServiceImpl extends BaseServiceImpl implem itemInformationService.insert(itemInfoDto); //修改通知部门Id(街道Id) ItemInformationEntity itemInfoStreetDto = new ItemInformationEntity(); - BeanUtils.copyProperties(itemInfoDto,itemInfoStreetDto); + BeanUtils.copyProperties(itemInfoDto, itemInfoStreetDto); itemInfoStreetDto.setId(null); - Result result =adminFeignClient.getCompleteDept(entity.getGridId()); + Result result = adminFeignClient.getCompleteDept(entity.getGridId()); CompleteDeptDTO comDeptDto = result.getData(); itemInfoStreetDto.setDeptId(comDeptDto.getStreetId().toString()); itemInformationService.insert(itemInfoStreetDto); } - // 吹哨处理 - }else if (ItemHandleCategoryEnum.HANDLE_CIRCULATION_ASSISTANCE.getValue() == dto.getHandleCategory()) { - List deptList = dto.getDeptResultDTOS(); + // 吹哨处理 + } else if (ItemHandleCategoryEnum.HANDLE_CIRCULATION_ASSISTANCE.getValue() == dto.getHandleCategory()) { + List deptList = dto.getDeptResultDTOS(); // 拼接被吹哨部门 String whistlDept = ""; - for (int i =0; i < deptList.size(); i++) { - ItemCirculationDeptResultDTO indexDto = (ItemCirculationDeptResultDTO)deptList.get(i); + for (int i = 0; i < deptList.size(); i++) { + ItemCirculationDeptResultDTO indexDto = (ItemCirculationDeptResultDTO) deptList.get(i); if (i == 0) { whistlDept += indexDto.getDeptName(); } else { @@ -714,12 +730,12 @@ public class ItemServiceImpl extends BaseServiceImpl implem for (ItemCirculationDeptResultDTO itemDto : deptList) { // 通知部门Id(被吹哨部门) ItemInformationEntity itemInfoEachDto = new ItemInformationEntity(); - BeanUtils.copyProperties(itemInfoDto,itemInfoEachDto); + BeanUtils.copyProperties(itemInfoDto, itemInfoEachDto); itemInfoEachDto.setId(null); itemInfoEachDto.setDeptId(itemDto.getDeptId().toString()); itemInformationService.insert(itemInfoEachDto); } - // 关闭和结案处理 + // 关闭和结案处理 } else { // 查询已吹哨部门 List oldDeptIds = itemDeptService.listOfWhistlingDeptIds(dto.getId(), SecurityUser.getDeptId()); @@ -727,7 +743,7 @@ public class ItemServiceImpl extends BaseServiceImpl implem for (Long itemDeptId : oldDeptIds) { // 通知部门Id(被吹哨部门) ItemInformationEntity itemInfoEachDto = new ItemInformationEntity(); - BeanUtils.copyProperties(itemInfoDto,itemInfoEachDto); + BeanUtils.copyProperties(itemInfoDto, itemInfoEachDto); itemInfoEachDto.setId(null); itemInfoEachDto.setDeptId(itemDeptId.toString()); itemInformationService.insert(itemInfoEachDto); @@ -746,12 +762,12 @@ public class ItemServiceImpl extends BaseServiceImpl implem this.sendWhistlingDeptItemHandleMenuNotice(Collections.singletonList(user.getDeptId()), null); } //项目外部处理意见图片保存 - if(dto.getOutHandleImages()!= null && dto.getOutHandleImages().size()>0){ - imgService.saveImages(dto.getOutHandleImages(),handleProcessEntity.getId(), ImageConstant.TYPE_IMAGE_ITEM_OUT_HANDLE); + if (dto.getOutHandleImages() != null && dto.getOutHandleImages().size() > 0) { + imgService.saveImages(dto.getOutHandleImages(), handleProcessEntity.getId(), ImageConstant.TYPE_IMAGE_ITEM_OUT_HANDLE); } //项目处理意见图片保存 - if(dto.getHandleImages()!= null && dto.getHandleImages().size()>0){ - imgService.saveImages(dto.getHandleImages(),handleProcessEntity.getId(), ImageConstant.TYPE_IMAGE_ITEM_HANDLE); + if (dto.getHandleImages() != null && dto.getHandleImages().size() > 0) { + imgService.saveImages(dto.getHandleImages(), handleProcessEntity.getId(), ImageConstant.TYPE_IMAGE_ITEM_HANDLE); } //居民端项目关闭、结案-短信通知 if (ItemHandleCategoryEnum.HANDLE_CLOSE.getValue() == dto.getHandleCategory() || @@ -899,12 +915,55 @@ public class ItemServiceImpl extends BaseServiceImpl implem newsTask.eventMenuNotice(menuNoticeDTO, userId); } } + @Override public Result getItemStatistics(ItemStatisticsFormDTO formDto) { ItemStatisticsResultDTO resultDTO = baseDao.selectOneItemStatistics(formDto); return new Result().ok(resultDTO); } + + + @Override + public List statPeopleEvaluationMetaData(KpiMetaDataOfEventsFormDTO metaDataFormDto) { + return baseDao.selectListPeopleEvaluationMetaData(metaDataFormDto); + } + + @Override + public List statItemHandleAmount(KpiMetaDataOfEventsFormDTO metaDataFormDto) { + List kpiMetaDataDTOList = new ArrayList<>(); + // 按部门id查询 部门网格呼叫事件总数 + List callAmountOfDept = baseDao.selectListItemGridCallAmount(metaDataFormDto, KpiMetaDataEnum.GRID_CALL_SUPERIOR_AMOUNT.getValue()); + kpiMetaDataDTOList.addAll(callAmountOfDept); + + //查询各个街道的项目呼叫有效时间 有效结案时间 + List KpiItemTimeLimitByDeptList = baseDao.selctListItemTimeLimitByDept(metaDataFormDto); + for (KpiItemTimeLimitByDeptResultDTO itemTimeLimitByDept : KpiItemTimeLimitByDeptList) { + if (StringUtils.isBlank(itemTimeLimitByDept.getItemId()) || StringUtils.isBlank(itemTimeLimitByDept.getCatecoryId())) { + continue; + } + Map map = (Map) redisUtils.get(RedisKeys.getKpiItemTimeLimitKey(itemTimeLimitByDept.getCatecoryId())); + itemTimeLimitByDept.setValidCloseTime(map.get(KpiItemConstant.CLOSE_ITEM_TIME_LIMIT)); + itemTimeLimitByDept.setValidRespondTime(map.get(KpiItemConstant.RESPOND_ITEM_TIME_LIMIT)); + } + + // 按部门id查询与项目有效响应时限 网格呼叫被响应总数 + List itemRespondAmountByDeot = baseDao.selectListItemRespondAmount(KpiItemTimeLimitByDeptList, KpiMetaDataEnum.GRID_CALL_SUPERIOR_RESP_AMOUNT.getValue()); + kpiMetaDataDTOList.addAll(itemRespondAmountByDeot); + + // 按部门id查询与项目有效办结时限 网格呼叫被办结总数 + List itemCloseAmountByDeot = baseDao.selectListItemCloseAmount(KpiItemTimeLimitByDeptList, KpiMetaDataEnum.GRID_CALL_SUPERIOR_CLOSE_AMOUNT.getValue()); + kpiMetaDataDTOList.addAll(itemCloseAmountByDeot); + + return kpiMetaDataDTOList; + } + + @Override + public List statGridEvaluationMetaData(KpiMetaDataOfEventsFormDTO metaDataFormDto) { + List list = baseDao.selectListGridEvaluationMetaData(metaDataFormDto); + return list; + } + /** * @param dto * @return void @@ -930,11 +989,10 @@ public class ItemServiceImpl extends BaseServiceImpl implem } /** - * * 保存接口调用日志 * - * @params [referenceId, businessType, interfaceName, successFlag, callMsgBody, returnMsgBody] * @return void + * @params [referenceId, businessType, interfaceName, successFlag, callMsgBody, returnMsgBody] * @author liuchuang * @since 2019/12/26 11:08 */ @@ -950,101 +1008,101 @@ public class ItemServiceImpl extends BaseServiceImpl implem interfaceLogService.insert(interfaceLogEntity); } - /** - * @param itemEntity - * @return com.elink.esua.gird.shibei.dto.form.SendInputInfoFormDto - * @Author yinzuomei - * @Description 组装案件信息上报接口入参 - * @Date 2019/12/25 13:14 - **/ - private SendInputInfoFormDto packageReportEntity(ItemEntity itemEntity) throws Exception { - UserDetail user = SecurityUser.getUser(); - SendInputInfoFormDto formDto = new SendInputInfoFormDto(); - // 案件来源 - formDto.setInfoSourceID(CommonConstants.INFO_SOURCE_ID); - // 渠道来源 - formDto.setReportDept(CommonConstants.REPORT_DEPT); - // 案件属性 - formDto.setInfoTypeID(CommonConstants.INFO_TYPE_ID); - // 案件大类 - formDto.setInfoBC(CommonConstants.INFO_BC); - // 案件小类 - formDto.setInfoSC(CommonConstants.INFO_SC); - // 案件子类 - formDto.setInfoZC(CommonConstants.INFO_ZC); - // 发生地址 - formDto.setStandardAddress(itemEntity.getIssueAddress()); - // 问题描述 + /** + * @param itemEntity + * @return com.elink.esua.gird.shibei.dto.form.SendInputInfoFormDto + * @Author yinzuomei + * @Description 组装案件信息上报接口入参 + * @Date 2019/12/25 13:14 + **/ + private SendInputInfoFormDto packageReportEntity(ItemEntity itemEntity) throws Exception { + UserDetail user = SecurityUser.getUser(); + SendInputInfoFormDto formDto = new SendInputInfoFormDto(); + // 案件来源 + formDto.setInfoSourceID(CommonConstants.INFO_SOURCE_ID); + // 渠道来源 + formDto.setReportDept(CommonConstants.REPORT_DEPT); + // 案件属性 + formDto.setInfoTypeID(CommonConstants.INFO_TYPE_ID); + // 案件大类 + formDto.setInfoBC(CommonConstants.INFO_BC); + // 案件小类 + formDto.setInfoSC(CommonConstants.INFO_SC); + // 案件子类 + formDto.setInfoZC(CommonConstants.INFO_ZC); + // 发生地址 + formDto.setStandardAddress(itemEntity.getIssueAddress()); + // 问题描述 formDto.setDescription(itemEntity.getItemContent());// 测试999勿删谢谢 - // 反映人 - formDto.setReportPerson(itemEntity.getNickName());// itemEntity.getNickName()测试人员 - // 联系方式 - formDto.setContactMode(itemEntity.getMobile()); - double[] gps= GPSUtils.gcj02_To_Gps84(itemEntity.getIssueLatitude(),itemEntity.getIssueLongitude()); - // 坐标X + // 反映人 + formDto.setReportPerson(itemEntity.getNickName());// itemEntity.getNickName()测试人员 + // 联系方式 + formDto.setContactMode(itemEntity.getMobile()); + double[] gps = GPSUtils.gcj02_To_Gps84(itemEntity.getIssueLatitude(), itemEntity.getIssueLongitude()); + // 坐标X formDto.setCoordX(new BigDecimal(gps[1]).setScale(15, BigDecimal.ROUND_HALF_UP)); - // 坐标Y + // 坐标Y formDto.setCoordY(new BigDecimal(gps[0]).setScale(15, BigDecimal.ROUND_HALF_UP)); - // 监督员编号 - formDto.setKeepersn(""); - // 操作时间 - formDto.setInsertTime(new Date()); - // 操作人 - formDto.setInsertUser(user.getRealName());// - // 外系统编号 - formDto.setHotLinesn(itemEntity.getId()); - // 先查询网格对应街道id - Result completeDeptDTOResult = adminFeignClient.getCompleteDept(itemEntity.getGridId()); - if (!completeDeptDTOResult.success()) { - throw new Exception("根据网格ID获取所有上级机构信息失败" + completeDeptDTOResult.getMsg()); - } - // 根据街道id查询对应平台的deptCode、streetCode - Result deptGridPlatformDTOResult = adminFeignClient.getDeptGridPlatformDTO(completeDeptDTOResult.getData().getStreetId().toString()); - if (!deptGridPlatformDTOResult.success() || null == deptGridPlatformDTOResult.getData()) { - throw new Exception("根据街道查询平台部门信息失败" + deptGridPlatformDTOResult.getMsg()); - } - //外系统编码 必填!!!!!!! - formDto.setDeptCode(deptGridPlatformDTOResult.getData().getDeptCode());// 130099 - // 街道编码!!!!!!!!!!!! - formDto.setStreetCode(deptGridPlatformDTOResult.getData().getStreetCode()); - // 网格编码 - formDto.setGridCode(null); - - //查询图片列表 - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(itemEntity.getEventId()), "REFERENCE_ID", itemEntity.getEventId()); - List imageList = imgDao.selectList(wrapper); - if (null != imageList && !imageList.isEmpty()) { - String url = null; - String filename = null; - ReportFile reportFile = null; - List reportFiles = new ArrayList<>(); - for (ImgEntity image : imageList) { - url = image.getImgUrl(); - if (org.apache.commons.lang.StringUtils.isNotBlank(url)) { - filename = url.substring(url.lastIndexOf(CommonConstants.CHAR_ASCII_47) + CommonConstants.NUMBER_ONE); - reportFile = new ReportFile(); - reportFile.setName(filename); - reportFile.setUrl(url); - reportFile.setBase64string(""); - reportFiles.add(reportFile); - } - } - ImageFile imageFile = new ImageFile(); - imageFile.setReportFileList(reportFiles); - formDto.setImageFile(imageFile); - } - return formDto; - } - - /** - * @param gridDto - * @param handleProcessEntity - * @return void - * @Author yinzuomei - * @Description - * @Date 2019/12/25 15:29 - **/ + // 监督员编号 + formDto.setKeepersn(""); + // 操作时间 + formDto.setInsertTime(new Date()); + // 操作人 + formDto.setInsertUser(user.getRealName());// + // 外系统编号 + formDto.setHotLinesn(itemEntity.getId()); + // 先查询网格对应街道id + Result completeDeptDTOResult = adminFeignClient.getCompleteDept(itemEntity.getGridId()); + if (!completeDeptDTOResult.success()) { + throw new Exception("根据网格ID获取所有上级机构信息失败" + completeDeptDTOResult.getMsg()); + } + // 根据街道id查询对应平台的deptCode、streetCode + Result deptGridPlatformDTOResult = adminFeignClient.getDeptGridPlatformDTO(completeDeptDTOResult.getData().getStreetId().toString()); + if (!deptGridPlatformDTOResult.success() || null == deptGridPlatformDTOResult.getData()) { + throw new Exception("根据街道查询平台部门信息失败" + deptGridPlatformDTOResult.getMsg()); + } + //外系统编码 必填!!!!!!! + formDto.setDeptCode(deptGridPlatformDTOResult.getData().getDeptCode());// 130099 + // 街道编码!!!!!!!!!!!! + formDto.setStreetCode(deptGridPlatformDTOResult.getData().getStreetCode()); + // 网格编码 + formDto.setGridCode(null); + + //查询图片列表 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(itemEntity.getEventId()), "REFERENCE_ID", itemEntity.getEventId()); + List imageList = imgDao.selectList(wrapper); + if (null != imageList && !imageList.isEmpty()) { + String url = null; + String filename = null; + ReportFile reportFile = null; + List reportFiles = new ArrayList<>(); + for (ImgEntity image : imageList) { + url = image.getImgUrl(); + if (org.apache.commons.lang.StringUtils.isNotBlank(url)) { + filename = url.substring(url.lastIndexOf(CommonConstants.CHAR_ASCII_47) + CommonConstants.NUMBER_ONE); + reportFile = new ReportFile(); + reportFile.setName(filename); + reportFile.setUrl(url); + reportFile.setBase64string(""); + reportFiles.add(reportFile); + } + } + ImageFile imageFile = new ImageFile(); + imageFile.setReportFileList(reportFiles); + formDto.setImageFile(imageFile); + } + return formDto; + } + + /** + * @param gridDto + * @param handleProcessEntity + * @return void + * @Author yinzuomei + * @Description + * @Date 2019/12/25 15:29 + **/ private void saveItemGridPlatformInfo(GridDto gridDto, ItemHandleProcessEntity handleProcessEntity) { UserDetail user = SecurityUser.getUser(); ItemGridPlatformEntity itemGridPlatformEntity = new ItemGridPlatformEntity(); @@ -1072,7 +1130,7 @@ public class ItemServiceImpl extends BaseServiceImpl implem // 获取已上报网格平台未结案的项目 List gridPlatformDTOList = itemGridPlatformService.listOfGridPlatformItemNotEnd(); // 拉取处理情况 - for (ItemGridPlatformDTO dto: + for (ItemGridPlatformDTO dto : gridPlatformDTOList) { SearchCaseProcessByTaskIdDto searchResultDot = shiBeiCityGridApi.searchCaseProcessByTaskId(dto.getTaskid()); String successFlag = YesOrNoEnum.NO.value(); @@ -1106,11 +1164,10 @@ public class ItemServiceImpl extends BaseServiceImpl implem } /** - * * 删除历史网格化平台处理记录 * - * @params [id] * @return void + * @params [id] * @author liuchuang * @since 2019/12/25 19:08 */ @@ -1126,18 +1183,17 @@ public class ItemServiceImpl extends BaseServiceImpl implem } /** - * * 保存新的网格化平台处理记录 * - * @params [progressList] * @return void + * @params [progressList] * @author liuchuang * @since 2019/12/25 19:27 */ private void insertNewHandleProcess(List progressList, String itemId, String itemGridPlatformId) { try { - for (SearchCaseProcessByTaskIdItemDto dto: + for (SearchCaseProcessByTaskIdItemDto dto : progressList) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); Date insertTime = sdf.parse(dto.getInserttime()); diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rolecategory/controller/HandleRoleCategoryController.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rolecategory/controller/HandleRoleCategoryController.java new file mode 100644 index 000000000..23fb71355 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rolecategory/controller/HandleRoleCategoryController.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.rolecategory.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.rulecategory.HandleRoleCategoryDTO; +import com.elink.esua.epdc.dto.rulecategory.form.HandleRoleCategoryFormDTO; +import com.elink.esua.epdc.modules.rolecategory.excel.HandleRoleCategoryExcel; +import com.elink.esua.epdc.modules.rolecategory.service.HandleRoleCategoryService; +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 qu@elink-cn.com + * @since v1.0.0 2019-12-20 + */ +@RestController +@RequestMapping("handlerolecategory") +public class HandleRoleCategoryController { + + @Autowired + private HandleRoleCategoryService handleRoleCategoryService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = handleRoleCategoryService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + HandleRoleCategoryDTO data = handleRoleCategoryService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody HandleRoleCategoryDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + handleRoleCategoryService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody HandleRoleCategoryDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + handleRoleCategoryService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + handleRoleCategoryService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = handleRoleCategoryService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, HandleRoleCategoryExcel.class); + } + + @PostMapping("saveOrUpdate") + public Result saveOrUpdate(@RequestBody HandleRoleCategoryFormDTO formDTO){ + return handleRoleCategoryService.saveOrUpdate(formDTO); + } + + @GetMapping("queryCategoryIdList/{roleId}") + public Result> queryCategoryIdList(@PathVariable("roleId") String roleId){ + return handleRoleCategoryService.listCategoryId(roleId); + } +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rolecategory/dao/HandleRoleCategoryDao.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rolecategory/dao/HandleRoleCategoryDao.java new file mode 100644 index 000000000..f199cccc8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rolecategory/dao/HandleRoleCategoryDao.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.rolecategory.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.rulecategory.result.HandleRoleCategoryPermissionDTO; +import com.elink.esua.epdc.modules.rolecategory.entity.HandleRoleCategoryEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 角色和处理类别关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-20 + */ +@Mapper +public interface HandleRoleCategoryDao extends BaseDao { + + /** + * @param roleId + * @return int + * @Author yinzuomei + * @Description 根据角色id删除角色对应处理类别权限记录 + * @Date 2019/12/26 15:16 + **/ + int deleteByRoleId(Long roleId); + + /** + * @param roleId + * @return java.util.List + * @Author yinzuomei + * @Description 根据角色id查询当前角色对应处理类别权限 + * @Date 2019/12/26 15:16 + **/ + List selectListCategoryId(String roleId); + + /** + * @param roleId + * @return java.util.List + * @Author yinzuomei + * @Description 根据角色id查询角色对应处理类别权限,供下拉框使用 + * @Date 2019/12/26 15:16 + **/ + List listHandleRoleCategoryPermission(String roleId); +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rolecategory/entity/HandleRoleCategoryEntity.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rolecategory/entity/HandleRoleCategoryEntity.java new file mode 100644 index 000000000..95abed9c8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rolecategory/entity/HandleRoleCategoryEntity.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.rolecategory.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 qu@elink-cn.com + * @since v1.0.0 2019-12-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_handle_role_category") +public class HandleRoleCategoryEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 角色ID + */ + private String roleId; + + /** + * 处理类别ID + */ + private String categoryId; + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rolecategory/excel/HandleRoleCategoryExcel.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rolecategory/excel/HandleRoleCategoryExcel.java new file mode 100644 index 000000000..82a19ad9d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rolecategory/excel/HandleRoleCategoryExcel.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.rolecategory.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 角色和处理类别关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-20 + */ +@Data +public class HandleRoleCategoryExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "角色ID") + private String roleId; + + @Excel(name = "处理类别ID") + private String categoryId; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "删除标识 0:未删除,1:已删除") + private String delFlag; + + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rolecategory/redis/HandleRoleCategoryRedis.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rolecategory/redis/HandleRoleCategoryRedis.java new file mode 100644 index 000000000..02e19ac68 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rolecategory/redis/HandleRoleCategoryRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.rolecategory.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 角色和处理类别关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-20 + */ +@Component +public class HandleRoleCategoryRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rolecategory/service/HandleRoleCategoryService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rolecategory/service/HandleRoleCategoryService.java new file mode 100644 index 000000000..0c027bd48 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rolecategory/service/HandleRoleCategoryService.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.rolecategory.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.rulecategory.HandleRoleCategoryDTO; +import com.elink.esua.epdc.dto.rulecategory.form.HandleRoleCategoryFormDTO; +import com.elink.esua.epdc.dto.rulecategory.result.HandleRoleCategoryPermissionDTO; +import com.elink.esua.epdc.modules.rolecategory.entity.HandleRoleCategoryEntity; + +import java.util.List; +import java.util.Map; + +/** + * 角色和处理类别关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-20 + */ +public interface HandleRoleCategoryService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return HandleRoleCategoryDTO + * @author generator + * @date 2019-12-20 + */ + HandleRoleCategoryDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-20 + */ + void save(HandleRoleCategoryDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-20 + */ + void update(HandleRoleCategoryDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-20 + */ + void delete(String[] ids); + + /** + * @param formDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 保存或修改 角色和处理类别关系 + * @Date 2019/12/24 12:46 + **/ + Result saveOrUpdate(HandleRoleCategoryFormDTO formDTO); + + /** + * @param roleId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author yinzuomei + * @Description + * @Date 2019/12/24 16:11 + **/ + Result> listCategoryId(String roleId); + + /** + * @param roleId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 查询角色对应项目处理类别权限 供下拉框使用 + * @Date 2019/12/26 16:09 + **/ + Result> listHandleRoleCategoryPermission(String roleId); +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rolecategory/service/impl/HandleRoleCategoryServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rolecategory/service/impl/HandleRoleCategoryServiceImpl.java new file mode 100644 index 000000000..f8aff5633 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rolecategory/service/impl/HandleRoleCategoryServiceImpl.java @@ -0,0 +1,177 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.rolecategory.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.constant.FieldConstant; +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.utils.Result; +import com.elink.esua.epdc.dto.rulecategory.HandleRoleCategoryDTO; +import com.elink.esua.epdc.dto.rulecategory.form.HandleRoleCategoryFormDTO; +import com.elink.esua.epdc.dto.rulecategory.result.HandleRoleCategoryPermissionDTO; +import com.elink.esua.epdc.modules.rolecategory.dao.HandleRoleCategoryDao; +import com.elink.esua.epdc.modules.rolecategory.entity.HandleRoleCategoryEntity; +import com.elink.esua.epdc.modules.rolecategory.redis.HandleRoleCategoryRedis; +import com.elink.esua.epdc.modules.rolecategory.service.HandleRoleCategoryService; +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 qu qu@elink-cn.com + * @since v1.0.0 2019-12-20 + */ +@Service +public class HandleRoleCategoryServiceImpl extends BaseServiceImpl implements HandleRoleCategoryService { + + @Autowired + private HandleRoleCategoryRedis handleRoleCategoryRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, HandleRoleCategoryDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, HandleRoleCategoryDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public HandleRoleCategoryDTO get(String id) { + HandleRoleCategoryEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, HandleRoleCategoryDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(HandleRoleCategoryDTO dto) { + HandleRoleCategoryEntity entity = ConvertUtils.sourceToTarget(dto, HandleRoleCategoryEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(HandleRoleCategoryDTO dto) { + HandleRoleCategoryEntity entity = ConvertUtils.sourceToTarget(dto, HandleRoleCategoryEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param formDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 保存或修改 角色和处理类别关系 + * @Date 2019/12/24 12:39 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public Result saveOrUpdate(HandleRoleCategoryFormDTO formDTO) { + //先删除角色处理类别权限关系 + deleteByRoleId(formDTO.getRoleId()); + + //角色没有一个处理类别的情况 + if (CollUtil.isEmpty(formDTO.getCategoryIdList())) { + return new Result(); + } + + //保存角色和处理类别关系 + for (String categoryId : formDTO.getCategoryIdList()) { + HandleRoleCategoryEntity entity = new HandleRoleCategoryEntity(); + entity.setCategoryId(categoryId); + entity.setRoleId(formDTO.getRoleId().toString()); + //保存 + insert(entity); + } + + return new Result(); + } + + /** + * @param roleId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 角色管理-查询角色对应项目处理类别权限 + * @Date 2019/12/24 16:11 + **/ + @Override + public Result> listCategoryId(String roleId) { + List list=baseDao.selectListCategoryId(roleId); + return new Result>().ok(list); + } + + /** + * @param roleId 角色id + * @return void + * @Author yinzuomei + * @Description + * @Date 2019/12/24 12:44 + **/ + private void deleteByRoleId(Long roleId) { + baseDao.deleteByRoleId(roleId); + } + + /** + * @param roleId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 查询角色对应项目处理类别权限 供下拉框使用 + * @Date 2019/12/26 15:11 + **/ + @Override + public Result> listHandleRoleCategoryPermission(String roleId) { + if (StringUtils.isBlank(roleId)) { + return new Result>().error("角色id不能为空"); + } + List list = baseDao.listHandleRoleCategoryPermission(roleId); + return new Result>().ok(list); + } +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/application.yml index 353ba573d..156301297 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/application.yml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/application.yml @@ -3,104 +3,18 @@ server: servlet: context-path: /events +nacos: + config: + server-addr: @nacos.server-addr@ + type: YAML + namespace: @nacos.config.namespace@ + group: @nacos.config.group@ + dataId: epdc-events-server + bootstrap: + enable: true + log: + enable: @nacos.config.bootstrap.log.enable@ + spring: - main: - allow-bean-definition-overriding: true application: name: epdc-events-server - # 环境 dev|test|prod - profiles: - active: @spring.profiles.active@ - messages: - encoding: UTF-8 - basename: i18n/messages,i18n/messages_common - jackson: - time-zone: GMT+8 - date-format: yyyy-MM-dd HH:mm:ss - redis: - database: @spring.redis.index@ - host: @spring.redis.host@ - timeout: 30s - port: @spring.redis.port@ - password: @spring.redis.password@ - cloud: - nacos: - discovery: - server-addr: @nacos.server-addr@ - register-enabled: @nacos.register-enabled@ - alibaba: - seata: - tx-service-group: epdc-events-server-fescar-service-group - datasource: - druid: - driver-class-name: com.mysql.jdbc.Driver - url: @spring.datasource.druid.url@ - username: @spring.datasource.druid.username@ - password: @spring.datasource.druid.password@ - -feign: - hystrix: - enabled: true - httpclient: - enabled: true - -hystrix: - command: - default: - execution: - isolation: - thread: - timeoutInMilliseconds: 60000 #缺省为1000 - -ribbon: - ReadTimeout: 300000 - ConnectTimeout: 300000 - -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: ALWAYS - -mybatis-plus: - mapper-locations: classpath:/mapper/**/*.xml - #实体扫描,多个package用逗号或者分号分隔 - typeAliasesPackage: com.elink.esua.epdc.modules.*.entity - global-config: - #数据库相关配置 - db-config: - #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; - id-type: UUID - #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" - field-strategy: NOT_NULL - #驼峰下划线转换 - column-underline: true - banner: false - #原生配置 - configuration: - map-underscore-to-camel-case: true - cache-enabled: false - call-setters-on-nulls: true - jdbc-type-for-null: 'null' - -wx: - ma: - configs: - - appid: @wx.ma.appId@ - secret: @wx.ma.secret@ - token: #微信小程序消息服务器配置的token - aesKey: #微信小程序消息服务器配置的EncodingAESKey - msgDataFormat: JSON - - appid: @work.wx.ma.appId@ - secret: @work.wx.ma.secret@ - token: #微信小程序消息服务器配置的token - aesKey: #微信小程序消息服务器配置的EncodingAESKey - msgDataFormat: JSON - appId: - # 普通居民端的appId - normal: @wx.ma.appId@ - # 工作端的appId - work: @work.wx.ma.appId@ diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/category/CategoryDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/category/CategoryDao.xml index 2eaa42e63..59a2edc2b 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/category/CategoryDao.xml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/category/CategoryDao.xml @@ -62,7 +62,8 @@ creator, create_date, updater, - update_date) + update_date, + info_code) values (#{item.id}, @@ -76,7 +77,8 @@ #{item.creator}, #{item.createDate}, #{item.updater}, - #{item.updateDate}) + #{item.updateDate}, + #{item.infoCode}) diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/events/EpdcEventsDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/events/EpdcEventsDao.xml index a8c46c8ac..7a96898f5 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/events/EpdcEventsDao.xml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/events/EpdcEventsDao.xml @@ -58,59 +58,59 @@ @@ -318,5 +318,20 @@ LIMIT #{pageIndex},#{pageSize} + diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/handlecategory/HandleCategoryDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/handlecategory/HandleCategoryDao.xml new file mode 100644 index 000000000..bec0b4dde --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/handlecategory/HandleCategoryDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/handleroledept/HandleRoleDeptDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/handleroledept/HandleRoleDeptDao.xml new file mode 100644 index 000000000..f55c03255 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/handleroledept/HandleRoleDeptDao.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + delete from epdc_handle_role_dept where ROLE_ID=#{roleId} + + diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml index 82df755f8..74a921d9a 100755 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml @@ -890,4 +890,106 @@ AND d.ITEM_ID = #{itemId} + + + + + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/rolecategory/HandleRoleCategoryDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/rolecategory/HandleRoleCategoryDao.xml new file mode 100644 index 000000000..c34516428 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/rolecategory/HandleRoleCategoryDao.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + delete from epdc_handle_role_category where ROLE_ID = #{roleId} + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentFormDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentFormDTO.java index d968ed85f..10424dd8f 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentFormDTO.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentFormDTO.java @@ -45,4 +45,9 @@ public class TopicCommentFormDTO { */ private String userFace; + /** + * 党员标识 0:否,1:是 + */ + private String partyFlag; + } diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/pom.xml b/esua-epdc/epdc-module/epdc-group/epdc-group-server/pom.xml index fd32da726..d3e142221 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/pom.xml @@ -51,6 +51,10 @@ feign-httpclient 10.3.0 + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + @@ -74,10 +78,10 @@ true - - com.spotify - dockerfile-maven-plugin - + + + + ${project.basedir}/src/main/java @@ -107,77 +111,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + dev true - dev - 9063 - 2 - 47.104.224.45 - 6379 - elink@888 - - - - - epdc - elink833066 - - false 47.104.224.45:8848 + 513d6635-3cfe-401f-b8b6-a04417288f47 + EPDC_CONFIG_GROUP + true test - - test + + - 9063 + - 2 - 47.104.224.45 - 6379 - elink@888 + + + + - - - - epdc - elink833066 + + + + + + + + + + + 9063 - true 47.104.224.45:8848 + 6a3577b4-7b79-43f6-aebb-9c3f31263f6a + EPDC_CONFIG_GROUP + true prod - - prod - prod + + + - 9063 + - - 0 - 10.5.34.164 - 6379 - Elink@833066 + + + + + - - - - epdc - Elink@833066 - - true - 10.5.34.164:8848 + + + + + + + + + + + 9063 + + 47.104.224.45:8848 + 513d6635-3cfe-401f-b8b6-a04417288f47 + EPDC_GROUP + true diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/impl/TopicCommentServiceImpl.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/impl/TopicCommentServiceImpl.java index 5fd230415..2ca8e88bb 100755 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/impl/TopicCommentServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/impl/TopicCommentServiceImpl.java @@ -20,12 +20,11 @@ package com.elink.esua.epdc.modules.comment.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.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; -import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.dto.UserDTO; import com.elink.esua.epdc.dto.comment.*; import com.elink.esua.epdc.dto.constant.TopicNoticeConstant; import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; @@ -35,9 +34,7 @@ import com.elink.esua.epdc.dto.topic.form.TopicReviewFormDTO; import com.elink.esua.epdc.modules.async.NewsTask; import com.elink.esua.epdc.modules.comment.dao.TopicCommentDao; import com.elink.esua.epdc.modules.comment.entity.TopicCommentEntity; -import com.elink.esua.epdc.modules.comment.redis.TopicCommentRedis; import com.elink.esua.epdc.modules.comment.service.TopicCommentService; -import com.elink.esua.epdc.modules.feign.UserFeignClient; import com.elink.esua.epdc.modules.topic.service.TopicService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -63,8 +60,6 @@ public class TopicCommentServiceImpl extends BaseServiceImpl page(Map params) { @@ -127,12 +122,7 @@ public class TopicCommentServiceImpl extends BaseServiceImpl userDTOResult=userFeignClient.getUserInfoById(commentFormDTO.getUserId()); - if(!userDTOResult.success()){ - return new Result().error("获取用户信息失败"); - } - commentEntity.setPartyFlag(userDTOResult.getData().getPartyFlag()); - + commentEntity.setPartyFlag(commentFormDTO.getPartyFlag()); boolean isComment = true; // 评论类型 0-评论 diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/application.yml index ebf9e2d72..86ffa81f9 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/application.yml +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/application.yml @@ -3,85 +3,18 @@ server: servlet: context-path: /group +nacos: + config: + server-addr: @nacos.server-addr@ + type: YAML + namespace: @nacos.config.namespace@ + group: @nacos.config.group@ + dataId: epdc-group-server + bootstrap: + enable: true + log: + enable: @nacos.config.bootstrap.log.enable@ + spring: - main: - allow-bean-definition-overriding: true application: name: epdc-group-server - # 环境 dev|test|prod - profiles: - active: @spring.profiles.active@ - messages: - encoding: UTF-8 - basename: i18n/messages,i18n/messages_common - jackson: - time-zone: GMT+8 - date-format: yyyy-MM-dd HH:mm:ss - redis: - database: @spring.redis.index@ - host: @spring.redis.host@ - timeout: 30s - port: @spring.redis.port@ - password: @spring.redis.password@ - cloud: - nacos: - discovery: - server-addr: @nacos.server-addr@ - register-enabled: @nacos.register-enabled@ - alibaba: - seata: - tx-service-group: epdc-group-server-fescar-service-group - datasource: - druid: - driver-class-name: com.mysql.jdbc.Driver - url: @spring.datasource.druid.url@ - username: @spring.datasource.druid.username@ - password: @spring.datasource.druid.password@ - -feign: - hystrix: - enabled: true - httpclient: - enabled: true - -hystrix: - command: - default: - execution: - isolation: - thread: - timeoutInMilliseconds: 60000 #缺省为1000 - -ribbon: - ReadTimeout: 300000 - ConnectTimeout: 300000 - -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: ALWAYS - -mybatis-plus: - mapper-locations: classpath:/mapper/**/*.xml - #实体扫描,多个package用逗号或者分号分隔 - typeAliasesPackage: com.elink.esua.epdc.modules.*.entity - global-config: - #数据库相关配置 - db-config: - #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; - id-type: UUID - #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" - field-strategy: NOT_NULL - #驼峰下划线转换 - column-underline: true - banner: false - #原生配置 - configuration: - map-underscore-to-camel-case: true - cache-enabled: false - call-setters-on-nulls: true - jdbc-type-for-null: 'null' diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/pom.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/pom.xml index 43a03bffa..c7d3f1614 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/pom.xml +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/pom.xml @@ -18,6 +18,13 @@ epdc-demo-client 1.0.0 + + com.esua.epdc + epdc-user-client + 1.0.0 + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActBannerDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActBannerDTO.java new file mode 100644 index 000000000..fd850265a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActBannerDTO.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 爱心互助活动banner 爱心互助活动banner + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Data +public class ActBannerDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 活动ID + */ + private String actId; + + /** + * 标题 + */ + private String title; + + /** + * banner图片 + */ + private String bannerImg; + + /** + * banner类型 0-活动,1-连接 + */ + private String bannerType; + + /** + * 连接地址 + */ + private String url; + + /** + * 上下架状态 0-下架,1-上架 + */ + private String status; + + /** + * 上下架时间 + */ + private Date statusTime; + + /** + * banner位置 0-顶部 + */ + private String bannerPosition; + /** + * 默认状态 + */ + private String actUserDefaultState; + + /** + * 浏览数量 + */ + private Integer browseNum; + + /** + * 创建部门ID + */ + private Long deptId; + + /** + * 创建时间 + */ + private Date createdTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActClockListDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActClockListDTO.java new file mode 100644 index 000000000..3ef9e0844 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActClockListDTO.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 用户打卡列表 + * + * @author wanggongfeng + * @since v1.0.0 2019-12-17 + */ +@Data +public class ActClockListDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 打卡日志表主键ID + */ + private String id; + /** + * 用户姓名 + */ + private String nickname; + /** + * 头像 + */ + private String faceImg; + /** + * 党员标志 + */ + private String partyFlag; + /** + * 打卡时间 + */ + private Date clockTime; + /** + * 打卡描述 + */ + private String clockDesc; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActClockPicDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActClockPicDTO.java new file mode 100644 index 000000000..d91b37500 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActClockPicDTO.java @@ -0,0 +1,77 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 活动打卡图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-18 + */ +@Data +public class ActClockPicDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 打卡ID + */ + private String clockId; + + /** + * 图片地址 + */ + private String clockPic; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActInfoDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActInfoDTO.java new file mode 100644 index 000000000..379cdcf7d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActInfoDTO.java @@ -0,0 +1,219 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class ActInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 标题 + */ + private String title; + + /** + * 活动头图 + */ + private String headPic; + + /** + * 报名开始时间 + */ + private Date signupStartTime; + + /** + * 报名截止时间 + */ + private Date signupEndTime; + + /** + * 活动开始时间 + */ + private Date actStartTime; + + /** + * 打卡开始时间 + */ + private Date signinStartTime; + + /** + * 打卡截止时间 + */ + private Date signinEndTime; + + + + /** + * 活动结束时间 + */ + private Date actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动位置经度 + */ + private BigDecimal actLongitude; + + /** + * 活动位置纬度 + */ + private BigDecimal actLatitude; + + /** + *活动报名默认状态 + */ + private String actUserDefaultState; + + + /** + * 活动签到打卡地点 + */ + private String signinAddress; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal signinLongitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal signinLatitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer clockRadius; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 已报名人数 + */ + private Integer signupNum; + + /** + * 活动打卡人数 + */ + private Integer clockNum; + + /** + * 活动分享数 + */ + private Integer actShareNum; + + /** + * 活动浏览数 + */ + private Integer actBrowseNum; + + /** + * 联系人 + */ + private String contacts; + + /** + * 联系电话 + */ + private String tel; + + /** + * 招募要求 + */ + private String requirement; + + /** + * 活动内容 + */ + private String actContent; + + /** + * 活动发布状态(0-下架,1上架) + */ + private String actStatus; + + /** + * 活动发布时间 + */ + private Date publishTime; + + /** + * 活动主办方 + */ + private String sponsor; + + /** + * 创建部门ID + */ + private Long deptId; + + /** + * 活动惩罚积分 + */ + private Integer punishmentPoints; + + /** + * 活动奖励积分 + */ + private Integer reward; + + /** + * 活动名额类型 + */ + private Integer actQuotaCategory; + /** + * 活动下架原因 + */ + private String cancelReason; + + /** + * 是否展示banner + */ + private String isBanner; + /** + * banner地址 + */ + private String bannerUrl; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserClockLogDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserClockLogDTO.java new file mode 100644 index 000000000..9551fad19 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserClockLogDTO.java @@ -0,0 +1,107 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 用户打卡日志表 用户打卡日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-17 + */ +@Data +public class ActUserClockLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 用户活动关系表ID + */ + private String actUserId; + + /** + * 打卡类型(0-打卡,1-更新打卡) + */ + private String clockType; + + /** + * 打卡时间 + */ + private Date clockTime; + + /** + * 打卡位置经度 + */ + private BigDecimal clockLongitude; + + /** + * 打卡位置纬度 + */ + private BigDecimal clockLatitude; + + /** + * 打卡地址 + */ + private String clockAddress; + + /** + * 打卡描述 + */ + private String clockDesc; + + /** + * 打卡是否有效(0-否,1-是) + */ + private String effectiveFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserLogDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserLogDTO.java new file mode 100644 index 000000000..fcfad239b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserLogDTO.java @@ -0,0 +1,92 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 用户活动日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Data +public class ActUserLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 活动ID + */ + private String actId; + + /** + * 用户ID + */ + private String userId; + + /** + * 操作类别(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过) + */ + private String operationType; + + /** + * 审核不通过的原因 + */ + private String failureReason; + + /** + * 操作时间 + */ + private Date operationTime; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserPointsLogDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserPointsLogDTO.java new file mode 100644 index 000000000..2b29726db --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserPointsLogDTO.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-21 + */ +@Data +public class ActUserPointsLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 用户活动关系表ID + */ + private String actUserId; + + /** + * 操作类型 0-系统确认积分,2-管理员确认积分,4-取消报名扣减积分,6-管理员扣减积分,8-拒绝积分 + */ + private String operationType; + + /** + * 操作积分类型 0-减积分,1-加积分 + */ + private String operationPointsType; + + /** + * 操作积分值 + */ + private Integer points; + + /** + * 处理原因 + */ + private String operationReason; + + /** + * 删除标识 0-否,1-是 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserRelationDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserRelationDTO.java new file mode 100644 index 000000000..e365873d9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserRelationDTO.java @@ -0,0 +1,137 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 用户活动关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Data +public class ActUserRelationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 活动ID + */ + private String actId; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户昵称 + */ + private String nickname; + + /** + * 用户头像 + */ + private String faceImg; + + /** + * 党员标识(0-否,1-是) + */ + private String partyFlag; + + /** + * 报名人真实姓名 + */ + private String realName; + + /** + * 性别(0-女,1-男) + */ + private String sex; + + /** + * 年龄 + */ + private Integer age; + + /** + * 联系电话 + */ + private String mobile; + + /** + * 身份证号 + */ + private String identityNo; + + /** + * 当前状态(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过) + */ + private String status; + + /** + * 未通过原因(仅当未通过时录入,并读取) + */ + private String failureReason; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 报名时间 + */ + private Date signupTime; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppActUserCancelsignupDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppActUserCancelsignupDTO.java new file mode 100644 index 000000000..15dc4938c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppActUserCancelsignupDTO.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 取消报名参数 + * + * @author wanggongfeng + * @since v1.0.0 2019-12-17 + */ +@Data +public class AppActUserCancelsignupDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private String userId; + /** + * 活动ID + */ + private String actId; + /** + * 取消报名原因 + */ + private String failureReason; +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppActUserClockLogDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppActUserClockLogDTO.java new file mode 100644 index 000000000..3b4471a36 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppActUserClockLogDTO.java @@ -0,0 +1,74 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; + +/** + * 用户打卡参数 + * + * @author wanggongfeng + * @since v1.0.0 2019-12-17 + */ +@Data +public class AppActUserClockLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private String userId; + /** + * 活动ID + */ + private String actId; + /** + * 打卡描述 + */ + private String clockDesc; + /** + * 打卡位置经度 + */ + private BigDecimal clockLongitude; + /** + * 打卡位置纬度 + */ + private BigDecimal clockLatitude; + /** + * 打卡地址 + */ + private String clockAddress; + /** + * 打卡图片 + */ + private ArrayList images; + /** + * 打卡类型(0-打卡,1-更新打卡) + */ + private String clockType; + /** + * 打卡是否有效(0-否,1-是) + */ + private String effectiveFlag; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppClockListDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppClockListDTO.java new file mode 100644 index 000000000..1ad95cf1e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppClockListDTO.java @@ -0,0 +1,46 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 用户打卡列表 + * + * @author wanggongfeng + * @since v1.0.0 2019-12-17 + */ +@Data +public class AppClockListDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 活动打卡人次 + */ + private int clockNum; + + /** + * 打卡列表 + */ + private List clocks; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActInfoAppFormDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActInfoAppFormDTO.java new file mode 100644 index 000000000..96221eaab --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActInfoAppFormDTO.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class ActInfoAppFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 页码,从1开始 + */ + @Min(value = 1, message = "页码必须大于0") + private int pageIndex; + + private String userId; + + private String id; + /** + * 页容量,默认20页 + */ + @Min(value = 1, message = "每页条数必须大于必须大于0") + private int pageSize = 20; + /** + * 第一页查询发起时的时间 + */ + @NotBlank(message = "时间戳不能为空") + private String timestamp; + + /** + * 活动列表类型 + */ + @NotBlank(message = "类型不能为空") + private String actType; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActInfoFormDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActInfoFormDTO.java new file mode 100644 index 000000000..32f90f099 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActInfoFormDTO.java @@ -0,0 +1,210 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class ActInfoFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @NotBlank(message = "id不能为空") + private String id; + + /** + * 标题 + */ + private String title; + + /** + * 活动头图 + */ + private String headPic; + + /** + * 报名开始时间 + */ + private Date signupStartTime; + + /** + * 报名截止时间 + */ + private Date signupEndTime; + + /** + * 活动开始时间 + */ + private Date actStartTime; + /** + *活动报名默认状态 + */ + private String actUserDefaultState; + + /** + * 活动结束时间 + */ + private Date actEndTime; + /** + * 打卡开始时间 + */ + private Date signinStartTime; + + /** + * 打卡截止时间 + */ + private Date signinEndTime; + + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动位置经度 + */ + private BigDecimal actLongitude; + + /** + * 活动位置纬度 + */ + private BigDecimal actLatitude; + + /** + * 活动签到打卡地点 + */ + private String signinAddress; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal signinLongitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal signinLatitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer clockRadius; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 已报名人数 + */ + private Integer signupNum; + + /** + * 活动打卡人数 + */ + private Integer clockNum; + + /** + * 活动分享数 + */ + private Integer actShareNum; + + /** + * 活动浏览数 + */ + private Integer actBrowseNum; + + /** + * 联系人 + */ + private String contacts; + + /** + * 联系电话 + */ + private String tel; + + /** + * 招募要求 + */ + private String requirement; + + /** + * 活动内容 + */ + private String actContent; + + /** + * 活动发布状态(0-下架,1上架) + */ + private String actStatus; + + /** + * 活动发布时间 + */ + private Date publishTime; + + /** + * 活动主办方 + */ + private String sponsor; + + /** + * 创建部门ID + */ + private Long deptId; + + /** + * 活动惩罚积分 + */ + private Integer punishmentPoints; + + /** + * 活动奖励积分 + */ + private Integer reward; + + /** + * 活动名额类型 + */ + private Integer actQuotaCategory; + + /** + * 活动下架原因 + */ + @NotBlank(message = "下架原因不能为空") + private String cancelReason; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActPointCheckFormDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActPointCheckFormDTO.java new file mode 100644 index 000000000..3975c7781 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActPointCheckFormDTO.java @@ -0,0 +1,59 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class ActPointCheckFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @NotBlank(message = "id不能为空") + private String id; + /** + * 活动 + */ + private String actId; + + /** + * 状态 + */ + @NotBlank(message = "状态不能为空") + private String status; + /** + * 未通过原因(仅当未通过时录入,并读取) + */ + @NotBlank(message = "原因不能为空") + private String failureReason; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActUserRelationAuditFormDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActUserRelationAuditFormDTO.java new file mode 100644 index 000000000..190b1becc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActUserRelationAuditFormDTO.java @@ -0,0 +1,116 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + + +/** + * 用户活动关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Data +public class ActUserRelationAuditFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @NotBlank(message = "id不能为空") + private String id; + + /** + * 活动ID + */ + private String actId; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户昵称 + */ + private String nickname; + + /** + * 用户头像 + */ + private String faceImg; + + /** + * 党员标识(0-否,1-是) + */ + private String partyFlag; + + /** + * 报名人真实姓名 + */ + private String realName; + + /** + * 性别(0-女,1-男) + */ + private String sex; + + /** + * 年龄 + */ + private Integer age; + + /** + * 联系电话 + */ + private String mobile; + + /** + * 身份证号 + */ + private String identityNo; + + /** + * 当前状态(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过) + */ + private String status; + + /** + * 未通过原因(仅当未通过时录入,并读取) + */ + @NotBlank(message = "原因不能为空") + private String failureReason; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 报名时间 + */ + private Date signupTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoAppResultDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoAppResultDTO.java new file mode 100644 index 000000000..9ade34503 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoAppResultDTO.java @@ -0,0 +1,108 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class ActInfoAppResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 标题 + */ + private String title; + + + + /** + * 活动开始时间 + */ + private Date actStartTime; + + private String headPic; + + /** + * 活动结束时间 + */ + private Date actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 已报名人数 + */ + private Integer signupNum; + + /** + * 活动打卡人数 + */ + private Integer clockNum; + /** + *活动报名默认状态 + */ + private String actUserDefaultState; + /** + * 活动当前状态(0-报名中,1-已报满,2-未开始,3-进行中,4-已结束) + */ + private String actCurrentState; + + /** + * 用户报名状态(0-未报名,1已报名) + */ + private String signupFlag; + + /** + * 用户打卡状态(0-未打卡,1-已打卡) + */ + private String clockFlag; + /** + * 活动用户关联表ID + */ + private String actUserId; + + private String actQuotaCategory; + + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoClockResultDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoClockResultDTO.java new file mode 100644 index 000000000..e670cb27f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoClockResultDTO.java @@ -0,0 +1,75 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class ActInfoClockResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + /** + * 活动 + */ + private String actId; + + /** + * 活动签到打卡地点 + */ + private String address; + + /** + * 状态 + */ + private String status; + /** + * 原因 + */ + private String failureReason; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal longitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal latitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer radius; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoDetailAppResultDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoDetailAppResultDTO.java new file mode 100644 index 000000000..b8ab56bb9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoDetailAppResultDTO.java @@ -0,0 +1,219 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class ActInfoDetailAppResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 标题 + */ + private String title; + + /** + * 活动头图 + */ + private String headPic; + + /** + * 报名开始时间 + */ + private Date signupStartTime; + /** + *活动报名默认状态 + */ + private String actUserDefaultState; + + /** + * 报名截止时间 + */ + private Date signupEndTime; + + /** + * 活动开始时间 + */ + private Date actStartTime; + + /** + * 活动结束时间 + */ + private Date actEndTime; + + /** + * 打卡开始时间 + */ + private Date signinStartTime; + + /** + * 打卡截止时间 + */ + private Date signinEndTime; + + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动位置经度 + */ + private BigDecimal actLongitude; + + /** + * 活动位置纬度 + */ + private BigDecimal actLatitude; + + /** + * 活动签到打卡地点 + */ + private String signinAddress; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal signinLongitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal signinLatitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer clockRadius; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 已报名人数 + */ + private Integer signupNum; + + /** + * 活动打卡人数 + */ + private Integer clockNum; + + /** + * 活动分享数 + */ + private Integer actShareNum; + + /** + * 活动浏览数 + */ + private Integer actBrowseNum; + + /** + * 联系人 + */ + private String contacts; + + /** + * 联系电话 + */ + private String tel; + + /** + * 招募要求 + */ + private String requirement; + + /** + * 活动内容 + */ + private String actContent; + + /** + * 活动发布状态(0-下架,1上架) + */ + private String actStatus; + + /** + * 活动发布时间 + */ + private Date publishTime; + + /** + * 活动主办方 + */ + private String sponsor; + + /** + * 创建部门ID + */ + private Long deptId; + + /** + * 活动惩罚积分 + */ + private Integer punishmentPoints; + + /** + * 活动奖励积分 + */ + private Integer reward; + + /** + * 活动名额类型 + */ + private Integer actQuotaCategory; + + /** + * 活动下架原因 + */ + private String cancelReason; + + private String failureReason; + + /** + * 用户当前状态(0-我要报名,1-取消报名,2-已报满,3-未开始,4-我要打卡,5-更新打卡,6-已结束,7-已取消) + */ + private String currentUserStatus; + /** + * 用户认证志愿者标识(0-未认证,1-已认证) + */ + private String userVolunteerFlag; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoResultDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoResultDTO.java new file mode 100644 index 000000000..8623a50b6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoResultDTO.java @@ -0,0 +1,208 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class ActInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 标题 + */ + private String title; + + /** + * 活动头图 + */ + private String headPic; + + /** + * 报名开始时间 + */ + private Date signupStartTime; + /** + *活动报名默认状态 + */ + private String actUserDefaultState; + + /** + * 报名截止时间 + */ + private Date signupEndTime; + + /** + * 活动开始时间 + */ + private Date actStartTime; + + /** + * 活动结束时间 + */ + private Date actEndTime; + + /** + * 打卡开始时间 + */ + private Date signinStartTime; + + /** + * 打卡截止时间 + */ + private Date signinEndTime; + + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动位置经度 + */ + private BigDecimal actLongitude; + + /** + * 活动位置纬度 + */ + private BigDecimal actLatitude; + + /** + * 活动签到打卡地点 + */ + private String signinAddress; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal signinLongitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal signinLatitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer clockRadius; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 已报名人数 + */ + private Integer signupNum; + + /** + * 活动打卡人数 + */ + private Integer clockNum; + + /** + * 活动分享数 + */ + private Integer actShareNum; + + /** + * 活动浏览数 + */ + private Integer actBrowseNum; + + /** + * 联系人 + */ + private String contacts; + + /** + * 联系电话 + */ + private String tel; + + /** + * 招募要求 + */ + private String requirement; + + /** + * 活动内容 + */ + private String actContent; + + /** + * 活动发布状态(0-下架,1上架) + */ + private String actStatus; + + /** + * 活动发布时间 + */ + private Date publishTime; + + /** + * 活动主办方 + */ + private String sponsor; + + /** + * 创建部门ID + */ + private Long deptId; + + /** + * 活动惩罚积分 + */ + private Integer punishmentPoints; + + /** + * 活动奖励积分 + */ + private Integer reward; + + /** + * 活动名额类型 + */ + private Integer actQuotaCategory; + + /** + * 活动下架原因 + */ + private String cancelReason; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserClockLogResultDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserClockLogResultDTO.java new file mode 100644 index 000000000..98176f314 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserClockLogResultDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 用户打卡日志表 用户打卡日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-17 + */ +@Data +public class ActUserClockLogResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + /** + * 打卡时间 + */ + private Date clockTime; + + /** + * 打卡位置经度 + */ + private BigDecimal clockLongitude; + + /** + * 打卡位置纬度 + */ + private BigDecimal clockLatitude; + + /** + * 打卡地址 + */ + private String clockAddress; + + /** + * 打卡描述 + */ + private String clockDesc; + + /** + * 报名人真实姓名 + */ + private String realName; + + /** + * 性别(0-女,1-男) + */ + private String sex; + + /** + * 年龄 + */ + private Integer age; + + /** + * 联系电话 + */ + private String mobile; + /** + * 联系电话 + */ + private String clockPic; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserClockResultDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserClockResultDTO.java new file mode 100644 index 000000000..474db6acc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserClockResultDTO.java @@ -0,0 +1,131 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 用户活动关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Data +public class ActUserClockResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 活动ID + */ + private String actId; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户昵称 + */ + private String nickname; + + /** + * 用户头像 + */ + private String faceImg; + + /** + * 党员标识(0-否,1-是) + */ + private String partyFlag; + + /** + * 报名人真实姓名 + */ + private String realName; + + /** + * 性别(0-女,1-男) + */ + private String sex; + + /** + * 年龄 + */ + private Integer age; + + /** + * 联系电话 + */ + private String mobile; + /** + * 打卡地点 + */ + private String clockAddress; + + /** + * 打卡次数 + */ + private String clockCount; + + /** + * 是否发放积分 + */ + private String checkPoint; + /** + * 是否发放积分 + */ + private String point; + + /** + * 身份证号 + */ + private String identityNo; + + /** + * 当前状态(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过) + */ + private String status; + + /** + * 未通过原因(仅当未通过时录入,并读取) + */ + private String failureReason; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 报名时间 + */ + private Date signupTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserRelationResultDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserRelationResultDTO.java new file mode 100644 index 000000000..e6b54b0c4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserRelationResultDTO.java @@ -0,0 +1,113 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 用户活动关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Data +public class ActUserRelationResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 活动ID + */ + private String actId; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户昵称 + */ + private String nickname; + + /** + * 用户头像 + */ + private String faceImg; + + /** + * 党员标识(0-否,1-是) + */ + private String partyFlag; + + /** + * 报名人真实姓名 + */ + private String realName; + + /** + * 性别(0-女,1-男) + */ + private String sex; + + /** + * 年龄 + */ + private Integer age; + + /** + * 联系电话 + */ + private String mobile; + + /** + * 身份证号 + */ + private String identityNo; + + /** + * 当前状态(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过) + */ + private String status; + + /** + * 未通过原因(仅当未通过时录入,并读取) + */ + private String failureReason; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 报名时间 + */ + private Date signupTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/AppActInfoDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/AppActInfoDTO.java new file mode 100644 index 000000000..735ce1227 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/AppActInfoDTO.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class AppActInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + /** + * 活动签到打卡地点 + */ + private String signinAddress; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal signinLongitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal signinLatitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer clockRadius; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/ActStateConstant.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/ActStateConstant.java new file mode 100644 index 000000000..a5a06e49f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/ActStateConstant.java @@ -0,0 +1,87 @@ +package com.elink.esua.epdc.constant; + +public interface ActStateConstant { + /** + * 活动状态-上架 + */ + String ACT_INFO_STATUS_GROUNDING = "1"; + /** + * 活动状态-下架 + */ + String ACT_INFO_STATUS_UNDERCARRIAGE = "0"; + + /** + * 活动BANNER状态-上架 + */ + String ACT_BANNER_STATUS_GROUNDING = "1"; + /** + * 活动BANNER状态-下架 + */ + String ACT_BANNER_STATUS_UNDERCARRIAGE = "0"; + + /** + * 活动报名状态-报名 + */ + String ACT_USER_RELATION_STATUS_APPLY = "0"; + /** + * 活动报名状态-通过 + */ + String ACT_USER_RELATION_STATUS_AUDITPASS = "1"; + + /** + * 活动报名状态-打卡 + */ + String ACT_USER_RELATION_STATUS_CLOCK = "2"; + + /** + * 活动报名状态-取消 + */ + String ACT_USER_RELATION_STATUS_CANCEL = "3"; + /** + * 活动报名状态-审核驳回 + */ + String ACT_USER_RELATION_STATUS_AUDITREJECT = "4"; + + /** + * 活动报名状态-确认积分 + */ + String ACT_USER_RELATION_STATUS_POINTPASS = "5"; + + /** + * 活动报名状态-拒绝积分 + */ + String ACT_USER_RELATION_STATUS_POINTREJECT = "6"; + + /** + * 积分操作类型-系统通过 + */ + String POINT_OPERATION_TYPE_SYSTEMPASS = "0"; + + /** + * 积分操作类型-管理员通过 + */ + String POINT_OPERATION_TYPE_ADMINPASS = "1"; + /** + * 积分操作类型-取消扣除 + */ + String POINT_OPERATION_TYPE_CANCELDEDUCT = "4"; + /** + * 积分操作类型-管理员扣除 + */ + String POINT_OPERATION_TYPE_ADMINDEDUCT = "6"; + /** + * 积分操作类型-管理员拒绝 + */ + String POINT_OPERATION_TYPE_ADMINREJECT = "8"; + /** + * 积分类型-增加 + */ + String OPERATION_POINTS_TYPE_ADD = "1"; + /** + * 积分类型-扣除 + */ + String OPERATION_POINTS_TYPE_DEDUCT = "0"; + + +} + diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/phrases/ActPhraseDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/phrases/ActPhraseDTO.java new file mode 100644 index 000000000..cb1143675 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/phrases/ActPhraseDTO.java @@ -0,0 +1,92 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.phrases; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 常用语表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class ActPhraseDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 常用语 + */ + private String phrase; + + /** + * 显示顺序 + */ + private Integer sort; + + /** + * 是否显示(0-否,1-是) + */ + private String showFlag; + + /** + * 使用次数 0 + */ + private Integer usageNum; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * code + */ + private String code; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/EpdcVolunteerRankDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/EpdcVolunteerRankDTO.java new file mode 100644 index 000000000..c847ccd62 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/EpdcVolunteerRankDTO.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.volunteer; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 志愿者排名 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-18 + */ +@Data +public class EpdcVolunteerRankDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 排名 + */ + private Integer sort; + + /** + * 头像 + */ + private String faceImg; + + /** + * 用户名 + */ + private String nickname; + + /** + * 是否党员(0-否,1-是) + */ + private String partyFlag; + + /** + * 爱心时长(单位:小时) + */ + private BigDecimal kindnessTime; + + /** + * 参加次数 + */ + private Integer participationNum; + + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/VolunteerRankDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/VolunteerRankDTO.java new file mode 100644 index 000000000..ca09f0839 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/VolunteerRankDTO.java @@ -0,0 +1,122 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.volunteer; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 志愿者排名 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Data +public class VolunteerRankDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 排名 + */ + private Integer sort; + + /** + * 志愿者ID + */ + private String volunteerId; + + /** + * 用户ID + */ + private String userId; + + /** + * 头像 + */ + private String faceImg; + + /** + * 用户名 + */ + private String nickname; + + /** + * 是否党员(0-否,1-是) + */ + private String partyFlag; + + /** + * 爱心时长(单位:小时) + */ + private BigDecimal kindnessTime; + + /** + * 参加次数 + */ + private Integer participationNum; + + /** + * 排行生成日期 + */ + private Date generateDate; + + /** + * 是否显示(0-不显示,1-显示) + */ + private String showFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标志 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/Dockerfile b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/Dockerfile new file mode 100755 index 000000000..d9a1f64c6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/Dockerfile @@ -0,0 +1,20 @@ +# 基础镜像 +FROM adoptopenjdk/openjdk11 +# 作者 +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} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml index 5d379be3b..08778c049 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml @@ -50,6 +50,28 @@ org.springframework.cloud spring-cloud-starter-zipkin + + com.esua.epdc + epdc-points-client + 1.0.0 + compile + + + com.esua.epdc + epdc-job-client + 1.0.0 + compile + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + com.esua.epdc + epdc-common-clienttoken + 1.0.0 + compile + @@ -78,6 +100,30 @@ dockerfile-maven-plugin + + ${project.basedir}/src/main/java + + + + true + ${basedir}/src/main/resources + + **/application*.yml + **/*.properties + logback-spring.xml + registry.conf + + + + ${basedir}/src/main/resources + + **/application*.yml + **/*.properties + logback-spring.xml + registry.conf + + + @@ -87,10 +133,10 @@ true - + + + 9072 + 47.104.224.45:8848 + 513d6635-3cfe-401f-b8b6-a04417288f47 + EPDC_CONFIG_GROUP + true test - + + + 9072 + 47.104.224.45:8848 + 6a3577b4-7b79-43f6-aebb-9c3f31263f6a + EPDC_CONFIG_GROUP + true @@ -140,7 +200,7 @@ prod - 9060 + 9072 2 47.104.224.45 @@ -148,7 +208,7 @@ elink@888 - + epdc elink888 @@ -165,7 +225,7 @@ prod - 9060 + 9072 0 diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/controller/DemoController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/controller/DemoController.java deleted file mode 100644 index 48e87c871..000000000 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/controller/DemoController.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.elink.esua.epdc.controller; - -import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.dto.DemoDto; -import com.elink.esua.epdc.feign.DemoFeignClient; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -/** - * - * @author yujintao - * @email yujintao@elink-cn.com - * @date 2019/8/23 10:59 - */ -@RestController -@RequestMapping("demo") -public class DemoController { - - - @Autowired - private DemoFeignClient demoFeignClient; - - - @GetMapping("listAll") - public Result> listDemo(){ - Result> listResult = demoFeignClient.listDemo(); - return listResult; - } -} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActBannerController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActBannerController.java new file mode 100644 index 000000000..19e430ff3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActBannerController.java @@ -0,0 +1,107 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.controller; + +import com.elink.esua.epdc.activity.ActBannerDTO; +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.modules.activity.excel.ActBannerExcel; +import com.elink.esua.epdc.modules.activity.service.ActBannerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * 爱心互助活动banner 爱心互助活动banner + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@RestController +@RequestMapping("actbanner") +public class ActBannerController { + + @Autowired + private ActBannerService actBannerService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = actBannerService.getActBannerPage(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ActBannerDTO data = actBannerService.get(id); + return new Result().ok(data); + } + @GetMapping("grounding/{id}") + public Result grounding(@PathVariable("id") String id){ + return actBannerService.grounding(id); + } + + @GetMapping("bannerlist") + public Result> getBannerList(){ + Map params =new HashMap(); + params.put("status","1"); + List data = actBannerService.list(params); + return new Result>().ok(data); + } + + @PostMapping + public Result save(@RequestBody ActBannerDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + actBannerService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ActBannerDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + actBannerService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + actBannerService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = actBannerService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ActBannerExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActClockPicController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActClockPicController.java new file mode 100644 index 000000000..a974d5968 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActClockPicController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.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.activity.ActClockPicDTO; +import com.elink.esua.epdc.modules.activity.excel.ActClockPicExcel; +import com.elink.esua.epdc.modules.activity.service.ActClockPicService; +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 qu@elink-cn.com + * @since v1.0.0 2019-12-18 + */ +@RestController +@RequestMapping("actclockpic") +public class ActClockPicController { + + @Autowired + private ActClockPicService actClockPicService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = actClockPicService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ActClockPicDTO data = actClockPicService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ActClockPicDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + actClockPicService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ActClockPicDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + actClockPicService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + actClockPicService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = actClockPicService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ActClockPicExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActInfoController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActInfoController.java new file mode 100644 index 000000000..49ef01a6b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActInfoController.java @@ -0,0 +1,125 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.controller; + +import com.elink.esua.epdc.activity.ActBannerDTO; +import com.elink.esua.epdc.activity.ActInfoDTO; +import com.elink.esua.epdc.activity.form.ActInfoFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoClockResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoResultDTO; +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.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.constant.ActStateConstant; +import com.elink.esua.epdc.dto.ScheduleJobDTO; +import com.elink.esua.epdc.modules.activity.excel.ActInfoExcel; +import com.elink.esua.epdc.modules.activity.service.ActBannerService; +import com.elink.esua.epdc.modules.activity.service.ActInfoService; +import com.elink.esua.epdc.modules.feign.JobFeignClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Map; + + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@RestController +@RequestMapping("actinfo") +public class ActInfoController { + + @Autowired + private ActInfoService actInfoService; + + + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + if(SecurityUser.getDeptId() != null){ + params.put("deptId", SecurityUser.getDeptId()); + } + System.out.println(params); + PageData page = actInfoService.getActInfoPageFromPC(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ActInfoDTO data = actInfoService.get(id); + return new Result().ok(data); + } + + + @PostMapping + @Transactional(rollbackFor=Exception.class) + public Result save(@RequestBody ActInfoDTO dto){ + //效验数据 + dto.setActStatus(ActStateConstant.ACT_INFO_STATUS_GROUNDING); + dto.setPublishTime(new Date()); + if(SecurityUser.getDeptId() != null){ + dto.setDeptId(SecurityUser.getDeptId()); + } + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return actInfoService.save(dto); + } + + @PutMapping + public Result update(@RequestBody ActInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + actInfoService.update(dto); + return new Result(); + } + @PostMapping("cancel") + public Result cancel(@RequestBody ActInfoFormDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + return actInfoService.cancel(dto); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + actInfoService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = actInfoService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ActInfoExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserClockLogController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserClockLogController.java new file mode 100644 index 000000000..98e078a22 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserClockLogController.java @@ -0,0 +1,122 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.controller; + +import com.elink.esua.epdc.activity.ActInfoDTO; +import com.elink.esua.epdc.activity.form.ActPointCheckFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoClockResultDTO; +import com.elink.esua.epdc.activity.result.ActUserClockLogResultDTO; +import com.elink.esua.epdc.activity.result.ActUserClockResultDTO; +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.activity.ActUserClockLogDTO; +import com.elink.esua.epdc.modules.activity.excel.ActUserClockLogExcel; +import com.elink.esua.epdc.modules.activity.service.ActUserClockLogService; +import com.elink.esua.epdc.modules.activity.service.ActUserRelationService; +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 qu@elink-cn.com + * @since v1.0.0 2019-12-17 + */ +@RestController +@RequestMapping("actuserclocklog") +public class ActUserClockLogController { + + @Autowired + private ActUserClockLogService actUserClockLogService; + + @Autowired + private ActUserRelationService actUserRelationService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = actUserClockLogService.getActUserClockLogFromPC(params); + System.out.println(page); + return new Result>().ok(page); + } + + @GetMapping("clockPage") + public Result> clockPage(@RequestParam Map params){ + PageData page = actUserRelationService.getActUserClockPageFromPC(params); + return new Result>().ok(page); + } + @GetMapping("clockDetail/{id}") + public Result clockDetail(@PathVariable("id") String id){ + ActInfoClockResultDTO data = actUserRelationService.getActDetail(id); + return new Result().ok(data); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ActUserClockLogDTO data = actUserClockLogService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ActUserClockLogDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + actUserClockLogService.save(dto); + return new Result(); + } + @PostMapping("pointCheck") + public Result pointCheck(@RequestBody ActPointCheckFormDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + actUserClockLogService.pointCheck(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ActUserClockLogDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + actUserClockLogService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + actUserClockLogService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = actUserClockLogService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ActUserClockLogExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserLogController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserLogController.java new file mode 100644 index 000000000..50b8188f2 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserLogController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.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.activity.ActUserLogDTO; +import com.elink.esua.epdc.modules.activity.excel.ActUserLogExcel; +import com.elink.esua.epdc.modules.activity.service.ActUserLogService; +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 qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@RestController +@RequestMapping("actuserlog") +public class ActUserLogController { + + @Autowired + private ActUserLogService actUserLogService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = actUserLogService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ActUserLogDTO data = actUserLogService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ActUserLogDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + actUserLogService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ActUserLogDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + actUserLogService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + actUserLogService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = actUserLogService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ActUserLogExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserPointsLogController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserPointsLogController.java new file mode 100644 index 000000000..3407156a9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserPointsLogController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.controller; + +import com.elink.esua.epdc.activity.ActUserPointsLogDTO; +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.modules.activity.excel.ActUserPointsLogExcel; +import com.elink.esua.epdc.modules.activity.service.ActUserPointsLogService; +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 qu@elink-cn.com + * @since v1.0.0 2019-12-21 + */ +@RestController +@RequestMapping("actuserpointslog") +public class ActUserPointsLogController { + + @Autowired + private ActUserPointsLogService actUserPointsLogService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = actUserPointsLogService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ActUserPointsLogDTO data = actUserPointsLogService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ActUserPointsLogDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + actUserPointsLogService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ActUserPointsLogDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + actUserPointsLogService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + actUserPointsLogService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = actUserPointsLogService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ActUserPointsLogExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserRelationController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserRelationController.java new file mode 100644 index 000000000..b71d136c4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserRelationController.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.controller; + +import com.elink.esua.epdc.activity.ActUserRelationDTO; +import com.elink.esua.epdc.activity.form.ActUserRelationAuditFormDTO; +import com.elink.esua.epdc.activity.result.ActUserRelationResultDTO; +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.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.modules.activity.excel.ActUserRelationExcel; +import com.elink.esua.epdc.modules.activity.service.ActUserRelationService; +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 qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@RestController +@RequestMapping("actuserrelation") +public class ActUserRelationController { + + @Autowired + private ActUserRelationService actUserRelationService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = actUserRelationService.getActUserRelationPageFromPC(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ActUserRelationDTO data = actUserRelationService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ActUserRelationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + actUserRelationService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ActUserRelationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + actUserRelationService.update(dto); + return new Result(); + } + @PostMapping("audit") + public Result audit(@RequestBody ActUserRelationAuditFormDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + return actUserRelationService.audit(dto); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + actUserRelationService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = actUserRelationService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ActUserRelationExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActInfoController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActInfoController.java new file mode 100644 index 000000000..9eeae53d4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActInfoController.java @@ -0,0 +1,120 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.controller; + +import com.elink.esua.epdc.activity.ActInfoDTO; +import com.elink.esua.epdc.activity.form.ActInfoAppFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoAppResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoDetailAppResultDTO; +import com.elink.esua.epdc.activity.result.AppActInfoDTO; +import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.annotation.LoginUser; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.modules.activity.service.ActInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@RestController +@RequestMapping("appactinfo") +public class AppActInfoController { + + @Autowired + private ActInfoService actInfoService; + + /** + * 获取活动打卡地点详情 + * @param actId + * @return + */ + @GetMapping("clockAddressDetail/{actId}") + public Result clockAddressDetail(@PathVariable("actId")String actId){ + ActInfoDTO actInfoDTO = actInfoService.get(actId); + AppActInfoDTO appActInfoDTO = ConvertUtils.sourceToTarget(actInfoDTO, AppActInfoDTO.class); + return new Result().ok(appActInfoDTO); + } + /** + * 活动列表--App端 + * @Params: [formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/11/19 16:46 + */ + @GetMapping("list") + public Result> listItems(@RequestBody ActInfoAppFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + return this.actInfoService.listItemsByApp(formDto); + } + /** + * 活动列表--App端 + * @Params: [formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/11/19 16:46 + */ + @GetMapping("signupList") + public Result> signupListItems(@RequestBody ActInfoAppFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + return this.actInfoService.signupListItemsByApp(formDto); + } + /** + * 项目详情--工作端 + * @Params: [id] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result + * @Author: lipengfei + * @Date: 2019/11/19 16:46 + */ + @GetMapping("detail") + public Result getDetail(@RequestBody ActInfoAppFormDTO formDto) { + return this.actInfoService.getDetailByApp(formDto); + } + + /** + * 项目详情--工作端 + * @Params: [id] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result + * @Author: lipengfei + * @Date: 2019/11/19 16:46 + */ + @GetMapping("rejectdetail") + public Result getRejectDetail(@RequestBody ActInfoAppFormDTO formDto) { + return this.actInfoService.getRejectDetailByApp(formDto); + } + /** + * 项目详情--工作端 + * @Params: [id] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result + * @Author: lipengfei + * @Date: 2019/11/19 16:46 + */ + @GetMapping("canceldetail/{id}") + public Result getCancelDetail(@PathVariable String id) { + return this.actInfoService.getCancelDetailByApp(id); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserClockLogController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserClockLogController.java new file mode 100644 index 000000000..909ab547a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserClockLogController.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.controller; + +import com.elink.esua.epdc.activity.AppActUserClockLogDTO; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.modules.activity.service.ActUserClockLogService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + + +/** + * App打卡操作 + * + * @author wanggongfeng + * @since v1.0.0 2019-12-17 + */ +@RestController +@RequestMapping("appactuserclocklog") +public class AppActUserClockLogController { + + @Autowired + private ActUserClockLogService actUserClockLogService; + + /** + * 活动打卡 + * @param appActUserClockLogDTO + * @return + */ + @GetMapping("activityClock") + public Result activityClock(@RequestBody AppActUserClockLogDTO appActUserClockLogDTO){ + //效验数据 + ValidatorUtils.validateEntity(appActUserClockLogDTO, UpdateGroup.class, DefaultGroup.class); + return actUserClockLogService.activityClock(appActUserClockLogDTO); + + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java new file mode 100644 index 000000000..3514e776d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java @@ -0,0 +1,82 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.controller; + +import com.elink.esua.epdc.activity.ActUserRelationDTO; +import com.elink.esua.epdc.activity.AppActUserCancelsignupDTO; +import com.elink.esua.epdc.activity.AppClockListDTO; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.modules.activity.service.ActUserRelationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * 用户活动关系表 + * + * @author wanggongfeng + * @since v1.0.0 2019-12-16 + */ +@RestController +@RequestMapping("appactuserrelation") +public class AppActUserRelationController { + + @Autowired + private ActUserRelationService actUserRelationService; + + /** + * 活动报名 + * @param actUserRelationDTO + * @return + */ + @GetMapping("activitySignUp") + public Result activitySignUp(@RequestBody ActUserRelationDTO actUserRelationDTO){ + return actUserRelationService.activitySignUp(actUserRelationDTO); + } + + /** + * 取消活动报名 + * @param appActUserCancelsignupDTO + * @return + */ + @GetMapping("activityCancelSignUp") + public Result activityCancelSignUp(@RequestBody AppActUserCancelsignupDTO appActUserCancelsignupDTO){ + + return actUserRelationService.activityCancelSignUp(appActUserCancelsignupDTO); + } + + /** + * 通过活动ID查询打卡列表 + * @param actId + * @return + */ + @GetMapping("selectListActUserRelation/{actId}") + public Result selectListActUserRelation(@PathVariable("actId")String actId){ + return actUserRelationService.selectListActUserRelation(actId); + } + + /** + * 活动时间到自动审核通过未审核的报名人员 + * @param actId + * @return + */ + @GetMapping("AutoAuditActUser/{actId}") + public Result AutoAuditActUser(@PathVariable("actId")String actId){ + return actUserRelationService.updateAuditDefaultStatus(actId); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActBannerDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActBannerDao.java new file mode 100644 index 000000000..f7ff1fb7e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActBannerDao.java @@ -0,0 +1,37 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.dao; + +import com.elink.esua.epdc.activity.ActBannerDTO; +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.activity.entity.ActBannerEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 爱心互助活动banner 爱心互助活动banner + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Mapper +public interface ActBannerDao extends BaseDao { + List getActBannerlist(Map params); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActClockPicDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActClockPicDao.java new file mode 100644 index 000000000..34b83b451 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActClockPicDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.activity.entity.ActClockPicEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 活动打卡图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-18 + */ +@Mapper +public interface ActClockPicDao extends BaseDao { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActInfoDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActInfoDao.java new file mode 100644 index 000000000..f759f7858 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActInfoDao.java @@ -0,0 +1,78 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.dao; + +import com.elink.esua.epdc.activity.form.ActInfoAppFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoAppResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoDetailAppResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoResultDTO; +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.activity.entity.ActInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Mapper +public interface ActInfoDao extends BaseDao { + /** + * 活动列表 + * @Params: [params] + * @Return: java.util.List + * @Author: liuchuang + * @Date: 2019/9/5 19:42 + */ + List getActInfoPageFromPC(Map params); + + /** + * 移动端-活动列表 + * @Params: [formDto] + * @Return: java.util.List + * @Author: liuchuang + * @Date: 2019/9/9 16:50 + */ + List listItemsByApp(ActInfoAppFormDTO formDto); + /** + * 移动端-活动列表(已报名) + * @Params: [formDto] + * @Return: java.util.List + * @Author: liuchuang + * @Date: 2019/9/9 16:50 + */ + List signupListItemsByApp(ActInfoAppFormDTO formDto); + + /** + * 工作端-项目详情 + * @Params: [formDto] + * @Return: com.elink.esua.epdc.dto.item.result.ItemDetailResultDTO + * @Author: lipengfei + * @Date: 2019/9/10 20:57 + */ + ActInfoDetailAppResultDTO getDetailByApp(ActInfoAppFormDTO formDto); + + ActInfoDetailAppResultDTO getRejectDetailByApp(ActInfoAppFormDTO formDto); + + ActInfoDetailAppResultDTO getCancelDetailByApp(ActInfoAppFormDTO formDto); + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserClockLogDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserClockLogDao.java new file mode 100644 index 000000000..275f386ad --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserClockLogDao.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.dao; + +import com.elink.esua.epdc.activity.result.ActUserClockLogResultDTO; +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.activity.entity.ActUserClockLogEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 用户打卡日志表 用户打卡日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-17 + */ +@Mapper +public interface ActUserClockLogDao extends BaseDao { + + List getActUserClockLogFromPC(Map params); + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserLogDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserLogDao.java new file mode 100644 index 000000000..1fdf0379b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserLogDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.activity.entity.ActUserLogEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户活动日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Mapper +public interface ActUserLogDao extends BaseDao { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserPointsLogDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserPointsLogDao.java new file mode 100644 index 000000000..623b6131c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserPointsLogDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.activity.entity.ActUserPointsLogEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-21 + */ +@Mapper +public interface ActUserPointsLogDao extends BaseDao { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java new file mode 100644 index 000000000..c564e594a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.dao; + +import com.elink.esua.epdc.activity.ActClockListDTO; +import com.elink.esua.epdc.activity.ActClockPicDTO; +import com.elink.esua.epdc.activity.ActUserRelationDTO; +import com.elink.esua.epdc.activity.result.ActInfoClockResultDTO; +import com.elink.esua.epdc.activity.result.ActUserClockResultDTO; +import com.elink.esua.epdc.activity.result.ActUserRelationResultDTO; +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 用户活动关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Mapper +public interface ActUserRelationDao extends BaseDao { + /** + * 查询用户是否已报名活动 + * @param userId + * @param actId + * @return + */ + int isSignUp(@Param("userId")String userId, @Param("actId")String actId); + + /** + * 获取用户活动关系表主键ID + * @param userId + * @param actId + * @return + */ + List selectOneActUserRelationInfo(@Param("userId")String userId, @Param("actId")String actId); + + /** + * 通过活动ID查询人员活动关系信息 + * @param actId + * @return + */ + List selectListActUserRelation(@Param("actId")String actId); + + /** + * 通过人员活动关系信息 + * @param id + * @return + */ + ActInfoClockResultDTO getActDetail(@Param("id")String id); + + /** + * 查询打卡图片 + * @param idArr + * @return + */ + List selectListClockImg(@Param("idArr")String[] idArr); + /** + * 报名列表 + * @Params: [params] + * @Return: java.util.List + * @Author: liuchuang + * @Date: 2019/9/5 19:42 + */ + List getActUserRelationPageFromPC(Map params); + + /** + * 自动审核 + * @param actId + * @return + */ + List selectListActUserInfo(@Param("actId")String actId); + + List getActUserClockPageFromPC(Map params); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActBannerEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActBannerEntity.java new file mode 100644 index 000000000..ac89c08e3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActBannerEntity.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.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; + +/** + * 爱心互助活动banner 爱心互助活动banner + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_act_banner") +public class ActBannerEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动ID + */ + private String actId; + + /** + * 标题 + */ + private String title; + + /** + * banner图片 + */ + private String bannerImg; + + /** + * banner类型 0-活动,1-连接 + */ + private String bannerType; + + /** + * 连接地址 + */ + private String url; + + /** + * 上下架状态 0-下架,1-上架 + */ + private String status; + + /** + * 上下架时间 + */ + private Date statusTime; + + /** + * banner位置 0-顶部 + */ + private String bannerPosition; + + /** + * 浏览数量 + */ + private Integer browseNum; + + /** + * 创建部门ID + */ + private Long deptId; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActClockPicEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActClockPicEntity.java new file mode 100644 index 000000000..924367c52 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActClockPicEntity.java @@ -0,0 +1,48 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 活动打卡图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_act_clock_pic") +public class ActClockPicEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 打卡ID + */ + private String clockId; + + /** + * 图片地址 + */ + private String clockPic; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActInfoEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActInfoEntity.java new file mode 100644 index 000000000..c82c66a91 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActInfoEntity.java @@ -0,0 +1,205 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.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 qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_act_info") +public class ActInfoEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 标题 + */ + private String title; + + /** + * 活动头图 + */ + private String headPic; + + /** + * 报名开始时间 + */ + private Date signupStartTime; + + /** + * 报名截止时间 + */ + private Date signupEndTime; + + /** + * 活动开始时间 + */ + private Date actStartTime; + + /** + * 活动结束时间 + */ + private Date actEndTime; + /** + * 打卡开始时间 + */ + private Date signinStartTime; + + /** + * 打卡截止时间 + */ + private Date signinEndTime; + + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 默认状态 + */ + private String actUserDefaultState; + + /** + * 活动位置经度 + */ + private BigDecimal actLongitude; + + /** + * 活动位置纬度 + */ + private BigDecimal actLatitude; + + /** + * 活动签到打卡地点 + */ + private String signinAddress; + /** + * 活动下架原因 + */ + private String cancelReason; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal signinLongitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal signinLatitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer clockRadius; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 已报名人数 + */ + private Integer signupNum; + + /** + * 活动打卡人数 + */ + private Integer clockNum; + + /** + * 活动分享数 + */ + private Integer actShareNum; + + /** + * 活动浏览数 + */ + private Integer actBrowseNum; + + /** + * 联系人 + */ + private String contacts; + + /** + * 联系电话 + */ + private String tel; + + /** + * 招募要求 + */ + private String requirement; + + /** + * 活动内容 + */ + private String actContent; + + /** + * 活动发布状态(0-下架,1上架) + */ + private String actStatus; + + /** + * 活动发布时间 + */ + private Date publishTime; + + /** + * 活动主办方 + */ + private String sponsor; + + /** + * 创建部门ID + */ + private Long deptId; + + /** + * 活动惩罚积分 + */ + private Integer punishmentPoints; + + /** + * 活动奖励积分 + */ + private Integer reward; + /** + * 活动名额类型 + */ + private Integer actQuotaCategory; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserClockLogEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserClockLogEntity.java new file mode 100644 index 000000000..f4c15b077 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserClockLogEntity.java @@ -0,0 +1,82 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.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 qu@elink-cn.com + * @since v1.0.0 2019-12-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_act_user_clock_log") +public class ActUserClockLogEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户活动关系表ID + */ + private String actUserId; + + /** + * 打卡类型(0-打卡,1-更新打卡) + */ + private String clockType; + + /** + * 打卡时间 + */ + private Date clockTime; + + /** + * 打卡位置经度 + */ + private BigDecimal clockLongitude; + + /** + * 打卡位置纬度 + */ + private BigDecimal clockLatitude; + + /** + * 打卡地址 + */ + private String clockAddress; + + /** + * 打卡描述 + */ + private String clockDesc; + + /** + * 打卡是否有效(0-否,1-是) + */ + private String effectiveFlag; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserLogEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserLogEntity.java new file mode 100644 index 000000000..1d0f91068 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserLogEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.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 qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_act_user_log") +public class ActUserLogEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动ID + */ + private String actId; + + /** + * 用户ID + */ + private String userId; + + /** + * 操作类别(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过) + */ + private String operationType; + + /** + * 审核不通过的原因 + */ + private String failureReason; + + /** + * 操作时间 + */ + private Date operationTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserPointsLogEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserPointsLogEntity.java new file mode 100644 index 000000000..57b080f0c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserPointsLogEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.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 qu@elink-cn.com + * @since v1.0.0 2019-12-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_act_user_points_log") +public class ActUserPointsLogEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户活动关系表ID + */ + private String actUserId; + + /** + * 操作类型 0-系统确认积分,2-管理员确认积分,4-取消报名扣减积分,6-管理员扣减积分,8-拒绝积分 + */ + private String operationType; + + /** + * 操作积分类型 0-减积分,1-加积分 + */ + private String operationPointsType; + + /** + * 操作积分值 + */ + private Integer points; + + /** + * 处理原因 + */ + private String operationReason; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserRelationEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserRelationEntity.java new file mode 100644 index 000000000..751a2c228 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserRelationEntity.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.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 qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_act_user_relation") +public class ActUserRelationEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动ID + */ + private String actId; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户昵称 + */ + private String nickname; + + /** + * 用户头像 + */ + private String faceImg; + + /** + * 党员标识(0-否,1-是) + */ + private String partyFlag; + + /** + * 报名人真实姓名 + */ + private String realName; + + /** + * 性别(0-女,1-男) + */ + private String sex; + + /** + * 年龄 + */ + private Integer age; + + /** + * 联系电话 + */ + private String mobile; + + /** + * 身份证号 + */ + private String identityNo; + + /** + * 当前状态(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过) + */ + private String status; + + /** + * 未通过原因(仅当未通过时录入,并读取) + */ + private String failureReason; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 报名时间 + */ + private Date signupTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActBannerExcel.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActBannerExcel.java new file mode 100644 index 000000000..d0e75687d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActBannerExcel.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 爱心互助活动banner 爱心互助活动banner + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Data +public class ActBannerExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "活动ID") + private String actId; + + @Excel(name = "标题") + private String title; + + @Excel(name = "banner图片") + private String bannerImg; + + @Excel(name = "banner类型 0-活动,1-连接") + private String bannerType; + + @Excel(name = "连接地址") + private String url; + + @Excel(name = "上下架状态 0-下架,1-上架") + private String status; + + @Excel(name = "上下架时间") + private Date statusTime; + + @Excel(name = "banner位置 0-顶部") + private String bannerPosition; + + @Excel(name = "浏览数量") + private Integer browseNum; + + @Excel(name = "创建部门ID") + private Long deptId; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "删除标识 0-否,1-是") + private String delFlag; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActClockPicExcel.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActClockPicExcel.java new file mode 100644 index 000000000..658430b80 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActClockPicExcel.java @@ -0,0 +1,59 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 活动打卡图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-18 + */ +@Data +public class ActClockPicExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "打卡ID") + private String clockId; + + @Excel(name = "图片地址") + private String clockPic; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActInfoExcel.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActInfoExcel.java new file mode 100644 index 000000000..c34943fc3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActInfoExcel.java @@ -0,0 +1,138 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class ActInfoExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "标题") + private String title; + + @Excel(name = "活动头图") + private String headPic; + + @Excel(name = "报名开始时间") + private Date signupStartTime; + + @Excel(name = "报名截止时间") + private Date signupEndTime; + + @Excel(name = "活动开始时间") + private Date actStartTime; + + @Excel(name = "活动结束时间") + private Date actEndTime; + + @Excel(name = "活动地点") + private String actAddress; + + @Excel(name = "活动位置经度") + private BigDecimal actLongitude; + + @Excel(name = "活动位置纬度") + private BigDecimal actLatitude; + + @Excel(name = "活动签到打卡地点") + private String signinAddress; + + @Excel(name = "活动签到打卡位置经度") + private BigDecimal signinLongitude; + + @Excel(name = "活动签到打卡位置纬度") + private BigDecimal signinLatitude; + + @Excel(name = "活动签到打卡半径(单位:米)") + private Integer clockRadius; + + @Excel(name = "活动名额") + private Integer actQuota; + + @Excel(name = "已报名人数") + private Integer signupNum; + + @Excel(name = "活动打卡人数") + private Integer clockNum; + + @Excel(name = "活动分享数") + private Integer actShareNum; + + @Excel(name = "活动浏览数") + private Integer actBrowseNum; + + @Excel(name = "联系人") + private String contacts; + + @Excel(name = "联系电话") + private String tel; + + @Excel(name = "招募要求") + private String requirement; + + @Excel(name = "活动内容") + private String actContent; + + @Excel(name = "活动发布状态(0-下架,1上架)") + private String actStatus; + + @Excel(name = "活动发布时间") + private Date publishTime; + + @Excel(name = "活动主办方") + private String sponsor; + + @Excel(name = "创建部门ID") + private Long deptId; + + @Excel(name = "活动惩罚积分") + private Integer punishmentPoints; + + @Excel(name = "活动奖励积分") + private Integer reward; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserClockLogExcel.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserClockLogExcel.java new file mode 100644 index 000000000..a209bb495 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserClockLogExcel.java @@ -0,0 +1,75 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 用户打卡日志表 用户打卡日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-17 + */ +@Data +public class ActUserClockLogExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "用户活动关系表ID") + private String actUserId; + + @Excel(name = "打卡类型(0-打卡,1-更新打卡)") + private String clockType; + + @Excel(name = "打卡时间") + private Date clockTime; + + @Excel(name = "打卡位置经度") + private BigDecimal clockLongitude; + + @Excel(name = "打卡位置纬度") + private BigDecimal clockLatitude; + + @Excel(name = "打卡地址") + private String clockAddress; + + @Excel(name = "打卡描述") + private String clockDesc; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserLogExcel.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserLogExcel.java new file mode 100644 index 000000000..c8416289e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserLogExcel.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 用户活动日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Data +public class ActUserLogExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "活动ID") + private String actId; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "操作类别(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过)") + private String operationType; + + @Excel(name = "审核不通过的原因") + private String failureReason; + + @Excel(name = "操作时间") + private Date operationTime; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserPointsLogExcel.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserPointsLogExcel.java new file mode 100644 index 000000000..77a2aff46 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserPointsLogExcel.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-21 + */ +@Data +public class ActUserPointsLogExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "用户活动关系表ID") + private String actUserId; + + @Excel(name = "操作类型 0-系统确认积分,2-管理员确认积分,4-取消报名扣减积分,6-管理员扣减积分,8-拒绝积分") + private String operationType; + + @Excel(name = "操作积分类型 0-减积分,1-加积分") + private String operationPointsType; + + @Excel(name = "操作积分值") + private Integer points; + + @Excel(name = "处理原因") + private String operationReason; + + @Excel(name = "删除标识 0-否,1-是") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserRelationExcel.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserRelationExcel.java new file mode 100644 index 000000000..89fd60f88 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserRelationExcel.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 用户活动关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Data +public class ActUserRelationExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "活动ID") + private String actId; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "用户昵称") + private String nickname; + + @Excel(name = "用户头像") + private String faceImg; + + @Excel(name = "党员标识(0-否,1-是)") + private String partyFlag; + + @Excel(name = "报名人真实姓名") + private String realName; + + @Excel(name = "性别(0-女,1-男)") + private String sex; + + @Excel(name = "年龄") + private Integer age; + + @Excel(name = "联系电话") + private String mobile; + + @Excel(name = "身份证号") + private String identityNo; + + @Excel(name = "当前状态(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过)") + private String status; + + @Excel(name = "未通过原因(仅当未通过时录入,并读取)") + private String failureReason; + + @Excel(name = "审核时间") + private Date auditTime; + + @Excel(name = "报名时间") + private Date signupTime; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActBannerRedis.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActBannerRedis.java new file mode 100644 index 000000000..c4e3632b2 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActBannerRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 爱心互助活动banner 爱心互助活动banner + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Component +public class ActBannerRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActClockPicRedis.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActClockPicRedis.java new file mode 100644 index 000000000..0e12109bc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActClockPicRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 活动打卡图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-18 + */ +@Component +public class ActClockPicRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActInfoRedis.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActInfoRedis.java new file mode 100644 index 000000000..8d00799c6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActInfoRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Component +public class ActInfoRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserClockLogRedis.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserClockLogRedis.java new file mode 100644 index 000000000..85757a14a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserClockLogRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 用户打卡日志表 用户打卡日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-17 + */ +@Component +public class ActUserClockLogRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserLogRedis.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserLogRedis.java new file mode 100644 index 000000000..165d528f0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserLogRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 用户活动日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Component +public class ActUserLogRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserPointsLogRedis.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserPointsLogRedis.java new file mode 100644 index 000000000..d80d75161 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserPointsLogRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

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

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 用户活动关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Component +public class ActUserRelationRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActBannerService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActBannerService.java new file mode 100644 index 000000000..4555386ed --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActBannerService.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.service; + +import com.elink.esua.epdc.activity.ActBannerDTO; +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.modules.activity.entity.ActBannerEntity; + +import java.util.List; +import java.util.Map; + +/** + * 爱心互助活动banner 爱心互助活动banner + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +public interface ActBannerService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-19 + */ + PageData page(Map params); + + PageData getActBannerPage(Map params); + + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActBannerDTO + * @author generator + * @date 2019-12-19 + */ + ActBannerDTO get(String id); + + Result grounding(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-19 + */ + void save(ActBannerDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-19 + */ + void update(ActBannerDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiManualScoreTempService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActClockPicService.java similarity index 64% rename from esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiManualScoreTempService.java rename to esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActClockPicService.java index 2aa80f771..323ec9890 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiManualScoreTempService.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActClockPicService.java @@ -15,53 +15,53 @@ * along with this program. If not, see . */ -package com.elink.esua.epdc.service; +package com.elink.esua.epdc.modules.activity.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.KpiManualScoreTempDTO; -import com.elink.esua.epdc.entity.KpiManualScoreTempEntity; +import com.elink.esua.epdc.activity.ActClockPicDTO; +import com.elink.esua.epdc.modules.activity.entity.ActClockPicEntity; import java.util.List; import java.util.Map; /** - * 绩效考核手动打分记录 + * 活动打卡图片表 * * @author qu qu@elink-cn.com - * @since v1.0.0 2019-12-06 + * @since v1.0.0 2019-12-18 */ -public interface KpiManualScoreTempService extends BaseService { +public interface ActClockPicService extends BaseService { /** * 默认分页 * * @param params - * @return PageData + * @return PageData * @author generator - * @date 2019-12-06 + * @date 2019-12-18 */ - PageData page(Map params); + PageData page(Map params); /** * 默认查询 * * @param params - * @return java.util.List + * @return java.util.List * @author generator - * @date 2019-12-06 + * @date 2019-12-18 */ - List list(Map params); + List list(Map params); /** * 单条查询 * * @param id - * @return KpiManualScoreTempDTO + * @return ActClockPicDTO * @author generator - * @date 2019-12-06 + * @date 2019-12-18 */ - KpiManualScoreTempDTO get(String id); + ActClockPicDTO get(String id); /** * 默认保存 @@ -69,9 +69,9 @@ public interface KpiManualScoreTempService extends BaseService + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.service; + +import com.elink.esua.epdc.activity.ActInfoDTO; +import com.elink.esua.epdc.activity.form.ActInfoAppFormDTO; +import com.elink.esua.epdc.activity.form.ActInfoFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoAppResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoDetailAppResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoResultDTO; +import com.elink.esua.epdc.common.token.dto.TokenDto; +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.modules.activity.entity.ActInfoEntity; + +import java.util.List; +import java.util.Map; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +public interface ActInfoService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-11 + */ + PageData page(Map params); + + PageData getActInfoPageFromPC(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-11 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActInfoDTO + * @author generator + * @date 2019-12-11 + */ + ActInfoDTO get(String id); + + /** + * 活动列表-移动app端用 + * @Params: [formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/10/19 16:47 + */ + Result> listItemsByApp(ActInfoAppFormDTO formDto); + /** + * 活动列表(已报名)-移动app端用 + * @Params: [formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/10/19 16:47 + */ + Result> signupListItemsByApp(ActInfoAppFormDTO formDto); + + /** + * 移动端-项目详情 + * @Params: [formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result + * @Author: liuchuang + * @Date: 2019/9/10 20:54 + */ + Result getDetailByApp(ActInfoAppFormDTO formDto); + /** + * 移动端-项目详情 + * @Params: [formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result + * @Author: liuchuang + * @Date: 2019/9/10 20:54 + */ + Result getRejectDetailByApp(ActInfoAppFormDTO formDto); + + /** + * 移动端-项目详情 + * @Params: [formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result + * @Author: liuchuang + * @Date: 2019/9/10 20:54 + */ + Result getCancelDetailByApp(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-11 + */ + Result save(ActInfoDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-11 + */ + void update(ActInfoDTO dto); + + Result cancel(ActInfoFormDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-11 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserClockLogService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserClockLogService.java new file mode 100644 index 000000000..74379cd8b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserClockLogService.java @@ -0,0 +1,116 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.service; + +import com.elink.esua.epdc.activity.ActUserClockLogDTO; +import com.elink.esua.epdc.activity.AppActUserClockLogDTO; +import com.elink.esua.epdc.activity.form.ActPointCheckFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoResultDTO; +import com.elink.esua.epdc.activity.result.ActUserClockLogResultDTO; +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.modules.activity.entity.ActUserClockLogEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户打卡日志表 用户打卡日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-17 + */ +public interface ActUserClockLogService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-17 + */ + PageData page(Map params); + + PageData getActUserClockLogFromPC(Map params); + + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActUserClockLogDTO + * @author generator + * @date 2019-12-17 + */ + ActUserClockLogDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-17 + */ + void save(ActUserClockLogDTO dto); + + Result pointCheck(ActPointCheckFormDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-17 + */ + void update(ActUserClockLogDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-17 + */ + void delete(String[] ids); + + /** + * 活动打卡 + * + * @param appActUserClockLogDTO + * @author wanggongfeng + * @date 2019-12-16 + */ + Result activityClock(AppActUserClockLogDTO appActUserClockLogDTO); + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserLogService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserLogService.java new file mode 100644 index 000000000..4f25afed4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserLogService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.activity.ActUserLogDTO; +import com.elink.esua.epdc.modules.activity.entity.ActUserLogEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户活动日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +public interface ActUserLogService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActUserLogDTO + * @author generator + * @date 2019-12-16 + */ + ActUserLogDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-16 + */ + void save(ActUserLogDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-16 + */ + void update(ActUserLogDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserPointsLogService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserPointsLogService.java new file mode 100644 index 000000000..fd65c8b10 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserPointsLogService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.service; + +import com.elink.esua.epdc.activity.ActUserPointsLogDTO; +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.modules.activity.entity.ActUserPointsLogEntity; + +import java.util.List; +import java.util.Map; + +/** + * + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-21 + */ +public interface ActUserPointsLogService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-21 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-21 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActUserPointsLogDTO + * @author generator + * @date 2019-12-21 + */ + ActUserPointsLogDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-21 + */ + void save(ActUserPointsLogDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-21 + */ + void update(ActUserPointsLogDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-21 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java new file mode 100644 index 000000000..08eb3c127 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java @@ -0,0 +1,168 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.service; + +import com.elink.esua.epdc.activity.ActUserRelationDTO; +import com.elink.esua.epdc.activity.AppActUserCancelsignupDTO; +import com.elink.esua.epdc.activity.AppClockListDTO; +import com.elink.esua.epdc.activity.form.ActUserRelationAuditFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoClockResultDTO; +import com.elink.esua.epdc.activity.result.ActUserClockResultDTO; +import com.elink.esua.epdc.activity.result.ActUserRelationResultDTO; +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.modules.activity.entity.ActUserRelationEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户活动关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +public interface ActUserRelationService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActUserRelationDTO + * @author generator + * @date 2019-12-16 + */ + ActUserRelationDTO get(String id); + + PageData getActUserRelationPageFromPC (Map params); + + PageData getActUserClockPageFromPC (Map params); + + ActInfoClockResultDTO getActDetail(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-16 + */ + void save(ActUserRelationDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-16 + */ + void update(ActUserRelationDTO dto); + + Result audit(ActUserRelationAuditFormDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-16 + */ + void delete(String[] ids); + + /** + * 活动报名 + * + * @param actUserRelationDTO + * @author wanggongfeng + * @date 2019-12-16 + */ + Result activitySignUp(ActUserRelationDTO actUserRelationDTO); + + /** + * 取消活动报名 + * + * @param appActUserCancelsignupDTO + * @author wanggongfeng + * @date 2019-12-16 + */ + Result activityCancelSignUp(AppActUserCancelsignupDTO appActUserCancelsignupDTO); + + /** + * 查询人员活动关系Id + * + * @param userId + * @param actId + * @return ActUserRelationDTO + * @author wanggongfeng + * @date 2019-12-16 + */ + ActUserRelationDTO getActUserRelationId(String userId,String actId); + + /** + * 活动打卡,更新活动人员关系表当前状态 + * + * @param actUserRelationDTO + * @author wanggongfeng + * @date 2019-12-16 + */ + Result updateActivityStatus(ActUserRelationDTO actUserRelationDTO); + + /** + * 通过活动ID查询打卡列表 + * + * @param actId + * @return ActUserRelationDTO + * @author wanggongfeng + * @date 2019-12-16 + */ + Result selectListActUserRelation(String actId); + + /** + * 默认活动报名审核通过 + * + * @param actId + * @author wanggongfeng + * @date 2019-12-16 + */ + Result updateAuditDefaultStatus(String actId); + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActBannerServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActBannerServiceImpl.java new file mode 100644 index 000000000..4734d45b9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActBannerServiceImpl.java @@ -0,0 +1,130 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.activity.ActBannerDTO; +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.Result; +import com.elink.esua.epdc.constant.ActStateConstant; +import com.elink.esua.epdc.modules.activity.dao.ActBannerDao; +import com.elink.esua.epdc.modules.activity.entity.ActBannerEntity; +import com.elink.esua.epdc.modules.activity.redis.ActBannerRedis; +import com.elink.esua.epdc.modules.activity.service.ActBannerService; +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.Date; +import java.util.List; +import java.util.Map; + +/** + * 爱心互助活动banner 爱心互助活动banner + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Service +public class ActBannerServiceImpl extends BaseServiceImpl implements ActBannerService { + + @Autowired + private ActBannerRedis actBannerRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActBannerDTO.class); + } + @Override + public PageData getActBannerPage(Map params) { + IPage page = getPage(params); + List list = baseDao.getActBannerlist(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActBannerDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ActBannerDTO get(String id) { + ActBannerEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActBannerDTO.class); + } + @Override + public Result grounding(String id) { + ActBannerEntity entity = baseDao.selectById(id); + ActBannerEntity updateEntity = new ActBannerEntity(); + updateEntity.setId(id); + updateEntity.setStatusTime(new Date()); + // 上架 + if (ActStateConstant.ACT_BANNER_STATUS_UNDERCARRIAGE.equals(entity.getStatus())) { + updateEntity.setStatus(ActStateConstant.ACT_BANNER_STATUS_GROUNDING); + updateById(updateEntity); + // 下架 + } else if (ActStateConstant.ACT_BANNER_STATUS_GROUNDING.equals(entity.getStatus())) { + updateEntity.setStatus(ActStateConstant.ACT_BANNER_STATUS_UNDERCARRIAGE); + updateById(updateEntity); + } + return new Result(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActBannerDTO dto) { + ActBannerEntity entity = ConvertUtils.sourceToTarget(dto, ActBannerEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActBannerDTO dto) { + ActBannerEntity entity = ConvertUtils.sourceToTarget(dto, ActBannerEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiManualScoreTempServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActClockPicServiceImpl.java similarity index 55% rename from esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiManualScoreTempServiceImpl.java rename to esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActClockPicServiceImpl.java index 2fc8daf95..489ff518e 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiManualScoreTempServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActClockPicServiceImpl.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.elink.esua.epdc.service.impl; +package com.elink.esua.epdc.modules.activity.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -23,11 +23,11 @@ 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.KpiManualScoreTempDao; -import com.elink.esua.epdc.dto.KpiManualScoreTempDTO; -import com.elink.esua.epdc.entity.KpiManualScoreTempEntity; -import com.elink.esua.epdc.redis.KpiManualScoreTempRedis; -import com.elink.esua.epdc.service.KpiManualScoreTempService; +import com.elink.esua.epdc.modules.activity.dao.ActClockPicDao; +import com.elink.esua.epdc.activity.ActClockPicDTO; +import com.elink.esua.epdc.modules.activity.entity.ActClockPicEntity; +import com.elink.esua.epdc.modules.activity.redis.ActClockPicRedis; +import com.elink.esua.epdc.modules.activity.service.ActClockPicService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -38,59 +38,59 @@ import java.util.List; import java.util.Map; /** - * 绩效考核手动打分记录 + * 活动打卡图片表 * * @author qu qu@elink-cn.com - * @since v1.0.0 2019-12-06 + * @since v1.0.0 2019-12-18 */ @Service -public class KpiManualScoreTempServiceImpl extends BaseServiceImpl implements KpiManualScoreTempService { +public class ActClockPicServiceImpl extends BaseServiceImpl implements ActClockPicService { @Autowired - private KpiManualScoreTempRedis kpiManualScoreTempRedis; + private ActClockPicRedis actClockPicRedis; @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( + public PageData page(Map params) { + IPage page = baseDao.selectPage( getPage(params, FieldConstant.CREATED_TIME, false), getWrapper(params) ); - return getPageData(page, KpiManualScoreTempDTO.class); + return getPageData(page, ActClockPicDTO.class); } @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); - return ConvertUtils.sourceToTarget(entityList, KpiManualScoreTempDTO.class); + return ConvertUtils.sourceToTarget(entityList, ActClockPicDTO.class); } - private QueryWrapper getWrapper(Map params){ + private QueryWrapper getWrapper(Map params){ String id = (String)params.get(FieldConstant.ID_HUMP); - QueryWrapper wrapper = new QueryWrapper<>(); + QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); return wrapper; } @Override - public KpiManualScoreTempDTO get(String id) { - KpiManualScoreTempEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, KpiManualScoreTempDTO.class); + public ActClockPicDTO get(String id) { + ActClockPicEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActClockPicDTO.class); } @Override @Transactional(rollbackFor = Exception.class) - public void save(KpiManualScoreTempDTO dto) { - KpiManualScoreTempEntity entity = ConvertUtils.sourceToTarget(dto, KpiManualScoreTempEntity.class); + public void save(ActClockPicDTO dto) { + ActClockPicEntity entity = ConvertUtils.sourceToTarget(dto, ActClockPicEntity.class); insert(entity); } @Override @Transactional(rollbackFor = Exception.class) - public void update(KpiManualScoreTempDTO dto) { - KpiManualScoreTempEntity entity = ConvertUtils.sourceToTarget(dto, KpiManualScoreTempEntity.class); + public void update(ActClockPicDTO dto) { + ActClockPicEntity entity = ConvertUtils.sourceToTarget(dto, ActClockPicEntity.class); updateById(entity); } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java new file mode 100644 index 000000000..26a1d4eac --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java @@ -0,0 +1,229 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.activity.ActBannerDTO; +import com.elink.esua.epdc.activity.ActInfoDTO; +import com.elink.esua.epdc.activity.form.ActInfoAppFormDTO; +import com.elink.esua.epdc.activity.form.ActInfoFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoAppResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoDetailAppResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoResultDTO; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.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.Result; +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.DefaultGroup; +import com.elink.esua.epdc.constant.ActStateConstant; +import com.elink.esua.epdc.dto.ScheduleJobDTO; +import com.elink.esua.epdc.modules.activity.dao.ActInfoDao; +import com.elink.esua.epdc.modules.activity.entity.ActInfoEntity; +import com.elink.esua.epdc.modules.activity.redis.ActInfoRedis; + +import com.elink.esua.epdc.modules.activity.service.ActBannerService; +import com.elink.esua.epdc.modules.activity.service.ActInfoService; +import com.elink.esua.epdc.modules.feign.JobFeignClient; +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 qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Service +public class ActInfoServiceImpl extends BaseServiceImpl implements ActInfoService { + + @Autowired + private ActInfoRedis actInfoRedis; + @Autowired + private ActBannerService actBannerService; + @Autowired + private JobFeignClient jobFeignClient; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActInfoDTO.class); + } + @Override + public PageData getActInfoPageFromPC(Map params) { + IPage page = getPage(params); + List list = baseDao.getActInfoPageFromPC(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActInfoDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ActInfoDTO get(String id) { + ActInfoEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActInfoDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result save(ActInfoDTO dto) { + + ActInfoEntity entity = ConvertUtils.sourceToTarget(dto, ActInfoEntity.class); + insert(entity); + //保存banner信息 + ActBannerDTO bannerDto = new ActBannerDTO(); + bannerDto.setActId(entity.getId()); + bannerDto.setTitle(dto.getTitle()); + bannerDto.setBannerImg(dto.getBannerUrl()); + bannerDto.setBannerType("0"); + bannerDto.setBannerPosition("0"); + bannerDto.setUrl(""); + bannerDto.setStatus(dto.getIsBanner()); + bannerDto.setStatusTime(new Date()); + bannerDto.setDeptId(dto.getDeptId()); + ValidatorUtils.validateEntity(bannerDto, AddGroup.class, DefaultGroup.class); + actBannerService.save(bannerDto); + ScheduleJobDTO jobDTO = new ScheduleJobDTO(); + jobDTO.setBeanName("AutoAuditActUserTask"); + jobDTO.setParams(entity.getId()); + jobDTO.setStatus(1); + String cron = ""; + Calendar calendar = Calendar.getInstance(); + calendar.setTime(dto.getActStartTime()); + int year = calendar.get(Calendar.YEAR); + int month = calendar.get(Calendar.MONTH) + 1; + int day = calendar.get(Calendar.DATE); + int hours = calendar.get(Calendar.HOUR_OF_DAY); + int minutes = calendar.get(Calendar.MINUTE); + int second=calendar.get(Calendar.SECOND); + System.out.println(dto.getActStartTime()); + + cron = second +" "+ minutes +" "+ hours + " " + day + " " + month + " ? " + year + "-" + year; + jobDTO.setCronExpression(cron); + return jobFeignClient.save(jobDTO); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActInfoDTO dto) { + ActInfoEntity entity = ConvertUtils.sourceToTarget(dto, ActInfoEntity.class); + updateById(entity); + } + /** + * 活动列表-移动app端用 + * @Params: [formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/10/19 16:47 + */ + @Override + public Result> signupListItemsByApp(ActInfoAppFormDTO formDto) { + int pageIndex = (formDto.getPageIndex() - NumConstant.ONE) * formDto.getPageSize(); + formDto.setPageIndex(pageIndex); + List data = baseDao.signupListItemsByApp(formDto); + return new Result>().ok(data); + } + /** + * 活动列表-移动app端用 + * @Params: [formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/10/19 16:47 + */ + @Override + public Result> listItemsByApp(ActInfoAppFormDTO formDto) { + int pageIndex = (formDto.getPageIndex() - NumConstant.ONE) * formDto.getPageSize(); + formDto.setPageIndex(pageIndex); + List data = baseDao.listItemsByApp(formDto); + return new Result>().ok(data); + } + @Override + @Transactional(rollbackFor = Exception.class) + public Result cancel(ActInfoFormDTO dto) { + ActInfoEntity entity = baseDao.selectById(dto.getId()); + if (ActStateConstant.ACT_INFO_STATUS_UNDERCARRIAGE.equals(entity.getActStatus())) { + return new Result().error("活动已取消"); + } else if (new Date().compareTo(entity.getSignupEndTime()) > 0) { + return new Result().error("已过报名时间不可取消"); + } + ActInfoEntity updateEntity = new ActInfoEntity(); + updateEntity.setId(dto.getId()); + updateEntity.setCancelReason(dto.getCancelReason()); + updateEntity.setActStatus(ActStateConstant.ACT_INFO_STATUS_UNDERCARRIAGE); + updateById(updateEntity); + return new Result(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + @Override + public Result getDetailByApp(ActInfoAppFormDTO formDto) { + + Date currentTime = new Date(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String dateString = formatter.format(currentTime); + formDto.setTimestamp(dateString); + ActInfoDetailAppResultDTO resultDTO = baseDao.getDetailByApp(formDto); + return new Result().ok(resultDTO); + } + @Override + public Result getRejectDetailByApp(ActInfoAppFormDTO formDto) { + ActInfoDetailAppResultDTO resultDTO = baseDao.getRejectDetailByApp(formDto); + return new Result().ok(resultDTO); + } + @Override + public Result getCancelDetailByApp(String id) { + ActInfoAppFormDTO formDto = new ActInfoAppFormDTO(); + formDto.setId(id); + ActInfoDetailAppResultDTO resultDTO = baseDao.getCancelDetailByApp(formDto); + return new Result().ok(resultDTO); + } + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserClockLogServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserClockLogServiceImpl.java new file mode 100644 index 000000000..7dfc8504c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserClockLogServiceImpl.java @@ -0,0 +1,272 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.activity.*; +import com.elink.esua.epdc.activity.form.ActPointCheckFormDTO; +import com.elink.esua.epdc.activity.result.ActUserClockLogResultDTO; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.constant.PointsConstant; +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; +import com.elink.esua.epdc.commons.tools.enums.pointsenum.PointsOperationModeEnum; +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.utils.Result; +import com.elink.esua.epdc.constant.ActStateConstant; +import com.elink.esua.epdc.dto.UserDTO; +import com.elink.esua.epdc.dto.logs.PointsLogsDTO; +import com.elink.esua.epdc.modules.activity.entity.ActUserClockLogEntity; +import com.elink.esua.epdc.modules.activity.redis.ActUserClockLogRedis; +import com.elink.esua.epdc.modules.activity.service.*; +import com.elink.esua.epdc.modules.feign.PointsFeignClient; +import com.elink.esua.epdc.modules.feign.UserInfoFeignClient; +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 com.elink.esua.epdc.modules.activity.dao.ActUserClockLogDao; +import org.springframework.transaction.interceptor.TransactionAspectSupport; + +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 用户打卡日志表 用户打卡日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-17 + */ +@Service +public class ActUserClockLogServiceImpl extends BaseServiceImpl implements ActUserClockLogService { + + @Autowired + private ActUserClockLogRedis actUserClockLogRedis; + + @Autowired + private ActUserRelationService actUserRelationService; + + @Autowired + private ActClockPicService actClockPicService; + + @Autowired + private ActUserLogService actUserLogService; + @Autowired + private ActUserPointsLogService actUserPointsLogService; + + @Autowired + private ActInfoService actInfoService; + + @Autowired + private UserInfoFeignClient userInfoFeignClient; + @Autowired + private PointsFeignClient pointsFeignClient; + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActUserClockLogDTO.class); + } + @Override + public PageData getActUserClockLogFromPC(Map params) { + IPage page = getPage(params); + System.out.println(params); + List list = baseDao.getActUserClockLogFromPC(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActUserClockLogDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ActUserClockLogDTO get(String id) { + ActUserClockLogEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActUserClockLogDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActUserClockLogDTO dto) { + ActUserClockLogEntity entity = ConvertUtils.sourceToTarget(dto, ActUserClockLogEntity.class); + insert(entity); + } + @Override + @Transactional(rollbackFor = Exception.class) + public Result pointCheck(ActPointCheckFormDTO dto) { + + ActInfoDTO actInfoDTO = actInfoService.get(dto.getActId()); + ActUserPointsLogDTO pointsLogDTO = new ActUserPointsLogDTO(); + pointsLogDTO.setActUserId(dto.getId()); + pointsLogDTO.setOperationReason(dto.getFailureReason()); + //确认加积分 + Integer point = 0; + if (ActStateConstant.ACT_USER_RELATION_STATUS_POINTPASS.equals(dto.getStatus())) { + pointsLogDTO.setOperationType(ActStateConstant.POINT_OPERATION_TYPE_ADMINPASS); + pointsLogDTO.setOperationPointsType(ActStateConstant.OPERATION_POINTS_TYPE_ADD); + point =actInfoDTO.getReward(); + pointsLogDTO.setPoints(point); + + //拒绝加积分 + } else if (ActStateConstant.ACT_USER_RELATION_STATUS_POINTREJECT.equals(dto.getStatus())) { + pointsLogDTO.setOperationType(ActStateConstant.POINT_OPERATION_TYPE_ADMINREJECT); + pointsLogDTO.setOperationPointsType(ActStateConstant.OPERATION_POINTS_TYPE_DEDUCT); + pointsLogDTO.setPoints(point); + } + PointsLogsDTO pointsLogsEntity = new PointsLogsDTO(); + pointsLogsEntity.setVolunteerId(dto.getId()); + pointsLogsEntity.setOperationTime(new Date()); + pointsLogsEntity.setOperationMode(PointsOperationModeEnum.OPERATION_MODE_ADMIN.getOperationMode()); + pointsLogsEntity.setStatus(YesOrNoEnum.YES.value()); + pointsLogsEntity.setFailureReason(""); + pointsLogsEntity.setRuleCode(PointsConstant.ruleCode); + pointsLogsEntity.setOperationDesc("积分操作"); + //操作描述 + pointsLogsEntity.setPoints(point); + pointsLogsEntity.setOperationType(pointsLogDTO.getOperationType()); + pointsLogsEntity.setBehaviorCode("like"); + //增加积分记录 + actUserPointsLogService.save(pointsLogDTO); + // 更新用户状态 + return userInfoHandle(dto,pointsLogsEntity); + + } + + private Result userInfoHandle(ActPointCheckFormDTO dto, PointsLogsDTO pointsLogsEntity){ + //用户关系表状态更新 + ActUserRelationDTO checkDTO =actUserRelationService.get(dto.getId()); + ActUserRelationDTO actUserRelationEntity = new ActUserRelationDTO(); + actUserRelationEntity.setId(dto.getId()); + actUserRelationEntity.setStatus(dto.getStatus()); + actUserRelationEntity.setFailureReason(dto.getFailureReason()); + actUserRelationService.update(actUserRelationEntity); + //存储活动日志表 epdc_act_user_log + ActUserLogDTO actUserLogDTO = new ActUserLogDTO(); + actUserLogDTO.setUserId(checkDTO.getUserId()); + actUserLogDTO.setActId(dto.getActId()); + actUserLogDTO.setOperationType(dto.getStatus()); + actUserLogDTO.setOperationTime(new Date()); + actUserLogService.save(actUserLogDTO); + //更新用户积分 + Result result = userInfoFeignClient.getUserInfoById(checkDTO.getUserId()); + if (result.success() && null != result.getData()) { + UserDTO updateUserDTO = result.getData(); + //增加用户积分 + System.out.println(updateUserDTO.toString()); + updateUserDTO.setPoints(updateUserDTO.getPoints() + pointsLogsEntity.getPoints()); + pointsLogsEntity.setUserId(checkDTO.getUserId()); + pointsLogsEntity.setLavePoints(updateUserDTO.getPoints() + pointsLogsEntity.getPoints()); + Result userResult = userInfoFeignClient.updateUserInfo(updateUserDTO); + if (userResult.success()) { + // 用户积分记录 + Result pointResult = pointsFeignClient.addPointsLog(pointsLogsEntity); + if(pointResult.success()){ + return new Result(); + } else { + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new Result().error("积分记录增加失败。"); + } + + } else { + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new Result().error("用户信息更新失败。"); + } + + } else { + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new Result().error("用户信息获取失败。"); + } + + } + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActUserClockLogDTO dto) { + ActUserClockLogEntity entity = ConvertUtils.sourceToTarget(dto, ActUserClockLogEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 活动打卡 + * @param appActUserClockLogDTO + * @return + */ + @Override + public Result activityClock(AppActUserClockLogDTO appActUserClockLogDTO) { + //查询人员活动关系Id + ActUserRelationDTO actUserRelationDTO = actUserRelationService.getActUserRelationId(appActUserClockLogDTO.getUserId(),appActUserClockLogDTO.getActId()); + ActUserClockLogDTO actUserClockLogDTO = ConvertUtils.sourceToTarget(appActUserClockLogDTO, ActUserClockLogDTO.class); + if(actUserRelationDTO.getId() == null){ + return new Result().error("打卡失败"); + } + actUserClockLogDTO.setActUserId(actUserRelationDTO.getId()); + actUserClockLogDTO.setClockTime(new Date()); + //存储打卡日志 + ActUserClockLogEntity entity = ConvertUtils.sourceToTarget(actUserClockLogDTO, ActUserClockLogEntity.class); + insert(entity); + String clockId = entity.getId(); + //存储活动日志表 epdc_act_user_log + ActUserLogDTO actUserLogDTO = new ActUserLogDTO(); + actUserLogDTO.setUserId(actUserRelationDTO.getUserId()); + actUserLogDTO.setActId(actUserRelationDTO.getActId()); + actUserLogDTO.setOperationType("2");//打卡 + actUserLogDTO.setOperationTime(new Date()); + actUserLogService.save(actUserLogDTO); + //更新人员活动关系表当前状态 + actUserRelationDTO.setStatus("2"); + actUserRelationService.updateActivityStatus(actUserRelationDTO); + //存储打卡图片 + List imgList = appActUserClockLogDTO.getImages(); + for(int i = 0 ; i < imgList.size() ; i++){ + String imgUrl = imgList.get(i); + ActClockPicDTO actClockPicDTO = new ActClockPicDTO(); + actClockPicDTO.setClockId(clockId); + actClockPicDTO.setClockPic(imgUrl); + actClockPicService.save(actClockPicDTO); + } + return new Result().ok("打卡成功"); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserLogServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserLogServiceImpl.java new file mode 100644 index 000000000..e06e4f44d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserLogServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.modules.activity.dao.ActUserLogDao; +import com.elink.esua.epdc.activity.ActUserLogDTO; +import com.elink.esua.epdc.modules.activity.entity.ActUserLogEntity; +import com.elink.esua.epdc.modules.activity.redis.ActUserLogRedis; +import com.elink.esua.epdc.modules.activity.service.ActUserLogService; +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 qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Service +public class ActUserLogServiceImpl extends BaseServiceImpl implements ActUserLogService { + + @Autowired + private ActUserLogRedis actUserLogRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActUserLogDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActUserLogDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ActUserLogDTO get(String id) { + ActUserLogEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActUserLogDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActUserLogDTO dto) { + ActUserLogEntity entity = ConvertUtils.sourceToTarget(dto, ActUserLogEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActUserLogDTO dto) { + ActUserLogEntity entity = ConvertUtils.sourceToTarget(dto, ActUserLogEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserPointsLogServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserPointsLogServiceImpl.java new file mode 100644 index 000000000..4a4fac224 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserPointsLogServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.activity.ActUserPointsLogDTO; +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.modules.activity.dao.ActUserPointsLogDao; +import com.elink.esua.epdc.modules.activity.entity.ActUserPointsLogEntity; +import com.elink.esua.epdc.modules.activity.redis.ActUserPointsLogRedis; +import com.elink.esua.epdc.modules.activity.service.ActUserPointsLogService; +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 qu qu@elink-cn.com + * @since v1.0.0 2019-12-21 + */ +@Service +public class ActUserPointsLogServiceImpl extends BaseServiceImpl implements ActUserPointsLogService { + + @Autowired + private ActUserPointsLogRedis actUserPointsLogRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActUserPointsLogDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActUserPointsLogDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ActUserPointsLogDTO get(String id) { + ActUserPointsLogEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActUserPointsLogDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActUserPointsLogDTO dto) { + ActUserPointsLogEntity entity = ConvertUtils.sourceToTarget(dto, ActUserPointsLogEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActUserPointsLogDTO dto) { + ActUserPointsLogEntity entity = ConvertUtils.sourceToTarget(dto, ActUserPointsLogEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java new file mode 100644 index 000000000..1c460767b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java @@ -0,0 +1,300 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.activity.*; +import com.elink.esua.epdc.activity.form.ActUserRelationAuditFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoClockResultDTO; +import com.elink.esua.epdc.activity.result.ActUserClockResultDTO; +import com.elink.esua.epdc.activity.result.ActUserRelationResultDTO; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +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.utils.Result; +import com.elink.esua.epdc.constant.ActStateConstant; +import com.elink.esua.epdc.modules.activity.dao.ActUserRelationDao; +import com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity; +import com.elink.esua.epdc.modules.activity.redis.ActUserRelationRedis; +import com.elink.esua.epdc.modules.activity.service.ActInfoService; +import com.elink.esua.epdc.modules.activity.service.ActUserLogService; +import com.elink.esua.epdc.modules.activity.service.ActUserRelationService; +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.*; + +/** + * 用户活动关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Service +public class ActUserRelationServiceImpl extends BaseServiceImpl implements ActUserRelationService { + + @Autowired + private ActUserRelationRedis actUserRelationRedis; + + @Autowired + private ActUserLogService actUserLogService; + + @Autowired + private ActInfoService actInfoService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActUserRelationDTO.class); + } + @Override + public PageData getActUserRelationPageFromPC(Map params) { + IPage page = getPage(params); + List list = baseDao.getActUserRelationPageFromPC(params); + return new PageData<>(list, page.getTotal()); + } + @Override + public PageData getActUserClockPageFromPC(Map params) { + IPage page = getPage(params); + List list = baseDao.getActUserClockPageFromPC(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public ActInfoClockResultDTO getActDetail(String id) { + ActInfoClockResultDTO resultDTO = baseDao.getActDetail(id); + System.out.println(resultDTO); + return resultDTO; + } + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActUserRelationDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ActUserRelationDTO get(String id) { + ActUserRelationEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActUserRelationDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActUserRelationDTO dto) { + ActUserRelationEntity entity = ConvertUtils.sourceToTarget(dto, ActUserRelationEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActUserRelationDTO dto) { + ActUserRelationEntity entity = ConvertUtils.sourceToTarget(dto, ActUserRelationEntity.class); + updateById(entity); + } + @Override + @Transactional(rollbackFor = Exception.class) + public Result audit(ActUserRelationAuditFormDTO dto) { + ActUserRelationEntity entity = baseDao.selectById(dto.getId()); + if (ActStateConstant.ACT_USER_RELATION_STATUS_APPLY.equals(entity.getStatus())) { + ActUserRelationEntity updateEntity = new ActUserRelationEntity(); + updateEntity.setId(dto.getId()); + updateEntity.setStatus(dto.getStatus()); + updateEntity.setFailureReason(dto.getFailureReason()); + updateEntity.setAuditTime(new Date()); + updateById(updateEntity); + //存储活动日志表 epdc_act_user_log + ActUserLogDTO actUserLogDTO = new ActUserLogDTO(); + actUserLogDTO.setUserId(entity.getUserId()); + actUserLogDTO.setActId(entity.getActId()); + actUserLogDTO.setOperationType(dto.getStatus()); + actUserLogDTO.setFailureReason(dto.getFailureReason()); + actUserLogDTO.setOperationTime(new Date()); + actUserLogService.save(actUserLogDTO); + return new Result(); + } + return new Result().error("不可操作"); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public Result activitySignUp(ActUserRelationDTO actUserRelationDTO) { + + //查询是否已报名 + int data = baseDao.isSignUp(actUserRelationDTO.getUserId(),actUserRelationDTO.getActId()); + if(data == 0){ + //未报名该活动,进行报名 + //存储活动人员关系表 + ActUserRelationEntity entity = ConvertUtils.sourceToTarget(actUserRelationDTO, ActUserRelationEntity.class); + insert(entity); + //存储活动日志表 + ActUserLogDTO actUserLogDTO = new ActUserLogDTO(); + actUserLogDTO.setActId(actUserRelationDTO.getActId()); + actUserLogDTO.setUserId(actUserRelationDTO.getUserId()); + actUserLogDTO.setOperationType("0");//报名 + actUserLogDTO.setOperationTime(new Date()); + actUserLogService.save(actUserLogDTO); + + }else{ + return new Result().error("已报名"); + } + + return new Result().ok("报名成功"); + } + + @Override + public Result activityCancelSignUp(AppActUserCancelsignupDTO appActUserCancelsignupDTO) { + + //查询是否已报名 + List data = baseDao.selectOneActUserRelationInfo(appActUserCancelsignupDTO.getUserId(),appActUserCancelsignupDTO.getActId()); + if(data != null && data.size() > 0){ + ActUserRelationDTO actUserRelationDTO = data.get(0); + actUserRelationDTO.setStatus("3");//取消报名 + actUserRelationDTO.setFailureReason(appActUserCancelsignupDTO.getFailureReason());//取消报名原因 + //已报名该活动,进行取消报名 + //更新活动人员关系表 + ActUserRelationEntity entity = ConvertUtils.sourceToTarget(actUserRelationDTO, ActUserRelationEntity.class); + updateById(entity); + //存储活动日志表 + ActUserLogDTO actUserLogDTO = new ActUserLogDTO(); + actUserLogDTO.setActId(actUserRelationDTO.getActId()); + actUserLogDTO.setUserId(actUserRelationDTO.getUserId()); + actUserLogDTO.setOperationType("3");//取消报名 + actUserLogDTO.setOperationTime(new Date()); + actUserLogService.save(actUserLogDTO); + + }else{ + return new Result().error("未报名"); + } + + return new Result().ok("取消报名成功"); + } + + @Override + public ActUserRelationDTO getActUserRelationId(String userId,String actId) { + List data = baseDao.selectOneActUserRelationInfo(userId,actId); + ActUserRelationDTO actUserRelationDTO = new ActUserRelationDTO(); + if(data != null && data.size() > 0){ + actUserRelationDTO = data.get(0); + + } + return actUserRelationDTO; + } + + @Override + public Result updateActivityStatus(ActUserRelationDTO actUserRelationDTO) { + //更新活动人员关系表当前状态为打卡 + ActUserRelationEntity entity = ConvertUtils.sourceToTarget(actUserRelationDTO, ActUserRelationEntity.class); + updateById(entity); + return new Result().ok("更新成功"); + } + + @Override + public Result selectListActUserRelation(String actId) { + List list = baseDao.selectListActUserRelation(actId); + List resultList = new ArrayList(); + String[] idArr = new String[list.size()]; + for(int k = 0 ; k < list.size() ; k++){ + Map map = new HashMap(); + map.put("nickname",list.get(k).getNickname()); + map.put("faceImg",list.get(k).getFaceImg()); + map.put("partyFlag",list.get(k).getPartyFlag()); + map.put("clockDesc",list.get(k).getClockDesc()); + map.put("createdTime",list.get(k).getClockTime()); + map.put("clockId",list.get(k).getId() == null ? "" : list.get(k).getId()); + //查询打卡对应图片 + idArr[k] = list.get(k).getId(); + resultList.add(map); + } + List listLogImg = baseDao.selectListClockImg(idArr); + for(Object objMap : resultList){ + Map mm = (Map)objMap; + List imgList = new ArrayList(); + for(int i = listLogImg.size()-1 ; i >= 0 ; i--){ + if(mm.get("clockId").equals(listLogImg.get(i).getClockId())){ + imgList.add(listLogImg.get(i).getClockPic()); + listLogImg.remove(i); + } + } + mm.put("images",imgList); + mm.remove("clockId"); + } + AppClockListDTO appClockListDTO = new AppClockListDTO(); + appClockListDTO.setClockNum(resultList.size()); + appClockListDTO.setClocks(resultList); + return new Result().ok(appClockListDTO); + } + + /** + * 自动审核 + * @param actId + * @return + */ + @Override + public Result updateAuditDefaultStatus(String actId) { + // 根据actID查询活动开始未审核报名人默认状态 + ActInfoDTO actInfoDTO = actInfoService.get(actId); + String actUserDefaultState = actInfoDTO.getActUserDefaultState(); // 活动开始未审核报名人默认状态 + + // 查询已报名未审核的志愿者 + List data = baseDao.selectListActUserInfo(actId); + if(data != null && data.size() > 0){ + for(int i = 0 ; i < data.size() ; i++){ + // 更新人员活动关系表 + ActUserRelationDTO actUserRelationDTO = data.get(i); + actUserRelationDTO.setStatus(actUserDefaultState);// 默认状态 + ActUserRelationEntity entity = ConvertUtils.sourceToTarget(actUserRelationDTO, ActUserRelationEntity.class); + updateById(entity); + // 存储活动日志表 + ActUserLogDTO actUserLogDTO = new ActUserLogDTO(); + actUserLogDTO.setActId(actUserRelationDTO.getActId()); + actUserLogDTO.setUserId(actUserRelationDTO.getUserId()); + actUserLogDTO.setOperationType(actUserDefaultState);// 默认状态 + actUserLogDTO.setOperationTime(new Date()); + actUserLogService.save(actUserLogDTO); + } + }else{ + return new Result().ok("该活动暂时没有未审核的志愿者"); + } + + return new Result().ok("该活动对已报名的志愿者自动审核成功"); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/JobFeignClient.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/JobFeignClient.java new file mode 100644 index 000000000..06a84d45c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/JobFeignClient.java @@ -0,0 +1,37 @@ +package com.elink.esua.epdc.modules.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.ScheduleJobDTO; +import com.elink.esua.epdc.dto.UserDTO; +import com.elink.esua.epdc.modules.feign.fallback.JobFeignClientFallback; +import com.elink.esua.epdc.modules.feign.fallback.UserInfoFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + +/** + * + * 调用用户模块 + * + * @Author:wanggongfeng + * @Date:2019/12/16 17:36 + */ +@FeignClient(name = ServiceConstant.EPDC_JOB_SERVER, fallback = JobFeignClientFallback.class) +public interface JobFeignClient { + + + + /** + * 定时任务 + * + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @params [userDTO] + * @author liuchuang + * @since 2019/10/25 17:07 + */ + @PostMapping("job/schedule") + Result save(ScheduleJobDTO dto); + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/PointsFeignClient.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/PointsFeignClient.java new file mode 100644 index 000000000..077ec117c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/PointsFeignClient.java @@ -0,0 +1,25 @@ +package com.elink.esua.epdc.modules.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.logs.PointsLogsDTO; +import com.elink.esua.epdc.modules.feign.fallback.PointsFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +/** + * + * 调用用户模块 + * + * @Author:wanggongfeng + * @Date:2019/12/16 17:36 + */ +@FeignClient(name = ServiceConstant.EPDC_POINTS_SERVER, fallback = PointsFeignClientFallback.class) +public interface PointsFeignClient { + + @PostMapping("/points/pointslogs/addPointsLog") + Result addPointsLog(@RequestBody PointsLogsDTO dto); + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/UserInfoFeignClient.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/UserInfoFeignClient.java new file mode 100644 index 000000000..06d3e4b1a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/UserInfoFeignClient.java @@ -0,0 +1,39 @@ +package com.elink.esua.epdc.modules.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.UserDTO; +import com.elink.esua.epdc.modules.feign.fallback.UserInfoFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + +import java.util.List; + +/** + * + * 调用用户模块 + * + * @Author:wanggongfeng + * @Date:2019/12/16 17:36 + */ +@FeignClient(name = ServiceConstant.EPDC_USER_SERVER, fallback = UserInfoFeignClientFallback.class) +public interface UserInfoFeignClient { + + + @GetMapping("app-user/epdc-app/user/getById/{userId}") + Result getUserInfoById(@PathVariable("userId") String userId); + + /** + * 更新用户信息 + * + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @params [userDTO] + * @author liuchuang + * @since 2019/10/25 17:07 + */ + @PostMapping("app-user/epdc-app/user/updateUserInfo") + Result updateUserInfo(UserDTO userDTO); + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/JobFeignClientFallback.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/JobFeignClientFallback.java new file mode 100644 index 000000000..361d84639 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/JobFeignClientFallback.java @@ -0,0 +1,20 @@ +package com.elink.esua.epdc.modules.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.dto.ScheduleJobDTO; +import com.elink.esua.epdc.dto.UserDTO; +import com.elink.esua.epdc.modules.feign.JobFeignClient; +import com.elink.esua.epdc.modules.feign.UserInfoFeignClient; + +/** + * @author 86185 + */ +public class JobFeignClientFallback implements JobFeignClient { + + @Override + public Result save(ScheduleJobDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_JOB_SERVER, "save", dto); + } +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/PointsFeignClientFallback.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/PointsFeignClientFallback.java new file mode 100644 index 000000000..01597dd98 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/PointsFeignClientFallback.java @@ -0,0 +1,23 @@ +package com.elink.esua.epdc.modules.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.dto.logs.PointsLogsDTO; +import com.elink.esua.epdc.modules.feign.PointsFeignClient; +import org.springframework.stereotype.Component; + + +/** + * @Author:wanggongfeng + * @Date:2019/12/16 15:11 + */ +@Component +public class PointsFeignClientFallback implements PointsFeignClient { + + + @Override + public Result addPointsLog(PointsLogsDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_POINTS_SERVER, "addPointsLog", dto); + } +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/UserInfoFeignClientFallback.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/UserInfoFeignClientFallback.java new file mode 100644 index 000000000..65058a7ab --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/UserInfoFeignClientFallback.java @@ -0,0 +1,21 @@ +package com.elink.esua.epdc.modules.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.dto.UserDTO; +import com.elink.esua.epdc.modules.feign.UserInfoFeignClient; + +/** + * @author 86185 + */ +public class UserInfoFeignClientFallback implements UserInfoFeignClient { + @Override + public Result getUserInfoById(String userId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "getUserInfoById", userId); + } + @Override + public Result updateUserInfo(UserDTO userDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "updateUserInfo", userDTO); + } +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiManualScoreTempController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/controller/ActPhraseController.java similarity index 62% rename from esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiManualScoreTempController.java rename to esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/controller/ActPhraseController.java index 2686c98ac..a07ca3a68 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiManualScoreTempController.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/controller/ActPhraseController.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.elink.esua.epdc.controller; +package com.elink.esua.epdc.modules.phrases.controller; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; @@ -23,11 +23,11 @@ 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.KpiManualScoreTempDTO; -import com.elink.esua.epdc.excel.KpiManualScoreTempExcel; -import com.elink.esua.epdc.service.KpiManualScoreTempService; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.modules.phrases.excel.ActPhraseExcel; +import com.elink.esua.epdc.modules.phrases.service.ActPhraseService; +import com.elink.esua.epdc.phrases.ActPhraseDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -37,43 +37,44 @@ import java.util.Map; /** - * 绩效考核手动打分记录 + * 常用语表 * * @author qu qu@elink-cn.com - * @since v1.0.0 2019-12-06 + * @since v1.0.0 2019-12-11 */ @RestController -@RequestMapping("kpimanualscoretemp") -public class KpiManualScoreTempController { +@RequestMapping("actphrase") +public class ActPhraseController { @Autowired - private KpiManualScoreTempService kpiManualScoreTempService; + private ActPhraseService actPhraseService; @GetMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = kpiManualScoreTempService.page(params); - return new Result>().ok(page); + public Result> page(@RequestParam Map params){ + //PageData page = actPhraseService.page(params); + PageData page = actPhraseService.getPhrasePage(params); + return new Result>().ok(page); } @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ - KpiManualScoreTempDTO data = kpiManualScoreTempService.get(id); - return new Result().ok(data); + public Result get(@PathVariable("id") String id){ + ActPhraseDTO data = actPhraseService.get(id); + return new Result().ok(data); } @PostMapping - public Result save(@RequestBody KpiManualScoreTempDTO dto){ + public Result save(@RequestBody ActPhraseDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - kpiManualScoreTempService.save(dto); + actPhraseService.save(dto); return new Result(); } @PutMapping - public Result update(@RequestBody KpiManualScoreTempDTO dto){ + public Result update(@RequestBody ActPhraseDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - kpiManualScoreTempService.update(dto); + actPhraseService.update(dto); return new Result(); } @@ -81,14 +82,14 @@ public class KpiManualScoreTempController { public Result delete(@RequestBody String[] ids){ //效验数据 AssertUtils.isArrayEmpty(ids, "id"); - kpiManualScoreTempService.delete(ids); + actPhraseService.delete(ids); return new Result(); } @GetMapping("export") public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { - List list = kpiManualScoreTempService.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, KpiManualScoreTempExcel.class); + List list = actPhraseService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ActPhraseExcel.class); } } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/controller/AppActPhraseController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/controller/AppActPhraseController.java new file mode 100644 index 000000000..4e5630f8b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/controller/AppActPhraseController.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.phrases.controller; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.modules.phrases.entity.ActPhraseRedisEntity; +import com.elink.esua.epdc.modules.phrases.service.ActPhraseService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +/** + * 常用语表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11sagenumAddOneById + */ +@RestController +@RequestMapping("appactphrase") +public class AppActPhraseController { + + @Autowired + private ActPhraseService actPhraseService; + + /** + * 使用次数加一 + * @param id 常用语ID + * @return + */ + @GetMapping(value="sagenumAddOneById/{id}") + public Result sagenumAddOneById(@PathVariable("id")String id) { + actPhraseService.updateUsagenumAddOne(id); + return new Result().ok("使用次数加一成功"); + } + + /** + * redis获取常用语 + * @return + */ + @GetMapping(value="getPhraseList") + public Result getPhraseList() { + List object = actPhraseService.getPhraseList(); + return new Result().ok(object); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/dao/ActPhraseDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/dao/ActPhraseDao.java new file mode 100644 index 000000000..3076a6c2d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/dao/ActPhraseDao.java @@ -0,0 +1,53 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.phrases.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.phrases.entity.ActPhraseEntity; +import com.elink.esua.epdc.modules.phrases.entity.ActPhraseRedisEntity; +import com.elink.esua.epdc.phrases.ActPhraseDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 常用语表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Mapper +public interface ActPhraseDao extends BaseDao { + + /** + * 按序号顺序查询常用语 + * @return + */ + List selectListPhraseInOrder(); + + void updateUsagenumAddOne(@Param("id")String id); + + /** + * 条件查询 + * @param params + * @return + */ + List getPhrasePage(Map params); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/entity/ActPhraseEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/entity/ActPhraseEntity.java new file mode 100644 index 000000000..453fa00b7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/entity/ActPhraseEntity.java @@ -0,0 +1,63 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.phrases.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 常用语表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_act_phrase") +public class ActPhraseEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 常用语 + */ + private String phrase; + + /** + * 显示顺序 + */ + private Integer sort; + + /** + * 是否显示(0-否,1-是) + */ + private String showFlag; + + /** + * 使用次数 0 + */ + private Integer usageNum; + + /** + * code + */ + private String code; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/entity/ActPhraseRedisEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/entity/ActPhraseRedisEntity.java new file mode 100644 index 000000000..883ed5b53 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/entity/ActPhraseRedisEntity.java @@ -0,0 +1,46 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.phrases.entity; + +import lombok.Data; + +/** + * 常用语表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class ActPhraseRedisEntity { + + /** + * ID + */ + private String id; + + /** + * 常用语 + */ + private String phrase; + + /** + * code + */ + private String code; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/excel/ActPhraseExcel.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/excel/ActPhraseExcel.java new file mode 100644 index 000000000..c6b06076d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/excel/ActPhraseExcel.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.phrases.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 常用语表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class ActPhraseExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "常用语") + private String phrase; + + @Excel(name = "显示顺序") + private Integer sort; + + @Excel(name = "是否显示(0-否,1-是)") + private String showFlag; + + @Excel(name = "使用次数 0") + private Integer usageNum; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/redis/ActPhraseRedis.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/redis/ActPhraseRedis.java new file mode 100644 index 000000000..da46cccab --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/redis/ActPhraseRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.phrases.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 常用语表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Component +public class ActPhraseRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/service/ActPhraseService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/service/ActPhraseService.java new file mode 100644 index 000000000..d2724726a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/service/ActPhraseService.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.phrases.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.modules.phrases.entity.ActPhraseEntity; +import com.elink.esua.epdc.modules.phrases.entity.ActPhraseRedisEntity; +import com.elink.esua.epdc.phrases.ActPhraseDTO; + +import java.util.List; +import java.util.Map; + +/** + * 常用语表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +public interface ActPhraseService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-11 + */ + PageData page(Map params); + + /** + * 分页条件查询 + * @param params + * @return + */ + PageData getPhrasePage(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-11 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActPhraseDTO + * @author generator + * @date 2019-12-11 + */ + ActPhraseDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-11 + */ + void save(ActPhraseDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-11 + */ + void update(ActPhraseDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-11 + */ + void delete(String[] ids); + + /** + * 查询常用语,更新Radis + */ + void insertPhraseListToRedis(); + + /** + * 更新使用次数(+1) + * + * @param id + * @return void + * @author wanggongfeng + * @date 2019-12-12 + */ + void updateUsagenumAddOne(String id); + + /** + * 从redis直接读取常用语 + * @author wanggongfeng + * @date 2019-12-12 + * @return 常用语列表 + */ + List getPhraseList(); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/service/impl/ActPhraseServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/service/impl/ActPhraseServiceImpl.java new file mode 100644 index 000000000..3b564d17e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/service/impl/ActPhraseServiceImpl.java @@ -0,0 +1,201 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.phrases.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.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.exception.RenException; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.redis.RedisKeys; +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.modules.phrases.dao.ActPhraseDao; +import com.elink.esua.epdc.modules.phrases.entity.ActPhraseEntity; +import com.elink.esua.epdc.modules.phrases.entity.ActPhraseRedisEntity; +import com.elink.esua.epdc.modules.phrases.redis.ActPhraseRedis; +import com.elink.esua.epdc.modules.phrases.service.ActPhraseService; +import com.elink.esua.epdc.phrases.ActPhraseDTO; +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.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 常用语表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Service +public class ActPhraseServiceImpl extends BaseServiceImpl implements ActPhraseService { + + @Autowired + private ActPhraseRedis actPhraseRedis; + @Autowired + private RedisUtils redisUtils; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActPhraseDTO.class); + } + + /** + * 条件查询 + * @param params + * @return + */ + @Override + public PageData getPhrasePage(Map params) { + IPage page = getPage(params); + List list = baseDao.getPhrasePage(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActPhraseDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ActPhraseDTO get(String id) { + ActPhraseEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActPhraseDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActPhraseDTO dto) { + String categoryCode = dto.getCode(); + if (StringUtils.isNotBlank(categoryCode)) { + if (getCodeCount(dto) > 0) { + throw new RenException("您输入的编码已存在"); + } + } + ActPhraseEntity entity = ConvertUtils.sourceToTarget(dto, ActPhraseEntity.class); + insert(entity); + + //redis存储 + String key = RedisKeys.getPhraseListKey(); + redisUtils.delete(key); + List list = baseDao.selectListPhraseInOrder(); + redisUtils.set(key,list); + + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActPhraseDTO dto) { + ActPhraseEntity entity = ConvertUtils.sourceToTarget(dto, ActPhraseEntity.class); + updateById(entity); + + //redis存储 + String key = RedisKeys.getPhraseListKey(); + redisUtils.delete(key); + List list = baseDao.selectListPhraseInOrder(); + redisUtils.set(key,list); + + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + + //redis存储 + String key = RedisKeys.getPhraseListKey(); + redisUtils.delete(key); + List list = baseDao.selectListPhraseInOrder(); + redisUtils.set(key,list); + } + + /** + * 统计编码数量 + * @param dto + * @return + */ + public Integer getCodeCount(ActPhraseDTO dto) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("code", dto.getCode()); + String id = dto.getId(); + wrapper.ne(id != null, "id", dto.getId()); + wrapper.eq("del_flag", "0"); + return baseDao.selectCount(wrapper); + } + + /** + * 查询启动时需存入radis内的常用语 + * @return + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void insertPhraseListToRedis(){ + //redis存储 + String key = RedisKeys.getPhraseListKey(); + redisUtils.delete(key); + List list = baseDao.selectListPhraseInOrder(); + redisUtils.set(key,list); + } + + /** + * 使用次数加一 + * @param id + */ + @Override + public void updateUsagenumAddOne(String id){ + baseDao.updateUsagenumAddOne(id); + } + + /** + * 从redis直接读取常用语 + * @return + */ + @Override + public List getPhraseList(){ + String key = RedisKeys.getPhraseListKey(); + Object object = redisUtils.get(key); + List list = new ArrayList(); + if(object != null){ + list = (List)object; + } + return list; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/AppVolunteerRankController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/AppVolunteerRankController.java new file mode 100644 index 000000000..e7e699609 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/AppVolunteerRankController.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.controller; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; +import com.elink.esua.epdc.modules.volunteer.service.VolunteerRankService; +import com.elink.esua.epdc.volunteer.EpdcVolunteerRankDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + + +/** + * 志愿者排名接口 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@RestController +@RequestMapping("volunteer") +public class AppVolunteerRankController { + + @Autowired + private VolunteerRankService volunteerRankService; + + /** + * 获取排行榜 + * @return + */ + @GetMapping(value="leaderboard") + public Result> leaderboard() { + List list = volunteerRankService.leaderboard(); + return new Result().ok(list); + } + + /** + * 定时更新排行榜 + * @return + */ + @PostMapping(value="generateRankingList") + public Result generateRankingList(@RequestBody List list) { + return volunteerRankService.generateRankingList(list); + + } + + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/VolunteerRankController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/VolunteerRankController.java new file mode 100644 index 000000000..79398e8d2 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/VolunteerRankController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.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.volunteer.VolunteerRankDTO; +import com.elink.esua.epdc.modules.volunteer.excel.VolunteerRankExcel; +import com.elink.esua.epdc.modules.volunteer.service.VolunteerRankService; +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 qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@RestController +@RequestMapping("volunteerrank") +public class VolunteerRankController { + + @Autowired + private VolunteerRankService volunteerRankService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = volunteerRankService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + VolunteerRankDTO data = volunteerRankService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody VolunteerRankDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + volunteerRankService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody VolunteerRankDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + volunteerRankService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + volunteerRankService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = volunteerRankService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, VolunteerRankExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VolunteerRankDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VolunteerRankDao.java new file mode 100644 index 000000000..d56556bcf --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VolunteerRankDao.java @@ -0,0 +1,41 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.volunteer.entity.VolunteerRankEntity; +import com.elink.esua.epdc.volunteer.EpdcVolunteerRankDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 志愿者排名 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Mapper +public interface VolunteerRankDao extends BaseDao { + /** + * 获取排行榜 + * @Author wanggongfeng + * @return + */ + List leaderboard(); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/VolunteerRankEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/VolunteerRankEntity.java new file mode 100644 index 000000000..26201329d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/VolunteerRankEntity.java @@ -0,0 +1,92 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.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 qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_volunteer_rank") +public class VolunteerRankEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 排名 + */ + private Integer sort; + + /** + * 志愿者ID + */ + private String volunteerId; + + /** + * 用户ID + */ + private String userId; + + /** + * 头像 + */ + private String faceImg; + + /** + * 用户名 + */ + private String nickname; + + /** + * 是否党员(0-否,1-是) + */ + private String partyFlag; + + /** + * 爱心时长(单位:小时) + */ + private BigDecimal kindnessTime; + + /** + * 参加次数 + */ + private Integer participationNum; + + /** + * 排行生成日期 + */ + private Date generateDate; + + /** + * 是否显示(0-不显示,1-显示) + */ + private String showFlag; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/excel/VolunteerRankExcel.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/excel/VolunteerRankExcel.java new file mode 100644 index 000000000..c3e8854ce --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/excel/VolunteerRankExcel.java @@ -0,0 +1,87 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 志愿者排名 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Data +public class VolunteerRankExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "排名") + private Integer sort; + + @Excel(name = "志愿者ID") + private String volunteerId; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "头像") + private String faceImg; + + @Excel(name = "用户名") + private String nickname; + + @Excel(name = "是否党员(0-否,1-是)") + private String partyFlag; + + @Excel(name = "爱心时长(单位:小时)") + private BigDecimal kindnessTime; + + @Excel(name = "参加次数") + private Integer participationNum; + + @Excel(name = "排行生成日期") + private Date generateDate; + + @Excel(name = "是否显示(0-不显示,1-显示)") + private String showFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "删除标志") + private String delFlag; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/redis/VolunteerRankRedis.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/redis/VolunteerRankRedis.java new file mode 100644 index 000000000..df6b5e58b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/redis/VolunteerRankRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 志愿者排名 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Component +public class VolunteerRankRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VolunteerRankService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VolunteerRankService.java new file mode 100644 index 000000000..757a41d68 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VolunteerRankService.java @@ -0,0 +1,114 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.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.epdc.result.EpdcGetVolunteerRankDTO; +import com.elink.esua.epdc.modules.volunteer.entity.VolunteerRankEntity; +import com.elink.esua.epdc.volunteer.EpdcVolunteerRankDTO; +import com.elink.esua.epdc.volunteer.VolunteerRankDTO; + +import java.util.List; +import java.util.Map; + +/** + * 志愿者排名 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +public interface VolunteerRankService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return VolunteerRankDTO + * @author generator + * @date 2019-12-19 + */ + VolunteerRankDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-19 + */ + void save(VolunteerRankDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-19 + */ + void update(VolunteerRankDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-19 + */ + void delete(String[] ids); + + /** + * 获取排行榜 + * @Author wanggongfeng + * @return + */ + List leaderboard(); + + /** + * 生成排行榜 + * @Author wanggongfeng + * @return + */ + Result generateRankingList(List list); + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerRankServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerRankServiceImpl.java new file mode 100644 index 000000000..5b8434bd8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerRankServiceImpl.java @@ -0,0 +1,136 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.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.constant.FieldConstant; +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.utils.Result; +import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; +import com.elink.esua.epdc.modules.volunteer.dao.VolunteerRankDao; +import com.elink.esua.epdc.modules.volunteer.entity.VolunteerRankEntity; +import com.elink.esua.epdc.modules.volunteer.redis.VolunteerRankRedis; +import com.elink.esua.epdc.modules.volunteer.service.VolunteerRankService; +import com.elink.esua.epdc.volunteer.EpdcVolunteerRankDTO; +import com.elink.esua.epdc.volunteer.VolunteerRankDTO; +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 qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Service +public class VolunteerRankServiceImpl extends BaseServiceImpl implements VolunteerRankService { + + @Autowired + private VolunteerRankRedis volunteerRankRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, VolunteerRankDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, VolunteerRankDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public VolunteerRankDTO get(String id) { + VolunteerRankEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, VolunteerRankDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(VolunteerRankDTO dto) { + VolunteerRankEntity entity = ConvertUtils.sourceToTarget(dto, VolunteerRankEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(VolunteerRankDTO dto) { + VolunteerRankEntity entity = ConvertUtils.sourceToTarget(dto, VolunteerRankEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 获取排行榜 + * @Author wanggongfeng + * @return + */ + @Override + public List leaderboard(){ + List list = baseDao.leaderboard(); + return list; + } + + /** + * 更新排行榜 + * @Author wanggongfeng + * @return + */ + @Override + public Result generateRankingList(List list){ + if(list != null && list.size() > 0){ + for(int i = 0 ; i < list.size(); i++ ){ + EpdcGetVolunteerRankDTO epdcGetVolunteerRankDTO = list.get(i); + VolunteerRankEntity entity = ConvertUtils.sourceToTarget(epdcGetVolunteerRankDTO, VolunteerRankEntity.class); + insert(entity); + } + return new Result().ok("排名更新成功"); + } + return new Result().error("更新排名失败"); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/support/initbean/InitRedisCache.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/support/initbean/InitRedisCache.java new file mode 100644 index 000000000..53f4593c6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/support/initbean/InitRedisCache.java @@ -0,0 +1,19 @@ +package com.elink.esua.epdc.support.initbean; + +import com.elink.esua.epdc.modules.phrases.service.ActPhraseService; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class InitRedisCache implements InitializingBean { + + @Autowired + private ActPhraseService actPhraseService; + + @Override + public void afterPropertiesSet() throws Exception{ + //redis存储常用语 + actPhraseService.insertPhraseListToRedis(); + } +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/application.yml index b9b4844a1..c4484369e 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/application.yml +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/application.yml @@ -3,73 +3,17 @@ server: servlet: context-path: /heart +nacos: + config: + server-addr: @nacos.server-addr@ + type: YAML + namespace: @nacos.config.namespace@ + group: @nacos.config.group@ + dataId: epdc-heart-server + bootstrap: + enable: true + log: + enable: @nacos.config.bootstrap.log.enable@ spring: application: name: epdc-heart-server - # 环境 dev|test|prod - profiles: - active: @spring.profiles.active@ - messages: - encoding: UTF-8 - basename: i18n/messages,i18n/messages_common - jackson: - time-zone: GMT+8 - date-format: yyyy-MM-dd HH:mm:ss - redis: - database: @spring.redis.index@ - host: @spring.redis.host@ - timeout: 30s - port: @spring.redis.port@ - password: @spring.redis.password@ - cloud: - nacos: - discovery: - server-addr: @nacos.server-addr@ - register-enabled: @nacos.register-enabled@ - alibaba: - seata: - tx-service-group: epdc-heart-server-fescar-service-group - datasource: - druid: - driver-class-name: com.mysql.jdbc.Driver - url: @spring.datasource.druid.url@ - username: @spring.datasource.druid.username@ - password: @spring.datasource.druid.password@ - zipkin: - # 指定了 zipkin 服务器的地址 - base-url: @spring.zipkin.base-url@ - sleuth: - sampler: - # 将采样比例设置为 1.0,也就是全部都需要。默认是 0.1 - probability: 1.0 - - -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: ALWAYS - -mybatis-plus: - mapper-locations: classpath:/mapper/**/*.xml - #实体扫描,多个package用逗号或者分号分隔 - typeAliasesPackage: io.renren.entity;com.elink.esua.epdc.entity - global-config: - #数据库相关配置 - db-config: - #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; - id-type: ID_WORKER - #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" - field-strategy: NOT_NULL - #驼峰下划线转换 - column-underline: true - banner: false - #原生配置 - configuration: - map-underscore-to-camel-case: true - cache-enabled: false - call-setters-on-nulls: true - jdbc-type-for-null: 'null' diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActBannerDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActBannerDao.xml new file mode 100644 index 000000000..bf9d8c9bc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActBannerDao.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActClockPicDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActClockPicDao.xml new file mode 100644 index 000000000..37dd9f15b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActClockPicDao.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActInfoDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActInfoDao.xml new file mode 100644 index 000000000..4e7e5db2a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActInfoDao.xml @@ -0,0 +1,456 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserClockLogDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserClockLogDao.xml new file mode 100644 index 000000000..6ff7c0236 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserClockLogDao.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserLogDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserLogDao.xml new file mode 100644 index 000000000..b46b94d6c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserLogDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserPointsLogDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserPointsLogDao.xml new file mode 100644 index 000000000..7410a2662 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserPointsLogDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml new file mode 100644 index 000000000..20aedc5a0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml @@ -0,0 +1,249 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/phrases/ActPhraseDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/phrases/ActPhraseDao.xml new file mode 100644 index 000000000..084868edf --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/phrases/ActPhraseDao.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + update epdc_act_phrase set USAGE_NUM = USAGE_NUM + 1 where id = #{id} + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/volunteer/VolunteerRankDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/volunteer/VolunteerRankDao.xml new file mode 100644 index 000000000..ad0ac000e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/volunteer/VolunteerRankDao.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/registry.conf b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/registry.conf index 9cfedf9cc..fb64abd71 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/registry.conf +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/registry.conf @@ -3,7 +3,7 @@ registry { type = "nacos" nacos { - serverAddr = "47.104.224.45" + serverAddr = "@nacos.server-addr@" namespace = "public" cluster = "default" } @@ -14,7 +14,7 @@ config { type = "nacos" nacos { - serverAddr = "47.104.224.45" + serverAddr = "@nacos.server-addr@" namespace = "public" cluster = "default" } diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-client/pom.xml b/esua-epdc/epdc-module/epdc-job/epdc-job-client/pom.xml index 1bd888898..65c2e075d 100644 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-client/pom.xml +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-client/pom.xml @@ -18,6 +18,11 @@ epdc-commons-tools 1.0.0 + + com.esua.epdc + epdc-user-client + 1.0.0 + diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/Dockerfile b/esua-epdc/epdc-module/epdc-job/epdc-job-server/Dockerfile new file mode 100755 index 000000000..d9a1f64c6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/Dockerfile @@ -0,0 +1,20 @@ +# 基础镜像 +FROM adoptopenjdk/openjdk11 +# 作者 +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} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/pom.xml b/esua-epdc/epdc-module/epdc-job/epdc-job-server/pom.xml index b5e3eb9bc..281578289 100644 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/pom.xml @@ -75,6 +75,10 @@ springfox-swagger-ui ${swagger.version} + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + io.github.openfeign @@ -141,7 +145,7 @@ true - + + + 9061 + 47.104.224.45:8848 + 513d6635-3cfe-401f-b8b6-a04417288f47 + EPDC_CONFIG_GROUP + true test - + + + 9061 + 47.104.224.45:8848 + 6a3577b4-7b79-43f6-aebb-9c3f31263f6a + EPDC_CONFIG_GROUP + true diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/controller/ScheduleJobController.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/controller/ScheduleJobController.java index 26c92a43c..e0ec14bec 100644 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/controller/ScheduleJobController.java +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/controller/ScheduleJobController.java @@ -67,6 +67,7 @@ public class ScheduleJobController { @ApiOperation("保存") @LogOperation("保存") public Result save(@RequestBody ScheduleJobDTO dto){ + dto.setId(null); ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); scheduleJobService.save(dto); diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/dao/ScheduleJobDao.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/dao/ScheduleJobDao.java index e537a63db..4d5e139ff 100644 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/dao/ScheduleJobDao.java +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/dao/ScheduleJobDao.java @@ -8,10 +8,10 @@ package com.elink.esua.epdc.dao; -import com.elink.esua.epdc.entity.ScheduleJobEntity; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.entity.ScheduleJobEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.Map; @@ -27,4 +27,9 @@ public interface ScheduleJobDao extends BaseDao { * 批量更新状态 */ int updateBatch(Map map); + + /** + * 根据params删除某一个定时任务 + */ + void deleteJobByParams(@Param("params")String params); } diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/HeartFeignClient.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/HeartFeignClient.java new file mode 100644 index 000000000..230d38575 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/HeartFeignClient.java @@ -0,0 +1,40 @@ +package com.elink.esua.epdc.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; +import com.elink.esua.epdc.feign.fallback.HeartFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + +import java.util.List; + +/** + * + * 调用用户模块 + * + * @Author:wanggongfeng + * @Date:2019/12/16 17:36 + */ +@FeignClient(name = ServiceConstant.EPDC_HEART_SERVER, fallback = HeartFeignClientFallback.class) +public interface HeartFeignClient { + + /** + * 更新当日排行榜 + * + * @return + */ + @PostMapping("heart/volunteer/generateRankingList") + Result generateRankingList(List list); + + /** + * 活动时间到自动审核通过未审核的报名人员 + * + * @return + */ + @GetMapping("heart/appactuserrelation/AutoAuditActUser/{actId}") + Result AutoAuditActUser(@PathVariable("actId") String actId); + +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/KpiFeignClient.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/KpiFeignClient.java new file mode 100644 index 000000000..61b783185 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/KpiFeignClient.java @@ -0,0 +1,48 @@ +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.KpiFeignClientFallBack; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; + +/** + * @author: qushutong + * @Date: 2019/12/12 18:46 + * @Description: kpi模块 + */ +@FeignClient(name = ServiceConstant.EPDC_KPI_SERVER, fallback = KpiFeignClientFallBack.class) +public interface KpiFeignClient { + + /*** + * 调用kpi模块执行获取元数据的定时任务 + * @param kpiScheduleCode + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author qushutong + * @date 2019/12/12 18:55 + */ + @GetMapping("kpi/metaData/buildMetaData/{kpiScheduleCode}") + Result runKpiMateData(@PathVariable("kpiScheduleCode") String kpiScheduleCode); + + /** + * 根据规则编码启动公式计算 + * + * @param ruleCode + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2019/12/25 14:06 + */ + @GetMapping("kpi/rule/calcByCode/{ruleCode}") + Result startTaskByRuleCode(@PathVariable("ruleCode") String ruleCode); + + /** + * 将手动打分存入元数据表 + * + * @return void + * @author work@yujt.net.cn + * @date 2019/12/25 14:06 + */ + @GetMapping("kpi/manualScore/initMetaData") + Result manualScoreToMetaData(); +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java new file mode 100644 index 000000000..975afbe24 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java @@ -0,0 +1,48 @@ +package com.elink.esua.epdc.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.UserDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; +import com.elink.esua.epdc.feign.fallback.UserFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + +import java.util.List; + +/** + * + * 调用用户模块 + * + * @Author:wanggongfeng + * @Date:2019/12/16 17:36 + */ +@FeignClient(name = ServiceConstant.EPDC_USER_SERVER, fallback = UserFeignClientFallback.class) +public interface UserFeignClient { + + /** + * 获取当日排行榜 + * + * @return + */ + @GetMapping("app-user/epdc-app/volunteerinfo/getRankingList") + Result> getRankingList(); + + + @GetMapping("app-user/epdc-app/user/getById/{userId}") + Result getUserInfoById(@PathVariable("userId") String userId); + + /** + * 更新用户信息 + * + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @params [userDTO] + * @author liuchuang + * @since 2019/10/25 17:07 + */ + @PostMapping("app-user/epdc-app/user/updateUserInfo") + Result updateUserInfo(UserDTO userDTO); + +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/HeartFeignClientFallback.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/HeartFeignClientFallback.java new file mode 100644 index 000000000..0bcf90b3f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/HeartFeignClientFallback.java @@ -0,0 +1,39 @@ +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.dto.epdc.result.EpdcGetVolunteerRankDTO; +import com.elink.esua.epdc.feign.HeartFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @Author:wanggongfeng + * @Date:2019/12/16 15:11 + */ +@Component +public class HeartFeignClientFallback implements HeartFeignClient { + + /** + * 更新排行榜 + * + * @return + */ + @Override + public Result generateRankingList(List list) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "generateRankingList",list); + } + + /** + * 活动时间到自动审核通过未审核的报名人员 + * + * @return + */ + @Override + public Result AutoAuditActUser(String actId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "AutoAuditActUser",actId); + } + +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/KpiFeignClientFallBack.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/KpiFeignClientFallBack.java new file mode 100644 index 000000000..7dd9ef2ad --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/KpiFeignClientFallBack.java @@ -0,0 +1,27 @@ +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.KpiFeignClient; +import org.springframework.stereotype.Component; + + +@Component +public class KpiFeignClientFallBack implements KpiFeignClient { + + @Override + public Result runKpiMateData(String kpiScheduleCode) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_KPI_SERVER, "runKpiMateData", kpiScheduleCode); + } + + @Override + public Result startTaskByRuleCode(String ruleCode) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_KPI_SERVER, "startTaskByRuleCode", ruleCode); + } + + @Override + public Result manualScoreToMetaData() { + return ModuleUtils.feignConError(ServiceConstant.EPDC_KPI_SERVER, "manualScoreToMetaData", ""); + } +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java new file mode 100644 index 000000000..d3ab4b71f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java @@ -0,0 +1,37 @@ +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.dto.UserDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; +import com.elink.esua.epdc.feign.UserFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @Author:wanggongfeng + * @Date:2019/12/16 15:11 + */ +@Component +public class UserFeignClientFallback implements UserFeignClient { + + /** + * 获取排行榜 + * + * @return + */ + @Override + public Result> getRankingList() { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "getRankingList"); + } + @Override + public Result getUserInfoById(String userId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "getUserInfoById", userId); + } + @Override + public Result updateUserInfo(UserDTO userDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "updateUserInfo", userDTO); + } +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/ActivityService.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/ActivityService.java new file mode 100644 index 000000000..44fee92f4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/ActivityService.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.tools.utils.Result; + +/** + * 定时更新排行榜 + * + * @author Mark sunlightcs@gmail.com + */ +public interface ActivityService { + + /** + * 活动时间到自动审核通过未审核的报名人员 + * @Author wanggongfeng + * @return + */ + Result AutoAuditActUser(String actId); + +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/ScheduleJobKpiService.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/ScheduleJobKpiService.java new file mode 100644 index 000000000..dc6ba6803 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/ScheduleJobKpiService.java @@ -0,0 +1,37 @@ +package com.elink.esua.epdc.service; + +/** + * @author: qushutong + * @Date: 2019/12/12 16:52 + * @Description: kpi 模块查原始数据 + */ +public interface ScheduleJobKpiService { + + /*** + * 启动kpi模块获取原始数据 + * @param params + * @return void + * @author qushutong + * @date 2019/12/12 16:56 + */ + void startKpiMetaData(String params); + + /** + * 启动与规则编码匹配的相关任务 + * + * @param ruleCode + * @return void + * @author work@yujt.net.cn + * @date 2019/12/17 14:43 + */ + void startTaskByRuleCode(String ruleCode); + + /** + * 将手动打分存入元数据表 + * + * @return void + * @author work@yujt.net.cn + * @date 2019/12/25 14:05 + */ + void manualScoreToMetaData(); +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/ScheduleJobService.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/ScheduleJobService.java index 66b96fff4..a8ff4a1c9 100644 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/ScheduleJobService.java +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/ScheduleJobService.java @@ -8,7 +8,6 @@ package com.elink.esua.epdc.service; -import com.elink.esua.epdc.entity.ScheduleJobEntity; import com.elink.esua.epdc.commons.mybatis.service.BaseService; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.dto.ScheduleJobDTO; @@ -61,4 +60,9 @@ public interface ScheduleJobService extends BaseService { * 恢复运行 */ void resume(Long[] ids); + + /** + * 根据params删除某一个定时任务 + */ + void deleteJobByParams(String params); } diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/VolunteerService.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/VolunteerService.java new file mode 100644 index 000000000..ce6343dd5 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/VolunteerService.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.tools.utils.Result; + +/** + * 定时更新排行榜 + * + * @author Mark sunlightcs@gmail.com + */ +public interface VolunteerService { + + /** + * 生成排行榜 + * @Author wanggongfeng + * @return + */ + Result generateRankingList(); + +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ActivityServiceImpl.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ActivityServiceImpl.java new file mode 100644 index 000000000..ba4cc19b9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ActivityServiceImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service.impl; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.feign.HeartFeignClient; +import com.elink.esua.epdc.feign.UserFeignClient; +import com.elink.esua.epdc.service.ActivityService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class ActivityServiceImpl implements ActivityService { + + @Autowired + private UserFeignClient userFeignClient; + + @Autowired + private HeartFeignClient heartFeignClient; + + /** + * 活动时间到自动审核通过未审核的报名人员 + * @Author wanggongfeng + * @return + */ + @Override + public Result AutoAuditActUser(String actId){ + return heartFeignClient.AutoAuditActUser(actId); + } + +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ScheduleJobKpiServiceImpl.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ScheduleJobKpiServiceImpl.java new file mode 100644 index 000000000..54346653e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ScheduleJobKpiServiceImpl.java @@ -0,0 +1,33 @@ +package com.elink.esua.epdc.service.impl; + +import com.elink.esua.epdc.feign.KpiFeignClient; +import com.elink.esua.epdc.service.ScheduleJobKpiService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @author: qushutong + * @Date: 2019/12/12 16:53 + * @Description: 查询gridId + */ +@Component +public class ScheduleJobKpiServiceImpl implements ScheduleJobKpiService { + + @Autowired + private KpiFeignClient kpiFeignClient; + + @Override + public void startKpiMetaData(String params) { + kpiFeignClient.runKpiMateData(params); + } + + @Override + public void startTaskByRuleCode(String ruleCode) { + kpiFeignClient.startTaskByRuleCode(ruleCode); + } + + @Override + public void manualScoreToMetaData() { + kpiFeignClient.manualScoreToMetaData(); + } +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ScheduleJobServiceImpl.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ScheduleJobServiceImpl.java index 6ca410703..5e31f78e8 100644 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ScheduleJobServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ScheduleJobServiceImpl.java @@ -130,4 +130,10 @@ public class ScheduleJobServiceImpl extends BaseServiceImpl> result = userFeignClient.getRankingList(); + List list = result.getData(); + return heartFeignClient.generateRankingList(list); + } + +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/KpiManualScoreTask.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/KpiManualScoreTask.java new file mode 100644 index 000000000..acdc82955 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/KpiManualScoreTask.java @@ -0,0 +1,31 @@ +package com.elink.esua.epdc.task; + +import com.elink.esua.epdc.service.ScheduleJobKpiService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 绩效考核规则的相关任务 + * + * @author work@yujt.net.cn + * @date 2019/12/17 14:40 + */ +@Component("kpiManualScoreTask") +public class KpiManualScoreTask implements ITask { + + @Autowired + private ScheduleJobKpiService kpiService; + + /** + * 将手动打分存入元数据表 + * @param ruleCode + * @return void + * @author work@yujt.net.cn + * @date 2019/12/25 14:02 + */ + @Override + public void run(String ruleCode) { + kpiService.manualScoreToMetaData(); + } +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/KpiMetaDataTask.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/KpiMetaDataTask.java new file mode 100644 index 000000000..43fd263f7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/KpiMetaDataTask.java @@ -0,0 +1,35 @@ +package com.elink.esua.epdc.task; + +import com.elink.esua.epdc.service.ScheduleJobKpiService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 绩效考核元数据统计任务 + * + * @author: qushutong + * @Date: 2019/12/12 16:50 + * @Description: kpi + */ +@Component("kpiMetaDataTask") +public class KpiMetaDataTask implements ITask { + + @Autowired + private ScheduleJobKpiService scheduleJobKpiService; + + /*** + * 查询所有gruidID 统计kpi元数据 + * @param params + * @return void + * @author qushutong + * @date 2019/12/12 16:51 + */ + @Override + public void run(String params) { + if (StringUtils.isNotBlank(params)) { + //群众反应问题网格响应数 总数 + scheduleJobKpiService.startKpiMetaData(params); + } + } +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/KpiRuleTask.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/KpiRuleTask.java new file mode 100644 index 000000000..6c5edf27a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/KpiRuleTask.java @@ -0,0 +1,34 @@ +package com.elink.esua.epdc.task; + +import com.elink.esua.epdc.service.ScheduleJobKpiService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 绩效考核规则的相关任务 + * + * @author work@yujt.net.cn + * @date 2019/12/17 14:40 + */ +@Component("kpiRuleTask") +public class KpiRuleTask implements ITask { + + @Autowired + private ScheduleJobKpiService kpiService; + + /** + * 根据规则编码执行计划任务 + * + * @param ruleCode + * @return void + * @author work@yujt.net.cn + * @date 2019/12/17 14:42 + */ + @Override + public void run(String ruleCode) { + if (StringUtils.isNotBlank(ruleCode)) { + kpiService.startTaskByRuleCode(ruleCode); + } + } +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/activity/AutoAuditActUserTask.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/activity/AutoAuditActUserTask.java new file mode 100644 index 000000000..44aca3e46 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/activity/AutoAuditActUserTask.java @@ -0,0 +1,31 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.task.activity; + +/** + * 志愿者排名 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +public interface AutoAuditActUserTask { + + void run(String actId); + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/activity/AutoAuditActUserTaskImpl.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/activity/AutoAuditActUserTaskImpl.java new file mode 100644 index 000000000..d75336440 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/activity/AutoAuditActUserTaskImpl.java @@ -0,0 +1,55 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.task.activity; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.service.ActivityService; +import com.elink.esua.epdc.service.ScheduleJobService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 自动审核通过未审核的报名人员 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Component("AutoAuditActUserTask") +public class AutoAuditActUserTaskImpl implements AutoAuditActUserTask { + + @Autowired + private ActivityService activityService; + + @Autowired + private ScheduleJobService scheduleJobService; + + @Override + public void run(String actId){ + //活动时间到自动审核通过未审核的报名人员 + Result result = activityService.AutoAuditActUser(actId); + + //删除对应job + if(result.getCode() == 0){ + scheduleJobService.deleteJobByParams(actId); + } + + + } + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/volunteer/UpdateVolunteerRankTask.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/volunteer/UpdateVolunteerRankTask.java new file mode 100644 index 000000000..fcba26c11 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/volunteer/UpdateVolunteerRankTask.java @@ -0,0 +1,31 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.task.volunteer; + +/** + * 志愿者排名 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +public interface UpdateVolunteerRankTask { + + void run(String param); + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/volunteer/UpdateVolunteerRankTaskImpl.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/volunteer/UpdateVolunteerRankTaskImpl.java new file mode 100644 index 000000000..667b19a78 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/volunteer/UpdateVolunteerRankTaskImpl.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.task.volunteer; + +import com.elink.esua.epdc.service.VolunteerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 定时更新志愿者排名 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Component("UpdateVolunteerRankTask") +public class UpdateVolunteerRankTaskImpl implements UpdateVolunteerRankTask { + + @Autowired + private VolunteerService volunteerService; + + @Override + public void run(String param){ + //每日定时更新排行榜 + volunteerService.generateRankingList(); + } + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/resources/application.yml index a54b30eaf..e4626638c 100644 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/resources/application.yml +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/resources/application.yml @@ -3,85 +3,17 @@ server: servlet: context-path: /job +nacos: + config: + server-addr: @nacos.server-addr@ + type: YAML + namespace: @nacos.config.namespace@ + group: @nacos.config.group@ + dataId: epdc-job-server + bootstrap: + enable: true + log: + enable: @nacos.config.bootstrap.log.enable@ spring: application: name: epdc-job-server - # 环境 dev|test|prod - profiles: - active: @spring.profiles.active@ - messages: - encoding: UTF-8 - basename: i18n/messages,i18n/messages_common - jackson: - time-zone: GMT+8 - date-format: yyyy-MM-dd HH:mm:ss - redis: - database: @spring.redis.index@ - host: @spring.redis.host@ - timeout: 30s - port: @spring.redis.port@ - password: @spring.redis.password@ - cloud: - nacos: - discovery: - server-addr: @nacos.server-addr@ - register-enabled: @nacos.register-enabled@ - alibaba: - seata: - tx-service-group: epdc-job-server-fescar-service-group - datasource: - druid: - driver-class-name: com.mysql.jdbc.Driver - url: @spring.datasource.druid.url@ - username: @spring.datasource.druid.username@ - password: @spring.datasource.druid.password@ - - -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: ALWAYS - -mybatis-plus: - mapper-locations: classpath:/mapper/**/*.xml - #实体扫描,多个package用逗号或者分号分隔 - typeAliasesPackage: io.renren.entity;com.elink.esua.epdc.entity - global-config: - #数据库相关配置 - db-config: - #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; - id-type: ID_WORKER - #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" - field-strategy: NOT_NULL - #驼峰下划线转换 - column-underline: true - banner: false - #原生配置 - configuration: - map-underscore-to-camel-case: true - cache-enabled: false - call-setters-on-nulls: true - jdbc-type-for-null: 'null' - -feign: - hystrix: - enabled: true - httpclient: - enabled: true - -hystrix: - command: - default: - execution: - isolation: - strategy: SEMAPHORE - thread: - timeoutInMilliseconds: 60000 #缺省为1000 - -ribbon: - ReadTimeout: 300000 - ConnectTimeout: 300000 diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/resources/mapper/ScheduleJobDao.xml b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/resources/mapper/ScheduleJobDao.xml index 57cb6edb5..836c17b76 100644 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/resources/mapper/ScheduleJobDao.xml +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/resources/mapper/ScheduleJobDao.xml @@ -11,4 +11,8 @@ + + delete from schedule_job where params = #{params} + + diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/constant/KpiFieldConstant.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/constant/KpiFieldConstant.java new file mode 100644 index 000000000..d8cb8cc3f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/constant/KpiFieldConstant.java @@ -0,0 +1,24 @@ +package com.elink.esua.epdc.constant; + +/** + * 绩效考核一些字段常量 + * + * @author work@yujt.net.cn + * @date 2019/12/18 19:41 + */ +public interface KpiFieldConstant { + + String RULE_ID = "RULE_ID"; + + String RULE_NAME = "RULE_NAME"; + String RULE_MODE = "RULE_MODE"; + String SCORE_START_DATE = "SCORE_START_DATE"; + String START_DATE = "START_DATE"; + String SCORE_END_DATE = "SCORE_END_DATE"; + String END_DATE = "END_DATE"; + String DEPT_ID = "DEPT_ID"; + String KPI_CYCLE = "KPI_CYCLE"; + + String REFERENCE_ID = "REFERENCE_ID"; + String DATA_CODE = "DATA_CODE"; +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/constant/KpiItemConstant.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/constant/KpiItemConstant.java new file mode 100644 index 000000000..01f512de4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/constant/KpiItemConstant.java @@ -0,0 +1,15 @@ +package com.elink.esua.epdc.constant; + +/** + * 绩效考核项目相关常量 + * + * @author work@yujt.net.cn + * @date 2019/12/17 10:35 + */ +public interface KpiItemConstant { + + String RESPOND_ITEM_TIME_LIMIT = "validCloseTime"; + + String CLOSE_ITEM_TIME_LIMIT = "validRespondTime"; + +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/constant/KpiScheduleCodeConstant.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/constant/KpiScheduleCodeConstant.java new file mode 100644 index 000000000..1a032642e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/constant/KpiScheduleCodeConstant.java @@ -0,0 +1,65 @@ +package com.elink.esua.epdc.constant; + +/** + * 考核规则编码常量 + * + * @author work@yujt.net.cn + * @date 2019/12/19 14:45 + */ +public interface KpiScheduleCodeConstant { + + /** + * 元数据统计:群众事件上报总数 与 被响应总数 + */ + String META_DATA_PEOPLE_REPORT_AMOUNT = "statPeopleReportAmount"; + /** + * 元数据统计:群众对网格问题办理 满意度评价 + */ + String META_DATA_PEOPLE_EVALUATION = "statPeopleEvaluation"; + /** + * 元数据统计:包括网格呼叫数,网格呼叫被响应数,网格呼叫被办结数 + */ + String META_DATA_ITEM_HANDLE_AMOUNT = "statItemHandleAmount"; + /** + * 元数据统计:网格对项目处理 满意度评价 + */ + String META_DATA_GRID_EVALUATION = "statGridEvaluation"; + + /** + * 考核规则:基础网格 平时工作成效得分 月度 + */ + String GRID_WORK_SCORE_MONTH = "calcGridWorkScoreByMonth"; + /** + * 考核规则:基础网格 平时工作成效得分 季度 + */ + String GRID_WORK_SCORE_QUARTER = "calcGridWorkScoreByQuarter"; + /** + * 考核规则:基础网格 平时工作成效得分 年度 + */ + String GRID_WORK_SCORE_YEAR = "calcGridWorkScoreByYear"; + /** + * 考核规则:基础网格 考核最终得分 月度 + */ + String GRID_FINAL_SCORE_MONTH = "calcGridFinalScoreByMonth"; + /** + * 考核规则:基础网格 考核最终得分 季度 + */ + String GRID_FINAL_SCORE_QUARTER = "calcGridFinalScoreByQuarter"; + /** + * 考核规则:基础网格 考核最终得分 年度 + */ + String GRID_FINAL_SCORE_YEAR = "calcGridFinalScoreByYear"; + /** + * 考核规则:街道/区直 考核最终得分 月度 + */ + String SUPERIOR_FINAL_SCORE_MONTH = "calcSuperiorFinalScoreByMonth"; + /** + * 考核规则:街道/区直 考核最终得分 季度 + */ + String SUPERIOR_FINAL_SCORE_QUARTER = "calcSuperiorFinalScoreByQuarter"; + /** + * 考核规则:街道/区直 考核最终得分 年度 + */ + String SUPERIOR_FINAL_SCORE_YEAR = "calcSuperiorFinalScoreByYear"; + +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/EventCountFromDTO.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/EventCountFromDTO.java new file mode 100644 index 000000000..8d27ad97f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/EventCountFromDTO.java @@ -0,0 +1,25 @@ +package com.elink.esua.epdc.dto; + + +import lombok.Data; + +import java.util.List; + +/** + * @author: qushutong + * @Date: 2019/12/17 10:23 + * @Description: kpi 群众反应问题数 + */ +@Data +public class EventCountFromDTO { + + /*** + * 所有网格 + */ + private List gridIdList; + + /*** + * 0 是群众反应问题总数 1 群众反应问题响应数 + */ + private String responseType; +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiManualScoreDTO.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiManualScoreDTO.java index 0626f2f75..11886c1d6 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiManualScoreDTO.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiManualScoreDTO.java @@ -18,9 +18,11 @@ package com.elink.esua.epdc.dto; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import javax.validation.constraints.Min; @@ -37,7 +39,7 @@ import javax.validation.constraints.NotEmpty; @Data public class KpiManualScoreDTO implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 866931079518321362L; /** * 主键 @@ -54,23 +56,25 @@ public class KpiManualScoreDTO implements Serializable { * 被打分的部门id */ @NotBlank(message = "考核部门id不能为空") - private String deptId; + private Long deptId; /** * 得分 */ @NotBlank(message = "得分不能为空") @Min(0) - private Integer score; + private BigDecimal score; /** * 考核起止日期 */ + @JSONField(format = "yyyy-MM-dd") private Date scoreStartDate; /** * 考核终止日期 */ + @JSONField(format = "yyyy-MM-dd") private Date scoreEndDate; /** @@ -123,6 +127,21 @@ public class KpiManualScoreDTO implements Serializable { */ private String allDeptNames; + /** + * 打分者的部门id + */ + private String creatorDeptName; + + /** + * 打分者的部门名称 + */ + private Long creatorDeptId; + + /** + * 被考核部门的网格长姓名 + */ + private String leaderName; + /** * 考核周期起始月 */ diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiManualScoreRuleDTO.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiManualScoreRuleDTO.java index d37d96a28..c55555435 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiManualScoreRuleDTO.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiManualScoreRuleDTO.java @@ -32,7 +32,7 @@ import java.math.BigDecimal; @Data public class KpiManualScoreRuleDTO implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -3127206787305914421L; /** * 主键 @@ -57,7 +57,7 @@ public class KpiManualScoreRuleDTO implements Serializable { /** * 满分 */ - private Integer fullMarks; + private BigDecimal fullMarks; /** * 乐观锁 diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiManualScoreTempDTO.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiManualScoreTempDTO.java index 1db797349..e1cd8e90f 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiManualScoreTempDTO.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiManualScoreTempDTO.java @@ -46,7 +46,7 @@ public class KpiManualScoreTempDTO implements Serializable { /** * 被打分的部门id */ - private String deptId; + private Long deptId; /** * 得分 diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiMetaDataDTO.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiMetaDataDTO.java new file mode 100644 index 000000000..6456a5b45 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiMetaDataDTO.java @@ -0,0 +1,113 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto; + +import java.io.Serializable; +import java.util.Date; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 绩效考核的元数据 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Data +public class KpiMetaDataDTO implements Serializable { + + private static final long serialVersionUID = -5970791269666802942L; + + /** + * 主键 + */ + private String id; + + /** + * 数据项编码 + */ + private String dataCode; + + /** + * 数据项名称 + */ + private String dataName; + + /** + * 元数据值 + */ + private BigDecimal dataValue; + + /** + * 考核周期(字典值 代表月,季,年) + */ + private String kpiCycle; + + /** + * 考核周期开始日 + */ + private Date startDate; + + /** + * 考核周期结束日 + */ + private Date endDate; + + /** + * 部门ID + */ + private Long deptId; + + /** + * 部门类别 + */ + private String deptTypeKey; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标记 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiResultGridDTO.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiResultGridDTO.java new file mode 100644 index 000000000..9a07190a3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiResultGridDTO.java @@ -0,0 +1,177 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 网格考核最终得分 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-12-17 + */ +@Data +public class KpiResultGridDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 手动打分得分 + */ + private BigDecimal manualScore; + + /** + * 工作得分 + */ + private BigDecimal workScore; + + /** + * 投票得分 + */ + private BigDecimal voteScore; + + /** + * 最终得分 + */ + private BigDecimal finalScore; + + /** + * 考核周期开始日 + */ + private Date startDate; + + /** + * 考核周期结束日 + */ + private Date endDate; + + /** + * 被考核部门的网格长姓名 + */ + private String leaderName; + + /** + * 考核周期(字典值 代表月,季,年) + */ + private String kpiCycle; + + /** + * 所有上级机构id + */ + private String parentDeptIds; + + /** + * 所有上级机构名称 + */ + private String parentDeptNames; + + /** + * 所有机构id + */ + private String allDeptIds; + + /** + * 所有机构名称 + */ + private String allDeptNames; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标记 + */ + private String delFlag; + + //虚字段 + + /** + * 街道名 + */ + private String street; + + /** + * 社区名 + */ + private String community; + + /** + * 网格名 + */ + private String grid; + + /** + * 伪列 + */ + private int rownum; + + /** + * 规则 + */ + private String rule; + + /** + * 详情 + */ + private String detail; + + + //虚字段----------------------- + + //考核周期开始日 + private String startDateString; + + //考核周期结束日 + private String endDateString; +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiResultSuperiorDTO.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiResultSuperiorDTO.java new file mode 100644 index 000000000..a66f37390 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiResultSuperiorDTO.java @@ -0,0 +1,144 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto; + +import java.io.Serializable; +import java.util.Date; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 街道或区直绩效考核最终得分 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-23 + */ +@Data +public class KpiResultSuperiorDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 网格ID + */ + private Long deptId; + + /** + * 最终得分 + */ + private BigDecimal finalScore; + + /** + * 考核周期开始日 + */ + private Date startDate; + + /** + * 考核周期结束日 + */ + private Date endDate; + + /** + * 考核周期(字典值 代表月,季,年) + */ + private String kpiCycle; + + /** + * 机构类别 + */ + private String deptTypeKey; + + /** + * 所有上级机构id + */ + private String parentDeptIds; + + /** + * 所有上级机构名称 + */ + private String parentDeptNames; + + /** + * 所有机构id + */ + private String allDeptIds; + + /** + * 所有机构名称 + */ + private String allDeptNames; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标记 + */ + private String delFlag; + + //虚字段----------------------- + + //考核周期开始日 + private String startDateString; + + //考核周期结束日 + private String endDateString; + + //详情页 网格呼叫事项总数 + private BigDecimal gridCallSuperiorAmount; + //详情页 响应网格呼叫事项数 + private BigDecimal gridCallSuperiorRespAmount; + //详情页 办结网格呼叫事项数 + private BigDecimal gridCallSuperiorCloseAmount; + //详情页 工作评议满意数 + private BigDecimal gridHighEvaluationAmount; + //详情页 工作评议基本满意数 + private BigDecimal gridMediumEvaluationAmount; + //详情页 工作评议不满意数 + private BigDecimal gridLowEvaluationAmount; +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiTimeLimitItemDTO.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiTimeLimitItemDTO.java index 57cdc6650..02ee5b09e 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiTimeLimitItemDTO.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiTimeLimitItemDTO.java @@ -53,7 +53,7 @@ public class KpiTimeLimitItemDTO implements Serializable { /** * 项目类别id */ - private String categoryId; + private Long categoryId; /** * 所有上级项目类别id @@ -108,6 +108,6 @@ public class KpiTimeLimitItemDTO implements Serializable { /** * 项目类别集合 */ - private List categoryIds; + private List categoryIds; } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/category/form/CategoryInfoFormDTO.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/form/CategoryInfoFormDTO.java similarity index 86% rename from esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/category/form/CategoryInfoFormDTO.java rename to esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/form/CategoryInfoFormDTO.java index 0d5221077..66915f16e 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/category/form/CategoryInfoFormDTO.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/form/CategoryInfoFormDTO.java @@ -1,4 +1,4 @@ -package com.elink.esua.epdc.dto.category.form; +package com.elink.esua.epdc.dto.form; import lombok.Data; diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/form/KpiMetaDataOfEventsFormDTO.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/form/KpiMetaDataOfEventsFormDTO.java new file mode 100644 index 000000000..5d919c060 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/form/KpiMetaDataOfEventsFormDTO.java @@ -0,0 +1,33 @@ +package com.elink.esua.epdc.dto.form; + +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * 参数:用于统计事件上报数与事件受理数 + * + * @author work@yujt.net.cn + * @date 2019/12/19 18:43 + */ +@Data +public class KpiMetaDataOfEventsFormDTO { + + private static final long serialVersionUID = 9029313054917612850L; + + /** + * 所有网格 + */ + private List deptIdList; + + /** + * 统计周期开始日 + */ + private Date startDate; + + /** + * 统计周期结束日 + */ + private Date endDate; +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/form/KpiRuleSaveOrUpdateFormDTO.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/form/KpiRuleSaveOrUpdateFormDTO.java index 061d241ab..ad68645e7 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/form/KpiRuleSaveOrUpdateFormDTO.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/form/KpiRuleSaveOrUpdateFormDTO.java @@ -56,6 +56,12 @@ public class KpiRuleSaveOrUpdateFormDTO implements Serializable { @NotBlank(message = "考核部门类别不能为空") private String deptTypeKey; + + /** + * 考核部门类别 + */ + private String[] deptTypeKeys; + /** * 乐观锁 */ diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/category/result/CategoryInfoResultDTO.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/CategoryInfoResultDTO.java similarity index 86% rename from esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/category/result/CategoryInfoResultDTO.java rename to esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/CategoryInfoResultDTO.java index dc7cdd7df..3f47137ec 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/category/result/CategoryInfoResultDTO.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/CategoryInfoResultDTO.java @@ -1,4 +1,4 @@ -package com.elink.esua.epdc.dto.category.result; +package com.elink.esua.epdc.dto.result; import lombok.Data; @@ -34,5 +34,5 @@ public class CategoryInfoResultDTO implements Serializable { /** * 所有上级分类名称,用逗号分开 */ - private List parentNames; + private String parentNames; } diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/ImportExcelErrorResultDTO.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/ImportExcelErrorResultDTO.java deleted file mode 100644 index d581645b6..000000000 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/ImportExcelErrorResultDTO.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.elink.esua.epdc.dto.result; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; - -import java.io.Serializable; - -/** - * @Description - * @Author yinzuomei - * @Date 2019/12/5 17:27 - */ -@Data -public class ImportExcelErrorResultDTO implements Serializable { - private static final long serialVersionUID = -6085396247858232510L; - - /** - * 错误数据行数 - */ - private String errorLine; - /** - * 错误数据信息 - */ - private String errorInfo; -} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiEvaluationAmountResultDTO.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiEvaluationAmountResultDTO.java new file mode 100644 index 000000000..b8aea5874 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiEvaluationAmountResultDTO.java @@ -0,0 +1,36 @@ +package com.elink.esua.epdc.dto.result; + +import lombok.Data; + + +/** + * 满意数统计结果 + * + * @author work@yujt.net.cn + * @date 2019/12/19 18:56 + */ +@Data +public class KpiEvaluationAmountResultDTO { + + private static final long serialVersionUID = 2661466688976182183L; + + /** + * 机构Id + */ + private Long deptId; + + /** + * 满意数 + */ + private Integer highAmount; + + /** + * 基本满意数 + */ + private Integer mediumAmount; + + /** + * 不满意数 + */ + private Integer lowAmount; +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiEventReportAmountResultDTO.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiEventReportAmountResultDTO.java new file mode 100644 index 000000000..80c31a4aa --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiEventReportAmountResultDTO.java @@ -0,0 +1,30 @@ +package com.elink.esua.epdc.dto.result; + +import lombok.Data; + + +/** + * 时间上报数统计结果 + * @author work@yujt.net.cn + * @date 2019/12/19 18:56 + */ +@Data +public class KpiEventReportAmountResultDTO { + + private static final long serialVersionUID = 9029313054917612850L; + + /** + * 网格Id + */ + private Long gridId; + + /** + * 事件上报数 + */ + private Integer reportAmount; + + /** + * 网格响应数 + */ + private Integer respondAmount; +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiItemHandleAmountResultDTO.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiItemHandleAmountResultDTO.java new file mode 100644 index 000000000..be2331930 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiItemHandleAmountResultDTO.java @@ -0,0 +1,30 @@ +package com.elink.esua.epdc.dto.result; + +import lombok.Data; + +/** + * 绩效考核统计:项目处理相关数量 + * + * @author work@yujt.net.cn + * @date 2019/12/23 10:50 + */ +@Data +public class KpiItemHandleAmountResultDTO { + + private static final long serialVersionUID = -4265085165992694474L; + /** + * 部门id + */ + private Long deptId; + + /** + * 元数据值(统计数) + */ + private Integer metaDataValue; + + /** + * 对应绩效考核元数据编码 + */ + private String metaDataCode; + +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiItemTimeLimitByDeptResultDTO.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiItemTimeLimitByDeptResultDTO.java new file mode 100644 index 000000000..1eba87670 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiItemTimeLimitByDeptResultDTO.java @@ -0,0 +1,48 @@ +package com.elink.esua.epdc.dto.result; + + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author: qushutong + * @Date: 2019/12/19 16:48 + * @Description: 项目 街道 时间规则绑定 + */ +@Data +public class KpiItemTimeLimitByDeptResultDTO implements Serializable { + + private static final long serialVersionUID = 3349393132985690393L; + + /*** + * 街道 区直 deptId + */ + private Long deptId; + + /*** + * 项目ID + */ + private String itemId; + + /*** + * 事件分类字典id + */ + private String catecoryId; + + /*** + * 创建时间 + */ + private Date createdTime; + + /** + * 有效响应时间(小时数) + */ + private Integer validRespondTime; + + /** + * 有效结案时间(小时数) + */ + private Integer validCloseTime; +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiManualScoreTemplateResultDTO.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiManualScoreTemplateResultDTO.java index cd5d571cb..682393607 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiManualScoreTemplateResultDTO.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiManualScoreTemplateResultDTO.java @@ -12,6 +12,7 @@ import java.util.Date; */ @Data public class KpiManualScoreTemplateResultDTO implements Serializable { + private static final long serialVersionUID = 3228442740296126765L; /** * 规则名称 @@ -33,43 +34,16 @@ public class KpiManualScoreTemplateResultDTO implements Serializable { */ private String grid; - /** - * 部门名称 - */ - private String deptName; - /** * 考核周期 */ private String kpiCycleName; - /** - * 考核起止日期 - */ - private String scoreStartTime; - - /** - * 考核终止日期 - */ - private String scoreEndTime; - /** * 得分 */ private Integer score; - /*********************************************************************************************************/ - - /** - * epdc_kpi_rule表主键 - */ - private String ruleId; - - /** - * 被打分的部门id - */ - private String deptId; - /** * 考核起止日期yyyy-MM-dd */ @@ -80,28 +54,5 @@ public class KpiManualScoreTemplateResultDTO implements Serializable { */ private Date scoreEndDate; - /** - * 所有父级部门id - */ - private String parentDeptIds; - - /** - * 所有父级部门名称 - */ - private String parentDeptNames; - /** - * 完整部门名称 - */ - private String allDeptNames; - - /** - * 完整部门id - */ - private String allDeptIds; - - /** - * 导出用户id - */ - private String userId; } diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiRuleQueryResultDTO.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiRuleQueryResultDTO.java index a25a78cbc..5c2eafe17 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiRuleQueryResultDTO.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/KpiRuleQueryResultDTO.java @@ -50,6 +50,11 @@ public class KpiRuleQueryResultDTO implements Serializable { */ private String deptTypeKey; + /** + * 考核部门类别 + */ + private String[] deptTypeKeys; + /** * 乐观锁 */ diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/enums/KpiCycleEnum.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/enums/KpiCycleEnum.java index 476e9196c..7f185372f 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/enums/KpiCycleEnum.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/enums/KpiCycleEnum.java @@ -1,44 +1,54 @@ package com.elink.esua.epdc.enums; +import org.apache.commons.lang3.StringUtils; + /** - * @Auther: yinzuomei + * @author: yinzuomei * @Date: 2019/12/5 12:41 * @Description: 考核周期枚举 */ public enum KpiCycleEnum { - /** - * 月month quarter year - */ - KPI_CYCLE_MONTH("month","月"), - /** - * 季 - */ - KPI_CYCLE_QUARTER("quarter","季"), - /** - * 年 - */ - KPI_CYCLE_YEAR("year","年"); - private String value; - private String name; - - KpiCycleEnum(String value, String name) { - this.value = value; - this.name = name; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } + /** + * 月month quarter year + */ + KPI_CYCLE_MONTH("month", "月"), + /** + * 季 + */ + KPI_CYCLE_QUARTER("quarter", "季"), + /** + * 年 + */ + KPI_CYCLE_YEAR("year", "年"); + + private String value; + + private String name; + + KpiCycleEnum(String value, String name) { + this.value = value; + this.name = name; + } + + public String getValue() { + return value; + } + + + public String getName() { + return name; + } + + public static KpiCycleEnum getByValue(String value){ + if(StringUtils.isNotBlank(value)){ + KpiCycleEnum[] enums = KpiCycleEnum.values(); + for (KpiCycleEnum kpiCycleEnum : enums) { + if(kpiCycleEnum.getValue().equals(value)){ + return kpiCycleEnum; + } + } + } + return null; + } + } diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/enums/KpiMetaDataEnum.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/enums/KpiMetaDataEnum.java new file mode 100644 index 000000000..b058b325c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/enums/KpiMetaDataEnum.java @@ -0,0 +1,116 @@ +package com.elink.esua.epdc.enums; + +import org.apache.commons.lang3.StringUtils; + +/** + * @author: qushutong + * @Date: 2019/12/17 19:53 + * @Description: 数据项名称 + */ +public enum KpiMetaDataEnum { + + /*** + * 群众反映问题总数 + */ + PEOPLE_REPORT_AMOUNT("people_report_amount", "群众反映问题总数"), + + /*** + * 群众反映问题被响应数 + */ + PEOPLE_REPORT_RESP_AMOUNT("people_report_resp_amount", "群众反映问题被响应数"), + + /*** + * 居民对项目处理评为“满意”的评价数量 + */ + PEOPLE_HIGH_EVALUATION_AMOUNT("people_high_evaluation_amount", "问题办理满意数"), + + /*** + * 居民对项目处理评为“基本满意”的评价数量 + */ + PEOPLE_MEDIUM_EVALUATION_AMOUNT("people_medium_evaluation_amount", "问题办理基本满意数"), + + /*** + * 居民对项目处理评为“不满意”的评价数量 + */ + PEOPLE_LOW_EVALUATION_AMOUNT("people_low_evaluation_amount", "问题办理不满意数"), + + /*** + * 履行抓基层党建工作得分(上级为网格打分) + */ + GRID_SCORE_BY_SUPERIOR_MANUAL("grid_score_by_superior_manual", "履行抓基层党建工作得分"), + + /*** + * 网格呼叫上级部门总数 + */ + GRID_CALL_SUPERIOR_AMOUNT("grid_call_superior_amount", "网格呼叫总数"), + + /*** + * 上级部门响应网格呼叫总数 + */ + GRID_CALL_SUPERIOR_RESP_AMOUNT("grid_call_superior_resp_amount", "网格呼叫被响应数"), + + /*** + * 上级部门办结网格呼叫总数 + */ + GRID_CALL_SUPERIOR_CLOSE_AMOUNT("grid_call_superior_close_amount", "网格呼叫被办结数"), + + /*** + * 网格对上级部门处理项目评为“满意” + */ + GRID_HIGH_EVALUATION_AMOUNT("grid_high_evaluation_amount", "网格评议满意数"), + + /*** + * 网格对上级部门处理项目评为“基本满意” + */ + GRID_MEDIUM_EVALUATION_AMOUNT("grid_medium_evaluation_amount", "网格评议基本满意数"), + + /*** + * 网格对上级部门处理项目评为“不满意” + */ + GRID_LOW_EVALUATION_AMOUNT("grid_low_evaluation_amount", "网格评议不满意数"), + + /*** + * 群众满意度投票,投票“满意”的数量 + */ + VOTE_HIGH_EVALUATION_AMOUNT("vote_high_evaluation_amount", "群众投票满意数"), + + /*** + * 群众满意度投票,投票“基本满意”的数量 + */ + VOTE_MEDIUM_EVALUATION_AMOUNT("vote_medium_evaluation_amount", "群众投票基本满意数"), + + /*** + * 群众满意度投票,投票“不满意”的数量 + */ + VOTE_LOW_EVALUATION_AMOUNT("vote_low_evaluation_amount", "群众投票不满意数"); + + + private String value; + + private String name; + + KpiMetaDataEnum(String value, String name) { + this.value = value; + this.name = name; + } + + public String getValue() { + return value; + } + + public String getName() { + return name; + } + + public static KpiMetaDataEnum getByValue(String value) { + if (StringUtils.isNotBlank(value)) { + KpiMetaDataEnum[] metaDataEnums = KpiMetaDataEnum.values(); + for (KpiMetaDataEnum metaDataEnum : metaDataEnums) { + if (value.equals(metaDataEnum.getValue())) { + return metaDataEnum; + } + } + } + return null; + } +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/enums/KpiResultGridDataEnum.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/enums/KpiResultGridDataEnum.java new file mode 100644 index 000000000..342d357c8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/enums/KpiResultGridDataEnum.java @@ -0,0 +1,50 @@ +package com.elink.esua.epdc.enums; + +/** + * @author: zy + * @Date: 2019/12/20 + * @Description: 数据项名称 + */ +public enum KpiResultGridDataEnum { + + /*** + * 履行抓基层党建工作职责得分 + */ + BASIC_LEVEL_WORK_SCORE("basic_level_work_score", "履行抓基层党建工作职责得分"), + + /*** + * 群众反映问题网格响应率得分 + */ + GRID_PROBLEM_RESPONSE_RATE_SCORE("grid_problem_response_rate_score","群众反映问题网格响应率得分"), + + /*** + * 群众反映问题网格办理满意率得分 + */ + GRID_PROBLEM_SATISFACTION_RATE_SCORE("grid_problem_satisfaction_rate_score","群众反映问题网格办理满意率得分"); + + + private String value; + + private String name; + + KpiResultGridDataEnum(String value, String name) { + this.value = value; + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/enums/KpiRuleModeEnum.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/enums/KpiRuleModeEnum.java new file mode 100644 index 000000000..0af051be1 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/enums/KpiRuleModeEnum.java @@ -0,0 +1,37 @@ +package com.elink.esua.epdc.enums; + +import com.elink.esua.epdc.commons.tools.constant.NumConstant; + +/** + * 规则来源枚举类 + * + * @author work@yujt.net.cn + * @date 2019/12/18 19:10 + */ +public enum KpiRuleModeEnum { + + /** + * 元公式 + */ + FORMULA(NumConstant.ZERO_STR), + + /** + * 手动打分 + */ + MANMUAL_SCORE(NumConstant.ONE_STR), + + /** + * 投票 + */ + VOTE(NumConstant.TWO_STR); + + private String value; + + KpiRuleModeEnum(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/pom.xml b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/pom.xml index 5faa821e5..d10257ab8 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/pom.xml @@ -20,7 +20,7 @@ com.esua.epdc - epdc-events-client + epdc-admin-client 1.0.0 @@ -50,7 +50,10 @@ spring-boot-admin-starter-client ${spring.boot.admin.version} - + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + @@ -112,10 +115,10 @@ true - + + + 9987 + 47.104.224.45:8848 + 513d6635-3cfe-401f-b8b6-a04417288f47 + EPDC_CONFIG_GROUP + true test - + + + 9987 + 47.104.224.45:8848 + 6a3577b4-7b79-43f6-aebb-9c3f31263f6a + EPDC_CONFIG_GROUP + true @@ -162,7 +179,7 @@ prod prod - 9987 + 9069 0 10.5.34.164 diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiFormulaController.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiFormulaController.java index 853f50dcc..c30b0a683 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiFormulaController.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiFormulaController.java @@ -44,7 +44,7 @@ import java.util.Map; * @since v1.0.0 2019-11-26 */ @RestController -@RequestMapping("kpiformula") +@RequestMapping("formula") public class KpiFormulaController { @Autowired diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiManualScoreController.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiManualScoreController.java index 9e0763fb8..b89448a82 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiManualScoreController.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiManualScoreController.java @@ -17,7 +17,9 @@ package com.elink.esua.epdc.controller; +import com.elink.esua.epdc.commons.mybatis.annotation.DataFilter; import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.DateUtils; 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; @@ -36,7 +38,6 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; -import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import java.util.Map; @@ -49,41 +50,41 @@ import java.util.Map; * @since v1.0.0 2019-12-04 */ @RestController -@RequestMapping("kpimanualscore") +@RequestMapping("manualScore") public class KpiManualScoreController { @Autowired private KpiManualScoreService kpiManualScoreService; - private SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");//设置日期格式 + @GetMapping("page") - public Result> page(@RequestParam Map params){ -// PageData page = kpiManualScoreService.page(params); + @DataFilter(prefix = "and", tableAlias = "kmc", isPendingCreator = false) + public Result> page(@RequestParam Map params) { PageData page = kpiManualScoreService.listKpiManualScoreResultDTO(params); return new Result>().ok(page); } @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ + public Result get(@PathVariable("id") String id) { KpiManualScoreDTO data = kpiManualScoreService.get(id); return new Result().ok(data); } @PostMapping - public Result save(@RequestBody KpiManualScoreDTO dto){ + public Result save(@RequestBody KpiManualScoreDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); return kpiManualScoreService.save(dto); } @PutMapping - public Result update(@RequestBody KpiManualScoreDTO dto){ + public Result update(@RequestBody KpiManualScoreDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); return kpiManualScoreService.update(dto); } @DeleteMapping - public Result delete(@RequestBody String[] ids){ + public Result delete(@RequestBody String[] ids) { //效验数据 AssertUtils.isArrayEmpty(ids, "id"); kpiManualScoreService.delete(ids); @@ -96,6 +97,19 @@ public class KpiManualScoreController { ExcelUtils.exportExcelToTarget(response, null, list, KpiManualScoreExcel.class); } + /** + * 导出打分模版前,校验选项 + * + * @param params + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2019/12/16 14:17 + */ + @GetMapping("checkExportTemplate") + public Result checkExportTemplate(@RequestParam Map params) { + return kpiManualScoreService.checkExportTemplate(params); + } + /** * @param params * @return void @@ -106,8 +120,8 @@ public class KpiManualScoreController { @GetMapping("exportTemplate") public void exportTemplate(@RequestParam Map params, HttpServletResponse response) throws Exception { List list = kpiManualScoreService.listKpiManualScoreTemplateResultDTO(params); - ExcelUtils.exportExcelToTarget(response, simpleDateFormat.format(new Date()), list, KpiManualScoreTemplateExcel.class); - + ExcelUtils.exportExcelToTarget(response, + DateUtils.format(new Date(), DateUtils.DATE_TIME_NO_SPLIT), list, KpiManualScoreTemplateExcel.class); } /** @@ -121,4 +135,17 @@ public class KpiManualScoreController { public Result importManualScoreExcel(@RequestParam("file") MultipartFile file) { return kpiManualScoreService.importManualScoreExcel(file); } + + /** + * 将手动打分初始化为元数据项 + * + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2019/12/25 14:10 + */ + @GetMapping("initMetaData") + public Result initManualScoreToMetaData() { + kpiManualScoreService.initManualScoreToMetaData(); + return new Result(); + } } diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiManualScoreRuleController.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiManualScoreRuleController.java index 64386d001..fc08d03b5 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiManualScoreRuleController.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiManualScoreRuleController.java @@ -44,7 +44,7 @@ import java.util.Map; * @since v1.0.0 2019-12-02 */ @RestController -@RequestMapping("kpimanualscorerule") +@RequestMapping("manualScoreRule") public class KpiManualScoreRuleController { @Autowired diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiMetaDataController.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiMetaDataController.java new file mode 100644 index 000000000..7c3a29434 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiMetaDataController.java @@ -0,0 +1,116 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.constant.KpiScheduleCodeConstant; +import com.elink.esua.epdc.dto.KpiMetaDataDTO; +import com.elink.esua.epdc.excel.KpiMetaDataExcel; +import com.elink.esua.epdc.service.KpiMetaDataService; +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 qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@RestController +@RequestMapping("metaData") +public class KpiMetaDataController { + + @Autowired + private KpiMetaDataService kpiMetaDataService; + + @GetMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = kpiMetaDataService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id) { + KpiMetaDataDTO data = kpiMetaDataService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody KpiMetaDataDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + kpiMetaDataService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody KpiMetaDataDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + kpiMetaDataService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + kpiMetaDataService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = kpiMetaDataService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, KpiMetaDataExcel.class); + } + + /*** + * 构建元数据 + * @param + * @return void + * @author qushutong + * @date 2019/12/16 10:17 + */ + @GetMapping("buildMetaData/{kpiScheduleCode}") + public Result buildMetaData(@PathVariable("kpiScheduleCode") String kpiScheduleCode) { + if (kpiScheduleCode.equals(KpiScheduleCodeConstant.META_DATA_PEOPLE_REPORT_AMOUNT)) { + kpiMetaDataService.statPeopleReportAmount(); + } else if (kpiScheduleCode.equals(KpiScheduleCodeConstant.META_DATA_PEOPLE_EVALUATION)) { + kpiMetaDataService.statPeopleEvaluation(); + } else if (kpiScheduleCode.equals(KpiScheduleCodeConstant.META_DATA_ITEM_HANDLE_AMOUNT)) { + kpiMetaDataService.statItemHandleAmount(); + } else if (kpiScheduleCode.equals(KpiScheduleCodeConstant.META_DATA_GRID_EVALUATION)){ + kpiMetaDataService.statGridEvaluation(); + } + return new Result(); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiResultGridController.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiResultGridController.java new file mode 100644 index 000000000..e84774f21 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiResultGridController.java @@ -0,0 +1,125 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.mybatis.annotation.DataFilter; +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.KpiResultGridDTO; +import com.elink.esua.epdc.excel.KpiResultGridDetailExcel; +import com.elink.esua.epdc.excel.KpiResultGridExcel; +import com.elink.esua.epdc.service.KpiResultGridService; +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 work@yujt.net.cn + * @since v1.0.0 2019-12-17 + */ +@RestController +@RequestMapping("gridResult") +public class KpiResultGridController { + + @Autowired + private KpiResultGridService kpiResultGridService; + + @GetMapping("page") + @DataFilter(tableAlias = "g", deptId = "grid_id", prefix = "AND", isPendingCreator = false) + public Result> page(@RequestParam Map params){ + PageData page = kpiResultGridService.page(params); + return new Result>().ok(page); + } + + /** + * @Description: 考核统计 详情页查询 + * @Param: [id] + * @return: com.elink.esua.epdc.commons.tools.utils.Result + * @Author: zy + * @Date: 2019-12-20 + */ + @GetMapping("{id}") + public Result> get(@PathVariable("id") String id){ + List data = kpiResultGridService.get(id); + return new Result>().ok(data); + } + + @PostMapping + public Result save(@RequestBody KpiResultGridDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + kpiResultGridService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody KpiResultGridDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + kpiResultGridService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + kpiResultGridService.delete(ids); + return new Result(); + } + + /** + * @Description: 考核统计首页导出 + * @Param: [params, response] + * @return: void + * @Author: zy + * @Date: 2019-12-20 + */ + @GetMapping("export") + @DataFilter(tableAlias = "g", deptId = "grid_id", prefix = "AND", isPendingCreator = false) + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = kpiResultGridService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, KpiResultGridExcel.class); + } + + + /** + * @Description: 详情页表格导出 + * @Param: [params, response] + * @return: void + * @Author: zy + * @Date: 2019-12-20 + */ + @GetMapping("tableExport") + public void tableExport(@RequestParam Map params, HttpServletResponse response) throws Exception { + List data = kpiResultGridService.get(params.get("id").toString()); + ExcelUtils.exportExcelToTarget(response, "考核统计得分详情", data, KpiResultGridDetailExcel.class); + } +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiResultSuperiorController.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiResultSuperiorController.java new file mode 100644 index 000000000..a3e77a4c3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiResultSuperiorController.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.mybatis.annotation.DataFilter; +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.KpiResultSuperiorDTO; +import com.elink.esua.epdc.excel.KpiResultSuperiorDetailExcel; +import com.elink.esua.epdc.excel.KpiResultSuperiorExcel; +import com.elink.esua.epdc.service.KpiResultSuperiorService; +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 qu@elink-cn.com + * @since v1.0.0 2019-12-23 + */ +@RestController +@RequestMapping("kpiresultsuperior") +public class KpiResultSuperiorController { + + @Autowired + private KpiResultSuperiorService kpiResultSuperiorService; + + @GetMapping("page") + @DataFilter(tableAlias = "s", deptId = "dept_id", prefix = "AND", isPendingCreator = false) + public Result> page(@RequestParam Map params){ + PageData page = kpiResultSuperiorService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result> get(@PathVariable("id") String id){ + List data = kpiResultSuperiorService.get(id); + return new Result>().ok(data); + } + + @PostMapping + public Result save(@RequestBody KpiResultSuperiorDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + kpiResultSuperiorService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody KpiResultSuperiorDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + kpiResultSuperiorService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + kpiResultSuperiorService.delete(ids); + return new Result(); + } + + @GetMapping("export") + @DataFilter(tableAlias = "s", deptId = "dept_id", prefix = "AND", isPendingCreator = false) + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = kpiResultSuperiorService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, KpiResultSuperiorExcel.class); + } + + /** + * @Description: 详情页表格导出 + * @Param: [params, response] + * @return: void + * @Author: zy + * @Date: 2019-12-24 + */ + @GetMapping("tableExport") + public void tableExport(@RequestParam Map params, HttpServletResponse response) throws Exception { + List data = kpiResultSuperiorService.get(params.get("id").toString()); + ExcelUtils.exportExcelToTarget(response, "区直街道考核统计得分详情", data, KpiResultSuperiorDetailExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiRuleController.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiRuleController.java index 1012930b1..62516384f 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiRuleController.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiRuleController.java @@ -45,114 +45,121 @@ import java.util.Map; * @since v1.0.0 2019-11-27 */ @RestController -@RequestMapping("kpirule") +@RequestMapping("rule") public class KpiRuleController { - @Autowired - private KpiRuleService kpiRuleService; - - @GetMapping("page") - public Result> page(@RequestParam Map params) { - PageData page = kpiRuleService.page(params); - return new Result>().ok(page); - } - - /*@GetMapping("{id}") - public Result get(@PathVariable("id") String id){ - KpiRuleDTO data = kpiRuleService.get(id); - return new Result().ok(data); - }*/ - - @PostMapping - public Result save(@RequestBody KpiRuleDTO dto) { - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - kpiRuleService.save(dto); - return new Result(); - } - - @PutMapping - public Result update(@RequestBody KpiRuleDTO dto) { - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - kpiRuleService.update(dto); - return new Result(); - } - - @DeleteMapping - public Result delete(@RequestBody String[] ids) { - //效验数据 - AssertUtils.isArrayEmpty(ids, "id"); - kpiRuleService.delete(ids); - return new Result(); - } - - @GetMapping("export") - public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { - List list = kpiRuleService.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, KpiRuleExcel.class); - } - - /** - * @param params - * @return com.elink.esua.epdc.commons.tools.utils.Result> - * @Author yinzuomei - * @Description 列表查询 - * @Date 2019/11/27 13:22 - **/ - @GetMapping("query") - public Result> query(@RequestParam Map params) { - PageData page = kpiRuleService.query(params); - return new Result>().ok(page); - } - - /** - * @param id - * @return com.elink.esua.epdc.commons.tools.utils.Result - * @Author yinzuomei - * @Description 查询详情 - * @Date 2019/11/27 15:17 - **/ - @GetMapping("{id}") - public Result queryDetailInfo(@PathVariable("id") String id) { - KpiRuleQueryResultDTO data = kpiRuleService.queryDetailInfo(id); - return new Result().ok(data); - } - - /** - * @param dto - * @return com.elink.esua.epdc.commons.tools.utils.Result - * @Author yinzuomei - * @Description 新增 - * @Date 2019/11/27 16:23 - **/ - @PostMapping("saveOrUpdate") - public Result add(@RequestBody KpiRuleSaveOrUpdateFormDTO dto) { - ValidatorUtils.validateEntity(dto); - return kpiRuleService.add(dto); - } - - /** - * @param dto - * @return com.elink.esua.epdc.commons.tools.utils.Result - * @Author yinzuomei - * @Description 修改 - * @Date 2019/11/27 16:20 - **/ - @PutMapping("saveOrUpdate") - public Result edit(@RequestBody KpiRuleSaveOrUpdateFormDTO dto) { - ValidatorUtils.validateEntity(dto); - return kpiRuleService.edit(dto); - } - - /** - * @return - * @Author yinzuomei - * @Description 已绑定手动打分的考核规则 手动打分下拉框使用 - * @Date 2019/12/4 15:52 - **/ - @GetMapping("getKpiManualRule") - public Result> getKpiManualRule() { - return kpiRuleService.listKpiRuleDTO(); - } + @Autowired + private KpiRuleService kpiRuleService; + + @GetMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = kpiRuleService.page(params); + return new Result>().ok(page); + } + + @PostMapping + public Result save(@RequestBody KpiRuleDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + kpiRuleService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody KpiRuleDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + kpiRuleService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + kpiRuleService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = kpiRuleService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, KpiRuleExcel.class); + } + + /** + * @param params + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 列表查询 + * @Date 2019/11/27 13:22 + **/ + @GetMapping("query") + public Result> query(@RequestParam Map params) { + PageData page = kpiRuleService.query(params); + return new Result>().ok(page); + } + + /** + * @param id + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 查询详情 + * @Date 2019/11/27 15:17 + **/ + @GetMapping("{id}") + public Result queryDetailInfo(@PathVariable("id") String id) { + KpiRuleQueryResultDTO data = kpiRuleService.queryDetailInfo(id); + return new Result().ok(data); + } + + /** + * @param dto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 新增 + * @Date 2019/11/27 16:23 + **/ + @PostMapping("saveOrUpdate") + public Result add(@RequestBody KpiRuleSaveOrUpdateFormDTO dto) { + ValidatorUtils.validateEntity(dto); + return kpiRuleService.add(dto); + } + + /** + * @param dto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 修改 + * @Date 2019/11/27 16:20 + **/ + @PutMapping("saveOrUpdate") + public Result edit(@RequestBody KpiRuleSaveOrUpdateFormDTO dto) { + ValidatorUtils.validateEntity(dto); + return kpiRuleService.edit(dto); + } + + /** + * @return + * @Author yinzuomei + * @Description 已绑定手动打分的考核规则 手动打分下拉框使用 + * @Date 2019/12/4 15:52 + **/ + @GetMapping("getKpiManualRule") + public Result> getKpiManualRule() { + return kpiRuleService.listKpiRuleDTO(); + } + + /** + * + * @param ruleCode + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author work@yujt.net.cn + * @date 2019/12/17 17:04 + */ + @GetMapping("calcByCode/{ruleCode}") + public Result calcByRuleCode(@PathVariable("ruleCode") String ruleCode) { + kpiRuleService.calcByRuleCode(ruleCode); + return new Result(); + } } diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiRuleParamController.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiRuleParamController.java index ce1c501e3..c9cef461f 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiRuleParamController.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiRuleParamController.java @@ -43,7 +43,7 @@ import java.util.Map; * @since v1.0.0 2019-11-27 */ @RestController -@RequestMapping("kpiruleparam") +@RequestMapping("ruleParam") public class KpiRuleParamController { @Autowired diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiTimeLimitIssueController.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiTimeLimitIssueController.java index 102ca1681..6c65ba482 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiTimeLimitIssueController.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiTimeLimitIssueController.java @@ -43,7 +43,7 @@ import java.util.Map; * @since v1.0.0 2019-12-02 */ @RestController -@RequestMapping("kpitimelimitissue") +@RequestMapping("timeLimitIssue") public class KpiTimeLimitIssueController { @Autowired diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiTimeLimitItemController.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiTimeLimitItemController.java index 90ce500a8..e00c1862c 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiTimeLimitItemController.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiTimeLimitItemController.java @@ -43,7 +43,7 @@ import java.util.Map; * @since v1.0.0 2019-12-02 */ @RestController -@RequestMapping("kpitimelimititem") +@RequestMapping("timeLimitItem") public class KpiTimeLimitItemController { @Autowired diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiFormulaDao.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiFormulaDao.java index a08084cef..d4b0c0cb1 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiFormulaDao.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiFormulaDao.java @@ -17,6 +17,7 @@ package com.elink.esua.epdc.dao; +import com.elink.esua.epdc.dto.KpiFormulaDTO; import com.elink.esua.epdc.dto.result.KpiFormulaDictResultDTO; import com.elink.esua.epdc.entity.KpiFormulaEntity; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; @@ -41,4 +42,13 @@ public interface KpiFormulaDao extends BaseDao { * @Date 2019/11/27 14:11 **/ List selectListKpiFormulaDictResultDTO(); + + /** + * @Description: 查询公式运行方法 + * @Param: [id] + * @return: com.elink.esua.epdc.dto.KpiFormulaDTO + * @Author: zy + * @Date: 2019-12-18 + */ + KpiFormulaDTO queryFormula(String id); } diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiManualScoreDao.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiManualScoreDao.java index 48c7be0c8..17185bdca 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiManualScoreDao.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiManualScoreDao.java @@ -20,8 +20,11 @@ package com.elink.esua.epdc.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.dto.result.KpiManualScoreResultDTO; import com.elink.esua.epdc.entity.KpiManualScoreEntity; +import com.elink.esua.epdc.excel.KpiManualScoreTemplateExcel; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import java.util.Date; import java.util.List; import java.util.Map; @@ -34,5 +37,19 @@ import java.util.Map; @Mapper public interface KpiManualScoreDao extends BaseDao { - List selectListKpiManualScoreResultDTO(Map params); + List selectListKpiManualScoreResultDTO(Map params); + + /** + * 删除手动打分 + * + * @param ruleId + * @param deptId + * @param scoreStartDate + * @param scoreEndDate + * @return int + * @author work@yujt.net.cn + * @date 2019/12/26 14:38 + */ + int deleteManualScore(@Param("ruleId") String ruleId, @Param("deptId") Long deptId, + @Param("scoreStartDate") Date scoreStartDate, @Param("scoreEndDate") Date scoreEndDate); } diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiManualScoreTempDao.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiMetaDataDao.java similarity index 58% rename from esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiManualScoreTempDao.java rename to esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiMetaDataDao.java index eeaca7ab1..3662281b8 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiManualScoreTempDao.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiMetaDataDao.java @@ -18,27 +18,31 @@ package com.elink.esua.epdc.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; -import com.elink.esua.epdc.entity.KpiManualScoreTempEntity; -import com.elink.esua.epdc.excel.KpiManualScoreTemplateExcel; +import com.elink.esua.epdc.dto.KpiMetaDataDTO; +import com.elink.esua.epdc.dto.KpiResultGridDTO; +import com.elink.esua.epdc.entity.KpiMetaDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import java.util.Date; import java.util.List; /** - * 绩效考核手动打分记录 + * 绩效考核的元数据 * * @author qu qu@elink-cn.com - * @since v1.0.0 2019-12-06 + * @since v1.0.0 2019-12-16 */ @Mapper -public interface KpiManualScoreTempDao extends BaseDao { +public interface KpiMetaDataDao extends BaseDao { - int deleteManualScoreTemp(@Param("userId") String toString, - @Param("ruleId")String id, - @Param("scoreStartTime")String scoreStartTime); + /*** + * 插入之前删除数据 防止插入部分出异常 + * @param metaList + * @return void + * @author qushutong + * @date 2019/12/20 13:32 + */ + void deleteListRepetitionMeta(@Param("metaList") List metaList); - List selectListKpiManualScoreTemp(@Param("userId") String userId, - @Param("recordList")List recordList); -} + List queryGridProblemHandlingScore(KpiResultGridDTO kpiResultGridDTO); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiResultGridDao.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiResultGridDao.java new file mode 100644 index 000000000..b98b210f1 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiResultGridDao.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.KpiResultGridDTO; +import com.elink.esua.epdc.entity.KpiResultGridEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.math.BigInteger; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 网格考核最终得分 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-12-17 + */ +@Mapper +public interface KpiResultGridDao extends BaseDao { + + /** + * @Description: 查询网格考核最终得分表中,当前考核规则数据是否存在 + * @Param: [] + * @return: java.util.List + * @Author: zy + * @Date: 2019-12-17 + */ + KpiResultGridDTO selectManualScoringISExist(Map map); + + /** + * @Description: 查询网格考核最终得分列表 + * @Param: [kpiResultGridEntity] 开始时间、结束时间 + * @return: java.util.List + * @Author: zy + * @Date: 2019-12-17 + */ + List selectKpiResultGrid(KpiResultGridEntity kpiResultGridEntity); + + /** + * 自定义分页列表 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-17 + */ + List selectStatisticalInfoList(Map params); + + /** + * @Description: 自定义分页总数 + * @Param: [params] + * @return: int + * @Author: zy + * @Date: 2019-12-19 + */ + int selectStatisticalInfoCount(Map params); + + /** + * 自定义默认查询首页统计列表 + * + * @param params + * @return List + * @author zy + * @date 2019-12-20 + */ + List list(Map params); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiResultSuperiorDao.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiResultSuperiorDao.java new file mode 100644 index 000000000..27d732f42 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiResultSuperiorDao.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.KpiResultGridDTO; +import com.elink.esua.epdc.dto.KpiResultSuperiorDTO; +import com.elink.esua.epdc.entity.KpiResultSuperiorEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 街道或区直绩效考核最终得分 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-23 + */ +@Mapper +public interface KpiResultSuperiorDao extends BaseDao { + /** + * 自定义分页列表 + * + * @param params + * @return List + * @author generator + * @date 2019-12-17 + */ + List selectSuperiorInfoList(Map params); + + /** + * @Description: 自定义分页总数 + * @Param: [params] + * @return: int + * @Author: zy + * @Date: 2019-12-19 + */ + int selectSuperiorInfoCount(Map params); + + /** + * 自定义导出查询列表 + * + * @param params + * @return List + * @author generator + * @date 2019-12-17 + */ + List exportSuperiorList(Map params); + + /** + * 根据部门id与考核周期 删除 + * + * @param deptId + * @param startDate + * @param endDate + * @return void + * @author work@yujt.net.cn + * @date 2019/12/25 18:56 + */ + int deleteByDeptIdAndKpiDate(@Param("deptId") Long deptId, + @Param("startDate") Date startDate, + @Param("endDate") Date endDate); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiRuleDao.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiRuleDao.java index a64fd10f4..a3495ad20 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiRuleDao.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiRuleDao.java @@ -18,6 +18,7 @@ package com.elink.esua.epdc.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.KpiRuleDTO; import com.elink.esua.epdc.dto.KpiRuleParamDTO; import com.elink.esua.epdc.dto.result.KpiRuleQueryResultDTO; import com.elink.esua.epdc.entity.KpiRuleEntity; @@ -62,4 +63,13 @@ public interface KpiRuleDao extends BaseDao { **/ KpiRuleQueryResultDTO queryDetailInfo(String id); + /** + * @Description: 根据考核规则编码,查询符合考核规则 的 元公式 + * @Param: [ruleCode] 考核规则编码 + * 规则生成方式为:0 元公式 + * @return: com.elink.esua.epdc.dao.KpiRuleDao + * @Author: zy + * @Date: 2019-12-18 + */ + KpiRuleDTO queryKpiRuleMetaFormula(String ruleCode); } diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiRuleParamDao.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiRuleParamDao.java index bd585ed2d..262466dcb 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiRuleParamDao.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiRuleParamDao.java @@ -18,9 +18,12 @@ package com.elink.esua.epdc.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.KpiRuleParamDTO; import com.elink.esua.epdc.entity.KpiRuleParamEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 公式参数表 * @@ -38,4 +41,13 @@ public interface KpiRuleParamDao extends BaseDao { * @Date 2019/11/27 16:36 **/ int deleteByRuleId(String id); + + /** + * @Description: 根据 考核规则表-主键,查询公式参数表 + * @Param: [ruleId] 规则ID + * @return: java.util.List + * @Author: zy + * @Date: 2019-12-18 + */ + List queryFormulaParam(String ruleId); } diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiTimeLimitItemDao.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiTimeLimitItemDao.java index 864818d4b..bbd50990e 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiTimeLimitItemDao.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiTimeLimitItemDao.java @@ -20,6 +20,9 @@ package com.elink.esua.epdc.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.entity.KpiTimeLimitItemEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 项目响应时限 @@ -29,5 +32,16 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface KpiTimeLimitItemDao extends BaseDao { - + + + /** + * 按类别id,批量删除配置 + * + * @param categoryIds + * @return int + * @author work@yujt.net.cn + * @date 2019/12/16 19:19 + */ + int deleteBatchByCategoryIds(@Param("categoryIds") List categoryIds); + } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiManualScoreEntity.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiManualScoreEntity.java index 24b7f293f..e489f0d10 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiManualScoreEntity.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiManualScoreEntity.java @@ -23,6 +23,7 @@ import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; import lombok.Data; import lombok.EqualsAndHashCode; +import java.math.BigDecimal; import java.util.Date; /** @@ -32,55 +33,70 @@ import java.util.Date; * @since v1.0.0 2019-12-04 */ @Data -@EqualsAndHashCode(callSuper=false) +@EqualsAndHashCode(callSuper = false) @TableName("epdc_kpi_manual_score") public class KpiManualScoreEntity extends BaseEpdcEntity { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -8994029691874794620L; /** * epdc_kpi_rule表主键 */ - private String ruleId; + private String ruleId; /** * 被打分的部门id */ - private String deptId; + private Long deptId; /** * 得分 */ - private Integer score; + private BigDecimal score; - /** - * 考核起止日期 - */ - private Date scoreStartDate; + /** + * 考核起止日期 + */ + private Date scoreStartDate; - /** - * 考核终止日期 - */ - private Date scoreEndDate; + /** + * 考核终止日期 + */ + private Date scoreEndDate; /** * 所有父级部门id */ - private String parentDeptIds; + private String parentDeptIds; /** * 所有父级部门名称 */ - private String parentDeptNames; + private String parentDeptNames; /** * 完整部门id */ - private String allDeptIds; + private String allDeptIds; /** * 完整部门名称 */ - private String allDeptNames; + private String allDeptNames; + + /** + * 打分者的部门id + */ + private String creatorDeptName; + + /** + * 打分者的部门名称 + */ + private Long creatorDeptId; + + /** + * 被考核部门的网格长姓名 + */ + private String leaderName; } diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiManualScoreRuleEntity.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiManualScoreRuleEntity.java index dd6565885..773a7bcb4 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiManualScoreRuleEntity.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiManualScoreRuleEntity.java @@ -24,7 +24,6 @@ import lombok.Data; import lombok.EqualsAndHashCode; import java.math.BigDecimal; -import java.util.Date; /** * 手动打分项 @@ -37,7 +36,7 @@ import java.util.Date; @TableName("epdc_kpi_manual_score_rule") public class KpiManualScoreRuleEntity extends BaseEpdcEntity { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1073211664180968064L; /** * 打分项名称 @@ -57,6 +56,6 @@ public class KpiManualScoreRuleEntity extends BaseEpdcEntity { /** * 满分 */ - private Integer fullMarks; + private BigDecimal fullMarks; } diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiMetaDataEntity.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiMetaDataEntity.java new file mode 100644 index 000000000..36fac4299 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiMetaDataEntity.java @@ -0,0 +1,82 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 绩效考核的元数据 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("epdc_kpi_meta_data") +public class KpiMetaDataEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = -27618138854750989L; + + /** + * 数据项编码 + */ + private String dataCode; + + /** + * 数据项名称 + */ + private String dataName; + + /** + * 元数据值 + */ + private BigDecimal dataValue; + + /** + * 考核周期(字典值 代表月,季,年) + */ + private String kpiCycle; + + /** + * 考核周期开始日 + */ + private Date startDate; + + /** + * 考核周期结束日 + */ + private Date endDate; + + /** + * 部门ID + */ + private Long deptId; + + /** + * 部门类别 + */ + private String deptTypeKey; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiManualScoreTempEntity.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiResultGridEntity.java similarity index 57% rename from esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiManualScoreTempEntity.java rename to esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiResultGridEntity.java index 7c342660c..97bea0f16 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiManualScoreTempEntity.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiResultGridEntity.java @@ -23,104 +23,85 @@ 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 qu@elink-cn.com - * @since v1.0.0 2019-12-06 + * @author work@yujt.net.cn + * @since v1.0.0 2019-12-17 */ @Data @EqualsAndHashCode(callSuper=false) -@TableName("epdc_kpi_manual_score_temp") -public class KpiManualScoreTempEntity extends BaseEpdcEntity { +@TableName("epdc_kpi_result_grid") +public class KpiResultGridEntity extends BaseEpdcEntity { private static final long serialVersionUID = 1L; /** - * epdc_kpi_rule表主键 + * 网格ID */ - private String ruleId; + private Long gridId; /** - * 被打分的部门id + * 手动打分得分 */ - private String deptId; + private BigDecimal manualScore; /** - * 得分 + * 工作得分 */ - private Integer score; + private BigDecimal workScore; /** - * 考核起止日期yyyy-MM-dd + * 投票得分 */ - private Date scoreStartDate; + private BigDecimal voteScore; /** - * 考核终止日期yyyy-MM-dd + * 最终得分 */ - private Date scoreEndDate; + private BigDecimal finalScore; /** - * 所有父级部门id + * 考核周期开始日 */ - private String parentDeptIds; - - /** - * 所有父级部门名称 - */ - private String parentDeptNames; - - /** - * 完整部门名称 - */ - private String allDeptNames; - - /** - * 完整部门id - */ - private String allDeptIds; - - /** - * 导出用户id - */ - private String userId; + private Date startDate; /** - * 街道 + * 考核周期结束日 */ - private String street; + private Date endDate; /** - * 社区 + * 被考核部门的网格长姓名 */ - private String community; + private String leaderName; /** - * 网格 + * 考核周期(字典值 代表月,季,年) */ - private String grid; + private String kpiCycle; /** - * 规则名称 + * 所有上级机构id */ - private String ruleName; + private String parentDeptIds; /** - * 考核周期 + * 所有上级机构名称 */ - private String kpiCycleName; + private String parentDeptNames; /** - * 考核起止日期 + * 所有机构id */ - private String scoreStartTime; + private String allDeptIds; /** - * 考核终止日期 + * 所有机构名称 */ - private String scoreEndTime; + private String allDeptNames; -} +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiResultSuperiorEntity.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiResultSuperiorEntity.java new file mode 100644 index 000000000..2cb59ee29 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiResultSuperiorEntity.java @@ -0,0 +1,92 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 街道或区直绩效考核最终得分 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-23 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_kpi_result_superior") +public class KpiResultSuperiorEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 网格ID + */ + private Long deptId; + + /** + * 最终得分 + */ + private BigDecimal finalScore; + + /** + * 考核周期开始日 + */ + private Date startDate; + + /** + * 考核周期结束日 + */ + private Date endDate; + + /** + * 考核周期(字典值 代表月,季,年) + */ + private String kpiCycle; + + /** + * 机构类别 + */ + private String deptTypeKey; + + /** + * 所有上级机构id + */ + private String parentDeptIds; + + /** + * 所有上级机构名称 + */ + private String parentDeptNames; + + /** + * 所有机构id + */ + private String allDeptIds; + + /** + * 所有机构名称 + */ + private String allDeptNames; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiTimeLimitItemEntity.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiTimeLimitItemEntity.java index d29045146..9a0ce5a83 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiTimeLimitItemEntity.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiTimeLimitItemEntity.java @@ -51,7 +51,7 @@ public class KpiTimeLimitItemEntity extends BaseEpdcEntity { /** * 项目类别id */ - private String categoryId; + private Long categoryId; /** * 所有上级项目类别id diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiManualScoreTemplateExcel.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiManualScoreTemplateExcel.java index 15376ed2c..88c119c5e 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiManualScoreTemplateExcel.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiManualScoreTemplateExcel.java @@ -13,105 +13,52 @@ import java.util.Date; @Data public class KpiManualScoreTemplateExcel { - /** - * 街道 - */ - @Excel(name = "街道") - private String street; + /** + * 街道 + */ + @Excel(name = "街道") + private String street; + + /** + * 社区 + */ + @Excel(name = "社区") + private String community; + + /** + * 网格 + */ + @Excel(name = "网格") + private String grid; + + /** + * 规则名称 + */ + @Excel(name = "规则名称") + private String ruleName; + + /** + * 考核周期 + */ + @Excel(name = "考核周期") + private String kpiCycleName; + + /** + * 考核起始日期 + */ + @Excel(name = "考核起始日", format = "yyyy-MM-dd") + private Date scoreStartDate; + + /** + * 考核终止日期 + */ + @Excel(name = "考核终止日", format = "yyyy-MM-dd") + private Date scoreEndDate; + + /** + * 得分 + */ + @Excel(name = "得分") + private Integer score; - /** - * 社区 - */ - @Excel(name = "社区") - private String community; - - /** - * 网格 - */ - @Excel(name = "网格") - private String grid; - - /** - * 规则名称 - */ - @Excel(name = "规则名称") - private String ruleName; - - /** - * 考核周期 - */ - @Excel(name = "考核周期") - private String kpiCycleName; - - /** - * 考核起止日期 - */ - @Excel(name = "考核起止日期") - private String scoreStartTime; - - /** - * 考核终止日期 - */ - @Excel(name = "考核终止日期") - private String scoreEndTime; - - /** - * 得分 - */ - @Excel(name = "得分") - private Integer score; - - /************************************************ 我 是 一 条 分 割 线 ************************************************************************/ - /************************************************ 我 是 一 条 分 割 线 ************************************************************************/ - /************************************************ 我 是 一 条 分 割 线 ************************************************************************/ - /** - * 部门名称 - * - */ - private String deptName; - - /************************************************ 组装数据 ************************************************************************/ - /** - * epdc_kpi_rule表主键 - */ - private String ruleId; - - /** - * 被打分的部门id - */ - private String deptId; - /** - * 考核起止日期 - */ - private Date scoreStartDate; - - /** - * 考核终止日期 - */ - private Date scoreEndDate; - - /** - * 所有父级部门id - */ - private String parentDeptIds; - - /** - * 所有父级部门名称 - */ - private String parentDeptNames; - - /** - * 完整部门id - */ - private String allDeptIds; - - /** - * 完整部门名称 - */ - private String allDeptNames; - - /** - * 导出用户id - */ - private String userId; } diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiManualScoreTempExcel.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiMetaDataExcel.java similarity index 51% rename from esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiManualScoreTempExcel.java rename to esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiMetaDataExcel.java index 961d03279..c1e27f67a 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiManualScoreTempExcel.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiMetaDataExcel.java @@ -20,49 +20,41 @@ package com.elink.esua.epdc.excel; import cn.afterturn.easypoi.excel.annotation.Excel; import lombok.Data; +import java.math.BigDecimal; import java.util.Date; /** - * 绩效考核手动打分记录 + * 绩效考核的元数据 * * @author qu qu@elink-cn.com - * @since v1.0.0 2019-12-06 + * @since v1.0.0 2019-12-16 */ @Data -public class KpiManualScoreTempExcel { +public class KpiMetaDataExcel { @Excel(name = "主键") private String id; - @Excel(name = "epdc_kpi_rule表主键") - private String ruleId; + @Excel(name = "数据项编码") + private String dataCode; - @Excel(name = "被打分的部门id") - private String deptId; + @Excel(name = "数据项名称") + private String dataName; - @Excel(name = "得分") - private Integer score; + @Excel(name = "元数据值") + private BigDecimal dataValue; - @Excel(name = "考核起止日期yyyy-MM-dd") - private Date scoreStartDate; + @Excel(name = "考核周期(字典值 代表月,季,年)") + private String kpiCycle; - @Excel(name = "考核终止日期yyyy-MM-dd") - private Date scoreEndDate; + @Excel(name = "考核周期开始日") + private Date startDate; - @Excel(name = "所有父级部门id") - private String parentDeptIds; + @Excel(name = "考核周期结束日") + private Date endDate; - @Excel(name = "所有父级部门名称") - private String parentDeptNames; - - @Excel(name = "完整部门名称") - private String allDeptNames; - - @Excel(name = "完整部门id") - private String allDeptIds; - - @Excel(name = "导出用户id") - private String userId; + @Excel(name = "部门ID") + private Long deptId; @Excel(name = "乐观锁") private Integer revision; @@ -82,26 +74,5 @@ public class KpiManualScoreTempExcel { @Excel(name = "删除标记") private String delFlag; - @Excel(name = "街道") - private String street; - - @Excel(name = "社区") - private String community; - - @Excel(name = "网格") - private String grid; - - @Excel(name = "规则名称") - private String ruleName; - - @Excel(name = "考核周期") - private String kpiCycleName; - - @Excel(name = "考核起止日期") - private String scoreStartTime; - - @Excel(name = "考核终止日期") - private Date scoreEndTime; - } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiResultGridDetailExcel.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiResultGridDetailExcel.java new file mode 100644 index 000000000..410aeec01 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiResultGridDetailExcel.java @@ -0,0 +1,22 @@ +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; +/** + * 网格考核详情导出 + * + * @author zy + * @since v1.0.0 2019-12-17 + */ +@Data +public class KpiResultGridDetailExcel { + + @Excel(name = "序号") + private int rownum; + + @Excel(name = "规则") + private String rule; + + @Excel(name = "详情") + private String detail; +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiResultGridExcel.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiResultGridExcel.java new file mode 100644 index 000000000..e12800f06 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiResultGridExcel.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 网格考核最终得分 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-12-17 + */ +@Data +public class KpiResultGridExcel { + + @Excel(name = "所属机构") + private String allDeptNames; + + @Excel(name = "网格长") + private String leaderName; + + @Excel(name = "考核周期开始日") + private String startDateString; + + @Excel(name = "考核周期结束日") + private String endDateString; + + @Excel(name = "基层党建工作职责得分") + private BigDecimal manualScore; + + @Excel(name = "平时工作得分") + private BigDecimal workScore; + + @Excel(name = "总分") + private BigDecimal finalScore; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiResultSuperiorDetailExcel.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiResultSuperiorDetailExcel.java new file mode 100644 index 000000000..b4f76b9d4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiResultSuperiorDetailExcel.java @@ -0,0 +1,35 @@ +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 街道或区直绩效考核最终得分 + * + * @author zy + * @since v1.0.0 2019-12-24 + */ +@Data +public class KpiResultSuperiorDetailExcel { + + @Excel(name = "网格呼叫事项总数") + private BigDecimal gridCallSuperiorAmount; + + @Excel(name = "响应网格呼叫事项数") + private BigDecimal gridCallSuperiorRespAmount; + + @Excel(name = "办结网格呼叫事项数") + private BigDecimal gridCallSuperiorCloseAmount; + + @Excel(name = "工作评议满意数") + private BigDecimal gridHighEvaluationAmount; + + @Excel(name = "工作评议基本满意数") + private BigDecimal gridMediumEvaluationAmount; + + @Excel(name = "工作评议不满意数") + private BigDecimal gridLowEvaluationAmount; + +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiResultSuperiorExcel.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiResultSuperiorExcel.java new file mode 100644 index 000000000..745fbd97a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiResultSuperiorExcel.java @@ -0,0 +1,53 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 街道或区直绩效考核最终得分 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-23 + */ +@Data +public class KpiResultSuperiorExcel { + + @Excel(name = "所属机构") + private String allDeptNames; + + @Excel(name = "最终得分") + private BigDecimal finalScore; + + @Excel(name = "考核周期开始日") + private String startDateString; + + @Excel(name = "考核周期结束日") + private String endDateString; + + @Excel(name = "考核周期") + private String kpiCycle; + + @Excel(name = "机构类别") + private String deptTypeKey; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java index 1c7d950a8..6d16111c7 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java @@ -2,8 +2,7 @@ package com.elink.esua.epdc.feign; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; -import com.elink.esua.epdc.dto.SysDeptDTO; +import com.elink.esua.epdc.dto.DeptLevelAndLeaderDTO; import com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO; import com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO; import com.elink.esua.epdc.feign.fallback.AdminFeignClientFallback; @@ -28,7 +27,7 @@ public interface AdminFeignClient { /** * @param userSysDeptInfoFormDTO - * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @return com.elink.esua.epdc.commons.tools.utils.Result> * @Author yinzuomei * @Description 获取用户数据权限下各部门基本信息 * @Date 2019/12/6 19:40 @@ -37,22 +36,31 @@ public interface AdminFeignClient { Result> queryUserSysDeptInfo(UserSysDeptInfoFormDTO userSysDeptInfoFormDTO); /** - * @param deptId - * @return com.elink.esua.epdc.commons.tools.utils.Result - * @Author yinzuomei - * @Description 根据部门ID获取上级所有部门信息 - * @Date 2019/12/6 19:49 - **/ - @GetMapping("/sys/dept/getParentAndAllDept/{deptId}") - Result getParentAndAllDept(@PathVariable("deptId") String deptId); + * 按部门类型,分页查询部门列表 + * + * @param typeKey 部门类型 + * @param pageSize 页容量 + * @param pageIndex 页码 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2019/12/17 16:03 + */ + @GetMapping("/sys/dept/pageDeptIdByTypeKey/{typeKey}/{pageSize}/{pageIndex}") + Result> pageDeptIdByTypeKey(@PathVariable("typeKey") String typeKey, + @PathVariable("pageSize") Integer pageSize, + @PathVariable("pageIndex") Integer pageIndex); /** - * @param id - * @return com.elink.esua.epdc.commons.tools.utils.Result - * @Author yinzuomei - * @Description 根据部门id获取部门信息 - * @Date 2019/12/6 20:22 - **/ - @GetMapping("/sys/dept/{id}") - Result getSysDeptDTO(@PathVariable("id") Long id); + * 根据部门id,获取部门层级关系,获取部门领导姓名 + * + * @param deptId 部门id + * @param leaderFlag 是否需要查询网格长姓名 0 否 、1 是 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2019/12/18 13:54 + */ + @GetMapping("/sys/dept/getDeptInfoById/{deptId}/{leaderFlag}") + Result getDeptInfoById(@PathVariable("deptId") Long deptId, + @PathVariable("leaderFlag") String leaderFlag); + } diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/EventFeignClient.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/EventFeignClient.java index e5c06cb0d..566898e68 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/EventFeignClient.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/EventFeignClient.java @@ -2,11 +2,18 @@ package com.elink.esua.epdc.feign; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.dto.category.form.CategoryInfoFormDTO; -import com.elink.esua.epdc.dto.category.result.CategoryInfoResultDTO; +import com.elink.esua.epdc.dto.KpiMetaDataDTO; +import com.elink.esua.epdc.dto.form.CategoryInfoFormDTO; +import com.elink.esua.epdc.dto.form.KpiMetaDataOfEventsFormDTO; +import com.elink.esua.epdc.dto.form.*; +import com.elink.esua.epdc.dto.result.CategoryInfoResultDTO; +import com.elink.esua.epdc.dto.result.KpiEvaluationAmountResultDTO; +import com.elink.esua.epdc.dto.result.KpiEventReportAmountResultDTO; +import com.elink.esua.epdc.dto.result.KpiItemHandleAmountResultDTO; import com.elink.esua.epdc.feign.fallback.EventFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import java.util.List; @@ -19,13 +26,56 @@ import java.util.List; @FeignClient(name = ServiceConstant.EPDC_EVENTS_SERVER, fallback = EventFeignClientFallback.class) public interface EventFeignClient { - /** - * @param categoryInfoFormDTO - * @return com.elink.esua.epdc.commons.tools.utils.Result> - * @Author yinzuomei - * @Description 根据id查询事件分类基本信息 - * @Date 2019/12/4 10:37 - **/ - @PostMapping(value = "events/category/queryCategoryInfo", consumes = MediaType.APPLICATION_JSON_VALUE) - Result> queryCategoryInfo(CategoryInfoFormDTO categoryInfoFormDTO); + /** + * @param categoryInfoFormDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 根据id查询事件分类基本信息 + * @Date 2019/12/4 10:37 + **/ + @GetMapping(value = "events/category/queryCategoryInfo", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> queryCategoryInfo(CategoryInfoFormDTO categoryInfoFormDTO); + + /** + * 统计网格指定时间段内事件上报数与事件受理数 + * + * @param eventReportAmountFormDto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author work@yujt.net.cn + * @date 2019/12/19 19:06 + */ + @PostMapping(value = "events/epdcevents/statEventReportAmount", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> statEventReportAmount(KpiMetaDataOfEventsFormDTO eventReportAmountFormDto); + + /** + * 统计群众对问题处理的满意度 + * + * @param metaDataFormDto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author work@yujt.net.cn + * @date 2019/12/20 14:46 + */ + @PostMapping(value = "events/item/statPeopleEvaluationMetaData", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> statPeopleEvaluationMetaData(KpiMetaDataOfEventsFormDTO metaDataFormDto); + + /*** + * 获取网格工作评议 + * @param metaDataFormDto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author qushutong + * @date 2019/12/20 15:16 + */ + @PostMapping(value = "events/item/statGridEvaluationMetaData", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> statGridEvaluationMetaData(KpiMetaDataOfEventsFormDTO metaDataFormDto); + + /** + * 统计项目处理数 包括:网格呼叫总数,网格呼叫被响应数,网格呼叫被关闭数 + * + * @param metaDataFormDto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author work@yujt.net.cn + * @date 2019/12/23 13:46 + */ + @PostMapping(value = "events/item/statItemHandleAmountMetaData", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> statItemHandleAmount(KpiMetaDataOfEventsFormDTO metaDataFormDto); } diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java index 5062da0bf..07fd7fc1a 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java @@ -3,8 +3,7 @@ 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.dto.ParentAndAllDeptDTO; -import com.elink.esua.epdc.dto.SysDeptDTO; +import com.elink.esua.epdc.dto.DeptLevelAndLeaderDTO; import com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO; import com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO; import com.elink.esua.epdc.feign.AdminFeignClient; @@ -19,40 +18,26 @@ import java.util.List; */ @Component public class AdminFeignClientFallback implements AdminFeignClient { - /** - * @param userSysDeptInfoFormDTO - * @return com.elink.esua.epdc.commons.tools.utils.Result> - * @Author yinzuomei - * @Description - * @Date 2019/12/6 20:15 - **/ - @Override - public Result> queryUserSysDeptInfo(UserSysDeptInfoFormDTO userSysDeptInfoFormDTO) { - return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "queryUserSysDeptInfo", userSysDeptInfoFormDTO); - } + /** + * @param userSysDeptInfoFormDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author yinzuomei + * @Description + * @Date 2019/12/6 20:15 + **/ + @Override + public Result> queryUserSysDeptInfo(UserSysDeptInfoFormDTO userSysDeptInfoFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "queryUserSysDeptInfo", userSysDeptInfoFormDTO); + } - /** - * @param deptId - * @return com.elink.esua.epdc.commons.tools.utils.Result - * @Author yinzuomei - * @Description 根据部门ID获取上级所有部门信息 - * @Date 2019/12/6 19:49 - **/ - @Override - public Result getParentAndAllDept(String deptId) { - return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getParentAndAllDept", deptId); - } + @Override + public Result> pageDeptIdByTypeKey(String typeKey, Integer pageSize, Integer pageIndex) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "pageDeptIdByTypeKey", typeKey, pageSize, pageIndex); + } - /** - * @param id - * @return com.elink.esua.epdc.commons.tools.utils.Result - * @Author yinzuomei - * @Description 根据部门id获取部门信息 - * @Date 2019/12/6 20:22 - **/ - @Override - public Result getSysDeptDTO(Long id) { - return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getSysDeptDTO", id); - } + @Override + public Result getDeptInfoById(Long deptId, String leaderFlag) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getDeptInfoById", deptId, leaderFlag); + } } diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/fallback/EventFeignClientFallback.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/fallback/EventFeignClientFallback.java index 8c83f4f01..c8390dc88 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/fallback/EventFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/fallback/EventFeignClientFallback.java @@ -3,8 +3,14 @@ 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.dto.category.form.CategoryInfoFormDTO; -import com.elink.esua.epdc.dto.category.result.CategoryInfoResultDTO; +import com.elink.esua.epdc.dto.KpiMetaDataDTO; +import com.elink.esua.epdc.dto.form.CategoryInfoFormDTO; +import com.elink.esua.epdc.dto.form.KpiMetaDataOfEventsFormDTO; +import com.elink.esua.epdc.dto.form.*; +import com.elink.esua.epdc.dto.result.CategoryInfoResultDTO; +import com.elink.esua.epdc.dto.result.KpiEvaluationAmountResultDTO; +import com.elink.esua.epdc.dto.result.KpiEventReportAmountResultDTO; +import com.elink.esua.epdc.dto.result.KpiItemHandleAmountResultDTO; import com.elink.esua.epdc.feign.EventFeignClient; import org.springframework.stereotype.Component; @@ -18,8 +24,28 @@ import java.util.List; @Component public class EventFeignClientFallback implements EventFeignClient { - @Override - public Result> queryCategoryInfo(CategoryInfoFormDTO categoryInfoFormDTO) { - return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "queryCategoryInfo", categoryInfoFormDTO); - } + @Override + public Result> queryCategoryInfo(CategoryInfoFormDTO categoryInfoFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "queryCategoryInfo", categoryInfoFormDTO); + } + + @Override + public Result> statEventReportAmount(KpiMetaDataOfEventsFormDTO eventReportAmountFormDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "statEventReportAmount", eventReportAmountFormDto); + } + + @Override + public Result> statPeopleEvaluationMetaData(KpiMetaDataOfEventsFormDTO metaDataFormDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "statPeopleEvaluationMetaData", metaDataFormDto); + } + + @Override + public Result> statGridEvaluationMetaData(KpiMetaDataOfEventsFormDTO metaDataFormDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "statGridEvaluationMetaData", metaDataFormDto); + } + + @Override + public Result> statItemHandleAmount(KpiMetaDataOfEventsFormDTO metaDataFormDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "statItemHandleAmount", metaDataFormDto); + } } diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiMetaDataRedis.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiMetaDataRedis.java new file mode 100644 index 000000000..0ef6cb409 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiMetaDataRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 绩效考核的元数据 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Component +public class KpiMetaDataRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiResultGridRedis.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiResultGridRedis.java new file mode 100644 index 000000000..70a85ca56 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiResultGridRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 网格考核最终得分 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-12-17 + */ +@Component +public class KpiResultGridRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiResultSuperiorRedis.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiResultSuperiorRedis.java new file mode 100644 index 000000000..2cd65460f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiResultSuperiorRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 街道或区直绩效考核最终得分 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-23 + */ +@Component +public class KpiResultSuperiorRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiTimeLimitItemRedis.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiTimeLimitItemRedis.java index 387cd1325..b8c271490 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiTimeLimitItemRedis.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiTimeLimitItemRedis.java @@ -17,10 +17,16 @@ package com.elink.esua.epdc.redis; +import com.elink.esua.epdc.commons.tools.redis.RedisKeys; import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import com.elink.esua.epdc.constant.KpiItemConstant; +import com.elink.esua.epdc.entity.KpiTimeLimitItemEntity; +import com.google.common.collect.Maps; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.util.Map; + /** * 项目响应时限 * @@ -29,19 +35,27 @@ import org.springframework.stereotype.Component; */ @Component public class KpiTimeLimitItemRedis { + @Autowired private RedisUtils redisUtils; - public void delete(Object[] ids) { - + /** + * 将项目类别时限设置存入缓存 + * + * @param timelimitItem + * @return void + * @author work@yujt.net.cn + * @date 2019/12/17 10:27 + */ + public void setTimelimitItem(KpiTimeLimitItemEntity timelimitItem) { + + Map map = Maps.newHashMap(); + map.put(KpiItemConstant.CLOSE_ITEM_TIME_LIMIT, timelimitItem.getValidCloseTime()); + map.put(KpiItemConstant.RESPOND_ITEM_TIME_LIMIT, timelimitItem.getValidRespondTime()); + + String key = RedisKeys.getKpiItemTimeLimitKey(String.valueOf(timelimitItem.getCategoryId())); + redisUtils.set(key, map); } - public void set(){ - - } - - public String get(String id){ - return null; - } } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiManualScoreService.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiManualScoreService.java index 0fb4ed3f5..2b2fb45d2 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiManualScoreService.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiManualScoreService.java @@ -123,4 +123,23 @@ public interface KpiManualScoreService extends BaseService * @Date 2019/12/5 15:46 **/ Result importManualScoreExcel(MultipartFile file); + + /** + * 导出打分模版前,校验选项 + * + * @param params + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2019/12/16 14:12 + */ + Result checkExportTemplate(Map params); + + /** + * 将手动打分初始化为元数据项 + * + * @return void + * @author work@yujt.net.cn + * @date 2019/12/25 14:11 + */ + void initManualScoreToMetaData(); } diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiMetaDataService.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiMetaDataService.java new file mode 100644 index 000000000..edd30a2d5 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiMetaDataService.java @@ -0,0 +1,143 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.KpiMetaDataDTO; +import com.elink.esua.epdc.entity.KpiMetaDataEntity; + +import java.util.List; +import java.util.Map; + +/** + * 绩效考核的元数据 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +public interface KpiMetaDataService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return KpiMetaDataDTO + * @author generator + * @date 2019-12-16 + */ + KpiMetaDataDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-16 + */ + void save(KpiMetaDataDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-16 + */ + void update(KpiMetaDataDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-16 + */ + void delete(String[] ids); + + /*** + * 统计网格内 群众事件上报总数 与 被响应总数,存入元数据表 + * @param + * @return void + * @author qushutong + * @date 2019/12/16 10:19 + */ + void statPeopleReportAmount(); + + /*** + * 统计网格内 群众对网格问题办理 满意度评价,存入元数据表 + * @param + * @return void + * @author qushutong + * @date 2019/12/18 9:34 + */ + void statPeopleEvaluation(); + + + /*** + * 构建元数据 网格呼叫总数 网格响应呼叫数 + * @param + * @return void + * @author qushutong + * @date 2019/12/18 18:21 + */ + void statItemHandleAmount(); + + /*** + * 构建元数据 网格工作评议 + * @param + * @return void + * @author qushutong + * @date 2019/12/20 14:48 + */ + void statGridEvaluation(); + + /** + * 先删除已有数据再批量插入元数据表 + * + * @param metaDateList + * @return void + * @author qushutong + * @date 2019/12/24 14:38 + */ + void deleteAndInsertBatch(List metaDateList); + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiResultGridService.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiResultGridService.java new file mode 100644 index 000000000..c7c8a8636 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiResultGridService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.KpiResultGridDTO; +import com.elink.esua.epdc.entity.KpiResultGridEntity; + +import java.util.List; +import java.util.Map; + +/** + * 网格考核最终得分 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-12-17 + */ +public interface KpiResultGridService extends BaseService { + + /** + * 自定义分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-17 + */ + PageData page(Map params); + + /** + * 自定义默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-17 + */ + List list(Map params); + + /** + * 详情查询 + * + * @param id + * @return KpiResultGridDTO + * @author generator + * @date 2019-12-17 + */ + List get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-17 + */ + void save(KpiResultGridDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-17 + */ + void update(KpiResultGridDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiResultSuperiorService.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiResultSuperiorService.java new file mode 100644 index 000000000..baf35e197 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiResultSuperiorService.java @@ -0,0 +1,97 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.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.KpiResultSuperiorDTO; +import com.elink.esua.epdc.entity.KpiResultSuperiorEntity; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.List; +import java.util.Map; + +/** + * 街道或区直绩效考核最终得分 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-23 + */ +public interface KpiResultSuperiorService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-23 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-23 + */ + List list(Map params); + + /** + * 根据id列表查询 + * + * @param id + * @return KpiResultSuperiorDTO + * @author generator + * @date 2019-12-23 + */ + List get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-23 + */ + void save(KpiResultSuperiorDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-23 + */ + void update(KpiResultSuperiorDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-23 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiRuleService.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiRuleService.java index 02eefcd39..ac1671b6b 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiRuleService.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiRuleService.java @@ -149,4 +149,6 @@ public interface KpiRuleService extends BaseService { * @Date 2019/12/4 15:52 **/ Result> listKpiRuleDTO(); + + void calcByRuleCode(String ruleCode); } diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiFormulaServiceImpl.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiFormulaServiceImpl.java index 72051af4b..d6edd767a 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiFormulaServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiFormulaServiceImpl.java @@ -53,10 +53,9 @@ import java.util.Map; @Service public class KpiFormulaServiceImpl extends BaseServiceImpl implements KpiFormulaService { - @Autowired - private KpiFormulaRedis kpiFormulaRedis; @Autowired private KpiRuleDao kpiRuleDao; + @Override public PageData page(Map params) { QueryWrapper wrapper=new QueryWrapper<>(); diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiManualScoreRuleServiceImpl.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiManualScoreRuleServiceImpl.java index 24184f2a4..d79d6e29b 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiManualScoreRuleServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiManualScoreRuleServiceImpl.java @@ -100,7 +100,7 @@ public class KpiManualScoreRuleServiceImpl extends BaseServiceImpl kpiRuleEntityList = kpiRuleService.listKpiRuleEntityByRereferenceId(referenceIds); if (null != kpiRuleEntityList && kpiRuleEntityList.size() > 0) { diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiManualScoreServiceImpl.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiManualScoreServiceImpl.java index 0e81638ed..d401a43c8 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiManualScoreServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiManualScoreServiceImpl.java @@ -1,19 +1,3 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

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

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

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ package com.elink.esua.epdc.service.impl; @@ -24,36 +8,36 @@ 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.constant.FieldConstant; -import com.elink.esua.epdc.commons.tools.exception.ErrorCode; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.constant.OrganizationTypeConstant; +import com.elink.esua.epdc.commons.tools.constant.StrConstant; +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; +import com.elink.esua.epdc.commons.tools.exception.RenException; import com.elink.esua.epdc.commons.tools.page.PageData; -import com.elink.esua.epdc.commons.tools.redis.UserDetailRedis; import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; 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.utils.LocalDateUtils; import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.dao.KpiManualScoreDao; -import com.elink.esua.epdc.dao.KpiManualScoreRuleDao; -import com.elink.esua.epdc.dao.KpiManualScoreTempDao; -import com.elink.esua.epdc.dao.KpiRuleDao; -import com.elink.esua.epdc.dto.KpiManualScoreDTO; -import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; -import com.elink.esua.epdc.dto.SysDeptDTO; +import com.elink.esua.epdc.constant.KpiFieldConstant; +import com.elink.esua.epdc.dao.*; +import com.elink.esua.epdc.dto.*; import com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO; import com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO; -import com.elink.esua.epdc.dto.result.ImportExcelErrorResultDTO; import com.elink.esua.epdc.dto.result.KpiManualScoreResultDTO; import com.elink.esua.epdc.dto.result.KpiManualScoreTemplateResultDTO; -import com.elink.esua.epdc.entity.KpiManualScoreEntity; -import com.elink.esua.epdc.entity.KpiManualScoreRuleEntity; -import com.elink.esua.epdc.entity.KpiManualScoreTempEntity; -import com.elink.esua.epdc.entity.KpiRuleEntity; +import com.elink.esua.epdc.entity.*; import com.elink.esua.epdc.enums.KpiCycleEnum; +import com.elink.esua.epdc.enums.KpiMetaDataEnum; import com.elink.esua.epdc.excel.KpiManualScoreTemplateExcel; import com.elink.esua.epdc.feign.AdminFeignClient; -import com.elink.esua.epdc.redis.KpiManualScoreRedis; import com.elink.esua.epdc.service.KpiManualScoreService; -import com.elink.esua.epdc.service.KpiManualScoreTempService; +import com.elink.esua.epdc.service.KpiMetaDataService; +import com.elink.esua.epdc.utils.DeptUtils; +import com.elink.esua.epdc.utils.KpiLocalDateUtils; import com.elink.esua.epdc.utils.StreamUtils; +import com.google.common.collect.Lists; +import lombok.Data; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -63,8 +47,9 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import java.io.File; -import java.text.ParseException; -import java.text.SimpleDateFormat; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.YearMonth; import java.util.*; /** @@ -76,411 +61,769 @@ import java.util.*; @Service public class KpiManualScoreServiceImpl extends BaseServiceImpl implements KpiManualScoreService { - private Logger logger = LoggerFactory.getLogger(getClass()); - @Autowired - private KpiManualScoreRedis kpiManualScoreRedis; - @Autowired - private KpiManualScoreRuleDao kpiManualScoreRuleDao; - @Autowired - private KpiRuleDao kpiRuleDao; - @Autowired - private UserDetailRedis userDetailRedis; - @Autowired - private AdminFeignClient adminFeignClient; - @Autowired - private KpiManualScoreTempDao kpiManualScoreTempDao; - @Autowired - private KpiManualScoreTempService kpiManualScoreTempService; - //设置日期格式 - private SimpleDateFormat monthFormat = new SimpleDateFormat("yyyy-MM"); - private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); - - @Override - public PageData page(Map params) { - String ruleId = params.containsKey("ruleId") ? params.get("ruleId").toString() : null; - String createdTime = params.containsKey("createdTime") ? params.get("createdTime").toString() : null; - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(ruleId), "RULE_ID", ruleId); - wrapper.between(StringUtils.isNotBlank(createdTime), "DATE_FORMAT(CREATED_TIME, '%Y-%m' )", createdTime, createdTime); - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - wrapper - ); - PageData list = getPageData(page, KpiManualScoreDTO.class); - return list; - } - - /** - * @param params - * @return com.elink.esua.epdc.commons.tools.page.PageData - * @Author yinzuomei - * @Description 列表查询 - * @Date 2019/12/4 17:37 - **/ - @Override - public PageData listKpiManualScoreResultDTO(Map params) { - IPage page = getPage(params); - List list = baseDao.selectListKpiManualScoreResultDTO(params); - return new PageData<>(list, page.getTotal()); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, KpiManualScoreDTO.class); - } - - /** - * @param - * @return java.util.List - * @Author yinzuomei - * @Description 导出录入模板 - * @Date 2019/12/4 18:00 - **/ - @Override - public List listKpiManualScoreTemplateResultDTO(Map params) { - List list = new ArrayList<>(); - //用户所选规则 - String ruleId = params.get("ruleId").toString(); - String scoreStartTime = params.get("scoreStartTime").toString(); - Date scoreStartDateMonth = new Date(); - try { - scoreStartDateMonth = monthFormat.parse(scoreStartTime); - } catch (ParseException e) { - e.printStackTrace(); - } - Date scoreEndDateMonth = new Date(); - - KpiRuleEntity kpiRuleEntity = kpiRuleDao.selectById(ruleId); - - //考核周期赋值 - String kpiCycleName = ""; - if (kpiRuleEntity.getKpiCycle().equals(KpiCycleEnum.KPI_CYCLE_MONTH.getValue())) { - kpiCycleName = KpiCycleEnum.KPI_CYCLE_MONTH.getName(); - scoreEndDateMonth = scoreStartDateMonth; - } else if (kpiRuleEntity.getKpiCycle().equals(KpiCycleEnum.KPI_CYCLE_QUARTER.getValue())) { - kpiCycleName = KpiCycleEnum.KPI_CYCLE_QUARTER.getName(); - scoreEndDateMonth = stepMonth(scoreStartDateMonth, 2); - } else if (kpiRuleEntity.getKpiCycle().equals(KpiCycleEnum.KPI_CYCLE_YEAR.getValue())) { - kpiCycleName = KpiCycleEnum.KPI_CYCLE_YEAR.getName(); - scoreEndDateMonth = stepMonth(scoreStartDateMonth, 11); - } - - // 用户拥有的所有部门权限 - List dataScopeDeptList = getDataScopeDeptList(); - - //调用admin模块查询部门信息详情 - UserSysDeptInfoFormDTO userSysDeptInfoFormDTO = new UserSysDeptInfoFormDTO(); - userSysDeptInfoFormDTO.setDeptIdList(dataScopeDeptList); - List typeKeyList = new ArrayList<>(); - typeKeyList.add(kpiRuleEntity.getDeptTypeKey()); - userSysDeptInfoFormDTO.setTypeKeyList(typeKeyList); - Result> result = this.queryUserSysDeptInfo(userSysDeptInfoFormDTO); - - if (result.getCode() == 0 && result.getData().size() > 0) { - List userSysDeptInfoResultDTOList = result.getData(); - for (UserSysDeptInfoResultDTO userSysDeptInfoResultDTO : userSysDeptInfoResultDTOList) { - - KpiManualScoreTemplateResultDTO kpiManualScoreTemplateResultDTO = new KpiManualScoreTemplateResultDTO(); - - kpiManualScoreTemplateResultDTO.setRuleName(kpiRuleEntity.getRuleName()); - kpiManualScoreTemplateResultDTO.setStreet(userSysDeptInfoResultDTO.getStreet()); - kpiManualScoreTemplateResultDTO.setCommunity(userSysDeptInfoResultDTO.getCommunity()); - kpiManualScoreTemplateResultDTO.setGrid(userSysDeptInfoResultDTO.getGrid()); - kpiManualScoreTemplateResultDTO.setDeptName(userSysDeptInfoResultDTO.getName()); - kpiManualScoreTemplateResultDTO.setKpiCycleName(kpiCycleName); - kpiManualScoreTemplateResultDTO.setScoreStartTime(dateFormat.format(getFirstDayDateOfMonth(scoreStartDateMonth))); - kpiManualScoreTemplateResultDTO.setScoreEndTime(dateFormat.format(getLastDayOfMonth(scoreEndDateMonth))); - kpiManualScoreTemplateResultDTO.setScore(null); - - kpiManualScoreTemplateResultDTO.setRuleId(kpiRuleEntity.getId()); - kpiManualScoreTemplateResultDTO.setDeptId(userSysDeptInfoResultDTO.getId().toString()); - kpiManualScoreTemplateResultDTO.setScoreStartDate(getFirstDayDateOfMonth(scoreStartDateMonth)); - kpiManualScoreTemplateResultDTO.setScoreEndDate(getLastDayOfMonth(scoreEndDateMonth)); - kpiManualScoreTemplateResultDTO.setParentDeptIds(userSysDeptInfoResultDTO.getPids()); - kpiManualScoreTemplateResultDTO.setParentDeptNames(userSysDeptInfoResultDTO.getParentNames()); - kpiManualScoreTemplateResultDTO.setAllDeptIds(userSysDeptInfoResultDTO.getPids() + "," + userSysDeptInfoResultDTO.getId()); - kpiManualScoreTemplateResultDTO.setAllDeptNames(userSysDeptInfoResultDTO.getParentNames() + "-" + userSysDeptInfoResultDTO.getName()); - kpiManualScoreTemplateResultDTO.setUserId(SecurityUser.getUserId().toString()); - list.add(kpiManualScoreTemplateResultDTO); - } - //删除临时表数据 - kpiManualScoreTempDao.deleteManualScoreTemp(SecurityUser.getUserId().toString(), - kpiRuleEntity.getId(), - dateFormat.format(getFirstDayDateOfMonth(scoreStartDateMonth))); - //插入临时表 - List tempEntityList = ConvertUtils.sourceToTarget(list, KpiManualScoreTempEntity.class); - kpiManualScoreTempService.insertBatch(tempEntityList, 200); - } - return list; - } - - /** - * @param file - * @return com.elink.esua.epdc.commons.tools.utils.Result - * @Author yinzuomei - * @Description 导入手动打分记录 - * @Date 2019/12/5 15:46 - **/ - @Override - @Transactional(rollbackFor = Exception.class) - public Result importManualScoreExcel(MultipartFile file) { - File f = StreamUtils.conversionFile(file); - try { - //判断上传文件类型 - String originalFilename = file.getOriginalFilename(); - if (!originalFilename.contains(".xlsx") && !originalFilename.contains(".xls")) { - return new Result().error("请选择.xls或者.xlsx格式文件"); - } - ImportParams importParams = new ImportParams(); - List recordList = ExcelImportUtil.importExcel(f, KpiManualScoreTemplateExcel.class, importParams); - if (CollUtil.isEmpty(recordList)) { - return new Result().error("导入内容不能为空"); - } - //校验记录数是否一致 - List errorRecordList = new ArrayList<>(); - List tempEntityList = kpiManualScoreTempDao.selectListKpiManualScoreTemp(SecurityUser.getUserId().toString(), recordList); - if (CollUtil.isEmpty(tempEntityList) || tempEntityList.size() != recordList.size()) { - ImportExcelErrorResultDTO excelErrorResultDTO = new ImportExcelErrorResultDTO(); - excelErrorResultDTO.setErrorLine("0"); - excelErrorResultDTO.setErrorInfo("导入记录条数与导出模板不一致,请核对"); - errorRecordList.add(excelErrorResultDTO); - } - if (CollUtil.isNotEmpty(errorRecordList)) { - Result errorResult = new Result(); - errorResult.setCode(ErrorCode.INTERNAL_SERVER_ERROR); - return errorResult.ok(errorRecordList); - } - List kpiManualScoreEntityList = ConvertUtils.sourceToTarget(tempEntityList, KpiManualScoreEntity.class); - //循环插入:如果存在则删除原纪录 - for (KpiManualScoreEntity kpiManualScoreEntity : kpiManualScoreEntityList) { - baseDao.delete(getUniqueWrapper(kpiManualScoreEntity)); - baseDao.insert(kpiManualScoreEntity); - } - //删除临时表数据 - kpiManualScoreTempDao.deleteManualScoreTemp(SecurityUser.getUserId().toString(), - tempEntityList.get(0).getRuleId(), - tempEntityList.get(0).getScoreStartTime()); - } finally { -// logger.info("记得删除文件哦"); - this.deleteAllFilesOfDir(f); - } - return new Result(); - } - - /** - * 删除文件夹(强制删除) - * - * @param path - */ - public void deleteAllFilesOfDir(File path) { - if (null != path) { - if (!path.exists()) - return; - if (path.isFile()) { - boolean result = path.delete(); - int tryCount = 0; - while (!result && tryCount++ < 10) { - System.gc(); // 回收资源 - result = path.delete(); - } - } - File[] files = path.listFiles(); - if (null != files) { - for (int i = 0; i < files.length; i++) { - deleteAllFilesOfDir(files[i]); - } - } - path.delete(); - } - } - - @Override - public KpiManualScoreDTO get(String id) { - KpiManualScoreEntity entity = baseDao.selectById(id); - KpiManualScoreDTO kpiManualScoreDTO = ConvertUtils.sourceToTarget(entity, KpiManualScoreDTO.class); - try { - kpiManualScoreDTO.setScoreStartMonth(monthFormat.parse(monthFormat.format(kpiManualScoreDTO.getScoreStartDate()))); - } catch (ParseException e) { - e.printStackTrace(); - } - return kpiManualScoreDTO; - } - - @Override - @Transactional(rollbackFor = Exception.class) - public Result save(KpiManualScoreDTO dto) { - KpiRuleEntity kpiRuleEntity = kpiRuleDao.selectById(dto.getRuleId()); - //得分不能大于满分 - KpiManualScoreRuleEntity kpiManualScoreRuleEntity = kpiManualScoreRuleDao.selectOneKpiManualScoreRuleByRuleId(kpiRuleEntity.getId()); - if (null == kpiManualScoreRuleEntity) { - return new Result().error("没有找到关联的手动打分项"); - } else if (null != kpiManualScoreRuleEntity && dto.getScore() > kpiManualScoreRuleEntity.getFullMarks()) { - return new Result().error("得分不能高于满分"); - } - - // 考核部门基本信息 - Result sysDeptDTOResult=adminFeignClient.getSysDeptDTO(Long.valueOf(dto.getDeptId())); - if(!sysDeptDTOResult.success()){ - return new Result().error(sysDeptDTOResult.getMsg()); - } - if(!kpiManualScoreRuleEntity.getDeptTypeKey().equals(sysDeptDTOResult.getData().getTypeKey())){ - return new Result().error("所选部门不在当前规则考核范围内"); - } - - Date scoreEndDateMonth = new Date(); - if (kpiRuleEntity.getKpiCycle().equals(KpiCycleEnum.KPI_CYCLE_MONTH.getValue())) { - scoreEndDateMonth = dto.getScoreStartMonth(); - } else if (kpiRuleEntity.getKpiCycle().equals(KpiCycleEnum.KPI_CYCLE_QUARTER.getValue())) { - scoreEndDateMonth = stepMonth(dto.getScoreStartMonth(), 2); - } else if (kpiRuleEntity.getKpiCycle().equals(KpiCycleEnum.KPI_CYCLE_YEAR.getValue())) { - scoreEndDateMonth = stepMonth(dto.getScoreStartMonth(), 11); - } - dto.setScoreStartDate(getFirstDayDateOfMonth(dto.getScoreStartMonth())); - dto.setScoreEndDate(getLastDayOfMonth(scoreEndDateMonth)); - //根据部门ID获取上级所有部门信息 - Result parentAndAllDeptDTOResult=adminFeignClient.getParentAndAllDept(dto.getDeptId()); - if(!parentAndAllDeptDTOResult.success()){ - return new Result().error(parentAndAllDeptDTOResult.getMsg()); - } - dto.setAllDeptNames(parentAndAllDeptDTOResult.getData().getAllDeptNames()); - dto.setAllDeptIds(parentAndAllDeptDTOResult.getData().getAllDeptIds()); - dto.setParentDeptNames(parentAndAllDeptDTOResult.getData().getParentDeptNames()); - dto.setParentDeptIds(parentAndAllDeptDTOResult.getData().getParentDeptIds()); - KpiManualScoreEntity entity = ConvertUtils.sourceToTarget(dto, KpiManualScoreEntity.class); - baseDao.delete(getUniqueWrapper(entity)); - insert(entity); - return new Result(); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public Result update(KpiManualScoreDTO dto) { - KpiManualScoreEntity entity = ConvertUtils.sourceToTarget(dto, KpiManualScoreEntity.class); - //得分不能大于满分 - KpiManualScoreRuleEntity kpiManualScoreRuleEntity = kpiManualScoreRuleDao.selectOneKpiManualScoreRuleByRuleId(dto.getRuleId()); - if (null == kpiManualScoreRuleEntity) { - return new Result().error("没有找到关联的手动打分项"); - } else if (null != kpiManualScoreRuleEntity && dto.getScore() > kpiManualScoreRuleEntity.getFullMarks()) { - return new Result().error("得分不能高于满分"); - } - updateById(entity); - return new Result(); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } - - /** - * @param entity - * @return com.baomidou.mybatisplus.core.conditions.query.QueryWrapper - * @Author yinzuomei - * @Description - * @Date 2019/12/6 13:58 - **/ - public QueryWrapper getUniqueWrapper(KpiManualScoreEntity entity) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(entity.getRuleId()), "RULE_ID", entity.getRuleId()) - .eq(StringUtils.isNotBlank(entity.getDeptId()), "DEPT_ID", entity.getDeptId()) - .eq("score_end_date", entity.getScoreEndDate()) - .eq("score_start_date", entity.getScoreStartDate()); - return wrapper; - } - - /** - * @param userSysDeptInfoFormDTO - * @return com.elink.esua.epdc.commons.tools.utils.Result> - * @Author yinzuomei - * @Description - * @Date 2019/12/6 13:58 - **/ - public Result> queryUserSysDeptInfo(UserSysDeptInfoFormDTO userSysDeptInfoFormDTO) { - return adminFeignClient.queryUserSysDeptInfo(userSysDeptInfoFormDTO); - } - - /** - * @param - * @return java.util.List - * @Author yinzuomei - * @Description 用户拥有的所有部门权限 - * @Date 2019/12/5 16:29 - **/ - public List getDataScopeDeptList() { - Long userId = SecurityUser.getUserId(); - // 查询当前用户所具有的的数据权限 - UserDetail userDetail = userDetailRedis.get(userId); - // 用户拥有的所有部门权限 - return userDetail.getDeptIdList(); - } - - /** - * @param sourceDate - * @param month - * @return java.util.Date - * @Author yinzuomei - * @Description - * @Date 2019/12/5 13:46 - **/ - public Date stepMonth(Date sourceDate, int month) { - Calendar c = Calendar.getInstance(); - c.setTime(sourceDate); - c.add(Calendar.MONTH, month); - return c.getTime(); - } - - /** - * @param date - * @return java.util.Date - * @Author yinzuomei - * @Description 获取传入日期所在月的第一天 - * @Date 2019/12/5 13:46 - **/ - public Date getFirstDayDateOfMonth(Date date) { - - final Calendar cal = Calendar.getInstance(); - - cal.setTime(date); - - final int last = cal.getActualMinimum(Calendar.DAY_OF_MONTH); - - cal.set(Calendar.DAY_OF_MONTH, last); - - return cal.getTime(); - - } - - /** - * @param date - * @return java.util.Date - * @Author yinzuomei - * @Description 获取传入日期所在月的最后一天 - * @Date 2019/12/5 13:47 - **/ - public Date getLastDayOfMonth(Date date) { - - final Calendar cal = Calendar.getInstance(); - - cal.setTime(date); - - final int last = cal.getActualMaximum(Calendar.DAY_OF_MONTH); - - cal.set(Calendar.DAY_OF_MONTH, last); - - return cal.getTime(); - - } - - private QueryWrapper getWrapper(Map params) { - String id = (String) params.get(FieldConstant.ID_HUMP); - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - - return wrapper; - } + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private KpiManualScoreRuleDao kpiManualScoreRuleDao; + + @Autowired + private KpiRuleDao kpiRuleDao; + + @Autowired + private KpiResultGridDao kpiResultGridDao; + + @Autowired + private KpiMetaDataService kpiMetaDataService; + + @Autowired + private DeptUtils deptUtils; + + @Autowired + private AdminFeignClient adminFeignClient; + + @Override + public PageData page(Map params) { + String ruleId = params.containsKey("ruleId") ? params.get("ruleId").toString() : null; + String createdTime = params.containsKey(FieldConstant.CREATED_TIME_HUMP) ? params.get(FieldConstant.CREATED_TIME_HUMP).toString() : null; + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(ruleId), KpiFieldConstant.RULE_ID, ruleId); + wrapper.between(StringUtils.isNotBlank(createdTime), "DATE_FORMAT(CREATED_TIME, '%Y-%m' )", createdTime, createdTime); + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + wrapper + ); + PageData list = getPageData(page, KpiManualScoreDTO.class); + return list; + } + + /** + * @param params + * @return com.elink.esua.epdc.commons.tools.page.PageData + * @Author yinzuomei + * @Description 列表查询 + * @Date 2019/12/4 17:37 + **/ + @Override + public PageData listKpiManualScoreResultDTO(Map params) { + String allDeptIds = ""; + if (params.get("streetId") != "" && params.get("streetId") != null){ + allDeptIds = params.get("streetId").toString(); //查询条件 街道 + } + if (params.get("communityId") != "" && params.get("communityId") != null){ + allDeptIds = params.get("communityId").toString(); //查询条件 社区 + } + if (params.get("gridId") != "" && params.get("gridId") != null){ + allDeptIds = params.get("gridId").toString(); //查询条件 网格 + } + params.put("allDeptIds", allDeptIds); + IPage page = getPage(params); + List list = baseDao.selectListKpiManualScoreResultDTO(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, KpiManualScoreDTO.class); + } + + @Override + public Result checkExportTemplate(Map params) { + //用户所选规则 + String ruleId = params.get("ruleId").toString(); + // yyyy-MM + String scoreStartMonth = params.get("scoreStartDate").toString(); + // 考核周期开始月 + YearMonth scoreStartDateMonth = YearMonth.parse(scoreStartMonth); + // 考核规则 + KpiRuleEntity kpiRuleEntity = kpiRuleDao.selectById(ruleId); + // 考核周期 + String kpiCycle = kpiRuleEntity.getKpiCycle(); + checkMonthAndCycle(kpiCycle, scoreStartDateMonth); + + return new Result(); + } + + /** + * 根据选择的月份和考核周期,判断是否可以进行考核打分 + * + * @param kpiCycle + * @param scoreStartDateMonth + * @return void + * @author work@yujt.net.cn + * @date 2019/12/16 15:38 + */ + private void checkMonthAndCycle(String kpiCycle, YearMonth scoreStartDateMonth) { + + YearMonth now = YearMonth.now(); + if (now.compareTo(scoreStartDateMonth) < NumConstant.ZERO) { + throw new RenException("不能针对未来的月份进行考核打分"); + } + + int monthValue = scoreStartDateMonth.getMonthValue(); + LocalDate localDate = LocalDate.now(); + + // 季度打分 + if (kpiCycle.equals(KpiCycleEnum.KPI_CYCLE_QUARTER.getValue())) { + if (monthValue != NumConstant.ONE && monthValue != NumConstant.FOUR + && monthValue != NumConstant.SEVEN && monthValue != NumConstant.TEN) { + throw new RenException("季度打分只能在1/4/7/10月份进行"); + } + if (localDate.compareTo(scoreStartDateMonth.plusMonths(NumConstant.TWO).atEndOfMonth()) <= NumConstant.ZERO) { + throw new RenException("考核期尚未结束,无法打分"); + } + } else if (kpiCycle.equals(KpiCycleEnum.KPI_CYCLE_YEAR.getValue())) { + if (monthValue != NumConstant.ONE) { + throw new RenException("年度打分只能在1月份进行"); + } + if (localDate.compareTo(scoreStartDateMonth.plusMonths(NumConstant.ELEVEN).atEndOfMonth()) <= NumConstant.ZERO) { + throw new RenException("考核期尚未结束,无法打分"); + } + } + } + + /** + * @param + * @return java.util.List + * @Author yinzuomei + * @Description 导出录入模板 + * @Date 2019/12/4 18:00 + **/ + @Override + public List listKpiManualScoreTemplateResultDTO(Map params) { + + //用户所选规则 + String ruleId = params.get("ruleId").toString(); + // yyyy-MM + String scoreStartMonth = params.get("scoreStartDate").toString(); + // 考核周期开始月 + YearMonth scoreStartDateMonth = YearMonth.parse(scoreStartMonth); + // 考核规则 + KpiRuleEntity kpiRuleEntity = kpiRuleDao.selectById(ruleId); + // 考核周期结束日 + LocalDate scoreEndDate; + // 考核周期赋值 + String kpiCycleName; + if (kpiRuleEntity.getKpiCycle().equals(KpiCycleEnum.KPI_CYCLE_MONTH.getValue())) { + kpiCycleName = KpiCycleEnum.KPI_CYCLE_MONTH.getName(); + scoreEndDate = scoreStartDateMonth.atEndOfMonth(); + } else if (kpiRuleEntity.getKpiCycle().equals(KpiCycleEnum.KPI_CYCLE_QUARTER.getValue())) { + kpiCycleName = KpiCycleEnum.KPI_CYCLE_QUARTER.getName(); + scoreEndDate = scoreStartDateMonth.plusMonths(NumConstant.TWO).atEndOfMonth(); + } else { + kpiCycleName = KpiCycleEnum.KPI_CYCLE_YEAR.getName(); + scoreEndDate = scoreStartDateMonth.plusMonths(NumConstant.ELEVEN).atEndOfMonth(); + } + + // 用户拥有的所有部门权限 + List dataScopeDeptList = SecurityUser.getUser().getDeptIdList(); + Result> result = queryUserSysDeptInfo(dataScopeDeptList, kpiRuleEntity.getDeptTypeKey()); + + if (!result.success() || CollUtil.isEmpty(result.getData())) { + return Lists.newArrayList(); + } + List list = Lists.newArrayList(); + + List userSysDeptInfoResultDTOList = result.getData(); + for (UserSysDeptInfoResultDTO userSysDeptInfoResultDTO : userSysDeptInfoResultDTOList) { + + KpiManualScoreTemplateResultDTO kpiManualScoreTemplateResultDTO = new KpiManualScoreTemplateResultDTO(); + + kpiManualScoreTemplateResultDTO.setRuleName(kpiRuleEntity.getRuleName()); + kpiManualScoreTemplateResultDTO.setStreet(userSysDeptInfoResultDTO.getStreet()); + kpiManualScoreTemplateResultDTO.setCommunity(userSysDeptInfoResultDTO.getCommunity()); + kpiManualScoreTemplateResultDTO.setGrid(userSysDeptInfoResultDTO.getGrid()); + kpiManualScoreTemplateResultDTO.setKpiCycleName(kpiCycleName); + kpiManualScoreTemplateResultDTO.setScore(null); + kpiManualScoreTemplateResultDTO.setScoreStartDate(LocalDateUtils.localDateToDate(scoreStartDateMonth.atDay(NumConstant.ONE))); + kpiManualScoreTemplateResultDTO.setScoreEndDate(LocalDateUtils.localDateToDate(scoreEndDate)); + + list.add(kpiManualScoreTemplateResultDTO); + } + return list; + } + + /** + * 调用admin模块查询部门信息详情 + * + * @param dataScopeDeptList 用户数据权限 + * @param deptTypeKey 部门类别 + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author work@yujt.net.cn + * @date 2019/12/13 14:38 + */ + private Result> queryUserSysDeptInfo(List dataScopeDeptList, String deptTypeKey) { + + UserSysDeptInfoFormDTO userSysDeptInfoFormDTO = new UserSysDeptInfoFormDTO(); + + List typeKeyList = new ArrayList<>(); + typeKeyList.add(deptTypeKey); + userSysDeptInfoFormDTO.setTypeKeyList(typeKeyList); + + userSysDeptInfoFormDTO.setDeptIdList(dataScopeDeptList); + + return adminFeignClient.queryUserSysDeptInfo(userSysDeptInfoFormDTO); + } + + /** + * @param file + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 导入手动打分记录 + * @Date 2019/12/5 15:46 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public Result importManualScoreExcel(MultipartFile file) { + File f = StreamUtils.conversionFile(file); + try { + //判断上传文件类型 + String originalFilename = file.getOriginalFilename(); + if (!originalFilename.endsWith(StrConstant.EXCEL_SUFFIX_2003) && !originalFilename.endsWith(StrConstant.EXCEL_SUFFIX_2007)) { + return new Result().error("请选择.xls或者.xlsx格式文件"); + } + List recordList = ExcelImportUtil.importExcel(f, KpiManualScoreTemplateExcel.class, new ImportParams()); + if (CollUtil.isEmpty(recordList)) { + return new Result().error("导入内容不能为空"); + } + UserDetail user = SecurityUser.getUser(); + // 校验excel数据 + List checkResult = checkExcelForManualScore(recordList, user.getDeptIdList()); + if (CollUtil.isNotEmpty(checkResult)) { + Result result = new Result().error(); + result.setData(checkResult); + return result; + } + // 规则名 + String ruleName = ""; + // 考核规则 + KpiRuleEntity kpiRuleEntity = null; + for (KpiManualScoreTemplateExcel kpiManualScoreTemplateExcel : recordList) { + + // 根据规则名,查询考核规则和打分规则 + if (!ruleName.equals(kpiManualScoreTemplateExcel.getRuleName())) { + ruleName = kpiManualScoreTemplateExcel.getRuleName(); + kpiRuleEntity = getRuleByName(ruleName); + } + + KpiManualScoreEntity manualScoreEntity = packageManualScoreByExcelData(kpiManualScoreTemplateExcel, user, kpiRuleEntity.getId()); + + baseDao.deleteManualScore(manualScoreEntity.getRuleId(), manualScoreEntity.getDeptId() + , manualScoreEntity.getScoreStartDate(), manualScoreEntity.getScoreEndDate()); + + baseDao.insert(manualScoreEntity); + + this.saveOrUpdateKpiResult(manualScoreEntity, kpiRuleEntity.getKpiCycle()); + } + + } catch (Exception e) { + return new Result().error("数据异常,解析excel文件失败"); + } finally { + // 删除文件 + this.deleteAllFilesOfDir(f); + } + return new Result(); + } + + /** + * 组装手动打分实体 + * + * @param excelData excel中的一条数据 + * @param user 当前用户 + * @param ruleId 所属考核规则id + * @return com.elink.esua.epdc.entity.KpiManualScoreEntity + * @author work@yujt.net.cn + * @date 2019/12/26 14:42 + */ + private KpiManualScoreEntity packageManualScoreByExcelData(KpiManualScoreTemplateExcel excelData, UserDetail user, String ruleId) { + + // 获取用户所有数据权限对应的部门 + List deptList = getDeptListByDateScope(user.getDeptIdList()); + DeptLevelAndLeaderDTO deptByExcelData = getDeptByExcelData(excelData, deptList); + if (null == deptByExcelData) { + throw new RenException("匹配数据权限失败"); + } + + DeptLevelAndLeaderDTO deptLevelInfo = deptUtils.getDeptLevelInfo(deptByExcelData.getDeptId(), YesOrNoEnum.YES); + KpiManualScoreEntity manualScoreEntity = new KpiManualScoreEntity(); + manualScoreEntity.setDeptId(deptLevelInfo.getDeptId()); + manualScoreEntity.setAllDeptIds(deptLevelInfo.getAllDeptIds()); + manualScoreEntity.setAllDeptNames(deptLevelInfo.getAllDeptNames()); + manualScoreEntity.setParentDeptIds(deptLevelInfo.getParentDeptIds()); + manualScoreEntity.setParentDeptNames(deptLevelInfo.getParentDeptNames()); + manualScoreEntity.setLeaderName(deptLevelInfo.getLeaderName()); + manualScoreEntity.setScore(new BigDecimal(excelData.getScore())); + manualScoreEntity.setScoreStartDate(excelData.getScoreStartDate()); + manualScoreEntity.setScoreEndDate(excelData.getScoreEndDate()); + manualScoreEntity.setCreatorDeptId(user.getDeptId()); + manualScoreEntity.setCreatorDeptName(user.getDeptName()); + manualScoreEntity.setRuleId(ruleId); + + return manualScoreEntity; + } + + /** + * 通过数据权限获取所有部门列表 + * + * @param deptIdList + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/12/26 14:11 + */ + private List getDeptListByDateScope(List deptIdList) { + List deptList = Lists.newArrayList(); + DeptLevelAndLeaderDTO deptLevelInfo; + for (Long deptId : deptIdList) { + deptLevelInfo = deptUtils.getDeptLevelInfo(deptId, YesOrNoEnum.NO); + deptList.add(deptLevelInfo); + } + return deptList; + } + + /** + * 从数据权限的所有部门中,匹配excel中的一行数据 + * + * @param excelData excel中的某一行 + * @param deptList 用户部门权限中的所有部门 + * @return com.elink.esua.epdc.dto.DeptLevelAndLeaderDTO + * @author work@yujt.net.cn + * @date 2019/12/26 14:15 + */ + private DeptLevelAndLeaderDTO getDeptByExcelData(KpiManualScoreTemplateExcel excelData, List deptList) { + String allDeptNames = excelData.getStreet().trim() + .concat(StrConstant.HYPHEN).concat(excelData.getCommunity().trim()) + .concat(StrConstant.HYPHEN).concat(excelData.getGrid().trim()); + for (DeptLevelAndLeaderDTO oneDept : deptList) { + if (oneDept.getAllDeptNames().contains(allDeptNames)) { + return oneDept; + } + } + return null; + } + + /** + * 根据规则名称查询考核规则 + * + * @param ruleName + * @return com.elink.esua.epdc.entity.KpiRuleEntity + * @author work@yujt.net.cn + * @date 2019/12/26 14:26 + */ + private KpiRuleEntity getRuleByName(String ruleName) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(KpiFieldConstant.RULE_NAME, ruleName); + return kpiRuleDao.selectOne(wrapper); + } + + /** + * 校验手动打分上传的数据 + * + * @param recordList excel中的数据 + * @param deptIdList 用户的部门权限 + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/12/26 14:04 + */ + private List checkExcelForManualScore(List recordList, List deptIdList) { + + if (CollUtil.isEmpty(deptIdList)) { + throw new RenException("数据权限异常"); + } + // 获取用户所有数据权限对应的部门 + List deptList = getDeptListByDateScope(deptIdList); + // 用户导入的每条打分数据 + KpiManualScoreTemplateExcel kpiManualScore; + // excel错误信息 + List checkExcel = Lists.newArrayList(); + // 规则名 + String ruleName = ""; + // 考核规则 + KpiRuleEntity kpiRuleEntity = null; + // 打分规则 + KpiManualScoreRuleEntity scoreRuleEntity = null; + int rowNum; + for (int i = 0; i < recordList.size(); i++) { + kpiManualScore = recordList.get(i); + // 第几行 + rowNum = i + NumConstant.ONE; + // 是否有打分某部门权限 + if (null == getDeptByExcelData(kpiManualScore, deptList)) { + checkExcel.add(packageExcelError(rowNum, "没有为该部门打分的权限")); + } + // 根据规则名,查询考核规则和打分规则 + if (!ruleName.equals(kpiManualScore.getRuleName())) { + ruleName = kpiManualScore.getRuleName(); + kpiRuleEntity = getRuleByName(ruleName); + if (null != kpiRuleEntity) { + scoreRuleEntity = kpiManualScoreRuleDao.selectById(kpiRuleEntity.getReferenceId()); + } + } + if (null == kpiRuleEntity || null == scoreRuleEntity) { + checkExcel.add(packageExcelError(rowNum, "无法根据考核规则匹配手动打分项")); + continue; + } + // 校验考核周期相关字段数据 + List list = checkKpiCycleOfExcel(rowNum, KpiCycleEnum.getByValue(kpiRuleEntity.getKpiCycle()), kpiManualScore); + if (CollUtil.isNotEmpty(list)) { + checkExcel.addAll(list); + } + if (null == kpiManualScore.getScore()) { + checkExcel.add(packageExcelError(rowNum, "考核得分不能为空")); + } else if (scoreRuleEntity.getFullMarks().compareTo(new BigDecimal(kpiManualScore.getScore())) == NumConstant.ONE_NEG) { + checkExcel.add(packageExcelError(rowNum, "考核得分[" + kpiManualScore.getScore() + "]不能超过满分:" + scoreRuleEntity.getFullMarks().toString())); + } + } + return checkExcel; + } + + /** + * 校验excel中考核周期相关信息 + * + * @param rowNum 第几行 + * @param kpiCycleEnum 考核周期 + * @param kpiManualScore 打分时倒入的excel + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/12/26 14:02 + */ + private List checkKpiCycleOfExcel(int rowNum, KpiCycleEnum kpiCycleEnum, KpiManualScoreTemplateExcel kpiManualScore) { + List checkExcel = Lists.newArrayList(); + if (!kpiCycleEnum.getName().equals(kpiManualScore.getKpiCycleName())) { + checkExcel.add(packageExcelError(rowNum, "考核规则[" + kpiManualScore.getRuleName() + "]与考核周期[" + kpiManualScore.getKpiCycleName() + "]不匹配")); + } + LocalDate startDate = LocalDateUtils.dateToLocalDate(kpiManualScore.getScoreStartDate()); + if (startDate.getDayOfMonth() != NumConstant.ONE) { + checkExcel.add(packageExcelError(rowNum, "考核起始日[" + startDate.toString() + "]错误")); + } + LocalDate endDate = LocalDateUtils.dateToLocalDate(kpiManualScore.getScoreEndDate()); + if (endDate.compareTo(LocalDate.now()) < NumConstant.ZERO) { + checkExcel.add(packageExcelError(rowNum, "不能针对未来的日期进行考核")); + } + int monthValue = startDate.getMonthValue(); + switch (kpiCycleEnum) { + case KPI_CYCLE_MONTH: + if (startDate.lengthOfMonth() != endDate.getDayOfMonth()) { + checkExcel.add(packageExcelError(rowNum, "考核终止日[" + endDate.toString() + "]错误")); + } + break; + case KPI_CYCLE_QUARTER: + if (monthValue != NumConstant.ONE && monthValue != NumConstant.FOUR && monthValue != NumConstant.SEVEN && monthValue != NumConstant.TEN) { + checkExcel.add(packageExcelError(rowNum, "考核周期[" + kpiManualScore.getKpiCycleName() + "]不能从[" + startDate.toString() + "]开始")); + } else if (startDate.plusMonths(NumConstant.TWO).lengthOfMonth() != endDate.getDayOfMonth()) { + checkExcel.add(packageExcelError(rowNum, "考核终止日[" + endDate.toString() + "]错误")); + } + break; + case KPI_CYCLE_YEAR: + if (monthValue != NumConstant.ONE) { + checkExcel.add(packageExcelError(rowNum, "考核周期[" + kpiManualScore.getKpiCycleName() + "]不能从[" + startDate.toString() + "]开始")); + } else if (startDate.plusMonths(NumConstant.ELEVEN).lengthOfMonth() != endDate.getDayOfMonth()) { + checkExcel.add(packageExcelError(rowNum, "考核终止日[" + endDate.toString() + "]错误")); + } + break; + default: + break; + } + return checkExcel; + } + + @Data + class ExcelError { + /** + * excel错误行 + */ + private int rowNum; + /** + * 错误信息 + */ + private String errorMsg; + } + + /** + * 组装内部类ExcelError + * + * @param rowNum + * @param errorMsg + * @return com.elink.esua.epdc.service.impl.KpiManualScoreServiceImpl.ExcelError + * @author work@yujt.net.cn + * @date 2019/12/26 14:02 + */ + private ExcelError packageExcelError(int rowNum, String errorMsg) { + ExcelError excelError = new ExcelError(); + excelError.setRowNum(rowNum); + excelError.setErrorMsg(errorMsg); + return excelError; + } + + /** + * 更新或插入考核结果 + * + * @param manualScore 收到打分 + * @param kpiCycle 考核周期 + * @return void + * @author zhangyong + * @date 2019/12/18 15:56 + */ + private void saveOrUpdateKpiResult(KpiManualScoreEntity manualScore, String kpiCycle) { + //查询网格考核最终得分表:条件(deptId,scoreStartDate,scoreEndDate) + KpiResultGridDTO kpiResultGridDto = getKpiresultGrid(manualScore.getDeptId(), manualScore.getScoreStartDate(), manualScore.getScoreEndDate()); + if (null == kpiResultGridDto) { + KpiResultGridEntity kpiResultGridEntity = ConvertUtils.sourceToTarget(manualScore, KpiResultGridEntity.class); + kpiResultGridEntity.setGridId(manualScore.getDeptId()); + kpiResultGridEntity.setManualScore(manualScore.getScore()); + kpiResultGridEntity.setStartDate(manualScore.getScoreStartDate()); + kpiResultGridEntity.setEndDate(manualScore.getScoreEndDate()); + //查询考核部门类别 + kpiResultGridEntity.setKpiCycle(kpiCycle); + kpiResultGridDao.insert(kpiResultGridEntity); + } else { + //查询考核部门类别 + KpiResultGridEntity kpiResultGridEntity = new KpiResultGridEntity(); + kpiResultGridEntity.setId(kpiResultGridDto.getId()); + kpiResultGridEntity.setManualScore(manualScore.getScore()); + kpiResultGridEntity.setLeaderName(manualScore.getLeaderName()); + kpiResultGridDao.updateById(kpiResultGridEntity); + } + } + + /** + * 查询考核结果 + * + * @param deptId 部门id + * @param stateDate 开始日期 + * @param endDate 结束日期 + * @return com.elink.esua.epdc.dto.KpiResultGridDTO + * @author work@yujt.net.cn + * @date 2019/12/18 15:56 + */ + private KpiResultGridDTO getKpiresultGrid(Long deptId, Date stateDate, Date endDate) { + Map map = new HashMap<>(); + map.put("deptId", deptId); + map.put("scoreStartDate", stateDate); + map.put("scoreEndDate", endDate); + return kpiResultGridDao.selectManualScoringISExist(map); + } + + /** + * 删除文件夹(强制删除) + * + * @param path + */ + public void deleteAllFilesOfDir(File path) { + if (null != path) { + if (!path.exists()) { + return; + } + if (path.isFile()) { + boolean result = path.delete(); + int tryCount = 0; + while (!result && tryCount++ < 10) { + System.gc(); // 回收资源 + result = path.delete(); + } + } + File[] files = path.listFiles(); + if (null != files) { + for (int i = 0; i < files.length; i++) { + deleteAllFilesOfDir(files[i]); + } + } + path.delete(); + } + } + + @Override + public KpiManualScoreDTO get(String id) { + KpiManualScoreEntity entity = baseDao.selectById(id); + KpiManualScoreDTO kpiManualScoreDTO = ConvertUtils.sourceToTarget(entity, KpiManualScoreDTO.class); + kpiManualScoreDTO.setScoreStartMonth(kpiManualScoreDTO.getScoreStartDate()); + return kpiManualScoreDTO; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result save(KpiManualScoreDTO dto) { + KpiRuleEntity kpiRuleEntity = kpiRuleDao.selectById(dto.getRuleId()); + //得分不能大于满分 + KpiManualScoreRuleEntity kpiManualScoreRuleEntity = kpiManualScoreRuleDao.selectOneKpiManualScoreRuleByRuleId(kpiRuleEntity.getId()); + if (null == kpiManualScoreRuleEntity) { + return new Result().error("没有找到关联的手动打分项"); + } else if (dto.getScore().compareTo(kpiManualScoreRuleEntity.getFullMarks()) == NumConstant.ONE) { + return new Result().error("得分不能高于满分:" + kpiManualScoreRuleEntity.getFullMarks()); + } + + YearMonth scoreStartMonth = LocalDateUtils.dateToYearMonth(dto.getScoreStartMonth()); + + DeptLevelAndLeaderDTO deptLevel = deptUtils.getDeptLevelInfo(dto.getDeptId(), YesOrNoEnum.YES); + + if (!kpiManualScoreRuleEntity.getDeptTypeKey().equals(deptLevel.getTypeKey())) { + return new Result().error("所选部门不在当前规则考核范围内"); + } + + // 考核周期 + String kpiCycle = kpiRuleEntity.getKpiCycle(); + checkMonthAndCycle(kpiCycle, scoreStartMonth); + + // 考核开始日 + dto.setScoreStartDate(LocalDateUtils.localDateToDate(scoreStartMonth.atDay(NumConstant.ONE))); + + // 考核结束日 + if (kpiCycle.equals(KpiCycleEnum.KPI_CYCLE_MONTH.getValue())) { + dto.setScoreEndDate(LocalDateUtils.localDateToDate(scoreStartMonth.atEndOfMonth())); + } else if (kpiCycle.equals(KpiCycleEnum.KPI_CYCLE_QUARTER.getValue())) { + dto.setScoreEndDate(LocalDateUtils.localDateToDate(scoreStartMonth.plusMonths(NumConstant.TWO).atEndOfMonth())); + } else if (kpiCycle.equals(KpiCycleEnum.KPI_CYCLE_YEAR.getValue())) { + dto.setScoreEndDate(LocalDateUtils.localDateToDate(scoreStartMonth.plusMonths(NumConstant.ELEVEN).atEndOfMonth())); + } + + dto.setAllDeptNames(deptLevel.getAllDeptNames()); + dto.setAllDeptIds(deptLevel.getAllDeptIds()); + dto.setParentDeptNames(deptLevel.getParentDeptNames()); + dto.setParentDeptIds(deptLevel.getParentDeptIds()); + dto.setLeaderName(deptLevel.getLeaderName()); + UserDetail user = SecurityUser.getUser(); + dto.setCreatorDeptId(user.getDeptId()); + dto.setCreatorDeptName(user.getDeptName()); + + KpiManualScoreEntity entity = ConvertUtils.sourceToTarget(dto, KpiManualScoreEntity.class); + + baseDao.delete(getUniqueWrapper(entity)); + insert(entity); + return new Result(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result update(KpiManualScoreDTO dto) { + KpiManualScoreEntity entity = ConvertUtils.sourceToTarget(dto, KpiManualScoreEntity.class); + //得分不能大于满分 + KpiManualScoreRuleEntity kpiManualScoreRuleEntity = kpiManualScoreRuleDao.selectOneKpiManualScoreRuleByRuleId(dto.getRuleId()); + if (null == kpiManualScoreRuleEntity) { + return new Result().error("没有找到关联的手动打分项"); + } else if (dto.getScore().compareTo(kpiManualScoreRuleEntity.getFullMarks()) == NumConstant.ONE) { + return new Result().error("得分不能高于满分"); + } + updateById(entity); + + entity = baseDao.selectById(entity.getId()); + + this.saveOrUpdateKpiResult(entity, kpiManualScoreRuleEntity.getScoreCycle()); + + return new Result(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public void initManualScoreToMetaData() { + initManualScoreToMetaDataByCycle(KpiCycleEnum.KPI_CYCLE_MONTH.getValue()); + initManualScoreToMetaDataByCycle(KpiCycleEnum.KPI_CYCLE_QUARTER.getValue()); + initManualScoreToMetaDataByCycle(KpiCycleEnum.KPI_CYCLE_YEAR.getValue()); + } + + /** + * @param entity + * @return com.baomidou.mybatisplus.core.conditions.query.QueryWrapper + * @Author yinzuomei + * @Description + * @Date 2019/12/6 13:58 + **/ + private QueryWrapper getUniqueWrapper(KpiManualScoreEntity entity) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(entity.getRuleId()), "RULE_ID", entity.getRuleId()) + .eq(null != entity.getDeptId(), "DEPT_ID", entity.getDeptId()) + .eq("score_end_date", entity.getScoreEndDate()) + .eq("score_start_date", entity.getScoreStartDate()); + return wrapper; + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + /** + * 根据考核周期,将手动打分初始化为元数据 + * + * @param kpiCycle + * @return void + * @author work@yujt.net.cn + * @date 2019/12/25 14:28 + */ + private void initManualScoreToMetaDataByCycle(String kpiCycle) { + Date startDate = KpiLocalDateUtils.getKpiCycoleStartDate(kpiCycle); + if (null == startDate) { + return; + } + Date endDate = LocalDateUtils.localDateToDate(YearMonth.now().minusMonths(NumConstant.ONE).atEndOfMonth()); + + int pageIndex = NumConstant.ONE; + List deptIdList = deptUtils.getDeptIdList(OrganizationTypeConstant.ORG_TYPE_GRID_PARTY, NumConstant.TWENTY, pageIndex); + List metaDataList; + do { + metaDataList = Lists.newArrayList(); + for (Long deptId : deptIdList) { + KpiManualScoreEntity scoreEntity = this.getKpiManualScoreEntity(deptId, startDate, endDate); + metaDataList.add(packageKpiMetaDataEntity(deptId, startDate, endDate, kpiCycle, null == scoreEntity ? BigDecimal.ZERO : scoreEntity.getScore())); + } + kpiMetaDataService.deleteAndInsertBatch(metaDataList); + pageIndex++; + deptIdList = deptUtils.getDeptIdList(OrganizationTypeConstant.ORG_TYPE_GRID_PARTY, NumConstant.TWENTY, pageIndex); + } while (CollUtil.isNotEmpty(deptIdList)); + } + + /** + * 组装元数据对象 + * + * @param deptId + * @param startDate + * @param endDate + * @param kpiCycle + * @param score + * @return com.elink.esua.epdc.entity.KpiMetaDataEntity + * @author work@yujt.net.cn + * @date 2019/12/25 15:53 + */ + private KpiMetaDataEntity packageKpiMetaDataEntity(Long deptId, Date startDate, Date endDate, String kpiCycle, BigDecimal score) { + KpiMetaDataEntity metaDataEntity = new KpiMetaDataEntity(); + metaDataEntity.setDeptTypeKey(OrganizationTypeConstant.ORG_TYPE_GRID_PARTY); + metaDataEntity.setEndDate(endDate); + metaDataEntity.setStartDate(startDate); + metaDataEntity.setKpiCycle(kpiCycle); + metaDataEntity.setDeptId(deptId); + metaDataEntity.setDataValue(BigDecimal.ZERO); + metaDataEntity.setDataValue(score); + metaDataEntity.setDataCode(KpiMetaDataEnum.GRID_SCORE_BY_SUPERIOR_MANUAL.getValue()); + metaDataEntity.setDataName(KpiMetaDataEnum.GRID_SCORE_BY_SUPERIOR_MANUAL.getName()); + return metaDataEntity; + } + + + /** + * 查询手动打分对象 + * + * @param deptId 部门id + * @param startDate 开始日 + * @param endDate 结束日 + * @return com.elink.esua.epdc.entity.KpiManualScoreEntity + * @author work@yujt.net.cn + * @date 2019/12/25 14:28 + */ + private KpiManualScoreEntity getKpiManualScoreEntity(Long deptId, Date startDate, Date endDate) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(KpiFieldConstant.DEPT_ID, deptId) + .eq(KpiFieldConstant.SCORE_START_DATE, startDate) + .eq(KpiFieldConstant.SCORE_END_DATE, endDate); + return baseDao.selectOne(wrapper); + } + } diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiMetaDataServiceImpl.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiMetaDataServiceImpl.java new file mode 100644 index 000000000..047e3017c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiMetaDataServiceImpl.java @@ -0,0 +1,535 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service.impl; + +import 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.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.constant.OrganizationTypeConstant; +import com.elink.esua.epdc.commons.tools.exception.RenException; +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.dao.KpiMetaDataDao; +import com.elink.esua.epdc.dto.KpiMetaDataDTO; +import com.elink.esua.epdc.dto.form.KpiMetaDataOfEventsFormDTO; +import com.elink.esua.epdc.dto.result.KpiEvaluationAmountResultDTO; +import com.elink.esua.epdc.dto.result.KpiEventReportAmountResultDTO; +import com.elink.esua.epdc.dto.result.KpiItemHandleAmountResultDTO; +import com.elink.esua.epdc.entity.KpiMetaDataEntity; +import com.elink.esua.epdc.enums.KpiCycleEnum; +import com.elink.esua.epdc.enums.KpiMetaDataEnum; +import com.elink.esua.epdc.feign.EventFeignClient; +import com.elink.esua.epdc.service.KpiMetaDataService; +import com.elink.esua.epdc.utils.DeptUtils; +import com.elink.esua.epdc.utils.KpiLocalDateUtils; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +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.math.BigDecimal; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.YearMonth; +import java.util.*; + +/** + * 绩效考核的元数据 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Slf4j +@Service +public class KpiMetaDataServiceImpl extends BaseServiceImpl implements KpiMetaDataService { + + @Autowired + private DeptUtils deptUtils; + + @Autowired + private EventFeignClient eventFeignClient; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, KpiMetaDataDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, KpiMetaDataDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public KpiMetaDataDTO get(String id) { + KpiMetaDataEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, KpiMetaDataDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(KpiMetaDataDTO dto) { + KpiMetaDataEntity entity = ConvertUtils.sourceToTarget(dto, KpiMetaDataEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(KpiMetaDataDTO dto) { + KpiMetaDataEntity entity = ConvertUtils.sourceToTarget(dto, KpiMetaDataEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public void statPeopleReportAmount() { + statMetaDataOfEventAmount(KpiCycleEnum.KPI_CYCLE_MONTH.getValue()); + statMetaDataOfEventAmount(KpiCycleEnum.KPI_CYCLE_QUARTER.getValue()); + statMetaDataOfEventAmount(KpiCycleEnum.KPI_CYCLE_YEAR.getValue()); + } + + /** + * 按考核周期进行元数据统计 + * + * @param kpiCycle + * @return void + * @author work@yujt.net.cn + * @date 2019/12/19 19:51 + */ + private void statMetaDataOfEventAmount(String kpiCycle) { + KpiMetaDataOfEventsFormDTO eventReportAmountFormDto = this.initKpiParam(kpiCycle, "statPeopleReportAmount"); + if (null != eventReportAmountFormDto) { + int pageIndex = NumConstant.ONE; + + List gridList = deptUtils.getDeptIdList(OrganizationTypeConstant.ORG_TYPE_GRID_PARTY, NumConstant.TEN, pageIndex); + do { + eventReportAmountFormDto.setDeptIdList(gridList); + // 从events模块获取统计数据 + List reportAmountList = this.getMetaDateFromEventsModule(eventReportAmountFormDto); + // 组装元数据对象 + List kpiMetaDataEntities = this.packageMetaDataList(reportAmountList, eventReportAmountFormDto, kpiCycle); + // 删除已存在 并 批量插入 + this.deleteAndInsertBatch(kpiMetaDataEntities); + pageIndex++; + gridList = deptUtils.getDeptIdList(OrganizationTypeConstant.ORG_TYPE_GRID_PARTY, NumConstant.TEN, pageIndex); + } while (CollUtil.isNotEmpty(gridList)); + } + } + + /** + * 根据月、季、年 以及当前月份,初始化统计元数据值的参数,用于模块间调用 + * + * @param kpiCycle 月、季、年 + * @param methodName 调用此方法的方法名,用于日志打印 + * @return java.util.Date 若返回空值:当前月份无法针对传入的考核周期进行考核 + * @author work@yujt.net.cn + * @date 2019/12/20 09:13 + */ + private KpiMetaDataOfEventsFormDTO initKpiParam(String kpiCycle, String methodName) { + Date startDate = KpiLocalDateUtils.getKpiCycoleStartDate(kpiCycle); + if (null == startDate) { + log.error("当前时间:{},无法按照{}执行绩效考核{}", LocalDateTime.now().toString(), kpiCycle, methodName); + return null; + } + log.info("开始执行:{},当前时间:{},考核周期:{}", methodName, LocalDateTime.now().toString(), kpiCycle); + KpiMetaDataOfEventsFormDTO metaDataFormDto = new KpiMetaDataOfEventsFormDTO(); + metaDataFormDto.setStartDate(startDate); + metaDataFormDto.setEndDate(LocalDateUtils.localDateToDate(YearMonth.now().minusMonths(NumConstant.ONE).atEndOfMonth())); + return metaDataFormDto; + } + + /** + * 从events模块获取统计数据 + * + * @param eventReportAmountFormDto + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/12/19 19:50 + */ + private List getMetaDateFromEventsModule(KpiMetaDataOfEventsFormDTO eventReportAmountFormDto) { + Result> eventResult = eventFeignClient.statEventReportAmount(eventReportAmountFormDto); + if (!eventResult.success() || null == eventResult.getData()) { + log.error("统计事件上报数异常"); + throw new RenException("统计事件上报数异常"); + } + return eventResult.getData(); + } + + /** + * 组装元数据对象准备插入数据库 + * + * @param eventReportAmountList + * @param eventReportAmountFormDto + * @param kpiCycle + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/12/19 19:50 + */ + private List packageMetaDataList(List eventReportAmountList, + KpiMetaDataOfEventsFormDTO eventReportAmountFormDto, String kpiCycle) { + Date startDate = eventReportAmountFormDto.getStartDate(); + Date endDate = eventReportAmountFormDto.getEndDate(); + // 声明集合用于存放所有元数据对象 + List kpiMetaDataEntityList = Lists.newArrayList(); + KpiMetaDataEntity kpiMetaDataEntity; + for (KpiEventReportAmountResultDTO reportAmount : eventReportAmountList) { + // 群众反映问题总数 + kpiMetaDataEntity = packageMetaDataEntity(KpiMetaDataEnum.PEOPLE_REPORT_AMOUNT, BigDecimal.valueOf(reportAmount.getReportAmount()) + , reportAmount.getGridId(), OrganizationTypeConstant.ORG_TYPE_GRID_PARTY, kpiCycle, startDate, endDate); + kpiMetaDataEntityList.add(kpiMetaDataEntity); + // 群众反映问题被响应总数 + kpiMetaDataEntity = packageMetaDataEntity(KpiMetaDataEnum.PEOPLE_REPORT_RESP_AMOUNT, BigDecimal.valueOf(reportAmount.getRespondAmount()) + , reportAmount.getGridId(), OrganizationTypeConstant.ORG_TYPE_GRID_PARTY, kpiCycle, startDate, endDate); + kpiMetaDataEntityList.add(kpiMetaDataEntity); + } + return kpiMetaDataEntityList; + } + + /** + * 根据统计的居民满意度情况,组装元数据实体集合 + * + * @param peopleEvaluationDataList + * @param eventReportAmountFormDto + * @param kpiCycle + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/12/20 15:55 + */ + private List packageMetaDataByEvaluationList(List peopleEvaluationDataList, + KpiMetaDataOfEventsFormDTO eventReportAmountFormDto, String kpiCycle) { + Date startDate = eventReportAmountFormDto.getStartDate(); + Date endDate = eventReportAmountFormDto.getEndDate(); + // 声明集合用于存放所有元数据对象 + List kpiMetaDataEntityList = Lists.newArrayList(); + KpiMetaDataEntity kpiMetaDataEntity; + for (KpiEvaluationAmountResultDTO evaluationAmount : peopleEvaluationDataList) { + // 问题办理满意数 + kpiMetaDataEntity = packageMetaDataEntity(KpiMetaDataEnum.PEOPLE_HIGH_EVALUATION_AMOUNT, BigDecimal.valueOf(evaluationAmount.getHighAmount()) + , evaluationAmount.getDeptId(), OrganizationTypeConstant.ORG_TYPE_GRID_PARTY, kpiCycle, startDate, endDate); + kpiMetaDataEntityList.add(kpiMetaDataEntity); + // 问题办理基本满意数 + kpiMetaDataEntity = packageMetaDataEntity(KpiMetaDataEnum.PEOPLE_MEDIUM_EVALUATION_AMOUNT, BigDecimal.valueOf(evaluationAmount.getMediumAmount()) + , evaluationAmount.getDeptId(), OrganizationTypeConstant.ORG_TYPE_GRID_PARTY, kpiCycle, startDate, endDate); + kpiMetaDataEntityList.add(kpiMetaDataEntity); + // 问题办理不满意数 + kpiMetaDataEntity = packageMetaDataEntity(KpiMetaDataEnum.PEOPLE_LOW_EVALUATION_AMOUNT, BigDecimal.valueOf(evaluationAmount.getLowAmount()) + , evaluationAmount.getDeptId(), OrganizationTypeConstant.ORG_TYPE_GRID_PARTY, kpiCycle, startDate, endDate); + kpiMetaDataEntityList.add(kpiMetaDataEntity); + } + return kpiMetaDataEntityList; + } + + /** + * 组装元数据对象 + * + * @param metaDataEnum 元数据类别枚举 + * @param dataValue 元数据值 + * @param deptId 部门id + * @param deptTypeKey 部门类别 + * @param kpiCycle 考核周期 + * @param startDate 考核开始日 + * @param endDate 考核结束日 + * @return com.elink.esua.epdc.entity.KpiMetaDataEntity + * @author work@yujt.net.cn + * @date 2019/12/20 14:05 + */ + private KpiMetaDataEntity packageMetaDataEntity(KpiMetaDataEnum metaDataEnum, BigDecimal dataValue, Long deptId, + String deptTypeKey, String kpiCycle, Date startDate, Date endDate) { + KpiMetaDataEntity kpiMetaDataEntity = new KpiMetaDataEntity(); + kpiMetaDataEntity.setDataCode(metaDataEnum.getValue()); + kpiMetaDataEntity.setDataName(metaDataEnum.getName()); + kpiMetaDataEntity.setDataValue(dataValue); + kpiMetaDataEntity.setDeptId(deptId); + kpiMetaDataEntity.setDeptTypeKey(deptTypeKey); + kpiMetaDataEntity.setKpiCycle(kpiCycle); + kpiMetaDataEntity.setStartDate(startDate); + kpiMetaDataEntity.setEndDate(endDate); + return kpiMetaDataEntity; + } + + @Override + public void statPeopleEvaluation() { + statMetaDataOfPeopleEvaluation(KpiCycleEnum.KPI_CYCLE_MONTH.getValue()); + statMetaDataOfPeopleEvaluation(KpiCycleEnum.KPI_CYCLE_QUARTER.getValue()); + statMetaDataOfPeopleEvaluation(KpiCycleEnum.KPI_CYCLE_YEAR.getValue()); + } + + /** + * 根据考核周期,统计周期内群众对网格处理项目的满意率 + * + * @param kpiCycle + * @return void + * @author work@yujt.net.cn + * @date 2019/12/20 15:53 + */ + private void statMetaDataOfPeopleEvaluation(String kpiCycle) { + KpiMetaDataOfEventsFormDTO metaDataFormDto = this.initKpiParam(kpiCycle, "statPeopleEvaluation"); + if (null != metaDataFormDto) { + int pageIndex = NumConstant.ONE; + List gridList = deptUtils.getDeptIdList(OrganizationTypeConstant.ORG_TYPE_GRID_PARTY, NumConstant.TEN, pageIndex); + do { + metaDataFormDto.setDeptIdList(gridList); + // 从events模块查询数据 + List peopleEvaluationDataList = this.getMetaDataListOfPeopleEvaluation(metaDataFormDto); + // 组装元数据实体 + List kpiMetaDataEntities = this.packageMetaDataByEvaluationList(peopleEvaluationDataList, metaDataFormDto, kpiCycle); + // 删除已存在 并 批量插入 + this.deleteAndInsertBatch(kpiMetaDataEntities); + pageIndex++; + gridList = deptUtils.getDeptIdList(OrganizationTypeConstant.ORG_TYPE_GRID_PARTY, NumConstant.TEN, pageIndex); + } while (CollUtil.isNotEmpty(gridList)); + } + } + + /** + * 调用events模块,查询群众满意度评价 + * + * @param metaDataFormDto + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/12/23 14:12 + */ + private List getMetaDataListOfPeopleEvaluation(KpiMetaDataOfEventsFormDTO metaDataFormDto) { + Result> eventResult = eventFeignClient.statPeopleEvaluationMetaData(metaDataFormDto); + if (!eventResult.success() || null == eventResult.getData()) { + log.error("方法{}执行失败,统计周期:{}至{}。", "getMetaDataListOfPeopleEvaluation", + DateUtils.format(metaDataFormDto.getStartDate()), DateUtils.format(metaDataFormDto.getEndDate())); + throw new RenException("调用events模块失败"); + } + return eventResult.getData(); + } + + @Override + public void statItemHandleAmount() { + statMetaDataOfItemHandleAmount(KpiCycleEnum.KPI_CYCLE_MONTH.getValue(), OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT); + statMetaDataOfItemHandleAmount(KpiCycleEnum.KPI_CYCLE_MONTH.getValue(), OrganizationTypeConstant.ORG_TYPE_STREET_PARTY); + + statMetaDataOfItemHandleAmount(KpiCycleEnum.KPI_CYCLE_QUARTER.getValue(), OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT); + statMetaDataOfItemHandleAmount(KpiCycleEnum.KPI_CYCLE_QUARTER.getValue(), OrganizationTypeConstant.ORG_TYPE_STREET_PARTY); + + statMetaDataOfItemHandleAmount(KpiCycleEnum.KPI_CYCLE_YEAR.getValue(), OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT); + statMetaDataOfItemHandleAmount(KpiCycleEnum.KPI_CYCLE_YEAR.getValue(), OrganizationTypeConstant.ORG_TYPE_STREET_PARTY); + } + + /** + * 根据考核周期与部门类型,统计项目的网格呼叫数,呼叫被响应数,呼叫被办结数 + * + * @param kpiCycle 考核周期 + * @param deptTypeKey 部门类型 + * @return void + * @author work@yujt.net.cn + * @date 2019/12/23 14:06 + */ + private void statMetaDataOfItemHandleAmount(String kpiCycle, String deptTypeKey) { + KpiMetaDataOfEventsFormDTO metaDataFormDto = this.initKpiParam(kpiCycle, "statItemHandleAmount"); + if (null != metaDataFormDto) { + int pageIndex = NumConstant.ONE; + List deptIdList = deptUtils.getDeptIdList(deptTypeKey, NumConstant.TEN, pageIndex); + do { + metaDataFormDto.setDeptIdList(deptIdList); + + List itemHandleAmountList = this.getHandleAmountListFromEvents(metaDataFormDto); + List kpiMetaDataEntities = this.packageMetaDataByItemHandleAmountList(itemHandleAmountList, metaDataFormDto, kpiCycle, deptTypeKey); + // 删除已存在 并 批量插入 + this.deleteAndInsertBatch(kpiMetaDataEntities); + pageIndex++; + deptIdList = deptUtils.getDeptIdList(deptTypeKey, NumConstant.TEN, pageIndex); + } while (CollUtil.isNotEmpty(deptIdList)); + } + } + + /** + * 组装元数据实体对象 + * + * @param itemHandleAmountList 网格呼叫数,呼叫被响应数,呼叫被办结数 + * @param metaDataFormDto 查询参数,主要是开始与结束时间 + * @param kpiCycle 考核周期 + * @param deptTypeKey 部门类型 + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/12/23 14:07 + */ + private List packageMetaDataByItemHandleAmountList( + List itemHandleAmountList, + KpiMetaDataOfEventsFormDTO metaDataFormDto, String kpiCycle, String deptTypeKey) { + + Date startDate = metaDataFormDto.getStartDate(); + Date endDate = metaDataFormDto.getEndDate(); + // 声明集合用于存放所有元数据对象 + List kpiMetaDataEntityList = Lists.newArrayList(); + KpiMetaDataEntity kpiMetaDataEntity; + + for (KpiItemHandleAmountResultDTO itemHandleAmount : itemHandleAmountList) { + kpiMetaDataEntity = packageMetaDataEntity(KpiMetaDataEnum.getByValue(itemHandleAmount.getMetaDataCode()), + BigDecimal.valueOf(itemHandleAmount.getMetaDataValue()), + itemHandleAmount.getDeptId(), deptTypeKey, kpiCycle, startDate, endDate); + kpiMetaDataEntityList.add(kpiMetaDataEntity); + } + + return kpiMetaDataEntityList; + } + + /** + * 调用events模块,统计网格呼叫数,呼叫被响应数,呼叫被办结数 + * + * @param metaDataFormDto + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/12/23 14:08 + */ + private List getHandleAmountListFromEvents(KpiMetaDataOfEventsFormDTO metaDataFormDto) { + Result> eventResult = eventFeignClient.statItemHandleAmount(metaDataFormDto); + if (!eventResult.success() || eventResult.getData() == null) { + log.error("方法{}执行失败,统计周期:{}至{}。", "getHandleAmountListFromEvents", + DateUtils.format(metaDataFormDto.getStartDate()), DateUtils.format(metaDataFormDto.getEndDate())); + throw new RenException("调用events模块失败"); + } + return eventResult.getData(); + } + + /** + * 先删除已有数据再批量插入元数据表 + * + * @param metaDateList + * @return void + * @author qushutong + * @date 2019/12/24 14:38 + */ + @Override + public void deleteAndInsertBatch(List metaDateList) { + baseDao.deleteListRepetitionMeta(metaDateList); + this.insertBatch(metaDateList); + } + + @Override + public void statGridEvaluation() { + statMetaDataOfGridEvaluation(KpiCycleEnum.KPI_CYCLE_MONTH.getValue(), OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT); + statMetaDataOfGridEvaluation(KpiCycleEnum.KPI_CYCLE_MONTH.getValue(), OrganizationTypeConstant.ORG_TYPE_STREET_PARTY); + + statMetaDataOfGridEvaluation(KpiCycleEnum.KPI_CYCLE_QUARTER.getValue(), OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT); + statMetaDataOfGridEvaluation(KpiCycleEnum.KPI_CYCLE_QUARTER.getValue(), OrganizationTypeConstant.ORG_TYPE_STREET_PARTY); + + statMetaDataOfGridEvaluation(KpiCycleEnum.KPI_CYCLE_YEAR.getValue(), OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT); + statMetaDataOfGridEvaluation(KpiCycleEnum.KPI_CYCLE_YEAR.getValue(), OrganizationTypeConstant.ORG_TYPE_STREET_PARTY); + } + + /** + * 根据考核周期和部门类型 统计 网格对项目处理的满意度情况 + * + * @param kpiCycle 考核周期 + * @param deptTypeKey 部门类型 + * @return void + * @author work@yujt.net.cn + * @date 2019/12/23 17:24 + */ + private void statMetaDataOfGridEvaluation(String kpiCycle, String deptTypeKey) { + // 获取考核周期开始日 + KpiMetaDataOfEventsFormDTO metaDataFormDto = this.initKpiParam(kpiCycle, "statGridEvaluation"); + if (null != metaDataFormDto) { + // 声明页容量和页码 + int pageIndex = NumConstant.ONE; + + List gridList = deptUtils.getDeptIdList(deptTypeKey, NumConstant.TEN, pageIndex); + do { + metaDataFormDto.setDeptIdList(gridList); + // 从events模块获取统计数据 + List jobEvaluationDataList = this.getjobEvaluationDataModule(metaDataFormDto); + // 组装元数据对象 + List kpiMetaDataEntities = this.packageMetaDataByGridEvaluationList(jobEvaluationDataList, metaDataFormDto, kpiCycle, deptTypeKey); + // 删除已存在 并 批量插入 + this.deleteAndInsertBatch(kpiMetaDataEntities); + pageIndex++; + gridList = deptUtils.getDeptIdList(deptTypeKey, NumConstant.TEN, pageIndex); + } while (CollUtil.isNotEmpty(gridList)); + } + } + + + /** + * 组装元数据实体,包括 网格对项目处理 满意、基本满意、不满意的数量 + * + * @param evaluationDataList 满意评价统计结果 + * @param metaDataFormDto 考核周期开始、结束日 + * @param kpiCycle 考核周期 + * @param OrganizationType 部门类型 + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/12/23 17:18 + */ + private List packageMetaDataByGridEvaluationList(List evaluationDataList, + KpiMetaDataOfEventsFormDTO metaDataFormDto, String kpiCycle, String OrganizationType) { + Date startDate = metaDataFormDto.getStartDate(); + Date endDate = metaDataFormDto.getEndDate(); + // 声明集合用于存放所有元数据对象 + List kpiMetaDataEntityList = Lists.newArrayList(); + KpiMetaDataEntity kpiMetaDataEntity; + for (KpiEvaluationAmountResultDTO evaluationAmount : evaluationDataList) { + // 网格评价满意数 + kpiMetaDataEntity = packageMetaDataEntity(KpiMetaDataEnum.GRID_HIGH_EVALUATION_AMOUNT, BigDecimal.valueOf(evaluationAmount.getHighAmount()) + , evaluationAmount.getDeptId(), OrganizationType, kpiCycle, startDate, endDate); + kpiMetaDataEntityList.add(kpiMetaDataEntity); + // 网格评价基本满意数 + kpiMetaDataEntity = packageMetaDataEntity(KpiMetaDataEnum.GRID_MEDIUM_EVALUATION_AMOUNT, BigDecimal.valueOf(evaluationAmount.getMediumAmount()) + , evaluationAmount.getDeptId(), OrganizationType, kpiCycle, startDate, endDate); + kpiMetaDataEntityList.add(kpiMetaDataEntity); + // 网格评价不满意数 + kpiMetaDataEntity = packageMetaDataEntity(KpiMetaDataEnum.GRID_LOW_EVALUATION_AMOUNT, BigDecimal.valueOf(evaluationAmount.getLowAmount()) + , evaluationAmount.getDeptId(), OrganizationType, kpiCycle, startDate, endDate); + kpiMetaDataEntityList.add(kpiMetaDataEntity); + } + return kpiMetaDataEntityList; + } + + private List getjobEvaluationDataModule(KpiMetaDataOfEventsFormDTO metaDataFormDto) { + Result> listResult = eventFeignClient.statGridEvaluationMetaData(metaDataFormDto); + if (!listResult.success() || null == listResult.getData()) { + log.error("统计网格工作评议数异常"); + throw new RenException("统计网格工作评议数异常"); + } + return listResult.getData(); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiResultGridServiceImpl.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiResultGridServiceImpl.java new file mode 100644 index 000000000..57b95a2ea --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiResultGridServiceImpl.java @@ -0,0 +1,252 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.dao.KpiMetaDataDao; +import com.elink.esua.epdc.dao.KpiResultGridDao; +import com.elink.esua.epdc.dto.KpiMetaDataDTO; +import com.elink.esua.epdc.dto.KpiResultGridDTO; +import com.elink.esua.epdc.entity.KpiResultGridEntity; +import com.elink.esua.epdc.enums.KpiMetaDataEnum; +import com.elink.esua.epdc.enums.KpiResultGridDataEnum; +import com.elink.esua.epdc.redis.KpiResultGridRedis; +import com.elink.esua.epdc.service.KpiResultGridService; +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.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.*; + +/** + * 网格考核最终得分 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-12-17 + */ +@Service +public class KpiResultGridServiceImpl extends BaseServiceImpl implements KpiResultGridService { + + @Autowired + private KpiResultGridRedis kpiResultGridRedis; + @Autowired + private KpiResultGridDao kpiResultGridDao; + @Autowired + private KpiMetaDataDao kpiMetaDataDao; + + @Override + public PageData page(Map params) { + Integer page = Integer.parseInt(params.get("page").toString()); + Integer limit = Integer.parseInt(params.get("limit").toString()); + String allDeptIds = this.queryAffiliatedInstitutionsParams(params); + params.put("page",(page - 1) * limit); + params.put("limit", limit); + params.put("allDeptIds", allDeptIds); + int count = kpiResultGridDao.selectStatisticalInfoCount(params); + List list = kpiResultGridDao.selectStatisticalInfoList(params); + PageData pageData = new PageData(list,count); + return pageData; + } + + @Override + public List list(Map params) { + String allDeptIds = this.queryAffiliatedInstitutionsParams(params); + params.put("allDeptIds", allDeptIds); + List entityList = baseDao.list(params); + return entityList; + } + + /** + * @Description: 处理所属机构 查询条件 + * @Param: [params] + * @return: java.lang.String + * @Author: zy + * @Date: 2019-12-26 + */ + private String queryAffiliatedInstitutionsParams(Map params){ + String allDeptIds = ""; + if (params.get("streetId") != "" && params.get("streetId") != null){ + allDeptIds = params.get("streetId").toString(); //查询条件 街道 + } + if (params.get("communityId") != "" && params.get("communityId") != null){ + allDeptIds = params.get("communityId").toString(); //查询条件 社区 + } + if (params.get("gridId") != "" && params.get("gridId") != null){ + allDeptIds = params.get("gridId").toString(); //查询条件 网格 + } + return allDeptIds; + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + /** + * @Description: 返回考核统计 详情页详情 + * @Param: [id] + * @return: java.util.List + * 序号:rownum + * 规则:rule + * 详情:detail + * @Author: zy + * @Date: 2019-12-20 + */ + @Override + public List get(String id) { + List listMap = new ArrayList(); + //查询网格考核最终得分表, 拼接:履行抓基层党建工作职责得分 + KpiResultGridDTO workScore = this.getWorkDutyScore(id); + listMap.add(workScore); + //根据 部门ID(网格ID),开始时间,结束时间(年月日) 查询 绩效考核的元数据表, 根据枚举计算得分 + Map mapBigDecimal = this.gridProblemHandlingScore(workScore); + + // 拼接:群众反映问题网格响应率得分 + KpiResultGridDTO dto = new KpiResultGridDTO(); + StringBuilder responseDetail = new StringBuilder(); + responseDetail.append("群众反应问题总数:"); + responseDetail.append(mapBigDecimal.get("peopleReportAmount") + ","); + responseDetail.append("群众反应问题响应数:" + mapBigDecimal.get("peopleReportRespAmount")); + dto.setRownum(2); + dto.setRule(KpiResultGridDataEnum.GRID_PROBLEM_RESPONSE_RATE_SCORE.getName()); + dto.setDetail(responseDetail.toString()); + listMap.add(dto); + + // 拼接:群群众反映问题网格办理满意率得分 + KpiResultGridDTO dto1 = new KpiResultGridDTO(); + StringBuilder satisfiedDetail = new StringBuilder(); + satisfiedDetail.append("调查总数:" + mapBigDecimal.get("total") + ";满意数:" + mapBigDecimal.get("peopleHighEvaluationAmount") + ";基本满意数:" + + mapBigDecimal.get("peopleMediumEvaluationAmount") + ";不满意数:" + mapBigDecimal.get("peopleLowEvaluationAmount")); + dto1.setRownum(3); + dto1.setRule(KpiResultGridDataEnum.GRID_PROBLEM_SATISFACTION_RATE_SCORE.getName()); + dto1.setDetail(satisfiedDetail.toString()); + listMap.add(dto1); + return listMap; + } + + /** + * @Description: 根据 网格考核最终得分表主键,拼接:履行抓基层党建工作职责得分 + * @Param: [id] + * @return: com.elink.esua.epdc.dto.KpiResultGridDTO + * @Author: zy + * @Date: 2019-12-20 + */ + public KpiResultGridDTO getWorkDutyScore(String id){ + KpiResultGridDTO kpiResultGridDTO = new KpiResultGridDTO(); + KpiResultGridEntity entity = baseDao.selectById(id); + StringBuilder detail = new StringBuilder(); + detail.append("评分部门:"); + if (entity.getAllDeptNames() != null && entity.getAllDeptNames() != ""){ + String[] split = entity.getAllDeptNames().split("-"); + if (split.length >= 2){ + detail.append(split[2] + ","); + }else { + detail.append(","); + } + }else { + detail.append(","); + } + SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + String scoreTime = sim.format(entity.getCreatedTime()); + detail.append("评分时间:" + scoreTime + ", 原始得分:" + entity.getManualScore()); + kpiResultGridDTO.setRownum(1); + kpiResultGridDTO.setRule(KpiResultGridDataEnum.BASIC_LEVEL_WORK_SCORE.getName()); + kpiResultGridDTO.setDetail(detail.toString()); + //用作后期查询,不生成导出列 + kpiResultGridDTO.setGridId(entity.getGridId()); + kpiResultGridDTO.setId(id); + kpiResultGridDTO.setStartDate(entity.getStartDate()); + kpiResultGridDTO.setEndDate(entity.getEndDate()); + return kpiResultGridDTO; + } + + /** + * @Description: 部门ID(网格ID),开始时间,结束时间(年月日) 查询 绩效考核的元数据表 + * @Param: {startDate}、{endDate}、{deptId} + * @return: com.elink.esua.epdc.dto.KpiResultGridDTO + * @Author: zy + * @Date: 2019-12-20 + */ + public Map gridProblemHandlingScore(KpiResultGridDTO kpiResultGridDTO){ + Map map = new HashMap(); + List dto = kpiMetaDataDao.queryGridProblemHandlingScore(kpiResultGridDTO); + BigDecimal peopleReportAmount = new BigDecimal(0); + BigDecimal peopleReportRespAmount = new BigDecimal(0); + BigDecimal peopleHighEvaluationAmount = new BigDecimal(0); + BigDecimal peopleMediumEvaluationAmount = new BigDecimal(0); + BigDecimal peopleLowEvaluationAmount = new BigDecimal(0); + BigDecimal total = new BigDecimal(0); + for (KpiMetaDataDTO kpiMetaDataDTO : dto){ + if (KpiMetaDataEnum.PEOPLE_REPORT_AMOUNT.getValue().equals(kpiMetaDataDTO.getDataCode())){ // 计算 群众反映问题总数 + peopleReportAmount = peopleReportAmount.add(kpiMetaDataDTO.getDataValue()); + }else if (KpiMetaDataEnum.PEOPLE_REPORT_RESP_AMOUNT.getValue().equals(kpiMetaDataDTO.getDataCode())){ //群众反映问题被响应数 + peopleReportRespAmount = peopleReportRespAmount.add(kpiMetaDataDTO.getDataValue()); + }else if (KpiMetaDataEnum.PEOPLE_HIGH_EVALUATION_AMOUNT.getValue().equals(kpiMetaDataDTO.getDataCode())){ //问题办理满意数 + peopleHighEvaluationAmount = peopleHighEvaluationAmount.add(kpiMetaDataDTO.getDataValue()); + }else if (KpiMetaDataEnum.PEOPLE_MEDIUM_EVALUATION_AMOUNT.getValue().equals(kpiMetaDataDTO.getDataCode())){ //问题办理基本满意数 + peopleMediumEvaluationAmount = peopleMediumEvaluationAmount.add(kpiMetaDataDTO.getDataValue()); + }else if (KpiMetaDataEnum.PEOPLE_LOW_EVALUATION_AMOUNT.getValue().equals(kpiMetaDataDTO.getDataCode())){ //问题办理不满意数 + peopleLowEvaluationAmount = peopleLowEvaluationAmount.add(kpiMetaDataDTO.getDataValue()); + } + } + total = total.add(peopleHighEvaluationAmount); + total = total.add(peopleMediumEvaluationAmount); + total = total.add(peopleLowEvaluationAmount); + map.put("peopleReportAmount",peopleReportAmount); + map.put("peopleReportRespAmount",peopleReportRespAmount); + map.put("peopleHighEvaluationAmount",peopleHighEvaluationAmount); + map.put("peopleMediumEvaluationAmount",peopleMediumEvaluationAmount); + map.put("peopleLowEvaluationAmount",peopleLowEvaluationAmount); + map.put("total",total); + return map; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(KpiResultGridDTO dto) { + KpiResultGridEntity entity = ConvertUtils.sourceToTarget(dto, KpiResultGridEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(KpiResultGridDTO dto) { + KpiResultGridEntity entity = ConvertUtils.sourceToTarget(dto, KpiResultGridEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiResultSuperiorServiceImpl.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiResultSuperiorServiceImpl.java new file mode 100644 index 000000000..ac79825e2 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiResultSuperiorServiceImpl.java @@ -0,0 +1,171 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.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.KpiMetaDataDao; +import com.elink.esua.epdc.dao.KpiResultSuperiorDao; +import com.elink.esua.epdc.dto.KpiMetaDataDTO; +import com.elink.esua.epdc.dto.KpiResultGridDTO; +import com.elink.esua.epdc.dto.KpiResultSuperiorDTO; +import com.elink.esua.epdc.entity.KpiResultSuperiorEntity; +import com.elink.esua.epdc.enums.KpiMetaDataEnum; +import com.elink.esua.epdc.redis.KpiResultSuperiorRedis; +import com.elink.esua.epdc.service.KpiResultSuperiorService; +import com.sun.org.apache.bcel.internal.generic.NEW; +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.math.BigDecimal; +import java.util.*; + +/** + * 街道或区直绩效考核最终得分 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-23 + */ +@Service +public class KpiResultSuperiorServiceImpl extends BaseServiceImpl implements KpiResultSuperiorService { + + @Autowired + private KpiResultSuperiorRedis kpiResultSuperiorRedis; + @Autowired + private KpiResultSuperiorDao kpiResultSuperiorDao; + @Autowired + private KpiMetaDataDao kpiMetaDataDao; + @Override + public PageData page(Map params) { + Integer page = Integer.parseInt(params.get("page").toString()); + Integer limit = Integer.parseInt(params.get("limit").toString()); + String allDeptIds = this.queryAffiliatedInstitutionsParams(params); + params.put("page",(page - 1) * limit); + params.put("limit", limit); + params.put("allDeptIds", allDeptIds); + int count = kpiResultSuperiorDao.selectSuperiorInfoCount(params); + List list = kpiResultSuperiorDao.selectSuperiorInfoList(params); + PageData pageData = new PageData(list,count); + return pageData; + } + + @Override + public List list(Map params) { + String allDeptIds = this.queryAffiliatedInstitutionsParams(params); + params.put("allDeptIds", allDeptIds); + List dtoList = kpiResultSuperiorDao.exportSuperiorList(params); + + return dtoList; + } + + /** + * @Description: 处理所属机构 查询条件 + * @Param: [params] + * @return: java.lang.String + * @Author: zy + * @Date: 2019-12-26 + */ + private String queryAffiliatedInstitutionsParams(Map params){ + String allDeptIds = ""; + if (params.get("streetId") != "" && params.get("streetId") != null){ + allDeptIds = params.get("streetId").toString(); //查询条件 街道 + } + if (params.get("communityId") != "" && params.get("communityId") != null){ + allDeptIds = params.get("communityId").toString(); //查询条件 社区 + } + if (params.get("gridId") != "" && params.get("gridId") != null){ + allDeptIds = params.get("gridId").toString(); //查询条件 网格 + } + return allDeptIds; + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + /** + * @Description: 区直街道考核统计 详情页分数查询 + * @Param: [id] + * @return: com.elink.esua.epdc.dto.KpiResultSuperiorDTO + * @Author: zy + * @Date: 2019-12-24 + */ + @Override + public List get(String id) { + KpiResultSuperiorEntity entity = baseDao.selectById(id); + //根据网格id,开始时间、结束时间,查询 区直街道考核统计 详情页分数(响应网格呼叫事项数、工作评议满意数...)具体值 + KpiResultGridDTO kpiResultGridDTO = new KpiResultGridDTO(); + kpiResultGridDTO.setGridId(entity.getDeptId()); + kpiResultGridDTO.setStartDate(entity.getStartDate()); + kpiResultGridDTO.setEndDate(entity.getEndDate()); + List dtoMetaData = kpiMetaDataDao.queryGridProblemHandlingScore(kpiResultGridDTO); + List resultSuperiorList = new ArrayList(); + KpiResultSuperiorDTO resultSuperior = new KpiResultSuperiorDTO(); + resultSuperior.setId(entity.getId()); + String A = KpiMetaDataEnum.GRID_LOW_EVALUATION_AMOUNT.getValue(); + for (KpiMetaDataDTO K : dtoMetaData){ + if (KpiMetaDataEnum.GRID_CALL_SUPERIOR_AMOUNT.getValue().equals(K.getDataCode())){ // 网格呼叫总数 + resultSuperior.setGridCallSuperiorAmount(K.getDataValue()); + }else if (KpiMetaDataEnum.GRID_CALL_SUPERIOR_RESP_AMOUNT.getValue().equals(K.getDataCode())){ //网格呼叫被响应数 + resultSuperior.setGridCallSuperiorRespAmount(K.getDataValue()); + }else if (KpiMetaDataEnum.GRID_CALL_SUPERIOR_CLOSE_AMOUNT.getValue().equals(K.getDataCode())){ //网格呼叫被办结数 + resultSuperior.setGridCallSuperiorCloseAmount(K.getDataValue()); + }else if (KpiMetaDataEnum.GRID_HIGH_EVALUATION_AMOUNT.getValue().equals(K.getDataCode())){ //网格评议满意数 + resultSuperior.setGridHighEvaluationAmount(K.getDataValue()); + }else if (KpiMetaDataEnum.GRID_MEDIUM_EVALUATION_AMOUNT.getValue().equals(K.getDataCode())){ //网格评议基本满意数 + resultSuperior.setGridMediumEvaluationAmount(K.getDataValue()); + }else if (KpiMetaDataEnum.GRID_LOW_EVALUATION_AMOUNT.getValue().equals(K.getDataCode())){ //网格评议不满意数 + resultSuperior.setGridLowEvaluationAmount(K.getDataValue()); + } + } + resultSuperiorList.add(resultSuperior); + return resultSuperiorList; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(KpiResultSuperiorDTO dto) { + KpiResultSuperiorEntity entity = ConvertUtils.sourceToTarget(dto, KpiResultSuperiorEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(KpiResultSuperiorDTO dto) { + KpiResultSuperiorEntity entity = ConvertUtils.sourceToTarget(dto, KpiResultSuperiorEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiRuleServiceImpl.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiRuleServiceImpl.java index 4f242317b..aac232fa4 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiRuleServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiRuleServiceImpl.java @@ -19,25 +19,32 @@ 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.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.constant.StrConstant; +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; +import com.elink.esua.epdc.commons.tools.exception.RenException; 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.LocalDateUtils; import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.dao.KpiFormulaDao; -import com.elink.esua.epdc.dao.KpiRuleDao; -import com.elink.esua.epdc.dao.KpiRuleParamDao; -import com.elink.esua.epdc.dto.KpiRuleDTO; -import com.elink.esua.epdc.dto.KpiRuleParamDTO; +import com.elink.esua.epdc.constant.KpiFieldConstant; +import com.elink.esua.epdc.constant.KpiScheduleCodeConstant; +import com.elink.esua.epdc.dao.*; +import com.elink.esua.epdc.dto.*; import com.elink.esua.epdc.dto.form.KpiRuleSaveOrUpdateFormDTO; import com.elink.esua.epdc.dto.result.KpiRuleQueryResultDTO; -import com.elink.esua.epdc.entity.KpiFormulaEntity; -import com.elink.esua.epdc.entity.KpiRuleEntity; -import com.elink.esua.epdc.entity.KpiRuleParamEntity; -import com.elink.esua.epdc.redis.KpiRuleRedis; -import com.elink.esua.epdc.service.KpiRuleParamService; +import com.elink.esua.epdc.entity.*; +import com.elink.esua.epdc.enums.KpiCycleEnum; +import com.elink.esua.epdc.enums.KpiRuleModeEnum; import com.elink.esua.epdc.service.KpiRuleService; +import com.elink.esua.epdc.utils.DeptUtils; +import com.elink.esua.epdc.utils.KpiLocalDateUtils; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -45,9 +52,13 @@ 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; +import javax.script.Invocable; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.time.YearMonth; +import java.util.*; /** * 考核规则表 @@ -55,218 +66,542 @@ import java.util.Map; * @author qu qu@elink-cn.com * @since v1.0.0 2019-11-27 */ +@Slf4j @Service public class KpiRuleServiceImpl extends BaseServiceImpl implements KpiRuleService { - private Logger logger = LoggerFactory.getLogger(getClass()); - @Autowired - private KpiRuleRedis kpiRuleRedis; - - @Autowired - private KpiRuleParamService kpiRuleParamService; - - @Autowired - private KpiRuleParamDao kpiRuleParamDao; - @Autowired - private KpiFormulaDao kpiFormulaDao; - - @Override - public PageData page(Map params) { - String ruleName = params.containsKey("ruleName") ? params.get("ruleName").toString() : null; - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.like(StringUtils.isNotBlank(ruleName), "rule_name", ruleName); - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - wrapper - ); - return getPageData(page, KpiRuleDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, KpiRuleDTO.class); - } - - private QueryWrapper getWrapper(Map params) { - String id = (String) params.get(FieldConstant.ID_HUMP); - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - - return wrapper; - } - - @Override - public KpiRuleDTO get(String id) { - KpiRuleEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, KpiRuleDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(KpiRuleDTO dto) { - KpiRuleEntity entity = ConvertUtils.sourceToTarget(dto, KpiRuleEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(KpiRuleDTO dto) { - KpiRuleEntity entity = ConvertUtils.sourceToTarget(dto, KpiRuleEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - QueryWrapper kpiRuleParamEntityQueryWrapper = new QueryWrapper<>(); - kpiRuleParamEntityQueryWrapper.in(ids.length>0,"RULE_ID",ids); - kpiRuleParamDao.delete(kpiRuleParamEntityQueryWrapper); - } - - /** - * @param params - * @return com.elink.esua.epdc.commons.tools.page.PageData - * @Author yinzuomei - * @Description 列表查询 - * @Date 2019/11/27 13:29 - **/ - @Override - public PageData query(Map params) { - IPage page = getPage(params); - List list = baseDao.selectListKpiRuleQueryResultDTO(params); - return new PageData<>(list, page.getTotal()); - } - - /** - * @param id 考核规则表主键 - * @return com.elink.esua.epdc.dto.result.KpiRuleQueryResultDTO - * @Author yinzuomei - * @Description 查询详情 - * @Date 2019/11/27 15:17 - **/ - @Override - public KpiRuleQueryResultDTO queryDetailInfo(String id) { - return baseDao.queryDetailInfo(id); - } - - /** - * @param dto - * @return void - * @Author yinzuomei - * @Description 新增 - * @Date 2019/11/27 16:27 - **/ - @Override - @Transactional(rollbackFor = Exception.class) - public Result add(KpiRuleSaveOrUpdateFormDTO dto) { - Result checkResult = this.checkKpiRuleSaveOrUpdateFormDTO(dto); - if (checkResult.getCode() != 0) { - return checkResult; - } - KpiRuleEntity entity = ConvertUtils.sourceToTarget(dto, KpiRuleEntity.class); - insert(entity); - //logger.info("规则表主键="+entity.getId()); - // 元公式需要设置参数 - if ("0".equals(dto.getRuleMode())) { - for (KpiRuleParamDTO kpiRuleParamDTO : dto.getRuleParamList()) { - kpiRuleParamDTO.setRuleId(entity.getId()); - KpiRuleParamEntity kpiRuleParamEntity = ConvertUtils.sourceToTarget(kpiRuleParamDTO, KpiRuleParamEntity.class); - kpiRuleParamDao.insert(kpiRuleParamEntity); - } - } - return new Result(); - } - - /** - * @param dto - * @return void - * @Author yinzuomei - * @Description 修改 - * @Date 2019/11/27 16:27 - **/ - @Override - @Transactional(rollbackFor = Exception.class) - public Result edit(KpiRuleSaveOrUpdateFormDTO dto) { - Result checkResult = this.checkKpiRuleSaveOrUpdateFormDTO(dto); - if (checkResult.getCode() != 0) { - return checkResult; - } - KpiRuleEntity entity = ConvertUtils.sourceToTarget(dto, KpiRuleEntity.class); - updateById(entity); - //logger.info("规则表主键="+entity.getId()); - //全部删除参数记录表 - int deleteResultNum = kpiRuleParamDao.deleteByRuleId(entity.getId()); - if ("0".equals(dto.getRuleMode())) { - for (KpiRuleParamDTO kpiRuleParamDTO : dto.getRuleParamList()) { - kpiRuleParamDTO.setId(null); - kpiRuleParamDTO.setRuleId(entity.getId()); - kpiRuleParamService.save(kpiRuleParamDTO); - } - } - return new Result(); - } - - public Result checkKpiRuleSaveOrUpdateFormDTO(KpiRuleSaveOrUpdateFormDTO dto) { - if (StringUtils.isNotBlank(dto.getRuleName())) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(dto.getRuleName()), "rule_name", dto.getRuleName()); - wrapper.ne(StringUtils.isNotBlank(dto.getId()), FieldConstant.ID, dto.getId()); - List list = baseDao.selectList(wrapper); - if (CollUtil.isNotEmpty(list)) { - return new Result().error("规则名称已存在"); - } - }else{ - return new Result().error("规则名称不能为空"); - } - if (("0").equals(dto.getRuleMode())) { - //是否缺少参数 - KpiFormulaEntity kpiFormulaEntity = kpiFormulaDao.selectById(dto.getReferenceId()); - if ((null == dto.getRuleParamList() || dto.getRuleParamList().size() == 0) - && kpiFormulaEntity.getParamAmount() > 0) { - return new Result().error("请选择元公式入参"); - } - if (kpiFormulaEntity.getParamAmount() != dto.getRuleParamList().size()) { - return new Result().error("公式缺少入参"); - } - //校验sort唯一性 - int sort = 0; - for (KpiRuleParamDTO kpiRuleParamDTO : dto.getRuleParamList()) { - if (kpiRuleParamDTO.getSort() == sort) { - return new Result().error("参数排序不唯一,请重新编辑"); - } - sort = kpiRuleParamDTO.getSort(); - } - } - return new Result(); - } - - /** - * @param referenceIds - * @return java.util.List - * @Author yinzuomei - * @Description 根据引用id查询考核规则表记录 - * @Date 2019/12/2 15:00 - **/ - @Override - public List listKpiRuleEntityByRereferenceId(String[] referenceIds) { - QueryWrapper kpiRuleEntityQueryWrapper = new QueryWrapper<>(); - kpiRuleEntityQueryWrapper.in("reference_id", referenceIds); - List kpiRuleEntityList = baseDao.selectList(kpiRuleEntityQueryWrapper); - return kpiRuleEntityList; - } - - @Override - public Result> listKpiRuleDTO() { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("rule_mode",1); - wrapper.orderByDesc("CREATED_TIME"); - List kpiRuleEntityList=baseDao.selectList(wrapper); - List list= ConvertUtils.sourceToTarget(kpiRuleEntityList, KpiRuleDTO.class); - return new Result().ok(list); - } + private Logger logger = LoggerFactory.getLogger(getClass()); + /** + * 公式参数表 + */ + @Autowired + private KpiRuleParamDao kpiRuleParamDao; + /** + * 绩效考核公式表 + */ + @Autowired + private KpiFormulaDao kpiFormulaDao; + /** + * 考核规则表 + */ + @Autowired + private KpiRuleDao kpiRuleDao; + /** + * 绩效考核元数据表 + */ + @Autowired + private KpiMetaDataDao kpiMetaDataDao; + /** + * 网格考核最终得分表 + */ + @Autowired + private KpiResultGridDao kpiResultGridDao; + @Autowired + private DeptUtils deptUtils; + /** + * 网格考核最终得分 + */ + @Autowired + private KpiResultSuperiorDao kpiResultSuperiorDao; + + @Override + public PageData page(Map params) { + String ruleName = params.containsKey("ruleName") ? params.get("ruleName").toString() : null; + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.isNotBlank(ruleName), KpiFieldConstant.RULE_NAME, ruleName); + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + wrapper + ); + return getPageData(page, KpiRuleDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, KpiRuleDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public KpiRuleDTO get(String id) { + KpiRuleEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, KpiRuleDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(KpiRuleDTO dto) { + KpiRuleEntity entity = ConvertUtils.sourceToTarget(dto, KpiRuleEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(KpiRuleDTO dto) { + KpiRuleEntity entity = ConvertUtils.sourceToTarget(dto, KpiRuleEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + QueryWrapper kpiRuleParamEntityQueryWrapper = new QueryWrapper<>(); + kpiRuleParamEntityQueryWrapper.in(ids.length > NumConstant.ZERO, KpiFieldConstant.RULE_ID, ids); + kpiRuleParamDao.delete(kpiRuleParamEntityQueryWrapper); + } + + /** + * @param params + * @return com.elink.esua.epdc.commons.tools.page.PageData + * @Author yinzuomei + * @Description 列表查询 + * @Date 2019/11/27 13:29 + **/ + @Override + public PageData query(Map params) { + IPage page = getPage(params); + List list = baseDao.selectListKpiRuleQueryResultDTO(params); + return new PageData<>(list, page.getTotal()); + } + + /** + * @param id 考核规则表主键 + * @return com.elink.esua.epdc.dto.result.KpiRuleQueryResultDTO + * @Author yinzuomei + * @Description 查询详情 + * @Date 2019/11/27 15:17 + **/ + @Override + public KpiRuleQueryResultDTO queryDetailInfo(String id) { + KpiRuleQueryResultDTO kpiRuleQueryResultDTO = baseDao.queryDetailInfo(id); + String[] deptTypeKeys = kpiRuleQueryResultDTO.getDeptTypeKey().split(","); + kpiRuleQueryResultDTO.setDeptTypeKeys(deptTypeKeys); + return kpiRuleQueryResultDTO; + } + + /** + * @param dto + * @return void + * @Author yinzuomei + * @Description 新增 + * @Date 2019/11/27 16:27 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public Result add(KpiRuleSaveOrUpdateFormDTO dto) { + + this.checkKpiRuleSaveOrUpdateFormDTO(dto); + //考核部门类别 数组转字符串 + String deptTypeKey = StringUtils.join(dto.getDeptTypeKeys(), ","); + // 为null :手动打分上传的 单个deptTypeKey + if (deptTypeKey != null) { + // 新增公式规则 多个deptTypeKey + dto.setDeptTypeKey(deptTypeKey); + } + KpiRuleEntity entity = ConvertUtils.sourceToTarget(dto, KpiRuleEntity.class); + insert(entity); + // 元公式需要设置参数 + if (KpiRuleModeEnum.FORMULA.value().equals(dto.getRuleMode())) { + for (KpiRuleParamDTO kpiRuleParamDTO : dto.getRuleParamList()) { + kpiRuleParamDTO.setRuleId(entity.getId()); + KpiRuleParamEntity kpiRuleParamEntity = ConvertUtils.sourceToTarget(kpiRuleParamDTO, KpiRuleParamEntity.class); + kpiRuleParamDao.insert(kpiRuleParamEntity); + } + } + return new Result(); + } + + /** + * @param dto + * @return void + * @Author yinzuomei + * @Description 修改 + * @Date 2019/11/27 16:27 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public Result edit(KpiRuleSaveOrUpdateFormDTO dto) { + + this.checkKpiRuleSaveOrUpdateFormDTO(dto); + //考核部门类别 数组转字符串 + String deptTypeKey = StringUtils.join(dto.getDeptTypeKeys(), ","); + dto.setDeptTypeKey(deptTypeKey); + KpiRuleEntity entity = ConvertUtils.sourceToTarget(dto, KpiRuleEntity.class); + updateById(entity); + // 全部删除参数记录表 + kpiRuleParamDao.deleteByRuleId(entity.getId()); + if (KpiRuleModeEnum.FORMULA.value().equals(dto.getRuleMode())) { + for (KpiRuleParamDTO ruleParam : dto.getRuleParamList()) { + ruleParam.setId(null); + ruleParam.setRuleId(entity.getId()); + kpiRuleParamDao.insert(ConvertUtils.sourceToTarget(ruleParam, KpiRuleParamEntity.class)); + } + } + return new Result(); + } + + /** + * 校验考核规则保存时提交的数据 + * + * @param dto + * @return void + * @author yinzuomei + * @date 2019/12/18 19:45 + */ + private void checkKpiRuleSaveOrUpdateFormDTO(KpiRuleSaveOrUpdateFormDTO dto) { + if (StringUtils.isBlank(dto.getRuleName())) { + throw new RenException("规则名称不能为空"); + } + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(KpiFieldConstant.RULE_NAME, dto.getRuleName()); + wrapper.ne(StringUtils.isNotBlank(dto.getId()), FieldConstant.ID, dto.getId()); + if (baseDao.selectCount(wrapper) > NumConstant.ZERO) { + throw new RenException("规则名称已存在"); + } + if (KpiRuleModeEnum.FORMULA.value().equals(dto.getRuleMode())) { + // 是否缺少参数 + KpiFormulaEntity kpiFormulaEntity = kpiFormulaDao.selectById(dto.getReferenceId()); + if (CollUtil.isEmpty(dto.getRuleParamList()) && kpiFormulaEntity.getParamAmount() > 0) { + throw new RenException("请选择元公式入参"); + } + if (kpiFormulaEntity.getParamAmount() != dto.getRuleParamList().size()) { + throw new RenException("公式缺少入参"); + } + // 校验sort唯一性 + int sort = NumConstant.ZERO; + for (KpiRuleParamDTO kpiRuleParamDTO : dto.getRuleParamList()) { + if (kpiRuleParamDTO.getSort() == sort) { + throw new RenException("参数排序不唯一,请重新编辑"); + } + sort = kpiRuleParamDTO.getSort(); + } + } + } + + /** + * @param referenceIds + * @return java.util.List + * @Author yinzuomei + * @Description 根据引用id查询考核规则表记录 + * @Date 2019/12/2 15:00 + **/ + @Override + public List listKpiRuleEntityByRereferenceId(String[] referenceIds) { + QueryWrapper kpiRuleEntityQueryWrapper = new QueryWrapper<>(); + kpiRuleEntityQueryWrapper.in(KpiFieldConstant.REFERENCE_ID, referenceIds); + List kpiRuleEntityList = baseDao.selectList(kpiRuleEntityQueryWrapper); + return kpiRuleEntityList; + } + + @Override + public Result> listKpiRuleDTO() { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(KpiFieldConstant.RULE_MODE, KpiRuleModeEnum.MANMUAL_SCORE.value()); + wrapper.orderByDesc(FieldConstant.CREATED_TIME); + List kpiRuleEntityList = baseDao.selectList(wrapper); + List list = ConvertUtils.sourceToTarget(kpiRuleEntityList, KpiRuleDTO.class); + return new Result().ok(list); + } + + @Override + public void calcByRuleCode(String ruleCode) { + // 查询考核规则表 + KpiRuleDTO kpiRule = kpiRuleDao.queryKpiRuleMetaFormula(ruleCode); + String ruleMode = kpiRule.getRuleMode(); + if (StringUtils.isBlank(ruleMode) || !ruleMode.equals(KpiRuleModeEnum.FORMULA.value())) { + logger.error("规则编码{}对应的ruleMode不合法,方法中止。", ruleCode); + return; + } + String kpiCycle = kpiRule.getKpiCycle(); + Date startDate = KpiLocalDateUtils.getKpiCycoleStartDate(kpiCycle); + if (null == startDate) { + logger.error("当前时间:{},无法按照规则编码{}计算绩效考核得分", LocalDateTime.now().toString(), ruleCode); + return; + } + // 考核结束日 + Date endDate = LocalDateUtils.localDateToDate(YearMonth.now().minusMonths(NumConstant.ONE).atEndOfMonth()); + // 根据 考核规则表-外键(公式id),查询绩效考核公式表,待运行公式方法 + KpiFormulaDTO kpiFormula = kpiFormulaDao.queryFormula(kpiRule.getReferenceId()); + // 初始化JavaScriptEngine引擎 + Invocable invocable = this.initInvocable(kpiFormula.getFormula(), ruleCode); + // 公式所有参数对应的元数据编码、升序排列 + List metaDateCodeList = this.getRuleParmOfMetaDateCodeList(kpiRule.getId()); + // 公式参数数量 + Integer paramAmount = kpiFormula.getParamAmount(); + // 公式方法名 + String functionName = kpiFormula.getFunctionName(); + // 部门类别 + String[] deptTypeKeyArray = kpiRule.getDeptTypeKey().split(StrConstant.COMMA); + if (null == deptTypeKeyArray || deptTypeKeyArray.length == NumConstant.ZERO) { + return; + } + for (String deptTypeKey : deptTypeKeyArray) { + int pageIndex = NumConstant.ONE; + List deptIdList = deptUtils.getDeptIdList(deptTypeKey, NumConstant.TWENTY, pageIndex); + do { + for (Long deptId : deptIdList) { + BigDecimal[] paramValue = selectArrayOfMetaDataValue(deptId, startDate, endDate, metaDateCodeList); + // 参数准备完全时,执行js运算 + if (paramValue.length == paramAmount) { + // 执行js中的函数 参数:js方法名 + 参数 + Double score = this.calcByJavaScript(invocable, functionName, ruleCode, paramValue); + this.packageFormulaResultToSaveOrUpdate(deptId, ruleCode, score, startDate, endDate, kpiCycle); + } + } + pageIndex++; + deptIdList = deptUtils.getDeptIdList(deptTypeKey, NumConstant.TWENTY, pageIndex); + } while (CollUtil.isNotEmpty(deptIdList)); + } + } + + /** + * 执行保存得分操作 + * + * @param deptId 部门id + * @param ruleCode 考核规则编码 + * @param score 得分 + * @param startDate 开始日 + * @param endDate 结束日 + * @param kpiCycle 考核周期 + * @return void + * @author work@yujt.net.cn + * @date 2019/12/25 10:56 + */ + private void packageFormulaResultToSaveOrUpdate(Long deptId, String ruleCode, Double score, Date startDate, Date endDate, String kpiCycle) { + switch (ruleCode) { + /** + * 基础网格平时工作成效 + */ + case KpiScheduleCodeConstant.GRID_WORK_SCORE_MONTH: + case KpiScheduleCodeConstant.GRID_WORK_SCORE_QUARTER: + case KpiScheduleCodeConstant.GRID_WORK_SCORE_YEAR: + this.saveOrUpdateGridKpiResult(deptId, score, startDate, endDate, kpiCycle); + break; + /** + * 基础网格考核最终得分 + */ + case KpiScheduleCodeConstant.GRID_FINAL_SCORE_MONTH: + case KpiScheduleCodeConstant.GRID_FINAL_SCORE_QUARTER: + case KpiScheduleCodeConstant.GRID_FINAL_SCORE_YEAR: + this.updateGridKpiFinalScore(deptId, score, startDate, endDate, kpiCycle); + break; + /** + * 区直/街道考核最终得分 + */ + case KpiScheduleCodeConstant.SUPERIOR_FINAL_SCORE_MONTH: + case KpiScheduleCodeConstant.SUPERIOR_FINAL_SCORE_QUARTER: + case KpiScheduleCodeConstant.SUPERIOR_FINAL_SCORE_YEAR: + this.saveSuperiorKpiResult(deptId, score, startDate, endDate, kpiCycle); + break; + default: + return; + } + } + + /** + * 使用JavaScriptEngine执行运算方法 + * + * @param invocable JavaScriptEngine引擎 + * @param functionName JavaScript方法名 + * @param ruleCode 考核规则编码 + * @param paramValue JavaScript方法所需所有参数 + * @return java.lang.Double + * @author work@yujt.net.cn + * @date 2019/12/25 10:28 + */ + private Double calcByJavaScript(Invocable invocable, String functionName, String ruleCode, BigDecimal[] paramValue) { + try { + return (Double) invocable.invokeFunction(functionName, paramValue); + } catch (Exception e) { + logger.error("javascipt执行失败,当前时间:{},考核规则编码:{}", LocalDateTime.now().toString(), ruleCode); + throw new RenException("绩效考核定时任务执行失败2"); + } + } + + /** + * 更新网格考核结果表平时工作成效字段,更新失败则执行插入 + * + * @param deptId 网格id + * @param score 得分 + * @param startDate 开始日 + * @param endDate 结束日 + * @param kpiCycle 考核周期 + * @return void + * @author work@yujt.net.cn + * @date 2019/12/25 10:35 + */ + private void saveOrUpdateGridKpiResult(Long deptId, Double score, Date startDate, Date endDate, String kpiCycle) { + KpiResultGridEntity gridKpiResultEntity = new KpiResultGridEntity(); + BigDecimal kpiScore = BigDecimal.valueOf(score).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP); + gridKpiResultEntity.setWorkScore(kpiScore); + int update = kpiResultGridDao.update(gridKpiResultEntity, this.updateGridKpiResultWrapper(deptId, startDate, endDate, kpiCycle)); + if (update == NumConstant.ZERO) { + gridKpiResultEntity.setGridId(deptId); + gridKpiResultEntity.setStartDate(startDate); + gridKpiResultEntity.setEndDate(endDate); + gridKpiResultEntity.setKpiCycle(kpiCycle); + kpiResultGridDao.insert(gridKpiResultEntity); + } + } + + /** + * 更新网格考核最终的得分字段 + * + * @param deptId 网格id + * @param score 得分 + * @param startDate 开始日 + * @param endDate 结束日 + * @param kpiCycle 考核周期 + * @return void + * @author work@yujt.net.cn + * @date 2019/12/25 10:50 + */ + private void updateGridKpiFinalScore(Long deptId, Double score, Date startDate, Date endDate, String kpiCycle) { + KpiResultGridEntity gridKpiResultEntity = new KpiResultGridEntity(); + BigDecimal kpiScore = BigDecimal.valueOf(score).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP); + gridKpiResultEntity.setFinalScore(kpiScore); + kpiResultGridDao.update(gridKpiResultEntity, this.updateGridKpiResultWrapper(deptId, startDate, endDate, kpiCycle)); + } + + /** + * 组装更新网格考核结果表的wrapper + * + * @param deptId 网格id + * @param startDate 开始日 + * @param endDate 结束日 + * @param kpiCycle 考核周期 + * @return com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper + * @author work@yujt.net.cn + * @date 2019/12/25 10:49 + */ + private UpdateWrapper updateGridKpiResultWrapper(Long deptId, Date startDate, Date endDate, String kpiCycle) { + UpdateWrapper wrapper = new UpdateWrapper<>(); + wrapper.eq(FieldConstant.GRID_ID, deptId) + .eq(KpiFieldConstant.START_DATE, startDate) + .eq(KpiFieldConstant.END_DATE, endDate) + .eq(KpiFieldConstant.KPI_CYCLE, kpiCycle); + return wrapper; + } + + /** + * 插入 街道/区直考核结果表 + * + * @param deptId 部门id + * @param score 得分 + * @param startDate 开始日 + * @param endDate 结束日 + * @param kpiCycle 考核周期 + * @return void + * @author work@yujt.net.cn + * @date 2019/12/25 10:54 + */ + private void saveSuperiorKpiResult(Long deptId, Double score, Date startDate, Date endDate, String kpiCycle) { + //先删除 在插入 + kpiResultSuperiorDao.deleteByDeptIdAndKpiDate(deptId, startDate, endDate); + + DeptLevelAndLeaderDTO deptLevelInfo = deptUtils.getDeptLevelInfo(deptId, YesOrNoEnum.YES); + KpiResultSuperiorEntity kpiResultSuperiorEntity = new KpiResultSuperiorEntity(); + kpiResultSuperiorEntity.setStartDate(startDate); + kpiResultSuperiorEntity.setEndDate(endDate); + kpiResultSuperiorEntity.setKpiCycle(kpiCycle); + kpiResultSuperiorEntity.setFinalScore(BigDecimal.valueOf(score).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP)); + kpiResultSuperiorEntity.setDeptId(deptId); + kpiResultSuperiorEntity.setDeptTypeKey(deptLevelInfo.getTypeKey()); + kpiResultSuperiorEntity.setParentDeptIds(deptLevelInfo.getParentDeptIds()); + kpiResultSuperiorEntity.setParentDeptNames(deptLevelInfo.getParentDeptNames()); + kpiResultSuperiorEntity.setAllDeptIds(deptLevelInfo.getAllDeptIds()); + kpiResultSuperiorEntity.setAllDeptNames(deptLevelInfo.getAllDeptNames()); + kpiResultSuperiorDao.insert(kpiResultSuperiorEntity); + } + + /** + * 获取公式所有参数对应的元数据编码、升序排列 + * + * @param ruleId 规则id + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/12/25 09:53 + */ + private List getRuleParmOfMetaDateCodeList(String ruleId) { + // 根据 考核规则表-主键,查询公式参数表,排序:1,2,3,4,5 + List ruleParamList = kpiRuleParamDao.queryFormulaParam(ruleId); + List metaDateCodeList = Lists.newArrayList(); + for (int i = 0; i < ruleParamList.size(); i++) { + metaDateCodeList.add(ruleParamList.get(i).getMetaDataCode()); + } + return metaDateCodeList; + } + + /** + * 初始化javascipt的执行引擎 + * + * @param formula 公式运行方法(Javascript) + * @param ruleCode 规则编码 + * @return javax.script.Invocable + * @author work@yujt.net.cn + * @date 2019/12/24 17:22 + */ + private Invocable initInvocable(String formula, String ruleCode) { + ScriptEngine engine = new ScriptEngineManager().getEngineByName(StrConstant.JAVASCRIPT); + //执行js代码:参数为:公式运行方法 + try { + engine.eval(formula); + } catch (Exception e) { + logger.error("初始化javascipt执行引擎失败,当前时间:{},考核规则编码:{}", LocalDateTime.now().toString(), ruleCode); + throw new RenException("绩效考核定时任务执行失败1"); + } + // 是否可调用方法 + boolean flag = engine instanceof Invocable; + if (!flag) { + logger.error("初始化javascipt执行引擎失败,当前时间:{},考核规则编码:{}", LocalDateTime.now().toString(), ruleCode); + throw new RenException("绩效考核定时任务执行失败1"); + } + return (Invocable) engine; + } + + /** + * 根据公式参数,获取公式参数对应的元数据值 + * + * @param deptId 部门id + * @param startDate 考核周期开始日 + * @param endDate 考核周期结束日 + * @param metaDateCodeList 所有公式参数对应的元数据编码 + * @return java.math.BigDecimal[] + * @author work@yujt.net.cn + * @date 2019/12/25 11:02 + */ + private BigDecimal[] selectArrayOfMetaDataValue(Long deptId, Date startDate, Date endDate, List metaDateCodeList) { + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(KpiFieldConstant.START_DATE, startDate) + .eq(KpiFieldConstant.END_DATE, endDate) + .eq(KpiFieldConstant.DEPT_ID, deptId) + .in(KpiFieldConstant.DATA_CODE, metaDateCodeList); + + List metaDataList = kpiMetaDataDao.selectList(wrapper); + BigDecimal[] metaDataValueArray = new BigDecimal[metaDataList.size()]; + + String metaDataCode; + for (int i = 0; i < metaDateCodeList.size(); i++) { + metaDataCode = metaDateCodeList.get(i); + for (KpiMetaDataEntity kpiMetaDataEntity : metaDataList) { + if (kpiMetaDataEntity.getDataCode().equals(metaDataCode)) { + metaDataValueArray[i] = kpiMetaDataEntity.getDataValue(); + } + } + } + return metaDataValueArray; + } } diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiTimeLimitIssueServiceImpl.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiTimeLimitIssueServiceImpl.java index d1db57ed1..147f68f6d 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiTimeLimitIssueServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiTimeLimitIssueServiceImpl.java @@ -26,10 +26,8 @@ import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.dao.KpiTimeLimitIssueDao; import com.elink.esua.epdc.dto.KpiTimeLimitIssueDTO; import com.elink.esua.epdc.entity.KpiTimeLimitIssueEntity; -import com.elink.esua.epdc.redis.KpiTimeLimitIssueRedis; import com.elink.esua.epdc.service.KpiTimeLimitIssueService; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -46,9 +44,6 @@ import java.util.Map; @Service public class KpiTimeLimitIssueServiceImpl extends BaseServiceImpl implements KpiTimeLimitIssueService { - @Autowired - private KpiTimeLimitIssueRedis kpiTimeLimitIssueRedis; - @Override public PageData page(Map params) { IPage page = baseDao.selectPage( diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiTimeLimitItemServiceImpl.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiTimeLimitItemServiceImpl.java index 28b44ee8e..0cd45aba4 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiTimeLimitItemServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiTimeLimitItemServiceImpl.java @@ -21,18 +21,21 @@ 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.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.constant.StrConstant; 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.Result; import com.elink.esua.epdc.dao.KpiTimeLimitItemDao; import com.elink.esua.epdc.dto.KpiTimeLimitItemDTO; -import com.elink.esua.epdc.dto.category.form.CategoryInfoFormDTO; -import com.elink.esua.epdc.dto.category.result.CategoryInfoResultDTO; +import com.elink.esua.epdc.dto.form.CategoryInfoFormDTO; +import com.elink.esua.epdc.dto.result.CategoryInfoResultDTO; import com.elink.esua.epdc.entity.KpiTimeLimitItemEntity; import com.elink.esua.epdc.feign.EventFeignClient; import com.elink.esua.epdc.redis.KpiTimeLimitItemRedis; import com.elink.esua.epdc.service.KpiTimeLimitItemService; +import com.google.common.collect.Lists; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -40,7 +43,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.io.File; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -55,12 +57,13 @@ import java.util.Map; public class KpiTimeLimitItemServiceImpl extends BaseServiceImpl implements KpiTimeLimitItemService { private Logger logger = LoggerFactory.getLogger(getClass()); - @Autowired - private KpiTimeLimitItemRedis kpiTimeLimitItemRedis; @Autowired private EventFeignClient eventFeignClient; + @Autowired + private KpiTimeLimitItemRedis kpiTimeLimitItemRedis; + @Override public PageData page(Map params) { String categoryId = params.containsKey("categoryId") ? params.get("categoryId").toString() : null; @@ -80,8 +83,8 @@ public class KpiTimeLimitItemServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -98,44 +101,55 @@ public class KpiTimeLimitItemServiceImpl extends BaseServiceImpl> res = eventFeignClient.queryCategoryInfo(categoryInfoFormDTO); - if (res.getCode() != 0 || CollUtil.isEmpty(res.getData()) || res.getData().size() == 0) { - return new Result().error("查询分类详情失败" + res.getMsg()); + List selectedCategoryIds = dto.getCategoryIds(); + // 用户选择的所有部门id(去重之后) + List distinctCategoryIds = Lists.newArrayList(); + + for (Long[] oneOptionCategoryIdArray : selectedCategoryIds) { + for (Long categoryId : oneOptionCategoryIdArray) { + if (!distinctCategoryIds.contains(categoryId)) { + distinctCategoryIds.add(categoryId); + } } - String allCategoryNames = ""; - String parentCategoryIds = ""; - String parentCategoryNames = ""; - CategoryInfoResultDTO categoryInfoResultDTO = res.getData().get(0); - for (String parentName : categoryInfoResultDTO.getParentNames()) { - parentCategoryNames += (parentName + "-"); + } + CategoryInfoFormDTO categoryInfoFormDto = new CategoryInfoFormDTO(); + categoryInfoFormDto.setIds(distinctCategoryIds.toArray(new Long[distinctCategoryIds.size()])); + Result> eventResult = eventFeignClient.queryCategoryInfo(categoryInfoFormDto); + if (!eventResult.success() || CollUtil.isEmpty(eventResult.getData())) { + return new Result().error(); + } + + List categoryInfoList = eventResult.getData(); + + KpiTimeLimitItemEntity timeLimit; + List entityList = Lists.newArrayList(); + + for (CategoryInfoResultDTO categoryInfo : categoryInfoList) { + timeLimit = new KpiTimeLimitItemEntity(); + + timeLimit.setValidCloseTime(dto.getValidCloseTime()); + timeLimit.setValidRespondTime(dto.getValidRespondTime()); + + timeLimit.setCategoryId(categoryInfo.getId()); + // 父id为根节点0,表示一级类别,不拼接根节点 + if (categoryInfo.getPids().equals(NumConstant.ZERO_STR)) { + timeLimit.setAllCategoryIds(String.valueOf(categoryInfo.getId())); + timeLimit.setAllCategoryNames(categoryInfo.getCategoryName()); + } else { + timeLimit.setAllCategoryIds(categoryInfo.getPids().concat(StrConstant.COMMA).concat(String.valueOf(categoryInfo.getId()))); + timeLimit.setAllCategoryNames(categoryInfo.getParentNames().concat(StrConstant.HYPHEN.concat(categoryInfo.getCategoryName()))); } - //去除最后一个- - parentCategoryNames = parentCategoryNames.substring(0, parentCategoryNames.length() - 1); - allCategoryNames = parentCategoryNames + "-" + categoryInfoResultDTO.getCategoryName(); - int index = categoryIds.lastIndexOf(","); -// logger.info("最后一个逗号所在的位置"+index); - parentCategoryIds = categoryIds.substring(0, index); - dto.setCategoryId(categoryId); - dto.setAllCategoryIds(categoryIds); - dto.setAllCategoryNames(allCategoryNames); - dto.setParentCategoryIds(parentCategoryIds); - dto.setParentCategoryNames(parentCategoryNames); - KpiTimeLimitItemEntity entity = ConvertUtils.sourceToTarget(dto, KpiTimeLimitItemEntity.class); - // 删除已存在的记录 - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(categoryId), "CATEGORY_ID", categoryId); - baseDao.delete(wrapper); - //插入 - insert(entity); + + timeLimit.setParentCategoryIds(categoryInfo.getPids()); + timeLimit.setParentCategoryNames(categoryInfo.getParentNames()); + entityList.add(timeLimit); + + kpiTimeLimitItemRedis.setTimelimitItem(timeLimit); } + + baseDao.deleteBatchByCategoryIds(distinctCategoryIds); + this.insertBatch(entityList, NumConstant.THIRTY); + return new Result(); } diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/utils/DeptUtils.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/utils/DeptUtils.java new file mode 100644 index 000000000..e3824f39a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/utils/DeptUtils.java @@ -0,0 +1,73 @@ +package com.elink.esua.epdc.utils; + +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; +import com.elink.esua.epdc.commons.tools.exception.RenException; +import com.elink.esua.epdc.commons.tools.redis.RedisKeys; +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.DeptLevelAndLeaderDTO; +import com.elink.esua.epdc.feign.AdminFeignClient; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 获取部门信息 + * + * @author work@yujt.net.cn + * @date 2019/12/18 14:52 + */ +@Component +public class DeptUtils { + + @Autowired + private AdminFeignClient adminFeignClient; + + @Autowired + private RedisUtils redisUtils; + + /** + * 获取部门信息 + * + * @param deptId 部门id + * @param yesOrNo 是否需要获取网格长姓名 + * @return com.elink.esua.epdc.dto.DeptLevelAndLeaderDTO + * @author work@yujt.net.cn + * @date 2019/12/18 15:02 + */ + public DeptLevelAndLeaderDTO getDeptLevelInfo(Long deptId, YesOrNoEnum yesOrNo) { + DeptLevelAndLeaderDTO dto = (DeptLevelAndLeaderDTO) redisUtils.get(RedisKeys.getDeptOptionKey(deptId)); + if (null != dto) { + // 已取到网格长姓名或者不需要网格长姓名 直接返回 + if ((StringUtils.isNotBlank(dto.getLeaderName()) || YesOrNoEnum.NO.value().equals(yesOrNo.value()))) { + return dto; + } + } + Result result = adminFeignClient.getDeptInfoById(deptId, yesOrNo.value()); + if (!result.success() || result.getData() == null) { + throw new RenException("获取机构信息失败"); + } + return result.getData(); + } + + + /** + * 按部门类型,分页查询部门列表 + * + * @param typeKey 部门类型 + * @param pageSize 页容量 + * @param pageIndex 页码 + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/12/18 20:01 + */ + public List getDeptIdList(String typeKey, Integer pageSize, Integer pageIndex) { + Result> adminResult = adminFeignClient.pageDeptIdByTypeKey(typeKey, pageSize, pageIndex); + if (!adminResult.success()) { + throw new RenException("获取机构信息失败"); + } + return adminResult.getData(); + } +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/utils/KpiLocalDateUtils.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/utils/KpiLocalDateUtils.java new file mode 100644 index 000000000..97caa4cf2 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/utils/KpiLocalDateUtils.java @@ -0,0 +1,47 @@ +package com.elink.esua.epdc.utils; + +import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.utils.LocalDateUtils; +import com.elink.esua.epdc.enums.KpiCycleEnum; + +import java.time.LocalDate; +import java.time.YearMonth; +import java.util.Date; + +/** + * 绩效考核相关日期工具 + * + * @author work@yujt.net.cn + * @date 2019/12/24 17:26 + */ +public class KpiLocalDateUtils { + + /** + * 获取考核周期开始日 + * + * @param kpiCycle 考核周期 月、季、年 + * @return java.util.Date + * @author work@yujt.net.cn + * @date 2019/12/24 17:28 + */ + public static Date getKpiCycoleStartDate(String kpiCycle) { + LocalDate startDate = null; + YearMonth now = YearMonth.now(); + if (KpiCycleEnum.KPI_CYCLE_MONTH.getValue().equals(kpiCycle)) { + startDate = now.minusMonths(NumConstant.ONE).atDay(NumConstant.ONE); + } else if (KpiCycleEnum.KPI_CYCLE_QUARTER.getValue().equals(kpiCycle)) { + int monthValue = now.getMonthValue(); + if (monthValue == NumConstant.ONE || monthValue == NumConstant.FOUR || monthValue == NumConstant.SEVEN || monthValue == NumConstant.TEN) { + startDate = now.minusMonths(NumConstant.THREE).atDay(NumConstant.ONE); + } + } else if (KpiCycleEnum.KPI_CYCLE_YEAR.getValue().equals(kpiCycle)) { + if (now.getMonthValue() == NumConstant.ONE) { + startDate = now.minusMonths(NumConstant.TWELVE).atDay(NumConstant.ONE); + } + } + if (null == startDate) { + return null; + } + return LocalDateUtils.localDateToDate(startDate); + } +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/application.yml index f754286a1..14d28db9b 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/application.yml +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/application.yml @@ -3,86 +3,17 @@ server: servlet: context-path: /kpi +nacos: + config: + server-addr: @nacos.server-addr@ + type: YAML + namespace: @nacos.config.namespace@ + group: @nacos.config.group@ + dataId: epdc-kpi-server + bootstrap: + enable: true + log: + enable: @nacos.config.bootstrap.log.enable@ spring: - main: - allow-bean-definition-overriding: true application: name: epdc-kpi-server - # 环境 dev|test|prod - profiles: - active: dev - messages: - encoding: UTF-8 - basename: i18n/messages,i18n/messages_common - jackson: - time-zone: GMT+8 - date-format: yyyy-MM-dd HH:mm:ss - redis: - database: @spring.redis.index@ - host: @spring.redis.host@ - timeout: 30s - port: @spring.redis.port@ - password: @spring.redis.password@ - datasource: - druid: - driver-class-name: com.mysql.cj.jdbc.Driver - url: @spring.datasource.druid.url@ - username: @spring.datasource.druid.username@ - password: @spring.datasource.druid.password@ - cloud: - nacos: - discovery: - server-addr: @nacos.server-addr@ - register-enabled: @nacos.register-enabled@ - alibaba: - seata: - tx-service-group: epdc-kpi-server-fescar-service-group - -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: ALWAYS - -feign: - hystrix: - enabled: true - httpclient: - enabled: true - -hystrix: - command: - default: - execution: - isolation: - thread: - timeoutInMilliseconds: 60000 #缺省为1000 - -ribbon: - ReadTimeout: 300000 - ConnectTimeout: 300000 - -mybatis-plus: - mapper-locations: classpath:/mapper/**/*.xml - #实体扫描,多个package用逗号或者分号分隔 - typeAliasesPackage: com.elink.esua.epdc.entity - global-config: - #数据库相关配置 - db-config: - #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; - id-type: ID_WORKER - #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" - field-strategy: NOT_NULL - #驼峰下划线转换 - column-underline: true - banner: false - #原生配置 - configuration: - map-underscore-to-camel-case: true - cache-enabled: false - call-setters-on-nulls: true - jdbc-type-for-null: 'null' - diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiFormulaDao.xml b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiFormulaDao.xml index 6cfe4092c..b0324df3e 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiFormulaDao.xml +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiFormulaDao.xml @@ -33,4 +33,20 @@ ORDER BY ekf.CREATED_TIME DESC + + + diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiManualScoreDao.xml b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiManualScoreDao.xml index b64f4b426..307176dcc 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiManualScoreDao.xml +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiManualScoreDao.xml @@ -3,47 +3,13 @@ - - - - - - - - - - - - - - - - - - + + delete from epdc_kpi_manual_score where + rule_id = #{ruleId} and dept_id = #{deptId} and score_start_date = #{scoreStartDate} and score_end_date = #{scoreEndDate} + - - - - - - - - - - - - - - - - - - - - - - SELECT kmc.id, kmc.rule_id, @@ -63,18 +29,20 @@ kr.kpi_cycle, kmc.score_start_date, kmc.score_end_date - FROM - epdc_kpi_manual_score kmc - left join epdc_kpi_rule kr - on(kmc.RULE_ID=kr.id) + FROM epdc_kpi_manual_score kmc + left join epdc_kpi_rule kr on(kmc.RULE_ID=kr.id) WHERE kmc.del_flag = '0' - - AND kmc.rule_id =#{ruleId} - - - AND DATE_FORMAT( kmc.score_start_date, '%Y-%m' ) BETWEEN #{scoreStartDate} AND #{scoreStartDate} - + + AND kmc.rule_id =#{ruleId} + + + AND DATE_FORMAT( kmc.score_start_date, '%Y-%m' ) BETWEEN #{scoreStartDate} AND #{scoreStartDate} + + + AND kmc.all_dept_ids like concat('%',#{allDeptIds},'%') + ORDER BY kmc.CREATED_TIME DESC + diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiManualScoreTempDao.xml b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiManualScoreTempDao.xml deleted file mode 100644 index 1cd17d684..000000000 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiManualScoreTempDao.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DELETE - FROM - epdc_kpi_manual_score_temp - WHERE - RULE_ID =#{ruleId} - AND user_id = #{userId} - AND score_start_time =#{scoreStartTime} - - - - diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiMetaDataDao.xml b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiMetaDataDao.xml new file mode 100644 index 000000000..9bd92b965 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiMetaDataDao.xml @@ -0,0 +1,37 @@ + + + + + + + DELETE + FROM + epdc_kpi_meta_data + WHERE + + (#{metaListItem.deptId}=epdc_kpi_meta_data.dept_id + AND #{metaListItem.startDate}=epdc_kpi_meta_data.start_date + AND #{metaListItem.endDate}=epdc_kpi_meta_data.end_date + AND #{metaListItem.dataCode}=epdc_kpi_meta_data.data_code + ) + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiResultGridDao.xml b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiResultGridDao.xml new file mode 100644 index 000000000..dec0e489d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiResultGridDao.xml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiResultSuperiorDao.xml b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiResultSuperiorDao.xml new file mode 100644 index 000000000..e15d17e8b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiResultSuperiorDao.xml @@ -0,0 +1,84 @@ + + + + + + + delete from epdc_kpi_result_superior where dept_id = #{deptId} and start_date = #{startDate} and end_date = #{endDate} + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiRuleDao.xml b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiRuleDao.xml index bc84be77b..e808b9720 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiRuleDao.xml +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiRuleDao.xml @@ -129,4 +129,21 @@ and ekr.id=#{id} + + diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiRuleParamDao.xml b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiRuleParamDao.xml index 2928504c6..358c5a535 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiRuleParamDao.xml +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiRuleParamDao.xml @@ -19,4 +19,18 @@ delete from epdc_kpi_rule_param where rule_id=#{id} + + + diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiTimeLimitItemDao.xml b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiTimeLimitItemDao.xml index 83044e824..a35805931 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiTimeLimitItemDao.xml +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiTimeLimitItemDao.xml @@ -3,22 +3,10 @@ - - - - - - - - - - - - - - - - + + delete from epdc_kpi_time_limit_item where category_id in + #{item} + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/resources/application.yml index 68027a37d..2a2c91a0b 100644 --- a/esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/resources/application.yml +++ b/esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/resources/application.yml @@ -1,4 +1,4 @@ -server: + server: port: @server.port@ servlet: context-path: /message diff --git a/esua-epdc/epdc-module/epdc-news/epdc-news-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcInformationFormDTO.java b/esua-epdc/epdc-module/epdc-news/epdc-news-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcInformationFormDTO.java index 17428cd70..95351d979 100644 --- a/esua-epdc/epdc-module/epdc-news/epdc-news-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcInformationFormDTO.java +++ b/esua-epdc/epdc-module/epdc-news/epdc-news-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcInformationFormDTO.java @@ -64,7 +64,7 @@ public class EpdcInformationFormDTO implements Serializable { * 消息所属业务类型:event事件审核;issueComment议题评论;issueReply议题评论回复;itemComment项目评论;itemReply项目评论回复; * issueApprove支持议题;itemApprove支持项目;issueCommentApprove议题评论支持;issueCommentOppose议题评论反对; * itemCommentApprove项目评论支持;itemCommentOppose项目评论反对;issue议题处理; - * item项目处理;groupInvited社群邀请等 + * item项目处理;groupInvited社群邀请等; volunteerCheck志愿者审核 */ @NotBlank(message = "消息所属业务类型不能为空") private String businessType; diff --git a/esua-epdc/epdc-module/epdc-news/epdc-news-server/pom.xml b/esua-epdc/epdc-module/epdc-news/epdc-news-server/pom.xml index e3877629b..7a194d780 100644 --- a/esua-epdc/epdc-module/epdc-news/epdc-news-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-news/epdc-news-server/pom.xml @@ -45,7 +45,10 @@ epdc-admin-client 1.0.0 - + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + @@ -107,7 +110,7 @@ true - + + + 9064 + 47.104.224.45:8848 + 513d6635-3cfe-401f-b8b6-a04417288f47 + EPDC_CONFIG_GROUP + true test - + + + 9064 + 47.104.224.45:8848 + 6a3577b4-7b79-43f6-aebb-9c3f31263f6a + EPDC_CONFIG_GROUP + true diff --git a/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/resources/application.yml index 5e6f0761b..9905ec16b 100644 --- a/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/resources/application.yml +++ b/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/resources/application.yml @@ -3,85 +3,18 @@ server: servlet: context-path: /news +nacos: + config: + server-addr: @nacos.server-addr@ + type: YAML + namespace: @nacos.config.namespace@ + group: @nacos.config.group@ + dataId: epdc-news-server + bootstrap: + enable: true + log: + enable: @nacos.config.bootstrap.log.enable@ + spring: - main: - allow-bean-definition-overriding: true application: name: epdc-news-server - # 环境 dev|test|prod - profiles: - active: @spring.profiles.active@ - messages: - encoding: UTF-8 - basename: i18n/messages,i18n/messages_common - jackson: - time-zone: GMT+8 - date-format: yyyy-MM-dd HH:mm:ss - redis: - database: @spring.redis.index@ - host: @spring.redis.host@ - timeout: 30s - port: @spring.redis.port@ - password: @spring.redis.password@ - cloud: - nacos: - discovery: - server-addr: @nacos.server-addr@ - register-enabled: @nacos.register-enabled@ - alibaba: - seata: - tx-service-group: epdc-news-server-fescar-service-group - datasource: - druid: - driver-class-name: com.mysql.jdbc.Driver - url: @spring.datasource.druid.url@ - username: @spring.datasource.druid.username@ - password: @spring.datasource.druid.password@ - -feign: - hystrix: - enabled: true - httpclient: - enabled: true - -hystrix: - command: - default: - execution: - isolation: - thread: - timeoutInMilliseconds: 60000 #缺省为1000 - -ribbon: - ReadTimeout: 300000 - ConnectTimeout: 300000 - -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: ALWAYS - -mybatis-plus: - mapper-locations: classpath:/mapper/**/*.xml - #实体扫描,多个package用逗号或者分号分隔 - typeAliasesPackage: io.renren.entity;com.elink.esua.epdc.entity - global-config: - #数据库相关配置 - db-config: - #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; - id-type: ID_WORKER - #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" - field-strategy: NOT_NULL - #驼峰下划线转换 - column-underline: true - banner: false - #原生配置 - configuration: - map-underscore-to-camel-case: true - cache-enabled: false - call-setters-on-nulls: true - jdbc-type-for-null: 'null' diff --git a/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/pom.xml b/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/pom.xml index dca5df69a..bbe59af59 100644 --- a/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/pom.xml @@ -94,6 +94,10 @@ gson 2.8.5 + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + @@ -154,7 +158,7 @@ true - + + + 9065 + 47.104.224.45:8848 + 513d6635-3cfe-401f-b8b6-a04417288f47 + EPDC_CONFIG_GROUP + true test - + + + 9065 + 47.104.224.45:8848 + 6a3577b4-7b79-43f6-aebb-9c3f31263f6a + EPDC_CONFIG_GROUP + true diff --git a/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/src/main/java/com/elink/esua/epdc/controller/OssController.java b/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/src/main/java/com/elink/esua/epdc/controller/OssController.java index 02912121c..31882f01e 100644 --- a/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/src/main/java/com/elink/esua/epdc/controller/OssController.java +++ b/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/src/main/java/com/elink/esua/epdc/controller/OssController.java @@ -171,4 +171,16 @@ public class OssController { return new Result().ok(url); } + /** + * @param avatarUrl + * @return java.lang.String + * @Author yinzuomei + * @Description 上传微信头像 + * @Date 2019/12/19 18:48 + **/ + @GetMapping("saveWeChatFaceImg") + public Result saveWeChatFaceImg(@RequestParam(value = "avatarUrl") String avatarUrl){ + return ossService.saveWeChatFaceImg(avatarUrl); + } + } diff --git a/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/src/main/java/com/elink/esua/epdc/service/OssService.java b/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/src/main/java/com/elink/esua/epdc/service/OssService.java index e7fe79341..9b383ea27 100644 --- a/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/src/main/java/com/elink/esua/epdc/service/OssService.java +++ b/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/src/main/java/com/elink/esua/epdc/service/OssService.java @@ -49,4 +49,13 @@ public interface OssService extends BaseService { * @date 2019/12/10 17:23 */ void download(String fileUrl, HttpServletResponse response); + + /** + * @param fileUrl + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 上传微信头像 + * @Date 2019/12/19 18:55 + **/ + Result saveWeChatFaceImg(String fileUrl); } diff --git a/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/src/main/java/com/elink/esua/epdc/service/impl/OssServiceImpl.java b/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/src/main/java/com/elink/esua/epdc/service/impl/OssServiceImpl.java index b1054b2ee..6334efc11 100644 --- a/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/src/main/java/com/elink/esua/epdc/service/impl/OssServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/src/main/java/com/elink/esua/epdc/service/impl/OssServiceImpl.java @@ -10,6 +10,7 @@ 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.cloud.OssFactory; 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; @@ -19,6 +20,7 @@ import com.elink.esua.epdc.dao.OssDao; import com.elink.esua.epdc.dto.UploadDTO; import com.elink.esua.epdc.entity.OssEntity; import com.elink.esua.epdc.service.OssService; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import javax.servlet.http.HttpServletResponse; @@ -97,4 +99,33 @@ public class OssServiceImpl extends BaseServiceImpl implement } + /** + * @param avatarUrl + * @return java.lang.String + * @Author yinzuomei + * @Description 上传微信头像 + * @Date 2019/12/19 18:49 + **/ + @Override + public Result saveWeChatFaceImg(String avatarUrl) { + if (StringUtils.isBlank(avatarUrl)) { + return new Result().error("avatarUrl不能为空"); + } + try { + //实例化url + URL url = new URL(avatarUrl); + //载入图片到输入流 + DataInputStream dataInputStream = new DataInputStream(url.openStream()); + int size = dataInputStream.available(); + //上传文件 + String fileUrl = OssFactory.build().uploadSuffix(dataInputStream, "jpg"); + return this.afterUpload(fileUrl, size); + } catch (MalformedURLException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + return new Result().error("上传微信头像异常"); + } + } diff --git a/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/src/main/resources/application.yml index 47956a5c0..963cace2e 100644 --- a/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/src/main/resources/application.yml +++ b/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/src/main/resources/application.yml @@ -3,77 +3,18 @@ server: servlet: context-path: /oss +nacos: + config: + server-addr: @nacos.server-addr@ + type: YAML + namespace: @nacos.config.namespace@ + group: @nacos.config.group@ + dataId: epdc-oss-server + bootstrap: + enable: true + log: + enable: @nacos.config.bootstrap.log.enable@ + spring: application: name: epdc-oss-server - # 环境 dev|test|prod - profiles: - active: @spring.profiles.active@ - messages: - encoding: UTF-8 - basename: i18n/messages,i18n/messages_common - jackson: - time-zone: GMT+8 - date-format: yyyy-MM-dd HH:mm:ss - servlet: - multipart: - max-file-size: 1024MB - max-request-size: 1024MB - enabled: true - redis: - database: @spring.redis.index@ - host: @spring.redis.host@ - timeout: 30s - port: @spring.redis.port@ - password: @spring.redis.password@ - cloud: - nacos: - discovery: - server-addr: @nacos.server-addr@ - register-enabled: @nacos.register-enabled@ - alibaba: - seata: - tx-service-group: epdc-oss-server-fescar-service-group - datasource: - druid: - driver-class-name: com.mysql.jdbc.Driver - url: @spring.datasource.druid.url@ - username: @spring.datasource.druid.username@ - password: @spring.datasource.druid.password@ - -fdfs: - so-timeout: 600000 - connect-timeout: 6000 - tracker-list: #TrackerList参数,支持多个 - - @fastdfs.server-addr@ - -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: ALWAYS - - -mybatis-plus: - mapper-locations: classpath:/mapper/**/*.xml - #实体扫描,多个package用逗号或者分号分隔 - typeAliasesPackage: io.renren.entity;com.elink.esua.epdc.entity - global-config: - #数据库相关配置 - db-config: - #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; - id-type: ID_WORKER - #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" - field-strategy: NOT_NULL - #驼峰下划线转换 - column-underline: true - banner: false - #原生配置 - configuration: - map-underscore-to-camel-case: true - cache-enabled: false - call-setters-on-nulls: true - jdbc-type-for-null: 'null' diff --git a/esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-client/pom.xml b/esua-epdc/epdc-module/epdc-points/epdc-points-client/pom.xml similarity index 57% rename from esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-client/pom.xml rename to esua-epdc/epdc-module/epdc-points/epdc-points-client/pom.xml index cb0fce014..6beca7732 100644 --- a/esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-client/pom.xml +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-client/pom.xml @@ -3,14 +3,20 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - epdc-neighbor + epdc-points com.esua.epdc 1.0.0 4.0.0 - epdc-neighbor-client + epdc-points-client jar + + + com.esua.epdc + epdc-commons-tools + 1.0.0 + + - - \ No newline at end of file + diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-client/src/main/java/com/elink/esua/epdc/dto/logs/PointsLogsDTO.java b/esua-epdc/epdc-module/epdc-points/epdc-points-client/src/main/java/com/elink/esua/epdc/dto/logs/PointsLogsDTO.java new file mode 100644 index 000000000..8b59d5af5 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-client/src/main/java/com/elink/esua/epdc/dto/logs/PointsLogsDTO.java @@ -0,0 +1,130 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto.logs; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 积分日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-13 + */ +@Data +public class PointsLogsDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 志愿者ID + */ + private String volunteerId; + + /** + * 用户ID + */ + private String userId; + + /** + * 积分操作类型(0-减积分,1-加积分) + */ + private String operationType; + + /** + * 操作积分值 + */ + private Integer points; + + /** + * 操作描述 + */ + private String operationDesc; + + /** + * 操作时间 + */ + private Date operationTime; + + /** + * 操作方式(user-用户操作,admin-管理员操作,sys-系统操作) + */ + private String operationMode; + + /** + * 积分规则编码 + */ + private String ruleCode; + + /** + * 是否操作成功(0-失败,1-成功) + */ + private String status; + + /** + * 操作失败原因 + */ + private String failureReason; + + /** + * 删除标记 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 剩余积分值 + */ + private Integer lavePoints; + + /** + * 积分行为编码 + */ + private String behaviorCode; +} diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-client/src/main/java/com/elink/esua/epdc/dto/logs/UserPointsLogDTO.java b/esua-epdc/epdc-module/epdc-points/epdc-points-client/src/main/java/com/elink/esua/epdc/dto/logs/UserPointsLogDTO.java new file mode 100644 index 000000000..4134f3d43 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-client/src/main/java/com/elink/esua/epdc/dto/logs/UserPointsLogDTO.java @@ -0,0 +1,46 @@ +package com.elink.esua.epdc.dto.logs; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description @PointsBehavior 入参DTO + * @Author yinzuomei + * @Date 2019/12/13 10:11 + */ +@Data +public class UserPointsLogDTO implements Serializable { + private static final long serialVersionUID = -4809148536169854292L; + + /** + * 积分操作类型(加积分、减积分) + */ + @NotBlank(message = "积分操作类型不能为空") + private String operationType; + + /** + * 积分操作方式(user-用户操作,admin-管理员操作,sys-系统操作) + */ + @NotBlank(message = "积分操作方式不能为空") + private String operationMode; + + /** + * VOLUNTEER_ID 志愿者ID + */ + @NotBlank(message = "志愿者id不能为空") + private String volunteerId; + + /** + * 用户ID + */ + @NotBlank(message = "用户id不能为空") + private String userId; + + /** + * 规则编码 + */ + @NotBlank(message = "规则编码不能为空") + private String ruleCode; +} diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-client/src/main/java/com/elink/esua/epdc/dto/rule/PointsRuleDTO.java b/esua-epdc/epdc-module/epdc-points/epdc-points-client/src/main/java/com/elink/esua/epdc/dto/rule/PointsRuleDTO.java new file mode 100644 index 000000000..d1c0f57a7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-client/src/main/java/com/elink/esua/epdc/dto/rule/PointsRuleDTO.java @@ -0,0 +1,122 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto.rule; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 积分规则表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class PointsRuleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 规则编码 + */ + private String ruleCode; + + /** + * 规则描述 + */ + private String ruleDesc; + + /** + * 积分值 + */ + private Integer points; + + /** + * 规则操作类型(0-减积分,1-加积分) + */ + private String operationType; + + /** + * 可用标记(0-不可用,1-可用) + */ + private String available; + + /** + * 积分行为编码 + */ + private String behaviorCode; + + /** + * 积分行为描述 + */ + private String behaviorDesc; + + /** + * 积分是否有上限限制(0-否,1-是) + */ + private String upperLimitFlag; + + /** + * 限制时限(0-分钟,1-小时,2-日,3-月,4-年) + */ + private String limitTimeType; + + /** + * 积分上限值 + */ + private Integer upperLimitVal; + + /** + * 删除标记 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/resources/i18n/messages.properties b/esua-epdc/epdc-module/epdc-points/epdc-points-client/src/main/java/com/elink/esua/epdc/epdc.gitkeep similarity index 100% rename from esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/resources/i18n/messages.properties rename to esua-epdc/epdc-module/epdc-points/epdc-points-client/src/main/java/com/elink/esua/epdc/epdc.gitkeep diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/Dockerfile b/esua-epdc/epdc-module/epdc-points/epdc-points-server/Dockerfile new file mode 100755 index 000000000..d9a1f64c6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/Dockerfile @@ -0,0 +1,20 @@ +# 基础镜像 +FROM adoptopenjdk/openjdk11 +# 作者 +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} diff --git a/esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/pom.xml b/esua-epdc/epdc-module/epdc-points/epdc-points-server/pom.xml similarity index 68% rename from esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/pom.xml rename to esua-epdc/epdc-module/epdc-points/epdc-points-server/pom.xml index 3abbeb50c..f42162d44 100644 --- a/esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/pom.xml @@ -3,19 +3,19 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - epdc-neighbor + epdc-points com.esua.epdc 1.0.0 4.0.0 - epdc-neighbor-server + epdc-points-server jar com.esua.epdc - epdc-neighbor-client + epdc-points-client 1.0.0 @@ -45,6 +45,17 @@ spring-boot-admin-starter-client ${spring.boot.admin.version} + + + org.springframework.cloud + spring-cloud-starter-zipkin + + + com.esua.epdc + epdc-user-client + 1.0.0 + compile + @@ -73,6 +84,29 @@ dockerfile-maven-plugin + + ${project.basedir}/src/main/java + + + true + ${basedir}/src/main/resources + + **/application*.yml + **/*.properties + logback-spring.xml + registry.conf + + + + ${basedir}/src/main/resources + + **/application*.yml + **/*.properties + logback-spring.xml + registry.conf + + + @@ -85,7 +119,7 @@ dev - 9063 + 9070 2 47.104.224.45 @@ -93,13 +127,15 @@ elink@888 - + - epdc - elink888 + root + shibei@888 - false + true 47.104.224.45:8848 + + http://localhost:9411 @@ -108,7 +144,7 @@ test - 9063 + 9070 2 47.104.224.45 @@ -116,13 +152,15 @@ elink@888 - + epdc elink888 false 47.104.224.45:8848 + + http://localhost:9411 @@ -131,7 +169,7 @@ prod - 9063 + 9070 2 47.104.224.45 @@ -139,15 +177,16 @@ elink@888 - + epdc elink888 false 47.104.224.45:8848 + + http://localhost:9411 - diff --git a/esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/java/com/elink/esua/epdc/NeighborApplication.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/PointsApplication.java similarity index 83% rename from esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/java/com/elink/esua/epdc/NeighborApplication.java rename to esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/PointsApplication.java index 9e021c6ee..8f2b9aa29 100644 --- a/esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/java/com/elink/esua/epdc/NeighborApplication.java +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/PointsApplication.java @@ -14,7 +14,7 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.openfeign.EnableFeignClients; /** - * 友邻社群模块 + * 爱心互助模块 * * @author Mark sunlightcs@gmail.com * @since 1.1.0 @@ -22,10 +22,10 @@ import org.springframework.cloud.openfeign.EnableFeignClients; @SpringBootApplication @EnableDiscoveryClient @EnableFeignClients -public class NeighborApplication { +public class PointsApplication { public static void main(String[] args) { - SpringApplication.run(NeighborApplication.class, args); + SpringApplication.run(PointsApplication.class, args); } } diff --git a/esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java similarity index 94% rename from esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java rename to esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java index 2d13dec56..a91d50d2b 100644 --- a/esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java @@ -21,6 +21,6 @@ import org.springframework.stereotype.Service; public class ModuleConfigImpl implements ModuleConfig { @Override public String getName() { - return "neighbor"; + return "heart"; } } diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/feign/UserFeignClient.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/feign/UserFeignClient.java new file mode 100644 index 000000000..deb8b3e84 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/feign/UserFeignClient.java @@ -0,0 +1,42 @@ +package com.elink.esua.epdc.modules.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.UserDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcUserPointsFormDTO; +import com.elink.esua.epdc.modules.feign.fallback.UserFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + +/** + * @Description 用户模块 + * @Author yinzuomei + * @Date 2019/12/13 10:00 + */ +@FeignClient(name = ServiceConstant.EPDC_USER_SERVER, fallback = UserFeignClientFallback.class) +public interface UserFeignClient { + + /** + * @param formDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据操作类型更新用户积分 + * @Date 2019/12/13 15:12 + **/ + @PostMapping(value = "app-user/user/handleUserPoints", consumes = MediaType.APPLICATION_JSON_VALUE) + Result handleUserPoints(EpdcUserPointsFormDTO formDTO); + + /** + * 查询用户基础信息 + * + * @param userId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2019/10/26 15:16 + */ + @GetMapping("app-user/epdc-app/user/getById/{userId}") + Result getUserInfoById(@PathVariable("userId") String userId); +} diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/UserFeignClientFallback.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/UserFeignClientFallback.java new file mode 100644 index 000000000..c9b61993a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/UserFeignClientFallback.java @@ -0,0 +1,28 @@ +package com.elink.esua.epdc.modules.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.dto.UserDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcUserPointsFormDTO; +import com.elink.esua.epdc.modules.feign.UserFeignClient; +import org.springframework.stereotype.Component; + +/** + * @Description + * @Author yinzuomei + * @Date 2019/12/13 10:00 + */ +@Component +public class UserFeignClientFallback implements UserFeignClient { + + @Override + public Result handleUserPoints(EpdcUserPointsFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "handleUserPoints", formDTO); + } + + @Override + public Result getUserInfoById(String userId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "getUserInfoById", userId); + } +} diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/logs/controller/PointsLogsController.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/logs/controller/PointsLogsController.java new file mode 100644 index 000000000..a119de4f0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/logs/controller/PointsLogsController.java @@ -0,0 +1,112 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.logs.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.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO; +import com.elink.esua.epdc.dto.logs.PointsLogsDTO; +import com.elink.esua.epdc.modules.logs.excel.PointsLogsExcel; +import com.elink.esua.epdc.modules.logs.service.PointsLogsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.util.List; +import java.util.Map; + + +/** + * 积分日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-13 + */ +@RestController +@RequestMapping("pointslogs") +public class PointsLogsController { + + @Autowired + private PointsLogsService pointsLogsService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = pointsLogsService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + PointsLogsDTO data = pointsLogsService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody PointsLogsDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return pointsLogsService.save(dto); + } + @PostMapping("addPointsLog") + public Result addPointsLog(@RequestBody PointsLogsDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return pointsLogsService.save(dto); + } + @PutMapping + public Result update(@RequestBody PointsLogsDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + pointsLogsService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + pointsLogsService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = pointsLogsService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, PointsLogsExcel.class); + } + + /** + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 确定调整用户积分 + * @Date 2019/12/16 18:56 + **/ + @PostMapping("confirmAdjustPoint") + public Result confirmAdjustPoint(@RequestBody EpdcAdjustVolunteerPointsDTO formDto){ + ValidatorUtils.validateEntity(formDto); + return pointsLogsService.confirmAdjustPoint(formDto); + } +} diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/logs/dao/PointsLogsDao.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/logs/dao/PointsLogsDao.java new file mode 100644 index 000000000..5d9945a62 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/logs/dao/PointsLogsDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.logs.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.logs.entity.PointsLogsEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 积分日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-13 + */ +@Mapper +public interface PointsLogsDao extends BaseDao { + +} diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/logs/entity/PointsLogsEntity.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/logs/entity/PointsLogsEntity.java new file mode 100644 index 000000000..5f9fac8a8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/logs/entity/PointsLogsEntity.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.logs.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 qu@elink-cn.com + * @since v1.0.0 2019-12-13 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_points_logs") +public class PointsLogsEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 志愿者ID + */ + private String volunteerId; + + /** + * 用户ID + */ + private String userId; + + /** + * 积分操作类型(0-减积分,1-加积分) + */ + private String operationType; + + /** + * 操作积分值 + */ + private Integer points; + + /** + * 操作描述 + */ + private String operationDesc; + + /** + * 操作时间 + */ + private Date operationTime; + + /** + * 操作方式(user-用户操作,admin-管理员操作,sys-系统操作) + */ + private String operationMode; + + /** + * 积分规则编码 + */ + private String ruleCode; + + /** + * 是否操作成功(0-失败,1-成功) + */ + private String status; + + /** + * 操作失败原因 + */ + private String failureReason; + + /** + * 剩余积分值 + */ + private Integer lavePoints; + + /** + * 积分行为编码 + */ + private String behaviorCode; +} diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/logs/excel/PointsLogsExcel.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/logs/excel/PointsLogsExcel.java new file mode 100644 index 000000000..4377620d9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/logs/excel/PointsLogsExcel.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.logs.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 积分日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-13 + */ +@Data +public class PointsLogsExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "志愿者ID") + private String volunteerId; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "积分操作类型(0-减积分,1-加积分)") + private String operationType; + + @Excel(name = "操作积分值") + private Integer points; + + @Excel(name = "操作描述") + private String operationDesc; + + @Excel(name = "操作时间") + private Date operationTime; + + @Excel(name = "操作方式(user-用户操作,admin-管理员操作,sys-系统操作)") + private String operationMode; + + @Excel(name = "积分规则编码") + private String ruleCode; + + @Excel(name = "是否操作成功(0-失败,1-成功)") + private String status; + + @Excel(name = "操作失败原因") + private String failureReason; + + @Excel(name = "删除标记") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/logs/redis/PointsLogsRedis.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/logs/redis/PointsLogsRedis.java new file mode 100644 index 000000000..81776df7a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/logs/redis/PointsLogsRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.logs.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 积分日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-13 + */ +@Component +public class PointsLogsRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/logs/service/PointsLogsService.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/logs/service/PointsLogsService.java new file mode 100644 index 000000000..6d43ada76 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/logs/service/PointsLogsService.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.logs.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.epdc.result.EpdcAdjustVolunteerPointsDTO; +import com.elink.esua.epdc.dto.logs.PointsLogsDTO; +import com.elink.esua.epdc.modules.logs.entity.PointsLogsEntity; + +import java.util.List; +import java.util.Map; + +/** + * 积分日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-13 + */ +public interface PointsLogsService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-13 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-13 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PointsLogsDTO + * @author generator + * @date 2019-12-13 + */ + PointsLogsDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-13 + */ + Result save(PointsLogsDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-13 + */ + void update(PointsLogsDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-13 + */ + void delete(String[] ids); + + /** + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 确定调整用户积分 + * @Date 2019/12/16 18:56 + **/ + Result confirmAdjustPoint(EpdcAdjustVolunteerPointsDTO formDto); +} diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/logs/service/impl/PointsLogsServiceImpl.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/logs/service/impl/PointsLogsServiceImpl.java new file mode 100644 index 000000000..f84f9c915 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/logs/service/impl/PointsLogsServiceImpl.java @@ -0,0 +1,162 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.logs.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.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.constant.PointsConstant; +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; +import com.elink.esua.epdc.commons.tools.enums.pointsenum.PointsOperationModeEnum; +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.utils.Result; +import com.elink.esua.epdc.dto.UserDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcUserPointsFormDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO; +import com.elink.esua.epdc.dto.logs.PointsLogsDTO; +import com.elink.esua.epdc.modules.feign.UserFeignClient; +import com.elink.esua.epdc.modules.logs.dao.PointsLogsDao; +import com.elink.esua.epdc.modules.logs.entity.PointsLogsEntity; +import com.elink.esua.epdc.modules.logs.redis.PointsLogsRedis; +import com.elink.esua.epdc.modules.logs.service.PointsLogsService; +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.Date; +import java.util.List; +import java.util.Map; + +/** + * 积分日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-13 + */ +@Service +public class PointsLogsServiceImpl extends BaseServiceImpl implements PointsLogsService { + + @Autowired + private PointsLogsRedis pointsLogsRedis; + + @Autowired + private UserFeignClient userFeignClient; + + @Override + public PageData page(Map params) { + String volunteerId = (String) params.get("volunteerId"); + String behaviorCode=(String) params.get("behaviorCode"); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(volunteerId), "VOLUNTEER_ID", volunteerId) + .eq(StringUtils.isNotBlank(behaviorCode),"BEHAVIOR_CODE",behaviorCode); + + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + wrapper + ); + return getPageData(page, PointsLogsDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PointsLogsDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public PointsLogsDTO get(String id) { + PointsLogsEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PointsLogsDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result save(PointsLogsDTO dto) { + PointsLogsEntity entity = ConvertUtils.sourceToTarget(dto, PointsLogsEntity.class); + insert(entity); + return new Result(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PointsLogsDTO dto) { + PointsLogsEntity entity = ConvertUtils.sourceToTarget(dto, PointsLogsEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 确定调整用户积分 + * @Date 2019/12/16 18:56 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public Result confirmAdjustPoint(EpdcAdjustVolunteerPointsDTO formDto) { + if(formDto.getOperatePoints()== NumConstant.ZERO){ + return new Result().error("操作积分不能为0"); + } + PointsLogsEntity pointsLogsEntity=new PointsLogsEntity(); + pointsLogsEntity.setVolunteerId(formDto.getId()); + pointsLogsEntity.setUserId(formDto.getUserId()); + pointsLogsEntity.setOperationTime(new Date()); + pointsLogsEntity.setOperationMode(PointsOperationModeEnum.OPERATION_MODE_ADMIN.getOperationMode());//操作方式(user-用户操作,admin-管理员操作,sys-系统操作) + pointsLogsEntity.setStatus(YesOrNoEnum.YES.value()); + pointsLogsEntity.setFailureReason(""); + pointsLogsEntity.setRuleCode(PointsConstant.ruleCode); + pointsLogsEntity.setOperationDesc(formDto.getAdjustReason());//操作描述 + pointsLogsEntity.setPoints(formDto.getOperatePoints()); + pointsLogsEntity.setOperationType(formDto.getOperationType());//积分操作类型(0-减积分,1-加积分) + EpdcUserPointsFormDTO userPointsFormDTO=new EpdcUserPointsFormDTO(); + userPointsFormDTO.setUserId(formDto.getUserId()); + userPointsFormDTO.setPoints(formDto.getOperatePoints()); + userPointsFormDTO.setOperationType(formDto.getOperationType()); + Result result=userFeignClient.handleUserPoints(userPointsFormDTO); + Result userDTOResult=userFeignClient.getUserInfoById(formDto.getUserId()); + pointsLogsEntity.setLavePoints(userDTOResult.getData().getPoints());//剩余积分 + pointsLogsEntity.setBehaviorCode(formDto.getBehaviorCode()); + if(!result.success()){ + return new Result().error("调整用户积分失败"); + } + this.insert(pointsLogsEntity); + return new Result(); + } +} diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/rule/controller/PointsRuleController.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/rule/controller/PointsRuleController.java new file mode 100644 index 000000000..37ddd3643 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/rule/controller/PointsRuleController.java @@ -0,0 +1,103 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.rule.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.rule.PointsRuleDTO; +import com.elink.esua.epdc.modules.rule.excel.PointsRuleExcel; +import com.elink.esua.epdc.modules.rule.service.PointsRuleService; +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 qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@RestController +@RequestMapping("pointsrule") +public class PointsRuleController { + + @Autowired + private PointsRuleService pointsRuleService; + + @GetMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = pointsRuleService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id) { + PointsRuleDTO data = pointsRuleService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody PointsRuleDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return pointsRuleService.save(dto); + } + + @PutMapping + public Result update(@RequestBody PointsRuleDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + return pointsRuleService.update(dto); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + pointsRuleService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = pointsRuleService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, PointsRuleExcel.class); + } + + /** + * @param ruleCode + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据规则编码查询规则信息 + * @Date 2019/12/12 16:29 + **/ + @GetMapping("getPointRule/{ruleCode}") + public Result getPointRule(@PathVariable("ruleCode") String ruleCode) { + return pointsRuleService.getPointRule(ruleCode); + } +} diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/rule/dao/PointsRuleDao.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/rule/dao/PointsRuleDao.java new file mode 100644 index 000000000..558b37d89 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/rule/dao/PointsRuleDao.java @@ -0,0 +1,34 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.rule.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.rule.entity.PointsRuleEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 积分规则表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Mapper +public interface PointsRuleDao extends BaseDao { + + +} diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/rule/entity/PointsRuleEntity.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/rule/entity/PointsRuleEntity.java new file mode 100644 index 000000000..488900d8a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/rule/entity/PointsRuleEntity.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.rule.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 qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_points_rule") +public class PointsRuleEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 规则编码 + */ + private String ruleCode; + + /** + * 规则描述 + */ + private String ruleDesc; + + /** + * 积分值 + */ + private Integer points; + + /** + * 规则操作类型(0-减积分,1-加积分) + */ + private String operationType; + + /** + * 可用标记(0-不可用,1-可用) + */ + private String available; + + /** + * 积分行为编码 + */ + private String behaviorCode; + + /** + * 积分行为描述 + */ + private String behaviorDesc; + + /** + * 积分是否有上限限制(0-否,1-是) + */ + private String upperLimitFlag; + + /** + * 限制时限(0-分钟,1-小时,2-日,3-月,4-年) + */ + private String limitTimeType; + + /** + * 积分上限值 + */ + private Integer upperLimitVal; + +} diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/rule/excel/PointsRuleExcel.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/rule/excel/PointsRuleExcel.java new file mode 100644 index 000000000..3342faeae --- /dev/null +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/rule/excel/PointsRuleExcel.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.rule.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 积分规则表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class PointsRuleExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "规则编码") + private String ruleCode; + + @Excel(name = "规则描述") + private String ruleDesc; + + @Excel(name = "积分值") + private Integer points; + + @Excel(name = "规则操作类型(0-减积分,1-加积分)") + private String operationType; + + @Excel(name = "可用标记(0-不可用,1-可用)") + private String available; + + @Excel(name = "积分行为编码") + private String behaviorCode; + + @Excel(name = "积分行为描述") + private String behaviorDesc; + + @Excel(name = "积分是否有上限限制(0-否,1-是)") + private String upperLimitFlag; + + @Excel(name = "限制时限(0-分钟,1-小时,2-日,3-月,4-年)") + private String limitTimeType; + + @Excel(name = "积分上限值") + private Integer upperLimitVal; + + @Excel(name = "删除标记") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/rule/redis/PointsRuleRedis.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/rule/redis/PointsRuleRedis.java new file mode 100644 index 000000000..dd7028f6f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/rule/redis/PointsRuleRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.rule.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 积分规则表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Component +public class PointsRuleRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/rule/service/PointsRuleService.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/rule/service/PointsRuleService.java new file mode 100644 index 000000000..35436ccc9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/rule/service/PointsRuleService.java @@ -0,0 +1,114 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.rule.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.rule.PointsRuleDTO; +import com.elink.esua.epdc.modules.rule.entity.PointsRuleEntity; + +import java.util.List; +import java.util.Map; + +/** + * 积分规则表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +public interface PointsRuleService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-11 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-11 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PointsRuleDTO + * @author generator + * @date 2019-12-11 + */ + PointsRuleDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-11 + */ + Result save(PointsRuleDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-11 + */ + Result update(PointsRuleDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-11 + */ + void delete(String[] ids); + + /** + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 项目启动初始化积分规则到redis + * @Date 2019/12/12 16:27 + **/ + Result initPointsRuleRedis(); + + /** + * @param ruleCode + * @return com.elink.esua.epdc.dto.rule.PointsRuleDTO + * @Author yinzuomei + * @Description 根据规则编码查询规则信息 + * @Date 2019/12/12 16:30 + **/ + Result getPointRule(String ruleCode); +} diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/rule/service/impl/PointsRuleServiceImpl.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/rule/service/impl/PointsRuleServiceImpl.java new file mode 100644 index 000000000..c0fbfc170 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/rule/service/impl/PointsRuleServiceImpl.java @@ -0,0 +1,235 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.rule.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.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.enums.pointsenum.PointsLimitTimeEnum; +import com.elink.esua.epdc.commons.tools.enums.pointsenum.PointsRuleAvailableEnum; +import com.elink.esua.epdc.commons.tools.enums.pointsenum.PointsUpperLimitEnum; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.redis.RedisKeys; +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.rule.PointsRuleDTO; +import com.elink.esua.epdc.modules.rule.dao.PointsRuleDao; +import com.elink.esua.epdc.modules.rule.entity.PointsRuleEntity; +import com.elink.esua.epdc.modules.rule.redis.PointsRuleRedis; +import com.elink.esua.epdc.modules.rule.service.PointsRuleService; +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 qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Service +public class PointsRuleServiceImpl extends BaseServiceImpl implements PointsRuleService { + + @Autowired + private PointsRuleRedis pointsRuleRedis; + + @Autowired + private RedisUtils redisUtils; + + @Override + public PageData page(Map params) { + String ruleDesc = (String) params.get("ruleDesc"); + String behaviorCode = (String) params.get("behaviorCode"); + String behaviorDesc = (String) params.get("behaviorDesc"); + String ruleCode = (String) params.get("ruleCode"); + String operationType = (String) params.get("operationType"); + String available = (String) params.get("available"); + String upperLimitFlag = (String) params.get("upperLimitFlag"); + String startTime = (String) params.get("startTime"); + String endTime = (String) params.get("endTime"); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.isNotBlank(ruleDesc), "RULE_DESC", ruleDesc.trim()) + .like(StringUtils.isNotBlank(behaviorDesc), "BEHAVIOR_DESC", behaviorDesc.trim()) + .like(StringUtils.isNotBlank(ruleCode), "RULE_CODE", ruleCode.trim()) + .eq(StringUtils.isNotBlank(operationType), "OPERATION_TYPE", operationType) + .eq(StringUtils.isNotBlank(available), "AVAILABLE", available) + .eq(StringUtils.isNotBlank(upperLimitFlag), "UPPER_LIMIT_FLAG", upperLimitFlag) + .eq(StringUtils.isNotBlank(behaviorCode), "BEHAVIOR_CODE", behaviorCode) + .between(StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime), + "DATE_FORMAT(CREATED_TIME, '%Y-%m-%d' )", + startTime, + endTime); + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + wrapper + ); + return getPageData(page, PointsRuleDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PointsRuleDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public PointsRuleDTO get(String id) { + PointsRuleEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PointsRuleDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result save(PointsRuleDTO dto) { + Result checkResult = checkPointsRuleDTO(dto); + if (!checkResult.success()) { + return checkResult; + } + if(StringUtils.isBlank(dto.getLimitTimeType())){ + dto.setLimitTimeType(PointsLimitTimeEnum.LIMIT_TIME_MINUTE.value()); + } + dto.setAvailable(PointsRuleAvailableEnum.AVAILABLE_TRUE.value());//可用标记(0-不可用,1-可用) 新增时默认可用 + PointsRuleEntity entity = ConvertUtils.sourceToTarget(dto, PointsRuleEntity.class); + insert(entity); + String pointsRuleKey = RedisKeys.getPointsRuleKey(dto.getRuleCode()); + redisUtils.set(pointsRuleKey, entity); + return new Result(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result update(PointsRuleDTO dto) { + Result checkResult = checkPointsRuleDTO(dto); + if (!checkResult.success()) { + return checkResult; + } + if(StringUtils.isBlank(dto.getLimitTimeType())){ + dto.setLimitTimeType(PointsLimitTimeEnum.LIMIT_TIME_MINUTE.value()); + } + PointsRuleEntity entity = ConvertUtils.sourceToTarget(dto, PointsRuleEntity.class); + updateById(entity); + String pointsRuleKey = RedisKeys.getPointsRuleKey(dto.getRuleCode()); + redisUtils.set(pointsRuleKey, entity); + return new Result(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.in(FieldConstant.ID, ids); + List pointsRuleEntityList = baseDao.selectList(wrapper); + for (PointsRuleEntity pointsRuleEntity : pointsRuleEntityList) { + String pointsRuleKey = RedisKeys.getPointsRuleKey(pointsRuleEntity.getRuleCode()); + redisUtils.delete(pointsRuleKey); + } + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 项目启动初始化积分规则到redis + * @Date 2019/12/12 16:26 + **/ + @Override + public Result initPointsRuleRedis() { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("AVAILABLE", PointsRuleAvailableEnum.AVAILABLE_TRUE.value()); + List pointsRuleEntityList = baseDao.selectList(wrapper); + for (PointsRuleEntity pointsRuleEntity : pointsRuleEntityList) { + String pointsRuleKey = RedisKeys.getPointsRuleKey(pointsRuleEntity.getRuleCode()); + redisUtils.set(pointsRuleKey, pointsRuleEntity); + } + return new Result(); + } + + /** + * @param ruleCode + * @return com.elink.esua.epdc.dto.rule.PointsRuleDTO + * @Author yinzuomei + * @Description 根据规则编码查询规则信息 + * @Date 2019/12/12 16:30 + **/ + @Override + public Result getPointRule(String ruleCode) { + if (StringUtils.isBlank(ruleCode)) { + return new Result().error("规则编码不能为空"); + } + String pointsRuleKey = RedisKeys.getPointsRuleKey(ruleCode); + Object obj = redisUtils.get(pointsRuleKey); + if (null == obj) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("RULE_CODE", ruleCode); + List pointsRuleEntityList = baseDao.selectList(wrapper); + if (CollUtil.isEmpty(pointsRuleEntityList)) { + return new Result().error("没有找到有效记录"); + } else if (pointsRuleEntityList.size() > 1) { + return new Result().error("规则编码不唯一"); + } + redisUtils.set(pointsRuleKey, pointsRuleEntityList.get(0)); + obj = redisUtils.get(pointsRuleKey); + } + PointsRuleDTO pointsRuleDTO = ConvertUtils.sourceToTarget(obj, PointsRuleDTO.class); + return new Result().ok(pointsRuleDTO); + } + + /** + * @param dto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 校验界面提交数据 + * @Date 2019/12/11 17:56 + **/ + public Result checkPointsRuleDTO(PointsRuleDTO dto) { + //规则有上限值:积分值不能大于上限值 + if (PointsUpperLimitEnum.YES.value().equals(dto.getUpperLimitFlag()) + && dto.getPoints() > dto.getUpperLimitVal()) { + return new Result().error("积分值不能大于上限值"); + } + //校验规则编码是否唯一 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("RULE_CODE", dto.getRuleCode()) + .ne(StringUtils.isNotBlank(dto.getId()), FieldConstant.ID, dto.getId()); + List list = baseDao.selectList(wrapper); + if (CollUtil.isNotEmpty(list)) { + return new Result().error("规则编码已存在"); + } + return new Result(); + } +} diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/support/annotion/PointsBehavior.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/support/annotion/PointsBehavior.java new file mode 100644 index 000000000..e223d5e6e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/support/annotion/PointsBehavior.java @@ -0,0 +1,42 @@ +package com.elink.esua.epdc.support.annotion; + +import com.elink.esua.epdc.commons.tools.enums.pointsenum.PointsOperationEnum; +import com.elink.esua.epdc.commons.tools.enums.pointsenum.PointsOperationModeEnum; + +import java.lang.annotation.*; + +/** + * @Auther: yinzuomei + * @Date: 2019/12/13 09:15 + * @Description: 爱心互助积分注解 + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +@Inherited +@Documented +public @interface PointsBehavior { + /** + * 积分操作类型(加积分、减积分) + */ + PointsOperationEnum operationType(); + + /** + * 积分操作方式(user-用户操作,admin-管理员操作,sys-系统操作) + */ + PointsOperationModeEnum operationMode(); + + /** + * 志愿者ID + */ + String volunteerId() default ""; + + /** + * 用户ID + */ + String userId() default ""; + + /** + * 规则编码 + */ + String ruleCode() default ""; +} diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/support/aop/PointsBehaviorAop.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/support/aop/PointsBehaviorAop.java new file mode 100644 index 000000000..0ecdad1c2 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/support/aop/PointsBehaviorAop.java @@ -0,0 +1,209 @@ +package com.elink.esua.epdc.support.aop; + +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.dto.epdc.form.EpdcUserPointsFormDTO; +import com.elink.esua.epdc.dto.logs.PointsLogsDTO; +import com.elink.esua.epdc.dto.logs.UserPointsLogDTO; +import com.elink.esua.epdc.dto.rule.PointsRuleDTO; +import com.elink.esua.epdc.modules.feign.UserFeignClient; +import com.elink.esua.epdc.modules.logs.service.PointsLogsService; +import com.elink.esua.epdc.modules.rule.service.PointsRuleService; +import com.elink.esua.epdc.support.annotion.PointsBehavior; +import io.seata.spring.annotation.GlobalTransactional; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.AfterReturning; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.aspectj.lang.reflect.MethodSignature; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import java.lang.reflect.Method; +import java.util.Date; + +/** + * @Description + * @Author yinzuomei + * @Date 2019/12/13 10:00 + */ +@Aspect +@Component +public class PointsBehaviorAop { + private final Logger logger = LogManager.getLogger(getClass()); + @Autowired + private PointsLogsService pointsLogsService; + + @Autowired + private PointsRuleService pointsRuleService; + + @Autowired + private UserFeignClient userFeignClient; + + @Pointcut("@annotation(com.elink.esua.epdc.support.annotion.PointsBehavior)") + public void recordUserPointsBehavior() { + } + + @AfterReturning("recordUserPointsBehavior()") + public void handleUserPoints(JoinPoint joinPoint) throws Exception { + logger.info("handleUserPoints start"); + MethodSignature signature = (MethodSignature) joinPoint.getSignature(); + Method method = signature.getMethod(); + PointsBehavior pointsBehavior = method.getAnnotation(PointsBehavior.class); + Object[] args = joinPoint.getArgs(); + String[] argNames = ((MethodSignature) joinPoint.getSignature()).getParameterNames(); + //解析入参 + UserPointsLogDTO userPointsLogDTO = this.packageUserPointsLogDTO(pointsBehavior, args, argNames); + //校验入参属性都不能为空 + ValidatorUtils.validateEntity(userPointsLogDTO); + Result result = this.updateUserPoints(userPointsLogDTO); + if (!result.success()) { + throw new Exception("更新用户积分异常" + result.getMsg()); + } + } + + /** + * @param userPointsLogDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description + * @Date 2019/12/13 15:17 + **/ + private Result updateUserPoints(UserPointsLogDTO userPointsLogDTO) { + //logger.info("解析后的UserPointsLogDTO:" + JSONObject.toJSONString(userPointsLogDTO)); + //插入积分日志 + PointsLogsDTO pointsLogDto = ConvertUtils.sourceToTarget(userPointsLogDTO, PointsLogsDTO.class); + Result pointsRuleDTOResult = pointsRuleService.getPointRule(pointsLogDto.getRuleCode()); + pointsLogDto.setOperationDesc(pointsRuleDTOResult.getData().getBehaviorDesc()); + pointsLogDto.setPoints(pointsRuleDTOResult.getData().getPoints()); + pointsLogDto.setOperationTime(new Date()); + pointsLogDto.setStatus(YesOrNoEnum.YES.value());//是否操作成功(0-失败,1-成功) + Result result = pointsLogsService.save(pointsLogDto); + if (!result.success()) { + return result; + } + //修改用户总积分数 + EpdcUserPointsFormDTO formDTO = new EpdcUserPointsFormDTO(); + formDTO.setOperationType(userPointsLogDTO.getOperationType()); + formDTO.setPoints(pointsRuleDTOResult.getData().getPoints()); + formDTO.setUserId(userPointsLogDTO.getUserId()); + Result res = userFeignClient.handleUserPoints(formDTO); + return res; + } + + /** + * @param pointsBehavior + * @param args + * @param argNames + * @return com.elink.esua.epdc.dto.logs.UserPointsLogDTO + * @Author yinzuomei + * @Description + * @Date 2019/12/13 10:29 + **/ + private UserPointsLogDTO packageUserPointsLogDTO(PointsBehavior pointsBehavior, + Object[] args, + String[] argNames) { + logger.info("packageUserPointsLogDTO start"); + UserPointsLogDTO userPointsLogDTO = new UserPointsLogDTO(); + userPointsLogDTO.setOperationMode(pointsBehavior.operationMode().getOperationMode()); + userPointsLogDTO.setOperationType(pointsBehavior.operationType().getOperationType()); + //志愿者ID + String volunteerIdKey = pointsBehavior.volunteerId(); + //用户ID + String userIdKey = pointsBehavior.userId(); + //规则编码 + String ruleCodeKey = pointsBehavior.ruleCode(); + if (volunteerIdKey.startsWith("#") && userIdKey.startsWith("#") && ruleCodeKey.startsWith("#")) { + String volunteerId = ""; + String userId = ""; + String ruleCode = ""; + + //解析志愿者id + String volunteerIdExpression = volunteerIdKey.substring(2, volunteerIdKey.length() - 1); + String[] volunteerIdStrArr = volunteerIdExpression.split("\\."); + if (volunteerIdStrArr.length > 2 || volunteerIdStrArr.length == 0) { + throw new RuntimeException("记录用户积分注解中volunteerId格式不正确"); + } + if (volunteerIdStrArr.length == 1) { + for (int i = 0; i < argNames.length; i++) { + if (argNames[i].equals(volunteerIdStrArr[0])) { + volunteerId = String.valueOf(args[i]); + } + } + } else if (volunteerIdStrArr.length == 2) { + for (int i = 0; i < argNames.length; i++) { + if (argNames[i].equals(volunteerIdStrArr[0])) { + Object obj = args[i]; + try { + Method method = obj.getClass().getDeclaredMethod(volunteerIdStrArr[1]); + volunteerId = String.valueOf(method.invoke(obj)); + } catch (Exception e) { + throw new RuntimeException("记录用户积分注解中volunteerId反射失败"); + } + } + } + } + //解析ruleCode + String ruleCodeExpression = ruleCodeKey.substring(2, ruleCodeKey.length() - 1); + String[] ruleCodeStrArr = ruleCodeExpression.split("\\."); + if (ruleCodeStrArr.length > 2 || ruleCodeStrArr.length == 0) { + throw new RuntimeException("记录用户积分注解中ruleCode格式不正确"); + } + if (ruleCodeStrArr.length == 1) { + for (int i = 0; i < argNames.length; i++) { + if (argNames[i].equals(ruleCodeStrArr[0])) { + ruleCode = String.valueOf(args[i]); + } + } + } else if (ruleCodeStrArr.length == 2) { + for (int i = 0; i < argNames.length; i++) { + if (argNames[i].equals(ruleCodeStrArr[0])) { + Object obj = args[i]; + try { + Method method = obj.getClass().getDeclaredMethod(ruleCodeStrArr[1]); + ruleCode = String.valueOf(method.invoke(obj)); + } catch (Exception e) { + throw new RuntimeException("记录用户积分注解中ruleCode反射失败"); + } + } + } + } + //解析userId + String userIdExpression = userIdKey.substring(2, userIdKey.length() - 1); + String[] userIdStrArr = userIdExpression.split("\\."); + if (userIdStrArr.length > 2 || userIdStrArr.length == 0) { + throw new RuntimeException("记录用户积分注解中userId格式不正确"); + } + if (userIdStrArr.length == 1) { + for (int i = 0; i < argNames.length; i++) { + if (argNames[i].equals(userIdStrArr[0])) { + userId = String.valueOf(args[i]); + } + } + } else if (userIdStrArr.length == 2) { + for (int i = 0; i < argNames.length; i++) { + if (argNames[i].equals(userIdStrArr[0])) { + Object obj = args[i]; + try { + Method method = obj.getClass().getDeclaredMethod(userIdStrArr[1]); + userId = String.valueOf(method.invoke(obj)); + } catch (Exception e) { + throw new RuntimeException("记录用户积分注解中userId反射失败"); + } + } + } + } + userPointsLogDTO.setVolunteerId(volunteerId); + userPointsLogDTO.setUserId(userId); + userPointsLogDTO.setRuleCode(ruleCode); + } + return userPointsLogDTO; + } + + +} diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/support/initbean/InitPointsRuleRedisCache.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/support/initbean/InitPointsRuleRedisCache.java new file mode 100644 index 000000000..ab5651f6c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/support/initbean/InitPointsRuleRedisCache.java @@ -0,0 +1,31 @@ +package com.elink.esua.epdc.support.initbean; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.modules.rule.service.PointsRuleService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Description 项目启动初始化积分规则到缓存 + * @Author yinzuomei + * @Date 2019/12/12 16:06 + */ +@Component +public class InitPointsRuleRedisCache implements InitializingBean { + private Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired + private PointsRuleService pointsRuleService; + + @Override + public void afterPropertiesSet() throws Exception { + Result result = pointsRuleService.initPointsRuleRedis(); + if (result.success()) { + logger.info("积分规则初始化成功"); + } else { + logger.info("积分规则初始化失败" + result.getMsg()); + } + } +} diff --git a/esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/application.yml similarity index 83% rename from esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/resources/application.yml rename to esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/application.yml index 1e4d7fd0e..7025db4bf 100644 --- a/esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/resources/application.yml +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/application.yml @@ -1,11 +1,11 @@ server: port: @server.port@ servlet: - context-path: /neighbor + context-path: /points spring: application: - name: epdc-neighbor-server + name: epdc-points-server # 环境 dev|test|prod profiles: active: @spring.profiles.active@ @@ -28,13 +28,20 @@ spring: register-enabled: @nacos.register-enabled@ alibaba: seata: - tx-service-group: epdc-neighbor-server-fescar-service-group + tx-service-group: epdc-points-server-fescar-service-group datasource: druid: driver-class-name: com.mysql.jdbc.Driver url: @spring.datasource.druid.url@ username: @spring.datasource.druid.username@ password: @spring.datasource.druid.password@ + zipkin: + # 指定了 zipkin 服务器的地址 + base-url: @spring.zipkin.base-url@ + sleuth: + sampler: + # 将采样比例设置为 1.0,也就是全部都需要。默认是 0.1 + probability: 1.0 management: diff --git a/esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/resources/i18n/messages_en_US.properties b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/i18n/messages.properties similarity index 100% rename from esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/resources/i18n/messages_en_US.properties rename to esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/i18n/messages.properties diff --git a/esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/resources/i18n/messages_zh_CN.properties b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/i18n/messages_en_US.properties similarity index 100% rename from esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/resources/i18n/messages_zh_CN.properties rename to esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/i18n/messages_en_US.properties diff --git a/esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/resources/i18n/messages_zh_TW.properties b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/i18n/messages_zh_CN.properties similarity index 100% rename from esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/resources/i18n/messages_zh_TW.properties rename to esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/i18n/messages_zh_CN.properties diff --git a/esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/resources/i18n/validation.properties b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/i18n/messages_zh_TW.properties similarity index 100% rename from esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/resources/i18n/validation.properties rename to esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/i18n/messages_zh_TW.properties diff --git a/esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/resources/i18n/validation_en_US.properties b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/i18n/validation.properties similarity index 100% rename from esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/resources/i18n/validation_en_US.properties rename to esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/i18n/validation.properties diff --git a/esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/resources/i18n/validation_zh_CN.properties b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/i18n/validation_en_US.properties similarity index 100% rename from esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/resources/i18n/validation_zh_CN.properties rename to esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/i18n/validation_en_US.properties diff --git a/esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/resources/i18n/validation_zh_TW.properties b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/i18n/validation_zh_CN.properties similarity index 100% rename from esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/resources/i18n/validation_zh_TW.properties rename to esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/i18n/validation_zh_CN.properties diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/i18n/validation_zh_TW.properties b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/i18n/validation_zh_TW.properties new file mode 100644 index 000000000..e69de29bb diff --git a/esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/resources/logback-spring.xml b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/logback-spring.xml similarity index 98% rename from esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/resources/logback-spring.xml rename to esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/logback-spring.xml index b6a877871..48658aa4c 100644 --- a/esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/resources/logback-spring.xml +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/logback-spring.xml @@ -2,7 +2,7 @@ - + - + @@ -156,4 +156,4 @@ - \ No newline at end of file + diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/mapper/logs/PointsLogsDao.xml b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/mapper/logs/PointsLogsDao.xml new file mode 100644 index 000000000..1412307a3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/mapper/logs/PointsLogsDao.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/mapper/rule/PointsRuleDao.xml b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/mapper/rule/PointsRuleDao.xml new file mode 100644 index 000000000..40e8d530f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/mapper/rule/PointsRuleDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/resources/registry.conf b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/registry.conf similarity index 79% rename from esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/resources/registry.conf rename to esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/registry.conf index 9cfedf9cc..fb64abd71 100644 --- a/esua-epdc/epdc-module/epdc-neighbor/epdc-neighbor-server/src/main/resources/registry.conf +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/registry.conf @@ -3,7 +3,7 @@ registry { type = "nacos" nacos { - serverAddr = "47.104.224.45" + serverAddr = "@nacos.server-addr@" namespace = "public" cluster = "default" } @@ -14,7 +14,7 @@ config { type = "nacos" nacos { - serverAddr = "47.104.224.45" + serverAddr = "@nacos.server-addr@" namespace = "public" cluster = "default" } diff --git a/esua-epdc/epdc-module/epdc-neighbor/pom.xml b/esua-epdc/epdc-module/epdc-points/pom.xml similarity index 77% rename from esua-epdc/epdc-module/epdc-neighbor/pom.xml rename to esua-epdc/epdc-module/epdc-points/pom.xml index 744cca83b..c15cfe38f 100644 --- a/esua-epdc/epdc-module/epdc-neighbor/pom.xml +++ b/esua-epdc/epdc-module/epdc-points/pom.xml @@ -9,12 +9,12 @@ 4.0.0 - epdc-neighbor + epdc-points pom - epdc-neighbor-client - epdc-neighbor-server + epdc-points-client + epdc-points-server - \ No newline at end of file + diff --git a/esua-epdc/epdc-module/epdc-services/epdc-services-server/Dockerfile b/esua-epdc/epdc-module/epdc-services/epdc-services-server/Dockerfile new file mode 100755 index 000000000..d9a1f64c6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-services/epdc-services-server/Dockerfile @@ -0,0 +1,20 @@ +# 基础镜像 +FROM adoptopenjdk/openjdk11 +# 作者 +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} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/constant/VolunteerInfoConsant.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/constant/VolunteerInfoConsant.java new file mode 100644 index 000000000..2e013c085 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/constant/VolunteerInfoConsant.java @@ -0,0 +1,22 @@ +package com.elink.esua.epdc.constant; + +/** + * 志愿者审批结果 推送信息常量 + */ +public interface VolunteerInfoConsant { + + /** + * 标题:志愿者审批被拉入黑名单 + */ + String NOTICE_TITLE_VOLUNTEER_BLACKLIST = "您已被解除志愿者身份"; + + /** + * 标题:志愿者审批不通过 + */ + String NOTICE_TITLE_VOLUNTEER_NOT_PASSED = "您志愿者身份审核未通过"; + + /** + * 消息所属业务类型 : 志愿者审核 + */ + String NOTICE_BUSINESSTYPE_VOLUNTEER_CHECK = "volunteerCheck"; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/CachingUserInfoDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/CachingUserInfoDTO.java new file mode 100644 index 000000000..81103fe09 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/CachingUserInfoDTO.java @@ -0,0 +1,73 @@ +package com.elink.esua.epdc.dto; + +import lombok.Data; + +import java.util.List; + +/** + * 缓存的用户信息DTO + * + * @author rongchao + * @Date 19-12-18 + */ +@Data +public class CachingUserInfoDTO { + + private static final long serialVersionUID = 915598602233599300L; + + /** + * 用户ID + */ + private String userId; + + /** + * 昵称 + */ + private String nickname; + + /** + * 头像 + */ + private String faceImg; + + /** + * 手机号 + */ + private String mobile; + + /** + * 真实姓名 + */ + private String realName; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 网格名称 + */ + private String grid; + + /** + * 性别(女性-0,男性-1) + */ + private String sex; + + /** + * 用户状态 + */ + private String state; + + /** + * 用户标签信息列表 + */ + private List userTagInfos; + + /** + * 审核备注 + */ + private String remark; + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserGridRelationDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserGridRelationDTO.java index ec36bfa37..68f365019 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserGridRelationDTO.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserGridRelationDTO.java @@ -44,36 +44,6 @@ public class UserGridRelationDTO implements Serializable { */ private String userId; - /** - * 区县 - */ - private String district; - - /** - * 区县ID - */ - private Long districtId; - - /** - * 街道 - */ - private String street; - - /** - * 街道ID - */ - private Long streetId; - - /** - * 社区 - */ - private String community; - - /** - * 社区ID - */ - private Long communityId; - /** * 所属网格 */ @@ -89,36 +59,6 @@ public class UserGridRelationDTO implements Serializable { */ private Date switchedTime; - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; - - /** - * 删除标记 - */ - private String delFlag; - /** * 是否是网格长 0否1是 */ @@ -144,4 +84,4 @@ public class UserGridRelationDTO implements Serializable { */ private String parentDeptIds; -} \ No newline at end of file +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserTagDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserTagDTO.java index 351b1856e..2e40c8703 100755 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserTagDTO.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserTagDTO.java @@ -36,6 +36,10 @@ public class UserTagDTO implements Serializable { private String id; private String tagName; + /** + * 标签编码 + */ + private String tagCode; private String tagDesc; diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserTagInfo.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserTagInfo.java new file mode 100644 index 000000000..35aa8adc3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserTagInfo.java @@ -0,0 +1,27 @@ +package com.elink.esua.epdc.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 用户标签信息 + * + * @author rongchao + * @Date 19-12-18 + */ +@Data +public class UserTagInfo implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 用户标签ID + */ + private String id; + + /** + * 用户标签编码 + */ + private String tagCode; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerInfoDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerInfoDTO.java new file mode 100644 index 000000000..26f803b4b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerInfoDTO.java @@ -0,0 +1,198 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 志愿者信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class VolunteerInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 用户ID + */ + private String userId; + + /** + * 姓名 + */ + private String realName; + + /** + * 性别(0-女,1-男) + */ + private String sex; + + /** + * 出生日期 + */ + private Date birthday; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证 + */ + private String identityNo; + + /** + * 爱心时长(单位:分钟) + */ + private Integer kindnessTime; + + /** + * 参加活动次数 + */ + private Integer participationNum; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 父所有部门ID + */ + private String parentDeptIds; + + /** + * 父所有部门名称 + */ + private String parentDeptNames; + + /** + * 所有部门ID + */ + private String allDeptIds; + + /** + * 所有部门名称 + */ + private String allDeptNames; + + /** + * 所属道路 + */ + private String road; + + /** + * 小区名称 + */ + private String villageName; + + /** + * 住处 + */ + private String dwellingPlace; + + /** + * 居住地址 + */ + private String address; + + /** + * 自我介绍 + */ + private String introduce; + + /** + * 志愿者注册时间 + */ + private Date registTime; + + /** + * 审核状态(0-未审核,1-审核通过,2-审核不通过) + */ + private String auditStatus; + + /** + * 审核不通过的原因 + */ + private String failureReason; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 审核人 + */ + private Long auditor; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + //虚字段 + + /** + * 积分,连user表查询 + */ + private int points; + + /** + * 出生日期 + */ + private String birthdayString; + + /** + * 志愿者注册时间 + */ + private String registTimeString; +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcCompleteVolunteerInfoFormDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcCompleteVolunteerInfoFormDTO.java new file mode 100644 index 000000000..aa350cfbc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcCompleteVolunteerInfoFormDTO.java @@ -0,0 +1,114 @@ +package com.elink.esua.epdc.dto.epdc.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + +/** + * 移动端完善用户信息 + * + * @author work@yujt.net.cn + * @date 2019/10/26 10:56 + */ +@Data +public class EpdcCompleteVolunteerInfoFormDTO implements Serializable { + + private static final long serialVersionUID = 7848126935041704928L; + + /** + * 用户Id + */ + private String userId; + + /** + * 真实姓名 + */ + @NotBlank(message = "真实姓名不能为空") + private String realName; + + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空") + private String mobile; + + //@NotBlank(message = "党员标识不能为空") + //private String partyFlag; + + /** + * 身份证号码 + */ + @NotBlank(message = "身份证号码不能为空") + private String identityNo; + + /** + * 所在道路 + */ + @NotBlank(message = "所在道路不能为空") + private String road; + + /** + * 小区名 + */ + private String villageName; + + /** + * 住处(楼栋-单元-房间) + */ + private String dwellingPlace; + + /** + * 居住网格id + */ + private Long gridId; + + /** + * 微信code + */ + private String wxCode; + + /** + * 用户信息 + */ + private String encryptedData; + + /** + * 加密算法的初始向量 + */ + private String iv; + + /** + * 自我介绍 + */ + private String introduce; + + /*----------------------志愿者新增所需字段---------------------------*/ + + /** + * 出生日期 + */ + private Date birthday; + + + + /*----------------------用户认证所需字段-----------------------------*/ + + /** + * 短信验证码 + */ + private String smsCode; + /** + * 0女,1男 + */ + private String sex; + + + + + + + + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcUserPointsFormDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcUserPointsFormDTO.java new file mode 100644 index 000000000..264ddfcc0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcUserPointsFormDTO.java @@ -0,0 +1,29 @@ +package com.elink.esua.epdc.dto.epdc.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * @Description 根据操作类型更新用户积分 入参DTO + * @Author yinzuomei + * @Date 2019/12/13 13:57 + */ +@Data +public class EpdcUserPointsFormDTO { + /** + * 积分操作类型(加积分、减积分) + */ + @NotBlank(message = "积分操作类型不能为空") + private String operationType; + + /** + * 用户ID + */ + @NotBlank(message = "用户id不能为空") + private String userId; + + @NotNull + private Integer points; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcAdjustVolunteerPointsDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcAdjustVolunteerPointsDTO.java new file mode 100644 index 000000000..27933901e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcAdjustVolunteerPointsDTO.java @@ -0,0 +1,79 @@ +package com.elink.esua.epdc.dto.epdc.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 志愿者积分调整入参DTO + * @Author yinzuomei + * @Date 2019/12/16 17:25 + */ +@Data +public class EpdcAdjustVolunteerPointsDTO implements Serializable { + private static final long serialVersionUID = -2810969141214818209L; + + /** + * 志愿者ID + */ + @NotBlank(message = "主键不能为空") + private String id; + + /** + * 用户ID + */ + @NotBlank(message = "用户id为空") + private String userId; + + /** + * 姓名 + */ + private String realName; + + /** + * 性别(0-女,1-男) + */ + private String sex; + + /** + * 出生日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date birthday; + + /** + * 手机号 + */ + private String mobile; + + /** + * 用户当前积分 + */ + private Integer points; + + /** + * 调整原因 + */ + @NotBlank(message = "调整原因不能为空") + private String adjustReason; + + /** + * 积分加值 + */ + @NotBlank(message = "操作类型不能为空") + private String operationType; + + /** + * 积分减值 + */ + private Integer operatePoints; + + /** + * 积分行为编码 + */ + @NotBlank(message = "积分行为编码不能为空") + private String behaviorCode; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcGetVolunteerRankDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcGetVolunteerRankDTO.java new file mode 100644 index 000000000..5de780bd1 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcGetVolunteerRankDTO.java @@ -0,0 +1,122 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto.epdc.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 志愿者排名 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Data +public class EpdcGetVolunteerRankDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 排名 + */ + private Integer sort; + + /** + * 志愿者ID + */ + private String volunteerId; + + /** + * 用户ID + */ + private String userId; + + /** + * 头像 + */ + private String faceImg; + + /** + * 用户名 + */ + private String nickname; + + /** + * 是否党员(0-否,1-是) + */ + private String partyFlag; + + /** + * 爱心时长(单位:小时) + */ + private BigDecimal kindnessTime; + + /** + * 参加次数 + */ + private Integer participationNum; + + /** + * 排行生成日期 + */ + private Date generateDate; + + /** + * 是否显示(0-不显示,1-显示) + */ + private String showFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标志 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcVolunteerInfoResultDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcVolunteerInfoResultDTO.java new file mode 100644 index 000000000..9b5bc2b5f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcVolunteerInfoResultDTO.java @@ -0,0 +1,157 @@ +package com.elink.esua.epdc.dto.epdc.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +@Data +public class EpdcVolunteerInfoResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 用户ID + */ + private String userId; + + /** + * 姓名 + */ + private String realName; + + /** + * 性别(0-女,1-男) + */ + private String sex; + + /** + * 出生日期 + */ + private Date birthday; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证 + */ + private String identityNo; + + /** + * 爱心时长(单位:分钟) + */ + private Integer kindnessTime; + + /** + * 参加活动次数 + */ + private Integer participationNum; + + + /** + * 网格ID + */ + private Long gridId; + + /** + * 父所有部门ID + */ + private String parentDeptIds; + + /** + * 父所有部门名称 + */ + private String parentDeptNames; + + /** + * 所有部门ID + */ + private String allDeptIds; + + /** + * 所有部门名称 + */ + private String allDeptNames; + + /** + * 所属道路 + */ + private String road; + + /** + * 小区名称 + */ + private String villageName; + + /** + * 住处 + */ + private String dwellingPlace; + + /** + * 居住地址 + */ + private String address; + + /** + * 自我介绍 + */ + private String introduce; + + /** + * 志愿者注册时间 + */ + private Date registTime; + + /** + * 审核状态(0-未审核,1-审核通过,2-审核不通过) + */ + private String auditStatus; + + /** + * 审核不通过的原因 + */ + private String failureReason; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 审核人 + */ + private Long auditor; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/pom.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/pom.xml index c7004cb56..918a33902 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/pom.xml @@ -50,6 +50,16 @@ spring-boot-admin-starter-client ${spring.boot.admin.version} + + com.esua.epdc + epdc-news-client + 1.0.0 + compile + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + @@ -111,7 +121,7 @@ true - + + + 9068 + 47.104.224.45:8848 + 513d6635-3cfe-401f-b8b6-a04417288f47 + EPDC_CONFIG_GROUP + true test - + + + 9068 + 47.104.224.45:8848 + 6a3577b4-7b79-43f6-aebb-9c3f31263f6a + EPDC_CONFIG_GROUP + true diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/UserApplication.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/UserApplication.java index 851d91f25..4407c63d6 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/UserApplication.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/UserApplication.java @@ -1,8 +1,8 @@ /** * Copyright (c) 2018 人人开源 All rights reserved. - * + *

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

* 版权所有,侵权必究! */ diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/async/NewsTask.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/async/NewsTask.java new file mode 100644 index 000000000..256bb52f9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/async/NewsTask.java @@ -0,0 +1,33 @@ +package com.elink.esua.epdc.async; + +import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; +import com.elink.esua.epdc.feign.NewsFeignClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Component; + +/** + * 志愿者审核结果通知消息模块 线程任务 + * + * @author zy + * @date 2019/12/16 15:39 + */ +@Component +public class NewsTask { + + @Autowired + private NewsFeignClient newsFeignClient; + + /** + * 志愿者审核结果,消息推送到app + * + * @param informationDto + * @return void + * @author zy + * @date 2019/12/16 15:39 + */ + @Async + public void insertUserInformation(EpdcInformationFormDTO informationDto) { + newsFeignClient.saveInformation(informationDto); + } +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppUserController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppUserController.java index 2550651a4..d33c1af3f 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppUserController.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppUserController.java @@ -3,17 +3,10 @@ package com.elink.esua.epdc.controller; import com.elink.esua.epdc.commons.tools.constant.Constant; import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.CachingUserInfoDTO; import com.elink.esua.epdc.dto.UserDTO; -import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO; -import com.elink.esua.epdc.dto.epdc.form.EpdcUserRegistFormDTO; import com.elink.esua.epdc.dto.epdc.form.*; import com.elink.esua.epdc.dto.epdc.result.*; -import com.elink.esua.epdc.dto.epdc.result.EpdcResidentDetailResultDTO; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserRegisterInfoResultDTO; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserRegisterAuditMsgResultDTO; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO; -import com.elink.esua.epdc.dto.epdc.result.EpdcWorkUserResultDTO; import com.elink.esua.epdc.enums.AppUserStatesEnum; import com.elink.esua.epdc.service.UserInvitationRecordService; import com.elink.esua.epdc.service.UserService; @@ -250,6 +243,20 @@ public class EpdcAppUserController { return new Result(); } + /** + * 更新用户信息 + * + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @params [userDTO] + * @author liuchuang + * @since 2019/10/25 17:10 + */ + @PostMapping("updateUserInfo") + public Result updateUserInfo(@RequestBody UserDTO userDto) { + userService.update(userDto); + return new Result(); + } + /** * 验证用户完善个人信息时提交的数据,校验成功,返回用户当前状态 * @@ -372,4 +379,30 @@ public class EpdcAppUserController { public Result> queryGroupUsers(@RequestBody List gridIdList) { return userService.listGridUserResultDTO(gridIdList); } + + /** + * 获取用户缓存信息 + * + * @param formDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author rongchao + * @since 2019-12-18 + */ + @PostMapping("needCachingUserInfo") + public Result needCachingUserInfo(@RequestBody EpdcAppQueryUserInfoFormDTO formDTO) { + return userService.queryCachingUserInfo(formDTO); + } + + /** + * 根据用户ID获取用户缓存信息 + * + * @param userId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author rongchao + * @since 2019-12-19 + */ + @GetMapping("needCachingUserInfoByUserId/{userId}") + public Result needCachingUserInfoByUserId(@PathVariable("userId") String userId) { + return userService.cachingUserInfoByUserId(userId); + } } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppVolunteerInfoController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppVolunteerInfoController.java new file mode 100644 index 000000000..99306f05f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppVolunteerInfoController.java @@ -0,0 +1,65 @@ +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.dto.epdc.form.EpdcCompleteVolunteerInfoFormDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; +import com.elink.esua.epdc.service.VolunteerInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 对移动端开放 + * + * @author wanggongfeng + * @date 2019/9/6 20:31 + */ +@RestController +@RequestMapping(Constant.EPDC_APP + "volunteerinfo") +public class EpdcAppVolunteerInfoController { + @Autowired + private VolunteerInfoService volunteerInfoService; + + /** + * 根据用户id 进行志愿者认证 + * @param userId + * @author wanggongfeng + * @return + */ + @GetMapping("getVolunteerCountById/{userId}") + public Result getVolunteerCountById(@PathVariable("userId") String userId) { + return volunteerInfoService.getVolunteerCountById(userId); + } + + /** + * 插入一条志愿者数据 + * @param epdcCompleteVolunteerInfoFormDTO + * @author wanggongfeng + * @return + */ + @GetMapping("insertVolunteerInfo") + public Result insertVolunteerInfo(@RequestBody EpdcCompleteVolunteerInfoFormDTO epdcCompleteVolunteerInfoFormDTO) { + //效验数据 + ValidatorUtils.validateEntity(epdcCompleteVolunteerInfoFormDTO, UpdateGroup.class, DefaultGroup.class); + Result result = volunteerInfoService.insertVolunteerInfo(epdcCompleteVolunteerInfoFormDTO); + return result; + } + + /** + * 获取排行榜数据 + * + * @return + */ + @GetMapping("getRankingList") + public Result> getRankingList() { + return volunteerInfoService.getRankingList(); + } + + + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserController.java index 0a56c1aed..4d44d26b1 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserController.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserController.java @@ -27,6 +27,7 @@ import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; import com.elink.esua.epdc.dto.UserDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcUserPointsFormDTO; import com.elink.esua.epdc.enums.AppUserStatesEnum; import com.elink.esua.epdc.excel.UserExcel; import com.elink.esua.epdc.service.UserService; @@ -34,6 +35,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; import java.util.List; import java.util.Map; @@ -129,4 +131,15 @@ public class UserController { ExcelUtils.exportExcelToTarget(response, fileName, list, UserExcel.class); } + /** + * @param formDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据操作类型更新用户积分 + * @Date 2019/12/13 15:01 + **/ + @PostMapping("handleUserPoints") + public Result handleUserPoints(@RequestBody @Valid EpdcUserPointsFormDTO formDTO) { + return userService.handleUserPoints(formDTO); + } } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/VolunteerInfoController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/VolunteerInfoController.java new file mode 100644 index 000000000..812026284 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/VolunteerInfoController.java @@ -0,0 +1,175 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; +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.UserTagDTO; +import com.elink.esua.epdc.dto.UserTagRelationDTO; +import com.elink.esua.epdc.dto.VolunteerInfoDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO; +import com.elink.esua.epdc.excel.VolunteerInfoExcel; +import com.elink.esua.epdc.service.UserTagRelationService; +import com.elink.esua.epdc.service.UserTagService; +import com.elink.esua.epdc.service.VolunteerInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.Date; +import java.util.List; +import java.util.Map; + + +/** + * 志愿者信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@RestController +@RequestMapping("volunteerinfo") +public class VolunteerInfoController { + + @Autowired + private VolunteerInfoService volunteerInfoService; + + @Autowired + private UserTagService userTagService; //标签表 + + @Autowired + private UserTagRelationService userTagRelationService; //用户标签关系表 + + /** + * @Description: 查询列表数据 + * @Param: [params] + * @return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: zy + * @Date: 2019-12-17 + */ + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = volunteerInfoService.volunteerInfo(params); + return new Result>().ok(page); + } + + /** + * @Description: 根据志愿者ID,查询志愿者 信息详情 + * 积分需要连user表查询 + * @Param: [id] + * @return: com.elink.esua.epdc.commons.tools.utils.Result + * @Author: zy + * @Date: 2019-12-17 + */ + @GetMapping("getVolunteerDetail/{id}") + public Result getVolunteerDetail(@PathVariable("id") String id){ + VolunteerInfoDTO data = volunteerInfoService.getVolunteerDetail(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody VolunteerInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + volunteerInfoService.save(dto); + return new Result(); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + VolunteerInfoDTO data = volunteerInfoService.get(id); + return new Result().ok(data); + } + + /** + * @Description: 志愿者 申请审批 + * 审批不通过、拉入黑名单,清除用户标签关系表,志愿者标签,并进行消息推送 + * @Param: [dto] + * @return: com.elink.esua.epdc.commons.tools.utils.Result + * @Author: zy + * @Date: 2019-12-17 + */ + @PostMapping("volunteerInfoCheck") + public Result volunteerInfoCheck(@RequestBody VolunteerInfoDTO dto){ + Long userId = SecurityUser.getUserId(); + Date date = new Date(); + dto.setAuditor(userId); + dto.setAuditTime(date); + dto.setUpdatedBy(userId.toString()); + dto.setUpdatedTime(date); + + VolunteerInfoDTO data = volunteerInfoService.get(dto.getId());//查询志愿者表,该志愿者的最新信息 + String auditStatus = dto.getAuditStatus(); //申请是否通过 + if (auditStatus.equals("1")){ //通过 + volunteerInfoService.updateVolunteerInfo(dto);//修改志愿者表 是否通过字段及更新时间 + + //向标签表中,查询唯一志愿者标签:tag_code = volunteer + UserTagDTO userTag = volunteerInfoService.volunteerTagQuery("volunteer"); + UserTagRelationDTO userTagRelationDTO = new UserTagRelationDTO(); + userTagRelationDTO.setUserId(data.getUserId()); + userTagRelationDTO.setTagId(userTag.getId()); + userTagRelationService.save(userTagRelationDTO); + }else if (auditStatus.equals("2") || auditStatus.equals("3")){ //不通过/拉黑 + volunteerInfoService.updateVolunteerInfo(dto);//修改志愿者表 字段为:审核人 审核时间 审核状态 审核不通过原因 + userTagRelationService.deleteUserTagRelation(data.getUserId()); + } + return new Result(); + } + + @PutMapping + public Result update(@RequestBody VolunteerInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + volunteerInfoService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + volunteerInfoService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = volunteerInfoService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, VolunteerInfoExcel.class); + } + + /** + * @param id + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 积分调整按钮按下,查询用户信息 + * @Date 2019/12/16 17:48 + **/ + @GetMapping("queryById/{id}") + public Result queryByUserId(@PathVariable("id") String id){ + return volunteerInfoService.getAdjustVolunteerPointsDTO(id); + } + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java index 664a84a27..81118ca86 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java @@ -18,6 +18,7 @@ package com.elink.esua.epdc.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.CachingUserInfoDTO; import com.elink.esua.epdc.dto.UserDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcUnauthorizedAmountFromDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO; @@ -165,4 +166,23 @@ public interface UserDao extends BaseDao { * @Date 2019/12/19 15:05 **/ List selectListGridUserResultDTO(@Param("gridIdList") List gridIdList); + + /** + * @param openId + * @param unionId + * @return com.elink.esua.epdc.dto.CachingUserInfoDTO + * @Author yinzuomei + * @Description 获取用户缓存信息 + * @Date 2019/12/18 14:12 + **/ + CachingUserInfoDTO selectCachingUserInfoDTO(@Param("openId") String openId, @Param("unionId") String unionId); + + /** + * @param userId + * @return com.elink.esua.epdc.dto.CachingUserInfoDTO + * @Author yinzuomei + * @Description 根据用户id查询CachingUserInfoDTO + * @Date 2020/1/15 17:43 + **/ + CachingUserInfoDTO selectCachingUserInfoDTOByUserId(String userId); } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserTagDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserTagDao.java index cccd1945c..17f4fc75f 100755 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserTagDao.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserTagDao.java @@ -18,6 +18,7 @@ package com.elink.esua.epdc.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.UserTagInfo; import com.elink.esua.epdc.entity.UserTagEntity; import org.apache.ibatis.annotations.Mapper; @@ -29,5 +30,15 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface UserTagDao extends BaseDao { - -} \ No newline at end of file + + /** + * @param tagCode + * @return com.elink.esua.epdc.entity.UserTagEntity + * @Author yinzuomei + * @Description 根据标签编码查询信息 + * @Date 2019/12/17 19:17 + **/ + UserTagEntity selectByTagCode(String tagCode); + + UserTagInfo selectByUserId(String userId); +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserTagRelationDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserTagRelationDao.java index 709e558d7..6ddec02ae 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserTagRelationDao.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserTagRelationDao.java @@ -29,5 +29,15 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface UserTagRelationDao extends BaseDao { - + + /** + * 根据user_id 删除 + * 用户标签关系表 + * + * @param userId + * @return void + * @author zy + * @date 2019-12-16 + */ + void deleteUserTagRelation(String userId); } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerInfoDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerInfoDao.java new file mode 100644 index 000000000..c6c4bea0f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerInfoDao.java @@ -0,0 +1,110 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.UserTagDTO; +import com.elink.esua.epdc.dto.VolunteerInfoDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; +import com.elink.esua.epdc.entity.VolunteerInfoEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 志愿者信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Mapper +public interface VolunteerInfoDao extends BaseDao { + /** + * 志愿者申请,根据用户表基础信息 赋默认值 + * @param id + * @return VolunteerInfoDTO + * @author zy + * @date 2019-12-11 + */ + VolunteerInfoDTO getVolunteerUserDefaultValue(String id); + + /** + * 根据查询条件,返回首页 志愿者信息列表 + * @param params + * @return + */ + List volunteerInfoList(Map params); + + /** + * 根据志愿者ID,查询志愿者 单条详情 + * 积分需要连user表查询 + * + * @param id + * @return VolunteerInfoDTO + * @author generator + * @date 2019-12-11 + */ + VolunteerInfoDTO getVolunteerDetail(String id); + + /** + * 根据查询条件,返回首页 志愿者信息列表总数 + * @param params + * @return + */ + int volunteerInfoCount(Map params); + + /** + * 自定义 志愿者表修改方法 + * @param dto + */ + void updateVolunteerInfo(VolunteerInfoDTO dto); + + /** + * 向标签表中,查询唯一志愿者标签:tag_code = volunteer + * @param tagCode + * @return + */ + UserTagDTO volunteerTagQuery(String tagCode); + + /** + * 志愿者认证 + * @param userId + * @return + */ + int getVolunteerCountById(@Param("userId") String userId); + + /** + * @param id + * @return com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO + * @Author yinzuomei + * @Description 积分调整按钮按下, 查询用户信息 + * @Date 2019/12/16 17:54 + **/ + EpdcAdjustVolunteerPointsDTO selectAdjustVolunteerPointsDTO(String id); + + /** + * 获取排行榜 + * @author wanggongfeng + * @return + */ + List getRankingList(); + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyAuthenticationFailedEntity.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyAuthenticationFailedEntity.java index 2691b5b3f..2530a5ec7 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyAuthenticationFailedEntity.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyAuthenticationFailedEntity.java @@ -20,6 +20,7 @@ package com.elink.esua.epdc.entity; import com.baomidou.mybatisplus.annotation.TableName; import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import com.elink.esua.epdc.commons.mybatis.entity.DeptScope; import lombok.Data; import lombok.EqualsAndHashCode; @@ -32,100 +33,80 @@ import java.util.Date; * @since v1.0.0 2019-11-15 */ @Data -@EqualsAndHashCode(callSuper=false) +@EqualsAndHashCode(callSuper = false) @TableName("epdc_party_authentication_failed") -public class PartyAuthenticationFailedEntity extends BaseEpdcEntity { +public class PartyAuthenticationFailedEntity extends DeptScope { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; /** * 姓名 */ - private String realName; + private String realName; /** * 手机号 */ - private String mobile; + private String mobile; /** * 身份证号 */ - private String identityNo; + private String identityNo; /** * 职务 字典表dict_name */ - private String post; + private String post; /** * 职务ID 字典表dict_value */ - private String postValue; + private String postValue; /** * 干部下沉标识 0-否,1-是 */ - private String cadreFlag; + private String cadreFlag; /** * 注册状态 0-否,1-是 */ - private String registFlag; + private String registFlag; /** * 注册时间 */ - private Date registTime; + private Date registTime; /** * 网格名称 */ - private String gridName; + private String gridName; /** * 网格ID */ - private Long gridId; + private Long gridId; /** * 部门ID */ - private Long deptId; + private Long deptId; /** * 状态 0-认证失败 */ - private Integer state; + private String state; /** * 用户ID */ - private String userId; + private String userId; /** * 居民住址 */ - private String address; + private String address; - /*** - *所有部门名称 - */ - private String allDeptNames; - - /*** - *所有部门ID - */ - private String allDeptIds; - - /*** - *父所有部门 - */ - private String parentDeptNames; - - /*** - *父所有部门 - */ - private String parentDeptIds; - -} \ No newline at end of file +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyMembersEntity.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyMembersEntity.java index e0490c6fc..5fe55571d 100755 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyMembersEntity.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyMembersEntity.java @@ -17,13 +17,8 @@ package com.elink.esua.epdc.entity; -import com.baomidou.mybatisplus.annotation.TableId; -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 com.elink.esua.epdc.commons.mybatis.entity.DeptScope; import lombok.Data; import lombok.EqualsAndHashCode; @@ -36,78 +31,60 @@ import java.util.Date; * @since v1.0.0 2019-09-02 */ @Data -@EqualsAndHashCode(callSuper=false) +@EqualsAndHashCode(callSuper = false) @TableName("epdc_party_members") -public class PartyMembersEntity extends BaseEpdcEntity { - private static final long serialVersionUID = 1L; +public class PartyMembersEntity extends DeptScope { + + private static final long serialVersionUID = 1L; /** * 姓名 */ - private String realName; + private String realName; /** * 手机号 */ - private String mobile; + private String mobile; /** * 身份证号 */ - private String identityNo; + private String identityNo; /** * 职务 */ - private String post; + private String post; /** * 职务ID(字典表) */ - private String postValue; + private String postValue; /** * 干部下沉标识(0-否,1-是) */ - private String cadreFlag; + private String cadreFlag; /** * 注册状态(0-否,1-是) */ - private String registFlag; + private String registFlag; /** * 注册时间 */ - private Date registTime; + private Date registTime; /** * 网格名称 */ - private String gridName; + private String gridName; /** * 网格ID */ - private long gridId; + private long gridId; /** * 部门ID */ - private long deptId; - /*** - *所有部门名称 - */ - private String allDeptNames; - - /*** - *所有部门ID - */ - private String allDeptIds; + private long deptId; - /*** - *父所有部门 - */ - private String parentDeptNames; - - /*** - *父所有部门 - */ - private String parentDeptIds; - - /*** - * 所在党委 - */ - private String partyOrganization; + /*** + * 所在党委 + */ + private String partyOrganization; } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserAuthenticateHistoryEntity.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserAuthenticateHistoryEntity.java index d8c063b5e..3a3b14bf5 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserAuthenticateHistoryEntity.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserAuthenticateHistoryEntity.java @@ -32,45 +32,45 @@ import java.util.Date; * @since v1.0.0 2019-11-21 */ @Data -@EqualsAndHashCode(callSuper=false) +@EqualsAndHashCode(callSuper = false) @TableName("epdc_user_authenticate_history") public class UserAuthenticateHistoryEntity extends BaseEpdcEntity { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; /** * 用户ID */ - private String userId; + private String userId; /** * 手机号 */ - private String mobile; + private String mobile; /** * 姓名 */ - private String realName; + private String realName; /** * 居民地址 */ - private String address; + private String address; /** * 是否认证通过 0未通过1通过 */ - private String authenticatedFlag; + private String authenticatedFlag; /** - * 审核备注 + * 认证类别(0-居民认证,1-党员认证,2-志愿者认证) */ - private String remark; + private String authenticatedType; - /** - * 认证类别(0-居民认证,1-党员认证,2-志愿者认证) - */ - private String authenticatedType; + /** + * 审核备注 + */ + private String remark; -} \ No newline at end of file +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserEntity.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserEntity.java index c1ae65855..f3707b436 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserEntity.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserEntity.java @@ -20,6 +20,7 @@ package com.elink.esua.epdc.entity; import com.baomidou.mybatisplus.annotation.TableName; import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import com.elink.esua.epdc.commons.mybatis.entity.DeptScope; import lombok.Data; import lombok.EqualsAndHashCode; @@ -32,9 +33,9 @@ import java.util.Date; * @since v1.0.0 2019-09-02 */ @Data -@EqualsAndHashCode(callSuper=false) +@EqualsAndHashCode(callSuper = false) @TableName("epdc_user") -public class UserEntity extends BaseEpdcEntity { +public class UserEntity extends DeptScope { private static final long serialVersionUID = -6047044658708037479L; @@ -233,24 +234,4 @@ public class UserEntity extends BaseEpdcEntity { * 居住网格id */ private Long deptId; - - /** - * 父所有部门 - */ - private String parentDeptIds; - - /** - * 父所有部门 - */ - private String parentDeptNames; - - /** - * 所有部门ID - */ - private String allDeptIds; - - /** - * 所有部门名称 - */ - private String allDeptNames; } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserGridRelationEntity.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserGridRelationEntity.java index 1addcae49..02d9ea3eb 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserGridRelationEntity.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserGridRelationEntity.java @@ -20,6 +20,7 @@ package com.elink.esua.epdc.entity; import com.baomidou.mybatisplus.annotation.TableName; import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import com.elink.esua.epdc.commons.mybatis.entity.DeptScope; import lombok.Data; import lombok.EqualsAndHashCode; @@ -32,54 +33,35 @@ import java.util.Date; * @since v1.0.0 2019-10-23 */ @Data -@EqualsAndHashCode(callSuper=false) +@EqualsAndHashCode(callSuper = false) @TableName("epdc_user_grid_relation") -public class UserGridRelationEntity extends BaseEpdcEntity { +public class UserGridRelationEntity extends DeptScope { - private static final long serialVersionUID = 8308463158510832072L; + private static final long serialVersionUID = 8308463158510832072L; /** * 用户ID */ - private String userId; + private String userId; /** * 所属网格 */ - private String grid; + private String grid; /** * 网格ID */ - private Long gridId; + private Long gridId; /** * 最后切换此网格的时间 */ - private Date switchedTime; + private Date switchedTime; /** * 是否是网格长 0否1是 */ private String leaderFlag; - /*** - *所有部门名称 - */ - private String allDeptNames; - - /*** - *所有部门ID - */ - private String allDeptIds; - - /*** - *父所有部门 - */ - private String parentDeptNames; - - /*** - *父所有部门 - */ - private String parentDeptIds; } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserTagEntity.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserTagEntity.java index 4c2e99203..a108b6b9e 100755 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserTagEntity.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserTagEntity.java @@ -45,6 +45,12 @@ public class UserTagEntity extends BaseEpdcEntity { * 标签名 */ private String tagName; + + /** + * 标签编码 + */ + private String tagCode; + /** * 标签描述 */ diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/VolunteerInfoEntity.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/VolunteerInfoEntity.java new file mode 100644 index 000000000..cf4e9c810 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/VolunteerInfoEntity.java @@ -0,0 +1,157 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 志愿者信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_volunteer_info") +public class VolunteerInfoEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private String userId; + + /** + * 姓名 + */ + private String realName; + + /** + * 性别(0-女,1-男) + */ + private String sex; + + /** + * 出生日期 + */ + private Date birthday; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证 + */ + private String identityNo; + + /** + * 爱心时长(单位:分钟) + */ + private Integer kindnessTime; + + /** + * 参加活动次数 + */ + private Integer participationNum; + + + /** + * 网格ID + */ + private Long gridId; + + /** + * 父所有部门ID + */ + private String parentDeptIds; + + /** + * 父所有部门名称 + */ + private String parentDeptNames; + + /** + * 所有部门ID + */ + private String allDeptIds; + + /** + * 所有部门名称 + */ + private String allDeptNames; + + /** + * 所属道路 + */ + private String road; + + /** + * 小区名称 + */ + private String villageName; + + /** + * 住处 + */ + private String dwellingPlace; + + /** + * 居住地址 + */ + private String address; + + /** + * 自我介绍 + */ + private String introduce; + + /** + * 志愿者注册时间 + */ + private Date registTime; + + /** + * 审核状态(0-未审核,1-审核通过,2-审核不通过) + */ + private String auditStatus; + + /** + * 审核不通过的原因 + */ + private String failureReason; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 审核人 + */ + private Long auditor; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/VolunteerInfoExcel.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/VolunteerInfoExcel.java new file mode 100644 index 000000000..403771953 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/VolunteerInfoExcel.java @@ -0,0 +1,125 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 志愿者信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class VolunteerInfoExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "姓名") + private String realName; + + @Excel(name = "性别(0-女,1-男)") + private String sex; + + @Excel(name = "出生日期") + private Date birthday; + + @Excel(name = "手机号") + private String mobile; + + @Excel(name = "身份证") + private String identityNo; + + @Excel(name = "爱心时长(单位:分钟)") + private Integer kindnessTime; + + @Excel(name = "参加活动次数") + private Integer participationNum; + + @Excel(name = "积分") + private Integer points; + + @Excel(name = "网格ID") + private Long gridId; + + @Excel(name = "父所有部门ID") + private String parentDeptIds; + + @Excel(name = "父所有部门名称") + private String parentDeptNames; + + @Excel(name = "所有部门ID") + private String allDeptIds; + + @Excel(name = "所有部门名称") + private String allDeptNames; + + @Excel(name = "所属道路") + private String road; + + @Excel(name = "小区名称") + private String villageName; + + @Excel(name = "住处") + private String dwellingPlace; + + @Excel(name = "居住地址") + private String address; + + @Excel(name = "自我介绍") + private String introduce; + + @Excel(name = "志愿者注册时间") + private Date registTime; + + @Excel(name = "审核状态(0-未审核,1-审核通过,2-审核不通过)") + private String auditStatus; + + @Excel(name = "审核不通过的原因") + private String failureReason; + + @Excel(name = "审核时间") + private Date auditTime; + + @Excel(name = "审核人") + private Long auditor; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/feign/NewsFeignClient.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/feign/NewsFeignClient.java new file mode 100644 index 000000000..437288959 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/feign/NewsFeignClient.java @@ -0,0 +1,32 @@ +package com.elink.esua.epdc.feign; + +import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; +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.NewsFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +/** + * 志愿者审核结果通知消息模块 线程任务 + * + * @author zy + * @date 2019/12/16 15:39 + */ +@FeignClient(name = ServiceConstant.EPDC_NEWS_SERVER, fallback = NewsFeignClientFallback.class) +public interface NewsFeignClient { + + /** + * 志愿者审核结果,消息推送到app + * + * @param formDto + * @return void + * @author zy + * @date 2019/12/16 15:39 + */ + @PostMapping(value = "news/epdc-app/information/save", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result saveInformation(@RequestBody EpdcInformationFormDTO formDto); + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/feign/fallback/NewsFeignClientFallback.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/feign/fallback/NewsFeignClientFallback.java new file mode 100644 index 000000000..9965e8667 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/feign/fallback/NewsFeignClientFallback.java @@ -0,0 +1,23 @@ +package com.elink.esua.epdc.feign.fallback; + +import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; +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.NewsFeignClient; +import org.springframework.stereotype.Component; + +/** + * 志愿者审核结果通知消息模块 线程任务 + * + * @author zy + * @date 2019/12/16 15:39 + */ +@Component +public class NewsFeignClientFallback implements NewsFeignClient { + + @Override + public Result saveInformation(EpdcInformationFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_NEWS_SERVER, "saveInformation", formDto); + } +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/redis/VolunteerInfoRedis.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/redis/VolunteerInfoRedis.java new file mode 100644 index 000000000..1c5d99cf0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/redis/VolunteerInfoRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 志愿者信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Component +public class VolunteerInfoRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PartyMembersService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PartyMembersService.java index d2385904c..a1b3d69fe 100755 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PartyMembersService.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PartyMembersService.java @@ -70,6 +70,17 @@ public interface PartyMembersService extends BaseService { */ Result insertPartyList(MultipartFile file); + /** + * 根据身份证号和姓名获取党员数量 + * + * @param identityNo + * @param realName + * @return int + * @author rongchao + * @since 2019-12-18 + */ + int countPartyMemberByIdNoAndRealName(String identityNo, String realName); + /*** * 已认证党员 * @param params diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java index 1df248fcc..4e792a51a 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java @@ -20,17 +20,10 @@ 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.utils.Result; +import com.elink.esua.epdc.dto.CachingUserInfoDTO; import com.elink.esua.epdc.dto.UserDTO; -import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO; -import com.elink.esua.epdc.dto.epdc.form.EpdcUserRegistFormDTO; import com.elink.esua.epdc.dto.epdc.form.*; -import com.elink.esua.epdc.dto.epdc.result.EpdcResidentDetailResultDTO; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserRegisterInfoResultDTO; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserRegisterAuditMsgResultDTO; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO; import com.elink.esua.epdc.dto.epdc.result.*; -import com.elink.esua.epdc.dto.epdc.result.EpdcWorkUserResultDTO; import com.elink.esua.epdc.entity.UserEntity; import java.util.List; @@ -203,28 +196,32 @@ public interface UserService extends BaseService { /** * 获取居民详情(已认证或待认证(提交信息待审核)的居民用户) + * * @param userId 用户Id * @return */ - Result residentDetail(String userId); + Result residentDetail(String userId); /** * 获取党员详情(已认证或未认证的党员用户) + * * @param userId * @return */ - Result partyMemberDetail(String userId); + Result partyMemberDetail(String userId); /** * 认证用户(用户信息审核) + * * @param formDTO * @return */ Result authenticateResident(EpdcAppAuthenticateResidentFormDTO formDTO); + /*** * 获取用户列表 * @param workUserFromDto - * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @return com.elink.esua.epdc.commons.tools.utils.Result> * @author qushutong * @date 2019/11/18 14:00 */ @@ -240,11 +237,10 @@ public interface UserService extends BaseService { Result getUnauthorizedAmount(EpdcUnauthorizedAmountFromDTO fromDto); /** - * * 获取用户最后一次切换的网格信息 * - * @params [openId] * @return com.elink.esua.epdc.commons.tools.utils.Result + * @params [openId] * @author liuchuang * @since 2019/12/6 10:59 */ @@ -267,4 +263,30 @@ public interface UserService extends BaseService { * @Date 2019/12/19 15:03 **/ Result> listGridUserResultDTO(List gridIdList); + + /** + * @param formDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 获取用户缓存信息 + * @Date 2019/12/18 14:01 + **/ + Result queryCachingUserInfo(EpdcAppQueryUserInfoFormDTO formDTO); + + /** + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据操作类型更新用户积分 + * @Date 2019/12/13 15:10 + **/ + Result handleUserPoints(EpdcUserPointsFormDTO formDTO); + + /** + * @param userId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 获取用户缓存信息 + * @Date 2020/1/15 17:40 + **/ + Result cachingUserInfoByUserId(String userId); } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserTagRelationService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserTagRelationService.java index d83e1d196..3c069a590 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserTagRelationService.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserTagRelationService.java @@ -92,4 +92,15 @@ public interface UserTagRelationService extends BaseService + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.UserTagDTO; +import com.elink.esua.epdc.dto.VolunteerInfoDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcCompleteVolunteerInfoFormDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; +import com.elink.esua.epdc.entity.VolunteerInfoEntity; + +import java.util.List; +import java.util.Map; + +/** + * 志愿者信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +public interface VolunteerInfoService extends BaseService { + + /** + * 根据查询条件,返回首页 志愿者信息列表,分页 + * @param params + * @return + */ + PageData volunteerInfo(Map params); + + /** + * 根据志愿者ID,查询志愿者 单条详情 + * 积分需要连user表查询 + * @param id + * @return VolunteerInfoDTO + * @author generator + * @date 2019-12-11 + */ + VolunteerInfoDTO getVolunteerDetail(String id); + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-11 + */ + PageData page(Map params); + + /** + * 自定义 志愿者表修改方法 + * @param dto + */ + void updateVolunteerInfo(VolunteerInfoDTO dto); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-11 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return VolunteerInfoDTO + * @author generator + * @date 2019-12-11 + */ + VolunteerInfoDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-11 + */ + void save(VolunteerInfoDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-11 + */ + void update(VolunteerInfoDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-11 + */ + void delete(String[] ids); + + + /** + * 志愿者申请,根据用户表基础信息 赋默认值 + * @param id + * @return VolunteerInfoDTO + * @author zy + * @date 2019-12-11 + */ + Result getVolunteerUserDefaultValue(String id); + + /** + * 向标签表中,查询唯一志愿者标签:tag_code = volunteer + * @param tagCode + * @return + */ + UserTagDTO volunteerTagQuery(String tagCode); + + /** + * 根据用户id 进行志愿者认证 + * @param userId + * @author wanggongfeng + * @return + * @Date 2019/12/13 16:39 + */ + Result getVolunteerCountById(String userId); + + /** + * 插入一条志愿者数据 + * @param epdcCompleteVolunteerInfoFormDTO + * @author wanggongfeng + * @return + */ + Result insertVolunteerInfo(EpdcCompleteVolunteerInfoFormDTO epdcCompleteVolunteerInfoFormDTO); + + /** + * @param userId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 积分调整按钮按下,查询用户信息 + * @Date 2019/12/16 17:48 + **/ + Result getAdjustVolunteerPointsDTO(String userId); + + /** + * 获取排行榜 + * @author wanggongfeng + * @return + */ + Result> getRankingList(); + + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PartyMembersServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PartyMembersServiceImpl.java index 906c7fb56..2f0ec12dd 100755 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PartyMembersServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PartyMembersServiceImpl.java @@ -33,6 +33,7 @@ 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.utils.Result; import com.elink.esua.epdc.config.StreamUtils; +import com.elink.esua.epdc.constant.UserFieldConsant; import com.elink.esua.epdc.dao.PartyMembersDao; import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; import com.elink.esua.epdc.dto.PartyMembersDTO; @@ -69,6 +70,7 @@ public class PartyMembersServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -85,6 +87,7 @@ public class PartyMembersServiceImpl extends BaseServiceImpl list = baseDao.pageDIY(params); return new Result>().ok(new PageData<>(list, page.getTotal())); } + @Override public Result> hasAuthenticationPartyPage(Map params) { IPage page = getPage(params); @@ -109,9 +112,9 @@ public class PartyMembersServiceImpl extends BaseServiceImpl parentResult = null; - if(dto.getAllDeptIds()!=null&&dto.getAllDeptIds().length>1){ - parentResult = adminFeignClient.getParentAndAllDept(dto.getAllDeptIds()[dto.getAllDeptIds().length-1]); + if (dto.getAllDeptIds() != null && dto.getAllDeptIds().length > 1) { + parentResult = adminFeignClient.getParentAndAllDept(dto.getAllDeptIds()[dto.getAllDeptIds().length - 1]); } - if(parentResult!=null){ + if (parentResult != null) { if (!parentResult.success() || parentResult.getData() == null) { throw new RenException("获取部门信息失败"); - }else { + } else { ParentAndAllDeptDTO deptDTO = parentResult.getData(); entity.setAllDeptIds(deptDTO.getAllDeptIds()); entity.setAllDeptNames(deptDTO.getAllDeptNames()); entity.setParentDeptIds(deptDTO.getParentDeptIds()); entity.setParentDeptNames(deptDTO.getParentDeptNames()); - entity.setGridId(Long.valueOf(dto.getAllDeptIds()[dto.getAllDeptIds().length-1])); + entity.setGridId(Long.valueOf(dto.getAllDeptIds()[dto.getAllDeptIds().length - 1])); String[] split = deptDTO.getAllDeptNames().split("-"); - entity.setGridName(split[split.length-1]); + entity.setGridName(split[split.length - 1]); } } insert(entity); @@ -159,10 +162,10 @@ public class PartyMembersServiceImpl extends BaseServiceImpl parentResult = adminFeignClient.getParentAndAllDept(String.valueOf(allDeptIds[allDeptIds.length-1])); + Result parentResult = adminFeignClient.getParentAndAllDept(String.valueOf(allDeptIds[allDeptIds.length - 1])); if (!parentResult.success() || parentResult.getData() == null) { throw new RenException("获取部门信息失败"); - }else { + } else { ParentAndAllDeptDTO deptDTO = parentResult.getData(); entity.setAllDeptIds(deptDTO.getAllDeptIds()); entity.setAllDeptNames(deptDTO.getAllDeptNames()); @@ -196,7 +199,7 @@ public class PartyMembersServiceImpl extends BaseServiceImpl partyList) { List partyMembersEntityList = ConvertUtils.sourceToTarget(partyList, PartyMembersEntity.class); - for (int i=0;i partyList = ExcelImportUtil.importExcel(f, PartyMembersExcel.class, importParams); // 校验数据 List epdcPartyErroyResultDtos = this.checkExcel(partyList, partyMembersEntityList); - if(epdcPartyErroyResultDtos.size()>0){ + if (epdcPartyErroyResultDtos.size() > 0) { return new Result().ok(epdcPartyErroyResultDtos); } saveList(partyList); @@ -230,6 +233,14 @@ public class PartyMembersServiceImpl extends BaseServiceImpl partyWrapper = new QueryWrapper<>(); + partyWrapper.eq(UserFieldConsant.IDENTITY_NO, identityNo) + .eq(UserFieldConsant.REAL_NAME, realName); + return baseDao.selectCount(partyWrapper); + } + /*** * 校验excel表格数据 * @param partyList @@ -240,35 +251,35 @@ public class PartyMembersServiceImpl extends BaseServiceImpl checkExcel(List partyList, List partyMembersEntityList) { // 不匹配信息 - List errorLineinfoList=new ArrayList<>(); + List errorLineinfoList = new ArrayList<>(); EpdcPartyErroyResultDTO errorLineinfoDto; for (int i = 0; i < partyList.size(); i++) { PartyMembersExcel partyMembersExcel = partyList.get(i); String realName = partyMembersExcel.getRealName(); String mobile = partyMembersExcel.getMobile(); - String identityNo=partyMembersExcel.getIdentityNo(); + String identityNo = partyMembersExcel.getIdentityNo(); if (StringUtils.isBlank(realName)) { - errorLineinfoDto=new EpdcPartyErroyResultDTO(); - errorLineinfoDto.setErroLine((i+2)+""); + errorLineinfoDto = new EpdcPartyErroyResultDTO(); + errorLineinfoDto.setErroLine((i + 2) + ""); errorLineinfoDto.setErrorInfo("姓名为空"); errorLineinfoList.add(errorLineinfoDto); } if (StringUtils.isBlank(identityNo)) { - errorLineinfoDto=new EpdcPartyErroyResultDTO(); - errorLineinfoDto.setErroLine((i+2)+""); + errorLineinfoDto = new EpdcPartyErroyResultDTO(); + errorLineinfoDto.setErroLine((i + 2) + ""); errorLineinfoDto.setErrorInfo("身份证号为空"); errorLineinfoList.add(errorLineinfoDto); } - for (PartyMembersEntity item:partyMembersEntityList) { - if(StringUtils.isNotBlank(item.getMobile())&&item.getMobile().equals(mobile)){ - errorLineinfoDto=new EpdcPartyErroyResultDTO(); - errorLineinfoDto.setErroLine((i+2)+""); + for (PartyMembersEntity item : partyMembersEntityList) { + if (StringUtils.isNotBlank(item.getMobile()) && item.getMobile().equals(mobile)) { + errorLineinfoDto = new EpdcPartyErroyResultDTO(); + errorLineinfoDto.setErroLine((i + 2) + ""); errorLineinfoDto.setErrorInfo("手机号已存在"); errorLineinfoList.add(errorLineinfoDto); } - if(item.getIdentityNo().equals(identityNo)){ - errorLineinfoDto=new EpdcPartyErroyResultDTO(); - errorLineinfoDto.setErroLine((i+2)+""); + if (item.getIdentityNo().equals(identityNo)) { + errorLineinfoDto = new EpdcPartyErroyResultDTO(); + errorLineinfoDto.setErroLine((i + 2) + ""); errorLineinfoDto.setErrorInfo("身份证号已存在"); errorLineinfoList.add(errorLineinfoDto); } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java index b15ca5226..e18703c06 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java @@ -21,44 +21,37 @@ import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; 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.mybatis.utils.DeptEntityUtils; import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.enums.UserAuthTypeEnum; import com.elink.esua.epdc.commons.tools.enums.UserSexEnum; +import com.elink.esua.epdc.commons.tools.enums.UserTagEnum; import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; +import com.elink.esua.epdc.commons.tools.enums.pointsenum.PointsOperationEnum; import com.elink.esua.epdc.commons.tools.exception.RenException; import com.elink.esua.epdc.commons.tools.page.PageData; -import com.elink.esua.epdc.commons.tools.redis.UserDetailRedis; import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; -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.utils.MessageUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.constant.AuthenticatedConsant; import com.elink.esua.epdc.constant.UserFieldConsant; -import com.elink.esua.epdc.dao.PartyAuthenticationFailedDao; -import com.elink.esua.epdc.dao.PartyMembersDao; -import com.elink.esua.epdc.dao.UserAuthenticateHistoryDao; -import com.elink.esua.epdc.dao.UserDao; +import com.elink.esua.epdc.dao.*; +import com.elink.esua.epdc.dto.CachingUserInfoDTO; import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; import com.elink.esua.epdc.dto.UserDTO; -import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO; -import com.elink.esua.epdc.dto.epdc.form.EpdcUserRegistFormDTO; -import com.elink.esua.epdc.dto.epdc.result.*; import com.elink.esua.epdc.dto.UserGridRelationDTO; import com.elink.esua.epdc.dto.epdc.EpdcCompleteAppUserDTO; import com.elink.esua.epdc.dto.epdc.EpdcGridLeaderRegisterDTO; import com.elink.esua.epdc.dto.epdc.form.*; -import com.elink.esua.epdc.dto.epdc.result.EpdcResidentDetailResultDTO; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserRegisterInfoResultDTO; +import com.elink.esua.epdc.dto.epdc.result.*; import com.elink.esua.epdc.entity.*; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserRegisterAuditMsgResultDTO; -import com.elink.esua.epdc.dto.epdc.result.EpdcWorkUserResultDTO; import com.elink.esua.epdc.enums.AppUserAuditStateEnum; import com.elink.esua.epdc.enums.AppUserStatesEnum; -import com.elink.esua.epdc.exception.UserModuleErrorCode; import com.elink.esua.epdc.feign.AdminFeignClient; +import com.elink.esua.epdc.service.PartyMembersService; import com.elink.esua.epdc.service.UserGridRelationService; import com.elink.esua.epdc.service.UserInvitationRecordService; import com.elink.esua.epdc.service.UserService; @@ -67,7 +60,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.*; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Map; /** * 用户信息表 @@ -78,30 +74,38 @@ import java.util.*; @Service public class UserServiceImpl extends BaseServiceImpl implements UserService { - @Autowired - private PartyMembersDao partyMembersDao; @Autowired private UserGridRelationService userGridRelationService; @Autowired - private UserAuthenticateHistoryDao userAuthenticateHistoryDao; + private UserInvitationRecordService userInvitationRecordService; @Autowired - private UserInvitationRecordService userInvitationRecordService; + private PartyMembersService partyMembersService; + @Autowired - private UserDetailRedis userDetailRedis; + private PartyMembersDao partyMembersDao; + @Autowired - private AdminFeignClient adminFeignClient; + private UserAuthenticateHistoryDao userAuthenticateHistoryDao; + @Autowired private PartyAuthenticationFailedDao partyAuthenticationFailedDao; + @Autowired + private UserTagDao userTagDao; + + @Autowired + private UserTagRelationDao userTagRelationDao; + + @Autowired + private AdminFeignClient adminFeignClient; + @Override public PageData page(Map params) { this.verifyParams(params); Long userId = SecurityUser.getUserId(); - // 查询当前用户所具有的的数据权限 - UserDetail userDetail = userDetailRedis.get(userId); IPage iPage = this.getPage(params); List userDtoList = this.baseDao.selectListUserDto(params); return new PageData<>(userDtoList, iPage.getTotal()); @@ -349,7 +353,7 @@ public class UserServiceImpl extends BaseServiceImpl implem userEntity.setFaceImg(null); userEntity.setId(userId); //用户已绑定手机号时不更新手机号 - if(StringUtils.isNotBlank(existUser.getMobile())){ + if (StringUtils.isNotBlank(existUser.getMobile())) { userEntity.setMobile(existUser.getMobile()); } this.updateById(userEntity); @@ -487,7 +491,7 @@ public class UserServiceImpl extends BaseServiceImpl implem if (selectCount > NumConstant.ZERO) { return new Result().error("手机号已被注册"); } - //党员都需要查重 + //党员都需要查重 if (YesOrNoEnum.YES.value().equals(userDto.getPartyFlag())) { userWrapper = new QueryWrapper<>(); userWrapper.eq(UserFieldConsant.IDENTITY_NO, userDto.getIdentityNo()) @@ -501,113 +505,331 @@ public class UserServiceImpl extends BaseServiceImpl implem return new Result().ok(userEntity.getState()); } - @Override - @Transactional(rollbackFor = Exception.class) - public Result completeUserInfo(EpdcAppUserCompleteInfoFormDTO formDto) { - Result result = new Result(); - EpdcCompleteAppUserDTO completeAppUser = formDto.getCompleteAppUser(); + /** + * 生成党员认证失败记录 + * + * @param dto + * @param userGridRelationDTO + * @param parentAndAllDeptDTO + * @return boolean + * @author rongchao + * @since 2019-12-19 + */ + private boolean generatePartyAuthenticationFailedRecord(EpdcCompleteAppUserDTO dto, UserGridRelationDTO userGridRelationDTO, ParentAndAllDeptDTO parentAndAllDeptDTO) { + PartyAuthenticationFailedEntity authenticationFailedEntity = ConvertUtils.sourceToTarget(dto, PartyAuthenticationFailedEntity.class); + // 装载部门冗余信息 + DeptEntityUtils.loadDeptInfo( + ConvertUtils.sourceToTarget(parentAndAllDeptDTO, DeptEntityUtils.DeptDto.class), + authenticationFailedEntity + ); + authenticationFailedEntity.setUserId(dto.getId()); + authenticationFailedEntity.setState(dto.getState()); + authenticationFailedEntity.setAddress(dto.getAddress()); + authenticationFailedEntity.setDeptId(dto.getDeptId()); + authenticationFailedEntity.setGridId(userGridRelationDTO.getGridId()); + authenticationFailedEntity.setGridName(userGridRelationDTO.getGrid()); + authenticationFailedEntity.setRegistTime(new Date()); + authenticationFailedEntity.setRegistFlag(YesOrNoEnum.YES.value()); + authenticationFailedEntity.setIdentityNo(dto.getIdentityNo()); + authenticationFailedEntity.setMobile(dto.getMobile()); + authenticationFailedEntity.setRealName(dto.getRealName()); + return SqlHelper.retBool(partyAuthenticationFailedDao.insert(authenticationFailedEntity)); + } - UserDTO userDto = ConvertUtils.sourceToTarget(completeAppUser, UserDTO.class); - if (StringUtils.isBlank(userDto.getWxUnionId())) { - userDto.setWxUnionId(null); + /** + * 生成认证历史 + * + * @param completeAppUser + * @param userAuthTypeEnum + * @param yesOrNoEnum + * @param remark + * @return boolean + * @author rongchao + * @since 2019-12-19 + */ + private boolean generateUserAuthenticateHistory(EpdcCompleteAppUserDTO completeAppUser, UserAuthTypeEnum userAuthTypeEnum, YesOrNoEnum yesOrNoEnum, String remark) { + UserAuthenticateHistoryEntity userAuthenticateHistoryEntity = new UserAuthenticateHistoryEntity(); + userAuthenticateHistoryEntity.setUserId(completeAppUser.getId()); + userAuthenticateHistoryEntity.setMobile(completeAppUser.getMobile()); + userAuthenticateHistoryEntity.setRealName(completeAppUser.getRealName()); + userAuthenticateHistoryEntity.setAddress(completeAppUser.getAddress()); + userAuthenticateHistoryEntity.setAuthenticatedType(userAuthTypeEnum.value()); + userAuthenticateHistoryEntity.setAuthenticatedFlag(yesOrNoEnum.value()); + if (StringUtils.isNotEmpty(remark)) { + userAuthenticateHistoryEntity.setRemark(remark); } + return SqlHelper.retBool(userAuthenticateHistoryDao.insert(userAuthenticateHistoryEntity)); + } + + /** + * 更新党员库信息 + * + * @param parentAndAllDeptDTO + * @param formDto + * @return boolean + * @author rongchao + * @since 2019-12-19 + */ + private boolean modifyPartyMembers(ParentAndAllDeptDTO parentAndAllDeptDTO, EpdcAppUserCompleteInfoFormDTO formDto) { + PartyMembersEntity partyMembersEntity = DeptEntityUtils.loadDeptInfo( + ConvertUtils.sourceToTarget(parentAndAllDeptDTO, DeptEntityUtils.DeptDto.class), + PartyMembersEntity.class + ); + EpdcCompleteAppUserDTO completeAppUser = formDto.getCompleteAppUser(); UserGridRelationDTO userGridRelation = formDto.getUserGridRelation(); + partyMembersEntity.setGridId(userGridRelation.getGridId()); + partyMembersEntity.setGridName(userGridRelation.getGrid()); + partyMembersEntity.setRegistFlag(YesOrNoEnum.YES.value()); + partyMembersEntity.setRegistTime(new Date()); + UpdateWrapper partyUpdate = new UpdateWrapper<>(); + partyUpdate.eq(UserFieldConsant.IDENTITY_NO, completeAppUser.getIdentityNo()) + .eq(UserFieldConsant.REAL_NAME, completeAppUser.getRealName()); + return SqlHelper.retBool(partyMembersDao.update(partyMembersEntity, partyUpdate)); + } - String userId = userDto.getId(); + /** + * 修改居民信息 + * + * @param completeAppUser + * @param userGridRelation + * @param parentAndAllDeptDTO + * @return com.elink.esua.epdc.entity.UserEntity + * @author rongchao + * @since 2019-12-19 + */ + private UserEntity modifyResidentInfo(EpdcCompleteAppUserDTO completeAppUser, UserGridRelationDTO userGridRelation, ParentAndAllDeptDTO parentAndAllDeptDTO) { + UserEntity userEntity = ConvertUtils.sourceToTarget(completeAppUser, UserEntity.class); + if (StringUtils.isBlank(userEntity.getWxUnionId())) { + userEntity.setWxUnionId(null); + } + String userId = completeAppUser.getId(); UserEntity oldEntity = this.baseDao.selectById(userId); + if (oldEntity.getState().equals(AppUserStatesEnum.STATE_INFORMATION_NOT_PASSED.value())) { + userEntity.setState(AppUserStatesEnum.STATE_COMPLETED_INFORMATION_PENDING_REVIEW.value()); + } + //返回网格长标识信息 + UserGridRelationDTO relationInfo = userGridRelationService.getUserRelationInfo(completeAppUser.getId(), userGridRelation.getGridId()); + String nicknamePrefix = completeAppUser.getRoad().concat("-"); + if (relationInfo != null && NumConstant.ZERO_STR.equals(relationInfo.getLeaderFlag())) { + } + // 姓 + String lastName = completeAppUser.getRealName().substring(NumConstant.ZERO, NumConstant.ONE); + userEntity.setLastName(lastName); + userEntity.setNickname(nicknamePrefix.concat(lastName).concat(UserSexEnum.FEMALE.sex().equals(userEntity.getSex()) ? "女士" : "先生")); + + //保存用户居住地所在网格,及其他冗余字段。 + DeptEntityUtils.loadDeptInfo( + ConvertUtils.sourceToTarget(parentAndAllDeptDTO, DeptEntityUtils.DeptDto.class), + userEntity + ); + if (!updateById(userEntity)) { + throw new RenException("用户认证修改居民信息时失败!"); + } + UserDTO userDTO = ConvertUtils.sourceToTarget(userEntity, UserDTO.class); + userDTO.setLeaderFlag(relationInfo.getLeaderFlag()); + return userEntity; + } - // 身份证号 - String identityNo = userDto.getIdentityNo(); + /** + * 生成用户身份标签 + * + * @param userId + * @return boolean + * @author rongchao + * @since 2019-12-19 + */ + private boolean generateUserTag(String userId) { + UserTagEntity userTagEntity = userTagDao.selectByTagCode(UserTagEnum.PARTY_MEMBER.value()); + UserTagRelationEntity userTagRelationEntity = new UserTagRelationEntity(); + userTagRelationEntity.setTagId(userTagEntity.getId()); + userTagRelationEntity.setUserId(userId); + return SqlHelper.retBool(userTagRelationDao.insert(userTagRelationEntity)); + } + + /** + * 根据网格ID获取冗余的组织机构信息 + * + * @param + * @return com.elink.esua.epdc.dto.ParentAndAllDeptDTO + * @author rongchao + * @since 2019-12-19 + */ + private ParentAndAllDeptDTO getParentAndAllDeptDTO(String gridId) { + // 获取组织结构冗余信息 + Result parentAndAllDeptDTOResult = adminFeignClient.getParentAndAllDept(gridId); + ParentAndAllDeptDTO parentAndAllDeptDTO = parentAndAllDeptDTOResult.getData(); - Result parentAndAllDeptDTOResult = adminFeignClient.getParentAndAllDept(String.valueOf(userGridRelation.getGridId())); if (!parentAndAllDeptDTOResult.success()) { - return new Result().error(parentAndAllDeptDTOResult.getMsg()); + throw new RenException(parentAndAllDeptDTOResult.getMsg()); } - if (YesOrNoEnum.YES.value().equals(userDto.getPartyFlag())) { - PartyMembersEntity partyMembersEntity = new PartyMembersEntity(); - partyMembersEntity.setAllDeptNames(parentAndAllDeptDTOResult.getData().getAllDeptNames()); - partyMembersEntity.setAllDeptIds(parentAndAllDeptDTOResult.getData().getAllDeptIds()); - partyMembersEntity.setParentDeptNames(parentAndAllDeptDTOResult.getData().getParentDeptNames()); - partyMembersEntity.setParentDeptIds(parentAndAllDeptDTOResult.getData().getParentDeptIds()); - partyMembersEntity.setGridId(userGridRelation.getGridId()); - partyMembersEntity.setGridName(userGridRelation.getGrid()); - partyMembersEntity.setRegistFlag(YesOrNoEnum.YES.value()); - partyMembersEntity.setRegistTime(oldEntity.getRegisterTime()); - QueryWrapper partyWrapper = new QueryWrapper<>(); - partyWrapper.eq(UserFieldConsant.IDENTITY_NO, identityNo) - .eq(UserFieldConsant.REAL_NAME, userDto.getRealName()); - int selectCount = this.partyMembersDao.selectCount(partyWrapper); - //用户认证历史 - UserAuthenticateHistoryEntity userAuthenticateHistoryEntity = new UserAuthenticateHistoryEntity(); - if (selectCount == NumConstant.ZERO) { - // 党员库中没有,存进党员认证失败表 - PartyAuthenticationFailedEntity authenticationFailedEntity = ConvertUtils.sourceToTarget(partyMembersEntity, PartyAuthenticationFailedEntity.class); - authenticationFailedEntity.setUserId(userId); - authenticationFailedEntity.setState(Integer.parseInt(YesOrNoEnum.NO.value())); - authenticationFailedEntity.setAddress(userDto.getAddress()); - authenticationFailedEntity.setRealName(userDto.getRealName()); - authenticationFailedEntity.setMobile(userDto.getMobile()); - authenticationFailedEntity.setIdentityNo(identityNo); - authenticationFailedEntity.setRegistTime(oldEntity.getRegisterTime()); - partyAuthenticationFailedDao.insert(authenticationFailedEntity); - - userDto.setState(AppUserStatesEnum.STATE_COMPLETED_INFORMATION_PENDING_REVIEW.value()); - // 是否是党员(0-否,1-是) 认证失败:0 - userDto.setPartyFlag(YesOrNoEnum.NO.value()); - userAuthenticateHistoryEntity.setAuthenticatedFlag(YesOrNoEnum.NO.value()); - // 党员认证失败返回code码 - result.error(UserModuleErrorCode.AUTHENTICATION_CODE, MessageUtils.getMessage(UserModuleErrorCode.AUTHENTICATION_CODE)); - } else { - UpdateWrapper partyUpdate = new UpdateWrapper<>(); - partyUpdate.eq(UserFieldConsant.IDENTITY_NO, identityNo) - .eq(UserFieldConsant.REAL_NAME, userDto.getRealName()); - this.partyMembersDao.update(partyMembersEntity, partyUpdate); - userAuthenticateHistoryEntity.setAuthenticatedFlag(YesOrNoEnum.YES.value()); - userDto.setPartyFlag(YesOrNoEnum.YES.value());//是否是党员(0-否,1-是) 认证失败:0 - userDto.setRegisterTime(new Date());// 认证成功之后更新认证时间 - //认证成功党员 信息审核通过 - userDto.setState(AppUserStatesEnum.STATE_INFORMATION_PASSED.value()); - } - //插入用户认证历史表 - userAuthenticateHistoryEntity.setUserId(userId); - userAuthenticateHistoryEntity.setMobile(userDto.getMobile()); - userAuthenticateHistoryEntity.setRealName(userDto.getRealName()); - userAuthenticateHistoryEntity.setAddress(userDto.getAddress()); - userAuthenticateHistoryEntity.setRemark(userDto.getRemark()); - // 新维护的 认证类别(0-居民认证,1-党员认证,2-志愿者认证) - userAuthenticateHistoryEntity.setAuthenticatedType(AuthenticatedConsant.partyAuth); - userAuthenticateHistoryDao.insert(userAuthenticateHistoryEntity); + return parentAndAllDeptDTO; + } + + /** + * 认证党员 + * + * @param formDto + * @param parentAndAllDeptDTO + * @return void + * @author rongchao + * @since 2019-12-19 + */ + private boolean authPartyMembers(EpdcAppUserCompleteInfoFormDTO formDto, ParentAndAllDeptDTO parentAndAllDeptDTO) { + EpdcCompleteAppUserDTO completeAppUser = formDto.getCompleteAppUser(); + UserGridRelationDTO userGridRelation = formDto.getUserGridRelation(); + boolean result = Boolean.FALSE; + int selectCount = partyMembersService.countPartyMemberByIdNoAndRealName(completeAppUser.getIdentityNo(), completeAppUser.getRealName()); + if (selectCount == NumConstant.ZERO) { + // 党员认证失败 + // 党员库中没有,存进党员认证失败表 + generatePartyAuthenticationFailedRecord(completeAppUser, userGridRelation, parentAndAllDeptDTO); + // 生成党员认证不通过记录 + generateUserAuthenticateHistory(completeAppUser, UserAuthTypeEnum.PARTY_AUTH, YesOrNoEnum.NO, "党员库中无此党员信息"); } else { - userDto.setState(AppUserStatesEnum.STATE_COMPLETED_INFORMATION_PENDING_REVIEW.value()); - } - // 昵称前缀 - String nicknamePrefix = "网格长-"; - if (!oldEntity.getNickname().startsWith(nicknamePrefix)) { - nicknamePrefix = userDto.getRoad().concat("-"); + //党员认证成功 + modifyPartyMembers(parentAndAllDeptDTO, formDto); + // 党员认证成功,生成用户身份标签 + generateUserTag(completeAppUser.getId()); + // 生成党员认证通过记录 + generateUserAuthenticateHistory(completeAppUser, UserAuthTypeEnum.PARTY_AUTH, YesOrNoEnum.YES, null); + result = Boolean.TRUE; } - // 姓 - String lastName = userDto.getRealName().substring(NumConstant.ZERO, NumConstant.ONE); - userDto.setLastName(lastName); - userDto.setNickname(nicknamePrefix.concat(lastName).concat(UserSexEnum.FEMALE.sex().equals(userDto.getSex()) ? "女士" : "先生")); + return result; + } - //保存用户居住地所在网格,及其他冗余字段。 - userDto.setAllDeptIds(parentAndAllDeptDTOResult.getData().getAllDeptIds()); - userDto.setAllDeptNames(parentAndAllDeptDTOResult.getData().getAllDeptNames()); - userDto.setParentDeptIds(parentAndAllDeptDTOResult.getData().getParentDeptIds()); - userDto.setParentDeptNames(parentAndAllDeptDTOResult.getData().getParentDeptNames()); + @Override + @Transactional(rollbackFor = Exception.class) + public Result completeUserInfo(EpdcAppUserCompleteInfoFormDTO formDto) { + EpdcCompleteAppUserDTO completeAppUser = formDto.getCompleteAppUser(); + UserGridRelationDTO userGridRelation = formDto.getUserGridRelation(); - UserEntity userEntity = ConvertUtils.sourceToTarget(userDto, UserEntity.class); - boolean updateUser = this.updateById(userEntity); - if (!updateUser) { - throw new RenException("保存用户信息异常"); - } + // 获取组织结构冗余信息 + ParentAndAllDeptDTO parentAndAllDeptDTO = getParentAndAllDeptDTO(userGridRelation.getGridId().toString()); + + //进行居民认证 + UserEntity userEntity = modifyResidentInfo(completeAppUser, userGridRelation, parentAndAllDeptDTO); - UserGridRelationDTO relationInfo = userGridRelationService.getUserRelationInfo(userEntity.getId(), userGridRelation.getGridId()); - userDto.setLeaderFlag(relationInfo.getLeaderFlag()); - userDto.setFaceImg(oldEntity.getFaceImg()); - return result.ok(userDto); + //返回网格长标识信息 + UserGridRelationDTO relationInfo = userGridRelationService.getUserRelationInfo(completeAppUser.getId(), userGridRelation.getGridId()); + UserDTO userDTO = ConvertUtils.sourceToTarget(userEntity, UserDTO.class); + userDTO.setLeaderFlag(relationInfo.getLeaderFlag()); + + if (YesOrNoEnum.YES.value().equals(completeAppUser.getPartyFlag())) { + //进行党员认证 + boolean authFlag = authPartyMembers(formDto, parentAndAllDeptDTO); + //认证成功党员 信息审核通过 + if (authFlag) { + userDTO.setState(AppUserStatesEnum.STATE_INFORMATION_PASSED.value()); + userDTO.setRegisterTime(new Date());// 认证成功之后更新认证时间 + } + } + return new Result().ok(userDTO); } +// @Override +// @Transactional(rollbackFor = Exception.class) +// public Result completeUserInfo(EpdcAppUserCompleteInfoFormDTO formDto) { +// EpdcCompleteAppUserDTO completeAppUser = formDto.getCompleteAppUser(); +// +// UserDTO userDto = ConvertUtils.sourceToTarget(completeAppUser, UserDTO.class); +// if (StringUtils.isBlank(userDto.getWxUnionId())) { +// userDto.setWxUnionId(null); +// } +// UserGridRelationDTO userGridRelation = formDto.getUserGridRelation(); +// +// String userId = userDto.getId(); +// UserEntity oldEntity = this.baseDao.selectById(userId); +// +// // 身份证号 +// String identityNo = userDto.getIdentityNo(); +// +// Result parentAndAllDeptDTOResult = adminFeignClient.getParentAndAllDept(String.valueOf(userGridRelation.getGridId())); +// if (!parentAndAllDeptDTOResult.success()) { +// return new Result().error(parentAndAllDeptDTOResult.getMsg()); +// } +// if (YesOrNoEnum.YES.value().equals(userDto.getPartyFlag())) { +// PartyMembersEntity partyMembersEntity = new PartyMembersEntity(); +// partyMembersEntity.setAllDeptNames(parentAndAllDeptDTOResult.getData().getAllDeptNames()); +// partyMembersEntity.setAllDeptIds(parentAndAllDeptDTOResult.getData().getAllDeptIds()); +// partyMembersEntity.setParentDeptNames(parentAndAllDeptDTOResult.getData().getParentDeptNames()); +// partyMembersEntity.setParentDeptIds(parentAndAllDeptDTOResult.getData().getParentDeptIds()); +// partyMembersEntity.setGridId(userGridRelation.getGridId()); +// partyMembersEntity.setGridName(userGridRelation.getGrid()); +// partyMembersEntity.setRegistFlag(YesOrNoEnum.YES.value()); +// partyMembersEntity.setRegistTime(oldEntity.getRegisterTime()); +// QueryWrapper partyWrapper = new QueryWrapper<>(); +// partyWrapper.eq(UserFieldConsant.IDENTITY_NO, identityNo) +// .eq(UserFieldConsant.REAL_NAME, userDto.getRealName()); +// int selectCount = this.partyMembersDao.selectCount(partyWrapper); +// //用户认证历史 +// UserAuthenticateHistoryEntity userAuthenticateHistoryEntity = new UserAuthenticateHistoryEntity(); +// if (selectCount == NumConstant.ZERO) { +// // 党员库中没有,存进党员认证失败表 +// PartyAuthenticationFailedEntity authenticationFailedEntity = ConvertUtils.sourceToTarget(partyMembersEntity, PartyAuthenticationFailedEntity.class); +// authenticationFailedEntity.setUserId(userId); +// authenticationFailedEntity.setState(Integer.parseInt(YesOrNoEnum.NO.value())); +// authenticationFailedEntity.setAddress(userDto.getAddress()); +// authenticationFailedEntity.setRealName(userDto.getRealName()); +// authenticationFailedEntity.setMobile(userDto.getMobile()); +// authenticationFailedEntity.setIdentityNo(identityNo); +// authenticationFailedEntity.setRegistTime(oldEntity.getRegisterTime()); +// partyAuthenticationFailedDao.insert(authenticationFailedEntity); +// +// userDto.setState(AppUserStatesEnum.STATE_COMPLETED_INFORMATION_PENDING_REVIEW.value()); +// userDto.setPartyFlag(YesOrNoEnum.NO.value());//是否是党员(0-否,1-是) 认证失败:0 +// userAuthenticateHistoryEntity.setAuthenticatedFlag(YesOrNoEnum.NO.value()); +// } else { +// UpdateWrapper partyUpdate = new UpdateWrapper<>(); +// partyUpdate.eq(UserFieldConsant.IDENTITY_NO, identityNo) +// .eq(UserFieldConsant.REAL_NAME, userDto.getRealName()); +// this.partyMembersDao.update(partyMembersEntity, partyUpdate); +// userAuthenticateHistoryEntity.setAuthenticatedFlag(YesOrNoEnum.YES.value()); +// userDto.setPartyFlag(YesOrNoEnum.YES.value());//是否是党员(0-否,1-是) 认证失败:0 +// userDto.setRegisterTime(new Date());// 认证成功之后更新认证时间 +// //认证成功党员 信息审核通过 +// userDto.setState(AppUserStatesEnum.STATE_INFORMATION_PASSED.value()); +// } +// //插入用户认证历史表 +// userAuthenticateHistoryEntity.setUserId(userId); +// userAuthenticateHistoryEntity.setMobile(userDto.getMobile()); +// userAuthenticateHistoryEntity.setRealName(userDto.getRealName()); +// userAuthenticateHistoryEntity.setAddress(userDto.getAddress()); +// userAuthenticateHistoryEntity.setRemark(userDto.getRemark()); +// userAuthenticateHistoryEntity.setAuthenticatedType(AuthenticatedConsant.partyAuth); // 新维护的 认证类别(0-居民认证,1-党员认证,2-志愿者认证) +// userAuthenticateHistoryDao.insert(userAuthenticateHistoryEntity); +// } else { +// if (oldEntity.getState().equals(AppUserStatesEnum.STATE_INFORMATION_NOT_PASSED.value())) { +// userDto.setState(AppUserStatesEnum.STATE_COMPLETED_INFORMATION_PENDING_REVIEW.value()); +// } +// } +// // 昵称前缀 +// String nicknamePrefix = "网格长-"; +// if (!oldEntity.getNickname().startsWith(nicknamePrefix)) { +// nicknamePrefix = userDto.getRoad().concat("-"); +// } +// // 姓 +// String lastName = userDto.getRealName().substring(NumConstant.ZERO, NumConstant.ONE); +// userDto.setLastName(lastName); +// userDto.setNickname(nicknamePrefix.concat(lastName).concat(UserSexEnum.FEMALE.sex().equals(userDto.getSex()) ? "女士" : "先生")); +// +// //保存用户居住地所在网格,及其他冗余字段。 +// userDto.setAllDeptIds(parentAndAllDeptDTOResult.getData().getAllDeptIds()); +// userDto.setAllDeptNames(parentAndAllDeptDTOResult.getData().getAllDeptNames()); +// userDto.setParentDeptIds(parentAndAllDeptDTOResult.getData().getParentDeptIds()); +// userDto.setParentDeptNames(parentAndAllDeptDTOResult.getData().getParentDeptNames()); +// +// UserEntity userEntity = ConvertUtils.sourceToTarget(userDto, UserEntity.class); +// boolean updateUser = this.updateById(userEntity); +// if (!updateUser) { +// throw new RenException("保存用户信息异常"); +// } +// +// UserGridRelationDTO relationInfo = userGridRelationService.getUserRelationInfo(userEntity.getId(), userGridRelation.getGridId()); +// userDto.setLeaderFlag(relationInfo.getLeaderFlag()); +// userDto.setFaceImg(oldEntity.getFaceImg()); +// return result.ok(userDto); +// } + /** * 获取居民详情(已认证或待认证(提交信息待审核)的居民用户) * @@ -789,6 +1011,65 @@ public class UserServiceImpl extends BaseServiceImpl implem return new Result>().ok(baseDao.selectListGridUserResultDTO(gridIdList)); } + /** + * @param formDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 获取用户缓存信息 + * @Date 2019/12/18 14:01 + **/ + @Override + public Result queryCachingUserInfo(EpdcAppQueryUserInfoFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getOpenId())) { + throw new RenException("openId不能为空"); + } + CachingUserInfoDTO cachingUserInfoDTO = null; + if (StringUtils.isNotBlank(formDTO.getUnionId())) { + //根据unionId查询 + cachingUserInfoDTO = this.baseDao.selectCachingUserInfoDTO(null, formDTO.getUnionId()); + } + if (null == cachingUserInfoDTO) { + //根据openId查询 + cachingUserInfoDTO = this.baseDao.selectCachingUserInfoDTO(formDTO.getOpenId(), null); + } + return new Result().ok(cachingUserInfoDTO); + } + + /** + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据操作类型更新用户积分 + * @Date 2019/12/13 15:02 + **/ + @Override + public Result handleUserPoints(EpdcUserPointsFormDTO formDTO) { + UserEntity userEntity = baseDao.selectById(formDTO.getUserId()); + //规则操作类型(0-减积分,1-加积分) + if (PointsOperationEnum.OPERATION_TYPE_ADD.getOperationType().equals(formDTO.getOperationType())) { + userEntity.setPoints(userEntity.getPoints() + formDTO.getPoints()); + } else if (PointsOperationEnum.OPERATION_TYPE_SUBSTRACT.getOperationType().equals(formDTO.getOperationType())) { + userEntity.setPoints(userEntity.getPoints() - formDTO.getPoints()); + } + baseDao.updateById(userEntity); + return new Result(); + } + + /** + * @param userId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 获取用户缓存信息 + * @Date 2020/1/15 17:40 + **/ + @Override + public Result cachingUserInfoByUserId(String userId) { + if (StringUtils.isBlank(userId)) { + throw new RenException("userId不能为空"); + } + CachingUserInfoDTO cachingUserInfoDTO = baseDao.selectCachingUserInfoDTOByUserId(userId); + return new Result().ok(cachingUserInfoDTO); + } + /** * 根据微信信息查询用户 * @@ -817,4 +1098,5 @@ public class UserServiceImpl extends BaseServiceImpl implem return ConvertUtils.sourceToTarget(userEntity, UserDTO.class); } + } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserTagRelationServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserTagRelationServiceImpl.java index 4ab767252..540016aa9 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserTagRelationServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserTagRelationServiceImpl.java @@ -48,6 +48,8 @@ public class UserTagRelationServiceImpl extends BaseServiceImpl page(Map params) { @@ -101,4 +103,18 @@ public class UserTagRelationServiceImpl extends BaseServiceImpl + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.async.NewsTask; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +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.utils.Result; +import com.elink.esua.epdc.constant.VolunteerInfoConsant; +import com.elink.esua.epdc.dao.VolunteerInfoDao; +import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; +import com.elink.esua.epdc.dto.UserTagDTO; +import com.elink.esua.epdc.dto.VolunteerInfoDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcCompleteVolunteerInfoFormDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; +import com.elink.esua.epdc.entity.VolunteerInfoEntity; +import com.elink.esua.epdc.feign.AdminFeignClient; +import com.elink.esua.epdc.redis.VolunteerInfoRedis; +import com.elink.esua.epdc.service.UserService; +import com.elink.esua.epdc.service.VolunteerInfoService; +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.Date; +import java.util.List; +import java.util.Map; + +/** + * 志愿者信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Service +public class VolunteerInfoServiceImpl extends BaseServiceImpl implements VolunteerInfoService { + + @Autowired + private VolunteerInfoRedis volunteerInfoRedis; + + @Autowired + private VolunteerInfoDao volunteerInfoDao; + + @Autowired + private UserService userService; + + @Autowired + private NewsTask newsTask; + + @Autowired + private AdminFeignClient adminFeignClient; + + /** + * 根据查询条件,返回首页 志愿者信息列表 + * @param params + * @return + */ + @Override + public PageData volunteerInfo(Map params) { + Integer page = Integer.parseInt(params.get("page").toString()); + Integer limit = Integer.parseInt(params.get("limit").toString()); + String allDeptIds = ""; + if (params.get("streetId") != "" && params.get("streetId") != null){ + allDeptIds = params.get("streetId").toString(); //查询条件 街道 + } + if (params.get("communityId") != "" && params.get("communityId") != null){ + allDeptIds = params.get("communityId").toString(); //查询条件 社区 + } + if (params.get("gridId") != "" && params.get("gridId") != null){ + allDeptIds = params.get("gridId").toString(); //查询条件 网格 + } + params.put("page",page - 1); + params.put("limit",limit); + params.put("allDeptIds",allDeptIds); + int count = volunteerInfoDao.volunteerInfoCount(params); + List list = volunteerInfoDao.volunteerInfoList(params); + PageData pageDate = new PageData(list,count); + return pageDate; + } + + /** + * 根据志愿者ID,查询志愿者 单条详情 + * 积分需要连user表查询 + * @param id + * @return + */ + @Override + public VolunteerInfoDTO getVolunteerDetail(String id) { + return volunteerInfoDao.getVolunteerDetail(id); + } + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, VolunteerInfoDTO.class); + } + + /** + * 自定义 志愿者表修改方法 + * @param dto + */ + @Override + public void updateVolunteerInfo(VolunteerInfoDTO dto) { + volunteerInfoDao.updateVolunteerInfo(dto); + //审核状态(0-未审核,1-审核通过,2-审核不通过,3-拉黑),当审核状态为2,3时推送消息 + if (dto.getAuditStatus().equals("2") || dto.getAuditStatus().equals("3")){ + EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO(); + informationFormDTO.setUserId(dto.getUserId()); + if (dto.getAuditStatus().equals("2")){ + informationFormDTO.setTitle(VolunteerInfoConsant.NOTICE_TITLE_VOLUNTEER_NOT_PASSED); + }else if (dto.getAuditStatus().equals("3")){ + informationFormDTO.setTitle(VolunteerInfoConsant.NOTICE_TITLE_VOLUNTEER_BLACKLIST); + } + informationFormDTO.setContent(dto.getFailureReason());//审核不通过原因 + informationFormDTO.setType("0"); //消息类型:0审核通知 + informationFormDTO.setBusinessType(VolunteerInfoConsant.NOTICE_BUSINESSTYPE_VOLUNTEER_CHECK);//消息所属业务类型 + informationFormDTO.setBusinessId(dto.getId());//消息所属业务ID:主键id + //消息推送 + newsTask.insertUserInformation(informationFormDTO); + } + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, VolunteerInfoDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public VolunteerInfoDTO get(String id) { + VolunteerInfoEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, VolunteerInfoDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(VolunteerInfoDTO dto) { + VolunteerInfoEntity entity = ConvertUtils.sourceToTarget(dto, VolunteerInfoEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(VolunteerInfoDTO dto) { + VolunteerInfoEntity entity = ConvertUtils.sourceToTarget(dto, VolunteerInfoEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 志愿者申请,根据用户表基础信息 赋默认值 + * @param id + * @return VolunteerInfoDTO + * @author zy + * @date 2019-12-11 + */ + @Override + public Result getVolunteerUserDefaultValue(String id) { + VolunteerInfoDTO vo = volunteerInfoDao.getVolunteerUserDefaultValue(id); + return new Result().ok(vo); + } + + /** + * 向标签表中,查询唯一志愿者标签:tag_code = volunteer + * @param tagCode + * @return + */ + @Override + public UserTagDTO volunteerTagQuery(String tagCode) { + return volunteerInfoDao.volunteerTagQuery(tagCode); + } + + /** + * 根据用户id 进行志愿者认证 + * @param userId + * @author wanggongfeng + * @return + * @Date 2019/12/13 16:39 + */ + @Override + public Result getVolunteerCountById(String userId) { + return new Result().ok(baseDao.getVolunteerCountById(userId)); + } + + /** + * 新增志愿者 + * @param epdcCompleteVolunteerInfoFormDTO + * @author wanggongfeng + * @return + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Result insertVolunteerInfo(EpdcCompleteVolunteerInfoFormDTO epdcCompleteVolunteerInfoFormDTO) { + VolunteerInfoEntity volunteerEntity = ConvertUtils.sourceToTarget(epdcCompleteVolunteerInfoFormDTO, VolunteerInfoEntity.class); + // 补全其他字段 + volunteerEntity.setRegistTime(new Date());// 注册时间 + volunteerEntity.setAuditStatus("1"); // 审核状态 默认审核通过 + volunteerEntity.setAuditTime(new Date()); // 审核时间 + volunteerEntity.setKindnessTime(0); // 爱心时长(单位:分钟) + volunteerEntity.setParticipationNum(0); // 参加活动次数 + String address = volunteerEntity.getRoad() + .concat(StringUtils.isNotBlank(volunteerEntity.getVillageName()) ? volunteerEntity.getVillageName() : "") + .concat(StringUtils.isNotBlank(volunteerEntity.getDwellingPlace()) ? volunteerEntity.getDwellingPlace() : ""); + volunteerEntity.setAddress(address); // 居住地址 + + // 获取部门信息 + Result dtoResult = adminFeignClient.getParentAndAllDept(volunteerEntity.getGridId()+""); + ParentAndAllDeptDTO parentAndAllDeptDTO = dtoResult.getData(); + + volunteerEntity.setParentDeptIds(parentAndAllDeptDTO.getParentDeptIds()); // 父所有部门ID + volunteerEntity.setParentDeptNames(parentAndAllDeptDTO.getParentDeptNames());// 父所有部门 + volunteerEntity.setAllDeptIds(parentAndAllDeptDTO.getAllDeptIds()); // 所有部门ID + volunteerEntity.setAllDeptNames(parentAndAllDeptDTO.getAllDeptNames()); // 所有部门 + + + insert(volunteerEntity); + return new Result().ok(1); + } + + /** + * @param id + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 积分调整按钮按下, 查询用户信息 + * @Date 2019/12/16 17:48 + **/ + @Override + public Result getAdjustVolunteerPointsDTO(String id) { + if(StringUtils.isBlank(id) ){ + return new Result().error("志愿者主键不能为空"); + } + EpdcAdjustVolunteerPointsDTO adjustVolunteerPointsDTO = baseDao.selectAdjustVolunteerPointsDTO(id); + return new Result().ok(adjustVolunteerPointsDTO); + } + + /** + * 获取排行榜 + * @author wanggongfeng + * @return + */ + @Override + public Result> getRankingList() { + List list = baseDao.getRankingList(); + return new Result>().ok(list); + } + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/application.yml index 4bde8c8cb..ef7249654 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/application.yml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/application.yml @@ -1,77 +1,20 @@ server: - tomcat: - max-swallow-size: 100MB port: @server.port@ servlet: context-path: /app-user +nacos: + config: + server-addr: @nacos.server-addr@ + type: YAML + namespace: @nacos.config.namespace@ + group: @nacos.config.group@ + dataId: epdc-user-server + bootstrap: + enable: true + log: + enable: @nacos.config.bootstrap.log.enable@ + spring: - main: - allow-bean-definition-overriding: true - servlet: - multipart: - enabled: true - file-size-threshold: 0 - max-file-size: 100MB - max-request-size: 100MB application: name: epdc-user-server - # 环境 dev|test|prod - profiles: - active: @spring.profiles.active@ - messages: - encoding: UTF-8 - basename: i18n/messages,i18n/messages_common - jackson: - time-zone: GMT+8 - date-format: yyyy-MM-dd HH:mm:ss - redis: - database: @spring.redis.index@ - host: @spring.redis.host@ - timeout: 30s - port: @spring.redis.port@ - password: @spring.redis.password@ - cloud: - nacos: - discovery: - server-addr: @nacos.server-addr@ - register-enabled: @nacos.register-enabled@ - alibaba: - seata: - tx-service-group: epdc-user-server-fescar-service-group - datasource: - druid: - driver-class-name: com.mysql.jdbc.Driver - url: @spring.datasource.druid.url@ - username: @spring.datasource.druid.username@ - password: @spring.datasource.druid.password@ - -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: ALWAYS - -mybatis-plus: - mapper-locations: classpath:/mapper/**/*.xml - #实体扫描,多个package用逗号或者分号分隔 - typeAliasesPackage: io.renren.entity;com.elink.esua.epdc.entity - global-config: - #数据库相关配置 - db-config: - #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; - id-type: ID_WORKER - #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" - field-strategy: NOT_NULL - #驼峰下划线转换 - column-underline: true - banner: false - #原生配置 - configuration: - map-underscore-to-camel-case: true - cache-enabled: false - call-setters-on-nulls: true - jdbc-type-for-null: 'null' diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml index 42330c870..43ff2f991 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml @@ -382,4 +382,89 @@ + + + + + + + + + + + + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserTagDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserTagDao.xml index 22ebfc9b6..342b01090 100755 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserTagDao.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserTagDao.xml @@ -6,6 +6,7 @@ + @@ -15,5 +16,26 @@ + + - \ No newline at end of file + + + diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserTagRelationDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserTagRelationDao.xml index e7c8bc663..1e328b2eb 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserTagRelationDao.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserTagRelationDao.xml @@ -15,5 +15,8 @@ - + + UPDATE epdc_user_tag_relation + SET del_flag='1' WHERE USER_ID = #{userId} AND del_flag='0' + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml new file mode 100644 index 000000000..725554e52 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE epdc_volunteer_info + SET + UPDATED_BY = #{updatedBy} + ,UPDATED_TIME = #{updatedTime} + ,AUDIT_STATUS = #{auditStatus} + ,FAILURE_REASON = #{failureReason} + ,AUDIT_TIME = #{auditTime} + ,AUDITOR = #{auditor} + WHERE ID = #{id} + + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/config/WebServiceConfig.java b/esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/config/WebServiceConfig.java index c0cbba341..d032a46f5 100644 --- a/esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/config/WebServiceConfig.java +++ b/esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/config/WebServiceConfig.java @@ -10,23 +10,23 @@ import org.springframework.context.annotation.Configuration; import javax.xml.ws.Endpoint; /** - * @Description TODO + * @Description * @Author yinzuomei * @Date 2019/12/30 12:55 */ @Configuration public class WebServiceConfig { - @Autowired - private Bus bus; - @Autowired - private CityGridInterfaceServiceWebService cityGridInterfaceServiceWebService; + @Autowired + private Bus bus; + @Autowired + private CityGridInterfaceServiceWebService cityGridInterfaceServiceWebService; - @Bean - public Endpoint endpointUserService() { - EndpointImpl endpoint = new EndpointImpl(bus,cityGridInterfaceServiceWebService); - endpoint.publish("/CityGridInterfaceServiceWebService");//接口发布在 /CityGridInterfaceServiceWebService 目录下 - return endpoint; - } + @Bean + public Endpoint endpointUserService() { + EndpointImpl endpoint = new EndpointImpl(bus, cityGridInterfaceServiceWebService); + endpoint.publish("/CityGridInterfaceServiceWebService");//接口发布在 /CityGridInterfaceServiceWebService 目录下 + return endpoint; + } } diff --git a/esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/dto/form/TestDTO.java b/esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/dto/form/TestDTO.java index 6f9be79c7..e7419ce9f 100644 --- a/esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/dto/form/TestDTO.java +++ b/esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/dto/form/TestDTO.java @@ -6,20 +6,20 @@ import javax.xml.bind.annotation.*; import java.io.Serializable; /** - * @Description TODO + * @Description * @Author yinzuomei * @Date 2019/12/30 17:28 */ -@XmlRootElement(name="user") +@XmlRootElement(name = "user") @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "user",propOrder = {"userId","userName"}) +@XmlType(name = "user", propOrder = {"userId", "userName"}) @Data public class TestDTO implements Serializable { - private static final long serialVersionUID = 1677005211935252496L; - @XmlElement(name = "userId",required = true) - private String userId; - @XmlElement(name = "userName",required = true) - private String userName; + private static final long serialVersionUID = 1677005211935252496L; + @XmlElement(name = "userId", required = true) + private String userId; + @XmlElement(name = "userName", required = true) + private String userName; } diff --git a/esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/utils/JaxbUtil.java b/esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/utils/JaxbUtil.java index a834ed356..ab035fc97 100644 --- a/esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/utils/JaxbUtil.java +++ b/esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/utils/JaxbUtil.java @@ -1,7 +1,7 @@ package com.elink.esua.epdc.utils; /** - * @Description TODO + * @Description * @Author yinzuomei * @Date 2019/12/30 17:46 */ diff --git a/esua-epdc/epdc-module/epdc-websocket/epdc-websocket-server/pom.xml b/esua-epdc/epdc-module/epdc-websocket/epdc-websocket-server/pom.xml index 1d99d06de..02a22a0f8 100644 --- a/esua-epdc/epdc-module/epdc-websocket/epdc-websocket-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-websocket/epdc-websocket-server/pom.xml @@ -226,8 +226,10 @@ 111 111 - wxdd8530c5f4926766 - 5bf4fb813145431b3493a10aa7e041e9 + + + wx5d3e97461d248397 + bfed51b731e53db9affb9e6131e7ae12 diff --git a/esua-epdc/epdc-module/pom.xml b/esua-epdc/epdc-module/pom.xml index ec076c9e2..6d4103a66 100644 --- a/esua-epdc/epdc-module/pom.xml +++ b/esua-epdc/epdc-module/pom.xml @@ -22,13 +22,13 @@ epdc-heart epdc-news epdc-events - epdc-neighbor epdc-services epdc-user epdc-demo epdc-group epdc-websocket epdc-kpi + epdc-points epdc-webservice epdc-custom diff --git a/esua-epdc/k8s/kongcun/app-master/mysql/mysql-config.yml b/esua-epdc/k8s/kongcun/app-master/mysql/mysql-config.yml new file mode 100644 index 000000000..bec1eecf7 --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/mysql/mysql-config.yml @@ -0,0 +1,30 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: mysql-master-config + namespace: epdc-mysql + labels: + config: mysql-master-config +data: + mysqld.cnf: |- + [mysqld] + pid-file = /var/run/mysqld/mysqld.pid + socket = /var/run/mysqld/mysqld.sock + datadir = /var/lib/mysql + log-error = /var/log/mysql/error.log + # By default we only accept connections from localhost + # bind-address = 127.0.0.1 + # Disabling symbolic-links is recommended to prevent assorted security risks + symbolic-links=0 + sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' + # 允许最大连接数 + max_connections=200 + # 允许连接失败的次数。这是为了防止有人从该主机试图攻击数据库系统 + max_connect_errors=10 + # 创建新表时将使用的默认存储引擎 + default-storage-engine=INNODB + # 默认使用“mysql_native_password”插件认证 + default_authentication_plugin=mysql_native_password + server-id=164 + log-bin=master-bin + log-bin-index=master-bin.index diff --git a/esua-epdc/k8s/kongcun/app-master/mysql/mysql-deploy.yml b/esua-epdc/k8s/kongcun/app-master/mysql/mysql-deploy.yml new file mode 100644 index 000000000..fdabdc889 --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/mysql/mysql-deploy.yml @@ -0,0 +1,42 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mysql-master-deploy + namespace: epdc-mysql + labels: + deploy: mysql-master-deploy +spec: + replicas: 1 + selector: + matchLabels: + app: mysql-master-pod + template: + metadata: + labels: + app: mysql-master-pod + spec: + containers: + - name: mysql-master-container + image: mysql:8.0 + env: + - name: MYSQL_ROOT_PASSWORD #以下是设置MySQL数据库的密码 + valueFrom: + secretKeyRef: + name: mysql-master-secret + key: mysql-user-root-pwd + ports: + - containerPort: 3306 + protocol: TCP + name: mysql-master-tcp-3306 + volumeMounts: + - name: mysql-master-persistent-storage + mountPath: /var/lib/mysql #MySQL容器的数据都是存在这个目录的,要对这个目录做数据持久化 + - name: mysql-master-config-volume #表示一个挂载点的名称 + mountPath: /etc/mysql/mysql.conf.d/ #表示新挂载点的路径,这里就是mysql配置文件的路径 + volumes: + - name: mysql-master-persistent-storage + persistentVolumeClaim: + claimName: mysql-master-pvc #指定pvc的名称 + - name: mysql-master-config-volume #表示挂载点的名称 + configMap: #使用configmap + name: mysql-master-config diff --git a/esua-epdc/k8s/kongcun/app-master/mysql/mysql-pv.yml b/esua-epdc/k8s/kongcun/app-master/mysql/mysql-pv.yml new file mode 100644 index 000000000..18ff7b812 --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/mysql/mysql-pv.yml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: mysql-master-pv + namespace: epdc-mysql + labels: + pv: mysql-master-pv +spec: + accessModes: + - ReadWriteOnce #访问模式定义为只能以读写的方式挂载到单个节点 + capacity: + storage: 100Gi + persistentVolumeReclaimPolicy: Retain + storageClassName: nfs + nfs: + path: /mnt/nfsdata/mysql-master + server: 172.16.0.7 diff --git a/esua-epdc/k8s/kongcun/app-master/mysql/mysql-pvc.yml b/esua-epdc/k8s/kongcun/app-master/mysql/mysql-pvc.yml new file mode 100644 index 000000000..f3373ae78 --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/mysql/mysql-pvc.yml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: mysql-master-pvc + namespace: epdc-mysql + labels: + pvc: mysql-master-pvc +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Gi + storageClassName: managed-nfs-storage + selector: + matchLabels: + pv: mysql-master-pv diff --git a/esua-epdc/k8s/kongcun/app-master/mysql/mysql-secret.yml b/esua-epdc/k8s/kongcun/app-master/mysql/mysql-secret.yml new file mode 100644 index 000000000..404545628 --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/mysql/mysql-secret.yml @@ -0,0 +1,11 @@ +#键的值是经过base64编码的 +#在Linux里运行命令“echo -n dbuser | base64”获得“dbuser”的编码 +apiVersion: v1 +kind: Secret +metadata: + name: mysql-master-secret + namespace: epdc-mysql + labels: + secret: mysql-master-secret +data: + mysql-user-root-pwd: ZXBkY19rb25nY3VuQDE0MDU= diff --git a/esua-epdc/k8s/kongcun/app-master/mysql/mysql-svc.yml b/esua-epdc/k8s/kongcun/app-master/mysql/mysql-svc.yml new file mode 100644 index 000000000..70b104759 --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/mysql/mysql-svc.yml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: mysql-master-svc + namespace: epdc-mysql + labels: + svc: mysql-master-svc +spec: + type: NodePort + ports: + - port: 3306 + protocol: TCP + targetPort: 3306 + nodePort: 33306 + selector: + app: mysql-master-pod diff --git a/esua-epdc/k8s/kongcun/app-master/nacos/nacos-cm.yml b/esua-epdc/k8s/kongcun/app-master/nacos/nacos-cm.yml new file mode 100644 index 000000000..e36532865 --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/nacos/nacos-cm.yml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: nacos-cm + namespace: epdc-nacos +data: + mysql.master.db.name: "nacos_devtest" + mysql.master.port: "3306" + mysql.slave.port: "3306" + mysql.master.user: "nacos" + mysql.master.password: "nacos" diff --git a/esua-epdc/k8s/kongcun/app-master/nacos/nacos-pvc-nfs.yml b/esua-epdc/k8s/kongcun/app-master/nacos/nacos-pvc-nfs.yml new file mode 100644 index 000000000..ac857b09f --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/nacos/nacos-pvc-nfs.yml @@ -0,0 +1,132 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: nacos +spec: + serviceName: nacos-headless + replicas: 2 + template: + metadata: + labels: + app: nacos + annotations: + pod.alpha.kubernetes.io/initialized: "true" + spec: + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: "app" + operator: In + values: + - nacos + topologyKey: "kubernetes.io/hostname" + serviceAccountName: nfs-client-provisioner + initContainers: + - name: peer-finder-plugin-install + image: nacos/nacos-peer-finder-plugin:latest + imagePullPolicy: Always + volumeMounts: + - mountPath: "/home/nacos/plugins/peer-finder" + name: plugindir + containers: + - name: nacos + imagePullPolicy: Always + image: nacos/nacos-server:latest + resources: + requests: + memory: "2Gi" + cpu: "500m" + ports: + - containerPort: 8848 + name: client-port + env: + - name: NACOS_REPLICAS + value: "3" + - name: SERVICE_NAME + value: "nacos-headless" + - name: POD_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: MYSQL_MASTER_SERVICE_DB_NAME + valueFrom: + configMapKeyRef: + name: nacos-cm + key: mysql.master.db.name + - name: MYSQL_MASTER_SERVICE_PORT + valueFrom: + configMapKeyRef: + name: nacos-cm + key: mysql.master.port + - name: MYSQL_SLAVE_SERVICE_PORT + valueFrom: + configMapKeyRef: + name: nacos-cm + key: mysql.slave.port + - name: MYSQL_MASTER_SERVICE_USER + valueFrom: + configMapKeyRef: + name: nacos-cm + key: mysql.master.user + - name: MYSQL_MASTER_SERVICE_PASSWORD + valueFrom: + configMapKeyRef: + name: nacos-cm + key: mysql.master.password + - name: NACOS_SERVER_PORT + value: "8848" + - name: PREFER_HOST_MODE + value: "hostname" + readinessProbe: + httpGet: + port: client-port + path: /nacos/v1/console/health/readiness + initialDelaySeconds: 60 + timeoutSeconds: 3 + livenessProbe: + httpGet: + port: client-port + path: /nacos/v1/console/health/liveness + initialDelaySeconds: 60 + timeoutSeconds: 3 + volumeMounts: + - name: plugindir + mountPath: /home/nacos/plugins/peer-finder + - name: datadir + mountPath: /home/nacos/data + - name: logdir + mountPath: /home/nacos/logs + volumeClaimTemplates: + - metadata: + name: plugindir + annotations: + volume.beta.kubernetes.io/storage-class: "managed-nfs-storage" + spec: + accessModes: [ "ReadWriteMany" ] + resources: + requests: + storage: 5Gi + - metadata: + name: datadir + annotations: + volume.beta.kubernetes.io/storage-class: "managed-nfs-storage" + spec: + accessModes: [ "ReadWriteMany" ] + resources: + requests: + storage: 5Gi + - metadata: + name: logdir + annotations: + volume.beta.kubernetes.io/storage-class: "managed-nfs-storage" + spec: + accessModes: [ "ReadWriteMany" ] + resources: + requests: + storage: 5Gi + selector: + matchLabels: + app: nacos diff --git a/esua-epdc/k8s/kongcun/app-master/nacos/nacos-svc.yml b/esua-epdc/k8s/kongcun/app-master/nacos/nacos-svc.yml new file mode 100644 index 000000000..ec1af420a --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/nacos/nacos-svc.yml @@ -0,0 +1,18 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: nacos-headless + namespace: epdc-nacos + labels: + app: nacos + annotations: + service.alpha.kubernetes.io/tolerate-unready-endpoints: "true" +spec: + ports: + - port: 8848 + name: server + targetPort: 8848 + clusterIP: None + selector: + app: nacos diff --git a/esua-epdc/k8s/kongcun/app-master/nfs/nfs-deployment.yml b/esua-epdc/k8s/kongcun/app-master/nfs/nfs-deployment.yml new file mode 100644 index 000000000..0b2efd137 --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/nfs/nfs-deployment.yml @@ -0,0 +1,35 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + name: nfs-client-provisioner +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: nfs-client-provisioner + template: + metadata: + labels: + app: nfs-client-provisioner + spec: + serviceAccountName: nfs-client-provisioner + containers: + - name: nfs-client-provisioner + image: quay.io/external_storage/nfs-client-provisioner:latest + volumeMounts: + - name: nfs-client-root + mountPath: /persistentvolumes + env: + - name: PROVISIONER_NAME + value: fuseim.pri/ifs + - name: NFS_SERVER + value: 172.16.0.8 + - name: NFS_PATH + value: /mnt/nfs/data + volumes: + - name: nfs-client-root + nfs: + server: 172.16.0.8 + path: /mnt/nfs/data diff --git a/esua-epdc/k8s/kongcun/app-master/nfs/nfs-rbac.yml b/esua-epdc/k8s/kongcun/app-master/nfs/nfs-rbac.yml new file mode 100644 index 000000000..92c1e4718 --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/nfs/nfs-rbac.yml @@ -0,0 +1,42 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: nfs-client-provisioner + +--- + +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: nfs-client-provisioner-runner +rules: + - apiGroups: [""] + resources: ["persistentvolumes"] + verbs: ["get", "list", "watch", "create", "delete"] + - apiGroups: [""] + resources: ["persistentvolumeclaims"] + verbs: ["get", "list", "watch", "update"] + - apiGroups: ["storage.k8s.io"] + resources: ["storageclasses"] + verbs: ["get", "list", "watch"] + - apiGroups: [""] + resources: ["events"] + verbs: ["list", "watch", "create", "update", "patch"] + - apiGroups: [""] + resources: ["endpoints"] + verbs: ["create", "delete", "get", "list", "watch", "patch", "update"] + +--- + +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: run-nfs-client-provisioner +subjects: + - kind: ServiceAccount + name: nfs-client-provisioner + namespace: default +roleRef: + kind: ClusterRole + name: nfs-client-provisioner-runner + apiGroup: rbac.authorization.k8s.io diff --git a/esua-epdc/k8s/kongcun/app-master/nfs/storageclass-nfs.yml b/esua-epdc/k8s/kongcun/app-master/nfs/storageclass-nfs.yml new file mode 100644 index 000000000..d20235804 --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/nfs/storageclass-nfs.yml @@ -0,0 +1,5 @@ +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: course-nfs-storage +provisioner: fuseim.pri/ifs # or choose another name, must match deployment's env PROVISIONER_NAME' diff --git a/esua-epdc/k8s/kongcun/app-master/nginx/nginx-deploy.yml b/esua-epdc/k8s/kongcun/app-master/nginx/nginx-deploy.yml new file mode 100644 index 000000000..4d8ad1a38 --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/nginx/nginx-deploy.yml @@ -0,0 +1,41 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nginx-deploy + namespace: epdc-nginx + labels: + deploy: nginx-deploy +spec: + replicas: 1 + selector: + matchLabels: + app: nginx-pod + template: + metadata: + labels: + app: nginx-pod + spec: + containers: + - name: nginx-container + image: nginx + ports: + - containerPort: 443 + name: nginx-443 + volumeMounts: + - name: nginx-persistent-storage-01 + mountPath: /usr/share/nginx/html + - name: nginx-persistent-storage-02 + mountPath: /etc/nginx #MySQL容器的数据都是存在这个目录的,要对这个目录做数据持久化 + readOnly: true + - name: nginx-persistent-storage-03 #表示一个挂载点的名称 + mountPath: /var/log/nginx #表示新挂载点的路径,这里就是mysql配置文件的路径 + volumes: + - name: nginx-persistent-storage-01 + persistentVolumeClaim: + claimName: nginx-data-pvc #指定pvc的名称 + - name: nginx-persistent-storage-02 + persistentVolumeClaim: + claimName: nginx-etc-pvc + - name: nginx-persistent-storage-03 + persistentVolumeClaim: + claimName: nginx-log-pvc diff --git a/esua-epdc/k8s/kongcun/app-master/nginx/nginx-pv.yml b/esua-epdc/k8s/kongcun/app-master/nginx/nginx-pv.yml new file mode 100644 index 000000000..ed9c372ff --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/nginx/nginx-pv.yml @@ -0,0 +1,60 @@ +#nginx数据PV +apiVersion: v1 +kind: PersistentVolume +metadata: + name: nginx-data-pv + namespace: epdc-nginx + labels: + pv: nginx-data-pv +spec: + accessModes: + - ReadWriteOnce #访问模式定义为只能以读写的方式挂载到单个节点 + capacity: + storage: 2Gi + persistentVolumeReclaimPolicy: Retain + storageClassName: nfs + nfs: + path: /mnt/nfsdata/nginx/data + server: 172.16.0.7 + +--- + +#nginx配置PV +apiVersion: v1 +kind: PersistentVolume +metadata: + name: nginx-etc-pv + namespace: epdc-nginx + labels: + pv: nginx-etc-pv +spec: + accessModes: + - ReadWriteOnce #访问模式定义为只能以读写的方式挂载到单个节点 + capacity: + storage: 1Gi + persistentVolumeReclaimPolicy: Retain + storageClassName: nfs + nfs: + path: /mnt/nfsdata/nginx/etc + server: 172.16.0.7 + +--- + +#nginx日志PV +apiVersion: v1 +kind: PersistentVolume +metadata: + name: nginx-log-pv + namespace: epdc-nginx + labels: + pv: nginx-log-pv +spec: + accessModes: + - ReadWriteOnce #访问模式定义为只能以读写的方式挂载到单个节点 + capacity: + storage: 2Gi + persistentVolumeReclaimPolicy: Retain + storageClassName: nfs + nfs: + path: /mnt/nfsdata/nginx/log + server: 172.16.0.7 diff --git a/esua-epdc/k8s/kongcun/app-master/nginx/nginx-pvc.yml b/esua-epdc/k8s/kongcun/app-master/nginx/nginx-pvc.yml new file mode 100644 index 000000000..fa021eb1d --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/nginx/nginx-pvc.yml @@ -0,0 +1,61 @@ +#nginx数据PVC +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: nginx-data-pvc + namespace: epdc-nginx + labels: + pvc: nginx-data-pvc +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi + storageClassName: nfs + selector: + matchLabels: + pv: nginx-data-pv + +--- + +#nginx配置PVC +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: nginx-etc-pvc + namespace: epdc-nginx + labels: + pvc: nginx-etc-pvc +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + storageClassName: nfs + selector: + matchLabels: + pv: nginx-etc-pv + +--- + +#nginx日志PVC + +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: nginx-log-pvc + namespace: epdc-nginx + labels: + pvc: nginx-log-pvc +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi + storageClassName: nfs + selector: + matchLabels: + pv: nginx-log-pv diff --git a/esua-epdc/k8s/kongcun/app-master/nginx/nginx-svc.yml b/esua-epdc/k8s/kongcun/app-master/nginx/nginx-svc.yml new file mode 100644 index 000000000..af4cf986d --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/nginx/nginx-svc.yml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: nginx-svc + namespace: epdc-nginx + labels: + svc: nginx-svc +spec: + type: NodePort + ports: + - port: 443 + protocol: TCP + targetPort: 443 + nodePort: 443 + selector: + app: mysql-master-pod diff --git a/esua-epdc/pom.xml b/esua-epdc/pom.xml index dd49e5c39..acac2690f 100644 --- a/esua-epdc/pom.xml +++ b/esua-epdc/pom.xml @@ -38,6 +38,7 @@ prod registry.cn-qingdao.aliyuncs.com/esua-epdc-shibei/ 9508 + 2.1.1.RELEASE @@ -71,6 +72,12 @@ seata-all ${seata.version} + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + 2.1.1.RELEASE + @@ -116,22 +123,6 @@ - - - - - - - - - - - - - - - - elink-release aliyun nexus @@ -140,6 +131,14 @@ true + + centerl-release + centerl + https://repo1.maven.org/maven2/ + + true + + sonatype sonatype nexus diff --git a/renren-cloud-generator/src/main/resources/application.yml b/renren-cloud-generator/src/main/resources/application.yml index dc0f5909f..91fe3458c 100644 --- a/renren-cloud-generator/src/main/resources/application.yml +++ b/renren-cloud-generator/src/main/resources/application.yml @@ -9,7 +9,7 @@ spring: type: com.alibaba.druid.pool.DruidDataSource #MySQL配置 driverClassName: com.mysql.jdbc.Driver - url: jdbc:mysql://47.104.224.45:3308/esua_epdc_group?useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://47.104.224.45:3308/esua_epdc_kpi?useUnicode=true&characterEncoding=UTF-8&useSSL=false username: epdc password: elink833066 #oracle配置 diff --git a/renren-cloud-generator/src/main/resources/generator.properties b/renren-cloud-generator/src/main/resources/generator.properties index 7cdad8a6b..9e9f68440 100644 --- a/renren-cloud-generator/src/main/resources/generator.properties +++ b/renren-cloud-generator/src/main/resources/generator.properties @@ -3,7 +3,7 @@ main= #\u5305\u540D package=com.elink.esua.epdc -moduleName=news +moduleName=kpi #\u4F5C\u8005 author=qu #\u7248\u672C\u53F7