输血申请单审核业务,取消审核

This commit is contained in:
jiangs 2026-07-10 09:22:04 +08:00
parent 49cd553f51
commit d94a86ed9b
11 changed files with 168 additions and 26 deletions

View File

@ -32,4 +32,8 @@ public class BloodInterfaceTypeConstants {
* 申请单审核
*/
public static final String APPLY_CHECK = "APPLY_CHECK";
/**
* 取消申请单审核
*/
public static final String CANCEL_APPLY_CHECK = "CANCEL_APPLY_CHECK";
}

View File

@ -134,9 +134,10 @@ public class BloodCommonController extends BaseController {
@ApiOperation("获取员工的部门类型")
@GetMapping("/getDeptType")
public String getDeptType(String userId){
public Result getDeptType(String userId){
SysUser userInfo = bloodBankUtil.getUserInfo(userId);
return BloodBankUtil.isBank(userInfo.getDept().getDeptType());
String deptType = userInfo.getDept().getDeptType();
return new Result("0","获取数据成功!",BloodBankUtil.isBank(deptType));
}
// @ApiOperation("测试接口")

View File

@ -0,0 +1,44 @@
package com.czblood.bus.pojo;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("血液出库主表")
public class XkOutMain {
private String bill_no;
private String hos_id;
private Date occur_date;
private BigDecimal total_money;
private String take_person;
private String handle_person;
private String apply_no;
private String match_no;
private String patient_name;
private String beinhos_id;
private String dept_id;
private String check_no;
private String bill_sort;
private Date notify_time;
private String is_free_account;
private String input_person;
private Date input_date;
private String check_sign;
private String check_person;
private Date check_date;
private String audit_person;
private String remark;
private String exp1;
private String exp2;
private Date last_modified;
private String all_recycle_sign;
private String receive_person;
private String receive_id;
}

View File

@ -0,0 +1,19 @@
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 CancelApplyCheckRequest implements BloodInterfaceType{
private final String method = BloodInterfaceTypeConstants.CANCEL_APPLY_CHECK;
private String billNo;
@Override
public String serializationJson() {
return JSONUtil.toJsonStr(this);
}
}

View File

@ -134,9 +134,9 @@ public class TransfuseApplyController extends BaseController {
}
@ApiOperation("取消申请单审核")
@PostMapping("/cancelApplyCheck")
public Result cancelApplyCheck(){
return null;
@GetMapping("/cancelApplyCheck")
public Result cancelApplyCheck(String billNo){
return transfuseApplyService.cancelApplyCheck(billNo);
}

View File

@ -2,6 +2,7 @@ package com.czblood.busDoctor.mapper;
import com.czblood.bus.pojo.XkCheckBloodtype;
import com.czblood.bus.pojo.XkOutMain;
import com.czblood.busDoctor.pojo.DTO.TransfuseApplyInfoOne;
import com.czblood.busDoctor.pojo.VO.TransfuseApplyVO;
import org.apache.ibatis.annotations.Param;
@ -21,4 +22,5 @@ public interface TransfuseApplyMapper {
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);
long queryBillStatusCount(String beinhos_id);
XkCheckBloodtype queryCheckDate(String beinhos_id);
int queryXkOutMainCount(String applyNo);
}

View File

@ -15,9 +15,4 @@ public class ApplyCheckVO {
@NotBlank(message = "单据号不能为空!")
private String billNo;
private String userId;
@NotBlank(message = "上级医生不能为空!")
private String checkMedic;
@NotBlank(message = "审核时间不能为空!")
private Date checkDate;
private TransfuseApplyInfoOne transfuseApplyInfoOne;
}

View File

@ -30,4 +30,6 @@ public interface TransfuseApplyService {
Result applyPreCheck(ApplyCheckVO applyCheckVO);
Result cancelApplyMedicCheck(CheckMedicVO checkMedicVO);
Result cancelApplyCheck(String billNo);
}

View File

@ -3,6 +3,7 @@ package com.czblood.busDoctor.service.impl;
import cn.hutool.core.date.DateUtil;
import com.czblood.bus.mapper.*;
import com.czblood.bus.pojo.*;
import com.czblood.bus.pojo.inter.CancelApplyCheckRequest;
import com.czblood.bus.pojo.inter.GetTestResultBloodTypeRequest;
import com.czblood.bus.pojo.xtwh.XkDmzd;
import com.czblood.bus.utils.BloodBankUtil;
@ -138,16 +139,23 @@ public class TransfuseApplyServiceImpl implements TransfuseApplyService {
@Override
public Result queryList(TransfuseApplyVO transfuseApplyVO) {
Integer day = transfuseApplyVO.getDay();
if (day == null || day == 0) return new Result("-1", "查询天数不能为空!");
if (day == null || day == 0) day = 7;
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);
// TransfuseApplyVO transfuseApplyVO = new TransfuseApplyVO();
// transfuseApplyVO.setBill_no(billNo);
// TransfuseApplyInfoOne transfuseApplyInfoOne = transfuseApplyMapper.queryApplyOne(transfuseApplyVO);
TransfuseApplyInfoOne transfuseApplyInfoOne = new TransfuseApplyInfoOne();
XkTransfuseApply xkTransfuseApply = xkTransfuseApplyMapper.queryOne(billNo);
if(xkTransfuseApply == null) return new Result("-1", "没有查询到输血申请单!");
String beinhosId = xkTransfuseApply.getBeinhos_id();
XkPatientInfo xkPatientInfo = xkPatientInfoMapper.queryOne(beinhosId);
transfuseApplyInfoOne.setXkPatientInfo(xkPatientInfo);
transfuseApplyInfoOne.setXkTransfuseApply(xkTransfuseApply);
TransfuseApplyDTO transfuseApplyDTO = new TransfuseApplyDTO();
transfuseApplyDTO.setTransfuseApplyInfoOne(transfuseApplyInfoOne);
List<XkTransfuseApplyTestitem> xkTransfuseApplyTestitemList = xkTransfuseApplyTestitemMapper.queryList(billNo);
@ -419,16 +427,6 @@ public class TransfuseApplyServiceImpl implements TransfuseApplyService {
return new Result("-1","该单据已发血,不允许重复审核!");
}
// SysUser userInfo = bloodBankUtil.getUserInfo(userId);
// String deptType = userInfo.getDept().getDeptType();
// if(deptType.equals("001")){
// //临床科室,代表上级医生审核
// CheckMedicVO checkMedicVO = new CheckMedicVO();
// checkMedicVO.setBillNo(billNo);
// checkMedicVO.setCheckMedic(applyCheckVO.getCheckMedic());
// checkMedicVO.setCheckDate(applyCheckVO.getCheckDate());
// return applyMedicCheck(checkMedicVO);
// }
/**
* 下面是输血科审核的逻辑
*/
@ -515,10 +513,36 @@ public class TransfuseApplyServiceImpl implements TransfuseApplyService {
}
}
/**
* 取消上级医生审核
* @param checkMedicVO
* @return
*/
@Override
public Result cancelApplyMedicCheck(CheckMedicVO checkMedicVO) {
String billNo = checkMedicVO.getBillNo();
if(StringUtils.isEmpty(billNo)) return new Result("-1","申请单号不能为空!");
XkTransfuseApply xkTransfuseApply1 = xkTransfuseApplyMapper.queryOne(billNo);
if(xkTransfuseApply1 == null) return new Result("-1","没有查到该申请单的信息!");
String billStasus = xkTransfuseApply1.getBill_stasus();
String checkMedic = xkTransfuseApply1.getCheck_medic();
switch (billStasus){
case "B":
return new Result("-1","该申请单输血科已经审核通过,不能取消审核!");
case "C":
return new Result("-1","该申请单已经配血,不能取消审核!");
case "F":
return new Result("-1","该申请单已经复核血型,不能取消审核!");
case "D":
return new Result("-1","该申请单已经发血,不能取消审核!");
case "SF":
return new Result("-1","该申请单已经发血且已追加复核血型,不能取消审核!");
case "S":
return new Result("-1","该申请单已经发血且已追加配血,不能取消审核!");
case "Z":
return new Result("-1","该申请单已经作废,不能取消审核!");
}
if(checkMedic == null || checkMedic.isEmpty()) return new Result("-1","该申请单还未审核,不能取消审核!");
XkTransfuseApply xkTransfuseApply = new XkTransfuseApply();
xkTransfuseApply.setCheck_medic("");
xkTransfuseApply.setMedic_check_date(DateUtil.parse("1900-01-01 00:00:00","yyyy-MM-dd HH:mm:ss"));
@ -527,6 +551,50 @@ public class TransfuseApplyServiceImpl implements TransfuseApplyService {
return new Result("0","取消上级医生审核成功!");
}
/**
* 取消审核
* @param billNo
* @return
*/
@Override
public Result cancelApplyCheck(String billNo) {
XkTransfuseApply xkTransfuseApply = xkTransfuseApplyMapper.queryOne(billNo);
if(xkTransfuseApply == null) return new Result("-1","没有查到该申请单的信息!");
String billStasus = xkTransfuseApply.getBill_stasus();
switch (billStasus){
case "C":
return new Result("-1","该申请单已经配血,不能取消审核!");
case "F":
return new Result("-1","该申请单已经复核血型,不能取消审核!");
case "D":
return new Result("-1","该申请单已经发血,不能取消审核!");
case "SF":
return new Result("-1","该申请单已经发血且已追加复核血型,不能取消审核!");
case "S":
return new Result("-1","该申请单已经发血且已追加配血,不能取消审核!");
case "Z":
return new Result("-1","该申请单已经作废,不能取消审核!");
}
if(billStasus.equals("B")) return new Result("-1","该申请单还未审核,不能取消审核!");
int i = transfuseApplyMapper.queryXkOutMainCount(billNo);
if(i > 0) return new Result("-1","该申请单已经发血,不能取消审核!");
//修改申请单主表数据
XkTransfuseApply xkTransfuseApplyTemp = new XkTransfuseApply();
xkTransfuseApplyTemp.setBill_stasus("A");
xkTransfuseApplyTemp.setCheck_sign("N");
xkTransfuseApplyTemp.setBill_sort("N");
xkTransfuseApplyTemp.setNotify_sign("N");
xkTransfuseApplyTemp.setBill_no(billNo);
xkTransfuseApplyMapper.update(xkTransfuseApplyTemp);
//调用外部接口
CancelApplyCheckRequest cancelApplyCheckRequest = new CancelApplyCheckRequest();
cancelApplyCheckRequest.setBillNo(billNo);
BloodInterfaceUtil.invokeBloodInterface(cancelApplyCheckRequest);
return new Result("0","取消审核成功!");
}
/**
* 校验医生职称是否符合要求

View File

@ -17,7 +17,8 @@
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}
and xk_transfuse_apply.hos_id = #{hos_id}
<if test="day != null and day > 0">and xk_transfuse_apply.apply_date > getdate() - #{day}</if>
<if test="bill_status != null and bill_status != ''">and xk_transfuse_apply.bill_stasus = #{bill_status}</if>
<if test="bill_no != null and bill_no != ''">and xk_transfuse_apply.bill_no = #{bill_no}</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>
@ -188,4 +189,7 @@
SELECT * FROM xk_check_bloodtype
<![CDATA[ Where Beinhos_id = #{beinhos_id} and isnull(remark,'')<>'系统生成' Order By test_date Desc;]]>
</select>
<select id="queryXkOutMainCount" resultType="java.lang.Integer">
select count(*) from xk_out_main where apply_no = #{applyNo}
</select>
</mapper>

View File

@ -41,6 +41,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="orderNum" column="order_num" />
<result property="leader" column="leader" />
<result property="status" column="dept_status" />
<result property="deptType" column="dept_type" />
<result property="hos_id" column="hos_id" />
<result property="deptCode" column="dept_code" />
</resultMap>
<resultMap id="RoleResult" type="SysRole">
@ -55,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectUserVo">
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
u.hos_id, u.postname, u.workgroup, u.operator_type, u.is_bank_director, u.is_medical_director,
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,d.dept_type,d.hos_id,d.dept_code,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
from sys_user u
left join sys_dept d on u.dept_id = d.dept_id