Compare commits

..

No commits in common. 'master' and '首页签出2023/07/24' have entirely different histories.

@ -87,11 +87,6 @@
<version>3.4.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-engine-core</artifactId>

@ -3,6 +3,7 @@ package com.docus.server;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
@ -13,6 +14,7 @@ import org.springframework.jms.annotation.EnableJms;
@SpringBootApplication(scanBasePackages ={"com.docus","com.neusoft"})
@EnableJms
@EnableFeignClients
@MapperScan("com.docus.server.**.mapper")
public class AppRunBootstrap {
public static void main(String[] args) {
System.setProperty("javax.xml.parsers.DocumentBuilderFactory","com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");

@ -1,68 +0,0 @@
package com.docus.server.collection.config;
import com.alibaba.druid.pool.DruidDataSource;
import com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties;
import com.baomidou.mybatisplus.core.MybatisConfiguration;
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.type.JdbcType;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.io.support.ResourcePatternResolver;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import javax.sql.DataSource;
@Configuration
@MapperScan(basePackages = com.docus.server.collection.config.DbMysqlConfig.PACKAGE, sqlSessionFactoryRef = "dbmysqlSqlSessionFactory")
@EnableConfigurationProperties(MybatisPlusProperties.class)
public class DbMysqlConfig {
// 这里一定要指定精准 否则后果不堪设想
static final String PACKAGE = "com.docus.server.collection.infrastructure.dao.mapper";
static final String MAPPER_LOCATION = "classpath:mapper/*.xml";
@Bean(name = "dbmysqlDataSource")
@ConfigurationProperties(prefix = "spring.datasource.mysql-docus")
public DataSource secondDataSource(){
return new DruidDataSource();
}
/*注入事务*/
@Bean(name = "dbmysqlTransactionManager")
public DataSourceTransactionManager secondTransactionManager() {
return new DataSourceTransactionManager(secondDataSource());
}
@Bean(name = "dbmysqlSqlSessionFactory")
public SqlSessionFactory secondSqlSessionFactory(@Qualifier("dbmysqlDataSource") DataSource dataSource)
throws Exception {
//配置mybatis-plus源
MybatisSqlSessionFactoryBean bean = new MybatisSqlSessionFactoryBean();
//添加XML目录
ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
bean.setMapperLocations(resolver.getResources(MAPPER_LOCATION));
// 实体类别名
bean.setTypeAliasesPackage("com.docus.server.collection.infrastructure.dao.entity.*");
MybatisConfiguration configuration = new MybatisConfiguration();
//开启下划线转驼峰
configuration.setMapUnderscoreToCamelCase(true);
configuration.setJdbcTypeForNull(JdbcType.NULL);
bean.setDataSource(dataSource);
bean.setConfiguration(configuration);
return bean.getObject();
//
// final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
// sessionFactory.setDataSource(secondDataSource);
// sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver()
// .getResources(DbMysqlConfig.MAPPER_LOCATION));
// return sessionFactory.getObject();
}
}

@ -1,48 +0,0 @@
package com.docus.server.collection.config;
import com.alibaba.druid.pool.DruidDataSource;
import com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import javax.sql.DataSource;
@Configuration
@MapperScan(basePackages = com.docus.server.collection.config.DbSqlserverConfig.PACKAGE, sqlSessionFactoryRef = "dbsqlserverSqlSessionFactory")
@EnableConfigurationProperties(MybatisPlusProperties.class)
public class DbSqlserverConfig {
// 这里一定要指定精准 否则后果不堪设想
static final String PACKAGE = "com.docus.server.collection.infrastructure.dao.sqlserver";
static final String MAPPER_LOCATION = "classpath:sqlserver/*.xml";
@Bean(name = "dbsqlserverDataSource")
@ConfigurationProperties(prefix = "spring.datasource.sqlserver-docus")
public DataSource secondDataSource(){
return new DruidDataSource();
}
/*注入事务*/
@Bean(name = "dbsqlserverTransactionManager")
public DataSourceTransactionManager secondTransactionManager() {
return new DataSourceTransactionManager(secondDataSource());
}
@Bean(name = "dbsqlserverSqlSessionFactory")
public SqlSessionFactory secondSqlSessionFactory(@Qualifier("dbsqlserverDataSource") DataSource secondDataSource)
throws Exception {
final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
sessionFactory.setDataSource(secondDataSource);
sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver()
.getResources(com.docus.server.collection.config.DbSqlserverConfig.MAPPER_LOCATION));
return sessionFactory.getObject();
}
}

@ -1,21 +1,12 @@
package com.docus.server.collection.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.write.builder.ExcelWriterBuilder;
import com.docus.core.util.DateUtil;
import com.docus.core.util.Func;
import com.docus.infrastructure.core.exception.BaseException;
import com.docus.infrastructure.util.easyexcel.ExcelUtil;
import com.docus.infrastructure.web.api.CommonResult;
import com.docus.infrastructure.web.api.ResultCode;
import com.docus.server.collection.converter.FirstPageCheckoutConverter;
import com.docus.server.collection.dto.FirstPageCheckoutInDTO;
import com.docus.server.collection.dto.FirstPageCheckoutRequest;
import com.docus.server.collection.dto.VJsjWzh7addnjreportDto;
import com.docus.server.collection.entity.VJsjWzh7addnjreport;
import com.docus.server.collection.entity.VJsjWzh7addnjreportVo;
import com.docus.server.collection.feign.service.MedicalrecordService;
import com.docus.server.collection.infrastructure.dao.sqlserver.VJsjWzh7addnjreportMapper;
import com.docus.server.collection.service.MzZyHisService;
import com.docus.server.collection.util.PersistRequestUtil;
import com.docus.server.collection.validator.RequestValidator;
@ -24,14 +15,13 @@ import com.docus.server.collection.validator.impl.FirstPageCheckoutRequestValida
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
@Api("梅州中西HIS相关接口")
@Slf4j
@ -41,12 +31,6 @@ public class MzZyHisController {
@Resource
private MzZyHisService mzZyHisService;
@Resource
private MedicalrecordService medicalrecordService;
@Resource
private VJsjWzh7addnjreportMapper vmp;
@ApiOperation("首页签出")
@PostMapping("/firstPageCheckout")
public CommonResult<String> firstPageCheckout(@RequestBody FirstPageCheckoutRequest firstPageCheckoutRequest, HttpServletRequest servletRequest) {
@ -74,50 +58,4 @@ public class MzZyHisController {
}
}
@ApiOperation("查询报告")
@PostMapping("/getReport")
public CommonResult<List<VJsjWzh7addnjreport>> getReport(@RequestBody VJsjWzh7addnjreportDto dto) {
List<VJsjWzh7addnjreport> reports = vmp.getReport(dto);
return CommonResult.success(reports);
}
@ApiOperation("内镜超期导出excel---按勾选")
@PostMapping("/export")
public void export(HttpServletResponse resp, @RequestBody List<VJsjWzh7addnjreportVo> vos) {
OutputStream outputStream = ExcelUtil.getOutputStream("内镜超期报告.xls", resp);
ExcelWriterBuilder write = EasyExcel.write(outputStream, VJsjWzh7addnjreportVo.class);
write.sheet("sheet1").doWrite(vos);
}
@ApiOperation("内镜超期导出excel---按条件")
@PostMapping("/exportAll")
public void exportAll(HttpServletResponse resp,
@RequestBody VJsjWzh7addnjreportDto dto) {
List<VJsjWzh7addnjreport> reports = vmp.getReport(dto);
List<VJsjWzh7addnjreportVo> reportsVo=new ArrayList<VJsjWzh7addnjreportVo>();
reports.forEach(report->{
VJsjWzh7addnjreportVo vo=new VJsjWzh7addnjreportVo();
vo.setDept(report.getDept());
vo.setInpatientNo(report.getInpatientNo());
vo.setItem(report.getItem());
vo.setName(report.getName());
vo.setRegistDateTime(DateUtil.format(report.getRegistDateTime(),"yyyy-MM-dd HH:mm:ss"));
vo.setReportDateTime(DateUtil.format(report.getReportDateTime(),"yyyy-MM-dd HH:mm:ss"));
vo.setType(report.getType());
reportsVo.add(vo);
});
export(resp, reportsVo);
}
@ApiOperation("测试")
@GetMapping("/test")
public CommonResult<List> test() {
return CommonResult.success(mzZyHisService.getPid());
}
@ApiOperation("测试sql")
@GetMapping("/vmp")
public CommonResult<List> vmp() {
return CommonResult.success(vmp.getList());
}
}

@ -31,5 +31,4 @@ public class TBasicDto {
private String bedNum;
private String isDead;
private String admissDays;
private String motherInpatientNo;
}

@ -1,28 +0,0 @@
package com.docus.server.collection.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @BelongsProject: docus-mzzy-collector
* @BelongsPackage: com.docus.server.collection.entity
* @Author: chierhao
* @CreateTime: 2024-07-31 15:47
* @Description: TODO
* @Version: 1.0
*/
@Data
public class VJsjWzh7addnjreportDto {
@ApiModelProperty(value = "姓名")
private String name;
@ApiModelProperty(value = "住院号")
private String inpatientNo;
@ApiModelProperty(value = "报告开始时间 格式yyyy-MM-dd")
private String startReportDateTime;
@ApiModelProperty(value = "报告结束时间 格式yyyy-MM-dd")
private String endReportDateTime;
}

@ -1,48 +0,0 @@
package com.docus.server.collection.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.BaseRowModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @BelongsProject: docus-mzzy-collector
* @BelongsPackage: com.docus.server.collection.entity
* @Author: chierhao
* @CreateTime: 2024-07-31 15:47
* @Description: TODO
* @Version: 1.0
*/
@Data
public class VJsjWzh7addnjreport extends BaseRowModel {
@ApiModelProperty(value = "姓名")
@ExcelProperty(value = {"姓名"}, index =0 )
private String name;
@ApiModelProperty(value = "住院号")
@ExcelProperty(value = {"住院号"}, index =1 )
private String inpatientNo;
@ApiModelProperty(value = "类型")
@ExcelProperty(value = {"类型"}, index =2 )
private String type;
@ApiModelProperty(value = "申请科室")
@ExcelProperty(value = {"申请科室"}, index =3 )
private String dept;
@ApiModelProperty(value = "项目")
@ExcelProperty(value = {"项目"}, index =4 )
private String item;
@ApiModelProperty(value = "登记时间")
@ExcelProperty(value = {"登记时间"}, index =5 )
private Date registDateTime;
@ApiModelProperty(value = "报告时间")
@ExcelProperty(value = {"报告时间"}, index =6 )
private Date reportDateTime;
}

@ -1,46 +0,0 @@
package com.docus.server.collection.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.BaseRowModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @BelongsProject: docus-mzzy-collector
* @BelongsPackage: com.docus.server.collection.entity
* @Author: chierhao
* @CreateTime: 2024-07-31 15:47
* @Description: TODO
* @Version: 1.0
*/
@Data
public class VJsjWzh7addnjreportVo extends BaseRowModel {
@ApiModelProperty(value = "姓名")
@ExcelProperty(value = {"姓名"}, index =0 )
private String name;
@ApiModelProperty(value = "住院号")
@ExcelProperty(value = {"住院号"}, index =1 )
private String inpatientNo;
@ApiModelProperty(value = "类型")
@ExcelProperty(value = {"类型"}, index =2 )
private String type;
@ApiModelProperty(value = "申请科室")
@ExcelProperty(value = {"申请科室"}, index =3 )
private String dept;
@ApiModelProperty(value = "项目")
@ExcelProperty(value = {"项目"}, index =4 )
private String item;
@ApiModelProperty(value = "登记时间")
@ExcelProperty(value = {"登记时间"}, index =5 )
private String registDateTime;
@ApiModelProperty(value = "报告时间")
@ExcelProperty(value = {"报告时间"}, index =6 )
private String reportDateTime;
}

@ -1,23 +0,0 @@
package com.docus.server.collection.feign.service;
import com.docus.infrastructure.web.api.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* @author ceh
*/
@FeignClient(url = "${docus.url.sign-out-url}",name = "Medicalrecord")
public interface MedicalrecordService {
/*
* @description
* @author chierhao
* @date 2023-10-08 11:00
* @param patientId
* @return: com.docus.infrastructure.web.api.CommonResult
*/
@PostMapping("/basic/tbasic/signOutOrBackRepair")
CommonResult signOutOrBackRepair(@RequestParam(value = "patientId") String patientId);
}

@ -1,11 +1,10 @@
package com.docus.server.collection.httpservices.impl;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil;
import com.docus.core.util.Func;
import com.docus.server.collection.dto.TBasicDto;
import com.docus.server.collection.httpservices.HttpTBasicService;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.http.util.HttpUtil;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@ -29,22 +28,13 @@ public class HttpTBasicServiceImpl implements HttpTBasicService {
try {
//发送get请求获取返货值
log.info("发送请求开始");
HttpRequest get = HttpUtil.createGet(url);
for (Map.Entry<String, String> map : headers.entrySet()) {
get.header(map.getKey(),map.getValue());
}
get.form(params);
get.timeout(60*1000);
String resultStr = get.execute().body();
// String resultStr = HttpUtil.get(url, headers, params);
String resultStr = HttpUtil.get(url, headers, params);
//解析返货值字符串
log.info("解析:"+resultStr);
tBasicDtos=parsing(resultStr);
}catch (Exception e){
log.error(e.getMessage(),e);
log.info("重试");
return getTBasicDto(url,headers,params);
}
return tBasicDtos;
}
@ -89,9 +79,9 @@ public class HttpTBasicServiceImpl implements HttpTBasicService {
//出院科室名称
String disDeptName=map.get("deptName");
//主管医生编号
String attending=map.get("residencyDocCode");
String attending=map.get("directorDocCode");
//主管医生姓名
String attendingName=map.get("residencyDocName");
String attendingName=map.get("directorDocName");
//责任护士编号
String dutyNurse=map.get("dutyNurseName");
//年龄
@ -103,12 +93,10 @@ public class HttpTBasicServiceImpl implements HttpTBasicService {
//住院天数
String admissDays=map.get("inDays");
//是否死亡
String isDead=map.get("outType");
String isDead=map.get("");
//床位号
String bedNum=map.get("bedNo");
String motherInpatientNo=map.get("motherInpatientNo");
TBasicDto tBasicDto=new TBasicDto();
tBasicDto.setAdmissDays(admissDays);
tBasicDto.setIsDead(isDead);
@ -129,7 +117,6 @@ public class HttpTBasicServiceImpl implements HttpTBasicService {
tBasicDto.setName(name);
tBasicDto.setInpatientNo(inpatientNo);
tBasicDto.setDutyNurse(dutyNurse);
tBasicDto.setMotherInpatientNo(motherInpatientNo);
tBasicDtos.add(tBasicDto);
}

@ -91,10 +91,4 @@ public class TBasic implements Serializable {
@ApiModelProperty(value = "责任护士")
private String dutyNurse;
@ApiModelProperty(value = "是否其他数据 0否1是婴儿2医疗保险类别是家庭病床")
private Integer isOther;
@ApiModelProperty(value = "婴儿母亲住院流水号")
private String motherInpatientNo;
}

@ -23,8 +23,4 @@ public interface TBasicMapper{
Integer update(@Param("tBasic") TBasic tBasic);
String getPatientIdByJzh(@Param("jzh") String jzh);
List<String> getPatientIdByMomJzh(@Param("momJzh") String momJzh);
List<String> getPid();
}

@ -1,21 +0,0 @@
package com.docus.server.collection.infrastructure.dao.sqlserver;
import com.docus.server.collection.dto.VJsjWzh7addnjreportDto;
import com.docus.server.collection.entity.VJsjWzh7addnjreport;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @BelongsProject: docus-mzzy-collector
* @BelongsPackage: com.docus.server.collection.infrastructure.dao.mapper.sqlserver
* @Author: chierhao
* @CreateTime: 2024-07-31 14:31
* @Description: TODO
* @Version: 1.0
*/
public interface VJsjWzh7addnjreportMapper {
List<String> getList();
List<VJsjWzh7addnjreport> getReport(@Param("dto") VJsjWzh7addnjreportDto dto);
}

@ -1,9 +1,7 @@
package com.docus.server.collection.receiver;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.docus.server.collection.dto.DeptDto;
import com.docus.server.collection.rpc.MzZyyRocCurrWebCommonRpc;
import com.docus.server.collection.dto.UserDto;
import com.docus.server.collection.service.IPowerDeptService;
import com.docus.server.collection.service.IPowerUserService;
import com.docus.server.collection.xml.parsers.MzZyParser;
@ -24,61 +22,37 @@ public class MzZyMqReceiver {
private IPowerUserService powerUserService;
@Autowired
private IPowerDeptService powerDeptService;
@Autowired
private MzZyyRocCurrWebCommonRpc mzZyyRocCurrWebCommonRpc;
/**
*
*
* @param message
*/
@JmsIbmListener(destination = "TJ_createDepartment")
public void revCreateDepartment(String message) {
log.info("注册科室 队列接收信息:{}", message);
public void revCreateDepartment(String message){
log.info("注册科室 队列接收信息:{}",message);
try {
DeptDto deptDto = MzZyParser.parseCreateDept(message);
// 只保存住院的,如果接口异常也保存
JSONObject jsonObject = mzZyyRocCurrWebCommonRpc.queryDept(deptDto.getDeptCode(), "I");
if (jsonObject == null) {
powerDeptService.register(deptDto);
return;
}
boolean success = "200".equals(jsonObject.getString("code"));
JSONArray data = jsonObject.getJSONArray("data");
if (success && data.size() > 0) {
DeptDto deptDto= MzZyParser.parseCreateDept(message);
powerDeptService.register(deptDto);
}catch (Exception ex){
log.error("处理注册科室 队列接收信息:{},出现异常:{}",message,ex.getMessage());
}
} catch (Exception ex) {
log.error("处理注册科室 队列接收信息:{},出现异常:{}", message, ex.getMessage());
}
}
/**
*
*
* @param message
*/
@JmsIbmListener(destination = "TJ_updateDepartment")
public void revUpdateDepartment(String message) {
log.info("变更科室 队列接收信息:{}", message);
public void revUpdateDepartment(String message){
log.info("变更科室 队列接收信息:{}",message);
try {
DeptDto deptDto = MzZyParser.parseUpdateDept(message);
// 只保存住院的,如果接口异常也保存
JSONObject jsonObject = mzZyyRocCurrWebCommonRpc.queryDept(deptDto.getDeptCode(), "I");
if (jsonObject == null) {
DeptDto deptDto=MzZyParser.parseUpdateDept(message);
powerDeptService.register(deptDto);
return;
}
boolean success = "200".equals(jsonObject.getString("code"));
JSONArray data = jsonObject.getJSONArray("data");
if (success && data.size() > 0) {
powerDeptService.register(deptDto);
}
} catch (Exception ex) {
log.error("处理变更科室 队列接收信息:{},出现异常:{}", message, ex.getMessage());
}catch (Exception ex){
log.error("处理变更科室 队列接收信息:{},出现异常:{}",message,ex.getMessage());
}
}
@ -86,40 +60,34 @@ public class MzZyMqReceiver {
/**
*
*
* @param message
*/
@JmsIbmListener(destination = "TJ_createPractitioner")
public void revCreatePractitioner(String message) {
log.info("人员注册 队列接收信息:{}", message);
/*
public void revCreatePractitioner(String message){
log.info("人员注册 队列接收信息:{}",message);
try {
UserDto userDto=MzZyParser.parseCreateUser(message);
powerUserService.register(userDto);
}catch (Exception ex){
log.error("处理人员注册 队列接收信息:{},出现异常:{}",message,ex.getMessage());
}
*/
}
/**
*
*
* @param message
*/
@JmsIbmListener(destination = "TJ_updatePractitioner")
public void revUpdatePractitioner(String message) {
log.info("人员变更 队列接收信息:{}", message);
/*
public void revUpdatePractitioner(String message){
log.info("人员变更 队列接收信息:{}",message);
try {
UserDto userDto=MzZyParser.parseUpdateUser(message);
powerUserService.register(userDto);
}catch (Exception ex){
log.error("处理人员注册 队列接收信息:{},出现异常:{}",message,ex.getMessage());
}
*/
}
}

@ -1,18 +0,0 @@
package com.docus.server.collection.rpc;
import com.alibaba.fastjson.JSONObject;
/**
* roc curr-web api
* @author YongBin Wen
* @date 2025/2/8 10:04
*/
public interface MzZyyRocCurrWebCommonRpc {
/**
*
* @param deptCode
* @param deptType C I , F L (logistics) PI T O D P N
* @return
*/
JSONObject queryDept(String deptCode, String deptType);
}

@ -1,50 +0,0 @@
package com.docus.server.collection.rpc.impl;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject;
import com.docus.server.collection.rpc.MzZyyRocCurrWebCommonRpc;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
/**
* roc curr-web api
*
* @author YongBin Wen
* @date 2025/2/8 10:04
*/
@Service
@Slf4j
public class MzZyyRocCurrWebCommonRpcImpl implements MzZyyRocCurrWebCommonRpc {
@Value("${mzzyy.url.roc.curr-web: http://199.168.91.110:7800/roc/curr-web}")
private String rocCurrWebUrl;
@Value("${mzzyy.roc-domain: WZHBA}")
private String rocDomain;
@Value("${mzzyy.roc-key: b91b0ac7-665f-4874-a282-2f5511a44263}")
private String rocKey;
@Override
public JSONObject queryDept(String deptCode, String deptType) {
final String path = "/api/v1/common/dept/query";
final String url = rocCurrWebUrl + path;
Map<String, Object> paramMap = new HashMap<>(2);
paramMap.put("deptCode", deptCode);
paramMap.put("deptType", deptType);
try {
String result = HttpUtil.createGet(url)
.header("Content-Type", "application/json")
.header("domain", rocDomain)
.header("key", rocKey)
.form(paramMap)
.timeout(60 * 1000)
.execute().body();
return JSONObject.parseObject(result);
} catch (Exception ex) {
log.error(url + " 请求出错了," + ex.getMessage(), ex);
return null;
}
}
}

@ -2,8 +2,6 @@ package com.docus.server.collection.service;
import com.docus.server.collection.dto.FirstPageCheckoutInDTO;
import java.util.List;
/**
* @author wyb
*/
@ -14,7 +12,4 @@ public interface MzZyHisService {
* @param checkoutInDTO
*/
void firstPageCheckout(FirstPageCheckoutInDTO checkoutInDTO);
List<String> getPid();
}

@ -1,6 +1,7 @@
package com.docus.server.collection.service.impl;
import com.docus.core.util.Func;
import com.docus.infrastructure.core.exception.BaseException;
import com.docus.infrastructure.web.api.CommonResult;
import com.docus.infrastructure.web.api.ResultCode;
import com.docus.server.collection.config.SystemMappingConfig;
@ -10,7 +11,6 @@ import com.docus.server.collection.entity.CollectSysDictionary;
import com.docus.server.collection.enums.FileSyncMethod;
import com.docus.server.collection.feign.dto.CompensateTasRequest;
import com.docus.server.collection.feign.service.CollectTaskService;
import com.docus.server.collection.feign.service.MedicalrecordService;
import com.docus.server.collection.infrastructure.dao.mapper.CollectSysDictionaryMapper;
import com.docus.server.collection.infrastructure.dao.mapper.TBasicMapper;
import com.docus.server.collection.service.MzZyHisService;
@ -37,22 +37,20 @@ public class MzZyHisServiceImpl implements MzZyHisService {
@Resource
private TBasicMapper tBasicMapper;
@Resource
private MedicalrecordService medicalrecordService;
@Override
public void firstPageCheckout(FirstPageCheckoutInDTO dto) {
System.out.println(dto);
PatientInfoDTO patientInfo = dto.getPatientInfo();
//验证基础数据是否存在
String patientId = tBasicMapper.getPatientIdByJzh(patientInfo.getInpatientNo());
if (Func.isBlank(patientId)) {
throw new RuntimeException("系统未找到患者数据,住院流水号:" + patientInfo.getInpatientNo());
throw new BaseException("系统未找到患者数据,住院流水号:" + patientInfo.getInpatientNo());
}
// 取得映射结果后的无纸化系统id
List<String> collectorIds = systemMappingCollectorIds(dto);
// 进行任务补偿
CompensateTasRequest request = new CompensateTasRequest();
request.setPriority(3);
request.setPriority(4);
request.setPatientIds(Collections.singletonList(patientId));
request.setCollectorIds(collectorIds);
CommonResult<String> commonResult = collectTaskService.compensateTask(request);
@ -60,37 +58,6 @@ public class MzZyHisServiceImpl implements MzZyHisService {
if (commonResult.getCode().equals(ResultCode.FAILED.getCode())) {
throw new RuntimeException(commonResult.getMsg());
}
CommonResult result = medicalrecordService.signOutOrBackRepair(patientId);
// 抛出异常,进行参数持久
if (result.getCode().equals(ResultCode.FAILED.getCode())) {
throw new RuntimeException(commonResult.getMsg());
}
babyTaskCompensate(patientInfo.getInpatientNo(),collectorIds);
}
@Override
public List<String> getPid() {
return tBasicMapper.getPid();
}
/**
*
* @param momJzh
* @param collectorIds id
*/
private void babyTaskCompensate(String momJzh, List<String> collectorIds) {
List<String> babyPatientIds=tBasicMapper.getPatientIdByMomJzh(momJzh);
if(Func.isNotEmpty(babyPatientIds)){
// 进行任务补偿
CompensateTasRequest request = new CompensateTasRequest();
request.setPatientIds(babyPatientIds);
request.setPriority(2);
request.setCollectorIds(collectorIds);
collectTaskService.compensateTask(request);
for (String babyPatientId : babyPatientIds) {
medicalrecordService.signOutOrBackRepair(babyPatientId);
}
}
}
private List<String> systemMappingCollectorIds(FirstPageCheckoutInDTO dto) {

@ -3,7 +3,6 @@ package com.docus.server.collection.service.impl;
import cn.hutool.core.util.NumberUtil;
import com.docus.core.util.DateUtil;
import com.docus.core.util.Func;
import com.docus.core.util.ObjectUtil;
import com.docus.infrastructure.redis.service.IdService;
import com.docus.server.collection.dto.TBasicDto;
import com.docus.server.collection.httpservices.HttpTBasicService;
@ -115,22 +114,12 @@ public class TBasicServiceImpl implements ITBasicService {
//判断jzh是否重复
Integer num = tBasicMapper.selectOne(tBasicDto.getJzh());
//判断是否血液净化的,是则跳过
if(ObjectUtil.isNotEmpty(tBasicDto.getInpatientNo())&&(tBasicDto.getInpatientNo().contains("x")||tBasicDto.getInpatientNo().contains("X"))){
continue;
}
//判断是否C的是则跳过
if(ObjectUtil.isNotEmpty(tBasicDto.getInpatientNo())&&(tBasicDto.getInpatientNo().contains("c")||tBasicDto.getInpatientNo().contains("C"))){
continue;
}
Long patientId = idService.getDateSeq();
//数据类型转化,格式处理
Date admissDate = null;
if(Func.isNotEmpty(tBasicDto.getAdmissDate())){
admissDate=Func.parseDate(tBasicDto.getAdmissDate(), DateUtil.PATTERN_DATETIME);
}else {
continue;
}
@ -161,7 +150,7 @@ public class TBasicServiceImpl implements ITBasicService {
String isDeadStr = tBasicDto.getIsDead();
Integer isDead=0;
if("5".equals(isDeadStr)){
if("死亡".equals(isDeadStr)){
isDead=1;
}
@ -201,13 +190,6 @@ public class TBasicServiceImpl implements ITBasicService {
tBasic.setDisDept(tBasicDto.getDisDept());
tBasic.setDisDeptName(tBasicDto.getDisDeptName());
tBasic.setCreateTime(DateUtil.now());
tBasic.setMotherInpatientNo(tBasicDto.getMotherInpatientNo());
//判断是否B开头
if(ObjectUtil.isNotEmpty(tBasicDto.getInpatientNo())&&(tBasicDto.getInpatientNo().contains("B")||tBasicDto.getInpatientNo().contains("b"))){
tBasic.setIsOther(1);
}else {
tBasic.setIsOther(0);
}
if (num>0) {
log.info("更新,jzh为"+tBasic.getJzh());

@ -6,19 +6,27 @@ spring:
application:
name: @artifactId@
datasource:
mysql-docus:
url: jdbc:log4jdbc:mysql://db.docus.cn:3306/docus_archivefile?autoReconnect=true&allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
username: docus
password: docus702
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
type: com.alibaba.druid.pool.DruidDataSource
sqlserver-docus:
url: jdbc:sqlserver://192.168.16.103\DOCUS;DatabaseName=zj_power
username: sa
password: docus702
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
type: com.alibaba.druid.pool.DruidDataSource
# 初始化配置
initial-size: 3
# 最小连接数
min-idle: 3
# 最大连接数
max-active: 15
# 获取连接超 时时间
max-wait: 5000
# 连接有效性检测时间
time-between-eviction-runs-millis: 90000
# 最大空闲时间
min-evictable-idle-time-millis: 1800000
test-while-idle: true
test-on-borrow: false
test-on-return: false
validation-query: select 1
redis:
host: redis.docus.cn
@ -44,8 +52,6 @@ docus:
url:
# 采集任务补偿地址
compensate-task-url: http://localhost:9295/
# 签出调用
sign-out-url: http://localhost:9102/
mybatis-plus:
configuration:
@ -72,12 +78,7 @@ xxl:
TBasic:
url: http://localhost:8989/tbasic
mzzyy:
roc-domain: WZHBA
roc-key: b91b0ac7-665f-4874-a282-2f5511a44263
url:
roc:
curr-web: http://199.168.91.110:7800/roc/curr-web
# com.ibm.mq连接方式集群模式需要配置两个地址 本地测试
#ibm:

@ -25,9 +25,7 @@
`dis_date`,
`dis_dept_name`,
`attending_name`,
`jzh`,
`is_other`,
`mother_inpatient_no`)
`jzh`)
VALUES
<foreach collection="tBasicList" item="tBasic" separator=",">
(#{tBasic.admissDept},
@ -50,9 +48,7 @@
#{tBasic.disDate},
#{tBasic.disDeptName},
#{tBasic.attendingName},
#{tBasic.jzh},
#{tBasic.isOther},
#{tBasic.motherInpatientNo})
#{tBasic.jzh})
</foreach>
</insert>
@ -60,7 +56,7 @@
UPDATE `docus_medicalrecord`.`t_basic` SET
`admiss_dept` = #{tBasic.admissDept},
`attending` = #{tBasic.attending},
`update_time` = #{tBasic.createTime},
`create_time` = #{tBasic.createTime},
`admiss_days` = #{tBasic.admissDays},
`is_dead` = #{tBasic.isDead},
`sex_name` = #{tBasic.sexName},
@ -75,9 +71,7 @@
`admiss_dept_name` = #{tBasic.admissDeptName},
`dis_date` = #{tBasic.disDate},
`dis_dept_name` = #{tBasic.disDeptName},
`attending_name` = #{tBasic.attendingName},
`is_other` = #{tBasic.isOther},
`mother_inpatient_no`= #{tBasic.motherInpatientNo}
`attending_name` = #{tBasic.attendingName}
WHERE
`jzh` = #{tBasic.jzh}
</update>
@ -88,10 +82,5 @@
<select id="getPatientIdByJzh" resultType="java.lang.String">
select patient_id from `docus_medicalrecord`.`t_basic` where jzh=#{jzh}
</select>
<select id="getPatientIdByMomJzh" resultType="java.lang.String">
select patient_id from `docus_medicalrecord`.`t_basic` where mother_inpatient_no=#{momJzh}
</select>
<select id="getPid" resultType="java.lang.String">
select patient_id from `docus_medicalrecord`.`t_basic` limit 10
</select>
</mapper>

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.docus.server.collection.infrastructure.dao.sqlserver.VJsjWzh7addnjreportMapper">
<select id="getList" resultType="java.lang.String">
SELECT 姓名
FROM dbo.v_jsj_wzh7addnjreport;
</select>
<select id="getReport" resultType="com.docus.server.collection.entity.VJsjWzh7addnjreport">
SELECT 姓名 name, 住院号 inpatientNo, 类型 type, 申请科室 dept, 项目 item, RegistDateTime registDateTime, ReportDateTime reportDateTime
FROM dbo.v_jsj_wzh7addnjreport
where
1=1
<if test="dto.startReportDateTime!=null and dto.startReportDateTime!='' and dto.endReportDateTime!=null and dto.endReportDateTime!=''">
and convert(varchar(10),ReportDateTime,120)between
#{dto.startReportDateTime} and #{dto.endReportDateTime}
</if>
<if test="dto.name!=null and dto.name!=''">
and 姓名 like CONCAT('%',#{dto.name},'%')
</if>
<if test="dto.inpatientNo!=null and dto.inpatientNo!=''">
and 住院号 like CONCAT('%',#{dto.inpatientNo},'%')
</if>
</select>
</mapper>
Loading…
Cancel
Save