674 changed files with 38909 additions and 5055 deletions
@ -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 '处理部门角色权限表';; |
|||
@ -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 |
|||
|
|||
@ -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 |
|||
|
|||
@ -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"; |
|||
} |
|||
@ -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; |
|||
} |
|||
@ -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<java.util.List < java.lang.String>> |
|||
* @Author yinzuomei |
|||
* @Description 查询角色对应的项目处理类型权限 |
|||
* @Date 2019/12/24 17:17 |
|||
**/ |
|||
@GetMapping(value = "events/handlerolecategory/queryCategoryIdList/{roleId}") |
|||
Result<List<String>> 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<java.util.List < java.lang.Long>> |
|||
* @Author yinzuomei |
|||
* @Description 查询角色对应可吹哨部门权限 |
|||
* @Date 2019/12/26 14:09 |
|||
**/ |
|||
@GetMapping(value = "events/handleroledept/queryWhistleDeptIdList/{roleId}") |
|||
Result<List<Long>> queryWhistleDeptIdList(@PathVariable("roleId")Long roleId); |
|||
} |
|||
@ -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<List<String>> 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<List<Long>> queryWhistleDeptIdList(Long roleId) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "queryWhistleDeptIdList", roleId); |
|||
} |
|||
|
|||
} |
|||
@ -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; |
|||
} |
|||
} |
|||
} |
|||
@ -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; |
|||
|
|||
} |
|||
@ -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 extends DeptScope> T loadDeptInfo(DeptDto dto, Class<T> 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 <T extends DeptScope> void loadDeptInfo(DeptDto dto, T entity) { |
|||
entity.setAllDeptIds(dto.getAllDeptIds()); |
|||
entity.setAllDeptNames(dto.getAllDeptNames()); |
|||
entity.setParentDeptIds(dto.getParentDeptIds()); |
|||
entity.setParentDeptNames(dto.getParentDeptNames()); |
|||
} |
|||
} |
|||
@ -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"; |
|||
} |
|||
@ -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"; |
|||
} |
|||
@ -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 = ":"; |
|||
} |
|||
@ -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; |
|||
} |
|||
} |
|||
@ -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; |
|||
} |
|||
} |
|||
@ -0,0 +1,40 @@ |
|||
package com.elink.esua.epdc.commons.tools.enums.pointsenum; |
|||
|
|||
/** |
|||
* @Auther: yinzuomei |
|||
* @Date: 2020/2/6 14:01 |
|||
* @Description: 积分行为编码 |
|||
*/ |
|||
public enum PointsBehaviorCodeEnum { |
|||
LIKE("like", "赞"), |
|||
DISLIKE("dislike", "踩"), |
|||
SHARE("share", "分享"), |
|||
CLOCK("clock", "打卡"), |
|||
COMMENT("comment", "评论"), |
|||
BREAK_PROMISE("break_promise", "爽约"), |
|||
JOIN_ACT("join_act", "活动积分"); |
|||
|
|||
private String behaviorCode; |
|||
private String name; |
|||
|
|||
PointsBehaviorCodeEnum(String behaviorCode, String name) { |
|||
this.behaviorCode = behaviorCode; |
|||
this.name = name; |
|||
} |
|||
|
|||
public String getBehaviorCode() { |
|||
return behaviorCode; |
|||
} |
|||
|
|||
public void setBehaviorCode(String behaviorCode) { |
|||
this.behaviorCode = behaviorCode; |
|||
} |
|||
|
|||
public String getName() { |
|||
return name; |
|||
} |
|||
|
|||
public void setName(String name) { |
|||
this.name = name; |
|||
} |
|||
} |
|||
@ -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; |
|||
} |
|||
} |
|||
@ -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; |
|||
} |
|||
} |
|||
@ -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; |
|||
} |
|||
} |
|||
@ -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; |
|||
} |
|||
} |
|||
@ -0,0 +1,36 @@ |
|||
package com.elink.esua.epdc.commons.tools.enums.pointsenum; |
|||
|
|||
/** |
|||
* @Auther: yinzuomei |
|||
* @Date: 2020/2/6 14:00 |
|||
* @Description: 积分规则编码 |
|||
*/ |
|||
public enum PointsRuleCodeEnum { |
|||
CANCEL_ACT("cancel_act", "取消报名系统扣减积分"), |
|||
CONFIRM_JOIN_ACT("confirm_join_act", "参与活动确认积分"); |
|||
|
|||
private String ruleCode; |
|||
private String name; |
|||
|
|||
PointsRuleCodeEnum(String ruleCode, String name) { |
|||
this.ruleCode = ruleCode; |
|||
this.name = name; |
|||
} |
|||
|
|||
public String getRuleCode() { |
|||
return ruleCode; |
|||
} |
|||
|
|||
public void setRuleCode(String ruleCode) { |
|||
this.ruleCode = ruleCode; |
|||
} |
|||
|
|||
public String getName() { |
|||
return name; |
|||
} |
|||
|
|||
public void setName(String name) { |
|||
this.name = name; |
|||
} |
|||
} |
|||
|
|||
@ -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; |
|||
} |
|||
} |
|||
@ -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); |
|||
} |
|||
} |
|||
|
|||
|
|||
@ -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); |
|||
} |
|||
|
|||
} |
|||
@ -1,64 +0,0 @@ |
|||
package com.elink.esua.epdc.dto.issue.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @Description 议题列表DTO |
|||
* @Author yinzuomei |
|||
* @Date 2020/2/10 15:58 |
|||
*/ |
|||
@Data |
|||
public class IssueResultDTO implements Serializable { |
|||
/** |
|||
* epdc_issue主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 议题内容 |
|||
*/ |
|||
private String issueContent; |
|||
|
|||
/** |
|||
* 来源网格-所有部门 |
|||
*/ |
|||
private String allDeptNames; |
|||
|
|||
/** |
|||
* 用户昵称 |
|||
*/ |
|||
private String nickName; |
|||
|
|||
/** |
|||
* 发布时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 支持-点赞次数 |
|||
*/ |
|||
private Integer approveNum; |
|||
|
|||
/** |
|||
* 反对-踩次数 |
|||
*/ |
|||
private Integer opposeNum; |
|||
|
|||
/** |
|||
* 评论数 |
|||
*/ |
|||
private Integer commentNum; |
|||
|
|||
/** |
|||
* 浏览数 |
|||
*/ |
|||
private Integer browseNum; |
|||
|
|||
/** |
|||
* 表达态度(评论+回复+浏览) |
|||
*/ |
|||
private Integer expressAttitudeNum; |
|||
} |
|||
@ -1,63 +0,0 @@ |
|||
package com.elink.esua.epdc.dto.item.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @Description 项目列表DTO |
|||
* @Author yinzuomei |
|||
* @Date 2020/2/10 13:44 |
|||
*/ |
|||
@Data |
|||
public class ItemResultDTO implements Serializable { |
|||
/** |
|||
* epdc_item表主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 议题内容-项目摘要 |
|||
*/ |
|||
private String itemContent; |
|||
|
|||
/** |
|||
* 所有部门 |
|||
*/ |
|||
private String allDeptNames; |
|||
|
|||
/** |
|||
* 发布人用户昵称 |
|||
*/ |
|||
private String nickName; |
|||
/** |
|||
* 发布时间 |
|||
*/ |
|||
private Date releaseTime; |
|||
|
|||
/** |
|||
* 支持-点赞次数 |
|||
*/ |
|||
private Integer approveNum; |
|||
|
|||
/** |
|||
* 反对-踩次数 |
|||
*/ |
|||
private Integer opposeNum; |
|||
|
|||
/** |
|||
* 评论数 |
|||
*/ |
|||
private Integer commentNum; |
|||
|
|||
/** |
|||
* 浏览数 |
|||
*/ |
|||
private Integer browseNum; |
|||
|
|||
/** |
|||
* 表达态度(评论+回复+浏览) |
|||
*/ |
|||
private Integer expressAttitudeNum; |
|||
} |
|||
@ -1,61 +0,0 @@ |
|||
package com.elink.esua.epdc.dto.topic.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @Description 话题列表DTO |
|||
* @Author yinzuomei |
|||
* @Date 2020/2/10 11:31 |
|||
*/ |
|||
@Data |
|||
public class TopicResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -1938141144074477454L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 话题摘要 |
|||
*/ |
|||
private String topicContent; |
|||
|
|||
/** |
|||
* 所有部门 |
|||
*/ |
|||
private String allDeptNames; |
|||
|
|||
/** |
|||
* 网格来源群名称 |
|||
*/ |
|||
private String groupName; |
|||
|
|||
/** |
|||
* 话题发布人姓名 |
|||
*/ |
|||
private String nickName; |
|||
|
|||
/** |
|||
* 发布时间 |
|||
*/ |
|||
private Date releaseTime; |
|||
|
|||
/** |
|||
* 评论数(评论+回复) |
|||
*/ |
|||
private Integer commentNum; |
|||
|
|||
/** |
|||
* 浏览数 |
|||
*/ |
|||
private Integer browseNum; |
|||
|
|||
/** |
|||
* 表达态度(评论+回复+浏览) |
|||
*/ |
|||
private Integer expressAttitudeNum; |
|||
} |
|||
@ -1,205 +0,0 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" 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"> |
|||
<modelVersion>4.0.0</modelVersion> |
|||
<parent> |
|||
<groupId>com.esua.epdc</groupId> |
|||
<artifactId>epdc-analysis</artifactId> |
|||
<version>1.0.0</version> |
|||
</parent> |
|||
|
|||
<artifactId>epdc-analysis-server</artifactId> |
|||
<packaging>jar</packaging> |
|||
|
|||
<dependencies> |
|||
<dependency> |
|||
<groupId>com.esua.epdc</groupId> |
|||
<artifactId>epdc-analysis-client</artifactId> |
|||
<version>1.0.0</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.esua.epdc</groupId> |
|||
<artifactId>epdc-commons-tools</artifactId> |
|||
<version>1.0.0</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.esua.epdc</groupId> |
|||
<artifactId>epdc-commons-mybatis</artifactId> |
|||
<version>1.0.0</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-web</artifactId> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.springframework</groupId> |
|||
<artifactId>spring-context-support</artifactId> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>de.codecentric</groupId> |
|||
<artifactId>spring-boot-admin-starter-client</artifactId> |
|||
<version>${spring.boot.admin.version}</version> |
|||
</dependency> |
|||
|
|||
<!-- nacos start --> |
|||
<dependency> |
|||
<groupId>com.alibaba.cloud</groupId> |
|||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> |
|||
</dependency> |
|||
<!-- nacos end --> |
|||
<!--版本控制--> |
|||
<dependency> |
|||
<groupId>com.esua.epdc</groupId> |
|||
<artifactId>epdc-commons-api-version-control</artifactId> |
|||
<version>${project.version}</version> |
|||
</dependency> |
|||
</dependencies> |
|||
|
|||
<build> |
|||
<finalName>${project.artifactId}</finalName> |
|||
<plugins> |
|||
<plugin> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-maven-plugin</artifactId> |
|||
</plugin> |
|||
<plugin> |
|||
<groupId>org.apache.maven.plugins</groupId> |
|||
<artifactId>maven-surefire-plugin</artifactId> |
|||
<configuration> |
|||
<skipTests>true</skipTests> |
|||
</configuration> |
|||
</plugin> |
|||
<plugin> |
|||
<groupId>org.apache.maven.plugins</groupId> |
|||
<artifactId>maven-deploy-plugin</artifactId> |
|||
<configuration> |
|||
<skip>true</skip> |
|||
</configuration> |
|||
</plugin> |
|||
<plugin> |
|||
<groupId>com.spotify</groupId> |
|||
<artifactId>dockerfile-maven-plugin</artifactId> |
|||
</plugin> |
|||
</plugins> |
|||
|
|||
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory> |
|||
|
|||
<resources> |
|||
<resource> |
|||
<filtering>true</filtering> |
|||
<directory>${basedir}/src/main/resources</directory> |
|||
<includes> |
|||
<include>**/application*.yml</include> |
|||
<include>**/*.properties</include> |
|||
<include>logback-spring.xml</include> |
|||
<include>registry.conf</include> |
|||
</includes> |
|||
</resource> |
|||
<resource> |
|||
<directory>${basedir}/src/main/resources</directory> |
|||
<excludes> |
|||
<exclude>**/application*.yml</exclude> |
|||
<exclude>**/*.properties</exclude> |
|||
<exclude>logback-spring.xml</exclude> |
|||
<exclude>registry.conf</exclude> |
|||
</excludes> |
|||
</resource> |
|||
</resources> |
|||
</build> |
|||
|
|||
<profiles> |
|||
<profile> |
|||
<id>dev</id> |
|||
<activation> |
|||
<activeByDefault>true</activeByDefault> |
|||
</activation> |
|||
<properties> |
|||
<spring.profiles.active>dev</spring.profiles.active> |
|||
|
|||
<server.port>9077</server.port> |
|||
|
|||
<spring.redis.index>2</spring.redis.index> |
|||
<spring.redis.host>47.104.224.45</spring.redis.host> |
|||
<spring.redis.port>6379</spring.redis.port> |
|||
<spring.redis.password>elink@888</spring.redis.password> |
|||
|
|||
<nacos.register-enabled>false</nacos.register-enabled> |
|||
<nacos.server-addr>47.104.224.45:8848</nacos.server-addr> |
|||
</properties> |
|||
</profile> |
|||
|
|||
<profile> |
|||
<id>test</id> |
|||
<properties> |
|||
<spring.profiles.active>test</spring.profiles.active> |
|||
|
|||
<server.port>9077</server.port> |
|||
|
|||
<spring.redis.index>2</spring.redis.index> |
|||
<spring.redis.host>47.104.224.45</spring.redis.host> |
|||
<spring.redis.port>6379</spring.redis.port> |
|||
<spring.redis.password>elink@888</spring.redis.password> |
|||
|
|||
<nacos.register-enabled>true</nacos.register-enabled> |
|||
<nacos.server-addr>47.104.224.45:8848</nacos.server-addr> |
|||
</properties> |
|||
</profile> |
|||
|
|||
<profile> |
|||
<id>prod</id> |
|||
<properties> |
|||
<spring.profiles.active>prod</spring.profiles.active> |
|||
|
|||
<server.port>9077</server.port> |
|||
|
|||
<!-- redis配置 --> |
|||
<spring.redis.index>0</spring.redis.index> |
|||
<spring.redis.host>10.5.34.164</spring.redis.host> |
|||
<spring.redis.port>6379</spring.redis.port> |
|||
<spring.redis.password>Elink@833066</spring.redis.password> |
|||
<!-- nacos --> |
|||
<nacos.register-enabled>true</nacos.register-enabled> |
|||
<nacos.server-addr>10.5.34.164:8848</nacos.server-addr> |
|||
</properties> |
|||
</profile> |
|||
|
|||
<profile> |
|||
<id>prod_kongcun</id> |
|||
<properties> |
|||
<spring.profiles.active>prod</spring.profiles.active> |
|||
|
|||
<server.port>9077</server.port> |
|||
|
|||
<!-- redis配置 --> |
|||
<spring.redis.index>0</spring.redis.index> |
|||
<spring.redis.host>172.16.1.238</spring.redis.host> |
|||
<spring.redis.port>6379</spring.redis.port> |
|||
<spring.redis.password>Elink833066</spring.redis.password> |
|||
|
|||
<!-- nacos --> |
|||
<nacos.register-enabled>true</nacos.register-enabled> |
|||
<nacos.server-addr>172.16.1.238:8848</nacos.server-addr> |
|||
</properties> |
|||
</profile> |
|||
|
|||
<profile> |
|||
<id>prod_shibei_aliyun</id> |
|||
<properties> |
|||
<spring.profiles.active>prod</spring.profiles.active> |
|||
|
|||
<server.port>9077</server.port> |
|||
|
|||
<!-- redis配置 --> |
|||
<spring.redis.index>0</spring.redis.index> |
|||
<spring.redis.host>172.16.0.54</spring.redis.host> |
|||
<spring.redis.port>6379</spring.redis.port> |
|||
<spring.redis.password>Elink833066</spring.redis.password> |
|||
|
|||
<!-- nacos --> |
|||
<nacos.register-enabled>true</nacos.register-enabled> |
|||
<nacos.server-addr>172.16.0.52:8848</nacos.server-addr> |
|||
</properties> |
|||
</profile> |
|||
</profiles> |
|||
|
|||
</project> |
|||
@ -1,31 +0,0 @@ |
|||
/** |
|||
* Copyright (c) 2018 人人开源 All rights reserved. |
|||
* |
|||
* https://www.renren.io
|
|||
* |
|||
* 版权所有,侵权必究! |
|||
*/ |
|||
|
|||
package com.elink.esua.epdc; |
|||
|
|||
import org.springframework.boot.SpringApplication; |
|||
import org.springframework.boot.autoconfigure.SpringBootApplication; |
|||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
|||
import org.springframework.cloud.openfeign.EnableFeignClients; |
|||
|
|||
/** |
|||
* 模块 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since 1.0.0 |
|||
*/ |
|||
@SpringBootApplication |
|||
@EnableDiscoveryClient |
|||
@EnableFeignClients |
|||
public class AnalysisApplication { |
|||
|
|||
public static void main(String[] args) { |
|||
SpringApplication.run(AnalysisApplication.class, args); |
|||
} |
|||
|
|||
} |
|||
@ -1,26 +0,0 @@ |
|||
/** |
|||
* Copyright (c) 2018 人人开源 All rights reserved. |
|||
* <p> |
|||
* https://www.renren.io
|
|||
* <p> |
|||
* 版权所有,侵权必究! |
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.config; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.config.ModuleConfig; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* 模块配置信息 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since 1.0.0 |
|||
*/ |
|||
@Service |
|||
public class ModuleConfigImpl implements ModuleConfig { |
|||
@Override |
|||
public String getName() { |
|||
return "analysis"; |
|||
} |
|||
} |
|||
@ -1,22 +0,0 @@ |
|||
package com.elink.esua.epdc.datasources; |
|||
|
|||
/** |
|||
* |
|||
* 增加多数据源,在此配置 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/2/9 14:50 |
|||
*/ |
|||
public interface DataSourceNames { |
|||
String FIRST = "first"; |
|||
String SECOND = "second"; |
|||
String THIRD = "third"; |
|||
String FOURTH = "fourth"; |
|||
String FIFTH = "fifth"; |
|||
String SIXTH = "sixth"; |
|||
String SEVENTH = "seventh"; |
|||
String EIGHTH = "eighth"; |
|||
String NINTH = "ninth"; |
|||
String TENTH = "tenth"; |
|||
String ELEVENTH = "eleventh"; |
|||
} |
|||
@ -1,41 +0,0 @@ |
|||
package com.elink.esua.epdc.datasources; |
|||
|
|||
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; |
|||
|
|||
import javax.sql.DataSource; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* |
|||
* 动态数据源 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/2/9 14:59 |
|||
*/ |
|||
public class DynamicDataSource extends AbstractRoutingDataSource { |
|||
|
|||
private static final ThreadLocal<String> contextHolder = new ThreadLocal<>(); |
|||
|
|||
public DynamicDataSource(DataSource defaultTargetDataSource, Map<Object, Object> targetDataSources) { |
|||
super.setDefaultTargetDataSource(defaultTargetDataSource); |
|||
super.setTargetDataSources(targetDataSources); |
|||
super.afterPropertiesSet(); |
|||
} |
|||
|
|||
@Override |
|||
protected Object determineCurrentLookupKey() { |
|||
return getDataSource(); |
|||
} |
|||
|
|||
public static void setDataSource(String dataSource) { |
|||
contextHolder.set(dataSource); |
|||
} |
|||
|
|||
public static String getDataSource() { |
|||
return contextHolder.get(); |
|||
} |
|||
|
|||
public static void clearDataSource() { |
|||
contextHolder.remove(); |
|||
} |
|||
} |
|||
@ -1,111 +0,0 @@ |
|||
package com.elink.esua.epdc.datasources; |
|||
|
|||
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder; |
|||
import org.springframework.boot.context.properties.ConfigurationProperties; |
|||
import org.springframework.context.annotation.Bean; |
|||
import org.springframework.context.annotation.Configuration; |
|||
import org.springframework.context.annotation.Primary; |
|||
|
|||
import javax.sql.DataSource; |
|||
import java.util.HashMap; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* |
|||
* 配置多数据源 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/2/9 15:04 |
|||
*/ |
|||
@Configuration |
|||
public class DynamicDataSourceConfig { |
|||
|
|||
@Bean |
|||
@ConfigurationProperties("spring.datasource.druid.first") |
|||
public DataSource firstDataSource() { |
|||
return DruidDataSourceBuilder.create().build(); |
|||
} |
|||
|
|||
@Bean |
|||
@ConfigurationProperties("spring.datasource.druid.second") |
|||
public DataSource secondDataSource() { |
|||
return DruidDataSourceBuilder.create().build(); |
|||
} |
|||
|
|||
@Bean |
|||
@ConfigurationProperties("spring.datasource.druid.third") |
|||
public DataSource thirdDataSource() { |
|||
return DruidDataSourceBuilder.create().build(); |
|||
} |
|||
|
|||
@Bean |
|||
@ConfigurationProperties("spring.datasource.druid.fourth") |
|||
public DataSource fourthDataSource() { |
|||
return DruidDataSourceBuilder.create().build(); |
|||
} |
|||
|
|||
@Bean |
|||
@ConfigurationProperties("spring.datasource.druid.fifth") |
|||
public DataSource fifthDataSource() { |
|||
return DruidDataSourceBuilder.create().build(); |
|||
} |
|||
|
|||
@Bean |
|||
@ConfigurationProperties("spring.datasource.druid.sixth") |
|||
public DataSource sixthDataSource() { |
|||
return DruidDataSourceBuilder.create().build(); |
|||
} |
|||
|
|||
@Bean |
|||
@ConfigurationProperties("spring.datasource.druid.seventh") |
|||
public DataSource seventhDataSource() { |
|||
return DruidDataSourceBuilder.create().build(); |
|||
} |
|||
|
|||
@Bean |
|||
@ConfigurationProperties("spring.datasource.druid.eighth") |
|||
public DataSource eighthDataSource() { |
|||
return DruidDataSourceBuilder.create().build(); |
|||
} |
|||
|
|||
@Bean |
|||
@ConfigurationProperties("spring.datasource.druid.ninth") |
|||
public DataSource ninthDataSource() { |
|||
return DruidDataSourceBuilder.create().build(); |
|||
} |
|||
|
|||
@Bean |
|||
@ConfigurationProperties("spring.datasource.druid.tenth") |
|||
public DataSource tenthDataSource() { |
|||
return DruidDataSourceBuilder.create().build(); |
|||
} |
|||
|
|||
@Bean |
|||
@ConfigurationProperties("spring.datasource.druid.eleventh") |
|||
public DataSource eleventhDataSource() { |
|||
return DruidDataSourceBuilder.create().build(); |
|||
} |
|||
|
|||
@Bean |
|||
@Primary |
|||
public DynamicDataSource dataSource(DataSource firstDataSource, DataSource secondDataSource, |
|||
DataSource thirdDataSource, DataSource fourthDataSource, |
|||
DataSource fifthDataSource, DataSource sixthDataSource, |
|||
DataSource seventhDataSource, DataSource eighthDataSource, |
|||
DataSource ninthDataSource, DataSource tenthDataSource, |
|||
DataSource eleventhDataSource) { |
|||
Map<Object, Object> targetDataSources = new HashMap<>(); |
|||
targetDataSources.put(DataSourceNames.FIRST, firstDataSource); |
|||
targetDataSources.put(DataSourceNames.SECOND, secondDataSource); |
|||
targetDataSources.put(DataSourceNames.THIRD, thirdDataSource); |
|||
targetDataSources.put(DataSourceNames.FOURTH, fourthDataSource); |
|||
targetDataSources.put(DataSourceNames.FIFTH, fifthDataSource); |
|||
targetDataSources.put(DataSourceNames.SIXTH, sixthDataSource); |
|||
targetDataSources.put(DataSourceNames.SEVENTH, seventhDataSource); |
|||
targetDataSources.put(DataSourceNames.EIGHTH, eighthDataSource); |
|||
targetDataSources.put(DataSourceNames.NINTH, ninthDataSource); |
|||
targetDataSources.put(DataSourceNames.TENTH, tenthDataSource); |
|||
targetDataSources.put(DataSourceNames.ELEVENTH, eleventhDataSource); |
|||
return new DynamicDataSource(firstDataSource, targetDataSources); |
|||
} |
|||
} |
|||
@ -1,17 +0,0 @@ |
|||
package com.elink.esua.epdc.datasources.annotation; |
|||
|
|||
import java.lang.annotation.*; |
|||
|
|||
/** |
|||
* |
|||
* 多数据源注解 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/2/9 14:50 |
|||
*/ |
|||
@Target(ElementType.METHOD) |
|||
@Retention(RetentionPolicy.RUNTIME) |
|||
@Documented |
|||
public @interface DataSource { |
|||
String name() default ""; |
|||
} |
|||
@ -1,61 +0,0 @@ |
|||
package com.elink.esua.epdc.datasources.aspect; |
|||
|
|||
import com.elink.esua.epdc.datasources.DataSourceNames; |
|||
import com.elink.esua.epdc.datasources.DynamicDataSource; |
|||
import com.elink.esua.epdc.datasources.annotation.DataSource; |
|||
import org.aspectj.lang.ProceedingJoinPoint; |
|||
import org.aspectj.lang.annotation.Around; |
|||
import org.aspectj.lang.annotation.Aspect; |
|||
import org.aspectj.lang.annotation.Pointcut; |
|||
import org.aspectj.lang.reflect.MethodSignature; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.core.Ordered; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.lang.reflect.Method; |
|||
|
|||
/** |
|||
* |
|||
* 多数据源,切面处理类 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/2/9 15:12 |
|||
*/ |
|||
@Aspect |
|||
@Component |
|||
public class DataSourceAspect implements Ordered { |
|||
protected Logger logger = LoggerFactory.getLogger(getClass()); |
|||
|
|||
@Pointcut("@annotation(com.elink.esua.epdc.datasources.annotation.DataSource)") |
|||
public void dataSourcePointCut() { |
|||
|
|||
} |
|||
|
|||
@Around("dataSourcePointCut()") |
|||
public Object around(ProceedingJoinPoint point) throws Throwable { |
|||
MethodSignature signature = (MethodSignature) point.getSignature(); |
|||
Method method = signature.getMethod(); |
|||
|
|||
DataSource ds = method.getAnnotation(DataSource.class); |
|||
if(ds == null){ |
|||
DynamicDataSource.setDataSource(DataSourceNames.FIRST); |
|||
logger.debug("set datasource is " + DataSourceNames.FIRST); |
|||
}else { |
|||
DynamicDataSource.setDataSource(ds.name()); |
|||
logger.debug("set datasource is " + ds.name()); |
|||
} |
|||
|
|||
try { |
|||
return point.proceed(); |
|||
} finally { |
|||
DynamicDataSource.clearDataSource(); |
|||
logger.debug("clean datasource"); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public int getOrder() { |
|||
return 1; |
|||
} |
|||
} |
|||
@ -1,52 +0,0 @@ |
|||
package com.elink.esua.epdc.modules.issue.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.issue.result.IssueResultDTO; |
|||
import com.elink.esua.epdc.modules.issue.service.IssueService; |
|||
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.RequestParam; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @Description 议题相关 |
|||
* @Author yinzuomei |
|||
* @Date 2020/2/10 16:06 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("issue") |
|||
public class IssueController { |
|||
@Autowired |
|||
private IssueService issueService; |
|||
|
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.dto.issue.result.IssueResultDTO |
|||
* @Author yinzuomei |
|||
* @Description 最热议题列表 |
|||
* @Date 2020/2/10 16:15 |
|||
**/ |
|||
@GetMapping("pageHottestIssue") |
|||
public Result<PageData<IssueResultDTO>> pageHottestIssue(@RequestParam Map<String, Object> params) { |
|||
PageData<IssueResultDTO> page = issueService.listHottestIssue(params); |
|||
return new Result<PageData<IssueResultDTO>>().ok(page); |
|||
} |
|||
|
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.dto.issue.result.IssueResultDTO |
|||
* @Author yinzuomei |
|||
* @Description 最新议题列表 |
|||
* @Date 2020/2/10 16:15 |
|||
**/ |
|||
@GetMapping("pageLatestIssue") |
|||
public Result<PageData<IssueResultDTO>> pageLatestIssue(@RequestParam Map<String, Object> params) { |
|||
PageData<IssueResultDTO> page = issueService.listLatestIssue(params); |
|||
return new Result<PageData<IssueResultDTO>>().ok(page); |
|||
} |
|||
|
|||
} |
|||
@ -1,31 +0,0 @@ |
|||
package com.elink.esua.epdc.modules.issue.service; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.dto.issue.result.IssueResultDTO; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @Description 议题相关 |
|||
* @Author yinzuomei |
|||
* @Date 2020/2/10 16:06 |
|||
*/ |
|||
public interface IssueService { |
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.issue.result.IssueResultDTO> |
|||
* @Author yinzuomei |
|||
* @Description 最热议题列表 |
|||
* @Date 2020/2/10 16:16 |
|||
**/ |
|||
PageData<IssueResultDTO> listHottestIssue(Map<String, Object> params); |
|||
|
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.issue.result.IssueResultDTO> |
|||
* @Author yinzuomei |
|||
* @Description 最新议题列表 |
|||
* @Date 2020/2/10 16:16 |
|||
**/ |
|||
PageData<IssueResultDTO> listLatestIssue(Map<String, Object> params); |
|||
} |
|||
@ -1,59 +0,0 @@ |
|||
package com.elink.esua.epdc.modules.issue.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; |
|||
import com.elink.esua.epdc.commons.tools.security.user.UserDetail; |
|||
import com.elink.esua.epdc.datasources.DataSourceNames; |
|||
import com.elink.esua.epdc.datasources.annotation.DataSource; |
|||
import com.elink.esua.epdc.dto.issue.result.IssueResultDTO; |
|||
import com.elink.esua.epdc.modules.issue.dao.IssueDao; |
|||
import com.elink.esua.epdc.modules.issue.service.IssueService; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @Description 议题相关 |
|||
* @Author yinzuomei |
|||
* @Date 2020/2/10 16:06 |
|||
*/ |
|||
@Service |
|||
public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueResultDTO> implements IssueService { |
|||
|
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.issue.result.IssueResultDTO> |
|||
* @Author yinzuomei |
|||
* @Description 最热议题列表 |
|||
* @Date 2020/2/10 16:17 |
|||
**/ |
|||
@DataSource(name = DataSourceNames.FOURTH) |
|||
@Override |
|||
public PageData<IssueResultDTO> listHottestIssue(Map<String, Object> params) { |
|||
UserDetail userDetail= SecurityUser.getUser(); |
|||
params.put("deptIdList",userDetail.getDeptIdList()); |
|||
IPage<IssueResultDTO> page = getPage(params); |
|||
List<IssueResultDTO> list = baseDao.selectListHottestIssue(params); |
|||
return new PageData<>(list, page.getTotal()); |
|||
} |
|||
|
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.issue.result.IssueResultDTO> |
|||
* @Author yinzuomei |
|||
* @Description 最新议题列表 |
|||
* @Date 2020/2/10 16:17 |
|||
**/ |
|||
@DataSource(name = DataSourceNames.FOURTH) |
|||
@Override |
|||
public PageData<IssueResultDTO> listLatestIssue(Map<String, Object> params) { |
|||
UserDetail userDetail= SecurityUser.getUser(); |
|||
params.put("deptIdList",userDetail.getDeptIdList()); |
|||
IPage<IssueResultDTO> page = getPage(params); |
|||
List<IssueResultDTO> list = baseDao.selectListLatestIssue(params); |
|||
return new PageData<>(list, page.getTotal()); |
|||
} |
|||
} |
|||
@ -1,59 +0,0 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.item.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.item.result.ItemResultDTO; |
|||
import com.elink.esua.epdc.modules.item.service.ItemService; |
|||
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.RequestParam; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 项目表 项目表 |
|||
* |
|||
* @author yujintao yujintao@elink-cn.com |
|||
* @since v1.0.0 2019-09-04 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("item") |
|||
public class ItemController { |
|||
|
|||
@Autowired |
|||
private ItemService itemService; |
|||
|
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.dto.item.result.ItemResultDTO |
|||
* @Author yinzuomei |
|||
* @Description 最热项目列表查询 |
|||
* @Date 2020/2/10 13:45 |
|||
**/ |
|||
@GetMapping("pageHottestItem") |
|||
public Result<PageData<ItemResultDTO>> pageHottestItem(@RequestParam Map<String, Object> params) { |
|||
PageData<ItemResultDTO> page = itemService.listItemResultDTO(params); |
|||
return new Result<PageData<ItemResultDTO>>().ok(page); |
|||
} |
|||
|
|||
} |
|||
@ -1,24 +0,0 @@ |
|||
package com.elink.esua.epdc.modules.item.service; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.dto.item.result.ItemResultDTO; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 项目模块 |
|||
* |
|||
* @Author yinzuomei |
|||
* @Date 2020/2/10 13:43 |
|||
*/ |
|||
public interface ItemService { |
|||
|
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.dto.item.result.ItemResultDTO |
|||
* @Author yinzuomei |
|||
* @Description 最热项目列表查询 |
|||
* @Date 2020/2/10 13:46 |
|||
**/ |
|||
PageData<ItemResultDTO> listItemResultDTO(Map<String, Object> params); |
|||
} |
|||
@ -1,41 +0,0 @@ |
|||
package com.elink.esua.epdc.modules.item.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; |
|||
import com.elink.esua.epdc.commons.tools.security.user.UserDetail; |
|||
import com.elink.esua.epdc.datasources.DataSourceNames; |
|||
import com.elink.esua.epdc.datasources.annotation.DataSource; |
|||
import com.elink.esua.epdc.dto.item.result.ItemResultDTO; |
|||
import com.elink.esua.epdc.modules.item.dao.ItemDao; |
|||
import com.elink.esua.epdc.modules.item.service.ItemService; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @Description 项目模块 |
|||
* @Author yinzuomei |
|||
* @Date 2020/2/10 13:43 |
|||
*/ |
|||
@Service |
|||
public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemResultDTO> implements ItemService { |
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.dto.item.result.ItemResultDTO |
|||
* @Author yinzuomei |
|||
* @Description 最热项目列表查询 |
|||
* @Date 2020/2/10 13:47 |
|||
**/ |
|||
@DataSource(name = DataSourceNames.FOURTH) |
|||
@Override |
|||
public PageData<ItemResultDTO> listItemResultDTO(Map<String, Object> params) { |
|||
UserDetail userDetail = SecurityUser.getUser(); |
|||
params.put("deptIdList", userDetail.getDeptIdList()); |
|||
IPage<ItemResultDTO> page = getPage(params); |
|||
List<ItemResultDTO> list = baseDao.selectListHottestItemResultDTO(params); |
|||
return new PageData<>(list, page.getTotal()); |
|||
} |
|||
} |
|||
@ -1,71 +0,0 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.topic.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.topic.result.TopicResultDTO; |
|||
import com.elink.esua.epdc.modules.topic.service.TopicService; |
|||
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.RequestParam; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 话题相关接口 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-10-10 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("topic") |
|||
public class TopicController { |
|||
|
|||
@Autowired |
|||
private TopicService topicService; |
|||
|
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.dto.result.TopicResultDTO |
|||
* @Author yinzuomei |
|||
* @Description 最热话题列表查询 |
|||
* @Date 2020/2/10 11:34 |
|||
**/ |
|||
@GetMapping("pageHottestTopic") |
|||
public Result<PageData<TopicResultDTO>> pageHottestTopic(@RequestParam Map<String, Object> params) { |
|||
PageData<TopicResultDTO> page = topicService.listHottestTopic(params); |
|||
return new Result<PageData<TopicResultDTO>>().ok(page); |
|||
} |
|||
|
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.dto.result.TopicResultDTO |
|||
* @Author yinzuomei |
|||
* @Description 最新话题列表查询 |
|||
* @Date 2020/2/10 12:50 |
|||
**/ |
|||
@GetMapping("pageLatestTopic") |
|||
public Result<PageData<TopicResultDTO>> pageLatestTopic(@RequestParam Map<String, Object> params) { |
|||
PageData<TopicResultDTO> page = topicService.listLatestTopic(params); |
|||
return new Result<PageData<TopicResultDTO>>().ok(page); |
|||
} |
|||
} |
|||
@ -1,49 +0,0 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.topic.service; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.dto.topic.result.TopicResultDTO; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 话题相关Service |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-10-10 |
|||
*/ |
|||
public interface TopicService { |
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.dto.result.TopicResultDTO |
|||
* @Author yinzuomei |
|||
* @Description 最热话题列表查询 |
|||
* @Date 2020/2/10 11:34 |
|||
**/ |
|||
PageData<TopicResultDTO> listHottestTopic(Map<String, Object> params); |
|||
|
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.result.TopicResultDTO> |
|||
* @Author yinzuomei |
|||
* @Description 最新话题列表查询 |
|||
* @Date 2020/2/10 12:50 |
|||
**/ |
|||
PageData<TopicResultDTO> listLatestTopic(Map<String, Object> params); |
|||
} |
|||
@ -1,61 +0,0 @@ |
|||
package com.elink.esua.epdc.modules.topic.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; |
|||
import com.elink.esua.epdc.commons.tools.security.user.UserDetail; |
|||
import com.elink.esua.epdc.datasources.DataSourceNames; |
|||
import com.elink.esua.epdc.datasources.annotation.DataSource; |
|||
import com.elink.esua.epdc.dto.topic.result.TopicResultDTO; |
|||
import com.elink.esua.epdc.modules.topic.dao.TopicDao; |
|||
import com.elink.esua.epdc.modules.topic.service.TopicService; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @Description 话题相关Service |
|||
* @Author yinzuomei |
|||
* @Date 2020/2/10 10:56 |
|||
*/ |
|||
@Service |
|||
public class TopicServiceImpl extends BaseServiceImpl<TopicDao, TopicResultDTO> implements TopicService { |
|||
|
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.dto.result.HottestTopicResultDTO |
|||
* @Author yinzuomei |
|||
* @Description 最热话题列表查询 |
|||
* @Date 2020/2/10 12:53 |
|||
**/ |
|||
@DataSource(name = DataSourceNames.FIFTH) |
|||
@Override |
|||
public PageData<TopicResultDTO> listHottestTopic(Map<String, Object> params) { |
|||
UserDetail userDetail = SecurityUser.getUser(); |
|||
params.put("deptIdList", userDetail.getDeptIdList()); |
|||
IPage<TopicResultDTO> page = getPage(params); |
|||
List<TopicResultDTO> list = baseDao.selectListHottestTopicDTO(params); |
|||
return new PageData<>(list, page.getTotal()); |
|||
} |
|||
|
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.dto.result.LatestTopicResultDTO |
|||
* @Author yinzuomei |
|||
* @Description 最新话题列表查询 |
|||
* @Date 2020/2/10 12:53 |
|||
**/ |
|||
@DataSource(name = DataSourceNames.FIFTH) |
|||
@Override |
|||
public PageData<TopicResultDTO> listLatestTopic(Map<String, Object> params) { |
|||
UserDetail userDetail = SecurityUser.getUser(); |
|||
params.put("deptIdList", userDetail.getDeptIdList()); |
|||
IPage<TopicResultDTO> page = getPage(params); |
|||
List<TopicResultDTO> list = baseDao.selectListLatesttTopicDTO(params); |
|||
return new PageData<>(list, page.getTotal()); |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -1,21 +0,0 @@ |
|||
/** |
|||
* Copyright (c) 2018 人人开源 All rights reserved. |
|||
* |
|||
* https://www.renren.io
|
|||
* |
|||
* 版权所有,侵权必究! |
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.utils; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.constant.Constant; |
|||
|
|||
/** |
|||
* 模块常量 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since 1.1.0 |
|||
*/ |
|||
public interface ModuleConstant extends Constant { |
|||
|
|||
} |
|||
@ -1,74 +0,0 @@ |
|||
spring: |
|||
datasource: |
|||
type: com.alibaba.druid.pool.DruidDataSource |
|||
driverClassName: com.mysql.jdbc.Driver |
|||
druid: |
|||
first: #数据源1 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_admin?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
second: #数据源2 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_api?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
third: #数据源3 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_custom?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
fourth: #数据源4 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_events?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
fifth: #数据源5 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_group?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
sixth: #数据源6 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_job?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
seventh: #数据源7 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_kpi?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
eighth: #数据源8 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_mutuality?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
ninth: #数据源9 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_news?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
tenth: #数据源10 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_points?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
eleventh: #数据源11 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_user?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
initial-size: 10 |
|||
max-active: 100 |
|||
min-idle: 10 |
|||
max-wait: 60000 |
|||
pool-prepared-statements: true |
|||
max-pool-prepared-statement-per-connection-size: 20 |
|||
time-between-eviction-runs-millis: 60000 |
|||
min-evictable-idle-time-millis: 300000 |
|||
test-while-idle: true |
|||
test-on-borrow: false |
|||
test-on-return: false |
|||
stat-view-servlet: |
|||
enabled: true |
|||
url-pattern: /druid/* |
|||
filter: |
|||
stat: |
|||
log-slow-sql: true |
|||
slow-sql-millis: 1000 |
|||
merge-sql: false |
|||
wall: |
|||
config: |
|||
multi-statement-allow: true |
|||
jackson: |
|||
time-zone: GMT+8 |
|||
date-format: yyyy-MM-dd HH:mm:ss |
|||
@ -1,74 +0,0 @@ |
|||
spring: |
|||
datasource: |
|||
type: com.alibaba.druid.pool.DruidDataSource |
|||
driverClassName: com.mysql.jdbc.Driver |
|||
druid: |
|||
first: #数据源1 |
|||
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_admin?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: Elink@833066 |
|||
second: #数据源2 |
|||
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_api?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: Elink@833066 |
|||
third: #数据源3 |
|||
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_custom?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: Elink@833066 |
|||
fourth: #数据源4 |
|||
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_events?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: Elink@833066 |
|||
fifth: #数据源5 |
|||
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_group?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: Elink@833066 |
|||
sixth: #数据源6 |
|||
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_job?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: Elink@833066 |
|||
seventh: #数据源7 |
|||
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_kpi?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: Elink@833066 |
|||
eighth: #数据源8 |
|||
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_mutuality?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: Elink@833066 |
|||
ninth: #数据源9 |
|||
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_news?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: Elink@833066 |
|||
tenth: #数据源10 |
|||
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_points?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: Elink@833066 |
|||
eleventh: #数据源11 |
|||
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_user?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: Elink@833066 |
|||
initial-size: 10 |
|||
max-active: 100 |
|||
min-idle: 10 |
|||
max-wait: 60000 |
|||
pool-prepared-statements: true |
|||
max-pool-prepared-statement-per-connection-size: 20 |
|||
time-between-eviction-runs-millis: 60000 |
|||
min-evictable-idle-time-millis: 300000 |
|||
test-while-idle: true |
|||
test-on-borrow: false |
|||
test-on-return: false |
|||
stat-view-servlet: |
|||
enabled: true |
|||
url-pattern: /druid/* |
|||
filter: |
|||
stat: |
|||
log-slow-sql: true |
|||
slow-sql-millis: 1000 |
|||
merge-sql: false |
|||
wall: |
|||
config: |
|||
multi-statement-allow: true |
|||
jackson: |
|||
time-zone: GMT+8 |
|||
date-format: yyyy-MM-dd HH:mm:ss |
|||
@ -1,74 +0,0 @@ |
|||
spring: |
|||
datasource: |
|||
type: com.alibaba.druid.pool.DruidDataSource |
|||
driverClassName: com.mysql.jdbc.Driver |
|||
druid: |
|||
first: #数据源1 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_admin?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
second: #数据源2 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_api?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
third: #数据源3 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_custom?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
fourth: #数据源4 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_events?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
fifth: #数据源5 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_group?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
sixth: #数据源6 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_job?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
seventh: #数据源7 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_kpi?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
eighth: #数据源8 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_mutuality?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
ninth: #数据源9 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_news?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
tenth: #数据源10 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_points?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
eleventh: #数据源11 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_user?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
initial-size: 10 |
|||
max-active: 100 |
|||
min-idle: 10 |
|||
max-wait: 60000 |
|||
pool-prepared-statements: true |
|||
max-pool-prepared-statement-per-connection-size: 20 |
|||
time-between-eviction-runs-millis: 60000 |
|||
min-evictable-idle-time-millis: 300000 |
|||
test-while-idle: true |
|||
test-on-borrow: false |
|||
test-on-return: false |
|||
stat-view-servlet: |
|||
enabled: true |
|||
url-pattern: /druid/* |
|||
filter: |
|||
stat: |
|||
log-slow-sql: true |
|||
slow-sql-millis: 1000 |
|||
merge-sql: false |
|||
wall: |
|||
config: |
|||
multi-statement-allow: true |
|||
jackson: |
|||
time-zone: GMT+8 |
|||
date-format: yyyy-MM-dd HH:mm:ss |
|||
@ -1,62 +0,0 @@ |
|||
server: |
|||
port: @server.port@ |
|||
servlet: |
|||
context-path: /analysis |
|||
|
|||
spring: |
|||
main: |
|||
allow-bean-definition-overriding: true |
|||
application: |
|||
name: epdc-analysis-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-analysis-server-fescar-service-group |
|||
|
|||
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 |
|||
@ -1 +0,0 @@ |
|||
#Default |
|||
@ -1 +0,0 @@ |
|||
#English |
|||
@ -1 +0,0 @@ |
|||
#\u7B80\u4F53\u4E2D\u6587 |
|||
@ -1 +0,0 @@ |
|||
#\u7E41\u4F53\u4E2D\u6587 |
|||
@ -1 +0,0 @@ |
|||
#Default |
|||
@ -1 +0,0 @@ |
|||
#English |
|||
@ -1 +0,0 @@ |
|||
#\u7B80\u4F53\u4E2D\u6587 |
|||
@ -1 +0,0 @@ |
|||
#\u7E41\u4F53\u4E2D\u6587 |
|||
@ -1,106 +0,0 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.elink.esua.epdc.modules.issue.dao.IssueDao"> |
|||
<!-- 最热议题列表 --> |
|||
<select id="selectListHottestIssue" resultType="com.elink.esua.epdc.dto.issue.result.IssueResultDTO"> |
|||
SELECT |
|||
ei.ID, |
|||
ei.ISSUE_CONTENT, |
|||
ei.ALL_DEPT_NAMES, |
|||
ei.NICK_NAME, |
|||
ei.CREATED_TIME, |
|||
ee.APPROVE_NUM, |
|||
ee.OPPOSE_NUM, |
|||
ee.COMMENT_NUM, |
|||
ee.BROWSE_NUM, |
|||
( ee.COMMENT_NUM + ee.BROWSE_NUM + ee.APPROVE_NUM + ee.OPPOSE_NUM ) AS expressAttitudeNum |
|||
FROM |
|||
esua_epdc_events.epdc_issue ei |
|||
LEFT JOIN esua_epdc_events.epdc_events ee ON ee.ID = ei.EVENT_ID |
|||
AND ee.DEL_FLAG = '0' |
|||
<if test="issueContent != null and issueContent != ''"> |
|||
AND ei.ISSUE_CONTENT LIKE CONCAT('%',#{issueContent},'%') |
|||
</if> |
|||
<if test="streetId != null and streetId != ''"> |
|||
AND (find_in_set(#{streetId},ei.PARENT_DEPT_IDS) |
|||
OR find_in_set(#{streetId},ei.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="communityId != null and communityId != ''"> |
|||
AND (find_in_set(#{communityId},ei.PARENT_DEPT_IDS) |
|||
OR find_in_set(#{communityId},ei.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="gridId != null and gridId != ''"> |
|||
AND (ei.GRID_ID = #{gridId} |
|||
OR find_in_set(#{gridId},ei.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="startTime != null and startTime != ''"> |
|||
and DATE_FORMAT( ei.CREATED_TIME, '%Y-%m-%d' ) >=#{startTime} |
|||
</if> |
|||
<if test="endTime != null and endTime != ''"> |
|||
and DATE_FORMAT( ei.CREATED_TIME, '%Y-%m-%d' ) <=#{endTime} |
|||
</if> |
|||
<if test="deptIdList!=null and deptIdList.size()>0"> |
|||
and ei.GRID_ID in |
|||
<foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")"> |
|||
#{deptId} |
|||
</foreach> |
|||
</if> |
|||
WHERE |
|||
ei.DEL_FLAG = '0' |
|||
AND ei.ISSUE_STATE IN ( 0, 2 ) |
|||
ORDER BY |
|||
expressAttitudeNum DESC |
|||
</select> |
|||
|
|||
<!-- 最新议题列表 --> |
|||
<select id="selectListLatestIssue" resultType="com.elink.esua.epdc.dto.issue.result.IssueResultDTO"> |
|||
SELECT |
|||
ei.ID, |
|||
ei.ISSUE_CONTENT, |
|||
ei.ALL_DEPT_NAMES, |
|||
ei.NICK_NAME, |
|||
ei.CREATED_TIME, |
|||
ee.APPROVE_NUM, |
|||
ee.OPPOSE_NUM, |
|||
ee.COMMENT_NUM, |
|||
ee.BROWSE_NUM, |
|||
( ee.COMMENT_NUM + ee.BROWSE_NUM + ee.APPROVE_NUM + ee.OPPOSE_NUM ) AS expressAttitudeNum |
|||
FROM |
|||
esua_epdc_events.epdc_issue ei |
|||
LEFT JOIN esua_epdc_events.epdc_events ee ON ee.ID = ei.EVENT_ID |
|||
AND ee.DEL_FLAG = '0' |
|||
<if test="issueContent != null and issueContent != ''"> |
|||
AND ei.ISSUE_CONTENT LIKE CONCAT('%',#{issueContent},'%') |
|||
</if> |
|||
<if test="streetId != null and streetId != ''"> |
|||
AND (find_in_set(#{streetId},ei.PARENT_DEPT_IDS) |
|||
OR find_in_set(#{streetId},ei.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="communityId != null and communityId != ''"> |
|||
AND (find_in_set(#{communityId},ei.PARENT_DEPT_IDS) |
|||
OR find_in_set(#{communityId},ei.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="gridId != null and gridId != ''"> |
|||
AND (ei.GRID_ID = #{gridId} |
|||
OR find_in_set(#{gridId},ei.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="startTime != null and startTime != ''"> |
|||
and DATE_FORMAT( ei.CREATED_TIME, '%Y-%m-%d' ) >=#{startTime} |
|||
</if> |
|||
<if test="endTime != null and endTime != ''"> |
|||
and DATE_FORMAT( ei.CREATED_TIME, '%Y-%m-%d' ) <=#{endTime} |
|||
</if> |
|||
<if test="deptIdList!=null and deptIdList.size()>0"> |
|||
and ei.GRID_ID in |
|||
<foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")"> |
|||
#{deptId} |
|||
</foreach> |
|||
</if> |
|||
WHERE |
|||
ei.DEL_FLAG = '0' |
|||
AND ei.ISSUE_STATE IN ( 0, 2 ) |
|||
ORDER BY |
|||
expressAttitudeNum DESC,CREATED_TIME desc |
|||
</select> |
|||
</mapper> |
|||
@ -1,53 +0,0 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.elink.esua.epdc.modules.item.dao.ItemDao"> |
|||
<select id="selectListHottestItemResultDTO" resultType="com.elink.esua.epdc.dto.item.result.ItemResultDTO"> |
|||
SELECT |
|||
ei.id, |
|||
ei.ITEM_CONTENT, |
|||
ei.ALL_DEPT_NAMES, |
|||
ei.GRID, |
|||
ei.NICK_NAME, |
|||
ei.CREATED_TIME AS releaseTime, |
|||
ee.APPROVE_NUM, |
|||
ee.OPPOSE_NUM, |
|||
ee.COMMENT_NUM, |
|||
ee.BROWSE_NUM, |
|||
(ee.APPROVE_NUM + ee.OPPOSE_NUM + ee.COMMENT_NUM + ee.BROWSE_NUM ) AS expressAttitudeNum |
|||
FROM |
|||
epdc_item ei |
|||
LEFT JOIN epdc_events ee ON ( ei.EVENT_ID = ee.ID ) |
|||
WHERE |
|||
ei.DEL_FLAG = '0' |
|||
AND ee.DEL_FLAG = '0' |
|||
<if test='searchContent != null and searchContent != ""'> |
|||
AND ei.ITEM_CONTENT LIKE CONCAT('%',#{searchContent},'%') |
|||
</if> |
|||
<if test="streetId != null and streetId != ''"> |
|||
AND (find_in_set(#{streetId},ei.PARENT_DEPT_IDS) |
|||
OR find_in_set(#{streetId},ei.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="communityId != null and communityId != ''"> |
|||
AND (find_in_set(#{communityId},ei.PARENT_DEPT_IDS) |
|||
OR find_in_set(#{communityId},ei.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="gridId != null and gridId != ''"> |
|||
AND (ei.GRID_ID = #{gridId} |
|||
OR find_in_set(#{gridId},ei.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="startTime != null and startTime != ''"> |
|||
and DATE_FORMAT( ei.CREATED_TIME, '%Y-%m-%d' ) >=#{startTime} |
|||
</if> |
|||
<if test="endTime != null and endTime != ''"> |
|||
and DATE_FORMAT( ei.CREATED_TIME, '%Y-%m-%d' ) <=#{endTime} |
|||
</if> |
|||
<if test="deptIdList!=null and deptIdList.size()>0"> |
|||
and ei.GRID_ID in |
|||
<foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")"> |
|||
#{deptId} |
|||
</foreach> |
|||
</if> |
|||
ORDER BY expressAttitudeNum DESC |
|||
</select> |
|||
</mapper> |
|||
@ -1,96 +0,0 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.elink.esua.epdc.modules.topic.dao.TopicDao"> |
|||
<!-- 最热话题列表查询 --> |
|||
<select id="selectListHottestTopicDTO" resultType="com.elink.esua.epdc.dto.topic.result.TopicResultDTO"> |
|||
select |
|||
et.ID, |
|||
et.TOPIC_CONTENT, |
|||
et.ALL_DEPT_NAMES, |
|||
et.GRID, |
|||
et.GROUP_NAME, |
|||
et.NICKNAME, |
|||
et.CREATED_TIME as releaseTime, |
|||
et.COMMENT_NUM, |
|||
et.BROWSE_NUM, |
|||
et.COMMENT_NUM+et.BROWSE_NUM as expressAttitudeNum |
|||
from epdc_topic et |
|||
where et.DEL_FLAG='0' |
|||
and et.STATE='0' |
|||
<if test="topicContent != null and topicContent != ''"> |
|||
and et.TOPIC_CONTENT like concat('%', #{topicContent}, '%') |
|||
</if> |
|||
<if test="streetId != null and streetId != ''"> |
|||
AND (find_in_set(#{streetId},et.PARENT_DEPT_IDS) |
|||
OR find_in_set(#{streetId},et.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="communityId != null and communityId != ''"> |
|||
AND (find_in_set(#{communityId},et.PARENT_DEPT_IDS) |
|||
OR find_in_set(#{communityId},et.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="gridId != null and gridId != ''"> |
|||
AND (et.GRID_ID = #{gridId} |
|||
OR find_in_set(#{gridId},et.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="startTime != null and startTime != ''"> |
|||
and DATE_FORMAT( et.CREATED_TIME, '%Y-%m-%d' ) >=#{startTime} |
|||
</if> |
|||
<if test="endTime != null and endTime != ''"> |
|||
and DATE_FORMAT( et.CREATED_TIME, '%Y-%m-%d' ) <=#{endTime} |
|||
</if> |
|||
<if test="deptIdList!=null and deptIdList.size()>0"> |
|||
and et.GRID_ID in |
|||
<foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")"> |
|||
#{deptId} |
|||
</foreach> |
|||
</if> |
|||
order by expressAttitudeNum desc |
|||
</select> |
|||
|
|||
<!-- 最新话题列表查询 --> |
|||
<select id="selectListLatesttTopicDTO" resultType="com.elink.esua.epdc.dto.topic.result.TopicResultDTO"> |
|||
select |
|||
et.ID, |
|||
et.TOPIC_CONTENT, |
|||
et.ALL_DEPT_NAMES, |
|||
et.GRID, |
|||
et.GROUP_NAME, |
|||
et.NICKNAME, |
|||
et.CREATED_TIME as releaseTime, |
|||
et.COMMENT_NUM, |
|||
et.BROWSE_NUM, |
|||
et.COMMENT_NUM+et.BROWSE_NUM as expressAttitudeNum |
|||
from epdc_topic et |
|||
where et.DEL_FLAG='0' |
|||
and et.STATE='0' |
|||
<if test="topicContent != null and topicContent != ''"> |
|||
and et.TOPIC_CONTENT like concat('%', #{topicContent}, '%') |
|||
</if> |
|||
<if test="streetId != null and streetId != ''"> |
|||
AND (find_in_set(#{streetId},et.PARENT_DEPT_IDS) |
|||
OR find_in_set(#{streetId},et.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="communityId != null and communityId != ''"> |
|||
AND (find_in_set(#{communityId},et.PARENT_DEPT_IDS) |
|||
OR find_in_set(#{communityId},et.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="gridId != null and gridId != ''"> |
|||
AND (et.GRID_ID = #{gridId} |
|||
OR find_in_set(#{gridId},et.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="startTime != null and startTime != ''"> |
|||
and DATE_FORMAT( et.CREATED_TIME, '%Y-%m-%d' ) >=#{startTime} |
|||
</if> |
|||
<if test="endTime != null and endTime != ''"> |
|||
and DATE_FORMAT( et.CREATED_TIME, '%Y-%m-%d' ) <=#{endTime} |
|||
</if> |
|||
<if test="deptIdList!=null and deptIdList.size()>0"> |
|||
and et.GRID_ID in |
|||
<foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")"> |
|||
#{deptId} |
|||
</foreach> |
|||
</if> |
|||
order by expressAttitudeNum desc,releaseTime desc |
|||
</select> |
|||
</mapper> |
|||
@ -1,21 +0,0 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" 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"> |
|||
<modelVersion>4.0.0</modelVersion> |
|||
|
|||
<parent> |
|||
<groupId>com.esua.epdc</groupId> |
|||
<artifactId>epdc-module</artifactId> |
|||
<version>1.0.0</version> |
|||
</parent> |
|||
|
|||
<groupId>com.esua.epdc</groupId> |
|||
<artifactId>epdc-analysis</artifactId> |
|||
<packaging>pom</packaging> |
|||
|
|||
<modules> |
|||
<module>epdc-analysis-client</module> |
|||
<module>epdc-analysis-server</module> |
|||
</modules> |
|||
|
|||
</project> |
|||
@ -0,0 +1,51 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
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 |
|||
*/ |
|||
@NotBlank(message = "活动ID不能为空") |
|||
private String actId; |
|||
|
|||
/** |
|||
* 取消报名原因 |
|||
*/ |
|||
@NotBlank(message = "取消报名原因不能为空") |
|||
private String failureReason; |
|||
} |
|||
@ -0,0 +1,80 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
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 |
|||
*/ |
|||
@NotBlank(message = "活动ID不能为空") |
|||
private String actId; |
|||
/** |
|||
* 打卡描述 |
|||
*/ |
|||
@NotBlank(message = "打卡描述不能为空") |
|||
private String clockDesc; |
|||
/** |
|||
* 打卡位置经度 |
|||
*/ |
|||
private BigDecimal clockLongitude; |
|||
/** |
|||
* 打卡位置纬度 |
|||
*/ |
|||
private BigDecimal clockLatitude; |
|||
/** |
|||
* 打卡地址 |
|||
*/ |
|||
@NotBlank(message = "打卡地址不能为空") |
|||
private String clockAddress; |
|||
/** |
|||
* 打卡图片 |
|||
*/ |
|||
private ArrayList<String> images; |
|||
/** |
|||
* 打卡类型(0-打卡,1-更新打卡) |
|||
*/ |
|||
@NotBlank(message = "打卡类型不能为空") |
|||
private String clockType; |
|||
/** |
|||
* 打卡是否有效(0-否,1-是) |
|||
*/ |
|||
@NotBlank(message = "打卡是否有效不能为空") |
|||
private String effectiveFlag; |
|||
|
|||
} |
|||
@ -0,0 +1,48 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dto.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<Object> clocks; |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,68 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dto.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; |
|||
|
|||
|
|||
|
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue