119 changed files with 4541 additions and 196 deletions
@ -0,0 +1,71 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 行政区划 |
|||
* |
|||
* @author yujintao |
|||
* @date 2019/9/3 16:22 |
|||
*/ |
|||
@Data |
|||
public class AreaDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 9173956433924027751L; |
|||
|
|||
/** |
|||
* ID |
|||
*/ |
|||
private Integer id; |
|||
/** |
|||
* 父级ID |
|||
*/ |
|||
private Integer parentId; |
|||
/** |
|||
* 名称 |
|||
*/ |
|||
private String name; |
|||
/** |
|||
* 简称 |
|||
*/ |
|||
private String shortName; |
|||
/** |
|||
* 经度 |
|||
*/ |
|||
private Float longitude; |
|||
/** |
|||
* 纬度 |
|||
*/ |
|||
private Float latitude; |
|||
/** |
|||
* 等级(1省/直辖市,2地级市,3区县,4镇/街道) |
|||
*/ |
|||
private Integer level; |
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private Integer sort; |
|||
/** |
|||
* 状态(0禁用/1启用) |
|||
*/ |
|||
private Integer status; |
|||
} |
|||
@ -0,0 +1,28 @@ |
|||
|
|||
package com.elink.esua.epdc.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* 行政区划简要信息 |
|||
* |
|||
* @author yujintao |
|||
* @date 2019/9/3 16:22 |
|||
*/ |
|||
@Data |
|||
public class SimpleAreaDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -3243672014476007901L; |
|||
|
|||
/** |
|||
* ID |
|||
*/ |
|||
private Integer id; |
|||
/** |
|||
* 名称 |
|||
*/ |
|||
private String name; |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
|
|||
package com.elink.esua.epdc.dto; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 数据字典简要信息 |
|||
* |
|||
* @author yujintao |
|||
* @date 2019/7/15 09:29 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "数据字典") |
|||
public class SysSimpleDictDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -4827806651372425347L; |
|||
|
|||
@ApiModelProperty(value = "字典名称") |
|||
@NotBlank(message = "{sysdict.name.require}", groups = DefaultGroup.class) |
|||
private String dictName; |
|||
|
|||
@ApiModelProperty(value = "字典值") |
|||
private String dictValue; |
|||
|
|||
} |
|||
@ -0,0 +1,42 @@ |
|||
|
|||
package com.elink.esua.epdc.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.SimpleAreaDTO; |
|||
import com.elink.esua.epdc.service.AreaService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* 获取行政区划 |
|||
* |
|||
* @author liuhongwei @elink-cn.com |
|||
* @since v1.0.0 2019-05-13 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("area") |
|||
public class AreaController { |
|||
|
|||
@Autowired |
|||
private AreaService areaService; |
|||
|
|||
/** |
|||
* 根据区划ID,获取下属区域列表 |
|||
* |
|||
* @param areaId |
|||
* @return com.elink.esua.commons.tools.utils.Result<java.util.List < com.elink.esua.dto.AreaDTO>> |
|||
* @author yujintao |
|||
* @date 2019/9/3 16:28 |
|||
*/ |
|||
@GetMapping("listSimple/{areaId}") |
|||
public Result<List<SimpleAreaDTO>> listSimpleAreaInfo(@PathVariable("areaId") String areaId) { |
|||
return this.areaService.listSimpleAreaInfo(areaId); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
|
|||
package com.elink.esua.epdc.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.entity.AreaEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
|
|||
/** |
|||
* @author yujintao |
|||
* @date 2019/9/3 16:54 |
|||
*/ |
|||
@Mapper |
|||
public interface AreaDao extends BaseDao<AreaEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,60 @@ |
|||
package com.elink.esua.epdc.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 行政区划 |
|||
* |
|||
* @author yujintao |
|||
* @date 2019/9/3 16:25 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = false) |
|||
@TableName("area") |
|||
public class AreaEntity implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -2139014717755304245L; |
|||
|
|||
/** |
|||
* ID |
|||
*/ |
|||
private Integer id; |
|||
/** |
|||
* 父级ID |
|||
*/ |
|||
private Integer parentId; |
|||
/** |
|||
* 名称 |
|||
*/ |
|||
private String name; |
|||
/** |
|||
* 简称 |
|||
*/ |
|||
private String shortName; |
|||
/** |
|||
* 经度 |
|||
*/ |
|||
private Float longitude; |
|||
/** |
|||
* 纬度 |
|||
*/ |
|||
private Float latitude; |
|||
/** |
|||
* 等级(1省/直辖市,2地级市,3区县,4镇/街道) |
|||
*/ |
|||
private Integer level; |
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private Integer sort; |
|||
/** |
|||
* 状态(0禁用/1启用) |
|||
*/ |
|||
private Integer status; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,67 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.redis; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.redis.RedisKeys; |
|||
import com.elink.esua.epdc.commons.tools.redis.RedisUtils; |
|||
import com.elink.esua.epdc.dto.SimpleAreaDTO; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 区划信息表 |
|||
* |
|||
* @author yujintao yujintao@elink-cn.com |
|||
* @since v1.0.0 2019-05-08 |
|||
*/ |
|||
@Component |
|||
public class AreaRedis { |
|||
|
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
/** |
|||
* 取出区划信息 |
|||
* |
|||
* @param areaId 区域ID |
|||
* @return java.lang.String |
|||
* @author yujintao |
|||
* @date 2019/6/13 11:05 |
|||
*/ |
|||
public List<SimpleAreaDTO> getSimpleAreaList(String areaId) { |
|||
String configAreaKey = RedisKeys.getSimpleAreaKey(areaId); |
|||
return (List<SimpleAreaDTO>) redisUtils.get(configAreaKey); |
|||
} |
|||
|
|||
/** |
|||
* 缓存区划信息 |
|||
* |
|||
* @param areaId |
|||
* @param areaDtoList |
|||
* @return void |
|||
* @author yujintao |
|||
* @date 2019/6/13 11:02 |
|||
*/ |
|||
public void setSimpleAreaList(String areaId, List<SimpleAreaDTO> areaDtoList) { |
|||
String configAreaKey = RedisKeys.getSimpleAreaKey(areaId); |
|||
redisUtils.set(configAreaKey, areaDtoList); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,81 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.redis; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.redis.RedisKeys; |
|||
import com.elink.esua.epdc.commons.tools.redis.RedisUtils; |
|||
import com.elink.esua.epdc.dto.SimpleAreaDTO; |
|||
import com.elink.esua.epdc.dto.SysSimpleDictDTO; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 区划信息表 |
|||
* |
|||
* @author yujintao yujintao@elink-cn.com |
|||
* @since v1.0.0 2019-05-08 |
|||
*/ |
|||
@Component |
|||
public class SysDictRedis { |
|||
|
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
/** |
|||
* 根据数据字典类型,从redis获取简版数据字典列表 |
|||
* |
|||
* @param dictType 数据字典类型 |
|||
* @return java.util.List<com.elink.esua.dto.SysSimpleDictDTO> |
|||
* @author yujintao |
|||
* @date 2019/7/15 09:42 |
|||
*/ |
|||
public List<SysSimpleDictDTO> getSimpleDictList(String dictType) { |
|||
String dictKey = RedisKeys.getSimpleDictKey(dictType); |
|||
return (List<SysSimpleDictDTO>) redisUtils.get(dictKey); |
|||
} |
|||
|
|||
/** |
|||
* 根据数据字典类型,将简版数据字典列表放入缓存 |
|||
* |
|||
* @param dictType 数据字典类型 |
|||
* @param simpleDictList 列表 |
|||
* @return void |
|||
* @author yujintao |
|||
* @date 2019/7/15 09:50 |
|||
*/ |
|||
public void setSimpleDictList(String dictType, List<SysSimpleDictDTO> simpleDictList) { |
|||
String dictKey = RedisKeys.getSimpleDictKey(dictType); |
|||
redisUtils.set(dictKey, simpleDictList); |
|||
} |
|||
|
|||
/** |
|||
* 根据数据字典类型,从redis删除简版数据字典列表 |
|||
* |
|||
* @param dictType |
|||
* @return void |
|||
* @author yujintao |
|||
* @date 2019/7/15 10:10 |
|||
*/ |
|||
public void removeSimpleDictList(String dictType) { |
|||
String dictKey = RedisKeys.getSimpleDictKey(dictType); |
|||
redisUtils.delete(dictKey); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
|
|||
package com.elink.esua.epdc.service; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.SimpleAreaDTO; |
|||
import com.elink.esua.epdc.entity.AreaEntity; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 行政区划 |
|||
* |
|||
* @author yujintao |
|||
* @date 2019/9/3 16:54 |
|||
*/ |
|||
public interface AreaService extends BaseService<AreaEntity> { |
|||
|
|||
|
|||
/** |
|||
* 根据区划ID,获取下属区域列表 |
|||
* |
|||
* @param areaId |
|||
* @return com.elink.esua.commons.tools.utils.Result<java.util.List < com.elink.esua.dto.AreaDTO>> |
|||
* @author yujintao |
|||
* @date 2019/6/13 10:35 |
|||
*/ |
|||
Result<List<SimpleAreaDTO>> listSimpleAreaInfo(String areaId); |
|||
} |
|||
@ -0,0 +1,65 @@ |
|||
|
|||
package com.elink.esua.epdc.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.commons.tools.constant.NumConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dao.AreaDao; |
|||
import com.elink.esua.epdc.dto.SimpleAreaDTO; |
|||
import com.elink.esua.epdc.entity.AreaEntity; |
|||
import com.elink.esua.epdc.redis.AreaRedis; |
|||
import com.elink.esua.epdc.service.AreaService; |
|||
import com.google.common.collect.Lists; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* @author yujintao |
|||
* @date 2019/9/3 16:55 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
public class AreaServiceImpl extends BaseServiceImpl<AreaDao, AreaEntity> implements AreaService { |
|||
|
|||
|
|||
@Autowired |
|||
private AreaRedis areaRedis; |
|||
|
|||
@Override |
|||
public Result<List<SimpleAreaDTO>> listSimpleAreaInfo(String areaId) { |
|||
|
|||
List<SimpleAreaDTO> simpleAreaList = Lists.newArrayList(); |
|||
|
|||
try { |
|||
if (StringUtils.isNotBlank(areaId)) { |
|||
|
|||
List<SimpleAreaDTO> areaList = areaRedis.getSimpleAreaList(areaId); |
|||
if (null != areaList) { |
|||
return new Result<List<SimpleAreaDTO>>().ok(areaList); |
|||
} |
|||
|
|||
Integer pid = Integer.parseInt(areaId); |
|||
QueryWrapper<AreaEntity> arWrapper = new QueryWrapper<>(); |
|||
arWrapper.select("ID", "NAME"); |
|||
arWrapper.eq("PARENT_ID", pid); |
|||
arWrapper.eq("STATUS", NumConstant.ONE); |
|||
arWrapper.orderByAsc("LEVEL", "SORT"); |
|||
List<AreaEntity> entityList = baseDao.selectList(arWrapper); |
|||
if (!entityList.isEmpty()) { |
|||
simpleAreaList = ConvertUtils.sourceToTarget(entityList, SimpleAreaDTO.class); |
|||
areaRedis.setSimpleAreaList(areaId, simpleAreaList); |
|||
} |
|||
} |
|||
} catch (Exception e) { |
|||
log.error("获取区划信息失败,错误信息{}", e.getMessage()); |
|||
} |
|||
return new Result<List<SimpleAreaDTO>>().ok(simpleAreaList); |
|||
} |
|||
} |
|||
@ -0,0 +1,41 @@ |
|||
<?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"> |
|||
<parent> |
|||
<artifactId>epdc-commons</artifactId> |
|||
<groupId>com.esua.epdc</groupId> |
|||
<version>1.0.0</version> |
|||
</parent> |
|||
<modelVersion>4.0.0</modelVersion> |
|||
|
|||
<artifactId>epdc-commons-tools-phone</artifactId> |
|||
<packaging>jar</packaging> |
|||
|
|||
<dependencies> |
|||
<dependency> |
|||
<groupId>com.googlecode.libphonenumber</groupId> |
|||
<artifactId>libphonenumber</artifactId> |
|||
<version>8.8.8</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.googlecode.libphonenumber</groupId> |
|||
<artifactId>carrier</artifactId> |
|||
<version>1.75</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.googlecode.libphonenumber</groupId> |
|||
<artifactId>geocoder</artifactId> |
|||
<version>2.85</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.googlecode.libphonenumber</groupId> |
|||
<artifactId>prefixmapper</artifactId> |
|||
<version>2.85</version> |
|||
</dependency> |
|||
</dependencies> |
|||
|
|||
<build> |
|||
<finalName>${project.artifactId}</finalName> |
|||
</build> |
|||
</project> |
|||
@ -0,0 +1,79 @@ |
|||
package com.elink.esua.epdc.commons.tools.utils; |
|||
|
|||
/** |
|||
* 电话DTO |
|||
* |
|||
* @author rongchao |
|||
* @Date 18-12-11 |
|||
*/ |
|||
public class PhoneDto { |
|||
|
|||
/** |
|||
* 省份名称 |
|||
*/ |
|||
private String provinceName; |
|||
|
|||
/** |
|||
* 城市名称 |
|||
*/ |
|||
private String cityName; |
|||
|
|||
/** |
|||
* 运营商:移动/电信/联通 |
|||
*/ |
|||
private String carrier; |
|||
|
|||
/** |
|||
* 省份名称 |
|||
* |
|||
* @return 获取provinceName属性值 |
|||
*/ |
|||
public String getProvinceName() { |
|||
return provinceName; |
|||
} |
|||
|
|||
/** |
|||
* 省份名称 |
|||
* |
|||
* @param provinceName 设置 provinceName 属性值为参数值 provinceName |
|||
*/ |
|||
public void setProvinceName(String provinceName) { |
|||
this.provinceName = provinceName; |
|||
} |
|||
|
|||
/** |
|||
* 城市名称 |
|||
* |
|||
* @return 获取cityName属性值 |
|||
*/ |
|||
public String getCityName() { |
|||
return cityName; |
|||
} |
|||
|
|||
/** |
|||
* 城市名称 |
|||
* |
|||
* @param cityName 设置 cityName 属性值为参数值 cityName |
|||
*/ |
|||
public void setCityName(String cityName) { |
|||
this.cityName = cityName; |
|||
} |
|||
|
|||
/** |
|||
* 运营商:移动/电信/联通 |
|||
* |
|||
* @return 获取carrier属性值 |
|||
*/ |
|||
public String getCarrier() { |
|||
return carrier; |
|||
} |
|||
|
|||
/** |
|||
* 运营商:移动/电信/联通 |
|||
* |
|||
* @param carrier 设置 carrier 属性值为参数值 carrier |
|||
*/ |
|||
public void setCarrier(String carrier) { |
|||
this.carrier = carrier; |
|||
} |
|||
} |
|||
@ -0,0 +1,175 @@ |
|||
package com.elink.esua.epdc.commons.tools.utils; |
|||
|
|||
/** |
|||
* @author rongchao |
|||
* @Date 18-12-11 |
|||
*/ |
|||
|
|||
import com.google.i18n.phonenumbers.PhoneNumberToCarrierMapper; |
|||
import com.google.i18n.phonenumbers.PhoneNumberUtil; |
|||
import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber; |
|||
import com.google.i18n.phonenumbers.geocoding.PhoneNumberOfflineGeocoder; |
|||
|
|||
import java.util.Locale; |
|||
|
|||
/** |
|||
* 手机号归属地查询 |
|||
* jar依赖:com.googlecode.libphonenumber(Libphonenumber、Geocoder、Prefixmapper |
|||
* 、Carrier) pom依赖:http://mvnrepository.com/search?q=libphonenumber
|
|||
* 项目地址:https://github.com/googlei18n/libphonenumber
|
|||
* |
|||
* @author rongchao |
|||
* @Date 18-12-11 |
|||
*/ |
|||
public class PhoneUtil { |
|||
|
|||
/** |
|||
* 直辖市 |
|||
*/ |
|||
private final static String[] MUNICIPALITY = {"北京市", "天津市", "上海市", "重庆市"}; |
|||
|
|||
/** |
|||
* 自治区 |
|||
*/ |
|||
private final static String[] AUTONOMOUS_REGION = {"新疆", "内蒙古", "西藏", "宁夏", "广西"}; |
|||
|
|||
private static PhoneNumberUtil phoneNumberUtil = PhoneNumberUtil |
|||
.getInstance(); |
|||
|
|||
/** |
|||
* 提供与电话号码相关的运营商信息 |
|||
*/ |
|||
private static PhoneNumberToCarrierMapper carrierMapper = PhoneNumberToCarrierMapper |
|||
.getInstance(); |
|||
|
|||
/** |
|||
* 提供与电话号码有关的地理信息 |
|||
*/ |
|||
private static PhoneNumberOfflineGeocoder geocoder = PhoneNumberOfflineGeocoder |
|||
.getInstance(); |
|||
|
|||
/** |
|||
* 中国大陆区区号 |
|||
*/ |
|||
private final static int COUNTRY_CODE = 86; |
|||
|
|||
/** |
|||
* 根据手机号 判断手机号是否有效 |
|||
* |
|||
* @param phoneNumber 手机号码 |
|||
* @return true-有效 false-无效 |
|||
*/ |
|||
public static boolean checkPhoneNumber(String phoneNumber) { |
|||
long phone = Long.parseLong(phoneNumber); |
|||
|
|||
PhoneNumber pn = new PhoneNumber(); |
|||
pn.setCountryCode(COUNTRY_CODE); |
|||
pn.setNationalNumber(phone); |
|||
|
|||
return phoneNumberUtil.isValidNumber(pn); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 根据手机号 判断手机运营商 |
|||
* |
|||
* @param phoneNumber 手机号码 |
|||
* @return 如:广东省广州市移动 |
|||
*/ |
|||
public static String getCarrier(String phoneNumber) { |
|||
|
|||
long phone = Long.parseLong(phoneNumber); |
|||
|
|||
PhoneNumber pn = new PhoneNumber(); |
|||
pn.setCountryCode(COUNTRY_CODE); |
|||
pn.setNationalNumber(phone); |
|||
// 返回结果只有英文,自己转成成中文
|
|||
String carrierEn = carrierMapper.getNameForNumber(pn, Locale.ENGLISH); |
|||
String carrierZh = ""; |
|||
switch (carrierEn) { |
|||
case "China Mobile": |
|||
carrierZh += "移动"; |
|||
break; |
|||
case "China Unicom": |
|||
carrierZh += "联通"; |
|||
break; |
|||
case "China Telecom": |
|||
carrierZh += "电信"; |
|||
break; |
|||
default: |
|||
break; |
|||
} |
|||
return carrierZh; |
|||
} |
|||
|
|||
/** |
|||
* 根据手机号 获取手机归属地 |
|||
* |
|||
* @param phoneNumber 手机号码 |
|||
* @return 如:广东省广州市 |
|||
*/ |
|||
public static String getGeo(String phoneNumber) { |
|||
long phone = Long.parseLong(phoneNumber); |
|||
|
|||
PhoneNumber pn = new PhoneNumber(); |
|||
pn.setCountryCode(COUNTRY_CODE); |
|||
pn.setNationalNumber(phone); |
|||
return geocoder.getDescriptionForNumber(pn, Locale.CHINESE); |
|||
} |
|||
|
|||
/** |
|||
* 根据手机号 获取手机信息模型 |
|||
* |
|||
* <pre> |
|||
* 若返回值为null,则说明该号码无效 |
|||
* </pre> |
|||
* |
|||
* @param phoneNumber 手机号码 |
|||
* @return 手机信息模型PhoneModel |
|||
*/ |
|||
public static PhoneDto getPhoneDto(String phoneNumber) { |
|||
if (checkPhoneNumber(phoneNumber)) { |
|||
String geo = getGeo(phoneNumber); |
|||
PhoneDto phoneDto = new PhoneDto(); |
|||
String carrier = getCarrier(phoneNumber); |
|||
phoneDto.setCarrier(carrier); |
|||
// 直辖市
|
|||
for (String val : MUNICIPALITY) { |
|||
if (geo.equals(val)) { |
|||
phoneDto.setProvinceName(val.replace("市", "")); |
|||
phoneDto.setCityName(val); |
|||
return phoneDto; |
|||
} |
|||
} |
|||
// 自治区
|
|||
for (String val : AUTONOMOUS_REGION) { |
|||
if (geo.startsWith(val)) { |
|||
phoneDto.setProvinceName(val); |
|||
phoneDto.setCityName(geo.replace(val, "")); |
|||
return phoneDto; |
|||
} |
|||
} |
|||
|
|||
// 其它
|
|||
String[] splitArr = geo.split("省"); |
|||
if (splitArr != null && splitArr.length == 2) { |
|||
phoneDto.setProvinceName(splitArr[0]); |
|||
phoneDto.setCityName(splitArr[1]); |
|||
return phoneDto; |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
public static void main(String[] args) { |
|||
PhoneDto phoneDto = PhoneUtil.getPhoneDto("13701001254"); |
|||
if (phoneDto != null) { |
|||
System.out.println(phoneDto.getProvinceName()); |
|||
System.out.println(phoneDto.getCityName()); |
|||
System.out.println(phoneDto.getCarrier()); |
|||
} else { |
|||
System.err.println("该号码无效"); |
|||
} |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,40 @@ |
|||
package com.elink.esua.epdc.commons.tools.utils; |
|||
|
|||
import java.util.Random; |
|||
|
|||
/** |
|||
* @author rongchao |
|||
* @Date 18-12-17 |
|||
*/ |
|||
public class RandomUtil { |
|||
/** |
|||
* 根据需要生成指定长度的纯数字随机数,这个随机数的每一位都是从(0-9)这个产生的一位 |
|||
* |
|||
* @param codeLen |
|||
* @return |
|||
*/ |
|||
public static String getNewRandomCode(int codeLen) { |
|||
Random randomCode = new Random(); |
|||
String strCode = ""; |
|||
while (codeLen > 0) { |
|||
int charCode = randomCode.nextInt(9); |
|||
strCode += charCode; |
|||
codeLen--; |
|||
} |
|||
return strCode; |
|||
} |
|||
|
|||
public static int getRandomNum(int min, int max) { |
|||
Random random = new Random(); |
|||
return random.nextInt(max - min + 1) + min; |
|||
} |
|||
|
|||
public static void main(String[] args) { |
|||
for (int i = 0; i < 10000; i++) { |
|||
int s = RandomUtil.getRandomNum(1, 10); |
|||
if (s < 1 || s > 10) { |
|||
System.out.println(s); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,69 @@ |
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> |
|||
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.w3.org/1999/XPath" id="m1567478636229" name="" targetNamespace="http://www.activiti.org/testm1567478636229" typeLanguage="http://www.w3.org/2001/XMLSchema"> |
|||
<process id="demoTask" isClosed="false" isExecutable="true" name="测试任务流程" processType="None"> |
|||
<startEvent id="_2" name="StartEvent"/> |
|||
<endEvent id="_3" name="EndEvent"/> |
|||
<userTask activiti:assignee="${deptId}" activiti:exclusive="true" id="_4" name="初次审核"> |
|||
<extensionElements> |
|||
<activiti:executionListener event="end" expression="审核完成"/> |
|||
</extensionElements> |
|||
</userTask> |
|||
<userTask activiti:assignee="${deptId}" activiti:exclusive="true" id="_5" name="二次审核"> |
|||
<extensionElements> |
|||
<activiti:executionListener event="end" expression="审核完成"/> |
|||
</extensionElements> |
|||
</userTask> |
|||
<sequenceFlow id="_6" sourceRef="_2" targetRef="_4"/> |
|||
<sequenceFlow id="_7" sourceRef="_4" targetRef="_5"/> |
|||
<sequenceFlow id="_8" sourceRef="_5" targetRef="_3"/> |
|||
</process> |
|||
<bpmndi:BPMNDiagram documentation="background=#FFFFFF;count=1;horizontalcount=1;orientation=0;width=842.4;height=1195.2;imageableWidth=832.4;imageableHeight=1185.2;imageableX=5.0;imageableY=5.0" id="Diagram-_1" name="New Diagram"> |
|||
<bpmndi:BPMNPlane bpmnElement="demoTask"> |
|||
<bpmndi:BPMNShape bpmnElement="_2" id="Shape-_2"> |
|||
<dc:Bounds height="32.0" width="32.0" x="370.0" y="60.0"/> |
|||
<bpmndi:BPMNLabel> |
|||
<dc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/> |
|||
</bpmndi:BPMNLabel> |
|||
</bpmndi:BPMNShape> |
|||
<bpmndi:BPMNShape bpmnElement="_3" id="Shape-_3"> |
|||
<dc:Bounds height="32.0" width="32.0" x="375.0" y="640.0"/> |
|||
<bpmndi:BPMNLabel> |
|||
<dc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/> |
|||
</bpmndi:BPMNLabel> |
|||
</bpmndi:BPMNShape> |
|||
<bpmndi:BPMNShape bpmnElement="_4" id="Shape-_4"> |
|||
<dc:Bounds height="55.0" width="85.0" x="350.0" y="225.0"/> |
|||
<bpmndi:BPMNLabel> |
|||
<dc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/> |
|||
</bpmndi:BPMNLabel> |
|||
</bpmndi:BPMNShape> |
|||
<bpmndi:BPMNShape bpmnElement="_5" id="Shape-_5"> |
|||
<dc:Bounds height="55.0" width="85.0" x="355.0" y="415.0"/> |
|||
<bpmndi:BPMNLabel> |
|||
<dc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/> |
|||
</bpmndi:BPMNLabel> |
|||
</bpmndi:BPMNShape> |
|||
<bpmndi:BPMNEdge bpmnElement="_6" id="BPMNEdge__6" sourceElement="_2" targetElement="_4"> |
|||
<di:waypoint x="386.0" y="92.0"/> |
|||
<di:waypoint x="386.0" y="225.0"/> |
|||
<bpmndi:BPMNLabel> |
|||
<dc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/> |
|||
</bpmndi:BPMNLabel> |
|||
</bpmndi:BPMNEdge> |
|||
<bpmndi:BPMNEdge bpmnElement="_7" id="BPMNEdge__7" sourceElement="_4" targetElement="_5"> |
|||
<di:waypoint x="395.0" y="280.0"/> |
|||
<di:waypoint x="395.0" y="415.0"/> |
|||
<bpmndi:BPMNLabel> |
|||
<dc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/> |
|||
</bpmndi:BPMNLabel> |
|||
</bpmndi:BPMNEdge> |
|||
<bpmndi:BPMNEdge bpmnElement="_8" id="BPMNEdge__8" sourceElement="_5" targetElement="_3"> |
|||
<di:waypoint x="391.0" y="470.0"/> |
|||
<di:waypoint x="391.0" y="640.0"/> |
|||
<bpmndi:BPMNLabel> |
|||
<dc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/> |
|||
</bpmndi:BPMNLabel> |
|||
</bpmndi:BPMNEdge> |
|||
</bpmndi:BPMNPlane> |
|||
</bpmndi:BPMNDiagram> |
|||
</definitions> |
|||
@ -1,43 +1,50 @@ |
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> |
|||
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" |
|||
xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" |
|||
xmlns:activiti="http://activiti.org/bpmn" |
|||
xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" |
|||
xmlns:tns="http://www.activiti.org/test" |
|||
xmlns:xsd="http://www.w3.org/2001/XMLSchema" |
|||
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" |
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|||
expressionLanguage="http://www.w3.org/1999/XPath" |
|||
id="m1566628843418" |
|||
name="" |
|||
targetNamespace="http://www.activiti.org/test" |
|||
typeLanguage="http://www.w3.org/2001/XMLSchema"> |
|||
<process xmlns="" id="myProcess_1" isClosed="false" isExecutable="true" |
|||
processType="None"> |
|||
<startEvent id="_2" name="开始"/> |
|||
<userTask activiti:exclusive="true" id="_3" name="UserTask"> |
|||
<extensionElements> |
|||
<activiti:taskListener event="create"/> |
|||
</extensionElements> |
|||
</userTask> |
|||
</process> |
|||
<bpmndi:BPMNDiagram xmlns="" |
|||
documentation="background=#3C3F41;count=1;horizontalcount=1;orientation=0;width=842.4;height=1195.2;imageableWidth=832.4;imageableHeight=1185.2;imageableX=5.0;imageableY=5.0" |
|||
id="Diagram-_1" |
|||
name="New Diagram"> |
|||
<bpmndi:BPMNPlane bpmnElement="myProcess_1"> |
|||
<bpmndi:BPMNShape bpmnElement="_2" id="Shape-_2"> |
|||
<omgdc:Bounds height="32.0" width="32.0" x="245.0" y="100.0"/> |
|||
<bpmndi:BPMNLabel> |
|||
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/> |
|||
</bpmndi:BPMNLabel> |
|||
</bpmndi:BPMNShape> |
|||
<bpmndi:BPMNShape bpmnElement="_3" id="Shape-_3"> |
|||
<omgdc:Bounds height="55.0" width="85.0" x="255.0" y="200.0"/> |
|||
<bpmndi:BPMNLabel> |
|||
<omgdc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/> |
|||
</bpmndi:BPMNLabel> |
|||
</bpmndi:BPMNShape> |
|||
</bpmndi:BPMNPlane> |
|||
</bpmndi:BPMNDiagram> |
|||
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.activiti.org/test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.w3.org/1999/XPath" id="m1566628843418" name="" targetNamespace="http://www.activiti.org/test" typeLanguage="http://www.w3.org/2001/XMLSchema"> |
|||
<process id="myProcess_1" isClosed="false" isExecutable="true" processType="None"> |
|||
<startEvent id="_2" name="testTaskStart"/> |
|||
<endEvent id="_6" name="testTaskEnd"/> |
|||
<userTask activiti:exclusive="true" id="_11" name="UserTask"> |
|||
<extensionElements> |
|||
<activiti:executionListener event="start" expression="test"/> |
|||
</extensionElements> |
|||
</userTask> |
|||
<sequenceFlow id="_13" sourceRef="_2" targetRef="_11"/> |
|||
<sequenceFlow id="_14" sourceRef="_11" targetRef="_6"/> |
|||
</process> |
|||
<bpmndi:BPMNDiagram documentation="background=#3C3F41;count=1;horizontalcount=1;orientation=0;width=842.4;height=1195.2;imageableWidth=832.4;imageableHeight=1185.2;imageableX=5.0;imageableY=5.0" id="Diagram-_1" name="New Diagram"> |
|||
<bpmndi:BPMNPlane bpmnElement="myProcess_1"> |
|||
<bpmndi:BPMNShape bpmnElement="_2" id="Shape-_2"> |
|||
<omgdc:Bounds height="32.0" width="32.0" x="290.0" y="55.0"/> |
|||
<bpmndi:BPMNLabel> |
|||
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/> |
|||
</bpmndi:BPMNLabel> |
|||
</bpmndi:BPMNShape> |
|||
<bpmndi:BPMNShape bpmnElement="_6" id="Shape-_6"> |
|||
<omgdc:Bounds height="32.0" width="32.0" x="285.0" y="515.0"/> |
|||
<bpmndi:BPMNLabel> |
|||
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/> |
|||
</bpmndi:BPMNLabel> |
|||
</bpmndi:BPMNShape> |
|||
<bpmndi:BPMNShape bpmnElement="_11" id="Shape-_11"> |
|||
<omgdc:Bounds height="55.0" width="85.0" x="530.0" y="240.0"/> |
|||
<bpmndi:BPMNLabel> |
|||
<omgdc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/> |
|||
</bpmndi:BPMNLabel> |
|||
</bpmndi:BPMNShape> |
|||
<bpmndi:BPMNEdge bpmnElement="_13" id="BPMNEdge__13" sourceElement="_2" targetElement="_11"> |
|||
<omgdi:waypoint x="322.0" y="71.0"/> |
|||
<omgdi:waypoint x="530.0" y="267.5"/> |
|||
<bpmndi:BPMNLabel> |
|||
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/> |
|||
</bpmndi:BPMNLabel> |
|||
</bpmndi:BPMNEdge> |
|||
<bpmndi:BPMNEdge bpmnElement="_14" id="BPMNEdge__14" sourceElement="_11" targetElement="_6"> |
|||
<omgdi:waypoint x="530.0" y="267.5"/> |
|||
<omgdi:waypoint x="317.0" y="531.0"/> |
|||
<bpmndi:BPMNLabel> |
|||
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/> |
|||
</bpmndi:BPMNLabel> |
|||
</bpmndi:BPMNEdge> |
|||
</bpmndi:BPMNPlane> |
|||
</bpmndi:BPMNDiagram> |
|||
</definitions> |
|||
|
|||
@ -0,0 +1,24 @@ |
|||
package com.elink.esua.epdc.service; |
|||
|
|||
/** |
|||
* activiti工作流 |
|||
* |
|||
* @author yujintao |
|||
* @email yujintao@elink-cn.com |
|||
* @date 2019/9/3 11:18 |
|||
*/ |
|||
public interface ActWorkflowCommonService { |
|||
|
|||
/** |
|||
* 启动流程并绑定任务 |
|||
* |
|||
* @param processKey 流程ID |
|||
* @param businessKey 任务ID |
|||
* @param deptId 部门ID(通过部门ID,判断是否有权限审核任务) |
|||
* @return boolean |
|||
* @author yujintao |
|||
* @date 2019/9/3 13:58 |
|||
*/ |
|||
boolean startProcess(String processKey, String businessKey, String deptId); |
|||
|
|||
} |
|||
@ -0,0 +1,50 @@ |
|||
package com.elink.esua.epdc.service.impl; |
|||
|
|||
import com.elink.esua.epdc.service.ActWorkflowCommonService; |
|||
import com.google.common.collect.Maps; |
|||
import org.activiti.engine.HistoryService; |
|||
import org.activiti.engine.RepositoryService; |
|||
import org.activiti.engine.RuntimeService; |
|||
import org.activiti.engine.TaskService; |
|||
import org.activiti.engine.runtime.ProcessInstance; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.web.context.ContextLoader; |
|||
import org.springframework.web.context.WebApplicationContext; |
|||
|
|||
import java.util.HashMap; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* @author yujintao |
|||
* @email yujintao@elink-cn.com |
|||
* @date 2019/9/3 11:19 |
|||
*/ |
|||
@Service |
|||
public class ActWorkflowCommonServiceImpl implements ActWorkflowCommonService { |
|||
|
|||
@Autowired |
|||
private RepositoryService repositoryService; |
|||
|
|||
@Autowired |
|||
private RuntimeService runtimeService; |
|||
|
|||
@Autowired |
|||
private TaskService taskService; |
|||
|
|||
@Autowired |
|||
private HistoryService historyService; |
|||
|
|||
@Override |
|||
public boolean startProcess(String processKey, String businessKey, String deptId) { |
|||
Map<String, Object> map = Maps.newHashMap(); |
|||
map.put("deptId", deptId); |
|||
map.put("activityId", "_2"); |
|||
//使用正在执行对象表中的一个字段BUSINESS_KEY(Activiti提供的一个字段),让启动的流程(流程实例)关联业务
|
|||
runtimeService.startProcessInstanceByKey(processKey, businessKey, map); |
|||
return true; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,110 @@ |
|||
package com.elink.esua.epdc; |
|||
|
|||
import com.elink.esua.epdc.service.ActWorkflowCommonService; |
|||
import com.google.common.collect.Maps; |
|||
import org.activiti.engine.RuntimeService; |
|||
import org.activiti.engine.TaskService; |
|||
import org.activiti.engine.runtime.ProcessInstance; |
|||
import org.activiti.engine.task.Task; |
|||
import org.activiti.engine.task.TaskQuery; |
|||
import org.junit.Test; |
|||
import org.junit.runner.RunWith; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.boot.test.context.SpringBootTest; |
|||
import org.springframework.test.context.junit4.SpringRunner; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author yujintao |
|||
* @email yujintao@elink-cn.com |
|||
* @date 2019/9/3 10:06 |
|||
*/ |
|||
@RunWith(SpringRunner.class) |
|||
@SpringBootTest |
|||
public class ActivitiTest { |
|||
|
|||
@Autowired |
|||
private ActWorkflowCommonService actWorkflowCommonService; |
|||
|
|||
@Autowired |
|||
private TaskService taskService; |
|||
|
|||
@Autowired |
|||
private RuntimeService runtimeService; |
|||
|
|||
@Test |
|||
public void test() { |
|||
String processId = "demoTask"; |
|||
// 启动一个任务流程
|
|||
actWorkflowCommonService.startProcess(processId, "testBusinessKey3", "testDeptId"); |
|||
} |
|||
|
|||
@Test |
|||
public void test2() { |
|||
String processId = "demoTask"; |
|||
String deptId = "testDeptId"; |
|||
this.queryTask(processId, deptId); |
|||
/* |
|||
关联业务id:testBusinessKey |
|||
流程实例id:5001 |
|||
任务id:5006 |
|||
任务标识:_4 |
|||
任务负责人:testDeptId |
|||
任务名称:初次审核 |
|||
任务创建时间:Tue Sep 03 14:26:50 CST 2019 |
|||
*/ |
|||
} |
|||
|
|||
@Test |
|||
public void test3() { |
|||
Map<String, Object> map = Maps.newHashMap(); |
|||
map.put("deptId", "testDeptId2"); |
|||
taskService.complete("5006", map); |
|||
} |
|||
|
|||
@Test |
|||
public void test4() { |
|||
String processId = "demoTask"; |
|||
String deptId = "testDeptId2"; |
|||
this.queryTask(processId, deptId); |
|||
/* |
|||
关联业务id:testBusinessKey |
|||
流程实例id:5001 |
|||
任务id:7502 |
|||
任务标识:_5 |
|||
任务负责人:testDeptId2 |
|||
任务名称:二次审核 |
|||
任务创建时间:Tue Sep 03 14:49:29 CST 2019 |
|||
*/ |
|||
} |
|||
|
|||
|
|||
private void queryTask(String processId, String deptId) { |
|||
//创建查询对象
|
|||
TaskQuery taskQuery = taskService.createTaskQuery().taskAssignee(deptId).processDefinitionKey(processId); |
|||
//获取查询列表
|
|||
List<Task> list = taskQuery.list(); |
|||
|
|||
for (Task task : list) { |
|||
//流程实例id
|
|||
String processInstanceId = task.getProcessInstanceId(); |
|||
//根据流程实例id找到流程实例对象
|
|||
ProcessInstance processInstance = runtimeService |
|||
.createProcessInstanceQuery() |
|||
.processInstanceId(processInstanceId) |
|||
.singleResult(); |
|||
//从流程实例对象获取bussinesskey
|
|||
String businessKey = processInstance.getBusinessKey(); |
|||
//根据businessKey查询业务系统,获取相关的业务信息
|
|||
System.out.println("关联业务id:" + businessKey); |
|||
System.out.println("流程实例id:" + task.getProcessInstanceId()); |
|||
System.out.println("任务id:" + task.getId()); |
|||
System.out.println("任务标识:" + task.getTaskDefinitionKey()); |
|||
System.out.println("任务负责人:" + task.getAssignee()); |
|||
System.out.println("任务名称:" + task.getName()); |
|||
System.out.println("任务创建时间:" + task.getCreateTime()); |
|||
} |
|||
} |
|||
} |
|||
@ -1,21 +1,159 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<configuration> |
|||
<include resource="org/springframework/boot/logging/logback/base.xml" /> |
|||
<logger name="org.springframework.web" level="INFO"/> |
|||
<logger name="org.springboot.sample" level="TRACE" /> |
|||
<include resource="org/springframework/boot/logging/logback/base.xml"/> |
|||
|
|||
<property name="log.path" value="logs/oss"/> |
|||
|
|||
<!-- 彩色日志格式 --> |
|||
<property name="CONSOLE_LOG_PATTERN" |
|||
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
|||
|
|||
<!--1. 输出到控制台--> |
|||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> |
|||
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息--> |
|||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
|||
<level>debug</level> |
|||
</filter> |
|||
<encoder> |
|||
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern> |
|||
<!-- 设置字符集 --> |
|||
<charset>UTF-8</charset> |
|||
</encoder> |
|||
</appender> |
|||
|
|||
<!--2. 输出到文档--> |
|||
<!-- 2.1 level为 DEBUG 日志,时间滚动输出 --> |
|||
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|||
<!-- 正在记录的日志文档的路径及文档名 --> |
|||
<file>${log.path}/debug.log</file> |
|||
<!--日志文档输出格式--> |
|||
<encoder> |
|||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
|||
<charset>UTF-8</charset> <!-- 设置字符集 --> |
|||
</encoder> |
|||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
|||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|||
<!-- 日志归档 --> |
|||
<fileNamePattern>${log.path}/debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
|||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
|||
<maxFileSize>100MB</maxFileSize> |
|||
</timeBasedFileNamingAndTriggeringPolicy> |
|||
<!--日志文档保留天数--> |
|||
<maxHistory>15</maxHistory> |
|||
</rollingPolicy> |
|||
<!-- 此日志文档只记录debug级别的 --> |
|||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
|||
<level>debug</level> |
|||
<onMatch>ACCEPT</onMatch> |
|||
<onMismatch>DENY</onMismatch> |
|||
</filter> |
|||
</appender> |
|||
|
|||
<!-- 2.2 level为 INFO 日志,时间滚动输出 --> |
|||
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|||
<!-- 正在记录的日志文档的路径及文档名 --> |
|||
<file>${log.path}/info.log</file> |
|||
<!--日志文档输出格式--> |
|||
<encoder> |
|||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
|||
<charset>UTF-8</charset> |
|||
</encoder> |
|||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
|||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|||
<!-- 每天日志归档路径以及格式 --> |
|||
<fileNamePattern>${log.path}/info-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
|||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
|||
<maxFileSize>100MB</maxFileSize> |
|||
</timeBasedFileNamingAndTriggeringPolicy> |
|||
<!--日志文档保留天数--> |
|||
<maxHistory>15</maxHistory> |
|||
</rollingPolicy> |
|||
<!-- 此日志文档只记录info级别的 --> |
|||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
|||
<level>info</level> |
|||
<onMatch>ACCEPT</onMatch> |
|||
<onMismatch>DENY</onMismatch> |
|||
</filter> |
|||
</appender> |
|||
|
|||
<!-- 2.3 level为 WARN 日志,时间滚动输出 --> |
|||
<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|||
<!-- 正在记录的日志文档的路径及文档名 --> |
|||
<file>${log.path}/warn.log</file> |
|||
<!--日志文档输出格式--> |
|||
<encoder> |
|||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
|||
<charset>UTF-8</charset> <!-- 此处设置字符集 --> |
|||
</encoder> |
|||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
|||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|||
<fileNamePattern>${log.path}/warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
|||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
|||
<maxFileSize>100MB</maxFileSize> |
|||
</timeBasedFileNamingAndTriggeringPolicy> |
|||
<!--日志文档保留天数--> |
|||
<maxHistory>15</maxHistory> |
|||
</rollingPolicy> |
|||
<!-- 此日志文档只记录warn级别的 --> |
|||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
|||
<level>warn</level> |
|||
<onMatch>ACCEPT</onMatch> |
|||
<onMismatch>DENY</onMismatch> |
|||
</filter> |
|||
</appender> |
|||
|
|||
<!-- 2.4 level为 ERROR 日志,时间滚动输出 --> |
|||
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|||
<!-- 正在记录的日志文档的路径及文档名 --> |
|||
<file>${log.path}/error.log</file> |
|||
<!--日志文档输出格式--> |
|||
<encoder> |
|||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
|||
<charset>UTF-8</charset> <!-- 此处设置字符集 --> |
|||
</encoder> |
|||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
|||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|||
<fileNamePattern>${log.path}/error-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
|||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
|||
<maxFileSize>100MB</maxFileSize> |
|||
</timeBasedFileNamingAndTriggeringPolicy> |
|||
<!--日志文档保留天数--> |
|||
<maxHistory>15</maxHistory> |
|||
</rollingPolicy> |
|||
<!-- 此日志文档只记录ERROR级别的 --> |
|||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
|||
<level>ERROR</level> |
|||
<onMatch>ACCEPT</onMatch> |
|||
<onMismatch>DENY</onMismatch> |
|||
</filter> |
|||
</appender> |
|||
|
|||
<!-- 开发、测试环境 --> |
|||
<springProfile name="dev,test"> |
|||
<logger name="org.springframework.web" level="INFO"/> |
|||
<logger name="org.springboot.sample" level="INFO" /> |
|||
<logger name="io.renren" level="DEBUG" /> |
|||
<logger name="org.springboot.sample" level="INFO"/> |
|||
<logger name="com.elink.esua.epdc" level="INFO"/> |
|||
<logger name="com.elink.esua.epdc.dao" level="DEBUG"/> |
|||
<root level="INFO"> |
|||
<appender-ref ref="DEBUG_FILE"/> |
|||
<appender-ref ref="INFO_FILE"/> |
|||
<appender-ref ref="WARN_FILE"/> |
|||
<appender-ref ref="ERROR_FILE"/> |
|||
</root> |
|||
</springProfile> |
|||
|
|||
<!-- 生产环境 --> |
|||
<springProfile name="prod"> |
|||
<logger name="org.springframework.web" level="ERROR"/> |
|||
<logger name="org.springboot.sample" level="ERROR" /> |
|||
<logger name="io.renren" level="ERROR" /> |
|||
<logger name="org.springboot.sample" level="ERROR"/> |
|||
<logger name="com.elink.esua.epdc" level="ERROR"/> |
|||
<root level="ERROR"> |
|||
<appender-ref ref="CONSOLE"/> |
|||
<appender-ref ref="DEBUG_FILE"/> |
|||
<appender-ref ref="INFO_FILE"/> |
|||
<appender-ref ref="WARN_FILE"/> |
|||
<appender-ref ref="ERROR_FILE"/> |
|||
</root> |
|||
</springProfile> |
|||
|
|||
</configuration> |
|||
@ -0,0 +1,85 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dto; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 党员表 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since v1.0.0 2019-09-02 |
|||
*/ |
|||
@Data |
|||
public class PartyMembersDTO implements Serializable { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
private String tagIds; |
|||
|
|||
private String tagName; |
|||
|
|||
private String id; |
|||
|
|||
private String realName; |
|||
|
|||
private String mobile; |
|||
|
|||
private String identityNo; |
|||
|
|||
private String post; |
|||
|
|||
private String postValue; |
|||
|
|||
private String cadreFlag; |
|||
|
|||
private String registFlag; |
|||
|
|||
private Date registTime; |
|||
|
|||
private String streetName; |
|||
|
|||
private long streetId; |
|||
|
|||
private String communityName; |
|||
|
|||
private long communityId; |
|||
|
|||
private String gridName; |
|||
|
|||
private long gridId; |
|||
|
|||
private long deptId; |
|||
|
|||
private Integer revision; |
|||
|
|||
private String createdBy; |
|||
|
|||
private Date createdTime; |
|||
|
|||
private String updatedBy; |
|||
|
|||
private Date updatedTime; |
|||
|
|||
private String delFlag; |
|||
|
|||
} |
|||
@ -0,0 +1,54 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dto; |
|||
|
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 党员标签关系表 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since v1.0.0 2019-09-04 |
|||
*/ |
|||
@Data |
|||
public class PartyTagRelationDTO implements Serializable { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
private String id; |
|||
|
|||
private String partyId; |
|||
|
|||
private String tagId; |
|||
|
|||
private Integer revision; |
|||
|
|||
private String createdBy; |
|||
|
|||
private Date createdTime; |
|||
|
|||
private String updatedBy; |
|||
|
|||
private Date updatedTime; |
|||
|
|||
private String delFlag; |
|||
|
|||
} |
|||
@ -0,0 +1,159 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dto; |
|||
|
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 用户信息表 |
|||
* |
|||
* @author qu qu@gmail.com |
|||
* @since v1.0.0 2019-09-02 |
|||
*/ |
|||
@Data |
|||
public class UserDTO implements Serializable { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
private String id; |
|||
|
|||
private String nickname; |
|||
|
|||
private String mobile; |
|||
|
|||
private String password; |
|||
|
|||
private Date registerTime; |
|||
|
|||
private String faceImg; |
|||
|
|||
// @ApiModelProperty(value = "性别(女性-female,男性-male)")
|
|||
private String sex; |
|||
|
|||
// @ApiModelProperty(value = "生日")
|
|||
private Date birthday; |
|||
|
|||
// @ApiModelProperty(value = "邮箱")
|
|||
private String email; |
|||
|
|||
// @ApiModelProperty(value = "电话")
|
|||
private String telephone; |
|||
|
|||
// @ApiModelProperty(value = "邮编")
|
|||
private String zipCode; |
|||
|
|||
// @ApiModelProperty(value = "职业")
|
|||
private String profession; |
|||
|
|||
// @ApiModelProperty(value = "爱好")
|
|||
private String hobbies; |
|||
|
|||
// @ApiModelProperty(value = "个性签名")
|
|||
private String userSign; |
|||
|
|||
// @ApiModelProperty(value = "邀请码")
|
|||
private String invitationCode; |
|||
|
|||
// @ApiModelProperty(value = "最近登录时间")
|
|||
private Date lastLoginTime; |
|||
|
|||
// @ApiModelProperty(value = "最近登录IP")
|
|||
private String lastLoginIp; |
|||
|
|||
// @ApiModelProperty(value = "最近登录位置经度")
|
|||
private String lastLongitude; |
|||
|
|||
// @ApiModelProperty(value = "最近登录位置维度")
|
|||
private String lastLatitude; |
|||
|
|||
// @ApiModelProperty(value = "真实姓名")
|
|||
private String realName; |
|||
|
|||
// @ApiModelProperty(value = "身份证号")
|
|||
private String identityNo; |
|||
|
|||
// @ApiModelProperty(value = "居民住址")
|
|||
private String address; |
|||
|
|||
// @ApiModelProperty(value = "微信OPENID")
|
|||
private String wxOpenId; |
|||
|
|||
// @ApiModelProperty(value = "是否是党员(0-否,1-是)")
|
|||
private String partyFlag; |
|||
|
|||
// @ApiModelProperty(value = "注册方式(wx:微信注册)")
|
|||
private String registerWay; |
|||
|
|||
// @ApiModelProperty(value = "用户来源(wp:公众号)")
|
|||
private String registerSource; |
|||
|
|||
// @ApiModelProperty(value = "手机号所属省份")
|
|||
private String phoneProvince; |
|||
|
|||
// @ApiModelProperty(value = "手机号所属城市")
|
|||
private String phoneCity; |
|||
|
|||
// @ApiModelProperty(value = "手机号所属运营商")
|
|||
private String phoneCarrier; |
|||
|
|||
// @ApiModelProperty(value = "用户积分")
|
|||
private Integer points; |
|||
|
|||
// @ApiModelProperty(value = "邀请人ID")
|
|||
private String inviteUserId; |
|||
|
|||
// @ApiModelProperty(value = "乐观锁")
|
|||
private Integer revision; |
|||
|
|||
// @ApiModelProperty(value = "网格ID")
|
|||
private String gridId; |
|||
|
|||
// @ApiModelProperty(value = "创建人")
|
|||
private String createdBy; |
|||
|
|||
// @ApiModelProperty(value = "创建时间")
|
|||
private Date createdTime; |
|||
|
|||
// @ApiModelProperty(value = "更新人")
|
|||
private String updatedBy; |
|||
|
|||
// @ApiModelProperty(value = "更新时间")
|
|||
private Date updatedTime; |
|||
|
|||
// @ApiModelProperty(value = "删除标记")
|
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 审核状态 |
|||
*/ |
|||
private Integer state; |
|||
|
|||
private String grid; |
|||
|
|||
private String street; |
|||
|
|||
private String streetId; |
|||
|
|||
private String community; |
|||
|
|||
private String communityId; |
|||
|
|||
} |
|||
@ -0,0 +1,54 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dto; |
|||
|
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 用户标签表 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since v1.0.0 2019-09-02 |
|||
*/ |
|||
@Data |
|||
public class UserTagDTO implements Serializable { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
private String id; |
|||
|
|||
private String tagName; |
|||
|
|||
private String tagDesc; |
|||
|
|||
private Integer revision; |
|||
|
|||
private String createdBy; |
|||
|
|||
private Date createdTime; |
|||
|
|||
private String updatedBy; |
|||
|
|||
private Date updatedTime; |
|||
|
|||
private String delFlag; |
|||
|
|||
} |
|||
@ -0,0 +1,45 @@ |
|||
package com.elink.esua.epdc.config; |
|||
|
|||
import com.elink.esua.epdc.config.property.WxMpProperties; |
|||
import me.chanjar.weixin.mp.api.WxMpConfigStorage; |
|||
import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage; |
|||
import me.chanjar.weixin.mp.api.WxMpService; |
|||
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.boot.context.properties.EnableConfigurationProperties; |
|||
import org.springframework.context.annotation.Bean; |
|||
import org.springframework.context.annotation.Configuration; |
|||
|
|||
/** |
|||
* 微信公众号配置 |
|||
* |
|||
* @author yujintao |
|||
* @date 2019/6/17 17:38 |
|||
*/ |
|||
@Configuration |
|||
@EnableConfigurationProperties(WxMpProperties.class) |
|||
public class WxMpConfig { |
|||
|
|||
private WxMpProperties properties; |
|||
|
|||
@Autowired |
|||
public WxMpConfig(WxMpProperties properties) { |
|||
this.properties = properties; |
|||
} |
|||
|
|||
@Bean |
|||
public WxMpService wxMpService() { |
|||
WxMpService wxMpService = new WxMpServiceImpl(); |
|||
wxMpService.setWxMpConfigStorage(wxMpConfigStorage()); |
|||
return wxMpService; |
|||
} |
|||
|
|||
@Bean |
|||
public WxMpConfigStorage wxMpConfigStorage() { |
|||
WxMpInMemoryConfigStorage wxMpConfigStorage = new WxMpInMemoryConfigStorage(); |
|||
wxMpConfigStorage.setAppId(properties.getAppid()); |
|||
wxMpConfigStorage.setSecret(properties.getSecret()); |
|||
return wxMpConfigStorage; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
package com.elink.esua.epdc.config.property; |
|||
|
|||
import lombok.Data; |
|||
import org.springframework.boot.context.properties.ConfigurationProperties; |
|||
|
|||
/** |
|||
* 微信公众号框架配置类 |
|||
* |
|||
* @author |
|||
* @Date |
|||
*/ |
|||
@Data |
|||
@ConfigurationProperties(prefix = "wx.mp") |
|||
public class WxMpProperties { |
|||
|
|||
/** |
|||
* 设置微信公众号的appid |
|||
*/ |
|||
private String appid; |
|||
|
|||
/** |
|||
* 设置微信公众号的Secret |
|||
*/ |
|||
private String secret; |
|||
|
|||
} |
|||
@ -0,0 +1,103 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; |
|||
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|||
import com.elink.esua.epdc.dto.PartyMembersDTO; |
|||
import com.elink.esua.epdc.excel.PartyMembersExcel; |
|||
import com.elink.esua.epdc.service.PartyMembersService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 党员表 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since v1.0.0 2019-09-02 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/partymembers") |
|||
public class PartyMembersController { |
|||
|
|||
@Autowired |
|||
private PartyMembersService partyMembersService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<PartyMembersDTO>> page(@RequestParam Map<String, Object> params){ |
|||
return partyMembersService.pageDIY(params); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<PartyMembersDTO> get(@PathVariable("id") String id){ |
|||
PartyMembersDTO data = partyMembersService.get(id); |
|||
|
|||
return new Result<PartyMembersDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody PartyMembersDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
dto.setDeptId(SecurityUser.getDeptId()); |
|||
partyMembersService.save(dto); |
|||
|
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody PartyMembersDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
|
|||
partyMembersService.update(dto); |
|||
|
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
|
|||
partyMembersService.delete(ids); |
|||
|
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<PartyMembersDTO> list = partyMembersService.list(params); |
|||
|
|||
ExcelUtils.exportExcelToTarget(response, null, list, PartyMembersExcel.class); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,102 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|||
import com.elink.esua.epdc.dto.PartyTagRelationDTO; |
|||
import com.elink.esua.epdc.excel.PartyTagRelationExcel; |
|||
import com.elink.esua.epdc.service.PartyTagRelationService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 党员标签关系表 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since v1.0.0 2019-09-04 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/partytagrelation") |
|||
public class PartyTagRelationController { |
|||
@Autowired |
|||
private PartyTagRelationService partyTagRelationService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<PartyTagRelationDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<PartyTagRelationDTO> page = partyTagRelationService.page(params); |
|||
|
|||
return new Result<PageData<PartyTagRelationDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<PartyTagRelationDTO> get(@PathVariable("id") String id){ |
|||
PartyTagRelationDTO data = partyTagRelationService.get(id); |
|||
|
|||
return new Result<PartyTagRelationDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody PartyTagRelationDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
|
|||
partyTagRelationService.save(dto); |
|||
|
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody PartyTagRelationDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
|
|||
partyTagRelationService.update(dto); |
|||
|
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
|
|||
partyTagRelationService.delete(ids); |
|||
|
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<PartyTagRelationDTO> list = partyTagRelationService.list(params); |
|||
|
|||
ExcelUtils.exportExcelToTarget(response, null, list, PartyTagRelationExcel.class); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,101 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
|||
import com.elink.esua.epdc.dto.UserDTO; |
|||
import com.elink.esua.epdc.excel.UserExcel; |
|||
import com.elink.esua.epdc.service.UserService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 用户信息表 |
|||
* |
|||
* @author qu qu@gmail.com |
|||
* @since v1.0.0 2019-09-02 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("user") |
|||
public class UserController { |
|||
@Autowired |
|||
private UserService userService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<UserDTO>> page( @RequestParam Map<String, Object> params){ |
|||
PageData<UserDTO> page = userService.page(params); |
|||
|
|||
return new Result<PageData<UserDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<UserDTO> get(@PathVariable("id") String id){ |
|||
UserDTO data = userService.get(id); |
|||
|
|||
return new Result<UserDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody UserDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
|
|||
userService.save(dto); |
|||
|
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody UserDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
|
|||
userService.update(dto); |
|||
|
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
|
|||
userService.delete(ids); |
|||
|
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export( @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<UserDTO> list = userService.list(params); |
|||
|
|||
ExcelUtils.exportExcelToTarget(response, null, list, UserExcel.class); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,107 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|||
import com.elink.esua.epdc.dto.UserTagDTO; |
|||
import com.elink.esua.epdc.excel.UserTagExcel; |
|||
import com.elink.esua.epdc.service.UserTagService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 用户标签表 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since v1.0.0 2019-09-02 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/usertag") |
|||
public class UserTagController { |
|||
@Autowired |
|||
private UserTagService userTagService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<UserTagDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<UserTagDTO> page = userTagService.page(params); |
|||
return new Result<PageData<UserTagDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("list") |
|||
public Result<List<UserTagDTO>> list(@RequestParam Map<String, Object> params){ |
|||
List<UserTagDTO> list = userTagService.list(params); |
|||
return new Result<List<UserTagDTO>>().ok(list); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<UserTagDTO> get(@PathVariable("id") String id){ |
|||
UserTagDTO data = userTagService.get(id); |
|||
|
|||
return new Result<UserTagDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody UserTagDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
|
|||
userTagService.save(dto); |
|||
|
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody UserTagDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
|
|||
userTagService.update(dto); |
|||
|
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
|
|||
userTagService.delete(ids); |
|||
|
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<UserTagDTO> list = userTagService.list(params); |
|||
|
|||
ExcelUtils.exportExcelToTarget(response, null, list, UserTagExcel.class); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,41 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.dto.PartyMembersDTO; |
|||
import com.elink.esua.epdc.entity.PartyMembersEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 党员表 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since v1.0.0 2019-09-02 |
|||
*/ |
|||
@Mapper |
|||
public interface PartyMembersDao extends BaseDao<PartyMembersEntity> { |
|||
|
|||
List<PartyMembersDTO> pageDIY(Map<String, Object> params); |
|||
|
|||
PartyMembersDTO selectByIdNew(String id); |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.entity.PartyTagRelationEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 党员标签关系表 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since v1.0.0 2019-09-04 |
|||
*/ |
|||
@Mapper |
|||
public interface PartyTagRelationDao extends BaseDao<PartyTagRelationEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.entity.UserEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 用户信息表 |
|||
* |
|||
* @author qu qu@gmail.com |
|||
* @since v1.0.0 2019-09-02 |
|||
*/ |
|||
@Mapper |
|||
public interface UserDao extends BaseDao<UserEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.entity.UserTagEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 用户标签表 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since v1.0.0 2019-09-02 |
|||
*/ |
|||
@Mapper |
|||
public interface UserTagDao extends BaseDao<UserTagEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,105 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.FieldFill; |
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity; |
|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 党员表 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since v1.0.0 2019-09-02 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epdc_party_members") |
|||
public class PartyMembersEntity extends BaseEpdcEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 姓名 |
|||
*/ |
|||
private String realName; |
|||
/** |
|||
* 手机号 |
|||
*/ |
|||
private String mobile; |
|||
/** |
|||
* 身份证号 |
|||
*/ |
|||
private String identityNo; |
|||
/** |
|||
* 职务 |
|||
*/ |
|||
private String post; |
|||
/** |
|||
* 职务ID(字典表) |
|||
*/ |
|||
private String postValue; |
|||
/** |
|||
* 干部下沉标识(0-否,1-是) |
|||
*/ |
|||
private String cadreFlag; |
|||
/** |
|||
* 注册状态(0-否,1-是) |
|||
*/ |
|||
private String registFlag; |
|||
/** |
|||
* 注册时间 |
|||
*/ |
|||
private Date registTime; |
|||
/** |
|||
* 街道名称 |
|||
*/ |
|||
private String streetName; |
|||
/** |
|||
* 街道ID |
|||
*/ |
|||
private long streetId; |
|||
/** |
|||
* 社区名称 |
|||
*/ |
|||
private String communityName; |
|||
/** |
|||
* 社区ID |
|||
*/ |
|||
private long communityId; |
|||
/** |
|||
* 网格名称 |
|||
*/ |
|||
private String gridName; |
|||
/** |
|||
* 网格ID |
|||
*/ |
|||
private long gridId; |
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private long deptId; |
|||
|
|||
} |
|||
@ -0,0 +1,53 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.FieldFill; |
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity; |
|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 党员标签关系表 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since v1.0.0 2019-09-04 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epdc_party_tag_relation") |
|||
public class PartyTagRelationEntity extends BaseEpdcEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 党员ID |
|||
*/ |
|||
private String partyId; |
|||
/** |
|||
* 标签ID |
|||
*/ |
|||
private String tagId; |
|||
|
|||
} |
|||
@ -0,0 +1,183 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.FieldFill; |
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 用户信息表 |
|||
* |
|||
* @author qu qu@gmail.com |
|||
* @since v1.0.0 2019-09-02 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epdc_user") |
|||
public class UserEntity extends BaseEpdcEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 昵称 |
|||
*/ |
|||
private String nickname; |
|||
/** |
|||
* 手机号 |
|||
*/ |
|||
private String mobile; |
|||
/** |
|||
* 密码 |
|||
*/ |
|||
private String password; |
|||
/** |
|||
* 注册时间 |
|||
*/ |
|||
private Date registerTime; |
|||
/** |
|||
* 头像 |
|||
*/ |
|||
private String faceImg; |
|||
/** |
|||
* 性别(女性-female,男性-male) |
|||
*/ |
|||
private String sex; |
|||
/** |
|||
* 生日 |
|||
*/ |
|||
private Date birthday; |
|||
/** |
|||
* 邮箱 |
|||
*/ |
|||
private String email; |
|||
/** |
|||
* 电话 |
|||
*/ |
|||
private String telephone; |
|||
/** |
|||
* 邮编 |
|||
*/ |
|||
private String zipCode; |
|||
/** |
|||
* 职业 |
|||
*/ |
|||
private String profession; |
|||
/** |
|||
* 爱好 |
|||
*/ |
|||
private String hobbies; |
|||
/** |
|||
* 个性签名 |
|||
*/ |
|||
private String userSign; |
|||
/** |
|||
* 邀请码 |
|||
*/ |
|||
private String invitationCode; |
|||
/** |
|||
* 最近登录时间 |
|||
*/ |
|||
private Date lastLoginTime; |
|||
/** |
|||
* 最近登录IP |
|||
*/ |
|||
private String lastLoginIp; |
|||
/** |
|||
* 最近登录位置经度 |
|||
*/ |
|||
private String lastLongitude; |
|||
/** |
|||
* 最近登录位置维度 |
|||
*/ |
|||
private String lastLatitude; |
|||
/** |
|||
* 真实姓名 |
|||
*/ |
|||
private String realName; |
|||
/** |
|||
* 身份证号 |
|||
*/ |
|||
private String identityNo; |
|||
/** |
|||
* 居民住址 |
|||
*/ |
|||
private String address; |
|||
/** |
|||
* 微信OPENID |
|||
*/ |
|||
private String wxOpenId; |
|||
/** |
|||
* 是否是党员(0-否,1-是) |
|||
*/ |
|||
private String partyFlag; |
|||
/** |
|||
* 注册方式(wx:微信注册) |
|||
*/ |
|||
private String registerWay; |
|||
/** |
|||
* 用户来源(wp:公众号) |
|||
*/ |
|||
private String registerSource; |
|||
/** |
|||
* 手机号所属省份 |
|||
*/ |
|||
private String phoneProvince; |
|||
/** |
|||
* 手机号所属城市 |
|||
*/ |
|||
private String phoneCity; |
|||
/** |
|||
* 手机号所属运营商 |
|||
*/ |
|||
private String phoneCarrier; |
|||
/** |
|||
* 用户积分 |
|||
*/ |
|||
private Integer points; |
|||
/** |
|||
* 邀请人ID |
|||
*/ |
|||
private String inviteUserId; |
|||
/** |
|||
* 网格ID |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 审核状态 |
|||
*/ |
|||
private Integer state; |
|||
|
|||
private String grid; |
|||
|
|||
private String street; |
|||
|
|||
private String streetId; |
|||
|
|||
private String community; |
|||
|
|||
private String communityId; |
|||
|
|||
} |
|||
@ -0,0 +1,53 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.FieldFill; |
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity; |
|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 用户标签表 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since v1.0.0 2019-09-02 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epdc_user_tag") |
|||
public class UserTagEntity extends BaseEpdcEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 标签名 |
|||
*/ |
|||
private String tagName; |
|||
/** |
|||
* 标签描述 |
|||
*/ |
|||
private String tagDesc; |
|||
|
|||
} |
|||
@ -0,0 +1,78 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.excel; |
|||
|
|||
import cn.afterturn.easypoi.excel.annotation.Excel; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 党员表 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since v1.0.0 2019-09-02 |
|||
*/ |
|||
@Data |
|||
public class PartyMembersExcel { |
|||
@Excel(name = "主键") |
|||
private String id; |
|||
@Excel(name = "姓名") |
|||
private String realName; |
|||
@Excel(name = "手机号") |
|||
private String mobile; |
|||
@Excel(name = "身份证号") |
|||
private String identityNo; |
|||
@Excel(name = "职务") |
|||
private String post; |
|||
@Excel(name = "职务ID(字典表)") |
|||
private String postId; |
|||
@Excel(name = "干部下沉标识(0-否,1-是)") |
|||
private String cadreFlag; |
|||
@Excel(name = "注册状态(0-否,1-是)") |
|||
private String registFlag; |
|||
@Excel(name = "注册时间") |
|||
private Date registTime; |
|||
@Excel(name = "街道名称") |
|||
private String streetName; |
|||
@Excel(name = "街道ID") |
|||
private String streetId; |
|||
@Excel(name = "社区名称") |
|||
private String communityName; |
|||
@Excel(name = "社区ID") |
|||
private String communityId; |
|||
@Excel(name = "网格名称") |
|||
private String gridName; |
|||
@Excel(name = "网格ID") |
|||
private String gridId; |
|||
@Excel(name = "部门ID") |
|||
private String deptId; |
|||
@Excel(name = "乐观锁") |
|||
private Integer revision; |
|||
@Excel(name = "创建人") |
|||
private String createdBy; |
|||
@Excel(name = "创建时间") |
|||
private Date createdTime; |
|||
@Excel(name = "更新人") |
|||
private String updatedBy; |
|||
@Excel(name = "更新时间") |
|||
private Date updatedTime; |
|||
@Excel(name = "删除标记") |
|||
private String delFlag; |
|||
|
|||
} |
|||
@ -0,0 +1,52 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.excel; |
|||
|
|||
import cn.afterturn.easypoi.excel.annotation.Excel; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 党员标签关系表 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since v1.0.0 2019-09-04 |
|||
*/ |
|||
@Data |
|||
public class PartyTagRelationExcel { |
|||
@Excel(name = "主键") |
|||
private String id; |
|||
@Excel(name = "党员ID") |
|||
private String partyId; |
|||
@Excel(name = "标签ID") |
|||
private String tagId; |
|||
@Excel(name = "乐观锁") |
|||
private Integer revision; |
|||
@Excel(name = "创建人") |
|||
private String createdBy; |
|||
@Excel(name = "创建时间") |
|||
private Date createdTime; |
|||
@Excel(name = "更新人") |
|||
private String updatedBy; |
|||
@Excel(name = "更新时间") |
|||
private Date updatedTime; |
|||
@Excel(name = "删除标记") |
|||
private String delFlag; |
|||
|
|||
} |
|||
@ -0,0 +1,110 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.excel; |
|||
|
|||
import cn.afterturn.easypoi.excel.annotation.Excel; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 用户信息表 |
|||
* |
|||
* @author qu qu@gmail.com |
|||
* @since v1.0.0 2019-09-02 |
|||
*/ |
|||
@Data |
|||
public class UserExcel { |
|||
@Excel(name = "主键") |
|||
private String id; |
|||
@Excel(name = "昵称") |
|||
private String nickname; |
|||
@Excel(name = "手机号") |
|||
private String mobile; |
|||
@Excel(name = "密码") |
|||
private String password; |
|||
@Excel(name = "注册时间") |
|||
private Date registerTime; |
|||
@Excel(name = "头像") |
|||
private String faceImg; |
|||
@Excel(name = "性别(女性-female,男性-male)") |
|||
private String sex; |
|||
@Excel(name = "生日") |
|||
private Date birthday; |
|||
@Excel(name = "邮箱") |
|||
private String email; |
|||
@Excel(name = "电话") |
|||
private String telephone; |
|||
@Excel(name = "邮编") |
|||
private String zipCode; |
|||
@Excel(name = "职业") |
|||
private String profession; |
|||
@Excel(name = "爱好") |
|||
private String hobbies; |
|||
@Excel(name = "个性签名") |
|||
private String userSign; |
|||
@Excel(name = "邀请码") |
|||
private String invitationCode; |
|||
@Excel(name = "最近登录时间") |
|||
private Date lastLoginTime; |
|||
@Excel(name = "最近登录IP") |
|||
private String lastLoginIp; |
|||
@Excel(name = "最近登录位置经度") |
|||
private String lastLongitude; |
|||
@Excel(name = "最近登录位置维度") |
|||
private String lastLatitude; |
|||
@Excel(name = "真实姓名") |
|||
private String realName; |
|||
@Excel(name = "身份证号") |
|||
private String identityNo; |
|||
@Excel(name = "居民住址") |
|||
private String address; |
|||
@Excel(name = "微信OPENID") |
|||
private String wxOpenId; |
|||
@Excel(name = "是否是党员(0-否,1-是)") |
|||
private String partyFlag; |
|||
@Excel(name = "注册方式(wx:微信注册)") |
|||
private String registerWay; |
|||
@Excel(name = "用户来源(wp:公众号)") |
|||
private String registerSource; |
|||
@Excel(name = "手机号所属省份") |
|||
private String phoneProvince; |
|||
@Excel(name = "手机号所属城市") |
|||
private String phoneCity; |
|||
@Excel(name = "手机号所属运营商") |
|||
private String phoneCarrier; |
|||
@Excel(name = "用户积分") |
|||
private Integer points; |
|||
@Excel(name = "邀请人ID") |
|||
private String inviteUserId; |
|||
@Excel(name = "乐观锁") |
|||
private Integer revision; |
|||
@Excel(name = "网格ID") |
|||
private String gridId; |
|||
@Excel(name = "创建人") |
|||
private String createdBy; |
|||
@Excel(name = "创建时间") |
|||
private Date createdTime; |
|||
@Excel(name = "更新人") |
|||
private String updatedBy; |
|||
@Excel(name = "更新时间") |
|||
private Date updatedTime; |
|||
@Excel(name = "删除标记") |
|||
private String delFlag; |
|||
|
|||
} |
|||
@ -0,0 +1,52 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.excel; |
|||
|
|||
import cn.afterturn.easypoi.excel.annotation.Excel; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 用户标签表 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since v1.0.0 2019-09-02 |
|||
*/ |
|||
@Data |
|||
public class UserTagExcel { |
|||
@Excel(name = "主键") |
|||
private String id; |
|||
@Excel(name = "标签名") |
|||
private String tagName; |
|||
@Excel(name = "标签描述") |
|||
private String tagDesc; |
|||
@Excel(name = "乐观锁") |
|||
private Integer revision; |
|||
@Excel(name = "创建人") |
|||
private String createdBy; |
|||
@Excel(name = "创建时间") |
|||
private Date createdTime; |
|||
@Excel(name = "更新人") |
|||
private String updatedBy; |
|||
@Excel(name = "更新时间") |
|||
private Date updatedTime; |
|||
@Excel(name = "删除标记") |
|||
private String delFlag; |
|||
|
|||
} |
|||
@ -0,0 +1,43 @@ |
|||
/** |
|||
* Copyright (c) 2018 人人开源 All rights reserved. |
|||
* |
|||
* https://www.renren.io
|
|||
* |
|||
* 版权所有,侵权必究! |
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.jwt; |
|||
|
|||
import org.springframework.boot.context.properties.ConfigurationProperties; |
|||
import org.springframework.context.annotation.Configuration; |
|||
|
|||
/** |
|||
* Jwt |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since 1.0.0 |
|||
*/ |
|||
@Configuration |
|||
@ConfigurationProperties(prefix = "jwt") |
|||
public class JwtProperties { |
|||
|
|||
private String secret; |
|||
|
|||
private int expire; |
|||
|
|||
public String getSecret() { |
|||
return secret; |
|||
} |
|||
|
|||
public void setSecret(String secret) { |
|||
this.secret = secret; |
|||
} |
|||
|
|||
public int getExpire() { |
|||
return expire; |
|||
} |
|||
|
|||
public void setExpire(int expire) { |
|||
this.expire = expire; |
|||
} |
|||
} |
|||
@ -0,0 +1,80 @@ |
|||
/** |
|||
* Copyright (c) 2018 人人开源 All rights reserved. |
|||
* <p> |
|||
* https://www.renren.io
|
|||
* <p> |
|||
* 版权所有,侵权必究! |
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.jwt; |
|||
|
|||
import io.jsonwebtoken.Claims; |
|||
import io.jsonwebtoken.Jwts; |
|||
import io.jsonwebtoken.SignatureAlgorithm; |
|||
import org.joda.time.DateTime; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* Jwt工具类 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since 1.0.0 |
|||
*/ |
|||
@Component |
|||
public class JwtUtils { |
|||
private static final Logger logger = LoggerFactory.getLogger(JwtUtils.class); |
|||
|
|||
@Autowired |
|||
private JwtProperties jwtProperties; |
|||
|
|||
/** |
|||
* 生成jwt token |
|||
*/ |
|||
public String generateToken(Long userId) { |
|||
return Jwts.builder() |
|||
.setHeaderParam("typ", "JWT") |
|||
.setSubject(userId + "") |
|||
.setIssuedAt(new Date()) |
|||
.setExpiration(DateTime.now().plusSeconds(jwtProperties.getExpire()).toDate()) |
|||
.signWith(SignatureAlgorithm.HS512, jwtProperties.getSecret()) |
|||
.compact(); |
|||
} |
|||
|
|||
/** |
|||
* 生成jwt token |
|||
*/ |
|||
public String generateToken(String userId) { |
|||
return Jwts.builder() |
|||
.setHeaderParam("typ", "JWT") |
|||
.setSubject(userId) |
|||
.setIssuedAt(new Date()) |
|||
.setExpiration(DateTime.now().plusSeconds(jwtProperties.getExpire()).toDate()) |
|||
.signWith(SignatureAlgorithm.HS512, jwtProperties.getSecret()) |
|||
.compact(); |
|||
} |
|||
|
|||
public Claims getClaimByToken(String token) { |
|||
try { |
|||
return Jwts.parser() |
|||
.setSigningKey(jwtProperties.getSecret()) |
|||
.parseClaimsJws(token) |
|||
.getBody(); |
|||
} catch (Exception e) { |
|||
logger.debug("validate is token error, token = " + token, e); |
|||
return null; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* token是否过期 |
|||
* @return true:过期 |
|||
*/ |
|||
public boolean isTokenExpired(Date expiration) { |
|||
return expiration.before(new Date()); |
|||
} |
|||
} |
|||
@ -0,0 +1,47 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.redis; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.redis.RedisUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 党员表 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since v1.0.0 2019-09-02 |
|||
*/ |
|||
@Component |
|||
public class PartyMembersRedis { |
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
public void delete(Object[] ids) { |
|||
|
|||
} |
|||
|
|||
public void set(){ |
|||
|
|||
} |
|||
|
|||
public String get(String id){ |
|||
return null; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,47 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.redis; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.redis.RedisUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 党员标签关系表 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since v1.0.0 2019-09-04 |
|||
*/ |
|||
@Component |
|||
public class PartyTagRelationRedis { |
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
public void delete(Object[] ids) { |
|||
|
|||
} |
|||
|
|||
public void set(){ |
|||
|
|||
} |
|||
|
|||
public String get(String id){ |
|||
return null; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,46 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.redis; |
|||
import com.elink.esua.epdc.commons.tools.redis.RedisUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 用户信息表 |
|||
* |
|||
* @author qu qu@gmail.com |
|||
* @since v1.0.0 2019-09-02 |
|||
*/ |
|||
@Component |
|||
public class UserRedis { |
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
public void delete(Object[] ids) { |
|||
|
|||
} |
|||
|
|||
public void set(){ |
|||
|
|||
} |
|||
|
|||
public String get(String id){ |
|||
return null; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,47 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.redis; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.redis.RedisUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 用户标签表 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since v1.0.0 2019-09-02 |
|||
*/ |
|||
@Component |
|||
public class UserTagRedis { |
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
public void delete(Object[] ids) { |
|||
|
|||
} |
|||
|
|||
public void set(){ |
|||
|
|||
} |
|||
|
|||
public String get(String id){ |
|||
return null; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,50 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.service; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.PartyMembersDTO; |
|||
import com.elink.esua.epdc.entity.PartyMembersEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 党员表 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since v1.0.0 2019-09-02 |
|||
*/ |
|||
public interface PartyMembersService extends BaseService<PartyMembersEntity> { |
|||
|
|||
PageData<PartyMembersDTO> page(Map<String, Object> params); |
|||
|
|||
Result<PageData<PartyMembersDTO>> pageDIY(Map<String, Object> params); |
|||
|
|||
List<PartyMembersDTO> list(Map<String, Object> params); |
|||
|
|||
PartyMembersDTO get(String id); |
|||
|
|||
void save(PartyMembersDTO dto); |
|||
|
|||
void update(PartyMembersDTO dto); |
|||
|
|||
void delete(String[] ids); |
|||
} |
|||
@ -0,0 +1,47 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.service; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.dto.PartyTagRelationDTO; |
|||
import com.elink.esua.epdc.entity.PartyTagRelationEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 党员标签关系表 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since v1.0.0 2019-09-04 |
|||
*/ |
|||
public interface PartyTagRelationService extends BaseService<PartyTagRelationEntity> { |
|||
|
|||
PageData<PartyTagRelationDTO> page(Map<String, Object> params); |
|||
|
|||
List<PartyTagRelationDTO> list(Map<String, Object> params); |
|||
|
|||
PartyTagRelationDTO get(String id); |
|||
|
|||
void save(PartyTagRelationDTO dto); |
|||
|
|||
void update(PartyTagRelationDTO dto); |
|||
|
|||
void delete(String[] ids); |
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue