药品追溯流程接口开发,相关字段调整
This commit is contained in:
parent
1e532ce353
commit
a5afa9955d
|
@ -0,0 +1,37 @@
|
|||
package com.alihealth.d2d.provtest.VO;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 药品收货单信息,多条
|
||||
*/
|
||||
@Data
|
||||
public class DrugDeliveryNoteInfoVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -6817830718249051422L;
|
||||
|
||||
/**
|
||||
* 收货时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date shsj;
|
||||
|
||||
/**
|
||||
* 收货公司社会信用代码
|
||||
*/
|
||||
private String tyshxydmshjg;
|
||||
|
||||
/**
|
||||
* 收货公司名称
|
||||
*/
|
||||
private String shjgmc;
|
||||
|
||||
/**
|
||||
* 收货单号
|
||||
*/
|
||||
private String shdbh;
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.alihealth.d2d.provtest.VO;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 描述: 药品发货单信息
|
||||
*/
|
||||
@Data
|
||||
public class DrugInvoiceInfoVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 6502538268319598412L;
|
||||
|
||||
/** 发货时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date fhsj;
|
||||
|
||||
/** 发货公司社会信用代码 */
|
||||
private String tyshxydmfhjg;
|
||||
|
||||
/** 发货公司名称 */
|
||||
private String fhjgmc;
|
||||
|
||||
/** 发货单号 */
|
||||
private String fhdbh;
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
package com.alihealth.d2d.provtest.VO;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 描述: 药品生产信息 : 包含境内与境外的药品生产信息两个表,查询时注意字段转换
|
||||
*/
|
||||
@Data
|
||||
public class DrugProductionInfoVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 2214859259608999147L;
|
||||
|
||||
/**
|
||||
* 药品生产日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date scrq;
|
||||
|
||||
/**
|
||||
* 药品有效期截止日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date ypyxqjzrq;
|
||||
|
||||
/**
|
||||
* 药品生产批号
|
||||
*/
|
||||
private String ypscph;
|
||||
|
||||
/**
|
||||
* 药品生产企业信用代码
|
||||
*/
|
||||
private String tyshxydm;
|
||||
|
||||
/**
|
||||
* 药品生产企业名称
|
||||
*/
|
||||
private String scqymc;
|
||||
|
||||
/**
|
||||
* 药品通用名称
|
||||
*/
|
||||
private String yptymc;
|
||||
|
||||
/**
|
||||
* 药品商用名称(中文)
|
||||
*/
|
||||
private String ypspmc;
|
||||
|
||||
/**
|
||||
* 国家药品标识码
|
||||
*/
|
||||
private String gjypbsm;
|
||||
|
||||
|
||||
/**
|
||||
* 药品本位码
|
||||
*/
|
||||
private String ypbwm;
|
||||
|
||||
/**
|
||||
* 剂型
|
||||
*/
|
||||
private String jx;
|
||||
|
||||
/**
|
||||
* 制剂规格
|
||||
*/
|
||||
private String zjgg;
|
||||
|
||||
/**
|
||||
* 包装规格
|
||||
*/
|
||||
private String bzgg;
|
||||
|
||||
/**
|
||||
* 包装转换比
|
||||
*/
|
||||
private Integer bzzhb;
|
||||
|
||||
/**
|
||||
* 药品有效期
|
||||
*/
|
||||
private Integer ypyxq;
|
||||
|
||||
/**
|
||||
* 药品有效期单位
|
||||
*/
|
||||
private String ypyxqdw;
|
||||
|
||||
/**
|
||||
* 药品批准文号
|
||||
*/
|
||||
private String yppzwh;
|
||||
|
||||
/**
|
||||
* 药品批准文号有效期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date yppzwhyxq;
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package com.alihealth.d2d.provtest.VO;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 描述:药品与零售信息,暂时展示下列信息,后续有必要再展示更多信息
|
||||
*/
|
||||
@Data
|
||||
public class DrugRetailAndUseInfoVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 8169288349155391871L;
|
||||
|
||||
/** 售药时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date scsj;
|
||||
|
||||
/** 购买人身份信息 */
|
||||
private String gmrsfxx;
|
||||
|
||||
/** 购买人电话号码 */
|
||||
private String gmrdhhm;
|
||||
|
||||
/** 互联网订单标识 */
|
||||
private String hlwddbz;
|
||||
|
||||
/** 零售药店名称 */
|
||||
private String lsydmc;
|
||||
|
||||
/** 零售药店编号 */
|
||||
private String lsdjbh;
|
||||
|
||||
/** 统一社会信用代码(零售药店) */
|
||||
private String tyshxydmlsyd;
|
||||
|
||||
/** 开方医师(非处方药没有该字段) */
|
||||
private String kfys;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package com.alihealth.d2d.provtest.VO;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class DrugRetraceVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 5380130274842679836L;
|
||||
|
||||
/**
|
||||
* 药品生产信息
|
||||
*/
|
||||
private DrugProductionInfoVO drugProductionInfoVO;
|
||||
|
||||
/**
|
||||
* 药品发货信息, 发货信息可能会有多条
|
||||
*/
|
||||
private List<DrugInvoiceInfoVO> drugInvoiceInfoVOList;
|
||||
|
||||
/**
|
||||
* 药品收货信息, 收货信息可能会有多条
|
||||
*/
|
||||
private List<DrugDeliveryNoteInfoVO> drugDeliveryNoteInfoVOList;
|
||||
|
||||
/**
|
||||
* 药品零售与药品使用信息
|
||||
*/
|
||||
private DrugRetailAndUseInfoVO drugRetailAndUseInfoVO;
|
||||
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package com.alihealth.d2d.provtest.controller;
|
||||
|
||||
import com.alihealth.d2d.provtest.VO.DrugRetraceVO;
|
||||
import com.alihealth.d2d.provtest.common.AjaxResult;
|
||||
import com.alihealth.d2d.provtest.searcher.DrugRetraceSearcher;
|
||||
import com.alihealth.d2d.provtest.service.DrugRetraceService;
|
||||
|
@ -20,8 +21,8 @@ public class DrugRetraceController {
|
|||
private DrugRetraceService drugRetraceService;
|
||||
|
||||
@PostMapping(value = "/retrace")
|
||||
public AjaxResult retrace(@RequestBody(required = true) DrugRetraceSearcher searcher) {
|
||||
drugRetraceService.retrace(searcher);
|
||||
return AjaxResult.success(null);
|
||||
public AjaxResult retrace(@RequestBody DrugRetraceSearcher searcher) {
|
||||
DrugRetraceVO drugRetraceVO = drugRetraceService.retrace(searcher);
|
||||
return AjaxResult.success(drugRetraceVO);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
package com.alihealth.d2d.provtest.domain;
|
||||
|
||||
import com.alihealth.d2d.provtest.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
|
@ -68,8 +66,8 @@ public class DomesticDrugProductionApplyInfo {
|
|||
@Column(name = "scrq")
|
||||
private Date scrq;
|
||||
|
||||
@Column(name = "ymyxqjzrq")
|
||||
private Date ymyxqjzrq;
|
||||
@Column(name = "ypyxqjzrq")
|
||||
private Date ypyxqjzrq;
|
||||
|
||||
@Column(name = "scsl")
|
||||
private Integer scsl;
|
||||
|
@ -91,4 +89,37 @@ public class DomesticDrugProductionApplyInfo {
|
|||
|
||||
@Column(name = "rkdwlx")
|
||||
private String rkdwlx;
|
||||
|
||||
@Column(name = "ypspmc")
|
||||
private String ypspmc;
|
||||
|
||||
@Column(name = "ypbwm")
|
||||
private String ypbwm;
|
||||
|
||||
@Column(name = "jx")
|
||||
private String jx;
|
||||
|
||||
@Column(name = "zjgg")
|
||||
private String zjgg;
|
||||
|
||||
@Column(name = "bzgg")
|
||||
private String bzgg;
|
||||
|
||||
@Column(name = "bzzhb")
|
||||
private Integer bzzhb;
|
||||
|
||||
@Column(name = "ypyxq")
|
||||
private Integer ypyxq;
|
||||
|
||||
@Column(name = "ypyxqdw")
|
||||
private String ypyxqdw;
|
||||
|
||||
@Column(name = "yppzwh")
|
||||
private String yppzwh;
|
||||
|
||||
@Column(name = "yppzwhyxq")
|
||||
private Date yppzwhyxq;
|
||||
|
||||
@Column(name = "ypscph")
|
||||
private String ypscph;
|
||||
}
|
||||
|
|
|
@ -41,12 +41,12 @@ public class DrugImportApplyInfo {
|
|||
//暂无
|
||||
@Column(name = "ymzt")
|
||||
private String ymzt;
|
||||
//统一社会信用代码(进口疫苗代理企业)
|
||||
@Column(name = "tyshxydmjkymdlqy")
|
||||
private String tyshxydmjkymdlqy;
|
||||
//进口疫苗代理企业名称
|
||||
@Column(name = "jkymdlqymc")
|
||||
private String jkymdlqymc;
|
||||
//统一社会信用代码(进口药品代理企业)
|
||||
@Column(name = "tyshxydmjkypdlqy")
|
||||
private String tyshxydmjkypdlqy;
|
||||
//进口药品代理企业名称
|
||||
@Column(name = "jkypdlqymc")
|
||||
private String jkypdlqymc;
|
||||
//境外药品上市许可持有人代码
|
||||
@Column(name = "jwypssxkcyrdm")
|
||||
private String jwypssxkcyrdm;
|
||||
|
@ -78,8 +78,8 @@ public class DrugImportApplyInfo {
|
|||
@Column(name = "scrq")
|
||||
private Date scrq;
|
||||
//药品有效期截止日期
|
||||
@Column(name = "ymyxqjzrq")
|
||||
private Date ymyxqjzrq;
|
||||
@Column(name = "ypyxqjzrq")
|
||||
private Date ypyxqjzrq;
|
||||
//生产数量
|
||||
@Column(name = "scsl")
|
||||
private Integer scsl;
|
||||
|
@ -89,6 +89,40 @@ public class DrugImportApplyInfo {
|
|||
//入库时间
|
||||
@Column(name = "rksj")
|
||||
private Date rksj;
|
||||
|
||||
@Column(name = "ypspmc")
|
||||
private String ypspmc;
|
||||
|
||||
@Column(name = "ypbwm")
|
||||
private String ypbwm;
|
||||
|
||||
@Column(name = "jx")
|
||||
private String jx;
|
||||
|
||||
@Column(name = "zjgg")
|
||||
private String zjgg;
|
||||
|
||||
@Column(name = "bzgg")
|
||||
private String bzgg;
|
||||
|
||||
@Column(name = "bzzhb")
|
||||
private Integer bzzhb;
|
||||
|
||||
@Column(name = "ypyxq")
|
||||
private Integer ypyxq;
|
||||
|
||||
@Column(name = "ypyxqdw")
|
||||
private String ypyxqdw;
|
||||
|
||||
@Column(name = "yppzwh")
|
||||
private String yppzwh;
|
||||
|
||||
@Column(name = "yppzwhyxq")
|
||||
private Date yppzwhyxq;
|
||||
|
||||
@Column(name = "ypscph")
|
||||
private String ypscph;
|
||||
|
||||
//创建时间
|
||||
@Column(name = "create_time")
|
||||
private Date createTime;
|
||||
|
|
|
@ -0,0 +1,127 @@
|
|||
package com.alihealth.d2d.provtest.exception;
|
||||
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.alihealth.d2d.provtest.common.AjaxResult;
|
||||
import com.alihealth.d2d.provtest.constant.HttpStatus;
|
||||
import com.alihealth.d2d.provtest.utils.EscapeUtil;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.validation.BindException;
|
||||
import org.springframework.web.HttpRequestMethodNotSupportedException;
|
||||
import org.springframework.web.bind.MethodArgumentNotValidException;
|
||||
import org.springframework.web.bind.MissingPathVariableException;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.nio.file.AccessDeniedException;
|
||||
|
||||
/**
|
||||
* 全局异常处理器
|
||||
*
|
||||
* @author tcctyn
|
||||
*/
|
||||
@RestControllerAdvice
|
||||
public class GlobalExceptionHandler {
|
||||
private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class);
|
||||
|
||||
/**
|
||||
* 权限校验异常
|
||||
*/
|
||||
@ExceptionHandler(AccessDeniedException.class)
|
||||
public AjaxResult handleAccessDeniedException(AccessDeniedException e, HttpServletRequest request) {
|
||||
String requestURI = request.getRequestURI();
|
||||
log.error("请求地址'{}',权限校验失败'{}'", requestURI, e.getMessage());
|
||||
return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求方式不支持
|
||||
*/
|
||||
@ExceptionHandler(HttpRequestMethodNotSupportedException.class)
|
||||
public AjaxResult handleHttpRequestMethodNotSupported(HttpRequestMethodNotSupportedException e,
|
||||
HttpServletRequest request) {
|
||||
String requestURI = request.getRequestURI();
|
||||
log.error("请求地址'{}',不支持'{}'请求", requestURI, e.getMethod());
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务异常
|
||||
*/
|
||||
@ExceptionHandler(ServiceException.class)
|
||||
public AjaxResult handleServiceException(ServiceException e, HttpServletRequest request) {
|
||||
log.error(e.getMessage(), e);
|
||||
Integer code = e.getCode();
|
||||
return StringUtils.isEmpty(code) ? AjaxResult.error(code, e.getMessage()) : AjaxResult.error(e.getMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求路径中缺少必需的路径变量
|
||||
*/
|
||||
@ExceptionHandler(MissingPathVariableException.class)
|
||||
public AjaxResult handleMissingPathVariableException(MissingPathVariableException e, HttpServletRequest request) {
|
||||
String requestURI = request.getRequestURI();
|
||||
log.error("请求路径中缺少必需的路径变量'{}',发生系统异常.", requestURI, e);
|
||||
return AjaxResult.error(String.format("请求路径中缺少必需的路径变量[%s]", e.getVariableName()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求参数类型不匹配
|
||||
*/
|
||||
@ExceptionHandler(MethodArgumentTypeMismatchException.class)
|
||||
public AjaxResult handleMethodArgumentTypeMismatchException(MethodArgumentTypeMismatchException e, HttpServletRequest request) {
|
||||
String requestURI = request.getRequestURI();
|
||||
String value = Convert.toStr(e.getValue());
|
||||
if (!StringUtils.isEmpty(value)) {
|
||||
value = EscapeUtil.clean(value);
|
||||
}
|
||||
log.error("请求参数类型不匹配'{}',发生系统异常.", requestURI, e);
|
||||
return AjaxResult.error(String.format("请求参数类型不匹配,参数[%s]要求类型为:'%s',但输入值为:'%s'", e.getName(), e.getRequiredType().getName(), value));
|
||||
}
|
||||
|
||||
/**
|
||||
* 拦截未知的运行时异常
|
||||
*/
|
||||
@ExceptionHandler(RuntimeException.class)
|
||||
public AjaxResult handleRuntimeException(RuntimeException e, HttpServletRequest request) {
|
||||
String requestURI = request.getRequestURI();
|
||||
log.error("请求地址'{}',发生未知异常.", requestURI, e);
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统异常
|
||||
*/
|
||||
@ExceptionHandler(Exception.class)
|
||||
public AjaxResult handleException(Exception e, HttpServletRequest request) {
|
||||
String requestURI = request.getRequestURI();
|
||||
log.error("请求地址'{}',发生系统异常.", requestURI, e);
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义验证异常
|
||||
*/
|
||||
@ExceptionHandler(BindException.class)
|
||||
public AjaxResult handleBindException(BindException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
String message = e.getAllErrors().get(0).getDefaultMessage();
|
||||
return AjaxResult.error(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义验证异常
|
||||
*/
|
||||
@ExceptionHandler(MethodArgumentNotValidException.class)
|
||||
public Object handleMethodArgumentNotValidException(MethodArgumentNotValidException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
String message = e.getBindingResult().getFieldError().getDefaultMessage();
|
||||
return AjaxResult.error(message);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
package com.alihealth.d2d.provtest.exception;
|
||||
|
||||
/**
|
||||
* 业务异常
|
||||
*
|
||||
* @author tcctyn
|
||||
*/
|
||||
public final class ServiceException extends RuntimeException
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 错误码
|
||||
*/
|
||||
private Integer code;
|
||||
|
||||
/**
|
||||
* 错误提示
|
||||
*/
|
||||
private String message;
|
||||
|
||||
/**
|
||||
* 错误明细,内部调试错误
|
||||
*
|
||||
*/
|
||||
private String detailMessage;
|
||||
|
||||
/**
|
||||
* 空构造方法,避免反序列化问题
|
||||
*/
|
||||
public ServiceException()
|
||||
{
|
||||
}
|
||||
|
||||
public ServiceException(String message)
|
||||
{
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public ServiceException(String message, Integer code)
|
||||
{
|
||||
this.message = message;
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getDetailMessage()
|
||||
{
|
||||
return detailMessage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
return message;
|
||||
}
|
||||
|
||||
public Integer getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public ServiceException setMessage(String message)
|
||||
{
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ServiceException setDetailMessage(String detailMessage)
|
||||
{
|
||||
this.detailMessage = detailMessage;
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -1,8 +1,16 @@
|
|||
package com.alihealth.d2d.provtest.mapper;
|
||||
|
||||
import com.alihealth.d2d.provtest.VO.DrugProductionInfoVO;
|
||||
import com.alihealth.d2d.provtest.domain.DomesticDrugProductionApplyInfo;
|
||||
import com.alihealth.d2d.provtest.domain.DomesticPharmaBaseInfo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface DomesticDrugProductionApplyInfoMapper extends BaseMapper<DomesticDrugProductionApplyInfo> {
|
||||
|
||||
/**
|
||||
* 根据药品追溯码查询药品信息
|
||||
* @param ypzsm
|
||||
* @return
|
||||
*/
|
||||
DrugProductionInfoVO selectByYpzsm(@Param("ypzsm") String ypzsm);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
package com.alihealth.d2d.provtest.mapper;
|
||||
|
||||
import com.alihealth.d2d.provtest.VO.DrugDeliveryNoteInfoVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.alihealth.d2d.provtest.domain.DrugDeliveryNoteApplyInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 收货单信息数据子集(DrugDeliveryNoteApplyInfo)表数据库访问层
|
||||
|
@ -11,5 +15,11 @@ import com.alihealth.d2d.provtest.domain.DrugDeliveryNoteApplyInfo;
|
|||
*/
|
||||
public interface DrugDeliveryNoteApplyInfoMapper extends BaseMapper<DrugDeliveryNoteApplyInfo> {
|
||||
|
||||
/**
|
||||
* 根据ypzsm查询收货单信息
|
||||
* @param ypzsm
|
||||
* @return
|
||||
*/
|
||||
List<DrugDeliveryNoteInfoVO> selectByYpzsm(@Param("ypzsm") String ypzsm);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package com.alihealth.d2d.provtest.mapper;
|
||||
|
||||
import com.alihealth.d2d.provtest.VO.DrugProductionInfoVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.alihealth.d2d.provtest.domain.DrugImportApplyInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 药品进口信息数据子集(DrugImportApplyInfo)表数据库访问层
|
||||
|
@ -11,5 +13,9 @@ import com.alihealth.d2d.provtest.domain.DrugImportApplyInfo;
|
|||
*/
|
||||
public interface DrugImportApplyInfoMapper extends BaseMapper<DrugImportApplyInfo> {
|
||||
|
||||
/*
|
||||
* 根据药品追溯码查询药品生产信息
|
||||
*/
|
||||
DrugProductionInfoVO selectByYpzsm(@Param("ypzsm") String ypzsm);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
package com.alihealth.d2d.provtest.mapper;
|
||||
|
||||
import com.alihealth.d2d.provtest.VO.DrugInvoiceInfoVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.alihealth.d2d.provtest.domain.DrugInvoiceApplyInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 发货单信息数据子集(DrugInvoiceApplyInfo)表数据库访问层
|
||||
|
@ -11,5 +15,11 @@ import com.alihealth.d2d.provtest.domain.DrugInvoiceApplyInfo;
|
|||
*/
|
||||
public interface DrugInvoiceApplyInfoMapper extends BaseMapper<DrugInvoiceApplyInfo> {
|
||||
|
||||
/**
|
||||
* 根据药品追溯码查询发货单信息
|
||||
* @param ypzsm
|
||||
* @return
|
||||
*/
|
||||
List<DrugInvoiceInfoVO> selectByYpzsm(@Param("ypzsm") String ypzsm);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package com.alihealth.d2d.provtest.mapper;
|
||||
|
||||
import com.alihealth.d2d.provtest.VO.DrugRetailAndUseInfoVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.alihealth.d2d.provtest.domain.DrugRetailAndUseApplyInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 药品零售与药品使用信息数据子集(DrugRetailAndUseApplyInfo)表数据库访问层
|
||||
|
@ -11,5 +13,11 @@ import com.alihealth.d2d.provtest.domain.DrugRetailAndUseApplyInfo;
|
|||
*/
|
||||
public interface DrugRetailAndUseApplyInfoMapper extends BaseMapper<DrugRetailAndUseApplyInfo> {
|
||||
|
||||
/**
|
||||
* 根据药品追溯码查询零售与使用信息
|
||||
* @param ypzsm
|
||||
* @return
|
||||
*/
|
||||
DrugRetailAndUseInfoVO selectByYpzsm(@Param("ypzsm") String ypzsm);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package com.alihealth.d2d.provtest.searcher;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 药品追溯查询请求参数
|
||||
*/
|
||||
@Data
|
||||
public class DrugRetraceSearcher implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 6736979196768225595L;
|
||||
|
||||
/**
|
||||
* 药品追溯码
|
||||
*/
|
||||
private String ypzsm;
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.alihealth.d2d.provtest.service;
|
||||
|
||||
import com.alihealth.d2d.provtest.VO.DrugRetraceVO;
|
||||
import com.alihealth.d2d.provtest.searcher.DrugRetraceSearcher;
|
||||
|
||||
public interface DrugRetraceService {
|
||||
|
||||
/**
|
||||
* 药品追溯流程,根据药品追溯码进行查询
|
||||
* @param searcher
|
||||
* @return
|
||||
*/
|
||||
DrugRetraceVO retrace(DrugRetraceSearcher searcher);
|
||||
}
|
|
@ -62,10 +62,23 @@ public class SubType2011Handler extends AbstractEventDataHandler<DomesticDrugPro
|
|||
.ymscph(item.getString("YMSCPH"))
|
||||
|
||||
.scrq(formatterDate.parse(item.getString("SCRQ")))
|
||||
.ymyxqjzrq(formatterDate.parse(item.getString("YMYXQJZRQ")))
|
||||
.ypyxqjzrq(formatterDate.parse(item.getString("YPYXQJZRQ")))
|
||||
|
||||
.scsl(Integer.parseInt(item.getString("SCSL")))
|
||||
.scdz(item.getString("SCDZ"))
|
||||
.ypspmc(item.getString("YPSPMC"))
|
||||
.ypbwm(item.getString("YPBWM"))
|
||||
.jx(item.getString("JX"))
|
||||
.zjgg(item.getString("ZJGG"))
|
||||
.bzgg(item.getString("BZGG"))
|
||||
.bzzhb(Integer.parseInt(item.getString("BZZHB")))
|
||||
.ypyxq(Integer.parseInt(item.getString("YPYXQ")))
|
||||
.ypyxqdw(item.getString("YPYXQDW"))
|
||||
.yppzwh(item.getString("YPPZWH"))
|
||||
.yppzwhyxq(formatterDate.parse(item.getString("YPPZWHYXQ")))
|
||||
.ypscph(item.getString("YPSCPH"))
|
||||
|
||||
|
||||
.ypzsm(instance.getString("YPZSM"))
|
||||
.syjbzypzsm(instance.getString("SYJBZYPZSM"))
|
||||
.bzcj(instance.getString("BZCJ"))
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
package com.alihealth.d2d.provtest.service.handle.business;
|
||||
|
||||
import com.alihealth.d2d.provtest.domain.DomesticDrugProductionApplyInfo;
|
||||
import com.alihealth.d2d.provtest.domain.DrugImportApplyInfo;
|
||||
import com.alihealth.d2d.provtest.entity.EventBasic;
|
||||
import com.alihealth.d2d.provtest.entity.EventBody;
|
||||
import com.alihealth.d2d.provtest.entity.InstanceDetail;
|
||||
import com.alihealth.d2d.provtest.entity.ItemDetail;
|
||||
import com.alihealth.d2d.provtest.service.IDomesticDrugProductionApplyInfoService;
|
||||
import com.alihealth.d2d.provtest.service.IDrugImportApplyInfoService;
|
||||
import com.alihealth.d2d.provtest.service.handle.AbstractEventDataHandler;
|
||||
import com.alihealth.d2d.provtest.service.handle.EventSubType;
|
||||
|
@ -16,9 +14,6 @@ import org.springframework.stereotype.Service;
|
|||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author Jason
|
||||
|
@ -61,8 +56,8 @@ public class SubType2012Handler extends AbstractEventDataHandler<DrugImportApply
|
|||
.bzcj(instance.getString("BZCJ"))
|
||||
.ymzt(instance.getString("YMZT"))
|
||||
|
||||
.tyshxydmjkymdlqy(item.getString("TYSHXYDMJKYMDLQY"))
|
||||
.jkymdlqymc(item.getString("JKYMDLQYMC"))
|
||||
.tyshxydmjkypdlqy(item.getString("TYSHXYDMJKYPDLQY"))
|
||||
.jkypdlqymc(item.getString("JKYPDLQYMC"))
|
||||
.jwypssxkcyrdm(item.getString("JWYPSSXKCYRDM"))
|
||||
.jwypssxkcyrmczw(item.getString("JWYPSSXKCYRMCZW"))
|
||||
.jwypscqydm(item.getString("JWYPSCQYDM"))
|
||||
|
@ -73,7 +68,18 @@ public class SubType2012Handler extends AbstractEventDataHandler<DrugImportApply
|
|||
.gjypbsm(item.getString("GJYPBSM"))
|
||||
.ymscph(item.getString("YMSCPH"))
|
||||
.scrq(formatterDate.parse(item.getString("SCRQ")))
|
||||
.ymyxqjzrq(formatterDate.parse(item.getString("YMYXQJZRQ")))
|
||||
.ypyxqjzrq(formatterDate.parse(item.getString("YPYXQJZRQ")))
|
||||
.ypspmc(item.getString("YPSPMC"))
|
||||
.ypbwm(item.getString("YPBWM"))
|
||||
.jx(item.getString("JX"))
|
||||
.zjgg(item.getString("ZJGG"))
|
||||
.bzgg(item.getString("BZGG"))
|
||||
.bzzhb(Integer.parseInt(item.getString("BZZHB")))
|
||||
.ypyxq(Integer.parseInt(item.getString("YPYXQ")))
|
||||
.ypyxqdw(item.getString("YPYXQDW"))
|
||||
.yppzwh(item.getString("YPPZWH"))
|
||||
.yppzwhyxq(formatterDate.parse(item.getString("YPPZWHYXQ")))
|
||||
.ypscph(item.getString("YPSCPH"))
|
||||
|
||||
.scsl(item.getInt("SCSL"))
|
||||
.build();
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
package com.alihealth.d2d.provtest.service.impl;
|
||||
|
||||
import com.alihealth.d2d.provtest.VO.*;
|
||||
import com.alihealth.d2d.provtest.exception.ServiceException;
|
||||
import com.alihealth.d2d.provtest.mapper.*;
|
||||
import com.alihealth.d2d.provtest.searcher.DrugRetraceSearcher;
|
||||
import com.alihealth.d2d.provtest.service.DrugRetraceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Service("drugRetraceService")
|
||||
public class DrugRetraceServiceImpl implements DrugRetraceService {
|
||||
|
||||
@Autowired
|
||||
private DomesticDrugProductionApplyInfoMapper domesticDrugProductionApplyInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private DrugImportApplyInfoMapper drugImportApplyInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private DrugInvoiceApplyInfoMapper drugInvoiceApplyInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private DrugDeliveryNoteApplyInfoMapper drugDeliveryNoteApplyInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private DrugRetailAndUseApplyInfoMapper drugRetailAndUseApplyInfoMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public DrugRetraceVO retrace(DrugRetraceSearcher searcher) {
|
||||
DrugRetraceVO drugRetraceVO = new DrugRetraceVO();
|
||||
//先查国内的,要是国内没有查询到,再查询国外的
|
||||
DrugProductionInfoVO drugProductionInfoVO = domesticDrugProductionApplyInfoMapper.selectByYpzsm(searcher.getYpzsm());
|
||||
if (Objects.isNull(drugProductionInfoVO)) {
|
||||
drugProductionInfoVO = drugImportApplyInfoMapper.selectByYpzsm(searcher.getYpzsm());
|
||||
}
|
||||
if (Objects.isNull(drugProductionInfoVO)) {
|
||||
throw new ServiceException("未查询到该药品!");
|
||||
}
|
||||
drugRetraceVO.setDrugProductionInfoVO(drugProductionInfoVO);
|
||||
// 查询发货单
|
||||
List<DrugInvoiceInfoVO> drugInvoiceInfoVOList = drugInvoiceApplyInfoMapper.selectByYpzsm(searcher.getYpzsm());
|
||||
drugRetraceVO.setDrugInvoiceInfoVOList(drugInvoiceInfoVOList);
|
||||
// 查询收货单
|
||||
List<DrugDeliveryNoteInfoVO> drugDeliveryNoteInfoVOList = drugDeliveryNoteApplyInfoMapper.selectByYpzsm(searcher.getYpzsm());
|
||||
drugRetraceVO.setDrugDeliveryNoteInfoVOList(drugDeliveryNoteInfoVOList);
|
||||
// 查询零售及使用信息
|
||||
DrugRetailAndUseInfoVO drugRetailAndUseInfoVO = drugRetailAndUseApplyInfoMapper.selectByYpzsm(searcher.getYpzsm());
|
||||
drugRetraceVO.setDrugRetailAndUseInfoVO(drugRetailAndUseInfoVO);
|
||||
|
||||
return drugRetraceVO;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,142 @@
|
|||
package com.alihealth.d2d.provtest.utils;
|
||||
|
||||
|
||||
import cn.hutool.http.HTMLFilter;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* 转义和反转义工具类
|
||||
*
|
||||
* @author tcctyn
|
||||
*/
|
||||
public class EscapeUtil {
|
||||
public static final String RE_HTML_MARK = "(<[^<]*?>)|(<[\\s]*?/[^<]*?>)|(<[^<]*?/[\\s]*?>)";
|
||||
|
||||
private static final char[][] TEXT = new char[64][];
|
||||
|
||||
static {
|
||||
for (int i = 0; i < 64; i++) {
|
||||
TEXT[i] = new char[]{(char) i};
|
||||
}
|
||||
|
||||
// special HTML characters
|
||||
TEXT['\''] = "'".toCharArray(); // 单引号
|
||||
TEXT['"'] = """.toCharArray(); // 双引号
|
||||
TEXT['&'] = "&".toCharArray(); // &符
|
||||
TEXT['<'] = "<".toCharArray(); // 小于号
|
||||
TEXT['>'] = ">".toCharArray(); // 大于号
|
||||
}
|
||||
|
||||
/**
|
||||
* 转义文本中的HTML字符为安全的字符
|
||||
*
|
||||
* @param text 被转义的文本
|
||||
* @return 转义后的文本
|
||||
*/
|
||||
public static String escape(String text) {
|
||||
return encode(text);
|
||||
}
|
||||
|
||||
/**
|
||||
* 还原被转义的HTML特殊字符
|
||||
*
|
||||
* @param content 包含转义符的HTML内容
|
||||
* @return 转换后的字符串
|
||||
*/
|
||||
public static String unescape(String content) {
|
||||
return decode(content);
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除所有HTML标签,但是不删除标签内的内容
|
||||
*
|
||||
* @param content 文本
|
||||
* @return 清除标签后的文本
|
||||
*/
|
||||
public static String clean(String content) {
|
||||
return new HTMLFilter().filter(content);
|
||||
}
|
||||
|
||||
/**
|
||||
* Escape编码
|
||||
*
|
||||
* @param text 被编码的文本
|
||||
* @return 编码后的字符
|
||||
*/
|
||||
private static String encode(String text) {
|
||||
if (StringUtils.isEmpty(text)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
final StringBuilder tmp = new StringBuilder(text.length() * 6);
|
||||
char c;
|
||||
for (int i = 0; i < text.length(); i++) {
|
||||
c = text.charAt(i);
|
||||
if (c < 256) {
|
||||
tmp.append("%");
|
||||
if (c < 16) {
|
||||
tmp.append("0");
|
||||
}
|
||||
tmp.append(Integer.toString(c, 16));
|
||||
} else {
|
||||
tmp.append("%u");
|
||||
if (c <= 0xfff) {
|
||||
// issue#I49JU8@Gitee
|
||||
tmp.append("0");
|
||||
}
|
||||
tmp.append(Integer.toString(c, 16));
|
||||
}
|
||||
}
|
||||
return tmp.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Escape解码
|
||||
*
|
||||
* @param content 被转义的内容
|
||||
* @return 解码后的字符串
|
||||
*/
|
||||
public static String decode(String content) {
|
||||
if (StringUtils.isEmpty(content)) {
|
||||
return content;
|
||||
}
|
||||
|
||||
StringBuilder tmp = new StringBuilder(content.length());
|
||||
int lastPos = 0, pos = 0;
|
||||
char ch;
|
||||
while (lastPos < content.length()) {
|
||||
pos = content.indexOf("%", lastPos);
|
||||
if (pos == lastPos) {
|
||||
if (content.charAt(pos + 1) == 'u') {
|
||||
ch = (char) Integer.parseInt(content.substring(pos + 2, pos + 6), 16);
|
||||
tmp.append(ch);
|
||||
lastPos = pos + 6;
|
||||
} else {
|
||||
ch = (char) Integer.parseInt(content.substring(pos + 1, pos + 3), 16);
|
||||
tmp.append(ch);
|
||||
lastPos = pos + 3;
|
||||
}
|
||||
} else {
|
||||
if (pos == -1) {
|
||||
tmp.append(content.substring(lastPos));
|
||||
lastPos = content.length();
|
||||
} else {
|
||||
tmp.append(content.substring(lastPos, pos));
|
||||
lastPos = pos;
|
||||
}
|
||||
}
|
||||
}
|
||||
return tmp.toString();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String html = "<script>alert(1);</script>";
|
||||
String escape = EscapeUtil.escape(html);
|
||||
// String html = "<scr<script>ipt>alert(\"XSS\")</scr<script>ipt>";
|
||||
// String html = "<123";
|
||||
// String html = "123>";
|
||||
System.out.println("clean: " + EscapeUtil.clean(html));
|
||||
System.out.println("escape: " + escape);
|
||||
System.out.println("unescape: " + EscapeUtil.unescape(escape));
|
||||
}
|
||||
}
|
|
@ -5,4 +5,26 @@
|
|||
<mapper namespace="com.alihealth.d2d.provtest.mapper.DomesticDrugProductionApplyInfoMapper">
|
||||
|
||||
|
||||
<select id="selectByYpzsm" resultType="com.alihealth.d2d.provtest.VO.DrugProductionInfoVO">
|
||||
SELECT yptymc,
|
||||
ypspmc,
|
||||
gjypbsm,
|
||||
ypbwm,
|
||||
jx,
|
||||
zjgg,
|
||||
bzgg,
|
||||
bzzhb,
|
||||
ypyxq,
|
||||
ypyxqdw,
|
||||
yppzwh,
|
||||
yppzwhyxq,
|
||||
|
||||
scrq,
|
||||
ypyxqjzrq,
|
||||
ypscph,
|
||||
tyshxydmscqy AS tyshxydm,
|
||||
scqymc
|
||||
FROM domestic_drug_production_apply_info
|
||||
WHERE ypzsm = #{ypzsm}
|
||||
</select>
|
||||
</mapper>
|
|
@ -2,7 +2,17 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.alihealth.d2d.provtest.mapper.DrugDeliveryNoteApplyInfoMapper">
|
||||
|
||||
|
||||
|
||||
<select id="selectByYpzsm" resultType="com.alihealth.d2d.provtest.VO.DrugDeliveryNoteInfoVO">
|
||||
SELECT
|
||||
shsj,
|
||||
tyshxydmshjg,
|
||||
shjgmc,
|
||||
shdbh
|
||||
FROM
|
||||
drug_delivery_note_apply_info
|
||||
WHERE
|
||||
ypzsm = #{ypzsm}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
|
|
@ -2,7 +2,28 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.alihealth.d2d.provtest.mapper.DrugImportApplyInfoMapper">
|
||||
|
||||
|
||||
|
||||
<select id="selectByYpzsm" resultType="com.alihealth.d2d.provtest.VO.DrugProductionInfoVO">
|
||||
SELECT yptymc,
|
||||
ypspmc,
|
||||
gjypbsm,
|
||||
ypbwm,
|
||||
jx,
|
||||
zjgg,
|
||||
bzgg,
|
||||
bzzhb,
|
||||
ypyxq,
|
||||
ypyxqdw,
|
||||
yppzwh,
|
||||
yppzwhyxq,
|
||||
|
||||
scrq,
|
||||
ypyxqjzrq,
|
||||
ypscph,
|
||||
tyshxydmjkypdlqy AS tyshxydm,
|
||||
jkypdlqymc AS scqymc
|
||||
FROM drug_import_apply_info
|
||||
WHERE ypzsm = #{ypzsm}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
|
|
@ -2,7 +2,17 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.alihealth.d2d.provtest.mapper.DrugInvoiceApplyInfoMapper">
|
||||
|
||||
|
||||
|
||||
<select id="selectByYpzsm" resultType="com.alihealth.d2d.provtest.VO.DrugInvoiceInfoVO">
|
||||
SELECT
|
||||
fhsj,
|
||||
tyshxydmfhjg,
|
||||
fhjgmc,
|
||||
fhdbh
|
||||
FROM
|
||||
drug_invoice_apply_info
|
||||
WHERE
|
||||
ypzsm = #{ypzsm}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
|
|
@ -2,7 +2,21 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.alihealth.d2d.provtest.mapper.DrugRetailAndUseApplyInfoMapper">
|
||||
|
||||
|
||||
|
||||
<select id="selectByYpzsm" resultType="com.alihealth.d2d.provtest.VO.DrugRetailAndUseInfoVO">
|
||||
SELECT
|
||||
scsj,
|
||||
gmrsfxx,
|
||||
gmrdhhm,
|
||||
hlwddbz,
|
||||
lsydmc,
|
||||
lsdjbh,
|
||||
tyshxydmlsyd,
|
||||
kfys
|
||||
FROM
|
||||
drug_retail_and_use_apply_info
|
||||
WHERE
|
||||
ypzsm = #{ypzsm}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
|
Loading…
Reference in New Issue