|
|
@@ -0,0 +1,63 @@
|
|
|
+package com.style24.batch.biz.job.marketing;
|
|
|
+
|
|
|
+import java.util.Collection;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import com.gagaframework.web.parameter.GagaMap;
|
|
|
+import com.style24.batch.biz.job.TsbAbstractJob;
|
|
|
+import com.style24.batch.biz.service.TsbPointService;
|
|
|
+import com.style24.batch.support.env.TsbConstants;
|
|
|
+import com.style24.persistence.domain.Point;
|
|
|
+
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+
|
|
|
+@Component
|
|
|
+@Slf4j
|
|
|
+public class TsbExpirePointJob extends TsbAbstractJob<Collection<Point>, GagaMap, GagaMap> {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ TsbPointService pointService;
|
|
|
+
|
|
|
+ private int succCnt = 0;
|
|
|
+ private int failCnt = 0;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Collection<Point> read() throws Exception {
|
|
|
+ Point point = new Point();
|
|
|
+ return pointService.getExpirePointList(point);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public GagaMap process(Collection<Point> readItem) throws Exception {
|
|
|
+ Point point1 = new Point();
|
|
|
+ point1.setUpdNo(TsbConstants.REG_NO);
|
|
|
+ pointService.updateCustPointExpire(point1);
|
|
|
+
|
|
|
+ for (Point point2 : readItem) {
|
|
|
+ try {
|
|
|
+ point2.setRegNo(TsbConstants.REG_NO);
|
|
|
+ point2.setUpdNo(TsbConstants.REG_NO);
|
|
|
+ point2.setPntAmt(point2.getRmPntAmt()* -1);
|
|
|
+ pointService.saveExpirePointHst(point2);
|
|
|
+ succCnt++;
|
|
|
+ } catch (Exception e) {
|
|
|
+ failCnt++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public GagaMap write(GagaMap convertedItem) throws Exception {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void notify(GagaMap resultItem) throws Exception {
|
|
|
+ super.printResult(succCnt, failCnt);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|