Commit 34f3c726275544aa0c0e6621bcbb3b16d4c30522

Authored by liquanyu
1 parent 973e2e8a9d

德州产检管理添加处理意见查询历史数据处理

Showing 3 changed files with 138 additions and 0 deletions

platform-dal/src/main/java/com/lyms/platform/query/AntExChuQuery.java View file @ 34f3c72
... ... @@ -37,6 +37,16 @@
37 37 // 其他高危
38 38 private String otherHighRisk;
39 39  
  40 + private boolean isOpinion;
  41 +
  42 + public boolean isOpinion() {
  43 + return isOpinion;
  44 + }
  45 +
  46 + public void setIsOpinion(boolean isOpinion) {
  47 + this.isOpinion = isOpinion;
  48 + }
  49 +
40 50 public String getCheckDoctor() {
41 51 return checkDoctor;
42 52 }
... ... @@ -188,6 +198,11 @@
188 198 if (null != otherHighRisk) {
189 199 condition = condition.and("otherHighRisk", otherHighRisk, MongoOper.NE);
190 200 }
  201 +
  202 + if (isOpinion) {
  203 + condition = condition.and("treatOpinion", true, MongoOper.EXISTS);
  204 + }
  205 +
191 206 if(CollectionUtils.isNotEmpty(parentIds)){
192 207 condition = condition.and("parentId", parentIds, MongoOper.IN);
193 208 }
platform-dal/src/main/java/com/lyms/platform/query/AntExQuery.java View file @ 34f3c72
... ... @@ -40,6 +40,16 @@
40 40 //其他高危
41 41 private String otherRisk;
42 42  
  43 + private boolean isOpinion;
  44 +
  45 + public boolean isOpinion() {
  46 + return isOpinion;
  47 + }
  48 +
  49 + public void setIsOpinion(boolean isOpinion) {
  50 + this.isOpinion = isOpinion;
  51 + }
  52 +
43 53 public String getOtherRisk() {
44 54 return otherRisk;
45 55 }
... ... @@ -156,6 +166,9 @@
156 166 condition= condition.and("checkDoctor",checkDoctor, MongoOper.IS);
157 167 }
158 168  
  169 + if (isOpinion) {
  170 + condition = condition.and("treatOpinion", true, MongoOper.EXISTS);
  171 + }
