Commit 023a8f7c7fc3e741d9647f8e5bc2892929501d43

Authored by [wangbo]
1 parent f8f06ffd0a

孕妇追访预约追访时间冗余

Showing 5 changed files with 70 additions and 5 deletions

platform-dal/src/main/java/com/lyms/platform/pojo/ResidentsArchiveModel.java View file @ 023a8f7
... ... @@ -118,7 +118,7 @@
118 118 private Integer yn;
119 119  
120 120 private String publishId;
121   -
  121 + /*****冗余字段*****/
122 122 private String publishName;
123 123 //是否婚检 0 未婚检 1. 已婚检
124 124 private String checkup;
125 125  
... ... @@ -126,7 +126,12 @@
126 126 //是否怀孕建档 0 否 1 是
127 127 private String pregnantBuild;
128 128  
  129 + //追访预约时间
  130 + private Date followupTime;
129 131  
  132 + //是否终止流程 0 正常流程 1 终止流程
  133 + private String stop;
  134 +
130 135 /***********荣成新增男性建档字段**********/
131 136 private String isOrNotrdl;//是否进食肉、蛋类(0:否;1:是;默认为1)
132 137 private String isOrNotSc;//是否厌食蔬菜(0:否;1:是;默认为0)
... ... @@ -164,6 +169,22 @@
164 169 private String znstzk;//子女身体状况(0:健康;1:疾病)
165 170 private String jtbm;//注明具体病名
166 171  
  172 +
  173 + public String getStop() {
  174 + return stop;
  175 + }
  176 +
  177 + public void setStop(String stop) {
  178 + this.stop = stop;
  179 + }
  180 +
  181 + public Date getFollowupTime() {
  182 + return followupTime;
  183 + }
  184 +
  185 + public void setFollowupTime(Date followupTime) {
  186 + this.followupTime = followupTime;
  187 + }
167 188  
168 189 public String getCheckup() {
169 190 return checkup;
platform-dal/src/main/java/com/lyms/platform/query/ResidentsArchiveQuery.java View file @ 023a8f7
... ... @@ -124,7 +124,18 @@
124 124 //是否怀孕建档 0 否 1 是
125 125 private String pregnantBuild;
126 126  
  127 + //追访状态 0 正常 1. 待追访 2.已终止
  128 + private Integer followupStatus;
127 129  
  130 +
  131 + public Integer getFollowupStatus() {
  132 + return followupStatus;
  133 + }
  134 +
  135 + public void setFollowupStatus(Integer followupStatus) {
  136 + this.followupStatus = followupStatus;
  137 + }
  138 +
128 139 public String getPregnantBuild() {
129 140 return pregnantBuild;
130 141 }
... ... @@ -162,6 +173,17 @@
162 173 if (StringUtils.isNotEmpty(pregnantBuild)) {
163 174 condition = condition.and("pregnantBuild", pregnantBuild, MongoOper.IS);
164 175 }
  176 + if (null != followupStatus) {
  177 + if (followupStatus == 1) {
  178 + condition = condition.and("followupTime", new Date(), MongoOper.LTE);
  179 + } else if (followupStatus == 2) {
  180 + condition = condition.and("followupTime", new Date(), MongoOper.GTE);
  181 + } else if (followupStatus == 3) {
  182 + condition = condition.and("stop", "1", MongoOper.IS);
  183 + }
  184 + }
  185 +
  186 +
165 187 if (StringUtils.isNotBlank(username)) {
166 188 condition = condition.and("username", username, MongoOper.LIKE);
167 189 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TrackDownController.java View file @ 023a8f7
... ... @@ -86,9 +86,9 @@
86 86 @RequestMapping(value = "/all", method = RequestMethod.GET)
87 87 public BaseResponse all(Date buildStart, Date buildEnd, Date checkStart, Date checkEnd, Date fmStart, Date fmEnd, String key, Integer type,
88 88 @RequestParam Integer page, @RequestParam Integer limit, HttpServletRequest request,
89   - Integer check, String checkup, String pregnantBuild) {
  89 + Integer check, String checkup, String pregnantBuild, Integer followupStatus) {
90 90 return trackDownService.all(buildStart, buildEnd, checkStart, checkEnd, fmStart, fmEnd, key,
91   - page, limit, getUserId(request), type, check, checkup, pregnantBuild);
  91 + page, limit, getUserId(request), type, check, checkup, pregnantBuild, followupStatus);
92 92 }
93 93  
94 94 @ResponseBody
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/ITrackDownService.java View file @ 023a8f7
... ... @@ -17,7 +17,7 @@
17 17 BaseObjectResponse list(String provinceId, String cityId, String areaId, String streetId, String key, Integer trackType, Integer page, Integer limit, Integer userId);
18 18  
19 19 BaseObjectResponse all(Date buildStart, Date buildEnd, Date checkStart, Date checkEnd, Date fmStart,
20   - Date fmEnd, String key, Integer page, Integer limit, Integer userId, Integer type, Integer check, String checkup, String pregnantBuild);
  20 + Date fmEnd, String key, Integer page, Integer limit, Integer userId, Integer type, Integer check, String checkup, String pregnantBuild, Integer followupStatus);
