Browse Source

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

# Conflicts:
#	epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java
dev_shibei_match
jianjun 5 years ago
parent
commit
54c3bdf1f6
  1. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java
  2. 17
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java
  3. 54
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java

5
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java

@ -34,7 +34,7 @@ public class PublicPartiProfileResultDTO implements Serializable {
/** /**
* 较上月趋势incr上升decr下降 * 较上月趋势incr上升decr下降
* */ */
private String issueCompareLatestTrend = ""; private String issueCompareLatestTrend = "";
/** /**
@ -42,6 +42,9 @@ public class PublicPartiProfileResultDTO implements Serializable {
*/ */
private BigDecimal averageJoin = new BigDecimal(NumConstant.ZERO); private BigDecimal averageJoin = new BigDecimal(NumConstant.ZERO);
/**
* 较上月百分比
*/
private String joinCompareLatestMonth = ""; private String joinCompareLatestMonth = "";
private String joinCompareLatestTrend = ""; private String joinCompareLatestTrend = "";

17
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java

@ -108,18 +108,17 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
UserJoinIndicatorGrowthRateResultDTO latest = screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId); UserJoinIndicatorGrowthRateResultDTO latest = screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId);
//保证获取公众参与概率数据的最大可能性 //保证获取公众参与概率数据的最大可能性
int time = NumConstant.TWELVE; int time = NumConstant.TWELVE;
while(null == latest && time > NumConstant.ONE) while (null == latest && time > NumConstant.ONE) {
{ time--;
time --; monthId = dateUtils.getPreviousMonthIdByDest(null, monthId);
monthId = dateUtils.getPreviousMonthIdByDest(null,monthId);
latest = screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId); latest = screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId);
} }
if(null == latest) return new PublicPartiProfileResultDTO(); if (null == latest) return new PublicPartiProfileResultDTO();
PublicPartiProfileResultDTO result = ConvertUtils.sourceToTarget(latest,PublicPartiProfileResultDTO.class); PublicPartiProfileResultDTO result = ConvertUtils.sourceToTarget(latest, PublicPartiProfileResultDTO.class);
result.setMonthIncr(convertPercentStr(latest.getMonthIncr(),NumConstant.ZERO)); result.setMonthIncr(convertPercentStr(latest.getMonthIncr(), NumConstant.ZERO));
result.setJoinCompareLatestMonth(convertPercentStr(latest.getJoinCompareLatestMonth(),NumConstant.ZERO)); result.setJoinCompareLatestMonth(convertPercentStr(latest.getJoinCompareLatestMonth().abs(), NumConstant.ZERO));
result.setIssueCompareLatestMonth(convertPercentStr(latest.getIssueCompareLatestMonth(),NumConstant.ZERO)); result.setIssueCompareLatestMonth(convertPercentStr(latest.getIssueCompareLatestMonth().abs(), NumConstant.ZERO));
return result; return result;
} }

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

