From 8f7b99b0a3d53f4410e8b1f2f209ce2743f0a944 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Thu, 08 Apr 2021 20:14:44 +0800
Subject: [PATCH] 20210408 核销

---
 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSignAction.java |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSignAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSignAction.java
index 5149a5b..8ebd7e9 100644
--- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSignAction.java
+++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSignAction.java
@@ -11,9 +11,11 @@
 import com.matrix.system.activity.dao.ActivitySignAwardSetDao;
 import com.matrix.system.activity.dao.ActivitySignReceiveRecordDao;
 import com.matrix.system.activity.dao.ActivitySignRecordDao;
+import com.matrix.system.activity.dao.ActivitySignWriteoffDao;
 import com.matrix.system.activity.entity.ActivitySignAwardSet;
 import com.matrix.system.activity.entity.ActivitySignReceiveRecord;
 import com.matrix.system.activity.entity.ActivitySignRecord;
+import com.matrix.system.activity.entity.ActivitySignWriteoff;
 import com.matrix.system.hive.bean.SysVipInfo;
 import com.matrix.system.shopXcx.api.dto.ClickSignDTO;
 import com.matrix.system.shopXcx.api.vo.ActivitySignAwardSetVo;
@@ -50,6 +52,9 @@
 	
 	@Autowired
 	private ActivitySignReceiveRecordDao activitySignReceiveRecordDao;
+	
+	@Autowired
+	private ActivitySignWriteoffDao activitySignWriteoffDao;
 	
 	@Autowired
 	private ActivitySignRecordDao activitySignRecordDao;
@@ -115,6 +120,7 @@
          * 是否已领取
          * 查询是否有签到奖品
          * 		日常奖励和自定义奖品
+         * 			生成核销记录
          */
         //活动是否存在
         ShopActivities shopActivities = shopActivitiesDao.selectById(actId);
@@ -262,6 +268,27 @@
         		signSuccessVo.setCouponName(activitySignAwardSetCumulativeDay.getCouponName());
         	}
         	activitySignReceiveRecordDao.insert(activitySignReceiveRecord);
+        	//生成核销记录
+        	if(ActivitySignAwardSet.AWARDTYPE_CUSTOMIZE == activitySignAwardSetCumulativeDay.getAwardType()) {
+	        	ActivitySignWriteoff activitySignWriteoff = new ActivitySignWriteoff();
+	        	//线下兑换和客服兑换
+	        	if(ActivitySignAwardSet.AWARDWAY_ONE == activitySignAwardSetCumulativeDay.getAwardWay()
+	        			|| ActivitySignAwardSet.AWARDWAY_THREE == activitySignAwardSetCumulativeDay.getAwardWay()) {
+	        		activitySignWriteoff.setWriteoffCode(activitySignReceiveRecord.getWriteOffCode());
+	        	}
+	        	activitySignWriteoff.setActId(actId);
+	        	activitySignWriteoff.setAwardId(activitySignAwardSetCumulativeDay.getId());
+	        	activitySignWriteoff.setWinTime(date);
+	        	activitySignWriteoff.setState(ActivitySignWriteoff.STATE_ONE);
+	        	activitySignWriteoff.setUserId(userId);
+	        	activitySignWriteoff.setCompanyId(companyId);
+	        	activitySignWriteoff.setReceiveId(activitySignReceiveRecord.getId());
+	        	activitySignWriteoff.setCreateBy(user.getName());
+	        	activitySignWriteoff.setCreateTime(new Date());
+	        	activitySignWriteoff.setUpdateBy(user.getName());
+	        	activitySignWriteoff.setUpdateTime(new Date());
+	        	activitySignWriteoffDao.insert(activitySignWriteoff);
+        	}
         }
         
         AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("签到成功");

--
Gitblit v1.9.1