????2??  ???excel???
????A???????????????????
??????F12????chrome???????excel????????????????????
????HttpClient ??????????????????????? - ?????? - dreamsyeah
???????post?????????????org.apache.httpcomponents??httpmime jar??????Maven?м?????????
????<dependency>
????<groupId>org.apache.httpcomponents</groupId>
????<artifactId>httpmime</artifactId>
????<version>4.5</version>
????</dependency>
?????????????????
????HttpPost httpPost = new HttpPost(url);
????FileBody file = new FileBody(new File(GlobalSetting.getResoucesPath()+fileName));
????HttpEntity reqEntity = MultipartEntityBuilder.create()
????.addPart("myfile"?? file)
????.build();
????httpPost.setEntity(reqEntity);
????CloseableHttpResponse response = httpclient.execute(httpPost);
???????У?fileName?“?????????????????壨????.xlsx”?????????FileBody??????????????MultipartEntityBuilder??????HttpEntity?С?
????B???????????????????????
????HttpClient ??????????????????????? - ?????? - dreamsyeah
?????????????????
????HttpPost httpPost = new HttpPost(url);
????FileBody file = new FileBody(new File(GlobalSetting.getResoucesPath()+fileName));
????StringBody id = new StringBody(PoId??Charset.forName("UTF-8"));
????HttpEntity reqEntity = MultipartEntityBuilder.create()
????.addPart("scheduleId"?? id)
????.addPart("myfile"?? file)
????.build();
????httpPost.setEntity(reqEntity);
????CloseableHttpResponse response = httpclient.execute(httpPost);
???????У?fileName?“??????????????????.xlsx”??PoId?“1033046”?????????FileBody??StringBody????????????MultipartEntityBuilder??????HttpEntity?С?
????3??  POST??????????????
????????????post?????????ж???????????????????????
????HttpClient ??????????????????????? - ?????? - dreamsyeah
???????JSON????List <NameValuePair> nvps = new ArrayList <NameValuePair>()????????
?????????????JSON????
????JSONObject postEntityJSON= new JSONObject();
????postEntityJSON.put("curSupplierAreaId"??"0");
????postEntityJSON.put("endDate"??"1444924799000");
????postEntityJSON.put("limit"??"10");
????postEntityJSON.put("offset"??"0");
????postEntityJSON.put("startDate"??"1410710400000");
????postEntityJSON.put("status"??"0");
??????????????????????????????????????????????
????HttpClient ??????????????????????? - ?????? - dreamsyeah
?????????????????
????HttpPost post = new HttpPost(url);
????post.setHeader("Accept"?? "application/json");
????post.setHeader("Content-Type"?? "application/json");
????post.setEntity(new StringEntity("["+PoId+"]"));
????CloseableHttpResponse response = httpclient.execute(post);
???????У?PoId?“1033046”????????????????????????????Σ??????????????????????????????????????post????弴??????
????4??  ???excel???????
?????????????????????excel??????????????excel????????????鷳???????????java??????????excel????????????????Ч???
?????????maven????????????????????
????<dependency>
????<groupId>org.apache.poi</groupId>
????<artifactId>poi</artifactId>
????<version>3.9</version>
????</dependency>
????<dependency>
????<groupId>org.apache.poi</groupId>
????<artifactId>poi-ooxml</artifactId>
????<version>3.9</version>
????</dependency>
????????poi??????.xls??excel?????poi-ooxml??????.xlsx??excel?????
???????в???????????????
try
{
FileInputStream
file = new FileInputStream(new File(GlobalSetting.getResoucesPath()+excelName));
XSSFWorkbook workbook = new XSSFWorkbook(file);
XSSFSheet sheet = workbook.getSheetAt(0);
int rowNum = sheet.getLastRowNum();
XSSFRow row = sheet.getRow(0);
int index = 0;
for (int i = 2; i <=  rowNum; i++) {
row = sheet.getRow(i);
row.getCell(3).setCellValue(list.get(index++));
}
FileOutputStream out = new FileOutputStream(new
File(GlobalSetting.getResoucesPath()+excelName));
workbook.write(out);
file.close();
out.close();
} catch (Exception e){
e.printStackTrace();
}
????5??  ??????
?????????????????????ZIP??????????????????????????????????????????????????в???????鷳????????java?????????????????
????Java????????zip?????API?????import java.util.zip.*;
????????????????????????????????????????????????????????????????????????????????zip???????????????????????????????洢???????????????ZIP?????