Browse Source

Merge branches 'dev' and 'dev_heart' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_heart

master
yinzuomei 5 years ago
parent
commit
7fd0a8471e
  1. 7
      epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java
  2. 16
      epmet-auth/src/main/java/com/epmet/service/impl/PublicUserLoginServiceImpl.java
  3. 3
      epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java
  4. 2
      epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml
  5. 2
      epmet-module/epmet-heart/epmet-heart-server/pom.xml
  6. 2
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/ComponentAccessTokenServiceImpl.java
  7. 2
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/RefreshAuthAccessTokenServiceImpl.java
  8. 116
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/EpmetThirdFeignClient.java
  9. 71
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/EpmetThirdFeignClientFallback.java
  10. 2
      epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml
  11. 2
      epmet-module/epmet-third/epmet-third-server/pom.xml
  12. 7
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java
  13. 3
      epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java
  14. 2
      epmet-user/epmet-user-server/deploy/docker-compose-dev.yml
  15. 2
      epmet-user/epmet-user-server/deploy/docker-compose-test.yml
  16. 2
      epmet-user/epmet-user-server/pom.xml
  17. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java
  18. 2
      epmet-user/epmet-user-server/src/main/resources/mapper/UserCustomerDao.xml

7
epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java

@ -21,7 +21,10 @@ import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.GovStaffRoleDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgFeignClient;
import com.epmet.jwt.JwtTokenProperties;
import com.epmet.jwt.JwtTokenUtils;
import com.epmet.redis.CaptchaRedis;
@ -64,8 +67,6 @@ public class GovLoginServiceImpl implements GovLoginService {
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Autowired
private EpmetUserOpenFeignClient userOpenFeignClient;
@Autowired
private EpmetThirdFeignClient epmetThirdFeignClient;
/**
* @param formDTO

16
epmet-auth/src/main/java/com/epmet/service/impl/PublicUserLoginServiceImpl.java

@ -7,10 +7,6 @@ import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.*;
import com.epmet.commons.tools.utils.CpUserDetailRedis;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.PhoneValidatorUtils;
import com.epmet.constant.AuthHttpUrlConstant;
import com.epmet.constant.PublicUserLoginConstant;
@ -22,7 +18,6 @@ import com.epmet.dto.PaUserWechatDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetThirdFeignClient;
import com.epmet.jwt.JwtTokenProperties;
import com.epmet.jwt.JwtTokenUtils;
import com.epmet.redis.CaptchaRedis;
@ -53,8 +48,6 @@ public class PublicUserLoginServiceImpl implements PublicUserLoginService {
@Autowired
private WxMpService wxMpService;
@Autowired
private EpmetThirdFeignClient epmetThirdFeignClient;
@Autowired
private JwtTokenUtils jwtTokenUtils;
@Autowired
private JwtTokenProperties jwtTokenProperties;
@ -75,12 +68,15 @@ public class PublicUserLoginServiceImpl implements PublicUserLoginService {
dto.setSource(formDTO.getSource());
//2.将获取的用户基本信息初始化到数据库
String url = ThirdApiConstant.THIRD_PAUSER_SAVEUSER;
Result<String> result = HttpClientManager.getInstance().sendPostByJSON(url, JSON.toJSONString(dto));
String data = HttpClientManager.getInstance().sendPostByJSON(ThirdApiConstant.THIRD_PAUSER_SAVEUSER, JSON.toJSONString(dto)).getData();
JSONObject toResult = JSON.parseObject(data);
Result result = ConvertUtils.mapToEntity(toResult, Result.class);
if (!result.success()) {
throw new RenException(PublicUserLoginConstant.SAVE_USER_EXCEPTION);
}
SaveUserResultDTO resultDTO = JSONObject.parseObject(result.getData(), SaveUserResultDTO.class);
Object RegisterResult = result.getData();
JSONObject jsonObject = JSON.parseObject(RegisterResult.toString());
SaveUserResultDTO resultDTO = ConvertUtils.mapToEntity(jsonObject, SaveUserResultDTO.class);
//3.获取用户token
String token = this.generateGovWxmpToken(resultDTO.getUserId());

3
epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java

@ -16,7 +16,6 @@ import com.epmet.constant.AuthHttpUrlConstant;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.EpmetThirdFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.jwt.JwtTokenProperties;
@ -52,8 +51,6 @@ public class ThirdLoginServiceImpl implements ThirdLoginService {
@Autowired
private CpUserDetailRedis cpUserDetailRedis;
@Autowired
private EpmetThirdFeignClient epmetThirdFeignClient;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;

2
epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-heart-server:
container_name: epmet-heart-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-heart-server:0.0.16
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-heart-server:0.0.17
ports:
- "8111:8111"
network_mode: host # 使用现有网络

2
epmet-module/epmet-heart/epmet-heart-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.0.16</version>
<version>0.0.17</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-heart</artifactId>

2
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/ComponentAccessTokenServiceImpl.java

@ -6,10 +6,8 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.HttpUrlConstant;
import com.epmet.feign.EpmetThirdFeignClient;
import com.epmet.service.ComponentAccessTokenService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**

2
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/RefreshAuthAccessTokenServiceImpl.java

@ -6,9 +6,7 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.HttpUrlConstant;
import com.epmet.feign.EpmetThirdFeignClient;
import com.epmet.service.RefreshAuthAccessTokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**

116
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/EpmetThirdFeignClient.java

@ -1,116 +0,0 @@
package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.UserWechatDTO;
import com.epmet.dto.form.RegisterFormDTO;
import com.epmet.dto.form.SaveUserVisitedFormDTO;
import com.epmet.dto.form.WxLoginFormDTO;
import com.epmet.dto.result.*;
import com.epmet.feign.fallback.EpmetThirdFeignClientFallback;
import me.chanjar.weixin.mp.bean.result.WxMpUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
/**
* 本服务对外开放的API,其他服务通过引用此client调用该服务
*
* @Author zxc
* @CreateTime 2020/7/5 14:45
* ,url="localhost:8110"
*/
@FeignClient(name = ServiceConstant.EPMET_THIRD_SERVER, fallback = EpmetThirdFeignClientFallback.class)
public interface EpmetThirdFeignClient {
/**
* @param wxMpUser
* @return
* @Author sun
* @Description 根据openId新增或更新用户信息
**/
@PostMapping(value = "third/pauser/saveuser", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result<SaveUserResultDTO> saveUser(@RequestBody WxMpUser wxMpUser);
/**
* @param phone
* @return
* @Author sun
* @Description 根据手机号查询公众号用户基本信息校验用户是否存在
**/
@PostMapping(value = "third/pauser/checkpauser/{phone}")
Result<CustomerUserResultDTO> checkPaUser(@PathVariable("phone") String phone);
/**
* @param visited
* @return
* @Author sun
* @Description 用户登陆新增访问记录数据
**/
@PostMapping(value = "third/pauservisited/saveuservisited")
Result saveUserVisited(@RequestBody SaveUserVisitedFormDTO visited);
/**
* @param customerId
* @return
* @Author sun
* @Description 根据客户Id查询各项注册信息
**/
@PostMapping(value = "third/pacustomer/getcustomeragencyuser/{customerId}")
Result<InitCustomerResultDTO> getCustomerAgencyUser(@PathVariable("customerId") String customerId);
/**
* @param customerId
* @return
* @Author sun
* @Description 修改客户数据状态为已完成初始化
**/
@PostMapping(value = "third/pacustomer/updatecustomer/{customerId}")
Result updateCustomer(@PathVariable("customerId") String customerId);
/**
* @Description 获取component_access_token的定时任务 10min/
* @param
* @author zxc
*/
@PostMapping(value = "third/wechatthird/componentaccesstoken")
Result getComponentAccessTokenJob();
/**
* @Description 获取/刷新接口调用令牌 10min/
* @param
* @author zxc
*/
@PostMapping(value = "third/wechatthird/refreshtoken")
Result refreshAuthorizerAccessTokenJob();
/**
* @param formDTO
* @return
* @Author sun
* @Description 校验appId是否有效以及是否授权,校验通过的调用微信API获取用户基本信息
**/
@PostMapping(value = "third/customermp/resiandworklogin")
Result<UserWechatDTO> resiAndWorkLogin(@RequestBody WxLoginFormDTO formDTO);
/**
* @param appId
* @return
* @Author sun
* @Description 根据appId查询公众号注册的客户信息
**/
@PostMapping(value = "third/customermp/getcustomermsg/{appId}")
Result<PublicCustomerResultDTO> getCustomerMsg(@PathVariable("appId") String appId);
/**
* @param formDTO
* @return
* @Author sun
* @Description 用户登陆新增访问记录数据
**/
@PostMapping(value = "third/pacustomer/register")
Result<RegisterResultDTO> register(@RequestBody RegisterFormDTO formDTO);
}

71
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/EpmetThirdFeignClientFallback.java

@ -1,71 +0,0 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.UserWechatDTO;
import com.epmet.dto.form.RegisterFormDTO;
import com.epmet.dto.form.SaveUserVisitedFormDTO;
import com.epmet.dto.form.WxLoginFormDTO;
import com.epmet.dto.result.*;
import com.epmet.feign.EpmetThirdFeignClient;
import me.chanjar.weixin.mp.bean.result.WxMpUser;
import org.springframework.stereotype.Component;
/**
* @Author zxc
* @CreateTime 2020/7/5 14:46
*/
@Component
public class EpmetThirdFeignClientFallback implements EpmetThirdFeignClient {
@Override
public Result<SaveUserResultDTO> saveUser(WxMpUser wxMpUser) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "saveUser", wxMpUser);
}
@Override
public Result<CustomerUserResultDTO> checkPaUser(String phone) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "checkPaUser", phone);
}
@Override
public Result saveUserVisited(SaveUserVisitedFormDTO visited) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "saveUserVisited", visited);
}
@Override
public Result<InitCustomerResultDTO> getCustomerAgencyUser(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "getCustomerAgencyUser", customerId);
}
@Override
public Result updateCustomer(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "updateCustomer", customerId);
}
@Override
public Result getComponentAccessTokenJob() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "getComponentAccessTokenJob");
}
@Override
public Result refreshAuthorizerAccessTokenJob() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "refreshAuthorizerAccessTokenJob");
}
@Override
public Result<UserWechatDTO> resiAndWorkLogin(WxLoginFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "resiAndWorkLogin", formDTO);
}
@Override
public Result<PublicCustomerResultDTO> getCustomerMsg(String appId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "getCustomerMsg", appId);
}
@Override
public Result<RegisterResultDTO> register(RegisterFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "register", formDTO);
}
}

