From b718daf58eec8845787de29eaeb25489ab0b6652 Mon Sep 17 00:00:00 2001 From: zhouxiantao <1026371446@qq.com> Date: Sun, 08 Sep 2024 16:03:38 +0800 Subject: [PATCH] 小程序办件进度 --- dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseTaskService.java | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 53 insertions(+), 0 deletions(-) diff --git a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseTaskService.java b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseTaskService.java index 6d85073..a362a4f 100644 --- a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseTaskService.java +++ b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseTaskService.java @@ -3,15 +3,20 @@ import cn.huge.base.common.exception.ServiceException; import cn.huge.base.common.utils.DateUtils; import cn.huge.base.common.utils.IdUtils; +import cn.huge.base.common.utils.ObjectUtils; import cn.huge.module.cases.domain.dto.CaseFlowDTO; import cn.huge.module.cases.domain.dto.TabButtonDTO; import cn.huge.module.cases.domain.dto.TabButtonInfoDTO; +import cn.huge.module.client.api.impl.CustClientImpl; import cn.huge.module.client.api.impl.UtilsClientImpl; import cn.huge.module.cases.dao.mapper.CaseTaskMapper; import cn.huge.module.cases.domain.po.CaseTask; +import cn.huge.module.cust.dto.CtUserDTO; import cn.huge.module.mediate.constant.CaseBaseConsts; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.google.common.collect.Maps; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import lombok.extern.slf4j.Slf4j; @@ -42,6 +47,12 @@ @Autowired private UtilsClientImpl utilsClient; + + @Autowired + private CustClientImpl custClient; + + @Autowired + private CaseSuperviseService superviseService; /** * 更新对象 @@ -332,4 +343,46 @@ } } + /** + * 按条件统计 + * @param userId 用户编号 + * @return long + */ + public Map<String, Long> getCountList(String userId){ + CtUserDTO loginUser = custClient.clientGetUserAll(userId); + Map<String, Object> terms = new HashMap<>(); + terms.put("candeUnitId", loginUser.getUnitId()); + terms.put("candeDeptId", loginUser.getDeptId()); + mapper.countTaskList(terms); + superviseService.countCaseSuperviseList(0,loginUser.getUnitId()); + Map<String, Long> result = new HashMap<>(); + return result; + } + + /** + * wechat端-查询流程进度 + * @param caseId 纠纷编号 + * @return + */ + public List<CaseFlowDTO> wechatListCaseFlow(String caseId, String userId){ + try{ + // 临时给前端联调数据 + List<CaseFlowDTO> list = new ArrayList<>(); + QueryWrapper<CaseTask> queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("case_id", caseId); + queryWrapper.orderByAsc("create_time"); + List<CaseTask> caseTasks = mapper.selectList(queryWrapper); + if(ObjectUtils.isNotEmpty(caseTasks)){ + for (CaseTask caseTask : caseTasks) { + CaseFlowDTO caseFlowDTO = new CaseFlowDTO(); + BeanUtils.copyProperties(caseTask, caseFlowDTO); + list.add(caseFlowDTO); + } + } + return list; + }catch (Exception e){ + log.error("[CaseTaskService.wechatListCaseFlow]调用失败,异常信息:"+e, e); + throw new ServiceException("CaseTaskService.wechatListCaseFlow", e); + } + } } -- Gitblit v1.8.0