diff --git a/src/main/java/com/bonus/gzcar/business/backstage/entity/HomeSupStatisticsVo.java b/src/main/java/com/bonus/gzcar/business/backstage/entity/HomeSupStatisticsVo.java index 209d583..8f95402 100644 --- a/src/main/java/com/bonus/gzcar/business/backstage/entity/HomeSupStatisticsVo.java +++ b/src/main/java/com/bonus/gzcar/business/backstage/entity/HomeSupStatisticsVo.java @@ -14,6 +14,8 @@ public class HomeSupStatisticsVo { /**合同ID*/ private Long id; + /**供应商id*/ + private String supId; /**合同类型 1.车辆 2.吊车*/ private int type; /**供应商名称*/ diff --git a/src/main/java/com/bonus/gzcar/business/backstage/mapper/HomeIndexMapper.java b/src/main/java/com/bonus/gzcar/business/backstage/mapper/HomeIndexMapper.java index a802c55..a91efe0 100644 --- a/src/main/java/com/bonus/gzcar/business/backstage/mapper/HomeIndexMapper.java +++ b/src/main/java/com/bonus/gzcar/business/backstage/mapper/HomeIndexMapper.java @@ -146,4 +146,18 @@ public interface HomeIndexMapper { * @date 2025/1/20 9:25 */ List getProPlanDataView(BackParamsDto data); + + /** + * 依据车辆类型查询支付金额 + * @param dto + * @return + */ + IndexVo getPayMoneyByCarType(BackParamsDto dto); + + /** + * 查询 供应商 合同 的 以租赁数量金额 进度 + * @param vo + * @return + */ + HomeSupStatisticsVo getMoneyBySupContract(HomeSupStatisticsVo vo); } diff --git a/src/main/java/com/bonus/gzcar/business/backstage/service/HomeIndexServiceImpl.java b/src/main/java/com/bonus/gzcar/business/backstage/service/HomeIndexServiceImpl.java index bbba5de..79bf63e 100644 --- a/src/main/java/com/bonus/gzcar/business/backstage/service/HomeIndexServiceImpl.java +++ b/src/main/java/com/bonus/gzcar/business/backstage/service/HomeIndexServiceImpl.java @@ -3,6 +3,7 @@ package com.bonus.gzcar.business.backstage.service; import com.bonus.gzcar.business.backstage.entity.*; import com.bonus.gzcar.business.backstage.mapper.HomeIndexMapper; import com.bonus.gzcar.manager.common.util.DateTimeHelper; +import com.bonus.gzcar.manager.common.util.StringHelper; import com.bonus.gzcar.manager.common.util.StringUtils; import com.bonus.gzcar.manager.webResult.ServerResponse; import lombok.extern.slf4j.Slf4j; @@ -101,6 +102,9 @@ public class HomeIndexServiceImpl implements HomeIndexService { log.info("数据概览-已付款金额{}", Thread.currentThread().getName()); List dataList = new ArrayList<>(2); IndexVo indexVo = mapper.getPayMoney(dto); + if(StringHelper.isEmpty(indexVo.getMoney())){ + indexVo.setMoney("0"); + } dataList.add(0, indexVo != null ? Double.parseDouble(indexVo.getMoney()) : 0); dataList.add(1, indexVo != null ? Integer.parseInt(indexVo.getNum()) : 0); return dataList; @@ -108,6 +112,9 @@ public class HomeIndexServiceImpl implements HomeIndexService { Future> future6 = testTaskExecutor.submit(() -> { log.info("数据概览-应付款金额{}", Thread.currentThread().getName()); IndexVo indexVo = mapper.getNoPayMoney(dto); + if(StringHelper.isEmpty(indexVo.getMoney())){ + indexVo.setMoney("0"); + } List dataList = new ArrayList<>(2); dataList.add(0, indexVo != null ? Double.parseDouble(indexVo.getMoney()) : 0); dataList.add(1, indexVo != null ? Integer.parseInt(indexVo.getNum()) : 0); @@ -248,6 +255,17 @@ public class HomeIndexServiceImpl implements HomeIndexService { List dataList = new ArrayList<>(); for (int i = 0; i < v.size(); i++) { HomeSupStatisticsVo vo = v.get(i); + HomeSupStatisticsVo de=mapper.getMoneyBySupContract(vo); + if(de!=null){ + vo.setLeaseProgress(handleProgress(vo.getContractMoney(),de.getLeaseMoney())); + vo.setLeaseNum(de.getLeaseNum()); + vo.setLeaseMoney(de.getLeaseMoney()); + vo.setDispatchTime(de.getDispatchTime()); + }else{ + vo.setLeaseProgress(0); + vo.setLeaseNum(0); + vo.setLeaseMoney(0); + } vo.setDispatchTime(vo.getDispatchTime() == null ? "--" : vo.getDispatchTime()); dataList.add(vo); } @@ -273,6 +291,13 @@ public class HomeIndexServiceImpl implements HomeIndexService { double v = handleMoney(list); vo.setContractMoney(v); } + dto.setType("1"); + IndexVo indexVo = mapper.getPayMoneyByCarType(dto); + if(indexVo!=null) { + vo.setPayMoney(Double.parseDouble(indexVo.getMoney())); + }else { + vo.setPayMoney(0.0); + } double progress = handleProgress(vo.getContractMoney(), vo.getPayMoney()); vo.setProgress(progress); } catch (Exception e) { @@ -291,6 +316,14 @@ public class HomeIndexServiceImpl implements HomeIndexService { double v = handleMoney(list); vo.setContractMoney(v); } + dto.setType("2"); + IndexVo indexVo = mapper.getPayMoneyByCarType(dto); + if(indexVo!=null) { + vo.setPayMoney(Double.parseDouble(indexVo.getMoney())); + }else { + vo.setPayMoney(0.0); + } + double progress = handleProgress(vo.getContractMoney(), vo.getPayMoney()); vo.setProgress(progress); } catch (Exception e) { diff --git a/src/main/resources/mappers/business/backstage/HomeIndexMapper.xml b/src/main/resources/mappers/business/backstage/HomeIndexMapper.xml index 40cd48c..ff40a7c 100644 --- a/src/main/resources/mappers/business/backstage/HomeIndexMapper.xml +++ b/src/main/resources/mappers/business/backstage/HomeIndexMapper.xml @@ -85,6 +85,7 @@ ccr.ratio AS contractRatio, ccr.ratio_money AS contractMoney, ccr.sup_name AS supName, + ccr.sup_id supId, cc.type AS type FROM car_contract cc LEFT JOIN car_contract_relation ccr ON cc.id = ccr.contract_id @@ -94,16 +95,9 @@ + + \ No newline at end of file