zjh
2025-04-24 da2ad4874c91ee6e14654eb11f35676ebcd1f66b
zjh20250424
10个文件已修改
240 ■■■■■ 已修改文件
ltkj-admin/src/main/java/com/ltkj/web/config/captcha/CommonController.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjReportController.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjXdPictureController.java 138 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/resources/application-dev.yml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/resources/application-prod.yml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/resources/application-test.yml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-common/src/main/java/com/ltkj/common/utils/file/FileUploadUtils.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjXdtgmdjg.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/LtkjExamJcsqdMapper.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/hosp/vodomain/CsProVo.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/java/com/ltkj/web/config/captcha/CommonController.java
@@ -2,10 +2,10 @@
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -14,6 +14,7 @@
import com.ltkj.common.core.domain.entity.SysDictData;
import com.ltkj.common.utils.SnowFlake;
import com.ltkj.common.utils.uuid.UUID;
import com.ltkj.db.DataSourceContextHolder;
import com.ltkj.hosp.domain.SysAttachment;
import com.ltkj.hosp.service.ISysAttachmentService;
import com.ltkj.system.service.ISysDictDataService;
@@ -48,6 +49,9 @@
    @Autowired
    private ServerConfig serverConfig;
    @Value("${path.xdtfilePath}")
    private String value;
    private static final String FILE_DELIMETER = ",";
