Merge remote-tracking branch 'origin/master'

This commit is contained in:
tangw 2025-11-14 19:22:43 +08:00
commit 3494271727
26 changed files with 1022 additions and 155 deletions

View File

@ -28,4 +28,21 @@ public class LisinterfaceNameConstants {
* 撤销报告-0
*/
public static final String REPORTCANCAL = "0";
//区域lis接口
/**
* 获取门诊申请单
*/
public static final String GET_REG_OUTPATIENT_INFO = "GET_REG_OUTPATIENT_INFO";
/**
* 获取住院申请单
*/
public static final String GET_REG_INP_INFO = "GET_REG_INP_INFO";
/**
* 修改状态接口
*/
//public static final String MODIFY_REG_STATUS = "MODIFY_REG_STATUS";
}

View File

@ -0,0 +1,8 @@
package com.czlis.interfaceCommon.mapper;
import com.czlis.common.core.domain.entity.SysUser;
public interface SysUserCommMapper {
SysUser getSysUserOne(String user_name);
}

View File

@ -0,0 +1,29 @@
package com.czlis.interfaceCommon.pojo.inter.reg;
import cn.hutool.json.JSONUtil;
import com.czlis.interfaceCommon.service.LisInterfaceType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class GetRegInpInfo implements LisInterfaceType {
private String dept;
private String stime;
private String etime;
private String userId;
private String bz;
private String yljg;
private String ip;
@Override
public String serializationJson() {
return JSONUtil.toJsonStr(this);
}
}

View File

@ -0,0 +1,25 @@
package com.czlis.interfaceCommon.pojo.inter.reg;
import cn.hutool.json.JSONUtil;
import com.czlis.interfaceCommon.service.LisInterfaceType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class GetRegOutPatientInfo implements LisInterfaceType {
private String yljg;
private String brdh;
private String userid;
private String stime;
private String etime;
private String bz1;
private String ip;
@Override
public String serializationJson() {
return JSONUtil.toJsonStr(this);
}
}

View File

