diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/OrderController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/OrderController.java index c602621..854b5f3 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/OrderController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/OrderController.java @@ -435,19 +435,20 @@ public class OrderController { new Thread(()->{ try{ LymsPatient patient = lymsPatientService.getById(pid); - Map map = new HashMap<>(); - map.put("idno",patient.getIdno().toUpperCase()); - map.put("name",patient.getPname()); - map.put("weeks",cnt*4); - map.put("renew",pcid == null ? 0 : 1); - log.info("自动开通服务参数:{}",JsonUtil.obj2Str(map)); - String resposne = HttpUtil.doGetPost(platformUrl + Constant.PLATFORM_AUTO_OPEN_SERVICE_URL, "POST", map); - log.info("自动开通服务结果:{}",resposne); - + //TODO 特殊医院特殊处理 + if (patient.getHId()!=46){ + Map map = new HashMap<>(); + map.put("idno",patient.getIdno().toUpperCase()); + map.put("name",patient.getPname()); + map.put("weeks",cnt*4); + map.put("renew",pcid == null ? 0 : 1); + log.info("自动开通服务参数:{}",JsonUtil.obj2Str(map)); + String resposne = HttpUtil.doGetPost(platformUrl + Constant.PLATFORM_AUTO_OPEN_SERVICE_URL, "POST", map); + log.info("自动开通服务结果:{}",resposne); + } }catch (Exception e){ log.error("自动开通服务异常",e); } - }).start(); result.put("return_code","SUCCESS"); diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java index bd5022c..7e20cf0 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java @@ -51,6 +51,8 @@ public class PatientController { @Autowired private PatientInfoService patientInfoService;//患者视图 + @Autowired + private PatientInfo2Service patientInfo2Service;//特殊病例患者视图 @Autowired private LymsTcardService lymsTcardService;//问诊卡信息 @@ -89,14 +91,36 @@ public class PatientController { @Autowired private LymsHisInfoService lymsHisInfoService; - /** - * 获取患者列表 - * - * @param patientInfo - * @param current - * @param size - * @return - */ + @GetMapping("sltIllnessPatientLst") + @TokenRequired + public BaseResponse sltPatientLst(PatientInfo2 patientInfo, int current, int size) { + BaseResponse baseResponse = new BaseResponse(); + Page page = new Page<>(current, size); + QueryWrapper queryWrapper = Wrappers.query(patientInfo); + if(StringUtils.isEmpty(patientInfo.getPname())){ + patientInfo.setPname(null); + } + if(StringUtil.isNotEmpty(patientInfo.getSynthesisQuery())){ + queryWrapper.and(wrapper -> wrapper .like("pname", patientInfo.getSynthesisQuery()) + .or().eq("mobile", patientInfo.getSynthesisQuery()) + .or().eq("enrolmentPhone", patientInfo.getSynthesisQuery()) + .or().eq("idno", patientInfo.getSynthesisQuery())); + } + Page patientPagePage = patientInfo2Service.page(page, queryWrapper); + baseResponse.setObject(patientPagePage); + + return baseResponse; + } + + + /** + * 获取患者列表 + * + * @param patientInfo + * @param current + * @param size + * @return + */ @GetMapping("sltPatientLst") @TokenRequired public BaseResponse sltPatientLst(PatientInfo patientInfo, int current, int size, @RequestParam(required = false) Integer qtype) { @@ -964,17 +988,28 @@ public class PatientController { @PostMapping("updatePatientCase") @TokenRequired - public BaseResponse updatePatient(LymsPatient patient,LymsPcase pcase,LymsIllness illness,Integer ilid){ + public BaseResponse updatePatient(LymsPatient patient,LymsPcase pcase, + LymsIllness illness,Integer ilid,Integer iType){ BaseResponse baseResponse=new BaseResponse(); baseResponse.setErrorcode(1); baseResponse.setErrormsg("修改失败!"); boolean f=false; if(null!=patient.getId() && null!=pcase.getPcid() && null!=illness.getId()){ - f=lymsPatientService.saveOrUpdate(patient); + if (pcase.getPid()==null){ + pcase.setPid(patient.getId()); + } f=lymsPcaseService.saveOrUpdate(pcase); - illness.setId(ilid);//前端传入一组夸对象组合。后端用3组对象接受。前端传的是ilid这里id值是错误的。需要ilid赋给id。 + if (iType!=null && iType==1){ + illness.setPcid(pcase.getPcid()); + illness.setIid(ilid); + patient.setIname(""); + }else { + illness.setId(ilid);//前端传入一组夸对象组合。后端用3组对象接受。前端传的是ilid这里id值是错误的。需要ilid赋给id。 + } + f=lymsPatientService.saveOrUpdate(patient); f=lymsIllnessService.saveOrUpdate(illness); + if(f){ baseResponse.setErrorcode(0); baseResponse.setErrormsg("成功"); diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/PatientInfo2.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/PatientInfo2.java new file mode 100644 index 0000000..1ebcfcd --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/PatientInfo2.java @@ -0,0 +1,211 @@ +package com.lyms.talkonlineweb.domain; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +/** + * + * @TableName patient_info + */ +@TableName(value ="patient_info2") +@Data +public class PatientInfo2 implements Serializable { + /** + * id + */ + @TableField(value = "id") + private Integer id; + + /** + * 患者姓名 + */ + @TableField(value = "pname") + private String pname; + + /** + * 身份证号 + */ + @TableField(value = "idno") + private String idno; + + /** + * 登录密码 + */ + @TableField(value = "ppasswd") + private String ppasswd; + + /** + * 性别 + */ + @TableField(value = "sex") + private Integer sex; + + /** + * 问诊卡数量 + */ + @TableField(value = "ccnt") + private Integer ccnt; + + @TableField(value = "birth") + private String birth;//出生日期 + + /** + * 环信对应标识 + */ + @TableField(value = "hxid") + private String hxid; + + /** + * 创建人 + */ + @TableField(value = "createdby") + private Integer createdby; + + /** + * 病例id + */ + @TableField(value = "cid") + private Integer cid; + + /** + * 病例手机号 + */ + @TableField(value = "mobile") + private String mobile; + /** + * 注册手机号 + */ + @TableField(value = "enrolmentPhone") + private String enrolmentPhone; + + /** + * 填写医院id + */ + @TableField(value = "hid") + private Integer hid; + + /** + * 就诊医院名称 + */ + @TableField(value = "hname") + private String hname; + + /** + * 填写科室id + */ + @TableField(value = "did") + private Integer did; + + /** + * 科室名称 + */ + @TableField(value = "dname") + private String dname; + + /** + * 就诊医生 + */ + @TableField(value = "dtid") + private Integer dtid; + /** + * 医生登录账号 + */ + @TableField(value = "dlogin") + private String dlogin; + + /** + * 就诊医生hxid + */ + @TableField(value = "dhxid") + private String dhxid; + + /** + * 就诊医生姓名 + */ + @TableField(value = "dtname") + private String dtname; + + + /** + * 疾病名称 + */ + @TableField(value = "iname") + private String iname; + + + @TableField(value="headimg") + private String headimg;//患者头像 + + + @TableField(value = "createdtime") + private Date createdtime;//病例创建时间 + + /** + * 用户的公众号id + */ + @TableField(value = "gzopenid") + private String gzopenid; + /** + * 综合查询(姓名/电话/身份证) + */ + @TableField(exist = false) + private String synthesisQuery; + /** + * his系统就诊时间、就诊时间 + */ + @TableField(value = "created") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date created; + + @TableField(value="height") + private String height;//身高 + + @TableField(value="weight") + private String weight;//体重 + @TableField(value="type") + private Integer type;//1为孕妇 2为产妇 0为其他 + @TableField(value="week") + private String week;//孕产 产周 + @TableField(value="fmtype") + private Integer fmtype;//分娩方式 1为顺产 2为剖腹产 + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @Override + public String toString() { + return "PatientInfo{" + + "id=" + id + + ", pname='" + pname + '\'' + + ", idno='" + idno + '\'' + + ", ppasswd='" + ppasswd + '\'' + + ", sex=" + sex + + ", ccnt=" + ccnt + + ", birth='" + birth + '\'' + + ", hxid='" + hxid + '\'' + + ", createdby=" + createdby + + ", cid=" + cid + + ", mobile='" + mobile + '\'' + + ", enrolmentPhone='" + enrolmentPhone + '\'' + + ", hid=" + hid + + ", hname='" + hname + '\'' + + ", did=" + did + + ", dname='" + dname + '\'' + + ", dtid=" + dtid + + ", dtname='" + dtname + '\'' + + ", iname='" + iname + '\'' + + ", headimg='" + headimg + '\'' + + ", createdtime=" + createdtime + + ", gzopenid='" + gzopenid + '\'' + + ", synthesisQuery='" + synthesisQuery + '\'' + + ", created=" + created + + ", height='" + height + '\'' + + ", weight='" + weight + '\'' + + '}'; + } +} \ No newline at end of file diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/PatientInfo2Mapper.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/PatientInfo2Mapper.java new file mode 100644 index 0000000..3b9ce26 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/PatientInfo2Mapper.java @@ -0,0 +1,16 @@ +package com.lyms.talkonlineweb.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.lyms.talkonlineweb.domain.PatientInfo; +import com.lyms.talkonlineweb.domain.PatientInfo2; + +/** + * @Entity com.lyms.talkonlineweb.domain.PatientInfo + */ +public interface PatientInfo2Mapper extends BaseMapper { + +} + + + + diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/PatientInfo2Service.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/PatientInfo2Service.java new file mode 100644 index 0000000..9e54bf2 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/PatientInfo2Service.java @@ -0,0 +1,12 @@ +package com.lyms.talkonlineweb.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.lyms.talkonlineweb.domain.PatientInfo; +import com.lyms.talkonlineweb.domain.PatientInfo2; + +/** + *这个是个view不能做插入操作 + */ +public interface PatientInfo2Service extends IService { + +} diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsOrderServiceImpl.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsOrderServiceImpl.java index d3c1ee2..40396f6 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsOrderServiceImpl.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsOrderServiceImpl.java @@ -20,6 +20,8 @@ import com.lyms.talkonlineweb.service.LymsPcaseService; import com.lyms.talkonlineweb.service.LymsTcardService; import com.lyms.talkonlineweb.util.Constant; import com.lyms.talkonlineweb.util.DateUtil; +import com.lyms.talkonlineweb.util.StringUtil; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -33,6 +35,7 @@ import java.util.List; * @author Administrator */ @Service +@Slf4j public class LymsOrderServiceImpl extends ServiceImpl implements LymsOrderService { @@ -72,7 +75,8 @@ public class LymsOrderServiceImpl extends ServiceImpl query = new QueryWrapper<>(); query.eq("pid",patient.getId()); List list= lymsTcardService.list(query); @@ -80,7 +84,7 @@ public class LymsOrderServiceImpl extends ServiceImpl query1 = new QueryWrapper<>(); query1.eq("pid",patient.getId()); List pcaseList= lymsPcaseService.list(query1); - if (CollectionUtils.isEmpty(pcaseList)){ + if (CollectionUtils.isNotEmpty(pcaseList)){ pcId=pcaseList.get(0).getPcid(); } } @@ -96,7 +100,7 @@ public class LymsOrderServiceImpl extends ServiceImpl + implements PatientInfo2Service { + +} + + + +