| | |
| | | package com.smartearth.poiexcel.service; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.google.common.collect.Lists; |
| | | import com.smartearth.poiexcel.entity.*; |
| | | import com.smartearth.poiexcel.mapper.BasicMapper; |
| | | import com.smartearth.poiexcel.mapper.EntMapper; |
| | | import com.smartearth.poiexcel.utils.RestHelper; |
| | | import org.apache.commons.logging.Log; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 插入企业 |
| | | */ |
| | | public Integer insertEnts(List<EntEntity> list) { |
| | | try { |
| | | int rows = 0; |
| | | List<List<EntEntity>> subLists = Lists.partition(list, StaticData.I200); |
| | | for (List<EntEntity> sub : subLists) { |
| | | try { |
| | | rows += entMapper.insertBatch(sub); |
| | | } catch (Exception ex) { |
| | | log.error(ex); |
| | | } |
| | | } |
| | | |
| | | return rows; |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * get请求(Rest) |
| | | */ |
| | | public <T> T getForRest(String url, Class<T> clazz) { |