| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xcong.farmer.cms.common.contants.AppContants; |
| | | import com.xcong.farmer.cms.common.response.Result; |
| | | import com.xcong.farmer.cms.configurations.properties.CmsProperties; |
| | | import com.xcong.farmer.cms.modules.system.dto.AdminAddColumnDto; |
| | | import com.xcong.farmer.cms.modules.system.dto.AdminColumnDto; |
| | | import com.xcong.farmer.cms.modules.system.dto.AdminDeleteDto; |
| | |
| | | private ArticleMapper articleMapper; |
| | | @Autowired |
| | | private CompanyMapper companyMapper; |
| | | @Autowired |
| | | private CmsProperties cmsProperties; |
| | | |
| | | @Override |
| | | public Result getColumnInPage(AdminColumnDto adminColumnDto) { |
| | |
| | | columnEntity.setIsNav(adminAddColumnDto.getIsNav()); |
| | | columnEntity.setContentType(adminAddColumnDto.getContentType()); |
| | | this.baseMapper.insert(columnEntity); |
| | | return Result.ok("添加成功"); |
| | | return Result.ok("添加成功", columnEntity.getId()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (columnEntity.getTargetType() == 1) { |
| | | ArticleEntity articleEntity = articleMapper.selectById(Long.parseLong(columnEntity.getTargetUrl())); |
| | | adminSeeColumnInfoVo.setTargetName(articleEntity.getTitle()); |
| | | adminSeeColumnInfoVo.setUrl(cmsProperties.getBaseUrl() + columnEntity.getPath() + "/" + columnEntity.getTargetUrl() + ".html"); |
| | | } else if (columnEntity.getTargetType() == 2) { |
| | | ColumnEntity column = this.baseMapper.selectByCodeAndCompanyId(columnEntity.getTargetUrl(), LoginUserUtil.getCompanyId()); |
| | | adminSeeColumnInfoVo.setTargetName(column.getColumnName()); |
| | | adminSeeColumnInfoVo.setUrl(cmsProperties.getBaseUrl() + column.getPath()); |
| | | } |
| | | } else { |
| | | adminSeeColumnInfoVo.setUrl(cmsProperties.getBaseUrl() + columnEntity.getPath()); |
| | | } |
| | | adminSeeColumnInfoVo.setTargetUrl(columnEntity.getTargetUrl()); |
| | | return Result.ok(adminSeeColumnInfoVo); |
| | |
| | | Long companyId = 0L; |
| | | if(CollUtil.isNotEmpty(companyEntities)){ |
| | | for(CompanyEntity companyEntity : companyEntities){ |
| | | boolean contains = StrUtil.contains(website, companyEntity.getWebAddress()); |
| | | boolean contains = StrUtil.contains(companyEntity.getWebAddress(), website); |
| | | if(contains){ |
| | | companyId = companyEntity.getId(); |
| | | } |