|
@@ -25,6 +25,7 @@ import com.ruoyi.finance.domain.TFeeDo;
|
|
import com.ruoyi.finance.domain.TWareHouseFees;
|
|
import com.ruoyi.finance.domain.TWareHouseFees;
|
|
import com.ruoyi.finance.domain.dto.FeeDTO;
|
|
import com.ruoyi.finance.domain.dto.FeeDTO;
|
|
import com.ruoyi.finance.domain.excel.GeneralLedgerDetailExcel;
|
|
import com.ruoyi.finance.domain.excel.GeneralLedgerDetailExcel;
|
|
|
|
+import com.ruoyi.finance.domain.excel.GeneralLedgerDetailTotalExcel;
|
|
import com.ruoyi.finance.domain.excel.GeneralLedgerExcel;
|
|
import com.ruoyi.finance.domain.excel.GeneralLedgerExcel;
|
|
import com.ruoyi.finance.domain.excel.ProfitGeneralLedgerExcel;
|
|
import com.ruoyi.finance.domain.excel.ProfitGeneralLedgerExcel;
|
|
import com.ruoyi.finance.domain.vo.FeeVO;
|
|
import com.ruoyi.finance.domain.vo.FeeVO;
|
|
@@ -76,7 +77,6 @@ import java.io.File;
|
|
import java.io.FileOutputStream;
|
|
import java.io.FileOutputStream;
|
|
import java.io.OutputStream;
|
|
import java.io.OutputStream;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
-import java.text.ParseException;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
@@ -767,14 +767,50 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
if (tWareHouseFees.getGroupBy() == 0) {
|
|
if (tWareHouseFees.getGroupBy() == 0) {
|
|
return tFeeMapper.warehouseBillsFeesProfitList(tWareHouseFees);
|
|
return tFeeMapper.warehouseBillsFeesProfitList(tWareHouseFees);
|
|
}
|
|
}
|
|
- if (tWareHouseFees.getSwitchSection() == 1) {
|
|
|
|
|
|
+ if (tWareHouseFees.getSwitchSection() == 0) {
|
|
tWareHouseFees.setTimeExamine(tWareHouseFees.getTimeExamine());
|
|
tWareHouseFees.setTimeExamine(tWareHouseFees.getTimeExamine());
|
|
tWareHouseFees.setfBstimeExamine(null);
|
|
tWareHouseFees.setfBstimeExamine(null);
|
|
} else {
|
|
} else {
|
|
tWareHouseFees.setfBstimeExamine(tWareHouseFees.getTimeExamine());
|
|
tWareHouseFees.setfBstimeExamine(tWareHouseFees.getTimeExamine());
|
|
tWareHouseFees.setTimeExamine(null);
|
|
tWareHouseFees.setTimeExamine(null);
|
|
}
|
|
}
|
|
- return tFeeMapper.warehouseBillsFeesCustomProfitList(tWareHouseFees);
|
|
|
|
|
|
+ List<Map<String, Object>> mapList = tFeeMapper.warehouseBillsFeesCustomProfitList(tWareHouseFees);
|
|
|
|
+ for (Map<String, Object> map : mapList) {
|
|
|
|
+ FeeDTO feeDTO = new FeeDTO();
|
|
|
|
+ feeDTO.setFToCorpid(Long.parseLong(map.get("fCorpid").toString()));
|
|
|
|
+ BigDecimal amount = new BigDecimal("0.00");
|
|
|
|
+ BigDecimal stlamount = new BigDecimal("0.00");
|
|
|
|
+// if (tWareHouseFees.getSwitchSection() == 0) {
|
|
|
|
+ if (ObjectUtils.isNotNull(map.get("reviewDate"))) {
|
|
|
|
+ List<String> list1 = new ArrayList<>();
|
|
|
|
+ list1.add(map.get("reviewDate").toString());
|
|
|
|
+ list1.add(map.get("reviewDate").toString());
|
|
|
|
+ feeDTO.setFAuditList(list1);
|
|
|
|
+ }
|
|
|
|
+ /* } else {
|
|
|
|
+ if (ObjectUtils.isNotNull(map.get("f_bstime"))) {
|
|
|
|
+ List<String> list1 = new ArrayList<>();
|
|
|
|
+ list1.add(map.get("f_bstime").toString());
|
|
|
|
+ list1.add(map.get("f_bstime").toString());
|
|
|
|
+ feeDTO.setFBstimeExamine(list1);
|
|
|
|
+ }
|
|
|
|
+ }*/
|
|
|
|
+ List<FeeVO> feeVOList = tFeeMapper.selectFinancialLedgerDetails(feeDTO);
|
|
|
|
+ for (FeeVO feeVO : feeVOList) {
|
|
|
|
+ if ("D".equals(feeVO.getfDc())) {
|
|
|
|
+ amount = amount.add(feeVO.getFAmount());
|
|
|
|
+ } else {
|
|
|
|
+ stlamount = stlamount.add(feeVO.getFAmount());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ map.put("fAmount", amount);
|
|
|
|
+ map.put("fStlamount", stlamount);
|
|
|
|
+ map.put("nnfinished", amount.subtract(stlamount));
|
|
|
|
+ /*list.get(i).setFAmount(amount);
|
|
|
|
+ list.get(i).setNnfinished(amount.subtract(stlamount));
|
|
|
|
+ list.get(i).setFStlamount(stlamount);*/
|
|
|
|
+ }
|
|
|
|
+ return mapList;
|
|
}
|
|
}
|
|
|
|
|
|
public static BigDecimal calculation1(String fTotalgross, String fGrossweightblc) {
|
|
public static BigDecimal calculation1(String fTotalgross, String fGrossweightblc) {
|
|
@@ -2357,6 +2393,10 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
public AjaxResult financialLedgerDetailsTotal(FeeDTO feeDTO) {
|
|
public AjaxResult financialLedgerDetailsTotal(FeeDTO feeDTO) {
|
|
feeDTO.setFToCorpid(feeDTO.getFCorpId());
|
|
feeDTO.setFToCorpid(feeDTO.getFCorpId());
|
|
feeDTO.setFCorpId(null);
|
|
feeDTO.setFCorpId(null);
|
|
|
|
+ if (ObjectUtils.isNotNull(feeDTO.getFBstimeExamine())){
|
|
|
|
+ feeDTO.setFAuditList(feeDTO.getFBstimeExamine());
|
|
|
|
+ feeDTO.setFBstimeExamine(null);
|
|
|
|
+ }
|
|
List<FeeVO> feeVOList = tFeeMapper.selectFinancialLedgerDetails(feeDTO);
|
|
List<FeeVO> feeVOList = tFeeMapper.selectFinancialLedgerDetails(feeDTO);
|
|
|
|
|
|
feeDTO.setFDc("D");
|
|
feeDTO.setFDc("D");
|
|
@@ -2370,8 +2410,10 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
Map<Long, List<FeeVO>> map = feeVOList.stream().collect(Collectors.groupingBy(FeeVO::getFSrcpid));
|
|
Map<Long, List<FeeVO>> map = feeVOList.stream().collect(Collectors.groupingBy(FeeVO::getFSrcpid));
|
|
map.forEach((key, value) -> {
|
|
map.forEach((key, value) -> {
|
|
|
|
|
|
|
|
+ List<FeeVO> feeVODList = feeVOListD.stream().filter(e -> e.getFSrcpid().equals(key)).collect(Collectors.toList());
|
|
FeeVO feeVOD = feeVOListD.stream().filter(e -> e.getFSrcpid().equals(key)).findFirst().orElse(null);
|
|
FeeVO feeVOD = feeVOListD.stream().filter(e -> e.getFSrcpid().equals(key)).findFirst().orElse(null);
|
|
|
|
|
|
|
|
+ List<FeeVO> feeVOCList = feeVOListC.stream().filter(e -> e.getFSrcpid().equals(key)).collect(Collectors.toList());
|
|
FeeVO feeVOC = feeVOListC.stream().filter(e -> e.getFSrcpid().equals(key)).findFirst().orElse(null);
|
|
FeeVO feeVOC = feeVOListC.stream().filter(e -> e.getFSrcpid().equals(key)).findFirst().orElse(null);
|
|
|
|
|
|
FeeVO vo = new FeeVO();
|
|
FeeVO vo = new FeeVO();
|
|
@@ -2380,11 +2422,11 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
BeanUtils.copyProperties(feeVO, vo);
|
|
BeanUtils.copyProperties(feeVO, vo);
|
|
BigDecimal D = new BigDecimal("0.00");
|
|
BigDecimal D = new BigDecimal("0.00");
|
|
BigDecimal C = new BigDecimal("0.00");
|
|
BigDecimal C = new BigDecimal("0.00");
|
|
- if (ObjectUtils.isNotNull(feeVOD)){
|
|
|
|
- if(ObjectUtils.isNotNull(feeVOD.getFAmount())){
|
|
|
|
- D = feeVOD.getFAmount();
|
|
|
|
- vo.setReceivableAmount(feeVOD.getFAmount());
|
|
|
|
- }else{
|
|
|
|
|
|
+ if (ObjectUtils.isNotNull(feeVOD)) {
|
|
|
|
+ if (ObjectUtils.isNotNull(feeVOD)) {
|
|
|
|
+ D = feeVODList.stream().map(FeeVO::getFAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
+ vo.setReceivableAmount(D);
|
|
|
|
+ } else {
|
|
vo.setReceivableAmount(D);
|
|
vo.setReceivableAmount(D);
|
|
}
|
|
}
|
|
vo.setReceivableFQty(feeVOD.getFQty());
|
|
vo.setReceivableFQty(feeVOD.getFQty());
|
|
@@ -2393,11 +2435,11 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
vo.setfBilltype(storageType.getName());
|
|
vo.setfBilltype(storageType.getName());
|
|
vo.setFBillingDays(feeVOD.getFBillingDays());
|
|
vo.setFBillingDays(feeVOD.getFBillingDays());
|
|
}
|
|
}
|
|
- if (ObjectUtils.isNotNull(feeVOC)){
|
|
|
|
- if(ObjectUtils.isNotNull(feeVOC.getFAmount())){
|
|
|
|
- C = feeVOC.getFAmount();
|
|
|
|
- vo.setCopeWithAmount(feeVOC.getFAmount());
|
|
|
|
- }else{
|
|
|
|
|
|
+ if (ObjectUtils.isNotNull(feeVOC)) {
|
|
|
|
+ if (ObjectUtils.isNotNull(feeVOC.getFAmount())) {
|
|
|
|
+ C = feeVOCList.stream().map(FeeVO::getFAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);;
|
|
|
|
+ vo.setCopeWithAmount(C);
|
|
|
|
+ } else {
|
|
vo.setCopeWithAmount(C);
|
|
vo.setCopeWithAmount(C);
|
|
}
|
|
}
|
|
WarehouseTypeEnum storageType = WarehouseTypeEnum.fromTypeAndBusinessType(feeVOC.getfBilltype(), "storageType");
|
|
WarehouseTypeEnum storageType = WarehouseTypeEnum.fromTypeAndBusinessType(feeVOC.getfBilltype(), "storageType");
|
|
@@ -2413,6 +2455,72 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
return AjaxResult.success(feeVOList);
|
|
return AjaxResult.success(feeVOList);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public List<GeneralLedgerDetailTotalExcel> financialLedgerDetailsTotalExport(FeeDTO feeDTO) {
|
|
|
|
+ List<GeneralLedgerDetailTotalExcel> list = new ArrayList<>();
|
|
|
|
+ feeDTO.setFToCorpid(feeDTO.getFCorpId());
|
|
|
|
+ feeDTO.setFCorpId(null);
|
|
|
|
+ if (ObjectUtils.isNotNull(feeDTO.getFBstimeExamine())){
|
|
|
|
+ feeDTO.setFAuditList(feeDTO.getFBstimeExamine());
|
|
|
|
+ feeDTO.setFBstimeExamine(null);
|
|
|
|
+ }
|
|
|
|
+ List<FeeVO> feeVOList = tFeeMapper.selectFinancialLedgerDetails(feeDTO);
|
|
|
|
+
|
|
|
|
+ feeDTO.setFDc("D");
|
|
|
|
+ List<FeeVO> feeVOListD = tFeeMapper.selectFinancialLedgerDetails(feeDTO);
|
|
|
|
+
|
|
|
|
+ feeDTO.setFDc("C");
|
|
|
|
+ List<FeeVO> feeVOListC = tFeeMapper.selectFinancialLedgerDetails(feeDTO);
|
|
|
|
+
|
|
|
|
+ if (CollectionUtils.isNotEmpty(feeVOList)) {
|
|
|
|
+ Map<Long, List<FeeVO>> map = feeVOList.stream().collect(Collectors.groupingBy(FeeVO::getFSrcpid));
|
|
|
|
+ map.forEach((key, value) -> {
|
|
|
|
+ GeneralLedgerDetailTotalExcel generalLedgerDetailTotalExcel = new GeneralLedgerDetailTotalExcel();
|
|
|
|
+ List<FeeVO> feeVODList = feeVOListD.stream().filter(e -> e.getFSrcpid().equals(key)).collect(Collectors.toList());
|
|
|
|
+ FeeVO feeVOD = feeVOListD.stream().filter(e -> e.getFSrcpid().equals(key)).findFirst().orElse(null);
|
|
|
|
+
|
|
|
|
+ List<FeeVO> feeVOCList = feeVOListC.stream().filter(e -> e.getFSrcpid().equals(key)).collect(Collectors.toList());
|
|
|
|
+ FeeVO feeVOC = feeVOListC.stream().filter(e -> e.getFSrcpid().equals(key)).findFirst().orElse(null);
|
|
|
|
+
|
|
|
|
+ FeeVO feeVO = value.stream().findFirst().orElseThrow(() ->
|
|
|
|
+ new WarehouseException("获取费用异常"));
|
|
|
|
+ BeanUtils.copyProperties(feeVO, generalLedgerDetailTotalExcel);
|
|
|
|
+
|
|
|
|
+ BigDecimal D = new BigDecimal("0.00");
|
|
|
|
+ BigDecimal C = new BigDecimal("0.00");
|
|
|
|
+ if (ObjectUtils.isNotNull(feeVOD)) {
|
|
|
|
+ if (ObjectUtils.isNotNull(feeVOD)) {
|
|
|
|
+ D = feeVODList.stream().map(FeeVO::getFAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
+ generalLedgerDetailTotalExcel.setReceivableAmount(D);
|
|
|
|
+ } else {
|
|
|
|
+ generalLedgerDetailTotalExcel.setReceivableAmount(D);
|
|
|
|
+ }
|
|
|
|
+ generalLedgerDetailTotalExcel.setReceivableFQty(feeVOD.getFQty());
|
|
|
|
+ generalLedgerDetailTotalExcel.setReceivablePrice(feeVOD.getPrice());
|
|
|
|
+ WarehouseTypeEnum storageType = WarehouseTypeEnum.fromTypeAndBusinessType(feeVOD.getfBilltype(), "storageType");
|
|
|
|
+ generalLedgerDetailTotalExcel.setFBilltype(storageType.getName());
|
|
|
|
+ generalLedgerDetailTotalExcel.setFBillingDays(feeVOD.getFBillingDays());
|
|
|
|
+ }
|
|
|
|
+ if (ObjectUtils.isNotNull(feeVOC)) {
|
|
|
|
+ if (ObjectUtils.isNotNull(feeVOC.getFAmount())) {
|
|
|
|
+ C = feeVOCList.stream().map(FeeVO::getFAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);;
|
|
|
|
+ generalLedgerDetailTotalExcel.setCopeWithAmount(C);
|
|
|
|
+ } else {
|
|
|
|
+ generalLedgerDetailTotalExcel.setCopeWithAmount(C);
|
|
|
|
+ }
|
|
|
|
+ WarehouseTypeEnum storageType = WarehouseTypeEnum.fromTypeAndBusinessType(feeVOC.getfBilltype(), "storageType");
|
|
|
|
+ generalLedgerDetailTotalExcel.setFBilltypeC(storageType.getName());
|
|
|
|
+ generalLedgerDetailTotalExcel.setCopeWithFQty(feeVOC.getFQty());
|
|
|
|
+ generalLedgerDetailTotalExcel.setCopeWithPrice(feeVOC.getPrice());
|
|
|
|
+ }
|
|
|
|
+ generalLedgerDetailTotalExcel.setNnfinished(D.subtract(C));
|
|
|
|
+ list.add(generalLedgerDetailTotalExcel);
|
|
|
|
+ });
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<ReceivableExcel> receivable(TWareHouseFees tWareHouseFees) {
|
|
public List<ReceivableExcel> receivable(TWareHouseFees tWareHouseFees) {
|