diff --git a/lis-interfaceCommon/src/main/java/com/czlis/interfaceCommon/constants/LisinterfaceNameConstants.java b/lis-interfaceCommon/src/main/java/com/czlis/interfaceCommon/constants/LisinterfaceNameConstants.java index c04c0dd..e1e878d 100644 --- a/lis-interfaceCommon/src/main/java/com/czlis/interfaceCommon/constants/LisinterfaceNameConstants.java +++ b/lis-interfaceCommon/src/main/java/com/czlis/interfaceCommon/constants/LisinterfaceNameConstants.java @@ -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"; + + + } diff --git a/lis-interfaceCommon/src/main/java/com/czlis/interfaceCommon/mapper/SysUserCommMapper.java b/lis-interfaceCommon/src/main/java/com/czlis/interfaceCommon/mapper/SysUserCommMapper.java new file mode 100644 index 0000000..4a66b3a --- /dev/null +++ b/lis-interfaceCommon/src/main/java/com/czlis/interfaceCommon/mapper/SysUserCommMapper.java @@ -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); +} diff --git a/lis-interfaceCommon/src/main/java/com/czlis/interfaceCommon/pojo/inter/reg/GetRegInpInfo.java b/lis-interfaceCommon/src/main/java/com/czlis/interfaceCommon/pojo/inter/reg/GetRegInpInfo.java new file mode 100644 index 0000000..8eaee2c --- /dev/null +++ b/lis-interfaceCommon/src/main/java/com/czlis/interfaceCommon/pojo/inter/reg/GetRegInpInfo.java @@ -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); + } +} diff --git a/lis-interfaceCommon/src/main/java/com/czlis/interfaceCommon/pojo/inter/reg/GetRegOutPatientInfo.java b/lis-interfaceCommon/src/main/java/com/czlis/interfaceCommon/pojo/inter/reg/GetRegOutPatientInfo.java new file mode 100644 index 0000000..2c0825b --- /dev/null +++ b/lis-interfaceCommon/src/main/java/com/czlis/interfaceCommon/pojo/inter/reg/GetRegOutPatientInfo.java @@ -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); + } +} diff --git a/lis-interfaceCommon/src/main/java/com/czlis/interfaceCommon/utils/CommonUtil.java b/lis-interfaceCommon/src/main/java/com/czlis/interfaceCommon/utils/CommonUtil.java index 6a60793..45417b8 100644 --- a/lis-interfaceCommon/src/main/java/com/czlis/interfaceCommon/utils/CommonUtil.java +++ b/lis-interfaceCommon/src/main/java/com/czlis/interfaceCommon/utils/CommonUtil.java @@ -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); + } } diff --git a/lis-interfaceCommon/src/main/resources/mapper/SysUserCommMapper.xml b/lis-interfaceCommon/src/main/resources/mapper/SysUserCommMapper.xml new file mode 100644 index 0000000..f08ec54 --- /dev/null +++ b/lis-interfaceCommon/src/main/resources/mapper/SysUserCommMapper.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lis-system/src/main/java/com/czlis/system/config/ApplicationConfig.java b/lis-system/src/main/java/com/czlis/system/config/ApplicationConfig.java index a42f391..0d80fa9 100644 --- a/lis-system/src/main/java/com/czlis/system/config/ApplicationConfig.java +++ b/lis-system/src/main/java/com/czlis/system/config/ApplicationConfig.java @@ -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 list = Arrays.asList("GROUP","AU","BT","DG", "DP", "FT", "HOS","LG","PT","PW","SRD","SX","UT","CM","VF"); + //private List 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 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 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); +// +// } /** * 加载系统配置缓存 diff --git a/sql/lis8.0/ruoyi_lis8.0_sqlserver.sql b/sql/lis8.0/ruoyi_lis8.0_sqlserver.sql index 2bbfda7..ba15be1 100644 --- a/sql/lis8.0/ruoyi_lis8.0_sqlserver.sql +++ b/sql/lis8.0/ruoyi_lis8.0_sqlserver.sql @@ -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 diff --git a/sql/lis8.0/updatedb_lis8.0.sql b/sql/lis8.0/updatedb_lis8.0.sql index 85baf6a..68bbb88 100644 --- a/sql/lis8.0/updatedb_lis8.0.sql +++ b/sql/lis8.0/updatedb_lis8.0.sql @@ -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 diff --git a/sql/lis8.0/web_fs_printReport.sql b/sql/lis8.0/web_fs_printReport.sql new file mode 100644 index 0000000..3020882 --- /dev/null +++ b/sql/lis8.0/web_fs_printReport.sql @@ -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 + + diff --git a/sql/lis8.0/web_getReportsList.sql b/sql/lis8.0/web_getReportsList.sql new file mode 100644 index 0000000..bb2870b --- /dev/null +++ b/sql/lis8.0/web_getReportsList.sql @@ -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 + + diff --git a/sql/lis8.0/web_getresultmed.sql b/sql/lis8.0/web_getresultmed.sql new file mode 100644 index 0000000..e4e8d22 --- /dev/null +++ b/sql/lis8.0/web_getresultmed.sql @@ -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 + + diff --git a/sql/lis8.0/web_result.sql b/sql/lis8.0/web_result.sql new file mode 100644 index 0000000..1815867 --- /dev/null +++ b/sql/lis8.0/web_result.sql @@ -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 + + diff --git a/transitPF/src/main/java/com/czlis/transitPF/controller/RegReportController.java b/transitPF/src/main/java/com/czlis/transitPF/controller/RegReportController.java new file mode 100644 index 0000000..bc3435b --- /dev/null +++ b/transitPF/src/main/java/com/czlis/transitPF/controller/RegReportController.java @@ -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> sampleTypeCountList = regReportMapper.getSampleTypeCount(regTransitSample); + return getDataTable(sampleTypeCountList); + } + + @ApiOperation("项目统计数据") + @GetMapping("/itemCount") + public TableDataInfo getItemCount(RegItemVO regItemVO){ + startPage(); + List> itemCountList = regReportMapper.getItemCount(regItemVO); + return getDataTable(itemCountList); + } +} diff --git a/transitPF/src/main/java/com/czlis/transitPF/controller/RegTransitSampleController.java b/transitPF/src/main/java/com/czlis/transitPF/controller/RegTransitSampleController.java index 917ab18..4e1b628 100644 --- a/transitPF/src/main/java/com/czlis/transitPF/controller/RegTransitSampleController.java +++ b/transitPF/src/main/java/com/czlis/transitPF/controller/RegTransitSampleController.java @@ -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 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 regTransitSampleList = regTransitSampleService.getRegTransitSample(regTransitSample); + return getDataTable(regTransitSampleList); + } + + @ApiOperation("获取未签收的标本") + @GetMapping("/querySampleSign") + public TableDataInfo getSampleSign(){ + startPage(); + List regTransitSampleList = regTransitSampleService.getSampleSign(); + return getDataTable(regTransitSampleList); + } + + @ApiOperation("状态修改") + @PostMapping("/sampleSign") + public Result sampleSign(@RequestBody SampleSignVO sampleSignVO){ + List barcode = sampleSignVO.getBarcode(); + String status = sampleSignVO.getStatus(); + return regTransitSampleService.sampleSign(sampleSignVO,getUsername()); + } + + //@ApiOperation("条码退回") + @PostMapping("/sampleSignBack") + public Result sampleSignBack(@RequestBody SampleSignVO sampleSignVO){ + List barcode = sampleSignVO.getBarcode(); + String status = sampleSignVO.getStatus(); + return regTransitSampleService.sampleSignBack(barcode,getUsername(),status); + } + + @ApiOperation("获取标本条码退回数据") + @GetMapping("querySampleSignBack") + public TableDataInfo getSampleSignBack(RegTransitSample regTransitSample){ + startPage(); + List 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()); + } + } diff --git a/transitPF/src/main/java/com/czlis/transitPF/mapper/RegReportMapper.java b/transitPF/src/main/java/com/czlis/transitPF/mapper/RegReportMapper.java new file mode 100644 index 0000000..56363d3 --- /dev/null +++ b/transitPF/src/main/java/com/czlis/transitPF/mapper/RegReportMapper.java @@ -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> getSampleTypeCount(RegTransitSample regTransitSample); + List> getItemCount(RegItemVO regItemVO); +} diff --git a/transitPF/src/main/java/com/czlis/transitPF/mapper/RegTransitSampleMapper.java b/transitPF/src/main/java/com/czlis/transitPF/mapper/RegTransitSampleMapper.java index eecafc0..77fd798 100644 --- a/transitPF/src/main/java/com/czlis/transitPF/mapper/RegTransitSampleMapper.java +++ b/transitPF/src/main/java/com/czlis/transitPF/mapper/RegTransitSampleMapper.java @@ -7,7 +7,7 @@ import org.apache.ibatis.annotations.Param; import java.util.List; public interface RegTransitSampleMapper { - List getRegTransitSample(RegTransitSample labQuerySample); + List getRegTransitSample(RegTransitSample regTransitSample); List 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 getRegTransitSampleSign(); + + void updateRegTransitSample(RegTransitSample regTransitSample); + + List getRegTransitSampleSignBack(RegTransitSample regTransitSample); } diff --git a/transitPF/src/main/java/com/czlis/transitPF/pojo/DTO/RegItemVO.java b/transitPF/src/main/java/com/czlis/transitPF/pojo/DTO/RegItemVO.java new file mode 100644 index 0000000..51811cf --- /dev/null +++ b/transitPF/src/main/java/com/czlis/transitPF/pojo/DTO/RegItemVO.java @@ -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; +} diff --git a/transitPF/src/main/java/com/czlis/transitPF/pojo/RegTransitSampleDTO.java b/transitPF/src/main/java/com/czlis/transitPF/pojo/DTO/RegTransitSampleDTO.java similarity index 74% rename from transitPF/src/main/java/com/czlis/transitPF/pojo/RegTransitSampleDTO.java rename to transitPF/src/main/java/com/czlis/transitPF/pojo/DTO/RegTransitSampleDTO.java index d6e74ec..eb21637 100644 --- a/transitPF/src/main/java/com/czlis/transitPF/pojo/RegTransitSampleDTO.java +++ b/transitPF/src/main/java/com/czlis/transitPF/pojo/DTO/RegTransitSampleDTO.java @@ -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; diff --git a/transitPF/src/main/java/com/czlis/transitPF/pojo/DTO/SampleSignVO.java b/transitPF/src/main/java/com/czlis/transitPF/pojo/DTO/SampleSignVO.java new file mode 100644 index 0000000..1b03cbd --- /dev/null +++ b/transitPF/src/main/java/com/czlis/transitPF/pojo/DTO/SampleSignVO.java @@ -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 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; +} diff --git a/transitPF/src/main/java/com/czlis/transitPF/pojo/RegTransitSample.java b/transitPF/src/main/java/com/czlis/transitPF/pojo/RegTransitSample.java index 456cb82..2f92242 100644 --- a/transitPF/src/main/java/com/czlis/transitPF/pojo/RegTransitSample.java +++ b/transitPF/src/main/java/com/czlis/transitPF/pojo/RegTransitSample.java @@ -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; diff --git a/transitPF/src/main/java/com/czlis/transitPF/service/RegTransitSampleService.java b/transitPF/src/main/java/com/czlis/transitPF/service/RegTransitSampleService.java index e2eb128..c8b311f 100644 --- a/transitPF/src/main/java/com/czlis/transitPF/service/RegTransitSampleService.java +++ b/transitPF/src/main/java/com/czlis/transitPF/service/RegTransitSampleService.java @@ -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 getRegTransitSample(RegTransitSample regTransitSample); Result invoke(String jsonStr); + + List getSampleSign(); + + Result sampleSign(SampleSignVO sampleSignVO, String userId); + + Result sampleSignBack(List barcode, String userId, String status); + + List 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); } diff --git a/transitPF/src/main/java/com/czlis/transitPF/service/impl/RegInterfaceImpl.java b/transitPF/src/main/java/com/czlis/transitPF/service/impl/RegInterfaceImpl.java new file mode 100644 index 0000000..f14ab51 --- /dev/null +++ b/transitPF/src/main/java/com/czlis/transitPF/service/impl/RegInterfaceImpl.java @@ -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 regTransitSample2List = regTransitSampleMapper.getRegTransitSample(regTransitSample1); + if(regTransitSample2List.size() > 0) return new Result("-1","存在相同记录的标本信息!"); + String checkPUR = ""; + //填写默认值 + List 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 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 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 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 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 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 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","成功!"); + } + +} diff --git a/transitPF/src/main/java/com/czlis/transitPF/service/impl/RegTransitSampleServiceImpl.java b/transitPF/src/main/java/com/czlis/transitPF/service/impl/RegTransitSampleServiceImpl.java index 6f9484a..c79b418 100644 --- a/transitPF/src/main/java/com/czlis/transitPF/service/impl/RegTransitSampleServiceImpl.java +++ b/transitPF/src/main/java/com/czlis/transitPF/service/impl/RegTransitSampleServiceImpl.java @@ -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 getRegTransitSample(RegTransitSample labQuerySample) { - List regTransitSampleList = regTransitSampleMapper.getRegTransitSample(labQuerySample); - // RegTransitSampleDetail regTransitSampleDetail = new RegTransitSampleDetail(); -// List 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 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 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 getSampleSign() { + List 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 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 barcode, String userId, String status) { + return new Result("0","退回成功!"); } - - public Result queryTransitSample(String jsonStr){ - JSONObject jsonObject = JSONUtil.parseObj(jsonStr); - - return null; + @Override + public List getSampleSignBack(RegTransitSample regTransitSample) { + return regTransitSampleMapper.getRegTransitSampleSignBack(regTransitSample); } - - public Result test(){ - RegTransitSample regTransitSample = new RegTransitSample(); - List 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 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 getRegTransitSample(RegTransitSample labQuerySample) { + List regTransitSampleList = regTransitSampleMapper.getRegTransitSample(labQuerySample); + return regTransitSampleList; + } } diff --git a/transitPF/src/main/resources/mapper/RegReportMapper.xml b/transitPF/src/main/resources/mapper/RegReportMapper.xml new file mode 100644 index 0000000..287f147 --- /dev/null +++ b/transitPF/src/main/resources/mapper/RegReportMapper.xml @@ -0,0 +1,27 @@ + + + + + + + + + \ No newline at end of file diff --git a/transitPF/src/main/resources/mapper/RegTransitSampleMapper.xml b/transitPF/src/main/resources/mapper/RegTransitSampleMapper.xml index 86d8299..63d3440 100644 --- a/transitPF/src/main/resources/mapper/RegTransitSampleMapper.xml +++ b/transitPF/src/main/resources/mapper/RegTransitSampleMapper.xml @@ -9,6 +9,9 @@ and Barcode = #{Barcode} and SrcHospName like '%'+#{SrcHospName}+'%' + and DstHospName like '%'+#{DstHospName}+'%' + and DstHospCode like '%'+#{DstHospCode}+'%' + and SrcHospCode like '%'+#{SrcHospCode}+'%' and PatName like '%'+#{PatName}+'%' and checkPUR like '%'+#{checkPUR}+'%' and Status = #{Status} @@ -185,5 +188,48 @@ update reg_TransitSample set checkPUR = #{checkPUR} WHERE Barcode = #{barcode} + + + + update reg_TransitSample + + Status = #{Status}, + BackReasons = #{BackReasons}, + SignInTime = #{SignInTime}, + SignInUserCode = #{SignInUserCode}, + SignInUserName = #{SignInUserName}, + DstHospCode = #{DstHospCode}, + DstHospName = #{DstHospName}, + BackUserCode = #{BackUserCode}, + BackUserName = #{BackUserName}, + BackTime = #{BackTime}, + update_by = #{update_by},update_time = #{update_time} + + where barcode = #{barcode} + + + \ No newline at end of file