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 0ccb31b..df8c258 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java @@ -28,7 +28,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import java.util.*; -import java.util.stream.Collectors; + /** * 患者管理 @@ -117,7 +117,7 @@ public class PatientController { .or().eq("idno", patientInfo.getSynthesisQuery())); } Page patientPagePage = patientInfoService.page(page, queryWrapper); - List pLst = patientInfoService.list(queryWrapper); + /* List pLst = patientInfoService.list(queryWrapper); int daiCnt = pLst.parallelStream().mapToInt(PatientInfo::getCcnt).sum();//待使用数量 List pids = pLst.parallelStream().map(PatientInfo::getId).collect(Collectors.toList()); @@ -130,7 +130,7 @@ public class PatientController { tWrapper.in("pid", pids); int sum = lymsTcardService.list(tWrapper).parallelStream().mapToInt(LymsTcard::getCnt).sum(); - log.info("统计需要改动数据结构:daiCnt:{} sum:{}", daiCnt, sum); + log.info("统计需要改动数据结构:daiCnt:{} sum:{}", daiCnt, sum);*/ baseResponse.setObject(patientPagePage); return baseResponse; @@ -147,11 +147,16 @@ public class PatientController { public BaseResponse savePatient(@Validated LymsPatient patient, BindingResult result, LymsPcase pcase, String illness) { BaseResponse baseResponse = new BaseResponse(); log.info(">>>>>>>>>>>>>>>登记病例"); - baseResponse.setErrormsg(""); + if(StringUtil.isEmpty(illness)){ + baseResponse.setErrorcode(1); + baseResponse.setErrormsg("请选择疾病名称"); + return baseResponse; + } + patient.setIdno(patient.getIdno().toLowerCase()); - LymsPatient tmpP=new LymsPatient(); + LymsPatient tmpP = new LymsPatient(); tmpP.setIdno(patient.getIdno().toLowerCase()); - LymsPatient patient2 = lymsPatientService.getOne(Wrappers.query(tmpP).eq("idno", patient.getIdno())); + LymsPatient patient2 = lymsPatientService.getOne(Wrappers.query(tmpP)); if (patient2 == null) { patient.setCreatedtime(new Date()); patient.setPpasswd(DigestUtils.md5DigestAsHex(Constant.COMMON_PASSWD.getBytes())); @@ -169,8 +174,11 @@ public class PatientController { for (LymsPcase lymsPcase : pcaseList) { QueryWrapper illnessQueryWrapper = new QueryWrapper<>(); illnessQueryWrapper.eq("pcid", lymsPcase.getPcid()); - List iids=Arrays.asList(illness.split(",")); - illnessQueryWrapper.in("iid", iids); + if(StringUtil.isNotEmpty(illness)){ + List iids=Arrays.asList(illness.split(",")); + illnessQueryWrapper.in("iid", iids); + } + illnessQueryWrapper.ge("createdtime", calendar.getTime()); int count = lymsIllnessService.count(illnessQueryWrapper); if (count != 0) { @@ -212,7 +220,7 @@ public class PatientController { pcase.setPid(patient.getId()); pcase.setCreatedtime(new Date()); f = lymsPcaseService.saveOrUpdate(pcase); - String[] iArr = illness.split(","); + log.info(patient); log.info(pcase); @@ -220,6 +228,8 @@ public class PatientController { Map param = new HashMap(); param.put("vtype",3); List dLst=lymsDictService.listByMap(param); + String[] iArr = illness.split(","); + for (int i = 0; i < iArr.length; i++) { LymsIllness ness = new LymsIllness(); ness.setCreatedby(patient.getCreatedby()); @@ -246,7 +256,7 @@ public class PatientController { Date instDate = new Date(); //需要添加医院购买卡记录 - for (int i = 0; i < patient.getCcnt() && Objects.nonNull(patient.getCcnt()); i++) { + for (int i = 0; i < patient.getCcnt(); i++) { LymsTcard tcard = new LymsTcard(); tcard.setCnt(1); tcard.setPcid(pcase.getPcid()); @@ -258,7 +268,7 @@ public class PatientController { lymsTcardService.saveOrUpdate(tcard); } baseResponse.setObject(patient); - baseResponse.setErrorcode(f == true ? 0 : 1); + baseResponse.setErrorcode(0); return baseResponse; } @@ -892,7 +902,7 @@ public class PatientController { /** * 选科室后查询出科室下有哪些疾病 - * @param 科室id + * @param did * @return */ @GetMapping("getDepartIllness") @@ -1025,7 +1035,7 @@ public class PatientController { /** * 小程序关注的患者列表 * - * @param patient + * @param patientAttention * @return */ @GetMapping("getPatientAttentionList") @@ -1321,4 +1331,28 @@ public class PatientController { return baseResponse; } + /** + * pc端获取用户信息,主要用于咨询页面获取用户头像 + * @param idno + * @return + */ + @GetMapping("getPatientByIdno/{idno}") + @TokenRequired + public BaseResponse getHeadImage(@PathVariable("idno") String idno) { + BaseResponse baseResponse = new BaseResponse(); + try { + QueryWrapper query=new QueryWrapper(); + query.eq("idno",idno); + LymsPatient lymsPatient = lymsPatientService.getOne(query); + baseResponse.setObject(lymsPatient); + baseResponse.setErrorcode(0); + baseResponse.setErrormsg("成功"); + } catch (Exception e) { + log.error("根据身份证号查询用户信息异常,idno={}",idno,e); + baseResponse.setErrorcode(1); + baseResponse.setErrormsg("未查询到用户信息"); + } + return baseResponse; + } + } diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PermissController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PermissController.java index 14cf4e1..fea2b09 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PermissController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PermissController.java @@ -82,7 +82,7 @@ public class PermissController { public BaseResponse getAllPerm(LymsPermission perm){ BaseResponse baseResponse=new BaseResponse(); - List perIPage=lymsPermissionService.list(Wrappers.query(perm).orderByDesc("updated_time","createdtime")); + List perIPage=lymsPermissionService.list(Wrappers.query(perm).orderByAsc("id")); baseResponse.setObject(perIPage); return baseResponse; diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsRoleMapper.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsRoleMapper.java index 8cc6719..8265131 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsRoleMapper.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsRoleMapper.java @@ -24,7 +24,7 @@ public interface LymsRoleMapper extends BaseMapper { @Insert("insert lyms_rolepermiss(rid,pid) values(#{rid},#{pid})") int addRoleByPerms(@Param("rid") int rid, @Param("pid") int pid); - @Select("SELECT * FROM lyms_rolepermiss rp,lyms_permission p WHERE p.`id`=rp.`pid` AND rp.`rid`= #{rid} ") + @Select("SELECT * FROM lyms_rolepermiss rp,lyms_permission p WHERE p.`id`=rp.`pid` AND rp.`rid`= #{rid} order by p.id ") List getPersByRid(@Param("rid") int rid); } diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/util/WeiXinUtil.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/util/WeiXinUtil.java index 6a0241f..7e67367 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/util/WeiXinUtil.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/util/WeiXinUtil.java @@ -43,7 +43,7 @@ public class WeiXinUtil { */ private static final String OPEN_ID_KEY = "openid"; /** - * 获取微信用户的openid + * 小程序获取openid方法 * * @param code 登录时获取的code * @return 微信方获取openid diff --git a/talkonlineweb/src/main/resources/logback-spring.xml b/talkonlineweb/src/main/resources/logback-spring.xml index 46228a1..adefeda 100644 --- a/talkonlineweb/src/main/resources/logback-spring.xml +++ b/talkonlineweb/src/main/resources/logback-spring.xml @@ -5,7 +5,7 @@ - + @@ -17,7 +17,7 @@ + pattern="[%d{yyyy-MM-dd HH:mm:ss.SSS}] %-5level %class{36} %L %M - %msg%xEx%n"/> @@ -33,7 +33,7 @@ + pattern="[%d{yyyy-MM-dd HH:mm:ss.SSS}] %-5level %class{36} %L %M - %msg%xEx%n"/> @@ -48,7 +48,7 @@ + pattern="[%d{yyyy-MM-dd HH:mm:ss.SSS}] %-5level %class{36} %L %M - %msg%xEx%n"/>