diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/annotation/Resubmit.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/annotation/Resubmit.java new file mode 100644 index 0000000..edcb3dc --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/annotation/Resubmit.java @@ -0,0 +1,20 @@ +package com.lyms.talkonlineweb.annotation; + + +import java.lang.annotation.*; + +/** + * @author lqy + * 表单重复提交注解 + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Resubmit { + /** + * 延时时间 在延时多久后可以再次提交 + * + * @return Time unit is one second + */ + int delaySeconds() default 6; +} diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/aop/ResubmitDataAspect.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/aop/ResubmitDataAspect.java new file mode 100644 index 0000000..c3adff5 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/aop/ResubmitDataAspect.java @@ -0,0 +1,85 @@ +package com.lyms.talkonlineweb.aop; + + + +import com.lyms.talkonlineweb.annotation.Resubmit; +import com.lyms.talkonlineweb.domain.BaseModel; +import com.lyms.talkonlineweb.lock.ResubmitLock; +import com.lyms.talkonlineweb.result.BaseResponse; +import com.lyms.talkonlineweb.util.JsonUtil; +import com.lyms.talkonlineweb.util.StringUtil; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.reflect.MethodSignature; +import org.springframework.stereotype.Component; + + +import java.lang.reflect.Method; + +/** + * @author lqy + * 重复提交处理 + */ +@Slf4j +@Aspect +@Component +public class ResubmitDataAspect { + + private final static Object PRESENT = new Object(); + + @Around("@annotation(resubmit)") + public Object handleResubmit(ProceedingJoinPoint joinPoint, Resubmit resubmit) throws Throwable { + Method method = ((MethodSignature) joinPoint.getSignature()).getMethod(); + //获取注解信息 + Resubmit annotation = method.getAnnotation(Resubmit.class); + int delaySeconds = annotation.delaySeconds(); + Object[] pointArgs = joinPoint.getArgs(); + StringBuilder key = new StringBuilder(); + if (pointArgs != null && pointArgs.length > 0) + { + for (Object param : pointArgs) + { + if (param instanceof BaseModel) { + String paramStr = JsonUtil.obj2Str(param); + //生成加密参数 使用了content_MD5的加密方式 + key.append(ResubmitLock.handleKey(paramStr)); + } + else if (param != null) + { + key.append(ResubmitLock.handleKey(param.toString())); + } + } + + if (StringUtil.isNotEmpty(key.toString())) + { + //执行锁 + boolean lock = false; + try + { + //设置解锁key + lock = ResubmitLock.getInstance().lock(key.toString(), PRESENT); + if (lock) + { //放行 + return joinPoint.proceed(); + } + else + { //响应重复提交异常 + BaseResponse response = new BaseResponse(); + response.setErrorcode(1); + response.setErrormsg("请勿重复提交"); + return response; + } + } + finally + { + //设置解锁key和解锁时间 + ResubmitLock.getInstance().unLock(lock, key.toString(), delaySeconds); + } + } + } + return joinPoint.proceed(); + } + +} 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 1ddfce1..9ecca11 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java @@ -1,32 +1,29 @@ package com.lyms.talkonlineweb.controller; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.lyms.talkonlineweb.domain.*; import com.lyms.talkonlineweb.result.BaseResponse; import com.lyms.talkonlineweb.service.*; import com.lyms.talkonlineweb.util.Constant; -import com.lyms.talkonlineweb.util.HXService; import com.lyms.talkonlineweb.util.JwtUtils; import lombok.extern.log4j.Log4j2; -import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.BindingResult; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import java.util.*; -import java.util.stream.Collectors; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * 患者管理 */ @RestController @RequestMapping("pat") -@Slf4j +@Log4j2 public class PatientController { @Autowired @@ -39,6 +36,9 @@ public class PatientController { private LymsIllnessService lymsIllnessService;//疾病 @Autowired + private LymsTkcardService lymsTkcardService;//问诊记录 + + @Autowired private PatientInfoService patientInfoService;//患者视图 @Autowired @@ -50,6 +50,15 @@ public class PatientController { @Autowired private HXService hxService; + //医院 + @Autowired + private LymsHospitalService lymsHospitalService; + //医生 + @Autowired + private LymsDoctorService lymsDoctorService; + //关注 + @Autowired + private LymsAttentionService lymsAttentionService; /** * 获取患者列表 @@ -125,6 +134,9 @@ public class PatientController { f=lymsPcaseService.saveOrUpdate(pcase); String[] iArr=illness.split(","); + log.info(patient); + log.info(pcase); + Map param=new HashMap(); for (int i = 0; i < iArr.length; i++) { @@ -248,4 +260,241 @@ public class PatientController { return baseResponse; } + + /** + * 传入患者id,获取病历对应的医院列表 + * @param lymsPcase + * @return + */ + @GetMapping("getPatientHospitals") + public BaseResponse getPatientHospitals(LymsPcase lymsPcase){ + BaseResponse baseResponse = new BaseResponse(); + List pcases =lymsPcaseService.list(Wrappers.query(lymsPcase)); + baseResponse.setObject(pcases); + return baseResponse; + } + + + /** + * 查询患者在某个医院的详细诊断病历 + * 需要传入患者id和医院id + * @param pid 患者id + * @param hid 医院id + * @return + */ + @GetMapping("getPatientHospitalPcase") + public BaseResponse getPatientHospitalPcase(int pid,int hid, + @RequestParam(required = false) String keyword){ + BaseResponse baseResponse = new BaseResponse(); + Map data = new HashMap(5); + LymsPatient patient = lymsPatientService.getById(pid); + //患者基本信息 + data.put("patient",patient); + + //医院信息 + LymsHospital hospital = lymsHospitalService.getById(pid); + data.put("hospital",hospital); + + List ilist = new ArrayList<>(); + if (StringUtil.isNotEmpty(keyword)){ + LambdaQueryWrapper iwrapper = new QueryWrapper().lambda(); + iwrapper.like(LymsIllness::getIname, keyword); + List illnesses = lymsIllnessService.list(iwrapper); + if (CollectionUtils.isNotEmpty(illnesses)){ + illnesses.stream().forEach(i -> { + ilist.add(i.getPcid()); + }); + } + } + //查询患者的就诊记录 + LambdaQueryWrapper wrapper = new QueryWrapper().lambda(); + wrapper.eq(LymsPcase::getPid, pid); + wrapper.eq(LymsPcase::getHid, hid); + if (StringUtil.isNotEmpty(keyword)){ + wrapper.and(i -> i.like(LymsPcase::getDname, keyword).or().like(LymsPcase::getDtname, keyword)); + if (CollectionUtils.isNotEmpty(ilist)){ + wrapper.or(i -> i.in(LymsPcase::getPcid, ilist)); + } + } + wrapper.orderByDesc(LymsPcase::getCreatedtime); + List lymsPcaseList = lymsPcaseService.list(wrapper); + + List pcases = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(lymsPcaseList)){ + lymsPcaseList.forEach(destModel -> { + PatientPcaseResult result = new PatientPcaseResult(); + result.setPid(destModel.getPid()); + result.setDepartName(destModel.getDname()); + result.setDoctorName(destModel.getDtname()); + result.setCardNo(patient.getIdno()); + result.setPatientName(patient.getPname()); + result.setCcnt(patient.getCcnt()); + result.setPhxid(patient.getHxid()); + LymsDoctor doctor = lymsDoctorService.getById(destModel.getDtid()); + result.setDhxid(doctor.getHxid()); + result.setDtid(destModel.getDtid()); + result.setCreatedby(DateUtil.getYyyyMmDdHhMmSs(destModel.getCreatedtime())); + pcases.add(result); + }); + } + data.put("pcases",pcases); + + baseResponse.setObject(data); + return baseResponse; + } + + + /** + * 通过患者id查询患者的基本信息 + * @param lymsPatient + * @return + */ + @GetMapping("getPatientBaseInfo") + public BaseResponse getPatientBaseInfo(LymsPatient lymsPatient){ + + BaseResponse baseResponse = new BaseResponse(); + + Map data = new HashMap(6); + LymsPatient patients = lymsPatientService.getById(lymsPatient.getId()); + + //查询患者的就诊记录 + LambdaQueryWrapper wrapper = new QueryWrapper().lambda(); + wrapper.eq(LymsPcase::getPid, lymsPatient.getId()); + wrapper.orderByDesc(LymsPcase::getCreatedtime); + List lymsPcaseList = lymsPcaseService.list(wrapper); + + data.put("pid",patients.getId()); + data.put("pname",patients.getPname()); + data.put("psex",patients.getSex()); + data.put("birth",patients.getBirth()); + if (CollectionUtils.isNotEmpty(lymsPcaseList)) + { + data.put("mobile",lymsPcaseList.get(0).getMobile()); + } + baseResponse.setObject(data); + return baseResponse; + } + + + /** + * 更新患者信息 + * @param request + * @return + */ + @PutMapping("updatePatientInfo") + public BaseResponse updatePatientInfo(@RequestBody PatientInfoRequest request){ + BaseResponse baseResponse=new BaseResponse(); + LymsPatient patients = lymsPatientService.getById(request.getPid()); + patients.setBirth(request.getBirth()); + patients.setPname(request.getPname()); + patients.setSex(request.getPsex()); + lymsPatientService.updateById(patients); + + //查询患者的就诊记录 + LambdaQueryWrapper wrapper = new QueryWrapper().lambda(); + wrapper.eq(LymsPcase::getPid, request.getPid()); + wrapper.orderByDesc(LymsPcase::getCreatedtime); + List lymsPcaseList = lymsPcaseService.list(wrapper); + if (CollectionUtils.isNotEmpty(lymsPcaseList)) + { + lymsPcaseList.forEach(lymsPcase -> { + lymsPcase.setMobile(request.getMobile()); + lymsPcaseService.updateById(lymsPcase); + }); + } + return baseResponse; + } + + + /** + * 患者的问诊记录接口 + * @param lymsTkrecord 传入患者id参数 + * @return + */ + @GetMapping("getPatienttkrecord") + public BaseResponse getPatienttkrecord(LymsTkrecord lymsTkrecord){ + + BaseResponse baseResponse = new BaseResponse(); + LymsPatient patients = lymsPatientService.getById(lymsTkrecord.getPid()); + + //查询患者的就诊记录 + LambdaQueryWrapper wrapper = new QueryWrapper().lambda(); + wrapper.eq(LymsTkrecord::getPid, lymsTkrecord.getPid()); + wrapper.orderByDesc(LymsTkrecord::getCreatedtime); + List lymsTkrecords = lymsTkcardService.list(wrapper); + + List list = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(lymsTkrecords)) + { + for(LymsTkrecord record : lymsTkrecords) + { + LymsPcase pcase = lymsPcaseService.getById(record.getPcid()); + + Map data = new HashMap(20); + data.put("hospitalName",pcase.getHname()); + data.put("hospitalLevel",""); + data.put("doctorName",pcase.getDtname()); + data.put("departName",pcase.getDname()); + data.put("doctorLevel",""); + data.put("patientName",patients.getPname()); + + StringBuilder sb = new StringBuilder(); + LambdaQueryWrapper iwrapper = new QueryWrapper().lambda(); + iwrapper.like(LymsIllness::getPcid, pcase.getPcid()); + List illnesses = lymsIllnessService.list(iwrapper); + if (CollectionUtils.isNotEmpty(illnesses)) + { + illnesses.forEach(lymsIllness -> { + sb.append(lymsIllness.getIname()); + sb.append(" "); + }); + } + + data.put("iname",sb.toString()); + data.put("createTime",DateUtil.getDateTime(record.getCreatedtime(),DateUtil.YYYY_MM_DD)); + data.put("stat",record.getStat()); + + + list.add(data); + } + } + baseResponse.setObject(list); + return baseResponse; + } + + /** + * 查询患者关注的医生记录 + * @param lymsAttention 传入患者id参数 + * @return + */ + @GetMapping("getPatientAttentions") + public BaseResponse getPatientAttentions(LymsAttention lymsAttention){ + + BaseResponse baseResponse = new BaseResponse(); + //查询患者的关注医生记录 + LambdaQueryWrapper wrapper = new QueryWrapper().lambda(); + wrapper.eq(LymsAttention::getPid, lymsAttention.getPid()); + wrapper.orderByDesc(LymsAttention::getCreatedtime); + List lymsAttentions = lymsAttentionService.list(wrapper); + + List list = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(lymsAttentions)) + { + for(LymsAttention attention : lymsAttentions) + { + LymsDoctor doctor = lymsDoctorService.getById(attention.getDid()); + + Map data = new HashMap(20); + data.put("doctorName",doctor.getDname()); + data.put("departName",doctor.getDdname()); + data.put("doctorLevel",""); + data.put("hospitalName",doctor.getHname()); + data.put("hospitalLevel",""); + data.put("doctorDesc",doctor.getIntro()); + list.add(data); + } + } + baseResponse.setObject(list); + return baseResponse; + } } diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/BaseModel.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/BaseModel.java new file mode 100644 index 0000000..ed004f4 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/BaseModel.java @@ -0,0 +1,14 @@ +package com.lyms.talkonlineweb.domain; + +/** + * @ProjectName: talkonline + * @Package: com.lyms.talkonlineweb.domain + * @ClassName: BaseModel + * @Author: lqy + * @Description: 基础实体 + * @Date: 2021-09-10 20:34 + * @Version: + */ + +public class BaseModel { +} diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsAttention.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsAttention.java new file mode 100644 index 0000000..6753fa4 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsAttention.java @@ -0,0 +1,51 @@ +package com.lyms.talkonlineweb.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.ToString; + +import java.io.Serializable; +import java.util.Date; + +/** + * @ProjectName: talkonline + * @Package: com.lyms.talkonlineweb.domain + * @ClassName: LymsAttention + * @Author: lqy + * @Description: 关注表 + * @Date: 2021-09-10 16:08 + * @Version: + */ +@TableName(value ="lyms_attention") +@Data +@ToString +public class LymsAttention implements Serializable { + + /** + * + */ + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 患者id + */ + @TableField(value = "pid") + private Integer pid; + + /** + * 问诊医生 + */ + @TableField(value = "did") + private Integer did; + + /** + * 创建时间 + */ + @TableField(value = "createdtime") + private Date createdtime; + +} diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsOrder.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsOrder.java new file mode 100644 index 0000000..1ee7048 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsOrder.java @@ -0,0 +1,88 @@ +package com.lyms.talkonlineweb.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.ToString; + +import java.io.Serializable; +import java.util.Date; + +/** + * @ProjectName: talkonline + * @Package: com.lyms.talkonlineweb.domain + * @ClassName: LymsAttention + * @Author: lqy + * @Description: 订单 + * @Date: 2021-09-10 16:08 + * @Version: + */ +@TableName(value ="lyms_order") +@Data +@ToString +public class LymsOrder extends BaseModel implements Serializable { + + /** + * + */ + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 订单编号 + */ + @TableField(value = "orderno") + private String orderno; + + /** + * 患者id + */ + @TableField(value = "pid") + private Integer pid; + + /** + * 商品编号 + */ + @TableField(value = "gid") + private Integer gid; + + + /** + * 价格 + */ + @TableField(value = "price") + private Integer price; + /** + * 购买数量 + */ + @TableField(value = "cnt") + private Integer cnt; + + + /** + * 创建人 + */ + @TableField(value = "createdby") + private Integer createdby; + + /** + * 创建时间 + */ + @TableField(value = "createdtime") + private Date createdtime; + + /** + * 更新人 + */ + @TableField(value = "updatedby") + private String updatedby; + + /** + * 更新时间 + */ + @TableField(value = "updatedtime") + private Date updatedtime; + +} diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsPatient.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsPatient.java index 0785b90..38e01ed 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsPatient.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsPatient.java @@ -40,6 +40,13 @@ public class LymsPatient implements Serializable { private String ppasswd; /** + * 生日 + */ + @TableField(value = "birth") + private String birth; + + + /** * 性别 */ @TableField(value = "sex") diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsTkrecord.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsTkrecord.java new file mode 100644 index 0000000..fa2f2f2 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsTkrecord.java @@ -0,0 +1,77 @@ +package com.lyms.talkonlineweb.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.ToString; + +import java.io.Serializable; +import java.util.Date; + +/** + * 问诊记录 + * @TableName lyms_tkrecord + */ +@TableName(value ="lyms_tkrecord") +@Data +@ToString +public class LymsTkrecord implements Serializable { + + /** + * + */ + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 患者id + */ + @TableField(value = "pid") + private Integer pid; + + /** + * 问诊医生 + */ + @TableField(value = "did") + private Integer did; + + /** + * 诊断id + */ + @TableField(value = "pcid") + private Integer pcid; + + + /** + * 问诊状态 + */ + @TableField(value = "stat") + private Integer stat; + + + /** + * 创建人 + */ + @TableField(value = "createdby") + private Integer createdby; + + /** + * 创建时间 + */ + @TableField(value = "createdtime") + private Date createdtime; + + /** + * 更新人 + */ + @TableField(value = "updatedby") + private Integer updatedby; + + /** + * 更新时间 + */ + @TableField(value = "updated_time") + private Date updatedTime; +} \ No newline at end of file diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/lock/ResubmitLock.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/lock/ResubmitLock.java new file mode 100644 index 0000000..b0e2004 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/lock/ResubmitLock.java @@ -0,0 +1,65 @@ +package com.lyms.talkonlineweb.lock; + +import com.lyms.talkonlineweb.util.MD5Util; +import lombok.extern.slf4j.Slf4j; + +import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +@Slf4j +public class ResubmitLock { + private static final ConcurrentHashMap LOCK_CACHE = new ConcurrentHashMap<>(200); + private static final ScheduledThreadPoolExecutor EXECUTOR = new ScheduledThreadPoolExecutor(5, new ThreadPoolExecutor.DiscardPolicy()); + + + private ResubmitLock() { + } + + /** + * 静态内部类 单例模式 + * + * @return + */ + private static class SingletonInstance { + private static final ResubmitLock INSTANCE = new ResubmitLock(); + } + + public static ResubmitLock getInstance() { + return SingletonInstance.INSTANCE; + } + + + public static String handleKey(String param) { + return MD5Util.md5(param == null ? "" : param); + } + + /** + * 加锁 putIfAbsent 是原子操作保证线程安全 + * + * @param key 对应的key + * @param value + * @return + */ + public boolean lock(final String key, Object value) { + return Objects.isNull(LOCK_CACHE.putIfAbsent(key, value)); + } + + /** + * 延时释放锁 用以控制短时间内的重复提交 + * + * @param lock 是否需要解锁 + * @param key 对应的key + * @param delaySeconds 延时时间 + */ + public void unLock(final boolean lock, final String key, final int delaySeconds) { + if (lock) { + EXECUTOR.schedule(() -> { + LOCK_CACHE.remove(key); + }, delaySeconds, TimeUnit.SECONDS); + } + } + +} diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsAttentionMapper.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsAttentionMapper.java new file mode 100644 index 0000000..d353911 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsAttentionMapper.java @@ -0,0 +1,15 @@ +package com.lyms.talkonlineweb.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.lyms.talkonlineweb.domain.LymsAttention; + +/** + * @Entity com.lyms.talkonlineweb.domain.LymsAttention + */ +public interface LymsAttentionMapper extends BaseMapper { + +} + + + + diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsOrderMapper.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsOrderMapper.java new file mode 100644 index 0000000..e1111e2 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsOrderMapper.java @@ -0,0 +1,16 @@ +package com.lyms.talkonlineweb.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.lyms.talkonlineweb.domain.LymsAttention; +import com.lyms.talkonlineweb.domain.LymsOrder; + +/** + * @Entity com.lyms.talkonlineweb.domain.LymsOrder + */ +public interface LymsOrderMapper extends BaseMapper { + +} + + + + diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsTkcardMapper.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsTkcardMapper.java new file mode 100644 index 0000000..31f4263 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsTkcardMapper.java @@ -0,0 +1,15 @@ +package com.lyms.talkonlineweb.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.lyms.talkonlineweb.domain.LymsTkrecord; + +/** + * @Entity com.lyms.talkonlineweb.domain.LymsTkrecord + */ +public interface LymsTkcardMapper extends BaseMapper { + +} + + + + diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/request/PatientInfoRequest.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/request/PatientInfoRequest.java new file mode 100644 index 0000000..2ff7800 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/request/PatientInfoRequest.java @@ -0,0 +1,21 @@ +package com.lyms.talkonlineweb.request; + +import lombok.Data; + +/** + * @ProjectName: talkonline + * @Package: com.lyms.talkonlineweb.request + * @ClassName: PatientInfoRequest + * @Author: lqy + * @Description: 修改个人信息 + * @Date: 2021-09-08 19:37 + * @Version: + */ +@Data +public class PatientInfoRequest { + private int pid; + private String pname; + private int psex; + private String birth; + private String mobile; +} diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/result/IResultConvert.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/result/IResultConvert.java new file mode 100644 index 0000000..7af2381 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/result/IResultConvert.java @@ -0,0 +1,15 @@ +package com.lyms.talkonlineweb.result; + +/** + * @ProjectName: talkonline + * @Package: com.lyms.talkonlineweb.result + * @ClassName: IResultConvert + * @Author: lqy + * @Description: 返回转换类 + * @Date: 2021-09-08 14:57 + * @Version: + */ + +public interface IResultConvert { + T convertToResult(V destModel); +} diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/result/PatientPcaseResult.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/result/PatientPcaseResult.java new file mode 100644 index 0000000..0ec1e66 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/result/PatientPcaseResult.java @@ -0,0 +1,51 @@ +package com.lyms.talkonlineweb.result; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.lyms.talkonlineweb.domain.LymsPcase; +import lombok.Data; + +import java.io.Serializable; + +/** + * @ProjectName: talkonline + * @Package: com.lyms.talkonlineweb.result + * @ClassName: PatientPcaseResult + * @Author: lqy + * @Description: 小程序患者就诊病历返回对象 + * @Date: 2021-09-08 14:55 + * @Version: + */ +@Data +public class PatientPcaseResult { + //患者id + private int pid; + //医院名称 + private String hname; + //医院id + private String hid; + //科室名称 + private String departName; + //医生名称 + private String doctorName; + //医生id; + private int dtid; + //医生环信id + private String dhxid; + //医生职位 + private String doctorLvl; + //患者姓名 + private String patientName; + //患者环信id + private String phxid; + //身份证号码 + private String cardNo; + //疾病名称 + private String iname; + //就诊时间 + private String createdby; + + //问诊卡数量 + private Integer ccnt; + + +} diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsAttentionService.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsAttentionService.java new file mode 100644 index 0000000..a14ab48 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsAttentionService.java @@ -0,0 +1,11 @@ +package com.lyms.talkonlineweb.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.lyms.talkonlineweb.domain.LymsAttention; + +/** + * + */ +public interface LymsAttentionService extends IService { + +} diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsOrderService.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsOrderService.java new file mode 100644 index 0000000..53c3ff6 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsOrderService.java @@ -0,0 +1,12 @@ +package com.lyms.talkonlineweb.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.lyms.talkonlineweb.domain.LymsAttention; +import com.lyms.talkonlineweb.domain.LymsOrder; + +/** + * + */ +public interface LymsOrderService extends IService { + +} diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsTkcardService.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsTkcardService.java new file mode 100644 index 0000000..c20e197 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsTkcardService.java @@ -0,0 +1,11 @@ +package com.lyms.talkonlineweb.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.lyms.talkonlineweb.domain.LymsTkrecord; + +/** + * + */ +public interface LymsTkcardService extends IService { + +} diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsAttentionServiceImpl.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsAttentionServiceImpl.java new file mode 100644 index 0000000..aedbd9e --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsAttentionServiceImpl.java @@ -0,0 +1,20 @@ +package com.lyms.talkonlineweb.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.lyms.talkonlineweb.domain.LymsAttention; +import com.lyms.talkonlineweb.mapper.LymsAttentionMapper; +import com.lyms.talkonlineweb.service.LymsAttentionService; +import org.springframework.stereotype.Service; + +/** + * + */ +@Service +public class LymsAttentionServiceImpl extends ServiceImpl + implements LymsAttentionService { + +} + + + + 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 new file mode 100644 index 0000000..ff0e679 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsOrderServiceImpl.java @@ -0,0 +1,23 @@ +package com.lyms.talkonlineweb.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.lyms.talkonlineweb.domain.LymsAttention; +import com.lyms.talkonlineweb.domain.LymsOrder; +import com.lyms.talkonlineweb.mapper.LymsAttentionMapper; +import com.lyms.talkonlineweb.mapper.LymsOrderMapper; +import com.lyms.talkonlineweb.service.LymsAttentionService; +import com.lyms.talkonlineweb.service.LymsOrderService; +import org.springframework.stereotype.Service; + +/** + * + */ +@Service +public class LymsOrderServiceImpl extends ServiceImpl + implements LymsOrderService { + +} + + + + diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsTkcardServiceImpl.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsTkcardServiceImpl.java new file mode 100644 index 0000000..ef4d531 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsTkcardServiceImpl.java @@ -0,0 +1,20 @@ +package com.lyms.talkonlineweb.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.lyms.talkonlineweb.domain.LymsTkrecord; +import com.lyms.talkonlineweb.mapper.LymsTkcardMapper; +import com.lyms.talkonlineweb.service.LymsTkcardService; +import org.springframework.stereotype.Service; + +/** + * + */ +@Service +public class LymsTkcardServiceImpl extends ServiceImpl + implements LymsTkcardService { + +} + + + + diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/util/DateUtil.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/util/DateUtil.java new file mode 100644 index 0000000..b9ddce0 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/util/DateUtil.java @@ -0,0 +1,73 @@ +package com.lyms.talkonlineweb.util; + +import lombok.extern.slf4j.Slf4j; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; + +/** + * @ProjectName: talkonline + * @Package: com.lyms.talkonlineweb.util + * @ClassName: DateUtil + * @Author: lqy + * @Description: 时间格式类 + * @Date: 2021-09-07 17:53 + * @Version: + */ +public class DateUtil { + /** + * 缓存时间格式化 + */ + private static ConcurrentHashMap dateFormatCache = new ConcurrentHashMap(); + private static Lock lock = new ReentrantLock(); + + public static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss"; + public static final String YYYY_MM_DD = "yyyy-MM-dd"; + /** + * 私有构造方法,禁止对该类进行实例化 + */ + private DateUtil() { + } + + public static String getYyyyMmDdHhMmSs(Date datetime) { + return getDateTime(datetime, YYYY_MM_DD_HH_MM_SS); + } + + public static String getDateTime(Date date, String pattern) { + if (date == null) { + return ""; + } + + DateFormat format = getDateFormat(pattern); + lock.lock(); + try { + return format.format(date); + } finally { + lock.unlock(); + } + } + + public static DateFormat getDateFormat(String pattern) { + if (StringUtil.isEmpty(pattern)) { + pattern = YYYY_MM_DD; + } + + if (dateFormatCache.get(pattern) != null) { + return dateFormatCache.get(pattern); + } + lock.lock(); + try { + DateFormat format = new SimpleDateFormat(pattern); + dateFormatCache.put(pattern, format); + return format; + } catch (Exception e) { + } finally { + lock.unlock(); + } + return null; + } +} diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/util/JsonUtil.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/util/JsonUtil.java new file mode 100644 index 0000000..921804b --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/util/JsonUtil.java @@ -0,0 +1,30 @@ +package com.lyms.talkonlineweb.util; + +import com.fasterxml.jackson.databind.ObjectMapper; + + +/** + * Created by Administrator on 2019-09-06. + */ +public class JsonUtil { + + + + /** + * 对象转换为String + * @param cls + * @return + */ + public static String obj2Str( + Object cls) { + try { + ObjectMapper objectMapper = new ObjectMapper(); + objectMapper.setDateFormat(DateUtil.getDateFormat(DateUtil.YYYY_MM_DD_HH_MM_SS)); + return objectMapper.writeValueAsString(cls); + } catch (Exception e) { + + } + return null; + } + +} diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/util/MD5Util.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/util/MD5Util.java new file mode 100644 index 0000000..1e70630 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/util/MD5Util.java @@ -0,0 +1,39 @@ +package com.lyms.talkonlineweb.util; + +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; + +/** + */ +public class MD5Util { + + /** + * md5加密 + * @param plainText + * @return + */ + public static String md5(String plainText) { + try { + if (plainText == null) { + return null; + } + MessageDigest md = MessageDigest.getInstance("MD5"); + md.update(plainText.getBytes()); + byte b[] = md.digest(); + int i; + StringBuffer buf = new StringBuffer(""); + for (int offset = 0; offset < b.length; offset++) { + i = b[offset]; + if (i < 0) + i += 256; + if (i < 16) + buf.append("0"); + buf.append(Integer.toHexString(i)); + } + return buf.toString().toUpperCase(); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + return null; + } + } +} diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/util/StringUtil.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/util/StringUtil.java new file mode 100644 index 0000000..d37ff83 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/util/StringUtil.java @@ -0,0 +1,42 @@ +package com.lyms.talkonlineweb.util; + +/** + * @ProjectName: talkonline + * @Package: com.lyms.talkonlineweb.util + * @ClassName: Stringutil + * @Author: lqy + * @Description: 字符串处理类 + * @Date: 2021-09-07 17:50 + * @Version: + */ + +public class StringUtil { + + public static boolean isEmpty(String str) { + if (str == null || "".equals(str)) { + return true; + } + return false; + } + + public static boolean isNotEmpty(String str) { + if (str != null && !"".equals(str)) { + return true; + } + return false; + } + + /** + * //+表示1个或多个(如"3"或"225"),*表示0个或多个([0-9]*)(如""或"1"或"22"), + * ?表示0个或1个([0-9]?)(如""或"7") + * + * @param str + * @return + */ + public static boolean isNum(String str) { + if (!isEmpty(str)) { + return str.matches("[0-9]+"); + } + return false; + } +}