|
|
@ -65,6 +65,7 @@ public class ExcelController { |
|
|
|
String type = jsonObject.getString("type"); |
|
|
|
String companyCode = "LEARPROD-CCJV"; |
|
|
|
String interfaceName = "supplierrsexport"; |
|
|
|
String orderDomain = jsonObject.getString("orderDomain"); |
|
|
|
String domain = "CCJV"; |
|
|
|
if("guowai2".equals(type)) { |
|
|
|
interfaceName = "xxpomrpexport"; |
|
|
@ -87,6 +88,7 @@ public class ExcelController { |
|
|
|
JSONObject ttSearchCondition = new JSONObject(); |
|
|
|
ttSearchCondition.put("order_from", orderNo); |
|
|
|
ttSearchCondition.put("order_to", orderNo); |
|
|
|
ttSearchCondition.put("order_domain", orderDomain); |
|
|
|
jsonArray.add(ttSearchCondition); |
|
|
|
JSONObject dsSearchCondition = new JSONObject(); |
|
|
|
dsSearchCondition.put("ttSearchCondition", jsonArray); |
|
|
@ -164,10 +166,40 @@ public class ExcelController { |
|
|
|
orderArray.add(mainMap.get(mainKey)); |
|
|
|
} |
|
|
|
for(String firmKey : firmMap.keySet()) { |
|
|
|
firmArray.add(firmMap.get(firmKey)); |
|
|
|
JSONObject firm = firmMap.get(firmKey); |
|
|
|
boolean isAllZero = false; |
|
|
|
for(int count = 0; count < orderArray.size(); count++) { |
|
|
|
String cellValue = ""; |
|
|
|
JSONObject object = orderArray.getJSONObject(count); |
|
|
|
JSONObject order = firm.getJSONObject(object.getString("schd_line_line")); |
|
|
|
if(order != null) { |
|
|
|
cellValue = order.getString("schd_line_qty"); |
|
|
|
} |
|
|
|
if(!cellValue.isEmpty() && !cellValue.equals("0")) { |
|
|
|
isAllZero = true; |
|
|
|
} |
|
|
|
} |
|
|
|
if(isAllZero) { |
|
|
|
firmArray.add(firm); |
|
|
|
} |
|
|
|
} |
|
|
|
for(String forecastKey : forecastMap.keySet()) { |
|
|
|
forecastArray.add(forecastMap.get(forecastKey)); |
|
|
|
JSONObject forecast = forecastMap.get(forecastKey); |
|
|
|
boolean isAllZero = false; |
|
|
|
for(int count = 0; count < orderArray.size(); count++) { |
|
|
|
String cellValue = ""; |
|
|
|
JSONObject object = orderArray.getJSONObject(count); |
|
|
|
JSONObject order = forecast.getJSONObject(object.getString("schd_line_line")); |
|
|
|
if(order != null) { |
|
|
|
cellValue = order.getString("schd_line_qty"); |
|
|
|
} |
|
|
|
if(!cellValue.isEmpty() && !cellValue.equals("0")) { |
|
|
|
isAllZero = true; |
|
|
|
} |
|
|
|
} |
|
|
|
if(isAllZero) { |
|
|
|
forecastArray.add(forecastMap.get(forecastKey)); |
|
|
|
} |
|
|
|
} |
|
|
|
if("changchun".equals(type)) {//长春模板
|
|
|
|
fileNames.add(fillChangchun(orderNo, jsonObjectHeader, orderArray, firmArray, forecastArray)); |
|
|
@ -336,7 +368,7 @@ public class ExcelController { |
|
|
|
nextCell.setCellStyle(cellStyle7); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!forecastArray.isEmpty()) { |
|
|
|
if (!forecastArray.isEmpty() && forecastArray.size() > 1) { |
|
|
|
// 合并单元格
|
|
|
|
CellRangeAddress cellRangeAddress3 = new CellRangeAddress(14, 14, firmArray.size() + 6, firmArray.size() + forecastArray.size() + 5); |
|
|
|
sheet.addMergedRegion(cellRangeAddress3); |
|
|
@ -512,7 +544,7 @@ public class ExcelController { |
|
|
|
nextCell.setCellStyle(cellStyle7); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!forecastArray.isEmpty()) { |
|
|
|
if (!forecastArray.isEmpty() && forecastArray.size() > 1) { |
|
|
|
// 合并单元格
|
|
|
|
CellRangeAddress cellRangeAddress3 = new CellRangeAddress(14, 14, firmArray.size() + 9, firmArray.size() + forecastArray.size() + 8); |
|
|
|
sheet.addMergedRegion(cellRangeAddress3); |
|
|
|