Commit 5b86d3425a8bc7ef02a5a89da1fb6fa862643887

Authored by zhangchao
1 parent 66c231ce5d
Exists in dev

#fix:优化特殊病例流程

Showing 7 changed files with 326 additions and 24 deletions

talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/OrderController.java View file @ 5b86d34
... ... @@ -435,19 +435,20 @@
435 435 new Thread(()->{
436 436 try{
437 437 LymsPatient patient = lymsPatientService.getById(pid);
438   - Map<String,Object> map = new HashMap<>();
439   - map.put("idno",patient.getIdno().toUpperCase());
440   - map.put("name",patient.getPname());
441   - map.put("weeks",cnt*4);
442   - map.put("renew",pcid == null ? 0 : 1);
443   - log.info("自动开通服务参数:{}",JsonUtil.obj2Str(map));
444   - String resposne = HttpUtil.doGetPost(platformUrl + Constant.PLATFORM_AUTO_OPEN_SERVICE_URL, "POST", map);
445   - log.info("自动开通服务结果:{}",resposne);
446   -
  438 + //TODO 特殊医院特殊处理
  439 + if (patient.getHId()!=46){
  440 + Map<String,Object> map = new HashMap<>();
  441 + map.put("idno",patient.getIdno().toUpperCase());
  442 + map.put("name",patient.getPname());
  443 + map.put("weeks",cnt*4);
  444 + map.put("renew",pcid == null ? 0 : 1);
  445 + log.info("自动开通服务参数:{}",JsonUtil.obj2Str(map));
  446 + String resposne = HttpUtil.doGetPost(platformUrl + Constant.PLATFORM_AUTO_OPEN_SERVICE_URL, "POST", map);
  447 + log.info("自动开通服务结果:{}",resposne);
  448 + }
447 449 }catch (Exception e){
448 450 log.error("自动开通服务异常",e);
449 451 }
450   -
451 452 }).start();
452 453  
453 454 result.put("return_code","SUCCESS");
talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java View file @ 5b86d34
... ... @@ -51,6 +51,8 @@
51 51  
52 52 @Autowired
53 53 private PatientInfoService patientInfoService;//患者视图
  54 + @Autowired
  55 + private PatientInfo2Service patientInfo2Service;//特殊病例患者视图
54 56  
55 57 @Autowired
56 58 private LymsTcardService lymsTcardService;//问诊卡信息
... ... @@ -89,14 +91,36 @@
89 91 @Autowired
90 92 private LymsHisInfoService lymsHisInfoService;
91 93  
92   - /**
93   - * 获取患者列表
94   - *
95   - * @param patientInfo
96   - * @param current
97   - * @param size
98   - * @return
99   - */
  94 + @GetMapping("sltIllnessPatientLst")
  95 + @TokenRequired
  96 + public BaseResponse sltPatientLst(PatientInfo2 patientInfo, int current, int size) {
  97 + BaseResponse baseResponse = new BaseResponse();
  98 + Page<PatientInfo2> page = new Page<>(current, size);
  99 + QueryWrapper<PatientInfo2> queryWrapper = Wrappers.query(patientInfo);
  100 + if(StringUtils.isEmpty(patientInfo.getPname())){
  101 + patientInfo.setPname(null);
  102 + }
  103 + if(StringUtil.isNotEmpty(patientInfo.getSynthesisQuery())){
  104 + queryWrapper.and(wrapper -> wrapper .like("pname", patientInfo.getSynthesisQuery())
  105 + .or().eq("mobile", patientInfo.getSynthesisQuery())
  106 + .or().eq("enrolmentPhone", patientInfo.getSynthesisQuery())
  107 + .or().eq("idno", patientInfo.getSynthesisQuery()));
  108 + }
  109 + Page<PatientInfo2> patientPagePage = patientInfo2Service.page(page, queryWrapper);
  110 + baseResponse.setObject(patientPagePage);
  111 +
  112 + return baseResponse;
  113 + }
  114 +
  115 +
  116 + /**
  117 + * 获取患者列表
  118 + *
  119 + * @param patientInfo
  120 + * @param current
  121 + * @param size
  122 + * @return
  123 + */
