|  |  | 
 |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
 |  |  | import com.doumee.core.constants.ResponseStatus; | 
 |  |  | import com.doumee.core.exception.BusinessException; | 
 |  |  | import com.doumee.core.model.LoginUserInfo; | 
 |  |  | import com.doumee.core.model.PageData; | 
 |  |  | import com.doumee.core.model.PageWrap; | 
 |  |  | import com.doumee.service.business.third.model.LoginUserInfo; | 
 |  |  | import com.doumee.service.business.third.model.PageData; | 
 |  |  | import com.doumee.service.business.third.model.PageWrap; | 
 |  |  | import com.doumee.core.utils.Constants; | 
 |  |  | import com.doumee.dao.system.SystemDictDataMapper; | 
 |  |  | import com.doumee.dao.system.SystemDictMapper; | 
 |  |  | import com.doumee.dao.system.dto.PlatformConfigDTO; | 
 |  |  | import com.doumee.dao.system.dto.QuerySystemDictDataDTO; | 
 |  |  | import com.doumee.dao.system.dto.VisitConfigDTO; | 
 |  |  | import com.doumee.dao.system.model.SystemDict; | 
 |  |  | 
 |  |  | import com.doumee.service.system.SystemDictDataService; | 
 |  |  | import com.github.pagehelper.PageHelper; | 
 |  |  | import com.github.pagehelper.PageInfo; | 
 |  |  | import lombok.extern.java.Log; | 
 |  |  | import org.apache.shiro.SecurityUtils; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.stereotype.Service; | 
 |  |  | 
 |  |  |         } | 
 |  |  |         return ""; | 
 |  |  |     } | 
 |  |  |     @Override | 
 |  |  |     public PlatformConfigDTO getPlatformConfigDTO(){ | 
 |  |  |         PlatformConfigDTO visitConfigDTO = new PlatformConfigDTO(); | 
 |  |  |         SystemDict systemDict = systemDictMapper.selectOne(new QueryWrapper<SystemDict>().lambda().eq(SystemDict::getCode,Constants.PLATFORM)); | 
 |  |  |         if(Objects.isNull(systemDict)){ | 
 |  |  |             throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(),"字典类不存在"); | 
 |  |  |         } | 
 |  |  |         List<SystemDictData> systemDictList = systemDictDataMapper.selectList( | 
 |  |  |                 new QueryWrapper<SystemDictData>().lambda().eq(SystemDictData::getDictId,systemDict.getId())); | 
 |  |  |         if(!com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(systemDictList)){ | 
 |  |  |             throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(),"字典不存在"); | 
 |  |  |         } | 
 |  |  |         visitConfigDTO.setBookTips( setDataByLabel(systemDictList,Constants.PLATFORM_BOOKING_TIPS)); | 
 |  |  |         visitConfigDTO.setTipsImg( setDataByLabel(systemDictList,Constants.PLATFORM_GUIDEMAP)); | 
 |  |  |         return visitConfigDTO; | 
 |  |  |     } | 
 |  |  |     @Override | 
 |  |  |     @Transactional | 
 |  |  |     public void updatePlatformConfig(PlatformConfigDTO visitConfigDTO) { | 
 |  |  |         if(Objects.isNull(visitConfigDTO) | 
 |  |  |                 && Objects.isNull(visitConfigDTO.getBookTips()) | 
 |  |  |                 && Objects.isNull(visitConfigDTO.getTipsImg()) | 
 |  |  |         ){ | 
 |  |  |             throw new BusinessException(ResponseStatus.BAD_REQUEST); | 
 |  |  |         } | 
 |  |  |         LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
 |  |  |         if(loginUserInfo == null){ | 
 |  |  |             loginUserInfo = visitConfigDTO.getLoginUserInfo(); | 
 |  |  |         } | 
 |  |  |         SystemDict systemDict = systemDictMapper.selectOne(new QueryWrapper<SystemDict>().lambda().eq(SystemDict::getCode,Constants.PLATFORM)); | 
 |  |  |         if(Objects.isNull(systemDict)){ | 
 |  |  |             systemDict = new SystemDict(); | 
 |  |  |             systemDict.setCreateUser(loginUserInfo.getId()); | 
 |  |  |             systemDict.setCreateTime(new Date()); | 
 |  |  |             systemDict.setUpdateUser(systemDict.getCreateUser()); | 
 |  |  |             systemDict.setUpdateTime(systemDict.getCreateTime()); | 
 |  |  |             systemDict.setCode(Constants.PLATFORM); | 
 |  |  |             systemDict.setRemark("月台相关配置"); | 
 |  |  |             systemDict.setDeleted(Boolean.FALSE); | 
 |  |  |             systemDictMapper.insert(systemDict); | 
 |  |  |         } | 
 |  |  |         List<SystemDictData> systemDictList = systemDictDataMapper.selectList( | 
 |  |  |                 new QueryWrapper<SystemDictData>().lambda().eq(SystemDictData::getDictId,systemDict.getId())); | 
 |  |  |         if(!com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(systemDictList)){ | 
 |  |  |             throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(),"字典不存在"); | 
 |  |  |         } | 
 |  |  |         dealDictData(systemDictList,systemDict.getId(),Constants.PLATFORM_GUIDEMAP,"物流车园区导览图",loginUserInfo, visitConfigDTO.getTipsImg()==null?"":visitConfigDTO.getTipsImg().toString()); | 
 |  |  |         dealDictData(systemDictList,systemDict.getId(),Constants.PLATFORM_BOOKING_TIPS,"物流车预约指南",loginUserInfo, visitConfigDTO.getBookTips()==null?"":visitConfigDTO.getBookTips().toString()); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     @Transactional |