예제 #1
0
  @Override
  public CableInfo getCableInfoById(Integer id) {
    CableInfo temp = cableInfoDao.selectCableInfoById(id);
    if (temp != null) {
      BoxInfo backBoxInfo = temp.getBackBoxInfo();
      if (backBoxInfo != null && backBoxInfo.getLocalePhoto() != null) {
        String name = "box_" + backBoxInfo.getLocalePhoto().getLocalePhotoId() + ".jpg";
        byte[] data = backBoxInfo.getLocalePhoto().getLocalePhoto();
        saveImageToFile(name, data);
        backBoxInfo.getLocalePhoto().setLocalePhoto(null);
        backBoxInfo.getLocalePhoto().setLocalePhotoUrl("/images/" + name);
      }
      BoxInfo froBoxInfo = temp.getFroBoxInfo();
      if (froBoxInfo != null && froBoxInfo.getLocalePhoto() != null) {
        String name = "box_" + froBoxInfo.getLocalePhoto().getLocalePhotoId() + ".jpg";
        byte[] data = froBoxInfo.getLocalePhoto().getLocalePhoto();
        saveImageToFile(name, data);
        froBoxInfo.getLocalePhoto().setLocalePhoto(null);
        froBoxInfo.getLocalePhoto().setLocalePhotoUrl("/images/" + name);
      }
    }

    return temp;
  }
예제 #2
0
 @Override
 public Integer getCableInfosCount() {
   return cableInfoDao.selectCableInfoCount();
 }
예제 #3
0
 @Override
 public List<CableInfo> getCableInfoList(DynamicPagination dynamicPagination) {
   List<CableInfo> datas = cableInfoDao.selectCableInfoList();
   return limit(
       datas, dynamicPagination.getStartIndex().intValue(), dynamicPagination.getPageSize());
 }