159 172  
160 173 boolean isAddStart = Boolean.FALSE;
161 174 Criteria c = null;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java View file @ 34f3c72
... ... @@ -1655,6 +1655,116 @@
1655 1655 return "upateNewHighRisk finish";
1656 1656 }
1657 1657  
  1658 +
  1659 +
  1660 + @RequestMapping(value = "/updateRecordOpinion", method = RequestMethod.GET)
  1661 + @ResponseBody
  1662 + public String updateRecordOpinion(@RequestParam(required = false) String hospitalId, @RequestParam(required = false) String cid
  1663 + , @RequestParam(required = false) String fid) {
  1664 +
  1665 +
  1666 + AntExChuQuery antExChuQuery = new AntExChuQuery();
  1667 + antExChuQuery.setIsOpinion(true);
  1668 + if (StringUtils.isNotEmpty(hospitalId)) {
  1669 +
  1670 + antExChuQuery.setHospitalId(hospitalId);
  1671 + }
  1672 + if (StringUtils.isNotEmpty(cid))
  1673 + {
  1674 + antExChuQuery.setId(cid);
  1675 + }
  1676 +
  1677 + List<AntExChuModel> antExChuModelList = antenatalExaminationService.queryAntExChu(antExChuQuery);
  1678 +
  1679 + if (CollectionUtils.isNotEmpty(antExChuModelList)) {
  1680 + int batchSize = 100;
  1681 + int end = 0;
  1682 + for (int i = 0; i < antExChuModelList.size(); i += batchSize) {
  1683 + end = (end + batchSize);
  1684 + if (end > antExChuModelList.size()) {
  1685 + end = antExChuModelList.size();
  1686 + }
  1687 + System.out.println("start:" + i + ",end:" + end);
  1688 + final List<AntExChuModel> tempList = antExChuModelList.subList(i, end);
  1689 + commonThreadPool.execute(new Runnable() {
  1690 + @Override
  1691 + public void run() {
  1692 + if (CollectionUtils.isNotEmpty(tempList)) {
  1693 + for (AntExChuModel chuModel : tempList) {
  1694 +
  1695 + AntExRecordQuery pageAntExRecordsQuery = new AntExRecordQuery();
  1696 + pageAntExRecordsQuery.setfId(chuModel.getId());
  1697 + List<AntExRecordModel> recordModels = recordService.queryAntExRecords(pageAntExRecordsQuery);
  1698 + if (CollectionUtils.isNotEmpty(recordModels))
  1699 + {
  1700 + if (StringUtils.isNotEmpty(chuModel.getTreatOpinion()))
  1701 + {
  1702 + System.out.println("chuId=" + chuModel.getId()+";chuModel.getTreatOpinion()");
  1703 + AntExRecordModel recordModel = recordModels.get(0);
  1704 + recordModel.setTreatOpinion(chuModel.getTreatOpinion());
  1705 + recordService.updateOne(recordModel,recordModel.getId());
  1706 + }
  1707 + }
  1708 + }
  1709 + }
  1710 + }
  1711 + });
  1712 + }
  1713 + }
  1714 +
  1715 + // 查询复诊
  1716 + AntExQuery antExQuery = new AntExQuery();
  1717 + antExQuery.setIsOpinion(true);
  1718 + if (StringUtils.isNotEmpty(hospitalId)) {
  1719 +
  1720 + antExQuery.setHospitalId(hospitalId);
  1721 + }
  1722 + if (StringUtils.isNotEmpty(cid))
  1723 + {
  1724 + antExQuery.setId(cid);
  1725 + }
  1726 +
  1727 + List<AntenatalExaminationModel> antenatalExaminationModelList = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery());
  1728 + if (CollectionUtils.isNotEmpty(antenatalExaminationModelList)) {
  1729 + int batchSize = 100;
  1730 + int end = 0;
  1731 + for (int i = 0; i < antenatalExaminationModelList.size(); i += batchSize) {
  1732 + end = (end + batchSize);
  1733 + if (end > antenatalExaminationModelList.size()) {
  1734 + end = antenatalExaminationModelList.size();
  1735 + }
  1736 + System.out.println("fstart:" + i + ",fend:" + end);
  1737 + final List<AntenatalExaminationModel> tempList = antenatalExaminationModelList.subList(i, end);
  1738 + commonThreadPool.execute(new Runnable() {
  1739 + @Override
  1740 + public void run() {
  1741 + if (CollectionUtils.isNotEmpty(tempList)) {
  1742 + for (AntenatalExaminationModel fuModel : tempList) {
  1743 +
  1744 + AntExRecordQuery pageAntExRecordsQuery = new AntExRecordQuery();
  1745 + pageAntExRecordsQuery.setfId(fuModel.getId());
  1746 + List<AntExRecordModel> recordModels = recordService.queryAntExRecords(pageAntExRecordsQuery);
  1747 + if (CollectionUtils.isNotEmpty(recordModels))
  1748 + {
  1749 + if (StringUtils.isNotEmpty(fuModel.getTreatmentOpinion()))
  1750 + {
  1751 + System.out.println("fId=" + fuModel.getId()+";chuModel.getTreatOpinion()");
  1752 + AntExRecordModel recordModel = recordModels.get(0);
  1753 + recordModel.setTreatOpinion(fuModel.getTreatmentOpinion());
  1754 + recordService.updateOne(recordModel,recordModel.getId());
  1755 + }
  1756 + }
  1757 + }
  1758 + }
  1759 + }
  1760 + });
  1761 + }
  1762 + }
  1763 +
  1764 + return "updateRecordOpinion finish";
  1765 + }
  1766 +
  1767 +
1658 1768 @Autowired
1659 1769 private CommonService commonService;
1660 1770 @Autowired