|
|
@@ -66,6 +66,11 @@ public class TauvWaterSpectrumServiceImpl extends BaseServiceImpl<TauvWaterSpect |
|
|
|
} |
|
|
|
IPage page = new Page(query.getPage(), query.getPageSize()); |
|
|
|
IPage<TauvWaterSpectrum> list = baseMapper.selectPage(page, wrapper); |
|
|
|
if (list.getRecords() != null && list.getRecords().size() > 0) { |
|
|
|
for (TauvWaterSpectrum item : list.getRecords()) { |
|
|
|
item = getDetailData(item); |
|
|
|
} |
|
|
|
} |
|
|
|
return response.success(list); |
|
|
|
} |
|
|
|
|
|
|
@@ -120,22 +125,22 @@ public class TauvWaterSpectrumServiceImpl extends BaseServiceImpl<TauvWaterSpect |
|
|
|
public Response editSpectrum(TauvWaterSpectrum waterSpectrum) { |
|
|
|
// 处理图片路径 |
|
|
|
if (StringUtils.isNotEmpty(waterSpectrum.getCodPic()) && waterSpectrum.getCodPic().contains(uploadFolder)) { |
|
|
|
waterSpectrum.setCodPic(waterSpectrum.getCodPic().replace(uploadFolder, uploadUrl)); |
|
|
|
waterSpectrum.setCodPic(waterSpectrum.getCodPic().replace(uploadFolder, "")); |
|
|
|
} |
|
|
|
if (StringUtils.isNotEmpty(waterSpectrum.getNh3nPic()) && waterSpectrum.getNh3nPic().contains(uploadFolder)) { |
|
|
|
waterSpectrum.setNh3nPic(waterSpectrum.getNh3nPic().replace(uploadFolder, uploadUrl)); |
|
|
|
waterSpectrum.setNh3nPic(waterSpectrum.getNh3nPic().replace(uploadFolder, "")); |
|
|
|
} |
|
|
|
if (StringUtils.isNotEmpty(waterSpectrum.getTpPic()) && waterSpectrum.getTpPic().contains(uploadFolder)) { |
|
|
|
waterSpectrum.setTpPic(waterSpectrum.getTpPic().replace(uploadFolder, uploadUrl)); |
|
|
|
waterSpectrum.setTpPic(waterSpectrum.getTpPic().replace(uploadFolder, "")); |
|
|
|
} |
|
|
|
if (StringUtils.isNotEmpty(waterSpectrum.getTnPic()) && waterSpectrum.getTnPic().contains(uploadFolder)) { |
|
|
|
waterSpectrum.setTnPic(waterSpectrum.getTnPic().replace(uploadFolder, uploadUrl)); |
|
|
|
waterSpectrum.setTnPic(waterSpectrum.getTnPic().replace(uploadFolder, "")); |
|
|
|
} |
|
|
|
if (StringUtils.isNotEmpty(waterSpectrum.getDoPic()) && waterSpectrum.getDoPic().contains(uploadFolder)) { |
|
|
|
waterSpectrum.setDoPic(waterSpectrum.getDoPic().replace(uploadFolder, uploadUrl)); |
|
|
|
waterSpectrum.setDoPic(waterSpectrum.getDoPic().replace(uploadFolder, "")); |
|
|
|
} |
|
|
|
if (StringUtils.isNotEmpty(waterSpectrum.getTubPic()) && waterSpectrum.getTubPic().contains(uploadFolder)) { |
|
|
|
waterSpectrum.setTubPic(waterSpectrum.getTubPic().replace(uploadFolder, uploadUrl)); |
|
|
|
waterSpectrum.setTubPic(waterSpectrum.getTubPic().replace(uploadFolder, "")); |
|
|
|
} |
|
|
|
Boolean res = updateById(waterSpectrum); |
|
|
|
if (!res) { |
|
|
@@ -153,4 +158,32 @@ public class TauvWaterSpectrumServiceImpl extends BaseServiceImpl<TauvWaterSpect |
|
|
|
update(wrapper); |
|
|
|
return response.success("删除成功"); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 处理图片路径 |
|
|
|
* @param waterSpectrum |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public TauvWaterSpectrum getDetailData(TauvWaterSpectrum waterSpectrum) { |
|
|
|
if (StringUtils.isNotEmpty(waterSpectrum.getCodPic()) && !waterSpectrum.getCodPic().contains("http")) { |
|
|
|
waterSpectrum.setCodPic(uploadUrl + waterSpectrum.getCodPic()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotEmpty(waterSpectrum.getNh3nPic()) && !waterSpectrum.getNh3nPic().contains("http")) { |
|
|
|
waterSpectrum.setNh3nPic(uploadUrl + waterSpectrum.getNh3nPic()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotEmpty(waterSpectrum.getTpPic()) && !waterSpectrum.getTpPic().contains("http")) { |
|
|
|
waterSpectrum.setTpPic(uploadUrl + waterSpectrum.getTpPic()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotEmpty(waterSpectrum.getTnPic()) && !waterSpectrum.getTnPic().contains("http")) { |
|
|
|
waterSpectrum.setTnPic(uploadUrl + waterSpectrum.getTnPic()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotEmpty(waterSpectrum.getDoPic()) && !waterSpectrum.getDoPic().contains("http")) { |
|
|
|
waterSpectrum.setDoPic(uploadUrl + waterSpectrum.getDoPic()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotEmpty(waterSpectrum.getTubPic()) && !waterSpectrum.getTubPic().contains("http")) { |
|
|
|
waterSpectrum.setTubPic(uploadUrl + waterSpectrum.getTubPic()); |
|
|
|
} |
|
|
|
return waterSpectrum; |
|
|
|
} |
|
|
|
} |