|
|
@@ -99,7 +99,6 @@ public class TsaGoodsService {
|
|
|
@Autowired
|
|
|
private NaverLowestPriceApi naverLowestPriceApi;
|
|
|
|
|
|
-
|
|
|
@Autowired
|
|
|
private ObjectMapper mapper;
|
|
|
|
|
|
@@ -143,7 +142,7 @@ public class TsaGoodsService {
|
|
|
for (Itemkind itemkind : itemkindList) {
|
|
|
itemkind.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
itemkind.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
- itemkind.setItemkindNm(GagaStringUtil.replace(GagaStringUtil.replace(itemkind.getItemkindNm(), "<", "<"),">", ">"));
|
|
|
+ itemkind.setItemkindNm(GagaStringUtil.replace(GagaStringUtil.replace(itemkind.getItemkindNm(), "<", "<"), ">", ">"));
|
|
|
//itemkind.setItemkindEnm(GagaStringUtil.replace(GagaStringUtil.replace(itemkind.getItemkindEnm(), "<", "<"),">", ">"));
|
|
|
goodsDao.saveItemkindInfo(itemkind);
|
|
|
}
|
|
|
@@ -234,7 +233,7 @@ public class TsaGoodsService {
|
|
|
|
|
|
for (NotiInfo notiInfo : notiInfoList) {
|
|
|
if (!StringUtils.isBlank(notiInfo.getNiContent())) {
|
|
|
- notiInfo.setNiContent(GagaStringUtil.replace(GagaStringUtil.replace(notiInfo.getNiContent(),"<", "<"),">", ">"));
|
|
|
+ notiInfo.setNiContent(GagaStringUtil.replace(GagaStringUtil.replace(notiInfo.getNiContent(), "<", "<"), ">", ">"));
|
|
|
}
|
|
|
notiInfo.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
notiInfo.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
@@ -376,11 +375,11 @@ public class TsaGoodsService {
|
|
|
if ("Y".equals(goodsSearch.getImageViewYn())) {
|
|
|
// 헤더 title 설정
|
|
|
String[] listTitles = {"이미지", "상품코드", "업체명", "브랜드명", "상품명", "품목", "재고", "상품상태", "스타일년도", "시즌",
|
|
|
- "정상가", "판매가", "할인율", "가격변경일", "ERP재고연동여부", "정상이월구분", "반품가능 여부","승인일시"};
|
|
|
+ "정상가", "판매가", "할인율", "가격변경일", "ERP재고연동여부", "정상이월구분", "반품가능 여부", "승인일시"};
|
|
|
|
|
|
// DB 처리 시 사용되는 파라미터명(셀명) 설정
|
|
|
String[] cellNames = {"SYS_IMG_NM", "GOODS_CD", "SUPPLY_COMP_CD", "BRAND_GRP_NM", "GOODS_NM", "ITEMKIND_NM",
|
|
|
- "STOCK_QTY_SUM", "GOODS_STAT", "STYLE_YEAR", "SEASON_CD", "LIST_PRICE", "CURR_PRICE",
|
|
|
+ "STOCK_QTY_SUM", "GOODS_STAT", "STYLE_YEAR", "SEASON_CD", "LIST_PRICE", "CURR_PRICE",
|
|
|
"DC_RATE", "PRICE_UPD_DT", "ERP_STOCK_LINK_YN", "FORMAL_GB", "RETURNABLE_YN", "FRST_CFRM_DT"};
|
|
|
|
|
|
String[] cellTypes = {GagaExcelConstants.CellType.IMAGE.name(),
|
|
|
@@ -398,8 +397,8 @@ public class TsaGoodsService {
|
|
|
Collection<GagaMap> dataList = goodsDao.getGoodsInfoExcelList(goodsSearch); // map형식으로 조회
|
|
|
if (dataList != null && !dataList.isEmpty()) {
|
|
|
for (GagaMap gagaMap : dataList) {
|
|
|
- if (!StringUtils.isBlank(gagaMap.get("SYS_IMG_NM").toString()) ) {
|
|
|
- gagaMap.set("SYS_IMG_NM", targetPath + '/' + gagaMap.get("SYS_IMG_NM").toString());
|
|
|
+ if (!StringUtils.isBlank(gagaMap.get("SYS_IMG_NM").toString())) {
|
|
|
+ gagaMap.set("SYS_IMG_NM", targetPath + '/' + gagaMap.get("SYS_IMG_NM").toString());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -413,22 +412,22 @@ public class TsaGoodsService {
|
|
|
} else {
|
|
|
// 헤더 title 설정
|
|
|
String[] listTitles = {"상품코드", "업체명", "브랜드명", "상품명", "품목", "재고", "상품상태", "스타일년도",
|
|
|
- "시즌", "정상가", "판매가", "할인율", "가격변경일", "ERP재고연동여부", "정상이월구분", "반품가능 여부", "승인일시"};
|
|
|
+ "시즌", "정상가", "판매가", "할인율", "가격변경일", "ERP재고연동여부", "정상이월구분", "반품가능 여부", "승인일시"};
|
|
|
|
|
|
// DB 처리 시 사용되는 파라미터명(셀명) 설정
|
|
|
String[] cellNames = {"GOODS_CD", "SUPPLY_COMP_CD", "BRAND_GRP_NM", "GOODS_NM", "ITEMKIND_NM", "STOCK_QTY_SUM", "GOODS_STAT", "STYLE_YEAR",
|
|
|
- "SEASON_CD", "LIST_PRICE", "CURR_PRICE", "DC_RATE", "PRICE_UPD_DT", "ERP_STOCK_LINK_YN", "FORMAL_GB", "RETURNABLE_YN", "FRST_CFRM_DT"};
|
|
|
+ "SEASON_CD", "LIST_PRICE", "CURR_PRICE", "DC_RATE", "PRICE_UPD_DT", "ERP_STOCK_LINK_YN", "FORMAL_GB", "RETURNABLE_YN", "FRST_CFRM_DT"};
|
|
|
|
|
|
String[] cellTypes = {
|
|
|
- GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
- GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
- GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_RIGHT.name(),
|
|
|
- GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
- GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_RIGHT.name(),
|
|
|
- GagaExcelConstants.CellType.CHAR_RIGHT.name(), GagaExcelConstants.CellType.CHAR_RIGHT.name(),
|
|
|
- GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
- GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
- GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name()};
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_RIGHT.name(),
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_RIGHT.name(),
|
|
|
+ GagaExcelConstants.CellType.CHAR_RIGHT.name(), GagaExcelConstants.CellType.CHAR_RIGHT.name(),
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name()};
|
|
|
|
|
|
Collection<GagaMap> dataList = goodsDao.getGoodsInfoExcelList(goodsSearch);
|
|
|
|
|
|
@@ -540,7 +539,7 @@ public class TsaGoodsService {
|
|
|
for (GoodsDesc tmpGoodsDesc : goodsDescList) {
|
|
|
goodsDescSb.append(tmpGoodsDesc.getGoodsDesc());
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
goodsDescSb.append("");
|
|
|
}
|
|
|
return goodsDescSb.toString();
|
|
|
@@ -984,7 +983,7 @@ public class TsaGoodsService {
|
|
|
goods.setListPrice(newRepGoodsPrice);
|
|
|
goods.setDcRate(0);
|
|
|
goods.setChDataYn("Y");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
if (goods.getCurrPrice() != goods.getCurrPriceOrg()) {
|
|
|
goods.setCurrBprice(goods.getCurrPriceOrg());
|
|
|
goods.setListPrice(goods.getCurrPrice());
|
|
|
@@ -992,7 +991,7 @@ public class TsaGoodsService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
// 가격변경일
|
|
|
if (goods.getCurrPrice() != goods.getCurrPriceOrg()) {
|
|
|
goods.setCurrBprice(goods.getCurrPriceOrg());
|
|
|
@@ -1087,11 +1086,11 @@ public class TsaGoodsService {
|
|
|
goodsOrderGrade.setGoodsCd(goods.getGoodsCd());
|
|
|
goodsOrderGrade.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
goodsDao.deleteGoodsCustGrade(goodsOrderGrade);
|
|
|
- for(String custGrade : goods.getGoodsOrderGrade()) {
|
|
|
+ for (String custGrade : goods.getGoodsOrderGrade()) {
|
|
|
goodsOrderGrade.setCustGrade(custGrade);
|
|
|
goodsDao.createGoodsCustGrade(goodsOrderGrade);
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
Goods goodsOrderGrade = new Goods();
|
|
|
goodsOrderGrade.setGoodsCd(goods.getGoodsCd());
|
|
|
goodsOrderGrade.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
@@ -1288,7 +1287,6 @@ public class TsaGoodsService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 상품 사이즈 옵션정보 이력 생성
|
|
|
*
|
|
|
@@ -1462,7 +1460,7 @@ public class TsaGoodsService {
|
|
|
if (StringUtils.isBlank(extendGoods.getBrandCd())) {
|
|
|
throw new IllegalStateException(message.getMessage("구성상품 중 " + goodsCompose.getCompsGoodsCd() + " 상품 정보를 확인해 주세요."));
|
|
|
}
|
|
|
- listPriceSum += extendGoods.getListPrice() * goodsCompose.getQty() ;
|
|
|
+ listPriceSum += extendGoods.getListPrice() * goodsCompose.getQty();
|
|
|
currPriceSum += goodsCompose.getCompsCurrPrice(); // 입력값
|
|
|
|
|
|
if ("Y".equals(goodsCompose.getBaseYn())) {
|
|
|
@@ -1811,7 +1809,7 @@ public class TsaGoodsService {
|
|
|
goodsResSell.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
goodsResSell.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
|
|
|
- if(goodsDao.getGoodsResSellDupChkCount(goodsResSell) > 0 ) {
|
|
|
+ if (goodsDao.getGoodsResSellDupChkCount(goodsResSell) > 0) {
|
|
|
throw new IllegalStateException("이미 등록된 상품예약판매가 존재합니다. \n(상품코드 : " + goodsCd + ")");
|
|
|
}
|
|
|
|
|
|
@@ -1993,7 +1991,7 @@ public class TsaGoodsService {
|
|
|
goodsPriceRes.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
goodsPriceRes.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
|
|
|
- if(goodsDao.getGoodsPriceResDupChkCount(goodsPriceRes) > 0 ) {
|
|
|
+ if (goodsDao.getGoodsPriceResDupChkCount(goodsPriceRes) > 0) {
|
|
|
throw new IllegalStateException("이미 등록된 상품 가격예약이 존재합니다. \n(상품코드 : " + goodsCd + ")");
|
|
|
}
|
|
|
|
|
|
@@ -2100,12 +2098,12 @@ public class TsaGoodsService {
|
|
|
SimpleDateFormat dateFormatParser = new SimpleDateFormat("yyyyMMddHH");
|
|
|
dateFormatParser.setLenient(false);
|
|
|
try {
|
|
|
- dateFormatParser.parse(goodsPriceRes.getApplyStdt() );
|
|
|
+ dateFormatParser.parse(goodsPriceRes.getApplyStdt());
|
|
|
} catch (Exception e) {
|
|
|
return (cnt + 2) + "행의 예약시작일시을 확인해주세요.";
|
|
|
}
|
|
|
try {
|
|
|
- dateFormatParser.parse(goodsPriceRes.getApplyEddt() );
|
|
|
+ dateFormatParser.parse(goodsPriceRes.getApplyEddt());
|
|
|
} catch (Exception e) {
|
|
|
return (cnt + 2) + "행의 예약종료일시을 확인해주세요.";
|
|
|
}
|
|
|
@@ -2132,18 +2130,16 @@ public class TsaGoodsService {
|
|
|
return (cnt + 2) + "행의 상품은 자사상품이 아닙니다.";
|
|
|
}
|
|
|
|
|
|
- if(goodsDao.getGoodsPriceResDupChkCount(goodsPriceRes) > 0 ) {
|
|
|
+ if (goodsDao.getGoodsPriceResDupChkCount(goodsPriceRes) > 0) {
|
|
|
return (cnt + 2) + "행은 이미 등록된 상품 가격예약이 존재합니다. \n(상품코드 : " + goodsPriceRes.getGoodsCd() + ")";
|
|
|
}
|
|
|
|
|
|
-
|
|
|
cnt++;
|
|
|
}
|
|
|
|
|
|
return "SUCC";
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 상품 동영상 목록 조회
|
|
|
*
|
|
|
@@ -2186,18 +2182,18 @@ public class TsaGoodsService {
|
|
|
public void saveGoodsVideo(Video video) {
|
|
|
video.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
video.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
- if (video.getVideoSq() == null || video.getVideoSq() == 0) {
|
|
|
+ if (video.getVideoSq() == null || video.getVideoSq() == 0) {
|
|
|
|
|
|
String videoSeq = goodsDao.getVideoSeq(video);
|
|
|
if (StringUtils.isBlank(videoSeq)) {
|
|
|
goodsDao.createVideo(video);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
//video.setVideoSq(Integer.parseInt(videoSeq)); //why?
|
|
|
//goodsDao.updateVideo(video);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (video.getVideoSq() == null || video.getVideoSq() == 0) {
|
|
|
+ if (video.getVideoSq() == null || video.getVideoSq() == 0) {
|
|
|
String videoSeq = goodsDao.getVideoSeq(video);
|
|
|
|
|
|
if (!StringUtils.isBlank(videoSeq)) {
|
|
|
@@ -2295,7 +2291,6 @@ public class TsaGoodsService {
|
|
|
goodsPriceRes.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
goodsPriceRes.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
|
|
|
-
|
|
|
Goods goods = new Goods();
|
|
|
goods.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
goods.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
@@ -2362,7 +2357,7 @@ public class TsaGoodsService {
|
|
|
}
|
|
|
|
|
|
// 2. 일 최초 조회이면 테이블 삭제
|
|
|
- String regYmd = goodsDao.getGoodsNaverLowestPriceReqYmd();
|
|
|
+ String regYmd = goodsDao.getGoodsNaverLowestPriceReqYmd();
|
|
|
if (!StringUtils.isBlank(regYmd) && !regYmd.equals(GagaDateUtil.getToday())) {
|
|
|
goodsDao.deleteGoodsNaverLowestPrice();
|
|
|
}
|
|
|
@@ -2393,7 +2388,7 @@ public class TsaGoodsService {
|
|
|
log.info("saveGoodsNaverLowestPrice 22 = {}", GagaDateUtil.getTodayDateTime());
|
|
|
NaverLowestPrice naverLowestPrice = naverLowestPriceApi.getLowestPrice(goodsCd);
|
|
|
|
|
|
- log.info("[saveGoodsNaverLowestPrice] naverLowestPrice= {}",naverLowestPrice);
|
|
|
+ log.info("[saveGoodsNaverLowestPrice] naverLowestPrice= {}", naverLowestPrice);
|
|
|
if (naverLowestPrice != null) {
|
|
|
GoodsNaverLowestPrice goodsNaverLowestPrice = new GoodsNaverLowestPrice();
|
|
|
goodsNaverLowestPrice.setReqYmd(GagaDateUtil.getToday());
|
|
|
@@ -2496,7 +2491,8 @@ public class TsaGoodsService {
|
|
|
|
|
|
int idx = 0;
|
|
|
for (AdKeywordGoods adKeywordGoods : adKeywordGoodsList) {
|
|
|
- if (idx == 0) goodsDao.deleteAdKeywordGoods(adKeywordGoods); // 전체 상품 삭제
|
|
|
+ if (idx == 0)
|
|
|
+ goodsDao.deleteAdKeywordGoods(adKeywordGoods); // 전체 상품 삭제
|
|
|
adKeywordGoods.setAdKeywordSq(adKeyword.getAdKeywordSq());
|
|
|
adKeywordGoods.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
adKeywordGoods.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
@@ -2550,7 +2546,6 @@ public class TsaGoodsService {
|
|
|
return goodsDao.getReinboundInformList(goodsSearch);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 재입고알림 발송 처리
|
|
|
*
|
|
|
@@ -2626,7 +2621,7 @@ public class TsaGoodsService {
|
|
|
* @since 2020. 12. 21
|
|
|
*/
|
|
|
@Transactional("shopTxnManager")
|
|
|
- public void saveGoodsImageList(Collection<GoodsImg> goodsImgList){
|
|
|
+ public void saveGoodsImageList(Collection<GoodsImg> goodsImgList) {
|
|
|
int index = 0;
|
|
|
for (GoodsImg goodsImg : goodsImgList) {
|
|
|
// 상품이미지 전체 삭제
|
|
|
@@ -2662,7 +2657,7 @@ public class TsaGoodsService {
|
|
|
* @since 2020. 12. 21
|
|
|
*/
|
|
|
@Transactional("shopTxnManager")
|
|
|
- public void updateFreeGoods(FreeGoods freeGoods){
|
|
|
+ public void updateFreeGoods(FreeGoods freeGoods) {
|
|
|
|
|
|
freeGoods.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
goodsDao.updateFreeGoods(freeGoods);
|
|
|
@@ -2699,9 +2694,9 @@ public class TsaGoodsService {
|
|
|
* @since 2021. 01. 05
|
|
|
*/
|
|
|
@Transactional("shopTxnManager")
|
|
|
- public void saveFreeGoods(Collection<WmsGoods> wmsGoodsList){
|
|
|
+ public void saveFreeGoods(Collection<WmsGoods> wmsGoodsList) {
|
|
|
|
|
|
- for (WmsGoods wmsGoods: wmsGoodsList) {
|
|
|
+ for (WmsGoods wmsGoods : wmsGoodsList) {
|
|
|
FreeGoods freeGoods = new FreeGoods();
|
|
|
freeGoods.setProductNo(wmsGoods.getProductNo());
|
|
|
freeGoods.setProductCode(wmsGoods.getProductCode());
|
|
|
@@ -2721,4 +2716,26 @@ public class TsaGoodsService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 고시분류별 상품고시정보 목록
|
|
|
+ * @param goodsNotiInfo - 상품고시정보
|
|
|
+ * @return
|
|
|
+ * @author gagamel
|
|
|
+ * @since 2021. 1. 21
|
|
|
+ */
|
|
|
+ public Collection<GoodsNotiInfo> getGoodsNotiInfoListByNotiClsf(GoodsNotiInfo goodsNotiInfo) {
|
|
|
+ return goodsDao.getGoodsNotiInfoListByNotiClsf(goodsNotiInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 고시분류 칼럼 정보
|
|
|
+ * @param niClsfCd - 고시분류코드
|
|
|
+ * @return
|
|
|
+ * @author gagamel
|
|
|
+ * @since 2021. 1. 21
|
|
|
+ */
|
|
|
+ public GoodsNotiInfo getNotiClsfColumnInfo(String niClsfCd) {
|
|
|
+ return goodsDao.getNotiClsfColumnInfo(niClsfCd);
|
|
|
+ }
|
|
|
+
|
|
|
}
|