|
|
@ -28,6 +28,7 @@ import com.elink.esua.epdc.constant.CustomImageConstant; |
|
|
|
import com.elink.esua.epdc.dto.ScreenCompanyDTO; |
|
|
|
import com.elink.esua.epdc.dto.form.EpdcScreenCompanyListFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO; |
|
|
|
import com.elink.esua.epdc.dto.result.ScreenCompanyImagesResultDTO; |
|
|
|
import com.elink.esua.epdc.modules.epidemic.dao.ScreenCompanyDao; |
|
|
|
import com.elink.esua.epdc.modules.epidemic.entity.ScreenCompanyEntity; |
|
|
|
import com.elink.esua.epdc.modules.epidemic.service.ScreenCompanyService; |
|
|
@ -37,6 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
@ -89,7 +91,7 @@ public class ScreenCompanyServiceImpl extends BaseServiceImpl<ScreenCompanyDao, |
|
|
|
ScreenCompanyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenCompanyEntity.class); |
|
|
|
insert(entity); |
|
|
|
// 保存图片
|
|
|
|
customImgService.saveImages(dto.getImages(), entity.getId(), CustomImageConstant.SCREEN_COMPANY_IMAGE); |
|
|
|
this.saveImages(dto.getImages(), entity.getId()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -100,7 +102,7 @@ public class ScreenCompanyServiceImpl extends BaseServiceImpl<ScreenCompanyDao, |
|
|
|
// 删除已有图片
|
|
|
|
customImgService.modifyImagesByReferenceIdAndImgType(entity.getId(), CustomImageConstant.SCREEN_COMPANY_IMAGE); |
|
|
|
// 保存新图片
|
|
|
|
customImgService.saveImages(dto.getImages(), entity.getId(), CustomImageConstant.SCREEN_COMPANY_IMAGE); |
|
|
|
this.saveImages(dto.getImages(), entity.getId()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -117,4 +119,22 @@ public class ScreenCompanyServiceImpl extends BaseServiceImpl<ScreenCompanyDao, |
|
|
|
return baseDao.selectListOfCompanyListForScreen(formDto); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 保存图片 |
|
|
|
* |
|
|
|
* @param dto |
|
|
|
* @param id |
|
|
|
* @return void |
|
|
|
* @author lc |
|
|
|
* @since 2021/9/6 11:06 |
|
|
|
*/ |
|
|
|
private void saveImages(List<ScreenCompanyImagesResultDTO> dto, String id) { |
|
|
|
List<String> images = new ArrayList<>(); |
|
|
|
for (ScreenCompanyImagesResultDTO image: |
|
|
|
dto) { |
|
|
|
images.add(image.getUrl()); |
|
|
|
} |
|
|
|
customImgService.saveImages(images, id, CustomImageConstant.SCREEN_COMPANY_IMAGE); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|