Commit e8fba38325429051bd1f08f3fa9294af6a195a1a

Authored by cfl
1 parent 1a76459e6c
Exists in master and in 1 other branch dev

部分优化

Showing 5 changed files with 54 additions and 20 deletions

talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java View file @ e8fba38
... ... @@ -28,8 +28,8 @@
28 28 import org.springframework.web.bind.annotation.*;
29 29  
30 30 import java.util.*;
31   -import java.util.stream.Collectors;
32 31  
  32 +
33 33 /**
34 34 * 患者管理
35 35 */
... ... @@ -117,7 +117,7 @@
117 117 .or().eq("idno", patientInfo.getSynthesisQuery()));
118 118 }
119 119 Page<PatientInfo> patientPagePage = patientInfoService.page(page, queryWrapper);
120   - List<PatientInfo> pLst = patientInfoService.list(queryWrapper);
  120 + /* List<PatientInfo> pLst = patientInfoService.list(queryWrapper);
121 121 int daiCnt = pLst.parallelStream().mapToInt(PatientInfo::getCcnt).sum();//待使用数量
122 122  
123 123 List<Integer> pids = pLst.parallelStream().map(PatientInfo::getId).collect(Collectors.toList());
... ... @@ -130,7 +130,7 @@
130 130 tWrapper.in("pid", pids);
131 131 int sum = lymsTcardService.list(tWrapper).parallelStream().mapToInt(LymsTcard::getCnt).sum();
132 132  
133   - log.info("统计需要改动数据结构:daiCnt:{} sum:{}", daiCnt, sum);
  133 + log.info("统计需要改动数据结构:daiCnt:{} sum:{}", daiCnt, sum);*/
