qa-prevention-gwj/src/main/java/com/zcloud/service/bus/impl/ImgFilesServiceImpl.java

157 lines
3.4 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package com.zcloud.service.bus.impl;
import java.util.ArrayList;
import java.util.List;
import com.zcloud.util.Tools;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.bus.ImgFilesMapper;
import com.zcloud.service.bus.ImgFilesService;
/**
* 说明:图片管理
* 作者luoxiaobao
* 时间2020-12-24
* 官网www.zcloudchina.com
*/
@Service
@Transactional //开启事物
public class ImgFilesServiceImpl implements ImgFilesService{
@Autowired
private ImgFilesMapper imgfilesMapper;
/**新增
* @param pd
* @throws Exception
*/
public void save(PageData pd)throws Exception{
imgfilesMapper.save(pd);
}
/**删除
* @param pd
* @throws Exception
*/
public void delete(PageData pd)throws Exception{
imgfilesMapper.delete(pd);
}
/**删除
* @param pd
* @throws Exception
*/
public void deleteList(PageData pd)throws Exception{
imgfilesMapper.deleteList(pd);
}
/**修改
* @param pd
* @throws Exception
*/
public void edit(PageData pd)throws Exception{
imgfilesMapper.edit(pd);
}
/**列表
* @param page
* @throws Exception
*/
public List<PageData> list(Page page)throws Exception{
return imgfilesMapper.datalistPage(page);
}
/**列表(全部)
* @param pd
* @throws Exception
*/
public List<PageData> listAll(PageData pd)throws Exception{
return imgfilesMapper.listAll(pd);
}
/**通过id获取数据
* @param pd
* @throws Exception
*/
public PageData findById(PageData pd)throws Exception{
return imgfilesMapper.findById(pd);
}
/**批量删除
* @param ArrayDATA_IDS
* @throws Exception
*/
public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
imgfilesMapper.deleteAll(ArrayDATA_IDS);
}
/**列表(全部)
* @param pd
* @throws Exception
*/
public List<PageData> listAllByIds(PageData pd)throws Exception{
return imgfilesMapper.listAllByIds(pd);
}
/**
* 根据标识 和 类型获取 附件信息
* @param key
* @param type
* @return
* @throws Exception
*/
public List<PageData> getListByKeyAndType (Object key ,String type) throws Exception{
if(!Tools.isEmpty(key)){
PageData pd = new PageData();
pd.put("FOREIGN_KEY",key);
pd.put("TYPE", type);
return imgfilesMapper.listAll(pd);
}
return new ArrayList<>();
}
/**
* 根据标识 和 类型获取 附件信息
* @param key
* @param type
* @return
* @throws Exception
*/
public List<PageData> getListByKeyAndTypeV2 (PageData pd, String key ,String type) throws Exception{
if(!Tools.isEmpty(pd)){
PageData img = new PageData();
pd.put("FOREIGN_KEY",pd.get(key));
pd.put("TYPE", type);
return imgfilesMapper.listAll(pd);
}
return null;
}
@Override
public void deleteInspectionHiddenFile(PageData pd) throws Exception {
imgfilesMapper.deleteInspectionHiddenFile(pd);
}
@Override
public void deleteByPath(PageData pd) throws Exception {
imgfilesMapper.deleteByPath(pd);
}
@Override
public void hideImg(PageData forward) {
imgfilesMapper.hideImg(forward);
}
public List<PageData> getListByKeyAndType (Object key) throws Exception{
if(!Tools.isEmpty(key)){
PageData pd = new PageData();
pd.put("FOREIGN_KEY",key);
return imgfilesMapper.listAll(pd);
}
return new ArrayList<>();
}
}