| | |
| | | public Integer create(Information information) { |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(Objects.isNull(information) |
| | | || Objects.isNull(information.getSortnum()) |
| | | || Objects.isNull(information.getReleaseDate()) |
| | | // || Objects.isNull(information.getSortnum()) |
| | | // || Objects.isNull(information.getReleaseDate()) |
| | | || StringUtils.isEmpty(information.getTitle()) |
| | | || StringUtils.isEmpty(information.getContnet()) |
| | | || StringUtils.isEmpty(information.getDescribe()) |
| | | || StringUtils.isEmpty(information.getImgurl()) |
| | | // || StringUtils.isEmpty(information.getContent()) |
| | | // || StringUtils.isEmpty(information.getDetail()) |
| | | // || StringUtils.isEmpty(information.getImgurl()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(Objects.isNull(information) |
| | | || Objects.isNull(information.getId()) |
| | | || Objects.isNull(information.getSortnum()) |
| | | || Objects.isNull(information.getReleaseDate()) |
| | | // || Objects.isNull(information.getSortnum()) |
| | | // || Objects.isNull(information.getReleaseDate()) |
| | | || StringUtils.isEmpty(information.getTitle()) |
| | | || StringUtils.isEmpty(information.getContnet()) |
| | | || StringUtils.isEmpty(information.getDescribe()) |
| | | || StringUtils.isEmpty(information.getImgurl()) |
| | | // || StringUtils.isEmpty(information.getContent()) |
| | | // || StringUtils.isEmpty(information.getDetail()) |
| | | // || StringUtils.isEmpty(information.getImgurl()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | |
| | | .eq(Information::getIsdeleted,Constants.ZERO) |
| | | .eq(pageWrap.getModel().getId() != null, Information::getId, pageWrap.getModel().getId()) |
| | | .eq(pageWrap.getModel().getRemark() != null, Information::getRemark, pageWrap.getModel().getRemark()) |
| | | .eq(pageWrap.getModel().getTitle() != null, Information::getTitle, pageWrap.getModel().getTitle()) |
| | | .eq(pageWrap.getModel().getDescribe() != null, Information::getDescribe, pageWrap.getModel().getDescribe()) |
| | | .eq(pageWrap.getModel().getContnet() != null, Information::getContnet, pageWrap.getModel().getContnet()) |
| | | .like(pageWrap.getModel().getTitle() != null, Information::getTitle, pageWrap.getModel().getTitle()) |
| | | .like(pageWrap.getModel().getDetail() != null, Information::getDetail, pageWrap.getModel().getDetail()) |
| | | .like(pageWrap.getModel().getContent() != null, Information::getContent, pageWrap.getModel().getContent()) |
| | | .ge(pageWrap.getModel().getReleaseDate() != null, Information::getReleaseDate, Utils.Date.getStart(pageWrap.getModel().getReleaseDate())) |
| | | .le(pageWrap.getModel().getReleaseDate() != null, Information::getReleaseDate, Utils.Date.getEnd(pageWrap.getModel().getReleaseDate())) |
| | | ; |
| | |
| | | IPage<Information> iPage = informationMapper.selectPage(page, queryWrapper); |
| | | String fileDir = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.FILE_DIR).getCode(); |
| | | for (Information information:iPage.getRecords()) { |
| | | if(Objects.isNull(information)&& org.apache.commons.lang3.StringUtils.isNotBlank(information.getImgurl())){ |
| | | if(!Objects.isNull(information)&& org.apache.commons.lang3.StringUtils.isNotBlank(information.getImgurl())){ |
| | | information.setFullImgurl(fileDir + information.getImgurl()); |
| | | } |
| | | } |
| | |
| | | QueryWrapper<Information> wrapper = new QueryWrapper<>(information); |
| | | return informationMapper.selectCount(wrapper); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void updateStatus(Information information){ |
| | | if(Objects.isNull(information) |
| | | || Objects.isNull(information.getStatus()) |
| | | || Objects.isNull(information.getId()) |
| | | || !(Constants.equalsInteger(information.getStatus(),Constants.ZERO) |
| | | || Constants.equalsInteger(information.getStatus(),Constants.ONE)) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | informationMapper.update(new UpdateWrapper<Information>().lambda().set(Information::getStatus,information.getStatus()).eq(Information::getId,information.getId())); |
| | | } |
| | | } |