@ -1,5 +1,6 @@
package com.czlis.interfaceCommon.utils;
import com.czlis.common.core.domain.entity.SysUser;
import com.czlis.common.core.domain.entity.lis.*;
import com.czlis.common.utils.ComDictUtils;
import com.czlis.common.utils.ComOptionUtils;
@ -87,6 +88,9 @@ public class CommonUtil {
LabInputmdlMapper labInputmdlMapper;
@Autowired
LabInputmdlDetailMapper labInputmdlDetailMapper;
@Autowired
SysUserCommMapper sysUserCommMapper;
//====检验主表操作方法集合===
public LabPat getLabPatOne(Date jyrq, String yq, String ybh) {
return labPatMapper.getLabPatOne(jyrq, yq, ybh);
@ -668,4 +672,8 @@ public class CommonUtil {
public String getLocalconfig(String smac) {
return comLocalconfigMapper.getLocalconfig(smac);
}
public SysUser getSysUserOne(String user_name){
return sysUserCommMapper.getSysUserOne(user_name);
}
}

View File

@ -0,0 +1,59 @@
<?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.czlis.interfaceCommon.mapper.SysUserCommMapper">
<resultMap type="SysUser" id="SysUserResult">
<id property="userId" column="user_id" />
<result property="deptId" column="dept_id" />
<result property="userName" column="user_name" />
<result property="nickName" column="nick_name" />
<result property="email" column="email" />
<result property="phonenumber" column="phonenumber" />
<result property="sex" column="sex" />
<result property="avatar" column="avatar" />
<result property="password" column="password" />
<result property="status" column="status" />
<result property="delFlag" column="del_flag" />
<result property="loginIp" column="login_ip" />
<result property="loginDate" column="login_date" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="vshisuser" column="vshisuser" />
<result property="vshisuser1" column="vshisuser1" />
<result property="vshisuser2" column="vshisuser2" />
<result property="yljg" column="yljg" />
<result property="sn" column="sn" />
<result property="snid" column="snid" />
<result property="signCert" column="signCert" />
<association property="dept" javaType="SysDept" resultMap="deptResult" />
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
</resultMap>
<resultMap id="deptResult" type="SysDept">
<id property="deptId" column="dept_id" />
<result property="parentId" column="parent_id" />
<result property="deptName" column="dept_name" />
<result property="ancestors" column="ancestors" />
<result property="orderNum" column="order_num" />
<result property="leader" column="leader" />
<result property="status" column="dept_status" />
</resultMap>
<resultMap id="RoleResult" type="SysRole">
<id property="roleId" column="role_id" />
<result property="roleName" column="role_name" />
<result property="roleKey" column="role_key" />
<result property="roleSort" column="role_sort" />
<result property="dataScope" column="data_scope" />
<result property="status" column="role_status" />
</resultMap>
<select id="getSysUserOne" parameterType="String" resultMap="SysUserResult">
select * from sys_user where user_name = #{user_name}
</select>
</mapper>

View File

@ -36,15 +36,15 @@ import java.util.stream.Collectors;
@Slf4j
public class ApplicationConfig {
@Autowired
private ComDictMapper comDictMapper;
// @Autowired
// private ComDictMapper comDictMapper;
@Autowired
private SysConfigServiceImpl sysConfigService;
@Autowired
private SysJobServiceImpl sysJobService;
//选择性提供缓存的字典类别
private List<String> list = Arrays.asList("GROUP","AU","BT","DG", "DP", "FT", "HOS","LG","PT","PW","SRD","SX","UT","CM","VF");
//private List<String> list = Arrays.asList("GROUP","AU","BT","DG", "DP", "FT", "HOS","LG","PT","PW","SRD","SX","UT","CM","VF");
/**
* 时区配置
@ -57,24 +57,24 @@ public class ApplicationConfig {
/**
* 加载字典缓存数据
*/
@Bean
public void loadingDictCache() {
TimerTask task = new TimerTask(){
@Override
public void run() {
try {
//清空所有com_dict缓存
ComDictUtils.clearDictCache();
List<ComDict> comDictList=comDictMapper.getComDictListin(list);
list.stream().forEach(zdlb -> ComDictUtils.setDictCache(zdlb,comDictList.stream().filter(lis->zdlb.equals(lis.getZdlb())).collect(Collectors.toList())));
} catch (Exception e) {
log.error("获取lis代码字典失败,异步执行{}方法失败",this, e);
}
}
};
AsyncManager.me().execute(task);
}
// @Bean
// public void loadingDictCache() {
// TimerTask task = new TimerTask(){
// @Override
// public void run() {
// try {
// //清空所有com_dict缓存
// ComDictUtils.clearDictCache();
// List<ComDict> comDictList=comDictMapper.getComDictListin(list);
// list.stream().forEach(zdlb -> ComDictUtils.setDictCache(zdlb,comDictList.stream().filter(lis->zdlb.equals(lis.getZdlb())).collect(Collectors.toList())));
// } catch (Exception e) {
// log.error("获取lis代码字典失败,异步执行{}方法失败",this, e);
// }
// }
// };
// AsyncManager.me().execute(task);
//
// }
/**
* 加载系统配置缓存

View File

@ -1358,7 +1358,7 @@ if not exists(select 1 from dbo.sys_config where config_id = '3' )
if not exists(select 1 from dbo.sys_config where config_id = '4' )
begin
INSERT INTO dbo.sys_config (config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark)
VALUES (4, '账号自助-验证码开关', 'sys.account.captchaEnabled', 'true', 'Y', 'admin', '2025-05-13 11:40:21.12', '', NULL, '是否开启验证码功能(true开启,false关闭)')
VALUES (4, '账号自助-验证码开关', 'sys.account.captchaEnabled', 'false', 'Y', 'admin', '2025-05-13 11:40:21.12', '', NULL, '是否开启验证码功能(true开启,false关闭)')
end

View File

@ -94,6 +94,11 @@ if not exists(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'com_
alter table com_opt add status varchar(10)
end
if not exists(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'com_opt' AND COLUMN_NAME = 'lx')
begin
alter table com_opt add lx varchar(10)
end
if not exists(select 1 from com_opt where yq = '' and xxdh = 'A5MERGEA4')
begin
insert into com_opt(yq,xxdh,xxlb,xxqz,bz,lx) values('','A5MERGEA4','SYS','0','A5报告单是否合并成A4打印','1')
@ -312,6 +317,25 @@ if not exists(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'reg_
alter table reg_TransitSample add checkPUR varchar(1000)
end
if not exists(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'reg_TransitSample' and COLUMN_NAME = 'BackReasons')
begin
alter table reg_TransitSample add BackReasons varchar(500)
end
if not exists(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'reg_TransitSample' and COLUMN_NAME = 'BackUserCode')
begin
alter table reg_TransitSample add BackUserCode varchar(50)
end
if not exists(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'reg_TransitSample' and COLUMN_NAME = 'BackUserName')
begin
alter table reg_TransitSample add BackUserName varchar(50)
end
if not exists(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'reg_TransitSample' and COLUMN_NAME = 'BackTime')
begin
alter table reg_TransitSample add BackTime datetime
end
if not exists(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'req_dict')
begin

View File

@ -0,0 +1,70 @@
CREATE VIEW [dbo].[web_fs_printReport]
AS
select isnull((select bz from com_dict where zdlb='HOS' AND zddh=a.yljg),a.yljg) yljg,a.jyrq,
--a.yq,
z.yqmc as yq,
a.ybh ,a.brxm,
--a.brdh,
e.bz1 brdh,
a.ch,
--a.jymd
e.jymd as jymd
,a.zd,isnull(e.sqsj,a.sqsj) as sqsj,isnull(e.cysj,a.cyrq) as cyrq,isnull(e.jssj,a.sqsj) as lastdt,a.confirmdt,a.confirmer,a.sqh,
(CONVERT(varchar(12), a.jyrq, 112)+'_'+rtrim(a.yq)+'_'+a.ybh) as bgdh,y.xmdh,y.csjg,y.refs,y.dw,y.result_flag,z.yqmc,z.yqdl,
(select c.xmmc from xm_info c where c.yq=a.yq and c.xmdh=y.xmdh) as xmmc,
(CONVERT(varchar(10),a.nl)+(select b.zdmc from com_dict b where zdlb='AU' and a.nldw=b.zddh)) as nl,
(select b.zdmc from com_dict b where zdlb='DP' and a.ksdh=b.zddh) as ksname,
(select b.zdmc from com_dict b where zdlb='PT' and a.brly=b.zddh) as brlyname,
(CASE WHEN a.brxb = '1' THEN 'ÄÐ' WHEN a.brxb = '2' THEN 'Å®' ELSE 'ÆäËû' END) as brxbname,
isnull((select b.zdmc from com_dict b where zdlb='BT' and a.yblx=b.zddh),a.yblx) as yblxname,
isnull((select b.zdmc from com_dict b where zdlb='SRD' and a.sjys=b.zddh),a.sjys) as sjysname,
b.dyxh,
(case y.result_flag when 'Q' then '+' when 'L' THEN '¡ý' WHEN 'H' then '¡ü' else '' end) flag,
a.yhdh AS lastuser,
(select dzqm from com_usr c where a.confirmer=c.yhdh) confirmerpic,
(select dzqm from com_usr c where a.yhdh=c.yhdh) as lastpic,a.bz AS bz
from lab_pat a left join lab_reqmain e on a.sqh=e.sqh,lab_result y,lab_instr z ,xm_info b
where y.yq=b.yq and y.xmdh=b.xmdh and a.jyrq=y.jyrq
and a.yq=y.yq and y.ybh=a.ybh and a.brxm is not null and a.yq=z.yq
and a.brly='3'
and a.jyrq >getdate()-360
union all
select isnull((select bz from com_dict where zdlb='HOS' AND zddh=a.yljg),a.yljg) yljg,a.jyrq,
--a.yq,
z.yqmc as yq,
a.ybh ,a.brxm,
--a.brdh,
a.brdh brdh,
a.ch,
--a.jymd
e.jymd as jymd
,a.zd,isnull(e.sqsj,a.sqsj) as sqsj,isnull(e.cysj,a.cyrq) as cyrq,isnull(e.jssj,a.sqsj) as lastdt,a.confirmdt,a.confirmer,a.sqh,
(CONVERT(varchar(12), a.jyrq, 112)+'_'+rtrim(a.yq)+'_'+a.ybh) as bgdh,y.xmdh,y.csjg,y.refs,y.dw,y.result_flag,z.yqmc,z.yqdl,
(select c.xmmc from xm_info c where c.yq=a.yq and c.xmdh=y.xmdh) as xmmc,
(CONVERT(varchar(10),a.nl)+(select b.zdmc from com_dict b where zdlb='AU' and a.nldw=b.zddh)) as nl,
(select b.zdmc from com_dict b where zdlb='DP' and a.ksdh=b.zddh) as ksname,
(select b.zdmc from com_dict b where zdlb='PT' and a.brly=b.zddh) as brlyname,
(CASE WHEN a.brxb = '1' THEN 'ÄÐ' WHEN a.brxb = '2' THEN 'Å®' ELSE 'ÆäËû' END) as brxbname,
isnull((select b.zdmc from com_dict b where zdlb='BT' and a.yblx=b.zddh),a.yblx) as yblxname,
isnull((select b.zdmc from com_dict b where zdlb='SRD' and a.sjys=b.zddh),a.sjys) as sjysname,
b.dyxh,
(case y.result_flag when 'Q' then '+' when 'L' THEN '¡ý' WHEN 'H' then '¡ü' else '' end) flag,
a.yhdh AS lastuser,
(select dzqm from com_usr c where a.confirmer=c.yhdh) confirmerpic,
(select dzqm from com_usr c where a.yhdh=c.yhdh) as lastpic,a.bz AS bz
from lab_pat a left join lab_reqmain e on a.sqh=e.sqh,lab_result y,lab_instr z ,xm_info b
where y.yq=b.yq and y.xmdh=b.xmdh and a.jyrq=y.jyrq
and a.yq=y.yq and y.ybh=a.ybh and a.brxm is not null and a.yq=z.yq
and a.brly='1'
and a.jyrq >getdate()-360
GO

View File

@ -0,0 +1,77 @@
/****** Object: View [dbo].[web_getReportsList] Script Date: 11/14/2025 17:09:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[web_getReportsList]
AS
--select isnull((select bz from com_dict where zdlb='HOS' AND zddh=a.yljg),a.yljg) yljg, a.jyrq, CONVERT(varchar(100), a.jyrq, 23) as jyrqname,a.yq,a.ybh,a.yblx,a.brxm,
----a.brdh,
--(case when a.brly = '1' then a.brdh else isnull(e.bz1,a.brdh) end ) brdh,
--a.ch,a.jymd,a.zd,a.sqh,a.ksdh,isnull(a.jzbz,'0') as jzbz,isnull(a.alarmflag,'0') as alarmflag,isnull(a.dybz,'0') as dybz,
--(convert(varchar(10),a.nl)+(select b.zdmc from com_dict b where zdlb='AU' and a.nldw=b.zddh)) as nl,
--(select b.zdmc from com_dict b where zdlb='DP' and a.ksdh=b.zddh) as ksname,
--(select b.zdmc from com_dict b where zdlb='PT' and a.brly=b.zddh) as brlyname,
--(CASE WHEN a.brxb = '1' THEN 'ÄÐ' WHEN a.brxb = '2' THEN 'Å®' ELSE 'ÆäËû' END) as brxbname,
--isnull((select b.zdmc from com_dict b where zdlb='BT' and a.yblx=b.zddh),a.yblx) as yblxname,
--isnull((select b.zdmc from com_dict b where zdlb='SRD' and a.sjys=b.zddh),a.sjys) as sjysname,
--z.yqmc,z.yqdl from lab_pat a left join lab_reqmain e on a.sqh=e.sqh,lab_instr z
--where a.brxm<>'' and a.yq=z.yq and --a.jymd<>''
-- jgbz ='2'
select c.sqsj, isnull((select bz from com_dict where zdlb='HOS' AND zddh=a.yljg),a.yljg) yljg, a.jyrq, CONVERT(varchar(100), a.jyrq, 23) as jyrqname,a.yq,a.ybh,a.yblx,a.brxm,
a.brdh,c.cysj,c.zxsj,c.bbsjsj,c.jssj,a.confirmdt as confirmtime,
a.ch,a.jymd,a.zd,a.sqh,a.ksdh,isnull(a.jzbz,'0') as jzbz,isnull(a.alarmflag,'0') as alarmflag,isnull(a.dybz,'0') as dybz,
(convert(varchar(10),a.nl)+(select b.zdmc from com_dict b where zdlb='AU' and a.nldw=b.zddh)) as nl,
(select b.zdmc from com_dict b where zdlb='DP' and a.ksdh=b.zddh) as ksname,
(select b.zdmc from com_dict b where zdlb='PT' and a.brly=b.zddh) as brlyname,
(CASE WHEN a.brxb = '1' THEN 'ÄÐ' WHEN a.brxb = '2' THEN 'Å®' ELSE 'ÆäËû' END) as brxbname,
isnull((select b.zdmc from com_dict b where zdlb='BT' and a.yblx=b.zddh),a.yblx) as yblxname,
isnull((select b.zdmc from com_dict b where zdlb='SRD' and a.sjys=b.zddh),a.sjys) as sjysname,
z.yqmc,z.yqdl,dysj from lab_pat a ,lab_instr z ,lab_reqmain c
where a.brxm<>'' and a.yq=z.yq and --a.jymd<>''
jgbz ='2'
and a.brly='1' and c.sqh = a.sqh
union all
select e.sqsj, isnull((select bz from com_dict where zdlb='HOS' AND zddh=a.yljg),a.yljg) yljg, a.jyrq, CONVERT(varchar(100), a.jyrq, 23) as jyrqname,a.yq,a.ybh,a.yblx,a.brxm,
--a.brdh,
isnull(e.bz1,e.brdh) brdh,e.cysj,e.zxsj,e.bbsjsj,e.jssj,a.confirmdt as confirmtime,
a.ch,a.jymd,a.zd,a.sqh,a.ksdh,isnull(a.jzbz,'0') as jzbz,isnull(a.alarmflag,'0') as alarmflag,isnull(a.dybz,'0') as dybz,
(convert(varchar(10),a.nl)+(select b.zdmc from com_dict b where zdlb='AU' and a.nldw=b.zddh)) as nl,
(select b.zdmc from com_dict b where zdlb='DP' and a.ksdh=b.zddh) as ksname,
(select b.zdmc from com_dict b where zdlb='PT' and a.brly=b.zddh) as brlyname,
(CASE WHEN a.brxb = '1' THEN 'ÄÐ' WHEN a.brxb = '2' THEN 'Å®' ELSE 'ÆäËû' END) as brxbname,
isnull((select b.zdmc from com_dict b where zdlb='BT' and a.yblx=b.zddh),a.yblx) as yblxname,
isnull((select b.zdmc from com_dict b where zdlb='SRD' and a.sjys=b.zddh),a.sjys) as sjysname,
z.yqmc,z.yqdl,a.dysj dysj from lab_pat a join lab_reqmain e on a.sqh=e.sqh,lab_instr z
where a.brxm<>'' and a.yq=z.yq and --a.jymd<>''
jgbz ='2'
and a.brly<>'1'
GO

View File

@ -0,0 +1,40 @@
CREATE view [dbo].[web_getresultmed]
as
select (CONVERT(varchar(12), a.jyrq, 112)+'_'+rtrim(c.yq)+'_'+a.ybh) as bgdh,
--(case when a.brly = '1' then a.brdh else isnull(g.bz1,a.brdh) end ) brdh ,
a.brdh as brdh,
c.xmmc,
e.ywmc,
d.*,
(select textresult from lab_result where yq=d.yq and ybh=d.ybh and jyrq=d.jyrq and xmdh=d.xmdh) textresult1
from lab_Pat a --left join lab_result b on a.yq=b.yq and a.ybh=b.ybh and a.jyrq=b.jyrq and b.xmdh=d.xmdh
join lab_resultmed d on a.yq=d.yq and a.ybh=d.ybh and a.jyrq=d.jyrq
join xm_info c on d.yq=c.yq and d.xmdh=c.xmdh
join lab_reqmain g on g.sqh=a.sqh
join xm_med e on d.ywdh=e.ywdh
join lab_instr on a.yq=lab_instr.yq and yqdl='ϸ¾úÒÇ'
where a.jgbz='2' --and a.ybh like '%2017001%'
and a.brly='1'
union all
select (CONVERT(varchar(12), a.jyrq, 112)+'_'+rtrim(c.yq)+'_'+a.ybh) as bgdh,
-- (case when a.brly = '1' then a.brdh else isnull(g.bz1,a.brdh) end ) brdh ,
g.bz1 as brdh,
c.xmmc,
e.ywmc,
d.*,
(select textresult from lab_result where yq=d.yq and ybh=d.ybh and jyrq=d.jyrq and xmdh=d.xmdh) textresult1
from lab_Pat a --left join lab_result b on a.yq=b.yq and a.ybh=b.ybh and a.jyrq=b.jyrq and b.xmdh=d.xmdh
join lab_resultmed d on a.yq=d.yq and a.ybh=d.ybh and a.jyrq=d.jyrq
join xm_info c on d.yq=c.yq and d.xmdh=c.xmdh
join lab_reqmain g on g.sqh=a.sqh
join xm_med e on d.ywdh=e.ywdh
join lab_instr on a.yq=lab_instr.yq and yqdl='ϸ¾úÒÇ'
where a.jgbz='2' --and a.ybh like '%2017001%'
and a.brly<>'1'
GO

33
sql/lis8.0/web_result.sql Normal file
View File

@ -0,0 +1,33 @@
CREATE view [dbo].[web_result]
as
select a.[wyh]
,a.[jyrq]
,a.[yq]
,a.[ybh]
,a.[xmdh]
,a.[csjg]
,a.[od]
,a.[cutoff]
--,a.[jgbz]
,a.[bz1]
,a.[bz2]
,a.[yhdh]
,a.[textresult]
,a.[instrid]
,a.[operdt]
,a.[operna]
,a.[refs]
,a.[flag]
,a.[dw]
,a.[result_flag] jgbz
,a.[alarm_flag]
,a.[redo_flag]
,a.[sqxmdh],
b.xmmc,
b.dyxh
from lab_result a join xm_info b on a.yq=b.yq and a.xmdh=b.xmdh
GO

View File

@ -0,0 +1,48 @@
package com.czlis.transitPF.controller;
import com.czlis.common.core.controller.BaseController;
import com.czlis.common.core.domain.Result;
import com.czlis.common.core.page.TableDataInfo;
import com.czlis.transitPF.mapper.RegReportMapper;
import com.czlis.transitPF.pojo.DTO.RegItemVO;
import com.czlis.transitPF.pojo.RegTransitSample;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* 区域检验中心,报表统计
*/
@Api(tags = "区域检验中心-报表统计")
@RestController
@RequestMapping("/transitReport")
@Slf4j
public class RegReportController extends BaseController {
@Autowired
RegReportMapper regReportMapper;
@ApiOperation("样本报表数据")
@GetMapping("/sampleTypeCount")
public TableDataInfo getSampleTypeCount(RegTransitSample regTransitSample){
startPage();
List<Map<String, Object>> sampleTypeCountList = regReportMapper.getSampleTypeCount(regTransitSample);
return getDataTable(sampleTypeCountList);
}
@ApiOperation("项目统计数据")
@GetMapping("/itemCount")
public TableDataInfo getItemCount(RegItemVO regItemVO){
startPage();
List<Map<String, Object>> itemCountList = regReportMapper.getItemCount(regItemVO);
return getDataTable(itemCountList);
}
}

View File

@ -1,13 +1,11 @@
package com.czlis.transitPF.controller;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.czlis.common.annotation.Anonymous;
import com.czlis.common.core.controller.BaseController;
import com.czlis.common.core.domain.Result;
import com.czlis.common.core.page.TableDataInfo;
import com.czlis.transitPF.pojo.DTO.SampleSignVO;
import com.czlis.transitPF.pojo.RegTransitSample;
import com.czlis.transitPF.pojo.RegTransitSampleDTO;
import com.czlis.transitPF.service.RegTransitSampleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -29,14 +27,6 @@ public class RegTransitSampleController extends BaseController {
@Autowired
private RegTransitSampleService regTransitSampleService;
@ApiOperation("获取流转数据")
@GetMapping("/querySample")
public TableDataInfo getQuerySample(RegTransitSample labQuerySample) {
startPage();
List<RegTransitSample> regTransitSampleList = regTransitSampleService.getRegTransitSample(labQuerySample);
return getDataTable(regTransitSampleList);
}
@Anonymous
@ApiOperation("接口调用")
@PostMapping("/invoke")
@ -44,4 +34,56 @@ public class RegTransitSampleController extends BaseController {
return regTransitSampleService.invoke(jsonStr);
}
@ApiOperation("获取流转数据")
@GetMapping("/querySample")
public TableDataInfo getQuerySample(RegTransitSample regTransitSample) {
startPage();
List<RegTransitSample> regTransitSampleList = regTransitSampleService.getRegTransitSample(regTransitSample);
return getDataTable(regTransitSampleList);
}
@ApiOperation("获取未签收的标本")
@GetMapping("/querySampleSign")
public TableDataInfo getSampleSign(){
startPage();
List<RegTransitSample> regTransitSampleList = regTransitSampleService.getSampleSign();
return getDataTable(regTransitSampleList);
}
@ApiOperation("状态修改")
@PostMapping("/sampleSign")
public Result sampleSign(@RequestBody SampleSignVO sampleSignVO){
List<String> barcode = sampleSignVO.getBarcode();
String status = sampleSignVO.getStatus();
return regTransitSampleService.sampleSign(sampleSignVO,getUsername());
}
//@ApiOperation("条码退回")
@PostMapping("/sampleSignBack")
public Result sampleSignBack(@RequestBody SampleSignVO sampleSignVO){
List<String> barcode = sampleSignVO.getBarcode();
String status = sampleSignVO.getStatus();
return regTransitSampleService.sampleSignBack(barcode,getUsername(),status);
}
@ApiOperation("获取标本条码退回数据")
@GetMapping("querySampleSignBack")
public TableDataInfo getSampleSignBack(RegTransitSample regTransitSample){
startPage();
List<RegTransitSample> regTransitSampleList = regTransitSampleService.getSampleSignBack(regTransitSample);
return getDataTable(regTransitSampleList);
}
@ApiOperation("获取门诊申请单")
@GetMapping("/outPatientInfo")
public Result getOutPatientInfo(String patNo,String st,String et,String yljg){
return regTransitSampleService.getOutPatientInfo(patNo,st,et,getUsername(),yljg);
}
@ApiOperation("获取住院申请单")
@GetMapping("/inpPatientInfo")
public Result getInpInfo(String dept,String st,String et,String yljg){
return regTransitSampleService.getInpInfo(dept,st,et,yljg,getUsername());
}
}

View File

@ -0,0 +1,12 @@
package com.czlis.transitPF.mapper;
import com.czlis.transitPF.pojo.DTO.RegItemVO;
import com.czlis.transitPF.pojo.RegTransitSample;
import java.util.List;
import java.util.Map;
public interface RegReportMapper {
List<Map<String,Object>> getSampleTypeCount(RegTransitSample regTransitSample);
List<Map<String,Object>> getItemCount(RegItemVO regItemVO);
}

View File

@ -7,7 +7,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface RegTransitSampleMapper {
List<RegTransitSample> getRegTransitSample(RegTransitSample labQuerySample);
List<RegTransitSample> getRegTransitSample(RegTransitSample regTransitSample);
List<RegTransitSampleDetail> getRegTransitSampleDetail(RegTransitSampleDetail regTransitSampleDetail);
void addRegTransitSample(RegTransitSample regTransitSample);
@ -18,4 +18,10 @@ public interface RegTransitSampleMapper {
void delRegTransitSampleDetail(String barcode);
void updateTest(@Param("checkPUR") String checkPUR,@Param("barcode") String barcode);
List<RegTransitSample> getRegTransitSampleSign();
void updateRegTransitSample(RegTransitSample regTransitSample);
List<RegTransitSample> getRegTransitSampleSignBack(RegTransitSample regTransitSample);
}

View File

@ -0,0 +1,15 @@
package com.czlis.transitPF.pojo.DTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RegItemVO {
private String SrcHospName;
private String SrcOrderItemCode;
private String SrcOrderItemName;
private String DstHospName;
}

View File

@ -1,6 +1,8 @@
package com.czlis.transitPF.pojo;
package com.czlis.transitPF.pojo.DTO;
import com.czlis.transitPF.pojo.RegTransitSample;
import com.czlis.transitPF.pojo.RegTransitSampleDetail;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;

View File

@ -0,0 +1,37 @@
package com.czlis.transitPF.pojo.DTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SampleSignVO {
@ApiModelProperty(value = "条码集合")
private List<String> barcode;
@ApiModelProperty(value = "状态")
private String status;
@ApiModelProperty(value = "送检医院代码")
private String dstHospCode;
@ApiModelProperty(value = "送检医院名称")
private String dstHospName;
@ApiModelProperty(value = "标本退回原因")
private String backReasons;
@ApiModelProperty(value = "标本采集时间")
private Date affirmTime;
@ApiModelProperty(value = "标本采集人代码")
private String affirmUserCode;
@ApiModelProperty(value = "标本采集人姓名")
private String affirmUserName;
@ApiModelProperty(value = "标本送出时间")
private Date sendPackTime;
@ApiModelProperty(value = "标本送出人代码")
private String sendUserCode;
@ApiModelProperty(value = "标本送出人姓名")
private String sendUserName;
}

View File

@ -17,7 +17,6 @@ public class RegTransitSample {
/**
* 病人ID
*/
@ApiModelProperty(value = "病人ID")
private String PatId;
/**
* 就诊卡类型
@ -130,7 +129,6 @@ public class RegTransitSample {
/**
* 标本条码号
*/
@ApiModelProperty(value = "标本条码号")
private String Barcode;
/**
* 试管编码
@ -236,6 +234,9 @@ public class RegTransitSample {
private Date create_time;
private String update_by;
private Date update_time;
/**
* 数据来源:1.委托机构,2.区域流转平台
*/
private String DataSource;
/**
* 检验目的,项目字段拼接
@ -286,8 +287,22 @@ public class RegTransitSample {
* 检验分组名称
*/
private String LisGroupName;
/**
* 退回理由
*/
private String BackReasons;
/**
* 退回人代码
*/
private String BackUserCode;
/**
* 退回人姓名
*/
private String BackUserName;
/**
* 标本退回时间
*/
private Date BackTime;
private String DateType;
private Date DateStart;

View File

@ -1,6 +1,7 @@
package com.czlis.transitPF.service;
import com.czlis.common.core.domain.Result;
import com.czlis.transitPF.pojo.DTO.SampleSignVO;
import com.czlis.transitPF.pojo.RegTransitSample;
import java.util.List;
@ -9,4 +10,16 @@ public interface RegTransitSampleService {
List<RegTransitSample> getRegTransitSample(RegTransitSample regTransitSample);
Result invoke(String jsonStr);
List<RegTransitSample> getSampleSign();
Result sampleSign(SampleSignVO sampleSignVO, String userId);
Result sampleSignBack(List<String> barcode, String userId, String status);
List<RegTransitSample> getSampleSignBack(RegTransitSample regTransitSample);
Result getOutPatientInfo(String patNo,String st,String et,String userId,String yljg);
Result getInpInfo(String dept, String st, String et, String yljg,String userId);
}

View File

@ -0,0 +1,190 @@
package com.czlis.transitPF.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.czlis.common.core.domain.Result;
import com.czlis.transitPF.mapper.RegTransitSampleMapper;
import com.czlis.transitPF.pojo.DTO.SampleSignVO;
import com.czlis.transitPF.pojo.RegTransitSample;
import com.czlis.transitPF.pojo.RegTransitSampleDetail;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
@Component
@Slf4j
public class RegInterfaceImpl {
@Autowired
RegTransitSampleMapper regTransitSampleMapper;
/**
*{
* "method":"addTransitSample",
* "req": {
* """":"",
* "reqDetail": [{
* "",""
* },{
* "",""
* }
* ]
* }
* }
* @param jsonStr
* @return
*/
public Result addTransitSample(String jsonStr){
JSONObject reqMain = null;
JSONArray reqDetailList = null;
try{
JSONObject jsonObject = JSONUtil.parseObj(jsonStr);
reqMain = jsonObject.getJSONObject("req").getJSONObject("reqMain");
if(reqMain.getStr("PatId") == null || reqMain.getStr("PatId").equals("")) return new Result("-1","PatId不能为空!");
if(reqMain.getStr("PatName") == null || reqMain.getStr("PatName").equals("")) return new Result("-1","PatName不能为空!");
if(reqMain.getStr("PatSex") == null || reqMain.getStr("PatSex").equals("")) return new Result("-1","PatSex不能为空!");
if(reqMain.getStr("PatBirthday") == null || reqMain.getStr("PatBirthday").equals("")) return new Result("-1","PatBirthday不能为空!");
if(reqMain.getStr("OrderTime") == null ) return new Result("-1","OrderTime不能为空!");
if(reqMain.getStr("Barcode") == null || reqMain.getStr("Barcode").equals("")) return new Result("-1","Barcode不能为空!");
reqDetailList = jsonObject.getJSONObject("req").getJSONArray("reqDetail");
}catch (Exception e){
e.printStackTrace();
log.error("json格式错误:",e);
return new Result("-1","json格式不合法"+e.getMessage());
}
RegTransitSample regTransitSample = JSONUtil.toBean(reqMain, RegTransitSample.class);
RegTransitSample regTransitSample1 = new RegTransitSample();
regTransitSample1.setBarcode(reqMain.getStr("Barcode"));
regTransitSample1.setSrcHospCode(reqMain.getStr("SrcHospCode"));
List<RegTransitSample> regTransitSample2List = regTransitSampleMapper.getRegTransitSample(regTransitSample1);
if(regTransitSample2List.size() > 0) return new Result("-1","存在相同记录的标本信息!");
String checkPUR = "";
//填写默认值
List<RegTransitSampleDetail> regTransitSampleDetailList = reqDetailList.toList(RegTransitSampleDetail.class);
for (RegTransitSampleDetail regTransitSampleDetail : regTransitSampleDetailList) {
checkPUR = checkPUR + "," + regTransitSampleDetail.getOrderItemName();
}
checkPUR = checkPUR.substring(1);
regTransitSample.setCheckPUR(checkPUR);
regTransitSample.setStatus("10");
regTransitSample.setDataSource("1");
regTransitSampleMapper.addRegTransitSample(regTransitSample);
for (RegTransitSampleDetail regTransitSampleDetail : regTransitSampleDetailList) {
regTransitSampleMapper.addRegTransitSampleDetail(regTransitSampleDetail);
}
return new Result("0","");
}
/**
* {
* "method":"delTransitSample",
* "req": {
* "barcode":{
* "":"",
* } }
* }
* @param jsonStr
* @return
*/
public Result delTransitSample(String jsonStr){
String barcode = "";
try{
JSONObject jsonObject = JSONUtil.parseObj(jsonStr);
barcode = jsonObject.getJSONObject("reqMain").getStr("barcode");
RegTransitSample regTransitSample = new RegTransitSample();
regTransitSample.setBarcode(barcode);
List<RegTransitSample> regTransitSampleList = regTransitSampleMapper.getRegTransitSample(regTransitSample);
for (RegTransitSample transitSample : regTransitSampleList) {
String status = transitSample.getStatus();
if(Integer.parseInt(status) > 20) return new Result("-1","标本已经送检,不允许删除!");
}
}catch (Exception e){
e.printStackTrace();
log.error("json格式不合法",e);
return new Result("-1","json格式不合法!");
}
regTransitSampleMapper.delRegTransitSample(barcode);
regTransitSampleMapper.delRegTransitSampleDetail(barcode);
return new Result("0","删除成功!");
}
public Result queryTransitSample(String jsonStr){
try{
JSONObject jsonObject = JSONUtil.parseObj(jsonStr);
String barcode = jsonObject.getJSONObject("req").getJSONObject("param").getStr("barcode");
RegTransitSample regTransitSample = new RegTransitSample();
regTransitSample.setBarcode(barcode);
List<RegTransitSample> regTransitSampleList = regTransitSampleMapper.getRegTransitSample(regTransitSample);
return new Result("0","获取数据成功!",regTransitSampleList);
}catch (Exception e){
e.printStackTrace();
log.error("调用的json格式不合法!",e);
return new Result("-1","调用的json格式不合法!");
}
}
public Result updateStatus(String jsonStr){
try{
JSONObject jsonObject = JSONUtil.parseObj(jsonStr);
SampleSignVO sampleSignVO = jsonObject.getJSONObject("req").getJSONObject("param").toBean(SampleSignVO.class);
List<String> barcodeList = sampleSignVO.getBarcode();
Date sendPackTime = sampleSignVO.getSendPackTime();
String sendUserCode = sampleSignVO.getSendUserCode();
String sendUserName = sampleSignVO.getSendUserName();
//状态判断
for (String barcode : barcodeList) {
RegTransitSample regTransitSample1 = new RegTransitSample();
regTransitSample1.setBarcode(barcode);
List<RegTransitSample> regTransitSampleList = regTransitSampleMapper.getRegTransitSample(regTransitSample1);
if(regTransitSampleList.size() <= 0) return new Result("-1","没有查到该标本的信息!");
String status = regTransitSampleList.get(0).getStatus();
if(Integer.parseInt(status) >= 30) return new Result("-1","该标本已经送检!");
RegTransitSample regTransitSample = new RegTransitSample();
regTransitSample.setBarcode(barcode);
regTransitSample.setSendUserCode(sendUserCode);
regTransitSample.setSendUserName(sendUserName);
try{
regTransitSample.setSendPackTime(sendPackTime);
}catch (Exception e){
e.printStackTrace();
return new Result("-1","日期时间格式不正确!");
}
regTransitSample.setStatus("30");
regTransitSampleMapper.updateRegTransitSample(regTransitSample);
}
}catch (Exception e){
e.printStackTrace();
log.error("json格式不合法",e);
return new Result("-1","json格式不合法!");
}
return null;
}
public Result test(){
RegTransitSample regTransitSample = new RegTransitSample();
List<RegTransitSample> regTransitSampleList = regTransitSampleMapper.getRegTransitSample(regTransitSample);
for (RegTransitSample transitSample : regTransitSampleList) {
if(transitSample.getBarcode() == null || transitSample.getBarcode().equals("")) continue;
RegTransitSampleDetail regTransitSampleDetail = new RegTransitSampleDetail();
regTransitSampleDetail.setBarcode(transitSample.getBarcode());
List<RegTransitSampleDetail> regTransitSampleDetailList = regTransitSampleMapper.getRegTransitSampleDetail(regTransitSampleDetail);
String tempName = "";
for (RegTransitSampleDetail transitSampleDetail : regTransitSampleDetailList) {
tempName = tempName + ","+ transitSampleDetail.getSrcOrderItemName();
}
tempName = tempName.substring(1);
regTransitSampleMapper.updateTest(tempName,transitSample.getBarcode());
}
return new Result("0","成功!");
}
}

View File

@ -1,18 +1,25 @@
package com.czlis.transitPF.service.impl;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.czlis.common.core.domain.Result;
import com.czlis.common.core.domain.entity.SysUser;
import com.czlis.interfaceCommon.constants.LisinterfaceNameConstants;
import com.czlis.interfaceCommon.pojo.inter.reg.GetRegInpInfo;
import com.czlis.interfaceCommon.pojo.inter.reg.GetRegOutPatientInfo;
import com.czlis.interfaceCommon.utils.CommonUtil;
import com.czlis.interfaceCommon.utils.LisInterfaceUtil;
import com.czlis.transitPF.mapper.RegTransitSampleMapper;
import com.czlis.transitPF.pojo.DTO.SampleSignVO;
import com.czlis.transitPF.pojo.RegTransitSample;
import com.czlis.transitPF.pojo.RegTransitSampleDTO;
import com.czlis.transitPF.pojo.RegTransitSampleDetail;
import com.czlis.transitPF.service.RegTransitSampleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
@ -21,28 +28,14 @@ public class RegTransitSampleServiceImpl implements RegTransitSampleService {
@Autowired
RegTransitSampleMapper regTransitSampleMapper;
@Autowired
RegInterfaceImpl regInterfaceImpl;
@Autowired
private CommonUtil commonUtil;
@Autowired
LisInterfaceUtil lisInterfaceUtil;
@Override
public List<RegTransitSample> getRegTransitSample(RegTransitSample labQuerySample) {
List<RegTransitSample> regTransitSampleList = regTransitSampleMapper.getRegTransitSample(labQuerySample);
// RegTransitSampleDetail regTransitSampleDetail = new RegTransitSampleDetail();
// List<RegTransitSampleDetail> querySampleDetailList = null;
// if(labQuerySample != null){
// String barcode = labQuerySample.getBarcode();
// if(barcode != null && barcode.equals("")){
// regTransitSampleDetail.setBarcode(labQuerySample.getBarcode());
// querySampleDetailList = regTransitSampleMapper.getRegTransitSampleDetail(regTransitSampleDetail);
// }
// }
// RegTransitSampleDTO regTransitSampleDTO = new RegTransitSampleDTO();
// regTransitSampleDTO.setLabQuerySampleList(labQuerySampleList);
// regTransitSampleDTO.setRegTransitSampleDetailList(querySampleDetailList);
//return new Result("0","查询成功!", regTransitSampleDTO);
return regTransitSampleList;
}
@Override
public Result invoke(String jsonStr) {
log.info("区域平台入参:{}", jsonStr);
@ -60,11 +53,13 @@ public class RegTransitSampleServiceImpl implements RegTransitSampleService {
switch (method){
case "addTransitSample": //新增数据接口
return addTransitSample(jsonStr);
case "delTransitSample":
return delTransitSample(jsonStr);
case "queryTransitSample":
return queryTransitSample(jsonStr);
return regInterfaceImpl.addTransitSample(jsonStr);
case "delTransitSample": //删除数据接口
return regInterfaceImpl.delTransitSample(jsonStr);
case "queryTransitSample": //查询数据接口
return regInterfaceImpl.queryTransitSample(jsonStr);
case "update": //修改状态, 目前只写了送检状态的
return regInterfaceImpl.updateStatus(jsonStr);
// case "test":
// return test();
default:
@ -73,106 +68,135 @@ public class RegTransitSampleServiceImpl implements RegTransitSampleService {
}
/**
*{
* "method":"addTransitSample",
* "req": {
* """":"",
* "reqDetail": [{
* "",""
* },{
* "",""
* }
* ]
* }
* }
* @param jsonStr
* @return
*/
public Result addTransitSample(String jsonStr){
JSONObject jsonObject = null;
try{
jsonObject = JSONUtil.parseObj(jsonStr);
}catch (Exception e){
e.printStackTrace();
log.error("json格式错误:",e);
return new Result("-1","json格式不合法");
}
JSONObject reqMain = jsonObject.getJSONObject("req").getJSONObject("reqMain");
RegTransitSample regTransitSample = JSONUtil.toBean(reqMain, RegTransitSample.class);
RegTransitSample regTransitSample1 = new RegTransitSample();
regTransitSample1.setBarcode(reqMain.getStr("Barcode"));
regTransitSample1.setSrcHospCode(reqMain.getStr("SrcHospCode"));
List<RegTransitSample> regTransitSample2List = regTransitSampleMapper.getRegTransitSample(regTransitSample1);
if(regTransitSample2List.size() > 0){
for (RegTransitSample transitSample : regTransitSample2List) {
String barcode = transitSample.getBarcode();
regTransitSampleMapper.delRegTransitSample(barcode);
regTransitSampleMapper.delRegTransitSampleDetail(barcode);
}
}
JSONArray reqDetailList = jsonObject.getJSONObject("req").getJSONArray("reqDetail");
String checkPUR = "";
List<RegTransitSampleDetail> regTransitSampleDetailList = reqDetailList.toList(RegTransitSampleDetail.class);
for (RegTransitSampleDetail regTransitSampleDetail : regTransitSampleDetailList) {
checkPUR = checkPUR + "," + regTransitSampleDetail.getOrderItemName();
}
checkPUR = checkPUR.substring(1);
regTransitSample.setCheckPUR(checkPUR);
regTransitSampleMapper.addRegTransitSample(regTransitSample);
for (RegTransitSampleDetail regTransitSampleDetail : regTransitSampleDetailList) {
regTransitSampleMapper.addRegTransitSampleDetail(regTransitSampleDetail);
}
return new Result("0","");
@Override
public List<RegTransitSample> getSampleSign() {
List<RegTransitSample> regTransitSampleSignList = regTransitSampleMapper.getRegTransitSampleSign();
return regTransitSampleSignList;
}
@Override
public Result sampleSign(SampleSignVO sampleSignVO, String userId) {
String status = sampleSignVO.getStatus();
String dstHospCode = sampleSignVO.getDstHospCode();
String dstHospName = sampleSignVO.getDstHospName();
String backReasons = sampleSignVO.getBackReasons();
Date affirmTime = sampleSignVO.getAffirmTime();
String affirmUserCode = sampleSignVO.getAffirmUserCode();
String affirmUserName = sampleSignVO.getAffirmUserName();
Date sendPackTime = sampleSignVO.getSendPackTime();
String sendUserName = sampleSignVO.getSendUserName();
String sendUserCode = sampleSignVO.getSendUserCode();
List<String> barcode = sampleSignVO.getBarcode();
for (int i = 0; i < barcode.size(); i++) {
RegTransitSample regTransitSample = new RegTransitSample();
regTransitSample.setBarcode(barcode.get(i));
SysUser sysUserOne = commonUtil.getSysUserOne(userId);
if(sysUserOne == null) return new Result("-1","未查询到员工信息!");
String nickName = sysUserOne.getNickName();
switch (status){
case "20": //标本采集
if(affirmTime == null) return new Result("-1","affirmTime标本采集时间不能为空!");
if(affirmUserName == null || affirmUserName.equals("")) return new Result("-1","affirmUserName标本采集人姓名不能为空!");
regTransitSample.setAffirmTime(affirmTime);
regTransitSample.setAffirmUserCode(affirmUserCode);
regTransitSample.setAffirmUserName(affirmUserName);
case "30": //标本送检
if(dstHospName == null || dstHospName.equals("")) return new Result("-1","dstHospName不能为空!");
if(sendPackTime == null) return new Result("-1","sendPackTime不能为空!");
if(sendUserName == null || sendUserName.equals("")) return new Result("-1","sendUserName不能为空!");
regTransitSample.setDstHospCode(dstHospCode);
regTransitSample.setDstHospName(dstHospName);
regTransitSample.setSendPackTime(sendPackTime);
regTransitSample.setSendUserCode(sendUserCode);
regTransitSample.setSendUserName(sendUserName);
break;
case "50": //标本签收
regTransitSample.setSignInTime(commonUtil.getCurrentTime());
regTransitSample.setSignInUserCode(userId);
regTransitSample.setSignInUserName(nickName);
break;
case "100": //标本退回
regTransitSample.setBackReasons(backReasons);
regTransitSample.setBackUserCode(userId);
regTransitSample.setBackUserName(nickName);
regTransitSample.setBackTime(commonUtil.getCurrentTime());
break;
}
regTransitSample.setStatus(status);
regTransitSample.setUpdate_by(userId);
regTransitSample.setUpdate_time(commonUtil.getCurrentTime());
regTransitSampleMapper.updateRegTransitSample(regTransitSample);
}
return new Result("0","签收成功!");
}
/**
* {
* "method":"delTransitSample",
* "req": {
* "barcode":{
* "":"",
* } }
* }
* @param jsonStr
* 标本退回
* @param barcode
* @param userId
* @param status
* @return
*/
public Result delTransitSample(String jsonStr){
JSONObject jsonObject = JSONUtil.parseObj(jsonStr);
String barcode = jsonObject.getJSONObject("reqMain").getStr("Barcode");
regTransitSampleMapper.delRegTransitSample(barcode);
regTransitSampleMapper.delRegTransitSampleDetail(barcode);
return new Result("0","删除成功!");
@Override
public Result sampleSignBack(List<String> barcode, String userId, String status) {
return new Result("0","退回成功!");
}
public Result queryTransitSample(String jsonStr){
JSONObject jsonObject = JSONUtil.parseObj(jsonStr);
return null;
@Override
public List<RegTransitSample> getSampleSignBack(RegTransitSample regTransitSample) {
return regTransitSampleMapper.getRegTransitSampleSignBack(regTransitSample);
}
public Result test(){
RegTransitSample regTransitSample = new RegTransitSample();
List<RegTransitSample> regTransitSampleList = regTransitSampleMapper.getRegTransitSample(regTransitSample);
for (RegTransitSample transitSample : regTransitSampleList) {
if(transitSample.getBarcode() == null || transitSample.getBarcode().equals("")) continue;
RegTransitSampleDetail regTransitSampleDetail = new RegTransitSampleDetail();
regTransitSampleDetail.setBarcode(transitSample.getBarcode());
List<RegTransitSampleDetail> regTransitSampleDetailList = regTransitSampleMapper.getRegTransitSampleDetail(regTransitSampleDetail);
String tempName = "";
for (RegTransitSampleDetail transitSampleDetail : regTransitSampleDetailList) {
tempName = tempName + ","+ transitSampleDetail.getSrcOrderItemName();
}
tempName = tempName.substring(1);
regTransitSampleMapper.updateTest(tempName,transitSample.getBarcode());
}
return new Result("0","成功!");
/**
* 获取门诊申请单数据
* @param patNo
* @return
*/
@Override
public Result getOutPatientInfo(String patNo,String stime,String etime,String userId,String yljg) {
GetRegOutPatientInfo getRegOutPatientInfo = new GetRegOutPatientInfo();
getRegOutPatientInfo.setUserid(userId);
getRegOutPatientInfo.setStime(stime);
getRegOutPatientInfo.setEtime(etime);
getRegOutPatientInfo.setBrdh(patNo);
getRegOutPatientInfo.setYljg(yljg);
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.GET_REG_OUTPATIENT_INFO, getRegOutPatientInfo);
if(!result.getCode().equals("0")) return result;
//返回的数据应该和平台返回的数据格式一样才对
String jsonData = result.getData().toString();
return regInterfaceImpl.addTransitSample(jsonData);
}
/**
* 获取住院申请单
* @param dept
* @param st
* @param et
* @param yljg
* @return
*/
@Override
public Result getInpInfo(String dept, String st, String et, String yljg,String userId) {
GetRegInpInfo getRegInpInfo = new GetRegInpInfo();
getRegInpInfo.setDept(dept);
getRegInpInfo.setStime(st);
getRegInpInfo.setEtime(et);
getRegInpInfo.setYljg(yljg);
getRegInpInfo.setUserId(userId);
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.GET_REG_OUTPATIENT_INFO, getRegInpInfo);
if(!result.getCode().equals("0")) return result;
//返回的数据应该和平台返回的数据格式一样才对
String jsonData = result.getData().toString();
return regInterfaceImpl.addTransitSample(jsonData);
}
@Override
public List<RegTransitSample> getRegTransitSample(RegTransitSample labQuerySample) {
List<RegTransitSample> regTransitSampleList = regTransitSampleMapper.getRegTransitSample(labQuerySample);
return regTransitSampleList;
}
}

View File

@ -0,0 +1,27 @@
<?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.czlis.transitPF.mapper.RegReportMapper">
<select id="getSampleTypeCount" resultType="map">
select srchospname,sampletypecode,sampletypename,count(1) as sl from reg_TransitSample
<where>
<if test="SrcHospName != null and SrcHospName !=''">and SrcHospName = #{SrcHospName}</if>
<if test="SampleTypeCode != null and SampleTypeCode !=''">and sampletypecode = #{SampleTypeCode}</if>
<if test="SampleTypeName != null and SampleTypeName !=''">and sampletypename = #{SampleTypeName}</if>
<if test="OrderTime != null">and (OrderTime between #{DateStart} and #{DateEnd})</if>
</where>
group by srchospname,sampletypecode,sampletypename
</select>
<select id="getItemCount" resultType="map">
select a.SrcHospName,b.SrcOrderItemCode,b.SrcOrderItemName,count(1) as sl,b.cost,a.DstHospName from reg_TransitSample a,reg_TransitSample_detail b where a.barcode = b.barcode
<if test="SrcHospName != null and SrcHospName !=''">and SrcHospName = #{SrcHospName}</if>
<if test="SrcOrderItemCode != null and SrcOrderItemCode !=''">and SrcOrderItemCode = #{SrcOrderItemCode}</if>
<if test="SrcOrderItemName != null and SrcOrderItemName !=''">and SrcOrderItemName = #{SrcOrderItemName}</if>
<if test="DstHospName != null and DstHospName !=''">and DstHospName = #{DstHospName}</if>
group by a.SrcHospName,b.SrcOrderItemCode,b.SrcOrderItemName,b.cost,a.DstHospName
</select>
</mapper>

View File

@ -9,6 +9,9 @@
<where>
<if test="Barcode != null and Barcode !=''">and Barcode = #{Barcode}</if>
<if test="SrcHospName != null and SrcHospName !=''">and SrcHospName like '%'+#{SrcHospName}+'%' </if>
<if test="DstHospName != null and DstHospName !=''">and DstHospName like '%'+#{DstHospName}+'%' </if>
<if test="DstHospCode != null and DstHospCode !=''">and DstHospCode like '%'+#{DstHospCode}+'%' </if>
<if test="SrcHospCode != null and SrcHospCode !=''">and SrcHospCode like '%'+#{SrcHospCode}+'%' </if>
<if test="PatName != null and PatName !=''">and PatName like '%'+#{PatName}+'%'</if>
<if test="checkPUR != null and checkPUR !=''">and checkPUR like '%'+#{checkPUR}+'%'</if>
<if test="Status != null and Status !=''">and Status = #{Status}</if>
@ -185,5 +188,48 @@
update reg_TransitSample set checkPUR = #{checkPUR} WHERE Barcode = #{barcode}
</update>
<select id="getRegTransitSampleSign" resultType="com.czlis.transitPF.pojo.RegTransitSample">
<![CDATA[select * from Reg_TransitSample where Status in (select dict_code from reg_dict where dict_type = 'ZT' AND CAST(dict_code AS INT) < 50)]]>
<if test="SrcHospCode != null and SrcHospCode != ''"> and SrcHospCode = #{SrcHospCode}</if>
<if test="DstHospCode != null and DstHospCode != ''"> and DstHospCode = #{DstHospCode}</if>
<if test="Status != null and Status != ''"> and Status = #{Status}</if>
<if test="Barcode != null and Barcode != ''"> and Barcode = #{Barcode}</if>
<if test="PatName != null and PatName != ''"> and PatName like '%'+#{PatName}+'%'</if>
<if test="DateType == '登记时间'">and (OrderTime between #{DateStart} and #{DateEnd}) </if>
<if test="DateType == '采样时间'">and (AffirmTime between #{DateStart} and #{DateEnd}) </if>
<if test="DateType == '送出时间'">and (SendPackTime between #{DateStart} and #{DateEnd}) </if>
<if test="DateType == '签收时间'">and (SignInTime between #{DateStart} and #{DateEnd}) </if>
</select>
<update id="updateRegTransitSample">
update reg_TransitSample
<set>
<if test="Status != null and Status != ''">Status = #{Status},</if>
<if test="BackReasons != null and BackReasons != ''">BackReasons = #{BackReasons},</if>
<if test="SignInTime != null">SignInTime = #{SignInTime},</if>
<if test="SignInUserCode != null and SignInUserCode != ''">SignInUserCode = #{SignInUserCode},</if>
<if test="SignInUserName != null and SignInUserName != ''">SignInUserName = #{SignInUserName},</if>
<if test="DstHospCode != null and DstHospCode != ''">DstHospCode = #{DstHospCode},</if>
<if test="DstHospName != null and DstHospName != ''">DstHospName = #{DstHospName},</if>
<if test="BackUserCode != null and BackUserCode != ''">BackUserCode = #{BackUserCode},</if>
<if test="BackUserName != null and BackUserName != ''">BackUserName = #{BackUserName},</if>
<if test="BackTime != null">BackTime = #{BackTime},</if>
update_by = #{update_by},update_time = #{update_time}
</set>
where barcode = #{barcode}
</update>
<select id="getRegTransitSampleSignBack">
<![CDATA[select * from Reg_TransitSample where Status in (select dict_code from reg_dict where dict_type = 'ZT' AND dict_code = '100')]]>
<if test="SrcHospCode != null and SrcHospCode != ''"> and SrcHospCode = #{SrcHospCode}</if>
<if test="DstHospCode != null and DstHospCode != ''"> and DstHospCode = #{DstHospCode}</if>
<if test="Status != null and Status != ''"> and Status = #{Status}</if>
<if test="Barcode != null and Barcode != ''"> and Barcode = #{Barcode}</if>
<if test="PatName != null and PatName != ''"> and PatName = #{PatName}</if>
<if test="DateType == '登记时间'">and (OrderTime between #{DateStart} and #{DateEnd}) </if>
<if test="DateType == '采样时间'">and (AffirmTime between #{DateStart} and #{DateEnd}) </if>
<if test="DateType == '送出时间'">and (SendPackTime between #{DateStart} and #{DateEnd}) </if>
<if test="DateType == '签收时间'">and (SignInTime between #{DateStart} and #{DateEnd}) </if>
</select>
</mapper>