| | |
| | | import com.lf.server.helper.RestHelper; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.mapper.data.PublishMapper; |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Autowired |
| | | PublishMapper publishMapper; |
| | | |
| | | @Autowired |
| | | FmeService fmeService; |
| | | |
| | | private final static Log log = LogFactory.getLog(PublishService.class); |
| | | |
| | | @Override |
| | | public Integer selectCount(String name) { |
| | |
| | | @Override |
| | | public PublishEntity selectById(int id) { |
| | | return publishMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<PublishEntity> selectByIds(String ids) { |
| | | return publishMapper.selectByIds(ids); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 删除多条 |
| | | */ |
| | | public Integer deletes(List<Integer> idList, HttpServletRequest req) { |
| | | String ids = StringHelper.join(idList, ","); |
| | | |
| | | deleteRes(ids, req); |
| | | |
| | | return deletes(ids); |
| | | } |
| | | |
| | | /** |
| | | * 删除资源 |
| | | */ |
| | | private void deleteRes(String ids, HttpServletRequest req) { |
| | | List<PublishEntity> list = selectByIds(ids); |
| | | if (null == list || list.isEmpty()) { |
| | | return; |
| | | } |
| | | |
| | | for (PublishEntity entity : list) { |
| | | try { |
| | | fmeService.deleteRes(entity.getRegid(), req); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | } |
| | | } |