2
epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-third-server:
container_name: epmet-third-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.80
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.81
ports:
- "8110:8110"
network_mode: host # 使用现有网络

2
epmet-module/epmet-third/epmet-third-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.0.80</version>
<version>0.0.81</version>
<parent>
<groupId>com.epmet</groupId>

7
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java

@ -37,7 +37,10 @@ import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerEntity;
import com.epmet.feign.*;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.GovOrgFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.OperCustomizeFeignClient;
import com.epmet.redis.CustomerRedis;
import com.epmet.service.CustomerService;
import com.github.pagehelper.PageHelper;
@ -71,8 +74,6 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn
@Autowired
private OperCustomizeFeignClient operCustomizeFeignClient;
@Autowired
private EpmetThirdFeignClient epmetThirdFeignClient;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Override

3
epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java

@ -26,7 +26,6 @@ import com.epmet.dto.result.HomeDesignByCustomerResultDTO;
import com.epmet.dto.result.PublicCustomerGridForStrangerResultDTO;
import com.epmet.dto.result.PublicCustomerResultDTO;
import com.epmet.entity.StrangerAccessRecordEntity;
import com.epmet.feign.EpmetThirdFeignClient;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.GovOrgFeignClient;
import com.epmet.feign.OperCustomizeFeignClient;
@ -59,8 +58,6 @@ public class StrangerAccessRecordServiceImpl extends BaseServiceImpl<StrangerAcc
private EpmetUserFeignClient epmetUserFeignClient;
@Autowired
private OperCustomizeFeignClient operCustomizeFeignClient;
@Autowired
private EpmetThirdFeignClient epmetThirdFeignClient;
/**
* 查询陌生人访问记录

2
epmet-user/epmet-user-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-user-server:
container_name: epmet-user-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.94
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.97
ports:
- "8087:8087"
network_mode: host # 不会创建新的网络

2
epmet-user/epmet-user-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-user-server:
container_name: epmet-user-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-user-server:0.3.86
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-user-server:0.3.97
ports:
- "8087:8087"
network_mode: host # 不会创建新的网络

2
epmet-user/epmet-user-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.94</version>
<version>0.3.97</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-user</artifactId>

5
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java

@ -29,7 +29,6 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.SmsTemplateConstant;
import com.epmet.constant.UserConstant;
import com.epmet.constant.UserRoleConstant;
import com.epmet.dao.UserCustomerDao;
import com.epmet.dao.UserResiInfoDao;
@ -258,12 +257,12 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
saveUserResiInfo(userResiInfoDTO);
//居民注册关系表新增数据 首次注册数加一 注册数加一 参与数加一
registerRelationService.saveRegisterRelation(userResiInfoDTO);
//将用户于居民角色关联
/* //将用户于居民角色关联 saveUserResiInfo已包含
UserRoleDTO userRole = new UserRoleDTO();
userRole.setUserId(userResiInfoDTO.getUserId());
userRole.setRoleKey(UserConstant.ROLE_RESI);
userRole.setApp(userResiInfoDTO.getApp());
userRoleService.saveUserRole(userRole);
userRoleService.saveUserRole(userRole);*/
//更新该用户在该客户下的注册状态
userCustomerDao.updateRegistered(userResiInfoDTO.getCustomerId(), userResiInfoDTO.getUserId());
}

2
epmet-user/epmet-user-server/src/main/resources/mapper/UserCustomerDao.xml

@ -4,7 +4,7 @@
<mapper namespace="com.epmet.dao.UserCustomerDao">
<update id="updateRegistered">
update set IS_REGISTER = 1 where CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} and USER_ID = #{userId,jdbcType=VARCHAR}
update user_customer set IS_REGISTER = 1 where CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} and USER_ID = #{userId,jdbcType=VARCHAR}
</update>
</mapper>
Loading…
Cancel
Save