|
@@ -24,6 +24,7 @@ import com.ruoyi.warehouseBusiness.service.impl.BillnoSerialServiceImpl;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
@@ -256,11 +257,37 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
|
|
|
@Override
|
|
|
public List<Map<String, Object>> warehouseBillsFeesList(TWareHouseFees tWareHouseFees) {
|
|
|
+ List<Map<String, Object>> maps =new ArrayList<Map<String, Object>>();
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("tWareHouseFees", tWareHouseFees);
|
|
|
- return tFeeMapper.warehouseBillsFeesList(map);
|
|
|
+ List<Map<String, Object>> mapList = tFeeMapper.warehouseBillsFeesList(map);
|
|
|
+ if (mapList != null && mapList.size() > 0) {
|
|
|
+ String fAmtdr = null; // 金额
|
|
|
+ String fAmt = null; // 结算
|
|
|
+ for (Map<String, Object> m : mapList) {
|
|
|
+ for (String k : m.keySet()) {
|
|
|
+ if (k.equals("fAmtdr")) {
|
|
|
+ fAmtdr = m.get(k).toString();
|
|
|
+ }
|
|
|
+ if (k.equals("fAmt")) {
|
|
|
+ fAmt = m.get(k).toString();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ BigDecimal result = calculation1(fAmtdr, fAmt);
|
|
|
+ m.put("fAmtdr",result);
|
|
|
+ m.put("fAmt",result);
|
|
|
+ maps.add(m);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return maps;
|
|
|
}
|
|
|
|
|
|
+ public static BigDecimal calculation1(String fTotalgross, String fGrossweightblc) {
|
|
|
+ BigDecimal num1 = new BigDecimal(fTotalgross);
|
|
|
+ BigDecimal num2 = new BigDecimal(fGrossweightblc);
|
|
|
+ BigDecimal result = num1.subtract(num2);
|
|
|
+ return result.setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public AjaxResult confirm(String tfee, String tfeeDo, LoginUser loginUser, String fBilltype) {
|