Commit c682c7161662b85baabc38915e36682f7bf1317e

Authored by liquanyu
1 parent 0a2ea33824

update code

Showing 3 changed files with 83 additions and 2 deletions

platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/LisServiceImpl.java View file @ c682c71
... ... @@ -13,6 +13,8 @@
13 13 import org.apache.commons.collections.CollectionUtils;
14 14 import org.codehaus.jackson.type.TypeReference;
15 15 import org.springframework.beans.factory.annotation.Autowired;
  16 +import org.springframework.beans.factory.annotation.Qualifier;
  17 +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
16 18 import org.springframework.stereotype.Service;
17 19  
18 20 import java.util.ArrayList;
... ... @@ -25,6 +27,11 @@
25 27 public class LisServiceImpl implements LisService {
26 28  
27 29 @Autowired
  30 + @Qualifier("commonThreadPool")
  31 + private ThreadPoolTaskExecutor commonThreadPool;
  32 +
  33 +
  34 + @Autowired
28 35 private MasterLisMapper masterLisMapper;
29 36  
30 37 @Override
... ... @@ -45,7 +52,8 @@
45 52 end = lisList.size();
46 53 }
47 54 List<LisReportModel> models = lisList.subList(i, end);
48   - new Thread(new LisSaveTask(countDownLatch,masterLisMapper,models)).start();
  55 +// new Thread(new LisSaveTask(countDownLatch,masterLisMapper,models)).start();
  56 + commonThreadPool.execute(new LisSaveTask(countDownLatch,masterLisMapper,models));
49 57 }
50 58 countDownLatch.await();
51 59 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java View file @ c682c71
... ... @@ -858,6 +858,8 @@
858 858 List<String> hList = groupsFacade.findGroupHospital(userId, false);
859 859 babyQuery.setHospitalIdList(hList);
860 860  
  861 + Map<String,List<BabyChooseResult>> listMap = new HashMap<>();
  862 +
861 863 List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyQuery);
862 864  
863 865 if (CollectionUtils.isEmpty(models) && StringUtils.isNotEmpty(vcCardNo))
... ... @@ -879,6 +881,9 @@
879 881  
880 882 if (CollectionUtils.isNotEmpty(models))
881 883 {
  884 +
  885 +
  886 +
882 887 for (BabyModel model : models) {
883 888 if (model != null && model.getHospitalId() != null && hList.contains(hospitalId)) {
884 889 isBuild = true;
885 890  
886 891  
... ... @@ -890,11 +895,61 @@
890 895 result.setGender(SexEnum.getTextById(model.getSex()));
891 896 result.setName(model.getName());
892 897 result.setBirth(DateUtil.getyyyy_MM_dd(model.getBirth()));
893   - results.add(result);
  898 + result.setHospitalId(model.getHospitalId());
  899 + String hospital = "";
  900 + if (org.apache.commons.lang.StringUtils.isNotEmpty(model.getHospitalId())) {
  901 + Organization organization = organizationService.getOrganization(Integer.parseInt(model.getHospitalId()));
  902 + if (organization != null && organization.getYn() == YnEnums.YES.getId()) {
  903 + hospital = organization.getName();
  904 + }
  905 + }
  906 + result.setHospitalName(hospital);
  907 +
  908 + List<BabyChooseResult> list = new ArrayList<>();
  909 + if (listMap.get(model.getPid()) != null)
  910 + {
  911 + list = listMap.get(model.getPid());
  912 + list.add(result);
  913 + }
  914 + else
  915 + {
  916 + list.add(result);
  917 + }
  918 + listMap.put(model.getPid(),list);
  919 +
  920 +// results.add(result);
894 921 }
895 922 }
896 923  
  924 +
  925 + if (listMap != null)
  926 + {
  927 + for (String pid : listMap.keySet())
  928 + {
  929 + List<BabyChooseResult> currentBuildRecord = new ArrayList<>();
  930 +
  931 + List<BabyChooseResult> list = listMap.get(pid);
  932 + for(BabyChooseResult baby : list)
  933 + {
  934 + if (StringUtils.isNotEmpty(hospitalId) && hospitalId.equals(baby.getHospitalId()))
  935 + {
  936 + currentBuildRecord.add(baby);
  937 + break;
  938 + }
  939 + }
  940 + if (CollectionUtils.isNotEmpty(currentBuildRecord))
  941 + {
  942 + results.addAll(currentBuildRecord);
  943 + }
  944 + else
  945 + {
  946 + results.addAll(list);
  947 + }
  948 + }
  949 +
  950 + }
897 951 }
  952 +
898 953 map.put("isBuild", isBuild);
899 954 map.put("boies", results);
900 955 br.setData(map);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyChooseResult.java View file @ c682c71
... ... @@ -10,6 +10,24 @@
10 10 private String gender;
11 11 private String monthAge;
12 12 private String pid;
  13 + private String hospitalId;
  14 + private String hospitalName;
  15 +
  16 + public String getHospitalName() {
  17 + return hospitalName;
  18 + }
  19 +
  20 + public void setHospitalName(String hospitalName) {
  21 + this.hospitalName = hospitalName;
  22 + }
  23 +
  24 + public String getHospitalId() {
  25 + return hospitalId;
  26 + }
  27 +
  28 + public void setHospitalId(String hospitalId) {
  29 + this.hospitalId = hospitalId;
  30 + }
13 31  
14 32 public String getPid() {
15 33 return pid;