| | |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.CarouselMapper; |
| | | import com.doumee.dao.business.model.Carousel; |
| | | import com.doumee.dao.dto.FootDataDTO; |
| | | import com.doumee.dao.system.model.SystemDictData; |
| | | import com.doumee.dao.vo.FootDataVO; |
| | | import com.doumee.service.business.CarouselService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.doumee.service.system.SystemDictDataService; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | @Autowired |
| | | private SystemDictDataService systemDictDataService; |
| | | |
| | | @Override |
| | | public Integer create(Carousel carousel) { |
| | |
| | | QueryWrapper<Carousel> wrapper = new QueryWrapper<>(carousel); |
| | | return carouselMapper.selectCount(wrapper); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public FootDataVO getFoodDataVO(){ |
| | | FootDataVO footDataVO = new FootDataVO(); |
| | | 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.setAddress(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.ADDRESS).getCode()); |
| | | footDataVO.setLinkMobile(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()); |
| | | footDataVO.setServerTime(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.SERVER_TIME).getCode()); |
| | | return footDataVO; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public void updFoodDataVO(FootDataDTO footDataDTO) { |
| | | SystemDictData footWords = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.FOOT_WORDS); |
| | | if (Objects.nonNull(footWords)) { |
| | | footWords.setCode(footDataDTO.getFootWords()); |
| | | systemDictDataBiz.updateById(footWords); |
| | | } |
| | | |
| | | SystemDictData footImgUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.FOOT_IMGURL); |
| | | if (Objects.nonNull(footImgUrl)) { |
| | | footImgUrl.setCode(footDataDTO.getFootImgUrl()); |
| | | systemDictDataBiz.updateById(footImgUrl); |
| | | } |
| | | |
| | | SystemDictData linkPhone = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.LINK_PHONE); |
| | | if (Objects.nonNull(linkPhone)) { |
| | | linkPhone.setCode(footDataDTO.getLinkPhone()); |
| | | systemDictDataBiz.updateById(linkPhone); |
| | | } |
| | | |
| | | SystemDictData linkMobile = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.LINK_MOBILE); |
| | | if (Objects.nonNull(linkMobile)) { |
| | | linkMobile.setCode(footDataDTO.getLinkMobile()); |
| | | systemDictDataBiz.updateById(linkMobile); |
| | | } |
| | | |
| | | SystemDictData serverTime = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.SERVER_TIME); |
| | | if (Objects.nonNull(serverTime)) { |
| | | serverTime.setCode(footDataDTO.getServerTime()); |
| | | systemDictDataBiz.updateById(serverTime); |
| | | } |
| | | |
| | | SystemDictData address = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.ADDRESS); |
| | | if (Objects.nonNull(address)) { |
| | | address.setCode(footDataDTO.getAddress()); |
| | | systemDictDataBiz.updateById(address); |
| | | } |
| | | |
| | | SystemDictData solveScheme = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.SOLVE_SCHEME); |
| | | if (Objects.nonNull(solveScheme)) { |
| | | solveScheme.setCode(footDataDTO.getSolveScheme()); |
| | | systemDictDataBiz.updateById(solveScheme); |
| | | } |
| | | |
| | | SystemDictData wisdomSystem = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.WISDOM_SYSTEM); |
| | | if (Objects.nonNull(wisdomSystem)) { |
| | | wisdomSystem.setCode(footDataDTO.getWisdomSystem()); |
| | | systemDictDataBiz.updateById(wisdomSystem); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |