|
@@ -26,12 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import java.math.BigDecimal;
|
|
|
-import java.time.Duration;
|
|
|
import java.time.LocalDate;
|
|
|
-import java.time.LocalDateTime;
|
|
|
-import java.time.ZoneId;
|
|
|
-import java.time.temporal.ChronoUnit;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
@@ -254,7 +249,7 @@ public class FsUserIntegralLogsServiceImpl implements IFsUserIntegralLogsService
|
|
|
// logsType = FsUserIntegralLogTypeEnum.TYPE_1;
|
|
|
// break;
|
|
|
case 2: //消费获得积分
|
|
|
- integralNum = param.getAmount().multiply(BigDecimal.valueOf(config.getIntegralRatio())).intValue();
|
|
|
+ integralNum = param.getPoints() * config.getIntegralRatio();
|
|
|
logsType = FsUserIntegralLogTypeEnum.TYPE_2;
|
|
|
break;
|
|
|
case 3: //分享获得积分
|
|
@@ -361,11 +356,15 @@ public class FsUserIntegralLogsServiceImpl implements IFsUserIntegralLogsService
|
|
|
integralNum = config.getIntegralFirstOrderPoint();
|
|
|
logsType = FsUserIntegralLogTypeEnum.TYPE_22;
|
|
|
break;
|
|
|
+ case 23: //完成首次积分商城下单
|
|
|
+ integralNum = param.getPoints();
|
|
|
+ logsType = FsUserIntegralLogTypeEnum.TYPE_23;
|
|
|
+ break;
|
|
|
default:
|
|
|
return R.error("积分类型错误,联系管理员");
|
|
|
}
|
|
|
if (integralNum!=null && logsType!=null){
|
|
|
- R r = updateAddIntegral(integralNum, user.getUserId(), user.getIntegral(), logsType, param.getBusinessId());
|
|
|
+ R r = updateAddIntegral(integralNum, user.getUserId(), user.getIntegral(), logsType, param.getBusinessId(), param.getRemark());
|
|
|
log.info("用户id为{},{}", user.getUserId(),r.get("msg").toString());
|
|
|
return R.ok();
|
|
|
}
|
|
@@ -376,13 +375,12 @@ public class FsUserIntegralLogsServiceImpl implements IFsUserIntegralLogsService
|
|
|
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
* @param integralNum
|
|
|
* @param userId
|
|
|
* @param userIntegral
|
|
|
* @return
|
|
|
*/
|
|
|
- public R updateAddIntegral(Integer integralNum,Long userId,Long userIntegral, FsUserIntegralLogTypeEnum logsType,String businessId) {
|
|
|
+ public R updateAddIntegral(Integer integralNum, Long userId, Long userIntegral, FsUserIntegralLogTypeEnum logsType, String businessId, String remark) {
|
|
|
FsUser userMap=new FsUser();
|
|
|
userMap.setUserId(userId);
|
|
|
userMap.setIntegral(userIntegral+integralNum);
|
|
@@ -394,6 +392,7 @@ public class FsUserIntegralLogsServiceImpl implements IFsUserIntegralLogsService
|
|
|
integralLogs.setLogType(logsType.getValue());
|
|
|
integralLogs.setCreateTime(new Date());
|
|
|
integralLogs.setBusinessId(businessId);
|
|
|
+ integralLogs.setRemark(remark);
|
|
|
if (fsUserIntegralLogsMapper.insertFsUserIntegralLogs(integralLogs)>0){
|
|
|
return R.ok(logsType.getDesc()+":"+integralNum+"积分");
|
|
|
}
|
|
@@ -469,14 +468,14 @@ public class FsUserIntegralLogsServiceImpl implements IFsUserIntegralLogsService
|
|
|
int taskThree = 0;
|
|
|
int taskFour = 0;
|
|
|
int taskFive = 0;
|
|
|
- int isNewUser = 0;
|
|
|
+ int isNewUser = 1;
|
|
|
int isFinishConsultation = 0;
|
|
|
int isFinishFirstOrderPoint = 0;
|
|
|
// long expireDays = 0;
|
|
|
Date createTime = null;
|
|
|
- FsUser fsUser = fsUserMapper.selectFsUserIsNew(userId);
|
|
|
- if (fsUser!=null){
|
|
|
- isNewUser = 1;
|
|
|
+// FsUser fsUser = fsUserMapper.selectFsUserIsNew(userId);
|
|
|
+// if (fsUser!=null){
|
|
|
+// isNewUser = 1;
|
|
|
|
|
|
// Date createTime = fsUser.getCreateTime(); // 获取用户创建时间
|
|
|
// LocalDateTime createDateTime = LocalDateTime.ofInstant(createTime.toInstant(), ZoneId.systemDefault()); // 将 Date 转换为 LocalDateTime
|
|
@@ -490,7 +489,7 @@ public class FsUserIntegralLogsServiceImpl implements IFsUserIntegralLogsService
|
|
|
// expireDays = remainingDays;
|
|
|
|
|
|
|
|
|
- }
|
|
|
+// }
|
|
|
FsUserNewTask newTask = fsUserNewTaskMapper.selectFsUserNewTaskByUserId(userId);
|
|
|
if (newTask!=null){
|
|
|
taskOne = newTask.getTaskOne();
|