| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import io.swagger.models.auth.In; |
| | | import org.springblade.jfpt.parcel.service.ParcelService; |
| | | import org.springblade.jfpt.parcel.util.DateUtils; |
| | | import org.springblade.jfpt.parcel.util.HttpClientUtils; |
| | |
| | | //获取违禁包裹数据 |
| | | Map<String,Object> result = (Map<String,Object>)getParcelDataPageList(conditionVo, PARCEL_DETAIL_RUL, PARCEL_KEY, PARCEL_SECRET).get("result"); |
| | | if (null!=result) { |
| | | //提取违禁品数据 |
| | | List<Object> dataList = JSON.parseArray(result.get("data").toString()); |
| | | for (Object data : dataList) { |
| | | //取出list里面的值转为map |
| | | Map<String, Object> objectMap = (Map<String, Object>) data; |
| | | //获取违禁包裹名称,包裹Id,包裹图片,过机时间 |
| | | String checkMachineName = objectMap.get("checkMachineName").toString(); |
| | | String packageId = objectMap.get("packageId").toString(); |
| | | String imgUrl = objectMap.get("imgUrl").toString(); |
| | | String samplingTime = objectMap.get("samplingTime").toString(); |
| | | //获取违禁品集合数据 |
| | | List<Object> detailVoList = JSON.parseArray(objectMap.get("coordsDetailVoList").toString()); |
| | | //遍历违禁品集合数据 |
| | | for (Object detailVo : detailVoList) { |
| | | //封装违禁包裹信息 |
| | | Map<String, Object> detailVoMap = (Map<String, Object>) detailVo; |
| | | detailVoMap.put("checkMachineName", checkMachineName); |
| | | detailVoMap.put("packageId", packageId); |
| | | detailVoMap.put("imgUrl", imgUrl); |
| | | detailVoMap.put("samplingTime", samplingTime); |
| | | list.add(detailVoMap); |
| | | //获取总违禁包裹数量 |
| | | Integer totalSize = Integer.parseInt(result.get("totalSize").toString()); |
| | | int total = totalSize/conditionVo.getCurrentPage() +1 ; |
| | | for (int i = 0;i<total;i++){ |
| | | conditionVo.setCurrentPage(i+1); |
| | | //获取违禁包裹数据 |
| | | Map<String,Object> resultData = (Map<String,Object>)getParcelDataPageList(conditionVo, PARCEL_DETAIL_RUL, PARCEL_KEY, PARCEL_SECRET).get("result"); |
| | | //提取违禁品数据 |
| | | List<Object> dataList = JSON.parseArray(resultData.get("data").toString()); |
| | | for (Object data : dataList) { |
| | | //取出list里面的值转为map |
| | | Map<String, Object> objectMap = (Map<String, Object>) data; |
| | | //获取违禁包裹名称,包裹Id,包裹图片,过机时间 |
| | | String checkMachineName = objectMap.get("checkMachineName").toString(); |
| | | String packageId = objectMap.get("packageId").toString(); |
| | | String imgUrl = objectMap.get("imgUrl").toString(); |
| | | String samplingTime = objectMap.get("samplingTime").toString(); |
| | | //获取违禁品集合数据 |
| | | List<Object> detailVoList = JSON.parseArray(objectMap.get("coordsDetailVoList").toString()); |
| | | //遍历违禁品集合数据 |
| | | for (Object detailVo : detailVoList) { |
| | | //封装违禁包裹信息 |
| | | Map<String, Object> detailVoMap = (Map<String, Object>) detailVo; |
| | | detailVoMap.put("checkMachineName", checkMachineName); |
| | | detailVoMap.put("packageId", packageId); |
| | | detailVoMap.put("imgUrl", imgUrl); |
| | | detailVoMap.put("samplingTime", samplingTime); |
| | | list.add(detailVoMap); |
| | | } |
| | | } |
| | | } |
| | | //对组装好的违禁品集合数据排序,按时间 |