|
|
@ -6,6 +6,8 @@ import com.blockchain.common.base.dto.YyyfUserDto; |
|
|
|
import com.blockchain.common.base.util.YyyfUserDtoUtils; |
|
|
|
import com.blockchain.common.base.util.YyyfUserDtoUtils; |
|
|
|
import com.blockchain.server.yyyf.controller.api.ExamApi; |
|
|
|
import com.blockchain.server.yyyf.controller.api.ExamApi; |
|
|
|
import com.blockchain.server.yyyf.dto.AssessUserDto; |
|
|
|
import com.blockchain.server.yyyf.dto.AssessUserDto; |
|
|
|
|
|
|
|
import com.blockchain.server.yyyf.dto.UserTimeMoneyDto; |
|
|
|
|
|
|
|
import com.blockchain.server.yyyf.dto.YyyfLoginDto; |
|
|
|
import com.blockchain.server.yyyf.entity.AssessUser; |
|
|
|
import com.blockchain.server.yyyf.entity.AssessUser; |
|
|
|
import com.blockchain.server.yyyf.entity.AssessUserTarget; |
|
|
|
import com.blockchain.server.yyyf.entity.AssessUserTarget; |
|
|
|
import com.blockchain.server.yyyf.entity.YyyfMoney; |
|
|
|
import com.blockchain.server.yyyf.entity.YyyfMoney; |
|
|
@ -26,7 +28,9 @@ import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.math.BigDecimal; |
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
import java.util.Random; |
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -102,7 +106,7 @@ public class ExamController { |
|
|
|
@GetMapping("/reStart") |
|
|
|
@GetMapping("/reStart") |
|
|
|
@ApiOperation(value = ExamApi.Restart.METHOD_NAME, |
|
|
|
@ApiOperation(value = ExamApi.Restart.METHOD_NAME, |
|
|
|
notes = ExamApi.Restart.METHOD_NOTE) |
|
|
|
notes = ExamApi.Restart.METHOD_NOTE) |
|
|
|
public ResultDTO reStart(HttpServletRequest request) { |
|
|
|
public ResultDTO<YyyfLoginDto> reStart(HttpServletRequest request) { |
|
|
|
|
|
|
|
|
|
|
|
YyyfUserDto yyyfUserDto = YyyfUserDtoUtils.getYyyfUserDto(request, redisTemplate); |
|
|
|
YyyfUserDto yyyfUserDto = YyyfUserDtoUtils.getYyyfUserDto(request, redisTemplate); |
|
|
|
String assessUserId = yyyfUserDto.getAssessUserId(); |
|
|
|
String assessUserId = yyyfUserDto.getAssessUserId(); |
|
|
@ -111,7 +115,21 @@ public class ExamController { |
|
|
|
throw new YyyfException(YyyfEnums.FODBID_EXAM_RESTART); |
|
|
|
throw new YyyfException(YyyfEnums.FODBID_EXAM_RESTART); |
|
|
|
} |
|
|
|
} |
|
|
|
Date now=new Date(); |
|
|
|
Date now=new Date(); |
|
|
|
|
|
|
|
System.out.println(now.getTime()); |
|
|
|
|
|
|
|
//系统账户初始化
|
|
|
|
|
|
|
|
String tel=new SimpleDateFormat("yyMMddHHmm").format(now).concat(String.valueOf(yyyfUserDto.getUserId())); |
|
|
|
|
|
|
|
//第一次进入进行注册
|
|
|
|
|
|
|
|
String code=String.format("%06d",new Random().nextInt(1000000)); |
|
|
|
|
|
|
|
redisTemplate.opsForValue().set(YyyfConstant.REGISTER_KEY.concat(tel),code,YyyfConstant.TIME_OUT, TimeUnit.MINUTES); |
|
|
|
|
|
|
|
//本系统密码
|
|
|
|
|
|
|
|
String password=String.format("%08d",new Random().nextInt(10000000)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assessUser.setTel(tel); |
|
|
|
|
|
|
|
assessUser.setPassword(password); |
|
|
|
assessUser.setStartTime(now); |
|
|
|
assessUser.setStartTime(now); |
|
|
|
|
|
|
|
assessUser.setEndTime(null); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.assessUserService.update(assessUser); |
|
|
|
this.assessUserService.update(assessUser); |
|
|
|
|
|
|
|
|
|
|
|
//区块链原始金额还原
|
|
|
|
//区块链原始金额还原
|
|
|
@ -123,11 +141,32 @@ public class ExamController { |
|
|
|
yyyfMoney.setBtc(BigDecimal.ZERO); |
|
|
|
yyyfMoney.setBtc(BigDecimal.ZERO); |
|
|
|
yyyfMoney.setEth(BigDecimal.ZERO); |
|
|
|
yyyfMoney.setEth(BigDecimal.ZERO); |
|
|
|
yyyfMoney.setUsdt(BigDecimal.ZERO); |
|
|
|
yyyfMoney.setUsdt(BigDecimal.ZERO); |
|
|
|
|
|
|
|
yyyfMoney.setEos(BigDecimal.ZERO); |
|
|
|
yyyfMoney.setUpdateTime(now); |
|
|
|
yyyfMoney.setUpdateTime(now); |
|
|
|
|
|
|
|
|
|
|
|
this.yyyfMoneyService.update(yyyfMoney); |
|
|
|
this.yyyfMoneyService.update(yyyfMoney); |
|
|
|
|
|
|
|
|
|
|
|
return ResultDTO.requstSuccess(); |
|
|
|
this.assessUserTargetService.restoreByAssessUserId(assessUserId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
YyyfLoginDto yyyfLoginDto = new YyyfLoginDto(); |
|
|
|
|
|
|
|
yyyfLoginDto.setCode(code); |
|
|
|
|
|
|
|
yyyfLoginDto.setTel(tel); |
|
|
|
|
|
|
|
yyyfLoginDto.setPassword(password); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ResultDTO.requstSuccess(yyyfLoginDto); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@SneakyThrows |
|
|
|
|
|
|
|
@GetMapping("/getUserTimeMoneyDto") |
|
|
|
|
|
|
|
@ApiOperation(value = ExamApi.GetUserTimeMoneyDto.METHOD_NAME, |
|
|
|
|
|
|
|
notes = ExamApi.GetUserTimeMoneyDto.METHOD_NOTE) |
|
|
|
|
|
|
|
public ResultDTO<UserTimeMoneyDto> getUserTimeMoneyDto(HttpServletRequest request) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
YyyfUserDto yyyfUserDto = YyyfUserDtoUtils.getYyyfUserDto(request, redisTemplate); |
|
|
|
|
|
|
|
String assessUserId = yyyfUserDto.getAssessUserId(); |
|
|
|
|
|
|
|
UserTimeMoneyDto userTimeMoneyDto =this.assessUserService.getUserTimeMoneyDtoByAssessUserId(assessUserId); |
|
|
|
|
|
|
|
return ResultDTO.requstSuccess(userTimeMoneyDto); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|