liusheng
2024-04-24 fadd75018c5cce0586e761b875ac6bb268033f73
代码提交
已修改7个文件
59 ■■■■■ 文件已修改
ruoyi-project/src/main/java/com/ruoyi/project/mapper/ServiceFundSharedMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/service/IServiceFundSharedService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFundServiceImpl.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFundSharedServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementServiceImpl.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/resources/mapper/project/ServiceFundSharedMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/mapper/ServiceFundSharedMapper.java
@@ -25,5 +25,5 @@
    List<ServiceFundShared> getFundShareInfoById(Long fundid);
    Boolean delfundsharedInfoById(Long fundId);
    Boolean delfundsharedInfoById(Long fundId,Long serfunid);
}
ruoyi-project/src/main/java/com/ruoyi/project/service/IServiceFundSharedService.java
@@ -26,5 +26,5 @@
    List<ServiceFundShared> getFundShareInfoById(Long fundid);
    Boolean delfundsharedInfoById(Long fundId);
    Boolean delfundsharedInfoById(Long fundId,Long serfunid);
}
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFundServiceImpl.java
@@ -186,7 +186,16 @@
            serviceFunddetailShareds.get(i).setFundid(serviceFundShared.getId());
            serviceFunddetailShareds.get(i).setId(null);
            //数据发送给财务
            try {
            uploadOAFileAndUpdateDb(serviceFunddetailShareds.get(i));
            } catch (Exception e) {
                log.error("Exception中入参的ID为:{}", id);
                if (id != null) {
                    Boolean aBoolean = sharedService.delfundsharedInfoById(null, id);
                    log.error("fund2分享表里的数据是否删除成功:{}", aBoolean);
                }
                return false;
            }
        }
        boolean result = false;
        for (ServiceFunddetailShared serviceFunddetailShared : serviceFunddetailShareds) {
@@ -941,7 +950,7 @@
    }
    int uploadOAFileAndUpdateDb(ServiceFunddetailShared remShare) {
    int uploadOAFileAndUpdateDb(ServiceFunddetailShared remShare) throws Exception {
        //上传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";
@@ -981,7 +990,7 @@
    }
    private Integer uploadFile(String filePath, String strFUrl, List<RbDetailFile> parseArray2, List<RbDetailFile> parseArray, ServiceFunddetailShared remShare, String flag) {
    private Integer uploadFile(String filePath, String strFUrl, List<RbDetailFile> parseArray2, List<RbDetailFile> parseArray, ServiceFunddetailShared remShare, String flag) throws Exception {
        if (!CollectionUtils.isEmpty(parseArray)) {
            for (int i = 0; i < parseArray.size(); i++) {
                RbDetailFile rbDetailFile = parseArray.get(i);
@@ -993,7 +1002,6 @@
                System.out.println("fund服务的filePath + substring: " + filePath + substring);
                File filetest = new File(filePath + substring);
                try {
                    String struploadResult = HttpClientKit.sendPostWithFile(filetest, strFUrl);
                    log.info("第三方传回的数据: {}", struploadResult);
                    if (StringUtils.isEmpty(struploadResult)) {
@@ -1008,9 +1016,7 @@
                        JSONObject jsonRet = jsonArr.getJSONObject(j);
                        rbDetailFile.setFileid(jsonRet.get("fileUrl").toString());
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
                parseArray2.add(rbDetailFile);
            }
            if (flag.equals("1")) {
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFundSharedServiceImpl.java
@@ -191,8 +191,8 @@
    }
    @Override
    public Boolean delfundsharedInfoById(Long fundId) {
        return serviceFundSharedMapper.delfundsharedInfoById(fundId);
    public Boolean delfundsharedInfoById(Long fundId,Long serfunid) {
        return serviceFundSharedMapper.delfundsharedInfoById(fundId,serfunid);
    }
}
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementServiceImpl.java
@@ -196,7 +196,17 @@
            serviceReimbursementdetailShareds.get(i).setId(null);
            //上传OA文件
            log.info("上传OA文件方法的入参:{}", serviceReimbursementdetailShareds.get(i));
            try {
            uploadOAFileAndUpdateDb(serviceReimbursementdetailShareds.get(i));
            } catch (Exception e) {
                log.error("Exception中reimShare的入参id为:{}", serviceReimbursementShared.getId());
                if (serviceReimbursementShared.getId() != null) {
                    Boolean aBoolean = sharedService.delResharedInfoById(serviceReimbursementShared.getId());
                    log.error("文件上传失败,将分享表数据回滚:{}", aBoolean);
                }
                return false;
            }
        }
//        detailSharedService.saveBatch(serviceReimbursementdetailShareds);
@@ -251,7 +261,7 @@
    }
    public int uploadOAFileAndUpdateDb(ServiceReimbursementdetailShared remShare) {
    public int uploadOAFileAndUpdateDb(ServiceReimbursementdetailShared remShare) throws Exception {
        log.info("uploadOAFileAndUpdate方法的入参:{}", remShare);
        System.out.println("uploadOAFileAndUpdate方法的入参:" + remShare);
        //上传OA文件
@@ -285,13 +295,12 @@
        List<RbDetailFile> invoicefilesArray = JSON.parseArray(remShare.getInvoicefiles(), RbDetailFile.class);
        //普通附件
        uploadFile(filePath, strFUrl, parseArray2, parseArray, remShare, "1");
        //发票附件
        uploadFile(filePath, strFUrl, invoicefilesList, invoicefilesArray, remShare, "2");
        return 0;
    }
    private Integer uploadFile(String filePath, String strFUrl, List<RbDetailFile> parseArray2, List<RbDetailFile> parseArray, ServiceReimbursementdetailShared remShare, String flag) {
    private Integer uploadFile(String filePath, String strFUrl, List<RbDetailFile> parseArray2, List<RbDetailFile> parseArray, ServiceReimbursementdetailShared remShare, String flag) throws Exception {
        if (!CollectionUtils.isEmpty(parseArray)) {
            for (int i = 0; i < parseArray.size(); i++) {
                RbDetailFile rbDetailFile = parseArray.get(i);
@@ -303,7 +312,6 @@
                String strFile = rbDetailFile.getUrl().replace(filePath, "/profile/upload");
                System.out.println("reimbursement服务的filePath + substring是乱码吗: " + filePath + substring);
                File filetest = new File(filePath + substring);
                try {
                    log.info("请求第三方的入参strFile : {}, strFUrl : {}", strFile, filePath);
                    String struploadResult = HttpClientKit.sendPostWithFile(filetest, strFUrl);
                    log.info("第三方传回的数据: {}", struploadResult);
@@ -319,10 +327,6 @@
                    for (int j = 0; j < jsonArr.size(); j++) {
                        JSONObject jsonRet = jsonArr.getJSONObject(j);
                        rbDetailFile.setFileid(jsonRet.get("fileUrl").toString());
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                    log.error("HttpClientKit.sendPostWithFile 报错了 : " + e.getMessage());
                }
                parseArray2.add(rbDetailFile);
            }
ruoyi-project/src/main/resources/mapper/project/ServiceFundSharedMapper.xml
@@ -191,7 +191,11 @@
    <update id="delfundsharedInfoById">
        UPDATE service_fund_shared
        SET del_flag = 1
        WHERE ID = #{fundId}
          and del_flag != 1
        WHERE
        del_flag != 1
        <if test="fundId != null"> and ID = #{fundId}</if>
        <if test="serfunid != null"> and serfunid = #{serfunid}</if>
    </update>
</mapper>
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
@@ -81,8 +81,9 @@
                }
                String phone = serviceFundShared.getPhone();
                //将分享里的该数据删除
                serviceFundSharedService.delfundsharedInfoById(serviceFundShared.getId());
                log.info("checkReportInfo中入参ID为:{}", serviceFundShared.getId());
                Boolean aBoolean = serviceFundSharedService.delfundsharedInfoById(serviceFundShared.getId(), null);
                log.info("fund分享表里的数据是否删除成功:{}", aBoolean);
                ServiceFund serviceFund = new ServiceFund();
                serviceFund.setId(serviceFundShared.getSerfunid());
                List<ServiceFund> serviceFunds = serviceFundService.queryInfoById(serviceFund);