@@ -274,4 +278,36 @@
        }
        return AjaxResult.success("删除成功");
    }
    /**
     * 心电图报告上传图片方法
     */
    @PostMapping("/uploadXdtFile")
    @ApiOperation(value = "心电图报告上传图片方法")
    public AjaxResult uploadXdtFile(@ApiParam("文件") @RequestPart("file") MultipartFile file,
                                    @ApiParam("体检号") String tjh,@ApiParam("项目id") String proId) throws Exception {
        try {
            // 上传文件路径
            // 第一步:生成文件并保存
            String key = DataSourceContextHolder.getDataSourceKey();
            key = key.replace("ltkjpeis10_","");
            String filePath = value + File.separator + key + File.separator;
            String outputFileName = tjh +"_" +proId;
            // 上传并返回新文件名称
            String fileName = FileUploadUtils.upload(filePath,outputFileName, file);
            String url = filePath + fileName;
            Path path = Paths.get(url);
            byte[] data = Files.readAllBytes(path);
            String base64 = Base64.getEncoder().encodeToString(data);
            AjaxResult ajax = AjaxResult.success();
            ajax.put("url", url);
            ajax.put("fileName", fileName);
            ajax.put("base64", base64);
            return ajax;
        } catch (Exception e) {
            return AjaxResult.error(e.getMessage());
        }
    }
}
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjReportController.java
@@ -434,9 +434,6 @@
    public AjaxResult shengchengbgmoban(String tjNumber, TjOrder tjOrder, TjCustomer tjCustomer, TjReportTemplate reportTemplate,TjReportTemplate zongJianYiShiQianMing) {
        AjaxResult ajaxResult = null;
        try {
//            ajaxResult = hisPDFUtil.hisPDF(tjOrder, tjCustomer, reportTemplate);
//            ajaxResult = hisPDFUtil.hisPDFNew(tjOrder, tjCustomer, reportTemplate);
            ajaxResult = hisPDFUtil.hisPDFNew2(tjOrder, tjCustomer, reportTemplate,zongJianYiShiQianMing);
        } catch (Exception e) {
            e.printStackTrace();
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjXdPictureController.java
@@ -1,5 +1,10 @@
package com.ltkj.web.controller.system;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import java.util.stream.Collectors;
import javax.annotation.Resource;
@@ -10,6 +15,8 @@
import com.ltkj.common.core.domain.entity.SysUser;
import com.ltkj.common.core.redis.RedisCache;
import com.ltkj.common.utils.SecurityUtils;
import com.ltkj.common.utils.file.FileUploadUtils;
import com.ltkj.db.DataSourceContextHolder;
import com.ltkj.framework.config.MatchUtils;
import com.ltkj.hosp.domain.*;
import com.ltkj.hosp.service.*;
@@ -19,7 +26,9 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import jodd.util.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Isolation;
@@ -65,7 +74,8 @@
    private LtkjExamJcbgdService jcbgdService;
    @Resource
    private LtkjExamJcsqdService jcsqdService;
    @Value("${path.xdtfilePath}")
    private String value;
    /**
     * 查询体检心电图管理列表
     */
@@ -220,82 +230,6 @@
                                  @ApiParam (value = "开始时间") @RequestParam (required = false) String beginTime,
                                  @ApiParam (value = "结束时间") @RequestParam (required = false) String endTime) {
//        DateTime beginTimes = null;
//        DateTime endTimes = null;
//        if (null != beginTime && null != endTime) {
//            beginTimes = DateUtil.beginOfDay(DateUtil.parse(beginTime));
//            endTimes = DateUtil.endOfDay(DateUtil.parse(endTime));
//        }
//        //初始化体检订单表
//        List<TjOrder> orderList = null;
//        List<TjCustomer> customerList = new ArrayList<>();
//        Map<String, Object> map = new HashMap<>();
//
//        if (checkStatus == 0)
//            asyncService.wCScheckSetCustomerLisByRedis(orderService.getCsTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes));
//        if (checkStatus == 1)
//            asyncService.yCScheckSetCustomerLisByRedis(orderService.getCsTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes));
//
//        //根据姓名查询
//        if (null != name && !"".equals(name)) {
//            List<TjCustomer> list = customerService.getTjCustomerList(name);
//            if (null != list && list.size() > 0) {
//                List<TjCustomer> lists = new ArrayList<>();
//                for (TjCustomer customer : list) {
//                    orderList = orderService.getCsTjOrderListByCusId(customer.getCusId());
//                    if (null != orderList && orderList.size() > 0) {
//                        for (TjOrder tjOrder : orderList) {
//                            customer.setTjNumber(tjOrder.getTjNumber());
//                            customer.setTjStatus(Long.valueOf(tjOrder.getCheckStatus()));
//                            customer.setOrderId(tjOrder.getOrderId());
//                            customer.setTjTime(tjOrder.getCreateTime());
//                            customer.setFinishTime(tjOrder.getFinishTime());
//                            customer.setCusName(MatchUtils.hideCusName(customer.getCusName()));
//                            customer.setCusPhone(MatchUtils.hidePhoneNum(customer.getCusPhone()));
//                            customer.setCusIdcard(MatchUtils.hideIdCardNum(customer.getCusIdcard()));
//                            customer.setConfirmStatus(String.valueOf(tjOrder.getStatus()));
//                            if (tjOrder.getFirmId().equals("0")) {
//                                customer.setTjCompName(null);
//                            } else {
//                                customer.setTjCompName(compService.selectDictCompByDrugManufacturerId(tjOrder.getFirmId()).getCnName());
//                            }
//                            lists.add(customer);
//                        }
//                    }
//                }
//                List<TjCustomer> customers = null;
//                if (lists.size() > 0) {
//                    customers = lists.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
//                }
//                map.put("customers", customers);
//                map.put("total", lists.size());
//                return AjaxResult.success(map);
//            }
//            return AjaxResult.success("暂无数据");
//        }
//
//        //条件查询
//        if (null != tjNumber || null != compId || (null != beginTime && null != endTime)) {
//            orderList = orderService.getCsTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes);
//            return getResult(page, pageSize, orderList, customerList, map);
//        }
//
//        List<TjCustomer> customers = null;
//        if (checkStatus == 0) {
//            customers = redisCache.getCacheMapValue("cScheck", "ws");
//        }
//        if (checkStatus == 1) {
//            customers = redisCache.getCacheMapValue("cScheck", "ys");
//        }
//        if (customers != null && customers.size() > 0) {
//            List<TjCustomer> customerLists = customers.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
//            map.put("customers", customerLists);
//            map.put("total", customers.size());
//            return AjaxResult.success(map);
//        } else {
//            orderList = orderService.getCsTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes);
//            return getResult(page, pageSize, orderList, customerList, map);
//        }
        Long deptId = SecurityUtils.getDeptId();
        log.info("影像检查列表(骨密度和心电图)接口 当前登录人科室"+deptId);
        String value = String.valueOf(compId);
@@ -314,6 +248,28 @@
        Long deptId = SecurityUtils.getDeptId();
        log.info("影像检查骨密度心电图页面点击体检人员展示体检项目接口当前登录人科室"+deptId);
        List<CsProVo> list = remarkService.getYxJcXx(tjNumber,deptId.toString());
        if(null !=list && !list.isEmpty()){
            for (CsProVo vo : list) {
                LambdaQueryWrapper<TjXdtgmdjg> wq=new LambdaQueryWrapper<>();
                wq.eq(TjXdtgmdjg::getTjh,tjNumber);
                wq.eq(TjXdtgmdjg::getProId,vo.getProId());
                TjXdtgmdjg xdtgmdjg = xdtgmdjgService.getOne(wq);
                if(null !=xdtgmdjg){
                    if(StringUtil.isNotBlank(xdtgmdjg.getUrl())){
                        Path path = Paths.get(xdtgmdjg.getUrl());
                        byte[] data = null;
                        try {
                            data = Files.readAllBytes(path);
                        } catch (IOException e) {
                            throw new RuntimeException(e);
                        }
                        String base64 = Base64.getEncoder().encodeToString(data);
                        if(StringUtil.isNotBlank(base64)) vo.setImageUrl(base64);
                    }
                }
            }
        }
        return AjaxResult.success(list);
    }
@@ -323,7 +279,8 @@
    public AjaxResult addYxJcXx(@ApiParam (value = "体检号") @RequestParam String tjNumber,
                                @ApiParam (value = "项目id") @RequestParam String proId,
                                @ApiParam (value = "检查所见") @RequestParam String jcsj,
                                @ApiParam (value = "检查结论") @RequestParam String jcjl) {
                                @ApiParam (value = "检查结论") @RequestParam String jcjl,
                                @ApiParam (value = "图片地址") @RequestParam(required = false) String url) {
        try {
            SysUser user = SecurityUtils.getLoginUser().getUser();
            TjOrder order = orderService.getOrderByTjNum(tjNumber);
@@ -356,6 +313,7 @@
                            xdtgmdjg.setJcjl(jcjl);
                            xdtgmdjg.setCreateBy(user.getNickName());
                            xdtgmdjg.setCreateId(user.getUserId().toString());
                            if(StringUtil.isNotBlank(url)) xdtgmdjg.setUrl(url);
                            xdtgmdjgService.save(xdtgmdjg);
                            saveTjXdtgmdjgByJcbgd(xdtgmdjg);
                        }
@@ -385,7 +343,11 @@
            jcbgd.setXmdm(xdtgmdjg.getProId());
            jcbgd.setXmmc(xdtgmdjg.getProName());
            jcbgd.setBgNr(xdtgmdjg.getJcsj());
            jcbgd.setBgUrl("");
            if(StringUtil.isNotBlank(xdtgmdjg.getUrl())){
                jcbgd.setBgUrl(xdtgmdjg.getUrl());
            }else {
                jcbgd.setBgUrl("");
            }
            jcbgd.setShysxm(xdtgmdjg.getCreateBy());
            jcbgd.setShysdm(xdtgmdjg.getCreateId());
            jcbgd.setYxzd(xdtgmdjg.getJcjl());
@@ -417,7 +379,25 @@
            if(null !=xdtgmdjg ){
                map.put("jcsj",xdtgmdjg.getJcsj());
                map.put("jcjl",xdtgmdjg.getJcjl());
                if(StringUtil.isNotBlank(xdtgmdjg.getUrl())){
                    Path path = Paths.get(xdtgmdjg.getUrl());
                    byte[] data = null;
                    try {
                        data = Files.readAllBytes(path);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                    String base64 = Base64.getEncoder().encodeToString(data);
                    map.put("tp",base64);
                }else {
                    map.put("tp",null);
                }
                return AjaxResult.success(map);
            }else {
                TjProject tjProject = projectService.getById(proId);
                map.put("jcsj","");
                map.put("jcjl",tjProject.getProDefault()==null ? "":tjProject.getProDefault());
                map.put("tp",null);
            }
            return AjaxResult.success(map);
        }
ltkj-admin/src/main/resources/application-dev.yml
@@ -190,6 +190,7 @@
#  体检报告模板和报告临时生成存储的文件夹路径
path:
  filePath: D:\Tjreport
  xdtfilePath: C:\TjXdt
  # nginx图片服务器
  reportServer: https://ltpeis.xaltjdkj.cn:5516/
ltkj-admin/src/main/resources/application-prod.yml
@@ -190,6 +190,7 @@
#  体检报告模板和报告临时生成存储的文件夹路径
path:
  filePath: C:\Tjreport
  xdtfilePath: C:\TjXdt
  # nginx图片服务器
  reportServer: https://ltpeis.xaltjdkj.cn:5516/
ltkj-admin/src/main/resources/application-test.yml
@@ -190,6 +190,7 @@
#  体检报告模板和报告临时生成存储的文件夹路径
path:
  filePath: C:\Tjreport
  xdtfilePath: C:\TjXdt
  # nginx图片服务器
  reportServer: https://ltpeis.xaltjdkj.cn:5516/
ltkj-common/src/main/java/com/ltkj/common/utils/file/FileUploadUtils.java
@@ -78,6 +78,14 @@
        }
    }
    public static final String upload(String baseDir,String fileName,MultipartFile file) throws IOException {
        try {
            return upload(baseDir,fileName, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
        } catch (Exception e) {
            throw new IOException(e.getMessage(), e);
        }
    }
    /**
     * 文件上传
     *
@@ -102,16 +110,38 @@
        String fileName = extractFilename(file);
        //String absPath = getAbsoluteFile(baseDir, fileName).getAbsolutePath();
        String absPath = getAbsoluteFile(baseDir, fileName).getPath();
        file.transferTo(Paths.get(absPath));
        return getPathFileName(baseDir, fileName);
    }
    public static final String upload(String baseDir,String fileName, MultipartFile file, String[] allowedExtension)
            throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
            InvalidExtensionException {
        int fileNamelength = Objects.requireNonNull(file.getOriginalFilename()).length();
        if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH) {
            throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
        }
        assertAllowed(file, allowedExtension);
         fileName =StringUtils.format("{}/{}.{}", DateUtils.datePath(),
                 fileName, getExtension(file));
        String absPath = getAbsoluteFile(baseDir, fileName).getPath();
        file.transferTo(Paths.get(absPath));
        return fileName;
    }
    /**
     * 编码文件名
     */
    public static final String extractFilename(MultipartFile file) {
        return StringUtils.format("{}/{}_{}.{}", DateUtils.datePath(),
                FilenameUtils.getBaseName(file.getOriginalFilename()), Seq.getId(Seq.uploadSeqType), getExtension(file));
    }
    public static final String extractXdtFilename(MultipartFile file) {
        return StringUtils.format("{}/{}_{}.{}", DateUtils.datePath(),
                FilenameUtils.getBaseName(file.getOriginalFilename()), Seq.getId(Seq.uploadSeqType), getExtension(file));
    }
@@ -130,9 +160,10 @@
    public static final String getPathFileName(String uploadDir, String fileName) throws IOException {
        int dirLastIndex = ltkjConfig.getProfile().length() + 1;
        String currentDir = StringUtils.substring(uploadDir, dirLastIndex);
        return Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName;
        return Constants.RESOURCE_PREFIX + currentDir + "/" + fileName;
    }
    /**
     * 文件大小校验
     *
ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjXdtgmdjg.java
@@ -25,4 +25,5 @@
    private String proName;
    private String jcsj;
    private String jcjl;
    private String url;
}
ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/LtkjExamJcsqdMapper.java
@@ -32,10 +32,15 @@
    List<LtkjExamJcsqd> getLtkjJcsqdByTjh(String tjh);
    @Insert("INSERT INTO  ltkj_exam_jcsqd \n" +
            "SELECT a.tjh,a.tmh,NULL jclx,NULL jczlx,a.shysxm bgys,a.shysdm bgysid,a.sqsj,a.zdsj jgsj, a.xmmc jcxmmc,a.xmdm jcxmid,a.jcbw bw,\n" +
            "a.yxzd jgzt,a.yxbx jgbx,sysdate()\n" +
            "FROM ltkj_exam_jcbgd a WHERE a.tjh=#{tjh} GROUP BY a.xmmc")
//    @Insert("INSERT INTO  ltkj_exam_jcsqd \n" +
//            "SELECT a.tjh,a.tmh,NULL jclx,NULL jczlx,a.shysxm bgys,a.shysdm bgysid,a.sqsj,a.zdsj jgsj, a.xmmc jcxmmc,a.xmdm jcxmid,a.jcbw bw,\n" +
//            "a.yxzd jgzt,a.yxbx jgbx,'0',sysdate(),'0'\n" +
//            "FROM ltkj_exam_jcbgd a WHERE a.tjh=#{tjh} GROUP BY a.xmmc")
@Insert("INSERT INTO  ltkj_exam_jcsqd (`tjh`, `tmh`, `jclx`, `jczlx`, `bgys`, `bgysid`, " +
        "`sqsj`, `jgsj`, `jcxmmc`, `jcxmid`, `bw`, `jgzt`, `jgbx`, `lx`, `create_time`)\n" +
        "SELECT a.tjh,a.tmh,NULL jclx,NULL jczlx,a.shysxm bgys,a.shysdm bgysid,a.sqsj,a.zdsj jgsj, a.xmmc jcxmmc,a.xmdm jcxmid,a.jcbw bw,\n" +
        "a.yxzd jgzt,a.bg_nr jgbx,'0',sysdate()\n" +
        "FROM ltkj_exam_jcbgd a WHERE a.tjh=#{tjh} and a.lx=0  GROUP BY a.xmmc")
    void saveLtkjExamJcsqd(String tjh);
    @Select("SELECT a.tjh,a.tmh,NULL jclx,NULL jczlx,a.shysxm bgys,a.shysdm bgysid,a.sqsj,a.zdsj jgsj, a.xmmc jcxmmc,a.xmdm jcxmid,a.jcbw bw," +
ltkj-hosp/src/main/java/com/ltkj/hosp/vodomain/CsProVo.java
@@ -61,4 +61,7 @@
    private Date zhupdateTime;
    private Long deptId;
    @ApiModelProperty("图片")
    private String imageUrl;
}