|
|
@@ -1,18 +1,31 @@
|
|
|
package com.fs.course.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.lang.TypeReference;
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
import com.fs.common.utils.DateUtils;
|
|
|
import com.fs.common.utils.DictUtils;
|
|
|
+import com.fs.common.utils.SecurityUtils;
|
|
|
import com.fs.company.domain.Company;
|
|
|
import com.fs.company.mapper.CompanyMapper;
|
|
|
import com.fs.course.domain.FsCourseCheckinActivity;
|
|
|
import com.fs.course.domain.FsCourseCheckinPrize;
|
|
|
+import com.fs.course.domain.FsCourseCheckinWarningQuery;
|
|
|
+import com.fs.course.domain.FsCourseCheckinWarningVO;
|
|
|
+import com.fs.course.domain.FsUserCompanyUser;
|
|
|
import com.fs.course.mapper.FsCourseCheckinActivityMapper;
|
|
|
import com.fs.course.mapper.FsCourseCheckinPrizeMapper;
|
|
|
import com.fs.course.mapper.FsCourseCheckinReceiveMapper;
|
|
|
import com.fs.course.mapper.FsCourseCheckinUserMapper;
|
|
|
import com.fs.course.service.IFsCourseCheckinActivityService;
|
|
|
+import com.fs.course.service.IFsUserCompanyUserService;
|
|
|
+import com.fs.crm.domain.CrmMsg;
|
|
|
+import com.fs.crm.service.ICrmMsgService;
|
|
|
import com.fs.his.domain.FsIntegralGoods;
|
|
|
+import com.fs.his.domain.FsIntegralOrder;
|
|
|
import com.fs.his.mapper.FsIntegralGoodsMapper;
|
|
|
+import com.fs.his.mapper.FsIntegralOrderMapper;
|
|
|
+import com.fs.his.utils.PhoneUtil;
|
|
|
+import com.fs.his.utils.RedisCacheUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@@ -20,7 +33,12 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Calendar;
|
|
|
import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.HashSet;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Set;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 看课打卡活动Service业务层处理
|
|
|
@@ -46,9 +64,21 @@ public class FsCourseCheckinActivityServiceImpl implements IFsCourseCheckinActiv
|
|
|
@Autowired
|
|
|
private FsIntegralGoodsMapper fsIntegralGoodsMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private FsIntegralOrderMapper fsIntegralOrderMapper;
|
|
|
+
|
|
|
@Autowired
|
|
|
private CompanyMapper companyMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ICrmMsgService crmMsgService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IFsUserCompanyUserService fsUserCompanyUserService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private RedisCacheUtil redisCacheUtil;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 查询看课打卡活动
|
|
|
@@ -247,6 +277,12 @@ public class FsCourseCheckinActivityServiceImpl implements IFsCourseCheckinActiv
|
|
|
}
|
|
|
// 批量插入奖品
|
|
|
fsCourseCheckinPrizeMapper.batchInsertFsCourseCheckinPrize(prizeList);
|
|
|
+ // 清除缓存
|
|
|
+ for (FsCourseCheckinPrize prize : prizeList) {
|
|
|
+ if (prize.getGoodsId() != null) {
|
|
|
+ redisCacheUtil.delRedisKey("getIntegralGoodsById::" + prize.getGoodsId());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
@@ -283,6 +319,8 @@ public class FsCourseCheckinActivityServiceImpl implements IFsCourseCheckinActiv
|
|
|
// 更新活动
|
|
|
int result = updateFsCourseCheckinActivity(fsCourseCheckinActivity);
|
|
|
if (result > 0 && prizeList != null) {
|
|
|
+ // 查询原有奖品用于清除缓存
|
|
|
+ List<FsCourseCheckinPrize> oldPrizeList = fsCourseCheckinPrizeMapper.selectFsCourseCheckinPrizeByActivityId(fsCourseCheckinActivity.getActivityId());
|
|
|
// 删除原有奖品
|
|
|
fsCourseCheckinPrizeMapper.deleteFsCourseCheckinPrizeByActivityId(fsCourseCheckinActivity.getActivityId());
|
|
|
// 插入新奖品
|
|
|
@@ -294,6 +332,20 @@ public class FsCourseCheckinActivityServiceImpl implements IFsCourseCheckinActiv
|
|
|
setPrizeName(prize);
|
|
|
}
|
|
|
fsCourseCheckinPrizeMapper.batchInsertFsCourseCheckinPrize(prizeList);
|
|
|
+ // 清除新奖品缓存
|
|
|
+ for (FsCourseCheckinPrize prize : prizeList) {
|
|
|
+ if (prize.getGoodsId() != null) {
|
|
|
+ redisCacheUtil.delRedisKey("getIntegralGoodsById::" + prize.getGoodsId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 清除旧奖品缓存
|
|
|
+ if (oldPrizeList != null) {
|
|
|
+ for (FsCourseCheckinPrize prize : oldPrizeList) {
|
|
|
+ if (prize.getGoodsId() != null) {
|
|
|
+ redisCacheUtil.delRedisKey("getIntegralGoodsById::" + prize.getGoodsId());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return result;
|
|
|
@@ -309,27 +361,41 @@ public class FsCourseCheckinActivityServiceImpl implements IFsCourseCheckinActiv
|
|
|
@Transactional
|
|
|
public int deleteFsCourseCheckinActivityByActivityIds(Long[] activityIds) {
|
|
|
for (Long activityId : activityIds) {
|
|
|
+ // 查询奖品列表用于清除缓存
|
|
|
+ List<FsCourseCheckinPrize> prizeList = fsCourseCheckinPrizeMapper.selectFsCourseCheckinPrizeByActivityId(activityId);
|
|
|
// 删除关联数据
|
|
|
fsCourseCheckinPrizeMapper.deleteFsCourseCheckinPrizeByActivityId(activityId);
|
|
|
fsCourseCheckinUserMapper.deleteFsCourseCheckinUserByActivityId(activityId);
|
|
|
fsCourseCheckinReceiveMapper.deleteFsCourseCheckinReceiveByActivityId(activityId);
|
|
|
+ // 清除缓存
|
|
|
+ if (prizeList != null) {
|
|
|
+ for (FsCourseCheckinPrize prize : prizeList) {
|
|
|
+ if (prize.getGoodsId() != null) {
|
|
|
+ redisCacheUtil.delRedisKey("getIntegralGoodsById::" + prize.getGoodsId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
return fsCourseCheckinActivityMapper.deleteFsCourseCheckinActivityByActivityIds(activityIds);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 删除看课打卡活动信息
|
|
|
- *
|
|
|
- * @param activityId 看课打卡活动主键
|
|
|
- * @return 结果
|
|
|
- */
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public int deleteFsCourseCheckinActivityByActivityId(Long activityId) {
|
|
|
+ // 查询奖品列表用于清除缓存
|
|
|
+ List<FsCourseCheckinPrize> prizeList = fsCourseCheckinPrizeMapper.selectFsCourseCheckinPrizeByActivityId(activityId);
|
|
|
// 删除关联数据
|
|
|
fsCourseCheckinPrizeMapper.deleteFsCourseCheckinPrizeByActivityId(activityId);
|
|
|
fsCourseCheckinUserMapper.deleteFsCourseCheckinUserByActivityId(activityId);
|
|
|
fsCourseCheckinReceiveMapper.deleteFsCourseCheckinReceiveByActivityId(activityId);
|
|
|
+ // 清除缓存
|
|
|
+ if (prizeList != null) {
|
|
|
+ for (FsCourseCheckinPrize prize : prizeList) {
|
|
|
+ if (prize.getGoodsId() != null) {
|
|
|
+ redisCacheUtil.delRedisKey("getIntegralGoodsById::" + prize.getGoodsId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
return fsCourseCheckinActivityMapper.deleteFsCourseCheckinActivityByActivityId(activityId);
|
|
|
}
|
|
|
|
|
|
@@ -412,4 +478,279 @@ public class FsCourseCheckinActivityServiceImpl implements IFsCourseCheckinActiv
|
|
|
return "";
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 复制活动
|
|
|
+ * 复制源活动,只修改活动时间
|
|
|
+ *
|
|
|
+ * @param activityId 源活动ID
|
|
|
+ * @param startTime 新的开始时间
|
|
|
+ * @param endTime 新的结束时间
|
|
|
+ * @return 新活动ID
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @Transactional
|
|
|
+ public Long copyActivity(Long activityId, Date startTime, Date endTime) {
|
|
|
+ // 1. 查询源活动
|
|
|
+ FsCourseCheckinActivity sourceActivity = fsCourseCheckinActivityMapper.selectFsCourseCheckinActivityByActivityId(activityId);
|
|
|
+ if (sourceActivity == null) {
|
|
|
+ throw new RuntimeException("源活动不存在");
|
|
|
+ }
|
|
|
+ if (startTime == null || endTime == null) {
|
|
|
+ throw new RuntimeException("时间格式不正确");
|
|
|
+ }
|
|
|
+ if (endTime.before(startTime)) {
|
|
|
+ throw new RuntimeException("结束时间不能早于开始时间");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 3. 计算打卡天数(根据时间范围自动计算)
|
|
|
+ int checkinDays = calculateCheckinDays(startTime, endTime);
|
|
|
+
|
|
|
+ // 4. 创建新活动
|
|
|
+ FsCourseCheckinActivity newActivity = new FsCourseCheckinActivity();
|
|
|
+ newActivity.setActivityName(sourceActivity.getActivityName() + "_复制");
|
|
|
+ newActivity.setStartTime(startTime);
|
|
|
+ newActivity.setEndTime(endTime);
|
|
|
+ newActivity.setCheckinDays(checkinDays); // 自动计算打卡天数
|
|
|
+ newActivity.setCompanyIds(sourceActivity.getCompanyIds());
|
|
|
+ newActivity.setProjectIds(sourceActivity.getProjectIds());
|
|
|
+ newActivity.setNotifyTemplate(sourceActivity.getNotifyTemplate());
|
|
|
+ newActivity.setStatus(0); // 未开始
|
|
|
+ newActivity.setCreateTime(DateUtils.getNowDate());
|
|
|
+ newActivity.setCreateBy(SecurityUtils.getUsername());
|
|
|
+ newActivity.setRemark(sourceActivity.getRemark());
|
|
|
+
|
|
|
+ // 4. 插入新活动
|
|
|
+ fsCourseCheckinActivityMapper.insertFsCourseCheckinActivity(newActivity);
|
|
|
+ Long newActivityId = newActivity.getActivityId();
|
|
|
+
|
|
|
+ // 5. 复制奖品
|
|
|
+ List<FsCourseCheckinPrize> prizeList = fsCourseCheckinPrizeMapper.selectFsCourseCheckinPrizeByActivityId(activityId);
|
|
|
+ if (prizeList != null && !prizeList.isEmpty()) {
|
|
|
+ for (FsCourseCheckinPrize prize : prizeList) {
|
|
|
+ FsCourseCheckinPrize newPrize = new FsCourseCheckinPrize();
|
|
|
+ newPrize.setActivityId(newActivityId);
|
|
|
+ newPrize.setPrizeType(prize.getPrizeType());
|
|
|
+ newPrize.setPrizeName(prize.getPrizeName());
|
|
|
+ newPrize.setRedpacketAmount(prize.getRedpacketAmount());
|
|
|
+ newPrize.setGoodsId(prize.getGoodsId());
|
|
|
+ newPrize.setSort(prize.getSort());
|
|
|
+ newPrize.setCreateTime(DateUtils.getNowDate());
|
|
|
+ newPrize.setCreateBy(SecurityUtils.getUsername());
|
|
|
+ newPrize.setRemark(prize.getRemark());
|
|
|
+ fsCourseCheckinPrizeMapper.insertFsCourseCheckinPrize(newPrize);
|
|
|
+ // 清除缓存
|
|
|
+ if (newPrize.getGoodsId() != null) {
|
|
|
+ redisCacheUtil.delRedisKey("getIntegralGoodsById::" + newPrize.getGoodsId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return newActivityId;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询活动预警管理列表
|
|
|
+ *
|
|
|
+ * @param query 查询参数
|
|
|
+ * @return 预警列表
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<FsCourseCheckinWarningVO> selectWarningList(FsCourseCheckinWarningQuery query) {
|
|
|
+ if (query != null && query.getPhone() != null && !query.getPhone().isEmpty()) {
|
|
|
+ if (query.getPhone().length() <= 11) {
|
|
|
+ query.setPhone(PhoneUtil.encryptPhone(query.getPhone()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<FsCourseCheckinWarningVO> list = fsCourseCheckinUserMapper.selectWarningList(query);
|
|
|
+
|
|
|
+ Set<Long> userIds = list.stream()
|
|
|
+ .filter(vo -> vo.getPrizeType() != null && vo.getPrizeType() == 2
|
|
|
+ && vo.getGoodsId() != null && vo.getUserId() != null)
|
|
|
+ .map(FsCourseCheckinWarningVO::getUserId)
|
|
|
+ .collect(Collectors.toSet());
|
|
|
+
|
|
|
+ Map<String, Integer> orderStatusMap = new HashMap<>();
|
|
|
+ if (!userIds.isEmpty()) {
|
|
|
+ FsIntegralOrder orderQuery = new FsIntegralOrder();
|
|
|
+ orderQuery.setUserIds(new ArrayList<>(userIds));
|
|
|
+ List<FsIntegralOrder> orders = fsIntegralOrderMapper.selectFsIntegralOrderList(orderQuery);
|
|
|
+
|
|
|
+ for (FsIntegralOrder order : orders) {
|
|
|
+ if (order.getUserId() != null && order.getItemJson() != null) {
|
|
|
+ String itemJson = order.getItemJson();
|
|
|
+
|
|
|
+ try {
|
|
|
+ if (itemJson.startsWith("[")) {
|
|
|
+ List<FsIntegralGoods> goodsList = JSONUtil.toBean(itemJson, new TypeReference<List<FsIntegralGoods>>() {}, false);
|
|
|
+ for (FsIntegralGoods goods : goodsList) {
|
|
|
+ if (goods.getGoodsId() != null) {
|
|
|
+ String key = order.getUserId() + "_" + goods.getGoodsId();
|
|
|
+ orderStatusMap.put(key, order.getStatus());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ FsIntegralGoods goods = JSONUtil.toBean(itemJson, FsIntegralGoods.class);
|
|
|
+ if (goods.getGoodsId() != null) {
|
|
|
+ String key = order.getUserId() + "_" + goods.getGoodsId();
|
|
|
+ orderStatusMap.put(key, order.getStatus());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (FsCourseCheckinWarningVO vo : list) {
|
|
|
+ if (vo.getCheckinDays() != null && vo.getCurrentCheckinDays() != null) {
|
|
|
+ vo.setRemainingDays(Math.max(0, vo.getCheckinDays() - vo.getCurrentCheckinDays()));
|
|
|
+ }
|
|
|
+
|
|
|
+ boolean isCheckinCompleted = vo.getCurrentCheckinDays() != null
|
|
|
+ && vo.getCheckinDays() != null
|
|
|
+ && vo.getCurrentCheckinDays() >= vo.getCheckinDays();
|
|
|
+ vo.setIsCompleted(isCheckinCompleted ? 1 : 0);
|
|
|
+
|
|
|
+ Integer orderStatus = null;
|
|
|
+ if (vo.getPrizeType() != null && vo.getPrizeType() == 2
|
|
|
+ && vo.getGoodsId() != null && vo.getUserId() != null) {
|
|
|
+ String key = vo.getUserId() + "_" + vo.getGoodsId();
|
|
|
+ orderStatus = orderStatusMap.get(key);
|
|
|
+ }
|
|
|
+ vo.setOrderStatus(orderStatus);
|
|
|
+
|
|
|
+ boolean isShipped = orderStatus != null && orderStatus >= 2;
|
|
|
+ vo.setIsShipped(isShipped ? 1 : 0);
|
|
|
+
|
|
|
+ if (!isCheckinCompleted) {
|
|
|
+ vo.setStatus(1);
|
|
|
+ vo.setStatusText("未完成打卡");
|
|
|
+ } else if (vo.getRewardStatus() == null) {
|
|
|
+ vo.setStatus(2);
|
|
|
+ vo.setStatusText("已完成打卡未领取");
|
|
|
+ } else if (vo.getRewardStatus() == 0) {
|
|
|
+ vo.setStatus(3);
|
|
|
+ vo.setStatusText("已领取待发放");
|
|
|
+ } else if (vo.getRewardStatus() == 1) {
|
|
|
+ if (vo.getPrizeType() != null && vo.getPrizeType() == 2) {
|
|
|
+ if (isShipped) {
|
|
|
+ vo.setStatus(6);
|
|
|
+ vo.setStatusText("积分商品已发货");
|
|
|
+ } else {
|
|
|
+ vo.setStatus(5);
|
|
|
+ vo.setStatusText("积分商品待发货");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ vo.setStatus(4);
|
|
|
+ vo.setStatusText("红包已到账");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (vo.getPrizeType() != null) {
|
|
|
+ vo.setPrizeTypeText(vo.getPrizeType() == 1 ? "红包" : "积分商品券");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (vo.getPhone() != null && !vo.getPhone().isEmpty()) {
|
|
|
+ if (vo.getPhone().length() > 11) {
|
|
|
+ vo.setPhone(PhoneUtil.decryptPhone(vo.getPhone()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (query != null && query.getStatus() != null) {
|
|
|
+ list = list.stream()
|
|
|
+ .filter(vo -> query.getStatus().equals(vo.getStatus()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ }
|
|
|
+
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据公司ID查询活动列表
|
|
|
+ *
|
|
|
+ * @param companyId 公司ID
|
|
|
+ * @return 活动列表
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<FsCourseCheckinActivity> selectActivityListByCompanyId(Long companyId) {
|
|
|
+ return fsCourseCheckinActivityMapper.selectActivityListByCompanyId(companyId);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 发送打卡提醒消息给销售
|
|
|
+ * 定时任务调用
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void sendCheckinRemindToSales() {
|
|
|
+ List<FsCourseCheckinWarningVO> oneDayLeftList = fsCourseCheckinUserMapper.selectCheckinRemindList(1);
|
|
|
+ for (FsCourseCheckinWarningVO vo : oneDayLeftList) {
|
|
|
+ sendRemindMsg(vo, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ List<FsCourseCheckinWarningVO> completedList = fsCourseCheckinUserMapper.selectCheckinRemindList(2);
|
|
|
+ for (FsCourseCheckinWarningVO vo : completedList) {
|
|
|
+ sendRemindMsg(vo, 2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void sendRemindMsg(FsCourseCheckinWarningVO vo, Integer remindType) {
|
|
|
+ FsUserCompanyUser userCompanyUser = fsUserCompanyUserService.selectByUserIdAndProjectId(vo.getUserId(), vo.getProjectId());
|
|
|
+ if (userCompanyUser == null || userCompanyUser.getCompanyUserId() == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ String title;
|
|
|
+ String content;
|
|
|
+ String notifyTemplate = vo.getNotifyTemplate();
|
|
|
+
|
|
|
+ if (remindType == 1) {
|
|
|
+ title = "打卡提醒-剩余一天";
|
|
|
+ String nickName = vo.getUserNickName() != null ? vo.getUserNickName() : "用户";
|
|
|
+ if (notifyTemplate != null && !notifyTemplate.isEmpty()) {
|
|
|
+ content = notifyTemplate
|
|
|
+ .replace("{用户昵称}", nickName)
|
|
|
+ .replace("{剩余天数}", "1")
|
|
|
+ .replace("{奖品名称}", vo.getPrizeName() != null ? vo.getPrizeName() : "");
|
|
|
+ } else {
|
|
|
+ content = String.format("用户【%s】再打卡1天即可领取【%s】",
|
|
|
+ nickName,
|
|
|
+ vo.getPrizeName() != null ? vo.getPrizeName() : "奖励");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ title = "打卡提醒-打卡完成";
|
|
|
+ String nickName = vo.getUserNickName() != null ? vo.getUserNickName() : "用户";
|
|
|
+ Integer prizeType = vo.getPrizeType();
|
|
|
+ if (notifyTemplate != null && !notifyTemplate.isEmpty()) {
|
|
|
+ content = notifyTemplate
|
|
|
+ .replace("{用户昵称}", nickName)
|
|
|
+ .replace("{打卡天数}", vo.getCheckinDays() != null ? vo.getCheckinDays().toString() : "0")
|
|
|
+ .replace("{奖品名称}", vo.getPrizeName() != null ? vo.getPrizeName() : "");
|
|
|
+ } else {
|
|
|
+ if (prizeType != null && prizeType == 2) {
|
|
|
+ content = String.format("用户【%s】已完成打卡%d天,奖品为商品券【%s】,请通知用户使用商品券并按时发货",
|
|
|
+ nickName,
|
|
|
+ vo.getCheckinDays() != null ? vo.getCheckinDays() : 0,
|
|
|
+ vo.getPrizeName() != null ? vo.getPrizeName() : "商品券");
|
|
|
+ } else {
|
|
|
+ content = String.format("用户【%s】已完成打卡%d天,奖品:【%s】",
|
|
|
+ nickName,
|
|
|
+ vo.getCheckinDays() != null ? vo.getCheckinDays() : 0,
|
|
|
+ vo.getPrizeName() != null ? vo.getPrizeName() : "奖励");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ CrmMsg crmMsg = new CrmMsg();
|
|
|
+ crmMsg.setMsgType(5);
|
|
|
+ crmMsg.setTitle(title);
|
|
|
+ crmMsg.setContent(content);
|
|
|
+ crmMsg.setCompanyId(vo.getCompanyId());
|
|
|
+ crmMsg.setCompanyUserId(userCompanyUser.getCompanyUserId());
|
|
|
+ crmMsg.setObjId(vo.getId());
|
|
|
+ crmMsg.setCreateTime(DateUtils.getNowDate());
|
|
|
+ crmMsgService.insertCrmMsg(crmMsg);
|
|
|
+ }
|
|
|
}
|