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
2fcc9bae02
  1. 28
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java
  2. 2
      epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-test.yml
  3. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActInfoServiceImpl.java
  4. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java
  5. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
  6. 2
      epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-test.yml
  7. 1
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CodeCommonFormDTO.java
  8. 6
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CodeVersionInfoResultDTO.java
  9. 2
      epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml
  10. 2
      epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml
  11. 2
      epmet-module/epmet-third/epmet-third-server/pom.xml
  12. 1
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ModuleConstant.java
  13. 12
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeController.java
  14. 5
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeCustomerDao.java
  15. 22
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeCustomerService.java
  16. 36
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeService.java
  17. 15
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeCustomerServiceImpl.java
  18. 189
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java
  19. 45
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/WarrantServiceImpl.java
  20. 9
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaCodeService.java
  21. 18
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java
  22. 15
      epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeCustomerDao.xml
  23. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  24. 2
      epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml
  25. 2
      epmet-module/gov-project/gov-project-server/pom.xml
  26. 2
      epmet-module/resi-group/resi-group-server/deploy/docker-compose-test.yml
  27. 2
      epmet-user/epmet-user-server/deploy/docker-compose-test.yml

28
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java

@ -240,6 +240,34 @@ public class HttpClientManager {
return new Result<String>().error();
}
/**
* @Desc 发送钉钉消息 content需为 OapiRobotSendRequest 设定msgType格式根据相应的格式填写 标题 内容
* @param content OapiRobotSendRequest转换为String
* @param url webhook地址
* @param secret 加签串
* @author zxc
*/
public Result<String> sendDingMsg(String content,String url,String secret) {
Long timestamp = System.currentTimeMillis();
try {
String stringToSign = timestamp + "\n" + secret;
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(new SecretKeySpec(secret.getBytes("UTF-8"), "HmacSHA256"));
byte[] signData = mac.doFinal(stringToSign.getBytes("UTF-8"));
String sign = URLEncoder.encode(new String(Base64.encodeBase64(signData)), "UTF-8");
log.info("sign为:"+sign);
url = url.concat("&timestamp=" + timestamp + "&sign=" + sign);
log.info("发送url:"+url);
Result<String> stringResult = HttpClientManager.getInstance().sendPostByJSON(url, content);
log.info("robot发送消息结果为:"+stringResult.getData());
return stringResult;
} catch (Exception e) {
e.printStackTrace();
}
return new Result<String>().error();
}
/**
* desc: 发送get请求
* param:url, params

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

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-heart-server:
container_name: epmet-heart-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-heart-server:0.0.45
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-heart-server:0.0.46
ports:
- "8111:8111"
network_mode: host # 使用现有网络

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActInfoServiceImpl.java

@ -39,6 +39,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -105,6 +106,10 @@ public class LatestActInfoServiceImpl extends BaseServiceImpl<LatestActInfoDao,
}
dto.setId(null);
LatestActInfoEntity entity = ConvertUtils.sourceToTarget(dto, LatestActInfoEntity.class);
Date nowDate=new Date();
entity.setSignUpStartTime(nowDate);
entity.setCreatedTime(nowDate);
entity.setUpdatedTime(nowDate);
insert(entity);
logger.info("insert latest_act_info success");
return entity.getId();

4
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java

@ -176,10 +176,10 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
latestActInfoDTO.setTitle(formDTO.getTitle());
//活动封面
latestActInfoDTO.setCoverPic(formDTO.getCoverPic());
//报名开始时间latestActInfoDTO.setSignUpStartTime(new Date());
//报名截止时间
//报名开始时间暂不赋值,放在插入的时候赋值
if(StringUtils.isNotBlank(formDTO.getSignUpEndTime())){
Date signUpEndTime= DateUtils.minStrToSecondDate(formDTO.getSignUpEndTime());
//报名截止时间
latestActInfoDTO.setSignUpEndTime(signUpEndTime);
}
//招募要求

3
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java

@ -1232,9 +1232,6 @@ public class WorkActServiceImpl implements WorkActService {
this.deleteDraft();
publishActResultDTO.setActId(rePublishFormDTO.getActId());
//发送消息通知-暂时不做了,前端默认串的是不通知
/*if(rePublishFormDTO.getNoticePassedPeople()){
this.noticePassedPeople(originalActInfo,newActInfoEntity);
}*/
//如果用户在重新发布之前点击了预览,需要去更新草稿表里的act_info_id,记录草稿和活动的关系
if(StringUtils.isNotBlank(rePublishFormDTO.getActDraftId())){
latestActInfoDao.updateActInfoId(rePublishFormDTO.getActDraftId(),newActInfoEntity.getId());

2
epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-point-server:
container_name: epmet-point-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-point-server:0.0.34
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-point-server:0.0.37
ports:
- "8112:8112"
network_mode: host # 使用现有网络

1
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CodeCommonFormDTO.java

@ -20,6 +20,7 @@ public class CodeCommonFormDTO implements Serializable {
* 代码ID
*/
private String codeId;
private String grayPercentage;
private String path;
private Integer page = 1;
private Integer limit = 999;

6
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CodeVersionInfoResultDTO.java

@ -10,7 +10,6 @@ import java.io.Serializable;
* @dscription
* @date 2020/8/7 14:00
*/
@NoArgsConstructor
@Data
public class CodeVersionInfoResultDTO implements Serializable {
@ -28,7 +27,6 @@ public class CodeVersionInfoResultDTO implements Serializable {
*/
private ReleaseBean release;
@NoArgsConstructor
@Data
public static class CommitBean {
private String codeId;
@ -50,7 +48,6 @@ public class CodeVersionInfoResultDTO implements Serializable {
private String modelId;
}
@NoArgsConstructor
@Data
public static class AuditBean {
private String codeId;
@ -76,7 +73,6 @@ public class CodeVersionInfoResultDTO implements Serializable {
private String status;
}
@NoArgsConstructor
@Data
public static class ReleaseBean {
private String codeId;
@ -107,6 +103,6 @@ public class CodeVersionInfoResultDTO implements Serializable {
/**
*
*/
private int grayPercentage;
private Integer grayPercentage;
}
}

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.117
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.119
ports:
- "8110:8110"
network_mode: host # 使用现有网络

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

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-third-server:
container_name: epmet-third-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-third-server:0.0.108
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-third-server:0.0.117
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.117</version>
<version>0.0.119</version>
<parent>
<groupId>com.epmet</groupId>

1
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ModuleConstant.java

@ -94,6 +94,7 @@ public interface ModuleConstant {
String WE_APP_AUDIT = "weapp_audit";
String TO_USER_NAME = "ToUserName";
String FROM_USER_NAME = "FromUserName";
String RESI = "resi";
/**
* 微信模推送给第三方平台方 Content固定格式

12
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeController.java

@ -214,5 +214,17 @@ public class CodeController {
return new Result<PageData>().ok(pageData);
}
@PostMapping("version")
public Result<CodeVersionInfoResultDTO> version(@RequestBody CustomerClientFormDTO formDTO) {
CodeVersionInfoResultDTO result = codeService.version(formDTO);
return new Result<CodeVersionInfoResultDTO>().ok(result);
}
@PostMapping("speedupaudit")
public Result speedUpAudit(@RequestBody CodeCommonFormDTO formDTO) {
codeService.speedUpAudit(formDTO);
return new Result<>();
}
}

5
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeCustomerDao.java

@ -73,6 +73,8 @@ public interface CodeCustomerDao extends BaseDao<CodeCustomerEntity> {
*/
void deleteCode(@Param("customerId") String customerId, @Param("clientType") String clientType);
void deleteCommitCode(@Param("customerId") String customerId, @Param("clientType") String clientType);
/**
* 获取审核中代码列表
*
@ -92,7 +94,8 @@ public interface CodeCustomerDao extends BaseDao<CodeCustomerEntity> {
* @author zhaoqifeng
* @date 2020/7/31 15:54
*/
CodeCustomerDTO selectUploadCodeByCustomer(@Param("customerId") String customerId, @Param("clientType") String clientType);
CodeCustomerDTO selectUploadCodeByCustomer(@Param("codeId") String codeId, @Param("customerId") String customerId,
@Param("clientType") String clientType);
/**

22
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeCustomerService.java

@ -120,7 +120,7 @@ public interface CodeCustomerService extends BaseService<CodeCustomerEntity> {
* @param clientType
* @return com.epmet.dto.CodeCustomerDTO
*/
CodeCustomerDTO getUploadCodeByCustomer(String customerId, String clientType);
CodeCustomerDTO getUploadCodeByCustomer(String codeId, String customerId, String clientType);
/**
* 删除旧代码记录
@ -132,6 +132,16 @@ public interface CodeCustomerService extends BaseService<CodeCustomerEntity> {
*/
void deleteCode(String customerId, String clientType);
/**
* 删除旧上传记录
* @author zhaoqifeng
* @date 2020/8/10 11:09
* @param customerId
* @param clientType
* @return void
*/
void deleteCommitCode(String customerId, String clientType);
/**
* 开发版
* @author zhaoqifeng
@ -161,4 +171,14 @@ public interface CodeCustomerService extends BaseService<CodeCustomerEntity> {
* @return com.epmet.dto.CodeCustomerDTO
*/
CodeCustomerDTO getReleaseInfo(String customerId, String clientType);
/**
* 版本回退
* @author zhaoqifeng
* @date 2020/8/10 15:50
* @param customerId
* @param clientType
* @return void
*/
void revertCodeRelease(String customerId, String clientType);
}

36
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeService.java

@ -163,4 +163,40 @@ public interface CodeService {
*/
PageData getCustomerList(UploadListFormDTO formDTO);
/**
* 加急审核
* @author zhaoqifeng
* @date 2020/8/10 14:57
* @param formDTO
* @return void
*/
void speedUpAudit(CodeCommonFormDTO formDTO);
/**
* 分阶段发布
* @author zhaoqifeng
* @date 2020/8/10 15:29
* @param formDTO
* @return void
*/
void grayRelease(CodeCommonFormDTO formDTO);
/**
* 取消分阶段发布
* @author zhaoqifeng
* @date 2020/8/10 15:29
* @param formDTO
* @return void
*/
void revertGrayRelease(CodeCommonFormDTO formDTO);
/**
* 版本退回
* @author zhaoqifeng
* @date 2020/8/10 15:31
* @param formDTO
* @return void
*/
void revertCodeRelease(CodeCommonFormDTO formDTO);
}

15
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeCustomerServiceImpl.java

@ -120,8 +120,8 @@ public class CodeCustomerServiceImpl extends BaseServiceImpl<CodeCustomerDao, Co
}
@Override
public CodeCustomerDTO getUploadCodeByCustomer(String customerId, String clientType) {
return baseDao.selectUploadCodeByCustomer(customerId, clientType);
public CodeCustomerDTO getUploadCodeByCustomer(String codeId, String customerId, String clientType) {
return baseDao.selectUploadCodeByCustomer(codeId, customerId, clientType);
}
@Override
@ -129,6 +129,11 @@ public class CodeCustomerServiceImpl extends BaseServiceImpl<CodeCustomerDao, Co
baseDao.deleteCode(customerId, clientType);
}
@Override
public void deleteCommitCode(String customerId, String clientType) {
baseDao.deleteCommitCode(customerId, clientType);
}
@Override
public CodeCustomerDTO getCommitInfo(String customerId, String clientType) {
return baseDao.selectCommitInfo(customerId, clientType);
@ -144,5 +149,11 @@ public class CodeCustomerServiceImpl extends BaseServiceImpl<CodeCustomerDao, Co
return baseDao.selectReleaseInfo(customerId, clientType);
}
@Override
public void revertCodeRelease(String customerId, String clientType) {
CodeCustomerDTO dto = baseDao.selectLastVersion(customerId, clientType);
baseDao.updateVersion(dto.getId());
}
}

189
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java

@ -31,10 +31,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -149,7 +146,8 @@ public class CodeServiceImpl implements CodeService {
CustomerDTO customerDTO = new CustomerDTO();
customerDTO.setId(formDTO.getCustomerId());
PaCustomerDTO paCustomerDTO = paCustomerService.get(formDTO.getCustomerId());
//删除旧的开发版本
codeCustomerService.deleteCommitCode(formDTO.getCustomerId(),formDTO.getClientType());
//将上传信息存入表中
CodeCustomerDTO codeCustomerDTO = ConvertUtils.sourceToTarget(formDTO, CodeCustomerDTO.class);
codeCustomerDTO.setCustomerName(paCustomerDTO.getCustomerName());
@ -157,6 +155,7 @@ public class CodeServiceImpl implements CodeService {
codeCustomerDTO.setExtJson(extJson);
codeCustomerDTO.setAppId(authInfo.getAuthorizerAppid());
codeCustomerDTO.setStatus(CodeConstant.UNAUDITED);
codeCustomerDTO.setCommitTime(new Date());
String codeId = codeCustomerService.save(codeCustomerDTO);
saveOperation(formDTO.getCustomerId(), formDTO.getClientType(), codeId, formDTO.getUserVersion(), CodeConstant.OPER_UPLOAD, "上传成功");
@ -172,63 +171,76 @@ public class CodeServiceImpl implements CodeService {
CodeVersionInfoResultDTO resultDTO = new CodeVersionInfoResultDTO();
//开发版本
CodeCustomerDTO commit = codeCustomerService.getCommitInfo(formDTO.getCustomerId(), formDTO.getClientType());
resultDTO.getCommit().setCodeId(commit.getId());
resultDTO.getCommit().setCodeInfo(commit.getUserDesc());
resultDTO.getCommit().setModelId(commit.getTemplateId());
resultDTO.getCommit().setVersion(commit.getUserVersion());
resultDTO.getCommit().setCommitTime(DateUtils.format(commit.getCommitTime(), DateUtils.DATE_TIME_PATTERN));
if (null != commit) {
CodeVersionInfoResultDTO.CommitBean commitBean = new CodeVersionInfoResultDTO.CommitBean();
commitBean.setCodeId(commit.getId());
commitBean.setCodeInfo(commit.getUserDesc());
commitBean.setModelId(commit.getTemplateId());
commitBean.setVersion(commit.getUserVersion());
commitBean.setCommitTime(DateUtils.format(commit.getCommitTime(), DateUtils.DATE_TIME_PATTERN));
resultDTO.setCommit(commitBean);
}
//审核版本
CodeCustomerDTO audit = codeCustomerService.getAuditInfo(formDTO.getCustomerId(), formDTO.getClientType());
resultDTO.getAudit().setCodeId(audit.getId());
resultDTO.getAudit().setVersion(audit.getUserVersion());
resultDTO.getAudit().setCodeInfo(audit.getUserDesc());
if (CodeConstant.AUDITING.equals(audit.getStatus())) {
//获取小程序调用令牌
AuthorizationInfoDTO authInfo = authorizationInfoDao.getAuthInfoByCustomer(formDTO.getCustomerId(), formDTO.getClientType());
//获取审核结果信息
CodeAuditResultDTO auditResult = codeAuditResultService.getAuditResultByCodeId(audit.getId());
//调用微信API获取最新审核状态
WxMaCodeAuditStatusReq request = new WxMaCodeAuditStatusReq();
request.setAuditId(auditResult.getAuditId());
WxResult<WxMaAuditStatusResult> wxAuditResult = wxMaCodeService.getAuditStatus(authInfo.getAuthorizerAccessToken(), request);
if (wxAuditResult.success()) {
WxMaAuditStatusResult result = wxAuditResult.getData();
if (result.getStatus() == NumConstant.ZERO) {
audit.setStatus(CodeConstant.AUDIT_SUCCESS);
auditResult.setResult(CodeConstant.AUDIT_SUCCESS);
saveOperation(formDTO.getCustomerId(), formDTO.getClientType(), audit.getId(), audit.getUserVersion(), CodeConstant.OPER_SUCCESS
, "审核成功");
} else if (result.getStatus() == NumConstant.ONE) {
audit.setStatus(CodeConstant.AUDIT_FAILED);
auditResult.setResult(CodeConstant.AUDIT_FAILED);
auditResult.setReason(result.getReason());
auditResult.setScreenShot(result.getScreenshot());
saveOperation(formDTO.getCustomerId(), formDTO.getClientType(), audit.getId(), audit.getUserVersion(), CodeConstant.OPER_FAILED,
result.getReason());
} else if (result.getStatus() == NumConstant.FOUR) {
audit.setStatus(CodeConstant.DELAY);
auditResult.setResult(CodeConstant.DELAY);
auditResult.setReason(result.getReason());
saveOperation(formDTO.getCustomerId(), formDTO.getClientType(), audit.getId(), audit.getUserVersion(), CodeConstant.OPER_DELAY,
result.getReason());
if(null != audit) {
CodeVersionInfoResultDTO.AuditBean auditBean = new CodeVersionInfoResultDTO.AuditBean();
auditBean.setCodeId(audit.getId());
auditBean.setVersion(audit.getUserVersion());
auditBean.setCodeInfo(audit.getUserDesc());
if (CodeConstant.AUDITING.equals(audit.getStatus())) {
//获取小程序调用令牌
AuthorizationInfoDTO authInfo = authorizationInfoDao.getAuthInfoByCustomer(formDTO.getCustomerId(), formDTO.getClientType());
//获取审核结果信息
CodeAuditResultDTO auditResult = codeAuditResultService.getAuditResultByCodeId(audit.getId());
//调用微信API获取最新审核状态
WxMaCodeAuditStatusReq request = new WxMaCodeAuditStatusReq();
request.setAuditId(auditResult.getAuditId());
WxResult<WxMaAuditStatusResult> wxAuditResult = wxMaCodeService.getAuditStatus(authInfo.getAuthorizerAccessToken(), request);
if (wxAuditResult.success()) {
WxMaAuditStatusResult result = wxAuditResult.getData();
if (result.getStatus() == NumConstant.ZERO) {
audit.setStatus(CodeConstant.AUDIT_SUCCESS);
auditResult.setResult(CodeConstant.AUDIT_SUCCESS);
saveOperation(formDTO.getCustomerId(), formDTO.getClientType(), audit.getId(), audit.getUserVersion(), CodeConstant.OPER_SUCCESS
, "审核成功");
} else if (result.getStatus() == NumConstant.ONE) {
audit.setStatus(CodeConstant.AUDIT_FAILED);
auditResult.setResult(CodeConstant.AUDIT_FAILED);
auditResult.setReason(result.getReason());
auditResult.setScreenShot(result.getScreenshot());
saveOperation(formDTO.getCustomerId(), formDTO.getClientType(), audit.getId(), audit.getUserVersion(), CodeConstant.OPER_FAILED,
result.getReason());
} else if (result.getStatus() == NumConstant.FOUR) {
audit.setStatus(CodeConstant.DELAY);
auditResult.setResult(CodeConstant.DELAY);
auditResult.setReason(result.getReason());
saveOperation(formDTO.getCustomerId(), formDTO.getClientType(), audit.getId(), audit.getUserVersion(), CodeConstant.OPER_DELAY,
result.getReason());
}
codeCustomerService.update(audit);
codeAuditResultService.update(auditResult);
}
codeCustomerService.update(audit);
codeAuditResultService.update(auditResult);
}
auditBean.setStatus(audit.getStatus());
auditBean.setCommitTime(DateUtils.format(audit.getCommitTime(), DateUtils.DATE_TIME_PATTERN));
auditBean.setAuditTime(DateUtils.format(audit.getAuditTime(), DateUtils.DATE_TIME_PATTERN));
resultDTO.setAudit(auditBean);
}
resultDTO.getAudit().setStatus(audit.getStatus());
resultDTO.getAudit().setCommitTime(DateUtils.format(audit.getCommitTime(), DateUtils.DATE_TIME_PATTERN));
resultDTO.getAudit().setAuditTime(DateUtils.format(audit.getAuditTime(), DateUtils.DATE_TIME_PATTERN));
//线上版本
CodeCustomerDTO release = codeCustomerService.getReleaseInfo(formDTO.getCustomerId(), formDTO.getClientType());
resultDTO.getRelease().setCodeId(release.getId());
resultDTO.getRelease().setCodeInfo(release.getUserDesc());
resultDTO.getRelease().setCommitTime(DateUtils.format(release.getCommitTime(), DateUtils.DATE_TIME_PATTERN));
resultDTO.getRelease().setAuditTime(DateUtils.format(release.getAuditTime(), DateUtils.DATE_TIME_PATTERN));
resultDTO.getRelease().setReleaseTime(DateUtils.format(release.getReleaseTime(), DateUtils.DATE_TIME_PATTERN));
resultDTO.getRelease().setReleaseType(release.getReleaseType());
resultDTO.getRelease().setGrayPercentage(release.getGaryPercentage());
resultDTO.getRelease().setVersion(release.getUserVersion());
if(null != release) {
CodeVersionInfoResultDTO.ReleaseBean releaseBean = new CodeVersionInfoResultDTO.ReleaseBean();
releaseBean.setCodeId(release.getId());
releaseBean.setCodeInfo(release.getUserDesc());
releaseBean.setCommitTime(DateUtils.format(release.getCommitTime(), DateUtils.DATE_TIME_PATTERN));
releaseBean.setAuditTime(DateUtils.format(release.getAuditTime(), DateUtils.DATE_TIME_PATTERN));
releaseBean.setReleaseTime(DateUtils.format(release.getReleaseTime(), DateUtils.DATE_TIME_PATTERN));
releaseBean.setReleaseType(release.getReleaseType());
releaseBean.setGrayPercentage(release.getGaryPercentage());
releaseBean.setVersion(release.getUserVersion());
resultDTO.setRelease(releaseBean);
}
return resultDTO;
}
@ -245,7 +257,16 @@ public class CodeServiceImpl implements CodeService {
if (null == authInfo) {
throw new RenException("未授权");
}
//获取上传代码信息
CodeCustomerDTO uploadCode = codeCustomerService.getUploadCodeByCustomer(formDTO.getCodeId(), codeCustomerDTO.getCustomerId(),
codeCustomerDTO.getClientType());
if (null != uploadCode) {
if (CodeConstant.AUDITING.equals(uploadCode.getStatus())) {
throw new RenException("已经有正在审核的版本");
} else {
codeCustomerService.deleteById(uploadCode.getId());
}
}
//调用微信API上提交审核
WxMaCodeSubmitAuditRequest request = new WxMaCodeSubmitAuditRequest();
request.setVersionDesc(formDTO.getVersionDesc());
@ -292,6 +313,7 @@ public class CodeServiceImpl implements CodeService {
}
//更新代码表状态
codeCustomerDTO.setStatus(CodeConstant.AUDITING);
codeCustomerDTO.setAuditTime(new Date());
codeCustomerService.update(codeCustomerDTO);
saveOperation(codeCustomerDTO.getCustomerId(), codeCustomerDTO.getClientType(), codeCustomerDTO.getId(), codeCustomerDTO.getUserVersion(),
CodeConstant.OPER_SUBMIT, "审核中");
@ -370,6 +392,9 @@ public class CodeServiceImpl implements CodeService {
//更新代码表状态
codeCustomerDTO.setStatus(CodeConstant.RELEASE_SUCCESS);
codeCustomerDTO.setReleaseTime(new Date());
codeCustomerDTO.setReleaseType("total");
codeCustomerDTO.setGaryPercentage(NumConstant.ZERO);
codeCustomerService.update(codeCustomerDTO);
saveOperation(codeCustomerDTO.getCustomerId(), codeCustomerDTO.getClientType(), codeCustomerDTO.getId(), codeCustomerDTO.getUserVersion(),
CodeConstant.OPER_RELEASE, "发布成功");
@ -467,7 +492,6 @@ public class CodeServiceImpl implements CodeService {
public PageData history(CodeCommonFormDTO formDTO) {
PageHelper.startPage(formDTO.getPage(), formDTO.getLimit());
//获取上传代码信息
// CodeCustomerDTO codeCustomerDTO = codeCustomerService.get(formDTO.getCodeId());
List<CodeHistoryResultDTO> list = codeOperationHistoryService.getHistoryList(formDTO.getCodeId());
PageInfo<CodeHistoryResultDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
@ -553,6 +577,57 @@ public class CodeServiceImpl implements CodeService {
return paCustomerService.getCustomerList(formDTO);
}
@Override
public void speedUpAudit(CodeCommonFormDTO formDTO) {
//获取上传代码信息
CodeCustomerDTO codeCustomerDTO = codeCustomerService.get(formDTO.getCodeId());
//获取小程序调用令牌
AuthorizationInfoDTO authInfo = authorizationInfoDao.getAuthInfoByCustomer(codeCustomerDTO.getCustomerId(), codeCustomerDTO.getClientType());
if (null == authInfo) {
throw new RenException("未授权");
}
//获取审核结果信息
CodeAuditResultDTO codeAuditResultDTO = codeAuditResultService.getAuditResultByCodeId(formDTO.getCodeId());
//调用微信API 加急审核
WxMaSpeedUpAuditReq speedRequest = new WxMaSpeedUpAuditReq();
speedRequest.setAuditId(codeAuditResultDTO.getAuditId());
WxResult wxSpeedResult = wxMaCodeService.speedUpAudit(authInfo.getAuthorizerAccessToken(), speedRequest);
if (!wxSpeedResult.success()) {
saveOperation(codeCustomerDTO.getCustomerId(), codeCustomerDTO.getClientType(), codeCustomerDTO.getId(),
codeCustomerDTO.getUserVersion(), CodeConstant.OPER_SUBMIT, wxSpeedResult.getErrorMsg());
throw new RenException(wxSpeedResult.getErrorCode(), wxSpeedResult.getErrorMsg());
}
}
@Override
public void grayRelease(CodeCommonFormDTO formDTO) {
}
@Override
public void revertGrayRelease(CodeCommonFormDTO formDTO) {
}
@Override
public void revertCodeRelease(CodeCommonFormDTO formDTO) {
//获取上传代码信息
CodeCustomerDTO codeCustomerDTO = codeCustomerService.get(formDTO.getCodeId());
//获取小程序调用令牌
AuthorizationInfoDTO authInfo = authorizationInfoDao.getAuthInfoByCustomer(codeCustomerDTO.getCustomerId(), codeCustomerDTO.getClientType());
if (null == authInfo) {
throw new RenException("未授权");
}
WxResult wxSpeedResult = wxMaCodeService.revertCodeRelease(authInfo.getAuthorizerAccessToken());
if (!wxSpeedResult.success()) {
saveOperation(codeCustomerDTO.getCustomerId(), codeCustomerDTO.getClientType(), codeCustomerDTO.getId(),
codeCustomerDTO.getUserVersion(), CodeConstant.OPER_SUBMIT, wxSpeedResult.getErrorMsg());
throw new RenException(wxSpeedResult.getErrorCode(), wxSpeedResult.getErrorMsg());
}
codeCustomerService.revertCodeRelease(codeCustomerDTO.getCustomerId(), codeCustomerDTO.getClientType());
codeCustomerService.deleteById(codeCustomerDTO.getId());
}
private void saveOperation(String customerId, String clientType, String codeId, String version, String operation, String describe) {
CodeOperationHistoryDTO operationDTO = new CodeOperationHistoryDTO();
operationDTO.setCustomerId(customerId);

45
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/WarrantServiceImpl.java

@ -3,12 +3,8 @@ package com.epmet.service.impl;
import cn.hutool.json.JSONObject;
import com.alibaba.fastjson.JSON;
import com.alibaba.nacos.client.config.utils.IOUtils;
import com.dingtalk.api.DefaultDingTalkClient;
import com.dingtalk.api.DingTalkClient;
import com.dingtalk.api.request.OapiRobotSendRequest;
import com.dingtalk.api.response.OapiRobotSendResponse;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.DingTalkTextMsg;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.HttpClientManager;
@ -28,10 +24,6 @@ import com.epmet.mpaes.WXXmlToMapUtil;
import com.epmet.redis.RedisThird;
import com.epmet.service.WarrantService;
import com.epmet.wxapi.constant.WxMaCodeConstant;
import com.fasterxml.jackson.core.JsonEncoding;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.taobao.api.ApiException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils;
@ -152,7 +144,7 @@ public class WarrantServiceImpl implements WarrantService {
codeAuditRecord.setAuthAppId(authAppId);
codeAuditRecord.setTemplateId(templateId);
String customerName = paCustomerDao.selectCustomerName(customerId);
String client = this.getClient(clientType);
String client = clientType.equals(ModuleConstant.RESI) ? "居民端" : "工作端";
//插入 代码审核 记录
log.info(String.format(ThirdRunTimeInfoConstant.CODE_AUDIT_RESULT, xml));
codeAuditRecordDao.insertCodeAuditRecord(codeAuditRecord);
@ -171,7 +163,7 @@ public class WarrantServiceImpl implements WarrantService {
break;
}
log.info("开始寻找机器人发送消息");
this.dingDingRobot(reason,codeResult,customerName,client);
this.dingDingRobot(reason,event,customerName,client);
log.info("已找到robot,并发送消息......");
String codeCustomerId = codeCustomerDao.selectCodeCustomerId(codeAuditRecord);
codeAuditResultDao.updateAuditResult(customerId, codeCustomerId, codeResult);
@ -201,7 +193,6 @@ public class WarrantServiceImpl implements WarrantService {
PrintWriter pw = response.getWriter();//需在5秒内返回空串表明暂时不回复,然后再立即使用客服消息接口发送消息回复粉丝
pw.write("");
pw.flush();
log.info(String.format(ThirdRunTimeInfoConstant.TEXT_MESSAGE_LOG_INFO,content,content.split(ThirdRedisKeyConstant.COLON)[NumConstant.ONE],fromUserName,toUserName));
//接下来客服API再回复一次消息
String[] split = content.split(ThirdRedisKeyConstant.COLON);
@ -247,39 +238,9 @@ public class WarrantServiceImpl implements WarrantService {
log.info("robot需要发送的内容为:"+markdown.getText());
String url = "https://oapi.dingtalk.com/robot/send?access_token=2438902efbcc15909deb7076963c5cbe2d6fdbfdb9d66750faab2f2cce6eb09f";
String secret = "SECe3c785dd254659608667a4a623acc5a0395636143411617f6e36838b48941e74";
this.sendCodeMsg(request,url,secret);
HttpClientManager.getInstance().sendDingMsg(JSON.toJSONString(request),url,secret);
}
// public static void main(String[] args) {
// WarrantServiceImpl w = new WarrantServiceImpl();
// w.dingDingRobot("审核失败","weapp_audit_fail","机器人测试","居民端");
// }
public Result<String> sendCodeMsg(OapiRobotSendRequest request,String url,String secret) {
Long timestamp = System.currentTimeMillis();
try {
String stringToSign = timestamp + "\n" + secret;
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(new SecretKeySpec(secret.getBytes("UTF-8"), "HmacSHA256"));
byte[] signData = mac.doFinal(stringToSign.getBytes("UTF-8"));
String sign = URLEncoder.encode(new String(Base64.encodeBase64(signData)), "UTF-8");
log.info("sign为:"+sign);
url = url.concat("&timestamp=" + timestamp + "&sign=" + sign);
log.info("发送url:"+url);
String requestString = JSON.toJSONString(request);
log.info("发送内容:"+requestString);
Result<String> stringResult = HttpClientManager.getInstance().sendPostByJSON(url, requestString);
log.info("robot发送消息结果为:"+stringResult.getData());
return stringResult;
} catch (Exception e) {
e.printStackTrace();
}
return new Result<String>().error();
}
public String getClient(String clientType){
String result = clientType == "resi" ? "居民端" : "工作端";
return result;
}
/**
* 方法描述: 类型为event的时候拼接

9
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaCodeService.java

@ -191,4 +191,13 @@ public interface WxMaCodeService {
* @date 2020/8/6 14:07
*/
WxResult<WxBasicInfoResult> getAccountBasicInfo(String accessToken);
/**
* 版本退回
* @author zhaoqifeng
* @date 2020/8/10 15:41
* @param accessToken
* @return com.epmet.wxapi.result.WxResult
*/
WxResult revertCodeRelease(String accessToken);
}

18
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java

@ -293,7 +293,7 @@ public class WxMaCodeServiceImpl implements WxMaCodeService {
public WxResult<WxSupportVersionResult> getWeAppSupportVersion(String accessToken) {
WxResult<WxSupportVersionResult> result = new WxResult<>();
String url = WxMaCodeConstant.GET_SUPPORT_VERSION_URL + "?" + "access_token=" + accessToken;
Result<String> statusResult = HttpClientManager.getInstance().sendPostByJSON(url, null);
Result<String> statusResult = HttpClientManager.getInstance().sendPostByJSON(url, "{}");
if (!statusResult.success()) {
result.setErrorCode(statusResult.getCode());
result.setErrorMsg(statusResult.getMsg());
@ -367,6 +367,22 @@ public class WxMaCodeServiceImpl implements WxMaCodeService {
return result;
}
@Override
public WxResult revertCodeRelease(String accessToken) {
WxResult result = new WxResult();
String url = WxMaCodeConstant.REVERT_CODE_RELEASE_URL + "?" + "access_token=" + accessToken;
Result<String> setVersionResult = HttpClientManager.getInstance().sendPostByJSON(url, null);
if (!setVersionResult.success()) {
result.setErrorCode(setVersionResult.getCode());
result.setErrorMsg(setVersionResult.getMsg());
return result;
}
JSONObject jsonObject = JSONObject.parseObject(setVersionResult.getData());
result.setErrorCode(jsonObject.getInteger(ERR_CODE));
result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(jsonObject.getInteger(ERR_CODE)));
return result;
}
private String toJson(Object object) {
GsonBuilder gsonBuilder = new GsonBuilder();
gsonBuilder.setPrettyPrinting();

15
epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeCustomerDao.xml

@ -21,6 +21,15 @@
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<update id="deleteCommitCode">
UPDATE code_customer
SET
DEL_FLAG = '1'
WHERE CUSTOMER_ID = #{customerId}
AND CLIENT_TYPE = #{clientType}
AND STATUS = 'unaudited'
AND DEL_FLAG = '0'
</update>
<select id="selectCodeList" resultType="com.epmet.dto.result.UploadListResultDTO" parameterType="com.epmet.dto.form.UploadListFormDTO">
SELECT
@ -96,6 +105,9 @@
code_customer
WHERE CUSTOMER_ID = #{customerId}
AND CLIENT_TYPE = #{clientType}
AND ID != #{codeId}
AND STATUS != 'unaudited'
AND STATUS != 'release_success'
AND DEL_FLAG = '0'
</select>
<update id="deleteCode">
@ -116,8 +128,9 @@
FROM code_customer
WHERE CUSTOMER_ID = #{customerId}
AND CLIENT_TYPE = #{clientType}
AND STATUS = 'unaudited'
AND DEL_FLAG = '0'
ORDER BY COMMIT_TIME DESC
LIMIT 1
</select>
<select id="selectAuditInfo" resultType="com.epmet.dto.CodeCustomerDTO">
SELECT ID,

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

@ -581,8 +581,11 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
agencyList.setAgencyName(entity.getOrganizationName());
processorList.setAgencyList(agencyList);
//2:查询当前组织的上两级组织,按层级排序
String pids = entity.getPids();
String[] args = pids.split(":");
String[] args = new String[]{};
if (StringUtils.isNotBlank(entity.getPids())) {
String pids = entity.getPids();
args = pids.split(":");
}
List<String> agencyIdList = new ArrayList<>();
if (args.length < NumConstant.ONE) {
processorList.setParentAgencyList(parentAgencyList);
@ -594,7 +597,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
agencyIdList.add(args[args.length - NumConstant.ONE]);
}
List<CustomerAgencyDTO> parentList = baseDao.selectAgencyListByIds(agencyIdList);
parentList.forEach(parent->{
parentList.forEach(parent -> {
AgencyResultDTO agency = new AgencyResultDTO();
agency.setAgencyId(parent.getId());
agency.setAgencyName(parent.getOrganizationName());
@ -603,7 +606,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
processorList.setParentAgencyList(parentAgencyList);
}
//3:迭代查询当前组织的所有下级组织列表
List<AgencySubResultDTO> subAgencyList = getDepartmentList(entity.getPids() + ":" + entity.getId());
List<AgencySubResultDTO> subAgencyList = getDepartmentList(("".equals(entity.getPids()) ? "" : ":") + entity.getId());
processorList.setSubAgencyList(subAgencyList);
return processorList;

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

@ -2,7 +2,7 @@ version: "3.7"
services:
gov-project-server:
container_name: gov-project-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/gov-project-server:0.3.39
image: 192.168.1.130:10080/epmet-cloud-dev/gov-project-server:0.3.40
ports:
- "8102:8102"
network_mode: host # 使用现有网络

2
epmet-module/gov-project/gov-project-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">
<version>0.3.39</version>
<version>0.3.40</version>
<parent>
<artifactId>gov-project</artifactId>
<groupId>com.epmet</groupId>

2
epmet-module/resi-group/resi-group-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
resi-group-server:
container_name: resi-group-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-group-server:0.3.62
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-group-server:0.3.64
ports:
- "8095:8095"
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.108
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-user-server:0.3.113
ports:
- "8087:8087"
network_mode: host # 不会创建新的网络

Loading…
Cancel
Save