Commit c158986fd8b32a24eec53928cc8bcd3245fc125d
1 parent
46c3e9deac
Exists in
master
and in
6 other branches
体重修改
Showing 4 changed files with 22 additions and 47 deletions
- platform-common/src/main/java/com/lyms/platform/common/Test.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/VolumeComponentAnalysisFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
platform-common/src/main/java/com/lyms/platform/common/Test.java
View file @
c158986
| ... | ... | @@ -6,13 +6,32 @@ |
| 6 | 6 | |
| 7 | 7 | import java.io.UnsupportedEncodingException; |
| 8 | 8 | import java.util.Arrays; |
| 9 | +import java.util.Calendar; | |
| 9 | 10 | import java.util.Date; |
| 10 | 11 | |
| 11 | 12 | public class Test { |
| 12 | 13 | |
| 13 | 14 | public static void main(String[] args) throws UnsupportedEncodingException { |
| 15 | + System.out.println(DateUtil.getyyyy_MM_dd_hms(getStartTime())); | |
| 16 | + System.out.println(DateUtil.getyyyy_MM_dd_hms(getEndTime())); | |
| 14 | 17 | } |
| 15 | 18 | |
| 19 | + private static Date getStartTime() { | |
| 20 | + Calendar todayStart = Calendar.getInstance(); | |
| 21 | + todayStart.set(Calendar.HOUR_OF_DAY,0); | |
| 22 | + todayStart.set(Calendar.MINUTE,0); | |
| 23 | + todayStart.set(Calendar.SECOND, 0); | |
| 24 | + todayStart.set(Calendar.MILLISECOND, 0); | |
| 25 | + return todayStart.getTime(); | |
| 26 | + } | |
| 16 | 27 | |
| 28 | + private static Date getEndTime() { | |
| 29 | + Calendar todayEnd = Calendar.getInstance(); | |
| 30 | + todayEnd.set(Calendar.HOUR_OF_DAY,23); | |
| 31 | + todayEnd.set(Calendar.MINUTE,59); | |
| 32 | + todayEnd.set(Calendar.SECOND,59); | |
| 33 | + todayEnd.set(Calendar.MILLISECOND,999); | |
| 34 | + return todayEnd.getTime(); | |
| 35 | + } | |
| 17 | 36 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
View file @
c158986
| ... | ... | @@ -7375,7 +7375,7 @@ |
| 7375 | 7375 | Map <String, Object> map = new HashMap <>(); |
| 7376 | 7376 | //新生儿性别 |
| 7377 | 7377 | map.put("babyid", baby.getId()); |
| 7378 | - map.put("babyseq", baby.getBabySeq()); | |
| 7378 | + map.put("babyseq", baby.getBabySeq() == null ? "" : baby.getBabySeq()); | |
| 7379 | 7379 | //新生儿主键 |
| 7380 | 7380 | map.put("babysex", baby.getBabyGender() == null ? "" : SexEnum.getTextById( |
| 7381 | 7381 | Integer.parseInt(baby.getBabyGender()))); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/VolumeComponentAnalysisFacade.java
View file @
c158986
| ... | ... | @@ -117,6 +117,7 @@ |
| 117 | 117 | }else { |
| 118 | 118 | volume.setCreated(new Date()); |
| 119 | 119 | volume.setYn(YnEnums.YES.getId()); |
| 120 | + volume.setId(vc.getId()); | |
| 120 | 121 | Update update = MongoConvertHelper.convertToNativeUpdate(ReflectionUtils.getUpdateField(volume)); |
| 121 | 122 | mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(vc.getId())), update, VolumeComponentAnalysisModel.class); |
| 122 | 123 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
View file @
c158986
| ... | ... | @@ -131,10 +131,8 @@ |
| 131 | 131 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
| 132 | 132 | String nowWeight = patientWeight.getNowWeight(); |
| 133 | 133 | Patients patients = mongoTemplate.findById(patientWeight.getPatientId(), Patients.class); |
| 134 | -// PatientWeight pw = mongoTemplate.findOne(Query.query(Criteria.where("patientId").is(patientWeight.getPatientId()).and("hospitalId").is(hospitalId)), PatientWeight.class); | |
| 135 | -// PatientWeight pw = mongoTemplate.findOne(Query.query(Criteria.where("patientId").is(patientWeight.getPatientId())), PatientWeight.class); | |
| 136 | 134 | PatientWeight pw = mongoTemplate.findOne(Query.query(Criteria.where("type").is(1) |
| 137 | - .and("pid").is(patients.getPid()).and("yn").is("1")), PatientWeight.class); | |
| 135 | + .and("pid").is(patients.getPid()).and("yn").is("1").and("hospitalId").is(hospitalId)), PatientWeight.class); | |
| 138 | 136 | if (pw == null && StringUtils.isEmpty(patientWeight.getBeforeWeight())) { |
| 139 | 137 | patients = mongoTemplate.findOne(Query.query(Criteria.where("source").is(patientWeight.getPatientId()).and("hospitalId").is(hospitalId).and("enable").is("2")), Patients.class); |
| 140 | 138 | if (patients == null) { |
| 141 | 139 | |
| 142 | 140 | |
| 143 | 141 | |
| ... | ... | @@ -143,41 +141,20 @@ |
| 143 | 141 | patientWeight.setPatientId(patients.getId()); |
| 144 | 142 | pw = mongoTemplate.findOne(Query.query(Criteria.where("patientId").is(patients.getId()).and("hospitalId").is(hospitalId)), PatientWeight.class); |
| 145 | 143 | } |
| 146 | - | |
| 147 | - // 绑定医生和患者的关系 | |
| 148 | - /* String patSerSyncUrl = Config.getItem("patSer_sync_url", "0"); | |
| 149 | - Map<String, String> param = new HashMap<>(); | |
| 150 | - param.put("doctorName", couponMapper.findUserName(userId + "")); | |
| 151 | - param.put("patientId", patients.getId()); | |
| 152 | - param.put("hospitalName", couponMapper.findHospitalNameById(hospitalId)); | |
| 153 | - param.put("foreignId", userId + ""); | |
| 154 | - String s = HttpClientUtil.doPost(patSerSyncUrl + "/grWeContr/bindDoctorUser", param, "UTF-8"); | |
| 155 | - System.out.println("绑定医生和患者的关系>>. " + s + " param: " + param);*/ | |
| 156 | - | |
| 157 | 144 | DoctorUserMap doctorUserMap = new DoctorUserMap(patientWeight.getPatientId(), couponMapper.findUserName(userId + ""), couponMapper.findHospitalNameById(hospitalId), userId + ""); |
| 158 | 145 | doctorUserMapService.add(doctorUserMap); |
| 159 | 146 | |
| 160 | - /* if(pw != null && StringUtils.isNotEmpty(patientWeight.getBeforeWeight())) { | |
| 161 | - return RespBuilder.buildErro(ResponseCode.PATIENT_WEIGHT_IS_EXIST); | |
| 162 | - }*/ | |
| 163 | - | |
| 164 | 147 | if (patients != null && !hospitalId.equals(patients.getHospitalId())) {// 隐藏建档 |
| 165 | 148 | patients.setId(null); |
| 166 | 149 | patients.setHospitalId(hospitalId); |
| 167 | 150 | patients.setEnable("2"); |
| 168 | 151 | patients.setSource(patientWeight.getPatientId()); |
| 169 | 152 | patients.setCreated(new Date()); |
| 170 | -// mongoTemplate.save(patients); | |
| 171 | 153 | patients.setModified(new Date()); |
| 172 | 154 | patientsService.addPatient(patients); |
| 173 | 155 | patientWeight.setPatientId(patients.getId()); |
| 174 | 156 | } |
| 175 | 157 | |
| 176 | - | |
| 177 | - | |
| 178 | - | |
| 179 | - | |
| 180 | - | |
| 181 | 158 | Map<String, String> dayWeights = new LinkedHashMap<>(); |
| 182 | 159 | List<Map<String, Object>> dayWeights2 = new ArrayList<>(); |
| 183 | 160 | if (pw != null) { |
| ... | ... | @@ -188,9 +165,6 @@ |
| 188 | 165 | pw.setDayWeights(dayWeights); |
| 189 | 166 | pw.setNowWeight(patientWeight.getNowWeight()); |
| 190 | 167 | |
| 191 | - | |
| 192 | - | |
| 193 | - | |
| 194 | 168 | String ymdDate = DateUtil.getyyyy_MM_dd(new Date()); |
| 195 | 169 | boolean flag = true; |
| 196 | 170 | if (CollectionUtils.isNotEmpty(pw.getDayWeights2())) { |
| ... | ... | @@ -203,8 +177,6 @@ |
| 203 | 177 | map.put("hospitalName", couponMapper.getHospitalName(hospitalId)); |
| 204 | 178 | map.put("date", ymdDate); |
| 205 | 179 | map.put("nowWeight", nowWeight); |
| 206 | - /*map.put("doctorId", doctorId);*/ | |
| 207 | - | |
| 208 | 180 | } |
| 209 | 181 | } |
| 210 | 182 | if (flag) { |
| ... | ... | @@ -226,8 +198,6 @@ |
| 226 | 198 | } |
| 227 | 199 | |
| 228 | 200 | if (StringUtils.isEmpty(patientWeight.getId()) && patients != null) { |
| 229 | -// antenatalExaminationFacade.handHideBuild(patients.getPid(), patients.getId(), userId, 1); | |
| 230 | - | |
| 231 | 201 | dayWeights.put(DateUtil.getyyyy_MM_dd(new Date()), nowWeight); |
| 232 | 202 | patientWeight.setPid(patients.getPid()); |
| 233 | 203 | patientWeight.setDayWeights(dayWeights); |
| ... | ... | @@ -242,9 +212,6 @@ |
| 242 | 212 | } |
| 243 | 213 | } |
| 244 | 214 | patientWeight.setYn("1"); |
| 245 | -// mongoTemplate.save(patientWeight); | |
| 246 | - | |
| 247 | - | |
| 248 | 215 | Map<String, Object> m = new HashMap<>(); |
| 249 | 216 | m.put("hospitalId", hospitalId); |
| 250 | 217 | m.put("hospitalName", couponMapper.getHospitalName(hospitalId)); |
| ... | ... | @@ -261,18 +228,6 @@ |
| 261 | 228 | patientWeight.setBuildDate(patients.getBookbuildingDate()); |
| 262 | 229 | patientWeightService2.add(patientWeight); |
| 263 | 230 | |
| 264 | - operateLogFacade.addAddOptLog(userId, Integer.valueOf(hospitalId), patientWeight, OptActionEnums.ADD.getId(), "添加孕体重"); | |
| 265 | - | |
| 266 | - /* // 绑定医生和患者的关系 | |
| 267 | - String patSerSyncUrl = Config.getItem("patSer_sync_url", "0"); | |
| 268 | - Map<String, String> param = new HashMap<>(); | |
| 269 | - param.put("doctorName", couponMapper.findUserName(userId + "")); | |
| 270 | - param.put("patientId", patients.getId()); | |
| 271 | - param.put("hospitalName", couponMapper.findHospitalNameById(hospitalId)); | |
| 272 | - param.put("foreignId", userId + ""); | |
| 273 | - String s = HttpClientUtil.doPost(patSerSyncUrl + "/grWeContr/bindDoctorUser", param, "UTF-8");*/ | |
| 274 | -// String s = HttpClientUtil.doPost("http://localhost:9092/grWeContr/bindDoctorUser", param, "UTF-8"); | |
| 275 | -// System.out.println("绑定医生和患者的关系>>. " + s + " param: " + param); | |
| 276 | 231 | return RespBuilder.buildSuccess(patientWeight.getId()); |
| 277 | 232 | } else { |
| 278 | 233 | patientWeight.setOperaterId(userId.toString()); |