21 21  
22 22 BaseObjectResponse info(String patientId, Integer trackType, Integer buildType);
23 23  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TrackDownServiceImpl.java View file @ 023a8f7
... ... @@ -68,7 +68,7 @@
68 68 */
69 69 @Override
70 70 public BaseObjectResponse all(Date buildStart, Date buildEnd, Date checkStart, Date checkEnd, Date fmStart, Date fmEnd, String key,
71   - Integer page, Integer limit, Integer userId, Integer type, Integer check, String checkup, String pregnantBuild) {
  71 + Integer page, Integer limit, Integer userId, Integer type, Integer check, String checkup, String pregnantBuild, Integer followupStatus) {
72 72 String hospitalId = autoMatchFacade.getHospitalId(userId);
73 73 List<Map<String, Object>> restList = new ArrayList<>();
74 74 Integer archiveModelCount = 0;
... ... @@ -87,6 +87,7 @@
87 87 query.setEndBuildDay(buildEnd);
88 88 query.setCheckup(checkup);
89 89 query.setPregnantBuild(pregnantBuild);
  90 + query.setFollowupStatus(followupStatus);
90 91 //妇女建档主数据
91 92 List<ResidentsArchiveModel> modelList = residentsArchiveService.queryResident(query);
92 93 // StopWatch stopWatch = new StopWatch("妇女建档主数据");
93 94  
... ... @@ -789,12 +790,33 @@
789 790 }
790 791 }
791 792 }
  793 + /**冗余预约追访日期*/
  794 + if (StringUtils.isNotEmpty(trackDown.getParentId()) && StringUtils.isNotEmpty(trackDown.getHospitalId())) {
  795 + ResidentsArchiveModel residentsArchiveModel = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(trackDown.getParentId()).and("hospitalId").is(trackDown.getHospitalId())), ResidentsArchiveModel.class);
  796 + if (null != residentsArchiveModel) {
  797 + ResidentsArchiveModel residentsArchiveModel1 = new ResidentsArchiveModel();
  798 + if (null != residentsArchiveModel.getFollowupTime()) {
  799 + residentsArchiveModel1.setFollowupTime(trackDown.getReservatDate());
  800 + } else {
  801 + residentsArchiveModel1.setFollowupTime(new Date());
  802 + }
  803 + /**冗余 现在处于哪一个流程*/
  804 + if (1 == trackDown.getTrackDownTransfer() || 2 == trackDown.getTrackDownTransfer()) {
  805 + residentsArchiveModel1.setStop("0");
  806 + } else if (3 == trackDown.getTrackDownTransfer()) {
  807 + residentsArchiveModel1.setStop("1");
  808 + }
  809 + residentsArchiveService.updateResident(residentsArchiveModel1, trackDown.getParentId());
  810 + }
  811 + }
792 812 trackDown.setId(null);
793 813 trackDown.setYn(YnEnums.YES.getId());
794 814 trackDown.setCreated(new Date());
795 815 trackDown.setHospitalId(hospitalId);
796 816 trackDown.setOperaterId(userId);
797 817 trackDown.setModified(new Date());
  818 +
  819 +
798 820 trackDownService.add(trackDown);
799 821 String recordId = trackDown.getTrackDownRecId();
800 822 updateRecordStatus(trackDown, recordId);