|
@@ -63,6 +63,7 @@ import com.ruoyi.warehouseBusiness.service.impl.BillnoSerialServiceImpl;
|
|
|
import org.apache.commons.compress.utils.Lists;
|
|
|
import org.apache.poi.hssf.usermodel.*;
|
|
|
import org.apache.poi.ss.util.CellRangeAddress;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -74,6 +75,7 @@ import java.io.OutputStream;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 财务数据主Service业务层处理
|
|
@@ -2011,10 +2013,27 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
}
|
|
|
feeDTO.setFeesId(ccf.getfId());
|
|
|
List<FeeVO> feeVOList = tFeeMapper.selectFinancialLedgerDetails(feeDTO);
|
|
|
- feeVOList.forEach(vo -> {
|
|
|
- WarehouseTypeEnum storageType = WarehouseTypeEnum.fromTypeAndBusinessType(vo.getfBilltype(), "storageType");
|
|
|
- vo.setfBilltype(storageType.getName());
|
|
|
- });
|
|
|
+
|
|
|
+ if (CollectionUtils.isNotEmpty(feeVOList)) {
|
|
|
+ List<FeeVO> voList = new ArrayList<>();
|
|
|
+ Map<Long, List<FeeVO>> map = feeVOList.stream().collect(Collectors.groupingBy(FeeVO::getFSrcpid));
|
|
|
+ map.forEach((key, value) -> {
|
|
|
+ FeeVO vo = new FeeVO();
|
|
|
+ FeeVO feeVO = value.stream().findFirst().orElseThrow(() ->
|
|
|
+ new WarehouseException("获取费用异常"));
|
|
|
+ BeanUtils.copyProperties(feeVO, vo);
|
|
|
+ // 仓储费
|
|
|
+ BigDecimal storageFee = value.stream().map(FeeVO::getStorageFee).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
|
|
|
+ // 其他费用
|
|
|
+ BigDecimal otherFee = value.stream().map(FeeVO::getOtherFee).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
|
|
|
+ WarehouseTypeEnum storageType = WarehouseTypeEnum.fromTypeAndBusinessType(vo.getfBilltype(), "storageType");
|
|
|
+ vo.setfBilltype(storageType.getName());
|
|
|
+ vo.setStorageFee(storageFee);
|
|
|
+ vo.setOtherFee(otherFee);
|
|
|
+ voList.add(vo);
|
|
|
+ });
|
|
|
+ return AjaxResult.success(voList);
|
|
|
+ }
|
|
|
return AjaxResult.success(feeVOList);
|
|
|
}
|
|
|
|