Compare commits

..

No commits in common. "fa0fc0d3616a2247774c420150a7958a94c37250" and "6dbebb37f3bc4b7f5888554ce9033ea3c6708e98" have entirely different histories.

116 changed files with 356 additions and 28619 deletions

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="com.codeverse.userSettings.MarscodeWorkspaceAppSettingsState">
<option name="chatAppRouterInfo" value="chat-session" />
<option name="progress" value="0.42" />
</component>
</project>

View File

@ -1,7 +1,7 @@
package com.czblood.bus.cache;
import com.alibaba.fastjson2.JSONArray;
import com.czblood.bus.pojo.xtwh.XkDmzd;
import com.czblood.bus.pojo.XkDmzd;
import com.czblood.common.constant.CacheConstants;
import com.czblood.common.core.redis.RedisCache;
import com.czblood.common.utils.StringUtils;

View File

@ -1,11 +1,15 @@
package com.czblood.bus.cache;
import com.czblood.bus.pojo.xtwh.XkParameter;
import com.alibaba.fastjson2.JSONArray;
import com.czblood.bus.pojo.XkDmzd;
import com.czblood.bus.pojo.XkParameter;
import com.czblood.common.constant.CacheConstants;
import com.czblood.common.core.redis.RedisCache;
import com.czblood.common.utils.StringUtils;
import com.czblood.common.utils.spring.SpringUtils;
import java.util.Collection;
import java.util.List;
/**
* 参数缓存

View File

@ -1,8 +1,5 @@
package com.czblood.bus.constants;
/**
* 接口常量类
*/
public class BloodInterfaceTypeConstants {
/**
* 申请单审核
@ -20,8 +17,4 @@ public class BloodInterfaceTypeConstants {
* 输血前评估
*/
public static final String BEFORE_ASSESS = "BEFORE_ASSESS";
/**
* 使用his接口验证密码
*/
public static final String HIS_USE_PASSWORD = "HIS_USE_PASSWORD";
}

View File

@ -8,12 +8,4 @@ public class BloodPrintTypeConstants {
* 输血前评估单
*/
public static final String ASSESS_BEFORE = "ASSESS_BEFORE";
/**
* 知情同意书1
*/
public static final String INFORMED_CONSENT_1 = "INFORMED_CONSENT_1";
/**
* 知情同意书2
*/
public static final String INFORMED_CONSENT_2 = "INFORMED_CONSENT_2";
}

View File

@ -5,7 +5,4 @@ package com.czblood.bus.constants;
*/
public class BloodSysLogConstants {
public static final String LOG_TYPE_TRANSFUSE_APPLY_BEFORE = "输血前评估";
public static final String LOG_TYPE_YLJG = "医疗机构";
public static final String LOG_TYPE_DMZD = "代码字典";
public static final String LOG_TYPE_TRANSFUSE_APPLY = "输血申请";
}

View File

