|
@@ -30,6 +30,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import java.io.Serializable;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.BigInteger;
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -320,7 +321,8 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap
|
|
|
if(fabricOMOrder.getCInvName().equals(syTransfer.getGoodsName())){
|
|
|
Double unitCost=fabricOMOrder.getFabricMoOrderRKList().stream().mapToDouble(FabricMoOrderRK::getIPrice).average().orElse(0d);
|
|
|
syTransfer.setUnitCost(new BigDecimal(unitCost));
|
|
|
- syTransfer.setCost(syTransfer.getUnitCost().multiply(new BigDecimal(syTransfer.getNumber())));
|
|
|
+ syTransfer.setCost(syTransfer.getUnitCost().multiply(new BigDecimal(syTransfer.getNumber())).setScale(2, RoundingMode.HALF_UP));
|
|
|
+// syTransfer.setCost(syTransfer.getUnitCost().multiply(new BigDecimal(syTransfer.getNumber())));
|
|
|
cost=cost.add(syTransfer.getCost());
|
|
|
}
|
|
|
}
|