Commit fbf53eb3a54f448f8d418b4fcce2e3423cd893f5
1 parent
aa503fe977
Exists in
master
and in
6 other branches
update
Showing 2 changed files with 18 additions and 13 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MicroelementFacade.java
View file @
fbf53eb
... | ... | @@ -106,13 +106,13 @@ |
106 | 106 | |
107 | 107 | //孕周 |
108 | 108 | if (start != null && end != null) { |
109 | - Date start1 = DateUtil.getWeekStart(start); | |
110 | - Date end2 = DateUtil.getWeekEnd(end); | |
111 | - query.setLastMensesStart(end2); | |
112 | - query.setLastMensesEnd(start1); | |
109 | + Date start1 = DateUtil.addDay(DateUtil.parseYMD(DateUtil.getyyyy_MM_dd(new Date())), -(end * 7) - 6); | |
110 | + Date end1 = DateUtil.addDay(DateUtil.parseYMD(DateUtil.getyyyy_MM_dd(new Date())), -(start * 7)); | |
111 | + query.setLastMensesStart(start1); | |
112 | + query.setLastMensesEnd(end1); | |
113 | 113 | } |
114 | 114 | |
115 | - | |
115 | + System.out.println(query.convertToQuery().convertToMongoQuery().toString()); | |
116 | 116 | List<MicroelementModel> models = microelementService.queryMicroelementList(query); |
117 | 117 | |
118 | 118 | if (CollectionUtils.isNotEmpty(models)) |
... | ... | @@ -177,8 +177,8 @@ |
177 | 177 | Date currentDate = new Date(); |
178 | 178 | Date start1 = DateUtil.addMonth(currentDate, -start); |
179 | 179 | Date end2 = DateUtil.addDay(DateUtil.addMonth(currentDate, -end - 1), 1); |
180 | - query.setBirthStart(start1); | |
181 | - query.setBirthEnd(end2); | |
180 | + query.setBirthStart(end2); | |
181 | + query.setBirthEnd(start1); | |
182 | 182 | } |
183 | 183 | System.out.println(query.convertToQuery().convertToMongoQuery().toString()); |
184 | 184 | List<MicroelementModel> models = microelementService.queryMicroelementList(query); |
... | ... | @@ -198,7 +198,7 @@ |
198 | 198 | data.put("vcCardNo",babyModel.getVcCardNo()); |
199 | 199 | data.put("mcardNo",babyModel.getMcertNo()); |
200 | 200 | data.put("microelements", model.getMicroelements()); |
201 | - data.put("age", DateUtil.getBabyMonthAge(babyModel.getBirth(), model.getCreated())); | |
201 | + data.put("age", DateUtil.getBabyMonthAge(babyModel.getBirth(), new Date())); | |
202 | 202 | data.put("mname", babyModel.getMname()); |
203 | 203 | data.put("created", DateUtil.getyyyy_MM_dd(model.getCreated())); |
204 | 204 | dataList.add(data); |
platform-sync-data/src/main/java/com/lyms/platform/sync/data/service/SyncHsPatientService.java
View file @
fbf53eb
... | ... | @@ -11,6 +11,7 @@ |
11 | 11 | import com.lyms.platform.common.utils.SystemConfig; |
12 | 12 | import com.lyms.platform.pojo.Patients; |
13 | 13 | import com.lyms.platform.pojo.PersonModel; |
14 | +import com.lyms.platform.pojo.QhdWeightConfigModel; | |
14 | 15 | import com.lyms.platform.sync.data.util.DataUtil; |
15 | 16 | import com.lyms.platform.sync.data.util.HsDataUtil; |
16 | 17 | import com.lyms.platform.sync.data.util.JDBCUtil; |
... | ... | @@ -19,6 +20,8 @@ |
19 | 20 | import org.springframework.beans.factory.annotation.Autowired; |
20 | 21 | import org.springframework.beans.factory.annotation.Qualifier; |
21 | 22 | import org.springframework.data.mongodb.core.MongoTemplate; |
23 | +import org.springframework.data.mongodb.core.query.Criteria; | |
24 | +import org.springframework.data.mongodb.core.query.Query; | |
22 | 25 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
23 | 26 | import org.springframework.stereotype.Service; |
24 | 27 | |
... | ... | @@ -110,7 +113,8 @@ |
110 | 113 | } |
111 | 114 | |
112 | 115 | Patients patients = new Patients(); |
113 | - PersonModel person = new PersonModel(); | |
116 | + | |
117 | + | |
114 | 118 | int type = 1; |
115 | 119 | Integer weeks = DataUtil.getInteger(map.get("WEEKS")); |
116 | 120 | List<Map<String, Object>> chanList = null; |
117 | 121 | |
... | ... | @@ -129,11 +133,9 @@ |
129 | 133 | type = 3; |
130 | 134 | } |
131 | 135 | |
132 | - Date dueDate = DateUtil.addDay(DateUtil.addMonth(DataUtil.getDate(map.get("P_LASTMENSTRUALPERIOD")), 9), 7); | |
136 | + PersonModel person = new PersonModel(); | |
133 | 137 | |
134 | - patients.setDueDate(dueDate); | |
135 | - person.setCreated(new Date()); | |
136 | - | |
138 | + mongoTemplate.findOne(Query.query(Criteria.where("cardNo").is(DataUtil.getString(map.get("P_CARDNO"))).and("yn").is(1)), PersonModel.class); | |
137 | 139 | person.setId(String.valueOf(map.get("PID"))); |
138 | 140 | person.setType(type); |
139 | 141 | person.setYn(YnEnums.YES.getId()); |
... | ... | @@ -145,6 +147,9 @@ |
145 | 147 | person.setModified(DataUtil.getDate(map.get("P_OPERTIME"))); |
146 | 148 | mongoTemplate.save(person); |
147 | 149 | |
150 | + | |
151 | + Date dueDate = DateUtil.addDay(DateUtil.addMonth(DataUtil.getDate(map.get("P_LASTMENSTRUALPERIOD")), 9), 7); | |
152 | + patients.setDueDate(dueDate); | |
148 | 153 | |
149 | 154 | patients.setPid(person.getId()); |
150 | 155 | patients.setId(String.valueOf(map.get("PID"))); |