Commit bd28d5a2 by 胡懿

修复台账和物资明细统计

parent e6ec36e3
...@@ -66,6 +66,7 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> { ...@@ -66,6 +66,7 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> {
List<CountLedgerInfo> list = entry.getValue(); List<CountLedgerInfo> list = entry.getValue();
CountLedgerInfo cli = new CountLedgerInfo(); CountLedgerInfo cli = new CountLedgerInfo();
Set<String> wNameSet = new HashSet<>(); Set<String> wNameSet = new HashSet<>();
Set<String> sNameSet = new HashSet<>();
String shelvesNames = ""; String shelvesNames = "";
int num = 0; int num = 0;
BigDecimal sum = new BigDecimal(0); BigDecimal sum = new BigDecimal(0);
...@@ -77,17 +78,19 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> { ...@@ -77,17 +78,19 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> {
cli.setName(c.getName()); cli.setName(c.getName());
cli.setType(c.getType()); cli.setType(c.getType());
} }
if (i != list.size() - 1) { sNameSet.add(c.getShelves().getName());
/*if (i != list.size() - 1) {
shelvesNames = shelvesNames + c.getShelves().getName() + ","; shelvesNames = shelvesNames + c.getShelves().getName() + ",";
} else { } else {
shelvesNames = shelvesNames + c.getShelves().getName(); shelvesNames = shelvesNames + c.getShelves().getName();
} }*/
wNameSet.add(c.getShelves().getWarehouse().getName()); wNameSet.add(c.getShelves().getWarehouse().getName());
num += c.getNum(); num += c.getNum();
sum = sum.add(c.getSum()); sum = sum.add(c.getSum());
} }
String wNames = ShelvesUtil.mergerWarehouseName(wNameSet); String wNames = ShelvesUtil.mergerWarehouseName(wNameSet);
cli.setShelvesNames(shelvesNames); String sNames = ShelvesUtil.mergerWarehouseName(sNameSet);
cli.setShelvesNames(sNames);
cli.setWarehouseNames(wNames); cli.setWarehouseNames(wNames);
cli.setNum(num); cli.setNum(num);
cli.setSum(sum); cli.setSum(sum);
......
...@@ -79,6 +79,7 @@ public class StorageService extends CrudService<StorageMapper, Storage> { ...@@ -79,6 +79,7 @@ public class StorageService extends CrudService<StorageMapper, Storage> {
List<CountStorageInfo> list = entry.getValue(); List<CountStorageInfo> list = entry.getValue();
CountStorageInfo csi = new CountStorageInfo(); CountStorageInfo csi = new CountStorageInfo();
Set<String> wNameSet = new HashSet<>(); Set<String> wNameSet = new HashSet<>();
Set<String> sNameSet = new HashSet<>();
String shelvesNames = ""; String shelvesNames = "";
int num = 0; int num = 0;
BigDecimal sum = new BigDecimal(0); BigDecimal sum = new BigDecimal(0);
...@@ -92,17 +93,19 @@ public class StorageService extends CrudService<StorageMapper, Storage> { ...@@ -92,17 +93,19 @@ public class StorageService extends CrudService<StorageMapper, Storage> {
csi.setState(c.getState()); csi.setState(c.getState());
csi.setAmount(c.getAmount()); csi.setAmount(c.getAmount());
} }
if (i != list.size() - 1) { sNameSet.add(c.getShelves().getName());
/*if (i != list.size() - 1) {
shelvesNames = shelvesNames + c.getShelves().getName() + ","; shelvesNames = shelvesNames + c.getShelves().getName() + ",";
} else { } else {
shelvesNames = shelvesNames + c.getShelves().getName(); shelvesNames = shelvesNames + c.getShelves().getName();
} }*/
wNameSet.add(c.getWarehouse().getName()); wNameSet.add(c.getWarehouse().getName());
num += c.getNum(); num += c.getNum();
sum = sum.add(c.getSum()); sum = sum.add(c.getSum());
} }
String wNames = ShelvesUtil.mergerWarehouseName(wNameSet); String wNames = ShelvesUtil.mergerWarehouseName(wNameSet);
csi.setShelvesNames(shelvesNames); String sNames = ShelvesUtil.mergerWarehouseName(sNameSet);
csi.setShelvesNames(sNames);
csi.setWarehouseNames(wNames); csi.setWarehouseNames(wNames);
csi.setNum(num); csi.setNum(num);
csi.setSum(sum); csi.setSum(sum);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment