From f2c0d536edeafa31bc6358ee7de827bbba330e7b Mon Sep 17 00:00:00 2001
From: 张天森 <1292933220@qq.com>
Date: 星期三, 12 十月 2022 19:08:26 +0800
Subject: [PATCH] 三说会堂事件流程处理
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java | 42 ++++++++++++++++++++++++++++++++----------
1 files changed, 32 insertions(+), 10 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java
index 6ce956d..1470967 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java
@@ -23,6 +23,9 @@
import java.util.Date;
import java.util.List;
+import static java.util.Objects.isNull;
+import static java.util.Objects.nonNull;
+
/**
* 三说会堂调解专家控制器
* */
@@ -43,7 +46,7 @@
@PostMapping
public R add(@RequestBody ComSanshuoExpertDTO comSanshuoExpertDTO){
comSanshuoExpertDTO.setCreateBy(this.getLoginUserInfo().getName());
- return comSanShuoExpertService.addExpert(comSanshuoExpertDTO);
+ return comSanShuoExpertService.addOrUpdateExpert(comSanshuoExpertDTO);
}
@GetMapping("/detail")
@@ -55,9 +58,8 @@
* 小程序获取可选择专家
* */
@GetMapping("/appletsList")
- public R appList(){
- comSanShuoExpertService.selectExpertList();
- return R.ok(comSanShuoExpertService.list(new QueryWrapper<ComSanshuoExpert>().eq("status",1).eq("del_flag",1)));
+ public R appList(@RequestParam (value = "type",required = false)Integer type,@RequestParam(value = "id",required = false)Long id){
+ return comSanShuoExpertService.selectExpertList(type, id,this.getLoginUserInfo().getCommunityId());
}
/**
@@ -65,11 +67,9 @@
* */
@PutMapping
public R update(@RequestBody ComSanshuoExpertDTO comSanshuoExpertDTO){
- ComSanshuoExpert expert=new ComSanshuoExpert();
- BeanUtil.copyProperties(comSanshuoExpertDTO,expert);
- expert.setUpdateTime(new Date());
- return R.ok(comSanShuoExpertService.updateById(expert));
+ return R.ok(comSanShuoExpertService.addOrUpdateExpert(comSanshuoExpertDTO));
}
+
/**
* 后台获取列表
@@ -87,7 +87,6 @@
* */
@DeleteMapping("/remove")
public R remove(@RequestParam("id")Long id){
- //TODO 是否有为解决事件
List<ComEvent> list = comEventService.list(new QueryWrapper<ComEvent>().lambda().eq(ComEvent::getSpecialistId, id).in(ComEvent::getEventProcessStatus, (1), (2), (5)));
if (list.size()!=0){
return R.fail("有未调解完成事件,无法删除!");
@@ -95,7 +94,12 @@
ComSanshuoExpert expert = comSanShuoExpertService.getById(id);
expert.setStatus(0);
expert.setDelFlag(0);
- return R.ok(comSanShuoExpertService.updateById(expert));
+ boolean b = comSanShuoExpertService.updateById(expert);
+ if (b){
+ //删除专家账号的权限
+ userService.removeExpertRole(expert.getPhone());
+ }
+ return R.ok();
}
/**
@@ -119,6 +123,8 @@
+
+
/**
* 专家范围
* */
@@ -136,4 +142,20 @@
@RequestParam(value = "id",required = false)Long id){
return comSanShuoExpertService.expertShowList(level,id);
}
+
+ /**
+ * 是否为专家登陆小程序
+ * */
+ @GetMapping("/checkExpert")
+ public R checkExpert(@RequestParam("number") String number){
+ ComSanshuoExpert expert = comSanShuoExpertService.getOne(new QueryWrapper<ComSanshuoExpert>().lambda().eq(ComSanshuoExpert::getPhone, number));
+ if (nonNull(expert)){
+ return R.ok();
+ }
+ return R.fail();
+ }
+
+
+
+
}
--
Gitblit v1.7.1