|  | @@ -2,6 +2,10 @@ package com.ruoyi.finance.service.impl;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  import com.alibaba.fastjson.JSONArray;
 |  |  import com.alibaba.fastjson.JSONArray;
 | 
											
												
													
														|  |  import com.alibaba.fastjson.JSONObject;
 |  |  import com.alibaba.fastjson.JSONObject;
 | 
											
												
													
														|  | 
 |  | +import com.ruoyi.basicData.domain.TCorps;
 | 
											
												
													
														|  | 
 |  | +import com.ruoyi.basicData.domain.TFees;
 | 
											
												
													
														|  | 
 |  | +import com.ruoyi.basicData.mapper.TCorpsMapper;
 | 
											
												
													
														|  | 
 |  | +import com.ruoyi.basicData.mapper.TFeesMapper;
 | 
											
												
													
														|  |  import com.ruoyi.common.core.domain.AjaxResult;
 |  |  import com.ruoyi.common.core.domain.AjaxResult;
 | 
											
												
													
														|  |  import com.ruoyi.common.core.domain.model.LoginUser;
 |  |  import com.ruoyi.common.core.domain.model.LoginUser;
 | 
											
												
													
														|  |  import com.ruoyi.common.utils.DateUtils;
 |  |  import com.ruoyi.common.utils.DateUtils;
 | 
											
										
											
												
													
														|  | @@ -14,6 +18,7 @@ import com.ruoyi.finance.mapper.TFeeMapper;
 | 
											
												
													
														|  |  import com.ruoyi.finance.service.ITFeeService;
 |  |  import com.ruoyi.finance.service.ITFeeService;
 | 
											
												
													
														|  |  import com.ruoyi.warehouseBusiness.domain.*;
 |  |  import com.ruoyi.warehouseBusiness.domain.*;
 | 
											
												
													
														|  |  import com.ruoyi.warehouseBusiness.mapper.BillnoDelMapper;
 |  |  import com.ruoyi.warehouseBusiness.mapper.BillnoDelMapper;
 | 
											
												
													
														|  | 
 |  | +import com.ruoyi.warehouseBusiness.mapper.TWarehouseBillsMapper;
 | 
											
												
													
														|  |  import com.ruoyi.warehouseBusiness.service.impl.BillnoSerialServiceImpl;
 |  |  import com.ruoyi.warehouseBusiness.service.impl.BillnoSerialServiceImpl;
 | 
											
												
													
														|  |  import org.springframework.beans.factory.annotation.Autowired;
 |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
											
												
													
														|  |  import org.springframework.stereotype.Service;
 |  |  import org.springframework.stereotype.Service;
 | 
											
										
											
												
													
														|  | @@ -40,6 +45,15 @@ public class TFeeServiceImpl implements ITFeeService {
 | 
											
												
													
														|  |      @Autowired
 |  |      @Autowired
 | 
											
												
													
														|  |      private BillnoDelMapper billnoDelMapper;
 |  |      private BillnoDelMapper billnoDelMapper;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +    @Autowired
 | 
											
												
													
														|  | 
 |  | +    private TCorpsMapper tCorpsMapper;
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +    @Autowired
 | 
											
												
													
														|  | 
 |  | +    private TFeesMapper tFeesMapper;
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +    @Autowired
 | 
											
												
													
														|  | 
 |  | +    private TWarehouseBillsMapper tWarehouseBillsMapper;
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |      /**
 |  |      /**
 | 
											
												
													
														|  |       * 查询财务数据主
 |  |       * 查询财务数据主
 | 
											
												
													
														|  |       *
 |  |       *
 | 
											
										
											
												
													
														|  | @@ -47,8 +61,74 @@ public class TFeeServiceImpl implements ITFeeService {
 | 
											
												
													
														|  |       * @return 财务数据主
 |  |       * @return 财务数据主
 | 
											
												
													
														|  |       */
 |  |       */
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  | -    public TFee selectTFeeById(Long fId) {
 |  | 
 | 
											
												
													
														|  | -        return tFeeMapper.selectTFeeById(fId);
 |  | 
 | 
											
												
													
														|  | 
 |  | +    public Map<String, Object> selectTFeeById(Long fId) {
 | 
											
												
													
														|  | 
 |  | +        Map<String, Object> map = new HashMap<>();
 | 
											
												
													
														|  | 
 |  | +        // 客户表
 | 
											
												
													
														|  | 
 |  | +        List<Long> corpsId = new ArrayList<>();
 | 
											
												
													
														|  | 
 |  | +        // 费用
 | 
											
												
													
														|  | 
 |  | +        List<Long> feesId = new ArrayList<>();
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        TFee tFee=tFeeMapper.selectTFeeById(fId);
 | 
											
												
													
														|  | 
 |  | +        if (StringUtils.isNotNull(tFee.getfCorpid())) {
 | 
											
												
													
														|  | 
 |  | +            corpsId.add(tFee.getfCorpid());
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +        corpsId.add(tFee.getfCorpid());
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        // 查询从表数据
 | 
											
												
													
														|  | 
 |  | +        TFeeDo tFeeDo = new TFeeDo();
 | 
											
												
													
														|  | 
 |  | +        tFeeDo.setfPid(fId);
 | 
											
												
													
														|  | 
 |  | +        List<TFeeDo> tFeeDoList=  tFeeDoMapper.selectTFeeDoList(tFeeDo);
 | 
											
												
													
														|  | 
 |  | +        List<Map<String, Object>> feeDoList=new ArrayList<>();
 | 
											
												
													
														|  | 
 |  | +        if (StringUtils.isNotEmpty(tFeeDoList)) {
 | 
											
												
													
														|  | 
 |  | +            for (TFeeDo fees : tFeeDoList) {
 | 
											
												
													
														|  | 
 |  | +                Map<String, Object> map1 = new HashMap<>();
 | 
											
												
													
														|  | 
 |  | +                feesId.add(fees.getfFeeid());
 | 
											
												
													
														|  | 
 |  | +                // 查询主表
 | 
											
												
													
														|  | 
 |  | +                TWarehouseBills tWarehousebills = tWarehouseBillsMapper.selectTWarehousebillsById(fees.getfSrcpid());
 | 
											
												
													
														|  | 
 |  | +                map1.put("fId",fees.getfId());
 | 
											
												
													
														|  | 
 |  | +                map1.put("fSrcid",fees.getfSrcid());
 | 
											
												
													
														|  | 
 |  | +                map1.put("fSrcpid",fees.getfSrcpid());
 | 
											
												
													
														|  | 
 |  | +                map1.put("fMblno",tWarehousebills.getfMblno());
 | 
											
												
													
														|  | 
 |  | +                map1.put("fBscorpno",tWarehousebills.getfBscorpno());
 | 
											
												
													
														|  | 
 |  | +                map1.put("fProductName",tWarehousebills.getfProductName());
 | 
											
												
													
														|  | 
 |  | +                map1.put("fBsdate",tWarehousebills.getfBsdate());
 | 
											
												
													
														|  | 
 |  | +                map1.put("fFeeid",fees.getfFeeid());
 | 
											
												
													
														|  | 
 |  | +                map1.put("fSrcdc",fees.getfSrcdc());
 | 
											
												
													
														|  | 
 |  | +                map1.put("fAmt",fees.getfAmt());
 | 
											
												
													
														|  | 
 |  | +                if(tWarehousebills.getfBilltype().equals("SJRK")){
 | 
											
												
													
														|  | 
 |  | +                    map1.put("fBilltype","入库");
 | 
											
												
													
														|  | 
 |  | +                } else if(tWarehousebills.getfBilltype().equals("SJCK")){
 | 
											
												
													
														|  | 
 |  | +                    map1.put("fBilltype","出库");
 | 
											
												
													
														|  | 
 |  | +                } else if(tWarehousebills.getfBilltype().equals("CKDB")){
 | 
											
												
													
														|  | 
 |  | +                    map1.put("fBilltype","调拨");
 | 
											
												
													
														|  | 
 |  | +                } else if(tWarehousebills.getfBilltype().equals("HQZY")){
 | 
											
												
													
														|  | 
 |  | +                    map1.put("fBilltype","货权转移");
 | 
											
												
													
														|  | 
 |  | +                }
 | 
											
												
													
														|  | 
 |  | +                feeDoList.add(map1);
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        List<TCorps> corpsList = new ArrayList<>();
 | 
											
												
													
														|  | 
 |  | +        List<Long> corpsIdList = StringUtils.integerDeduplication(corpsId);
 | 
											
												
													
														|  | 
 |  | +        for (Long corpId : corpsIdList) {
 | 
											
												
													
														|  | 
 |  | +            TCorps corps = tCorpsMapper.selectTCorpsById(corpId);
 | 
											
												
													
														|  | 
 |  | +            if (StringUtils.isNotNull(corps)) {
 | 
											
												
													
														|  | 
 |  | +                corpsList.add(corps);
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +        List<TFees> feesList = new ArrayList<>();
 | 
											
												
													
														|  | 
 |  | +        List<Long> longList = StringUtils.integerDeduplication(feesId);
 | 
											
												
													
														|  | 
 |  | +        for (Long fees : longList) {
 | 
											
												
													
														|  | 
 |  | +            TFees tFees = tFeesMapper.selectTFeesById(fees);
 | 
											
												
													
														|  | 
 |  | +            if (StringUtils.isNotNull(tFees)) {
 | 
											
												
													
														|  | 
 |  | +                feesList.add(tFees);
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +        map.put("tFee",tFee);
 | 
											
												
													
														|  | 
 |  | +        map.put("corps",corpsList);
 | 
											
												
													
														|  | 
 |  | +        map.put("feesList", feesList);
 | 
											
												
													
														|  | 
 |  | +        map.put("feeDoList",feeDoList);
 | 
											
												
													
														|  | 
 |  | +        return map;
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      /**
 |  |      /**
 |