提交 afb6c288 authored 作者: huyufan's avatar huyufan

修改BUG

上级 2f85027e
......@@ -98,9 +98,6 @@ public class OwnerAccountController {
@PostMapping("/accountCaseOut")
@UnitCovert
public Result<Long> accountCaseOut(@RequestBody OwnerCaseOutParam param) {
UserSessionData loginUserInfo = TokenUtil.getLoginUserInfo();
param.setOwnerUserNo(loginUserInfo.getUserNo());
Long id = ownerAccountService.accountCaseOut(param);
return Result.ok(id);
}
......
......@@ -7,10 +7,8 @@ import com.baomidou.mybatisplus.annotation.TableName;
import com.msl.common.config.KeyColumn;
import com.msl.common.model.HasKey;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.apache.poi.hpsf.Decimal;
import java.math.BigDecimal;
import java.time.LocalDateTime;
......
......@@ -134,6 +134,8 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
@Transactional(rollbackFor = Exception.class)
public Long accountCaseOut(OwnerCaseOutParam param) {
BigDecimal caseOutBalance = param.getCaseOutBalance();
UserSessionData loginUserInfo = TokenUtil.getLoginUserInfo();
param.setOwnerUserNo(loginUserInfo.getUserNo());
LocalDateTime now = LocalDateTime.now();
while (true) {
......@@ -158,6 +160,7 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
OwnerCaseOut entity = new OwnerCaseOut();
entity.setAccountType(param.getAccountType());
entity.setCaseOutNo(idGenerateSnowFlake.nextId(IdTypeEnum.Type.CASE_OUT.getCode()));
entity.setCaseOutBalance(caseOutBalance);
entity.setOwnerUserNo(param.getOwnerUserNo());
entity.setStatus(OwnerAccountEnum.CaseOutStatus.PENDING_PAYMENT.getCode());
entity.setCaseOutBank(param.getCaseOutBank());
......@@ -166,9 +169,9 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
ownerCaseOutDao.saveEntity(entity);
//插入冻结流水
OwnerRunningWaterRecord runningWaterRecord = new OwnerRunningWaterRecord();
runningWaterRecord.setOwnerName("测试");
runningWaterRecord.setMobile("11111111111");
runningWaterRecord.setCreateBy("操作人测试");
runningWaterRecord.setOwnerName(loginUserInfo.getUserName());
runningWaterRecord.setMobile(loginUserInfo.getUserMobile());
runningWaterRecord.setCreateBy(loginUserInfo.getUserName());
runningWaterRecord.setRelationId(entity.getCaseOutNo());
runningWaterRecord.setAccountBalance(caseOutBalance);
runningWaterRecord.setOwnerUserNo(param.getOwnerUserNo());
......@@ -184,7 +187,8 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
@Transactional(rollbackFor = Exception.class)
public Long openAccountCaseOut(OpenOwnerCaseOutParam param) {
BigDecimal caseOutBalance = param.getCaseOutBalance();
UserSessionData loginUserInfo = TokenUtil.getLoginUserInfo();
param.setOwnerUserNo(loginUserInfo.getUserNo());
LocalDateTime now = LocalDateTime.now();
while (true) {
//冻结账户可用金额
......@@ -212,9 +216,9 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
ownerCaseOutDao.saveEntity(entity);
//插入冻结流水
OwnerRunningWaterRecord runningWaterRecord = new OwnerRunningWaterRecord();
runningWaterRecord.setOwnerName("测试");
runningWaterRecord.setMobile("11111111111");
runningWaterRecord.setCreateBy("操作人测试");
runningWaterRecord.setOwnerName(loginUserInfo.getUserName());
runningWaterRecord.setMobile(loginUserInfo.getUserMobile());
runningWaterRecord.setCreateBy(loginUserInfo.getUserName());
runningWaterRecord.setRelationId(entity.getCaseOutNo());
runningWaterRecord.setAccountBalance(caseOutBalance);
runningWaterRecord.setOwnerUserNo(param.getOwnerUserNo());
......@@ -232,12 +236,14 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
@Override
@Transactional(rollbackFor = Exception.class)
public void accountTopUpApprove(PlatformAccountTopUpParam param) {
UserSessionData loginUserInfo = TokenUtil.getLoginUserInfo();
Optional<OwnerTopUp> optional = ownerTopUpDao.getEntityByKey(param.getId());
if (!optional.isPresent()) {
throw new ServiceSystemException(PerformanceResultEnum.HTTP_ERROR, "当前ID未查询到有效记录");
}
OwnerTopUp ownerTopUp = optional.get();
OwnerTopUp entity = new OwnerTopUp();
String ownerName = "";
if (!param.getPassType()) {
entity.setId(param.getId());
entity.setApprovalTurnDown(param.getTurnDownContent());
......@@ -256,6 +262,7 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
update.setModifiedTime(account.getModifiedTime());
Integer flag = ownerAccountDao.updateAccountCAS(update, now, true);
if (null != flag) {
ownerName = account.getOwnerUserName();
break;
}
}
......@@ -265,9 +272,9 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
ownerTopUpDao.updateEntityByKey(entity);
//需要插入充值流水
OwnerRunningWaterRecord runningWaterRecord = new OwnerRunningWaterRecord();
runningWaterRecord.setOwnerName("测试");
runningWaterRecord.setMobile("11111111111");
runningWaterRecord.setCreateBy("操作人测试");
runningWaterRecord.setOwnerName(ownerName);
runningWaterRecord.setMobile(loginUserInfo.getUserMobile());
runningWaterRecord.setCreateBy(loginUserInfo.getUserName());
runningWaterRecord.setRelationId(ownerTopUp.getTopUpNo());
runningWaterRecord.setAccountBalance(topUpBalance);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论