| | |
| | | import com.kidgrow.oprationcenter.service.IAdvisoryDoctorInfoService; |
| | | import com.kidgrow.oprationcenter.service.IAppointmentTimeService; |
| | | import com.kidgrow.redis.util.RedisUtils; |
| | | import com.kidgrow.user.feign.DoctorAnswerUserRelationService; |
| | | import com.kidgrow.user.feign.UserInfoService; |
| | | import com.kidgrow.user.model.UserInfo; |
| | | import com.kidgrow.usercenter.feign.SysDoctorService; |
| | |
| | | @Autowired |
| | | private RedisUtils redisUtils; |
| | | |
| | | @Autowired |
| | | private DoctorAnswerUserRelationService doctorAnswerUserRelationService; |
| | | |
| | | /** |
| | | * 医生列表 |
| | | * |
| | |
| | | */ |
| | | @Override |
| | | public int removeById(Long id) { |
| | | return baseMapper.removeById(id); |
| | | ResultBody resultBody = doctorAnswerUserRelationService.deletByDoctorId(String.valueOf(id)); |
| | | log.info("删除医生关系返回值=>" + resultBody); |
| | | |
| | | appointmentTimeService.delByAdvisoryId(id); |
| | | baseMapper.removeById(id); |
| | | return 1; |
| | | } |
| | | |
| | | /** |
| | |
| | | JSONArray array = new JSONArray(); |
| | | JSONObject obj = null; |
| | | for (AppointmentTime app : byAdvisoryId) { |
| | | obj = new JSONObject(); |
| | | obj.put("name", app.getName()); |
| | | obj.put("afternoon", app.getAfternoon()); |
| | | obj.put("evening", app.getEvening()); |
| | | obj.put("morning", app.getMorning()); |
| | | boolean flag = true; |
| | | for (int i = 0; i < array.size(); i++) { |
| | | JSONObject jsonObject = array.getJSONObject(i); |
| | | if (jsonObject.getString("name").equals(app.getName())) { |
| | | if (app.getAfternoon() == 1) { |
| | | jsonObject.put("afternoon", 1); |
| | | } else if (app.getEvening() == 1) { |
| | | jsonObject.put("evening", 1); |
| | | } else if (app.getMorning() == 1) { |
| | | jsonObject.put("morning", 1); |
| | | } |
| | | flag = false; |
| | | array.add(jsonObject); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | array.add(obj); |
| | | if (flag) { |
| | | obj = new JSONObject(); |
| | | obj.put("name", app.getName()); |
| | | obj.put("afternoon", app.getAfternoon()); |
| | | obj.put("evening", app.getEvening()); |
| | | obj.put("morning", app.getMorning()); |
| | | array.add(obj); |
| | | } |
| | | } |
| | | json.put("appointments", array); |
| | | } |