|
@@ -32,10 +32,10 @@ public class InformationServiceImpl implements InformationService
|
|
|
private JnbHighServerImgMapper jnbHighServerImgMapper;
|
|
|
|
|
|
@Override
|
|
|
- public Information selectInformationById(Long id)
|
|
|
+ public Information selectInformationById(Long id,Integer type)
|
|
|
{
|
|
|
- Information information = informationMapper.selectInformationById(id);
|
|
|
- information.setImgUrlList(jnbHighServerImgMapper.selectAll(id));
|
|
|
+ Information information = informationMapper.selectInformationById(id,type);
|
|
|
+ information.setImgUrlList(jnbHighServerImgMapper.selectAll(id,information.getType()));
|
|
|
return information;
|
|
|
}
|
|
|
|
|
@@ -46,6 +46,17 @@ public class InformationServiceImpl implements InformationService
|
|
|
return informationMapper.selectInformationList(information);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<Information> selectInformationListWx(Information information)
|
|
|
+ {
|
|
|
+ return informationMapper.selectInformationListWx(information);
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ public List<Information> selectInformationListWxs(Information information)
|
|
|
+ {
|
|
|
+ return informationMapper.selectInformationListWx(information);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -64,6 +75,7 @@ public class InformationServiceImpl implements InformationService
|
|
|
serverImg.setCreateTime(DateUtils.getNowDate());
|
|
|
serverImg.setServerId(entity.getId());
|
|
|
serverImg.setImgUrl(a);
|
|
|
+ serverImg.setType(entity.getType());
|
|
|
imgList.add(serverImg);
|
|
|
});
|
|
|
jnbHighServerImgMapper.saveJnbHighServerImg(imgList);
|
|
@@ -77,20 +89,20 @@ public class InformationServiceImpl implements InformationService
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public int updateInformation(Information entity)
|
|
|
{
|
|
|
- BeanUtils.copyProperties(entity,entity);
|
|
|
entity.setUpdateTime(DateUtils.getNowDate());
|
|
|
entity.setUpdateBy(String.valueOf(SecurityUtils.getUserId()));
|
|
|
int i = informationMapper.updateInformation(entity);
|
|
|
List<String> imgUrlList = Arrays.asList(entity.getImgUrlList().split(","));
|
|
|
if (!ObjectUtils.isEmpty(imgUrlList)){
|
|
|
List<JnbHighServerImg> imgList = new ArrayList<>();
|
|
|
- jnbHighServerImgMapper.deleteJnbHighServerByServerId(entity.getId());
|
|
|
+ jnbHighServerImgMapper.deleteJnbHighServerByServerId(entity.getId(),entity.getType());
|
|
|
imgUrlList.forEach(a->{
|
|
|
JnbHighServerImg serverImg = new JnbHighServerImg();
|
|
|
serverImg.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
|
|
|
serverImg.setCreateTime(DateUtils.getNowDate());
|
|
|
serverImg.setServerId(entity.getId());
|
|
|
serverImg.setImgUrl(a);
|
|
|
+ serverImg.setType(entity.getType());
|
|
|
imgList.add(serverImg);
|
|
|
});
|
|
|
jnbHighServerImgMapper.saveJnbHighServerImg(imgList);
|
|
@@ -101,23 +113,13 @@ public class InformationServiceImpl implements InformationService
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public int deleteInformationByIds(Long[] ids)
|
|
|
+ public int deleteInformationByIds(Long[] ids,Integer type)
|
|
|
{
|
|
|
- int i = informationMapper.deleteInformationByIds(ids);
|
|
|
+ int i = informationMapper.deleteInformationByIds(ids,type);
|
|
|
if (i>0){
|
|
|
- jnbHighServerImgMapper.deleteJnbHighServerByServerIds(ids);
|
|
|
+ jnbHighServerImgMapper.deleteJnbHighServerByServerIds(ids,type);
|
|
|
}
|
|
|
return i;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
- public int deleteInformationById(Long id)
|
|
|
- {
|
|
|
- int i = informationMapper.deleteInformationById(id);
|
|
|
- if (i>0){
|
|
|
- jnbHighServerImgMapper.deleteJnbHighServerByServerId(id);
|
|
|
- }
|
|
|
- return i;
|
|
|
- }
|
|
|
}
|