|
|
@@ -536,8 +536,8 @@ public class TsaGoodsController extends TsaBaseController {
|
|
|
// 공급업체
|
|
|
mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(supplyCompCd));
|
|
|
|
|
|
- String[] exceptCds = {"G008_00"};
|
|
|
- mav.addObject("goodsStatList", rendererService.getCommonCodeList("G008", "Y", exceptCds));
|
|
|
+ String[] goodsStatExceptCds = {"G008_00"};
|
|
|
+ mav.addObject("goodsStatList", rendererService.getCommonCodeList("G008", "Y", goodsStatExceptCds));
|
|
|
|
|
|
// 정상이월
|
|
|
mav.addObject("formalGbList", rendererService.getAvailCommonCodeList("G009"));
|
|
|
@@ -557,6 +557,11 @@ public class TsaGoodsController extends TsaBaseController {
|
|
|
mav.addObject("goodsTypeList", rendererService.getAvailCommonCodeList("G056"));
|
|
|
// 상품구분
|
|
|
mav.addObject("goodsGbList", rendererService.getAvailCommonCodeList("G073"));
|
|
|
+ // 유통구분
|
|
|
+ String[] distributionGbExceptCds = {"G065_20"};
|
|
|
+ mav.addObject("distributionGbList", rendererService.getCommonCodeList("G065", "Y", distributionGbExceptCds));
|
|
|
+ // 상품연령대
|
|
|
+ mav.addObject("ageGrpCdList", rendererService.getAvailCommonCodeList("G023"));
|
|
|
// 색상
|
|
|
Color color = new Color();
|
|
|
mav.addObject("colorList", rendererService.getColorList(color));
|
|
|
@@ -685,6 +690,184 @@ public class TsaGoodsController extends TsaBaseController {
|
|
|
return super.ok(message.getMessage("SUCC_0001"));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 상품 상세 저장
|
|
|
+ *
|
|
|
+ * @param goods
|
|
|
+ * @return
|
|
|
+ * @author eskim
|
|
|
+ * @since 2020. 10. 27
|
|
|
+ */
|
|
|
+ @PostMapping("/detail/save")
|
|
|
+ @ResponseBody
|
|
|
+ public GagaResponse saveGoodsDetail(@RequestBody Goods goods) {
|
|
|
+
|
|
|
+ // 상품상태에 따른 이미지 정보 확인 - 상품상태가 승인대기나 승인 완료일 경우
|
|
|
+ if ("G008_40".equals(goods.getGoodsStat()) || "G008_90".equals(goods.getGoodsStat())) {
|
|
|
+ Collection<Goods> goodsList = goodsService.getGoodsImgsYn(goods);
|
|
|
+ String goodsImageYn = "N";
|
|
|
+ for (Goods tmpGoods : goodsList) {
|
|
|
+ goodsImageYn = tmpGoods.getGoodsImageYn();
|
|
|
+ }
|
|
|
+ if ("N".equals(goodsImageYn)) {
|
|
|
+ throw new IllegalStateException("필수 이미지나 고시정보가 등록되지 않은 상품은 <br/>'승인대기'나 '승인완료' 상태로 변경할 수 없습니다.");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Collection<GoodsNotiInfo> notiList = null;
|
|
|
+ Collection<GoodsCompose> goodComposeList = null;
|
|
|
+ Collection<CodiGoods> codiGoodList = null;
|
|
|
+ ObjectMapper mapper = new ObjectMapper();
|
|
|
+ try {
|
|
|
+ if (goods.getNotiList() != null) {
|
|
|
+ notiList = mapper.readValue(goods.getNotiList(), new TypeReference<Collection<GoodsNotiInfo>>() {
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ if (goods.getCodiGoodsList() != null) {
|
|
|
+ codiGoodList = mapper.readValue(goods.getCodiGoodsList(), new TypeReference<Collection<CodiGoods>>() {
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ if (goods.getGoodsComposeList() != null) {
|
|
|
+ goodComposeList = mapper.readValue(goods.getGoodsComposeList(), new TypeReference<Collection<GoodsCompose>>() {
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ goods.setNotiListNew(notiList);
|
|
|
+ goods.setGoodsComposeListNew(goodComposeList);
|
|
|
+ goods.setCodiGoodsListNew(codiGoodList);
|
|
|
+
|
|
|
+ goodsService.saveGoodsDetail(goods);
|
|
|
+ return super.ok(message.getMessage("SUCC_0001"));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 코디상품 삭제
|
|
|
+ *
|
|
|
+ * @param codiGoodsList
|
|
|
+ * @author eskim
|
|
|
+ * @since 2020. 10. 28
|
|
|
+ */
|
|
|
+ @PostMapping("/codi/delete")
|
|
|
+ @ResponseBody
|
|
|
+ public GagaResponse deleteCodiGoods(@RequestBody Collection<CodiGoods> codiGoodsList) {
|
|
|
+
|
|
|
+ goodsService.deleteCodiGoods(codiGoodsList);
|
|
|
+ return super.ok(message.getMessage("SUCC_0003"));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 세트상품구성 화면
|
|
|
+ *
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ * @author eskim
|
|
|
+ * @since 2020. 05. 26
|
|
|
+ */
|
|
|
+ @GetMapping("/set/form")
|
|
|
+ @ResponseBody
|
|
|
+ public ModelAndView setForm(Goods goods) {
|
|
|
+ ModelAndView mav = new ModelAndView();
|
|
|
+
|
|
|
+ // 사용여부
|
|
|
+ mav.addObject("useYnList", rendererService.getAvailCommonCodeList("G002"));
|
|
|
+ // 정상이월
|
|
|
+ mav.addObject("formalGbList", rendererService.getAvailCommonCodeList("G009"));
|
|
|
+ // 성별
|
|
|
+ mav.addObject("sexGbList", rendererService.getAvailCommonCodeList("G007"));
|
|
|
+ // 시즌
|
|
|
+ mav.addObject("seasonList", rendererService.getAvailCommonCodeList("G006"));
|
|
|
+ // 스타일년도
|
|
|
+ mav.addObject("styleYearList", rendererService.getAvailCommonCodeList("G023"));
|
|
|
+ // 매입유형
|
|
|
+ mav.addObject("buyingTypeList", rendererService.getAvailCommonCodeList("G035"));
|
|
|
+ // 상품상태
|
|
|
+ // mav.addObject("goodsStatList",
|
|
|
+ // rendererService.getAvailCommonCodeList("G008"));
|
|
|
+ String[] exceptCds = {"00"};
|
|
|
+ mav.addObject("goodsStatList", rendererService.getCommonCodeList("G008", "Y", exceptCds));
|
|
|
+
|
|
|
+ mav.addObject("params", goods);
|
|
|
+ mav.setViewName("goods/GoodsSetForm");
|
|
|
+ return mav;
|
|
|
+ }
|
|
|
+
|
|
|
+// /**
|
|
|
+// * 세트 상품 등록
|
|
|
+// *
|
|
|
+// * @param goods
|
|
|
+// * @return
|
|
|
+// * @author eskim
|
|
|
+// * @since 2020. 06. 12
|
|
|
+// */
|
|
|
+// @PostMapping("/set/save")
|
|
|
+// @ResponseBody
|
|
|
+// public GagaResponse saveGoodsSet(@RequestBody Goods goods) {
|
|
|
+// goodsService.saveGoodsSet(goods);
|
|
|
+// return super.ok(message.getMessage("SUCC_0001"));
|
|
|
+// }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 딜상품구성 화면
|
|
|
+ *
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ * @author eskim
|
|
|
+ * @since 2020. 05. 26
|
|
|
+ */
|
|
|
+ @GetMapping("/deal/form")
|
|
|
+ @ResponseBody
|
|
|
+ public ModelAndView dealForm(Goods goods) {
|
|
|
+ ModelAndView mav = new ModelAndView();
|
|
|
+
|
|
|
+ // 사용여부
|
|
|
+ mav.addObject("useYnList", rendererService.getAvailCommonCodeList("G002"));
|
|
|
+ // 정상이월
|
|
|
+ mav.addObject("formalGbList", rendererService.getAvailCommonCodeList("G009"));
|
|
|
+ // 성별
|
|
|
+ mav.addObject("sexGbList", rendererService.getAvailCommonCodeList("G007"));
|
|
|
+ // 시즌
|
|
|
+ mav.addObject("seasonList", rendererService.getAvailCommonCodeList("G006"));
|
|
|
+ // 스타일년도
|
|
|
+ mav.addObject("styleYearList", rendererService.getAvailCommonCodeList("G023"));
|
|
|
+ // 매입유형
|
|
|
+ mav.addObject("buyingTypeList", rendererService.getAvailCommonCodeList("G035"));
|
|
|
+ // 상품상태
|
|
|
+ // mav.addObject("goodsStatList",
|
|
|
+ // rendererService.getAvailCommonCodeList("G008"));
|
|
|
+ String[] exceptCds = {"00"};
|
|
|
+ mav.addObject("goodsStatList", rendererService.getCommonCodeList("G008", "Y", exceptCds));
|
|
|
+
|
|
|
+ mav.addObject("params", goods);
|
|
|
+ mav.setViewName("goods/GoodsDealForm");
|
|
|
+ return mav;
|
|
|
+ }
|
|
|
+
|
|
|
+// /**
|
|
|
+// * 딜 상품 등록
|
|
|
+// *
|
|
|
+// * @param goods
|
|
|
+// * @return
|
|
|
+// * @author eskim
|
|
|
+// * @since 2020. 06. 14
|
|
|
+// */
|
|
|
+// @PostMapping("/deal/save")
|
|
|
+// @ResponseBody
|
|
|
+// public GagaResponse saveGoodsDeal(@RequestBody Goods goods) {
|
|
|
+// goodsService.saveGoodsDeal(goods);
|
|
|
+// return super.ok(message.getMessage("SUCC_0001"));
|
|
|
+// }
|
|
|
+
|
|
|
/**
|
|
|
* 상품 대량 등록 화면
|
|
|
*
|
|
|
@@ -927,182 +1110,5 @@ public class TsaGoodsController extends TsaBaseController {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 상품 상세 저장
|
|
|
- *
|
|
|
- * @param goods
|
|
|
- * @return
|
|
|
- * @author eskim
|
|
|
- * @since 2020. 10. 27
|
|
|
- */
|
|
|
- @PostMapping("/detail/save")
|
|
|
- @ResponseBody
|
|
|
- public GagaResponse saveGoodsDetail(@RequestBody Goods goods) {
|
|
|
-
|
|
|
- // 상품상태에 따른 이미지 정보 확인 - 상품상태가 승인대기나 승인 완료일 경우
|
|
|
- if ("G008_40".equals(goods.getGoodsStat()) || "G008_90".equals(goods.getGoodsStat())) {
|
|
|
- Collection<Goods> goodsList = goodsService.getGoodsImgsYn(goods);
|
|
|
- String goodsImageYn = "N";
|
|
|
- for (Goods tmpGoods : goodsList) {
|
|
|
- goodsImageYn = tmpGoods.getGoodsImageYn();
|
|
|
- }
|
|
|
- if ("N".equals(goodsImageYn)) {
|
|
|
- throw new IllegalStateException("필수 이미지나 고시정보가 등록되지 않은 상품은 <br/>'승인대기'나 '승인완료' 상태로 변경할 수 없습니다.");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- Collection<GoodsNotiInfo> notiList = null;
|
|
|
- Collection<GoodsCompose> goodComposeList = null;
|
|
|
- Collection<CodiGoods> codiGoodList = null;
|
|
|
- ObjectMapper mapper = new ObjectMapper();
|
|
|
- try {
|
|
|
- if (goods.getNotiList() != null) {
|
|
|
- notiList = mapper.readValue(goods.getNotiList(), new TypeReference<Collection<GoodsNotiInfo>>() {
|
|
|
- });
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- try {
|
|
|
- if (goods.getCodiGoodsList() != null) {
|
|
|
- codiGoodList = mapper.readValue(goods.getCodiGoodsList(), new TypeReference<Collection<CodiGoods>>() {
|
|
|
- });
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- try {
|
|
|
- if (goods.getGoodsComposeList() != null) {
|
|
|
- goodComposeList = mapper.readValue(goods.getGoodsComposeList(), new TypeReference<Collection<GoodsCompose>>() {
|
|
|
- });
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- goods.setNotiListNew(notiList);
|
|
|
- goods.setGoodsComposeListNew(goodComposeList);
|
|
|
- goods.setCodiGoodsListNew(codiGoodList);
|
|
|
-
|
|
|
- goodsService.saveGoodsDetail(goods);
|
|
|
- return super.ok(message.getMessage("SUCC_0001"));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 코디상품 삭제
|
|
|
- *
|
|
|
- * @param codiGoodsList
|
|
|
- * @author eskim
|
|
|
- * @since 2020. 10. 28
|
|
|
- */
|
|
|
- @PostMapping("/codi/delete")
|
|
|
- @ResponseBody
|
|
|
- public GagaResponse deleteCodiGoods(@RequestBody Collection<CodiGoods> codiGoodsList) {
|
|
|
|
|
|
- goodsService.deleteCodiGoods(codiGoodsList);
|
|
|
- return super.ok(message.getMessage("SUCC_0003"));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 세트상품구성 화면
|
|
|
- *
|
|
|
- * @param
|
|
|
- * @return
|
|
|
- * @author eskim
|
|
|
- * @since 2020. 05. 26
|
|
|
- */
|
|
|
- @GetMapping("/set/form")
|
|
|
- @ResponseBody
|
|
|
- public ModelAndView setForm(Goods goods) {
|
|
|
- ModelAndView mav = new ModelAndView();
|
|
|
-
|
|
|
- // 사용여부
|
|
|
- mav.addObject("useYnList", rendererService.getAvailCommonCodeList("G002"));
|
|
|
- // 정상이월
|
|
|
- mav.addObject("formalGbList", rendererService.getAvailCommonCodeList("G009"));
|
|
|
- // 성별
|
|
|
- mav.addObject("sexGbList", rendererService.getAvailCommonCodeList("G007"));
|
|
|
- // 시즌
|
|
|
- mav.addObject("seasonList", rendererService.getAvailCommonCodeList("G006"));
|
|
|
- // 스타일년도
|
|
|
- mav.addObject("styleYearList", rendererService.getAvailCommonCodeList("G023"));
|
|
|
- // 매입유형
|
|
|
- mav.addObject("buyingTypeList", rendererService.getAvailCommonCodeList("G035"));
|
|
|
- // 상품상태
|
|
|
- // mav.addObject("goodsStatList",
|
|
|
- // rendererService.getAvailCommonCodeList("G008"));
|
|
|
- String[] exceptCds = {"00"};
|
|
|
- mav.addObject("goodsStatList", rendererService.getCommonCodeList("G008", "Y", exceptCds));
|
|
|
-
|
|
|
- mav.addObject("params", goods);
|
|
|
- mav.setViewName("goods/GoodsSetForm");
|
|
|
- return mav;
|
|
|
- }
|
|
|
-
|
|
|
-// /**
|
|
|
-// * 세트 상품 등록
|
|
|
-// *
|
|
|
-// * @param goods
|
|
|
-// * @return
|
|
|
-// * @author eskim
|
|
|
-// * @since 2020. 06. 12
|
|
|
-// */
|
|
|
-// @PostMapping("/set/save")
|
|
|
-// @ResponseBody
|
|
|
-// public GagaResponse saveGoodsSet(@RequestBody Goods goods) {
|
|
|
-// goodsService.saveGoodsSet(goods);
|
|
|
-// return super.ok(message.getMessage("SUCC_0001"));
|
|
|
-// }
|
|
|
-
|
|
|
- /**
|
|
|
- * 딜상품구성 화면
|
|
|
- *
|
|
|
- * @param
|
|
|
- * @return
|
|
|
- * @author eskim
|
|
|
- * @since 2020. 05. 26
|
|
|
- */
|
|
|
- @GetMapping("/deal/form")
|
|
|
- @ResponseBody
|
|
|
- public ModelAndView dealForm(Goods goods) {
|
|
|
- ModelAndView mav = new ModelAndView();
|
|
|
-
|
|
|
- // 사용여부
|
|
|
- mav.addObject("useYnList", rendererService.getAvailCommonCodeList("G002"));
|
|
|
- // 정상이월
|
|
|
- mav.addObject("formalGbList", rendererService.getAvailCommonCodeList("G009"));
|
|
|
- // 성별
|
|
|
- mav.addObject("sexGbList", rendererService.getAvailCommonCodeList("G007"));
|
|
|
- // 시즌
|
|
|
- mav.addObject("seasonList", rendererService.getAvailCommonCodeList("G006"));
|
|
|
- // 스타일년도
|
|
|
- mav.addObject("styleYearList", rendererService.getAvailCommonCodeList("G023"));
|
|
|
- // 매입유형
|
|
|
- mav.addObject("buyingTypeList", rendererService.getAvailCommonCodeList("G035"));
|
|
|
- // 상품상태
|
|
|
- // mav.addObject("goodsStatList",
|
|
|
- // rendererService.getAvailCommonCodeList("G008"));
|
|
|
- String[] exceptCds = {"00"};
|
|
|
- mav.addObject("goodsStatList", rendererService.getCommonCodeList("G008", "Y", exceptCds));
|
|
|
-
|
|
|
- mav.addObject("params", goods);
|
|
|
- mav.setViewName("goods/GoodsDealForm");
|
|
|
- return mav;
|
|
|
- }
|
|
|
-
|
|
|
-// /**
|
|
|
-// * 딜 상품 등록
|
|
|
-// *
|
|
|
-// * @param goods
|
|
|
-// * @return
|
|
|
-// * @author eskim
|
|
|
-// * @since 2020. 06. 14
|
|
|
-// */
|
|
|
-// @PostMapping("/deal/save")
|
|
|
-// @ResponseBody
|
|
|
-// public GagaResponse saveGoodsDeal(@RequestBody Goods goods) {
|
|
|
-// goodsService.saveGoodsDeal(goods);
|
|
|
-// return super.ok(message.getMessage("SUCC_0001"));
|
|
|
-// }
|
|
|
}
|