Compare commits

..

No commits in common. "60727a158e545aedb3fda00967d525dfcb097c95" and "1cffd78f1445a8220c096bbe85c6255eb66cae19" have entirely different histories.

2 changed files with 14 additions and 18 deletions

View File

@ -430,13 +430,13 @@ public class ConBigScreenServiceImpl implements IConBigScreenService {
Date beginOfYear = DateUtil.beginOfYear(new Date()); Date beginOfYear = DateUtil.beginOfYear(new Date());
// 获取本年结束时间 // 获取本年结束时间
Date endOfYear = DateUtil.endOfYear(new Date()); Date endOfYear = DateUtil.endOfYear(new Date());
BigDecimal newReceivablesDate = receivablesSum(beginOfYear, endOfYear); double newReceivablesDate = receivablesSum(beginOfYear, endOfYear);
map.put("newReceivablesDate", newReceivablesDate); map.put("newReceivablesDate", newReceivablesDate);
//计算去年的数据 //计算去年的数据
Date begin = DateUtil.beginOfYear(DateUtil.offset(new Date(), DateField.YEAR, -1)); Date begin = DateUtil.beginOfYear(DateUtil.offset(new Date(), DateField.YEAR, -1));
Date end = DateUtil.endOfYear(DateUtil.offset(new Date(), DateField.YEAR, -1)); Date end = DateUtil.endOfYear(DateUtil.offset(new Date(), DateField.YEAR, -1));
BigDecimal LastReceivablesDate = receivablesSum(begin, end); double LastReceivablesDate = receivablesSum(begin, end);
map.put("LastReceivablesDate", LastReceivablesDate); map.put("LastReceivablesDate", LastReceivablesDate);
return map; return map;
} }
@ -447,41 +447,37 @@ public class ConBigScreenServiceImpl implements IConBigScreenService {
* @param endOfYear * @param endOfYear
* @return * @return
*/ */
private BigDecimal receivablesSum(Date beginOfYear, Date endOfYear) { private double receivablesSum(Date beginOfYear, Date endOfYear) {
//所有销售合同的合同总金额 //所有销售合同的合同总金额
List<ConSaleVo> conSaleVos = conSaleMapper.selectVoList(Wrappers.<ConSale>lambdaQuery().select(ConSale::getId, ConSale::getContractMoney).eq(ConSale::getState, 1).between(true, ConSale::getSignTime, beginOfYear, endOfYear)); List<ConSaleVo> conSaleVos = conSaleMapper.selectVoList(Wrappers.<ConSale>lambdaQuery().select(ConSale::getId, ConSale::getContractMoney).eq(ConSale::getState, 1).between(true, ConSale::getSignTime, beginOfYear, endOfYear));
BigDecimal contractMoneySum = CollUtil.isNotEmpty(conSaleVos) ? conSaleVos.stream().filter(itx -> (ObjectUtil.isNotEmpty(itx) && itx.getContractMoney() != null)) double contractMoneySum = CollUtil.isNotEmpty(conSaleVos) ? conSaleVos.stream().filter(itx -> (ObjectUtil.isNotEmpty(itx) && ObjectUtil.isNotEmpty(itx.getContractMoney()))).mapToDouble(ConSaleVo::getContractMoney).sum() : 0d;
.map(value -> new BigDecimal(value.getContractMoney().toString()).setScale(2, RoundingMode.HALF_UP)).reduce(BigDecimal.ZERO, BigDecimal::add) : BigDecimal.ZERO;
//其他合同中回款总金额额 //其他合同中回款总金额额
List<ConOtherVo> lastConOtherVos = conOtherMapper.selectVoList(Wrappers.<ConOther>lambdaQuery().eq(ConOther::getState, 1).eq(ConOther::getMoneyType, 1).between(true, ConOther::getSignTime, beginOfYear, endOfYear)); List<ConOtherVo> lastConOtherVos = conOtherMapper.selectVoList(Wrappers.<ConOther>lambdaQuery().eq(ConOther::getState, 1).eq(ConOther::getMoneyType, 1).between(true, ConOther::getSignTime, beginOfYear, endOfYear));
BigDecimal otherMoney = BigDecimal.ZERO; double otherMoney = 0d;
if (CollUtil.isNotEmpty(lastConOtherVos)) { if (CollUtil.isNotEmpty(lastConOtherVos)) {
List<Long> list = lastConOtherVos.stream().map(ConOtherVo::getId).collect(Collectors.toList()); List<Long> list = lastConOtherVos.stream().map(ConOtherVo::getId).collect(Collectors.toList());
List<ConOtherCollect> conOtherCollects = conOtherCollectMapper.selectList(Wrappers.<ConOtherCollect>lambdaQuery().select(ConOtherCollect::getActualArrivalMoney).in(ConOtherCollect::getOtherId, list)); List<ConOtherCollect> conOtherCollects = conOtherCollectMapper.selectList(Wrappers.<ConOtherCollect>lambdaQuery().select(ConOtherCollect::getActualArrivalMoney).in(ConOtherCollect::getOtherId, list));
otherMoney = CollUtil.isNotEmpty(conOtherCollects) ? conOtherCollects.stream().filter(itx -> (ObjectUtil.isNotEmpty(itx) && ObjectUtil.isNotEmpty(itx.getActualArrivalMoney()))) otherMoney = CollUtil.isNotEmpty(conOtherCollects) ? conOtherCollects.stream().filter(itx -> (ObjectUtil.isNotEmpty(itx) && ObjectUtil.isNotEmpty(itx.getActualArrivalMoney()))).mapToDouble(ConOtherCollect::getActualArrivalMoney).sum() : 0d;
.map(value -> new BigDecimal(value.getActualArrivalMoney().toString()).setScale(2, RoundingMode.HALF_UP)).reduce(BigDecimal.ZERO, BigDecimal::add) : BigDecimal.ZERO;
} }
//所有销售合同的实际回款金额 //所有销售合同的实际回款金额
BigDecimal actualArrivalMone = BigDecimal.ZERO; double actualArrivalMone = 0d;
if (CollUtil.isNotEmpty(conSaleVos)) { if (CollUtil.isNotEmpty(conSaleVos)) {
List<Long> list = conSaleVos.stream().map(ConSaleVo::getId).collect(Collectors.toList()); List<Long> list = conSaleVos.stream().map(ConSaleVo::getId).collect(Collectors.toList());
List<ConSaleCollect> collects = conSaleCollectMapper.selectList(Wrappers.<ConSaleCollect>lambdaQuery().select(ConSaleCollect::getActualArrivalMoney).in(ConSaleCollect::getSaleId, list)); List<ConSaleCollect> collects = conSaleCollectMapper.selectList(Wrappers.<ConSaleCollect>lambdaQuery().select(ConSaleCollect::getActualArrivalMoney).in(ConSaleCollect::getSaleId, list));
//计算本年的数据 //计算本年的数据
actualArrivalMone = CollUtil.isNotEmpty(collects) ? collects.stream().filter(itx -> (ObjectUtil.isNotEmpty(itx) && ObjectUtil.isNotEmpty(itx.getActualArrivalMoney()))) actualArrivalMone = CollUtil.isNotEmpty(collects) ? collects.stream().filter(itx -> (ObjectUtil.isNotEmpty(itx) && ObjectUtil.isNotEmpty(itx.getActualArrivalMoney()))).mapToDouble(ConSaleCollect::getActualArrivalMoney).sum() : 0d;
.map(value -> new BigDecimal(value.getActualArrivalMoney().toString()).setScale(2, RoundingMode.HALF_UP)).reduce(BigDecimal.ZERO, BigDecimal::add) : BigDecimal.ZERO;
} }
//其他合同中回款(约定回款金额汇总) //其他合同中回款(约定回款金额汇总)
BigDecimal otheActualArrivalMoney=BigDecimal.ZERO; double otheActualArrivalMoney=0d;
if (CollUtil.isNotEmpty(lastConOtherVos)) { if (CollUtil.isNotEmpty(lastConOtherVos)) {
List<Long> list = lastConOtherVos.stream().map(ConOtherVo::getId).collect(Collectors.toList()); List<Long> list = lastConOtherVos.stream().map(ConOtherVo::getId).collect(Collectors.toList());
List<ConOtherCollect> conOtherCollects = conOtherCollectMapper.selectList(Wrappers.<ConOtherCollect>lambdaQuery().select(ConOtherCollect::getOtherId).in(ConOtherCollect::getOtherId, list)); List<ConOtherCollect> conOtherCollects = conOtherCollectMapper.selectList(Wrappers.<ConOtherCollect>lambdaQuery().select(ConOtherCollect::getOtherId).in(ConOtherCollect::getOtherId, list));
otheActualArrivalMoney = CollUtil.isNotEmpty(conOtherCollects) ? conOtherCollects.stream().filter(itx -> (ObjectUtil.isNotEmpty(itx) && ObjectUtil.isNotEmpty(itx.getConventionArrivalMoney()))) otheActualArrivalMoney = CollUtil.isNotEmpty(conOtherCollects) ? conOtherCollects.stream().filter(itx -> (ObjectUtil.isNotEmpty(itx) && ObjectUtil.isNotEmpty(itx.getConventionArrivalMoney()))).mapToDouble(ConOtherCollect::getConventionArrivalMoney).sum() : 0d;
.map(value -> new BigDecimal(value.getConventionArrivalMoney().toString()).setScale(2, RoundingMode.HALF_UP)).reduce(BigDecimal.ZERO, BigDecimal::add) : BigDecimal.ZERO;
} }
log.info("所有销售合同的合同总金额:{},其他合同中回款总金额额:{},所有销售合同的实际回款金额:{},其他合同中回款:{}", contractMoneySum, otherMoney, actualArrivalMone, otheActualArrivalMoney); log.info("所有销售合同的合同总金额:{},其他合同中回款总金额额:{},所有销售合同的实际回款金额:{},其他合同中回款:{}", contractMoneySum, otherMoney, actualArrivalMone, otheActualArrivalMoney);
//应收款项=所有销售合同的合同总金额+其他合同中回款总金额额-所有销售合同的实际回款金额-其他合同中回款 //应收款项=所有销售合同的合同总金额+其他合同中回款总金额额-所有销售合同的实际回款金额-其他合同中回款
return contractMoneySum.add(otherMoney).subtract(actualArrivalMone).subtract(otheActualArrivalMoney); return contractMoneySum+otherMoney-actualArrivalMone-otheActualArrivalMoney;
} }
@Override @Override
@ -724,7 +720,7 @@ public class ConBigScreenServiceImpl implements IConBigScreenService {
* @return double * @return double
*/ */
private double outgoings(Date begin, Date end) { private double outgoings(Date begin, Date end) {
List<ConPurchaseVo> purchaseVos = conPurchaseMapper.selectVoList(Wrappers.<ConPurchase>lambdaQuery().select(ConPurchase :: getId).eq(ConPurchase::getState, 1).between(true, ConPurchase::getSignTime, begin, end)); List<ConPurchaseVo> purchaseVos = conPurchaseMapper.selectVoList(Wrappers.<ConPurchase>lambdaQuery().select(ConPurchase::getContractMoney).eq(ConPurchase::getState, 1).between(true, ConPurchase::getSignTime, begin, end));
//所有采购合同的实际付款金额汇总 //所有采购合同的实际付款金额汇总

View File

@ -101,8 +101,8 @@ public class ConCityServiceImpl implements IConCityService {
public List<ConCityVo> getTreeSelect() { public List<ConCityVo> getTreeSelect() {
List<ConCityVo> allList = this.getAllList(); List<ConCityVo> allList = this.getAllList();
Map<Long,List<ConCityVo>> mapList = allList.stream().filter(item -> item.getParentId() != null).collect(Collectors.groupingBy(ConCityVo :: getParentId)); //Map<Long,List<ConCityVo>> mapList = allList.stream().filter(item -> item.getParentId() != null).collect(Collectors.groupingBy(ConCityVo :: getParentId));
return buildTreeNodeNew(getParentAreas(),mapList); return buildTreeNode(getParentAreas());
} }
@Override @Override