Commit d8676374f908a5714a2096d705f64bb573c53c9b
1 parent
cbc599dbf9
Exists in
master
and in
1 other branch
辅助建档分页
Showing 7 changed files with 129 additions and 4 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IPersonDao.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/PersonDaoImpl.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/MatDeliverService.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PersonService.java
- platform-dal/src/main/java/com/lyms/platform/pojo/MaternalDeliverModel.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RemoteController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IPersonDao.java
View file @
d867637
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/PersonDaoImpl.java
View file @
d867637
| 1 | 1 | package com.lyms.platform.biz.dal.impl; |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.biz.dal.IPersonDao; |
| 4 | -import com.lyms.platform.biz.dal.ISmsTemplateDao; | |
| 5 | 4 | import com.lyms.platform.common.dao.BaseMongoDAOImpl; |
| 6 | 5 | import com.lyms.platform.common.dao.operator.MongoCondition; |
| 7 | 6 | import com.lyms.platform.common.dao.operator.MongoOper; |
| 8 | 7 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 9 | 8 | import com.lyms.platform.pojo.PersonModel; |
| 10 | -import com.lyms.platform.pojo.SmsTemplateModel; | |
| 11 | 9 | import org.springframework.stereotype.Repository; |
| 12 | 10 | |
| 13 | 11 | import java.util.List; |
| ... | ... | @@ -28,6 +26,11 @@ |
| 28 | 26 | @Override |
| 29 | 27 | public List<PersonModel> queryPersons(MongoQuery mongoQuery) { |
| 30 | 28 | return find(mongoQuery.convertToMongoQuery()); |
| 29 | + } | |
| 30 | + | |
| 31 | + @Override | |
| 32 | + public int queryCount(MongoQuery query) { | |
| 33 | + return (int)count(query.convertToMongoQuery()); | |
| 31 | 34 | } |
| 32 | 35 | } |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/MatDeliverService.java
View file @
d867637
| ... | ... | @@ -40,6 +40,11 @@ |
| 40 | 40 | public List<MaternalDeliverModel> query(MatDeliverQuery deliverQuery){ |
| 41 | 41 | return iMatDeliverDao.queryWithList(deliverQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created")); |
| 42 | 42 | } |
| 43 | + | |
| 44 | + public List<MaternalDeliverModel> query(MatDeliverQuery deliverQuery,Sort.Direction sort,String field){ | |
| 45 | + return iMatDeliverDao.queryWithList(deliverQuery.convertToQuery().addOrder(sort, field)); | |
| 46 | + } | |
| 47 | + | |
| 43 | 48 | public void deleteOne(String id){ |
| 44 | 49 | iMatDeliverDao.deleteOne(id); |
| 45 | 50 | } |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PersonService.java
View file @
d867637
| ... | ... | @@ -2,8 +2,10 @@ |
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | import com.lyms.platform.biz.dal.IPersonDao; |
| 5 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
| 5 | 6 | import com.lyms.platform.pojo.PersonModel; |
| 6 | 7 | import com.lyms.platform.query.PersonModelQuery; |
| 8 | +import org.apache.commons.lang.StringUtils; | |
| 7 | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | 10 | import org.springframework.stereotype.Service; |
| 9 | 11 | |
| ... | ... | @@ -26,6 +28,13 @@ |
| 26 | 28 | |
| 27 | 29 | |
| 28 | 30 | public List<PersonModel> queryPersons(PersonModelQuery personModelQuery) { |
| 31 | + | |
| 32 | + MongoQuery query = personModelQuery.convertToQuery(); | |
| 33 | + if (StringUtils.isNotEmpty(personModelQuery.getNeed())) { | |
| 34 | + personModelQuery.mysqlBuild(personDao.queryCount(query)); | |
| 35 | + query.start(personModelQuery.getOffset()).end(personModelQuery.getLimit()); | |
| 36 | + } | |
| 37 | + | |
| 29 | 38 | return personDao.queryPersons(personModelQuery.convertToQuery()); |
| 30 | 39 | } |
| 31 | 40 | } |
platform-dal/src/main/java/com/lyms/platform/pojo/MaternalDeliverModel.java
View file @
d867637
| ... | ... | @@ -161,6 +161,26 @@ |
| 161 | 161 | */ |
| 162 | 162 | private Integer isClose; |
| 163 | 163 | |
| 164 | + private Integer fmAge; | |
| 165 | + | |
| 166 | + private List<Integer> fmChildTimes; | |
| 167 | + | |
| 168 | + public Integer getFmAge() { | |
| 169 | + return fmAge; | |
| 170 | + } | |
| 171 | + | |
| 172 | + public void setFmAge(Integer fmAge) { | |
| 173 | + this.fmAge = fmAge; | |
| 174 | + } | |
| 175 | + | |
| 176 | + public List<Integer> getFmChildTimes() { | |
| 177 | + return fmChildTimes; | |
| 178 | + } | |
| 179 | + | |
| 180 | + public void setFmChildTimes(List<Integer> fmChildTimes) { | |
| 181 | + this.fmChildTimes = fmChildTimes; | |
| 182 | + } | |
| 183 | + | |
| 164 | 184 | public String getFsHospital() { |
| 165 | 185 | return fsHospital; |
| 166 | 186 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RemoteController.java
View file @
d867637
| ... | ... | @@ -7,6 +7,7 @@ |
| 7 | 7 | import com.lyms.platform.common.base.LoginContext; |
| 8 | 8 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 9 | 9 | import com.lyms.platform.common.enums.YnEnums; |
| 10 | +import com.lyms.platform.common.result.BaseListResponse; | |
| 10 | 11 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 11 | 12 | import com.lyms.platform.common.result.BaseResponse; |
| 12 | 13 | import com.lyms.platform.common.result.RespBuilder; |
| ... | ... | @@ -141,7 +142,7 @@ |
| 141 | 142 | @RequestMapping(value = "/queryTodayArchiveList", method = RequestMethod.GET) |
| 142 | 143 | @ResponseBody |
| 143 | 144 | @TokenRequired |
| 144 | - public BaseObjectResponse queryTodayArchiveList(HttpServletRequest request, | |
| 145 | + public BaseListResponse queryTodayArchiveList(HttpServletRequest request, | |
| 145 | 146 | @RequestParam(required = false) Integer assistUserId, |
| 146 | 147 | @RequestParam(required = false) String created, |
| 147 | 148 | @RequestParam(required = false) Integer page, |
| ... | ... | @@ -192,7 +193,7 @@ |
| 192 | 193 | dataList.add(map); |
| 193 | 194 | } |
| 194 | 195 | } |
| 195 | - return new BaseObjectResponse().setData(dataList).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
| 196 | + return new BaseListResponse().setData(dataList).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setPageInfo(query.getPageInfo()); | |
| 196 | 197 | } |
| 197 | 198 | |
| 198 | 199 | @RequestMapping(value = "/bookArchive",method = RequestMethod.POST) |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
View file @
d867637
| ... | ... | @@ -1899,6 +1899,91 @@ |
| 1899 | 1899 | } |
| 1900 | 1900 | return "handleSieveTime ....."; |
| 1901 | 1901 | } |
| 1902 | + @RequestMapping(value="/handleChildbearAgeData") | |
| 1903 | + @ResponseBody | |
| 1904 | + public String handleChildbearAgeData(@RequestParam(required = false)final String id) { | |
| 1905 | + | |
| 1906 | + new Thread(new Runnable() { | |
| 1907 | + @Override | |
| 1908 | + public void run() { | |
| 1909 | + int limt = 1000; | |
| 1910 | + int page = 0; | |
| 1911 | + PersonModelQuery personModelQuery = new PersonModelQuery(); | |
| 1912 | + personModelQuery.setYn(YnEnums.YES.getId()); | |
| 1913 | + personModelQuery.setTypes(new Integer[]{1, 3}); //孕妇或者产妇基本信息 | |
| 1914 | + personModelQuery.setNeed("true"); | |
| 1915 | + if (StringUtils.isNotEmpty(id)) | |
| 1916 | + { | |
| 1917 | + personModelQuery.setId(id); | |
| 1918 | + } | |
| 1919 | + while (true) | |
| 1920 | + { | |
| 1921 | + personModelQuery.setPage(page); | |
| 1922 | + personModelQuery.setLimit(limt); | |
| 1923 | + List<PersonModel> personModels = personService.queryPersons(personModelQuery); | |
| 1924 | + if (CollectionUtils.isNotEmpty(personModels)) | |
| 1925 | + { | |
| 1926 | + int batchSize = 200; | |
| 1927 | + int end = 0; | |
| 1928 | + for (int i = 0; i < personModels.size(); i += batchSize) { | |
| 1929 | + end = (end + batchSize); | |
| 1930 | + if (end > personModels.size()) { | |
| 1931 | + end = personModels.size(); | |
| 1932 | + } | |
| 1933 | + System.out.println("start:" + i + ",end:" + end); | |
| 1934 | + final List<PersonModel> tempList = personModels.subList(i, end); | |
| 1935 | + commonThreadPool.execute(new Runnable() { | |
| 1936 | + @Override | |
| 1937 | + public void run() { | |
| 1938 | + if (CollectionUtils.isNotEmpty(tempList)) { | |
| 1939 | + for (PersonModel person : tempList) { | |
| 1940 | + MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); | |
| 1941 | + matDeliverQuery.setYn(YnEnums.YES.getId()); | |
| 1942 | + matDeliverQuery.setPid(person.getId()); | |
| 1943 | + List<MaternalDeliverModel> maternalDeliverModels = matDeliverService.query(matDeliverQuery,Sort.Direction.ASC,"created"); | |
| 1944 | + if (CollectionUtils.isNotEmpty(maternalDeliverModels)) | |
| 1945 | + { | |
| 1946 | + int upCount = 0; | |
| 1947 | + for(int i = 0 ; i < maternalDeliverModels.size() ; i++) | |
| 1948 | + { | |
| 1949 | + MaternalDeliverModel model = maternalDeliverModels.get(i); | |
| 1950 | + List<MaternalDeliverModel.Baby> babyList = model.getBaby(); | |
| 1951 | + | |
| 1952 | + List<Integer> fmChildTimes = new ArrayList<Integer>(); | |
| 1953 | + if (CollectionUtils.isNotEmpty(babyList)) | |
| 1954 | + { | |
| 1955 | + for (int j = 0;j < babyList.size();j++) | |
| 1956 | + { | |
| 1957 | + upCount+=1; | |
| 1958 | + fmChildTimes.add(upCount); | |
| 1959 | + model.setFmChildTimes(fmChildTimes); | |
| 1960 | + } | |
| 1961 | + Patients patients = patientsService.findOnePatientById(model.getParentId()); | |
| 1962 | + if (patients != null) | |
| 1963 | + { | |
| 1964 | + model.setFmAge(DateUtil.getAge(patients.getBirth(),model.getDueDate1())); | |
| 1965 | + } | |
| 1966 | + } | |
| 1967 | + matDeliverService.updateOne(model,model.getId()); | |
| 1968 | + } | |
| 1969 | + } | |
| 1970 | + } | |
| 1971 | + } | |
| 1972 | + } | |
| 1973 | + }); | |
| 1974 | + } | |
| 1975 | + } | |
| 1976 | + else | |
| 1977 | + { | |
| 1978 | + break; | |
| 1979 | + } | |
| 1980 | + page++; | |
| 1981 | + } | |
| 1982 | + } | |
| 1983 | + }).start(); | |
| 1984 | + | |
| 1985 | + return "handleChildbearAgeData........"; | |
| 1986 | + } | |
| 1902 | 1987 | |
| 1903 | 1988 | // @RequestMapping(value="/his/getLcdcfyByZyhHis") |
| 1904 | 1989 | // @ResponseBody |