134 134 baseResponse.setObject(patientPagePage);
135 135  
136 136 return baseResponse;
137 137  
138 138  
... ... @@ -147,11 +147,16 @@
147 147 public BaseResponse savePatient(@Validated LymsPatient patient, BindingResult result, LymsPcase pcase, String illness) {
148 148 BaseResponse baseResponse = new BaseResponse();
149 149 log.info(">>>>>>>>>>>>>>>登记病例");
150   - baseResponse.setErrormsg("");
  150 + if(StringUtil.isEmpty(illness)){
  151 + baseResponse.setErrorcode(1);
  152 + baseResponse.setErrormsg("请选择疾病名称");
  153 + return baseResponse;
  154 + }
  155 +
151 156 patient.setIdno(patient.getIdno().toLowerCase());
152   - LymsPatient tmpP=new LymsPatient();
  157 + LymsPatient tmpP = new LymsPatient();
153 158 tmpP.setIdno(patient.getIdno().toLowerCase());
154   - LymsPatient patient2 = lymsPatientService.getOne(Wrappers.query(tmpP).eq("idno", patient.getIdno()));
  159 + LymsPatient patient2 = lymsPatientService.getOne(Wrappers.query(tmpP));
155 160 if (patient2 == null) {
156 161 patient.setCreatedtime(new Date());
157 162 patient.setPpasswd(DigestUtils.md5DigestAsHex(Constant.COMMON_PASSWD.getBytes()));
... ... @@ -169,8 +174,11 @@
169 174 for (LymsPcase lymsPcase : pcaseList) {
170 175 QueryWrapper<LymsIllness> illnessQueryWrapper = new QueryWrapper<>();
171 176 illnessQueryWrapper.eq("pcid", lymsPcase.getPcid());
172   - List<String> iids=Arrays.asList(illness.split(","));
173   - illnessQueryWrapper.in("iid", iids);
  177 + if(StringUtil.isNotEmpty(illness)){
  178 + List<String> iids=Arrays.asList(illness.split(","));
  179 + illnessQueryWrapper.in("iid", iids);
  180 + }
  181 +
174 182 illnessQueryWrapper.ge("createdtime", calendar.getTime());
175 183 int count = lymsIllnessService.count(illnessQueryWrapper);
176 184 if (count != 0) {
177 185  
178 186  
... ... @@ -212,14 +220,16 @@
212 220 pcase.setPid(patient.getId());
213 221 pcase.setCreatedtime(new Date());
214 222 f = lymsPcaseService.saveOrUpdate(pcase);
215   - String[] iArr = illness.split(",");
216 223  
  224 +
217 225 log.info(patient);
218 226 log.info(pcase);
219 227  
220 228 Map param = new HashMap();
221 229 param.put("vtype",3);
222 230 List<LymsDict> dLst=lymsDictService.listByMap(param);
  231 + String[] iArr = illness.split(",");
  232 +
223 233 for (int i = 0; i < iArr.length; i++) {
224 234 LymsIllness ness = new LymsIllness();
225 235 ness.setCreatedby(patient.getCreatedby());
... ... @@ -246,7 +256,7 @@
246 256  
247 257 Date instDate = new Date();
248 258 //需要添加医院购买卡记录
249   - for (int i = 0; i < patient.getCcnt() && Objects.nonNull(patient.getCcnt()); i++) {
  259 + for (int i = 0; i < patient.getCcnt(); i++) {
250 260 LymsTcard tcard = new LymsTcard();
251 261 tcard.setCnt(1);
252 262 tcard.setPcid(pcase.getPcid());
... ... @@ -258,7 +268,7 @@
258 268 lymsTcardService.saveOrUpdate(tcard);
259 269 }
260 270 baseResponse.setObject(patient);
261   - baseResponse.setErrorcode(f == true ? 0 : 1);
  271 + baseResponse.setErrorcode(0);
262 272 return baseResponse;
263 273 }
264 274  
... ... @@ -892,7 +902,7 @@
892 902  
893 903 /**
894 904 * 选科室后查询出科室下有哪些疾病
895   - * @param 科室id
  905 + * @param did
896 906 * @return
897 907 */
898 908 @GetMapping("getDepartIllness")
... ... @@ -1025,7 +1035,7 @@
1025 1035 /**
1026 1036 * 小程序关注的患者列表
1027 1037 *
1028   - * @param patient
  1038 + * @param patientAttention
1029 1039 * @return
1030 1040 */
1031 1041 @GetMapping("getPatientAttentionList")
... ... @@ -1317,6 +1327,30 @@
1317 1327 baseResponse.setErrorcode(1);
1318 1328 baseResponse.setErrormsg("系统异常");
1319 1329 e.printStackTrace();
  1330 + }
  1331 + return baseResponse;
  1332 + }
  1333 +
  1334 + /**
  1335 + * pc端获取用户信息,主要用于咨询页面获取用户头像
  1336 + * @param idno
  1337 + * @return
  1338 + */
  1339 + @GetMapping("getPatientByIdno/{idno}")
  1340 + @TokenRequired
  1341 + public BaseResponse getHeadImage(@PathVariable("idno") String idno) {
  1342 + BaseResponse baseResponse = new BaseResponse();
  1343 + try {
  1344 + QueryWrapper<LymsPatient> query=new QueryWrapper();
  1345 + query.eq("idno",idno);
  1346 + LymsPatient lymsPatient = lymsPatientService.getOne(query);
  1347 + baseResponse.setObject(lymsPatient);
  1348 + baseResponse.setErrorcode(0);
  1349 + baseResponse.setErrormsg("成功");
  1350 + } catch (Exception e) {
  1351 + log.error("根据身份证号查询用户信息异常,idno={}",idno,e);
  1352 + baseResponse.setErrorcode(1);
  1353 + baseResponse.setErrormsg("未查询到用户信息");
1320 1354 }
1321 1355 return baseResponse;
1322 1356 }
talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PermissController.java View file @ e8fba38
... ... @@ -82,7 +82,7 @@
82 82 public BaseResponse getAllPerm(LymsPermission perm){
83 83 BaseResponse baseResponse=new BaseResponse();
84 84  
85   - List<LymsPermission> perIPage=lymsPermissionService.list(Wrappers.query(perm).orderByDesc("updated_time","createdtime"));
  85 + List<LymsPermission> perIPage=lymsPermissionService.list(Wrappers.query(perm).orderByAsc("id"));
86 86 baseResponse.setObject(perIPage);
87 87  
88 88 return baseResponse;
talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsRoleMapper.java View file @ e8fba38
... ... @@ -24,7 +24,7 @@
24 24 @Insert("insert lyms_rolepermiss(rid,pid) values(#{rid},#{pid})")
25 25 int addRoleByPerms(@Param("rid") int rid, @Param("pid") int pid);
26 26  
27   - @Select("SELECT * FROM lyms_rolepermiss rp,lyms_permission p WHERE p.`id`=rp.`pid` AND rp.`rid`= #{rid} ")
  27 + @Select("SELECT * FROM lyms_rolepermiss rp,lyms_permission p WHERE p.`id`=rp.`pid` AND rp.`rid`= #{rid} order by p.id ")
28 28 List<LymsPermission> getPersByRid(@Param("rid") int rid);
29 29 }
talkonlineweb/src/main/java/com/lyms/talkonlineweb/util/WeiXinUtil.java View file @ e8fba38
... ... @@ -43,7 +43,7 @@
43 43 */
44 44 private static final String OPEN_ID_KEY = "openid";
45 45 /**
46   - * 获取微信用户的openid
  46 + * 小程序获取openid方法
47 47 *
48 48 * @param code 登录时获取的code
49 49 * @return 微信方获取openid
talkonlineweb/src/main/resources/logback-spring.xml View file @ e8fba38
... ... @@ -5,7 +5,7 @@
5 5 <Console name="Console" target="SYSTEM_OUT">
6 6 <!--只接受程序中DEBUG级别的日志进行处理-->
7 7 <ThresholdFilter level="DEBUG" onMatch="ACCEPT" onMismatch="DENY"/>
8   - <PatternLayout pattern="[%d{HH:mm:ss.SSS}] %-5level %class{36} %L %M - %msg%xEx%n"/>
  8 + <PatternLayout pattern="[%d{yyyy-MM-dd HH:mm:ss.SSS}] %-5level %class{36} %L %M - %msg%xEx%n"/>
9 9 </Console>
10 10  
11 11 <!--处理DEBUG级别的日志,并把该日志放到logs/debug.log文件中-->
... ... @@ -17,7 +17,7 @@
17 17 <ThresholdFilter level="INFO" onMatch="DENY" onMismatch="NEUTRAL"/>
18 18 </Filters>
19 19 <PatternLayout
20   - pattern="[%d{yyyy-MM-dd HH:mm:ss}] %-5level %class{36} %L %M - %msg%xEx%n"/>
  20 + pattern="[%d{yyyy-MM-dd HH:mm:ss.SSS}] %-5level %class{36} %L %M - %msg%xEx%n"/>
21 21 <Policies>
22 22 <SizeBasedTriggeringPolicy size="500 MB"/>
23 23 <TimeBasedTriggeringPolicy/>
... ... @@ -33,7 +33,7 @@
33 33 <ThresholdFilter level="WARN" onMatch="DENY" onMismatch="NEUTRAL"/>
34 34 </Filters>
35 35 <PatternLayout
36   - pattern="[%d{yyyy-MM-dd HH:mm:ss}] %-5level %class{36} %L %M - %msg%xEx%n"/>
  36 + pattern="[%d{yyyy-MM-dd HH:mm:ss.SSS}] %-5level %class{36} %L %M - %msg%xEx%n"/>
37 37 <Policies>
38 38 <SizeBasedTriggeringPolicy size="500 MB"/>
39 39 <TimeBasedTriggeringPolicy/>
... ... @@ -48,7 +48,7 @@
48 48 <ThresholdFilter level="ERROR" onMatch="DENY" onMismatch="NEUTRAL"/>
49 49 </Filters>
50 50 <PatternLayout
51   - pattern="[%d{yyyy-MM-dd HH:mm:ss}] %-5level %class{36} %L %M - %msg%xEx%n"/>
  51 + pattern="[%d{yyyy-MM-dd HH:mm:ss.SSS}] %-5level %class{36} %L %M - %msg%xEx%n"/>
52 52 <Policies>
53 53 <SizeBasedTriggeringPolicy size="500 MB"/>
54 54 <TimeBasedTriggeringPolicy/>