|
@@ -226,44 +226,34 @@ public class invbal extends Controller {
|
|
|
String itemclass=itemclassRowsMap.get(row.getString("itemid")).toJsonArray("itemclassname").toString().substring(1,itemclassRowsMap.get(row.getString("itemid")).toJsonArray("itemclassname").toString().length()-1);
|
|
String itemclass=itemclassRowsMap.get(row.getString("itemid")).toJsonArray("itemclassname").toString().substring(1,itemclassRowsMap.get(row.getString("itemid")).toJsonArray("itemclassname").toString().length()-1);
|
|
|
row.put("itemclass", itemclass.replaceAll("\"", ""));
|
|
row.put("itemclass", itemclass.replaceAll("\"", ""));
|
|
|
if(sumQtyRowsMap.get(row.getString("itemno")).isNotEmpty()){
|
|
if(sumQtyRowsMap.get(row.getString("itemno")).isNotEmpty()){
|
|
|
- row.put("unsoldqty", sumQtyRowsMap.get(row.getString("itemno")).get(0).getBigDecimal("qty"));
|
|
|
|
|
|
|
+ row.put("unsoldqty", sumQtyRowsMap.get(row.getString("itemno")).get(0).getBigDecimal("qty").stripTrailingZeros().toPlainString());
|
|
|
}else {
|
|
}else {
|
|
|
- row.put("unsoldqty", BigDecimal.ZERO);
|
|
|
|
|
|
|
+ row.put("unsoldqty", BigDecimal.ZERO.stripTrailingZeros().toPlainString());
|
|
|
}
|
|
}
|
|
|
if(sumUnQtyRowsMap.get(row.getString("itemno")).isNotEmpty()){
|
|
if(sumUnQtyRowsMap.get(row.getString("itemno")).isNotEmpty()){
|
|
|
- row.put("undelqty", sumUnQtyRowsMap.get(row.getString("itemno")).get(0).getBigDecimal("undeliqty"));
|
|
|
|
|
- row.put("qty", sumUnQtyRowsMap.get(row.getString("itemno")).get(0).getBigDecimal("qty"));
|
|
|
|
|
|
|
+ row.put("undelqty", sumUnQtyRowsMap.get(row.getString("itemno")).get(0).getBigDecimal("undeliqty").stripTrailingZeros().toPlainString());
|
|
|
|
|
+ row.put("qty", sumUnQtyRowsMap.get(row.getString("itemno")).get(0).getBigDecimal("qty").stripTrailingZeros().toPlainString());
|
|
|
}else {
|
|
}else {
|
|
|
- row.put("undelqty", BigDecimal.ZERO);
|
|
|
|
|
- row.put("qty", BigDecimal.ZERO);
|
|
|
|
|
|
|
+ row.put("undelqty", BigDecimal.ZERO.stripTrailingZeros().toPlainString());
|
|
|
|
|
+ row.put("qty", BigDecimal.ZERO.stripTrailingZeros().toPlainString());
|
|
|
}
|
|
}
|
|
|
if(!row.containsKey("invbalqty")){
|
|
if(!row.containsKey("invbalqty")){
|
|
|
- row.put("invbalqty",BigDecimal.ZERO);
|
|
|
|
|
|
|
+ row.put("invbalqty",BigDecimal.ZERO.stripTrailingZeros().toPlainString());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
for (Row row:rows) {
|
|
for (Row row:rows) {
|
|
|
- row.put("canbesent", row.getBigDecimal("invbalqty").subtract(row.getBigDecimal("unsoldqty")));
|
|
|
|
|
- row.put("canbesale", (row.getBigDecimal("invbalqty").subtract(row.getBigDecimal("unsoldqty"))).subtract(row.getBigDecimal("undelqty")));
|
|
|
|
|
|
|
+ row.put("canbesent", (row.getBigDecimal("invbalqty").subtract(row.getBigDecimal("unsoldqty"))).stripTrailingZeros().toPlainString());
|
|
|
|
|
+ row.put("canbesale", ((row.getBigDecimal("invbalqty").subtract(row.getBigDecimal("unsoldqty"))).subtract(row.getBigDecimal("undelqty"))).stripTrailingZeros().toPlainString());
|
|
|
}
|
|
}
|
|
|
if(isExport){
|
|
if(isExport){
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
//去除不需要导出项
|
|
//去除不需要导出项
|
|
|
rows.getFieldList().remove("itemid");
|
|
rows.getFieldList().remove("itemid");
|
|
|
rows.getFieldList().remove("packageqty");
|
|
rows.getFieldList().remove("packageqty");
|
|
|
rows.getFieldList().remove("qty");
|
|
rows.getFieldList().remove("qty");
|
|
|
- //添加
|
|
|
|
|
- rows.getFieldList().add("canbesent");
|
|
|
|
|
- rows.getFieldList().add("canbesale");
|
|
|
|
|
- rows.getFieldList().add("invbalqty");
|
|
|
|
|
- rows.getFieldList().add("undelqty");
|
|
|
|
|
- ArrayList<String> keylist = rows.getFieldList();
|
|
|
|
|
- for (String str:
|
|
|
|
|
- keylist) {
|
|
|
|
|
- Class fieldclazztype = rows.getFieldMeta(str).getFieldtype();
|
|
|
|
|
- }
|
|
|
|
|
- System.out.println(rows.get(0).toString());
|
|
|
|
|
-
|
|
|
|
|
- Rows uploadRows = uploadExcelToObs("invbal", "Erp欠货库存列表", rows, getTitleMap());
|
|
|
|
|
|
|
+ Rows uploadRows = uploadExcelToObs("invbal", "库存列表", rows, getTitleMap());
|
|
|
return getSucReturnObject().setData(uploadRows).toString();
|
|
return getSucReturnObject().setData(uploadRows).toString();
|
|
|
}
|
|
}
|
|
|
return getSucReturnObject().setData(rows).toString();
|
|
return getSucReturnObject().setData(rows).toString();
|