|
@@ -8,9 +8,7 @@ import java.util.Date;
|
|
|
|
|
|
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.Gson;
|
|
|
import com.google.gson.reflect.TypeToken;
|
|
import com.google.gson.reflect.TypeToken;
|
|
|
-import com.style24.persistence.domain.CommonCode;
|
|
|
|
|
-import com.style24.persistence.domain.CouponBurden;
|
|
|
|
|
-import com.style24.persistence.domain.CouponRefval;
|
|
|
|
|
|
|
+import com.style24.persistence.domain.*;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -20,7 +18,6 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.style24.admin.biz.dao.TsaCouponDao;
|
|
import com.style24.admin.biz.dao.TsaCouponDao;
|
|
|
import com.style24.admin.support.security.session.TsaSession;
|
|
import com.style24.admin.support.security.session.TsaSession;
|
|
|
-import com.style24.persistence.domain.Coupon;
|
|
|
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
|
@@ -70,10 +67,9 @@ public class TsaCouponService {
|
|
|
Collection<CouponRefval> supplyCompList = gson.fromJson(params.getSupplyCompList() , new TypeToken<Collection<CouponRefval>>(){}.getType());
|
|
Collection<CouponRefval> supplyCompList = gson.fromJson(params.getSupplyCompList() , new TypeToken<Collection<CouponRefval>>(){}.getType());
|
|
|
for(CouponRefval supplyComp : supplyCompList) {
|
|
for(CouponRefval supplyComp : supplyCompList) {
|
|
|
sequence = null;
|
|
sequence = null;
|
|
|
|
|
+
|
|
|
if(supplyComp.getCpnRefvalSq() != null && supplyComp.getCpnRefvalSq() > 0){
|
|
if(supplyComp.getCpnRefvalSq() != null && supplyComp.getCpnRefvalSq() > 0){
|
|
|
sequence = supplyComp.getCpnRefvalSq();
|
|
sequence = supplyComp.getCpnRefvalSq();
|
|
|
- } else {
|
|
|
|
|
- sequence = commonService.getNextSequence("SEQ_COUPON_REFVAL");
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
supplyComp.setCpnId(cpnId);
|
|
supplyComp.setCpnId(cpnId);
|
|
@@ -88,10 +84,9 @@ public class TsaCouponService {
|
|
|
Collection<CouponRefval> brandList = gson.fromJson(params.getBrandList() , new TypeToken<Collection<CouponRefval>>(){}.getType());
|
|
Collection<CouponRefval> brandList = gson.fromJson(params.getBrandList() , new TypeToken<Collection<CouponRefval>>(){}.getType());
|
|
|
for(CouponRefval brand : brandList) {
|
|
for(CouponRefval brand : brandList) {
|
|
|
sequence = null;
|
|
sequence = null;
|
|
|
|
|
+
|
|
|
if(brand.getCpnRefvalSq() != null && brand.getCpnRefvalSq() > 0){
|
|
if(brand.getCpnRefvalSq() != null && brand.getCpnRefvalSq() > 0){
|
|
|
sequence = brand.getCpnRefvalSq();
|
|
sequence = brand.getCpnRefvalSq();
|
|
|
- } else {
|
|
|
|
|
- sequence = commonService.getNextSequence("SEQ_COUPON_REFVAL");
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
brand.setCpnId(cpnId);
|
|
brand.setCpnId(cpnId);
|
|
@@ -107,10 +102,9 @@ public class TsaCouponService {
|
|
|
Collection<CouponRefval> applyGoodsList = gson.fromJson(params.getApplyGoodsList() , new TypeToken<Collection<CouponRefval>>(){}.getType());
|
|
Collection<CouponRefval> applyGoodsList = gson.fromJson(params.getApplyGoodsList() , new TypeToken<Collection<CouponRefval>>(){}.getType());
|
|
|
for(CouponRefval applyGoods : applyGoodsList ) {
|
|
for(CouponRefval applyGoods : applyGoodsList ) {
|
|
|
sequence = null;
|
|
sequence = null;
|
|
|
|
|
+
|
|
|
if(applyGoods.getCpnRefvalSq() != null && applyGoods.getCpnRefvalSq() > 0){
|
|
if(applyGoods.getCpnRefvalSq() != null && applyGoods.getCpnRefvalSq() > 0){
|
|
|
sequence = applyGoods.getCpnRefvalSq();
|
|
sequence = applyGoods.getCpnRefvalSq();
|
|
|
- } else {
|
|
|
|
|
- sequence = commonService.getNextSequence("SEQ_COUPON_REFVAL");
|
|
|
|
|
}
|
|
}
|
|
|
applyGoods.setCpnId(cpnId);
|
|
applyGoods.setCpnId(cpnId);
|
|
|
applyGoods.setCpnRefvalSq(sequence);
|
|
applyGoods.setCpnRefvalSq(sequence);
|
|
@@ -125,10 +119,9 @@ public class TsaCouponService {
|
|
|
Collection<CouponRefval> cateList = gson.fromJson(params.getCateList() , new TypeToken<Collection<CouponRefval>>(){}.getType());
|
|
Collection<CouponRefval> cateList = gson.fromJson(params.getCateList() , new TypeToken<Collection<CouponRefval>>(){}.getType());
|
|
|
for(CouponRefval cate : cateList ) {
|
|
for(CouponRefval cate : cateList ) {
|
|
|
sequence = null;
|
|
sequence = null;
|
|
|
|
|
+
|
|
|
if(cate.getCpnRefvalSq() != null && cate.getCpnRefvalSq() > 0){
|
|
if(cate.getCpnRefvalSq() != null && cate.getCpnRefvalSq() > 0){
|
|
|
sequence = cate.getCpnRefvalSq();
|
|
sequence = cate.getCpnRefvalSq();
|
|
|
- } else {
|
|
|
|
|
- sequence = commonService.getNextSequence("SEQ_COUPON_REFVAL");
|
|
|
|
|
}
|
|
}
|
|
|
cate.setCpnId(cpnId);
|
|
cate.setCpnId(cpnId);
|
|
|
cate.setCpnRefvalSq(sequence);
|
|
cate.setCpnRefvalSq(sequence);
|
|
@@ -145,11 +138,11 @@ public class TsaCouponService {
|
|
|
Collection<CouponRefval> exceptGoodsList = gson.fromJson(params.getExceptGoodsList() , new TypeToken<Collection<CouponRefval>>(){}.getType());
|
|
Collection<CouponRefval> exceptGoodsList = gson.fromJson(params.getExceptGoodsList() , new TypeToken<Collection<CouponRefval>>(){}.getType());
|
|
|
for(CouponRefval exceptGoods: exceptGoodsList ) {
|
|
for(CouponRefval exceptGoods: exceptGoodsList ) {
|
|
|
sequence = null;
|
|
sequence = null;
|
|
|
|
|
+
|
|
|
if(exceptGoods.getCpnRefvalSq() != null && exceptGoods.getCpnRefvalSq() > 0){
|
|
if(exceptGoods.getCpnRefvalSq() != null && exceptGoods.getCpnRefvalSq() > 0){
|
|
|
sequence = exceptGoods.getCpnRefvalSq();
|
|
sequence = exceptGoods.getCpnRefvalSq();
|
|
|
- } else {
|
|
|
|
|
- sequence = commonService.getNextSequence("SEQ_COUPON_REFVAL");
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
exceptGoods.setCpnId(cpnId);
|
|
exceptGoods.setCpnId(cpnId);
|
|
|
exceptGoods.setCpnRefvalSq(sequence);
|
|
exceptGoods.setCpnRefvalSq(sequence);
|
|
|
exceptGoods.setCpnTarget("G260_14");
|
|
exceptGoods.setCpnTarget("G260_14");
|
|
@@ -317,14 +310,40 @@ public class TsaCouponService {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 쿠폰 적용대상 삭제
|
|
* 쿠폰 적용대상 삭제
|
|
|
- * @param coupon
|
|
|
|
|
|
|
+ * @param couponRefval
|
|
|
* @return
|
|
* @return
|
|
|
* @author xyzp1539
|
|
* @author xyzp1539
|
|
|
* @since 2021-01-19
|
|
* @since 2021-01-19
|
|
|
*/
|
|
*/
|
|
|
@Transactional("shopTxnManager")
|
|
@Transactional("shopTxnManager")
|
|
|
- public void updateCouponRefval(Coupon coupon) {
|
|
|
|
|
- coupon.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
|
|
- couponDao.updateCouponRefval(coupon);
|
|
|
|
|
|
|
+ public void updateCouponRefval(CouponRefval couponRefval) {
|
|
|
|
|
+ couponRefval.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
|
|
+ couponDao.updateCouponRefval(couponRefval);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 고객 쿠폰
|
|
|
|
|
+ * @param
|
|
|
|
|
+ * @return
|
|
|
|
|
+ * @author xyzp1539
|
|
|
|
|
+ * @since 2021-01-21
|
|
|
|
|
+ */
|
|
|
|
|
+ @Transactional("shopTxnManager")
|
|
|
|
|
+ public void saveCouponCustPub(CustCoupon custCoupon) {
|
|
|
|
|
+ Gson gson = new Gson();
|
|
|
|
|
+
|
|
|
|
|
+ Collection<CustCoupon> custPubList = gson.fromJson(custCoupon.getCustList() , new TypeToken<Collection<CustCoupon>>(){}.getType());
|
|
|
|
|
+ for(CustCoupon custPub : custPubList ) {
|
|
|
|
|
+ custPub.setCpnId(custCoupon.getCpnId());
|
|
|
|
|
+ custPub.setAvailStdt(custCoupon.getAvailStdt());
|
|
|
|
|
+ custPub.setAvailEddt(custCoupon.getAvailEddt());
|
|
|
|
|
+ custPub.setPubReason(custCoupon.getPubReason());
|
|
|
|
|
+ custPub.setPubReasonDtl(custCoupon.getPubReasonDtl());
|
|
|
|
|
+ custPub.setEndAlimSendYn(custCoupon.getEndAlimSendYn());
|
|
|
|
|
+ custPub.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
|
|
+ custPub.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
|
|
+
|
|
|
|
|
+ couponDao.saveCouponCustPub(custPub);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|