From ad2201f809f45cbbe2e63a829e4c93a9c7b7f67c Mon Sep 17 00:00:00 2001
From: yanghui <2536613402@qq.com>
Date: 星期五, 11 十一月 2022 10:00:19 +0800
Subject: [PATCH] #feat 修改
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComEventServiceImpl.java | 78 ++++++++++++++++++++++++++++----------
1 files changed, 57 insertions(+), 21 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 0508a2e..d6b9b4d 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
@@ -41,6 +41,7 @@
import org.springframework.web.bind.annotation.RequestParam;
import javax.annotation.Resource;
+import java.math.BigDecimal;
import java.util.*;
import static java.util.Objects.isNull;
@@ -96,6 +97,7 @@
Boolean isExpertCheck=false;
Long expertId=null;
Boolean isStretAccount = isStreetAccount(loginUserInfoVO);
+ comEvent.setAppId(loginUserInfoVO.getAppId());
if (nonNull(comEvent.getUserType())){
if (comEvent.getUserType().equals(1)){
//个人账号权限
@@ -373,7 +375,8 @@
comEvent.setSolve(0);
comEvent.setDistribution(0);
//comEvent.setChangeExpert(0);
- comEvent.setArchive(0);
+ //comEvent.setArchive(0);
+ comEvent.setConciliation(0);
}
else if (comEvent.getEventProcessStatus().equals(6) && comEvent.getEventSucceed().equals(2)){
//调解完成,可以归档,查看
@@ -393,7 +396,7 @@
//待分配和待验证状态,可以受理,分配专家
//关闭调解和归档
comEvent.setArchive(0);
- comEvent.setConciliation(0);
+ //comEvent.setConciliation(0);
comEvent.setChangeExpert(0);
if (comEvent.getSpecialistName().equals("待分配")){
comEvent.setSolve(0);
@@ -404,7 +407,14 @@
comEvent.setDistribution(0);
comEvent.setSolve(0);
comEvent.setArchive(0);
- } else if (comEvent.getEventProcessStatus().equals(6) && comEvent.getEventSucceed().equals(2)){
+ }else if (comEvent.getEventProcessStatus().equals(6) && comEvent.getEventResult().equals(2) && comEvent.getEventSucceed().equals(2)){
+ //调解完成并且成功,可以归档,查看
+ comEvent.setSolve(0);
+ comEvent.setDistribution(0);
+ comEvent.setChangeExpert(0);
+ comEvent.setConciliation(0);
+ }
+ else if (comEvent.getEventProcessStatus().equals(6) && comEvent.getEventSucceed().equals(2)){
//调解完成,可以归档,查看
comEvent.setSolve(0);
comEvent.setDistribution(0);
@@ -418,6 +428,7 @@
comEvent.setSolve(0);
comEvent.setDistribution(0);
comEvent.setChangeExpert(0);
+ //comEvent.setConciliation(0);
}
}else if (userType.equals(5) || isStreet){
//街道权限,操作街道下属社区的所有事件
@@ -609,12 +620,15 @@
comEvent.setCurrentOrgId(community.getCommunityId().toString());
comEvent.setCurrentProcessType(5);
}
- if (!StringUtils.isEmpty(comEvent.getCenterId())) {
+ if (!StringUtils.isEmpty(comEvent.getCenterId())) {
//创建时处理级别都是专家
ComSanshuoIndustryCenter center = comSanShuoIndustryCenterService.getById(comEvent.getCenterId());
comEvent.setCurrentOrgName(center.getName());
comEvent.setCurrentOrgId(center.getId().toString());
comEvent.setCurrentProcessType(5);
+ }
+ if (StringUtils.isNotEmpty(comEvent.getCenterId())){
+ comEvent.setRequestUserCommunity(null);
}
comEvent.setUserEventStatus(2);
//设置为未上报
@@ -642,17 +656,17 @@
return R.ok(ReturnMsgConstants.SAVE_SUCCESS);
}
-
public void sendMessage(Long expertId,ComEvent comEvent){
//获取专家的openId
ComSanshuoExpert expert = comSanShuoExpertService.getById(expertId);
- SysUser sysUser = sysUserDao.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getPhone, expert.getPhone()).eq(SysUser::getType, 1));
+ SysUser sysUser = sysUserDao.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getPhone, expert.getPhone()).eq(SysUser::getType, 1).eq(SysUser::getAppId,"wx0cef797390444b75" ));
SanShuoMessageVO vo=new SanShuoMessageVO();
- if (nonNull(sysUser)){
- if (isNull(sysUser.getOpenid())){
- log.info("专家未登陆APP,无法推送");
- return;
- }
+ if (isNull(sysUser)){
+ return;
+ }
+ if (isNull(sysUser.getOpenid())){
+ log.info("专家未登陆APP,无法推送");
+ return;
}
vo.setTouser(sysUser.getOpenid());
vo.setThing1(commediateTypeService.getById(comEvent.getEventCategory()).getName());
@@ -752,7 +766,7 @@
comEvent.setSpecialistName("待分配");
comEvent.setSpecialistId(99999L);
//生成一次流转记录
- ComSanshuoIndustryCenter center = comSanShuoIndustryCenterService.getById(comEvent.getSpecialistId());
+ ComSanshuoIndustryCenter center = comSanShuoIndustryCenterService.getById(comEvent.getCurrentOrgId());
comEvent.setCurrentEventProcessResult("(专家上报到"+center.getName()+")"+comEventConciliationVO.getCurrentEventProcessResult());
comEvent.setCurrentOrgName(expert.getUnit());
comEventTransferRecord.setFromId(comEvent.getSpecialistId());
@@ -841,7 +855,7 @@
|| comEvent.getEventProcessStatus() == SanShuoEventStatusEnum.VALID.getCode().intValue()) {
comEvent.setId(id);
comEvent.setUserEventStatus(4);
- comEvent.setEventProcessStatus(8);
+ comEvent.setEventProcessStatus(9);
comEvent.setRevokeDes("用户手动取消");
comEvent.setRevokeDate(new Date());
int flag = baseMapper.updateById(comEvent);
@@ -888,8 +902,23 @@
List<ComEventResource> resource = comEventResourceService.list(new QueryWrapper<ComEventResource>().lambda().eq(ComEventResource::getRefId, id)
.eq(ComEventResource::getStatus, 5));
map.put("archiveImage", resource);
+ map.put("contact", getPhone(comEvent));
return map;
}
+
+ public String getPhone(ComEvent comEvent){
+ if (isNull(comEvent.getRequestUserCommunity())){
+ return comSanShuoIndustryCenterService.getById(comEvent.getCenterId()).getPhone();
+ }else {
+ String contactsPhone = comActDAO.selectById(comEvent.getRequestUserCommunity()).getContactsPhone();
+ if (isNull(contactsPhone)){
+ return null;
+ }
+ return contactsPhone;
+ }
+ }
+
+
@Override
@Transactional(rollbackFor = Exception.class)
@@ -916,7 +945,8 @@
comEvent.setSpecialistName(specter.getName());
comEvent.setEventProcessStatus(SanShuoEventStatusEnum.VALID.getCode());
int flag = baseMapper.updateById(comEvent);
- sendMessage(specialistId,comEvent );
+ ComEvent comEvent1 = comEventMapper.selectById(id);
+ sendMessage(specialistId,comEvent1 );
//添加一条对应记录
comEventMapper.insertEventAndExpertRecord(id, specialistId,1);
return flag > 0 ? R.ok() : R.fail(ReturnMsgConstants.UPDATE_FALSE);
@@ -975,6 +1005,7 @@
}
}
log.info("当前userType===="+comEvent.getUserType());
+ comEvent.setAppId(loginUserInfoVO.getAppId());
List<ComEventCalculateVO> calculateList = baseMapper.calculate(comEvent);
ComEventCalculateVO comEventCalculateVO =new ComEventCalculateVO();
comEventCalculateVO.setStatus("0");
@@ -1031,7 +1062,12 @@
if (nonNull(vo.getSuccess()) && !vo.getSuccess().equals(0)){
if (nonNull(vo.getAccepted()) && !vo.getAccepted().equals(0)){
//计算成功率
- vo.setSuccessRate(NumberUtil.div(vo.getSuccess(),vo.getAccepted(),2));
+ try {
+ vo.setSuccessRate(NumberUtil.div(vo.getSuccess(),vo.getAccepted(),2));
+ }catch (NullPointerException e){
+ vo.setSuccessRate(new BigDecimal(0));
+ }
+
}
}
vo.setExpert(comSanshuoExpertDao.selectExpertCount(indexDataDTO));
@@ -1117,11 +1153,11 @@
case 1:
return "行业分中心受理";
case 3:
- return "街道调解站受理";
+ return "镇/街道受理案件";
case 2:
- return "社区调解站受理";
+ return "村/社区受理案件";
case 4:
- return "区三说会堂受理";
+ return "区三说会堂中心受理";
}
return null;
}
@@ -1129,13 +1165,13 @@
public String typeToNameExpert(Integer type){
switch (type){
case 1:
- return "区三说会堂专家";
+ return "区三说会堂中心专家";
case 2:
return "行业分中心专家";
case 3:
- return "街道调解站专家";
+ return "镇/街道调解专家";
case 4:
- return "社区调解站专家";
+ return "村/社区调解专家";
}
return null;
}
--
Gitblit v1.7.1