@ -7,8 +7,10 @@ import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils; 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.utils.Result;
import com.epmet.constant.CodeConstant; import com.epmet.constant.CodeConstant;
import com.epmet.constant.ModuleConstant;
import com.epmet.dao.AuthorizationInfoDao; import com.epmet.dao.AuthorizationInfoDao;
import com.epmet.dao.ComponentAccessTokenDao; import com.epmet.dao.ComponentAccessTokenDao;
import com.epmet.dao.MiniInfoDao; import com.epmet.dao.MiniInfoDao;
@ -17,7 +19,9 @@ import com.epmet.dto.form.*;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.feign.OssFeignClient; import com.epmet.feign.OssFeignClient;
import com.epmet.redis.RedisThird;
import com.epmet.service.*; import com.epmet.service.*;
import com.epmet.wxapi.constant.WxMaCodeConstant;
import com.epmet.wxapi.param.*; import com.epmet.wxapi.param.*;
import com.epmet.wxapi.result.*; import com.epmet.wxapi.result.*;
import com.epmet.wxapi.service.WxMaCodeService; import com.epmet.wxapi.service.WxMaCodeService;
@ -27,6 +31,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.mock.web.MockMultipartFile; import org.springframework.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -71,6 +76,11 @@ public class CodeServiceImpl implements CodeService {
private MiniInfoDao miniInfoDao; private MiniInfoDao miniInfoDao;
@Autowired @Autowired
private OperCrmOpenFeignClient operCrmOpenFeignClient; private OperCrmOpenFeignClient operCrmOpenFeignClient;
@Autowired
private RedisThird redisThird;
@Value("${third.platform.appId}")
private String componentAppId;
@Override @Override
public List<TemplateListResultDTO> templateList() { public List<TemplateListResultDTO> templateList() {
@ -117,29 +127,42 @@ public class CodeServiceImpl implements CodeService {
if (null == authInfo) { if (null == authInfo) {
throw new RenException("未授权"); throw new RenException("未授权");
} }
/*CustomerDTO customerFormDTO = new CustomerDTO(); String customerName = "";
customerFormDTO.setId(formDTO.getCustomerId()); Result<List<CustomerDTO>> customerList = operCrmOpenFeignClient.getAllCustomerList();
Result<CustomerDTO> result = operCrmOpenFeignClient.getCustomerInfo(customerFormDTO); if (customerList.success()) {
if (!result.success()) { for (CustomerDTO dto : customerList.getData()) {
throw new RenException(result.getCode(), result.getMsg()); if(formDTO.getCustomerId().equals(dto.getId())) {
}*/ customerName = dto.getCustomerName();
}
}
}
String resiName = "";
String workName = "";
if(CodeConstant.RESI.equals(formDTO.getClientType())) {
resiName = getNickName(authInfo.getAuthorizerAppid());
AuthorizationInfoDTO workAuthInfo = authorizationInfoDao.getAuthInfoByCustomer(formDTO.getCustomerId(), CodeConstant.WORK);
workName = getNickName(workAuthInfo.getAuthorizerAppid());
} else {
workName = getNickName(authInfo.getAuthorizerAppid());
AuthorizationInfoDTO resiAuthInfo = authorizationInfoDao.getAuthInfoByCustomer(formDTO.getCustomerId(), CodeConstant.RESI);
resiName = getNickName(resiAuthInfo.getAuthorizerAppid());
}
//获取小程序居民端与工作端名称 //获取小程序居民端与工作端名称
String resiName = miniInfoDao.getNickName(formDTO.getCustomerId(), CodeConstant.RESI);
String workName = miniInfoDao.getNickName(formDTO.getCustomerId(), CodeConstant.WORK);
String extJson = getExtJson(formDTO); String extJson = getExtJson(formDTO);
WxExtJson wxExtJson = JSONObject.parseObject(extJson, WxExtJson.class); WxExtJson wxExtJson = JSONObject.parseObject(extJson, WxExtJson.class);
wxExtJson.setExtAppid(authInfo.getAuthorizerAppid()); wxExtJson.setExtAppid(authInfo.getAuthorizerAppid());
wxExtJson.getExt().setExtAppid(authInfo.getAuthorizerAppid()); wxExtJson.getExt().setExtAppid(authInfo.getAuthorizerAppid());
wxExtJson.getExt().setResiName(resiName); wxExtJson.getExt().setResiName(resiName);
wxExtJson.getExt().setWorkName(workName); wxExtJson.getExt().setWorkName(workName);
//wxExtJson.getExt().setCustomerName(null == result.getData().getCustomerName()?"":result.getData().getCustomerName()); wxExtJson.getExt().setCustomerName(customerName);
wxExtJson.getExt().setCustomerName("");
if (CodeConstant.RESI.equals(formDTO.getClientType())) { if (CodeConstant.RESI.equals(formDTO.getClientType())) {
wxExtJson.getWindow().setNavigationBarTitleText(resiName); wxExtJson.getWindow().setNavigationBarTitleText(resiName);
} else { } else {
wxExtJson.getWindow().setNavigationBarTitleText(workName); wxExtJson.getWindow().setNavigationBarTitleText(workName);
} }
extJson = JSON.toJSONString(wxExtJson); extJson = JSON.toJSONString(wxExtJson);
log.info(extJson);
CodeExtDTO codeExtDTO = codeExtService.getExtByCustomer(formDTO.getCustomerId(), formDTO.getClientType()); CodeExtDTO codeExtDTO = codeExtService.getExtByCustomer(formDTO.getCustomerId(), formDTO.getClientType());
if (null == codeExtDTO) { if (null == codeExtDTO) {
codeExtDTO = new CodeExtDTO(); codeExtDTO = new CodeExtDTO();
@ -729,4 +752,15 @@ public class CodeServiceImpl implements CodeService {
codeOperationHistoryService.save(operationDTO); codeOperationHistoryService.save(operationDTO);
} }
private String getNickName(String appId) {
JSONObject jsonObject = new JSONObject();
jsonObject.put(ModuleConstant.COMPONENT_APP_ID,componentAppId);
jsonObject.put(ModuleConstant.AUTHORIZER_APP_ID,appId);
String componentAccessToken = componentAccessTokenDao.getComponentAccessToken();
String data = HttpClientManager.getInstance().sendPostByJSON(WxMaCodeConstant.API_GET_AUTHORIZER_INFO + componentAccessToken , JSON.toJSONString(jsonObject)).getData();
Map map = JSON.parseObject(data, Map.class);
Map authInfo = (Map) map.get(ModuleConstant.AUTHORIZER_INFO);
return ConvertUtils.mapToEntity(authInfo, MiniInfoFormDTO.class).getNick_name();
}
} }

Loading…
Cancel
Save