liusheng
2023-08-09 2c16ba7f4cdfedf4ec05395e20caf9c87f2b5101
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementServiceImpl.java
@@ -19,6 +19,7 @@
import com.ruoyi.project.service.IServiceReimbursementdetailSharedService;
import com.ruoyi.project.service.IServiceReimbursementpayeeSharedService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -117,10 +118,11 @@
    @Override
    public List<ServiceReimbursementdetailVO> getRBDetailList(Long id) {
        log.info("getRBDetailList的入参:{}", id);
        List<ServiceReimbursementdetailVO> serviceReimbursementdetailVOS = new ArrayList<>();
        List<ServiceReimbursementdetail> rbDetailList = serviceReimbursementdetailMapper.getRBDetailList(id);
        log.info("getRBDetailList的入参:{}", CollectionUtils.isEmpty(rbDetailList) ? null : rbDetailList.size());
        for (int j = 0; j < rbDetailList.size(); j++) {
            ServiceReimbursementdetail serviceReimbursementdetail = rbDetailList.get(j);
            String annexfiles = serviceReimbursementdetail.getAnnexfiles();
            ServiceReimbursementdetailVO serviceReimbursementdetailVO = DtoConversionUtils.sourceToTarget(serviceReimbursementdetail, ServiceReimbursementdetailVO.class);
@@ -147,10 +149,10 @@
        columnMap.put("rbid", id);
        //获取详情数据
        List<ServiceReimbursementdetail> details = serviceReimbursementdetailMapper.selectByMap(columnMap);
        log.info("serviceReimbursementdetailMapper.selectByMap方法的返参参 :{}", details.size());
        log.info("serviceReimbursementdetailMapper.selectByMap方法的返参参 :{}", CollectionUtils.isEmpty(details) ? null : details.size());
        //获取支付数据
        List<ServiceReimbursementpayee> serviceReimbursementpayees = reimbursementpayeeMapper.selectByMap(columnMap);
        log.info("reimbursementpayeeMapper.selectByMap方法的返参参 :{}", serviceReimbursementpayees.size());
        log.info("reimbursementpayeeMapper.selectByMap方法的返参参 :{}", CollectionUtils.isEmpty(serviceReimbursementpayees) ? null : serviceReimbursementpayees.size());
        //数据组装
        ServiceReimbursementShared serviceReimbursementShared = DtoConversionUtils.sourceToTarget(serviceReimbursement, ServiceReimbursementShared.class);
        serviceReimbursementShared.setReimid(id);
@@ -231,7 +233,7 @@
        JSONObject json1 = JSONObject.parseObject(strRes);
        strRes = json1.get("id").toString();
        log.info("strRes的值 : {}", strRes);
        String filePath = RuoYiConfig.getUploadPath();
        String strFUrl = "http://129.88.242.39:8899/seeyon/rest/attachment?token=" + strRes;
@@ -239,9 +241,13 @@
        List<RbDetailFile> parseArray = JSON.parseArray(remShare.getAnnexfiles(), RbDetailFile.class);
        for (int i = 0; i < parseArray.size(); i++) {
            RbDetailFile rbDetailFile = parseArray.get(i);
            log.info("filePath的修改:{}", filePath);
            String strFile = rbDetailFile.getUrl().replaceAll("/profile/upload", filePath);
            File filetest = new File(strFile);
            String url = rbDetailFile.getUrl();
            //file用的是绝对位置
            String substring = url.substring(url.indexOf("/profile/upload") + "/profile/upload".length());
            String strFile = rbDetailFile.getUrl().replace(filePath, "/profile/upload");
            File filetest = new File(filePath + substring);
            try {
                log.info("请求第三方的入参strFile : {}, strFUrl : {}", strFile, filePath);
                String struploadResult = HttpClientKit.sendPostWithFile(filetest, strFUrl);