|
|
@@ -16,6 +16,7 @@ import com.style24.admin.biz.dao.TsaMorebetterDao;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Collection;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
*마케팅>다다익선 Service
|
|
|
@@ -136,15 +137,12 @@ public class TsaMorebetterService {
|
|
|
* @author bin2107
|
|
|
* @since 2021. 1. 5
|
|
|
*/
|
|
|
- @Transactional("shopTxnManager")
|
|
|
public void saveMoreBetterDetail(MoreBetter moreBetter) {
|
|
|
// <,> replace 처리
|
|
|
moreBetter.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
moreBetter.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
Gson gson = new Gson();
|
|
|
String jsonData = gson.toJson(moreBetter);
|
|
|
- log.info("{ saveMoreBetterDetail jsonData}",jsonData);
|
|
|
- log.info("{ saveMoreBetterDetail moreBetter}",moreBetter);
|
|
|
|
|
|
// TMTB 마스터(TB_TMTB) 저장
|
|
|
morebetterDao.saveMorebetterMst(moreBetter);
|
|
|
@@ -171,16 +169,21 @@ public class TsaMorebetterService {
|
|
|
morebetterDao.saveMorebetterGoods(regBrand);
|
|
|
}
|
|
|
|
|
|
+ List<MoreBetterGoods> realApplyGoodsList = morebetterDao.getMorebetterRealApplyGoodsList(moreBetter);
|
|
|
// 적용상품
|
|
|
- for(MoreBetterGoods regApplyGoods : moreBetter.getApplyGoodsList()){
|
|
|
- // 다다익선 적용대상 설정(TB_TMTB_GOODS) 저장
|
|
|
- regApplyGoods.setTmtbSq(moreBetter.getTmtbSq());
|
|
|
- regApplyGoods.setTargetVal(regApplyGoods.getGoodsCd());
|
|
|
- regApplyGoods.setRegNo(moreBetter.getRegNo());
|
|
|
- regApplyGoods.setUpdNo(moreBetter.getUpdNo());
|
|
|
-
|
|
|
- morebetterDao.saveMorebetterGoods(regApplyGoods);
|
|
|
- morebetterDao.saveMorebetterApplyGoods(regApplyGoods);
|
|
|
+ for(MoreBetterGoods realApplyGoods : realApplyGoodsList){
|
|
|
+ for(MoreBetterGoods regApplyGoods : moreBetter.getApplyGoodsList()){
|
|
|
+ if(regApplyGoods.getGoodsCd().equals(realApplyGoods.getGoodsCd())){
|
|
|
+ // 다다익선 적용대상 설정(TB_TMTB_GOODS) 저장
|
|
|
+ regApplyGoods.setTmtbSq(moreBetter.getTmtbSq());
|
|
|
+ regApplyGoods.setTargetVal(realApplyGoods.getGoodsCd());
|
|
|
+ regApplyGoods.setRegNo(moreBetter.getRegNo());
|
|
|
+ regApplyGoods.setUpdNo(moreBetter.getUpdNo());
|
|
|
+
|
|
|
+ morebetterDao.saveMorebetterGoods(regApplyGoods);
|
|
|
+ morebetterDao.saveMorebetterApplyGoods(regApplyGoods);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 제외상품
|
|
|
@@ -338,6 +341,11 @@ public class TsaMorebetterService {
|
|
|
public void createMorebetterGoodsTemp(MoreBetterGoods moreBetterGoods){
|
|
|
moreBetterGoods.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
|
|
|
+ morebetterDao.deleteTmtbApplyGoodsTemp(moreBetterGoods);
|
|
|
+ for(int i=0; i<moreBetterGoods.getMultiApplyGoods().length; i++){
|
|
|
+ moreBetterGoods.setGoodsCd(moreBetterGoods.getMultiApplyGoods()[i]);
|
|
|
+ morebetterDao.createTmtbApplyGoodsTemp(moreBetterGoods);
|
|
|
+ }
|
|
|
morebetterDao.deleteTmtbGoodsTemp(moreBetterGoods);
|
|
|
morebetterDao.createTmtbGoodsTemp(moreBetterGoods);
|
|
|
}
|