|
@@ -1,11 +1,13 @@
|
|
|
package com.yh.saas.plugin.yiliangyiyun.service.impl;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
|
import com.baomidou.mybatisplus.plugins.Page;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.ReveExpeInfo;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.ReveExpeInfoMapper;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.service.IReveExpeInfoService;
|
|
|
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
|
|
+import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.HashMap;
|
|
@@ -44,6 +46,77 @@ public class ReveExpeInfoServiceImpl extends ServiceImpl<ReveExpeInfoMapper, Rev
|
|
|
// 查询列表总数
|
|
|
Integer dataCount = baseMapper.getCountByCondition(pageView);
|
|
|
List<ReveExpeInfo> dataList = baseMapper.getListByCondition(pageView);
|
|
|
+
|
|
|
+ if(!CollectionUtils.isEmpty(dataList)){
|
|
|
+ for(ReveExpeInfo reveExpeInfo1 : dataList){
|
|
|
+ //定义合同收入
|
|
|
+ Double inContractMoney = 0.0;
|
|
|
+ //查询
|
|
|
+ List<ReveExpeInfo> inContractReveExpeInfoList = this.selectList(new EntityWrapper<ReveExpeInfo>()
|
|
|
+ .eq("comp_id",reveExpeInfo1.getCompId())
|
|
|
+ .eq("reex_type_key","1")
|
|
|
+ .eq("delete_flag","0"));
|
|
|
+ if(inContractReveExpeInfoList != null){
|
|
|
+ inContractMoney = inContractMoney + reveExpeInfo1.getAmountMoney();
|
|
|
+ reveExpeInfo1.setInContractMoney(inContractMoney);
|
|
|
+ }
|
|
|
+ //定义合同支出
|
|
|
+ Double outContractMoney = 0.0;
|
|
|
+ //查询
|
|
|
+ List<ReveExpeInfo> outContractReveExpeInfoList = this.selectList(new EntityWrapper<ReveExpeInfo>()
|
|
|
+ .eq("comp_id",reveExpeInfo1.getCompId())
|
|
|
+ .eq("reex_type_key","2")
|
|
|
+ .eq("delete_flag","0"));
|
|
|
+ if(outContractReveExpeInfoList != null){
|
|
|
+ outContractMoney = outContractMoney + reveExpeInfo1.getAmountMoney();
|
|
|
+ reveExpeInfo1.setOutContractMoney(outContractMoney);
|
|
|
+ }
|
|
|
+ //定义仓库收入
|
|
|
+ Double inWarehouseMoney = 0.0;
|
|
|
+ //查询
|
|
|
+ List<ReveExpeInfo> inWarehouseReveExpeInfoList = this.selectList(new EntityWrapper<ReveExpeInfo>()
|
|
|
+ .eq("comp_id",reveExpeInfo1.getCompId())
|
|
|
+ .eq("reex_type_key","3")
|
|
|
+ .eq("delete_flag","0"));
|
|
|
+ if(inWarehouseReveExpeInfoList != null){
|
|
|
+ inWarehouseMoney = inWarehouseMoney + reveExpeInfo1.getAmountMoney();
|
|
|
+ reveExpeInfo1.setInWarehouseMoney(inWarehouseMoney);
|
|
|
+ }
|
|
|
+ //定义仓库支出
|
|
|
+ Double outWarehouseMoney = 0.0;
|
|
|
+ //查询
|
|
|
+ List<ReveExpeInfo> outWarehouseReveExpeInfoList = this.selectList(new EntityWrapper<ReveExpeInfo>()
|
|
|
+ .eq("comp_id",reveExpeInfo1.getCompId())
|
|
|
+ .eq("reex_type_key","4")
|
|
|
+ .eq("delete_flag","0"));
|
|
|
+ if(outWarehouseReveExpeInfoList != null){
|
|
|
+ outWarehouseMoney = outWarehouseMoney + reveExpeInfo1.getAmountMoney();
|
|
|
+ reveExpeInfo1.setOutWarehouseMoney(outWarehouseMoney);
|
|
|
+ }
|
|
|
+ //定义经营收入
|
|
|
+ Double inManageMoney = 0.0;
|
|
|
+ //查询
|
|
|
+ List<ReveExpeInfo> inManageReveExpeInfoList = this.selectList(new EntityWrapper<ReveExpeInfo>()
|
|
|
+ .eq("comp_id",reveExpeInfo1.getCompId())
|
|
|
+ .eq("reex_type_key","5")
|
|
|
+ .eq("delete_flag","0"));
|
|
|
+ if(inManageReveExpeInfoList != null){
|
|
|
+ inManageMoney = inManageMoney + reveExpeInfo1.getAmountMoney();
|
|
|
+ reveExpeInfo1.setInManageMoney(inManageMoney);
|
|
|
+ }
|
|
|
+ //定义经营支出
|
|
|
+ Double outManageMoney = 0.0;
|
|
|
+ //查询
|
|
|
+ List<ReveExpeInfo> outManageReveExpeInfoList = this.selectList(new EntityWrapper<ReveExpeInfo>()
|
|
|
+ .eq("comp_id",reveExpeInfo1.getCompId())
|
|
|
+ .eq("reex_type_key","6")
|
|
|
+ .eq("delete_flag","0"));
|
|
|
+ if(outManageReveExpeInfoList != null){
|
|
|
+ outManageMoney = outManageMoney + reveExpeInfo1.getAmountMoney();
|
|
|
+ reveExpeInfo1.setOutManageMoney(outManageMoney);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
Page<ReveExpeInfo> page = new Page<>();
|
|
|
page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
|
|
|
page.setTotal(dataCount == null ? 0 : dataCount);
|