@ -1,19 +1,11 @@
package com.czblood.bus.controller;
import com.czblood.bus.mapper.XkProTransfuseProjectMapper;
import com.czblood.bus.mapper.XkXtwhIllDiagnoseMapper;
import com.czblood.bus.pojo.*;
import com.czblood.bus.pojo.inter.HisUsePasswordRequest;
import com.czblood.bus.pojo.xtwh.XkBloodBreed;
import com.czblood.bus.pojo.xtwh.XkDmzd;
import com.czblood.bus.pojo.xtwh.XkXtwhIllDiagnose;
import com.czblood.bus.pojo.XkBloodBreed;
import com.czblood.bus.pojo.XkDmzd;
import com.czblood.bus.pojo.XkProTransfuseProject;
import com.czblood.bus.utils.BloodBankUtil;
import com.czblood.bus.utils.BloodInterfaceUtil;
import com.czblood.common.core.controller.BaseController;
import com.czblood.common.core.domain.Result;
import com.czblood.common.core.domain.entity.SysUser;
import com.czblood.common.core.page.TableDataInfo;
import com.czblood.common.utils.SecurityUtils;
import com.czblood.system.util.CommonUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -25,7 +17,7 @@ import java.util.List;
@Api(tags = "公共接口")
@RestController
@RequestMapping("/bus/common")
public class BloodCommonController extends BaseController {
public class BloodCommonController {
@Resource
private XkProTransfuseProjectMapper xkProTransfuseProjectMapper;
@ -33,8 +25,6 @@ public class BloodCommonController extends BaseController {
private BloodBankUtil bloodBankUtil;
@Resource
CommonUtil commonUtil;
@Resource
XkXtwhIllDiagnoseMapper xkXtwhIllDiagnoseMapper;
@ApiOperation("获取输血前检验项目")
@PostMapping("/queryLisProject")
@ -75,45 +65,6 @@ public class BloodCommonController extends BaseController {
public Result getBloodBreed(){
List<XkBloodBreed> bloodBreedList = bloodBankUtil.getBloodBreed();
return new Result("0","获取数据成功!",bloodBreedList);
}
@ApiOperation("查询诊断信息")
@GetMapping("/queryDiagnose")
public TableDataInfo queryDiagnose(XkXtwhIllDiagnose xkXtwhIllDiagnose){
startPage();
List<XkXtwhIllDiagnose> xkXtwhIllDiagnoseList = xkXtwhIllDiagnoseMapper.queryList(xkXtwhIllDiagnose);
return getDataTable(xkXtwhIllDiagnoseList);
}
/**
* 校验用户名和密码是否成功
* @return
*/
@ApiOperation("校验用户名和密码是否成功")
@GetMapping("/checkLoginAffirm")
public Result checkLoginAffirm(String userId,String password){
String hisUsedpass = bloodBankUtil.getParameterValue("HIS_usedpass");
if(hisUsedpass.equals("Y")){
//使用his接口验证密码
HisUsePasswordRequest hisUsePasswordRequest = new HisUsePasswordRequest();
hisUsePasswordRequest.setUserId(userId);
hisUsePasswordRequest.setPassword(password);
Result result = BloodInterfaceUtil.invokeBloodInterface(hisUsePasswordRequest);
if(!result.getCode().equals("0")) return result;
}else{
//使用本地密码校验
SysUser userInfo = bloodBankUtil.getUserInfo(userId);
boolean match = SecurityUtils.matchesPassword(password, userInfo.getPassword());
if(!match) return new Result("1","密码错误!");
}
return new Result("0","校验成功!");
}
// @ApiOperation("测试接口")
// @GetMapping("/test01")
// public Result test01(String billNo){
// XkTransfuseApply xkTransfuseApply = xkTransfuseApplyMapper.queryOne(billNo);
// return new Result("0","查询成功!",xkTransfuseApply);
// }
}

View File

@ -1,9 +1,7 @@
package com.czblood.bus.mapper;
import java.math.BigDecimal;
import java.util.Map;
public interface BloodBankMapper {
void spProduceMaxvalue(Map<String,Object> map);
BigDecimal getApplyTransNum(String bloodBreed);
}

View File

@ -0,0 +1,10 @@
package com.czblood.bus.mapper;
import com.czblood.bus.pojo.XkHosInfo;
import java.util.List;
public interface XKHosInfoMapper {
List<XkHosInfo> query(XkHosInfo xkHosInfo);
}

View File

@ -1,7 +0,0 @@
package com.czblood.bus.mapper;
import com.czblood.bus.pojo.xtwh.XkBloodApplyTrans;
public interface XkBloodApplyTransMapper {
XkBloodApplyTrans queryOne(String blood_breed);
}

View File

@ -1,10 +1,9 @@
package com.czblood.bus.mapper;
import com.czblood.bus.pojo.xtwh.XkBloodBreed;
import com.czblood.bus.pojo.XkBloodBreed;
import java.util.List;
public interface XkBloodBreedMapper {
List<XkBloodBreed> queryList(XkBloodBreed xkBloodBreed);
XkBloodBreed queryOne(String breed_code);
}

View File

@ -1,9 +0,0 @@
package com.czblood.bus.mapper;
import com.czblood.bus.pojo.XkCausalisSet;
import java.util.List;
public interface XkCausalisSetMapper {
List<XkCausalisSet> queryList(XkCausalisSet xkCausalisSet);
}

View File

@ -1,9 +0,0 @@
package com.czblood.bus.mapper;
import com.czblood.bus.pojo.XkCheckBloodtype;
import java.util.List;
public interface XkCheckBloodtypeMapper {
List<XkCheckBloodtype> queryList(XkCheckBloodtype xkCheckBloodtype);
}

View File

@ -1,12 +1,9 @@
package com.czblood.bus.mapper;
import com.czblood.bus.pojo.xtwh.XkDmzd;
import com.czblood.bus.pojo.XkDmzd;
import java.util.List;
public interface XkDmzdMapper {
List<XkDmzd> queryList(XkDmzd xkDmzd);
void insertXkDmzd(XkDmzd xkDmzd);
void updateXkDmzd(XkDmzd xkDmzd);
void deleteXkDmzd(XkDmzd xkDmzd);
}

View File

@ -1,13 +0,0 @@
package com.czblood.bus.mapper;
import com.czblood.bus.pojo.xtwh.XkHosInfo;
import java.util.List;
public interface XkHosInfoMapper {
List<XkHosInfo> queryList(XkHosInfo xkHosInfo);
XkHosInfo queryOne(String hospital_code);
void insert(XkHosInfo xkHosInfo);
void update(XkHosInfo xkHosInfo);
}

View File

@ -1,6 +1,6 @@
package com.czblood.bus.mapper;
import com.czblood.bus.pojo.xtwh.XkParameter;
import com.czblood.bus.pojo.XkParameter;
public interface XkParameterMapper {
XkParameter queryOne(String parameter_code);

View File

@ -9,5 +9,4 @@ public interface XkPatientInfoMapper {
void insertXkPatientInfo(XkPatientInfo xkPatientInfo);
void deleteXkPatientInfo(String beinhos_id);
void updateXkPatientInfo(XkPatientInfo xkPatientInfo);
XkPatientInfo queryOne(String beinhos_id);
}

View File

@ -1,10 +0,0 @@
package com.czblood.bus.mapper;
import com.czblood.bus.pojo.XkTransfuseApplyApproval;
public interface XkTransfuseApplyApprovalMapper {
XkTransfuseApplyApproval queryOneByBillNo(String billNo);
void insert(XkTransfuseApplyApproval xkTransfuseApplyApproval);
void update(XkTransfuseApplyApproval xkTransfuseApplyApproval);
void delete(String billNo);
}

View File

@ -1,7 +1,6 @@
package com.czblood.bus.mapper;
import com.czblood.bus.pojo.XkTransfuseApplyBefore;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -10,5 +9,4 @@ public interface XkTransfuseApplyBeforeMapper {
void insertXkTransfuseApplyBefore(XkTransfuseApplyBefore xkTransfuseApplyBefore);
void updateXkTransfuseApplyBefore(XkTransfuseApplyBefore xkTransfuseApplyBefore);
void deleteXkTransfuseApplyBefore(String bill_no);
XkTransfuseApplyBefore queryOne(String bill_no);
}

View File

@ -6,7 +6,4 @@ import java.util.List;
public interface XkTransfuseApplyBloodbreedMapper {
List<XkTransfuseApplyBloodbreed> queryList(XkTransfuseApplyBloodbreed xkTransfuseApplyBloodbreed);
List<XkTransfuseApplyBloodbreed> queryOne(String bill_no);
void insert(XkTransfuseApplyBloodbreed xkTransfuseApplyBloodbreed);
void update(XkTransfuseApplyBloodbreed xkTransfuseApplyBloodbreed);
}

View File

@ -6,8 +6,4 @@ import java.util.List;
public interface XkTransfuseApplyCausalisMapper {
List<XkTransfuseApplyCausalis> queryList(XkTransfuseApplyCausalis xkTransfuseApplyCausalis);
List<XkTransfuseApplyCausalis> queryListByBillNo(String billNo);
void deleteByBillNo(String billNo);
void insert(XkTransfuseApplyCausalis xkTransfuseApplyCausalis);
void update(XkTransfuseApplyCausalis xkTransfuseApplyCausalis);
}

View File

@ -7,6 +7,4 @@ import java.util.List;
public interface XkTransfuseApplyMapper {
List<XkTransfuseApply> queryList(XkTransfuseApply xkTransfuseApply);
XkTransfuseApply queryOne(String billNo);
void insert(XkTransfuseApply xkTransfuseApply);
void update(XkTransfuseApply xkTransfuseApply);
}

View File

@ -1,9 +0,0 @@
package com.czblood.bus.mapper;
import com.czblood.bus.pojo.xtwh.XkXtwhIllDiagnose;
import java.util.List;
public interface XkXtwhIllDiagnoseMapper {
List<XkXtwhIllDiagnose> queryList(XkXtwhIllDiagnose xkXtwhIllDiagnose);
}

View File

@ -1,9 +0,0 @@
package com.czblood.bus.mapper;
import com.czblood.bus.pojo.xtwh.XkXtwhIll;
import java.util.List;
public interface XkXtwhIllMapper {
List<XkXtwhIll> queryList(XkXtwhIll xkXtwhIll);
}

View File

@ -1,6 +1,5 @@
package com.czblood.bus.pojo;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -10,7 +9,6 @@ import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("打印入参")
public class ReportParam {
private String billNo;
private String beinhosId;

View File

@ -1,7 +1,5 @@
package com.czblood.bus.pojo.xtwh;
package com.czblood.bus.pojo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -12,13 +10,9 @@ import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("血液品种")
public class XkBloodBreed {
@ApiModelProperty("血液品种代码")
private String breed_code;
@ApiModelProperty("血液品种名称")
private String breed_name;
@ApiModelProperty("血液品种大类")
private String blood_kind;
private String breed_yard;
private String breed_liquid;

View File

@ -1,45 +0,0 @@
package com.czblood.bus.pojo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("输血指征设置")
public class XkCausalisSet {
@ApiModelProperty("输血指征代码")
private String Causalis_Code;
@ApiModelProperty("科室类型,A手术科室,B非手术科室")
private String Dept_Type;
@ApiModelProperty("判断方式,N人工判断,Y系统判断,W待定")
private String Causalis_Type;
@ApiModelProperty("血液品种")
private String Blood_Breed;
@ApiModelProperty("检验项目名称")
private String Pro_Name;
@ApiModelProperty("检验结果值1")
private String Test_Value;
@ApiModelProperty("比较表达式,>,<,≥,≤,between")
private String Result_Expression;
@ApiModelProperty("输血指征名称")
private String Causalis_Name;
@ApiModelProperty("输血合理性标志,Y合理,N不合理")
private String Causalis_Result;
@ApiModelProperty("使用标志,Y使用,N不使用")
private String Use_Sign;
@ApiModelProperty("排序")
private Integer Sequence;
private Date Last_Modified;
@ApiModelProperty("类别,对应字典当中的operatype,nooperatype")
private String Use_Type;
@ApiModelProperty("补充说明")
private String Explain;
@ApiModelProperty("检验结果值2")
private String Test_Value2;
}

View File

@ -1,40 +0,0 @@
package com.czblood.bus.pojo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class XkCheckBloodtype {
private String bill_no;
private String apply_no;
private String beinhos_id;
private String patient_name;
private String dept_id;
private String check_abo;
private String check_fabo;
private String affirm_abo;
private String check_rh;
private String antibody1;
private String antibody2;
private String antibody3;
private String affirm_antibody;
private String proteid_test;
private String test_person;
private Date test_date;
private String check_person;
private String input_person;
private Date input_date;
private String sample_id;
private String need_match;
private String bill_sort;
private String bill_status;
private String remark;
private String Sub_Blood;
private String bz1;
private String hos_id;
}

View File

@ -1,7 +1,5 @@
package com.czblood.bus.pojo.xtwh;
package com.czblood.bus.pojo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -11,25 +9,17 @@ import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("代码字典")
public class XkDmzd {
@ApiModelProperty("字典类别")
private String wordbook_sign;
@ApiModelProperty("字典代码")
private String wordbook_code;
private Integer sid;
@ApiModelProperty("字典名称")
private String wordbook_name;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("扩展字段1")
private String exp1;
private String exp2;
private String exp3;
private String exp4;
@ApiModelProperty("是否使用,Y代表使用,N代表不使用")
private String use_sign;
private Date last_modified;
private String exp5;
private String wordbook_code_old;
}

View File

@ -0,0 +1,23 @@
package com.czblood.bus.pojo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class XkHosInfo {
private String hospital_code;
private String hospital_name;
private String address;
private String post_code;
private String telno;
private String link_person;
private String org_kind;
private String foot_mode;
private String org_zone;
private String org_street;
private String sfby;
private String last_modified;
}

View File

@ -1,7 +1,5 @@
package com.czblood.bus.pojo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -9,27 +7,16 @@ import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("员工信息表")
public class XkOperatorInfo {
@ApiModelProperty("员工ID")
private String operator_id;
@ApiModelProperty("员工姓名")
private String operator_name;
@ApiModelProperty("员工密码")
private String pwd;
@ApiModelProperty("工作组")
private String work_group;
@ApiModelProperty("部门")
private String dept;
@ApiModelProperty("员工类型")
private String operator_type;
@ApiModelProperty("拼音")
private String py;
@ApiModelProperty("输血科主任")
private String is_bank_director;
@ApiModelProperty("医务部负责人")
private String is_medical_director;
@ApiModelProperty("职称")
private String postname;
private String sign_pic;
private String vshiscode;

View File

@ -1,6 +1,5 @@
package com.czblood.bus.pojo.xtwh;
package com.czblood.bus.pojo;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -10,7 +9,6 @@ import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("系统参数")
public class XkParameter {
private String parameter_code;
private String module_code;

View File

@ -7,7 +7,6 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
import java.util.Date;
@Data
@ -18,10 +17,8 @@ public class XkPatientInfo {
@ApiModelProperty("医疗机构ID")
private String hos_id;
@ApiModelProperty("住院号")
@NotBlank(message = "住院号不能为空")
private String beinhos_id;
@ApiModelProperty("病人姓名")
@NotBlank(message = "病人姓名不能为空")
private String patient_name;
@ApiModelProperty("病人性别")
private String patient_sex;
@ -45,7 +42,7 @@ public class XkPatientInfo {
private String gestation_history;
@ApiModelProperty("分娩史")
private String parturition_history;
@ApiModelProperty("移植配型史")
@ApiModelProperty("配型史")
private String match_history;
@ApiModelProperty("器官移植史")
private String transplant_history;
@ -53,6 +50,4 @@ public class XkPatientInfo {
private Date last_modified;
@ApiModelProperty("住院次数")
private String times;
@ApiModelProperty("病人唯一ID")
private String beinhos_number;
}

View File

@ -1,7 +1,6 @@
package com.czblood.bus.pojo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -12,19 +11,15 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
@ApiModel(value = "输血前检查项目")
public class XkProTransfuseProject {
@ApiModelProperty("序号")
private Integer sid;
@ApiModelProperty("项目名称")
private String pro_name;
private String result_type;
private String unit;
private String need;
@ApiModelProperty("lis项目名称")
private String lis_name;
private String max_value;
private String min_value;
private String upload_flag;
private String Pro_Name_All;
@ApiModelProperty("有效时间")
private Float ValidTime;
}

View File

@ -27,125 +27,73 @@ public class XkTransfuseApply {
@ApiModelProperty("床号")
private String patient_bed;
private String casehistory_id;
@ApiModelProperty("输血史")
private String transfuse_history;
@ApiModelProperty("输血反应史")
private String reaction_history;
@ApiModelProperty("妊娠史")
private String gestation_history;
@ApiModelProperty("分娩史")
private String parturition_history;
@ApiModelProperty("移植配型史")
private String match_history;
@ApiModelProperty("器官移植史")
private String transplant_history;
private String dept_id;
@ApiModelProperty("申请时间")
private Date apply_date;
private String send_person;
@ApiModelProperty("收费标志")
private String charge_sign;
@ApiModelProperty("输入人")
private String input_person;
@ApiModelProperty("接收时间")
private Date receive_date;
@ApiModelProperty("主治医师")
private String attending_medic;
@ApiModelProperty("上级医师")
private String treat_medic;
@ApiModelProperty("输血指征")
private String causalis;
@ApiModelProperty("输血科主任")
private String bank_director;
@ApiModelProperty("医务部负责人")
private String medical_affairs;
@ApiModelProperty("对应的条码ID")
private String sample_id;
@ApiModelProperty("采集时间")
private Date gather_date;
@ApiModelProperty("ABO血型")
private String abo_type;
@ApiModelProperty("RH血型")
private String rh_type;
@ApiModelProperty("审核标志")
private String check_sign;
@ApiModelProperty("审核意见")
private String check_explain;
@ApiModelProperty("状态(A=未审核、B=已审核、C=已配血、D=已发血、Z=作废、BD=未补录、W=已补录、F=已复核血型、S=已追加配血、N=审核未通过)")
@ApiModelProperty("状态")
private String bill_stasus;
private String bill_type;
@ApiModelProperty("申请医生")
private String apply_medic;
@ApiModelProperty("诊断")
private String diagnoses;
@ApiModelProperty("输血目的")
private String intent;
@ApiModelProperty("申请单类型")
private String apply_type;
@ApiModelProperty("第一次输血时间")
private Date use1_date;
@ApiModelProperty("第二次输血时间")
private Date use2_date;
@ApiModelProperty("第三次输血时间")
private Date use3_date;
private String remark;
@ApiModelProperty("预约入库标志(N=否、Y=是)")
private String is_plan;
@ApiModelProperty("单据类别(A,B,C,D,J)")
private String bill_sort;
@ApiModelProperty("是否有标本申请")
private String sample_sign;
@ApiModelProperty("输入科室")
private String input_dept;
@ApiModelProperty("上级医师审核标志")
private String send_able;
@ApiModelProperty("上级医师审核时间")
private Date medic_check_date;
@ApiModelProperty("审核医生")
private String check_medic;
@ApiModelProperty("是否大量用血(N=否、Y=是)")
private String is_large_use;
@ApiModelProperty("操作类型(C输血申请,Z自体血申请单,S为输血治疗单)")
private String operation_type;
@ApiModelProperty("血型复核结果与申请单的血型不一致继续配血标志(N=否、Y=是)")
private String bloodcheck_abnor;
@ApiModelProperty("当血型复核结果与申请单的血型不一致时,输血申请单是否可以继续进行下一步的流程操作,Y表示可以,N表示不可以")
private String abnor_next;
@ApiModelProperty("是否同意配血(N=否、Y=是)")
private String agreement_ink;
private String exp1;
private String exp2;
private String exp3;
private String exp4;
@ApiModelProperty("最后修改时间")
private Date last_modified;
@ApiModelProperty("通知标志")
private String notify_sign;
@ApiModelProperty("联系手机")
private String adm_no;
private BigDecimal Use1_Num;
private BigDecimal Use2_Num;
private BigDecimal Use3_Num;
@ApiModelProperty("科室类型(A手术科室,B非手术科室)")
private String Dept_Type;
private String use_type;
@ApiModelProperty("单病种")
private String Ill_Code;
@ApiModelProperty("手术名称")
private String Ops_Name;
private String isemergency;
@ApiModelProperty("是否合理(不合理N,待定W,合理Y)")
private String Valid_Flag;
@ApiModelProperty("通知消息确认标志(N=否、Y=是)")
private String notice_yn;
@ApiModelProperty("his系统申请单号")
private String his_SerialNo;
@ApiModelProperty("输血评估单")
private String assess_bill_no;
@ApiModelProperty("手术名称")
private String operation_name;
@ApiModelProperty("手术级别")
private String operation_level;
@ApiModelProperty("身份证号")
private String card_no;
}

View File

@ -1,7 +1,5 @@
package com.czblood.bus.pojo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -12,16 +10,13 @@ import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("大量用血审批")
public class XkTransfuseApplyApproval {
private String Bill_No;
private String Archiater;
private Date Archiater_CheckTime;
private String Medical_Dept;
private Date Medical_CheckTime;
@ApiModelProperty("2级审批,科主任审批,3级审批,需要科主任和医务部审批")
private String ApplyLevel;
@ApiModelProperty("是否审批标志")
private String Flag;
private BigDecimal SID;
}

View File

@ -1,63 +1,33 @@
package com.czblood.bus.pojo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("输血前评估")
public class XkTransfuseApplyBefore {
@ApiModelProperty("单据编号")
private String bill_no;
@ApiModelProperty("住院号")
@NotBlank(message = "住院号不能为空")
private String beinhos_id;
@ApiModelProperty("科室ID")
private String dept_id;
@ApiModelProperty("病区ID")
private String zone_id;
@ApiModelProperty("是否签署同意书")
private String agreement_ink;
@ApiModelProperty("出血量")
private BigDecimal blood_loss;
@ApiModelProperty("申请时间")
@NotBlank(message = "申请时间不允许为空")
private Date assess_data;
@ApiModelProperty("申请人")
@NotBlank(message = "申请人不能为空")
private String assess_person;
@ApiModelProperty("申请血液品种")
private String blood_breed;
@ApiModelProperty("申请血量")
private BigDecimal blood_num;
@ApiModelProperty("申请单位")
private String unit;
@ApiModelProperty("输血目的")
private String intent;
@ApiModelProperty("诊断")
private String diagnoses;
@ApiModelProperty("病人床号")
private String patient_bed;
@ApiModelProperty("贫血程度")
private String anemia;
private String metabolism;
private String cruor;
@ApiModelProperty("病情概要")
private String bqgy;
@ApiModelProperty("医疗机构ID")
private String hos_id;
@ApiModelProperty("单据状态,1保存状态,2使用状态,0作废")
private String bill_status;
private Date stime;
private Date etime;
}

View File

@ -1,7 +1,5 @@
package com.czblood.bus.pojo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -11,28 +9,18 @@ import java.math.BigDecimal;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("输血申请单品种")
public class XkTransfuseApplyBloodbreed {
@ApiModelProperty("单据编号")
private String bill_no;
@ApiModelProperty("血液品种")
private String blood_breed;
@ApiModelProperty("申请输血量")
private BigDecimal blood_num;
@ApiModelProperty("申请单位")
private String unit;
@ApiModelProperty("特殊处理")
private String special_deal;
private BigDecimal onetime_num;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("替代品种")
private String replace_bloodbreed;
private String apply_bloodtype;
private BigDecimal ops_bleeding;
private BigDecimal ops_fact_use;
@ApiModelProperty("输血目的")
private String intent;
@ApiModelProperty("输血指征")
private String causalis;
}

View File

@ -1,7 +1,5 @@
package com.czblood.bus.pojo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -9,27 +7,15 @@ import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("输血指征")
public class XkTransfuseApplyCausalis {
@ApiModelProperty("输血申请单编号")
private String Bill_No;
@ApiModelProperty("医疗机构ID")
private String Hos_ID;
private Integer SID;
@ApiModelProperty("输血指征代码")
private String Causalis_Code;
@ApiModelProperty("输血指征类别")
private String Causalis_Type;
@ApiModelProperty("输血指征名称")
private String Causalis_Name;
@ApiModelProperty("输血指征结果标志")
private String Causalis_Result;
@ApiModelProperty("使用标志")
private String Use_Flag;
@ApiModelProperty("上传标志")
private String Upload_Flag;
@ApiModelProperty("备注说明")
private String Explain;
@ApiModelProperty("实际值")
private String testValue;
}

View File

@ -1,7 +1,5 @@
package com.czblood.bus.pojo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -11,19 +9,12 @@ import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("输血申请单检验项目")
public class XkTransfuseApplyTestitem {
@ApiModelProperty("单据编号")
private String bill_no;
private Integer sid;
@ApiModelProperty("检验项目名称")
private String item_name;
@ApiModelProperty("检验项目结果")
private String item_result;
@ApiModelProperty("检验项目单位")
private String Item_unit;
@ApiModelProperty("检验项目时间")
private Date test_date;
@ApiModelProperty("上传标志")
private String upload_flag;
}

View File

@ -1,21 +0,0 @@
package com.czblood.bus.pojo.inter;
import cn.hutool.json.JSONUtil;
import com.czblood.bus.constants.BloodInterfaceTypeConstants;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class HisUsePasswordRequest implements BloodInterfaceType {
private final String method = BloodInterfaceTypeConstants.HIS_USE_PASSWORD;
private String userId;
private String password;
@Override
public String serializationJson() {
return JSONUtil.toJsonStr(this);
}
}

View File

@ -1,22 +0,0 @@
package com.czblood.bus.pojo.xtwh;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class XkBloodApplyTrans {
private String SID;
private String Blood_Breed;
private BigDecimal Capacity;
private String Unit;
private BigDecimal ApplyNum;
private String Unit2;
private String Flag;
private String Blood_Kind;
}

View File

@ -1,37 +0,0 @@
package com.czblood.bus.pojo.xtwh;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("医院信息")
public class XkHosInfo {
@ApiModelProperty("医院编码")
private String hospital_code;
@ApiModelProperty("医院名称")
private String hospital_name;
@ApiModelProperty("医院地址")
private String address;
@ApiModelProperty("邮政编码")
private String post_code;
@ApiModelProperty("电话")
private String telno;
@ApiModelProperty("联系人")
private String link_person;
@ApiModelProperty("类型")
private String org_kind;
@ApiModelProperty("结算类型")
private String foot_mode;
@ApiModelProperty("所属行政区")
private String org_zone;
@ApiModelProperty("所属街道")
private String org_street;
@ApiModelProperty(value = "使用标志,Y使用,N不使用")
private String sfby;
private String last_modified;
}

View File

@ -1,17 +0,0 @@
package com.czblood.bus.pojo.xtwh;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("单病种")
public class XkXtwhIll {
private String Ill_Code;
private String Ill_Name;
private String Use_Sign;
private String Remark;
}

View File

@ -1,18 +0,0 @@
package com.czblood.bus.pojo.xtwh;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("疾病诊断")
public class XkXtwhIllDiagnose {
private String Ill_Code;
private String Dia_Code;
private String Dia_Name;
private String Dia_Pym;
private String Remark;
}

View File

@ -1,27 +1,24 @@
package com.czblood.bus.system;
import com.czblood.bus.mapper.XkHosInfoMapper;
import com.czblood.bus.mapper.XKHosInfoMapper;
import com.czblood.bus.mapper.XkOperatorInfoMapper;
import com.czblood.bus.pojo.xtwh.XkDmzd;
import com.czblood.bus.pojo.xtwh.XkHosInfo;
import com.czblood.bus.pojo.XkHosInfo;
import com.czblood.bus.pojo.XkOperatorInfo;
import com.czblood.bus.utils.BloodBankUtil;
import com.czblood.common.core.domain.Result;
import com.czblood.common.core.domain.entity.SysDept;
import com.czblood.common.core.domain.entity.SysLoginParam;
import com.czblood.common.core.domain.entity.SysUser;
import com.czblood.common.core.domain.model.LoginParam;
import com.czblood.common.core.domain.model.LoginUser;
import com.czblood.common.utils.SecurityUtils;
import com.czblood.system.mapper.SysDeptMapper;
import com.czblood.common.utils.StringUtils;
import com.czblood.system.mapper.SysUserMapper;
import com.czblood.system.service.ExtSystemInterface;
import com.czblood.system.service.ISysConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
/**
* 登录接口
@ -30,62 +27,41 @@ import java.util.stream.Collectors;
public class BloodExtInterfaceService implements ExtSystemInterface {
@Resource
XkHosInfoMapper xkHosInfoMapper;
XKHosInfoMapper xkHosInfoMapper;
@Resource
XkOperatorInfoMapper xkOperatorInfoMapper;
@Autowired
private SysUserMapper userMapper;
// @Autowired
// private ISysConfigService configService;
@Resource
SysDeptMapper sysDeptMapper;
@Resource
BloodBankUtil bloodBankUtil;
@Autowired
private ISysConfigService configService;
@Override
public Result syncUser(String loginYLJG) {
//同步科室
Result result = syncDept();
if(!result.getCode().equals("0")) return result;
int deptCount = Integer.parseInt(result.getData().toString());
//同步用户
public Result syncUser() {
XkOperatorInfo xkOperatorInfo = new XkOperatorInfo();
List<XkOperatorInfo> xkOperatorInfoList = xkOperatorInfoMapper.queryList(xkOperatorInfo);
SysUser sysUser2 = new SysUser();
List<SysUser> sysUserList = userMapper.selectUserList(sysUser2);
SysDept sysDept = new SysDept();
List<SysDept> sysDeptList = sysDeptMapper.selectDeptList(sysDept);
int j = 0;
long deptId = 0L;
for (XkOperatorInfo operatorInfo : xkOperatorInfoList) {
// 验证是否存在这个用户
List<SysUser> collect = sysUserList.stream().filter(sysUser1 -> BloodBankUtil.isBank(sysUser1.getUserName()).equals(operatorInfo.getOperator_id())).collect(Collectors.toList());
if(!collect.isEmpty()) continue;
SysUser u = userMapper.selectUserByUserName(operatorInfo.getOperator_id());
if(!StringUtils.isNull(u)) continue;
SysUser sysUser = new SysUser();
//查询科室ID
SysDept sysDept1 = sysDeptList.stream().filter(sysDept2 -> BloodBankUtil.isBank(sysDept2.getDeptCode()).equals(operatorInfo.getDept())).findFirst().orElse(null);
if(sysDept1 != null) deptId = sysDept1.getDeptId();
sysUser.setDeptId(deptId);
sysUser.setDeptId(101L);
sysUser.setUserName(operatorInfo.getOperator_id());
sysUser.setNickName(operatorInfo.getOperator_name());
sysUser.setUserType("00");
sysUser.setSex("1");
sysUser.setPassword(SecurityUtils.encryptPassword(operatorInfo.getPwd()));
String password = configService.selectConfigByKey("sys.user.initPassword");
sysUser.setPassword(SecurityUtils.encryptPassword(password));
sysUser.setStatus("0");
sysUser.setCreateBy("admin");
sysUser.setPostname(operatorInfo.getPostname());
sysUser.setWorkgroup(operatorInfo.getWork_group());
sysUser.setOperator_type(operatorInfo.getOperator_type());
sysUser.setIs_bank_director(operatorInfo.getIs_bank_director());
sysUser.setIs_medical_director(operatorInfo.getIs_medical_director());
//sysUser.setVshisuser(operatorInfo.getVshiscode());
sysUser.setHos_id(loginYLJG);
sysUser.setVshisuser(operatorInfo.getVshiscode());
sysUser.setYljg("602"); //以前老的输血系统没有医疗机构的概念,所以这里先给个之前的默认值
sysUser.setDelFlag("0");
userMapper.insertUser(sysUser);
j++;
}
return new Result("0","导入成功,员工共有:"+j+"条数据导入,科室:共有:"+deptCount+"条数据导入!");
return new Result("0","导入成功,共有:"+j+"条数据导入!");
}
@ -101,42 +77,6 @@ public class BloodExtInterfaceService implements ExtSystemInterface {
@Override
public Object gethospList() {
XkHosInfo xkHosInfo = new XkHosInfo();
xkHosInfo.setSfby("Y");
return xkHosInfoMapper.queryList(xkHosInfo);
}
/**
* 同步科室
* @return
*/
public Result syncDept(){
int j = 0;
List<XkDmzd> xkDmzdList = bloodBankUtil.setDictCacheList("ks");
SysDept sysDept = new SysDept();
List<SysDept> sysDeptList = sysDeptMapper.selectDeptList(sysDept);
for (XkDmzd xkDmzd : xkDmzdList) {
List<SysDept> collect = sysDeptList.stream().filter(sysDept1 -> BloodBankUtil.isBank(sysDept1.getDeptCode()).equals(xkDmzd.getWordbook_code())).collect(Collectors.toList());
if(!collect.isEmpty()) continue;
sysDept = new SysDept();
sysDept.setParentId(100L);
sysDept.setAncestors("0,100");
sysDept.setDeptName(xkDmzd.getWordbook_name());
sysDept.setOrderNum(1);
sysDept.setDelFlag("0");
String useSign = xkDmzd.getUse_sign();
sysDept.setDeptCode(xkDmzd.getWordbook_code());
if(useSign.equals("Y")) {
useSign = "1";
}else{
useSign = "0";
}
sysDept.setStatus(useSign);
sysDept.setCreateBy("admin");
sysDept.setCreateTime(bloodBankUtil.getCurrentTimeDate());
sysDeptMapper.insertDept(sysDept);
j++;
}
return new Result("0","导入成功,共有:"+j+"条数据导入!",j);
return xkHosInfoMapper.query(xkHosInfo);
}
}

View File

@ -1,76 +0,0 @@
package com.czblood.bus.system;
import com.czblood.bus.mapper.XkDmzdMapper;
import com.czblood.bus.pojo.xtwh.XkDmzd;
import com.czblood.common.core.domain.entity.SysDept;
import com.czblood.system.mapper.SysDeptMapper;
import com.czblood.system.service.impl.SysDeptServiceImpl;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
@Primary
public class BloodSysDeptServiceImpl extends SysDeptServiceImpl {
@Resource
XkDmzdMapper xkDmzdMapper;
@Resource
SysDeptMapper sysDeptMapper;
@Override
public int insertDept(SysDept dept) {
int i = super.insertDept(dept);
if(i <= 0) return i;
//兼容逻辑,向输血系统字典表中增加科室信息
XkDmzd xkDmzd = new XkDmzd();
xkDmzd.setWordbook_sign("ks");
xkDmzd.setWordbook_code(dept.getDeptCode());
xkDmzd.setWordbook_name(dept.getDeptName());
xkDmzd.setUse_sign("Y");
xkDmzdMapper.insertXkDmzd(xkDmzd);
return 1;
}
/**
* 修改保存部门信息
*
* @param dept 部门信息
* @return 结果
*/
@Override
public int updateDept(SysDept dept) {
int i = super.updateDept(dept);
if(i <= 0) return i;
//兼容逻辑,向输血系统字典表中更新科室信息
XkDmzd xkDmzd = new XkDmzd();
xkDmzd.setWordbook_sign("ks");
xkDmzd.setWordbook_code(dept.getDeptCode());
xkDmzd.setWordbook_name(dept.getDeptName());
xkDmzd.setWordbook_code_old(dept.getDeptCodeOld());
xkDmzd.setUse_sign(dept.getStatus().equals("0")?"Y":"N");
xkDmzdMapper.updateXkDmzd(xkDmzd);
return 1;
}
@Override
public int deleteDeptById(Long deptId) {
int i = super.deleteDeptById(deptId);
if(i <= 0) return i;
//兼容逻辑,向输血系统字典表中删除科室信息
SysDept sysDept = sysDeptMapper.selectDeptById(deptId);
if (sysDept == null) return i;
XkDmzd xkDmzd = new XkDmzd();
xkDmzd.setWordbook_sign("ks");
xkDmzd.setWordbook_code(sysDept.getDeptCode());
xkDmzd.setWordbook_sign(sysDept.getDelFlag().equals("0")?"Y":"N");
xkDmzdMapper.updateXkDmzd(xkDmzd);
return 1;
}
}

View File

@ -4,19 +4,19 @@ package com.czblood.bus.utils;
import cn.hutool.core.date.DateUtil;
import com.czblood.bus.cache.DmzdCache;
import com.czblood.bus.cache.OptionCache;
import com.czblood.bus.mapper.*;
import com.czblood.bus.pojo.xtwh.XkBloodBreed;
import com.czblood.bus.pojo.xtwh.XkDmzd;
import com.czblood.bus.pojo.xtwh.XkParameter;
import com.czblood.common.core.domain.entity.SysUser;
import com.czblood.system.mapper.SysUserMapper;
import com.czblood.bus.mapper.BloodBankMapper;
import com.czblood.bus.mapper.XkBloodBreedMapper;
import com.czblood.bus.mapper.XkDmzdMapper;
import com.czblood.bus.mapper.XkParameterMapper;
import com.czblood.bus.pojo.XkBloodBreed;
import com.czblood.bus.pojo.XkDmzd;
import com.czblood.bus.pojo.XkParameter;
import com.czblood.common.core.domain.Result;
import com.czblood.system.util.CommonUtil;
import org.springframework.data.redis.connection.ReactiveSubscription;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -35,10 +35,6 @@ public class BloodBankUtil {
CommonUtil commonUtil;
@Resource
XkBloodBreedMapper xkBloodBreedMapper;
@Resource
SysUserMapper sysUserMapper;
@Resource
XkBloodApplyTransMapper xkBloodApplyTransMapper;
/**
@ -49,8 +45,14 @@ public class BloodBankUtil {
public List<XkDmzd> getDictCache(String key){
List<XkDmzd> dictCache = DmzdCache.getDictCache(key);
//缓存没有命中,从数据库中取值
if(dictCache == null || dictCache.isEmpty()){
return setDictCacheList(key);
if(dictCache == null){
XkDmzd xkDmzd = new XkDmzd();
xkDmzd.setWordbook_sign( key);
List<XkDmzd> xkDmzdList = xkDmzdMapper.queryList(xkDmzd);
if(xkDmzdList == null) return null;
//设置缓存
DmzdCache.setDictCache(key,xkDmzdList);
return xkDmzdList;
}
return dictCache;
}
@ -63,7 +65,7 @@ public class BloodBankUtil {
*/
public XkDmzd getDictCacheOne(String dictType,String dictCode){
List<XkDmzd> dictCache = getDictCache(dictType);
if(dictCache == null || dictCache.isEmpty()) return null;
if(dictCache == null) return null;
List<XkDmzd> collect = dictCache.stream().filter(xkDmzd -> xkDmzd.getWordbook_code().equals(dictCode)).collect(Collectors.toList());
if(collect.size() > 0) {
return collect.get(0);
@ -72,33 +74,6 @@ public class BloodBankUtil {
}
}
public XkDmzd getDictCacheOneByName(String dictType,String dictName){
List<XkDmzd> dictCache = getDictCache(dictType);
if(dictCache == null || dictCache.isEmpty()) return null;
List<XkDmzd> collect = dictCache.stream().filter(xkDmzd -> xkDmzd.getWordbook_name().equals(dictName)).collect(Collectors.toList());
if(collect.size() > 0) {
return collect.get(0);
}else{
return null;
}
}
/**
* 设置字典缓存
* @param wordbook_sign
* @return
*/
public List<XkDmzd> setDictCacheList(String wordbook_sign){
XkDmzd xkDmzd = new XkDmzd();
xkDmzd.setWordbook_sign( wordbook_sign);
List<XkDmzd> xkDmzdList = xkDmzdMapper.queryList(xkDmzd);
if(xkDmzdList == null) return null;
//设置缓存
DmzdCache.setDictCache(wordbook_sign,xkDmzdList);
return xkDmzdList;
}
/**
* 根据参数编码获取参数值
* @param parameterCode
@ -108,11 +83,9 @@ public class BloodBankUtil {
XkParameter parameterCache = OptionCache.getOptCache(parameterCode);
if(parameterCache == null){
XkParameter xkParameter = xkParameterMapper.queryOne(parameterCode);
if(xkParameter == null) return "";
return BloodBankUtil.isBank(xkParameter.getParameter_value());
}else{
return BloodBankUtil.isBank(parameterCache.getParameter_value());
return xkParameter.getParameter_value();
}
return "";
}
@ -132,24 +105,9 @@ public class BloodBankUtil {
}
}
/**
* 根据单据类型生成单据编号
* @param type
* @return
*/
public String produceBillNo(String type){
String formatDate = DateUtil.format(commonUtil.getCurrentTimeDate(), "yyyyMMdd");
formatDate = formatDate.substring(2);
String maxNo = getMaxValue();
int length = maxNo.length();
String subMaxNo = "";
if(length > 4){
subMaxNo = maxNo.substring(length - 4);
}else{
// int len = position - length ;
subMaxNo = String.format("%04d", Integer.valueOf(maxNo));
}
return type + formatDate + subMaxNo;
return type + formatDate + getMaxValue();
}
public List<XkBloodBreed> getBloodBreed(){
@ -158,22 +116,4 @@ public class BloodBankUtil {
}
public String getCurrentTime(){
return commonUtil.getCurrentTime();
}
public Date getCurrentTimeDate(){
return commonUtil.getCurrentTimeDate();
}
public SysUser getUserInfo(String userId){
return sysUserMapper.selectUserByUserName(userId);
}
public BigDecimal getApplyTransNum(String bloodBreed,BigDecimal applyNum){
BigDecimal applyTransNum = bloodBankMapper.getApplyTransNum(bloodBreed);
//计算结果保留 2 位小数,采用四舍五入规则。
return applyNum.divide(applyTransNum,2, RoundingMode.HALF_UP);
}
}

View File

@ -7,18 +7,14 @@ import com.czblood.common.core.domain.Result;
import com.czblood.common.utils.file.FileUtils;
import com.czblood.common.utils.file.ImageUtils;
import com.czblood.common.utils.ip.IpUtils;
import com.lowagie.text.Document;
import com.lowagie.text.pdf.PdfCopy;
import com.lowagie.text.pdf.PdfReader;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.sql.DataSource;
import java.io.*;
import java.io.File;
import java.sql.Connection;
import java.util.List;
import java.util.Map;
import java.util.UUID;
@ -75,75 +71,4 @@ public class ReportUtil {
}
return httpPath;
}
/**
* 合并多个Base64编码的PDF为一个PDF文件
* @param base64PdfList 包含多个PDF的Base64字符串列表
* @param outputFilePath 合并后PDF的输出路径(如:D:/merged.pdf)
* @throws Exception 处理过程中的异常
*/
public static void mergeToFile(List<String> base64PdfList, String outputFilePath) throws Exception {
// 1. 合并所有PDF字节流为一个字节数组
byte[] mergedBytes = mergeBase64Pdfs(base64PdfList);
// 2. 将合并后的字节数组写入文件
try (FileOutputStream fos = new FileOutputStream(outputFilePath)) {
fos.write(mergedBytes);
}
log.info("PDF合并完成,输出路径:{}", outputFilePath);
}
/**
* 合并多个Base64编码的PDF为字节数组
*
* @param base64PdfList Base64字符串列表
* @return 合并后的PDF字节数组
* @throws Exception 处理异常
*/
private static byte[] mergeBase64Pdfs(List<String> base64PdfList) throws Exception {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
Document document = null;
PdfCopy pdfCopy = null;
try {
for (int i = 0; i < base64PdfList.size(); i++) {
// 解码Base64为PDF字节数组
String base64Str = base64PdfList.get(i);
byte[] pdfBytes = Base64.decode(base64Str); // 使用Hutool解码
InputStream inputStream = new ByteArrayInputStream(pdfBytes);
// 读取PDF文件
PdfReader reader = new PdfReader(inputStream);
// 初始化文档(仅第一次循环时)
if (i == 0) {
document = new Document(reader.getPageSizeWithRotation(1));
pdfCopy = new PdfCopy(document, outputStream);
document.open();
}
// 合并所有页面
for (int pageNum = 1; pageNum <= reader.getNumberOfPages(); pageNum++) {
pdfCopy.addPage(pdfCopy.getImportedPage(reader, pageNum));
}
// 释放资源
pdfCopy.freeReader(reader);
reader.close();
inputStream.close();
}
} finally {
// 关闭文档和输出流
if (document != null) {
document.close();
}
if (outputStream != null) {
outputStream.close();
}
}
return outputStream.toByteArray();
}
}

View File

@ -5,7 +5,4 @@
<select id="spProduceMaxvalue" parameterType="map" statementType="CALLABLE" useCache="false">
{call sp_produce_maxvalue(#{returncode,mode=OUT,jdbcType=INTEGER})}
</select>
<select id="getApplyTransNum" resultType="java.math.BigDecimal">
select Capacity*ApplyNum from xk_blood_apply_trans where blood_breed = #{blood_breed}
</select>
</mapper>

View File

@ -0,0 +1,12 @@
<?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.czblood.bus.mapper.XKHosInfoMapper">
<select id="query" resultType="com.czblood.bus.pojo.XkHosInfo">
select * from xk_hos_info
<where>
<if test="hospital_code != null and hospital_code != ''">and hospital_code = #{hospital_code}</if>
<if test="hospital_name != null and hospital_name != ''">and hospital_name = #{hospital_name}</if>
</where>
</select>
</mapper>

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.czblood.bus.mapper.XkBloodApplyTransMapper">
<select id="queryOne" resultType="com.czblood.bus.pojo.xtwh.XkBloodApplyTrans">
select * from xk_blood_apply_trans where blood_breed = #{blood_breed}
</select>
</mapper>

View File

@ -2,11 +2,8 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.czblood.bus.mapper.XkBloodBreedMapper">
<select id="queryList" resultType="com.czblood.bus.pojo.xtwh.XkBloodBreed">
<select id="queryList" resultType="com.czblood.bus.pojo.XkBloodBreed">
select * from xk_blood_breed where use_sign = 'Y'
<if test="breed_code != null and breed_code != ''">and breed_code = #{breed_code}</if>
</select>
<select id="queryOne" resultType="com.czblood.bus.pojo.xtwh.XkBloodBreed">
select * from xk_blood_breed where breed_code = #{breed_code}
</select>
</mapper>

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.czblood.bus.mapper.XkCheckBloodtypeMapper">
<select id="queryList" resultType="com.czblood.bus.pojo.XkCheckBloodtype">
select * from xk_check_bloodtype where hos_id = #{hos_id}
<if test="bill_no != null and bill_no != ''">and bill_no = #{bill_no}</if>
<if test="apply_no != null and apply_no != ''">and apply_no = #{apply_no}</if>
<if test="beinhos_id != null and beinhos_id != ''">and beinhos_id = #{beinhos_id}</if>
</select>
</mapper>

View File

@ -0,0 +1,8 @@
<?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.czblood.bus.mapper.XkDmzdMapper">
<select id="queryList" resultType="com.czblood.bus.pojo.XkDmzd">
select * from xk_dmzd where wordbook_sign=#{wordbook_sign} and use_sign = 'Y'
</select>
</mapper>

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.czblood.bus.mapper.XkParameterMapper">
<select id="queryOne" resultType="com.czblood.bus.pojo.xtwh.XkParameter">
<select id="queryOne" resultType="com.czblood.bus.pojo.XkParameter">
select * from xk_parameter where parameter_code = #{parameter_code}
</select>
</mapper>

View File

@ -6,12 +6,8 @@
select * from xk_patient_info
<where>
<if test="beinhos_id != null and beinhos_id != ''">and beinhos_id = #{beinhos_id}</if>
<if test="hos_id != null and hos_id != ''">and hos_id = #{hos_id}</if>
</where>
</select>
<select id="queryOne" resultType="com.czblood.bus.pojo.XkPatientInfo">
select * from xk_patient_info where beinhos_id = #{beinhos_id} and hos_id = #{hos_id}
</select>
<insert id="insertXkPatientInfo">
insert into xk_patient_info(
@ -71,13 +67,13 @@
<if test="transplant_history != null and transplant_history != ''">transplant_history = #{transplant_history},</if>
<if test="last_modified != null">last_modified = #{last_modified},</if>
<if test="times != null and times != ''">times = #{times},</if>
hos_id = #{hos_id}
hos_id = #{hosid}
</set>
where beinhos_id = #{beinhos_id}
</update>
<delete id="deleteXkPatientInfo">
delete from xk_patient_info where beinhos_id = #{beinhos_id} and hos_id = #{hos_id}
delete from xk_patient_info where beinhos_id = #{beinhos_id}
</delete>
</mapper>

View File

@ -1,44 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.czblood.bus.mapper.XkTransfuseApplyApprovalMapper">
<insert id="insert">
insert into xk_transfuse_apply_approval (
<if test="Archiater != null and Archiater != ''">Archiater,</if>
<if test="Archiater_CheckTime != null ">Archiater_CheckTime,</if>
<if test="Medical_Dept != null and Medical_Dept != ''">Medical_Dept,</if>
<if test="Medical_CheckTime != null ">Medical_CheckTime,</if>
<if test="ApplyLevel != null and ApplyLevel != ''">ApplyLevel,</if>
<if test="Flag != null and Flag != ''">Flag,</if>
bill_no
)values (
<if test="Archiater != null and Archiater != ''">#{Archiater},</if>
<if test="Archiater_CheckTime != null and Archiater_CheckTime != ''">#{Archiater_CheckTime},</if>
<if test="Medical_Dept != null and Medical_Dept != ''">#{Medical_Dept},</if>
<if test="Medical_CheckTime != null ">#{Medical_CheckTime},</if>
<if test="ApplyLevel != null and ApplyLevel != ''">#{ApplyLevel},</if>
<if test="Flag != null and Flag != ''">#{Flag},</if>
#{billNo}
)
</insert>
<update id="update">
update xk_transfuse_apply_approval set
<if test="Archiater != null and Archiater != ''">Archiater = #{Archiater},</if>
<if test="Archiater_CheckTime != null">Archiater_CheckTime = #{Archiater_CheckTime},</if>
<if test="Medical_Dept != null and Medical_Dept != ''">Medical_Dept = #{Medical_Dept},</if>
<if test="Medical_CheckTime != null">Medical_CheckTime = #{Medical_CheckTime},</if>
<if test="ApplyLevel != null and ApplyLevel != ''">ApplyLevel = #{ApplyLevel},</if>
<if test="Flag != null and Flag != ''">Flag = #{Flag},</if>
bill_no = #{billNo}
</update>
<delete id="delete">
delete from xk_transfuse_apply_approval where bill_no = #{billNo}
</delete>
<select id="queryOneByBillNo" resultType="com.czblood.bus.pojo.XkTransfuseApplyApproval">
select * from xk_transfuse_apply_approval where bill_no = #{billNo}
</select>
</mapper>

View File

@ -3,14 +3,12 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.czblood.bus.mapper.XkTransfuseApplyBeforeMapper">
<select id="queryList" resultType="com.czblood.bus.pojo.XkTransfuseApplyBefore">
select * from xk_transfuse_apply_before where hos_id = #{hos_id}
<if test="bill_no != null and bill_no != ''">and bill_no = #{bill_no}</if>
<if test="beinhos_id != null and beinhos_id != ''">and beinhos_id = #{beinhos_id}</if>
</select>
select * from xk_transfuse_apply_before
<where>
<if test="bill_no != null and bill_no != ''">and bill_no = #{bill_no}</if>
<if test="beinhos_id != null and beinhos_id != ''">and beinhos_id = #{beinhos_id}</if>
</where>
<select id="queryOne" resultType="com.czblood.bus.pojo.XkTransfuseApplyBefore">
select * from xk_transfuse_apply_before where bill_no = #{bill_no} and hos_id = #{hos_id}
</select>
<insert id="insertXkTransfuseApplyBefore">
@ -32,7 +30,7 @@
<if test="cruor != null and cruor != ''">cruor,</if>
<if test="bqgy != null and bqgy != ''">bqgy,</if>
<if test="hos_id != null and hos_id != ''">hos_id,</if>
bill_no, beinhos_id,bill_status
bill_no, beinhos_id
)
values(
<if test="dept_id != null and dept_id !=''">#{dept_id},</if>
@ -52,7 +50,7 @@
<if test="cruor != null and cruor != ''">#{cruor},</if>
<if test="bqgy != null and bqgy != ''">#{bqgy},</if>
<if test="hos_id != null and hos_id != ''">#{hos_id},</if>
#{bill_no}, #{beinhos_id},#{bill_status}
#{bill_no}, #{beinhos_id}
)
</insert>
@ -76,9 +74,7 @@
<if test="metabolism != null and metabolism != ''">metabolism = #{metabolism},</if>
<if test="cruor != null and cruor != ''">cruor = #{cruor},</if>
<if test="bqgy != null and bqgy != ''">bqgy = #{bqgy},</if>
<if test="bill_status != null and bill_status != ''">bill_status = #{bill_status},</if>
<if test="hos_id != null and hos_id != ''">hos_id = #{hos_id},</if>
bill_no = #{bill_no}
hos_id = #{hos_id}
</set>
where bill_no = #{bill_no}
</update>

View File

@ -2,57 +2,8 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.czblood.bus.mapper.XkTransfuseApplyBloodbreedMapper">
<insert id="insert">
insert into xk_transfuse_apply_bloodbreed(
<if test="blood_num != null">blood_num,</if>
<if test="unit != null">unit,</if>
<if test="special_deal != null">special_deal,</if>
<if test="onetime_num != null">onetime_num,</if>
<if test="remark != null">remark,</if>
<if test="replace_bloodbreed != null">replace_bloodbreed,</if>
<if test="apply_bloodtype != null">apply_bloodtype,</if>
<if test="ops_bleeding != null">ops_bleeding,</if>
<if test="ops_fact_use != null">ops_fact_use,</if>
<if test="intent != null">intent,</if>
<if test="causalis != null">causalis,</if>
bill_no, blood_breed
) values(
<if test="blood_num != null">#{blood_num},</if>
<if test="unit != null">#{unit},</if>
<if test="special_deal != null">#{special_deal},</if>
<if test="onetime_num != null">#{onetime_num},</if>
<if test="remark != null">#{remark},</if>
<if test="replace_bloodbreed != null">#{replace_bloodbreed},</if>
<if test="apply_bloodtype != null">#{apply_bloodtype},</if>
<if test="ops_bleeding != null">#{ops_bleeding},</if>
<if test="ops_fact_use != null">#{ops_fact_use},</if>
<if test="intent != null">#{intent},</if>
<if test="causalis != null">#{causalis},</if>
#{bill_no}, #{blood_breed})
</insert>
<update id="update">
update xk_transfuse_apply_bloodbreed set
<if test="blood_num != null">blood_num = #{blood_num},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="special_deal != null">special_deal = #{special_deal},</if>
<if test="onetime_num != null">onetime_num = #{onetime_num},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="replace_bloodbreed != null">replace_bloodbreed = #{replace_bloodbreed},</if>
<if test="apply_bloodtype != null">apply_bloodtype = #{apply_bloodtype},</if>
<if test="ops_bleeding != null">ops_bleeding = #{ops_bleeding},</if>
<if test="ops_fact_use != null">ops_fact_use = #{ops_fact_use},</if>
<if test="intent != null">intent = #{intent},</if>
<if test="causalis != null">causalis = #{causalis},</if>
blood_breed = #{blood_breed}
where bill_no = #{bill_no}
<if test="blood_breed != null and blood_breed != ''">and blood_breed = #{blood_breed}</if>
</update>
<select id="queryList" resultType="com.czblood.bus.pojo.XkTransfuseApplyBloodbreed">
select * from xk_transfuse_apply_bloodbreed where bill_no = #{bill_no}
<if test="blood_breed != null and blood_breed != ''">and blood_breed = #{blood_breed}</if>
</select>
<select id="queryOne" resultType="com.czblood.bus.pojo.XkTransfuseApplyBloodbreed">
select * from xk_transfuse_apply_bloodbreed where bill_no = #{bill_no}
</select>
</mapper>

View File

@ -2,33 +2,8 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.czblood.bus.mapper.XkTransfuseApplyCausalisMapper">
<insert id="insert">
insert into xk_transfuse_apply_causalis (Bill_No, Hos_ID, SID,Causalis_Code,Causalis_Type,Causalis_Name,Causalis_Result,Use_Flag,Upload_Flag,Explain)
values (#{bill_no}, #{hos_id}, #{sid}, #{causalis_code}, #{causalis_type}, #{causalis_name}, #{causalis_result}, #{use_flag}, #{upload_flag}, #{explain})
</insert>
<update id="update">
update xk_transfuse_apply_causalis
<set>
<if test="SID != null">SID = #{SID},</if>
<if test="Causalis_Code != null">Causalis_Code = #{Causalis_Code},</if>
<if test="Causalis_Type != null">Causalis_Type = #{Causalis_Type},</if>
<if test="Causalis_Name != null">Causalis_Name = #{Causalis_Name}</if>
<if test="Causalis_Result != null">Causalis_Result = #{Causalis_Result}</if>
<if test="Use_Flag != null">Use_Flag = #{Use_Flag}</if>
<if test="Upload_Flag != null">Upload_Flag = #{Upload_Flag}</if>
<if test="Explain != null">Explain = #{Explain}</if>
hos_id = #{hos_id}
</set>
where Bill_No = #{bill_no} and Causalis_Code = #{Causalis_Code}
</update>
<delete id="deleteByBillNo">
delete from xk_transfuse_apply_causalis where Bill_No = #{bill_no} and Hos_ID = #{hos_id}
</delete>
<select id="queryList" resultType="com.czblood.bus.pojo.XkTransfuseApplyCausalis">
select * from xk_transfuse_apply_causalis where Bill_No = #{bill_no} and Hos_ID = #{hos_id}
select * from xk_transfuse_apply_causalis where Bill_No = #{bill_no}
<if test="SID != null">and sid = #{SID}</if>
</select>
<select id="queryListByBillNo" resultType="com.czblood.bus.pojo.XkTransfuseApplyCausalis">
select * from xk_transfuse_apply_causalis where Bill_No = #{bill_no} and Hos_ID = #{hos_id}
</select>
</mapper>

View File

@ -2,242 +2,16 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.czblood.bus.mapper.XkTransfuseApplyMapper">
<insert id="insert">
insert into xk_transfuse_apply (
<if test="beinhos_number != null">beinhos_number,</if>
<if test="zone_id != null">zone_id,</if>
<if test="patient_bed != null">patient_bed,</if>
<if test="casehistory_id != null">casehistory_id,</if>
<if test="transfuse_history != null">transfuse_history,</if>
<if test="reaction_history != null">reaction_history,</if>
<if test="gestation_history != null">gestation_history,</if>
<if test="parturition_history != null">parturition_history,</if>
<if test="match_history != null">match_history,</if>
<if test="transplant_history != null">transplant_history,</if>
<if test="dept_id != null">dept_id,</if>
<if test="apply_date != null">apply_date,</if>
<if test="send_person != null">apply_date,</if>
<if test="charge_sign != null">charge_sign,</if>
<if test="input_person != null">input_person,</if>
<if test="receive_date != null">receive_date,</if>
<if test="attending_medic != null">attending_medic,</if>
<if test="treat_medic != null">treat_medic,</if>
<if test="causalis != null">causalis,</if>
<if test="bank_director != null">bank_director,</if>
<if test="medical_affairs != null">medical_affairs,</if>
<if test="sample_id != null">sample_id,</if>
<if test="gather_date != null">gather_date,</if>
<if test="abo_type != null">abo_type,</if>
<if test="rh_type != null">rh_type,</if>
<if test="check_sign != null">check_sign,</if>
<if test="check_explain != null">check_explain,</if>
<if test="bill_stasus != null">bill_stasus,</if>
<if test="bill_type != null">bill_type,</if>
<if test="apply_medic != null">apply_medic,</if>
<if test="diagnoses != null">diagnoses,</if>
<if test="intent != null">intent,</if>
<if test="apply_type != null">apply_type,</if>
<if test="use1_date != null">use1_date,</if>
<if test="use2_date != null">use2_date,</if>
<if test="use3_date != null">use3_date,</if>
<if test="remark != null">remark,</if>
<if test="is_plan != null">is_plan,</if>
<if test="bill_sort != null">bill_sort,</if>
<if test="sample_sign != null">sample_sign,</if>
<if test="input_dept != null">input_dept,</if>
<if test="send_able != null">send_able,</if>
<if test="medic_check_date != null">medic_check_date,</if>
<if test="check_medic != null">check_medic,</if>
<if test="is_large_use != null">is_large_use,</if>
<if test="operation_type != null">operation_type,</if>
<if test="bloodcheck_abnor != null">bloodcheck_abnor,</if>
<if test="abnor_next != null">abnor_next,</if>
<if test="agreement_ink != null">agreement_ink,</if>
<if test="exp1 != null">exp1,</if>
<if test="exp2 != null">exp2,</if>
<if test="exp3 != null">exp3,</if>
<if test="exp4 != null">exp4,</if>
<if test="last_modified != null">last_modified,</if>
<if test="notify_sign != null">notify_sign,</if>
<if test="adm_no != null">adm_no,</if>
<if test="Use1_Num != null">Use1_Num,</if>
<if test="Use2_Num != null">Use2_Num,</if>
<if test="Use3_Num != null">Use3_Num,</if>
<if test="Dept_Type != null">Dept_Type,</if>
<if test="use_type != null">use_type,</if>
<if test="Ill_Code != null">Ill_Code,</if>
<if test="Ops_Name != null">Ops_Name,</if>
<if test="isemergency != null">isemergency,</if>
<if test="Valid_Flag != null">Valid_Flag,</if>
<if test="notice_yn != null">notice_yn,</if>
<if test="his_SerialNo != null">his_SerialNo,</if>
<if test="assess_bill_no != null">assess_bill_no,</if>
<if test="operation_name != null">operation_name,</if>
<if test="operation_level != null">operation_level,</if>
<if test="card_no != null">card_no,</if>
bill_no, beinhos_id, assess_bill_no, hos_id
)values (
<if test="beinhos_number != null">#{beinhos_number},</if>
<if test="zone_id != null">#{zone_id},</if>
<if test="patient_bed != null">#{patient_bed},</if>
<if test="casehistory_id != null">#{casehistory_id},</if>
<if test="transfuse_history != null">#{transfuse_history},</if>
<if test="reaction_history != null">#{reaction_history},</if>
<if test="gestation_history != null">#{gestation_history},</if>
<if test="parturition_history != null">#{parturition_history},</if>
<if test="match_history != null">#{match_history},</if>
<if test="transplant_history != null">#{transplant_history},</if>
<if test="dept_id != null">#{dept_id},</if>
<if test="apply_date != null">#{apply_date},</if>
<if test="send_person != null">#{send_person},</if>
<if test="charge_sign != null">#{charge_sign},</if>
<if test="input_person != null">#{input_person},</if>
<if test="receive_date != null">#{receive_date},</if>
<if test="attending_medic != null">#{attending_medic},</if>
<if test="treat_medic != null">#{treat_medic},</if>
<if test="causalis != null">#{causalis},</if>
<if test="bank_director != null">#{bank_director},</if>
<if test="medical_affairs != null">#{medical_affairs},</if>
<if test="sample_id != null">#{sample_id},</if>
<if test="gather_date != null">#{gather_date},</if>
<if test="abo_type != null">#{abo_type},</if>
<if test="rh_type != null">#{rh_type},</if>
<if test="check_sign != null">#{check_sign},</if>
<if test="check_explain != null">#{check_explain},</if>
<if test="bill_stasus != null">#{bill_stasus},</if>
<if test="bill_type != null">#{bill_type},</if>
<if test="apply_medic != null">#{apply_medic},</if>
<if test="diagnoses != null">#{diagnoses},</if>
<if test="intent != null">#{intent},</if>
<if test="apply_type != null">#{apply_type},</if>
<if test="use1_date != null">#{use1_date},</if>
<if test="use2_date != null">#{use2_date},</if>
<if test="use3_date != null">#{use3_date},</if>
<if test="remark != null">#{remark},</if>
<if test="is_plan != null">#{is_plan},</if>
<if test="bill_sort != null">#{bill_sort},</if>
<if test="sample_sign != null">#{sample_sign},</if>
<if test="input_dept != null">#{input_dept},</if>
<if test="send_able != null">#{send_able},</if>
<if test="medic_check_date != null">#{medic_check_date},</if>
<if test="check_medic != null">#{check_medic},</if>
<if test="is_large_use != null">#{is_large_use},</if>
<if test="operation_type != null">#{operation_type},</if>
<if test="bloodcheck_abnor != null">#{bloodcheck_abnor},</if>
<if test="abnor_next != null">#{abnor_next},</if>
<if test="agreement_ink != null">#{agreement_ink},</if>
<if test="exp1 != null">#{exp1},</if>
<if test="exp2 != null">#{exp2},</if>
<if test="exp3 != null">#{exp3},</if>
<if test="exp4 != null">#{exp4},</if>
<if test="last_modified != null">#{last_modified},</if>
<if test="notify_sign != null">#{notify_sign},</if>
<if test="adm_no != null">#{adm_no},</if>
<if test="Use1_Num != null">#{Use1_Num},</if>
<if test="Use2_Num != null">#{Use2_Num},</if>
<if test="Use3_Num != null">#{Use3_Num},</if>
<if test="Dept_Type != null">#{Dept_Type},</if>
<if test="use_type != null">#{use_type},</if>
<if test="Ill_Code != null">#{Ill_Code},</if>
<if test="Ops_Name != null">#{Ops_Name},</if>
<if test="isemergency != null">#{isemergency},</if>
<if test="Valid_Flag != null">#{Valid_Flag},</if>
<if test="notice_yn != null">#{notice_yn},</if>
<if test="his_SerialNo != null">#{his_SerialNo},</if>
<if test="assess_bill_no != null">#{assess_bill_no},</if>
<if test="operation_name != null">#{operation_name},</if>
<if test="operation_level != null">#{operation_level},</if>
<if test="card_no != null">#{card_no},</if>
#{bill_no}, #{beinhos_id}, #{assess_bill_no}, #{hos_id})
</insert>
<update id="update">
update xk_transfuse_apply
<set>
<if test="beinhos_number != null">beinhos_number = #{beinhos_number},</if>
<if test="zone_id != null">zone_id = #{zone_id},</if>
<if test="patient_bed != null">patient_bed = #{patient_bed},</if>
<if test="casehistory_id != null">casehistory_id = #{casehistory_id},</if>
<if test="transfuse_history != null">transfuse_history = #{transfuse_history},</if>
<if test="reaction_history != null">reaction_history = #{reaction_history},</if>
<if test="gestation_history != null">gestation_history = #{gestation_history},</if>
<if test="parturition_history != null">parturition_history = #{parturition_history},</if>
<if test="match_history != null">match_history = #{match_history},</if>
<if test="transplant_history != null">transplant_history = #{transplant_history},</if>
<if test="dept_id != null">dept_id = #{dept_id},</if>
<if test="apply_date != null">apply_date = #{apply_date},</if>
<if test="send_person != null">send_person = #{send_person},</if>
<if test="charge_sign != null">charge_sign = #{charge_sign},</if>
<if test="input_person != null">input_person = #{input_person},</if>
<if test="receive_date != null">receive_date = #{receive_date},</if>
<if test="attending_medic != null">attending_medic = #{attending_medic},</if>
<if test="treat_medic != null">treat_medic = #{treat_medic},</if>
<if test="causalis != null">causalis = #{causalis},</if>
<if test="bank_director != null">bank_director = #{bank_director},</if>
<if test="medical_affairs != null">medical_affairs = #{medical_affairs},</if>
<if test="sample_id != null">sample_id = #{sample_id},</if>
<if test="gather_date != null">gather_date = #{gather_date},</if>
<if test="abo_type != null">abo_type = #{abo_type},</if>
<if test="rh_type != null">rh_type = #{rh_type},</if>
<if test="check_sign != null">check_sign = #{check_sign},</if>
<if test="check_explain != null">check_explain = #{check_explain},</if>
<if test="bill_stasus != null">bill_stasus = #{bill_stasus},</if>
<if test="bill_type != null">bill_type = #{bill_type},</if>
<if test="apply_medic != null">apply_medic = #{apply_medic},</if>
<if test="diagnoses != null">diagnoses = #{diagnoses},</if>
<if test="intent != null">intent = #{intent},</if>
<if test="apply_type != null">apply_type = #{apply_type},</if>
<if test="use1_date != null">use1_date = #{use1_date},</if>
<if test="use2_date != null">use2_date = #{use2_date},</if>
<if test="use3_date != null">use3_date = #{use3_date},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="is_plan != null">is_plan = #{is_plan},</if>
<if test="bill_sort != null">bill_sort = #{bill_sort},</if>
<if test="sample_sign != null">sample_sign = #{sample_sign},</if>
<if test="input_dept != null">input_dept = #{input_dept},</if>
<if test="send_able != null">send_able = #{send_able},</if>
<if test="medic_check_date != null">medic_check_date = #{medic_check_date},</if>
<if test="check_medic != null">check_medic = #{check_medic},</if>
<if test="is_large_use != null">is_large_use = #{is_large_use},</if>
<if test="operation_type != null">operation_type = #{operation_type},</if>
<if test="bloodcheck_abnor != null">bloodcheck_abnor = #{bloodcheck_abnor},</if>
<if test="abnor_next != null">abnor_next = #{abnor_next},</if>
<if test="agreement_ink != null">agreement_ink = #{agreement_ink},</if>
<if test="exp1 != null">exp1 = #{exp1},</if>
<if test="exp2 != null">exp2 = #{exp2},</if>
<if test="exp3 != null">exp3 = #{exp3},</if>
<if test="exp4 != null">exp4 = #{exp4},</if>
<if test="last_modified != null">last_modified = #{last_modified},</if>
<if test="notify_sign != null">notify_sign = #{notify_sign},</if>
<if test="adm_no != null">adm_no = #{adm_no},</if>
<if test="Use1_Num != null">Use1_Num = #{Use1_Num},</if>
<if test="Use2_Num != null">Use2_Num = #{Use2_Num},</if>
<if test="Use3_Num != null">Use3_Num = #{Use3_Num},</if>
<if test="Dept_Type != null">Dept_Type = #{Dept_Type},</if>
<if test="use_type != null">use_type = #{use_type},</if>
<if test="Ill_Code != null">Ill_Code = #{Ill_Code},</if>
<if test="Ops_Name != null">Ops_Name = #{Ops_Name},</if>
<if test="isemergency != null">isemergency = #{isemergency},</if>
<if test="Valid_Flag != null">Valid_Flag = #{Valid_Flag},</if>
<if test="notice_yn != null">notice_yn = #{notice_yn},</if>
<if test="his_SerialNo != null">his_SerialNo = #{his_SerialNo},</if>
<if test="assess_bill_no != null">assess_bill_no = #{assess_bill_no},</if>
<if test="operation_name != null">operation_name = #{operation_name},</if>
<if test="operation_level != null">operation_level = #{operation_level},</if>
<if test="card_no != null">card_no = #{card_no},</if>
hos_id = #{hos_id}
</set>
where bill_no = #{bill_no}
</update>
<select id="queryList" resultType="com.czblood.bus.pojo.XkTransfuseApply">
select * from xk_transfuse_apply where hos_id = #{hos_id}
<if test="bill_no != null and bill_no != ''">and bill_no = #{bill_no}</if>
<if test="beinhos_id != null and beinhos_id != ''">and beinhos_id = #{beinhos_id}</if>
<if test="assess_bill_no != null and assess_bill_no != ''">and assess_bill_no = #{assess_bill_no}</if>
select * from xk_transfuse_apply
<where>
<if test="bill_no != null and bill_no != ''">and bill_no = #{bill_no}</if>
<if test="beinhos_id != null and beinhos_id != ''">and beinhos_id = #{beinhos_id}</if>
<if test="assess_bill_no != null and assess_bill_no != ''">and assess_bill_no = #{assess_bill_no}</if>
</where>
</select>
<select id="queryOne" resultType="com.czblood.bus.pojo.XkTransfuseApply">
select * from xk_transfuse_apply where bill_no = #{bill_no} and hos_id = #{hos_id}
select * from xk_transfuse_apply where bill_no = #{bill_no}
</select>
</mapper>

View File

@ -32,11 +32,11 @@
<if test="upload_flag != null and upload_flag != ''">upload_flag=#{upload_flag},</if>
item_name=#{item_name}
where bill_no=#{bill_no}
<if test="sid != 0">and sid=#{sid}</if>
<if test="sid != null">and sid=#{sid}</if>
</update>
<delete id="deleteXkTransfuseApplyTestitem">
delete from xk_transfuse_apply_testitem where bill_no=#{bill_no}
<if test="sid != 0">and sid=#{sid}</if>
<if test="sid != null">and sid=#{sid}</if>
</delete>
</mapper>

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.czblood.bus.mapper.XkCausalisSetMapper">
<select id="queryList" resultType="com.czblood.bus.pojo.XkCausalisSet">
select * from xk_causalis_set
<where>
<if test="Dept_Type != null and Dept_Type != ''">and Dept_Type = #{Dept_Type}</if>
<if test="Blood_Breed != null and Blood_Breed != ''">and Blood_Breed = #{Blood_Breed}</if>
<if test="Use_Type != null and Use_Type != ''">and Use_Type = #{Use_Type}</if>
</where>
</select>
</mapper>

View File

@ -1,53 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.czblood.bus.mapper.XkDmzdMapper">
<update id="updateXkDmzd">
update xk_dmzd set
<if test="wordbook_name != null and wordbook_name != ''">wordbook_name=#{wordbook_name},</if>
<if test="use_sign != null and use_sign != ''">use_sign=#{use_sign},</if>
<if test="exp1 != null and exp1 != ''">exp1=#{exp1},</if>
<if test="exp2 != null and exp2 != ''">exp2=#{exp2},</if>
<if test="exp3 != null and exp3 != ''">exp3=#{exp3},</if>
<if test="exp4 != null and exp4 != ''">exp4=#{exp4},</if>
<if test="exp5 != null and exp5 != ''">exp5=#{exp5},</if>
<if test="remark != null">remark=#{remark},</if>
wordbook_code=#{wordbook_code}
where wordbook_sign = #{wordbook_sign} and wordbook_code= #{wordbook_code_old}
</update>
<delete id="deleteXkDmzd">
delete from xk_dmzd where wordbook_sign = #{wordbook_sign} and wordbook_code=#{wordbook_code}
</delete>
<select id="queryList" resultType="com.czblood.bus.pojo.xtwh.XkDmzd">
select * from xk_dmzd where wordbook_sign=#{wordbook_sign}
<if test="use_sign != null and use_sign != ''">and use_sign = #{use_sign}</if>
<if test="wordbook_name != null and wordbook_name != ''">and wordbook_name like '%'+#{wordbook_name}+'%'</if>
<if test="wordbook_code != null and wordbook_code != ''">and wordbook_code = #{wordbook_code}</if>
</select>
<insert id="insertXkDmzd">
insert into xk_dmzd(
<if test="wordbook_name != null and wordbook_name != ''">wordbook_name,</if>
<if test="use_sign != null and use_sign != ''">use_sign,</if>
<if test="exp1 != null and exp1 != ''">exp1,</if>
<if test="exp2 != null and exp2 != ''">exp2,</if>
<if test="exp3 != null and exp3 != ''">exp3,</if>
<if test="exp4 != null and exp4 != ''">exp4,</if>
<if test="exp5 != null and exp5 != ''">exp5,</if>
<if test="remark != null and remark != ''">remark,</if>
wordbook_sign,wordbook_code
)values(
<if test="wordbook_name != null and wordbook_name != ''">#{wordbook_name},</if>
<if test="use_sign != null and use_sign != ''">#{use_sign},</if>
<if test="exp1 != null and exp1 != ''">#{exp1},</if>
<if test="exp2 != null and exp2 != ''">#{exp2},</if>
<if test="exp3 != null and exp3 != ''">#{exp3},</if>
<if test="exp4 != null and exp4 != ''">#{exp4},</if>
<if test="exp5 != null and exp5 != ''">#{exp5},</if>
<if test="remark != null and remark != ''">#{remark},</if>
#{wordbook_sign},#{wordbook_code}
)
</insert>
</mapper>

View File

@ -1,55 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.czblood.bus.mapper.XkHosInfoMapper">
<select id="queryList" resultType="com.czblood.bus.pojo.xtwh.XkHosInfo">
select * from xk_hos_info
<where>
<if test="hospital_code != null and hospital_code != ''">and hospital_code = #{hospital_code}</if>
<if test="hospital_name != null and hospital_name != ''">and hospital_name = #{hospital_name}</if>
</where>
</select>
<select id="queryOne" resultType="com.czblood.bus.pojo.xtwh.XkHosInfo">
select * from xk_hos_info where hospital_code = #{hospital_code}
</select>
<insert id="insert">
insert into xk_hos_info(
<if test="address != null and address != ''">address,</if>
<if test="post_code != null and post_code != ''">post_code,</if>
<if test="telno != null and telno != ''">telno,</if>
<if test="link_person != null and link_person != ''">link_person,</if>
<if test="org_kind != null and org_kind != ''">org_kind,</if>
<if test="foot_mode != null and foot_mode != ''">foot_mode,</if>
<if test="org_zone != null and org_zone != ''">org_zone,</if>
<if test="org_street != null and org_street != ''">org_street,</if>
hospital_code,hospital_name,sfby) values
(
<if test="address != null and address != ''">#{address},</if>
<if test="post_code != null and post_code != ''">#{post_code},</if>
<if test="telno != null and telno != ''">#{telno},</if>
<if test="link_person != null and link_person != ''">#{link_person},</if>
<if test="org_kind != null and org_kind != ''">#{org_kind},</if>
<if test="foot_mode != null and foot_mode != ''">#{foot_mode},</if>
<if test="org_zone != null and org_zone != ''">#{org_zone},</if>
<if test="org_street != null and org_street != ''">#{org_street},</if>
#{hospital_code},#{hospital_name},#{sfby})
</insert>
<update id="update">
update xk_hos_info set
<if test="address != null">address = #{address},</if>
<if test="post_code != null">post_code = #{post_code},</if>
<if test="telno != null">telno = #{telno},</if>
<if test="link_person != null">link_person = #{link_person},</if>
<if test="org_kind != null">org_kind = #{org_kind},</if>
<if test="foot_mode != null">foot_mode = #{foot_mode},</if>
<if test="org_zone != null">org_zone = #{org_zone},</if>
<if test="org_street != null">org_street = #{org_street},</if>
<if test="hospital_name != null">hospital_name = #{hospital_name},</if>
<if test="sfby != null">sfby = #{sfby},</if>
hospital_code = #{hospital_code}
where hospital_code = #{hospital_code}
</update>
</mapper>

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.czblood.bus.mapper.XkXtwhIllDiagnoseMapper">
<select id="queryList" resultType="com.czblood.bus.pojo.xtwh.XkXtwhIllDiagnose">
select * from xk_xtwh_ill_diagnose
<where>
<if test="Ill_Code != null and Ill_Code != ''">Ill_Code = #{Ill_Code}</if>
<if test="Dia_Code != null and Dia_Code != ''">Dia_Code = #{Dia_Code}</if>
<if test="Dia_Name != null and Dia_Name != ''">Dia_Name like '%'+#{Dia_Name}+'%'</if>
</where>
</select>
</mapper>

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.czblood.bus.mapper.XkXtwhIllMapper">
<select id="queryList" resultType="com.czblood.bus.pojo.xtwh.XkXtwhIll">
select * from xk_xtwh_ill
<where>
<if test="Ill_Code != null and Ill_Code != ''">and Ill_Code = #{Ill_Code}</if>
<if test="Ill_Name != null and Ill_Name != ''">and Ill_Name like '%'+ #{Ill_Name} +'%' </if>
<if test="Use_Sign != null and Use_Sign !=''">and Use_Sign = #{Use_Sign}</if>
</where>
</select>
</mapper>

View File

@ -1,77 +0,0 @@
package com.czblood.busBloodbank.controller;
import com.czblood.bus.cache.DmzdCache;
import com.czblood.bus.constants.BloodSysLogConstants;
import com.czblood.bus.mapper.XkDmzdMapper;
import com.czblood.bus.pojo.xtwh.XkDmzd;
import com.czblood.bus.utils.BloodBankUtil;
import com.czblood.common.annotation.Log;
import com.czblood.common.core.controller.BaseController;
import com.czblood.common.core.domain.Result;
import com.czblood.common.enums.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
@Api(tags = "代码字典")
@RestController
@RequestMapping("/bus/bloodbank/dmzd")
public class XkDmzdController extends BaseController {
@Resource
XkDmzdMapper xkDmzdMapper;
@Resource
BloodBankUtil bloodBankUtil;
@ApiOperation("获取代码字典列表")
@GetMapping("/queryList")
public Result queryList(){
List<XkDmzd> dictCacheList = bloodBankUtil.getDictCache("BASE");
//取有效的数据
List<XkDmzd> collect = dictCacheList.stream().filter(xkDmzd -> xkDmzd.getUse_sign().equals("Y")).collect(Collectors.toList());
return new Result("0","获取数据成功!",collect);
}
@Log(title = BloodSysLogConstants.LOG_TYPE_DMZD, businessType = BusinessType.INSERT)
@ApiOperation("添加字典")
@PostMapping("/add")
public Result addDmzd(@RequestBody XkDmzd xkDmzd){
xkDmzdMapper.insertXkDmzd(xkDmzd);
//写缓存
bloodBankUtil.setDictCacheList(xkDmzd.getWordbook_sign());
return new Result("0","添加成功!");
}
@Log(title = BloodSysLogConstants.LOG_TYPE_DMZD, businessType = BusinessType.UPDATE)
@ApiOperation("修改字典")
@PostMapping("/update")
public Result updateDmzd(@RequestBody XkDmzd xkDmzd){
xkDmzdMapper.updateXkDmzd(xkDmzd);
//写缓存
bloodBankUtil.setDictCacheList(xkDmzd.getWordbook_sign());
return new Result("0","修改成功!");
}
@Log(title = BloodSysLogConstants.LOG_TYPE_DMZD, businessType = BusinessType.DELETE)
@ApiOperation("删除字典")
@GetMapping("/delete")
public Result deleteDmzd(XkDmzd xkDmzd){
xkDmzdMapper.deleteXkDmzd(xkDmzd);
//写缓存
bloodBankUtil.setDictCacheList(xkDmzd.getWordbook_sign());
return new Result("0","删除成功!");
}
@ApiOperation("清空缓存")
@GetMapping("/clear")
public Result clearDictCache(){
DmzdCache.clearDictCache();
return new Result("0","清空缓存成功!");
}
}

View File

@ -1,48 +0,0 @@
package com.czblood.busBloodbank.controller;
import com.czblood.bus.constants.BloodSysLogConstants;
import com.czblood.bus.mapper.XkHosInfoMapper;
import com.czblood.bus.pojo.xtwh.XkHosInfo;
import com.czblood.common.annotation.Log;
import com.czblood.common.core.domain.Result;
import com.czblood.common.enums.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@Api(tags = "医疗机构")
@RestController
@RequestMapping("/bus/bloodbank/hosInfo")
public class XkHosInfoController {
@Resource
XkHosInfoMapper xkHosInfoMapper;
@ApiOperation("获取医疗机构列表")
@GetMapping("/queryList")
public Result queryList(){
XkHosInfo xkHosInfo = new XkHosInfo();
List<XkHosInfo> xkHosInfoList = xkHosInfoMapper.queryList(xkHosInfo);
return new Result("0","获取数据成功!",xkHosInfoList);
}
@Log(title = BloodSysLogConstants.LOG_TYPE_YLJG, businessType = BusinessType.INSERT)
@ApiOperation("新增机构")
@PostMapping("/add")
public Result add(@RequestBody XkHosInfo xkHosInfo){
xkHosInfoMapper.insert(xkHosInfo);
return new Result("0","新增数据成功!");
}
@Log(title = BloodSysLogConstants.LOG_TYPE_YLJG, businessType = BusinessType.UPDATE)
@ApiOperation("修改数据")
@PostMapping("/update")
public Result update(@RequestBody XkHosInfo xkHosInfo){
xkHosInfoMapper.update(xkHosInfo);
return new Result("0","修改数据成功!");
}
}

View File

@ -1,11 +0,0 @@
package com.czblood.busBloodbank.controller;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Api(tags = "系统参数")
@RestController
@RequestMapping("/bus/bloodbank/parameter")
public class XkParameterController {
}

View File

@ -1,28 +0,0 @@
package com.czblood.busBloodbank.controller;
import com.czblood.bus.pojo.xtwh.XkXtwhIll;
import com.czblood.busBloodbank.service.XkXtwhIllService;
import com.czblood.common.core.domain.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@Api(tags = "单病种")
@RestController
@RequestMapping("/bus/bloodbank/ill")
public class XkXtwhIllController {
@Resource
XkXtwhIllService xkXtwhIllService;
@ApiOperation("单病种查询")
@GetMapping("/queryList")
public Result queryList(XkXtwhIll xkXtwhIll) {
return xkXtwhIllService.queryList(xkXtwhIll);
}
}

View File

@ -1,8 +0,0 @@
package com.czblood.busBloodbank.service;
import com.czblood.bus.pojo.xtwh.XkXtwhIll;
import com.czblood.common.core.domain.Result;
public interface XkXtwhIllService {
Result queryList(XkXtwhIll xkXtwhIll);
}

View File

@ -1,23 +0,0 @@
package com.czblood.busBloodbank.service.impl;
import com.czblood.bus.mapper.XkXtwhIllMapper;
import com.czblood.bus.pojo.xtwh.XkXtwhIll;
import com.czblood.busBloodbank.service.XkXtwhIllService;
import com.czblood.common.core.domain.Result;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class XkXtwhIllServiceImpl implements XkXtwhIllService {
@Resource
XkXtwhIllMapper xkXtwhIllMapper;
@Override
public Result queryList(XkXtwhIll xkXtwhIll) {
List<XkXtwhIll> list = xkXtwhIllMapper.queryList(xkXtwhIll);
return new Result("0","查询成功!",list);
}
}

View File

@ -1,11 +1,10 @@
package com.czblood.busDoctor.controller;
import com.czblood.bus.constants.BloodSysLogConstants;
import com.czblood.busDoctor.pojo.DTO.TransfuseApplyBeforeDTO;
import com.czblood.busDoctor.pojo.VO.TransfuseApplyBeforeVO;
import com.czblood.bus.pojo.XkTransfuseApplyBefore;
import com.czblood.busDoctor.pojo.TransfuseApplyBeforeDTO;
import com.czblood.busDoctor.service.TransfuseApplyBeforeService;
import com.czblood.common.annotation.Log;
import com.czblood.common.core.controller.BaseController;
import com.czblood.common.core.domain.Result;
import com.czblood.common.enums.BusinessType;
import io.swagger.annotations.Api;
@ -17,23 +16,17 @@ import javax.annotation.Resource;
@Api(tags = "输血前评估")
@RestController
@RequestMapping("/bus/doctor/applyBefore")
@RequestMapping("/doctor/applyBefore")
@Slf4j
public class TransfuseApplyBeforeController extends BaseController {
public class TransfuseApplyBeforeController {
@Resource
private TransfuseApplyBeforeService transfuseApplyBeforeService;
@ApiOperation("查询单据信息列表")
@ApiOperation("查询单据信息")
@GetMapping("/queryList")
public Result queryList(TransfuseApplyBeforeVO xktransfuseApplyBeforeVO){
return transfuseApplyBeforeService.queryList(xktransfuseApplyBeforeVO);
}
@ApiOperation("查询单个申请单信息")
@GetMapping("/queryOne")
public Result queryOne(String billNo){
return transfuseApplyBeforeService.queryOne(billNo);
public Result queryList(XkTransfuseApplyBefore xkTransfuseApplyBefore){
return transfuseApplyBeforeService.queryList(xkTransfuseApplyBefore);
}
@ApiOperation("根据住院号获取病人信息")
@ -46,10 +39,6 @@ public class TransfuseApplyBeforeController extends BaseController {
@ApiOperation("保存信息")
@PostMapping("/save")
public Result save(@RequestBody TransfuseApplyBeforeDTO transfuseApplyBeforeDTO){
transfuseApplyBeforeDTO.getXkPatientInfo().setHos_id(getLoginUser().getSysLoginParam().getLoginYLJG());
transfuseApplyBeforeDTO.getXkTransfuseApplyBeforeList().forEach(xkTransfuseApplyBefore -> {
xkTransfuseApplyBefore.setHos_id(getLoginUser().getSysLoginParam().getLoginYLJG());
});
return transfuseApplyBeforeService.save(transfuseApplyBeforeDTO);
}
@ -67,9 +56,9 @@ public class TransfuseApplyBeforeController extends BaseController {
return transfuseApplyBeforeService.delete(billNo);
}
@ApiOperation("打印单据")
@ApiOperation("打印输血前评估单")
@GetMapping("/print")
public Result print(String billNo,String templateName){
return transfuseApplyBeforeService.print(billNo,templateName);
public Result print(String billNo){
return transfuseApplyBeforeService.print(billNo);
}
}

View File

@ -1,128 +1,16 @@
package com.czblood.busDoctor.controller;
import com.czblood.bus.constants.BloodSysLogConstants;
import com.czblood.bus.mapper.XkXtwhIllDiagnoseMapper;
import com.czblood.bus.pojo.xtwh.XkXtwhIllDiagnose;
import com.czblood.busDoctor.pojo.DTO.TransfuseApplyDTO;
import com.czblood.busDoctor.pojo.VO.ApplyCheckVO;
import com.czblood.busDoctor.pojo.VO.CheckMedicVO;
import com.czblood.busDoctor.pojo.VO.TransfuseApplyVO;
import com.czblood.busDoctor.service.TransfuseApplyService;
import com.czblood.common.annotation.Log;
import com.czblood.common.core.controller.BaseController;
import com.czblood.common.core.domain.Result;
import com.czblood.common.core.page.TableDataInfo;
import com.czblood.common.enums.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 输血申请
*/
@Api(tags = "输血申请")
@RestController
@RequestMapping("/bus/doctor/apply")
@RequestMapping("/doctor/apply")
@Slf4j
public class TransfuseApplyController extends BaseController {
@Resource
private TransfuseApplyService transfuseApplyService;
@Resource
XkXtwhIllDiagnoseMapper xkXtwhIllDiagnoseMapper;
@ApiOperation("查询申请单列表")
@GetMapping("/queryList")
public Result queryList(TransfuseApplyVO transfuseApplyVO){
return transfuseApplyService.queryList(transfuseApplyVO);
}
@ApiOperation("获取病人信息")
@GetMapping("/getPatInfo")
public Result getPatInfo(TransfuseApplyVO transfuseApplyVO){
transfuseApplyVO.setUser_id(getUsername());
return transfuseApplyService.getPatInfo(transfuseApplyVO);
}
@ApiOperation("查询输血前评估信息列表")
@GetMapping("/queryApplyBeforeList")
public Result queryApplyBeforeList(String dept_id,String user_id){
return transfuseApplyService.queryApplyBeforeList(dept_id,user_id);
}
@ApiOperation("查询单条申请单")
@GetMapping("/queryApplyOne")
public Result queryApplyOne(String billNo){
return transfuseApplyService.queryApplyOne(billNo);
}
@ApiOperation("保存前校验")
@PostMapping("/savePreApplyInfo")
public Result savePreApplyInfo(@RequestBody TransfuseApplyDTO transfuseApplyDTO){
transfuseApplyDTO.setUserId(getUsername());
return transfuseApplyService.savePreApplyInfo(transfuseApplyDTO);
}
@ApiOperation("自体血校验")
@GetMapping("/checkSelfBlood")
public Result checkSelfBlood(String beinhos_id){
return transfuseApplyService.checkSelfBlood(beinhos_id);
}
@ApiOperation("校验是否符合输血指征的规则")
@PostMapping("/checkCausalis")
public Result checkCausalis(@RequestBody TransfuseApplyDTO transfuseApplyDTO){
return transfuseApplyService.checkCausalis(transfuseApplyDTO);
}
/**
* 保存申请单的步骤
* 1. 自体血校验
* 2. 校验是否符合输血指征的规则
* 3. 保存前校验 如果点是,调用queryApplyOne,查询单个申请单,传返回值
* 4. 保存申请单
* @param transfuseApplyDTO
* @return
*/
@Log(title = BloodSysLogConstants.LOG_TYPE_TRANSFUSE_APPLY, businessType = BusinessType.INSERT)
@ApiOperation("保存申请单")
@PostMapping("/saveApplyInfo")
public Result saveApplyInfo(@RequestBody TransfuseApplyDTO transfuseApplyDTO){
transfuseApplyDTO.setUserId(getUsername());
return transfuseApplyService.saveApplyInfo(transfuseApplyDTO);
}
@Log(title = BloodSysLogConstants.LOG_TYPE_TRANSFUSE_APPLY, businessType = BusinessType.CHECK_MEDIC)
@ApiOperation("上级医生审核")
@PostMapping("/applyMedicCheck")
public Result applyMedicCheck(CheckMedicVO checkMedicVO){
return transfuseApplyService.applyMedicCheck(checkMedicVO);
}
@ApiOperation("查询单病种信息列表")
@GetMapping("/queryIllDiagnoseList")
public TableDataInfo queryIllDiagnoseList(){
startPage();
XkXtwhIllDiagnose xkXtwhIllDiagnose = new XkXtwhIllDiagnose();
List<XkXtwhIllDiagnose> xkXtwhIllDiagnoseList = xkXtwhIllDiagnoseMapper.queryList(xkXtwhIllDiagnose);
return getDataTable(xkXtwhIllDiagnoseList);
}
@Log(title = BloodSysLogConstants.LOG_TYPE_TRANSFUSE_APPLY, businessType = BusinessType.CHECK)
@ApiOperation("申请单审核")
@PostMapping("/applyCheck")
public Result applyCheck(ApplyCheckVO applyCheckVO){
return transfuseApplyService.applyCheck(applyCheckVO);
}
public class TransfuseApplyController {
}

View File

@ -1,10 +0,0 @@
package com.czblood.busDoctor.mapper;
import com.czblood.busDoctor.pojo.VO.TransfuseApplyBeforeVO;
import java.util.List;
import java.util.Map;
public interface TransfuseApplyBeforeMapper {
List<Map<String,Object>> queryList(TransfuseApplyBeforeVO transfuseApplyBeforeVO);
}

View File

@ -1,21 +0,0 @@
package com.czblood.busDoctor.mapper;
import com.czblood.busDoctor.pojo.DTO.TransfuseApplyInfoOne;
import com.czblood.busDoctor.pojo.VO.TransfuseApplyVO;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
public interface TransfuseApplyMapper {
List<Map<String,Object>> queryList(TransfuseApplyVO transfuseApplyVO);
TransfuseApplyInfoOne queryApplyOne(TransfuseApplyVO transfuseApplyVO);
List<Map<String,Object>> queryApplyBeforeList(@Param("dept_id") String dept_id,@Param("assess_person") String assess_person);
int queryXkCheckBloodtypeCount(@Param("beinhos_id") String beinhos_id);
String checkSameBloodType(@Param("beinhos_id") String beinhos_id,@Param("blood_breed") String blood_breed);
List<Map<String,Object>> checkSelfBlood(@Param("beinhos_id") String beinhos_id);
BigDecimal queryApplyTransTotalNum(@Param("beinhos_id") String beinhos_id,@Param("stime") Date stime, @Param("etime") Date etime,@Param("bloodKindList") List<String> bloodKindList,@Param("billNo") String billNo);
}

View File

@ -1,14 +0,0 @@
package com.czblood.busDoctor.pojo.DTO;
import com.czblood.bus.pojo.XkCausalisSet;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TransfuseApplyCausalisSetDTO {
private XkCausalisSet xkCausalisSet;
private String testValue;
}

View File

@ -1,29 +0,0 @@
package com.czblood.busDoctor.pojo.DTO;
import com.czblood.bus.pojo.XkTransfuseApplyApproval;
import com.czblood.bus.pojo.XkTransfuseApplyBloodbreed;
import com.czblood.bus.pojo.XkTransfuseApplyCausalis;
import com.czblood.bus.pojo.XkTransfuseApplyTestitem;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TransfuseApplyDTO {
@ApiModelProperty("输血申请单信息")
private TransfuseApplyInfoOne transfuseApplyInfoOne;
@ApiModelProperty(value = "输血前lis检查项目")
private List<XkTransfuseApplyTestitem> xkTransfuseApplyTestitemList;
@ApiModelProperty("输血申请单品种列表")
private List<XkTransfuseApplyBloodbreed> xkTransfuseApplyBloodbreedList;
@ApiModelProperty("输血指征列表")
private List<XkTransfuseApplyCausalis> xkTransfuseApplyCausalisList;
@ApiModelProperty("大量用血申请表")
private XkTransfuseApplyApproval xkTransfuseApplyApproval;
private String userId;
}

View File

@ -1,22 +0,0 @@
package com.czblood.busDoctor.pojo.DTO;
import com.czblood.bus.pojo.XkPatientInfo;
import com.czblood.bus.pojo.XkTransfuseApply;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TransfuseApplyInfoOne {
@ApiModelProperty("病人信息")
private XkPatientInfo xkPatientInfo;
@ApiModelProperty("输血申请信息")
private XkTransfuseApply xkTransfuseApply;
}

View File

@ -1,15 +0,0 @@
package com.czblood.busDoctor.pojo.DTO;
import com.czblood.bus.pojo.XkTransfuseApplyCausalis;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class XkTransfuseApplyCausalisDTO {
private XkTransfuseApplyCausalis xkTransfuseApplyCausalis;
private String itemName;
private String itemResult;
}

View File

@ -1,6 +1,7 @@
package com.czblood.busDoctor.pojo.DTO;
package com.czblood.busDoctor.pojo;
import com.czblood.bus.pojo.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
@ -18,4 +19,6 @@ public class TransfuseApplyBeforeDTO {
private List<XkTransfuseApplyBefore> xkTransfuseApplyBeforeList;
@ApiModelProperty(value = "输血前lis检查项目")
private List<XkTransfuseApplyTestitem> xkTransfuseApplyTestitemList;
@ApiModelProperty(value = "输血前申请信息")
private XkTransfuseApply xkTransfuseApply;
}

View File

@ -1,12 +0,0 @@
package com.czblood.busDoctor.pojo.VO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ApplyCheckVO {
private String billNo;
}

View File

@ -1,20 +0,0 @@
package com.czblood.busDoctor.pojo.VO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CheckMedicVO {
@NotBlank(message = "上级医生不能为空!")
private String checkMedic;
@NotBlank(message = "审核时间不能为空!")
private Date checkDate;
@NotBlank(message = "单据号不能为空!")
private String billNo;
}

View File

@ -1,26 +0,0 @@
package com.czblood.busDoctor.pojo.VO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("查询参数")
public class TransfuseApplyBeforeVO {
@ApiModelProperty("开始时间")
private Date stime;
@ApiModelProperty("结束时间")
private Date etime;
@ApiModelProperty("病人姓名")
private String patient_name;
@ApiModelProperty("住院号")
private String beinhos_id;
@ApiModelProperty("单据编号")
private String bill_no;
}

View File

@ -1,24 +0,0 @@
package com.czblood.busDoctor.pojo.VO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TransfuseApplyVO {
@ApiModelProperty("单据状态")
private String bill_status;
@ApiModelProperty("查询多少天之前的")
private Integer day;
@ApiModelProperty("查询的科室")
private String dept_code;
@ApiModelProperty("查询的医生")
private String doctor_code;
@ApiModelProperty("查询的单据编号")
private String bill_no;
@ApiModelProperty("操作用户")
private String user_id;
}

View File

@ -1,11 +1,11 @@
package com.czblood.busDoctor.service;
import com.czblood.busDoctor.pojo.DTO.TransfuseApplyBeforeDTO;
import com.czblood.busDoctor.pojo.VO.TransfuseApplyBeforeVO;
import com.czblood.bus.pojo.XkTransfuseApplyBefore;
import com.czblood.busDoctor.pojo.TransfuseApplyBeforeDTO;
import com.czblood.common.core.domain.Result;
public interface TransfuseApplyBeforeService {
Result queryList(TransfuseApplyBeforeVO transfuseApplyBeforeVO);
Result queryList(XkTransfuseApplyBefore xkTransfuseApplyBefore);
Result getPatInfo(String patNo);
@ -15,7 +15,5 @@ public interface TransfuseApplyBeforeService {
Result delete(String billNo);
Result print(String billNo,String templateName);
Result queryOne(String billNo);
Result print(String billNo);
}

View File

@ -1,30 +0,0 @@
package com.czblood.busDoctor.service;
import com.czblood.bus.pojo.XkTransfuseApply;
import com.czblood.busDoctor.pojo.DTO.TransfuseApplyDTO;
import com.czblood.busDoctor.pojo.VO.ApplyCheckVO;
import com.czblood.busDoctor.pojo.VO.CheckMedicVO;
import com.czblood.busDoctor.pojo.VO.TransfuseApplyVO;
import com.czblood.common.core.domain.Result;
public interface TransfuseApplyService {
Result getPatInfo(TransfuseApplyVO transfuseApplyVO);
Result queryList(TransfuseApplyVO transfuseApplyVO);
Result queryApplyOne(String billNo);
Result queryApplyBeforeList(String dept_id,String assess_person);
Result savePreApplyInfo(TransfuseApplyDTO transfuseApplyDTO);
Result checkSelfBlood(String beinhosId);
Result saveApplyInfo(TransfuseApplyDTO transfuseApplyDTO);
Result checkCausalis(TransfuseApplyDTO transfuseApplyDTO);
Result applyMedicCheck(CheckMedicVO checkMedicVO);
Result applyCheck(ApplyCheckVO applyCheckVO);
}

View File

@ -1,12 +1,11 @@
package com.czblood.busDoctor.service.impl;
import cn.hutool.core.codec.Base64;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONUtil;
import com.czblood.bus.constants.BloodPrintTypeConstants;
import com.czblood.bus.mapper.XkPatientInfoMapper;
import com.czblood.bus.mapper.XkTransfuseApplyBeforeMapper;
import com.czblood.bus.mapper.XkTransfuseApplyTestitemMapper;
import com.czblood.bus.mapper.XkTransfuseApplyMapper;
import com.czblood.bus.pojo.*;
import com.czblood.bus.pojo.inter.BeforeAssessRequest;
import com.czblood.bus.pojo.inter.GetPatientInfoRequest;
@ -14,26 +13,18 @@ import com.czblood.bus.pojo.inter.GetTestResultRequest;
import com.czblood.bus.utils.BloodBankUtil;
import com.czblood.bus.utils.BloodInterfaceUtil;
import com.czblood.bus.utils.ReportUtil;
import com.czblood.busDoctor.mapper.TransfuseApplyBeforeMapper;
import com.czblood.busDoctor.pojo.DTO.TransfuseApplyBeforeDTO;
import com.czblood.busDoctor.pojo.VO.TransfuseApplyBeforeVO;
import com.czblood.busDoctor.pojo.TransfuseApplyBeforeDTO;
import com.czblood.busDoctor.service.TransfuseApplyBeforeService;
import com.czblood.busDoctor.utils.TransfuseApplyBeforeUtil;
import com.czblood.common.config.RuoYiConfig;
import com.czblood.common.core.domain.Result;
import com.czblood.common.utils.file.FileUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
@Service
@Slf4j
public class TransfuseApplyBeforeServiceImpl implements TransfuseApplyBeforeService {
@Resource
@ -45,37 +36,22 @@ public class TransfuseApplyBeforeServiceImpl implements TransfuseApplyBeforeServ
@Resource
TransfuseApplyBeforeUtil transfuseApplyBeforeUtil;
@Resource
XkTransfuseApplyTestitemMapper xkTransfuseApplyTestitemMapper;
XkTransfuseApplyMapper xkTransfuseApplyMapper;
@Resource
ReportUtil reportUtil;
@Resource
TransfuseApplyBeforeMapper transfuseApplyBeforeMapper;
@Override
public Result queryList(TransfuseApplyBeforeVO xkTransfuseApplyBeforeVO) {
if(xkTransfuseApplyBeforeVO.getStime() == null || xkTransfuseApplyBeforeVO.getEtime() == null) return new Result("-1","开始时间和结束时间不能为空!");
List<Map<String, Object>> mapList = transfuseApplyBeforeMapper.queryList(xkTransfuseApplyBeforeVO);
return new Result("0","获取数据成功!", mapList);
}
@Override
public Result queryOne(String billNo) {
//输血前评估信息
XkTransfuseApplyBefore xkTransfuseApplyBefore = new XkTransfuseApplyBefore();
xkTransfuseApplyBefore.setBill_no(billNo);
List<XkTransfuseApplyBefore> xkTransfuseApplyBeforeList = xkTransfuseApplyBeforeMapper.queryList(xkTransfuseApplyBefore);
if(xkTransfuseApplyBeforeList.size() <= 0) return new Result("-1","没有找到对应的评估单信息!");
TransfuseApplyBeforeDTO transfuseApplyBeforeDTO = new TransfuseApplyBeforeDTO();
transfuseApplyBeforeDTO.setXkTransfuseApplyBeforeList(xkTransfuseApplyBeforeList);
//病人信息
public Result queryList(XkTransfuseApplyBefore xkTransfuseApplyBefore) {
String beinhosId = xkTransfuseApplyBefore.getBeinhos_id();
//病人基本信息
XkPatientInfo xkPatientInfo = new XkPatientInfo();
xkPatientInfo.setBeinhos_id(xkTransfuseApplyBeforeList.get(0).getBeinhos_id());
xkPatientInfo.setBeinhos_id(beinhosId);
List<XkPatientInfo> xkPatientInfoList = xkPatientInfoMapper.queryList(xkPatientInfo);
if(xkPatientInfoList.size() <= 0) return new Result("-1","没有找到对应的病人信息!");
transfuseApplyBeforeDTO.setXkPatientInfo(xkPatientInfoList.get(0));
//输血前检查lis项目信息
List<XkTransfuseApplyTestitem> xkTransfuseApplyTestitemList = xkTransfuseApplyTestitemMapper.queryList(billNo);
transfuseApplyBeforeDTO.setXkTransfuseApplyTestitemList(xkTransfuseApplyTestitemList);
//输血前评估信息
List<XkTransfuseApplyBefore> xkTransfuseApplyBeforeList = xkTransfuseApplyBeforeMapper.queryList(xkTransfuseApplyBefore);
TransfuseApplyBeforeDTO transfuseApplyBeforeDTO = new TransfuseApplyBeforeDTO();
if(xkPatientInfoList.size() > 0) transfuseApplyBeforeDTO.setXkPatientInfo(xkPatientInfoList.get(0));
transfuseApplyBeforeDTO.setXkTransfuseApplyBeforeList(xkTransfuseApplyBeforeList);
return new Result("0","获取数据成功!", transfuseApplyBeforeDTO);
}
@ -86,6 +62,7 @@ public class TransfuseApplyBeforeServiceImpl implements TransfuseApplyBeforeServ
getPatientInfoRequest.setBeinhos_id(patNo);
Result result = BloodInterfaceUtil.invokeBloodInterface(getPatientInfoRequest);
if(!result.getCode().equals("0")) return result;
XkTransfuseApply xkTransfuseApply = JSONUtil.parseObj(result.getData()).toBean(XkTransfuseApply.class);
XkPatientInfo xkPatientInfo = JSONUtil.parseObj(result.getData()).toBean(XkPatientInfo.class);
if(xkPatientInfo.getBeinhos_id() == null){
XkPatientInfo xkPatientInfoOne = new XkPatientInfo();
@ -93,7 +70,7 @@ public class TransfuseApplyBeforeServiceImpl implements TransfuseApplyBeforeServ
List<XkPatientInfo> xkPatientInfoList = xkPatientInfoMapper.queryList(xkPatientInfoOne);
if(!xkPatientInfoList.isEmpty()) xkPatientInfo = xkPatientInfoList.get(0);
}
//调用检验接口,获取病人检验信息,包括血型结果
//调用检验接口,获取病人检验信息
GetTestResultRequest getTestResultRequest = new GetTestResultRequest();
getTestResultRequest.setBeinhos_id(patNo);
Result result1 = BloodInterfaceUtil.invokeBloodInterface(getTestResultRequest);
@ -102,6 +79,7 @@ public class TransfuseApplyBeforeServiceImpl implements TransfuseApplyBeforeServ
TransfuseApplyBeforeDTO transfuseApplyBeforeDTO = new TransfuseApplyBeforeDTO();
transfuseApplyBeforeDTO.setXkPatientInfo(xkPatientInfo);
transfuseApplyBeforeDTO.setXkTransfuseApplyTestitemList(xkTransfuseApplyTestitemList);
transfuseApplyBeforeDTO.setXkTransfuseApply(xkTransfuseApply);
return new Result("0","获取数据成功!", transfuseApplyBeforeDTO);
}
@ -112,7 +90,6 @@ public class TransfuseApplyBeforeServiceImpl implements TransfuseApplyBeforeServ
if(xkTransfuseApplyBeforeList.size() > 0){
XkTransfuseApplyBefore xkTransfuseApplyBefore = xkTransfuseApplyBeforeList.get(0);
xkTransfuseApplyBefore.setBill_no(billNo);
xkTransfuseApplyBefore.setBill_status("1"); //保存状态
}
List<XkTransfuseApplyTestitem> xkTransfuseApplyTestitemList = transfuseApplyBeforeDTO.getXkTransfuseApplyTestitemList();
for (XkTransfuseApplyTestitem xkTransfuseApplyTestitem : xkTransfuseApplyTestitemList) {
@ -129,7 +106,7 @@ public class TransfuseApplyBeforeServiceImpl implements TransfuseApplyBeforeServ
Result result = BloodInterfaceUtil.invokeBloodInterface(beforeAssessRequest);
if(!result.getCode().equals("0")) return result;
return new Result("0","保存成功!",billNo);
return new Result("0","保存成功!");
}
@Override
@ -142,70 +119,33 @@ public class TransfuseApplyBeforeServiceImpl implements TransfuseApplyBeforeServ
return new Result("0","修改成功!");
}
@Transactional
@Override
public Result delete(String billNo) {
Result result = canModify(billNo);
if(!result.getCode().equals("0")) return result;
XkTransfuseApplyBefore xkTransfuseApplyBefore = new XkTransfuseApplyBefore();
xkTransfuseApplyBefore.setBill_status("0"); //作废状态
xkTransfuseApplyBefore.setBill_no(billNo);
xkTransfuseApplyBeforeMapper.updateXkTransfuseApplyBefore(xkTransfuseApplyBefore);
xkTransfuseApplyBeforeMapper.deleteXkTransfuseApplyBefore(billNo);
return new Result("0","删除成功!");
}
@Override
public Result print(String billNo,String templateName) {
public Result print(String billNo) {
//打印输血前评估单
ReportParam reportParam = new ReportParam();
reportParam.setBillNo(billNo);
switch (templateName){
case "ASSESS_BEFORE": //打印输血前评估单
return reportUtil.printToPdf(BloodPrintTypeConstants.ASSESS_BEFORE, reportParam, true);
case "INFORMED_CONSENT": //打印知情同意书
//有两页,分了两个模版,分别生成pdf之后合并再发给前端
String pdfName = UUID.randomUUID().toString();
String path = RuoYiConfig.getProfile() +"/static/printPDF/"+pdfName+".pdf";
List<String> mergeBgdhList = new ArrayList<>();
Result result = reportUtil.printToPdf(BloodPrintTypeConstants.INFORMED_CONSENT_1, reportParam, true);
if(!result.getCode().equals("0")) return result;
mergeBgdhList.add(BloodBankUtil.isBank(result.getData()));
Result result1 = reportUtil.printToPdf(BloodPrintTypeConstants.INFORMED_CONSENT_2, reportParam, true);
if(!result1.getCode().equals("0")) return result1;
mergeBgdhList.add(BloodBankUtil.isBank(result1.getData()));
try {
ReportUtil.mergeToFile(mergeBgdhList, path);
//转成base64字符串
File file = new File(path);
String encode = Base64.encode(file);
//删除pdf文件
FileUtils.deleteFile(path);
return new Result("0","打印成功!",encode);
} catch (Exception e) {
e.printStackTrace();
log.error("合并pdf:{}报告失败:{}",mergeBgdhList,e);
return new Result("-1",e.getMessage());
}
}
return new Result("-1","没有找到对应的打印模版!");
return reportUtil.printToPdf(BloodPrintTypeConstants.ASSESS_BEFORE, reportParam, true);
}
public Result canModify(String billNo){
XkTransfuseApplyBefore xkTransfuseApplyBefore = xkTransfuseApplyBeforeMapper.queryOne(billNo);
if(xkTransfuseApplyBefore == null) return new Result("-1","没有找到对应的评估单!");
String billStatus = xkTransfuseApplyBefore.getBill_status();
if(billStatus.equals("2")) return new Result("-1","该单据已使用,无法修改!");
// XkTransfuseApply xkTransfuseApply = new XkTransfuseApply();
// xkTransfuseApply.setAssess_bill_no(billNo);
// List<XkTransfuseApply> xkTransfuseApplyList = xkTransfuseApplyMapper.queryList(xkTransfuseApply);
// if(xkTransfuseApplyList.size() > 0){
// for (XkTransfuseApply transfuseApply : xkTransfuseApplyList) {
// String checkSign = transfuseApply.getCheck_sign();
// if(checkSign.equals("Y")) return new Result("-1","该评估单对应的申请单已审核,无法修改或删除!");
// }
// }
XkTransfuseApply xkTransfuseApply = new XkTransfuseApply();
xkTransfuseApply.setAssess_bill_no(billNo);
List<XkTransfuseApply> xkTransfuseApplyList = xkTransfuseApplyMapper.queryList(xkTransfuseApply);
if(xkTransfuseApplyList.size() > 0){
for (XkTransfuseApply transfuseApply : xkTransfuseApplyList) {
String checkSign = transfuseApply.getCheck_sign();
if(checkSign.equals("Y")) return new Result("-1","该评估单对应的申请单已审核,无法修改或删除!");
}
}
return new Result("0","可以修改!");
}
}

View File

@ -1,424 +0,0 @@
package com.czblood.busDoctor.service.impl;
import com.czblood.bus.mapper.*;
import com.czblood.bus.pojo.*;
import com.czblood.bus.pojo.xtwh.XkDmzd;
import com.czblood.bus.utils.BloodBankUtil;
import com.czblood.busDoctor.mapper.TransfuseApplyMapper;
import com.czblood.busDoctor.pojo.DTO.TransfuseApplyDTO;
import com.czblood.busDoctor.pojo.DTO.TransfuseApplyInfoOne;
import com.czblood.busDoctor.pojo.VO.ApplyCheckVO;
import com.czblood.busDoctor.pojo.VO.CheckMedicVO;
import com.czblood.busDoctor.pojo.VO.TransfuseApplyVO;
import com.czblood.busDoctor.service.TransfuseApplyService;
import com.czblood.busDoctor.utils.TransfuseApplyUtil;
import com.czblood.common.core.domain.Result;
import com.czblood.common.core.domain.entity.SysUser;
import com.czblood.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Service
@Slf4j
public class TransfuseApplyServiceImpl implements TransfuseApplyService {
@Resource
TransfuseApplyMapper transfuseApplyMapper;
@Resource
XkTransfuseApplyTestitemMapper xkTransfuseApplyTestitemMapper;
@Resource
XkTransfuseApplyBloodbreedMapper xkTransfuseApplyBloodbreedMapper;
@Resource
XkTransfuseApplyBeforeMapper xkTransfuseApplyBeforeMapper;
@Resource
XkPatientInfoMapper xkPatientInfoMapper;
@Resource
BloodBankUtil bloodBankUtil;
@Resource
XkProTransfuseProjectMapper xkProTransfuseProjectMapper;
@Resource
XkTransfuseApplyCausalisMapper xkTransfuseApplyCausalisMapper;
@Resource
TransfuseApplyUtil transfuseApplyUtil;
@Resource
XkTransfuseApplyApprovalMapper xkTransfuseApplyApprovalMapper;
@Resource
XkTransfuseApplyMapper xkTransfuseApplyMapper;
/**
* 获取病人信息
*
* @param transfuseApplyVO
* @return
*/
@Override
public Result getPatInfo(TransfuseApplyVO transfuseApplyVO) {
//获取输血前评估单对应的病人信息
String billNo = transfuseApplyVO.getBill_no();
if (billNo == null || billNo.equals("")) return new Result("-1", "查询的申请单号不能为空!");
XkTransfuseApplyBefore xkTransfuseApplyBefore = xkTransfuseApplyBeforeMapper.queryOne(billNo);
if (xkTransfuseApplyBefore == null) return new Result("-1", "没有查到对应的输血评估单!");
String beinhosId = xkTransfuseApplyBefore.getBeinhos_id();
XkPatientInfo xkPatientInfo = xkPatientInfoMapper.queryOne(beinhosId);
if (xkPatientInfo == null) return new Result("-1"," 没有查到对应的病人信息!");
//将输血评估的信息写入到输血申请单
String userId = transfuseApplyVO.getUser_id();
Result result = getTransfuseApplyInfo(xkTransfuseApplyBefore,xkPatientInfo,userId);
if (!result.getCode().equals("0")) return result;
//获取输血前lis检验信息
List<XkTransfuseApplyTestitem> xkTransfuseApplyTestitemList = xkTransfuseApplyTestitemMapper.queryList(billNo);
int count = transfuseApplyMapper.queryXkCheckBloodtypeCount(beinhosId);
String warnMsg = "";
String code = "0"; //返回值code
if(count > 0) warnMsg = "该患者历史血型复核为亚型,请联系输血科确认!";
if(!warnMsg.equals("")) code = "3";
TransfuseApplyDTO transfuseApplyDTO = new TransfuseApplyDTO();
transfuseApplyDTO.setTransfuseApplyInfoOne((TransfuseApplyInfoOne)result.getData());
transfuseApplyDTO.setXkTransfuseApplyTestitemList(xkTransfuseApplyTestitemList);
return new Result(code,warnMsg,transfuseApplyDTO);
}
private Result getTransfuseApplyInfo(XkTransfuseApplyBefore xkTransfuseApplyBefore,XkPatientInfo xkPatientInfo,String userId) {
String beinhosId = xkTransfuseApplyBefore.getBeinhos_id();
TransfuseApplyInfoOne transfuseApplyInfoOne = new TransfuseApplyInfoOne();
XkTransfuseApply xkTransfuseApply = transfuseApplyInfoOne.getXkTransfuseApply();
XkPatientInfo xkPatientInfoSet = transfuseApplyInfoOne.getXkPatientInfo();
xkTransfuseApply.setBeinhos_id(beinhosId);
xkTransfuseApply.setHos_id(xkTransfuseApplyBefore.getHos_id());
xkTransfuseApply.setBeinhos_number(xkPatientInfo.getBeinhos_number());
xkTransfuseApply.setZone_id(xkTransfuseApplyBefore.getZone_id());
xkTransfuseApply.setPatient_bed(xkTransfuseApplyBefore.getPatient_bed());
xkTransfuseApply.setTransfuse_history(xkPatientInfo.getTransfuse_history());
xkTransfuseApply.setReaction_history(xkPatientInfo.getReaction_history());
xkTransfuseApply.setGestation_history(xkPatientInfo.getGestation_history());
xkTransfuseApply.setParturition_history(xkPatientInfo.getParturition_history());
xkTransfuseApply.setMatch_history(xkPatientInfo.getMatch_history());
xkTransfuseApply.setTransplant_history(xkPatientInfo.getTransplant_history());
xkTransfuseApply.setDept_id(xkTransfuseApplyBefore.getDept_id());
xkTransfuseApply.setApply_date(bloodBankUtil.getCurrentTimeDate());
xkTransfuseApply.setInput_person(userId);
xkTransfuseApply.setAttending_medic(userId);
xkTransfuseApply.setTreat_medic(userId);
xkTransfuseApply.setAbo_type(xkPatientInfo.getAbo());
xkTransfuseApply.setRh_type(xkPatientInfo.getRh());
xkTransfuseApply.setBill_stasus("A");
xkTransfuseApply.setApply_medic(userId);
xkTransfuseApply.setDiagnoses(xkTransfuseApplyBefore.getDiagnoses());
xkTransfuseApply.setApply_type("001"); //常规用血
xkTransfuseApply.setUse1_date(bloodBankUtil.getCurrentTimeDate());
xkTransfuseApply.setSample_sign("N");
xkTransfuseApply.setInput_dept(BloodBankUtil.isBank(xkTransfuseApplyBefore.getDept_id()));
xkTransfuseApply.setOperation_type("C");
xkTransfuseApply.setAgreement_ink("Y");
xkTransfuseApply.setSend_able("N"); //这个像是上级医生审核标志,这里先默认为否
//xkTransfuseApply.setDept_Type(""); //这个前端传吧,而且是必填的
xkTransfuseApply.setValid_Flag("Y"); //默认是合理的
xkTransfuseApply.setNotice_yn("N");
xkTransfuseApply.setAssess_bill_no(xkTransfuseApplyBefore.getBill_no()); //输血评估单号
xkPatientInfoSet.setPatient_name(xkPatientInfo.getPatient_name());
xkPatientInfoSet.setPatient_sex(xkPatientInfo.getPatient_sex());
xkPatientInfoSet.setAge(xkPatientInfo.getAge());
xkPatientInfoSet.setApanage(xkPatientInfo.getApanage());
return new Result("0","操作成功",transfuseApplyInfoOne);
}
@Override
public Result queryList(TransfuseApplyVO transfuseApplyVO) {
Integer day = transfuseApplyVO.getDay();
if (day == null || day == 0) return new Result("-1", "查询天数不能为空!");
List<Map<String, Object>> transfuseApplyList = transfuseApplyMapper.queryList(transfuseApplyVO);
return new Result("0", "查询成功", transfuseApplyList);
}
@Override
public Result queryApplyOne(String billNo) {
TransfuseApplyVO transfuseApplyVO = new TransfuseApplyVO();
transfuseApplyVO.setBill_no(billNo);
TransfuseApplyInfoOne transfuseApplyInfoOne = transfuseApplyMapper.queryApplyOne(transfuseApplyVO);
TransfuseApplyDTO transfuseApplyDTO = new TransfuseApplyDTO();
transfuseApplyDTO.setTransfuseApplyInfoOne(transfuseApplyInfoOne);
List<XkTransfuseApplyTestitem> xkTransfuseApplyTestitemList = xkTransfuseApplyTestitemMapper.queryList(billNo);
transfuseApplyDTO.setXkTransfuseApplyTestitemList(xkTransfuseApplyTestitemList);
List<XkTransfuseApplyBloodbreed> xkTransfuseApplyBloodbreedList = xkTransfuseApplyBloodbreedMapper.queryOne(billNo);
transfuseApplyDTO.setXkTransfuseApplyBloodbreedList(xkTransfuseApplyBloodbreedList);
List<XkTransfuseApplyCausalis> xkTransfuseApplyCausalisList = xkTransfuseApplyCausalisMapper.queryListByBillNo(billNo);
transfuseApplyDTO.setXkTransfuseApplyCausalisList(xkTransfuseApplyCausalisList);
XkTransfuseApplyApproval xkTransfuseApplyApproval = xkTransfuseApplyApprovalMapper.queryOneByBillNo(billNo);
if (xkTransfuseApplyApproval != null) {
transfuseApplyDTO.setXkTransfuseApplyApproval(xkTransfuseApplyApproval);
}
return new Result("0", "查询成功", transfuseApplyDTO);
}
/**
* 查询输血前评估信息列表
*
* @return
*/
@Override
public Result queryApplyBeforeList(String dept_id, String assess_person) {
List<Map<String, Object>> transfuseApplyBeforeList = transfuseApplyMapper.queryApplyBeforeList(dept_id, assess_person);
return new Result("0", "查询成功", transfuseApplyBeforeList);
}
@Override
public Result savePreApplyInfo(TransfuseApplyDTO transfuseApplyDTO) {
TransfuseApplyInfoOne transfuseApplyInfoOne = transfuseApplyDTO.getTransfuseApplyInfoOne();
XkTransfuseApply xkTransfuseApply = transfuseApplyInfoOne.getXkTransfuseApply();
List<XkTransfuseApplyBloodbreed> xkTransfuseApplyBloodbreedList = transfuseApplyDTO.getXkTransfuseApplyBloodbreedList();
List<XkTransfuseApplyTestitem> xkTransfuseApplyTestitemList = transfuseApplyDTO.getXkTransfuseApplyTestitemList();
String beinhosId = xkTransfuseApply.getBeinhos_id();
String billStasus = xkTransfuseApply.getBill_stasus();
switch (billStasus) {
case "B":
return new Result("-1","该申请单已经审核!");
case "C":
return new Result("-1","该申请单已经配血!");
case "D":
return new Result("-1","该申请单已经发血!");
case "Z":
return new Result("-1","该申请单已经作废!");
case "S":
return new Result("-1","该申请单正在增加血液!");
}
String applyType = xkTransfuseApply.getApply_type();
if(applyType.contains("手术")){
String operationName = xkTransfuseApply.getOperation_name();
if(StringUtils.isEmpty(operationName)){
return new Result("-1","手术备血必须填写手术名称!");
}
}
XkDmzd dictCacheOne = bloodBankUtil.getDictCacheOne("sqlx", applyType);
//没有开启绿色通道的单据类型
if(!dictCacheOne.getExp2().equals("Y")){
String sfsyzckz = BloodBankUtil.isBank(bloodBankUtil.getParameterValue("SFSYZCKZ"));
//开启职称校验
if(sfsyzckz.equals("Y")){
//申请单的申请医生
Result result = checkZC(xkTransfuseApply.getApply_medic());
if(!result.getCode().equals("0")) return result;
if(Integer.parseInt(result.getData().toString()) < 2) return new Result("-1","申请医师必须具备中级或以上职称,录入的申请医师不具备该职称。");
//申请单的上级医师
Result result1 = checkZC(xkTransfuseApply.getTreat_medic());
if(!result1.getCode().equals("0")) return result1;
if(Integer.parseInt(result1.getData().toString()) < 3) return new Result("-1","上级医师必须具备高级职称,录入的上级医师不具备该职称。");
XkProTransfuseProject xkProTransfuseProject = new XkProTransfuseProject();
xkProTransfuseProject.setNeed("Y");
List<XkProTransfuseProject> xkProTransfuseProjectList = xkProTransfuseProjectMapper.queryList(xkProTransfuseProject);
//校验检验结果是否为空
for (XkTransfuseApplyTestitem xkTransfuseApplyTestitem : xkTransfuseApplyTestitemList) {
String itemResult = xkTransfuseApplyTestitem.getItem_result();
String itemName = xkTransfuseApplyTestitem.getItem_name();
XkProTransfuseProject xkProTransfuseProject2 = xkProTransfuseProjectList.stream().filter(xkProTransfuseProject1 -> xkProTransfuseProject1.getPro_name().equals(itemName)).findFirst().orElse(null);
if(xkProTransfuseProject2 != null && StringUtils.isEmpty(itemResult)) return new Result("-1","请输入"+itemName+"的检验结果!");
}
}
}
String agreementInk = BloodBankUtil.isBank(xkTransfuseApply.getAgreement_ink());
if(!agreementInk.equals("Y")) return new Result("-1","请先签署输血知情同意书!");
String intent = BloodBankUtil.isBank(xkTransfuseApply.getIntent());
if(intent.equals("")) return new Result("-1","请填写输血目的!");
for (XkTransfuseApplyBloodbreed xkTransfuseApplyBloodbreed : xkTransfuseApplyBloodbreedList) {
String bloodBreed = xkTransfuseApplyBloodbreed.getBlood_breed();
String preBillNo = transfuseApplyMapper.checkSameBloodType(beinhosId, bloodBreed);
//申请血型校验
String sqxxnfwk = bloodBankUtil.getParameterValue("SQXXNFWK");
if(!sqxxnfwk.equals("Y")){
//申请血型不能为空
if(StringUtils.isEmpty(bloodBreed)) return new Result("-1","请输入申请血型!");
}
if(!StringUtils.isEmpty(preBillNo)){
return new Result("2","当前患者存在相同的血液品种并且未审核的申请单,是否调出此单进行修改?",preBillNo);
}
}
return null;
}
@Override
public Result checkSelfBlood(String beinhosId) {
List<Map<String, Object>> mapList = transfuseApplyMapper.checkSelfBlood(beinhosId);
String msg = "";
for (Map<String, Object> stringObjectMap : mapList) {
String breedName = BloodBankUtil.isBank(stringObjectMap.get("breed_name"));
String capacity = BloodBankUtil.isBank(stringObjectMap.get("capacity"));
String unit = BloodBankUtil.isBank(stringObjectMap.get("unit"));
msg = msg + breedName + ":" + capacity + unit + ",";
}
if(msg.equals("")){
return new Result("0","校验通过!");
}else{
msg = "检测到该病患尚有贮存式自体血未出库,具体如下:" + msg + "是否继续申请血液?";
return new Result("2",msg);
}
}
/**
* 保存申请单
* @param transfuseApplyDTO
* @return
*/
@Override
public Result saveApplyInfo(TransfuseApplyDTO transfuseApplyDTO) {
TransfuseApplyInfoOne transfuseApplyInfoOne = transfuseApplyDTO.getTransfuseApplyInfoOne();
XkTransfuseApply xkTransfuseApply = transfuseApplyInfoOne.getXkTransfuseApply();
String billNo = xkTransfuseApply.getBill_no();
//校验是否是大量用血
Result result = transfuseApplyUtil.computeLargeBlood(transfuseApplyDTO);
//if(!result.getCode().equals("0")) return result;
String code = result.getCode();
String msg = result.getMsg();
XkTransfuseApplyApproval xkTransfuseApplyApproval = (XkTransfuseApplyApproval) result.getData();
//设置相关值,准备数据
String billType = xkTransfuseApply.getBill_type();
if(billType.equals("补单")) xkTransfuseApply.setBill_stasus("BD");
/**
* 大量用血标志,以前是有参数控制来判断值,但是以前是一个申请单只有一个血液品种,现在是有多个,
* 暂时就以大量用血审批表来做判断吧,有大量用血的审批,标志为Y,否则为N
* String spyxlParam = bloodBankUtil.getParameterValue("spyxl");
*/
if(code.equals("0")){
xkTransfuseApply.setIs_large_use("Y");
}else{
xkTransfuseApply.setIs_large_use("N");
}
//PB的逻辑:if gs_deptid = "001" then dw_main.object.xk_transfuse_apply_send_able[1] = "Y"
//xkTransfuseApply.setSend_able("Y");
//代表新增单据
if(billNo == null){
//产生申请单编号
String newBillNo = bloodBankUtil.produceBillNo("SQD");
//申请单信息
xkTransfuseApply.setBill_no(newBillNo);
//申请单明细,血液品种
List<XkTransfuseApplyBloodbreed> xkTransfuseApplyBloodbreedList = transfuseApplyDTO.getXkTransfuseApplyBloodbreedList();
for (XkTransfuseApplyBloodbreed xkTransfuseApplyBloodbreed : xkTransfuseApplyBloodbreedList) {
xkTransfuseApplyBloodbreed.setBill_no(newBillNo);
}
//输血指征信息
List<XkTransfuseApplyCausalis> xkTransfuseApplyCausalisList = transfuseApplyDTO.getXkTransfuseApplyCausalisList();
if(!xkTransfuseApplyCausalisList.isEmpty()){
for (XkTransfuseApplyCausalis xkTransfuseApplyCausalis : xkTransfuseApplyCausalisList) {
xkTransfuseApplyCausalis.setBill_No(newBillNo);
}
}
//检验项目明细
List<XkTransfuseApplyTestitem> xkTransfuseApplyTestitemList = transfuseApplyDTO.getXkTransfuseApplyTestitemList();
if(!xkTransfuseApplyTestitemList.isEmpty()){
for (XkTransfuseApplyTestitem xkTransfuseApplyTestitem : xkTransfuseApplyTestitemList) {
xkTransfuseApplyTestitem.setBill_no(newBillNo);
}
}
//大量用血申请单表
xkTransfuseApplyApproval.setBill_No(newBillNo);
}
//保存数据
transfuseApplyUtil.saveTransfuseApply(transfuseApplyDTO, billNo == null);
if(code.equals("0")){
return new Result("0","保存成功!");
}else{
return new Result("1",msg);
}
}
/**
* 校验是否符合输血指征的规则
* @param transfuseApplyDTO
* @return
*/
@Override
public Result checkCausalis(TransfuseApplyDTO transfuseApplyDTO) {
//输血指征处理
// TransfuseApplyInfoOne transfuseApplyInfoOne = transfuseApplyDTO.getTransfuseApplyInfoOne();
// XkTransfuseApply xkTransfuseApply = transfuseApplyInfoOne.getXkTransfuseApply();
// if(!StringUtils.isEmpty(xkTransfuseApply.getBill_no())){
// //如果申请单编号不是空的,说明是修改数据,如果之前有数据,则返回之前的数据,没有标识校验通过
// List<XkTransfuseApplyCausalis> xkTransfuseApplyCausalisList = transfuseApplyDTO.getXkTransfuseApplyCausalisList();
// if(xkTransfuseApplyCausalisList.isEmpty()){
// return new Result("0","校验通过!");
// }else{
// return new Result("1","校验失败!",xkTransfuseApplyCausalisList);
// }
// }
//输血指征是否输血合理,校验是否符合输血指征的规则
//他原来的逻辑,分单据类型了,没搞懂为啥分,先统一校验吧
return transfuseApplyUtil.checkCausalis(transfuseApplyDTO);
// if(result.getCode().equals("0")) return result;
// if(result.getCode().equals("1")){
// List<XkTransfuseApplyCausalis> xkTransfuseApplyCausalisRetList = (List<XkTransfuseApplyCausalis>)result.getData();
// return new Result("1","校验失败!",xkTransfuseApplyCausalisRetList);
// }
//
// return new Result("0","校验通过!");
}
/**
* 上级医生审核
* @param checkMedicVO
* @return
*/
@Override
public Result applyMedicCheck(CheckMedicVO checkMedicVO) {
SysUser userInfo = bloodBankUtil.getUserInfo(checkMedicVO.getCheckMedic());
String postName = userInfo.getPostname();
if(!postName.equals("003") && !postName.equals("004")) return new Result("-1","审核医生不是副主任医师或主任医师!");
XkTransfuseApply xkTransfuseApply = new XkTransfuseApply();
xkTransfuseApply.setSend_able("Y");
xkTransfuseApply.setCheck_medic(checkMedicVO.getCheckMedic());
xkTransfuseApply.setMedic_check_date(checkMedicVO.getCheckDate());
xkTransfuseApply.setBill_no(checkMedicVO.getBillNo());
xkTransfuseApplyMapper.update(xkTransfuseApply);
return new Result("0","审核通过!");
}
/**
* 输血申请单审核
* @param applyCheckVO
* @return
*/
@Override
public Result applyCheck(ApplyCheckVO applyCheckVO) {
String billNo = applyCheckVO.getBillNo();
XkTransfuseApply xkTransfuseApply = xkTransfuseApplyMapper.queryOne(billNo);
String billStasus = xkTransfuseApply.getBill_stasus();
switch (billStasus){
case "B":
return new Result("-1","该单据已经审核!");
case "C":
return new Result("-1","该单据已经配血,不允许重复审核!");
case "Z":
return new Result("-1","该单据已经作废,不允许审核!");
case "F":
return new Result("-1","该单据已复核血型,不允许重复审核!");
case "D":
return new Result("-1","该单据已发血,不允许重复审核!");
}
return null;
}
/**
* 校验医生职称是否符合要求
* @return
*/
public Result checkZC(String userId){
SysUser userInfo = bloodBankUtil.getUserInfo(userId);
if(userInfo == null) return new Result("-1","用户不存在!");
String postname = BloodBankUtil.isBank(userInfo.getPostname());
if(postname.equals("")) postname = "0";
return new Result("0","",postname);
}
}

View File

@ -6,7 +6,7 @@ import com.czblood.bus.mapper.XkTransfuseApplyTestitemMapper;
import com.czblood.bus.pojo.XkPatientInfo;
import com.czblood.bus.pojo.XkTransfuseApplyBefore;
import com.czblood.bus.pojo.XkTransfuseApplyTestitem;
import com.czblood.busDoctor.pojo.DTO.TransfuseApplyBeforeDTO;
import com.czblood.busDoctor.pojo.TransfuseApplyBeforeDTO;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@ -26,11 +26,7 @@ public class TransfuseApplyBeforeUtil {
@Transactional
public void saveTransfuseApplyBeforeDTO(TransfuseApplyBeforeDTO transfuseApplyBeforeDTO){
XkPatientInfo xkPatientInfo = transfuseApplyBeforeDTO.getXkPatientInfo();
String beinhosId = xkPatientInfo.getBeinhos_id();
XkPatientInfo xkPatientInfo1 = xkPatientInfoMapper.queryOne(beinhosId);
if(xkPatientInfo1 == null) {
xkPatientInfoMapper.insertXkPatientInfo(xkPatientInfo);
}
xkPatientInfoMapper.insertXkPatientInfo(xkPatientInfo);
List<XkTransfuseApplyBefore> xkTransfuseApplyBeforeList = transfuseApplyBeforeDTO.getXkTransfuseApplyBeforeList();
if(xkTransfuseApplyBeforeList.size() > 0){
XkTransfuseApplyBefore xkTransfuseApplyBefore = xkTransfuseApplyBeforeList.get(0);

View File

@ -1,307 +0,0 @@
package com.czblood.busDoctor.utils;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.czblood.bus.mapper.*;
import com.czblood.bus.pojo.*;
import com.czblood.bus.pojo.xtwh.XkBloodBreed;
import com.czblood.bus.pojo.xtwh.XkDmzd;
import com.czblood.bus.utils.BloodBankUtil;
import com.czblood.busDoctor.mapper.TransfuseApplyMapper;
import com.czblood.busDoctor.pojo.DTO.TransfuseApplyDTO;
import com.czblood.busDoctor.pojo.DTO.TransfuseApplyInfoOne;
import com.czblood.busDoctor.pojo.DTO.XkTransfuseApplyCausalisDTO;
import com.czblood.common.core.domain.Result;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
@Component
public class TransfuseApplyUtil {
@Resource
XkCausalisSetMapper xkCausalisSetMapper;
@Resource
BloodBankUtil bloodBankUtil;
@Resource
XkBloodBreedMapper xkBloodBreedMapper;
@Resource
TransfuseApplyMapper transfuseApplyMapper;
@Resource
XkTransfuseApplyApprovalMapper xkTransfuseApplyApprovalMapper;
@Resource
XkPatientInfoMapper xkPatientInfoMapper;
@Resource
XkTransfuseApplyBloodbreedMapper xkTransfuseApplyBloodbreedMapper;
@Resource
XkTransfuseApplyCausalisMapper xkTransfuseApplyCausalisMapper;
@Resource
XkTransfuseApplyTestitemMapper xkTransfuseApplyTestitemMapper;
@Resource
XkTransfuseApplyMapper xkTransfuseApplyMapper;
/**
* 计算大量用血
*/
public Result computeLargeBlood(TransfuseApplyDTO transfuseApplyDTO){
TransfuseApplyInfoOne transfuseApplyInfoOne = transfuseApplyDTO.getTransfuseApplyInfoOne();
XkTransfuseApply xkTransfuseApply = transfuseApplyInfoOne.getXkTransfuseApply();
String beinhosId = xkTransfuseApply.getBeinhos_id();
String billNo = xkTransfuseApply.getBill_no();
String applyType = xkTransfuseApply.getApply_type();
XkDmzd sqlxDmzd = bloodBankUtil.getDictCacheOneByName("sqlx", applyType);
String exp2 = sqlxDmzd.getExp2(); //是否是抢救用血
String applyLev = ""; //大量用血等级
String flag = ""; //通过标志
String msg = "";
//抢救用血不参与大量用血计算
if(BloodBankUtil.isBank(exp2).equals("Y")) return new Result("0","抢救用血不参与大量用血计算");
//血液品种是否参与大量用血判断
BigDecimal totalApplyNum = BigDecimal.ZERO;
List<String> bloodKindList = new ArrayList<>();
List<XkTransfuseApplyBloodbreed> xkTransfuseApplyBloodbreedList = transfuseApplyDTO.getXkTransfuseApplyBloodbreedList();
for (XkTransfuseApplyBloodbreed xkTransfuseApplyBloodbreed : xkTransfuseApplyBloodbreedList) {
String bloodBreed = xkTransfuseApplyBloodbreed.getBlood_breed();
BigDecimal bloodNum = xkTransfuseApplyBloodbreed.getBlood_num();
XkBloodBreed xkBloodBreed = xkBloodBreedMapper.queryOne(bloodBreed);
XkDmzd xylxDmzd = bloodBankUtil.getDictCacheOneByName("xylx", xkBloodBreed.getBlood_kind());
String exp1 = xylxDmzd.getExp1(); //是否参与大量用血计算
if(!BloodBankUtil.isBank(exp1).equals("Y")) continue;
BigDecimal applyTransNum = bloodBankUtil.getApplyTransNum(bloodBreed,bloodNum);
totalApplyNum = totalApplyNum.add(applyTransNum);
bloodKindList.add(xkBloodBreed.getBlood_kind());
}
Date currentTimeDate = bloodBankUtil.getCurrentTimeDate();
DateTime yesterday = DateUtil.offsetDay(currentTimeDate, -1);
//其中不包含了当前申请单的输血量
BigDecimal beforeNum = transfuseApplyMapper.queryApplyTransTotalNum(beinhosId, yesterday, currentTimeDate, bloodKindList,billNo);
//大量用血判断
BigDecimal largeBloodNum = totalApplyNum.add(beforeNum).abs();
if(largeBloodNum.compareTo(new BigDecimal(800)) < 0){
applyLev = "1";
flag = "Y";
}else if(largeBloodNum.compareTo(new BigDecimal(800)) >= 0 && largeBloodNum.compareTo(new BigDecimal(1600)) < 0){
applyLev = "2";
flag = "N";
msg = "申请用血量≥800ml,需科主任进入临床用血(大量用血审批)页面核准!";
}else{
applyLev = "3";
flag = "N";
msg = "申请用血量≥1600ml,需科主任进入临床用血(大量用血审批)页面核准后,再报医务部门在临床用血(大量用血审批)批准!";
}
XkTransfuseApplyApproval xkTransfuseApplyApproval = null;
if(billNo == null){
xkTransfuseApplyApproval = new XkTransfuseApplyApproval();
}else{
xkTransfuseApplyApproval = xkTransfuseApplyApprovalMapper.queryOneByBillNo(billNo);
}
xkTransfuseApplyApproval.setApplyLevel(applyLev);
xkTransfuseApplyApproval.setFlag(flag);
if(flag.equals("N")){
return new Result("1",msg,xkTransfuseApplyApproval);
}else{
//校验通过
return new Result("0",msg,xkTransfuseApplyApproval);
}
}
/**
* 输血指征判断是否输血合理
* @param transfuseApplyDTO
* @return
*/
public Result checkCausalis(TransfuseApplyDTO transfuseApplyDTO){
TransfuseApplyInfoOne transfuseApplyInfoOne = transfuseApplyDTO.getTransfuseApplyInfoOne();
XkTransfuseApply xkTransfuseApply = transfuseApplyInfoOne.getXkTransfuseApply();
List<XkTransfuseApplyBloodbreed> xkTransfuseApplyBloodbreedList = transfuseApplyDTO.getXkTransfuseApplyBloodbreedList();
String beinhosId = BloodBankUtil.isBank(xkTransfuseApply.getBeinhos_id());
String deptType = BloodBankUtil.isBank(xkTransfuseApply.getDept_Type());
String useType = BloodBankUtil.isBank(xkTransfuseApply.getUse_type());
XkCausalisSet xkCausalisSet = new XkCausalisSet();
xkCausalisSet.setUse_Sign("Y");
xkCausalisSet.setDept_Type(deptType);
xkCausalisSet.setUse_Type(useType);
List<XkCausalisSet> xkCausalisSetList = xkCausalisSetMapper.queryList(xkCausalisSet);
List<XkTransfuseApplyCausalisDTO> xkTransfuseApplyCausalisList = new ArrayList<>();
int i = 0;
//这个返回也是原来的逻辑
if(beinhosId.equals("") || deptType.equals("") || useType.equals("") ) return new Result("0","字段没有填完整,无法校验!");
List<XkTransfuseApplyTestitem> xkTransfuseApplyTestitemList = transfuseApplyDTO.getXkTransfuseApplyTestitemList();
for (XkTransfuseApplyBloodbreed xkTransfuseApplyBloodbreed : xkTransfuseApplyBloodbreedList) {
String bloodBreed = BloodBankUtil.isBank(xkTransfuseApplyBloodbreed.getBlood_breed());
if(bloodBreed.equals("")) continue;
List<XkCausalisSet> collect = xkCausalisSetList.stream().filter(xkCausalisSet1 -> xkCausalisSet1.getBlood_Breed().equals(bloodBreed)).collect(Collectors.toList());
//校验输血指征是否合理
//这里的写法没有完全按照原来的逻辑来,原来的逻辑太稀碎了,我按照自己的理解写了一个,后面遇到问题再改吧,原来那个逻辑真看不下去
for (XkTransfuseApplyTestitem xkTransfuseApplyTestitem : xkTransfuseApplyTestitemList) {
String itemName = xkTransfuseApplyTestitem.getItem_name();
String itemResult = xkTransfuseApplyTestitem.getItem_result();
XkCausalisSet xkCausalisSet2 = calcCausalis(collect, itemName, itemResult);
if(xkCausalisSet2 != null){
//没有校验通过的,增加数据,让前台界面显示
XkTransfuseApplyCausalisDTO xkTransfuseApplyCausalisDTO = new XkTransfuseApplyCausalisDTO();
XkTransfuseApplyCausalis xkTransfuseApplyCausalis = new XkTransfuseApplyCausalis();
xkTransfuseApplyCausalis.setSID(i++);
xkTransfuseApplyCausalis.setCausalis_Code(xkCausalisSet.getCausalis_Code());
xkTransfuseApplyCausalis.setCausalis_Name(xkCausalisSet.getCausalis_Name());
xkTransfuseApplyCausalis.setCausalis_Result(xkCausalisSet.getCausalis_Result());
xkTransfuseApplyCausalis.setUse_Flag("Y");
xkTransfuseApplyCausalis.setUpload_Flag("N");
xkTransfuseApplyCausalis.setExplain("");
xkTransfuseApplyCausalisDTO.setItemName(itemName);
xkTransfuseApplyCausalisDTO.setItemResult(xkTransfuseApplyTestitem.getItem_result());
xkTransfuseApplyCausalisDTO.setXkTransfuseApplyCausalis(xkTransfuseApplyCausalis);
xkTransfuseApplyCausalisList.add(xkTransfuseApplyCausalisDTO);
}
}
}
if(xkTransfuseApplyCausalisList.isEmpty()){
return new Result("0","校验成功!");
}else{
return new Result("1","校验失败",xkTransfuseApplyCausalisList);
}
}
private XkCausalisSet calcCausalis(List<XkCausalisSet> xkCausalisSetList, String proName,String testValue){
//查找是否包含该指标
List<XkCausalisSet> collect = xkCausalisSetList.stream().filter(xkCausalisSet -> xkCausalisSet.getPro_Name().equals(proName)).collect(Collectors.toList());
if(collect.isEmpty()) return null;
//校验指标是否合理
for (XkCausalisSet xkCausalisSet : collect) {
String resultExpression = xkCausalisSet.getResult_Expression();
String testValueStandard = xkCausalisSet.getTest_Value();
String testValueStandard2 = xkCausalisSet.getTest_Value2();
if(!StrUtil.isNumeric(testValue)) continue; //不是数字型的不处理
if(!StrUtil.isNumeric(testValueStandard)) continue;
if(!StrUtil.isNumeric(testValueStandard2)) continue;
String causalisResult = xkCausalisSet.getCausalis_Result();
if(causalisResult.equals("")) continue;
if(causalisResult.equals("Y")){
//合理范围,那么不在这个范围内的,代表需要增加说明
switch (resultExpression) {
case ">":
if(Integer.parseInt(testValue) > Integer.parseInt(testValueStandard)) {
}else{
return xkCausalisSet;
}
break;
case "<":
if(Integer.parseInt(testValue) < Integer.parseInt(testValueStandard)) {
}else {
return xkCausalisSet;
}
break;
case "≥":
if(Integer.parseInt(testValue) >= Integer.parseInt(testValueStandard)) {
}else{
return xkCausalisSet;
}
break;
case "≤":
if(Integer.parseInt(testValue) <= Integer.parseInt(testValueStandard)) {
}else{
return xkCausalisSet;
}
break;
case "between":
if(Integer.parseInt(testValue) >= Integer.parseInt(testValueStandard) && Integer.parseInt(testValue) <= Integer.parseInt(testValueStandard2)) {
}else{
return xkCausalisSet;
}
break;
}
}else{
//不合理范围,代表直接返回
switch (resultExpression) {
case ">":
if(Integer.parseInt(testValue) > Integer.parseInt(testValueStandard)) return xkCausalisSet;
break;
case "<":
if(Integer.parseInt(testValue) < Integer.parseInt(testValueStandard)) return xkCausalisSet;
break;
case "≥":
if(Integer.parseInt(testValue) >= Integer.parseInt(testValueStandard)) return xkCausalisSet;
break;
case "≤":
if(Integer.parseInt(testValue) <= Integer.parseInt(testValueStandard)) return xkCausalisSet;
break;
case "between":
if(Integer.parseInt(testValue) >= Integer.parseInt(testValueStandard) && Integer.parseInt(testValue) <= Integer.parseInt(testValueStandard2)) return xkCausalisSet;
break;
}
}
}
return null;
}
@Transactional
public void saveTransfuseApply(TransfuseApplyDTO transfuseApplyDTO,boolean isNew){
TransfuseApplyInfoOne transfuseApplyInfoOne = transfuseApplyDTO.getTransfuseApplyInfoOne();
XkTransfuseApply xkTransfuseApply = transfuseApplyInfoOne.getXkTransfuseApply();
XkPatientInfo xkPatientInfo = transfuseApplyInfoOne.getXkPatientInfo();
List<XkTransfuseApplyBloodbreed> xkTransfuseApplyBloodbreedList = transfuseApplyDTO.getXkTransfuseApplyBloodbreedList();
List<XkTransfuseApplyCausalis> xkTransfuseApplyCausalisList = transfuseApplyDTO.getXkTransfuseApplyCausalisList();
List<XkTransfuseApplyTestitem> xkTransfuseApplyTestitemList = transfuseApplyDTO.getXkTransfuseApplyTestitemList();
XkTransfuseApplyApproval xkTransfuseApplyApproval = transfuseApplyDTO.getXkTransfuseApplyApproval();
//保存病人信息表
xkPatientInfoMapper.deleteXkPatientInfo(xkPatientInfo.getBeinhos_id());
xkPatientInfoMapper.insertXkPatientInfo(xkPatientInfo);
if(!isNew){
//保存申请单信息表
xkTransfuseApplyMapper.update(xkTransfuseApply);
//保存申请单品种表
for (XkTransfuseApplyBloodbreed xkTransfuseApplyBloodbreed : xkTransfuseApplyBloodbreedList) {
xkTransfuseApplyBloodbreedMapper.update(xkTransfuseApplyBloodbreed);
}
}else{
//保存申请单信息表
xkTransfuseApplyMapper.insert(xkTransfuseApply);
for (XkTransfuseApplyBloodbreed xkTransfuseApplyBloodbreed : xkTransfuseApplyBloodbreedList) {
xkTransfuseApplyBloodbreedMapper.insert(xkTransfuseApplyBloodbreed);
}
//保存申请单品种表
for (XkTransfuseApplyBloodbreed xkTransfuseApplyBloodbreed : xkTransfuseApplyBloodbreedList) {
xkTransfuseApplyBloodbreedMapper.insert(xkTransfuseApplyBloodbreed);
}
}
//保存输血指征表
if(xkTransfuseApplyCausalisList.size() > 0){
xkTransfuseApplyCausalisMapper.deleteByBillNo(xkTransfuseApplyCausalisList.get(0).getBill_No());
for (XkTransfuseApplyCausalis xkTransfuseApplyCausalis : xkTransfuseApplyCausalisList) {
xkTransfuseApplyCausalisMapper.insert(xkTransfuseApplyCausalis);
}
}
//保存检验项目明细
xkTransfuseApplyTestitemMapper.deleteXkTransfuseApplyTestitem(xkTransfuseApply.getBill_no(),0);
for (XkTransfuseApplyTestitem xkTransfuseApplyTestitem : xkTransfuseApplyTestitemList) {
xkTransfuseApplyTestitemMapper.insertXkTransfuseApplyTestitem(xkTransfuseApplyTestitem);
}
//大量用血申请单表
xkTransfuseApplyApprovalMapper.delete(xkTransfuseApplyApproval.getBill_No());
xkTransfuseApplyApprovalMapper.insert(xkTransfuseApplyApproval);
}
}

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.czblood.busDoctor.mapper.TransfuseApplyBeforeMapper">
<select id="queryList" resultType="map">
select * from xk_transfuse_apply_before a ,xk_patient_info b
<![CDATA[where a.beinhos_id = b.beinhos_id and a.assess_data >= #{stime} and a.assess_data <= #{etime} and isnull(a.bill_status,'') <> '0']]>
<if test="bill_no != null and bill_no != ''">and a.bill_no = #{bill_no}</if>
<if test="beinhos_id != null and beinhos_id != ''">and a.beinhos_id = #{beinhos_id}</if>
<if test="patient_name != null and patient_name != ''">and b.patient_name like '%'+#{patient_name}+'%' </if>
</select>
</mapper>

View File

@ -1,175 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.czblood.busDoctor.mapper.TransfuseApplyMapper">
<select id="queryList" resultType="map">
SELECT DISTINCT xk_transfuse_apply.bill_no,
xk_transfuse_apply.dept_id,
xk_patient_info.patient_name,
xk_transfuse_apply.apply_date,
xk_transfuse_apply.apply_medic,
xk_transfuse_apply.bill_stasus,
xk_transfuse_apply.beinhos_id ,
xk_transfuse_apply.abo_type,
xk_transfuse_apply.rh_type,
xk_transfuse_apply.is_large_use,
SUBSTRING(( SELECT ',' +xx.breed_name+CONVERT(varchar(255),CONVERT(decimal(10,1),x.blood_num))+x.unit
from xk_transfuse_apply_bloodbreed x join xk_blood_breed xx on xx.breed_code=x.blood_breed where x.bill_no=xk_transfuse_apply.bill_no FOR XML PATH('') ),2,999) as req_breed
FROM xk_patient_info RIGHT OUTER JOIN xk_transfuse_apply ON xk_patient_info.beinhos_id = xk_transfuse_apply.beinhos_id
WHERE ( xk_transfuse_apply.operation_type = 'C' OR ISNULL(xk_transfuse_apply.operation_type,'') = '')
and xk_transfuse_apply.apply_date > getdate() - #{day} and xk_transfuse_apply.hos_id = #{hos_id}
<if test="bill_status != null and bill_status != ''">and xk_transfuse_apply.bill_stasus = #{bill_status}</if>
<if test="dept_code != null and dept_code != ''">and xk_transfuse_apply.dept_id = #{dept_code}</if>
<if test="dept_code != null and dept_code != ''">and (xk_transfuse_apply.dept_id = #{dept_code} or xk_transfuse_apply.input_dept = #{dept_code})</if>
<if test="doctor_code != null and doctor_code != ''">and xk_transfuse_apply.apply_medic = #{doctor_code}</if>
</select>
<select id="queryApplyOne" resultType="com.czblood.busDoctor.pojo.DTO.TransfuseApplyInfoOne">
SELECT top 1 xk_patient_info.hos_id,
xk_patient_info.patient_name,
xk_patient_info.age,
xk_transfuse_apply.zone_id,
xk_patient_info.patient_sex,
xk_patient_info.patient_birthday,
xk_transfuse_apply.patient_bed,
xk_transfuse_apply.casehistory_id,
xk_transfuse_apply.dept_id,
xk_transfuse_apply.card_no,
xk_patient_info.apanage,
xk_transfuse_apply.hos_id,
xk_transfuse_apply.bill_no,
xk_transfuse_apply.beinhos_id,
xk_patient_info.transfuse_history,
xk_patient_info.gestation_history,
xk_patient_info.parturition_history,
xk_patient_info.reaction_history,
xk_transfuse_apply.apply_date,
xk_transfuse_apply.send_person,
xk_transfuse_apply.charge_sign,
xk_transfuse_apply.input_person,
xk_transfuse_apply.receive_date,
xk_transfuse_apply.attending_medic,
xk_transfuse_apply.bank_director,
xk_transfuse_apply.medical_affairs,
xk_transfuse_apply.sample_id,
xk_transfuse_apply.gather_date,
xk_transfuse_apply.abo_type,
xk_transfuse_apply.rh_type,
xk_transfuse_apply.check_sign,
xk_transfuse_apply.bill_stasus,
xk_patient_info.out_sign,
xk_transfuse_apply.apply_medic,
xk_transfuse_apply.diagnoses,
xk_transfuse_apply.intent,
xk_transfuse_apply.treat_medic,
xk_transfuse_apply.causalis,
xk_transfuse_apply.use3_date,
xk_transfuse_apply.use2_date,
xk_transfuse_apply.use1_date,
xk_patient_info.match_history,
xk_transfuse_apply.apply_type,
xk_transfuse_apply.bill_type,
xk_transfuse_apply.operation_type ,
xk_transfuse_apply_bloodbreed.blood_breed ,
xk_transfuse_apply_bloodbreed.blood_num ,
xk_transfuse_apply_bloodbreed.unit ,
xk_transfuse_apply_bloodbreed.onetime_num ,
xk_transfuse_apply_bloodbreed.special_deal ,
xk_transfuse_apply_bloodbreed.replace_bloodbreed,
xk_transfuse_apply_bloodbreed.remark,
xk_transfuse_apply.bill_sort,
xk_transfuse_apply.sample_sign,
xk_transfuse_apply_bloodbreed.apply_bloodtype,
xk_transfuse_apply.check_explain,
xk_transfuse_apply.input_dept,
xk_transfuse_apply.send_able,
xk_transfuse_apply.medic_check_date,
xk_transfuse_apply.check_medic,xk_transfuse_apply.remark,
xk_transfuse_apply.is_large_use,xk_transfuse_apply.agreement_ink,
xk_transfuse_apply.beinhos_number ,xk_transfuse_apply.notify_sign,
xk_transfuse_apply.Use_Type ,xk_transfuse_apply.Valid_Flag,
xk_transfuse_apply.Ill_Code,xk_transfuse_apply.Dept_Type,
xk_transfuse_apply.Ops_Name,xk_transfuse_apply.Use1_Num,xk_transfuse_apply.operation_name,xk_transfuse_apply.operation_level
FROM xk_patient_info RIGHT OUTER JOIN xk_transfuse_apply ON xk_patient_info.beinhos_id = xk_transfuse_apply.beinhos_id ,
xk_transfuse_apply_bloodbreed
WHERE xk_transfuse_apply.bill_no = xk_transfuse_apply_bloodbreed.bill_no AND
xk_transfuse_apply.bill_no = #{bill_no} and xk_transfuse_apply.hos_id = #{hos_id}
</select>
<select id="queryApplyBeforeList" resultType="java.util.Map">
select
xk_transfuse_apply_before.bill_no,
xk_transfuse_apply_before.dept_id,
xk_patient_info.patient_name,
xk_transfuse_apply_before.beinhos_id,
xk_transfuse_apply_before.assess_data,
xk_transfuse_apply_before.assess_person
from
xk_transfuse_apply_before,xk_patient_info
where
xk_transfuse_apply_before.beinhos_id = xk_patient_info.beinhos_id AND
xk_transfuse_apply_before.assess_data>GETDATE() - 1 AND
(xk_transfuse_apply_before.dept_id=#{dept_id} or xk_transfuse_apply_before.assess_person=#{assess_person})
and xk_transfuse_apply_before.hos_id = #{hos_id}
</select>
<select id="queryXkCheckBloodtypeCount" resultType="java.lang.Integer">
SELECT Count (*) FROM xk_check_bloodtype where hos_id = #{hos_id}
<![CDATA[ and isnull( sub_blood , '' ) <> '' ]]>
and beinhos_id = #{beinhos_id};
</select>
<select id="checkSameBloodType" resultType="java.lang.String">
select distinct t1.bill_no
into :ls_pre_billno
from xk_transfuse_apply t1 , xk_transfuse_apply_bloodbreed t2
where t1.apply_date in (
select max ( apply_date )
from xk_transfuse_apply a , xk_transfuse_apply_bloodbreed b , xk_blood_breed d
where a.bill_no =b.bill_no and
b.blood_breed =d.breed_code and
d.blood_kind ='0004' and
a.beinhos_id = #{beinhos_id} and
b.blood_breed = #{blood_breed} and
isnull ( a.check_sign , 'N' ) ='N' and
<![CDATA[DATEDIFF ( day , apply_date , GETDATE ( ) ) < 3 ) and]]>
t2.blood_breed in (
select breed_code
from xk_blood_breed
where blood_kind ='0004' ) and
t1.bill_no =t2.bill_no;
</select>
<select id="checkSelfBlood" resultType="java.util.Map">
SELECT xk_blood_breed.breed_name,
sum(xk_blood_info.capacity) as capacity,
xk_blood_info.unit
FROM xk_blood_breed,
xk_blood_info,
xk_gather_detail,
xk_gather_main,
xk_transfuse_apply
WHERE ( xk_gather_detail.bill_no = xk_gather_main.bill_no ) and
( xk_blood_info.blood_no = xk_gather_detail.blood_no ) and
( xk_blood_info.blood_breed = xk_blood_breed.breed_code ) and
( xk_gather_main.apply_no = xk_transfuse_apply.bill_no ) and
( ( xk_blood_info.blood_sort = 'Z' ) AND
( xk_blood_info.blood_status = '1' ) AND
( xk_transfuse_apply.beinhos_id = #{beinhos_id} ) )
group by xk_blood_breed.breed_name,xk_blood_info.unit
</select>
<select id="queryApplyTransTotalNum" resultType="java.math.BigDecimal">
SELECT sum ( t.blood_num / b.capacity *b.applynum ) rl_qc
FROM xk_transfuse_apply a , xk_blood_apply_trans b , xk_transfuse_apply_bloodbreed t , xk_blood_breed k
WHERE a.beinhos_id = #{beinhos_id} AND
a.Bill_No =t.Bill_No AND
k.blood_kind =b.blood_breed AND
t.blood_breed =k.breed_code AND
<![CDATA[a.bill_stasus <> 'Z' and]]>
a.apply_date Between #{stime} AND #{etime}
<if test="billNo != null and billNo != ''"><![CDATA[and a.bill_no <> #{billNo}]]></if>
<if test="bloodKindList != null and bloodKindList.size() > 0">
and k.blood_kind in
<foreach collection="bloodKindList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</select>
</mapper>

View File

@ -1,44 +0,0 @@
package com.czblood.common.config.mybatis;
import com.czblood.common.utils.HosIdHolder;
import org.apache.ibatis.builder.StaticSqlSource;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.SqlSource;
/**
* 包装 MyBatis 的 SqlSource,在每次 getBoundSql 时自动把 hos_id 注入 additionalParameters。
*
* 原理:MyBatis 的 createCacheKey 和 ParameterHandler.setParameters 在读取参数时,
* 都会先检查 boundSql.hasAdditionalParameter(propertyName)。只要 hos_id 在 additionalParameters 中,
* 就不会去原始参数对象(如 ParamMap)中查找,从而绕过 ParamMap 的严格 key 检查。
*/
public class HosIdInjectingSqlSource implements SqlSource {
private static final String PARAM_NAME = "hos_id";
private final SqlSource delegate;
public HosIdInjectingSqlSource(SqlSource delegate) {
this.delegate = delegate;
}
@Override
public BoundSql getBoundSql(Object parameterObject) {
// 1. 先让 MyBatis 正常生成 BoundSql
BoundSql boundSql = delegate.getBoundSql(parameterObject);
// 2. 自动注入 hos_id 到 additionalParameters
String hosId = HosIdHolder.getHosId();
if (hosId != null && !hosId.isEmpty() && !boundSql.hasAdditionalParameter(PARAM_NAME)) {
boundSql.setAdditionalParameter(PARAM_NAME, hosId);
}
return boundSql;
}
/**
* 获取被包装的原始 SqlSource(用于调试/去重)。
*/
public SqlSource getDelegate() {
return delegate;
}
}

View File

@ -1,114 +0,0 @@
package com.czblood.common.config.mybatis;
import com.czblood.common.utils.HosIdHolder;
import org.apache.ibatis.cache.CacheKey;
import org.apache.ibatis.executor.Executor;
import org.apache.ibatis.executor.parameter.ParameterHandler;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.mapping.SqlSource;
import org.apache.ibatis.plugin.*;
import org.apache.ibatis.reflection.MetaObject;
import org.apache.ibatis.reflection.SystemMetaObject;
import org.apache.ibatis.session.ResultHandler;
import org.apache.ibatis.session.RowBounds;
import java.sql.PreparedStatement;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
/**
* 自动注入 hos_id 参数的 MyBatis 拦截器。
* 在 Mapper XML 中直接写 #{hos_id} 即可,无需在方法参数中传入。
*
* 获取 hos_id 的逻辑在 HosIdHolder.getHosId() 中维护。
*/
@Intercepts({
@Signature(type = Executor.class, method = "update",
args = {MappedStatement.class, Object.class}),
@Signature(type = Executor.class, method = "query",
args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class}),
@Signature(type = Executor.class, method = "query",
args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class,
CacheKey.class, BoundSql.class})
})
public class HosIdInterceptor implements Interceptor {
private static final String PARAM_NAME = "hos_id";
@Override
public Object intercept(Invocation invocation) throws Throwable {
Object[] args = invocation.getArgs();
MappedStatement ms = (MappedStatement) args[0];
Object parameter = args[1];
String hosId = HosIdHolder.getHosId();
if (hosId == null) {
// 取不到 hos_id,跳过注入
return invocation.proceed();
}
Object newParameter = injectIntoParameter(parameter, hosId);
args[1] = newParameter;
// 对于 6 参数的 query 重载(BoundSql 已存在),需要额外处理 additionalParameter
if (args.length == 6 && args[5] instanceof BoundSql) {
BoundSql boundSql = (BoundSql) args[5];
// 向 BoundSql 中添加 hos_id,作为参数解析的后备
boundSql.setAdditionalParameter(PARAM_NAME, hosId);
}
return invocation.proceed();
}
/**
* 把 hos_id 注入到参数对象中。
*
* 核心策略:无论参数是什么类型,都构建一个新的 HashMap 包装,
* 这样可以彻底避开 MyBatis ParamMap 的严格检查。
*/
@SuppressWarnings("unchecked")
private Object injectIntoParameter(Object parameter, String hosId) {
Map<String, Object> newMap = new HashMap<>();
if (parameter == null) {
// 无参数 -> 只放 hos_id
newMap.put(PARAM_NAME, hosId);
return newMap;
}
if (parameter instanceof Map) {
// 参数是 Map(包括 MyBatis 的 ParamMap)-> 复制全部条目 + hos_id
Map<String, Object> originalMap = (Map<String, Object>) parameter;
newMap.putAll(originalMap);
// 用户手动传的值优先(已存在则不覆盖)
newMap.putIfAbsent(PARAM_NAME, hosId);
return newMap;
}
// 参数是 POJO -> 通过 MetaObject 读取所有可读字段 + hos_id
MetaObject metaObject = SystemMetaObject.forObject(parameter);
for (String name : metaObject.getGetterNames()) {
if ("class".equals(name)) continue;
try {
newMap.put(name, metaObject.getValue(name));
} catch (Exception ignored) {
// 某些 getter 可能不可读,跳过即可
}
}
newMap.putIfAbsent(PARAM_NAME, hosId);
// 同时把原 POJO 也放进去,作为 fallback
newMap.put("_pojo", parameter);
return newMap;
}
@Override
public Object plugin(Object target) {
return Plugin.wrap(target, this);
}
@Override
public void setProperties(Properties properties) {
}
}

View File

@ -25,8 +25,17 @@ public class Result {
@ApiModelProperty(value = "响应消息", example = "操作成功", notes = "接口返回的提示信息")
private String msg;
private Object data;
@ApiModelProperty(value = "下一步请求URL", notes = "后续需要请求的接口地址")
private String url;
@ApiModelProperty(value = "下一步请求方法", example = "GET", notes = "GET/POST/PUT/DELETE等")
private String method;
@ApiModelProperty(value = "下一步请求参数", notes = "后续请求需要携带的参数")
private Object params;
@ApiModelProperty(value = "问题ID", example = "1001", notes = "关键业务标识ID")
private Integer problemId;
public Result(String resultCode, String message) {
super();
this.code = resultCode;
@ -38,6 +47,23 @@ public class Result {
this.msg = message;
this.data = data;
}
public Result(String resultCode, String message,Integer problemId) {
this.code = resultCode;
this.msg = message;
Integer problemId0=problemId;
HttpServletRequest request = ServletUtils.getRequest();
this.url = request.getContextPath() + request.getServletPath();
this.method = request.getMethod();
if("GET".equals(this.method)){
this.params = ServletUtils.getParamMap(request);
}else {
try {
this.data = JsonParamUtils.getJsonParams(request);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
this.problemId=problemId0;
}
}

View File

@ -72,6 +72,10 @@ public class ResultT<T> extends Result {
ResultT<T> resultT = new ResultT<>();
resultT.setCode(oldResult.getCode());
resultT.setMsg(oldResult.getMsg());
resultT.setUrl(oldResult.getUrl());
resultT.setMethod(oldResult.getMethod());
resultT.setParams(oldResult.getParams());
resultT.setProblemId(oldResult.getProblemId());
// 调用父类setData(Object),无冲突
Object oldData = oldResult.getData();

View File

@ -53,31 +53,9 @@ public class SysDept extends BaseEntity
/** 父部门名称 */
private String parentName;
@NotNull(message = "部门编码不能为空")
private String deptCode;
private String deptCodeOld;
private String hos_id;
/** 子部门 */
private List<SysDept> children = new ArrayList<SysDept>();
public String getDeptCodeOld() {
return deptCodeOld;
}
public void setDeptCodeOld(String deptCodeOld) {
this.deptCodeOld = deptCodeOld;
}
public String getHos_id() {
return hos_id;
}
public void setHos_id(String hos_id) {
this.hos_id = hos_id;
}
public Long getDeptId()
{
return deptId;
@ -204,14 +182,6 @@ public class SysDept extends BaseEntity
this.children = children;
}
public String getDeptCode() {
return deptCode;
}
public void setDeptCode(String deptCode) {
this.deptCode = deptCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -229,9 +199,6 @@ public class SysDept extends BaseEntity
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("deptCode", getDeptCode())
.append("hos_id", getHos_id())
.append("deptCodeOld", getDeptCodeOld())
.toString();
}
}

Some files were not shown because too many files have changed in this diff Show More