liukangdong
2024-06-12 a11bc1bed7953b88213330582c2085f60b5a73b1
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/ApproveServiceImpl.java
@@ -18,6 +18,7 @@
import com.doumee.dao.business.join.VisitsJoinMapper;
import com.doumee.dao.business.model.*;
import com.doumee.dao.business.vo.ApproveDataVO;
import com.doumee.dao.system.dto.NoticesDTO;
import com.doumee.dao.system.join.NoticesJoinMapper;
import com.doumee.dao.system.model.Notices;
import com.doumee.dao.system.model.SystemUser;
@@ -240,7 +241,7 @@
     * @return
     */
    @Override
    public InternalHomeVO getHomeData(Integer memberId,Integer isDetail){
    public InternalHomeVO getHomeDataH5(Integer memberId,Integer isDetail){
        InternalHomeVO internalHomeVO = new InternalHomeVO();
        internalHomeVO.setHomeImg(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.HOME_IMAGE).getCode());
        //任务数据
@@ -279,6 +280,48 @@
        return internalHomeVO;
    }
    @Override
    public InternalHomeVO getHomeDataPC(NoticesDTO noticesDTO){
        InternalHomeVO internalHomeVO = new InternalHomeVO();
        internalHomeVO.setHomeImg(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.HOME_IMAGE).getCode());
        //任务数据
        List<Notices> noticesList = noticesJoinMapper.
                selectList(new QueryWrapper<Notices>().lambda()
                        .ge(noticesDTO.getStartDate() != null, Notices::getCreateDate, Utils.Date.getStart(noticesDTO.getStartDate() ))
                        .le(noticesDTO.getEndDate() != null,  Notices::getCreateDate, Utils.Date.getEnd(noticesDTO.getEndDate() ))
                        .eq(noticesDTO.getType() != null,  Notices::getType, noticesDTO.getType())
                        .eq(Notices::getUserId,noticesDTO.getMemberId()).orderByDesc(Notices::getCreateDate)
                );
        internalHomeVO.setTaskNum(noticesList.size());
        if(CollectionUtils.isNotEmpty(noticesList)){
            //待我处理的数据
            internalHomeVO.setNoticeWaitNum(
                    noticesList.stream().filter(i->Constants.equalsInteger(i.getUserId(),noticesDTO.getMemberId())
                            &&Constants.equalsInteger(i.getStatus(),Constants.ZERO)
                            &&Constants.equalsInteger(i.getSendacopy(),Constants.ZERO)
                    ).count()
            );
            internalHomeVO.setNoticeDealNum(
                    noticesList.stream().filter(i->Constants.equalsInteger(i.getUserId(),noticesDTO.getMemberId())
                            &&Constants.equalsInteger(i.getStatus(),Constants.ONE)
                            &&Constants.equalsInteger(i.getSendacopy(),Constants.ZERO)
                    ).count()
            );
            internalHomeVO.setNoticeCreateNum(
                    noticesJoinMapper.selectCount(new QueryWrapper<Notices>().lambda().eq(Notices::getParam3,noticesDTO.getMemberId()))
            );
            internalHomeVO.setNoticeCopyNum(
                    noticesList.stream().filter(i->Constants.equalsInteger(i.getUserId(),noticesDTO.getMemberId())
                            &&Constants.equalsInteger(i.getSendacopy(),Constants.ONE)
                    ).count()
            );
        }
        return internalHomeVO;
    }
    /**
     * 创建审批流程
@@ -637,13 +680,15 @@
        List<Approve> levelList = getLevelListFromResult(approveGroupList,approveDateVO,memberId);
        List<Approve> copyList = getAllCopyList(approveGroupList);
        //遍历level查询每一级别业务数据
        for(Approve level:levelList){
            List<Approve> tlist = getLevelInfoFromList(level,approveGroupList);
            approveDateVO.getApproveList().addAll(tlist);
            if(tlist.size() ==0
                    ||Constants.equalsInteger(Constants.approveStatus.unPass,  tlist.get(0).getStatus())
                    ||Constants.equalsInteger(Constants.approveStatus.cancel,  tlist.get(0).getStatus())){
                break;
        if(levelList!=null){
            for(Approve level:levelList){
                List<Approve> tlist = getLevelInfoFromList(level,approveGroupList);
                approveDateVO.getApproveList().addAll(tlist);
                if(tlist.size() ==0
                        ||Constants.equalsInteger(Constants.approveStatus.unPass,  tlist.get(0).getStatus())
                        ||Constants.equalsInteger(Constants.approveStatus.cancel,  tlist.get(0).getStatus())){
                    break;
                }
            }
        }
@@ -799,7 +844,7 @@
            }
        }
        if(CollectionUtils.isEmpty(approveList)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"审批信息:级别数据异常");
         //   throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"审批信息:级别数据异常");
        }
        return  approveList;
    }