liusheng
2023-05-10 9ba8e58447fe44efc2f8052f38bd4b9c89314add
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFundServiceImpl.java
@@ -1,24 +1,24 @@
package com.ruoyi.project.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.ruoyi.project.domain.BaseExpertfeetype;
import com.ruoyi.project.domain.ServiceFunddetail;
import com.ruoyi.project.domain.ServiceReimbursement;
import com.ruoyi.common.utils.bean.DtoConversionUtils;
import com.ruoyi.project.domain.*;
import com.ruoyi.project.domain.vo.*;
import com.ruoyi.project.mapper.BaseExpertfeetypeMapper;
import com.ruoyi.project.mapper.ServiceFunddetailMapper;
import com.ruoyi.project.mapper.ServiceReimbursementMapper;
import com.ruoyi.project.mapper.*;
import com.ruoyi.project.service.IServiceFundSharedService;
import com.ruoyi.project.service.IServiceFunddetailSharedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.project.mapper.ServiceFundMapper;
import com.ruoyi.project.domain.ServiceFund;
import com.ruoyi.project.service.IServiceFundService;
import org.springframework.transaction.annotation.Transactional;
/**
 * 费用申请主Service业务层处理
@@ -27,8 +27,7 @@
 * @date 2022-01-24
 */
@Service
public class ServiceFundServiceImpl extends ServiceImpl<ServiceFundMapper, ServiceFund> implements IServiceFundService
{
public class ServiceFundServiceImpl extends ServiceImpl<ServiceFundMapper, ServiceFund> implements IServiceFundService {
    @Autowired
    ServiceFundMapper serviceFundMapper;
@@ -41,6 +40,17 @@
    @Autowired
    ServiceReimbursementMapper serviceReimbursementMapper;
    @Autowired
    IServiceFundSharedService sharedService;
    @Autowired
    ServiceFundSharedMapper serviceFundSharedMapper;
    @Autowired
    ServiceFunddetailSharedMapper sharedMapper;
    @Autowired
    IServiceFunddetailSharedService detailSharedService;
    /**
@@ -85,10 +95,34 @@
    }
    @Override
    public Long getFundId(Long infoid) {
        return serviceFundMapper.getFundId(infoid);
    }
    @Override
    @Transactional
    public Boolean addFundSharedInfo(Long id) {
        ServiceFund serviceFund = serviceFundMapper.selectById(id);
        ServiceFundShared serviceFundShared = DtoConversionUtils.sourceToTarget(serviceFund, ServiceFundShared.class);
        serviceFundShared.setSerfunid(serviceFundShared.getId());
        serviceFundShared.setId(null);
        sharedService.save(serviceFundShared);
        //fundId为主表的ID
        Map<String, Object> columnMap = new HashMap<>();
        columnMap.put("fundid", id);
        List<ServiceFunddetail> serviceFunddetails = serviceFunddetailMapper.selectByMap(columnMap);
        //将查出的数据放到ServiceFunddetailShared中
        List<ServiceFunddetailShared> serviceFunddetailShareds = DtoConversionUtils.sourceToTarget(serviceFunddetails, ServiceFunddetailShared.class);
        for (int i = 0; i < serviceFunddetails.size(); i++) {
            serviceFunddetailShareds.get(i).setFdid(serviceFunddetailShareds.get(i).getId());
            //fundID为service_fund_shared表的主键ID
            serviceFunddetailShareds.get(i).setFundid(serviceFundShared.getId());
            serviceFunddetailShareds.get(i).setId(null);
        }
        boolean result = detailSharedService.saveBatch(serviceFunddetailShareds);
        return result;
    }
    @Override
@@ -465,11 +499,9 @@
            }
        }
        hj = f1 + f2 + f3 + f4 + f5 + f6 + f7 + f8 + f9 + f10 + f11 + f12 + f13 + f14 + f15 + f16 + f17 + f18 + f19 + f20 + f21 + f22 + f23 + f24 + f25 + f26 + f27 + f28 + f29 + f30 + f31 + f32 + f33 + f34 + f35
                + f36 + f37 + f38 + f39 + f40 + f41 + f42 + f43 + f44 + f45 + f46 + f47 + f48 + f49 + f50 + f51 + f52;
        hj = f1 + f2 + f3 + f4 + f5 + f6 + f7 + f8 + f9 + f10 + f11 + f12 + f13 + f14 + f15 + f16 + f17 + f18 + f19 + f20 + f21 + f22 + f23 + f24 + f25 + f26 + f27 + f28 + f29 + f30 + f31 + f32 + f33 + f34 + f35 + f36 + f37 + f38 + f39 + f40 + f41 + f42 + f43 + f44 + f45 + f46 + f47 + f48 + f49 + f50 + f51 + f52;
        shhj = sh1 + sh2 + sh3 + sh4 + sh5 + sh6 + sh7 + sh8 + sh9 + sh10 + sh11 + sh12 + sh13 + sh14 + sh15 + sh16 + sh17 + sh18 + sh19 + sh20 + sh21 + sh22 + sh23 + sh24 + sh25 + sh26 + sh27 + sh28 + sh29 + sh30 + sh31 + sh32 + sh33 + sh34 + sh35
                + sh36 + sh37 + sh38 + sh39 + sh40 + sh41 + sh42 + sh43 + sh44 + sh45 + sh46 + sh47 + sh48 + sh49 + sh50 + sh51 + sh52;
        shhj = sh1 + sh2 + sh3 + sh4 + sh5 + sh6 + sh7 + sh8 + sh9 + sh10 + sh11 + sh12 + sh13 + sh14 + sh15 + sh16 + sh17 + sh18 + sh19 + sh20 + sh21 + sh22 + sh23 + sh24 + sh25 + sh26 + sh27 + sh28 + sh29 + sh30 + sh31 + sh32 + sh33 + sh34 + sh35 + sh36 + sh37 + sh38 + sh39 + sh40 + sh41 + sh42 + sh43 + sh44 + sh45 + sh46 + sh47 + sh48 + sh49 + sh50 + sh51 + sh52;
        fdvo.setFy1(f1);
        fdvo.setFy2(f2);