CompanyComponent.java 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. package com.java110.web.components;
  2. import com.java110.core.context.IPageData;
  3. import com.java110.web.smo.ICompanyServiceSMO;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.http.HttpStatus;
  6. import org.springframework.http.ResponseEntity;
  7. import org.springframework.stereotype.Component;
  8. /**
  9. * 初始化公司组件
  10. * Created by Administrator on 2019/3/28.
  11. */
  12. @Component("company")
  13. public class CompanyComponent {
  14. @Autowired
  15. ICompanyServiceSMO companyServiceSMOImpl;
  16. /**
  17. * 获取商户类型
  18. * @param pd
  19. * @return
  20. */
  21. public ResponseEntity<String> getStoreType(IPageData pd){
  22. ResponseEntity<String> responseEntity = null;
  23. try{
  24. responseEntity = companyServiceSMOImpl.getStoreType(pd);
  25. }catch (Exception e){
  26. responseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
  27. }finally {
  28. return responseEntity;
  29. }
  30. }
  31. /**
  32. * 保存公司信息
  33. * @param pd
  34. * @return
  35. */
  36. public ResponseEntity<String> saveCompanyInfo(IPageData pd){
  37. ResponseEntity<String> responseEntity = null;
  38. try{
  39. responseEntity = companyServiceSMOImpl.saveCompanyInfo(pd);
  40. }catch (Exception e){
  41. responseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
  42. }finally {
  43. return responseEntity;
  44. }
  45. }
  46. public ICompanyServiceSMO getCompanyServiceSMOImpl() {
  47. return companyServiceSMOImpl;
  48. }
  49. public void setCompanyServiceSMOImpl(ICompanyServiceSMO companyServiceSMOImpl) {
  50. this.companyServiceSMOImpl = companyServiceSMOImpl;
  51. }
  52. }