TsaBusinessController.java 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. package com.style24.admin.biz.web;
  2. import java.util.Collection;
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.stereotype.Controller;
  5. import org.springframework.web.bind.annotation.GetMapping;
  6. import org.springframework.web.bind.annotation.PostMapping;
  7. import org.springframework.web.bind.annotation.RequestBody;
  8. import org.springframework.web.bind.annotation.RequestMapping;
  9. import org.springframework.web.bind.annotation.ResponseBody;
  10. import org.springframework.web.servlet.ModelAndView;
  11. import com.style24.admin.biz.service.TsaBusinessService;
  12. import com.style24.admin.biz.service.TsaRendererService;
  13. import com.style24.admin.support.controller.TsaBaseController;
  14. import com.style24.admin.support.security.session.TsaSession;
  15. import com.style24.core.support.message.TscMessageByLocale;
  16. import com.style24.persistence.domain.SupplyCompany;
  17. import lombok.extern.slf4j.Slf4j;
  18. import com.gagaframework.web.rest.server.GagaResponse;
  19. /**
  20. * 영업관리 Controller
  21. *
  22. * @author jaewonHo
  23. * @since 2020. 10. 14
  24. */
  25. @Controller
  26. @RequestMapping("/business")
  27. @Slf4j
  28. public class TsaBusinessController extends TsaBaseController {
  29. @Autowired
  30. private TscMessageByLocale message;
  31. @Autowired
  32. private TsaBusinessService businessService;
  33. @Autowired
  34. private TsaRendererService rendererService;
  35. /**
  36. * 공급업체관리 화면
  37. * @return
  38. * @author gagamel
  39. * @since 2020. 10. 14
  40. */
  41. @GetMapping("/supply/company/form")
  42. public ModelAndView supplyCompanyForm() {
  43. ModelAndView mav = new ModelAndView();
  44. // 입점상태
  45. mav.addObject("supplyStatList", rendererService.getCommonCodeList("G010"));
  46. // 유통구분
  47. mav.addObject("distributionGbList", rendererService.getCommonCodeList("G065"));
  48. // 은행
  49. mav.addObject("bankList", rendererService.getCommonCodeList("G940"));
  50. mav.setViewName("business/SupplyCompanyForm");
  51. return mav;
  52. }
  53. /**
  54. * 공급업체관리 목록
  55. * @return
  56. * @author gagamel
  57. * @since 2020. 10. 14
  58. */
  59. @PostMapping("/supply/company/list")
  60. @ResponseBody
  61. public Collection<SupplyCompany> getCompanyList(@RequestBody SupplyCompany supplyComp) {
  62. return businessService.getSupplyCompanyList(supplyComp);
  63. }
  64. /**
  65. * 공급업체관리 저장 처리
  66. * @param supplyComp - 공급업체 정보
  67. * @return
  68. * @author gagamel
  69. * @since 2020. 10. 14
  70. */
  71. @PostMapping("/supply/company/save")
  72. @ResponseBody
  73. public GagaResponse saveSupplyInfo(@RequestBody SupplyCompany supplyComp) {
  74. supplyComp.setRegNo(TsaSession.getInfo().getUserNo());
  75. supplyComp.setUpdNo(TsaSession.getInfo().getUserNo());
  76. log.info("supplyComp: {}", supplyComp);
  77. businessService.saveSupplyCompany(supplyComp);
  78. return super.ok(message.getMessage("SUCC_0001"));
  79. }
  80. }