100 124 @GetMapping("sltPatientLst")
101 125 @TokenRequired
102 126 public BaseResponse sltPatientLst(PatientInfo patientInfo, int current, int size, @RequestParam(required = false) Integer qtype) {
103 127  
104 128  
105 129  
... ... @@ -964,17 +988,28 @@
964 988  
965 989 @PostMapping("updatePatientCase")
966 990 @TokenRequired
967   - public BaseResponse updatePatient(LymsPatient patient,LymsPcase pcase,LymsIllness illness,Integer ilid){
  991 + public BaseResponse updatePatient(LymsPatient patient,LymsPcase pcase,
  992 + LymsIllness illness,Integer ilid,Integer iType){
968 993 BaseResponse baseResponse=new BaseResponse();
969 994 baseResponse.setErrorcode(1);
970 995 baseResponse.setErrormsg("修改失败!");
971 996 boolean f=false;
972 997 if(null!=patient.getId() && null!=pcase.getPcid() && null!=illness.getId()){
973 998  
974   - f=lymsPatientService.saveOrUpdate(patient);
  999 + if (pcase.getPid()==null){
  1000 + pcase.setPid(patient.getId());
  1001 + }
975 1002 f=lymsPcaseService.saveOrUpdate(pcase);
976   - illness.setId(ilid);//前端传入一组夸对象组合。后端用3组对象接受。前端传的是ilid这里id值是错误的。需要ilid赋给id。
  1003 + if (iType!=null && iType==1){
  1004 + illness.setPcid(pcase.getPcid());
  1005 + illness.setIid(ilid);
  1006 + patient.setIname("");
  1007 + }else {
  1008 + illness.setId(ilid);//前端传入一组夸对象组合。后端用3组对象接受。前端传的是ilid这里id值是错误的。需要ilid赋给id。
  1009 + }
  1010 + f=lymsPatientService.saveOrUpdate(patient);
977 1011 f=lymsIllnessService.saveOrUpdate(illness);
  1012 +
978 1013 if(f){
979 1014 baseResponse.setErrorcode(0);
980 1015 baseResponse.setErrormsg("成功");
talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/PatientInfo2.java View file @ 5b86d34
  1 +package com.lyms.talkonlineweb.domain;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.TableField;
  4 +import com.baomidou.mybatisplus.annotation.TableName;
  5 +import lombok.Data;
  6 +import org.springframework.format.annotation.DateTimeFormat;
  7 +
  8 +import java.io.Serializable;
  9 +import java.util.Date;
  10 +
  11 +/**
  12 + *
  13 + * @TableName patient_info
  14 + */
  15 +@TableName(value ="patient_info2")
  16 +@Data
  17 +public class PatientInfo2 implements Serializable {
  18 + /**
  19 + * id
  20 + */
  21 + @TableField(value = "id")
  22 + private Integer id;
  23 +
  24 + /**
  25 + * 患者姓名
  26 + */
  27 + @TableField(value = "pname")
  28 + private String pname;
  29 +
  30 + /**
  31 + * 身份证号
  32 + */
  33 + @TableField(value = "idno")
  34 + private String idno;
  35 +
  36 + /**
  37 + * 登录密码
  38 + */
  39 + @TableField(value = "ppasswd")
  40 + private String ppasswd;
  41 +
  42 + /**
  43 + * 性别
  44 + */
  45 + @TableField(value = "sex")
  46 + private Integer sex;
  47 +
  48 + /**
  49 + * 问诊卡数量
  50 + */
  51 + @TableField(value = "ccnt")
  52 + private Integer ccnt;
  53 +
  54 + @TableField(value = "birth")
  55 + private String birth;//出生日期
  56 +
  57 + /**
  58 + * 环信对应标识
  59 + */
  60 + @TableField(value = "hxid")
  61 + private String hxid;
  62 +
  63 + /**
  64 + * 创建人
  65 + */
  66 + @TableField(value = "createdby")
  67 + private Integer createdby;
  68 +
  69 + /**
  70 + * 病例id
  71 + */
  72 + @TableField(value = "cid")
  73 + private Integer cid;
  74 +
  75 + /**
  76 + * 病例手机号
  77 + */
  78 + @TableField(value = "mobile")
  79 + private String mobile;
  80 + /**
  81 + * 注册手机号
  82 + */
  83 + @TableField(value = "enrolmentPhone")
  84 + private String enrolmentPhone;
  85 +
  86 + /**
  87 + * 填写医院id
  88 + */
  89 + @TableField(value = "hid")
  90 + private Integer hid;
  91 +
  92 + /**
  93 + * 就诊医院名称
  94 + */
  95 + @TableField(value = "hname")
  96 + private String hname;
  97 +
  98 + /**
  99 + * 填写科室id
  100 + */
  101 + @TableField(value = "did")
  102 + private Integer did;
  103 +
  104 + /**
  105 + * 科室名称
  106 + */
  107 + @TableField(value = "dname")
  108 + private String dname;
  109 +
  110 + /**
  111 + * 就诊医生
  112 + */
  113 + @TableField(value = "dtid")
  114 + private Integer dtid;
  115 + /**
  116 + * 医生登录账号
  117 + */
  118 + @TableField(value = "dlogin")
  119 + private String dlogin;
  120 +
  121 + /**
  122 + * 就诊医生hxid
  123 + */
  124 + @TableField(value = "dhxid")
  125 + private String dhxid;
  126 +
  127 + /**
  128 + * 就诊医生姓名
  129 + */
  130 + @TableField(value = "dtname")
  131 + private String dtname;
  132 +
  133 +
  134 + /**
  135 + * 疾病名称
  136 + */
  137 + @TableField(value = "iname")
  138 + private String iname;
  139 +
  140 +
  141 + @TableField(value="headimg")
  142 + private String headimg;//患者头像
  143 +
  144 +
  145 + @TableField(value = "createdtime")
  146 + private Date createdtime;//病例创建时间
  147 +
  148 + /**
  149 + * 用户的公众号id
  150 + */
  151 + @TableField(value = "gzopenid")
  152 + private String gzopenid;
  153 + /**
  154 + * 综合查询(姓名/电话/身份证)
  155 + */
  156 + @TableField(exist = false)
  157 + private String synthesisQuery;
  158 + /**
  159 + * his系统就诊时间、就诊时间
  160 + */
  161 + @TableField(value = "created")
  162 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  163 + private Date created;
  164 +
  165 + @TableField(value="height")
  166 + private String height;//身高
  167 +
  168 + @TableField(value="weight")
  169 + private String weight;//体重
  170 + @TableField(value="type")
  171 + private Integer type;//1为孕妇 2为产妇 0为其他
  172 + @TableField(value="week")
  173 + private String week;//孕产 产周
  174 + @TableField(value="fmtype")
  175 + private Integer fmtype;//分娩方式 1为顺产 2为剖腹产
  176 +
  177 + @TableField(exist = false)
  178 + private static final long serialVersionUID = 1L;
  179 +
  180 + @Override
  181 + public String toString() {
  182 + return "PatientInfo{" +
  183 + "id=" + id +
  184 + ", pname='" + pname + '\'' +
  185 + ", idno='" + idno + '\'' +
  186 + ", ppasswd='" + ppasswd + '\'' +
  187 + ", sex=" + sex +
  188 + ", ccnt=" + ccnt +
  189 + ", birth='" + birth + '\'' +
  190 + ", hxid='" + hxid + '\'' +
  191 + ", createdby=" + createdby +
  192 + ", cid=" + cid +
  193 + ", mobile='" + mobile + '\'' +
  194 + ", enrolmentPhone='" + enrolmentPhone + '\'' +
  195 + ", hid=" + hid +
  196 + ", hname='" + hname + '\'' +
  197 + ", did=" + did +
  198 + ", dname='" + dname + '\'' +
  199 + ", dtid=" + dtid +
  200 + ", dtname='" + dtname + '\'' +
  201 + ", iname='" + iname + '\'' +
  202 + ", headimg='" + headimg + '\'' +
  203 + ", createdtime=" + createdtime +
  204 + ", gzopenid='" + gzopenid + '\'' +
  205 + ", synthesisQuery='" + synthesisQuery + '\'' +
  206 + ", created=" + created +
  207 + ", height='" + height + '\'' +
  208 + ", weight='" + weight + '\'' +
  209 + '}';
  210 + }
  211 +}
talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/PatientInfo2Mapper.java View file @ 5b86d34
  1 +package com.lyms.talkonlineweb.mapper;
  2 +
  3 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  4 +import com.lyms.talkonlineweb.domain.PatientInfo;
  5 +import com.lyms.talkonlineweb.domain.PatientInfo2;
  6 +
  7 +/**
  8 + * @Entity com.lyms.talkonlineweb.domain.PatientInfo
  9 + */
  10 +public interface PatientInfo2Mapper extends BaseMapper<PatientInfo2> {
  11 +
  12 +}
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/PatientInfo2Service.java View file @ 5b86d34
  1 +package com.lyms.talkonlineweb.service;
  2 +
  3 +import com.baomidou.mybatisplus.extension.service.IService;
  4 +import com.lyms.talkonlineweb.domain.PatientInfo;
  5 +import com.lyms.talkonlineweb.domain.PatientInfo2;
  6 +
  7 +/**
  8 + *这个是个view不能做插入操作
  9 + */
  10 +public interface PatientInfo2Service extends IService<PatientInfo2> {
  11 +
  12 +}
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsOrderServiceImpl.java View file @ 5b86d34
... ... @@ -20,6 +20,8 @@
20 20 import com.lyms.talkonlineweb.service.LymsTcardService;
21 21 import com.lyms.talkonlineweb.util.Constant;
22 22 import com.lyms.talkonlineweb.util.DateUtil;
  23 +import com.lyms.talkonlineweb.util.StringUtil;
  24 +import lombok.extern.slf4j.Slf4j;
23 25 import org.springframework.beans.factory.annotation.Autowired;
24 26 import org.springframework.stereotype.Service;
25 27 import org.springframework.transaction.annotation.Transactional;
... ... @@ -33,6 +35,7 @@
33 35 * @author Administrator
34 36 */
35 37 @Service
  38 +@Slf4j
36 39 public class LymsOrderServiceImpl extends ServiceImpl<LymsOrderMapper, LymsOrder>
37 40 implements LymsOrderService {
38 41  
... ... @@ -72,7 +75,8 @@
72 75 DateUtil.addDay(DateUtil.getYmdDate(one.getEndTime()),1) : new Date();
73 76 }else {
74 77 //TODO 针对于特殊医院如果当前人是通过小程序购买
75   - if (patient.getHId()!=null && patient.getHId()==46){
  78 + if (patient.getHId()!=null && patient.getHId()==46 /*&&StringUtil.isEmpty(patient.getIname())*/){
  79 + //log.info("handleOrder patient:"+patient.getHId());
76 80 QueryWrapper<LymsTcard> query = new QueryWrapper<>();
77 81 query.eq("pid",patient.getId());
78 82 List<LymsTcard> list= lymsTcardService.list(query);
... ... @@ -80,7 +84,7 @@
80 84 QueryWrapper<LymsPcase> query1 = new QueryWrapper<>();
81 85 query1.eq("pid",patient.getId());
82 86 List<LymsPcase> pcaseList= lymsPcaseService.list(query1);
83   - if (CollectionUtils.isEmpty(pcaseList)){
  87 + if (CollectionUtils.isNotEmpty(pcaseList)){
84 88 pcId=pcaseList.get(0).getPcid();
85 89 }
86 90 }
... ... @@ -96,7 +100,7 @@
96 100 lymsOrders.setUpdatedtime(new Date());
97 101 updateById(lymsOrders);
98 102 }
99   -
  103 + //log.info("pcId===?"+pcId);
100 104 //pcid不为空,说明是续期购买,直接生成生成问诊卡 或者his上传 或者特殊医院
101 105 if(lymsOrders.getPcid() != null || !isPayCallBack || pcId !=null){
102 106  
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/PatientInfo2ServiceImpl.java View file @ 5b86d34
  1 +package com.lyms.talkonlineweb.service.impl;
  2 +
  3 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  4 +import com.lyms.talkonlineweb.domain.PatientInfo;
  5 +import com.lyms.talkonlineweb.domain.PatientInfo2;
  6 +import com.lyms.talkonlineweb.mapper.PatientInfo2Mapper;
  7 +import com.lyms.talkonlineweb.mapper.PatientInfoMapper;
  8 +import com.lyms.talkonlineweb.service.PatientInfo2Service;
  9 +import com.lyms.talkonlineweb.service.PatientInfoService;
  10 +import org.springframework.stereotype.Service;
  11 +
  12 +/**
  13 + *
  14 + */
  15 +@Service
  16 +public class PatientInfo2ServiceImpl extends ServiceImpl<PatientInfo2Mapper, PatientInfo2>
  17 + implements PatientInfo2Service {
  18 +
  19 +}