|
|
@@ -126,118 +126,6 @@ public class TsaCouponService {
|
|
|
couponDao.saveCouponBurden(couponBurden);
|
|
|
}
|
|
|
|
|
|
- return "SUCCESS";
|
|
|
- }
|
|
|
- @Transactional("shopTxnManager")
|
|
|
- public String saveCoupon2(Coupon params){
|
|
|
- int cpnId = params.getCpnId(); // 쿠폰ID (신규생성인지 수정인지 구분하기 위해 params의 cpnId를 먼저 가져옴 > 쿠폰 생성시 cpnId를 저장하기때문임)
|
|
|
- params.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
- params.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
-
|
|
|
- couponDao.couponInsert(params);
|
|
|
-
|
|
|
- Gson gson = new Gson();
|
|
|
- Integer sequence;
|
|
|
- // 적용대상 - 공급업체
|
|
|
- /*
|
|
|
- Collection<CouponRefval> supplyCompList = gson.fromJson(params.getSupplyCompList() , new TypeToken<Collection<CouponRefval>>(){}.getType());
|
|
|
- for(CouponRefval supplyComp : supplyCompList) {
|
|
|
- sequence = null;
|
|
|
-
|
|
|
- if(supplyComp.getCpnRefvalSq() != null && supplyComp.getCpnRefvalSq() > 0){
|
|
|
- sequence = supplyComp.getCpnRefvalSq();
|
|
|
- }
|
|
|
-
|
|
|
- supplyComp.setCpnId(cpnId);
|
|
|
- supplyComp.setCpnRefvalSq(sequence);
|
|
|
- supplyComp.setCpnTarget("G260_13");
|
|
|
- supplyComp.setRefVal(supplyComp.getSupplyCompCd());
|
|
|
- supplyComp.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
- supplyComp.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
- couponDao.saveCouponRefVal(supplyComp);
|
|
|
- }
|
|
|
- // 적용대상 - 브랜드
|
|
|
- Collection<CouponRefval> brandList = gson.fromJson(params.getBrandList() , new TypeToken<Collection<CouponRefval>>(){}.getType());
|
|
|
- for(CouponRefval brand : brandList) {
|
|
|
- sequence = null;
|
|
|
-
|
|
|
- if(brand.getCpnRefvalSq() != null && brand.getCpnRefvalSq() > 0){
|
|
|
- sequence = brand.getCpnRefvalSq();
|
|
|
- }
|
|
|
-
|
|
|
- brand.setCpnId(cpnId);
|
|
|
- brand.setCpnRefvalSq(sequence);
|
|
|
- brand.setCpnTarget("G260_12");
|
|
|
- brand.setRefVal(brand.getBrandCd());
|
|
|
- brand.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
- brand.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
-
|
|
|
- couponDao.saveCouponRefVal(brand);
|
|
|
- }
|
|
|
- // 적용대상 - 적용상품
|
|
|
- Collection<CouponRefval> applyGoodsList = gson.fromJson(params.getApplyGoodsList() , new TypeToken<Collection<CouponRefval>>(){}.getType());
|
|
|
- for(CouponRefval applyGoods : applyGoodsList ) {
|
|
|
- sequence = null;
|
|
|
-
|
|
|
- if(applyGoods.getCpnRefvalSq() != null && applyGoods.getCpnRefvalSq() > 0){
|
|
|
- sequence = applyGoods.getCpnRefvalSq();
|
|
|
- }
|
|
|
- applyGoods.setCpnId(cpnId);
|
|
|
- applyGoods.setCpnRefvalSq(sequence);
|
|
|
- applyGoods.setCpnTarget("G260_10");
|
|
|
- applyGoods.setRefVal(applyGoods.getGoodsCd());
|
|
|
- applyGoods.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
- applyGoods.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
-
|
|
|
- couponDao.saveCouponRefVal(applyGoods);
|
|
|
- }
|
|
|
- // 적용대상 - 카테고리
|
|
|
- Collection<CouponRefval> cateList = gson.fromJson(params.getCateList() , new TypeToken<Collection<CouponRefval>>(){}.getType());
|
|
|
- for(CouponRefval cate : cateList ) {
|
|
|
- sequence = null;
|
|
|
-
|
|
|
- if(cate.getCpnRefvalSq() != null && cate.getCpnRefvalSq() > 0){
|
|
|
- sequence = cate.getCpnRefvalSq();
|
|
|
- }
|
|
|
- cate.setCpnId(cpnId);
|
|
|
- cate.setCpnRefvalSq(sequence);
|
|
|
- cate.setCpnTarget("G260_11");
|
|
|
- cate.setRefVal(cate.getCateNo());
|
|
|
- cate.setRefFormalGb(cate.getFormalGb());
|
|
|
- cate.setRefBrandCd(cate.getBrandCd()); // ag-grid 브랜드코드
|
|
|
- cate.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
- cate.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
-
|
|
|
- couponDao.saveCouponRefVal(cate);
|
|
|
- }
|
|
|
- // 적용대상 - 제외상품
|
|
|
- Collection<CouponRefval> exceptGoodsList = gson.fromJson(params.getExceptGoodsList() , new TypeToken<Collection<CouponRefval>>(){}.getType());
|
|
|
- for(CouponRefval exceptGoods: exceptGoodsList ) {
|
|
|
- sequence = null;
|
|
|
-
|
|
|
- if(exceptGoods.getCpnRefvalSq() != null && exceptGoods.getCpnRefvalSq() > 0){
|
|
|
- sequence = exceptGoods.getCpnRefvalSq();
|
|
|
- }
|
|
|
-
|
|
|
- exceptGoods.setCpnId(cpnId);
|
|
|
- exceptGoods.setCpnRefvalSq(sequence);
|
|
|
- exceptGoods.setCpnTarget("G260_14");
|
|
|
- exceptGoods.setRefVal(exceptGoods.getGoodsCd());
|
|
|
- exceptGoods.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
- exceptGoods.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
-
|
|
|
- couponDao.saveCouponRefVal(exceptGoods);
|
|
|
- }
|
|
|
- // 입점업체분담율
|
|
|
- Collection<CouponBurden> burdenList = gson.fromJson(params.getBurdenList() , new TypeToken<Collection<CouponBurden>>(){}.getType());
|
|
|
- for(CouponBurden burden: burdenList ) {
|
|
|
- burden.setCpnId(cpnId);
|
|
|
- burden.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
- burden.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
-
|
|
|
- couponDao.saveCouponBurden(burden);
|
|
|
- }
|
|
|
- */
|
|
|
// 수정모드이고 변경된 쿠폰상태가 대기 , 중지 인경우 고객이 발급받은 내용도 변경
|
|
|
if(cpnId != 0 &&
|
|
|
(params.getCpnStat().equals("G232_10") || params.getCpnStat().equals("G232_12")) ) {
|
|
|
@@ -511,4 +399,37 @@ public class TsaCouponService {
|
|
|
public void saveCouponIssue(CustCoupon coupon) {
|
|
|
couponDao.saveCouponCustPub(coupon);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 쿠폰사용가능고객구분 조회
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ * @author bin2107
|
|
|
+ * @since 2021-02-02
|
|
|
+ */
|
|
|
+ public ArrayList<Coupon> getCouponCustGbList(int cpnId) {
|
|
|
+ return couponDao.getCouponCustGbList(cpnId);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 쿠폰사용가능고객등급 조회
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ * @author bin2107
|
|
|
+ * @since 2021-02-02
|
|
|
+ */
|
|
|
+ public ArrayList<Coupon> getCouponCustGradeList(int cpnId) {
|
|
|
+ return couponDao.getCouponCustGradeList(cpnId);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 쿠폰사용가능결제수단 조회
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ * @author bin2107
|
|
|
+ * @since 2021-02-02
|
|
|
+ */
|
|
|
+ public ArrayList<Coupon> getCouponPayTypeList(int cpnId) {
|
|
|
+ return couponDao.getCouponPayTypeList(cpnId);
|
|
|
+ }
|
|
|
}
|