diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/pom.xml b/yudao-framework/yudao-spring-boot-starter-mybatis/pom.xml index acc2dc507..9f1f98794 100644 --- a/yudao-framework/yudao-spring-boot-starter-mybatis/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-mybatis/pom.xml @@ -46,7 +46,6 @@ com.microsoft.sqlserver mssql-jdbc - true com.dameng diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/outapi/OutApiController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/outapi/OutApiController.java new file mode 100644 index 000000000..f15cdd354 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/outapi/OutApiController.java @@ -0,0 +1,64 @@ +package cn.iocoder.yudao.module.system.controller.admin.outapi; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.module.system.controller.admin.outapi.vo.*; +import cn.iocoder.yudao.module.system.dal.dataobject.contrastorg.ContrastOrgDO; +import cn.iocoder.yudao.module.system.dal.mysql.contrastorg.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.tags.*; +import org.springframework.validation.annotation.*; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.UUID; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +@Tag(name = "管理后台 - OutApiController") +@RestController +@RequestMapping("/system/outapi") +@Validated +public class OutApiController { + + @Resource + private ContrastOrgMapper contrastOrgMapper; + + @PostMapping("/addContrastOrg") + @Operation(summary = "addContrastOrg") + public CommonResult addContrastOrg(@RequestBody ContrastOrgSaveReqVO createReqVO) { + String _out = ""; + + try { + if ((createReqVO.getRegid() != null && !createReqVO.getRegid().isEmpty()) && + (createReqVO.getOrgid() != null && !createReqVO.getOrgid().isEmpty())) { + + ContrastOrgDO contrastOrgDO = null; + + contrastOrgDO = contrastOrgMapper.selectOne(new LambdaQueryWrapperX() + .eq(ContrastOrgDO::getRegid, createReqVO.getRegid().trim())); + + if (contrastOrgDO == null) { + UUID guid = UUID.randomUUID(); + contrastOrgDO = BeanUtils.toBean(createReqVO, ContrastOrgDO.class); + contrastOrgDO.setId(guid.toString()); + contrastOrgDO.setRegid(contrastOrgDO.getRegid().trim()); + contrastOrgDO.setOrgid(contrastOrgDO.getOrgid().trim()); + contrastOrgMapper.insert(contrastOrgDO); + _out = "成功"; + } else + _out = "失败,参数regid对应的数据已存在"; + } else + _out = "失败,参数regid、orgid都不能为空"; + } catch (Exception ex) { + _out = "失败," + ex.getMessage(); + } + + if (_out.equals("成功")) + return success(_out); + else + return error(400, _out); + } +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/outapi/vo/ContrastOrgSaveReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/outapi/vo/ContrastOrgSaveReqVO.java new file mode 100644 index 000000000..8ee7da172 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/outapi/vo/ContrastOrgSaveReqVO.java @@ -0,0 +1,22 @@ +package cn.iocoder.yudao.module.system.controller.admin.outapi.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.util.*; +import javax.validation.constraints.*; + +@Schema(description = "管理后台 - tb_contrast_org新增/修改 Request VO") +@Data +public class ContrastOrgSaveReqVO { + + @Schema(description = "ID", example = "30850") + private String id; + + @Schema(description = "regid", example = "32407") + private String regid; + + @Schema(description = "orgid", example = "17889") + private String orgid; + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/contrastorg/ContrastOrgDO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/contrastorg/ContrastOrgDO.java new file mode 100644 index 000000000..9d85e3d20 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/contrastorg/ContrastOrgDO.java @@ -0,0 +1,38 @@ +package cn.iocoder.yudao.module.system.dal.dataobject.contrastorg; + +import lombok.*; +import com.baomidou.mybatisplus.annotation.*; + +/** + * tb_contrast_org DO + * + * @author 李传洋 + */ +@TableName("tb_contrast_org") +@KeySequence("tb_contrast_org_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ContrastOrgDO { + + /** + * ID + */ + @TableId(value = "ID", type = IdType.INPUT) + private String id; + + /** + * regid + */ + @TableField("regid") + private String regid; + + /** + * orgid + */ + @TableField("orgid") + private String orgid; + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/contrastorg/ContrastOrgMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/contrastorg/ContrastOrgMapper.java new file mode 100644 index 000000000..506e59921 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/contrastorg/ContrastOrgMapper.java @@ -0,0 +1,23 @@ +package cn.iocoder.yudao.module.system.dal.mysql.contrastorg; + +import java.util.*; + +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.module.system.dal.dataobject.contrastorg.*; +import com.baomidou.mybatisplus.annotation.*; +import org.apache.ibatis.annotations.*; + +/** + * tb_contrast_org Mapper + * + * @author 李传洋 + */ +@InterceptorIgnore(tenantLine = "true") +@Mapper +public interface ContrastOrgMapper extends BaseMapperX { + + @Select(" SELECT t1.ID AS ID,t1.orgid AS orgid,t1.regid AS regid,t2.orgName FROM tb_contrast_org t1 LEFT JOIN tb_org t2 ON t1.orgid=t2.orgID WHERE t1.regid=#{regid} ") + List> selectInfo(@Param("regid") String regid); + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dicomworklist/DicomworklistMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dicomworklist/DicomworklistMapper.java index 25e066b83..f6c38f5de 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dicomworklist/DicomworklistMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dicomworklist/DicomworklistMapper.java @@ -81,11 +81,11 @@ public interface DicomworklistMapper extends BaseMapperX { List GetDicomSeriesByStudyInsta(@Param("studyInsta") String studyInsta); @Select(" SELECT CONCAT(\n" + - "(SELECT CAST(COUNT(*) AS CHAR) FROM dicomstudies t1\n" + + "(SELECT TRIM(CAST(COUNT(*) AS CHAR)) FROM dicomstudies t1\n" + " LEFT JOIN dicomseries t2 ON t1.StudyInsta=t2.StudyInsta\n" + " WHERE t1.PatientID=#{patientID} AND t1.StudyInsta=#{studyInsta} and t2.BodyPartEx is not null )\n" + ",'/',\n" + - "(SELECT CAST(COUNT(*) AS CHAR) FROM dicomstudies t1\n" + + "(SELECT TRIM(CAST(COUNT(*) AS CHAR)) FROM dicomstudies t1\n" + " LEFT JOIN dicomseries t2 ON t1.StudyInsta=t2.StudyInsta\n" + " LEFT JOIN dicomimages t3 ON t2.SeriesInst=t3.SeriesInst\n" + " WHERE t1.PatientID=#{patientID} AND t1.StudyInsta=#{studyInsta})) ") diff --git a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/PatientexamlistController.java b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/PatientexamlistController.java index 8e02b2f9e..420886853 100644 --- a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/PatientexamlistController.java +++ b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/PatientexamlistController.java @@ -188,6 +188,7 @@ public class PatientexamlistController { ids = patientexamlistService.dicomDataSync(); _out.put("code", "success"); } catch (Exception ex) { + System.out.println(ex.getMessage()); ids = null; _out.put("code", "error"); } @@ -398,21 +399,15 @@ public class PatientexamlistController { public void FtpPdf(@RequestBody inspdfscreenshotVO insimagescreenshotVO) { String base64String = insimagescreenshotVO.getImagebase(); String fileName = System.currentTimeMillis() + ".pdf"; - if(insimagescreenshotVO.getModel().equals("0")) - { + if (insimagescreenshotVO.getModel().equals("0")) { // 解码Base64字符串 String base64Image = base64String.split(",")[1]; - try - { - FileUtils.saveBase64ToFile(base64Image,insimagescreenshotVO.getFolderPath(),fileName.split("\\.")[0],"pdf"); + try { + FileUtils.saveBase64ToFile(base64Image, insimagescreenshotVO.getFolderPath(), fileName.split("\\.")[0], "pdf"); + } catch (Exception ignored) { + System.out.println("文件上传失败" + ignored.getMessage()); } - catch (Exception ignored) - { - System.out.println("文件上传失败"+ignored.getMessage()); - } - } - else - { + } else { String ftpServer = "114.55.171.231"; int ftpPort = 21; // FTP端口,默认为21 String ftpUser = "pacs"; @@ -460,16 +455,15 @@ public class PatientexamlistController { } } - //上传成功 - //当前时间 - 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()); - PatientexamlistSaveReqVO updateReqVO = new PatientexamlistSaveReqVO(); - updateReqVO.setId(insimagescreenshotVO.getID()); - updateReqVO.setPdfurl("https://pacs.gw12320.com/video/" +insimagescreenshotVO.getID()+"/"+ fileName); - patientexamlistService.updatePatientexamlist(updateReqVO); - + //上传成功 + //当前时间 + 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()); + PatientexamlistSaveReqVO updateReqVO = new PatientexamlistSaveReqVO(); + updateReqVO.setId(insimagescreenshotVO.getID()); + updateReqVO.setPdfurl("https://pacs.gw12320.com/video/" + insimagescreenshotVO.getID() + "/" + fileName); + patientexamlistService.updatePatientexamlist(updateReqVO); } diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index 795425d50..25ea8b627 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -40,7 +40,8 @@ spring: time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒 min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒 max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒 - validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效 + #validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效 + validation-query: SELECT 1 # 配置检测连接是否有效 test-while-idle: true test-on-borrow: false test-on-return: false @@ -180,12 +181,12 @@ debug: false --- #################### 微信公众号、小程序相关配置 #################### wx: mp: # 公众号配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档 -# app-id: wx041349c6f39b268b # 测试号(牛希尧提供的) -# secret: 5abee519483bc9f8cb37ce280e814bd0 + # app-id: wx041349c6f39b268b # 测试号(牛希尧提供的) + # secret: 5abee519483bc9f8cb37ce280e814bd0 app-id: wx5b23ba7a5589ecbb # 测试号(自己的) secret: 2a7b3b20c537e52e74afd395eb85f61f -# app-id: wxa69ab825b163be19 # 测试号(Kongdy 提供的) -# secret: bd4f9fab889591b62aeac0d7b8d8b4a0 + # app-id: wxa69ab825b163be19 # 测试号(Kongdy 提供的) + # secret: bd4f9fab889591b62aeac0d7b8d8b4a0 # 存储配置,解决 AccessToken 的跨节点的共享 config-storage: type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取 @@ -196,8 +197,8 @@ wx: # secret: 333ae72f41552af1e998fe1f54e1584a appid: wx63c280fe3248a3e7 # wenhualian的接口测试号 secret: 6f270509224a7ae1296bbf1c8cb97aed -# appid: wxc4598c446f8a9cb3 # 测试号(Kongdy 提供的) -# secret: 4a1a04e07f6a4a0751b39c3064a92c8b + # appid: wxc4598c446f8a9cb3 # 测试号(Kongdy 提供的) + # secret: 4a1a04e07f6a4a0751b39c3064a92c8b config-storage: type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取 key-prefix: wa # Redis Key 的前缀 diff --git a/yudao-server/src/main/resources/application.yaml b/yudao-server/src/main/resources/application.yaml index 7b568796d..c9680fa2b 100644 --- a/yudao-server/src/main/resources/application.yaml +++ b/yudao-server/src/main/resources/application.yaml @@ -165,6 +165,8 @@ yudao: - /admin-api/system/jwtToken/getToken - /admin-api/applyregistration/applyform/GetPatientPDFDcm - /admin-api/ultrasoniccom/ultrasonic/ftpimage + - /admin-api/ultrasoniccom/ultrasonic/SaveFileBase64 + - /admin-api/system/outapi/addContrastOrg websocket: enable: true # websocket的开关 path: /infra/ws # 路径 @@ -215,6 +217,8 @@ yudao: - /admin-api/system/jwtToken/getToken - /admin-api/applyregistration/applyform/GetPatientPDFDcm - /admin-api/ultrasoniccom/ultrasonic/ftpimage + - /admin-api/ultrasoniccom/ultrasonic/SaveFileBase64 + - /admin-api/system/outapi/addContrastOrg ignore-tables: - system_tenant - system_tenant_package