| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | |
| | | public Integer create(Carousel carousel) { |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(Objects.isNull(carousel) |
| | | || Objects.isNull(carousel.getType()) |
| | | || Objects.isNull(carousel.getImgurl()) |
| | | // || Objects.isNull(carousel.getImgurl()) |
| | | || Objects.isNull(carousel.getJumpType()) |
| | | || Objects.isNull(carousel.getSortnum()) |
| | | || (!Constants.equalsInteger(carousel.getJumpType(),Constants.ZERO) && StringUtils.isEmpty(carousel.getContnet())) |
| | | // || Objects.isNull(carousel.getSortnum()) |
| | | || StringUtils.isEmpty(carousel.getTitle()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | carousel.setType(Constants.ZERO); |
| | | carousel.setIsdeleted(Constants.ZERO); |
| | | carousel.setStatus(Constants.ZERO); |
| | | carousel.setCreateDate(new Date()); |
| | |
| | | |
| | | @Override |
| | | public void deleteById(Integer id) { |
| | | carouselMapper.update(new UpdateWrapper<Carousel>().lambda().set(Carousel::getIsdeleted,Constants.ZERO).eq(Carousel::getId,id)); |
| | | carouselMapper.update(new UpdateWrapper<Carousel>().lambda().set(Carousel::getIsdeleted,Constants.ONE).eq(Carousel::getId,id)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | return; |
| | | } |
| | | carouselMapper.deleteBatchIds(ids); |
| | | for(Integer id :ids){ |
| | | this.deleteById(id); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(Objects.isNull(carousel) |
| | | || Objects.isNull(carousel.getId()) |
| | | || Objects.isNull(carousel.getType()) |
| | | || Objects.isNull(carousel.getImgurl()) |
| | | || Objects.isNull(carousel.getJumpType()) |
| | | || Objects.isNull(carousel.getSortnum()) |
| | | || (!Constants.equalsInteger(carousel.getJumpType(),Constants.ZERO) && StringUtils.isEmpty(carousel.getContnet())) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | |
| | | wrapper.lambda().eq(Carousel::getIsdeleted,Constants.ZERO) |
| | | .eq(Carousel::getStatus,Constants.ZERO) |
| | | .orderByDesc(Carousel::getSortnum); |
| | | return carouselMapper.selectList(wrapper); |
| | | List<Carousel> carouselList = |
| | | carouselMapper.selectList(wrapper); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(carouselList)){ |
| | | String fileDir = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.FILE_DIR).getCode(); |
| | | for (Carousel carousel:carouselList) { |
| | | this.imgFullPath(fileDir,carousel); |
| | | } |
| | | } |
| | | return carouselList; |
| | | } |
| | | |
| | | @Override |
| | |
| | | .eq(pageWrap.getModel().getId() != null, Carousel::getId, pageWrap.getModel().getId()) |
| | | .eq(pageWrap.getModel().getRemark() != null, Carousel::getRemark, pageWrap.getModel().getRemark()) |
| | | .like(pageWrap.getModel().getTitle() != null, Carousel::getTitle, pageWrap.getModel().getTitle()) |
| | | .like(pageWrap.getModel().getDescribe() != null, Carousel::getDescribe, pageWrap.getModel().getDescribe()) |
| | | .eq(pageWrap.getModel().getType() != null, Carousel::getType, pageWrap.getModel().getType()) |
| | | .like(pageWrap.getModel().getDetail() != null, Carousel::getDetail, pageWrap.getModel().getDetail()) |
| | | .eq(pageWrap.getModel().getJumpType() != null, Carousel::getJumpType, pageWrap.getModel().getJumpType()) |
| | | .eq(pageWrap.getModel().getContnet() != null, Carousel::getContnet, pageWrap.getModel().getContnet()) |
| | | .like(pageWrap.getModel().getContent() != null, Carousel::getContent, pageWrap.getModel().getContent()) |
| | | .eq(pageWrap.getModel().getSortnum() != null, Carousel::getSortnum, pageWrap.getModel().getSortnum()) |
| | | .eq(pageWrap.getModel().getStatus() != null, Carousel::getStatus, pageWrap.getModel().getStatus()) |
| | | .orderByDesc(Carousel::getSortnum) |
| | | |
| | | ; |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |
| | |
| | | @Override |
| | | public FootDataVO getFoodDataVO(){ |
| | | FootDataVO footDataVO = new FootDataVO(); |
| | | String path =systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.FILE_DIR).getCode(); |
| | | footDataVO.setFootWords(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.FOOT_WORDS).getCode()); |
| | | footDataVO.setFootImgUrl(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.FILE_DIR).getCode() + systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.FOOT_IMGURL).getCode()); |
| | | footDataVO.setFootImgUrl(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.FOOT_IMGURL).getCode()); |
| | | footDataVO.setFootFullImgUrl(path+ |
| | | footDataVO.getFootImgUrl()); |
| | | footDataVO.setFootImgUrl2(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.FOOT_IMGURL2).getCode()); |
| | | footDataVO.setFootFullImgUrl2(path + |
| | | footDataVO.getFootImgUrl2()); |
| | | footDataVO.setAddress(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.ADDRESS).getCode()); |
| | | footDataVO.setLinkMobile(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.LINK_PHONE).getCode()); |
| | | footDataVO.setLinkPhone(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.LINK_PHONE).getCode()); |
| | | footDataVO.setLinkMobile(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.LINK_MOBILE).getCode()); |
| | | footDataVO.setSolveScheme(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.SOLVE_SCHEME).getCode()); |
| | | footDataVO.setWisdomSystem(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.WISDOM_SYSTEM).getCode()); |
| | | SystemDictData solveScheme = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.SOLVE_SCHEME); |
| | | if(Objects.nonNull(solveScheme) & org.apache.commons.lang3.StringUtils.isNotBlank(solveScheme.getCode())){ |
| | | footDataVO.setSolveScheme(JSONArray.parseArray(solveScheme.getCode())); |
| | | } |
| | | SystemDictData wisdomSystem = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.WISDOM_SYSTEM); |
| | | if(Objects.nonNull(wisdomSystem) & org.apache.commons.lang3.StringUtils.isNotBlank(wisdomSystem.getCode())){ |
| | | footDataVO.setWisdomSystem(JSONArray.parseArray(wisdomSystem.getCode())); |
| | | } |
| | | SystemDictData honors = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.HONORS); |
| | | if(Objects.nonNull(wisdomSystem) & org.apache.commons.lang3.StringUtils.isNotBlank(honors.getCode())){ |
| | | footDataVO.setHonors(JSONArray.parseArray(honors.getCode())); |
| | | } |
| | | footDataVO.setServerTime(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.SERVER_TIME).getCode()); |
| | | return footDataVO; |
| | | } |
| | |
| | | if (Objects.nonNull(footImgUrl)) { |
| | | footImgUrl.setCode(footDataDTO.getFootImgUrl()); |
| | | systemDictDataBiz.updateById(footImgUrl); |
| | | } |
| | | SystemDictData footImgUrl2 = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.FOOT_IMGURL2); |
| | | if (Objects.nonNull(footImgUrl2)) { |
| | | footImgUrl2.setCode(footDataDTO.getFootImgUrl2()); |
| | | systemDictDataBiz.updateById(footImgUrl2); |
| | | } |
| | | |
| | | SystemDictData linkPhone = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.LINK_PHONE); |
| | |
| | | } |
| | | |
| | | SystemDictData solveScheme = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.SOLVE_SCHEME); |
| | | if (Objects.nonNull(solveScheme)) { |
| | | solveScheme.setCode(footDataDTO.getSolveScheme()); |
| | | if (Objects.nonNull(solveScheme)&&Objects.nonNull(footDataDTO.getSolveScheme())) { |
| | | solveScheme.setCode(footDataDTO.getSolveScheme().toString()); |
| | | systemDictDataBiz.updateById(solveScheme); |
| | | } |
| | | |
| | | SystemDictData wisdomSystem = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.WISDOM_SYSTEM); |
| | | if (Objects.nonNull(wisdomSystem)) { |
| | | wisdomSystem.setCode(footDataDTO.getWisdomSystem()); |
| | | if (Objects.nonNull(wisdomSystem)&&Objects.nonNull(footDataDTO.getWisdomSystem())) { |
| | | wisdomSystem.setCode(footDataDTO.getWisdomSystem().toString()); |
| | | systemDictDataBiz.updateById(wisdomSystem); |
| | | } |
| | | SystemDictData honors = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.HONORS); |
| | | if (Objects.nonNull(honors)&&Objects.nonNull(footDataDTO.getHonors())) { |
| | | honors.setCode(footDataDTO.getHonors().toString()); |
| | | systemDictDataBiz.updateById(honors); |
| | | } |
| | | } |
| | | |
| | | |