From 89d13499ee41771ca492bce075472f34ed7df7b5 Mon Sep 17 00:00:00 2001 From: qushutong <1976590620@qq.com> Date: Mon, 2 Sep 2019 18:35:08 +0800 Subject: [PATCH 1/5] gateway --- esua-epdc/epdc-gateway/pom.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/esua-epdc/epdc-gateway/pom.xml b/esua-epdc/epdc-gateway/pom.xml index af24ad60b..ec6fe04a4 100644 --- a/esua-epdc/epdc-gateway/pom.xml +++ b/esua-epdc/epdc-gateway/pom.xml @@ -79,10 +79,10 @@ elink@888 - lb://epdc-auth-server - - lb://epdc-admin-server - + + http://127.0.0.1:9091 + + http://127.0.0.1:9092 lb://epdc-activiti-server lb://epdc-api-server lb://epdc-app-server @@ -105,7 +105,7 @@ lb://epdc-demo-server - true + false 47.104.224.45:8848 http://localhost:9411 From 21c8d40bf52f599d1390a752c07486e682069b14 Mon Sep 17 00:00:00 2001 From: qushutong <1976590620@qq.com> Date: Mon, 2 Sep 2019 20:05:36 +0800 Subject: [PATCH 2/5] gateway --- .../epdc-admin-server/src/main/resources/application-dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/application-dev.yml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/application-dev.yml index 67cd4ed55..cd056059e 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/application-dev.yml +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/application-dev.yml @@ -10,7 +10,7 @@ spring: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://47.104.224.45:3308/esua_epdc_admin?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai username: epdc - password: elink888 + password: elink833066 #Oracle # driver-class-name: oracle.jdbc.OracleDriver # url: jdbc:oracle:thin:@localhost:1521:xe From cce4d38d4ed877c0ba708a2334bbb630e8b0594c Mon Sep 17 00:00:00 2001 From: qushutong <1976590620@qq.com> Date: Tue, 3 Sep 2019 15:57:24 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fallback/UserFeignClientFallback.java | 2 +- .../java/com/elink/esua/epdc/dto/UserDTO.java | 149 +++++++++++++++ .../esua/epdc/controller/UserController.java | 101 ++++++++++ .../java/com/elink/esua/epdc/dao/UserDao.java | 33 ++++ .../elink/esua/epdc/entity/UserEntity.java | 173 ++++++++++++++++++ .../com/elink/esua/epdc/excel/UserExcel.java | 110 +++++++++++ .../com/elink/esua/epdc/redis/UserRedis.java | 46 +++++ .../elink/esua/epdc/service/UserService.java | 47 +++++ .../epdc/service/impl/UserServiceImpl.java | 112 ++++++++++++ .../epdc/service/impl/UserTagServiceImpl.java | 3 +- .../src/main/resources/mapper/UserDao.xml | 49 +++++ 11 files changed, 823 insertions(+), 2 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserDTO.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserController.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserEntity.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/UserExcel.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/redis/UserRedis.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml diff --git a/esua-epdc/epdc-auth/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java b/esua-epdc/epdc-auth/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java index 76a676fcd..ee760cd1e 100644 --- a/esua-epdc/epdc-auth/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java +++ b/esua-epdc/epdc-auth/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java @@ -28,7 +28,7 @@ public class UserFeignClientFallback implements UserFeignClient { } @Override - public Result getByUsername(String username) { + public Result getByUsername(String username) { return new Result<>(); } } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserDTO.java new file mode 100644 index 000000000..889fa2cf3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserDTO.java @@ -0,0 +1,149 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto; + + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户信息表 + * + * @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; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserController.java new file mode 100644 index 000000000..644c3c5f6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserController.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.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("epdc/user") +public class UserController { + @Autowired + private UserService userService; + + @GetMapping("page") + public Result> page( @RequestParam Map params){ + PageData page = userService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + UserDTO data = userService.get(id); + + return new Result().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 params, HttpServletResponse response) throws Exception { + List list = userService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, UserExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java new file mode 100644 index 000000000..dd75d4c29 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.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 { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserEntity.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserEntity.java new file mode 100644 index 000000000..b8ff4847d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserEntity.java @@ -0,0 +1,173 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.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; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/UserExcel.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/UserExcel.java new file mode 100644 index 000000000..ea5990a00 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/UserExcel.java @@ -0,0 +1,110 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.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; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/redis/UserRedis.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/redis/UserRedis.java new file mode 100644 index 000000000..ab9556b81 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/redis/UserRedis.java @@ -0,0 +1,46 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.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; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java new file mode 100644 index 000000000..28e105742 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.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.UserDTO; +import com.elink.esua.epdc.entity.UserEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户信息表 + * + * @author qu qu@gmail.com + * @since v1.0.0 2019-09-02 + */ +public interface UserService extends BaseService { + + PageData page(Map params); + + List list(Map params); + + UserDTO get(String id); + + void save(UserDTO dto); + + void update(UserDTO dto); + + void delete(String[] ids); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java new file mode 100644 index 000000000..4d0b820e0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java @@ -0,0 +1,112 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.dao.UserDao; +import com.elink.esua.epdc.dto.UserDTO; +import com.elink.esua.epdc.entity.UserEntity; +import com.elink.esua.epdc.redis.UserRedis; +import com.elink.esua.epdc.service.UserService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 用户信息表 + * + * @author qu qu@gmail.com + * @since v1.0.0 2019-09-02 + */ +@Service +public class UserServiceImpl extends BaseServiceImpl implements UserService { + @Autowired + private UserRedis userRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + + return getPageData(page, UserDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, UserDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get("id"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), "id", id); + //wrapper.eq(Constant.DEL_FLAG, DelFlagEnum.NORMAL.value()); + + return wrapper; + } + + @Override + public UserDTO get(String id) { + UserEntity entity = baseDao.selectById(id); + + return ConvertUtils.sourceToTarget(entity, UserDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(UserDTO dto) { + UserEntity entity = ConvertUtils.sourceToTarget(dto, UserEntity.class); + + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(UserDTO dto) { + UserEntity entity = ConvertUtils.sourceToTarget(dto, UserEntity.class); + + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + //逻辑删除 + //logicDelete(ids, UserEntity.class); + + //物理删除 + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserTagServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserTagServiceImpl.java index ce40103b3..dbc747c97 100755 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserTagServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserTagServiceImpl.java @@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.elink.esua.epdc.commons.mybatis.enums.DelFlagEnum; import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.exception.RenException; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; @@ -53,7 +54,7 @@ public class UserTagServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( - getPage(params, Constant.CREATED_TIME, false), + getPage(params, FieldConstant.CREATED_TIME, false), getWrapper(params) ); diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml new file mode 100644 index 000000000..be9256fbe --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 12c493846df32a3fc3e393697b0b21936fece84e Mon Sep 17 00:00:00 2001 From: yujintao Date: Tue, 3 Sep 2019 16:17:54 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=94=BE=E5=BC=83=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc-activiti-server/processon/demo1.bpmn | 69 +++++++++++ .../epdc-activiti-server/processon/yishi.bpmn | 89 +++++++------- .../service/ActWorkflowCommonService.java | 24 ++++ .../impl/ActWorkflowCommonServiceImpl.java | 50 ++++++++ .../com/elink/esua/epdc/ActivitiTest.java | 110 ++++++++++++++++++ 5 files changed, 301 insertions(+), 41 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/processon/demo1.bpmn create mode 100644 esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/src/main/java/com/elink/esua/epdc/service/ActWorkflowCommonService.java create mode 100644 esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/src/main/java/com/elink/esua/epdc/service/impl/ActWorkflowCommonServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/src/test/java/com/elink/esua/epdc/ActivitiTest.java diff --git a/esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/processon/demo1.bpmn b/esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/processon/demo1.bpmn new file mode 100644 index 000000000..f860f8979 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/processon/demo1.bpmn @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/processon/yishi.bpmn b/esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/processon/yishi.bpmn index 33cdd1a32..152a2efff 100644 --- a/esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/processon/yishi.bpmn +++ b/esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/processon/yishi.bpmn @@ -1,43 +1,50 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/src/main/java/com/elink/esua/epdc/service/ActWorkflowCommonService.java b/esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/src/main/java/com/elink/esua/epdc/service/ActWorkflowCommonService.java new file mode 100644 index 000000000..2db005979 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/src/main/java/com/elink/esua/epdc/service/ActWorkflowCommonService.java @@ -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); + +} diff --git a/esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/src/main/java/com/elink/esua/epdc/service/impl/ActWorkflowCommonServiceImpl.java b/esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/src/main/java/com/elink/esua/epdc/service/impl/ActWorkflowCommonServiceImpl.java new file mode 100644 index 000000000..8c1dee237 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/src/main/java/com/elink/esua/epdc/service/impl/ActWorkflowCommonServiceImpl.java @@ -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 map = Maps.newHashMap(); + map.put("deptId", deptId); + map.put("activityId", "_2"); + //使用正在执行对象表中的一个字段BUSINESS_KEY(Activiti提供的一个字段),让启动的流程(流程实例)关联业务 + runtimeService.startProcessInstanceByKey(processKey, businessKey, map); + return true; + } + + +} diff --git a/esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/src/test/java/com/elink/esua/epdc/ActivitiTest.java b/esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/src/test/java/com/elink/esua/epdc/ActivitiTest.java new file mode 100644 index 000000000..5594c95e7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/src/test/java/com/elink/esua/epdc/ActivitiTest.java @@ -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 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 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()); + } + } +} From e082698ce6292ab1cae5ec6e77118c9247a9b349 Mon Sep 17 00:00:00 2001 From: yujintao Date: Tue, 3 Sep 2019 16:55:52 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=AD=97=E5=85=B8=E5=92=8C=E8=A1=8C?= =?UTF-8?q?=E6=94=BF=E5=8C=BA=E5=88=92=E6=A8=A1=E5=9D=97=EF=BC=8C=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=85=AC=E7=94=A8=E6=96=B9=E6=B3=95=EF=BC=9B=E5=85=AC?= =?UTF-8?q?=E7=94=A8=E5=AE=9E=E7=8E=B0=E7=B1=BB=E6=B7=BB=E5=8A=A0=E6=96=B9?= =?UTF-8?q?=E6=B3=95=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/elink/esua/epdc/dto/AreaDTO.java | 71 ++++++++++++++++ .../elink/esua/epdc/dto/SimpleAreaDTO.java | 28 +++++++ .../elink/esua/epdc/dto/SysSimpleDictDTO.java | 31 +++++++ .../esua/epdc/controller/AreaController.java | 42 ++++++++++ .../epdc/controller/SysDictController.java | 28 +++++++ .../java/com/elink/esua/epdc/dao/AreaDao.java | 16 ++++ .../elink/esua/epdc/entity/AreaEntity.java | 60 ++++++++++++++ .../com/elink/esua/epdc/redis/AreaRedis.java | 67 +++++++++++++++ .../elink/esua/epdc/redis/SysDictRedis.java | 81 +++++++++++++++++++ .../elink/esua/epdc/service/AreaService.java | 29 +++++++ .../esua/epdc/service/SysDictService.java | 22 +++++ .../epdc/service/impl/AreaServiceImpl.java | 65 +++++++++++++++ .../epdc/service/impl/SysDictServiceImpl.java | 50 +++++++++++- .../mybatis/service/impl/BaseServiceImpl.java | 59 ++++++++++---- .../epdc/commons/tools/redis/RedisKeys.java | 24 ++++++ 15 files changed, 657 insertions(+), 16 deletions(-) create mode 100644 esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/AreaDTO.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SimpleAreaDTO.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysSimpleDictDTO.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/AreaController.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/AreaDao.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/AreaEntity.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/AreaRedis.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/SysDictRedis.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/AreaService.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/AreaServiceImpl.java diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/AreaDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/AreaDTO.java new file mode 100644 index 000000000..a8335772d --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/AreaDTO.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.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; +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SimpleAreaDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SimpleAreaDTO.java new file mode 100644 index 000000000..1ab29bab7 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SimpleAreaDTO.java @@ -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; +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysSimpleDictDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysSimpleDictDTO.java new file mode 100644 index 000000000..493c0f1cf --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysSimpleDictDTO.java @@ -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; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/AreaController.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/AreaController.java new file mode 100644 index 000000000..13bb88cbd --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/AreaController.java @@ -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> + * @author yujintao + * @date 2019/9/3 16:28 + */ + @GetMapping("listSimple/{areaId}") + public Result> listSimpleAreaInfo(@PathVariable("areaId") String areaId) { + return this.areaService.listSimpleAreaInfo(areaId); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDictController.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDictController.java index 075b9d134..806100627 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDictController.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDictController.java @@ -17,6 +17,7 @@ import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; import com.elink.esua.epdc.dto.SysDictDTO; +import com.elink.esua.epdc.dto.SysSimpleDictDTO; import com.elink.esua.epdc.service.SysDictService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -116,4 +117,31 @@ public class SysDictController { return new Result(); } + /** + * 根据数据字典类型获取简版数据字典列表,用于页面下拉菜单 + * + * @param dictType 数据字典类型 + * @return com.elink.esua.commons.tools.utils.Result> + * @author yujintao + * @date 2019/7/15 09:33 + */ + @GetMapping("listSimple/{dictType}") + @ApiOperation("字典分类数据") + @ApiImplicitParams({ + @ApiImplicitParam(name = "dictName", value = "字典名称", paramType = "query", dataType = "String") + }) + public Result> listSimpleDictInfo(@ApiIgnore @PathVariable("dictType") String dictType) { + //字典分类数据 + return sysDictService.listSimpleDictInfo(dictType); + } + + @DeleteMapping("{id}") + @ApiOperation("删除") + @LogOperation("Delete Dict") + public Result delete(@PathVariable Long id) { + //效验数据 + sysDictService.delete(id); + return new Result(); + } + } diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/AreaDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/AreaDao.java new file mode 100644 index 000000000..3a9944a39 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/AreaDao.java @@ -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 { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/AreaEntity.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/AreaEntity.java new file mode 100644 index 000000000..c5d58ad5b --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/AreaEntity.java @@ -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; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/AreaRedis.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/AreaRedis.java new file mode 100644 index 000000000..2dbe2158a --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/AreaRedis.java @@ -0,0 +1,67 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.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 getSimpleAreaList(String areaId) { + String configAreaKey = RedisKeys.getSimpleAreaKey(areaId); + return (List) redisUtils.get(configAreaKey); + } + + /** + * 缓存区划信息 + * + * @param areaId + * @param areaDtoList + * @return void + * @author yujintao + * @date 2019/6/13 11:02 + */ + public void setSimpleAreaList(String areaId, List areaDtoList) { + String configAreaKey = RedisKeys.getSimpleAreaKey(areaId); + redisUtils.set(configAreaKey, areaDtoList); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/SysDictRedis.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/SysDictRedis.java new file mode 100644 index 000000000..d67e65afa --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/SysDictRedis.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.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 + * @author yujintao + * @date 2019/7/15 09:42 + */ + public List getSimpleDictList(String dictType) { + String dictKey = RedisKeys.getSimpleDictKey(dictType); + return (List) redisUtils.get(dictKey); + } + + /** + * 根据数据字典类型,将简版数据字典列表放入缓存 + * + * @param dictType 数据字典类型 + * @param simpleDictList 列表 + * @return void + * @author yujintao + * @date 2019/7/15 09:50 + */ + public void setSimpleDictList(String dictType, List 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); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/AreaService.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/AreaService.java new file mode 100644 index 000000000..72a0ce258 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/AreaService.java @@ -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 { + + + /** + * 根据区划ID,获取下属区域列表 + * + * @param areaId + * @return com.elink.esua.commons.tools.utils.Result> + * @author yujintao + * @date 2019/6/13 10:35 + */ + Result> listSimpleAreaInfo(String areaId); +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDictService.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDictService.java index e6585dde1..b6a4fe634 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDictService.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDictService.java @@ -10,7 +10,9 @@ 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.SysDictDTO; +import com.elink.esua.epdc.dto.SysSimpleDictDTO; import com.elink.esua.epdc.entity.SysDictEntity; import java.util.List; @@ -35,4 +37,24 @@ public interface SysDictService extends BaseService { void update(SysDictDTO dto); void delete(Long[] ids); + + /** + * 根据数据字典类型获取简版数据字典列表,用于页面下拉菜单 + * + * @param dictType 数据字典类型 + * @return com.elink.esua.commons.tools.utils.Result> + * @author yujintao + * @date 2019/7/15 09:33 + */ + Result> listSimpleDictInfo(String dictType); + + /** + * 根据ID删除 + * + * @param id + * @return void + * @author yujintao + * @date 2019/7/15 10:14 + */ + void delete(Long id); } diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/AreaServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/AreaServiceImpl.java new file mode 100644 index 000000000..7bf4a8b76 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/AreaServiceImpl.java @@ -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 implements AreaService { + + + @Autowired + private AreaRedis areaRedis; + + @Override + public Result> listSimpleAreaInfo(String areaId) { + + List simpleAreaList = Lists.newArrayList(); + + try { + if (StringUtils.isNotBlank(areaId)) { + + List areaList = areaRedis.getSimpleAreaList(areaId); + if (null != areaList) { + return new Result>().ok(areaList); + } + + Integer pid = Integer.parseInt(areaId); + QueryWrapper arWrapper = new QueryWrapper<>(); + arWrapper.select("ID", "NAME"); + arWrapper.eq("PARENT_ID", pid); + arWrapper.eq("STATUS", NumConstant.ONE); + arWrapper.orderByAsc("LEVEL", "SORT"); + List 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>().ok(simpleAreaList); + } +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDictServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDictServiceImpl.java index bcab87744..5c6f0d565 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDictServiceImpl.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDictServiceImpl.java @@ -15,11 +15,17 @@ import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; import com.elink.esua.epdc.commons.tools.constant.Constant; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dao.SysDictDao; import com.elink.esua.epdc.dto.SysDictDTO; +import com.elink.esua.epdc.dto.SysSimpleDictDTO; import com.elink.esua.epdc.entity.SysDictEntity; +import com.elink.esua.epdc.redis.SysDictRedis; import com.elink.esua.epdc.service.SysDictService; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -32,9 +38,13 @@ import java.util.Map; * @author Mark sunlightcs@gmail.com * @since 1.0.0 */ +@Slf4j @Service public class SysDictServiceImpl extends BaseServiceImpl implements SysDictService { + @Autowired + private SysDictRedis dictRedis; + @Override public PageData page(Map params) { QueryWrapper wrapper = getWrapper(params); @@ -82,16 +92,16 @@ public class SysDictServiceImpl extends BaseServiceImpl> listSimpleDictInfo(String dictType) { + List simpleDictList = Lists.newArrayList(); + + try { + if (StringUtils.isNotBlank(dictType)) { + + List dictList = dictRedis.getSimpleDictList(dictType); + if (null != dictList) { + return new Result>().ok(dictList); + } + + QueryWrapper sdWrapper = new QueryWrapper<>(); + sdWrapper.select("dict_value", "dict_name"); + sdWrapper.eq("dict_type", dictType); + sdWrapper.ne("dict_value", ""); + sdWrapper.isNotNull("dict_value"); + sdWrapper.orderByAsc("SORT", Constant.CREATE_DATE); + List entityList = baseDao.selectList(sdWrapper); + if (!entityList.isEmpty()) { + simpleDictList = ConvertUtils.sourceToTarget(entityList, SysSimpleDictDTO.class); + dictRedis.setSimpleDictList(dictType, simpleDictList); + } + } + } catch (Exception e) { + log.error("获取数据字典列表失败,错误信息{}", e.getMessage()); + } + return new Result>().ok(simpleDictList); + } } diff --git a/esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/service/impl/BaseServiceImpl.java b/esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/service/impl/BaseServiceImpl.java index 461940eeb..bc7f6b44f 100644 --- a/esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/service/impl/BaseServiceImpl.java +++ b/esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/service/impl/BaseServiceImpl.java @@ -12,11 +12,11 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.enums.SqlMethod; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; import com.baomidou.mybatisplus.core.toolkit.*; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; import com.elink.esua.epdc.commons.mybatis.service.BaseService; -import com.elink.esua.epdc.commons.mybatis.service.BaseService; import com.elink.esua.epdc.commons.mybatis.utils.EntityUtils; import com.elink.esua.epdc.commons.tools.constant.Constant; import com.elink.esua.epdc.commons.tools.page.PageData; @@ -39,16 +39,53 @@ import java.util.Map; * @since 1.0.0 */ public abstract class BaseServiceImpl, T> implements BaseService { + @Autowired protected M baseDao; /** * 获取分页对象 - * @param params 分页查询参数 - * @param defaultOrderField 默认排序字段 - * @param isAsc 排序方式 + * + * @param params 分页查询参数 + * @param defaultOrderField 默认排序字段 + * @param isAsc 排序方式 */ protected IPage getPage(Map params, String defaultOrderField, boolean isAsc) { + Page page = initPage(params); + + //默认排序 + if (StringUtils.isNotEmpty(defaultOrderField)) { + if (isAsc) { + page.addOrder(OrderItem.asc(defaultOrderField)); + } else { + page.addOrder(OrderItem.desc(defaultOrderField)); + } + } + return page; + } + + /** + * 获取分页对象 + * + * @param params 分页查询参数 + * @return com.baomidou.mybatisplus.core.metadata.IPage + * @author yujintao + * @date 2019/6/12 10:57 + */ + protected IPage getPage(Map params) { + Page page = initPage(params); + return page; + } + + /** + * 初始化分页对象 + * + * @param params 分页查询参数 + * @return com.baomidou.mybatisplus.core.metadata.IPage + * @author yujintao + * @date 2019/6/12 10:57 + */ + private Page initPage(Map params) { //分页参数 long curPage = 1; long limit = 10; @@ -73,19 +110,12 @@ public abstract class BaseServiceImpl, T> implements Bas //前端字段排序 if (StringUtils.isNotEmpty(orderField) && StringUtils.isNotEmpty(order)) { if (Constant.ASC.equalsIgnoreCase(order)) { - return page.setAsc(orderField); + return page.addOrder(OrderItem.asc(orderField)); } else { - return page.setDesc(orderField); + return page.addOrder(OrderItem.desc(orderField)); } } - //默认排序 - if (isAsc) { - page.setAsc(defaultOrderField); - } else { - page.setDesc(defaultOrderField); - } - return page; } @@ -113,9 +143,9 @@ public abstract class BaseServiceImpl, T> implements Bas /** * 逻辑删除 + * * @param ids ids * @param entity 实体 - * * @return boolean */ @Override @@ -156,6 +186,7 @@ public abstract class BaseServiceImpl, T> implements Bas /** * 释放sqlSession + * * @param sqlSession session */ protected void closeSqlSession(SqlSession sqlSession) { diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/redis/RedisKeys.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/redis/RedisKeys.java index ae522f7c5..494c8c448 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/redis/RedisKeys.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/redis/RedisKeys.java @@ -73,4 +73,28 @@ public class RedisKeys { public static String getCpUserKey(String id) { return "sys:security:cpuser:" + id; } + + /** + * 获取简要区划信息key + * + * @param areaId 行政区划ID + * @return java.lang.String + * @author yujintao + * @date 2019/9/3 16:28 + */ + public static String getSimpleAreaKey(String areaId) { + return "epdc:config:simple:area:" + areaId; + } + + /** + * 获取简要数据字典key + * + * @param dictType 数据字典类型 + * @return java.lang.String + * @author yujintao + * @date 2019/9/3 16:28 + */ + public static String getSimpleDictKey(String dictType) { + return "epdc:config:simple:dict:" + dictType; + } }