张天森
2022-09-28 b2a64967d13f68175cd0c47f1a5b6169c42ed8a9
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoIndustryCenterApi.java
@@ -5,11 +5,14 @@
import com.panzhihua.common.model.dtos.community.sanshuo.ComSanShuoIndustryCenterDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.service_community.entity.ComEvent;
import com.panzhihua.service_community.entity.ComSanshuoIndustryCenter;
import com.panzhihua.service_community.service.ComSanShuoIndustryCenterService;
import com.panzhihua.service_community.service.IComEventService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
 * 三说会堂业务中心管理控制器
@@ -21,6 +24,8 @@
    private ComSanShuoIndustryCenterService comSanShuoIndustryCenterService;
    @Resource
    private UserService userService;
    @Resource
    private IComEventService comEventService;
    @GetMapping("/list")
    public R list(@RequestParam(value = "keyWord", required = false) String keyWord,
@@ -61,6 +66,10 @@
     */
    @DeleteMapping("/remove")
    public R remove(@RequestParam("id") Long id) {
        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("有未调解完成事件,无法删除!");
        }
        ComSanshuoIndustryCenter center = comSanShuoIndustryCenterService.getById(id);
        center.setDelFlag(0);
        center.setStatus(0);