|
|
@@ -76,8 +76,8 @@ public class WestreamUserServiceImpl extends BaseServiceImpl<WestreamUserMapper, |
|
|
|
westreamUser.setCreateTime(new Date()); |
|
|
|
//添加积分及其积分明细 |
|
|
|
westreamUserMapper.insert(westreamUser); |
|
|
|
addIntegral(westreamUser); |
|
|
|
|
|
|
|
String points = addIntegral(westreamUser); |
|
|
|
westreamUser.setMallPoints(Integer.parseInt(points)); |
|
|
|
westreamUser.setNickname("护河行者" + westreamUser.getId()); |
|
|
|
westreamUserMapper.updateById(westreamUser); |
|
|
|
} else { |
|
|
@@ -88,21 +88,21 @@ public class WestreamUserServiceImpl extends BaseServiceImpl<WestreamUserMapper, |
|
|
|
return JsonResult.success(); |
|
|
|
} |
|
|
|
|
|
|
|
private void addIntegral(WestreamUser westreamUser) { |
|
|
|
private String addIntegral(WestreamUser westreamUser) { |
|
|
|
//注册程序 积分设置 |
|
|
|
ThDict thDict = dictMapper.selectOne(new LambdaQueryWrapper<ThDict>() |
|
|
|
.eq(ThDict::getTenantId, westreamUser.getTenantId()) |
|
|
|
.eq(ThDict::getCode, DictConstants.POINTS_RULE_CODE) |
|
|
|
.eq(ThDict::getMark, 1)); |
|
|
|
if(ObjectUtils.isNotNull(thDict)){ |
|
|
|
if (ObjectUtils.isNotNull(thDict)) { |
|
|
|
ThDictData thDictData = dictDataMapper.selectOne(new LambdaQueryWrapper<ThDictData>() |
|
|
|
.eq(ThDictData::getDictId, thDict.getId()) |
|
|
|
.eq(ThDictData::getName, DictConstants.APP_REGISTRY)); |
|
|
|
if(ObjectUtils.isNotNull(thDictData)){ |
|
|
|
if(StringUtils.isNotEmpty(thDictData.getValue())){ |
|
|
|
if (ObjectUtils.isNotNull(thDictData)) { |
|
|
|
if (StringUtils.isNotEmpty(thDictData.getValue())) { |
|
|
|
//积分明细表入库 |
|
|
|
UserPointsDetail userPointsDetail = new UserPointsDetail(); |
|
|
|
BeanUtils.copyProperties(westreamUser,userPointsDetail); |
|
|
|
BeanUtils.copyProperties(westreamUser, userPointsDetail); |
|
|
|
userPointsDetail.setNickname(westreamUser.getNickname()); |
|
|
|
userPointsDetail.setPointsChange(Integer.parseInt(thDictData.getValue())); |
|
|
|
userPointsDetail.setPointsTime(new Date()); |
|
|
@@ -111,9 +111,11 @@ public class WestreamUserServiceImpl extends BaseServiceImpl<WestreamUserMapper, |
|
|
|
userPointsDetail.setCreateTime(new Date()); |
|
|
|
userPointsDetailMapper.insert(userPointsDetail); |
|
|
|
//TODO 对接商城 |
|
|
|
return thDictData.getValue(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return "0"; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |