Browse Source

Merge remote-tracking branch 'origin/dev_bugfix' into dev_bugfix

dev_shibei_match
wangchao 5 years ago
parent
commit
b1c3fe8c79
  1. 19
      epmet-auth/src/main/java/com/epmet/controller/LoginController.java
  2. 35
      epmet-auth/src/main/java/com/epmet/dto/form/ResiWxPhoneFormDTO.java
  3. 9
      epmet-auth/src/main/java/com/epmet/service/LoginService.java
  4. 21
      epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java
  5. 2
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/constant/GroupConstant.java
  6. 2
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/constant/TopicConstant.java
  7. 2
      epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml
  8. 2
      epmet-module/data-report/data-report-server/pom.xml
  9. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java
  10. 1
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java
  11. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java
  12. 2
      epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml
  13. 6
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java
  14. 4
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java
  15. 8
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java

19
epmet-auth/src/main/java/com/epmet/controller/LoginController.java

@ -8,9 +8,11 @@ import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.LoginByPassWordFormDTO;
import com.epmet.dto.form.LoginByWxCodeFormDTO;
import com.epmet.dto.form.ResiWxPhoneFormDTO;
import com.epmet.dto.result.UserTokenResultDTO;
import com.epmet.service.CaptchaService;
import com.epmet.service.LoginService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -96,4 +98,21 @@ public class LoginController {
public Result logout(@LoginUser TokenDto tokenDto, HttpServletRequest request) {
return loginService.logoutByToken(tokenDto);
}
/**
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei
* @description 获取用户微信绑定的手机号
* @Date 2020/7/2 14:33
**/
@PostMapping("getresiwxphone")
public Result getResiWxPhone(@RequestBody ResiWxPhoneFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ResiWxPhoneFormDTO.AddUserInternalGroup.class);
String phone = loginService.getResiWxPhone(formDTO);
if (StringUtils.isNotBlank(phone) && !"null".equals(phone)) {
return new Result().ok(phone);
}
return new Result().ok("");
}
}

35
epmet-auth/src/main/java/com/epmet/dto/form/ResiWxPhoneFormDTO.java

@ -0,0 +1,35 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 描述一下
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/2 14:28
*/
@Data
public class ResiWxPhoneFormDTO implements Serializable {
private static final long serialVersionUID = 4381236451736209332L;
public interface AddUserInternalGroup {}
/**
* 微信code
*/
@NotBlank(message = "wxCode不能为空",groups = {AddUserInternalGroup.class})
private String wxCode;
/**
* 用户信息
*/
@NotBlank(message = "encryptedData不能为空",groups = {AddUserInternalGroup.class})
private String encryptedData;
/**
* 加密算法的初始向量
*/
@NotBlank(message = "iv不能为空",groups = {AddUserInternalGroup.class})
private String iv;
}

9
epmet-auth/src/main/java/com/epmet/service/LoginService.java

@ -5,6 +5,7 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.LoginByPassWordFormDTO;
import com.epmet.dto.form.LoginByWxCodeFormDTO;
import com.epmet.dto.form.ResiWxPhoneFormDTO;
import com.epmet.dto.result.UserTokenResultDTO;
/**
@ -50,4 +51,12 @@ public interface LoginService {
**/
WxMaJscode2SessionResult getWxMaUser(String app, String wxCode);
/**
* @return java.lang.String
* @param formDTO
* @author yinzuomei
* @description 获取用户微信绑定的手机号
* @Date 2020/7/2 14:33
**/
String getResiWxPhone(ResiWxPhoneFormDTO formDTO);
}

21
epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java

@ -1,6 +1,8 @@
package com.epmet.service.impl;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
import cn.binarywang.wx.miniapp.bean.WxMaUserInfo;
import com.epmet.common.token.constant.LoginConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
@ -129,6 +131,25 @@ public class LoginServiceImpl implements LoginService {
return wxMaJscode2SessionResult;
}
@Override
public String getResiWxPhone(ResiWxPhoneFormDTO formDTO) {
String phone="";
try {
WxMaService wxMaService = wxMaServiceUtils.resiWxMaService();
WxMaJscode2SessionResult wxMaJscode2SessionResult = wxMaService.jsCode2SessionInfo(formDTO.getWxCode());
WxMaPhoneNumberInfo phoneNoInfo = wxMaService.getUserService().getPhoneNoInfo(wxMaJscode2SessionResult.getSessionKey(),
formDTO.getEncryptedData(),
formDTO.getIv());
if (null != phoneNoInfo) {
phone= phoneNoInfo.getPurePhoneNumber();
}
} catch (WxErrorException e) {
e.printStackTrace();
log.error(String.format("获取用户微信绑定的手机号接口异常"));
}
return phone;
}
/**
* 根据openId查询用户id
*

2
epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/constant/GroupConstant.java

@ -11,6 +11,6 @@ public interface GroupConstant {
String RAIL = "-";
String NULL_CHAR_STRING = "";
String DOT = ".";
}

2
epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/constant/TopicConstant.java

@ -33,5 +33,5 @@ public interface TopicConstant {
String RAIL = "-";
String NULL_CHAR_STRING = "";
String DOT = ".";
}

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

@ -2,7 +2,7 @@ version: "3.7"
services:
data-report-server:
container_name: data-report-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.20
image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.22
ports:
- "8109:8109"
network_mode: host # 使用现有网络

2
epmet-module/data-report/data-report-server/pom.xml

@ -3,7 +3,7 @@
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">
<version>0.3.20</version>
<version>0.3.22</version>
<artifactId>data-report-server</artifactId>
<parent>

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java

@ -43,7 +43,7 @@ public class GroupServiceImpl implements GroupService {
GroupSummaryInfoResultDTO result = groupDao.summaryInfo(agencyId);
if (null==result){
GroupSummaryInfoResultDTO resultDTO = new GroupSummaryInfoResultDTO();
resultDTO.setDeadline(LocalDate.now().minusDays(NumConstant.ONE).toString().replace(GroupConstant.RAIL,GroupConstant.NULL_CHAR_STRING));
resultDTO.setDeadline(LocalDate.now().minusDays(NumConstant.ONE).toString().replace(GroupConstant.RAIL,GroupConstant.DOT));
return resultDTO;
}
return result;

1
epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java

@ -57,6 +57,7 @@ public class ProjectServiceImpl implements ProjectService {
resultDTO.setPendingRatio(percent.format(pendingRatio.doubleValue()));
resultDTO.setClosedRatio(percent.format(resultDTO.getClosedRatioInt().setScale(4, RoundingMode.HALF_UP).doubleValue()));
} else {
resultDTO = new ProjectSummaryResultDTO();
resultDTO.setAgencyId(agencyId);
Date date = DateUtils.getBeforeDay(new Date());
resultDTO.setDateName(DateUtils.format(date, "yyyy.MM.dd"));

3
epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java

@ -42,10 +42,9 @@ public class TopicServiceImpl implements TopicService {
@Override
public TopicSummaryResultDTO topicSummary(TokenDto tokenDto) {
TopicSummaryResultDTO result = new TopicSummaryResultDTO();
result.setDeadline(LocalDate.now().minusDays(NumConstant.ONE).toString().replace(TopicConstant.RAIL,TopicConstant.NULL_CHAR_STRING));
result.setDeadline(LocalDate.now().minusDays(NumConstant.ONE).toString().replace(TopicConstant.RAIL,TopicConstant.DOT));
String agencyId = this.getLoginUserDetails(tokenDto);
List<TopicStatusResultDTO> topicStatus = topicDao.getTopicStatus(agencyId);
result.setDeadline(LocalDate.now().minusDays(NumConstant.ONE).toString());
if (topicStatus.size() != NumConstant.ZERO){
topicStatus.forEach(topic -> {
if (topic.getTopicStatus().equals(TopicConstant.DISCUSSING)){

2
epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml

@ -10,7 +10,7 @@
group_total_count AS groupTotalCount,
group_member_avg_count AS groupPeopleAvg,
group_median AS groupPeopleMedian,
DATE_FORMAT( date_id, '%Y-%m-%d' ) AS deadline
DATE_FORMAT( date_id, '%Y.%m.%d' ) AS deadline
FROM fact_group_agency_daily
WHERE del_flag = '0'
AND agency_id = #{agencyId}

6
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java

@ -362,6 +362,7 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
@Transactional(rollbackFor = Exception.class)
public void closeIssue(CloseIssueFormDTO formDTO) {
//公开回复内容审核
if (StringUtils.isNotBlank(formDTO.getCloseReason())) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setContent(formDTO.getCloseReason());
@ -374,6 +375,7 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
}
}
}
Date date = new Date();
//1:更新议题详情表数据
@ -504,18 +506,20 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
@Transactional(rollbackFor = Exception.class)
public void shiftProject(ShiftProjectFormDTO formDTO) {
//公开回复内容审核
if (StringUtils.isNotBlank(formDTO.getPublicReply())) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setContent(formDTO.getPublicReply());
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()){
if (!textSyncScanResult.success()) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
}
}
}
//因需要保证议题表中的转项目时间与创建项目时间一致 因此先新增项目数据再更新议题数据
//1:查询议题数据

4
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java

@ -187,18 +187,20 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl<ProjectProcessDao
@Transactional(rollbackFor = Exception.class)
public void transfer(TransferFormDTO formDTO) {
//公开回复内容审核
if (StringUtils.isNotBlank(formDTO.getPublicReply())) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setContent(formDTO.getPublicReply());
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()){
if (!textSyncScanResult.success()) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
}
}
}
//1:更新项目人员关联表数据状态为已处理
ProjectStaffEntity staffEntity = projectStaffDao.selectById(formDTO.getProjectStaffId());

8
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java

@ -300,18 +300,20 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
@Transactional(rollbackFor = Exception.class)
public void closed(ProjectClosedFromDTO fromDTO) {
//公开回复内容审核
if (StringUtils.isNotBlank(fromDTO.getPublicReply())) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setContent(fromDTO.getPublicReply());
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()){
if (!textSyncScanResult.success()) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
}
}
}
//更新项目表状态
ProjectEntity projectEntity = baseDao.selectById(fromDTO.getProjectId());
@ -376,18 +378,20 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
@Transactional(rollbackFor = Exception.class)
public void projectReturn(ReturnFromDTO fromDTO) {
//公开回复内容审核
if (com.alibaba.nacos.client.utils.StringUtils.isNotBlank(fromDTO.getPublicReply())) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setContent(fromDTO.getPublicReply());
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()){
if (!textSyncScanResult.success()) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
}
}
}
ProjectEntity projectEntity = baseDao.selectById(fromDTO.getProjectId());
if (ProjectConstant.CLOSED.equals(projectEntity.getStatus())) {

Loading…
Cancel
Save