|
@@ -124,6 +124,14 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
|
|
|
dOutSum = ret.getNumber();
|
|
|
}
|
|
|
ret.setOutboundNumber(dOutSum);
|
|
|
+
|
|
|
+ List<AccessorItem> accessorItemList = fabricLossMapper.getSoAccList(code);
|
|
|
+ accessorItemList.forEach(e->e.setFileurl("/report/FabricLoss/getFile?fileId="+e.getCFileId()+"&filename="+e.getFilename()));
|
|
|
+ ret.setAccessorItemList(accessorItemList);
|
|
|
+
|
|
|
+ List<AccessorItem> omAccList = fabricLossMapper.getOmAccList(code);
|
|
|
+ omAccList.forEach(e->e.setFileurl("/report/FabricLoss/getFile?fileId="+e.getCFileId()+"&filename="+e.getFilename()));
|
|
|
+
|
|
|
|
|
|
List<FabricPoOrder> fabricPoOrderListTmp = fabricLossMapper.getPurchaseList(code);
|
|
|
|
|
@@ -314,6 +322,11 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
|
|
|
|
|
|
fabricOMOrderList1 = setFabricOMOrderOutDetail(fabricOMOrderList1, code);
|
|
|
fabricOMOrderList1 = setFabricOMOrderInDetail(fabricOMOrderList1, code);
|
|
|
+
|
|
|
+ fabricOMOrderList1.forEach(e->{
|
|
|
+ List<AccessorItem> accessorItemList1 = omAccList.stream().filter(a->a.getCInvId().equals(e.getCInvCode()+e.getCColor())).collect(Collectors.toList());
|
|
|
+ e.setAccessorItemList(accessorItemList1);
|
|
|
+ });
|
|
|
|
|
|
for (FabricOMOrder fabricOMOrder : fabricOMOrderList1){
|
|
|
double dLoss = 0;
|
|
@@ -365,15 +378,26 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
|
|
|
newItem.setCVenName(fabricCostInvoice.getCVenName());
|
|
|
newItem.setCVenAbbName(fabricCostInvoice.getCVenAbbName());
|
|
|
newItem.setIUnitCost(fabricCostInvoice.getIUnitCost());
|
|
|
+ fabricCostInvoiceList.add(newItem);
|
|
|
+ }
|
|
|
+
|
|
|
+ Double money = newItem.getIMoney();
|
|
|
+ for (FabricOMOrder omOrder : fabricOMOrderList1){
|
|
|
+ List<FabricMoOrderCK> ckList = omOrder.getFabricMoOrderCKList();
|
|
|
+ if (ckList != null) {
|
|
|
+ List<FabricMoOrderCK> findList1 = ckList.stream().filter(e->
|
|
|
+ e.getCInvCodeOut().equals(fabricCostInvoice.getCInvCode()) &&
|
|
|
+ e.getCColorOut().equals(fabricCostInvoice.getCColor())).collect(Collectors.toList());
|
|
|
+
|
|
|
+ for (FabricMoOrderCK ckItem : findList1) {
|
|
|
+ money+=ckItem.getIMoney();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
- double outSum = fabricOMOrderList1.stream().filter(e->
|
|
|
- e.getCVCName().equals(fabricCostInvoice.getCVCName()) &&
|
|
|
- e.getCVenAbbName().equals(fabricCostInvoice.getCVenAbbName()) &&
|
|
|
- e.getCInvCode().equals(fabricCostInvoice.getCInvCode())).mapToDouble(FabricOMOrder::getIQuantityOut).sum();
|
|
|
- outSum *=newItem.getIUnitCost();
|
|
|
- outSum += newItem.getIMoney();
|
|
|
+ BigDecimal bdValue = new BigDecimal(money);
|
|
|
+ newItem.setIMoney(bdValue.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
|
|
|
|
|
|
- newItem.setIMoney(outSum);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -393,8 +417,10 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
|
|
|
if (fabricCostInvoiceListTmp.size()>0){
|
|
|
fabricCostInvoiceListOrder.addAll(fabricCostInvoiceListTmp);
|
|
|
}
|
|
|
- fabricCostInvoiceListTmp = fabricCostInvoiceList.stream().filter(e->e.getCVCName().indexOf("织")!=0&&e.getCVCName().indexOf("染")!=0&&e.getCVCName().indexOf("印")!=0).collect(Collectors.toList());
|
|
|
- if (fabricOMOrderListTmp.size()>0){
|
|
|
+ fabricCostInvoiceListTmp = fabricCostInvoiceList.stream().filter(e-> {
|
|
|
+ return fabricCostInvoiceListOrder.stream().filter(x->x.getCVCName().equals(e.getCVCName())).count()==0;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ if (fabricCostInvoiceListTmp.size()>0){
|
|
|
fabricCostInvoiceListOrder.addAll(fabricCostInvoiceListTmp);
|
|
|
}
|
|
|
fabricCostInvoiceList = fabricCostInvoiceListOrder;
|
|
@@ -699,7 +725,7 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
|
|
|
|
|
|
findInCanSetList = findInCanSetList.stream().filter(in->{
|
|
|
return findOutCanSetList.stream().filter(out->
|
|
|
- oConvertUtils.getInt(in.get("MODetailsID")).equals(out.getMODetailsID())).count()>0;
|
|
|
+ out.getMODetailsID() == oConvertUtils.getInt(in.get("MODetailsID"),0)).count()>0;
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
for (Map<String,Object> item : findInCanSetList){
|
|
@@ -897,4 +923,14 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
|
|
|
|
|
|
return ret;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public byte[] getFileContent(String fileId){
|
|
|
+ List<Map<String,Object>> fileContentList = fabricLossMapper.getAccDetail(fileId);
|
|
|
+ if (fileContentList.size()>0){
|
|
|
+ return (byte[])fileContentList.get(0).get("FileContent");
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|