|  |  |  | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.core.utils.Utils; | 
|---|
|  |  |  | import com.doumee.dao.business.NoticesMapper; | 
|---|
|  |  |  | import com.doumee.dao.business.SettleClaimsLogMapper; | 
|---|
|  |  |  | import com.doumee.dao.business.SettleClaimsMapper; | 
|---|
|  |  |  | import com.doumee.dao.business.dto.SCSupplementDTO; | 
|---|
|  |  |  | 
|---|
|  |  |  | import java.io.FileInputStream; | 
|---|
|  |  |  | import java.io.IOException; | 
|---|
|  |  |  | import java.net.URLEncoder; | 
|---|
|  |  |  | import java.nio.charset.Charset; | 
|---|
|  |  |  | import java.util.*; | 
|---|
|  |  |  | import java.util.stream.Collectors; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private SettleClaimsLogJoinMapper settleClaimsLogJoinMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private NoticesMapper noticesMapper; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 删除附件 | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public  Integer delFile(Integer id,Integer fileId){ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return 0; | 
|---|
|  |  |  | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | return   multifileJoinMapper.update(null,new UpdateWrapper<Multifile>().lambda() | 
|---|
|  |  |  | .set(Multifile::getIsdeleted,Constants.ONE) | 
|---|
|  |  |  | .set(Multifile::getEditDate,new Date()) | 
|---|
|  |  |  | .set(Multifile::getEditor,user.getId()) | 
|---|
|  |  |  | .eq(Multifile::getIsdeleted,Constants.ZERO) | 
|---|
|  |  |  | .eq(Multifile::getObjId,id) | 
|---|
|  |  |  | .eq(Multifile::getId,fileId) | 
|---|
|  |  |  | .in(Multifile::getObjType,Arrays.asList(new Integer[]{ | 
|---|
|  |  |  | Constants.MultiFile.LP_YGGX_FILE.getKey(), | 
|---|
|  |  |  | Constants.MultiFile.LP_MZCL_FILE.getKey(), | 
|---|
|  |  |  | Constants.MultiFile.LP_ZYCL_FILE.getKey(), | 
|---|
|  |  |  | Constants.MultiFile.LP_SCZL_FILE.getKey(), | 
|---|
|  |  |  | Constants.MultiFile.LP_JACL_FILE.getKey(), | 
|---|
|  |  |  | }))); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public      Integer back(SettleClaims  param){ | 
|---|
|  |  |  | 
|---|
|  |  |  | update.setId(model.getId()); | 
|---|
|  |  |  | update.setStatus(Constants.SettleClaimsStatus.RETURN_ACCEPTANCE.getKey()); | 
|---|
|  |  |  | settleClaimsMapper.updateById(update); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //存储待办信息 | 
|---|
|  |  |  | Constants.NoticeObjectType noticeObjectType = Constants.NoticeObjectType.SETTLE_CLAIMS; | 
|---|
|  |  |  | //删除其他待办 | 
|---|
|  |  |  | noticesMapper.delete(new QueryWrapper<Notices>().lambda().eq(Notices::getObjType,noticeObjectType.getKey()).eq(Notices::getObjId,model.getId())); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Notices notices = new Notices(noticeObjectType,Constants.ONE,model.getId(),model.getInformantName(), | 
|---|
|  |  |  | model.getCompanyId(), Constants.NoticeType.FOUR); | 
|---|
|  |  |  | noticesMapper.insert(notices); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Constants.SettleClaimsLogType applyLogType = Constants.SettleClaimsLogType.PLATFORM_RETURN; | 
|---|
|  |  |  | String info =applyLogType.getInfo(); | 
|---|
|  |  |  | 
|---|
|  |  |  | update.setId(model.getId()); | 
|---|
|  |  |  | update.setStatus(Constants.SettleClaimsStatus.CONFIRM_INFORMATION.getKey()); | 
|---|
|  |  |  | settleClaimsMapper.updateById(update); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //存储待办信息 | 
|---|
|  |  |  | Constants.NoticeObjectType noticeObjectType = Constants.NoticeObjectType.SETTLE_CLAIMS; | 
|---|
|  |  |  | //删除其他待办 | 
|---|
|  |  |  | noticesMapper.delete(new QueryWrapper<Notices>().lambda().eq(Notices::getObjType,noticeObjectType.getKey()).eq(Notices::getObjId,model.getId())); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Constants.SettleClaimsLogType applyLogType = Constants.SettleClaimsLogType.PLATFORM_CONFIRM_INFORMATION; | 
|---|
|  |  |  | String info =applyLogType.getInfo(); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Constants.SettleClaimsLogType applyLogType = Constants.SettleClaimsLogType.PLATFORM_REMARK; | 
|---|
|  |  |  | String info =applyLogType.getInfo(); | 
|---|
|  |  |  | info = info.replace("${param}", update.getCheckInfo()); | 
|---|
|  |  |  | info = info.replace("${param}", param.getCheckInfo()); | 
|---|
|  |  |  | SettleClaimsLog log = new SettleClaimsLog(update,applyLogType.getName(), info,update.getId(),applyLogType.getKey(), JSONObject.toJSONString(model), JSONObject.toJSONString(update)); | 
|---|
|  |  |  | settleClaimsLogMapper.insert(log); | 
|---|
|  |  |  | return  1; | 
|---|
|  |  |  | 
|---|
|  |  |  | update.setScClaimAccount(Constants.formatBigdecimal(param.getScClaimAccount())); | 
|---|
|  |  |  | update.setClaimAccount(update.getYlClaimAccount().add(update.getSwClaimAccount()).add(update.getScClaimAccount()).add(update.getWgClaimAccount())); | 
|---|
|  |  |  | settleClaimsMapper.updateById(update); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //存储待办信息 | 
|---|
|  |  |  | Constants.NoticeObjectType noticeObjectType = Constants.NoticeObjectType.SETTLE_CLAIMS; | 
|---|
|  |  |  | //删除其他待办 | 
|---|
|  |  |  | noticesMapper.delete(new QueryWrapper<Notices>().lambda().eq(Notices::getObjType,noticeObjectType.getKey()).eq(Notices::getObjId,model.getId())); | 
|---|
|  |  |  | Notices notices = new Notices(noticeObjectType,Constants.ONE,model.getId(),model.getInformantName(), | 
|---|
|  |  |  | model.getCompanyId(), Constants.NoticeType.ONE); | 
|---|
|  |  |  | noticesMapper.insert(notices); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Constants.SettleClaimsLogType applyLogType = Constants.SettleClaimsLogType.PLATFORM_FINISH; | 
|---|
|  |  |  | String info =applyLogType.getInfo(); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | settleClaims.setCreateDate(new Date()); | 
|---|
|  |  |  | settleClaims.setIsdeleted(Constants.ZERO); | 
|---|
|  |  |  | settleClaims.setCompanyId(loginUserInfo.getCompanyId()); | 
|---|
|  |  |  | settleClaims.setStatus(Constants.SettleClaimsStatus.WAIT_ACCEPTANCE.getKey()); | 
|---|
|  |  |  | settleClaims.setCreator(loginUserInfo.getId()); | 
|---|
|  |  |  | settleClaims.setCheckUserId(loginUserInfo.getId()); | 
|---|
|  |  |  | settleClaimsMapper.insert(settleClaims); | 
|---|
|  |  |  | 
|---|
|  |  |  | Multifile multifile = reportVideo.get(i); | 
|---|
|  |  |  | if(Objects.isNull(multifile.getFileurl()) | 
|---|
|  |  |  | || Objects.isNull(multifile.getType()) | 
|---|
|  |  |  | || StringUtils.isBlank(multifile.getName()) | 
|---|
|  |  |  | ){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"附件内容异常"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //记录日志 | 
|---|
|  |  |  | this.saveSettleClaimsLog(settleClaims,Constants.SettleClaimsLogType.UPLOAD,null); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //存储待办信息 | 
|---|
|  |  |  | Constants.NoticeObjectType noticeObjectType = Constants.NoticeObjectType.SETTLE_CLAIMS; | 
|---|
|  |  |  | //删除其他待办 | 
|---|
|  |  |  | noticesMapper.delete(new QueryWrapper<Notices>().lambda().eq(Notices::getObjType,noticeObjectType.getKey()).eq(Notices::getObjId,settleClaims.getId())); | 
|---|
|  |  |  | Notices notices = new Notices(noticeObjectType,Constants.ZERO,settleClaims.getId(),settleClaims.getInformantName(), | 
|---|
|  |  |  | settleClaims.getCompanyId(), Constants.NoticeType.ZERO); | 
|---|
|  |  |  | noticesMapper.insert(notices); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return settleClaims.getId(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<File> fileList = new ArrayList<>(); | 
|---|
|  |  |  | List<Multifile> multifileList = multifileJoinMapper.selectList(new QueryWrapper<Multifile>().lambda() | 
|---|
|  |  |  | .eq(Multifile::getIsdeleted,Constants.ZERO) | 
|---|
|  |  |  | .eq(Multifile::getObjId,id) | 
|---|
|  |  |  | .isNotNull(Multifile::getFileurl) | 
|---|
|  |  |  | .in(Multifile::getObjType, Arrays.asList(new Integer[]{ | 
|---|
|  |  |  | 
|---|
|  |  |  | Constants.MultiFile.LP_SCZL_FILE.getKey(), | 
|---|
|  |  |  | Constants.MultiFile.LP_JACL_FILE.getKey(), | 
|---|
|  |  |  | })) | 
|---|
|  |  |  | .orderByAsc(Multifile::getCreateDate) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | if(multifileList== null || multifileList.size() == 0){ | 
|---|
|  |  |  | throw  new BusinessException(ResponseStatus.DATA_EMPTY); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | String path = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()+systemDictDataBiz.queryByCode(Constants.OSS,Constants.SETTLE_FILE).getCode(); | 
|---|
|  |  |  | Integer sn = 1; | 
|---|
|  |  |  | for(Multifile l : multifileList){ | 
|---|
|  |  |  | File f = Constants.getFileByNetFile(path + l.getFileurl(),StringUtils.defaultString(l.getName(),"未命名")); | 
|---|
|  |  |  | File f = Constants.getFileByNetFile(path + l.getFileurl(),StringUtils.defaultString(sn + "_" +l.getName(),"未命名")); | 
|---|
|  |  |  | if(f !=null && f.isFile()){ | 
|---|
|  |  |  | fileList.add(f); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | sn = sn +1; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(fileList == null || fileList.size() == 0){ | 
|---|
|  |  |  | throw  new BusinessException(ResponseStatus.DATA_EMPTY); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | String fileName =  model.getInformantName() +"理赔资料下_"+System.currentTimeMillis()+".zip" ; | 
|---|
|  |  |  | String encodeFileName = URLEncoder.encode(fileName); | 
|---|
|  |  |  | String fileName =  model.getInformantName() +"-理赔资料-" +System.currentTimeMillis(); | 
|---|
|  |  |  | String encodeFileName =URLEncoder.encode(fileName, Charset.forName("UTF-8").toString())+".zip"; | 
|---|
|  |  |  | response.setHeader("Content-Disposition","attachment;filename=" + encodeFileName); | 
|---|
|  |  |  | response.setContentType("application/octet-stream"); | 
|---|
|  |  |  | response.setHeader("eva-opera-type", "download"); | 
|---|
|  |  |  | response.setHeader("eva-download-filename", encodeFileName); | 
|---|
|  |  |  | Constants.packFilesToZip(fileList,response.getOutputStream()); | 
|---|
|  |  |  | } catch (IOException e) { | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.EXPORT_EXCEL_ERROR, e); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | .eq(SettleClaimsLog::getSettleClainmsId,settleClaims.getId()) | 
|---|
|  |  |  | .orderByAsc(SettleClaimsLog::getCreateDate) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | settleClaims.setSettleClaimsLogList(settleClaimsLogList); | 
|---|
|  |  |  | SettleClaimsLog lastConfirm = settleClaimsLogMapper.selectOne(new QueryWrapper<SettleClaimsLog>().lambda() | 
|---|
|  |  |  | .eq(SettleClaimsLog::getSettleClainmsId,settleClaims.getId()) | 
|---|
|  |  |  | .eq(SettleClaimsLog::getObjType,Constants.SettleClaimsLogType.PLATFORM_CONFIRM_INFORMATION.getKey()) | 
|---|
|  |  |  | .orderByDesc(SettleClaimsLog::getCreateDate) | 
|---|
|  |  |  | .last(" limit 1") | 
|---|
|  |  |  | ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Multifile multifile = multifileJoinMapper.selectOne(new QueryWrapper<Multifile>() | 
|---|
|  |  |  | .lambda() | 
|---|
|  |  |  | .eq(Multifile::getObjId,settleClaims.getId()) | 
|---|
|  |  |  | .eq(Multifile::getIsdeleted,Constants.ZERO) | 
|---|
|  |  |  | .in(Multifile::getObjType, | 
|---|
|  |  |  | Constants.MultiFile.LP_SGXC_FILE.getKey(), | 
|---|
|  |  |  | Constants.MultiFile.LP_YGGX_FILE.getKey(), | 
|---|
|  |  |  | Constants.MultiFile.LP_MZCL_FILE.getKey(), | 
|---|
|  |  |  | Constants.MultiFile.LP_ZYCL_FILE.getKey(), | 
|---|
|  |  |  | Constants.MultiFile.LP_SCZL_FILE.getKey(), | 
|---|
|  |  |  | Constants.MultiFile.LP_JACL_FILE.getKey()) | 
|---|
|  |  |  | .orderByDesc(Multifile::getCreateDate) | 
|---|
|  |  |  | .last(" limit 1") | 
|---|
|  |  |  | ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(!Objects.isNull(lastConfirm)&&!Objects.isNull(multifile)){ | 
|---|
|  |  |  | settleClaims.setFinishDate(lastConfirm.getCreateDate().compareTo(multifile.getCreateDate())>=0?lastConfirm.getCreateDate():multifile.getCreateDate()); | 
|---|
|  |  |  | }else if(!Objects.isNull(lastConfirm)&&Objects.isNull(multifile)){ | 
|---|
|  |  |  | settleClaims.setFinishDate(lastConfirm.getCreateDate()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return settleClaims; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | if(!oldSettleClaims.getSolutionId().equals(settleClaims.getSolutionId())){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"无法修改方案信息"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(!(oldSettleClaims.getStatus().equals(Constants.SettleClaimsStatus.WAIT_ACCEPTANCE) | 
|---|
|  |  |  | || oldSettleClaims.getStatus().equals(Constants.SettleClaimsStatus.CONFIRM_INFORMATION))){ | 
|---|
|  |  |  | if(!(oldSettleClaims.getStatus().equals(Constants.SettleClaimsStatus.WAIT_ACCEPTANCE.getKey()) | 
|---|
|  |  |  | || oldSettleClaims.getStatus().equals(Constants.SettleClaimsStatus.DEAL_ING.getKey()) | 
|---|
|  |  |  | || oldSettleClaims.getStatus().equals(Constants.SettleClaimsStatus.CONFIRM_INFORMATION.getKey()))){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"当前状态无法进行该操作"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | oldSettleClaims.setEditor(loginUserInfo.getId()); | 
|---|
|  |  |  | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非企业员工无法进行该操作"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | SettleClaims settleClaims  = settleClaimsMapper.selectById(scSupplementDTO.getId()); | 
|---|
|  |  |  | if(!(settleClaims.getStatus().equals(Constants.SettleClaimsStatus.WAIT_ACCEPTANCE) | 
|---|
|  |  |  | || settleClaims.getStatus().equals(Constants.SettleClaimsStatus.CONFIRM_INFORMATION))){ | 
|---|
|  |  |  | if(!(settleClaims.getStatus().equals(Constants.SettleClaimsStatus.WAIT_ACCEPTANCE.getKey()) | 
|---|
|  |  |  | || settleClaims.getStatus().equals(Constants.SettleClaimsStatus.DEAL_ING.getKey()) | 
|---|
|  |  |  | || settleClaims.getStatus().equals(Constants.SettleClaimsStatus.CONFIRM_INFORMATION.getKey()))){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"当前状态无法进行该操作"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | settleClaims.setEditor(loginUserInfo.getId()); | 
|---|
|  |  |  | 
|---|
|  |  |  | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | if(Objects.isNull(scSupplementDTO) | 
|---|
|  |  |  | || Objects.isNull(scSupplementDTO.getId()) | 
|---|
|  |  |  | || Objects.isNull(scSupplementDTO.getSupplement()) | 
|---|
|  |  |  | || Objects.isNull(scSupplementDTO.getObjType()) | 
|---|
|  |  |  | || Objects.isNull(scSupplementDTO.getFileUrl()) | 
|---|
|  |  |  | || Objects.isNull(scSupplementDTO.getFileType()) | 
|---|
|  |  |  | || scSupplementDTO.getObjType().equals(Constants.ZERO) | 
|---|
|  |  |  | ){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.BAD_REQUEST); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | SettleClaims settleClaims  = settleClaimsMapper.selectById(scSupplementDTO.getId()); | 
|---|
|  |  |  | if(!(settleClaims.getStatus().equals(Constants.SettleClaimsStatus.WAIT_ACCEPTANCE) | 
|---|
|  |  |  | || settleClaims.getStatus().equals(Constants.SettleClaimsStatus.CONFIRM_INFORMATION))){ | 
|---|
|  |  |  | if(!(settleClaims.getStatus().equals(Constants.SettleClaimsStatus.WAIT_ACCEPTANCE.getKey()) | 
|---|
|  |  |  | || settleClaims.getStatus().equals(Constants.SettleClaimsStatus.DEAL_ING.getKey()) | 
|---|
|  |  |  | || settleClaims.getStatus().equals(Constants.SettleClaimsStatus.CONFIRM_INFORMATION.getKey()))){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"当前状态无法进行该操作"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Multifile multifile = new Multifile(); | 
|---|
|  |  |  | if(loginUserInfo.getType().equals(Constants.ONE)){ | 
|---|
|  |  |  | multifile.setCompanyId(loginUserInfo.getCompanyId()); | 
|---|
|  |  |  | 
|---|
|  |  |  | multifile.setCreator(loginUserInfo.getId()); | 
|---|
|  |  |  | multifile.setCreateDate(new Date()); | 
|---|
|  |  |  | multifile.setIsdeleted(Constants.ZERO); | 
|---|
|  |  |  | multifile.setObjType(scSupplementDTO.getObjType()); | 
|---|
|  |  |  | multifile.setObjId(scSupplementDTO.getId()); | 
|---|
|  |  |  | multifile.setName(scSupplementDTO.getFileUrl().substring(scSupplementDTO.getFileUrl().lastIndexOf("/") + 1)); | 
|---|
|  |  |  | multifile.setFileurl(scSupplementDTO.getFileUrl()); | 
|---|
|  |  |  | multifile.setName(scSupplementDTO.getFileName()); | 
|---|
|  |  |  | multifile.setType(scSupplementDTO.getFileType()); | 
|---|
|  |  |  | multifileJoinMapper.insert(multifile); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | .selectAs(Company::getName,SettleClaims::getCompanyName) | 
|---|
|  |  |  | .selectAs(Solutions::getName,SettleClaims::getSolutionName) | 
|---|
|  |  |  | .selectAs(Member::getName,SettleClaims::getMemberName) | 
|---|
|  |  |  | .selectAs(Member::getIdcardNo,SettleClaims::getMemberIdcardNo) | 
|---|
|  |  |  | .selectAs(Worktype::getName,SettleClaims::getWorktypeName) | 
|---|
|  |  |  | .selectAs(InsuranceApply::getStartTime,SettleClaims::getBaoxianStartTime) | 
|---|
|  |  |  | .selectAs(DispatchUnit::getName,SettleClaims::getDuName) | 
|---|
|  |  |  | 
|---|
|  |  |  | .leftJoin(InsuranceApply.class,InsuranceApply::getId,SettleClaims::getInsuranceApplyId) | 
|---|
|  |  |  | .leftJoin(Solutions.class,Solutions::getId,SettleClaims::getSolutionId); | 
|---|
|  |  |  | queryWrapper.eq(DispatchUnit::getIsdeleted,Constants.ZERO); | 
|---|
|  |  |  | queryWrapper.eq(SettleClaims::getIsdeleted,Constants.ZERO); | 
|---|
|  |  |  | if(Constants.equalsInteger(user.getType(),Constants.ZERO)){ | 
|---|
|  |  |  | //只能看权限范围内 | 
|---|
|  |  |  | if(user.getCompanyIdList() == null || user.getCompanyIdList().size() == 0){ | 
|---|
|  |  |  | 
|---|
|  |  |  | pageWrap.getModel().setCompanyId(user.getCompanyId()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | queryWrapper.like(StringUtils.isNotBlank(pageWrap.getModel().getMemberName()),Member::getName, pageWrap.getModel().getMemberName()); | 
|---|
|  |  |  | queryWrapper.like(StringUtils.isNotBlank(pageWrap.getModel().getMemberIdcardNo()),Member::getIdcardNo, pageWrap.getModel().getMemberIdcardNo()); | 
|---|
|  |  |  | queryWrapper.like(StringUtils.isNotBlank(pageWrap.getModel().getDuName()),DispatchUnit::getName, pageWrap.getModel().getDuName()); | 
|---|
|  |  |  | queryWrapper.eq(pageWrap.getModel().getBaseSolutionId()!=null,Solutions::getBaseId, pageWrap.getModel().getBaseSolutionId()); | 
|---|
|  |  |  | queryWrapper.eq(pageWrap.getModel().getBaseDuId()!=null,DispatchUnit::getBaseId, pageWrap.getModel().getBaseDuId()); | 
|---|
|  |  |  | 
|---|
|  |  |  | queryWrapper.eq(SettleClaims::getCode, pageWrap.getModel().getCode()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (pageWrap.getModel().getStatus() != null) { | 
|---|
|  |  |  | queryWrapper.eq(SettleClaims::getStatus, pageWrap.getModel().getStatus()); | 
|---|
|  |  |  | if(pageWrap.getModel().getStatus().equals(Constants.ZERO)){ | 
|---|
|  |  |  | queryWrapper.in(SettleClaims::getStatus, Constants.SettleClaimsStatus.WAIT_ACCEPTANCE.getKey() | 
|---|
|  |  |  | ,Constants.SettleClaimsStatus.DEAL_ING.getKey() | 
|---|
|  |  |  | ,Constants.SettleClaimsStatus.CONFIRM_INFORMATION.getKey()); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | queryWrapper.eq(SettleClaims::getStatus, pageWrap.getModel().getStatus()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (pageWrap.getModel().getType() != null) { | 
|---|
|  |  |  | queryWrapper.eq(SettleClaims::getType, pageWrap.getModel().getType()); | 
|---|
|  |  |  | 
|---|
|  |  |  | if (pageWrap.getModel().getInsuranceApplyId() != null) { | 
|---|
|  |  |  | queryWrapper.eq(SettleClaims::getInsuranceApplyId, pageWrap.getModel().getInsuranceApplyId()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | queryWrapper.orderByAsc(SettleClaims::getCreateDate); | 
|---|
|  |  |  | queryWrapper.orderByDesc(SettleClaims::getCreateDate); | 
|---|
|  |  |  | /*for(PageWrap.SortData sortData: pageWrap.getSorts()) { | 
|---|
|  |  |  | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { | 
|---|
|  |  |  | queryWrapper.orderByDesc(sortData.getProperty()); | 
|---|