liusheng
2023-05-06 2b04605163633cbc4c1c801f31211d1ae0ccf0f5
代码修改
已添加3个文件
已修改14个文件
1046 ■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/controller/enums/PersonType.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java 370 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementdetailController.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementdetailSharedController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementpayeeController.java 88 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/DtoConversionUtils.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursement.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursementEo.java 270 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursementdetail.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursementdetailShared.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/mapper/ServiceReimbursementMapper.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/service/IServiceReimbursementService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementServiceImpl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementdetailServiceImpl.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementdetailSharedServiceImpl.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/resources/mapper/project/ServiceReimbursementMapper.xml 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/enums/PersonType.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,47 @@
package com.ruoyi.web.controller.enums;
import com.ruoyi.common.enums.OrganEnum;
/**
 * ç”¨æˆ·ç±»åž‹
 *
 * @author ls
 */
public enum PersonType
{
    OTHER("0", "其他人员"),
    PROFESSIONAL("1", "专职人员"),
    COORDINATOR("2", "协调员"),
    EXPERT("3","专家"),
    KIN("4","家属");
    private final String code;
    private final String info;
    PersonType(String code, String info)
    {
        this.code = code;
        this.info = info;
    }
    public String getCode()
    {
        return code;
    }
    public String getInfo()
    {
        return info;
    }
    public static String getInfoByCode(String code) {
        PersonType[] personTypes = values();
        for (int i = 0; i < personTypes.length; i++) {
            PersonType personType = personTypes[i];
            if (personType.getCode().equals(code)) {
                return personType.getInfo();
            }
        }
        return null;
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java
@@ -23,11 +23,13 @@
import com.ruoyi.project.domain.vo.SpFinancialExpensesReimbursementOut;
import com.ruoyi.project.service.*;
import com.ruoyi.system.service.ISysPostService;
import com.ruoyi.web.controller.enums.PersonType;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.StringUtils;
import org.apache.ibatis.annotations.Options;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -37,7 +39,7 @@
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
@@ -49,8 +51,7 @@
@Api("报销申请")
@RestController
@RequestMapping("/project/reimbursement")
public class ServiceReimbursementController extends BaseController
{
public class ServiceReimbursementController extends BaseController {
    @Autowired
    private IServiceReimbursementService serviceReimbursementService;
@@ -73,10 +74,12 @@
    private IServiceSystemmessageService ServiceSystemmessage;
    private static Configuration configuration = null;
    public ServiceReimbursementController() {
        configuration = new Configuration();
        configuration.setDefaultEncoding("utf-8");
    }
    static String cashUnitLeft[] = { "元", "拾", "ä½°", "仟", "万", "拾", "ä½°", "仟","亿", "拾", "ä½°", "仟", "万" };
    static String cashUnitRight[] = { "角", "分", "厘" };
    static String upperNumber[] = { "零", "壹", "è´°", "叁", "肆", "伍", "陆", "柒","捌", "玖" };
@@ -88,8 +91,7 @@
    //@PreAuthorize("@ss.hasPermi('project:reimbursement:list')")
    @Log(title = "查询报销申请列表", businessType = BusinessType.OTHER)
    @GetMapping("/list")
    public TableDataInfo list(ServiceReimbursement serviceReimbursement)
    {
    public TableDataInfo list(ServiceReimbursement serviceReimbursement) {
        SysUser user = SecurityUtils.getLoginUser().getUser();
        serviceReimbursement.setCreateBy(user.getUserName());
        startPage();
@@ -102,8 +104,7 @@
     */
    @ApiOperation("根据日期查询报销申请列表")
    @GetMapping("/listWithDate")
    public TableDataInfo listWithDate(ServiceReimbursementDto serviceReimbursementdto)
    {
    public TableDataInfo listWithDate(ServiceReimbursementDto serviceReimbursementdto) {
        startPage();
        List<ServiceReimbursement> list = serviceReimbursementService.selectSearchList(serviceReimbursementdto);
        return getDataTable(list);
@@ -115,8 +116,7 @@
    @ApiOperation("根据权限显示审核列表")
    @Log(title = "根据权限显示审核列表", businessType = BusinessType.OTHER)
    @GetMapping("/listbypower")
    public TableDataInfo getListBypower(SpFinancialExpensesIn spFinancialExpensesIn)
    {
    public TableDataInfo getListBypower(SpFinancialExpensesIn spFinancialExpensesIn) {
        LoginUser loginUser = getLoginUser();
        String APPLICANT=spFinancialExpensesIn.getAPPLICANT();
@@ -127,28 +127,23 @@
        Integer pageNum=spFinancialExpensesIn.getPageNum();
        Integer pageSize=spFinancialExpensesIn.getPageSize();
        if(pageNum==null)
        {
        if (pageNum == null) {
            pageNum=1;
        }
        if(pageSize==null)
        {
        if (pageSize == null) {
            pageSize=10;
        }
        if(APPLICANT==null)
        {
        if (APPLICANT == null) {
            APPLICANT="";
        }
        if(APPLICATIONBEGTIME==null)
        {
        if (APPLICATIONBEGTIME == null) {
            APPLICATIONBEGTIME="";
        }
        if(APPLICATIONENDTIME==null)
        {
        if (APPLICATIONENDTIME == null) {
            APPLICATIONENDTIME="";
        }
        //startPage();
@@ -163,8 +158,7 @@
    //@PreAuthorize("@ss.hasPermi('project:reimbursement:export')")
    @Log(title = "报销申请", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(ServiceReimbursement serviceReimbursement)
    {
    public AjaxResult export(ServiceReimbursement serviceReimbursement) {
        List<ServiceReimbursement> list = serviceReimbursementService.queryList(serviceReimbursement);
        ExcelUtil<ServiceReimbursement> util = new ExcelUtil<ServiceReimbursement>(ServiceReimbursement.class);
        return util.exportExcel(list, "报销申请数据");
@@ -176,8 +170,7 @@
    @ApiOperation("获取报销申请详细信息")
    //@PreAuthorize("@ss.hasPermi('project:reimbursement:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return AjaxResult.success(serviceReimbursementService.getById(id));
    }
@@ -200,28 +193,23 @@
    @PostMapping
    @RepeatSubmit
    @Options(useGeneratedKeys = true, keyProperty = "id")
    public AjaxResult add(@RequestBody ServiceReimbursement serviceReimbursement)
    {
    public AjaxResult add(@RequestBody ServiceReimbursement serviceReimbursement) {
        boolean b = serviceReimbursementService.save(serviceReimbursement);
        if(b)
        {
        if (b) {
            addReiSharedDatd(serviceReimbursement,1);
        }
        Long id = serviceReimbursement.getId();
        return AjaxResult.success(id);
    }
    public  int addReiSharedDatd(ServiceReimbursement serviceReimbursement,int nType)
    {
    public int addReiSharedDatd(ServiceReimbursement serviceReimbursement, int nType) {
        //remShare = ;
        ServiceReimbursementShared remShare = null;
        if(nType == 1)
       {
        if (nType == 1) {
            remShare = new ServiceReimbursementShared();
            remShare.setReimid(serviceReimbursement.getId());
        }
        else //modify
        } else //modify
        {
            List<ServiceReimbursementShared> remlist = serviceReimbursementServiceShare.getRemShareInfoByRemId(serviceReimbursement.getId());
            if(remlist!=null)
@@ -292,12 +280,9 @@
        //remShare.setDonorno(serviceReimbursement.getDonorno());
        boolean bRet = false;
        if(nType==1)
        {
        if (nType == 1) {
            bRet = serviceReimbursementServiceShare.save(remShare);
        }
        else
        {
        } else {
            //remShare.setId(serviceReimbursement.);
            bRet = serviceReimbursementServiceShare.updateById(remShare);
        }
@@ -308,12 +293,9 @@
        if(strMutfileUrl == null) return 0;
        if(strMutfileUrl.isEmpty()) return 0;
        try
        {
        try {
            uploadOAFileAndUpdateDb(remShare);
        }
        catch (Exception e)
        {
        } catch (Exception e) {
            logger.error("调用第三方接口出错!");
            e.printStackTrace();
        }
@@ -324,8 +306,7 @@
    }
    int uploadOAFileAndUpdateDb(ServiceReimbursementShared remShare)
    {
    int uploadOAFileAndUpdateDb(ServiceReimbursementShared remShare) {
            //上传OA文件
        //String strUrl = "http://129.88.242.39:8899/seeyon/rest/token?userName=opo&password=127814f8-84e8-4304-84a5-a71573567efd&loginName=demo3";
        String strUrl = "http://129.88.242.39:8899/seeyon/rest/token";
@@ -372,20 +353,16 @@
        String fileid = "";
        String[] urlArray = strMutfileUrl.split(",");
        for (int i = 0; i < urlArray.length; i++)
        {
        for (int i = 0; i < urlArray.length; i++) {
            String strOneFileName = urlArray[i];
            String strTemp = strOneFileName.substring(15);
            String strFile = filePath  + strTemp ;
            //FileUploadUtils.getAbsoluteFile(filePath,strOneFileName);
            String struploadResult = "";
            File filetest = new File(strFile);
            try
            {
            try {
                struploadResult = HttpClientKit.sendPostWithFile(filetest,strFUrl);
            }
            catch (Exception e)
            {
            } catch (Exception e) {
                e.printStackTrace();
            }
@@ -427,15 +404,13 @@
            JSONObject jsonR = JSONObject.parseObject(struploadResult);
            JSONArray jsonArr = jsonR.getJSONArray("atts");
            for(int j=0;j<jsonArr.size();j++)
            {
            for (int j = 0; j < jsonArr.size(); j++) {
                JSONObject jsonRet = jsonArr.getJSONObject(j);
                String name1= jsonRet.get("filename").toString();
                String id1 = jsonRet.get("fileUrl").toString();
                filename+=name1;
                fileid+=id1;
                if(i!=urlArray.length-1)
                {
                if (i != urlArray.length - 1) {
                    filename+=",";
                    fileid+=",";
                }
@@ -459,23 +434,18 @@
    @ApiOperation("差旅费上报")
    @Log(title = "差旅费上报", businessType = BusinessType.OTHER)
    @PostMapping("/travelexpensereport")
    public AjaxResult travelexpensereport(@RequestBody CheckFundVO checkFundVO)
    {
    public AjaxResult travelexpensereport(@RequestBody CheckFundVO checkFundVO) {
        ServiceReimbursement serviceReimbursement= serviceReimbursementService.getById(checkFundVO.getFundid());
        if(serviceReimbursement!=null)
        {
        if (serviceReimbursement != null) {
            Integer TotalLevel=0;
            LoginUser loginUser = getLoginUser();
            SysUser user = loginUser.getUser();
            List<Integer> postids =postService.selectPostListByUserId(loginUser.getUserId());
            if(!postids.contains(2))
            {
            if (!postids.contains(2)) {
                serviceReimbursement.setFlowlevel(1L);
                serviceReimbursement.setRecordstatus(2);
            }
            else
            {
            } else {
                serviceReimbursement.setFlowlevel(0L);
                serviceReimbursement.setRecordstatus(0);
            }
@@ -496,9 +466,7 @@
            serviceReimbursementService.updateById(serviceReimbursement);
            return AjaxResult.success();
        }
        else
        {
        } else {
            return AjaxResult.error(HttpStatus.NO_CONTENT,"费用编号不正确");
        }
    }
@@ -510,11 +478,9 @@
    @ApiOperation("审核费用")
    @Log(title = "审核费用", businessType = BusinessType.OTHER)
    @PostMapping("/checkfund")
    public AjaxResult checkFund(@RequestBody CheckFundVO checkFundVO)
    {
    public AjaxResult checkFund(@RequestBody CheckFundVO checkFundVO) {
        ServiceReimbursement serviceReimbursement= serviceReimbursementService.getById(checkFundVO.getFundid());
        if(serviceReimbursement!=null)
        {
        if (serviceReimbursement != null) {
            Integer TotalLevel=0;
            LoginUser loginUser = getLoginUser();
            ServiceFundflowrule serviceFundflowrule=new ServiceFundflowrule();
@@ -523,51 +489,38 @@
            serviceFundflowrule.setCheckuserno(loginUser.getUsername());
            List<ServiceFundflowrule> serviceFundflowrules= serviceFundflowruleService.queryList(serviceFundflowrule);
            if(serviceFundflowrules==null || serviceFundflowrules.stream().count()==0)
            {
            if (serviceFundflowrules == null || serviceFundflowrules.stream().count() == 0) {
                return AjaxResult.error(HttpStatus.ERROR,"当前人员无此记录审核权限");
            }
            if(serviceFundflowrules.get(0).getFlowlevel()-1!=serviceReimbursement.getFlowlevel())
            {
            if (serviceFundflowrules.get(0).getFlowlevel() - 1 != serviceReimbursement.getFlowlevel()) {
                return AjaxResult.error(HttpStatus.ERROR,"当前人员与此记录的审核级别不符");
            }
            if(serviceFundflowrules!=null && serviceFundflowrules.stream().count()>0)
            {
            if (serviceFundflowrules != null && serviceFundflowrules.stream().count() > 0) {
                TotalLevel=serviceFundflowrules.get(0).getTotallevel();
            }
            Integer CheckFlag=0;
            Integer RecordStatus = serviceReimbursement.getRecordstatus();
            Integer FlowLevel = Integer.valueOf(serviceReimbursement.getFlowlevel().toString());
            Integer OriginalFlowLevel=FlowLevel;
            if(checkFundVO.getFlowconclusion()==1)
            {
            if (checkFundVO.getFlowconclusion() == 1) {
                CheckFlag=1;
                if(TotalLevel==0)
                {
                if (TotalLevel == 0) {
                    RecordStatus=99;
                }
                else
                {
                    if(TotalLevel==FlowLevel+1)
                    {
                } else {
                    if (TotalLevel == FlowLevel + 1) {
                        RecordStatus=99;
                    }
                    else
                    {
                    } else {
                        RecordStatus = (FlowLevel+1)*2;
                    }
                }
                FlowLevel=FlowLevel+1;
            }
            else
            {
            } else {
                CheckFlag=2;
                RecordStatus = (FlowLevel+1)*2 - 1;
                FlowLevel=(FlowLevel-1);
                if(FlowLevel<0)
                {
                if (FlowLevel < 0) {
                    FlowLevel=0;
                }
            }
@@ -589,10 +542,8 @@
            List<Integer> postids =postService.selectPostListByUserId(loginUser.getUserId());
            if(!postids.contains(2))
            {
                if(CheckFlag==2 && OriginalFlowLevel==1)
                {
            if (!postids.contains(2)) {
                if (CheckFlag == 2 && OriginalFlowLevel == 1) {
                    ServiceFundflow serviceFundflowAuto=new ServiceFundflow();
                    serviceFundflowAuto.setFundid(serviceReimbursement.getId());
                    serviceFundflowAuto.setCheckuserno(user.getUserName());
@@ -620,15 +571,12 @@
            serviceSystemmessage.setIsread(0);
            serviceSystemmessage.setMessagetype(1);
            serviceSystemmessage.setRelevantno(serviceReimbursement.getId());
            if(CheckFlag==1)
            {
            if (CheckFlag == 1) {
                //通过
                serviceSystemmessage.setMessagetitle(""+(OriginalFlowLevel+1)+"级审核通过");
                serviceSystemmessage.setMessagecontent("您"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(serviceReimbursement.getCreateTime())+"提交的关于捐献案例【"+serviceReimbursement.getDonorname()+"】的差旅费申请已通过"+(OriginalFlowLevel+1)+"级审核");
            }
            else
            {
            } else {
                //驳回
                serviceSystemmessage.setMessagetitle(""+(OriginalFlowLevel+1)+"级审核驳回");
                serviceSystemmessage.setMessagecontent("您"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(serviceReimbursement.getCreateTime())+"提交的关于捐献案例【"+serviceReimbursement.getDonorname()+"】的差旅费申请已被"+(OriginalFlowLevel+1)+"级审核驳回,原因为"+checkFundVO.getFlowcontent()+"");
@@ -636,9 +584,7 @@
            ServiceSystemmessage.save(serviceSystemmessage);
            return AjaxResult.success();
        }
        else
        {
        } else {
            return AjaxResult.error(HttpStatus.NO_CONTENT,"费用编号不正确");
        }
    }
@@ -652,11 +598,9 @@
    @Log(title = "报销申请", businessType = BusinessType.UPDATE)
    @PutMapping
    @RepeatSubmit    
    public AjaxResult edit(@RequestBody ServiceReimbursement serviceReimbursement)
    {
    public AjaxResult edit(@RequestBody ServiceReimbursement serviceReimbursement) {
        boolean b= serviceReimbursementService.updateById(serviceReimbursement);
        if(b)
        {
        if (b) {
            addReiSharedDatd(serviceReimbursement,2);
        }
        return toAjax(b);
@@ -669,11 +613,9 @@
    //@PreAuthorize("@ss.hasPermi('project:reimbursement:edit')")
    @Log(title = "审核费用", businessType = BusinessType.OTHER)
    @PostMapping("/editMoney")
    public AjaxResult editMoney(@RequestBody List<ReimbursementService> serviceReimbursement)
    {
    public AjaxResult editMoney(@RequestBody List<ReimbursementService> serviceReimbursement) {
        boolean b= serviceReimbursementService.updateById(null);
        if(b)
        {
        if (b) {
            addReiSharedDatd(null,2);
        }
        return toAjax(b);
@@ -686,8 +628,7 @@
    //@PreAuthorize("@ss.hasPermi('project:reimbursement:remove')")
    @Log(title = "报销申请", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(serviceReimbursementService.removeByIds(Arrays.asList(ids)));
    }
@@ -716,6 +657,20 @@
        //输出文档路径及名称
        File outFile = new File(RuoYiConfig.getProfile()+"/download/wordtemplate/"+name+".doc");
        //创建文件夹
        File folderPath = new File(RuoYiConfig.getProfile() + "/download/wordtemplate");
        if (!folderPath.exists()) {
            boolean success = folderPath.mkdirs();
            if (success) {
                System.out.println("目录创建成功");
            } else {
                System.out.println("目录创建失败");
            }
        } else {
            System.out.println("目录已存在");
        }
        Writer out = null;
        try {
@@ -735,52 +690,132 @@
    }
    private void getData(Map dataMap,Long id) {
        ServiceReimbursement serviceReimbursement = serviceReimbursementService.getById(id);
        if (serviceReimbursement == null) {
            throw new ServiceException("下载失败,用户信息出错", HttpStatus.NO_CONTENT);
        //ServiceReimbursement serviceReimbursement = serviceReimbursementService.getById(id);
        ServiceReimbursement serviceReimbursement = null;
        ServiceReimbursementEo serviceReimbursementEo = new ServiceReimbursementEo();
        serviceReimbursementEo.setId(id);
        List<ServiceReimbursementEo> rdInfoByItem = serviceReimbursementService.getRDInfoByItem(serviceReimbursementEo);
        Map<String, List<ServiceReimbursementEo>> listMap = rdInfoByItem.stream()
                .collect(Collectors.groupingBy(ServiceReimbursementEo::getPersontype));
        List<Map<String, BigDecimal>> list = new ArrayList<>();
        StringBuffer FYXM1 = new StringBuffer();
        StringBuffer FYXM2 = new StringBuffer();
        StringBuffer FYXM3 = new StringBuffer();
        int flag = 0;
        String key1 = null;
        BigDecimal allMoney = new BigDecimal(0.00);
        BigDecimal otherMoneyall = new BigDecimal(0.00);
        for (String key : listMap.keySet()) {
            Map<String, BigDecimal> map = new HashMap<>();
            List<ServiceReimbursementEo> values = listMap.get(key);
            BigDecimal otherMoney = new BigDecimal(0.00);
            BigDecimal keyOneMoney = new BigDecimal(0.00);
            BigDecimal keyTwoMoney = new BigDecimal(0.00);
            for (ServiceReimbursementEo serviceReimbursementEo1 : values) {
                otherMoney = otherMoney.add(serviceReimbursementEo1.getTrafficexpense()).add(serviceReimbursementEo1.getHotelexpense())
                        .add(serviceReimbursementEo1.getFoodexpenses()).add(serviceReimbursementEo1.getFoodallowance())
                        .add(serviceReimbursementEo1.getOtherexpense()).add(serviceReimbursementEo1.getOtherfeeamount());
            }
            map.put(key, otherMoney);
            list.add(map);
            // ä¸ä¸ºä¸“家或家属
            if (!key.equals("3") && !key.equals("4")) {
                //将上一次的清空
                FYXM1.delete(0, FYXM1.length());
                //再新增
                otherMoneyall = otherMoneyall.add(otherMoney);
                FYXM1.append("OPO工作人员" + ":" + otherMoneyall + " ");
            } else {
                if (flag == 0) {
                    key1 = key;
                    flag = 1;
                }
                if (key1 == key) {
                    FYXM2.append(PersonType.getInfoByCode(key) + ":" + otherMoney);
                    allMoney = allMoney.add(otherMoney);
                } else {
                    FYXM3.append(PersonType.getInfoByCode(key) + ":" + otherMoney);
                    allMoney = allMoney.add(otherMoney);
                }
            }
        }
        allMoney = allMoney.add(otherMoneyall);
        if (FYXM1.length() == 0) {
            if (FYXM2.length() != 0 && FYXM3.length() != 0) {
                FYXM1.append(FYXM3);
                FYXM3.setLength(0);
            } else if (FYXM2.length() != 0 && FYXM3.length() == 0) {
                FYXM1.append(FYXM2);
                FYXM2.setLength(0);
            }
        } else if (FYXM2.length() == 0) {
            if (FYXM3.length() != 0) {
                FYXM2.append(FYXM3);
                FYXM3.setLength(0);
            }
        }
        Date dt = serviceReimbursement.getCreateTime();
        if (rdInfoByItem == null || rdInfoByItem.size() == 0) {
            throw new ServiceException("下载失败,用户信息出错", HttpStatus.NO_CONTENT);
        }
        Date dt = rdInfoByItem.get(0).getCreateTime();
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String date = formatter.format(dt);
        String time = date.substring(0, 10);
        dataMap.put("TBYYMMDD", time);
        dataMap.put("BXDFJ", serviceReimbursement.getAttachcount() == 0 ? "   " : "" + serviceReimbursement.getAttachcount());
        dataMap.put("JXZXM", serviceReimbursement.getDonorname() == null ? "" : serviceReimbursement.getDonorname());
        dataMap.put("JSR", serviceReimbursement.getUsername() == null ? "" : serviceReimbursement.getUsername());
        dataMap.put("FYXM1", "差旅费报销总金额: " + String.format("%.2f", serviceReimbursement.getAmountrequested()).toString() + "元");
        dataMap.put("BXDFJ", rdInfoByItem.get(0).getAttachcount() == null ? "   " : "" + rdInfoByItem.get(0).getAttachcount());
        dataMap.put("JXZXM", rdInfoByItem.get(0).getDonorname() == null ? "" : rdInfoByItem.get(0).getDonorname());
        dataMap.put("JSR", rdInfoByItem.get(0).getUsername() == null ? "" : rdInfoByItem.get(0).getUsername());
        if (FYXM1.length() != 0) {
            dataMap.put("FYXM1", FYXM1.toString() + "元  ");
        } else {
            dataMap.put("FYXM1", "");
        }
        if (FYXM2.length() != 0) {
            dataMap.put("FYXM2", FYXM2.toString() + "元  ");
        } else {
        dataMap.put("FYXM2", "");
        }
        if (FYXM3.length() != 0) {
            dataMap.put("FYXM3", FYXM3.toString() + "元  ");
        } else {
        dataMap.put("FYXM3", "");
        dataMap.put("JEXS", serviceReimbursement.getAmountrequested());
        }
     //   dataMap.put("JEXS", rdInfoByItem.get(0).getAmountrequested());
        dataMap.put("JEXS", allMoney);
        //double temp = 0;
        //temp = Math.round(serviceReimbursement.getAmountrequested() * 100) * 0.01d;
        dataMap.put("JEDS", convert(serviceReimbursement.getAmountrequested()) + "整");
       // dataMap.put("JEDS", convert(rdInfoByItem.get(0).getAmountrequested().doubleValue()) + "整");
        dataMap.put("JEDS", convert(allMoney.doubleValue()) + "整");
        String remark = "";
        remark += serviceReimbursement.getCosttypename() == null ? "" : serviceReimbursement.getCosttypename() + "(";
        remark += rdInfoByItem.get(0).getCosttypename() == null ? "" : rdInfoByItem.get(0).getCosttypename() + "(";
        remark += serviceReimbursement.getTravelers() == null ? "" : serviceReimbursement.getTravelers() + ": ";
        remark += rdInfoByItem.get(0).getTravelers() == null ? "" : rdInfoByItem.get(0).getTravelers() + ": ";
        remark += serviceReimbursement.getIdcardno() == null ? "" : serviceReimbursement.getIdcardno() + "; ";
        remark += rdInfoByItem.get(0).getIdcardno() == null ? "" : rdInfoByItem.get(0).getIdcardno() + "; ";
        remark += serviceReimbursement.getDepositbank() == null ? "" : serviceReimbursement.getDepositbank() + ": ";
        remark += rdInfoByItem.get(0).getDepositbank() == null ? "" : rdInfoByItem.get(0).getDepositbank() + ": ";
        remark += serviceReimbursement.getBankcardno() == null ? "" : serviceReimbursement.getBankcardno() + ")";
        remark += rdInfoByItem.get(0).getBankcardno() == null ? "" : rdInfoByItem.get(0).getBankcardno() + ")";
        remark += "\n";
        remark += serviceReimbursement.getRemark() == null ? "" : serviceReimbursement.getRemark();
        remark += rdInfoByItem.get(0).getRemark() == null ? "" : rdInfoByItem.get(0).getRemark();
        dataMap.put("BXBZ", remark);
        dataMap.put("YYMMDD", time);
        dataMap.put("FJ", serviceReimbursement.getAttachcount() == 0 ? "   " : "" + serviceReimbursement.getAttachcount());
        dataMap.put("FP", serviceReimbursement.getInvoicecount() == 0 ? "   " : "" + serviceReimbursement.getInvoicecount());
        dataMap.put("XM", serviceReimbursement.getTravelers() == null ? "" : serviceReimbursement.getTravelers());
        dataMap.put("BXR", serviceReimbursement.getUsername() == null ? "" : serviceReimbursement.getUsername());
        dataMap.put("QYZZ", serviceReimbursement.getManagername() == null ? "" : serviceReimbursement.getManagername());
        dataMap.put("CCSY", serviceReimbursement.getReason() == null ? "" : serviceReimbursement.getReason());
        dataMap.put("FJ", rdInfoByItem.get(0).getAttachcount() == null ? "   " : "" + rdInfoByItem.get(0).getAttachcount());
        dataMap.put("FP", rdInfoByItem.get(0).getInvoicecount() == null ? "   " : "" + rdInfoByItem.get(0).getInvoicecount());
        dataMap.put("XM", rdInfoByItem.get(0).getTravelers() == null ? "" : rdInfoByItem.get(0).getTravelers());
        dataMap.put("BXR", rdInfoByItem.get(0).getUsername() == null ? "" : rdInfoByItem.get(0).getUsername());
        dataMap.put("QYZZ", rdInfoByItem.get(0).getManagername() == null ? "" : rdInfoByItem.get(0).getManagername());
        dataMap.put("CCSY", rdInfoByItem.get(0).getReason() == null ? "" : rdInfoByItem.get(0).getReason());
        List<ServiceReimbursementdetail> rd = serviceReimbursementdetailService.getAllDetailsByRBID(id);
@@ -789,14 +824,14 @@
        }
        List<Map<String, Object>> newsList = new ArrayList<Map<String,Object>>();
        int days = 0;
        double te = 0;
        double cf = 0;
        double he = 0;
        double oe = 0;
        double fe = 0;
        double fa = 0;
        double hj = 0;
        double qt = 0;
        BigDecimal te = BigDecimal.ZERO;
        BigDecimal cf = BigDecimal.ZERO;
        BigDecimal he = BigDecimal.ZERO;
        BigDecimal oe = BigDecimal.ZERO;
        BigDecimal fe = BigDecimal.ZERO;
        BigDecimal fa = BigDecimal.ZERO;
        BigDecimal hj = BigDecimal.ZERO;
        BigDecimal qt = BigDecimal.ZERO;
        for(ServiceReimbursementdetail s : rd) {
            Map<String, Object> map=new HashMap<String, Object>();
@@ -828,26 +863,26 @@
            days += s.getDays();
            map.put("JT", s.getTraffictype() == null ? "" : s.getTraffictype());
            map.put("QTFSM", s.getOtherfeedesc() == null ? "" : s.getOtherfeedesc());
            map.put("JTF", s.getTrafficexpense() == 0.00 ? "" : String.format("%.2f", s.getTrafficexpense()).toString() + "");
            te += s.getTrafficexpense();
            map.put("SNJT", s.getCityfee() == 0.00 ? "" : String.format("%.2f", s.getCityfee()).toString() + "");
            cf += s.getCityfee();
            map.put("ZSF", s.getHotelexpense() == 0.00 ? "" : String.format("%.2f", s.getHotelexpense()).toString() + "");
            he += s.getHotelexpense();
            map.put("ZF", s.getOtherexpense() == 0.00 ? "" : String.format("%.2f", s.getOtherexpense()).toString() + "");
            oe += s.getOtherexpense();
            map.put("HSBX", s.getFoodexpenses() == 0.00 ? "" : String.format("%.2f",s.getFoodexpenses()).toString() + "");
            fe += s.getFoodexpenses();
            map.put("HSBZ", s.getFoodallowance() == 0.00 ? "" : String.format("%.2f",s.getFoodallowance()).toString() + "");
            fa += s.getFoodallowance();
            map.put("QTF", s.getOtherfeeamount() == 0.00 ? "" : String.format("%.2f",s.getOtherfeeamount()).toString() + "");
            qt += s.getOtherfeeamount();
            map.put("HJ", String.format("%.2f", s.getTrafficexpense() + s.getCityfee() + s.getHotelexpense() + s.getOtherexpense() + s.getFoodexpenses() + s.getFoodallowance() + s.getOtherfeeamount()).toString() + "");
            hj += s.getTrafficexpense() + s.getCityfee() + s.getHotelexpense() + s.getOtherexpense() + s.getFoodexpenses() + s.getFoodallowance() + s.getOtherfeeamount();
            map.put("JTF", s.getTrafficexpense().equals(BigDecimal.ZERO) ? "" : String.format("%.2f", s.getTrafficexpense()).toString() + "");
            te = te.add(s.getTrafficexpense());
            map.put("SNJT", s.getCityfee().equals(BigDecimal.ZERO) ? "" : String.format("%.2f", s.getCityfee()).toString() + "");
            cf = cf.add(s.getCityfee());
            map.put("ZSF", s.getHotelexpense().equals(BigDecimal.ZERO) ? "" : String.format("%.2f", s.getHotelexpense()).toString() + "");
            he = he.add(s.getHotelexpense());
            map.put("ZF", s.getOtherexpense().equals(BigDecimal.ZERO) ? "" : String.format("%.2f", s.getOtherexpense()).toString() + "");
            oe = oe.add(s.getOtherexpense());
            map.put("HSBX", s.getFoodexpenses().equals(BigDecimal.ZERO) ? "" : String.format("%.2f", s.getFoodexpenses()).toString() + "");
            fe = fe.add(s.getFoodexpenses());
            map.put("HSBZ", s.getFoodallowance().equals(BigDecimal.ZERO) ? "" : String.format("%.2f", s.getFoodallowance()).toString() + "");
            fa = fa.add(s.getFoodallowance());
            map.put("QTF", s.getOtherfeeamount().equals(BigDecimal.ZERO) ? "" : String.format("%.2f", s.getOtherfeeamount()).toString() + "");
            qt = qt.add(s.getOtherfeeamount());
            map.put("HJ", String.format("%.2f", s.getTrafficexpense().add(s.getCityfee()).add(s.getHotelexpense()).add(s.getOtherexpense()).add(s.getFoodexpenses()).add(s.getFoodallowance()).add(s.getOtherfeeamount())).toString() + "");
            hj = hj.add(s.getTrafficexpense().add(s.getCityfee()).add(s.getHotelexpense()).add(s.getOtherexpense()).add(s.getFoodexpenses()).add(s.getFoodallowance()).add(s.getOtherfeeamount()));
            //hj = Math.round(hj * 100) * 0.01d;
            DecimalFormat df = new DecimalFormat("0.00");
//            DecimalFormat df = new DecimalFormat("0.00");
            hj = new Double(df.format(hj).toString());
          //  hj = new Double(df.format(hj).toString());
            newsList.add(map);
        }
@@ -864,11 +899,11 @@
        dataMap.put("TQTF", "" + String.format("%.2f", qt).toString() + "");
        dataMap.put("THJ", "" + String.format("%.2f", hj).toString() + "");
        dataMap.put("DS", convert(hj) + "整");
        dataMap.put("DS", convert(hj.doubleValue()) + "整");
        //dataMap.put("DS", "整");
        dataMap.put("XS", String.format("%.2f", hj).toString() + "");
        dataMap.put("R", serviceReimbursement.getCosttypename() == null ? "" : serviceReimbursement.getCosttypename());
        dataMap.put("R", StringUtils.isEmpty(rdInfoByItem.get(0).getCosttypename()) ? "" : rdInfoByItem.get(0).getCosttypename());
    }
@@ -977,7 +1012,6 @@
        System.out.println(result);
        return result;
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementdetailController.java
@@ -1,7 +1,12 @@
package com.ruoyi.web.controller.project;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import com.ruoyi.common.utils.bean.DtoConversionUtils;
import com.ruoyi.project.domain.ServiceReimbursementdetailShared;
import com.ruoyi.project.service.IServiceReimbursementdetailSharedService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -37,6 +42,8 @@
{
    @Autowired
    private IServiceReimbursementdetailService serviceReimbursementdetailService;
    @Autowired
    private IServiceReimbursementdetailSharedService detailSharedService;
    /**
     * æŸ¥è¯¢æŠ¥é”€ç”³è¯·æ˜Žç»†åˆ—表
@@ -109,15 +116,11 @@
    public AjaxResult updateRDlList(@RequestBody List<ServiceReimbursementdetail> serviceReimbursementdetails)
    {
        for (ServiceReimbursementdetail serviceReimbursementdetail:serviceReimbursementdetails) {
            if(serviceReimbursementdetail.getId()!=null) {
                serviceReimbursementdetailService.updateById(serviceReimbursementdetail);
            }else {
                //如果ID为空,则要新增
                add(serviceReimbursementdetail);
            serviceReimbursementdetailService.saveOrUpdate(serviceReimbursementdetail);
            //新增或修改报销申请明细分享表
            ServiceReimbursementdetailShared serviceReimbursementdetailShared = DtoConversionUtils.sourceToTarget(serviceReimbursementdetail, ServiceReimbursementdetailShared.class);
            detailSharedService.saveOrUpdate(serviceReimbursementdetailShared);
            }
        }
      //  return toAjax("null");
        return null;
    }
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementdetailSharedController.java
@@ -1,4 +1,4 @@
package com.ruoyi.project.controller;
package com.ruoyi.web.controller.project;
import java.util.Arrays;
import java.util.List;
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementpayeeController.java
@@ -1,13 +1,13 @@
package com.ruoyi.project.controller;
package com.ruoyi.web.controller.project;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import com.ruoyi.project.domain.ReimbursementService;
import com.ruoyi.common.utils.bean.DtoConversionUtils;
import com.ruoyi.project.domain.Reimbursementpayee;
import io.netty.util.internal.ObjectUtil;
import com.ruoyi.project.domain.ServiceReimbursementpayeeShared;
import com.ruoyi.project.service.IServiceReimbursementpayeeSharedService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
@@ -41,10 +41,12 @@
@Api("差旅报销付款信息")
@RestController
@RequestMapping("/project/reimbursementpayee")
public class ServiceReimbursementpayeeController extends BaseController
{
public class ServiceReimbursementpayeeController extends BaseController {
    @Autowired
    private IServiceReimbursementpayeeService serviceReimbursementpayeeService;
    @Autowired
    private IServiceReimbursementpayeeSharedService serviceReimbursementpayeeSharedService;
    /**
     * æŸ¥è¯¢å·®æ—…报销付款信息列表
@@ -52,8 +54,7 @@
    @ApiOperation("查询差旅报销付款信息列表")
    @PreAuthorize("@ss.hasPermi('project:reimbursementpayee:list')")
    @GetMapping("/list")
    public TableDataInfo list(ServiceReimbursementpayee serviceReimbursementpayee)
    {
    public TableDataInfo list(ServiceReimbursementpayee serviceReimbursementpayee) {
        startPage();
        List<ServiceReimbursementpayee> list = serviceReimbursementpayeeService.queryList(serviceReimbursementpayee);
        List<Reimbursementpayee> reimbursementpayees=new ArrayList<>();
@@ -79,8 +80,7 @@
    @PreAuthorize("@ss.hasPermi('project:reimbursementpayee:export')")
    @Log(title = "差旅报销付款信息", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(ServiceReimbursementpayee serviceReimbursementpayee)
    {
    public AjaxResult export(ServiceReimbursementpayee serviceReimbursementpayee) {
        List<ServiceReimbursementpayee> list = serviceReimbursementpayeeService.queryList(serviceReimbursementpayee);
        ExcelUtil<ServiceReimbursementpayee> util = new ExcelUtil<ServiceReimbursementpayee>(ServiceReimbursementpayee.class);
        return util.exportExcel(list, "差旅报销付款信息数据");
@@ -92,42 +92,47 @@
    @ApiOperation("获取差旅报销付款信息详细信息")
    @PreAuthorize("@ss.hasPermi('project:reimbursementpayee:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return AjaxResult.success(serviceReimbursementpayeeService.getById(id));
    }
    /**
     * æ–°å¢žå·®æ—…报销付款信息
     * æ–°å¢žæˆ–修改差旅报销付款信息
     */
    @ApiOperation("新增差旅报销付款信息")
    @ApiOperation("新增或修改差旅报销付款信息")
    @PostMapping("/addOrUpdateRBpayee")
    public AjaxResult addOrUpdateRBpayee(@RequestBody List<Reimbursementpayee> reimbursementPayees)
    {
        List<ServiceReimbursementpayee> addserviceReimbursementpayees=new ArrayList<>();
        List<ServiceReimbursementpayee> updateserviceReimbursementpayees=new ArrayList<>();
    public AjaxResult addOrUpdateRBpayee(@RequestBody List<Reimbursementpayee> reimbursementPayees) {
        List<ServiceReimbursementpayee> payees = new ArrayList<>();
        List<ServiceReimbursementpayeeShared> payeeSareds = new ArrayList<>();
        for (Reimbursementpayee reimbursementPayee:reimbursementPayees) {
            ServiceReimbursementpayee serviceReimbursementpayee=new ServiceReimbursementpayee();
            serviceReimbursementpayee.setRbid(reimbursementPayee.getRbid());
            serviceReimbursementpayee.setPersonname(reimbursementPayee.getCol_personname());
            serviceReimbursementpayee.setPersontype(reimbursementPayee.getCol_personType());
            serviceReimbursementpayee.setBankname(reimbursementPayee.getCol_bank());
            serviceReimbursementpayee.setBankcardno(reimbursementPayee.getCol_accounts());
            serviceReimbursementpayee.setPaiddate(reimbursementPayee.getCol_date());
            serviceReimbursementpayee.setRemark(reimbursementPayee.getCol_illustrate());
            serviceReimbursementpayee.setId(reimbursementPayee.getId());
            if(ObjectUtils.isEmpty(reimbursementPayee.getId())){
                addserviceReimbursementpayees.add(serviceReimbursementpayee);
            }else {
                updateserviceReimbursementpayees.add(serviceReimbursementpayee);
            }
            //封装支付数据
            ServiceReimbursementpayee payee = new ServiceReimbursementpayee();
            payee.setRbid(reimbursementPayee.getRbid());
            payee.setPersonname(reimbursementPayee.getCol_personname());
            payee.setPersontype(reimbursementPayee.getCol_personType());
            payee.setBankname(reimbursementPayee.getCol_bank());
            payee.setBankcardno(reimbursementPayee.getCol_accounts());
            payee.setPaiddate(reimbursementPayee.getCol_date());
            payee.setRemark(reimbursementPayee.getCol_illustrate());
            payee.setId(reimbursementPayee.getId());
            //封装支付分享数据
            ServiceReimbursementpayeeShared payeeShared = new ServiceReimbursementpayeeShared();
            payeeShared.setRbid(reimbursementPayee.getRbid());
            payeeShared.setPersonname(reimbursementPayee.getCol_personname());
            payeeShared.setPersontype(reimbursementPayee.getCol_personType());
            payeeShared.setBankname(reimbursementPayee.getCol_bank());
            payeeShared.setBankcardno(reimbursementPayee.getCol_accounts());
            payeeShared.setPaiddate(reimbursementPayee.getCol_date());
            payeeShared.setRemark(reimbursementPayee.getCol_illustrate());
            payeeShared.setId(reimbursementPayee.getId());
            payees.add(payee);
            payeeSareds.add(payeeShared);
        }
        boolean b = false;
        if(!CollectionUtils.isEmpty(addserviceReimbursementpayees)){
            b = serviceReimbursementpayeeService.saveBatch(addserviceReimbursementpayees);
        }else {
            b = serviceReimbursementpayeeService.updateBatchById(updateserviceReimbursementpayees);
        }
        b = serviceReimbursementpayeeService.saveOrUpdateBatch(payees);
        b = serviceReimbursementpayeeSharedService.saveOrUpdateBatch(payeeSareds);
        return toAjax(b);
    }
@@ -139,8 +144,7 @@
    @Log(title = "差旅报销付款信息", businessType = BusinessType.INSERT)
    @PostMapping
    @RepeatSubmit
    public AjaxResult add(@RequestBody ServiceReimbursementpayee serviceReimbursementpayee)
    {
    public AjaxResult add(@RequestBody ServiceReimbursementpayee serviceReimbursementpayee) {
        return toAjax(serviceReimbursementpayeeService.save(serviceReimbursementpayee));
    }
@@ -152,8 +156,7 @@
    @Log(title = "差旅报销付款信息", businessType = BusinessType.UPDATE)
    @PutMapping
    @RepeatSubmit    
    public AjaxResult edit(@RequestBody ServiceReimbursementpayee serviceReimbursementpayee)
    {
    public AjaxResult edit(@RequestBody ServiceReimbursementpayee serviceReimbursementpayee) {
        return toAjax(serviceReimbursementpayeeService.updateById(serviceReimbursementpayee));
    }
@@ -164,8 +167,7 @@
    @PreAuthorize("@ss.hasPermi('project:reimbursementpayee:remove')")
    @Log(title = "差旅报销付款信息", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(serviceReimbursementpayeeService.removeByIds(Arrays.asList(ids)));
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
@@ -103,7 +103,7 @@
    /**
     * èŽ·å–è·¯ç”±ä¿¡æ¯
     *
     * /addOrUpdateRBpayee/addOrUpdateRBpayee/addOrUpdateRBpayee
     * @return è·¯ç”±ä¿¡æ¯
     */
    @GetMapping("getRouters")
ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/DtoConversionUtils.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,64 @@
package com.ruoyi.common.utils.bean;
import org.springframework.beans.BeanUtils;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
 * DTO和entity相互转化工具类
 *
 * @author liusheng
 * @date 2023/5/06
 */
public class DtoConversionUtils {
    /**
     * entity转化为DTO
     *
     * @param source å®žä½“ç±»entity
     * @param target ç›®æ ‡ç±»DTO
     * @return è½¬åŒ–后的DTO
     */
    public static <T> T sourceToTarget(Object source, Class<T> target){
        if(source == null){
            return null;
        }
        T targetObject = null;
        try {
            targetObject = target.newInstance();
            BeanUtils.copyProperties(source, targetObject);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return targetObject;
    }
    /**
     * List<entity>转化为List<DTO>
     *
     * @param sourceList å®žä½“类集合Collection<entity>
     * @param target     ç›®æ ‡ç±»DTO
     * @return è½¬åŒ–后的Collection<DTO>
     */
    public static <T> List<T> sourceToTarget(Collection<?> sourceList, Class<T> target){
        if(sourceList == null){
            return null;
        }
        ArrayList<T> targetList = new ArrayList<>(sourceList.size());
        try {
            for(Object source : sourceList){
                T targetObject = target.newInstance();
                BeanUtils.copyProperties(source, targetObject);
                targetList.add(targetObject);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return targetList;
    }
}
ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursement.java
@@ -225,5 +225,15 @@
    @ApiModelProperty("捐献家属人数")
    private Integer donorrelatives;
    @ApiModelProperty("申请时间")
    private Date createTime;
//    @ApiModelProperty("开始时间")
//    private Date starttime;
//
//    @ApiModelProperty("结束时间")
//    private Date endtime;
}
ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursementEo.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,270 @@
package com.ruoyi.project.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
 * æŠ¥é”€ç”³è¯·å¯¹è±¡å…¥å‚对象
 *
 * @author åˆ˜çœ
 * @date 2023-04-28
 */
@Data
@ApiModel("报销申请入参EO")
public class ServiceReimbursementEo extends BaseEntity
{
    /** $column.columnComment */
    @ApiModelProperty("$column.columnComment")
    //数据库自增改成@TableId(type = IdType.AUTO)
    @TableId(type = IdType.AUTO)
    private Long id;
    /** æŠ¥é”€äººç¼–号 */
    @ApiModelProperty("报销人编号")
    @Excel(name = "报销人编号")
    private String userno;
    /** æŠ¥é”€äººå§“名 */
    @ApiModelProperty("报销人姓名")
    @Excel(name = "报销人姓名")
    private String username;
    /** è¯ä»¶ç±»åž‹ æ ¹æ®å­—å…¸sys_IDType */
    @ApiModelProperty("证件类型 æ ¹æ®å­—å…¸sys_IDType")
    @Excel(name = "证件类型 æ ¹æ®å­—å…¸sys_IDType")
    private String idcardtype;
    /** è¯ä»¶å·ç  */
    @ApiModelProperty("证件号码")
    @Excel(name = "证件号码")
    private String idcardno;
    /** è”系电话 */
    @ApiModelProperty("联系电话")
    @Excel(name = "联系电话")
    private String phone;
    /** å¼€æˆ·é“¶è¡Œ */
    @ApiModelProperty("开户银行")
    @Excel(name = "开户银行")
    private String depositbank;
    /** å¡å· */
    @ApiModelProperty("卡号")
    @Excel(name = "卡号")
    private String bankcardno;
    /** åˆ†è¡Œåç§° */
    @ApiModelProperty("分行名称")
    @Excel(name = "分行名称")
    private String branchbankname;
    /** é“¶è¡Œå¡ç…§ç‰‡è·¯å¾„ å¤šä¸ªç”¨;分开 */
    @ApiModelProperty("银行卡照片路径 å¤šä¸ªç”¨;分开")
    @Excel(name = "银行卡照片路径 å¤šä¸ªç”¨;分开")
    private String annexbankcard;
    /** é™„件路径 å¤šä¸ªç”¨;分开 */
    @ApiModelProperty("附件路径 å¤šä¸ªç”¨;分开")
    @Excel(name = "附件路径 å¤šä¸ªç”¨;分开")
    private String annexfiles;
    /** ç”³è¯·é‡‘额 */
    @ApiModelProperty("申请金额")
    @Excel(name = "申请金额")
    private BigDecimal amountrequested;
    /** äº¤é€šè´¹ */
    @ApiModelProperty("交通费")
    @Excel(name = "交通费")
    private BigDecimal trafficexpense;
    /** ä½å®¿è´¹ */
    @ApiModelProperty("住宿费")
    @Excel(name = "住宿费")
    private BigDecimal hotelexpense;
    /** ä¼™é£Ÿè´¹ */
    @ApiModelProperty("伙食费")
    @Excel(name = "伙食费")
    private BigDecimal foodexpenses;
    /** ä¼™é£Ÿè´¹è¡¥åŠ© */
    @ApiModelProperty("伙食费补助")
    @Excel(name = "伙食费补助")
    private BigDecimal foodallowance;
    /** æ‚è´¹ */
    @ApiModelProperty("杂费")
    @Excel(name = "杂费")
    private BigDecimal otherexpense;
    /** å…¶ä»–费用金额 */
    @ApiModelProperty("其他费用金额")
    @Excel(name = "其他费用金额")
    private BigDecimal otherfeeamount;
    /** é¢„支费用 */
    @ApiModelProperty("预支费用")
    @Excel(name = "预支费用")
    private Double prepaidamount;
    /** å‘票张数 */
    @ApiModelProperty("发票张数")
    @Excel(name = "发票张数")
    private Long invoicecount;
    /** é™„ä»¶æ•° */
    @ApiModelProperty("附件数")
    @Excel(name = "附件数")
    private Long attachcount;
    /** éƒ¨é—¨ä¸»ç®¡å·¥å· */
    @ApiModelProperty("部门主管工号")
    @Excel(name = "部门主管工号")
    private String managerno;
    /** éƒ¨é—¨ä¸»ç®¡åå­— */
    @ApiModelProperty("部门主管名字")
    @Excel(name = "部门主管名字")
    private String managername;
    /** éƒ¨é—¨ç¼–号 */
    @ApiModelProperty("部门编号")
    @Excel(name = "部门编号")
    private String deptmentno;
    /** éƒ¨é—¨åç§° */
    @ApiModelProperty("部门名称")
    @Excel(name = "部门名称")
    private String deptmentname;
    /** ä¸­å¿ƒç­¾å­— */
    @ApiModelProperty("中心签字")
    @Excel(name = "中心签字")
    private String opochecker;
    /** è´¢åŠ¡å‰¯é™¢é•¿ç­¾å­— */
    @ApiModelProperty("财务副院长签字")
    @Excel(name = "财务副院长签字")
    private String finvicepresident;
    /** ä¸šåŠ¡å‰¯é™¢é•¿ç­¾å­— */
    @ApiModelProperty("业务副院长签字")
    @Excel(name = "业务副院长签字")
    private String busvicepresident;
    /** åŠžå…¬å®¤ä¸»ä»»ç­¾å­— */
    @ApiModelProperty("办公室主任签字")
    @Excel(name = "办公室主任签字")
    private String officedirector;
    /** è´¢åŠ¡å®¤ä¸»ä»»ç­¾å­— */
    @ApiModelProperty("财务室主任签字")
    @Excel(name = "财务室主任签字")
    private String financedirector;
    /** è´¢åŠ¡å®¡æ ¸ */
    @ApiModelProperty("财务审核")
    @Excel(name = "财务审核")
    private String financechecher;
    /** å…³è”service_donatebaseinfo表的ID */
    @ApiModelProperty("关联service_donatebaseinfo表的ID")
    @Excel(name = "关联service_donatebaseinfo表的ID")
    private Long infoid;
    /** æçŒ®è€…编号 */
    @ApiModelProperty("捐献者编号")
    @Excel(name = "捐献者编号")
    private String donorno;
    /** è®°å½•状态 */
    @ApiModelProperty("记录状态")
    @Excel(name = "记录状态")
    private Integer recordstatus;
    /** ä¸Šä¼ æ ‡å¿— */
    @ApiModelProperty("上传标志")
    @Excel(name = "上传标志")
    private String uploadflag;
    /** ä¸Šä¼ æ—¶é—´ */
    @ApiModelProperty("上传时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "上传时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date uploadtime;
    @ApiModelProperty("出差人")
    @Excel(name = "出差人")
    private String travelers;
    @ApiModelProperty("出差事由")
    private String reason;
    @ApiModelProperty("捐献者姓名")
    private String donorname;
    @ApiModelProperty("总金额")
    private Double totalamount;
    @ApiModelProperty("总金额的大写")
    private String bigstrmoney;
    /** é™„件地址,add by yangjb 20221124 */
    @ApiModelProperty("附件地址")
    private String fileurl;
    private String remark;
    /** å½“前审核级别 å¤„于哪个阶段 0:申请;1:一级审核;2:二级审核;3:三级审核等 */
    @ApiModelProperty("当前审核级别")
    private Long flowlevel;
    /** è´¹ç”¨å½’属:0:其他人员;1:专职人员;2:协调员;3:专家;4:捐献者家属 */
    @ApiModelProperty("费用归属")
    private String persontype;
    /** è´¹ç”¨å½’属描述 */
    @ApiModelProperty("费用归属描述")
    private String costtypename;
    @ApiModelProperty("捐献家属银行")
    private String donorbank;
    @ApiModelProperty("捐献家属银行卡号")
    private String donorbankcard;
    @ApiModelProperty("捐献家属费用说明")
    private String donorremark;
    @ApiModelProperty("捐献家属费用金额")
    private Double donoramount;
    @ApiModelProperty("捐献家属人数")
    private Integer donorrelatives;
    @ApiModelProperty("申请时间")
    private Date createTime;
    @ApiModelProperty("申请时间")
    private Date starttime;
    @ApiModelProperty("申请时间")
    private Date endtime;
}
ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursementdetail.java
@@ -64,7 +64,7 @@
    /** äº¤é€šè´¹ */
    @ApiModelProperty("交通费")
    @Excel(name = "交通费")
    private Double trafficexpense;
    private BigDecimal trafficexpense;
    /** äº¤é€šå·¥å…· */
    @ApiModelProperty("交通工具")
@@ -74,12 +74,12 @@
    /** å¸‚内交通费 */
    @ApiModelProperty("市内交通费")
    @Excel(name = "市内交通费")
    private Double cityfee;
    private BigDecimal cityfee;
    /** ä½å®¿è´¹ */
    @ApiModelProperty("住宿费")
    @Excel(name = "住宿费")
    private Double hotelexpense;
    private BigDecimal hotelexpense;
    /** å‘票张数 */
    @ApiModelProperty("发票张数")
@@ -94,17 +94,17 @@
    /** æ‚è´¹ */
    @ApiModelProperty("杂费")
    @Excel(name = "杂费")
    private Double otherexpense;
    private BigDecimal otherexpense;
    /** ä¼™é£Ÿè´¹ */
    @ApiModelProperty("伙食费")
    @Excel(name = "伙食费")
    private Double foodexpenses;
    private BigDecimal foodexpenses;
    /** ä¼™é£Ÿè´¹è¡¥åŠ© */
    @ApiModelProperty("伙食费补助")
    @Excel(name = "伙食费补助")
    private Double foodallowance;
    private BigDecimal foodallowance;
    /** é™„件表 */
    @ApiModelProperty("附件表")
@@ -154,7 +154,7 @@
    @Excel(name = "所属街道(镇)名称")
    private String traveltownname;
    private Double otherfeeamount;
    private BigDecimal otherfeeamount;
    private String otherfeedesc;
ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursementdetailShared.java
@@ -177,15 +177,15 @@
    @Excel(name = "其他费用说明")
    private String otherfeedesc;
    /** é‡‘额-接口 */
    @ApiModelProperty("金额-接口")
    @Excel(name = "金额-接口")
    private String jine;
    /** ç†ç”±-接口 */
    @ApiModelProperty("理由-接口")
    @Excel(name = "理由-接口")
    private String liyou;
//    /** é‡‘额-接口 */
//    @ApiModelProperty("金额-接口")
//    @Excel(name = "金额-接口")
//    private String jine;
//
//    /** ç†ç”±-接口 */
//    @ApiModelProperty("理由-接口")
//    @Excel(name = "理由-接口")
//    private String liyou;
}
ruoyi-project/src/main/java/com/ruoyi/project/mapper/ServiceReimbursementMapper.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import com.ruoyi.project.domain.ServiceReimbursement;
import com.ruoyi.project.domain.ServiceReimbursementEo;
import com.ruoyi.project.domain.dto.ServiceReimbursementDto;
import com.ruoyi.project.domain.vo.SpFinancialExpensesReimbursementOut;
import org.apache.ibatis.annotations.Param;
@@ -33,4 +34,12 @@
    List<ServiceReimbursement> getInfoByInfoId(Long infoid);
    List<ServiceReimbursement> getInfoByInfoIdRelatives(Long infoid);
    /**
     *
     * @param serviceReimbursementEo
     * @return
     */
    List<ServiceReimbursementEo> getRDInfoByItem(ServiceReimbursementEo serviceReimbursementEo);
}
ruoyi-project/src/main/java/com/ruoyi/project/service/IServiceReimbursementService.java
@@ -3,6 +3,7 @@
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.project.domain.ServiceReimbursement;
import com.ruoyi.project.domain.ServiceReimbursementEo;
import com.ruoyi.project.domain.ServiceReimbursementdetail;
import com.ruoyi.project.domain.dto.ServiceReimbursementDto;
import com.ruoyi.project.domain.vo.SpFinancialExpensesReimbursementOut;
@@ -35,4 +36,6 @@
    List<ServiceReimbursement> getInfoByInfoId(Long infoid);
    List<ServiceReimbursement> getInfoByInfoIdRelatives(Long infoid);
    List<ServiceReimbursementEo> getRDInfoByItem(ServiceReimbursementEo serviceReimbursementEo);
}
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementServiceImpl.java
@@ -2,6 +2,7 @@
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.project.domain.ServiceReimbursementEo;
import com.ruoyi.project.domain.ServiceReimbursementdetail;
import com.ruoyi.project.domain.ServiceRelativesconfirmation;
import com.ruoyi.project.domain.dto.ServiceReimbursementDto;
@@ -106,4 +107,10 @@
        return serviceReimbursementMapper.getInfoByInfoIdRelatives(infoid);
    }
    @Override
   public List<ServiceReimbursementEo> getRDInfoByItem(ServiceReimbursementEo serviceReimbursementEo){
   return serviceReimbursementMapper.getRDInfoByItem(serviceReimbursementEo);
    }
}
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementdetailServiceImpl.java
@@ -1,9 +1,11 @@
package com.ruoyi.project.service.impl;
import java.math.BigDecimal;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.project.domain.ServiceReimbursement;
import com.ruoyi.project.mapper.ServiceReimbursementMapper;
import com.ruoyi.project.mapper.ServiceReimbursementdetailSharedMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -28,6 +30,9 @@
    @Autowired
    ServiceReimbursementdetailMapper serviceReimbursementdetailMapper;
    @Autowired
    ServiceReimbursementdetailSharedMapper detailSharedMapper;
    @Autowired
    ServiceReimbursementMapper serviceReimbursementMapper;
@@ -77,10 +82,15 @@
        Long rbid = serviceReimbursementdetail.getRbid();
        ServiceReimbursement serviceReimbursement = serviceReimbursementMapper.selectById(rbid);
        Double amount = serviceReimbursement.getAmountrequested();
        amount = amount - serviceReimbursementdetail.getTrafficexpense() - serviceReimbursementdetail.getCityfee() - serviceReimbursementdetail.getHotelexpense() - serviceReimbursementdetail.getFoodexpenses() - serviceReimbursementdetail.getFoodallowance() - serviceReimbursementdetail.getOtherexpense() - serviceReimbursementdetail.getOtherfeeamount();
        serviceReimbursement.setAmountrequested(amount);
        BigDecimal subtract = BigDecimal.valueOf(amount).subtract(serviceReimbursementdetail.getTrafficexpense()).subtract(serviceReimbursementdetail.getCityfee()).subtract(serviceReimbursementdetail.getHotelexpense())
                .subtract(serviceReimbursementdetail.getFoodexpenses()).subtract(serviceReimbursementdetail.getFoodallowance())
                .subtract(serviceReimbursementdetail.getOtherexpense()).subtract(serviceReimbursementdetail.getOtherfeeamount());
        serviceReimbursement.setAmountrequested(subtract.doubleValue());
        int updateAmount = serviceReimbursementMapper.updateById(serviceReimbursement);
        detailSharedMapper.deleteById(id);
        return serviceReimbursementdetailMapper.deleteById(id);
    }
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementdetailSharedServiceImpl.java
@@ -124,12 +124,12 @@
        if (StringUtils.isNotBlank(serviceReimbursementdetailShared.getOtherfeedesc())){
            wrappers.eq(ServiceReimbursementdetailShared::getOtherfeedesc ,serviceReimbursementdetailShared.getOtherfeedesc());
        }
        if (StringUtils.isNotBlank(serviceReimbursementdetailShared.getJine())){
            wrappers.eq(ServiceReimbursementdetailShared::getJine ,serviceReimbursementdetailShared.getJine());
        }
        if (StringUtils.isNotBlank(serviceReimbursementdetailShared.getLiyou())){
            wrappers.eq(ServiceReimbursementdetailShared::getLiyou ,serviceReimbursementdetailShared.getLiyou());
        }
//        if (StringUtils.isNotBlank(serviceReimbursementdetailShared.getJine())){
//            wrappers.eq(ServiceReimbursementdetailShared::getJine ,serviceReimbursementdetailShared.getJine());
//        }
//        if (StringUtils.isNotBlank(serviceReimbursementdetailShared.getLiyou())){
//            wrappers.eq(ServiceReimbursementdetailShared::getLiyou ,serviceReimbursementdetailShared.getLiyou());
//        }
        return this.list(wrappers);
    }
ruoyi-project/src/main/resources/mapper/project/ServiceReimbursementMapper.xml
@@ -58,16 +58,67 @@
    </resultMap>
    <sql id="selectServiceReimbursementVo">
        select ID, del_flag, create_by, create_time, update_by, update_time, UserNo, UserName, IDCardType, IDCardNo, Phone, DepositBank, BankCardNo, BranchBankName, AnnexBankCard, AnnexFiles, AmountRequested, PrepaidAmount, InvoiceCount, AttachCount, ManagerNo, ManagerName, DeptmentNo, DeptmentName, OPOchecker, FinVicePresident, BusVicePresident, OfficeDirector, FinanceDirector, FinanceChecher, InfoID, DonorNo, remark, RecordStatus, uploadflag, uploadtime, Travelers, DonorName, Reason, FlowLevel, costtype, costtypename,fileurl,donorbank,donorbankcard,donorremark, donoramount,donorrelatives from service_reimbursement
        select ID,
               del_flag,
               create_by,
               create_time,
               update_by,
               update_time,
               UserNo,
               UserName,
               IDCardType,
               IDCardNo,
               Phone,
               DepositBank,
               BankCardNo,
               BranchBankName,
               AnnexBankCard,
               AnnexFiles,
               AmountRequested,
               PrepaidAmount,
               InvoiceCount,
               AttachCount,
               ManagerNo,
               ManagerName,
               DeptmentNo,
               DeptmentName,
               OPOchecker,
               FinVicePresident,
               BusVicePresident,
               OfficeDirector,
               FinanceDirector,
               FinanceChecher,
               InfoID,
               DonorNo,
               remark,
               RecordStatus,
               uploadflag,
               uploadtime,
               Travelers,
               DonorName,
               Reason,
               FlowLevel,
               costtype,
               costtypename,
               fileurl,
               donorbank,
               donorbankcard,
               donorremark,
               donoramount,
               donorrelatives
        from service_reimbursement
    </sql>
    <select id="selectServiceReimbursementList" parameterType="ServiceReimbursement" resultMap="ServiceReimbursementResult">
    <select id="selectServiceReimbursementList" parameterType="ServiceReimbursement"
            resultMap="ServiceReimbursementResult">
        <include refid="selectServiceReimbursementVo"/>
        <where>
            <if test="createBy != null  and createBy != ''"> and create_by = #{createBy}</if>
            <if test="createTime != null "> and create_time = #{createTime}</if>
            <if test="username != null  and username != ''"> and UserName like concat('%', #{username}, '%')</if>
            <if test="deptmentname != null  and deptmentname != ''"> and DeptmentName like concat('%', #{deptmentname}, '%')</if>
            <if test="deptmentname != null  and deptmentname != ''">and DeptmentName like concat('%', #{deptmentname},
                '%')
            </if>
            <if test="donorno != null  and donorno != ''"> and DonorNo = #{donorno}</if>
            <if test="recordstatus != null  and recordstatus != ''"> and RecordStatus = #{recordstatus}</if>
            <if test="uploadflag != null  and uploadflag != ''"> and uploadflag = #{uploadflag}</if>
@@ -75,20 +126,24 @@
        </where>
    </select>
    <select id="getMaxId" resultType="java.lang.Long">
        select max(ID) from service_reimbursement
        select max(ID)
        from service_reimbursement
    </select>
    <select id="selectSearchList" resultMap="ServiceReimbursementResult">
        <include refid="selectServiceReimbursementVo"/>
        <where>
            <if test="createTime != null and createTime != ''" > and create_time >= #{searchstarttime} and create_time &lt;= #{searchendtime} </if>
            <if test="createTime != null and createTime != ''">and create_time >= #{searchstarttime} and create_time
                &lt;= #{searchendtime}
            </if>
            <if test="travelers != null  and travelers != ''"> and Travelers = #{travelers}</if>
        </where>
    </select>
    <select id="getListBypower" statementType="CALLABLE" resultType="com.ruoyi.project.domain.vo.SpFinancialExpensesReimbursementOut">
    <select id="getListBypower" statementType="CALLABLE"
            resultType="com.ruoyi.project.domain.vo.SpFinancialExpensesReimbursementOut">
        call SP_FINANCIAL_EXPENSES(#{PAUSERNO,mode=IN,jdbcType=VARCHAR},#{PAFUNDTYPE,mode=IN,jdbcType=INTEGER},#{PAAPPLICANT,mode=IN,jdbcType=VARCHAR},#{PAAPPLICATIONBEGTIME,mode=IN,jdbcType=VARCHAR},#{PAAPPLICATIONENDTIME,mode=IN,jdbcType=VARCHAR},#{PADEPARTMENT,mode=IN,jdbcType=VARCHAR},#{CHECKFLAG,mode=IN,jdbcType=INTEGER},#{APPLYTYPE,mode=IN,jdbcType=INTEGER})
    </select>
    <select id="getInfoByInfoId" resultType="com.ruoyi.project.domain.ServiceReimbursement">
@@ -100,4 +155,34 @@
        where infoid = #{infoid} and del_flag = '0' and costtype = "4"
    </select>
    <select id="getRDInfoByItem" resultType="com.ruoyi.project.domain.ServiceReimbursementEo">
        SELECT a.id as id,a.UserNo as userno,a.FlowLevel as recordstatus,b.persontype as persontype,a.create_time as
        createTime,
        a.UserName as username,b.personname as travelers,a.AmountRequested as amountrequested,a.Reason as reason,a.Phone
        as phone,a.DepositBank as depositbank,a.BankCardNo as bankcardno,a.DonorName as donorname,b.trafficexpense as
        trafficexpense,b.hotelexpense as hotelexpense,b.FoodExpenses as foodexpenses, b.foodallowance as foodallowance,
        b.otherexpense as otherexpense,b.otherfeeamount as otherfeeamount FROM service_reimbursement a LEFT JOIN
        service_reimbursementdetail b on a.id=b.RBID where a.del_flag != 1 and b.del_flag!=1
        <if test="id != null">
            and a.id = #{id}
        </if>
        <if test='travelers != null and travelers != ""'>
            and b.personname=#{travelers}
        </if>
        <if test='username != null and username != ""'>
            and a.UserName=#{username}
        </if>
        <if test='recordstatus != null and recordstatus != ""'>
            and a.FlowLevel=#{recordstatus}
        </if>
        <if test='travelers != null and travelers != ""'>
            and b.personname=#{travelers}
        </if>
        <if test='starttime != null and endtime != ""'>
            and a.create_time BETWEEN #{starttime} AND #{endtime}
        </if>
        ORDER BY a.id desc
    </select>
</mapper>