|
|
@@ -665,28 +665,53 @@ public class OrderItems extends Controller {
|
|
|
}
|
|
|
|
|
|
if (isExport) {
|
|
|
- ExcelFactory excelFactory = new ExcelFactory("订单明细查询");
|
|
|
-
|
|
|
- XSSFSheet sheet = excelFactory.getXssfWorkbook().createSheet("Sheet1");
|
|
|
- XSSFWorkbook xssfFWorkbook = excelFactory.getXssfWorkbook();
|
|
|
-
|
|
|
- CellStyle style = xssfFWorkbook.createCellStyle();
|
|
|
- // 设置为文本格式,防止身份证号变成科学计数法
|
|
|
- DataFormat format = xssfFWorkbook.createDataFormat();
|
|
|
- style.setDataFormat(format.getFormat("@"));
|
|
|
- // 对单独某一列进行样式赋值,第一个参数为列数,第二个参数为样式
|
|
|
- sheet.setDefaultColumnStyle(0, style);
|
|
|
- ExportDown.setBatchDetailSheetColumn1(sheet);// 设置工作薄列宽
|
|
|
- XSSFCellStyle titleCellStyle2 = ExportDown.createTitleCellStyle2(xssfFWorkbook);
|
|
|
- XSSFCellStyle titleCellStyle3 = ExportDown.createBodyCellStyle(xssfFWorkbook);
|
|
|
- ExportDown.batchDetail(sheet, titleCellStyle2, titleCellStyle3, rows);// 写入标题
|
|
|
-
|
|
|
- Rows uploadRows = uploadExcelToObs(excelFactory);
|
|
|
- String url = "";
|
|
|
- if (!uploadRows.isEmpty()) {
|
|
|
- url = uploadRows.get(0).getString("url");
|
|
|
- }
|
|
|
- return getSucReturnObject().setData(url).toString();
|
|
|
+ //去除不需要导出项
|
|
|
+ rows.getFieldList().remove("sa_orderitemsid");
|
|
|
+ rows.getFieldList().remove("itemid");
|
|
|
+ rows.getFieldList().remove("batchcontrol");
|
|
|
+ rows.getFieldList().remove("model");
|
|
|
+ rows.getFieldList().remove("conversionrate");
|
|
|
+ rows.getFieldList().remove("marketprice");
|
|
|
+ rows.getFieldList().remove("defaultprice");
|
|
|
+ rows.getFieldList().remove("defaultamount");
|
|
|
+ rows.getFieldList().remove("auxqty");
|
|
|
+ rows.getFieldList().remove("needdate");
|
|
|
+ rows.getFieldList().remove("deliedqty");
|
|
|
+ rows.getFieldList().remove("rebateamount");
|
|
|
+ rows.getFieldList().remove("invoiceamount");
|
|
|
+ rows.getFieldList().remove("writeoffamount");
|
|
|
+ rows.getFieldList().remove("auxunit");
|
|
|
+ rows.getFieldList().remove("sa_orderid");
|
|
|
+ rows.getFieldList().remove("deliverydate");
|
|
|
+ rows.getFieldList().remove("returnqty");
|
|
|
+ rows.getFieldList().remove("stockno");
|
|
|
+ rows.getFieldList().remove("position");
|
|
|
+ rows.getFieldList().remove("batchno");
|
|
|
+ rows.getFieldList().remove("isfreeze");
|
|
|
+ rows.getFieldList().remove("candispatchqty");
|
|
|
+ rows.getFieldList().remove("cansaleqty");
|
|
|
+ rows.getFieldList().remove("totalaty");
|
|
|
+ rows.getFieldList().remove("orderminqty_auxunit");
|
|
|
+ rows.getFieldList().remove("orderminqty");
|
|
|
+ rows.getFieldList().remove("orderaddqty_auxunit");
|
|
|
+ rows.getFieldList().remove("orderaddqty");
|
|
|
+ rows.getFieldList().remove("spec");
|
|
|
+ rows.getFieldList().remove("packageqty");
|
|
|
+ rows.getFieldList().remove("delivery");
|
|
|
+ rows.getFieldList().remove("erpitemno");
|
|
|
+ rows.getFieldList().remove("erpitemname");
|
|
|
+ rows.getFieldList().remove("prodline");
|
|
|
+ rows.getFieldList().remove("material");
|
|
|
+ rows.getFieldList().remove("device");
|
|
|
+ rows.getFieldList().remove("specalnote");
|
|
|
+ rows.getFieldList().remove("standards");
|
|
|
+ rows.getFieldList().remove("agentnum");
|
|
|
+ rows.getFieldList().remove("enterprisename");
|
|
|
+ rows.getFieldList().remove("stockstatus");
|
|
|
+
|
|
|
+
|
|
|
+ Rows uploadRows = uploadExcelToObs("orderdetail", "订单明细列表", rows, getTitleMapAgent());
|
|
|
+ return getSucReturnObject().setData(uploadRows).toString();
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -725,6 +750,27 @@ public class OrderItems extends Controller {
|
|
|
return titleMap;
|
|
|
}
|
|
|
|
|
|
+ //返回导出的标题
|
|
|
+ public HashMap<String, String> getTitleMapAgent() {
|
|
|
+ HashMap<String, String> titleMap = new HashMap<>();
|
|
|
+ titleMap.put("rowno", "行号");
|
|
|
+ titleMap.put("sonum", "订单号");
|
|
|
+ titleMap.put("status", "订单状态");
|
|
|
+ titleMap.put("type", "订单类型");
|
|
|
+ titleMap.put("billdate", "单据日期");
|
|
|
+ titleMap.put("tradefield", "领域");
|
|
|
+ titleMap.put("itemno", "产品编码");
|
|
|
+ titleMap.put("itemname", "品名");
|
|
|
+ titleMap.put("unit", "单位");
|
|
|
+ titleMap.put("qty", "数量");
|
|
|
+ titleMap.put("undeliqty", "未发货数量");
|
|
|
+ titleMap.put("price", "单价");
|
|
|
+ titleMap.put("amount", "金额");
|
|
|
+ titleMap.put("remarks", "订单行备注");
|
|
|
+
|
|
|
+ return titleMap;
|
|
|
+ }
|
|
|
+
|
|
|
@API(title = "查询可添加商品列表", apiversion = R.ID20221109153502.v1.class)
|
|
|
@CACHEING
|
|
|
public String selectItemList() throws YosException {
|