Commit bd28d5a2 by 胡懿

修复台账和物资明细统计

parent e6ec36e3
......@@ -66,6 +66,7 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> {
List<CountLedgerInfo> list = entry.getValue();
CountLedgerInfo cli = new CountLedgerInfo();
Set<String> wNameSet = new HashSet<>();
Set<String> sNameSet = new HashSet<>();
String shelvesNames = "";
int num = 0;
BigDecimal sum = new BigDecimal(0);
......@@ -77,17 +78,19 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> {
cli.setName(c.getName());
cli.setType(c.getType());
}
if (i != list.size() - 1) {
sNameSet.add(c.getShelves().getName());
/*if (i != list.size() - 1) {
shelvesNames = shelvesNames + c.getShelves().getName() + ",";
} else {
shelvesNames = shelvesNames + c.getShelves().getName();
}
}*/
wNameSet.add(c.getShelves().getWarehouse().getName());
num += c.getNum();
sum = sum.add(c.getSum());
}
String wNames = ShelvesUtil.mergerWarehouseName(wNameSet);
cli.setShelvesNames(shelvesNames);
String sNames = ShelvesUtil.mergerWarehouseName(sNameSet);
cli.setShelvesNames(sNames);
cli.setWarehouseNames(wNames);
cli.setNum(num);
cli.setSum(sum);
......
......@@ -79,6 +79,7 @@ public class StorageService extends CrudService<StorageMapper, Storage> {
List<CountStorageInfo> list = entry.getValue();
CountStorageInfo csi = new CountStorageInfo();
Set<String> wNameSet = new HashSet<>();
Set<String> sNameSet = new HashSet<>();
String shelvesNames = "";
int num = 0;
BigDecimal sum = new BigDecimal(0);
......@@ -92,17 +93,19 @@ public class StorageService extends CrudService<StorageMapper, Storage> {
csi.setState(c.getState());
csi.setAmount(c.getAmount());
}
if (i != list.size() - 1) {
sNameSet.add(c.getShelves().getName());
/*if (i != list.size() - 1) {
shelvesNames = shelvesNames + c.getShelves().getName() + ",";
} else {
shelvesNames = shelvesNames + c.getShelves().getName();
}
}*/
wNameSet.add(c.getWarehouse().getName());
num += c.getNum();
sum = sum.add(c.getSum());
}
String wNames = ShelvesUtil.mergerWarehouseName(wNameSet);
csi.setShelvesNames(shelvesNames);
String sNames = ShelvesUtil.mergerWarehouseName(sNameSet);
csi.setShelvesNames(sNames);
csi.setWarehouseNames(wNames);
csi.setNum(num);
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