RentingAppointmentInnerServiceSMOImpl.java 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. package com.java110.user.smo.impl;
  2. import com.java110.core.base.smo.BaseServiceSMO;
  3. import com.java110.dto.PageDto;
  4. import com.java110.dto.rentingAppointment.RentingAppointmentDto;
  5. import com.java110.intf.user.IRentingAppointmentInnerServiceSMO;
  6. import com.java110.po.rentingAppointment.RentingAppointmentPo;
  7. import com.java110.user.dao.IRentingAppointmentServiceDao;
  8. import com.java110.utils.util.BeanConvertUtil;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.web.bind.annotation.RequestBody;
  11. import org.springframework.web.bind.annotation.RestController;
  12. import java.util.List;
  13. /**
  14. * @ClassName FloorInnerServiceSMOImpl
  15. * @Description 租赁预约内部服务实现类
  16. * @Author wuxw
  17. * @Date 2019/4/24 9:20
  18. * @Version 1.0
  19. * add by wuxw 2019/4/24
  20. **/
  21. @RestController
  22. public class RentingAppointmentInnerServiceSMOImpl extends BaseServiceSMO implements IRentingAppointmentInnerServiceSMO {
  23. @Autowired
  24. private IRentingAppointmentServiceDao rentingAppointmentServiceDaoImpl;
  25. @Override
  26. public int saveRentingAppointment(@RequestBody RentingAppointmentPo rentingAppointmentPo) {
  27. int saveFlag = 1;
  28. rentingAppointmentServiceDaoImpl.saveRentingAppointmentInfo(BeanConvertUtil.beanCovertMap(rentingAppointmentPo));
  29. return saveFlag;
  30. }
  31. @Override
  32. public int updateRentingAppointment(@RequestBody RentingAppointmentPo rentingAppointmentPo) {
  33. int saveFlag = 1;
  34. rentingAppointmentServiceDaoImpl.updateRentingAppointmentInfo(BeanConvertUtil.beanCovertMap(rentingAppointmentPo));
  35. return saveFlag;
  36. }
  37. @Override
  38. public int deleteRentingAppointment(@RequestBody RentingAppointmentPo rentingAppointmentPo) {
  39. int saveFlag = 1;
  40. rentingAppointmentPo.setStatusCd("1");
  41. rentingAppointmentServiceDaoImpl.updateRentingAppointmentInfo(BeanConvertUtil.beanCovertMap(rentingAppointmentPo));
  42. return saveFlag;
  43. }
  44. @Override
  45. public List<RentingAppointmentDto> queryRentingAppointments(@RequestBody RentingAppointmentDto rentingAppointmentDto) {
  46. //校验是否传了 分页信息
  47. int page = rentingAppointmentDto.getPage();
  48. if (page != PageDto.DEFAULT_PAGE) {
  49. rentingAppointmentDto.setPage((page - 1) * rentingAppointmentDto.getRow());
  50. }
  51. List<RentingAppointmentDto> rentingAppointments = BeanConvertUtil.covertBeanList(rentingAppointmentServiceDaoImpl.getRentingAppointmentInfo(BeanConvertUtil.beanCovertMap(rentingAppointmentDto)), RentingAppointmentDto.class);
  52. return rentingAppointments;
  53. }
  54. @Override
  55. public int queryRentingAppointmentsCount(@RequestBody RentingAppointmentDto rentingAppointmentDto) {
  56. return rentingAppointmentServiceDaoImpl.queryRentingAppointmentsCount(BeanConvertUtil.beanCovertMap(rentingAppointmentDto));
  57. }
  58. public IRentingAppointmentServiceDao getRentingAppointmentServiceDaoImpl() {
  59. return rentingAppointmentServiceDaoImpl;
  60. }
  61. public void setRentingAppointmentServiceDaoImpl(IRentingAppointmentServiceDao rentingAppointmentServiceDaoImpl) {
  62. this.rentingAppointmentServiceDaoImpl = rentingAppointmentServiceDaoImpl;
  63. }
  64. }