Commit 63e497db by xunj

正是上线发布版本

1 parent e9dc1bb7
...@@ -57,6 +57,6 @@ public class CattleController { ...@@ -57,6 +57,6 @@ public class CattleController {
@ResponseBody @ResponseBody
public ApiResult getOpenCattleBrandResult(@RequestBody @Validated ComposeCattleBrandParam param) { public ApiResult getOpenCattleBrandResult(@RequestBody @Validated ComposeCattleBrandParam param) {
return cattleBrandService.getTaskStatus(param); return cattleBrandService.getOpenCattleBrandResult(param);
} }
} }
...@@ -38,4 +38,6 @@ public interface UserInfoMapper { ...@@ -38,4 +38,6 @@ public interface UserInfoMapper {
OpenCattleVO getCattleAmount(@Param("userId") Long userId); OpenCattleVO getCattleAmount(@Param("userId") Long userId);
BigDecimal getRedBalanceByUserId(@Param("userId") Long userId); BigDecimal getRedBalanceByUserId(@Param("userId") Long userId);
List<Long> getNotSignUserToYesterday(@Param("signDate") String signDate); List<Long> getNotSignUserToYesterday(@Param("signDate") String signDate);
int updateRedBalaceForFist(@Param("userId") Long userId,@Param("redBalance") BigDecimal redBalance);
int updateFirstRedStatus(@Param("id") Long id);
} }
...@@ -39,7 +39,9 @@ import java.util.ArrayList; ...@@ -39,7 +39,9 @@ import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Random;
import java.util.UUID; import java.util.UUID;
import java.util.stream.Collectors;
@Service @Service
...@@ -258,10 +260,8 @@ public class UserInfoServiceImpl implements UserInfoService { ...@@ -258,10 +260,8 @@ public class UserInfoServiceImpl implements UserInfoService {
try { try {
List<FirstLoginRedVO> firstLoginRedVOList = mapper.queryFirstLoginRed(); List<FirstLoginRedVO> firstLoginRedVOList = mapper.queryFirstLoginRed();
if(firstLoginRedVOList != null && firstLoginRedVOList.size() >0){ if(firstLoginRedVOList != null && firstLoginRedVOList.size() >0){
HashSet<Integer> set = RandomUtils.getLuckUser(1,firstLoginRedVOList.size());
//新增到红包雨表 作为红包基础数据 //新增到红包雨表 作为红包基础数据
FirstLoginRedVO redVO = firstLoginRedVOList.get(0); FirstLoginRedVO redVO = firstLoginRedVOList.get(new Random().nextInt(firstLoginRedVOList.size()));
AddRedRainDto dto = new AddRedRainDto(); AddRedRainDto dto = new AddRedRainDto();
dto.setRedId(SnowFlakeUtil.nextId()); dto.setRedId(SnowFlakeUtil.nextId());
dto.setUserId(userId); dto.setUserId(userId);
...@@ -276,18 +276,14 @@ public class UserInfoServiceImpl implements UserInfoService { ...@@ -276,18 +276,14 @@ public class UserInfoServiceImpl implements UserInfoService {
throw new BusinessException("首次登录新增t_red_rain表异常"); throw new BusinessException("首次登录新增t_red_rain表异常");
} }
//更新聚宝盆余额 //更新聚宝盆余额
List<UserInfoDto> userInfoDtoList = new ArrayList<>(); int k2 = mapper.updateRedBalaceForFist(userId,redVO.getAmount());
UserInfoDto userInfoDto = new UserInfoDto();
userInfoDto.setUserId(userId);
userInfoDto.setRedBalance(redVO.getAmount());
userInfoDto.setIsFirst("1");
userInfoDtoList.add(userInfoDto);
int k2 = mapper.updateRedBalace(userInfoDtoList);
if(k2 < 1){ if(k2 < 1){
throw new BusinessException("ID@@"+userId+"@@首次登录更新余额异常"); throw new BusinessException("ID@@"+userId+"@@首次登录更新余额异常");
} }
//更新首次登录状态 int k3 = mapper.updateFirstRedStatus(redVO.getId());
mapper.updateFirstLoginStatus(userId); if(k3 < 1){
throw new BusinessException("ID@@"+userId+"@@首次登录领取红包异常");
}
return ApiResult.ok(redVO.getAmount()); return ApiResult.ok(redVO.getAmount());
} }
} catch (Exception e) { } catch (Exception e) {
......
...@@ -57,6 +57,14 @@ ...@@ -57,6 +57,14 @@
</foreach> </foreach>
</where> </where>
</update> </update>
<update id="updateRedBalaceForFist" >
update t_user
set red_balance = red_balance+#{redBalance},
is_first = '1'
<where>
user_id=#{userId}
</where>
</update>
<update id="updateFirstLoginRed"> <update id="updateFirstLoginRed">
update t_first_login_red set is_flag = 1 where id =#{id} update t_first_login_red set is_flag = 1 where id =#{id}
</update> </update>
...@@ -81,6 +89,11 @@ ...@@ -81,6 +89,11 @@
user_id = #{userId} user_id = #{userId}
</where> </where>
</update> </update>
<update id="updateFirstRedStatus">
UPDATE t_first_login_red
SET is_flag = '1'
where id = #{id}
</update>
<insert id="saveCattleBrand" parameterType="com.polysoft.activity.model.dto.SaveUserCattleDto"> <insert id="saveCattleBrand" parameterType="com.polysoft.activity.model.dto.SaveUserCattleDto">
INSERT into t_user_cattle ( INSERT into t_user_cattle (
id, id,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!