From 2be0ed2de0fb91c1fab5a98a398061c514b6d2ba Mon Sep 17 00:00:00 2001 From: lxd <1004405501@qq.com> Date: Thu, 5 Sep 2024 11:39:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=85=E5=A3=B0=E5=A2=9E=E5=8A=A0=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E8=A7=86=E9=A2=91=E5=92=8C=E6=8F=92=E5=85=A5=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ultrasonic/ultrasonicController.java | 72 +++++++++++-------- .../ultrasonic/medicalimg/medicalimgDO.java | 3 + .../medicalimg/medicalimgMapper.java | 3 +- .../service/medicalimg/medicalimgService.java | 5 ++ .../medicalimg/medicalimgServiceImpl.java | 11 +++ .../service/ultrasonic/ultrasonicService.java | 2 + .../mapper/ultrasonic/medicalimgMapper.xml | 20 +++++- 7 files changed, 84 insertions(+), 32 deletions(-) diff --git a/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/controller/admin/ultrasonic/ultrasonicController.java b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/controller/admin/ultrasonic/ultrasonicController.java index 5a0453ac0..c11bfe912 100644 --- a/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/controller/admin/ultrasonic/ultrasonicController.java +++ b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/controller/admin/ultrasonic/ultrasonicController.java @@ -8,18 +8,8 @@ import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.service.dicomworklist.DicomworklistService; import cn.iocoder.yudao.module.system.service.org.OrgUnitService; import cn.iocoder.yudao.module.system.service.user.AdminUserService; -import com.fasterxml.jackson.databind.SerializationFeature; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import org.apache.http.entity.ContentType; -import cn.hutool.core.date.DateTime; +import cn.iocoder.yudao.module.ultrasoniccom.controller.admin.ultrasonic.medicalimg.insimagescreenshotVO; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; -import cn.iocoder.yudao.module.applyregistration.controller.admin.applyform.devicevo.DeviceVO; -import cn.iocoder.yudao.module.applyregistration.controller.admin.applyform.devicevo.deviceupVO; -import cn.iocoder.yudao.module.applyregistration.dal.dataobject.applyform.ApplyformDO; -import cn.iocoder.yudao.module.applyregistration.dal.device.DeviceDO; -import cn.iocoder.yudao.module.ultrasoniccom.controller.admin.ultrasonic.medicalimg.medicalimgVO; import cn.iocoder.yudao.module.ultrasoniccom.controller.admin.ultrasonic.medicalimg.upmedicalimgVO; import cn.iocoder.yudao.module.ultrasoniccom.dal.ultrasonic.medicalimg.medicalimgDO; import cn.iocoder.yudao.module.ultrasoniccom.dal.ultrasonic.ultrasonicDO; @@ -29,9 +19,7 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission; import cn.iocoder.yudao.module.applyregistration.controller.admin.applyform.ApplyformController; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -43,8 +31,6 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.validation.Valid; -import java.io.IOException; -import java.nio.charset.StandardCharsets; import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.LocalDateTime; @@ -81,7 +67,7 @@ public class ultrasonicController { public CommonResult> getreporttemplatelist(@RequestParam("orgID") String orgID, @RequestParam("type") String type, @RequestParam("isprivate") String isprivate) throws Exception { //当前登陆用户 AdminUserDO user = userService.getUser(getLoginUserId()); - orgID= user.getOrgId(); + orgID = user.getOrgId(); List devicelist = ultrasonicService.getreporttemplate(); List filteredList = new ArrayList<>(); @@ -109,13 +95,12 @@ public class ultrasonicController { } // 私有 if (isprivate.equals("1")) { - // 筛选条件: 私有不需要排序 没有父节点 + // 筛选条件: 私有不需要排序 没有父节点 filteredList = filteredList.stream() .filter(ultrasonicDO -> Objects.equals(ultrasonicDO.getPrivateDoctorId(), user.getDoctorID())) .collect(Collectors.toList()); - } - else// 共有 + } else// 共有 { // 筛选条件: filteredList = filteredList.stream() @@ -172,8 +157,7 @@ public class ultrasonicController { parent.children = new ArrayList<>(); // 初始化 parent.children 列表 } parent.children.add(tree); - } - else if(privateId!=null && !privateId.isEmpty())//判断是否是私有模版 私有的直接加到树里面 + } else if (privateId != null && !privateId.isEmpty())//判断是否是私有模版 私有的直接加到树里面 { treeList.add(tree); } @@ -199,6 +183,15 @@ public class ultrasonicController { return success(BeanUtils.toBean(devicelist, medicalimgDO.class)); } + @GetMapping("/GetImageVideo") + @Operation(summary = "获取图片表视频") + public CommonResult GetImageVideo(@RequestParam("regID") String regId) { + //当前登陆用户 + AdminUserDO user = userService.getUser(getLoginUserId()); + String imgurl = medicalimgService.GetImagevideo(user.getOrgId(), regId); + return success(imgurl); + } + @PutMapping("/examineimageupdate") @Operation(summary = "超声审核更新图片数据") @@ -274,7 +267,7 @@ public class ultrasonicController { @PreAuthorize("@ss.hasPermission('ultrasoniccom:ultrasonic:create')") public CommonResult GetDcmList(@RequestParam("orgID") String orgID, @RequestParam("studyInsta") String studyInsta, @RequestParam("regId") String regId) throws JsonProcessingException { String strJson = ""; - String json=""; + String json = ""; if (!studyInsta.isEmpty() && !orgID.isEmpty()) { // 先查询基本信息 一个患者基本信息就一条 @@ -296,7 +289,7 @@ public class ultrasonicController { for (DicomSeriesDO d : doList) { //判断第一条数据 是他的缩略图 boolean isFirst = true; - String url=""; + String url = ""; StringBuilder instanceList = new StringBuilder(); StringBuilder imageid = new StringBuilder(); StringBuilder seriesList = new StringBuilder(); @@ -304,25 +297,25 @@ public class ultrasonicController { //筛选数据 List activeImages = imagesDOList.stream() .filter(DicomImagesDO -> DicomImagesDO.getSeriesInst().equals(d.getSeriesInst())) - .sorted(Comparator.comparing(DicomImagesDO->Integer.parseInt(DicomImagesDO.getImageNumbe()))) // 保持原始顺序 + .sorted(Comparator.comparing(DicomImagesDO -> Integer.parseInt(DicomImagesDO.getImageNumbe()))) // 保持原始顺序 .collect(Collectors.toList()); for (DicomImagesDO imagesDO : activeImages) { if (isFirst) { // 这是第一条数据的逻辑处理 - // url="/dcm/"+imagesDO.getObjectFile().replace("\\", "\\\\").replaceFirst("\\.dcm$", ".jpg"); - url="/static/ctlogo.png"; + // url="/dcm/"+imagesDO.getObjectFile().replace("\\", "\\\\").replaceFirst("\\.dcm$", ".jpg"); + url = "/static/ctlogo.png"; // 处理完第一条数据后,将isFirst标志设置为false isFirst = false; } - imageid.append("{\"imageid\": \"").append("/dcm/"+imagesDO.getObjectFile().replace("\\", "\\\\")).append("\"},"); + imageid.append("{\"imageid\": \"").append("/dcm/" + imagesDO.getObjectFile().replace("\\", "\\\\")).append("\"},"); } } if (imageid.length() > 0) { imageid.deleteCharAt(imageid.length() - 1); } instanceList.append(" \"instanceList\": [").append(imageid).append("]"); - seriesList.append(" { \"SeriesDesc\": \""+d.getSeriesDesc()+"\",\"thumbUrl\": \""+url+"\",\n" + " \"seriesdesc\": \"CHEST\",\n").append(instanceList).append("},"); + seriesList.append(" { \"SeriesDesc\": \"" + d.getSeriesDesc() + "\",\"thumbUrl\": \"" + url + "\",\n" + " \"seriesdesc\": \"CHEST\",\n").append(instanceList).append("},"); seriesassembleList.append(seriesList); } @@ -340,7 +333,7 @@ public class ultrasonicController { } ObjectMapper mapper = new ObjectMapper(); - json= mapper.writeValueAsString(strJson); + json = mapper.writeValueAsString(strJson); } // String Res="{\"status\":\"success\",\"patientname\":\"朱晓珍\",\"hospital\":\"东营康惠健康体检中心\",\"seriesList\":[{\"thumbUrl\":\"/static/101缩略图.jpg\",\"seriesdesc\":\"CHEST\",\"instanceList\":[{\"imageid\":\"/static/49814@101@1@1.2.156.112605.189250948694021.20221211000237.4.28076.1.dcm\"}]},{\"thumbUrl\":\"/static/201缩略图.jpg\",\"seriesdesc\":\"CHEST\",\"instanceList\":[{\"imageid\":\"/static/49814@201@1@1.2.156.112605.189250948694021.20221211000325.4.16016.1.dcm\"},{\"imageid\":\"/static/49814@201@2@1.2.156.112605.189250948694021.20221211000325.4.16016.2.dcm\"},{\"imageid\":\"/static/49814@201@3@1.2.156.112605.189250948694021.20221211000325.4.16016.3.dcm\"},{\"imageid\":\"/static/49814@201@4@1.2.156.112605.189250948694021.20221211000326.4.16016.1.dcm\"},{\"imageid\":\"/static/49814@201@5@1.2.156.112605.189250948694021.20221211000326.4.16016.2.dcm\"}]}]}"; @@ -348,5 +341,26 @@ public class ultrasonicController { return success(strJson); } + @PostMapping("/insimagescreenshot") + @Operation(summary = "插入视频截屏图像") + public int InsImageScreenshot(@RequestBody insimagescreenshotVO insimagescreenshotVO) { + //当前时间 + LocalDateTime dateTime = LocalDateTime.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")), + DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + //当前登陆用户 + AdminUserDO user = userService.getUser(getLoginUserId()); + // 生成随机 UUID + UUID randomUUID = UUID.randomUUID(); + medicalimgDO medicalimgDO = new medicalimgDO(); + medicalimgDO.setId(randomUUID.toString()); + medicalimgDO.setImgUrl(insimagescreenshotVO.getImagebase()); + medicalimgDO.setCreatePerson(user.getUsername()); + medicalimgDO.setCreateDate(dateTime); + medicalimgDO.setRegId(insimagescreenshotVO.getID()); + medicalimgDO.setOrgId(user.getOrgId()); + medicalimgDO.setSelected("0"); + medicalimgDO.setImgType("1"); + return medicalimgService.insimage(medicalimgDO); + } } diff --git a/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/dal/ultrasonic/medicalimg/medicalimgDO.java b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/dal/ultrasonic/medicalimg/medicalimgDO.java index a07e1686c..09fa83422 100644 --- a/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/dal/ultrasonic/medicalimg/medicalimgDO.java +++ b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/dal/ultrasonic/medicalimg/medicalimgDO.java @@ -92,4 +92,7 @@ public class medicalimgDO { */ @TableField("selected") private String selected; + + @TableField("imgType") + private String imgType; } diff --git a/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/dal/ultrasonic/medicalimg/medicalimgMapper.java b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/dal/ultrasonic/medicalimg/medicalimgMapper.java index bf5717a64..2bbf46847 100644 --- a/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/dal/ultrasonic/medicalimg/medicalimgMapper.java +++ b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/dal/ultrasonic/medicalimg/medicalimgMapper.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.ultrasoniccom.dal.ultrasonic.medicalimg; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; -import cn.iocoder.yudao.module.ultrasoniccom.dal.ultrasonic.ultrasonicDO; import com.baomidou.mybatisplus.annotation.InterceptorIgnore; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -16,4 +15,6 @@ public interface medicalimgMapper extends BaseMapperX { List getmedicalimgist(@Param("orgId") String orgId,@Param("regId") String regId,@Param("select") String select); List getmedicalimgist(UserDataDocumentFactory UserDataDocumentFactory); + + String GetImageVideo(@Param("orgId") String orgId,@Param("regId") String regId); } diff --git a/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/service/medicalimg/medicalimgService.java b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/service/medicalimg/medicalimgService.java index 4a3051e38..a9dde1cf8 100644 --- a/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/service/medicalimg/medicalimgService.java +++ b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/service/medicalimg/medicalimgService.java @@ -16,4 +16,9 @@ public interface medicalimgService extends IService { void updatePatientexamlist(@Valid medicalimgVO medicalimgVO); + + + int insimage(medicalimgDO medicalimgDO); + + String GetImagevideo(String orgId,String regId); } diff --git a/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/service/medicalimg/medicalimgServiceImpl.java b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/service/medicalimg/medicalimgServiceImpl.java index 3c4daee5f..e91ed4c17 100644 --- a/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/service/medicalimg/medicalimgServiceImpl.java +++ b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/service/medicalimg/medicalimgServiceImpl.java @@ -12,6 +12,7 @@ import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; import java.util.List; +import java.util.UUID; @Service @Validated @@ -32,4 +33,14 @@ public class medicalimgServiceImpl extends ServiceImpl { List getmedicalimgist(@Param("orgId") String orgId, @Param("regId") String regId,@Param("select") String select); void updatePatientexamlist(@Valid medicalimgVO medicalimgVO); + + } diff --git a/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/resources/mapper/ultrasonic/medicalimgMapper.xml b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/resources/mapper/ultrasonic/medicalimgMapper.xml index d84d80785..de54f2c35 100644 --- a/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/resources/mapper/ultrasonic/medicalimgMapper.xml +++ b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/resources/mapper/ultrasonic/medicalimgMapper.xml @@ -14,7 +14,7 @@ WHERE - AND (isDelete != '1' OR isDelete IS NULL) + AND (isDelete != '1' OR isDelete IS NULL) AND imgType='1' AND orgId = #{orgId} @@ -27,9 +27,25 @@ + - +