|
|
|
@ -1,6 +1,8 @@ |
|
|
|
package com.zdxt.enforcementcode.service.impl; |
|
|
|
|
|
|
|
import com.zdxt.enforcementcode.domain.bean.EnforcementCarouselBanner; |
|
|
|
import com.zdxt.enforcementcode.domain.bo.ZdxtFileBo; |
|
|
|
import com.zdxt.enforcementcode.service.IZdxtFileService; |
|
|
|
import org.dromara.common.core.utils.MapstructUtils; |
|
|
|
import org.dromara.common.core.utils.StringUtils; |
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|
|
|
@ -32,6 +34,7 @@ import java.util.Collection; |
|
|
|
public class EnforcementCarouselBannerServiceImpl implements IEnforcementCarouselBannerService { |
|
|
|
|
|
|
|
private final EnforcementCarouselBannerMapper baseMapper; |
|
|
|
private final IZdxtFileService zdxtFileService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询轮播公告信息 |
|
|
|
@ -109,12 +112,40 @@ public class EnforcementCarouselBannerServiceImpl implements IEnforcementCarouse |
|
|
|
EnforcementCarouselBanner add = MapstructUtils.convert(bo, EnforcementCarouselBanner.class); |
|
|
|
validEntityBeforeSave(add); |
|
|
|
boolean flag = baseMapper.insert(add) > 0; |
|
|
|
|
|
|
|
//fujian
|
|
|
|
|
|
|
|
if (flag) { |
|
|
|
bo.setId(add.getId()); |
|
|
|
// 保存附件信息
|
|
|
|
if (bo.getFileList() != null && !bo.getFileList().isEmpty()) { |
|
|
|
saveAttachmentFiles(bo.getFileList(), add.getId()); |
|
|
|
} |
|
|
|
} |
|
|
|
return flag; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 批量保存附件信息 |
|
|
|
* |
|
|
|
* @param fileList 附件列表 |
|
|
|
* @param businessId 业务ID(普法服务主表ID) |
|
|
|
*/ |
|
|
|
private void saveAttachmentFiles(List<ZdxtFileBo> fileList, String businessId) { |
|
|
|
for (ZdxtFileBo fileBo : fileList) { |
|
|
|
// 设置业务ID关联
|
|
|
|
fileBo.setBusinessId(businessId); |
|
|
|
|
|
|
|
// 保存附件
|
|
|
|
try { |
|
|
|
zdxtFileService.insertByBo(fileBo); |
|
|
|
log.info("成功保存附件: businessId={}, fileName={}", businessId, fileBo.getFileName()); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("保存附件失败: businessId={}, fileName={}, error={}", |
|
|
|
businessId, fileBo.getFileName(), e.getMessage(), e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
/** |
|
|
|
* 修改轮播公告信息 |
|
|
|
* |
|
|
|
|