| | |
| | | import com.doumee.dao.business.model.Company; |
| | | import com.doumee.dao.business.model.InsuranceApply; |
| | | import com.doumee.dao.business.model.Notices; |
| | | import com.doumee.dao.business.vo.ApplyNoticeVO; |
| | | import com.doumee.service.business.NoticesService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 系统消息信息表Service实现 |
| | |
| | | QueryWrapper<Notices> wrapper = new QueryWrapper<>(notices); |
| | | return noticesMapper.selectCount(wrapper); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询投保单 提醒数量 |
| | | * @param companyId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ApplyNoticeVO getApplyNotice(Integer companyId){ |
| | | ApplyNoticeVO applyNoticeVO = new ApplyNoticeVO(); |
| | | applyNoticeVO.setWaitSignNum(Constants.ZERO); |
| | | applyNoticeVO.setRenewalNum(Constants.ZERO); |
| | | List<Notices> noticesList = noticesMapper.selectList(new QueryWrapper<Notices>() |
| | | .lambda() |
| | | .select(Notices::getType) |
| | | .eq(Notices::getPalt,Constants.ONE) |
| | | .eq(Notices::getCompanyId,companyId) |
| | | .eq(Notices::getObjType,Constants.NoticeObjectType.INSURANCE_APPLY.getKey()) |
| | | .eq(Notices::getStatus,Constants.ZERO) |
| | | .in(Notices::getType,Constants.NoticeType.SIX.getStatus(),Constants.NoticeType.ONE.getStatus()) |
| | | ); |
| | | if(CollectionUtils.isNotEmpty(noticesList)){ |
| | | applyNoticeVO.setRenewalNum(noticesList.stream().filter(m->m.getType().equals(Constants.NoticeType.SIX.getStatus())).collect(Collectors.toList()).size()); |
| | | applyNoticeVO.setWaitSignNum(noticesList.size() - applyNoticeVO.getRenewalNum()); |
| | | } |
| | | return applyNoticeVO ; |
| | | } |
| | | |
| | | /** |
| | | * 关闭提醒 |
| | | * @param companyId |
| | | * @param type |
| | | */ |
| | | @Override |
| | | public void closeApplyNotice(Integer companyId,Integer type){ |
| | | noticesMapper.update(null,new UpdateWrapper<Notices>() |
| | | .lambda() |
| | | .set(Notices::getStatus,Constants.ONE) |
| | | .eq(Notices::getPalt,Constants.ONE) |
| | | .eq(Notices::getCompanyId,companyId) |
| | | .eq(Notices::getStatus,Constants.ZERO) |
| | | .eq(Notices::getObjType,Constants.NoticeObjectType.INSURANCE_APPLY.getKey()) |
| | | .eq(Notices::getType,type) |
| | | ); |
| | | } |
| | | |
| | | } |