| | |
| | | |
| | | /** |
| | | * 获取所有体测预约记录 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/bodySideAppointments/listAll") |
| | | public List<QueryBodySideAppointmentVO> listAll(@RequestBody QueryBodySideAppointment vo){ |
| | | public List<QueryBodySideAppointmentVO> listAll(@RequestBody QueryBodySideAppointment vo) { |
| | | List<QueryBodySideAppointmentVO> queryBodySideAppointmentVOS = bodySideAppointmentService.listAll(vo); |
| | | List<Integer> list = new ArrayList<>(); |
| | | for (QueryBodySideAppointmentVO queryBodySideAppointmentVO : queryBodySideAppointmentVOS) { |
| | |
| | | List<Store> stores = storeClient.queryStoreByIds(list); |
| | | for (QueryBodySideAppointmentVO queryBodySideAppointmentVO : queryBodySideAppointmentVOS) { |
| | | for (Store store : stores) { |
| | | if (queryBodySideAppointmentVO.getStoreId() == store.getId()){ |
| | | if (queryBodySideAppointmentVO.getStoreId() == store.getId()) { |
| | | queryBodySideAppointmentVO.setStoreName(store.getName()); |
| | | break; |
| | | } |
| | |
| | | } |
| | | return queryBodySideAppointmentVOS; |
| | | } |
| | | |
| | | /** |
| | | * 增加/修改体测预约记录 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/bodySideAppointments/addBodySideAppointments") |
| | | public Object addBodySideAppointments(@RequestBody QueryBodySideAppointmentVO vo){ |
| | | public Object addBodySideAppointments(@RequestBody QueryBodySideAppointmentVO vo) { |
| | | BodySideAppointment bodySideAppointment = new BodySideAppointment(); |
| | | BeanUtils.copyProperties(vo,bodySideAppointment); |
| | | BeanUtils.copyProperties(vo, bodySideAppointment); |
| | | bodySideAppointment.setStatus(1); |
| | | bodySideAppointment.setState(1); |
| | | bodySideAppointment.setInsertTime(new Date()); |
| | | if (vo.getId() != null){ |
| | | return bodySideAppointmentService.updateById(bodySideAppointment); |
| | | }else { |
| | | if (vo.getId() != null) { |
| | | return bodySideAppointmentService.updateById(bodySideAppointment); |
| | | } else { |
| | | return bodySideAppointmentService.save(bodySideAppointment); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 手动标记用户已经到店并完成体测 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/bodySideAppointments/changeState") |
| | | public Object changeState(@RequestBody List<Integer> ids){ |
| | | public Object changeState(@RequestBody List<Integer> ids) { |
| | | return bodySideAppointmentService.changeState(ids); |
| | | } |
| | | |
| | | /** |
| | | * 通过id获取体测预约记录 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/bodySideAppointments/getInfoById") |
| | | public BodySideAppointment getInfoById(@RequestBody Integer id){ |
| | | public BodySideAppointment getInfoById(@RequestBody Integer id) { |
| | | return bodySideAppointmentService.getById(id); |
| | | |
| | | } |