diff --git a/doc/开发规范/命名规范.txt b/doc/开发规范/命名规范.txt new file mode 100644 index 0000000000..684d4b35ef --- /dev/null +++ b/doc/开发规范/命名规范.txt @@ -0,0 +1,19 @@ +dao层: +1、结果集是集合用selectListXXX +2、结果集为一个实例用selectOneXXX +3、更新:updateXXX +4、插入:insertXXX +5、删除:deleteXXX +6、获取统计值的方法用 selectCount +service层: +1、结果集是集合:listXXX +2、结果集是一个实例:getXXX +3、插入:saveXXX +5、修改:modifyXXX +4、删除:removeXXX +5、获取统计值的方法用 countXXX + + +数据传输对象:xxxDTO,xxx 为业务领域相关的名称 + +controller层根据接口定义来取名,接口定的什么就取什么 diff --git a/doc/开发规范/阿里巴巴java开发规范1.4.pdf b/doc/开发规范/阿里巴巴java开发规范1.4.pdf new file mode 100644 index 0000000000..35865f0599 Binary files /dev/null and b/doc/开发规范/阿里巴巴java开发规范1.4.pdf differ diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index 60da2cf0de..3d6c2500ae 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -57,6 +57,29 @@ kaptcha ${kaptcha.version} + + com.epmet + epmet-common-clienttoken + 2.0.0 + + + com.github.binarywang + weixin-java-miniapp + 3.6.0 + compile + + + com.epmet + epmet-commons-tools-wx-ma + 1.0.0 + compile + + + com.epmet + epmet-commons-mybatis + 2.0.0 + compile + @@ -92,6 +115,12 @@ 8081 dev + + + + + epmet + elink@833066 0 122.152.200.70 @@ -105,6 +134,15 @@ false + + + wx67fdf7da3fee1890 + ae15094f485af9e5c6b5a8a55945332a + 111 + 111 + + wx7c95937fa16a58c4 + 5782d372d99820fb4859d6be8e5230b0 @@ -117,6 +155,12 @@ 8081 test + + + + + epmet + elink@833066 0 122.152.200.70 @@ -130,6 +174,15 @@ false + + + wx67fdf7da3fee1890 + ae15094f485af9e5c6b5a8a55945332a + 111 + 111 + + wx7c95937fa16a58c4 + 5782d372d99820fb4859d6be8e5230b0 diff --git a/epmet-auth/src/main/java/com/epmet/controller/LoginController.java b/epmet-auth/src/main/java/com/epmet/controller/LoginController.java new file mode 100644 index 0000000000..147206dd0a --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/controller/LoginController.java @@ -0,0 +1,51 @@ +package com.epmet.controller; + +import com.epmet.common.token.annotation.Login; +import com.epmet.common.token.dto.form.LoginByPassWordFormDTO; +import com.epmet.common.token.dto.form.LoginByWxCodeFormDTO; +import com.epmet.common.token.dto.result.UserTokenResultDTO; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.service.LoginService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * @Description 通用登陆接口 + * @Author yinzuomei + * @Date 2020/3/14 13:58 + */ +@RestController +@RequestMapping("login") +public class LoginController { + @Autowired + private LoginService loginService; + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 微信小程序登录 + * @Date 2020/3/14 14:35 + **/ + @PostMapping("loginbywxcode") + public Result loginByWxCode(@RequestBody LoginByWxCodeFormDTO formDTO) { + //效验数据 + ValidatorUtils.validateEntity(formDTO); + return loginService.loginByWxCode(formDTO); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 手机号+密码登录接口 + * @Date 2020/3/14 19:46 + **/ + @PostMapping("loginbypassword") + public Result loginByPassword(@RequestBody LoginByPassWordFormDTO formDTO) { + //效验数据 + ValidatorUtils.validateEntity(formDTO); + return loginService.loginByPassword(formDTO); + } +} diff --git a/epmet-auth/src/main/java/com/epmet/dao/CustomerUserDao.java b/epmet-auth/src/main/java/com/epmet/dao/CustomerUserDao.java new file mode 100644 index 0000000000..5e2b1956dc --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dao/CustomerUserDao.java @@ -0,0 +1,41 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.CustomerUserEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户用户信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-14 + */ +@Mapper +public interface CustomerUserDao extends BaseDao { + + /** + * @param openId + * @return userId + * @Author yinzuomei + * @Description 根据openId查询居民用户信息 + * @Date 2020/3/14 20:45 + **/ + String selectByWxOpenId(String openId); +} diff --git a/epmet-auth/src/main/java/com/epmet/entity/CustomerUserEntity.java b/epmet-auth/src/main/java/com/epmet/entity/CustomerUserEntity.java new file mode 100644 index 0000000000..99affa17fb --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/entity/CustomerUserEntity.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 客户用户信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_user") +public class CustomerUserEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id CUSTOMER.id + */ + private String customerId; + + /** + * 微信openId + */ + private String wxOpenId; + + /** + * 手机号 + */ + private String mobile; + + /** + * 昵称 + */ + private String nickname; + + /** + * 性别:0.男 1.女 字典表(key:sex) + */ + private Integer sex; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * 国家 + */ + private String country; + + /** + * 省份 + */ + private String province; + + /** + * 城市 + */ + private String city; + + /** + * 语言 + */ + private String language; + +} diff --git a/epmet-auth/src/main/java/com/epmet/jwt/JwtTokenProperties.java b/epmet-auth/src/main/java/com/epmet/jwt/JwtTokenProperties.java new file mode 100644 index 0000000000..ddff4febcc --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/jwt/JwtTokenProperties.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.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.token") +public class JwtTokenProperties { + 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; + } +} diff --git a/epmet-auth/src/main/java/com/epmet/jwt/JwtTokenUtils.java b/epmet-auth/src/main/java/com/epmet/jwt/JwtTokenUtils.java new file mode 100644 index 0000000000..25e6308add --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/jwt/JwtTokenUtils.java @@ -0,0 +1,105 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.epmet.jwt; + +import io.jsonwebtoken.Claims; +import io.jsonwebtoken.Jwts; +import io.jsonwebtoken.SignatureAlgorithm; +import org.apache.commons.codec.binary.Base64; +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.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * Jwt工具类 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Component +public class JwtTokenUtils { + private static final Logger logger = LoggerFactory.getLogger(JwtTokenUtils.class); + + @Autowired + private JwtTokenProperties jwtProperties; + + /** + * 生成jwt token 弃用 + */ + @Deprecated + 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; + } + } + public String createToken(Map map) { + return Jwts.builder() + .setHeaderParam("typ", "JWT") + .setClaims(map) + .setIssuedAt(new Date()) + .setExpiration(DateTime.now().plusSeconds(jwtProperties.getExpire()).toDate()) + .signWith(SignatureAlgorithm.HS512, jwtProperties.getSecret()) + .compact(); + } + + /** + * token是否过期 + * + * @return true:过期 + */ + public boolean isTokenExpired(Date expiration) { + return expiration.before(new Date()); + } + + public static void main(String[] args) { + Map map=new HashMap<>(); + map.put("app","gov"); + map.put("client","wxmp"); + map.put("userId","100526ABC"); + String tokenStr=Jwts.builder() + .setHeaderParam("typ", "JWT") + .setClaims(map) + .setIssuedAt(new Date()) + .setExpiration(DateTime.now().plusSeconds(604800).toDate()) + .signWith(SignatureAlgorithm.HS512, "7016867071f0ebf1c46f123eaaf4b9d6[elink.epmet]") + .compact(); + System.out.println(tokenStr); + Claims claims= Jwts.parser() + .setSigningKey("7016867071f0ebf1c46f123eaaf4b9d6[elink.epmet]") + .parseClaimsJws(tokenStr) + .getBody(); + System.out.println("app="+ claims.get("app")); + System.out.println("client="+ claims.get("client")); + System.out.println("userId="+ claims.get("userId")); + } + +} diff --git a/epmet-auth/src/main/java/com/epmet/service/LoginService.java b/epmet-auth/src/main/java/com/epmet/service/LoginService.java new file mode 100644 index 0000000000..8ecb3bb35d --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/service/LoginService.java @@ -0,0 +1,31 @@ +package com.epmet.service; + +import com.epmet.common.token.dto.form.LoginByPassWordFormDTO; +import com.epmet.common.token.dto.form.LoginByWxCodeFormDTO; +import com.epmet.common.token.dto.result.UserTokenResultDTO; +import com.epmet.commons.tools.utils.Result; + +/** + * @Description + * @Author yinzuomei + * @Date 2020/3/14 20:21 + */ +public interface LoginService { + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 微信小程序登录 + * @Date 2020/3/14 19:34 + **/ + Result loginByWxCode(LoginByWxCodeFormDTO formDTO); + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 手机号+密码登录接口 + * @Date 2020/3/14 19:54 + **/ + Result loginByPassword(LoginByPassWordFormDTO formDTO); +} diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java new file mode 100644 index 0000000000..8d5b19864b --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java @@ -0,0 +1,193 @@ +package com.epmet.service.impl; + +import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; +import cn.binarywang.wx.miniapp.bean.WxMaUserInfo; +import com.epmet.common.token.constant.LoginConstant; +import com.epmet.common.token.dto.TokenDto; +import com.epmet.common.token.dto.form.LoginByPassWordFormDTO; +import com.epmet.common.token.dto.form.LoginByWxCodeFormDTO; +import com.epmet.common.token.dto.result.UserTokenResultDTO; +import com.epmet.common.token.util.CpUserDetailRedis; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.CustomerUserDao; +import com.epmet.entity.CustomerUserEntity; +import com.epmet.jwt.JwtTokenProperties; +import com.epmet.jwt.JwtTokenUtils; +import com.epmet.service.LoginService; +import com.epmet.utils.WxMaServiceUtils; +import lombok.extern.slf4j.Slf4j; +import me.chanjar.weixin.common.error.WxErrorException; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.Map; + +/** + * @Description + * @Author yinzuomei + * @Date 2020/3/14 20:31 + */ +@Slf4j +@Service +public class LoginServiceImpl implements LoginService { + private static final Logger logger = LoggerFactory.getLogger(AuthServiceImpl.class); + + @Autowired + private CustomerUserDao customerUserDao; + + @Autowired + private WxMaServiceUtils wxMaServiceUtils; + + @Autowired + private JwtTokenUtils jwtTokenUtils; + + @Autowired + private JwtTokenProperties jwtTokenProperties; + + @Autowired + private CpUserDetailRedis cpUserDetailRedis; + + /** + * 微信小程序登录 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @since 2020/3/14 19:34 + */ + @Override + public Result loginByWxCode(LoginByWxCodeFormDTO formDTO) { + //1、根据wxCode获取微信信息 + WxMaJscode2SessionResult wxMaJscode2SessionResult = this.getWxMaUser(formDTO); + logger.info("openId=[" + wxMaJscode2SessionResult.getOpenid() + "]unionId=[" + wxMaJscode2SessionResult.getUnionid() + "]"); + //2、根据openId查询数据库,没有则直接插入一条记录 + String userId = this.getUserId(formDTO, wxMaJscode2SessionResult); + if (StringUtils.isNotBlank(userId)) { + //3、封装token且存到redis + UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); + userTokenResultDTO.setToken(this.packagingUserToken(formDTO, userId, wxMaJscode2SessionResult)); + return new Result().ok(userTokenResultDTO); + } + return new Result().error("登录失败"); + } + + /** + * 解析微信code获取小程序用户信息 + * + * @param formDTO + * @return cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult + * @author yinzuomei + * @date 2020/3/14 20:16 + */ + private WxMaJscode2SessionResult getWxMaUser(LoginByWxCodeFormDTO formDTO) { + WxMaJscode2SessionResult wxMaJscode2SessionResult = null; + try { + if (LoginConstant.APP_GOV.equals(formDTO.getApp())) { + wxMaJscode2SessionResult = wxMaServiceUtils.govWxMaService().jsCode2SessionInfo(formDTO.getWxCode()); + } else if (LoginConstant.APP_OPER.equals(formDTO.getApp())) { + wxMaJscode2SessionResult = wxMaServiceUtils.operWxMaService().jsCode2SessionInfo(formDTO.getWxCode()); + } else if (LoginConstant.APP_RESI.equals(formDTO.getApp())) { + wxMaJscode2SessionResult = wxMaServiceUtils.resiWxMaService().jsCode2SessionInfo(formDTO.getWxCode()); + } + } catch (WxErrorException e) { + log.error("->[getMaOpenId]::error[{}]", "解析微信code失败"); + } + if (null == wxMaJscode2SessionResult) { + throw new RenException("解析微信用户信息失败"); + } else if (StringUtils.isBlank(wxMaJscode2SessionResult.getOpenid())) { + throw new RenException("获取微信openid失败"); + } + return wxMaJscode2SessionResult; + } + + /** + * 根据openId查询用户id + * + * @param formDTO + * @param wxMaJscode2SessionResult + * @return java.lang.String + * @author yinzuomei + * @since 2020/3/14 19:34 + */ + private String getUserId(LoginByWxCodeFormDTO formDTO, WxMaJscode2SessionResult wxMaJscode2SessionResult) { + String userId = ""; + if (LoginConstant.APP_GOV.equals(formDTO.getApp())) { + //查询customer_staff待完善 + } else if (LoginConstant.APP_OPER.equals(formDTO.getApp())) { + //查询oper_staff待完善 + } else if (LoginConstant.APP_RESI.equals(formDTO.getApp())) { + //查询customer_user + userId = customerUserDao.selectByWxOpenId(wxMaJscode2SessionResult.getOpenid()); + if (StringUtils.isBlank(userId)) { + WxMaUserInfo wxMaUserInfo = wxMaServiceUtils.resiWxMaService().getUserService() + .getUserInfo(wxMaJscode2SessionResult.getSessionKey(), + formDTO.getEncryptedData(), + formDTO.getIv()); + CustomerUserEntity customerUserEntity = new CustomerUserEntity(); + customerUserEntity.setCity(wxMaUserInfo.getCity()); + customerUserEntity.setWxOpenId(wxMaUserInfo.getOpenId()); + customerUserEntity.setNickname(wxMaUserInfo.getNickName()); + customerUserEntity.setCountry(wxMaUserInfo.getCountry()); + customerUserEntity.setHeadImgUrl(wxMaUserInfo.getAvatarUrl()); + customerUserEntity.setCountry(wxMaUserInfo.getCountry()); + customerUserEntity.setProvince(wxMaUserInfo.getProvince()); + customerUserEntity.setSex(Integer.valueOf(wxMaUserInfo.getGender())); + customerUserDao.insert(customerUserEntity); + userId = customerUserEntity.getId(); + } + } + return userId; + } + + /** + * 封装用户token值 + * + * @param formDTO + * @param userId + * @param wxMaJscode2SessionResult + * @return java.lang.String + * @author yinzuomei + * @since 2020/3/14 19:34 + */ + private String packagingUserToken(LoginByWxCodeFormDTO formDTO, + String userId, + WxMaJscode2SessionResult wxMaJscode2SessionResult) { + // 生成token + Map map = new HashMap<>(); + map.put("app", formDTO.getApp()); + map.put("client", formDTO.getClient()); + map.put("userId", userId); + String token = jwtTokenUtils.createToken(map); + int expire = jwtTokenProperties.getExpire(); + TokenDto tokenDto = new TokenDto(); + tokenDto.setApp(formDTO.getApp()); + tokenDto.setClient(formDTO.getClient()); + tokenDto.setUserId(userId); + tokenDto.setOpenId(wxMaJscode2SessionResult.getOpenid()); + tokenDto.setSessionKey(wxMaJscode2SessionResult.getSessionKey()); + tokenDto.setUnionId(wxMaJscode2SessionResult.getUnionid()); + cpUserDetailRedis.set(tokenDto, expire); + return token; + } + + /** + * 手机号+密码登录接口 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @since 2020/3/14 19:34 + */ + @Override + public Result loginByPassword(LoginByPassWordFormDTO formDTO) { + //1、账号是否存在 + //2、密码是否正确 + //3、生成token返回,且将TokenDto存到redis + return null; + } +} diff --git a/epmet-auth/src/main/resources/bootstrap.yml b/epmet-auth/src/main/resources/bootstrap.yml index c8cf9d6c75..525987775e 100644 --- a/epmet-auth/src/main/resources/bootstrap.yml +++ b/epmet-auth/src/main/resources/bootstrap.yml @@ -23,6 +23,34 @@ spring: port: @spring.redis.port@ password: @spring.redis.password@ timeout: 30s + datasource: + druid: + #MySQL + driver-class-name: com.mysql.cj.jdbc.Driver + url: @spring.datasource.druid.url@ + username: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + initial-size: 10 + max-active: 100 + min-idle: 10 + max-wait: 60000 + pool-prepared-statements: true + max-pool-prepared-statement-per-connection-size: 20 + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + #Oracle需要打开注释 + #validation-query: SELECT 1 FROM DUAL + test-while-idle: true + test-on-borrow: false + test-on-return: false + filter: + stat: + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: false + wall: + config: + multi-statement-allow: true cloud: nacos: discovery: @@ -87,8 +115,39 @@ ribbon: ReadTimeout: 300000 ConnectTimeout: 300000 jwt: - #秘钥 - # secret: 7016867071f0ebf1c46f123eaaf4b9d6[elink.epmet] - secret: f4e2e52034348f86b67cde5[www.renren.io] - #token有效时长,默认7天,单位秒 - expire: 604800 + token: + #秘钥 + secret: 7016867071f0ebf1c46f123eaaf4b9d6[elink.epmet] + #token有效时长,默认7天,单位秒 + expire: 604800 +wx: + mp: + configs: + - appId: @wx.mp.configs.appId@ + secret: @wx.mp.configs.secret@ + token: @wx.mp.configs.token@ + aesKey: @wx.mp.configs.aesKey@ + ma: + configs: + - appid: @resi.wx.ma.appId@ + secret: @resi.wx.ma.secret@ + token: #微信小程序消息服务器配置的token + aesKey: #微信小程序消息服务器配置的EncodingAESKey + msgDataFormat: JSON +# - appid: @gov.wx.ma.appId@ +# secret: @gov.wx.ma.secret@ +# token: #微信小程序消息服务器配置的token +# aesKey: #微信小程序消息服务器配置的EncodingAESKey +# msgDataFormat: JSON +# - appid: @oper.wx.ma.appId@ +# secret: @oper.wx.ma.secret@ +# token: #微信小程序消息服务器配置的token +# aesKey: #微信小程序消息服务器配置的EncodingAESKey +# msgDataFormat: JSON + appId: + # 党群e事通-居民端小程序配置appId + resi: @resi.wx.ma.appId@ + # 党群e事通-政府端小程序配置的appId + #gov: @gov.wx.ma.appId@ + # 党群e事通-运营端小程序配置的appId + #oper: @oper.wx.ma.appId@ diff --git a/epmet-auth/src/main/resources/mapper/CustomerUserDao.xml b/epmet-auth/src/main/resources/mapper/CustomerUserDao.xml new file mode 100644 index 0000000000..43f12f9172 --- /dev/null +++ b/epmet-auth/src/main/resources/mapper/CustomerUserDao.xml @@ -0,0 +1,15 @@ + + + + + + + diff --git a/epmet-commons/epmet-common-clienttoken/pom.xml b/epmet-commons/epmet-common-clienttoken/pom.xml new file mode 100644 index 0000000000..66221b888c --- /dev/null +++ b/epmet-commons/epmet-common-clienttoken/pom.xml @@ -0,0 +1,125 @@ + + + + epmet-commons + com.epmet + 2.0.0 + + 4.0.0 + + epmet-common-clienttoken + jar + + epmet-common-clienttoken + http://www.example.com + 客户端token + + + + com.epmet + epmet-commons-tools + ${project.version} + + + + org.springframework.boot + spring-boot-starter-web + provided + + + + org.springframework.boot + spring-boot-starter-aop + provided + + + + org.springframework.boot + spring-boot-configuration-processor + true + + + com.vaadin.external.google + android-json + + + + + + org.springframework.boot + spring-boot-autoconfigure + compile + + + + org.springframework.boot + spring-boot-autoconfigure-processor + compile + true + + + + org.springframework.boot + spring-boot-starter-log4j2 + provided + + + + io.jsonwebtoken + jjwt + 0.7.0 + + + + + ${project.artifactId} + + + + maven-clean-plugin + + + + maven-resources-plugin + + + maven-compiler-plugin + + true + ${maven.compiler.source} + ${maven.compiler.target} + ${project.build.sourceEncoding} + + + + maven-surefire-plugin + + + maven-war-plugin + + + maven-install-plugin + + + maven-deploy-plugin + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + true + + + + + + + ${project.basedir}/src/main/java + + diff --git a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/annotation/Login.java b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/annotation/Login.java new file mode 100644 index 0000000000..e5a19a10c5 --- /dev/null +++ b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/annotation/Login.java @@ -0,0 +1,31 @@ +/** + * Copyright 2018 人人开源 http://www.renren.io + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.epmet.common.token.annotation; + +import java.lang.annotation.*; + +/** + * 登录效验 + * @author chenshun + * @email sunlightcs@gmail.com + * @date 2017/9/23 14:30 + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Login { +} diff --git a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/annotation/LoginUser.java b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/annotation/LoginUser.java new file mode 100644 index 0000000000..068ea84c2d --- /dev/null +++ b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/annotation/LoginUser.java @@ -0,0 +1,35 @@ +/** + * Copyright 2018 人人开源 http://www.renren.io + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.epmet.common.token.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 登录用户信息 + * + * @author chenshun + * @email sunlightcs@gmail.com + * @date 2017-03-23 20:39 + */ +@Target(ElementType.PARAMETER) +@Retention(RetentionPolicy.RUNTIME) +public @interface LoginUser { + +} diff --git a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/annotation/NeedClientToken.java b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/annotation/NeedClientToken.java new file mode 100644 index 0000000000..4c2cd0b553 --- /dev/null +++ b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/annotation/NeedClientToken.java @@ -0,0 +1,13 @@ +package com.epmet.common.token.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.CLASS)//生命注释保留时长,这里无需反射使用,使用CLASS级别 +@Target(ElementType.METHOD)//生命可以使用此注解的元素级别类型(如类、方法变量等) +public @interface NeedClientToken { + + boolean value() default true; +} diff --git a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/constant/LoginConstant.java b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/constant/LoginConstant.java new file mode 100644 index 0000000000..b546108bc8 --- /dev/null +++ b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/constant/LoginConstant.java @@ -0,0 +1,33 @@ +package com.epmet.common.token.constant; + +/** + * @Description app、client + * @Author yinzuomei + * @Date 2020/3/14 20:12 + */ +public interface LoginConstant { + /** + * 政府端 + */ + String APP_GOV = "gov"; + + /** + * 居民端 + */ + String APP_RESI = "resi"; + + /** + * 运营端 + */ + String APP_OPER = "oper"; + + /** + * web + */ + String CLIENT_WEB = "web"; + + /** + * 微信小程序 + */ + String CLIENT_WXMP = "wxmp"; +} diff --git a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/TokenDto.java b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/TokenDto.java new file mode 100644 index 0000000000..885c4831ed --- /dev/null +++ b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/TokenDto.java @@ -0,0 +1,49 @@ +package com.epmet.common.token.dto; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 用户token + * + * @author yinzuomei + * @Date 2020-03-14 + */ +@Data +public class TokenDto implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 政府端:gov、居民端:resi、运营端:oper + */ + private String app; + + /** + * PC端:web、微信小程序:wxmp + */ + private String client; + + /** + * 用户ID + */ + private String userId; + + /** + * sessionKey + */ + private String sessionKey; + + /** + * openId + */ + private String openId; + + /** + * unionId + */ + private String unionId; +} diff --git a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/form/LoginByPassWordFormDTO.java b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/form/LoginByPassWordFormDTO.java new file mode 100644 index 0000000000..8dfd2750c6 --- /dev/null +++ b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/form/LoginByPassWordFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.common.token.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 手机号+密码登录接口入参 + * @Author yinzuomei + * @Date 2020/3/14 19:46 + */ +@Data +public class LoginByPassWordFormDTO extends LoginCommonFormDTO implements Serializable { + private static final long serialVersionUID = -7507437651048051183L; + + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空") + private String phone; + + /** + * 密码 + */ + @NotBlank(message = "密码不能为空") + private String password; + +} diff --git a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/form/LoginByWxCodeFormDTO.java b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/form/LoginByWxCodeFormDTO.java new file mode 100644 index 0000000000..149514a0a3 --- /dev/null +++ b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/form/LoginByWxCodeFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.common.token.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 微信小程序登录接口入参 + * @Author yinzuomei + * @Date 2020/3/14 14:39 + */ +@Data +public class LoginByWxCodeFormDTO extends LoginCommonFormDTO implements Serializable { + private static final long serialVersionUID = 7950477424010655108L; + + /** + * 微信code + */ + @NotBlank(message = "wxCode不能为空") + private String wxCode; + + /** + * 用户信息 + */ + @NotBlank(message = "用户信息不能为空") + private String encryptedData; + + /** + * 加密算法的初始向量 + */ + @NotBlank(message = "初始向量不能为空") + private String iv; +} diff --git a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/form/LoginCommonFormDTO.java b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/form/LoginCommonFormDTO.java new file mode 100644 index 0000000000..9b2390388e --- /dev/null +++ b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/form/LoginCommonFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.common.token.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 登录接口通用入参 + * @Author yinzuomei + * @Date 2020/3/14 19:47 + */ +@Data +public class LoginCommonFormDTO implements Serializable { + private static final long serialVersionUID = -5582224784914714820L; + + /** + * 政府端:gov、居民端:resi、运营端:oper + */ + @NotBlank(message = "app不能为空(政府端:gov、居民端:resi、运营端:oper)") + private String app; + + /** + * PC端:web、微信小程序:wxmp + */ + @NotBlank(message = "client不能为空(PC端:web、微信小程序:wxmp)") + private String client; +} diff --git a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/result/UserTokenResultDTO.java b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/result/UserTokenResultDTO.java new file mode 100644 index 0000000000..e5296bf42b --- /dev/null +++ b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/result/UserTokenResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.common.token.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 登录接口返参DTO + * @Author yinzuomei + * @Date 2020/3/14 15:10 + */ +@Data +public class UserTokenResultDTO implements Serializable { + private static final long serialVersionUID = 5214475907074876716L; + + /** + * 令牌 + */ + private String token; +} diff --git a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/enums/ErrorCode.java b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/enums/ErrorCode.java new file mode 100644 index 0000000000..f312ed9b8c --- /dev/null +++ b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/enums/ErrorCode.java @@ -0,0 +1,47 @@ +package com.epmet.common.token.enums; + + +import com.epmet.common.token.error.IErrorCode; + +/** + * client token错误码 + * + * @author rongchao + * @Date 18-11-24 + */ +public enum ErrorCode implements IErrorCode { + + SUCCESS(0, "请求成功"), + + ERR10001(10001, "clientToken不合法或者已过期"), + ERR10002(10002, "无法获取当前用户的信息,无法生成clientToken。"), + ERR10003(10003, "clientToken生成失败,请重试。"), + ERR10004(10004, "返回的Object类型不是EsuaResponse,无法添加token!"), + ERR10005(10005, "clentToken不能为空"), + + ERR500(500, "Internal Server Error"), + ERR501(501, "参数绑定异常"), + + ERR(ErrorCode.COMMON_ERR_CODE, "其他异常"); + + private int code; + + private String msg; + + ErrorCode(final int code, final String msg) { + this.code = code; + this.msg = msg; + } + + public static final int COMMON_ERR_CODE = -1; + + @Override + public int getCode() { + return code; + } + + @Override + public String getMsg() { + return msg; + } +} diff --git a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/error/IErrorCode.java b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/error/IErrorCode.java new file mode 100644 index 0000000000..9b58ccc96e --- /dev/null +++ b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/error/IErrorCode.java @@ -0,0 +1,11 @@ +package com.epmet.common.token.error; + +/** + * @author rongchao + * @Date 18-11-20 + */ +public interface IErrorCode { + int getCode(); + + String getMsg(); +} diff --git a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/property/TokenPropertise.java b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/property/TokenPropertise.java new file mode 100644 index 0000000000..1552871f39 --- /dev/null +++ b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/property/TokenPropertise.java @@ -0,0 +1,23 @@ +package com.epmet.common.token.property; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * @author rongchao + * @Date 18-12-3 + */ +@Component +@ConfigurationProperties(prefix = "token") +public class TokenPropertise { + + private long expire = 7200L; + + public long getExpire() { + return expire; + } + + public void setExpire(long expire) { + this.expire = expire; + } +} diff --git a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/util/CpUserDetailRedis.java b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/util/CpUserDetailRedis.java new file mode 100644 index 0000000000..4d10b38f66 --- /dev/null +++ b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/util/CpUserDetailRedis.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.epmet.common.token.util; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.map.MapUtil; +import com.epmet.common.token.dto.TokenDto; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * CP用户Redis + * + * @author rongchao + * @since 1.0.0 + */ +@Component +public class CpUserDetailRedis { + + @Autowired + private RedisUtils redisUtils; + + public void set(TokenDto user, long expire) { + if (user == null) { + return; + } + String key = RedisKeys.getCpUserKey(user.getApp(), user.getClient(), user.getUserId()); + //bean to map + Map map = BeanUtil.beanToMap(user, false, true); + redisUtils.hMSet(key, map, expire); + } + + /** + * 获取token信息 + * + * @param userId + * @return + */ + public TokenDto get(String app, String client, String userId) { + String key = RedisKeys.getCpUserKey(app, client, userId); + + Map map = redisUtils.hGetAll(key); + if (MapUtil.isEmpty(map)) { + return null; + } + + //map to bean + TokenDto user = BeanUtil.mapToBean(map, TokenDto.class, true); + + return user; + } + + /** + * 删除用户信息 + * + * @param userId + */ + public void logout(String app, String client, String userId) { + redisUtils.delete(RedisKeys.getCpUserKey(app, client, userId)); + } + + /** + * 设置redis时间 + * + * @param userId + * @param expire + * @author rongchao + */ + public boolean expire(String app, String client, String userId, long expire) { + return redisUtils.expire(RedisKeys.getCpUserKey(app, client, userId), expire); + } + + /** + * 查询token剩余时间 + * + * @param userId + * @return long + * @author yujintao + * @date 2019/9/9 14:18 + */ + public long getExpire(String app, String client, String userId) { + return redisUtils.getExpire(RedisKeys.getCpUserKey(app, client, userId)); + } +} diff --git a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/util/TokenUtil.java b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/util/TokenUtil.java new file mode 100644 index 0000000000..173e985523 --- /dev/null +++ b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/util/TokenUtil.java @@ -0,0 +1,51 @@ +package com.epmet.common.token.util; + +import com.epmet.common.token.dto.TokenDto; +import com.epmet.common.token.property.TokenPropertise; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * token服务类 + * + * @author rongchao + * @Date 18-10-31 + */ +@Component +public class TokenUtil { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private TokenPropertise tokenPropertise; + + @Autowired + private CpUserDetailRedis redisUtils; + + public TokenDto getTokenInfo(String app,String client,String userId) { + TokenDto tokenDto = redisUtils.get(app,client,userId); + return tokenDto; + } + + public void expireToken(String app,String client,String userId) { + redisUtils.logout(app,client,userId); + } + + public boolean delayToken(String app,String client,String userId) { + return redisUtils.expire(app,client,userId, tokenPropertise.getExpire()); + } + + /** + * 获取token过期时间 + * + * @param userId + * @return long + * @author yujintao + * @date 2019/9/9 14:19 + */ + public long getExpire(String app,String client,String userId) { + return redisUtils.getExpire(app,client,userId); + } +} diff --git a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/util/UserUtil.java b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/util/UserUtil.java new file mode 100644 index 0000000000..1868a76674 --- /dev/null +++ b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/util/UserUtil.java @@ -0,0 +1,55 @@ +package com.epmet.common.token.util; + +import com.epmet.common.token.dto.TokenDto; +import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.utils.WebUtil; + +/** + * 用户工具类 + * + * @author rongchao + * @Date 18-11-20 + */ +public class UserUtil { + + /** + * 获取当前用户信息 + * + * @return + */ + public static TokenDto getCurrentUser() { + return (TokenDto) WebUtil.getAttributesFromRequest(Constant.APP_USER_KEY); + } + + /** + * 获取当前用户信息 + * + * @return com.elink.esua.common.token.dto.UserTokenDto + * @author yujintao + * @date 2018/12/5 9:24 + */ + public static TokenDto getCurrentUserInfo() { + TokenDto tokenDto = getCurrentUser(); + if (tokenDto == null) { + return null; + } + return tokenDto; + } + + /** + * 获取当前用户ID + * + * @return + */ + public static String getCurrentUserId() { + TokenDto tokenDto = getCurrentUser(); + if (tokenDto == null) { + return null; + } + return tokenDto.getUserId(); + } + + public static void setCurrentUser(TokenDto user) { + WebUtil.setAttributesFromRequest(Constant.APP_USER_KEY, user); + } +} diff --git a/epmet-commons/epmet-commons-tools-phone/pom.xml b/epmet-commons/epmet-commons-tools-phone/pom.xml new file mode 100644 index 0000000000..7e8d052ee8 --- /dev/null +++ b/epmet-commons/epmet-commons-tools-phone/pom.xml @@ -0,0 +1,41 @@ + + + + epmet-commons + com.epmet + 2.0.0 + + 4.0.0 + + epmet-commons-tools-phone + jar + + + + com.googlecode.libphonenumber + libphonenumber + 8.8.8 + + + com.googlecode.libphonenumber + carrier + 1.75 + + + com.googlecode.libphonenumber + geocoder + 2.85 + + + com.googlecode.libphonenumber + prefixmapper + 2.85 + + + + + ${project.artifactId} + + diff --git a/epmet-commons/epmet-commons-tools-phone/src/main/java/com/epmet/commons/tools/utils/PhoneDto.java b/epmet-commons/epmet-commons-tools-phone/src/main/java/com/epmet/commons/tools/utils/PhoneDto.java new file mode 100644 index 0000000000..8bc240a16e --- /dev/null +++ b/epmet-commons/epmet-commons-tools-phone/src/main/java/com/epmet/commons/tools/utils/PhoneDto.java @@ -0,0 +1,79 @@ +package com.epmet.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; + } +} diff --git a/epmet-commons/epmet-commons-tools-phone/src/main/java/com/epmet/commons/tools/utils/PhoneUtil.java b/epmet-commons/epmet-commons-tools-phone/src/main/java/com/epmet/commons/tools/utils/PhoneUtil.java new file mode 100644 index 0000000000..022525592c --- /dev/null +++ b/epmet-commons/epmet-commons-tools-phone/src/main/java/com/epmet/commons/tools/utils/PhoneUtil.java @@ -0,0 +1,178 @@ +package com.epmet.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; +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.PhoneNumber pn = new Phonenumber.PhoneNumber(); + pn.setCountryCode(COUNTRY_CODE); + pn.setNationalNumber(phone); + return geocoder.getDescriptionForNumber(pn, Locale.CHINESE); + } + + /** + * 根据手机号 获取手机信息模型 + * + *

+     * 若返回值为null,则说明该号码无效
+     * 
+ * + * @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("该号码无效"); + } + } + +} diff --git a/epmet-commons/epmet-commons-tools-wx-ma/pom.xml b/epmet-commons/epmet-commons-tools-wx-ma/pom.xml new file mode 100644 index 0000000000..7380ada9e3 --- /dev/null +++ b/epmet-commons/epmet-commons-tools-wx-ma/pom.xml @@ -0,0 +1,34 @@ + + + + epmet-commons + com.epmet + 2.0.0 + + 4.0.0 + + 1.0.0 + epmet-commons-tools-wx-ma + jar + + + + org.projectlombok + lombok + provided + + + org.springframework.boot + spring-boot-autoconfigure + compile + + + com.github.binarywang + weixin-java-miniapp + 3.6.0 + + + + diff --git a/epmet-commons/epmet-commons-tools-wx-ma/src/main/java/com/epmet/utils/WxMaServiceUtils.java b/epmet-commons/epmet-commons-tools-wx-ma/src/main/java/com/epmet/utils/WxMaServiceUtils.java new file mode 100644 index 0000000000..8d7aaa463d --- /dev/null +++ b/epmet-commons/epmet-commons-tools-wx-ma/src/main/java/com/epmet/utils/WxMaServiceUtils.java @@ -0,0 +1,65 @@ +package com.epmet.utils; + +import cn.binarywang.wx.miniapp.api.WxMaService; +import com.epmet.wx.ma.WxMaConfig; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +/** + * 获取小程序业务工具 + * + * @author work@yujt.net.cn + * @date 2019/11/25 13:29 + */ +@Component +public class WxMaServiceUtils { + + @Value("${wx.ma.appId.resi}") + private String APPID_RESI; + + /*@Value("${wx.ma.appId.gov}") + private String APPID_GOV; + + @Value("${wx.ma.appId.oper}") + private String APPID_OPER;*/ + + /** + * 获取党群e事通-居民端小程序配置 + * + * @return cn.binarywang.wx.miniapp.api.WxMaService + * @author yinzuomei + * @date 2020/03/13 10:44 + */ + public final WxMaService resiWxMaService() { + final WxMaService wxMaService = WxMaConfig.getMaService(APPID_RESI); + return wxMaService; + } + + /** + * 获取党群e事通-政府端小程序配置 + * + * @return cn.binarywang.wx.miniapp.api.WxMaService + * @author yinzuomei + * @date 2020/03/13 10:44 + */ + public final WxMaService govWxMaService() { +// final WxMaService wxMaService = WxMaConfig.getMaService(APPID_GOV); + final WxMaService wxMaService = WxMaConfig.getMaService(APPID_RESI); + return wxMaService; + } + + /** + * + * 获取党群e事通-运营端小程序配置 + * + * @params [] + * @return cn.binarywang.wx.miniapp.api.WxMaService + * @author yinzuomei + * @since 2020/03/13 10:44 + */ + public final WxMaService operWxMaService() { +// final WxMaService wxMaService = WxMaConfig.getMaService(APPID_OPER); + final WxMaService wxMaService = WxMaConfig.getMaService(APPID_RESI); + return wxMaService; + } +} diff --git a/epmet-commons/epmet-commons-tools-wx-ma/src/main/java/com/epmet/wx/ma/WxMaConfig.java b/epmet-commons/epmet-commons-tools-wx-ma/src/main/java/com/epmet/wx/ma/WxMaConfig.java new file mode 100644 index 0000000000..073b701bd2 --- /dev/null +++ b/epmet-commons/epmet-commons-tools-wx-ma/src/main/java/com/epmet/wx/ma/WxMaConfig.java @@ -0,0 +1,148 @@ +package com.epmet.wx.ma; + +import cn.binarywang.wx.miniapp.api.WxMaService; +import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl; +import cn.binarywang.wx.miniapp.bean.WxMaKefuMessage; +import cn.binarywang.wx.miniapp.bean.WxMaTemplateData; +import cn.binarywang.wx.miniapp.bean.WxMaTemplateMessage; +import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl; +import cn.binarywang.wx.miniapp.message.WxMaMessageHandler; +import cn.binarywang.wx.miniapp.message.WxMaMessageRouter; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import me.chanjar.weixin.common.bean.result.WxMediaUploadResult; +import me.chanjar.weixin.common.error.WxErrorException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +import javax.annotation.PostConstruct; +import java.io.File; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author Binary Wang + */ +@Configuration +@EnableConfigurationProperties(WxMaProperties.class) +public class WxMaConfig { + + private WxMaProperties properties; + + private static Map routers = Maps.newHashMap(); + private static Map maServices = Maps.newHashMap(); + + @Autowired + public WxMaConfig(WxMaProperties properties) { + this.properties = properties; + } + + public static WxMaService getMaService(String appid) { + WxMaService wxService = maServices.get(appid); + if (wxService == null) { + throw new IllegalArgumentException(String.format("未找到对应appid=[%s]的配置,请核实!", appid)); + } + + return wxService; + } + + public static WxMaMessageRouter getRouter(String appid) { + return routers.get(appid); + } + + @PostConstruct + public void init() { + List configs = this.properties.getConfigs(); + if (configs == null) { + throw new RuntimeException("大哥,拜托先看下项目首页的说明(readme文件),添加下相关配置,注意别配错了!"); + } + + maServices = configs.stream() + .map(a -> { + WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl(); + config.setAppid(a.getAppid()); + config.setSecret(a.getSecret()); + config.setToken(a.getToken()); + config.setAesKey(a.getAesKey()); + config.setMsgDataFormat(a.getMsgDataFormat()); + + WxMaService service = new WxMaServiceImpl(); + service.setWxMaConfig(config); + routers.put(a.getAppid(), this.newRouter(service)); + return service; + }).collect(Collectors.toMap(s -> s.getWxMaConfig().getAppid(), a -> a)); + } + + private WxMaMessageRouter newRouter(WxMaService service) { + final WxMaMessageRouter router = new WxMaMessageRouter(service); + router + .rule().handler(logHandler).next() + .rule().async(false).content("模板").handler(templateMsgHandler).end() + .rule().async(false).content("文本").handler(textHandler).end() + .rule().async(false).content("图片").handler(picHandler).end() + .rule().async(false).content("二维码").handler(qrcodeHandler).end(); + return router; + } + + private final WxMaMessageHandler templateMsgHandler = (wxMessage, context, service, sessionManager) -> { + service.getMsgService().sendTemplateMsg(WxMaTemplateMessage.builder() + .templateId("此处更换为自己的模板id") + .formId("自己替换可用的formid") + .data(Lists.newArrayList( + new WxMaTemplateData("keyword1", "339208499", "#173177"))) + .toUser(wxMessage.getFromUser()) + .build()); + return null; + }; + + private final WxMaMessageHandler logHandler = (wxMessage, context, service, sessionManager) -> { + System.out.println("收到消息:" + wxMessage.toString()); + service.getMsgService().sendKefuMsg(WxMaKefuMessage.newTextBuilder().content("收到信息为:" + wxMessage.toJson()) + .toUser(wxMessage.getFromUser()).build()); + return null; + }; + + private final WxMaMessageHandler textHandler = (wxMessage, context, service, sessionManager) -> { + service.getMsgService().sendKefuMsg(WxMaKefuMessage.newTextBuilder().content("回复文本消息") + .toUser(wxMessage.getFromUser()).build()); + return null; + }; + + private final WxMaMessageHandler picHandler = (wxMessage, context, service, sessionManager) -> { + try { + WxMediaUploadResult uploadResult = service.getMediaService() + .uploadMedia("image", "png", + ClassLoader.getSystemResourceAsStream("tmp.png")); + service.getMsgService().sendKefuMsg( + WxMaKefuMessage + .newImageBuilder() + .mediaId(uploadResult.getMediaId()) + .toUser(wxMessage.getFromUser()) + .build()); + } catch (WxErrorException e) { + e.printStackTrace(); + } + + return null; + }; + + private final WxMaMessageHandler qrcodeHandler = (wxMessage, context, service, sessionManager) -> { + try { + final File file = service.getQrcodeService().createQrcode("123", 430); + WxMediaUploadResult uploadResult = service.getMediaService().uploadMedia("image", file); + service.getMsgService().sendKefuMsg( + WxMaKefuMessage + .newImageBuilder() + .mediaId(uploadResult.getMediaId()) + .toUser(wxMessage.getFromUser()) + .build()); + } catch (WxErrorException e) { + e.printStackTrace(); + } + + return null; + }; + +} diff --git a/epmet-commons/epmet-commons-tools-wx-ma/src/main/java/com/epmet/wx/ma/WxMaProperties.java b/epmet-commons/epmet-commons-tools-wx-ma/src/main/java/com/epmet/wx/ma/WxMaProperties.java new file mode 100644 index 0000000000..3d5dc33b4c --- /dev/null +++ b/epmet-commons/epmet-commons-tools-wx-ma/src/main/java/com/epmet/wx/ma/WxMaProperties.java @@ -0,0 +1,48 @@ +package com.epmet.wx.ma; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +import java.util.List; + +/** + * 微信小程序框架配置类 + * + * @author rongchao + * @Date 19-5-13 + */ +@Data +@ConfigurationProperties(prefix = "wx.ma") +public class WxMaProperties { + + private List configs; + + @Data + public static class Config { + /** + * 设置微信小程序的appid + */ + private String appid; + + /** + * 设置微信小程序的Secret + */ + private String secret; + + /** + * 设置微信小程序消息服务器配置的token + */ + private String token; + + /** + * 设置微信小程序消息服务器配置的EncodingAESKey + */ + private String aesKey; + + /** + * 消息格式,XML或者JSON + */ + private String msgDataFormat; + } + +} diff --git a/epmet-commons/epmet-commons-tools-wx-mp/.editorconfig b/epmet-commons/epmet-commons-tools-wx-mp/.editorconfig new file mode 100644 index 0000000000..775be5ba05 --- /dev/null +++ b/epmet-commons/epmet-commons-tools-wx-mp/.editorconfig @@ -0,0 +1,14 @@ +# EditorConfig: http://editorconfig.org/ + +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/epmet-commons/epmet-commons-tools-wx-mp/.travis.yml b/epmet-commons/epmet-commons-tools-wx-mp/.travis.yml new file mode 100644 index 0000000000..5d2a7698b9 --- /dev/null +++ b/epmet-commons/epmet-commons-tools-wx-mp/.travis.yml @@ -0,0 +1,13 @@ +language: java +jdk: + - openjdk8 + +script: "mvn clean package -Dmaven.test.skip=true" + +branches: + only: + - master + +notifications: + email: + - binarywang@vip.qq.com diff --git a/epmet-commons/epmet-commons-tools-wx-mp/README.md b/epmet-commons/epmet-commons-tools-wx-mp/README.md new file mode 100644 index 0000000000..790d56ba1b --- /dev/null +++ b/epmet-commons/epmet-commons-tools-wx-mp/README.md @@ -0,0 +1,58 @@ +[![码云Gitee](https://gitee.com/binary/weixin-java-mp-demo-springboot/badge/star.svg?theme=blue)](https://gitee.com/binary/weixin-java-mp-demo-springboot) +[![Github](http://github-svg-buttons.herokuapp.com/star.svg?user=binarywang&repo=weixin-java-mp-demo-springboot&style=flat&background=1081C1)](https://github.com/binarywang/weixin-java-mp-demo-springboot) +[![Build Status](https://travis-ci.org/binarywang/weixin-java-mp-demo-springboot.svg?branch=master)](https://travis-ci.org/binarywang/weixin-java-mp-demo-springboot) +----------------------- + +### 本Demo基于Spring Boot构建,实现微信公众号后端开发功能。 +### 本项目为WxJava的Demo演示程序,更多Demo请[查阅此处](https://github.com/Wechat-Group/WxJava/blob/master/demo.md)。 +#### 如有问题请[【在此提问】](https://github.com/binarywang/weixin-java-mp-demo-springboot/issues),谢谢配合。 + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +## 使用步骤: +1. 请注意,本demo为简化代码编译时加入了lombok支持,如果不了解lombok的话,请先学习下相关知识,比如可以阅读[此文章](https://mp.weixin.qq.com/s/cUc-bUcprycADfNepnSwZQ); +1. 另外,新手遇到问题,请务必先阅读[【开发文档首页】](https://github.com/Wechat-Group/WxJava/wiki)的常见问题部分,可以少走很多弯路,节省不少时间。 +1. 配置:复制 `/src/main/resources/application.yml.template` 或修改其扩展名生成 `application.yml` 文件,根据自己需要填写相关配置(需要注意的是:yml文件内的属性冒号后面的文字之前需要加空格,可参考已有配置,否则属性会设置不成功); +2. 主要配置说明如下: +``` +wx: + mp: + configs: + - appId: 1111 (一个公众号的appid) + secret: 1111(公众号的appsecret) + token: 111 (接口配置里的Token值) + aesKey: 111 (接口配置里的EncodingAESKey值) + - appId: 2222 (另一个公众号的appid,以下同上) + secret: 1111 + token: 111 + aesKey: 111 +``` +3. 运行Java程序:`WxMpDemoApplication`; +4. 配置微信公众号中的接口地址:http://公网可访问域名/wx/portal/xxxxx (注意,xxxxx为对应公众号的appid值); +5. 根据自己需要修改各个handler的实现,加入自己的业务逻辑。 + diff --git a/epmet-commons/epmet-commons-tools-wx-mp/pom.xml b/epmet-commons/epmet-commons-tools-wx-mp/pom.xml new file mode 100644 index 0000000000..5f69e61f1e --- /dev/null +++ b/epmet-commons/epmet-commons-tools-wx-mp/pom.xml @@ -0,0 +1,60 @@ + + + 4.0.0 + + + com.epmet + epmet-commons + 2.0.0 + + + 1.0.0 + epmet-commons-tools-wx-mp + jar + + + + + + 3.6.0 + 1.8 + 1.8 + UTF-8 + UTF-8 + zh_CN + wechat-mp-demo + + + + + com.github.binarywang + weixin-java-mp + ${weixin-java-mp.version} + + + + org.projectlombok + lombok + provided + + + + org.springframework.boot + spring-boot-autoconfigure + compile + + + org.springframework.boot + spring-boot-configuration-processor + compile + true + + + org.springframework.boot + spring-boot-autoconfigure-processor + compile + true + + + diff --git a/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/builder/AbstractBuilder.java b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/builder/AbstractBuilder.java new file mode 100644 index 0000000000..8dad467ffd --- /dev/null +++ b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/builder/AbstractBuilder.java @@ -0,0 +1,17 @@ +package com.epmet.wx.mp.builder; + +import me.chanjar.weixin.mp.api.WxMpService; +import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; +import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author Binary Wang(https://github.com/binarywang) + */ +public abstract class AbstractBuilder { + protected final Logger logger = LoggerFactory.getLogger(getClass()); + + public abstract WxMpXmlOutMessage build(String content, + WxMpXmlMessage wxMessage, WxMpService service); +} diff --git a/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/builder/ImageBuilder.java b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/builder/ImageBuilder.java new file mode 100644 index 0000000000..8afe9679d9 --- /dev/null +++ b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/builder/ImageBuilder.java @@ -0,0 +1,24 @@ +package com.epmet.wx.mp.builder; + +import me.chanjar.weixin.mp.api.WxMpService; +import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; +import me.chanjar.weixin.mp.bean.message.WxMpXmlOutImageMessage; +import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; + +/** + * @author Binary Wang(https://github.com/binarywang) + */ +public class ImageBuilder extends AbstractBuilder { + + @Override + public WxMpXmlOutMessage build(String content, WxMpXmlMessage wxMessage, + WxMpService service) { + + WxMpXmlOutImageMessage m = WxMpXmlOutMessage.IMAGE().mediaId(content) + .fromUser(wxMessage.getToUser()).toUser(wxMessage.getFromUser()) + .build(); + + return m; + } + +} diff --git a/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/builder/TextBuilder.java b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/builder/TextBuilder.java new file mode 100644 index 0000000000..9486aef270 --- /dev/null +++ b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/builder/TextBuilder.java @@ -0,0 +1,22 @@ +package com.epmet.wx.mp.builder; + +import me.chanjar.weixin.mp.api.WxMpService; +import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; +import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; +import me.chanjar.weixin.mp.bean.message.WxMpXmlOutTextMessage; + +/** + * @author Binary Wang(https://github.com/binarywang) + */ +public class TextBuilder extends AbstractBuilder { + + @Override + public WxMpXmlOutMessage build(String content, WxMpXmlMessage wxMessage, + WxMpService service) { + WxMpXmlOutTextMessage m = WxMpXmlOutMessage.TEXT().content(content) + .fromUser(wxMessage.getToUser()).toUser(wxMessage.getFromUser()) + .build(); + return m; + } + +} diff --git a/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/config/WxMpConfiguration.java b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/config/WxMpConfiguration.java new file mode 100644 index 0000000000..f2df571c42 --- /dev/null +++ b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/config/WxMpConfiguration.java @@ -0,0 +1,113 @@ +package com.epmet.wx.mp.config; + +import com.epmet.wx.mp.handler.*; +import lombok.AllArgsConstructor; +import me.chanjar.weixin.mp.api.WxMpMessageRouter; +import me.chanjar.weixin.mp.api.WxMpService; +import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl; +import me.chanjar.weixin.mp.config.impl.WxMpDefaultConfigImpl; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.util.List; +import java.util.stream.Collectors; + +import static me.chanjar.weixin.common.api.WxConsts.EventType; +import static me.chanjar.weixin.common.api.WxConsts.EventType.SUBSCRIBE; +import static me.chanjar.weixin.common.api.WxConsts.EventType.UNSUBSCRIBE; +import static me.chanjar.weixin.common.api.WxConsts.MenuButtonType.CLICK; +import static me.chanjar.weixin.common.api.WxConsts.MenuButtonType.VIEW; +import static me.chanjar.weixin.common.api.WxConsts.XmlMsgType; +import static me.chanjar.weixin.common.api.WxConsts.XmlMsgType.EVENT; +import static me.chanjar.weixin.mp.constant.WxMpEventConstants.CustomerService.*; +import static me.chanjar.weixin.mp.constant.WxMpEventConstants.POI_CHECK_NOTIFY; + +/** + * wechat mp configuration + * + * @author Binary Wang(https://github.com/binarywang) + */ +@AllArgsConstructor +@Configuration +@EnableConfigurationProperties(WxMpProperties.class) +public class WxMpConfiguration { + private final LogHandler logHandler; + private final NullHandler nullHandler; + private final KfSessionHandler kfSessionHandler; + private final StoreCheckNotifyHandler storeCheckNotifyHandler; + private final LocationHandler locationHandler; + private final MenuHandler menuHandler; + private final MsgHandler msgHandler; + private final UnsubscribeHandler unsubscribeHandler; + private final SubscribeHandler subscribeHandler; + private final ScanHandler scanHandler; + private final WxMpProperties properties; + + @Bean + public WxMpService wxMpService() { + // 代码里 getConfigs()处报错的同学,请注意仔细阅读项目说明,你的IDE需要引入lombok插件!!!! + final List configs = this.properties.getConfigs(); + if (configs == null) { + throw new RuntimeException("大哥,拜托先看下项目首页的说明(readme文件),添加下相关配置,注意别配错了!"); + } + + WxMpService service = new WxMpServiceImpl(); + service.setMultiConfigStorages(configs + .stream().map(a -> { + WxMpDefaultConfigImpl configStorage = new WxMpDefaultConfigImpl(); + configStorage.setAppId(a.getAppId()); + configStorage.setSecret(a.getSecret()); + configStorage.setToken(a.getToken()); + configStorage.setAesKey(a.getAesKey()); + return configStorage; + }).collect(Collectors.toMap(WxMpDefaultConfigImpl::getAppId, a -> a, (o, n) -> o))); + return service; + } + + @Bean + public WxMpMessageRouter messageRouter(WxMpService wxMpService) { + final WxMpMessageRouter newRouter = new WxMpMessageRouter(wxMpService); + + // 记录所有事件的日志 (异步执行) + newRouter.rule().handler(this.logHandler).next(); + + // 接收客服会话管理事件 + newRouter.rule().async(false).msgType(EVENT).event(KF_CREATE_SESSION) + .handler(this.kfSessionHandler).end(); + newRouter.rule().async(false).msgType(EVENT).event(KF_CLOSE_SESSION) + .handler(this.kfSessionHandler).end(); + newRouter.rule().async(false).msgType(EVENT).event(KF_SWITCH_SESSION) + .handler(this.kfSessionHandler).end(); + + // 门店审核事件 + newRouter.rule().async(false).msgType(EVENT).event(POI_CHECK_NOTIFY).handler(this.storeCheckNotifyHandler).end(); + + // 自定义菜单事件 + newRouter.rule().async(false).msgType(EVENT).event(CLICK).handler(this.menuHandler).end(); + + // 点击菜单连接事件 + newRouter.rule().async(false).msgType(EVENT).event(VIEW).handler(this.nullHandler).end(); + + // 关注事件 + newRouter.rule().async(false).msgType(EVENT).event(SUBSCRIBE).handler(this.subscribeHandler).end(); + + // 取消关注事件 + newRouter.rule().async(false).msgType(EVENT).event(UNSUBSCRIBE).handler(this.unsubscribeHandler).end(); + + // 上报地理位置事件 + newRouter.rule().async(false).msgType(EVENT).event(EventType.LOCATION).handler(this.locationHandler).end(); + + // 接收地理位置消息 + newRouter.rule().async(false).msgType(XmlMsgType.LOCATION).handler(this.locationHandler).end(); + + // 扫码事件 + newRouter.rule().async(false).msgType(EVENT).event(EventType.SCAN).handler(this.scanHandler).end(); + + // 默认 + newRouter.rule().async(false).handler(this.msgHandler).end(); + + return newRouter; + } + +} diff --git a/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/config/WxMpProperties.java b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/config/WxMpProperties.java new file mode 100644 index 0000000000..3e5c181948 --- /dev/null +++ b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/config/WxMpProperties.java @@ -0,0 +1,46 @@ +package com.epmet.wx.mp.config; + +import com.epmet.wx.mp.utils.JsonUtils; +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +import java.util.List; + +/** + * wechat mp properties + * + * @author Binary Wang(https://github.com/binarywang) + */ +@Data +@ConfigurationProperties(prefix = "wx.mp") +public class WxMpProperties { + private List configs; + + @Data + public static class MpConfig { + /** + * 设置微信公众号的appid + */ + private String appId; + + /** + * 设置微信公众号的app secret + */ + private String secret; + + /** + * 设置微信公众号的token + */ + private String token; + + /** + * 设置微信公众号的EncodingAESKey + */ + private String aesKey; + } + + @Override + public String toString() { + return JsonUtils.toJson(this); + } +} diff --git a/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/AbstractHandler.java b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/AbstractHandler.java new file mode 100644 index 0000000000..3831d6427a --- /dev/null +++ b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/AbstractHandler.java @@ -0,0 +1,12 @@ +package com.epmet.wx.mp.handler; + +import me.chanjar.weixin.mp.api.WxMpMessageHandler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author Binary Wang(https://github.com/binarywang) + */ +public abstract class AbstractHandler implements WxMpMessageHandler { + protected Logger logger = LoggerFactory.getLogger(getClass()); +} diff --git a/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/KfSessionHandler.java b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/KfSessionHandler.java new file mode 100644 index 0000000000..cfdcb95eec --- /dev/null +++ b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/KfSessionHandler.java @@ -0,0 +1,25 @@ +package com.epmet.wx.mp.handler; + +import me.chanjar.weixin.common.session.WxSessionManager; +import me.chanjar.weixin.mp.api.WxMpService; +import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; +import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * @author Binary Wang(https://github.com/binarywang) + */ +@Component +public class KfSessionHandler extends AbstractHandler { + + @Override + public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, + Map context, WxMpService wxMpService, + WxSessionManager sessionManager) { + //TODO 对会话做处理 + return null; + } + +} diff --git a/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/LocationHandler.java b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/LocationHandler.java new file mode 100644 index 0000000000..78f8296350 --- /dev/null +++ b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/LocationHandler.java @@ -0,0 +1,44 @@ +package com.epmet.wx.mp.handler; + +import com.epmet.wx.mp.builder.TextBuilder; +import me.chanjar.weixin.common.session.WxSessionManager; +import me.chanjar.weixin.mp.api.WxMpService; +import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; +import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; +import org.springframework.stereotype.Component; + +import java.util.Map; + +import static me.chanjar.weixin.common.api.WxConsts.XmlMsgType; + +/** + * @author Binary Wang(https://github.com/binarywang) + */ +@Component +public class LocationHandler extends AbstractHandler { + + @Override + public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, + Map context, WxMpService wxMpService, + WxSessionManager sessionManager) { + if (wxMessage.getMsgType().equals(XmlMsgType.LOCATION)) { + //TODO 接收处理用户发送的地理位置消息 + try { + String content = "感谢反馈,您的的地理位置已收到!"; + return new TextBuilder().build(content, wxMessage, null); + } catch (Exception e) { + this.logger.error("位置消息接收处理失败", e); + return null; + } + } + + //上报地理位置事件 + this.logger.info("上报地理位置,纬度 : {},经度 : {},精度 : {}", + wxMessage.getLatitude(), wxMessage.getLongitude(), String.valueOf(wxMessage.getPrecision())); + + //TODO 可以将用户地理位置信息保存到本地数据库,以便以后使用 + + return null; + } + +} diff --git a/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/LogHandler.java b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/LogHandler.java new file mode 100644 index 0000000000..7efe62c03e --- /dev/null +++ b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/LogHandler.java @@ -0,0 +1,25 @@ +package com.epmet.wx.mp.handler; + +import com.epmet.wx.mp.utils.JsonUtils; +import me.chanjar.weixin.common.session.WxSessionManager; +import me.chanjar.weixin.mp.api.WxMpService; +import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; +import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * @author Binary Wang(https://github.com/binarywang) + */ +@Component +public class LogHandler extends AbstractHandler { + @Override + public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, + Map context, WxMpService wxMpService, + WxSessionManager sessionManager) { + this.logger.info("\n接收到请求消息,内容:{}", JsonUtils.toJson(wxMessage)); + return null; + } + +} diff --git a/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/MenuHandler.java b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/MenuHandler.java new file mode 100644 index 0000000000..edb0fa8af8 --- /dev/null +++ b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/MenuHandler.java @@ -0,0 +1,36 @@ +package com.epmet.wx.mp.handler; + +import me.chanjar.weixin.common.session.WxSessionManager; +import me.chanjar.weixin.mp.api.WxMpService; +import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; +import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; +import org.springframework.stereotype.Component; + +import java.util.Map; + +import static me.chanjar.weixin.common.api.WxConsts.MenuButtonType; + +/** + * @author Binary Wang(https://github.com/binarywang) + */ +@Component +public class MenuHandler extends AbstractHandler { + + @Override + public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, + Map context, WxMpService weixinService, + WxSessionManager sessionManager) { + + String msg = String.format("type:%s, event:%s, key:%s", + wxMessage.getMsgType(), wxMessage.getEvent(), + wxMessage.getEventKey()); + if (MenuButtonType.VIEW.equals(wxMessage.getEvent())) { + return null; + } + + return WxMpXmlOutMessage.TEXT().content(msg) + .fromUser(wxMessage.getToUser()).toUser(wxMessage.getFromUser()) + .build(); + } + +} diff --git a/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/MsgHandler.java b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/MsgHandler.java new file mode 100644 index 0000000000..492ba61613 --- /dev/null +++ b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/MsgHandler.java @@ -0,0 +1,52 @@ +package com.epmet.wx.mp.handler; + +import com.epmet.wx.mp.builder.TextBuilder; +import com.epmet.wx.mp.utils.JsonUtils; +import me.chanjar.weixin.common.error.WxErrorException; +import me.chanjar.weixin.common.session.WxSessionManager; +import me.chanjar.weixin.mp.api.WxMpService; +import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; +import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Component; + +import java.util.Map; + +import static me.chanjar.weixin.common.api.WxConsts.XmlMsgType; + +/** + * @author Binary Wang(https://github.com/binarywang) + */ +@Component +public class MsgHandler extends AbstractHandler { + + @Override + public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, + Map context, WxMpService weixinService, + WxSessionManager sessionManager) { + + if (!wxMessage.getMsgType().equals(XmlMsgType.EVENT)) { + //TODO 可以选择将消息保存到本地 + } + + //当用户输入关键词如“你好”,“客服”等,并且有客服在线时,把消息转发给在线客服 + try { + if (StringUtils.startsWithAny(wxMessage.getContent(), "你好", "客服") + && weixinService.getKefuService().kfOnlineList() + .getKfOnlineList().size() > 0) { + return WxMpXmlOutMessage.TRANSFER_CUSTOMER_SERVICE() + .fromUser(wxMessage.getToUser()) + .toUser(wxMessage.getFromUser()).build(); + } + } catch (WxErrorException e) { + e.printStackTrace(); + } + + //TODO 组装回复消息 + String content = "收到信息内容:" + JsonUtils.toJson(wxMessage); + + return new TextBuilder().build(content, wxMessage, weixinService); + + } + +} diff --git a/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/NullHandler.java b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/NullHandler.java new file mode 100644 index 0000000000..39716acf93 --- /dev/null +++ b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/NullHandler.java @@ -0,0 +1,24 @@ +package com.epmet.wx.mp.handler; + +import me.chanjar.weixin.common.session.WxSessionManager; +import me.chanjar.weixin.mp.api.WxMpService; +import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; +import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * @author Binary Wang(https://github.com/binarywang) + */ +@Component +public class NullHandler extends AbstractHandler { + + @Override + public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, + Map context, WxMpService wxMpService, + WxSessionManager sessionManager) { + return null; + } + +} diff --git a/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/ScanHandler.java b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/ScanHandler.java new file mode 100644 index 0000000000..0f22dd27ff --- /dev/null +++ b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/ScanHandler.java @@ -0,0 +1,25 @@ +package com.epmet.wx.mp.handler; + +import java.util.Map; + +import org.springframework.stereotype.Component; + +import me.chanjar.weixin.common.error.WxErrorException; +import me.chanjar.weixin.common.session.WxSessionManager; +import me.chanjar.weixin.mp.api.WxMpService; +import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; +import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; + +/** + * @author Binary Wang(https://github.com/binarywang) + */ +@Component +public class ScanHandler extends AbstractHandler { + + @Override + public WxMpXmlOutMessage handle(WxMpXmlMessage wxMpXmlMessage, Map map, + WxMpService wxMpService, WxSessionManager wxSessionManager) throws WxErrorException { + // 扫码事件处理 + return null; + } +} diff --git a/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/StoreCheckNotifyHandler.java b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/StoreCheckNotifyHandler.java new file mode 100644 index 0000000000..79ed57f75c --- /dev/null +++ b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/StoreCheckNotifyHandler.java @@ -0,0 +1,27 @@ +package com.epmet.wx.mp.handler; + +import me.chanjar.weixin.common.session.WxSessionManager; +import me.chanjar.weixin.mp.api.WxMpService; +import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; +import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * 门店审核事件处理 + * + * @author Binary Wang(https://github.com/binarywang) + */ +@Component +public class StoreCheckNotifyHandler extends AbstractHandler { + + @Override + public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, + Map context, WxMpService wxMpService, + WxSessionManager sessionManager) { + // TODO 处理门店审核事件 + return null; + } + +} diff --git a/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/SubscribeHandler.java b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/SubscribeHandler.java new file mode 100644 index 0000000000..4acfb20c81 --- /dev/null +++ b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/SubscribeHandler.java @@ -0,0 +1,71 @@ +package com.epmet.wx.mp.handler; + +import java.util.Map; + +import com.epmet.wx.mp.builder.TextBuilder; +import org.springframework.stereotype.Component; + +import me.chanjar.weixin.common.error.WxErrorException; +import me.chanjar.weixin.common.session.WxSessionManager; +import me.chanjar.weixin.mp.api.WxMpService; +import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; +import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; +import me.chanjar.weixin.mp.bean.result.WxMpUser; + +/** + * @author Binary Wang(https://github.com/binarywang) + */ +@Component +public class SubscribeHandler extends AbstractHandler { + + @Override + public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, + Map context, WxMpService weixinService, + WxSessionManager sessionManager) throws WxErrorException { + + this.logger.info("新关注用户 OPENID: " + wxMessage.getFromUser()); + + // 获取微信用户基本信息 + try { + WxMpUser userWxInfo = weixinService.getUserService() + .userInfo(wxMessage.getFromUser(), null); + if (userWxInfo != null) { + // TODO 可以添加关注用户到本地数据库 + } + } catch (WxErrorException e) { + if (e.getError().getErrorCode() == 48001) { + this.logger.info("该公众号没有获取用户信息权限!"); + } + } + + + WxMpXmlOutMessage responseResult = null; + try { + responseResult = this.handleSpecial(wxMessage); + } catch (Exception e) { + this.logger.error(e.getMessage(), e); + } + + if (responseResult != null) { + return responseResult; + } + + try { + return new TextBuilder().build("感谢关注", wxMessage, weixinService); + } catch (Exception e) { + this.logger.error(e.getMessage(), e); + } + + return null; + } + + /** + * 处理特殊请求,比如如果是扫码进来的,可以做相应处理 + */ + private WxMpXmlOutMessage handleSpecial(WxMpXmlMessage wxMessage) + throws Exception { + //TODO + return null; + } + +} diff --git a/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/UnsubscribeHandler.java b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/UnsubscribeHandler.java new file mode 100644 index 0000000000..3f86977706 --- /dev/null +++ b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/handler/UnsubscribeHandler.java @@ -0,0 +1,27 @@ +package com.epmet.wx.mp.handler; + +import me.chanjar.weixin.common.session.WxSessionManager; +import me.chanjar.weixin.mp.api.WxMpService; +import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; +import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * @author Binary Wang(https://github.com/binarywang) + */ +@Component +public class UnsubscribeHandler extends AbstractHandler { + + @Override + public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, + Map context, WxMpService wxMpService, + WxSessionManager sessionManager) { + String openId = wxMessage.getFromUser(); + this.logger.info("取消关注用户 OPENID: " + openId); + // TODO 可以更新本地数据库为取消关注状态 + return null; + } + +} diff --git a/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/utils/JsonUtils.java b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/utils/JsonUtils.java new file mode 100644 index 0000000000..8534fce802 --- /dev/null +++ b/epmet-commons/epmet-commons-tools-wx-mp/src/main/java/com/epmet/wx/mp/utils/JsonUtils.java @@ -0,0 +1,16 @@ +package com.epmet.wx.mp.utils; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +/** + * @author Binary Wang(https://github.com/binarywang) + */ +public class JsonUtils { + public static String toJson(Object obj) { + Gson gson = new GsonBuilder() + .setPrettyPrinting() + .create(); + return gson.toJson(obj); + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java index 15b2e92cbf..38a6c0d33a 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java @@ -104,8 +104,4 @@ public interface Constant { * 版本控制用 */ String VERSION_CONTROL = "/{version}"; - /** - * 移动端接口标识 - */ - String EPDC_APP = "epdc-app/"; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java index 2329a246b6..c358b530b3 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java @@ -48,4 +48,9 @@ public interface ServiceConstant { * 陌生人导览 */ String RESI_GUIDE_SERVER = "resi-guide-server"; + + /** + * 政府端组织架构 + */ + String GOV_ORG_SERVER = "gov-org-server"; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 419ab5a51e..1517d1220c 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -1,8 +1,8 @@ /** * Copyright (c) 2018 人人开源 All rights reserved. - * + *

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

* 版权所有,侵权必究! */ @@ -13,59 +13,102 @@ package com.epmet.commons.tools.redis; * @since 1.0.0 */ public class RedisKeys { - /** - * 系统参数Key - */ - public static String getSysParamsKey(){ - return "sys:params"; - } - - /** - * 登录验证码Key - */ - public static String getLoginCaptchaKey(String uuid){ - return "sys:captcha:" + uuid; - } - - /** - * 登录用户Key - */ - public static String getSecurityUserKey(Long id){ - return "sys:security:user:" + id; - } - - /** - * 系统日志Key - */ - public static String getSysLogKey(){ - return "sys:log"; - } - - /** - * 系统资源Key - */ - public static String getSysResourceKey(){ - return "sys:resource"; - } - - /** - * 用户菜单导航Key - */ - public static String getUserMenuNavKey(Long userId, String language){ - return "sys:user:nav:" + userId + "_" + language; - } - - /** - * 用户菜单导航Key - */ - public static String getUserMenuNavKey(Long userId){ - return "sys:user:nav:" + userId + "_*"; - } - - /** - * 用户权限标识Key - */ - public static String getUserPermissionsKey(Long userId){ - return "sys:user:permissions:" + userId; - } + + /** + * 党群e事通redis前缀 + */ + private static String rootPrefix = "epmet:"; + + /** + * 系统参数Key + */ + public static String getSysParamsKey() { + return rootPrefix.concat("sys:params"); + } + + /** + * 登录验证码Key + */ + public static String getLoginCaptchaKey(String uuid) { + return rootPrefix.concat("sys:captcha:").concat(uuid); + } + + /** + * 登录用户Key + */ + public static String getSecurityUserKey(Long id) { + return rootPrefix.concat("sys:security:user:").concat(String.valueOf(id)); + } + + /** + * 系统日志Key + */ + public static String getSysLogKey() { + return rootPrefix.concat("sys:log"); + } + + /** + * 系统资源Key + */ + public static String getSysResourceKey() { + return rootPrefix.concat("sys:resource"); + } + + /** + * 用户菜单导航Key + */ + public static String getUserMenuNavKey(Long userId, String language) { + return rootPrefix.concat("sys:user:nav:").concat(String.valueOf(userId)).concat("_").concat(language); + } + + /** + * 用户菜单导航Key + */ + public static String getUserMenuNavKey(Long userId) { + return rootPrefix.concat("sys:user:nav:").concat(String.valueOf(userId)).concat("_*"); + } + + /** + * 用户权限标识Key + */ + public static String getUserPermissionsKey(Long userId) { + return rootPrefix.concat("sys:user:permissions:").concat(String.valueOf(userId)); + } + + /** + * 用户token Key + * epmet:sys:security:user:resi:wxmp:100051424889632 + * epmet:sys:security:user:gov:wxmp:5048212821254821 + * epmet:sys:security:user:oper:web:eeedsfsdfds512551 + */ + public static String getCpUserKey(String app, String client, String id) { + return rootPrefix.concat("sys:security:user:").concat(app).concat(":").concat(client).concat(":").concat(id); + } + + /** + * 拼接手机验证码key---后面需要改!!! + * + * @param phone + * @return java.lang.String + * @author yujintao + * @date 2019/9/6 17:03 + */ + public static String getPhoneSmsCodeKey(String phone) { + return rootPrefix.concat("phone:sms:code:").concat(phone); + } + + /** + * 用户请求发送短信接口,记录本次请求时间,保存一分钟 + * ---后面需要改!!! + * + * @param phone + * @return java.lang.String + * @author work@yujt.net.cn + * @date 2019/12/6 19:05 + */ + public static String getPhoneSmsHistoryKey(String phone) { + return rootPrefix.concat("phone:sms:history:").concat(phone); + } + + } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java index 9211a3a319..fd02d32f73 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java @@ -29,29 +29,53 @@ public class RedisUtils { @Autowired private RedisTemplate redisTemplate; - /** 默认过期时长为24小时,单位:秒 */ + /** + * 默认过期时长为24小时,单位:秒 + */ public final static long DEFAULT_EXPIRE = 60 * 60 * 24L; - /** 过期时长为1小时,单位:秒 */ + /** + * 过期时长为1小时,单位:秒 + */ public final static long HOUR_ONE_EXPIRE = 60 * 60 * 1L; - /** 过期时长为6小时,单位:秒 */ + /** + * 过期时长为6小时,单位:秒 + */ public final static long HOUR_SIX_EXPIRE = 60 * 60 * 6L; - /** 不设置过期时长 */ + /** + * 过期时长为5分钟,单位:秒 + */ + public final static long MINUTE_FIVE_EXPIRE = 60 * 5 * 1L; + /** + * 过期时长为1分钟,单位:秒 + */ + public final static long MINUTE_ONE_EXPIRE = 60 * 1 * 1L; + /** + * 过期时长为10分钟,单位:秒 + */ + public final static long MINUTE_TEN_EXPIRE = 60 * 10 * 1L; + /** + * 过期时长为30分钟,单位:秒 + */ + public final static long MINUTE_THIRTY_EXPIRE = 60 * 30 * 1L; + /** + * 不设置过期时长 + */ public final static long NOT_EXPIRE = -1L; - public void set(String key, Object value, long expire){ + public void set(String key, Object value, long expire) { redisTemplate.opsForValue().set(key, value); - if(expire != NOT_EXPIRE){ + if (expire != NOT_EXPIRE) { expire(key, expire); } } - public void set(String key, Object value){ + public void set(String key, Object value) { set(key, value, DEFAULT_EXPIRE); } public Object get(String key, long expire) { Object value = redisTemplate.opsForValue().get(key); - if(expire != NOT_EXPIRE){ + if (expire != NOT_EXPIRE) { expire(key, expire); } return value; @@ -61,7 +85,7 @@ public class RedisUtils { return get(key, NOT_EXPIRE); } - public Set keys(String pattern){ + public Set keys(String pattern) { return redisTemplate.keys(pattern); } @@ -81,19 +105,19 @@ public class RedisUtils { return redisTemplate.opsForHash().get(key, field); } - public Map hGetAll(String key){ + public Map hGetAll(String key) { HashOperations hashOperations = redisTemplate.opsForHash(); return hashOperations.entries(key); } - public void hMSet(String key, Map map){ + public void hMSet(String key, Map map) { hMSet(key, map, DEFAULT_EXPIRE); } - public void hMSet(String key, Map map, long expire){ + public void hMSet(String key, Map map, long expire) { redisTemplate.opsForHash().putAll(key, map); - if(expire != NOT_EXPIRE){ + if (expire != NOT_EXPIRE) { expire(key, expire); } } @@ -105,32 +129,37 @@ public class RedisUtils { public void hSet(String key, String field, Object value, long expire) { redisTemplate.opsForHash().put(key, field, value); - if(expire != NOT_EXPIRE){ + if (expire != NOT_EXPIRE) { expire(key, expire); } } - public void expire(String key, long expire){ - redisTemplate.expire(key, expire, TimeUnit.SECONDS); + public boolean expire(String key, long expire) { + return redisTemplate.expire(key, expire, TimeUnit.SECONDS); } - public void hDel(String key, Object... fields){ + public long getExpire(String key) { + return redisTemplate.getExpire(key, TimeUnit.SECONDS); + } + + public void hDel(String key, Object... fields) { redisTemplate.opsForHash().delete(key, fields); } - public void leftPush(String key, Object value){ + public void leftPush(String key, Object value) { leftPush(key, value, DEFAULT_EXPIRE); } - public void leftPush(String key, Object value, long expire){ + public void leftPush(String key, Object value, long expire) { redisTemplate.opsForList().leftPush(key, value); - if(expire != NOT_EXPIRE){ + if (expire != NOT_EXPIRE) { expire(key, expire); } } - public Object rightPop(String key){ + public Object rightPop(String key) { return redisTemplate.opsForList().rightPop(key); } + } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index 022d28b9c8..097da00d3e 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -29,6 +29,8 @@ public class DateUtils { public final static String DATE_PATTERN = "yyyy-MM-dd"; /** 时间格式(yyyy-MM-dd HH:mm:ss) */ public final static String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss"; + /** 时间格式(yyyyMMddHHmmss) */ + public final static String DATE_TIME_NO_SPLIT = "yyyyMMddHHmmss"; /** * 日期格式化 日期格式为:yyyy-MM-dd diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/WebUtil.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/WebUtil.java new file mode 100644 index 0000000000..f1e2c53382 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/WebUtil.java @@ -0,0 +1,66 @@ +package com.epmet.commons.tools.utils; + +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + +/** + * Web工具类 + * + * @author rongchao + * @Date 18-11-20 + */ +public class WebUtil { + + public static HttpServletRequest getHttpServletRequest() { + ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletRequest request = requestAttributes.getRequest(); + return request; + } + + public static Object getAttributesFromRequest(String paramName) { + ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + return requestAttributes.getAttribute(paramName, RequestAttributes.SCOPE_REQUEST); + } + + public static void setAttributesFromRequest(String paramName, Object obj) { + ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + requestAttributes.setAttribute(paramName, obj, RequestAttributes.SCOPE_REQUEST); + } + + /** + * 获取用户真实IP地址,不使用request.getRemoteAddr();的原因是有可能用户使用了代理软件方式避免真实IP地址, + *

+ * 可是,如果通过了多级反向代理的话,X-Forwarded-For的值并不止一个,而是一串IP值,究竟哪个才是真正的用户端的真实IP呢? + * 答案是取X-Forwarded-For中第一个非unknown的有效IP字符串。 + *

+ * 如:X-Forwarded-For:192.168.1.110, 192.168.1.120, 192.168.1.130, + * 192.168.1.100 + *

+ * 用户真实IP为: 192.168.1.110 + * + * @return + */ + public static String getIpAddress() { + HttpServletRequest request = getHttpServletRequest(); + String ip = request.getHeader("x-forwarded-for"); + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("WL-Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("HTTP_CLIENT_IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("HTTP_X_FORWARDED_FOR"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getRemoteAddr(); + } + return ip; + } +} diff --git a/epmet-commons/pom.xml b/epmet-commons/pom.xml index c4f8cd0f99..350503fdae 100644 --- a/epmet-commons/pom.xml +++ b/epmet-commons/pom.xml @@ -17,6 +17,10 @@ epmet-commons-tools epmet-commons-mybatis epmet-commons-dynamic-datasource + epmet-commons-tools-phone + epmet-common-clienttoken + epmet-commons-tools-wx-ma + epmet-commons-tools-wx-mp diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index e63f9f7d69..158544f723 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -118,7 +118,7 @@ http://localhost:8084 - + http://localhost:8087 lb://epmet-demo-server @@ -132,6 +132,9 @@ http://localhost:8091 + + + http://localhost:8092 @@ -180,7 +183,9 @@ lb://oper-crm-server - lb://oper-crm-server + lb://resi-guid-server + + lb://gov-org-server diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index a6cb5e4252..4644b5a062 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -69,7 +69,7 @@ spring: #工作流服务 - id: epmet-activiti-server uri: @gateway.routes.epmet-activiti-server.uri@ - order: 5 + order: 6 predicates: - Path=${server.servlet.context-path}/activiti/** filters: @@ -77,7 +77,7 @@ spring: #定时任务服务 - id: epmet-job-server uri: @gateway.routes.epmet-job-server.uri@ - order: 6 + order: 7 predicates: - Path=${server.servlet.context-path}/job/** filters: @@ -85,7 +85,7 @@ spring: #用户服务 - id: epmet-user-server uri: @gateway.routes.epmet-user-server.uri@ - order: 7 + order: 8 predicates: - Path=${server.servlet.context-path}/epmetuser/** filters: @@ -93,7 +93,7 @@ spring: #demo流服务 - id: epmet-demo-server uri: @gateway.routes.epmet-demo-server.uri@ - order: 8 + order: 9 predicates: - Path=${server.servlet.context-path}/demo/** filters: @@ -101,7 +101,7 @@ spring: #运营端客户定制化服务 - id: oper-customize-server uri: @gateway.routes.oper-customize-server.uri@ - order: 9 + order: 10 predicates: - Path=${server.servlet.context-path}/oper/customize/** filters: @@ -109,7 +109,7 @@ spring: #运营端客户管理 - id: oper-crm-server uri: @gateway.routes.oper-crm-server.uri@ - order: 9 + order: 11 predicates: - Path=${server.servlet.context-path}/oper/crm/** filters: @@ -117,11 +117,19 @@ spring: #居民端陌生人导览 - id: resi-guide-server uri: @gateway.routes.resi-guide-server.uri@ - order: 10 + order: 12 predicates: - Path=${server.servlet.context-path}/resi/guide/** filters: - StripPrefix=1 + #政府端组织管理 + - id: gov-org-server + uri: @gateway.routes.gov-org-server.uri@ + order: 13 + predicates: + - Path=${server.servlet.context-path}/gov/org/** + filters: + - StripPrefix=1 nacos: discovery: server-addr: @nacos.server-addr@ diff --git a/epmet-module/gov-org/gov-org-client/pom.xml b/epmet-module/gov-org/gov-org-client/pom.xml new file mode 100644 index 0000000000..59518f86e2 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/pom.xml @@ -0,0 +1,35 @@ + + + 4.0.0 + + + com.epmet + gov-org + 2.0.0 + + + gov-org-client + jar + + + + com.epmet + epmet-commons-tools + 2.0.0 + + + io.springfox + springfox-swagger2 + + + io.springfox + springfox-swagger-ui + + + + + ${project.artifactId} + + + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerDepartmentDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerDepartmentDTO.java new file mode 100644 index 0000000000..ce71b879e0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerDepartmentDTO.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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户部门表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class CustomerDepartmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 所属组织ID + */ + private String orgId; + + /** + * 上级组织ID 用于查找归口部门 + */ + private String orgPid; + + /** + * 部门名称 + */ + private String depatmentName; + + /** + * 部门编码 + */ + private String depatmentCode; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java new file mode 100644 index 0000000000..f5ebbaa64f --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java @@ -0,0 +1,116 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class CustomerGridDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格编码 + */ + private String gridCode; + + /** + * 上级组织ID + */ + private String pid; + + /** + * 所有上级组织ID + */ + private String pids; + + /** + * 排序 + */ + private Integer sort; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; + + /** + * 所属地区码 + */ + private String areaCode; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerOrganizationDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerOrganizationDTO.java new file mode 100644 index 0000000000..99da24c5af --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerOrganizationDTO.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class CustomerOrganizationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 上级组织ID + */ + private String pid; + + /** + * 所有上级组织ID + */ + private String pids; + + /** + * 组织名称 + */ + private String organizationName; + + /** + * 组织编码 + */ + private String organizationCode; + + /** + * 级别 字典表key:level + */ + private Integer level; + + /** + * 地区码 阿里云公共api + */ + private Integer areaCode; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标识 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerRelevantDepartmentDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerRelevantDepartmentDTO.java new file mode 100644 index 0000000000..793bf13f99 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerRelevantDepartmentDTO.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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户归口部门关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class CustomerRelevantDepartmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 归口部门ID + */ + private String relevantDepartmentId; + + /** + * 删除标识 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerRoleDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerRoleDTO.java new file mode 100644 index 0000000000..362ca76902 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerRoleDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户角色表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class CustomerRoleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 角色编码 + */ + private String roleCode; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标识 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffDepartmentDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffDepartmentDTO.java new file mode 100644 index 0000000000..cbaadafa56 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffDepartmentDTO.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户人员部门表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class CustomerStaffDepartmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 用户ID + */ + private String staffId; + + /** + * 部门ID + */ + private String departmentiD; + + /** + * 删除标识 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffGridDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffGridDTO.java new file mode 100644 index 0000000000..86edacc48e --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffGridDTO.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户人员网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class CustomerStaffGridDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 用户ID + */ + private String staffId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 删除标识 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffOrganizationDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffOrganizationDTO.java new file mode 100644 index 0000000000..e47a4c6ddb --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffOrganizationDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户人员组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class CustomerStaffOrganizationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 用户ID + */ + private String staffId; + + /** + * 组织ID + */ + private String orgId; + + /** + * 级别 + */ + private Integer level; + + /** + * 删除标识 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffRoleDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffRoleDTO.java new file mode 100644 index 0000000000..66c98e68bc --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffRoleDTO.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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户人员角色表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class CustomerStaffRoleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 用户ID + */ + private String staffId; + + /** + * 角色ID + */ + private String roleId; + + /** + * 删除标识 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/PdmanDbVersionDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/PdmanDbVersionDTO.java new file mode 100644 index 0000000000..7b6008323b --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/PdmanDbVersionDTO.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class PdmanDbVersionDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String dbVersion; + + /** + * + */ + private String versionDesc; + + /** + * + */ + private String createdTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml new file mode 100644 index 0000000000..d750db2d37 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -0,0 +1,140 @@ + + + 4.0.0 + + + com.epmet + gov-org + 2.0.0 + + + gov-org-server + jar + + + + com.epmet + gov-org-client + 2.0.0 + + + com.epmet + epmet-commons-mybatis + 2.0.0 + + + com.epmet + epmet-commons-dynamic-datasource + 2.0.0 + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework + spring-context-support + + + org.springframework.boot + spring-boot-starter-actuator + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + + ${project.basedir}/src/main/java + + + true + ${basedir}/src/main/resources + + + + + + + dev + + true + + + 8092 + dev + + + + + + epmet + elink@833066 + + 0 + 122.152.200.70 + 6379 + 123456 + + false + 122.152.200.70:8848 + fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + + + false + + + + + test + + + 8092 + test + + + + + + epmet + elink@833066 + + 0 + 122.152.200.70 + 6379 + 123456 + + true + 122.152.200.70:8848 + fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + + + false + + + + + diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/GovOrgApplication.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/GovOrgApplication.java new file mode 100644 index 0000000000..7f1f254652 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/GovOrgApplication.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@SpringBootApplication +public class GovOrgApplication { + + public static void main(String[] args) { + SpringApplication.run(GovOrgApplication.class, args); + } + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/config/ModuleConfigImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/config/ModuleConfigImpl.java new file mode 100644 index 0000000000..3401bed33e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/config/ModuleConfigImpl.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.config; + +import com.epmet.commons.tools.config.ModuleConfig; +import org.springframework.stereotype.Service; + +/** + * 模块配置信息 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class ModuleConfigImpl implements ModuleConfig { + @Override + public String getName() { + return "govorg"; + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/config/SwaggerConfig.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/config/SwaggerConfig.java new file mode 100644 index 0000000000..e4ceef42ee --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/config/SwaggerConfig.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.config; + +import com.epmet.commons.tools.constant.Constant; +import io.swagger.annotations.ApiOperation; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.ApiKey; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +import java.util.List; + +import static com.google.common.collect.Lists.newArrayList; + +/** + * Swagger配置 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Configuration +@EnableSwagger2 +public class SwaggerConfig { + + @Bean + public Docket createRestApi() { + return new Docket(DocumentationType.SWAGGER_2) + .apiInfo(apiInfo()) + .select() + //加了ApiOperation注解的类,才生成接口文档 + .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) + //包下的类,才生成接口文档 + //.apis(RequestHandlerSelectors.basePackage("io.renren.controller")) + .paths(PathSelectors.any()) + .build() + .directModelSubstitute(java.util.Date.class, String.class) + .securitySchemes(security()); + } + + private ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("人人开源") + .description("系统模块开发文档") + .termsOfServiceUrl("https://www.renren.io/community") + .version("1.4.0") + .build(); + } + + private List security() { + return newArrayList( + new ApiKey(Constant.TOKEN_HEADER, Constant.TOKEN_HEADER, "header") + ); + } + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerDepartmentController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerDepartmentController.java new file mode 100644 index 0000000000..6ca515264a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerDepartmentController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.CustomerDepartmentDTO; +import com.epmet.excel.CustomerDepartmentExcel; +import com.epmet.service.CustomerDepartmentService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@RestController +@RequestMapping("customerdepartment") +public class CustomerDepartmentController { + + @Autowired + private CustomerDepartmentService customerDepartmentService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = customerDepartmentService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CustomerDepartmentDTO data = customerDepartmentService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CustomerDepartmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + customerDepartmentService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CustomerDepartmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + customerDepartmentService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + customerDepartmentService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = customerDepartmentService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CustomerDepartmentExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java new file mode 100644 index 0000000000..be74383365 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.excel.CustomerGridExcel; +import com.epmet.service.CustomerGridService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@RestController +@RequestMapping("customergrid") +public class CustomerGridController { + + @Autowired + private CustomerGridService customerGridService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = customerGridService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CustomerGridDTO data = customerGridService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CustomerGridDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + customerGridService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CustomerGridDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + customerGridService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + customerGridService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = customerGridService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CustomerGridExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerOrganizationController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerOrganizationController.java new file mode 100644 index 0000000000..d411443b2c --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerOrganizationController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.CustomerOrganizationDTO; +import com.epmet.excel.CustomerOrganizationExcel; +import com.epmet.service.CustomerOrganizationService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@RestController +@RequestMapping("customerorganization") +public class CustomerOrganizationController { + + @Autowired + private CustomerOrganizationService customerOrganizationService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = customerOrganizationService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CustomerOrganizationDTO data = customerOrganizationService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CustomerOrganizationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + customerOrganizationService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CustomerOrganizationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + customerOrganizationService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + customerOrganizationService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = customerOrganizationService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CustomerOrganizationExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerRelevantDepartmentController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerRelevantDepartmentController.java new file mode 100644 index 0000000000..7cc6d6811e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerRelevantDepartmentController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.CustomerRelevantDepartmentDTO; +import com.epmet.excel.CustomerRelevantDepartmentExcel; +import com.epmet.service.CustomerRelevantDepartmentService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@RestController +@RequestMapping("customerrelevantdepartment") +public class CustomerRelevantDepartmentController { + + @Autowired + private CustomerRelevantDepartmentService customerRelevantDepartmentService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = customerRelevantDepartmentService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CustomerRelevantDepartmentDTO data = customerRelevantDepartmentService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CustomerRelevantDepartmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + customerRelevantDepartmentService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CustomerRelevantDepartmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + customerRelevantDepartmentService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + customerRelevantDepartmentService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = customerRelevantDepartmentService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CustomerRelevantDepartmentExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerRoleController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerRoleController.java new file mode 100644 index 0000000000..01c6e713fd --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerRoleController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.CustomerRoleDTO; +import com.epmet.excel.CustomerRoleExcel; +import com.epmet.service.CustomerRoleService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@RestController +@RequestMapping("customerrole") +public class CustomerRoleController { + + @Autowired + private CustomerRoleService customerRoleService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = customerRoleService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CustomerRoleDTO data = customerRoleService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CustomerRoleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + customerRoleService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CustomerRoleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + customerRoleService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + customerRoleService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = customerRoleService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CustomerRoleExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffDepartmentController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffDepartmentController.java new file mode 100644 index 0000000000..b883f6a933 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffDepartmentController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.CustomerStaffDepartmentDTO; +import com.epmet.excel.CustomerStaffDepartmentExcel; +import com.epmet.service.CustomerStaffDepartmentService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@RestController +@RequestMapping("customerstaffdepartment") +public class CustomerStaffDepartmentController { + + @Autowired + private CustomerStaffDepartmentService customerStaffDepartmentService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = customerStaffDepartmentService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CustomerStaffDepartmentDTO data = customerStaffDepartmentService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CustomerStaffDepartmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + customerStaffDepartmentService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CustomerStaffDepartmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + customerStaffDepartmentService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + customerStaffDepartmentService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = customerStaffDepartmentService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CustomerStaffDepartmentExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java new file mode 100644 index 0000000000..38d23d2962 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.CustomerStaffGridDTO; +import com.epmet.excel.CustomerStaffGridExcel; +import com.epmet.service.CustomerStaffGridService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@RestController +@RequestMapping("customerstaffgrid") +public class CustomerStaffGridController { + + @Autowired + private CustomerStaffGridService customerStaffGridService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = customerStaffGridService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CustomerStaffGridDTO data = customerStaffGridService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CustomerStaffGridDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + customerStaffGridService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CustomerStaffGridDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + customerStaffGridService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + customerStaffGridService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = customerStaffGridService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CustomerStaffGridExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffOrganizationController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffOrganizationController.java new file mode 100644 index 0000000000..cac39f7e4f --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffOrganizationController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.CustomerStaffOrganizationDTO; +import com.epmet.excel.CustomerStaffOrganizationExcel; +import com.epmet.service.CustomerStaffOrganizationService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@RestController +@RequestMapping("customerstafforganization") +public class CustomerStaffOrganizationController { + + @Autowired + private CustomerStaffOrganizationService customerStaffOrganizationService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = customerStaffOrganizationService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CustomerStaffOrganizationDTO data = customerStaffOrganizationService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CustomerStaffOrganizationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + customerStaffOrganizationService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CustomerStaffOrganizationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + customerStaffOrganizationService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + customerStaffOrganizationService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = customerStaffOrganizationService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CustomerStaffOrganizationExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffRoleController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffRoleController.java new file mode 100644 index 0000000000..b277f187c7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffRoleController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.CustomerStaffRoleDTO; +import com.epmet.excel.CustomerStaffRoleExcel; +import com.epmet.service.CustomerStaffRoleService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@RestController +@RequestMapping("customerstaffrole") +public class CustomerStaffRoleController { + + @Autowired + private CustomerStaffRoleService customerStaffRoleService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = customerStaffRoleService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CustomerStaffRoleDTO data = customerStaffRoleService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CustomerStaffRoleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + customerStaffRoleService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CustomerStaffRoleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + customerStaffRoleService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + customerStaffRoleService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = customerStaffRoleService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CustomerStaffRoleExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PdmanDbVersionController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PdmanDbVersionController.java new file mode 100644 index 0000000000..00851cdb80 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PdmanDbVersionController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.PdmanDbVersionDTO; +import com.epmet.excel.PdmanDbVersionExcel; +import com.epmet.service.PdmanDbVersionService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@RestController +@RequestMapping("pdmandbversion") +public class PdmanDbVersionController { + + @Autowired + private PdmanDbVersionService pdmanDbVersionService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = pdmanDbVersionService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + PdmanDbVersionDTO data = pdmanDbVersionService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody PdmanDbVersionDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + pdmanDbVersionService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody PdmanDbVersionDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + pdmanDbVersionService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + pdmanDbVersionService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = pdmanDbVersionService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, PdmanDbVersionExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java new file mode 100644 index 0000000000..88235a5429 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.CustomerDepartmentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户部门表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Mapper +public interface CustomerDepartmentDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java new file mode 100644 index 0000000000..f13389578a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.CustomerGridEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Mapper +public interface CustomerGridDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerOrganizationDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerOrganizationDao.java new file mode 100644 index 0000000000..6455f9e7b5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerOrganizationDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.CustomerOrganizationEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Mapper +public interface CustomerOrganizationDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerRelevantDepartmentDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerRelevantDepartmentDao.java new file mode 100644 index 0000000000..a054e54fdc --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerRelevantDepartmentDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.CustomerRelevantDepartmentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户归口部门关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Mapper +public interface CustomerRelevantDepartmentDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerRoleDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerRoleDao.java new file mode 100644 index 0000000000..eb62bd03f2 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerRoleDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.CustomerRoleEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户角色表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Mapper +public interface CustomerRoleDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java new file mode 100644 index 0000000000..ec0dd68a02 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.CustomerStaffDepartmentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户人员部门表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Mapper +public interface CustomerStaffDepartmentDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java new file mode 100644 index 0000000000..6f2b1def6f --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.CustomerStaffGridEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户人员网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Mapper +public interface CustomerStaffGridDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffOrganizationDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffOrganizationDao.java new file mode 100644 index 0000000000..0c7c19c254 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffOrganizationDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.CustomerStaffOrganizationEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户人员组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Mapper +public interface CustomerStaffOrganizationDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffRoleDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffRoleDao.java new file mode 100644 index 0000000000..21c279d181 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffRoleDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.CustomerStaffRoleEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户人员角色表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Mapper +public interface CustomerStaffRoleDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/PdmanDbVersionDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/PdmanDbVersionDao.java new file mode 100644 index 0000000000..44b4dc43da --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/PdmanDbVersionDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.PdmanDbVersionEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Mapper +public interface PdmanDbVersionDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerDepartmentEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerDepartmentEntity.java new file mode 100644 index 0000000000..2ec4a1e951 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerDepartmentEntity.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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 客户部门表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_department") +public class CustomerDepartmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 所属组织ID + */ + private String orgId; + + /** + * 上级组织ID 用于查找归口部门 + */ + private String orgPid; + + /** + * 部门名称 + */ + private String depatmentName; + + /** + * 部门编码 + */ + private String depatmentCode; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridEntity.java new file mode 100644 index 0000000000..1e101c1a5b --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridEntity.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 客户网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_grid") +public class CustomerGridEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格编码 + */ + private String gridCode; + + /** + * 上级组织ID + */ + private String pid; + + /** + * 所有上级组织ID + */ + private String pids; + + /** + * 排序 + */ + private Integer sort; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; + + /** + * 所属地区码 + */ + private String areaCode; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerOrganizationEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerOrganizationEntity.java new file mode 100644 index 0000000000..3a7f9343d1 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerOrganizationEntity.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 客户组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_organization") +public class CustomerOrganizationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 上级组织ID + */ + private String pid; + + /** + * 所有上级组织ID + */ + private String pids; + + /** + * 组织名称 + */ + private String organizationName; + + /** + * 组织编码 + */ + private String organizationCode; + + /** + * 级别 字典表key:level + */ + private Integer level; + + /** + * 地区码 阿里云公共api + */ + private Integer areaCode; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerRelevantDepartmentEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerRelevantDepartmentEntity.java new file mode 100644 index 0000000000..60a71919ab --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerRelevantDepartmentEntity.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 客户归口部门关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_relevant_department") +public class CustomerRelevantDepartmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 归口部门ID + */ + private String relevantDepartmentId; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerRoleEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerRoleEntity.java new file mode 100644 index 0000000000..9cca6a932b --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerRoleEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 客户角色表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_role") +public class CustomerRoleEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 角色编码 + */ + private String roleCode; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffDepartmentEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffDepartmentEntity.java new file mode 100644 index 0000000000..55da3442ad --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffDepartmentEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 客户人员部门表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_staff_department") +public class CustomerStaffDepartmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 用户ID + */ + private String staffId; + + /** + * 部门ID + */ + private String departmentiD; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffGridEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffGridEntity.java new file mode 100644 index 0000000000..6452776bfd --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffGridEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 客户人员网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_staff_grid") +public class CustomerStaffGridEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 用户ID + */ + private String staffId; + + /** + * 网格ID + */ + private String gridId; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffOrganizationEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffOrganizationEntity.java new file mode 100644 index 0000000000..0bab4abcd3 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffOrganizationEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 客户人员组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_staff_organization") +public class CustomerStaffOrganizationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 用户ID + */ + private String staffId; + + /** + * 组织ID + */ + private String orgId; + + /** + * 级别 + */ + private Integer level; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffRoleEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffRoleEntity.java new file mode 100644 index 0000000000..be4deaba69 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffRoleEntity.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 客户人员角色表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_staff_role") +public class CustomerStaffRoleEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private String staffId; + + /** + * 角色ID + */ + private String roleId; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/PdmanDbVersionEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/PdmanDbVersionEntity.java new file mode 100644 index 0000000000..9a9e181918 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/PdmanDbVersionEntity.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pdman_db_version") +public class PdmanDbVersionEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String dbVersion; + + /** + * + */ + private String versionDesc; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerDepartmentExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerDepartmentExcel.java new file mode 100644 index 0000000000..0be683105c --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerDepartmentExcel.java @@ -0,0 +1,74 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 客户部门表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class CustomerDepartmentExcel { + + @Excel(name = "ID 唯一标识") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "所属组织ID") + private String orgId; + + @Excel(name = "上级组织ID 用于查找归口部门") + private String orgPid; + + @Excel(name = "部门名称") + private String depatmentName; + + @Excel(name = "部门编码") + private String depatmentCode; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerGridExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerGridExcel.java new file mode 100644 index 0000000000..b0edac859e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerGridExcel.java @@ -0,0 +1,83 @@ +/** + * 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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 客户网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class CustomerGridExcel { + + @Excel(name = "ID 唯一标识") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "网格名称") + private String gridName; + + @Excel(name = "网格编码") + private String gridCode; + + @Excel(name = "上级组织ID") + private String pid; + + @Excel(name = "所有上级组织ID") + private String pids; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "中心位置经度") + private String longitude; + + @Excel(name = "中心位置纬度") + private String latitude; + + @Excel(name = "所属地区码") + private String areaCode; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerOrganizationExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerOrganizationExcel.java new file mode 100644 index 0000000000..89597a98fc --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerOrganizationExcel.java @@ -0,0 +1,80 @@ +/** + * 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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 客户组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class CustomerOrganizationExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "上级组织ID") + private String pid; + + @Excel(name = "所有上级组织ID") + private String pids; + + @Excel(name = "组织名称") + private String organizationName; + + @Excel(name = "组织编码") + private String organizationCode; + + @Excel(name = "级别 字典表key:level") + private Integer level; + + @Excel(name = "地区码 阿里云公共api") + private Integer areaCode; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "删除标识") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerRelevantDepartmentExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerRelevantDepartmentExcel.java new file mode 100644 index 0000000000..92e3f54489 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerRelevantDepartmentExcel.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 客户归口部门关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class CustomerRelevantDepartmentExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "部门ID") + private String departmentId; + + @Excel(name = "归口部门ID") + private String relevantDepartmentId; + + @Excel(name = "删除标识") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerRoleExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerRoleExcel.java new file mode 100644 index 0000000000..9fde7b496b --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerRoleExcel.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 客户角色表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class CustomerRoleExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "角色名称") + private String roleName; + + @Excel(name = "角色编码") + private String roleCode; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "删除标识") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffDepartmentExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffDepartmentExcel.java new file mode 100644 index 0000000000..3803bee96c --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffDepartmentExcel.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 客户人员部门表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class CustomerStaffDepartmentExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "用户ID") + private String staffId; + + @Excel(name = "部门ID") + private String departmentiD; + + @Excel(name = "删除标识") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffGridExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffGridExcel.java new file mode 100644 index 0000000000..824316ff8f --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffGridExcel.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 客户人员网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class CustomerStaffGridExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "用户ID") + private String staffId; + + @Excel(name = "网格ID") + private String gridId; + + @Excel(name = "删除标识") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffOrganizationExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffOrganizationExcel.java new file mode 100644 index 0000000000..313949ca7c --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffOrganizationExcel.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 客户人员组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class CustomerStaffOrganizationExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "用户ID") + private String staffId; + + @Excel(name = "组织ID") + private String orgId; + + @Excel(name = "级别") + private Integer level; + + @Excel(name = "删除标识") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffRoleExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffRoleExcel.java new file mode 100644 index 0000000000..b8a8fc05ac --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffRoleExcel.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 客户人员角色表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class CustomerStaffRoleExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "用户ID") + private String staffId; + + @Excel(name = "角色ID") + private String roleId; + + @Excel(name = "删除标识") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/PdmanDbVersionExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/PdmanDbVersionExcel.java new file mode 100644 index 0000000000..1bb5b05b13 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/PdmanDbVersionExcel.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class PdmanDbVersionExcel { + + @Excel(name = "") + private String dbVersion; + + @Excel(name = "") + private String versionDesc; + + @Excel(name = "") + private String createdTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerDepartmentRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerDepartmentRedis.java new file mode 100644 index 0000000000..92452e202c --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerDepartmentRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 客户部门表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Component +public class CustomerDepartmentRedis { + @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/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerGridRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerGridRedis.java new file mode 100644 index 0000000000..3d69fe3ca8 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerGridRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 客户网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Component +public class CustomerGridRedis { + @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/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerOrganizationRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerOrganizationRedis.java new file mode 100644 index 0000000000..9205ed1744 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerOrganizationRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 客户组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Component +public class CustomerOrganizationRedis { + @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/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerRelevantDepartmentRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerRelevantDepartmentRedis.java new file mode 100644 index 0000000000..42714c551b --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerRelevantDepartmentRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 客户归口部门关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Component +public class CustomerRelevantDepartmentRedis { + @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/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerRoleRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerRoleRedis.java new file mode 100644 index 0000000000..5f0eed0bce --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerRoleRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 客户角色表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Component +public class CustomerRoleRedis { + @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/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffDepartmentRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffDepartmentRedis.java new file mode 100644 index 0000000000..b2d6ed382a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffDepartmentRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 客户人员部门表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Component +public class CustomerStaffDepartmentRedis { + @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/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffGridRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffGridRedis.java new file mode 100644 index 0000000000..4d0a0b4732 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffGridRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 客户人员网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Component +public class CustomerStaffGridRedis { + @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/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffOrganizationRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffOrganizationRedis.java new file mode 100644 index 0000000000..c953577757 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffOrganizationRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 客户人员组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Component +public class CustomerStaffOrganizationRedis { + @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/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffRoleRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffRoleRedis.java new file mode 100644 index 0000000000..880014e64b --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffRoleRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 客户人员角色表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Component +public class CustomerStaffRoleRedis { + @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/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/PdmanDbVersionRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/PdmanDbVersionRedis.java new file mode 100644 index 0000000000..df050721f3 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/PdmanDbVersionRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Component +public class PdmanDbVersionRedis { + @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/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerDepartmentService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerDepartmentService.java new file mode 100644 index 0000000000..46a5016af2 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerDepartmentService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.CustomerDepartmentDTO; +import com.epmet.entity.CustomerDepartmentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户部门表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +public interface CustomerDepartmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CustomerDepartmentDTO + * @author generator + * @date 2020-03-16 + */ + CustomerDepartmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void save(CustomerDepartmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void update(CustomerDepartmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java new file mode 100644 index 0000000000..cdc050da2c --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.entity.CustomerGridEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +public interface CustomerGridService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CustomerGridDTO + * @author generator + * @date 2020-03-16 + */ + CustomerGridDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void save(CustomerGridDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void update(CustomerGridDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerOrganizationService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerOrganizationService.java new file mode 100644 index 0000000000..5071741b43 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerOrganizationService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.CustomerOrganizationDTO; +import com.epmet.entity.CustomerOrganizationEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +public interface CustomerOrganizationService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CustomerOrganizationDTO + * @author generator + * @date 2020-03-16 + */ + CustomerOrganizationDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void save(CustomerOrganizationDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void update(CustomerOrganizationDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerRelevantDepartmentService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerRelevantDepartmentService.java new file mode 100644 index 0000000000..742079da09 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerRelevantDepartmentService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.CustomerRelevantDepartmentDTO; +import com.epmet.entity.CustomerRelevantDepartmentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户归口部门关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +public interface CustomerRelevantDepartmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CustomerRelevantDepartmentDTO + * @author generator + * @date 2020-03-16 + */ + CustomerRelevantDepartmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void save(CustomerRelevantDepartmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void update(CustomerRelevantDepartmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerRoleService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerRoleService.java new file mode 100644 index 0000000000..d5a7c70464 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerRoleService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.CustomerRoleDTO; +import com.epmet.entity.CustomerRoleEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户角色表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +public interface CustomerRoleService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CustomerRoleDTO + * @author generator + * @date 2020-03-16 + */ + CustomerRoleDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void save(CustomerRoleDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void update(CustomerRoleDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffDepartmentService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffDepartmentService.java new file mode 100644 index 0000000000..4a3b7d4d53 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffDepartmentService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.CustomerStaffDepartmentDTO; +import com.epmet.entity.CustomerStaffDepartmentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户人员部门表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +public interface CustomerStaffDepartmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CustomerStaffDepartmentDTO + * @author generator + * @date 2020-03-16 + */ + CustomerStaffDepartmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void save(CustomerStaffDepartmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void update(CustomerStaffDepartmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java new file mode 100644 index 0000000000..9ebc45c530 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.CustomerStaffGridDTO; +import com.epmet.entity.CustomerStaffGridEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户人员网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +public interface CustomerStaffGridService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CustomerStaffGridDTO + * @author generator + * @date 2020-03-16 + */ + CustomerStaffGridDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void save(CustomerStaffGridDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void update(CustomerStaffGridDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffOrganizationService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffOrganizationService.java new file mode 100644 index 0000000000..d49c9a9ab7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffOrganizationService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.CustomerStaffOrganizationDTO; +import com.epmet.entity.CustomerStaffOrganizationEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户人员组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +public interface CustomerStaffOrganizationService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CustomerStaffOrganizationDTO + * @author generator + * @date 2020-03-16 + */ + CustomerStaffOrganizationDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void save(CustomerStaffOrganizationDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void update(CustomerStaffOrganizationDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffRoleService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffRoleService.java new file mode 100644 index 0000000000..dcf9dd19e1 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffRoleService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.CustomerStaffRoleDTO; +import com.epmet.entity.CustomerStaffRoleEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户人员角色表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +public interface CustomerStaffRoleService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CustomerStaffRoleDTO + * @author generator + * @date 2020-03-16 + */ + CustomerStaffRoleDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void save(CustomerStaffRoleDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void update(CustomerStaffRoleDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PdmanDbVersionService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PdmanDbVersionService.java new file mode 100644 index 0000000000..2b869d27c9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PdmanDbVersionService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.PdmanDbVersionDTO; +import com.epmet.entity.PdmanDbVersionEntity; + +import java.util.List; +import java.util.Map; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +public interface PdmanDbVersionService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PdmanDbVersionDTO + * @author generator + * @date 2020-03-16 + */ + PdmanDbVersionDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void save(PdmanDbVersionDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void update(PdmanDbVersionDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java new file mode 100644 index 0000000000..f7e78d5f23 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.PdmanDbVersionDao; +import com.epmet.dto.PdmanDbVersionDTO; +import com.epmet.entity.PdmanDbVersionEntity; +import com.epmet.redis.PdmanDbVersionRedis; +import com.epmet.service.PdmanDbVersionService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Service +public class PdmanDbVersionServiceImpl extends BaseServiceImpl implements PdmanDbVersionService { + + @Autowired + private PdmanDbVersionRedis pdmanDbVersionRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PdmanDbVersionDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PdmanDbVersionDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public PdmanDbVersionDTO get(String id) { + PdmanDbVersionEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PdmanDbVersionDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PdmanDbVersionDTO dto) { + PdmanDbVersionEntity entity = ConvertUtils.sourceToTarget(dto, PdmanDbVersionEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PdmanDbVersionDTO dto) { + PdmanDbVersionEntity entity = ConvertUtils.sourceToTarget(dto, PdmanDbVersionEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml b/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000..49bac0aa3d --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml @@ -0,0 +1,117 @@ +server: + port: @server.port@ + servlet: + context-path: /gov/org + +spring: + main: + allow-bean-definition-overriding: true + application: + name: gov-org-server + #环境 dev|test|prod + profiles: + active: dev + messages: + encoding: UTF-8 + basename: i18n/messages_common + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + redis: + database: @spring.redis.index@ + host: @spring.redis.host@ + port: @spring.redis.port@ + password: @spring.redis.password@ + timeout: 30s + datasource: + druid: + #MySQL + driver-class-name: com.mysql.cj.jdbc.Driver + url: @spring.datasource.druid.url@ + username: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + initial-size: 10 + max-active: 100 + min-idle: 10 + max-wait: 60000 + pool-prepared-statements: true + max-pool-prepared-statement-per-connection-size: 20 + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + #Oracle需要打开注释 + #validation-query: SELECT 1 FROM DUAL + test-while-idle: true + test-on-borrow: false + test-on-return: false + filter: + stat: + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: false + wall: + config: + multi-statement-allow: true + cloud: + nacos: + discovery: + server-addr: @nacos.server-addr@ + #nacos的命名空间ID,默认是public + namespace: @nacos.discovery.namespace@ + #不把自己注册到注册中心的地址 + register-enabled: @nacos.register-enabled@ + ip: @nacos.ip@ + config: + enabled: @nacos.config-enabled@ + server-addr: @nacos.server-addr@ + namespace: @nacos.config.namespace@ + group: @nacos.config.group@ + file-extension: yaml +management: + endpoints: + web: + exposure: + include: "*" + endpoint: + health: + show-details: ALWAYS + +mybatis-plus: + mapper-locations: classpath:/mapper/**/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.epmet.entity + global-config: + #数据库相关配置 + db-config: + #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; + id-type: ID_WORKER + banner: false + #原生配置 + configuration: + map-underscore-to-camel-case: true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' + +feign: + hystrix: + enabled: true + client: + config: + default: + loggerLevel: BASIC + httpclient: + enabled: true + max-connections: 200 + max-connections-per-route: 50 + +hystrix: + command: + default: + execution: + isolation: + thread: + timeoutInMilliseconds: 60000 #缺省为1000 + +ribbon: + ReadTimeout: 300000 + ConnectTimeout: 300000 diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/resources/logback-spring.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml similarity index 99% rename from epmet-module/resi-guide/resi-guide-server/src/main/resources/logback-spring.xml rename to epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml index 6f0e508a90..ed77f25d1f 100644 --- a/epmet-module/resi-guide/resi-guide-server/src/main/resources/logback-spring.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml @@ -2,7 +2,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml new file mode 100644 index 0000000000..5765fffd44 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerOrganizationDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerOrganizationDao.xml new file mode 100644 index 0000000000..a426a91bb1 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerOrganizationDao.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerRelevantDepartmentDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerRelevantDepartmentDao.xml new file mode 100644 index 0000000000..ee49f84cc7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerRelevantDepartmentDao.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerRoleDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerRoleDao.xml new file mode 100644 index 0000000000..23a4f2e60f --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerRoleDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml new file mode 100644 index 0000000000..b2c7feb516 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml new file mode 100644 index 0000000000..5d41eddab2 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffOrganizationDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffOrganizationDao.xml new file mode 100644 index 0000000000..6c803aea76 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffOrganizationDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffRoleDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffRoleDao.xml new file mode 100644 index 0000000000..8d1b32c0e1 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffRoleDao.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/PdmanDbVersionDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/PdmanDbVersionDao.xml new file mode 100644 index 0000000000..f265a47684 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/PdmanDbVersionDao.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/pom.xml b/epmet-module/gov-org/pom.xml new file mode 100644 index 0000000000..0ef2ad2df6 --- /dev/null +++ b/epmet-module/gov-org/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + + + com.epmet + epmet-module + 2.0.0 + + + com.epmet + gov-org + pom + + + gov-org-client + gov-org-server + + + diff --git a/epmet-module/pom.xml b/epmet-module/pom.xml index 9aca2a1ae1..571b2fed2c 100644 --- a/epmet-module/pom.xml +++ b/epmet-module/pom.xml @@ -22,6 +22,7 @@ oper-customize oper-crm resi-guide + gov-org diff --git a/epmet-module/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/result/.gitkeep b/epmet-module/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/result/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridLatestDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridLatestDTO.java new file mode 100644 index 0000000000..98a6176f5f --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridLatestDTO.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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 最近访问网格表 记录用户访问网格的最近一次记录,对同一网格只记录一条记录,同一网格每次只更新最近一次访问的时间 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class GridLatestDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id CUSTOMER.id + */ + private String customerId; + + /** + * 网格表Id(CUSTOMER_GRID.id) + */ + private String gridId; + + /** + * 用户Id(CUSTOMER_USER.id) + */ + private String customerUserId; + + /** + * 所属地区码 (数据统计字段) + */ + private String areaCode; + + /** + * 上级组织ID (数据统计字段) + */ + private String pid; + + /** + * 最近访问时间 + */ + private Date latestTime; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridVisitedDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridVisitedDTO.java new file mode 100644 index 0000000000..cf2c85a332 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridVisitedDTO.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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 网格访问记录表 用户对网格访问的一个记录,只有在访问网格首页时才存储数据,一个用户一天对一个网格的访问只有一条记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class GridVisitedDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 是否注册(0:否 1:是) + */ + private Integer isRegister; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格表Id (CUSTOMER_GRID.id) + */ + private String gridId; + + /** + * 用户Id + */ + private String customerUserId; + + /** + * 是否首次位置授权(0:否 1:是) + */ + private Integer isAuthorized; + + /** + * 访问时间 一个用户一天访问一个网格只有一条记录 + */ + private Date visitTime; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridLatestController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridLatestController.java new file mode 100644 index 0000000000..a6c1500b02 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridLatestController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.GridLatestDTO; +import com.epmet.excel.GridLatestExcel; +import com.epmet.service.GridLatestService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@RestController +@RequestMapping("gridlatest") +public class GridLatestController { + + @Autowired + private GridLatestService gridLatestService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = gridLatestService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GridLatestDTO data = gridLatestService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GridLatestDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + gridLatestService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GridLatestDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + gridLatestService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + gridLatestService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = gridLatestService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, GridLatestExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridVisitedController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridVisitedController.java new file mode 100644 index 0000000000..a960c39e20 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridVisitedController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.GridVisitedDTO; +import com.epmet.excel.GridVisitedExcel; +import com.epmet.service.GridVisitedService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@RestController +@RequestMapping("gridvisited") +public class GridVisitedController { + + @Autowired + private GridVisitedService gridVisitedService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = gridVisitedService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GridVisitedDTO data = gridVisitedService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GridVisitedDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + gridVisitedService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GridVisitedDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + gridVisitedService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + gridVisitedService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = gridVisitedService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, GridVisitedExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridLatestDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridLatestDao.java new file mode 100644 index 0000000000..2b31a4b1a8 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridLatestDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GridLatestEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 最近访问网格表 记录用户访问网格的最近一次记录,对同一网格只记录一条记录,同一网格每次只更新最近一次访问的时间 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Mapper +public interface GridLatestDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridVisitedDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridVisitedDao.java new file mode 100644 index 0000000000..e51d88956d --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridVisitedDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GridVisitedEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格访问记录表 用户对网格访问的一个记录,只有在访问网格首页时才存储数据,一个用户一天对一个网格的访问只有一条记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Mapper +public interface GridVisitedDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridLatestEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridLatestEntity.java new file mode 100644 index 0000000000..254829c16f --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridLatestEntity.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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 最近访问网格表 记录用户访问网格的最近一次记录,对同一网格只记录一条记录,同一网格每次只更新最近一次访问的时间 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("grid_latest") +public class GridLatestEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id CUSTOMER.id + */ + private String customerId; + + /** + * 网格表Id(CUSTOMER_GRID.id) + */ + private String gridId; + + /** + * 用户Id(CUSTOMER_USER.id) + */ + private String customerUserId; + + /** + * 所属地区码 (数据统计字段) + */ + private String areaCode; + + /** + * 上级组织ID (数据统计字段) + */ + private String pid; + + /** + * 最近访问时间 + */ + private Date latestTime; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridVisitedEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridVisitedEntity.java new file mode 100644 index 0000000000..9fb79ca7af --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridVisitedEntity.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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 网格访问记录表 用户对网格访问的一个记录,只有在访问网格首页时才存储数据,一个用户一天对一个网格的访问只有一条记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("grid_visited") +public class GridVisitedEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 是否注册(0:否 1:是) + */ + private Integer isRegister; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格表Id (CUSTOMER_GRID.id) + */ + private String gridId; + + /** + * 用户Id + */ + private String customerUserId; + + /** + * 是否首次位置授权(0:否 1:是) + */ + private Integer isAuthorized; + + /** + * 访问时间 一个用户一天访问一个网格只有一条记录 + */ + private Date visitTime; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GridLatestExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GridLatestExcel.java new file mode 100644 index 0000000000..e4d6000914 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GridLatestExcel.java @@ -0,0 +1,74 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 最近访问网格表 记录用户访问网格的最近一次记录,对同一网格只记录一条记录,同一网格每次只更新最近一次访问的时间 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class GridLatestExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id CUSTOMER.id") + private String customerId; + + @Excel(name = "网格表Id(CUSTOMER_GRID.id)") + private String gridId; + + @Excel(name = "用户Id(CUSTOMER_USER.id)") + private String customerUserId; + + @Excel(name = "所属地区码 (数据统计字段)") + private String areaCode; + + @Excel(name = "上级组织ID (数据统计字段)") + private String pid; + + @Excel(name = "最近访问时间") + private Date latestTime; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GridVisitedExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GridVisitedExcel.java new file mode 100644 index 0000000000..13c5fefc26 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GridVisitedExcel.java @@ -0,0 +1,74 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 网格访问记录表 用户对网格访问的一个记录,只有在访问网格首页时才存储数据,一个用户一天对一个网格的访问只有一条记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class GridVisitedExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "是否注册(0:否 1:是)") + private Integer isRegister; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "网格表Id (CUSTOMER_GRID.id)") + private String gridId; + + @Excel(name = "用户Id") + private String customerUserId; + + @Excel(name = "是否首次位置授权(0:否 1:是)") + private Integer isAuthorized; + + @Excel(name = "访问时间 一个用户一天访问一个网格只有一条记录") + private Date visitTime; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridLatestRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridLatestRedis.java new file mode 100644 index 0000000000..41bf0cfb49 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridLatestRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 最近访问网格表 记录用户访问网格的最近一次记录,对同一网格只记录一条记录,同一网格每次只更新最近一次访问的时间 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Component +public class GridLatestRedis { + @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/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridVisitedRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridVisitedRedis.java new file mode 100644 index 0000000000..9316d6f3c7 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridVisitedRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 网格访问记录表 用户对网格访问的一个记录,只有在访问网格首页时才存储数据,一个用户一天对一个网格的访问只有一条记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Component +public class GridVisitedRedis { + @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/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridLatestService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridLatestService.java new file mode 100644 index 0000000000..1ddbb716a8 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridLatestService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GridLatestDTO; +import com.epmet.entity.GridLatestEntity; + +import java.util.List; +import java.util.Map; + +/** + * 最近访问网格表 记录用户访问网格的最近一次记录,对同一网格只记录一条记录,同一网格每次只更新最近一次访问的时间 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +public interface GridLatestService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GridLatestDTO + * @author generator + * @date 2020-03-16 + */ + GridLatestDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void save(GridLatestDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void update(GridLatestDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridVisitedService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridVisitedService.java new file mode 100644 index 0000000000..d081fab310 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridVisitedService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GridVisitedDTO; +import com.epmet.entity.GridVisitedEntity; + +import java.util.List; +import java.util.Map; + +/** + * 网格访问记录表 用户对网格访问的一个记录,只有在访问网格首页时才存储数据,一个用户一天对一个网格的访问只有一条记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +public interface GridVisitedService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GridVisitedDTO + * @author generator + * @date 2020-03-16 + */ + GridVisitedDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void save(GridVisitedDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void update(GridVisitedDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java new file mode 100644 index 0000000000..1ab4bac35f --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

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

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.GridVisitedDao; +import com.epmet.dto.GridVisitedDTO; +import com.epmet.entity.GridVisitedEntity; +import com.epmet.redis.GridVisitedRedis; +import com.epmet.service.GridVisitedService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Service +public class GridVisitedServiceImpl extends BaseServiceImpl implements GridVisitedService { + + @Autowired + private GridVisitedRedis gridVisitedRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GridVisitedDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GridVisitedDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public GridVisitedDTO get(String id) { + GridVisitedEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GridVisitedDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GridVisitedDTO dto) { + GridVisitedEntity entity = ConvertUtils.sourceToTarget(dto, GridVisitedEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GridVisitedDTO dto) { + GridVisitedEntity entity = ConvertUtils.sourceToTarget(dto, GridVisitedEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/GridLatestDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/GridLatestDao.xml new file mode 100644 index 0000000000..c05db815e8 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GridLatestDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/GridVisitedDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/GridVisitedDao.xml new file mode 100644 index 0000000000..2ea9a363db --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GridVisitedDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file