|
@@ -23,10 +23,7 @@ import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.text.DecimalFormat;
|
|
import java.text.DecimalFormat;
|
|
import java.text.NumberFormat;
|
|
import java.text.NumberFormat;
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.HashMap;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
+import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -95,10 +92,7 @@ public class StockSaleReceiptReportServiceImpl extends ServiceImpl<StockSaleRece
|
|
List<StockSaleReceiptReport> dataList = baseMapper.getListByCondition(pageView);
|
|
List<StockSaleReceiptReport> dataList = baseMapper.getListByCondition(pageView);
|
|
if (!CollectionUtils.isEmpty(dataList)) {
|
|
if (!CollectionUtils.isEmpty(dataList)) {
|
|
for (StockSaleReceiptReport saleReceiptReport1:dataList){
|
|
for (StockSaleReceiptReport saleReceiptReport1:dataList){
|
|
- WarehouseInOutInfo warehouseInOutInfo=warehouseInOutInfoService.selectOne(new EntityWrapper<WarehouseInOutInfo>()
|
|
|
|
- .eq("contract_no",saleReceiptReport1.getContractNo())
|
|
|
|
- .eq("car_no",saleReceiptReport1.getCarNo())
|
|
|
|
- .eq("warehouse_name",saleReceiptReport1.getWarehouseName()));
|
|
|
|
|
|
+ WarehouseInOutInfo warehouseInOutInfo=warehouseInOutInfoService.selectById(saleReceiptReport1.getWarehouseRecordId());
|
|
if (warehouseInOutInfo!=null){
|
|
if (warehouseInOutInfo!=null){
|
|
saleReceiptReport1.setPoundImg(warehouseInOutInfo.getAddressUrl());
|
|
saleReceiptReport1.setPoundImg(warehouseInOutInfo.getAddressUrl());
|
|
}
|
|
}
|
|
@@ -285,71 +279,78 @@ public class StockSaleReceiptReportServiceImpl extends ServiceImpl<StockSaleRece
|
|
/**
|
|
/**
|
|
* 合同编号下拉列表
|
|
* 合同编号下拉列表
|
|
*
|
|
*
|
|
- * @param compId
|
|
|
|
|
|
+ * @param stockSaleReceiptReport
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public List<ContractManagementInfo> selectContractNoList(String compId) {
|
|
|
|
- //查现货销售合同
|
|
|
|
- List<ContractManagementInfo> contractManagementInfoList = contractManagementInfoService.selectList(new EntityWrapper<ContractManagementInfo>()
|
|
|
|
- .eq("comp_id", compId)
|
|
|
|
- .eq("contract_type", "1")
|
|
|
|
- .eq("delete_flag", "0")
|
|
|
|
- .eq("goods_type","1")
|
|
|
|
- .orderBy("update_date", false));
|
|
|
|
- for (ContractManagementInfo contractManagementInfo : contractManagementInfoList) {
|
|
|
|
- List<TranTaskInfo> tranTaskInfoList=tranTaskInfoService.selectList(new EntityWrapper<TranTaskInfo>()
|
|
|
|
- .eq("comp_id",contractManagementInfo.getCompId())
|
|
|
|
- .eq("contract_no",contractManagementInfo.getContractNo()));
|
|
|
|
- if (!CollectionUtils.isEmpty(tranTaskInfoList)){
|
|
|
|
- for(TranTaskInfo tranTaskInfo:tranTaskInfoList){
|
|
|
|
- TranProcessInfo tranProcessInfo=tranProcessInfoService.selectOne(new EntityWrapper<TranProcessInfo>()
|
|
|
|
- .eq("info_id",tranTaskInfo.getId())
|
|
|
|
- .eq("end_flag","1"));
|
|
|
|
- if (tranProcessInfo!=null){
|
|
|
|
- if ("船运".equals(tranProcessInfo.getTranType())) {
|
|
|
|
- TranCarInfo tranCarInfo = tranCarInfoService.selectOne(new EntityWrapper<TranCarInfo>()
|
|
|
|
- .eq("process_id", tranProcessInfo.getId())
|
|
|
|
- .eq("ship_type", "集装箱"));
|
|
|
|
- if (tranCarInfo != null) {
|
|
|
|
- tranProcessInfo.setTranType("箱船");
|
|
|
|
- tranTaskInfo.setTranProcessInfo(tranProcessInfo);
|
|
|
|
- }
|
|
|
|
- TranCarInfo tranCarInfo1 = tranCarInfoService.selectOne(new EntityWrapper<TranCarInfo>()
|
|
|
|
- .eq("process_id", tranProcessInfo.getId())
|
|
|
|
- .eq("ship_type", "散船"));
|
|
|
|
- if (tranCarInfo1 != null) {
|
|
|
|
- tranProcessInfo.setTranType("散船");
|
|
|
|
- tranTaskInfo.setTranProcessInfo(tranProcessInfo);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- tranTaskInfo.setTranProcessInfo(tranProcessInfo);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- contractManagementInfo.setTranTaskInfoList(tranTaskInfoList);
|
|
|
|
- }
|
|
|
|
- ContractGoodsInfo contractGoodsInfo = contractGoodsInfoService.selectOne(new EntityWrapper<ContractGoodsInfo>()
|
|
|
|
- .eq("contract_id",contractManagementInfo.getId()));
|
|
|
|
- contractManagementInfo.setGoodsName(contractGoodsInfo.getGoodsName());
|
|
|
|
- Double money = 0.00;
|
|
|
|
|
|
+ public List<ContractManagementInfo> selectContractNoList(StockSaleReceiptReport stockSaleReceiptReport) {
|
|
|
|
+ List<ContractManagementInfo> contractManagementInfoList=new ArrayList<>();
|
|
//查现货销售出库报表
|
|
//查现货销售出库报表
|
|
List<StockSaleReceiptReport> stockSaleReceiptReportList = this.selectList(new EntityWrapper<StockSaleReceiptReport>()
|
|
List<StockSaleReceiptReport> stockSaleReceiptReportList = this.selectList(new EntityWrapper<StockSaleReceiptReport>()
|
|
- .eq("contract_no", contractManagementInfo.getContractNo())
|
|
|
|
|
|
+ .eq("comp_id", stockSaleReceiptReport.getCompId())
|
|
|
|
+ .gt("create_date",stockSaleReceiptReport.getStartDate())
|
|
|
|
+ .lt("create_date",stockSaleReceiptReport.getEndDate())
|
|
|
|
+ .groupBy("contract_no")
|
|
.eq("delete_flag", "0"));
|
|
.eq("delete_flag", "0"));
|
|
if (!CollectionUtils.isEmpty(stockSaleReceiptReportList)) {
|
|
if (!CollectionUtils.isEmpty(stockSaleReceiptReportList)) {
|
|
- for (StockSaleReceiptReport stockSaleReceiptReport : stockSaleReceiptReportList) {
|
|
|
|
- money = money + (stockSaleReceiptReport.getAmountNotReceivable()!=null?stockSaleReceiptReport.getAmountNotReceivable():0.0);
|
|
|
|
- }
|
|
|
|
- //有未收金额
|
|
|
|
- if (money > 0) {
|
|
|
|
- contractManagementInfo.setReportStatus("待结算");
|
|
|
|
- } else {
|
|
|
|
- contractManagementInfo.setReportStatus("已结算");
|
|
|
|
|
|
+ for (StockSaleReceiptReport stockSaleReceiptReport1 : stockSaleReceiptReportList) {
|
|
|
|
+ ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
|
|
|
|
+ .eq("comp_id", stockSaleReceiptReport1.getCompId())
|
|
|
|
+ .eq("contract_no", stockSaleReceiptReport1.getContractNo()));
|
|
|
|
+ if (contractManagementInfo != null) {
|
|
|
|
+ ContractGoodsInfo contractGoodsInfo = contractGoodsInfoService.selectOne(new EntityWrapper<ContractGoodsInfo>()
|
|
|
|
+ .eq("contract_id", contractManagementInfo.getId()));
|
|
|
|
+ contractManagementInfo.setGoodsName(contractGoodsInfo.getGoodsName());
|
|
|
|
+ List<TranTaskInfo> tranTaskInfoList = tranTaskInfoService.selectList(new EntityWrapper<TranTaskInfo>()
|
|
|
|
+ .eq("comp_id", contractManagementInfo.getCompId())
|
|
|
|
+ .eq("contract_no", contractManagementInfo.getContractNo()));
|
|
|
|
+ if (!CollectionUtils.isEmpty(tranTaskInfoList)) {
|
|
|
|
+ for (TranTaskInfo tranTaskInfo : tranTaskInfoList) {
|
|
|
|
+ TranProcessInfo tranProcessInfo = tranProcessInfoService.selectOne(new EntityWrapper<TranProcessInfo>()
|
|
|
|
+ .eq("info_id", tranTaskInfo.getId())
|
|
|
|
+ .eq("end_flag", "1"));
|
|
|
|
+ if (tranProcessInfo != null) {
|
|
|
|
+ if ("船运".equals(tranProcessInfo.getTranType())) {
|
|
|
|
+ TranCarInfo tranCarInfo = tranCarInfoService.selectOne(new EntityWrapper<TranCarInfo>()
|
|
|
|
+ .eq("process_id", tranProcessInfo.getId())
|
|
|
|
+ .eq("ship_type", "集装箱"));
|
|
|
|
+ if (tranCarInfo != null) {
|
|
|
|
+ tranProcessInfo.setTranType("箱船");
|
|
|
|
+ tranTaskInfo.setTranProcessInfo(tranProcessInfo);
|
|
|
|
+ }
|
|
|
|
+ TranCarInfo tranCarInfo1 = tranCarInfoService.selectOne(new EntityWrapper<TranCarInfo>()
|
|
|
|
+ .eq("process_id", tranProcessInfo.getId())
|
|
|
|
+ .eq("ship_type", "散船"));
|
|
|
|
+ if (tranCarInfo1 != null) {
|
|
|
|
+ tranProcessInfo.setTranType("散船");
|
|
|
|
+ tranTaskInfo.setTranProcessInfo(tranProcessInfo);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ tranTaskInfo.setTranProcessInfo(tranProcessInfo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ contractManagementInfo.setTranTaskInfoList(tranTaskInfoList);
|
|
|
|
+ }
|
|
|
|
+ Double money = 0.0d;
|
|
|
|
+ List<StockSaleReceiptReport> stockSaleReceiptReportList1 = this.selectList(new EntityWrapper<StockSaleReceiptReport>()
|
|
|
|
+ .eq("comp_id", stockSaleReceiptReport.getCompId())
|
|
|
|
+ .eq("contract_no",stockSaleReceiptReport1.getContractNo())
|
|
|
|
+ .gt("create_date",stockSaleReceiptReport.getStartDate())
|
|
|
|
+ .lt("create_date",stockSaleReceiptReport.getEndDate())
|
|
|
|
+ .eq("delete_flag", "0"));
|
|
|
|
+ if (!CollectionUtils.isEmpty(stockSaleReceiptReportList1)){
|
|
|
|
+ money = (stockSaleReceiptReportList1.stream().mapToDouble(StockSaleReceiptReport::getAmountNotReceivable).sum()) ;
|
|
|
|
+ }
|
|
|
|
+ //有未收金额
|
|
|
|
+ if (money > 0) {
|
|
|
|
+ contractManagementInfo.setReportStatus("待结算");
|
|
|
|
+ } else {
|
|
|
|
+ contractManagementInfo.setReportStatus("已结算");
|
|
|
|
+ }
|
|
|
|
+ contractManagementInfoList.add(contractManagementInfo);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
return contractManagementInfoList;
|
|
return contractManagementInfoList;
|
|
}
|
|
}
|
|
|
|
|