liusheng
2023-08-07 4b6e55140537e4932f4ea46f6c62c72af1ddb40e
加上日志
已修改4个文件
44 ■■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementServiceImpl.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
@@ -1,6 +1,5 @@
package com.ruoyi.web.controller.common;
import org.apache.coyote.AbstractProtocol;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
@@ -10,27 +9,18 @@
import com.ruoyi.framework.config.ServerConfig;
import org.apache.catalina.connector.Connector;
import org.apache.catalina.startup.Tomcat;
import org.apache.coyote.AbstractProtocol;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import javax.management.MBeanServer;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import javax.management.Query;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.util.Set;
/**
 * 通用请求处理
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java
@@ -27,6 +27,7 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Options;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import java.io.*;
@@ -582,15 +583,19 @@
    /**
     * 修改费用申请主
     * 修改费用申请
     */
    @ApiOperation("修改费用申请主")
    @ApiOperation("修改费用申请")
    //@PreAuthorize("@ss.hasPermi('project:fund:edit')")
    @Log(title = "费用申请主", businessType = BusinessType.UPDATE)
    @PutMapping
    @RepeatSubmit
    public AjaxResult edit(@RequestBody ServiceFund serviceFund) {
        List<ServiceFund> infoByInfoIdList = serviceFundService.queryInfoById(serviceFund);
        if (CollectionUtils.isEmpty(infoByInfoIdList)) {
            log.info("修改费用申请,通过入参查询 serviceFundService.queryInfoById数据为空,入参:{}", serviceFund);
            return toAjax(false);
        }
        for (ServiceFund sf : infoByInfoIdList) {
            //如果等于100,说明已经走到医院财务那边了;财务那边取数据是从分享表取,所以,这里直接往分享表里添加数据就行了
            if (sf.getBackflowlevel() == 100 || sf.getBackflowlevel() == 199) {
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java
@@ -27,6 +27,7 @@
import freemarker.template.TemplateException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.ibatis.annotations.Options;
import org.springframework.beans.factory.annotation.Autowired;
@@ -46,6 +47,7 @@
 * @author ruoyi
 * @date 2022-01-24
 */
@Slf4j
@Api("报销申请")
@RestController
@RequestMapping("/project/reimbursement")
@@ -510,8 +512,9 @@
    @Log(title = "审核费用", businessType = BusinessType.OTHER)
    @PostMapping("/checkfund")
    public AjaxResult checkFund(@RequestBody CheckFundVO checkFundVO) {
        log.info("审核费用的入参 : {}", checkFundVO);
        ServiceReimbursement serviceReimbursement = serviceReimbursementService.getById(checkFundVO.getFundid());
        log.info("审核费用的serviceReimbursementService.getById返参 : {}", serviceReimbursement);
        if (serviceReimbursement != null) {
            Integer totalLevel = 0;
            LoginUser loginUser = getLoginUser();
@@ -520,7 +523,7 @@
            serviceFundflowrule.setApplytype("0");
            serviceFundflowrule.setCheckuserno(loginUser.getUsername());
            List<ServiceFundflowrule> serviceFundflowrules = serviceFundflowruleService.queryList(serviceFundflowrule);
            log.info("审核费用的serviceFundflowruleService.queryList返参 : {}", serviceFundflowrules.size());
            if (serviceFundflowrules == null || serviceFundflowrules.stream().count() == 0) {
                return AjaxResult.error(HttpStatus.ERROR, "当前人员无此记录审核权限");
            }
@@ -585,7 +588,7 @@
            serviceFundflowService.save(serviceFundflow);
            List<Integer> postids = postService.selectPostListByUserId(loginUser.getUserId());
            log.info("postService.selectPostListByUserId : {}", postids.size());
            if (!postids.contains(2)) {
                if (CheckFlag == 2 && OriginalFlowLevel == 1) {
                    ServiceFundflow serviceFundflowAuto = new ServiceFundflow();
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementServiceImpl.java
@@ -141,13 +141,16 @@
    @Override
    @Transactional
    public Boolean addSharedData(Long id) {
        log.info("addSharedData方法的入参id :{}", id);
        ServiceReimbursement serviceReimbursement = serviceReimbursementMapper.selectById(id);
        Map<String, Object> columnMap = new HashMap<>();
        columnMap.put("rbid", id);
        //获取详情数据
        List<ServiceReimbursementdetail> details = serviceReimbursementdetailMapper.selectByMap(columnMap);
        log.info("serviceReimbursementdetailMapper.selectByMap方法的返参参 :{}", details.size());
        //获取支付数据
        List<ServiceReimbursementpayee> serviceReimbursementpayees = reimbursementpayeeMapper.selectByMap(columnMap);
        log.info("reimbursementpayeeMapper.selectByMap方法的返参参 :{}", serviceReimbursementpayees.size());
        //数据组装
        ServiceReimbursementShared serviceReimbursementShared = DtoConversionUtils.sourceToTarget(serviceReimbursement, ServiceReimbursementShared.class);
        serviceReimbursementShared.setReimid(id);
@@ -164,6 +167,7 @@
            serviceReimbursementdetailShareds.get(i).setRbid(serviceReimbursementShared.getId());
            serviceReimbursementdetailShareds.get(i).setId(null);
            //上传OA文件
            log.info("上传OA文件方法的入参:{}", serviceReimbursementdetailShareds.get(i));
            uploadOAFileAndUpdateDb(serviceReimbursementdetailShareds.get(i));
        }
@@ -205,7 +209,10 @@
        return serviceReimbursementMapper.getRDInfoByItem(serviceReimbursementEo);
    }
    public int uploadOAFileAndUpdateDb(ServiceReimbursementdetailShared remShare) {
        log.info("uploadOAFileAndUpdate方法的入参:{}", remShare);
        System.out.println("uploadOAFileAndUpdate方法的入参:" + 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";
@@ -220,8 +227,7 @@
        JSONObject jsonObj = new JSONObject(map);
        System.out.println("uploadOAFileAndUpdateDb + jsonObject" + jsonObj.toString() + "\r\n" + jsonObj.toJSONString());
        String strRes = HttpClientKit.postOpr(strUrl, jsonObj.toString());//
        //String strRes = HttpClientKit.postMsg(strUrl,jsonObj);//得到返回的token?
        String strRes = HttpClientKit.postOpr(strUrl, jsonObj.toString());
        JSONObject json1 = JSONObject.parseObject(strRes);
        strRes = json1.get("id").toString();
@@ -233,10 +239,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);
            try {
                log.info("请求第三方的入参strFile : {}, strFUrl : {}", strFile, filePath);
                String struploadResult = HttpClientKit.sendPostWithFile(filetest, strFUrl);
                log.info("第三方传回的数据: {}", struploadResult);
                if (StringUtils.isEmpty(struploadResult)) {
                    log.info("HttpClientKit.sendPostWithFile 请求为空了 filetest:{},  strFUrl:{} ",filetest,strFUrl);
                    return 0;
@@ -245,6 +254,7 @@
                //获取fileid
                JSONObject jsonR = JSONObject.parseObject(struploadResult);
                JSONArray jsonArr = jsonR.getJSONArray("atts");
                log.info("第三方传回的数据获取的atts : {}", jsonArr);
                for (int j = 0; j < jsonArr.size(); j++) {
                    JSONObject jsonRet = jsonArr.getJSONObject(j);
                    rbDetailFile.setFileid(jsonRet.get("fileUrl").toString());