From d6b81d600ab6671e532ed77ed6fb00678e5b864b Mon Sep 17 00:00:00 2001
From: lidongdong <1459917685@qq.com>
Date: 星期五, 18 八月 2023 14:40:01 +0800
Subject: [PATCH] 志愿者活动增加经纬度字段
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComEventServiceImpl.java | 70 +++++++++++++++++++++++++++++------
1 files changed, 58 insertions(+), 12 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComEventServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComEventServiceImpl.java
index 79811b5..61e11f8 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComEventServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComEventServiceImpl.java
@@ -94,10 +94,11 @@
@Override
public R pageByComEvent(ComEvent comEvent, Page pagination,LoginUserInfoVO loginUserInfoVO) {
+ log.info("当前登录信息"+loginUserInfoVO);
Boolean isExpertCheck=false;
Long expertId=null;
Boolean isStretAccount = isStreetAccount(loginUserInfoVO);
-// comEvent.setAppId(loginUserInfoVO.getAppId());
+ comEvent.setAppId(loginUserInfoVO.getAppId());
if (nonNull(comEvent.getUserType())){
if (comEvent.getUserType().equals(1)){
//个人账号权限
@@ -573,6 +574,12 @@
public Integer hasPermission(ComEvent comEvent,LoginUserInfoVO sysUser){
String account="";
Integer perm=1;
+
+ if(comEvent==null || sysUser == null )
+ {
+ return perm;
+ }
+
if (nonNull(sysUser.getAccount())){
account=sysUser.getAccount();
}
@@ -920,15 +927,37 @@
return map;
}
- public String getPhone(ComEvent comEvent){
+ public String getPhone(ComEvent comEvent)
+ {
+ if(comEvent==null)
+ {
+ return "";
+ }
if (isNull(comEvent.getRequestUserCommunity())){
- return comSanShuoIndustryCenterService.getById(comEvent.getCenterId()).getPhone();
- }else {
- String contactsPhone = comActDAO.selectById(comEvent.getRequestUserCommunity()).getContactsPhone();
- if (isNull(contactsPhone)){
- return null;
+ ComSanshuoIndustryCenter sanshuoIndustryCenter=comSanShuoIndustryCenterService.getById(comEvent.getCenterId());
+ if(sanshuoIndustryCenter==null)
+ {
+ return "";
}
- return contactsPhone;
+ else
+ {
+ return sanshuoIndustryCenter.getPhone();
+ }
+
+ }else {
+ ComActDO comActDO=comActDAO.selectById(comEvent.getRequestUserCommunity());
+ if(comActDO!=null)
+ {
+ String contactsPhone = comActDO.getContactsPhone();
+ if (isNull(contactsPhone)){
+ return "";
+ }
+ else
+ {
+ return contactsPhone;
+ }
+ }
+ return "";
}
}
@@ -967,7 +996,7 @@
}
@Override
- public R calculate(LoginUserInfoVO loginUserInfoVO) {
+ public R calculate(LoginUserInfoVO loginUserInfoVO,Integer level,Long id) {
ComEvent comEvent=new ComEvent();
Boolean isExpertCheck=false;
Long expertId=null;
@@ -1020,10 +1049,16 @@
}
log.info("当前userType===="+comEvent.getUserType());
//comEvent.setAppId(loginUserInfoVO.getAppId());
- R<LoginUserInfoVO> r = userService.detailUser(loginUserInfoVO.getUserId());
- LoginUserInfoVO user = r.getData();
+// R<LoginUserInfoVO> r = userService.detailUser(loginUserInfoVO.getUserId());
+// LoginUserInfoVO user = r.getData();
+ LoginUserInfoVO user = loginUserInfoVO;
if (nonNull(user.getAppId())){
comEvent.setAppId(user.getAppId());
+ }
+ if (nonNull(level) && nonNull(id)){
+ comEvent.setLevel(level);
+ comEvent.setSearchId(id);
+ comEvent.setUserType(null);
}
List<ComEventCalculateVO> calculateList = baseMapper.calculate(comEvent);
ComEventCalculateVO comEventCalculateVO =new ComEventCalculateVO();
@@ -1106,6 +1141,7 @@
return R.ok(vo);
}
+
@Override
public R eventIndexData(Integer type) {
//获取事件总数
@@ -1113,9 +1149,19 @@
if (type.equals(1)){
//受理级别占比
List<EventRateVO> eventRateVOS = comEventMapper.eventRate();
+ //获取专家受理的数量
+ Integer expertCount=comEventMapper.expertSolveCountCommunity();
+ //获取行业分中心受理数量
+ Integer centerCount=comEventMapper.expertSolveCountCenter();
for (EventRateVO eventRateVO : eventRateVOS) {
if (nonNull(eventRateVO)){
- eventRateVO.setName(typeToName(eventRateVO.getCurrentProcessType()));
+ eventRateVO.setName(typeToName(eventRateVO.getType()));
+// if (eventRateVO.getCurrentProcessType().equals(2)){
+// eventRateVO.setCount(eventRateVO.getCount()+expertCount);
+// }
+// if (eventRateVO.getCurrentProcessType().equals(1)){
+// eventRateVO.setCount(eventRateVO.getCount()+centerCount);
+// }
if (nonNull(eventCount) && !eventCount.equals(0)){
//计算占比
eventRateVO.setRate(NumberUtil.div(eventRateVO.getCount(),eventCount,2));
--
Gitblit v1.7.1