区域检验中心

This commit is contained in:
jiangs 2025-11-13 16:01:42 +08:00
parent d75ff9082d
commit b52fd3c825
21 changed files with 687 additions and 147 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

@ -312,6 +312,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,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

@ -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,24 @@
package com.czlis.transitPF.pojo.DTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SampleSignVO {
@ApiModelProperty(value = "条码集合")
List<String> barcode;
@ApiModelProperty(value = "状态")
String status;
@ApiModelProperty(value = "送检医院代码")
String dstHospCode;
@ApiModelProperty(value = "送检医院名称")
String dstHospName;
@ApiModelProperty(value = "标本退回原因")
String backReasons;
}

View File

@ -286,6 +286,22 @@ public class RegTransitSample {
* 检验分组名称
*/
private String LisGroupName;
/**
* 退回理由
*/
private String BackReasons;
/**
* 退回人代码
*/
private String BackUserCode;
/**
* 退回人姓名
*/
private String BackUserName;
/**
* 标本退回时间
*/
private Date BackTime;

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,121 @@
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.transitPF.mapper.RegTransitSampleMapper;
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.List;
@Component
@Slf4j
public class RegInterfaceImpl {
@Autowired
RegTransitSampleMapper regTransitSampleMapper;
/**
*{
* "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","");
}
/**
* {
* "method":"delTransitSample",
* "req": {
* "barcode":{
* "":"",
* } }
* }
* @param jsonStr
* @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","删除成功!");
}
public Result queryTransitSample(String jsonStr){
JSONObject jsonObject = JSONUtil.parseObj(jsonStr);
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,24 @@
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.List;
@Service
@ -21,28 +27,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 +52,11 @@ public class RegTransitSampleServiceImpl implements RegTransitSampleService {
switch (method){
case "addTransitSample": //新增数据接口
return addTransitSample(jsonStr);
return regInterfaceImpl.addTransitSample(jsonStr);
case "delTransitSample":
return delTransitSample(jsonStr);
return regInterfaceImpl.delTransitSample(jsonStr);
case "queryTransitSample":
return queryTransitSample(jsonStr);
return regInterfaceImpl.queryTransitSample(jsonStr);
// case "test":
// return test();
default:
@ -73,106 +65,117 @@ 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;
}
/**
* {
* "method":"delTransitSample",
* "req": {
* "barcode":{
* "":"",
* } }
* }
* @param jsonStr
* @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","删除成功!");
}
public Result queryTransitSample(String jsonStr){
JSONObject jsonObject = JSONUtil.parseObj(jsonStr);
return null;
}
public Result test(){
@Override
public Result sampleSign(SampleSignVO sampleSignVO, String userId) {
String status = sampleSignVO.getStatus();
String dstHospCode = sampleSignVO.getDstHospCode();
String dstHospName = sampleSignVO.getDstHospName();
String backReasons = sampleSignVO.getBackReasons();
List<String> barcode = sampleSignVO.getBarcode();
for (int i = 0; i < barcode.size(); i++) {
RegTransitSample regTransitSample = new RegTransitSample();
List<RegTransitSample> regTransitSampleList = regTransitSampleMapper.getRegTransitSample(regTransitSample);
for (RegTransitSample transitSample : regTransitSampleList) {
if(transitSample.getBarcode() == null || transitSample.getBarcode().equals("")) continue;
regTransitSample.setBarcode(barcode.get(i));
SysUser sysUserOne = commonUtil.getSysUserOne(userId);
if(sysUserOne == null) return new Result("-1","未查询到员工信息!");
String nickName = sysUserOne.getNickName();
switch (status){
case "50": //标本签收
regTransitSample.setSignInTime(commonUtil.getCurrentTime());
regTransitSample.setSignInUserCode(userId);
System.out.println("名称:"+commonUtil.getSysUserOne(userId).toString());
regTransitSample.setSignInUserName(nickName);
break;
case "30": //标本送检
regTransitSample.setDstHospCode(dstHospCode);
regTransitSample.setDstHospName(dstHospName);
break;
case "100": //标本退回
regTransitSample.setBackReasons(backReasons);
regTransitSample.setBackUserCode(userId);
regTransitSample.setBackUserName(nickName);
regTransitSample.setBackTime(commonUtil.getCurrentTime());
break;
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());
regTransitSample.setStatus(status);
regTransitSample.setUpdate_by(userId);
regTransitSample.setUpdate_time(commonUtil.getCurrentTime());
regTransitSampleMapper.updateRegTransitSample(regTransitSample);
}
return new Result("0","成功!");
return new Result("0","签收成功!");
}
/**
* 标本退回
* @param barcode
* @param userId
* @param status
* @return
*/
@Override
public Result sampleSignBack(List<String> barcode, String userId, String status) {
return new Result("0","退回成功!");
}
@Override
public List<RegTransitSample> getSampleSignBack(RegTransitSample regTransitSample) {
return regTransitSampleMapper.getRegTransitSampleSignBack(regTransitSample);
}
/**
* 获取门诊申请单数据
* @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 OrderTime,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 OrderTime,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>