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

修改BUG

上级 07481b7c
package com.clx.performance.feign;
import com.clx.performance.param.pc.owner.FrozenAccountParam;
import com.clx.performance.vo.feign.OrderGoodsFeignVO;
import com.msl.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import javax.validation.constraints.NotBlank;
......@@ -27,4 +30,6 @@ public interface PerformanceFeign {
@GetMapping(value = {"clx-performance/feign/orderGoods/getOrderGoodsListByOrderNo"})
List<OrderGoodsFeignVO> getOrderGoodsListByOrderNo(@RequestParam String orderNo);
@PostMapping(value = {"clx-performance/feign/owner/ownerAccountFrozen"})
Result<Object> ownerAccountFrozen(@RequestBody FrozenAccountParam param);
}
package com.clx.performance.param.pc.owner;
import com.msl.common.convertor.type.MoneyInConvert;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
......@@ -15,11 +14,10 @@ import java.math.BigDecimal;
public class FrozenAccountParam {
private Long userNo;
private String mobile;
private String ownerName;
@MoneyInConvert
//保证金
private BigDecimal frozenBalance;
@MoneyInConvert
//预付运费
private BigDecimal ensureBalance;
private Integer orderId;
private String orderNo;
......
package com.clx.performance.controller.feign;
import com.clx.performance.param.pc.owner.FrozenAccountParam;
import com.clx.performance.service.OwnerAccountService;
import com.msl.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequestMapping("/feign/owner")
@Validated
@AllArgsConstructor
public class OwnerAccountFeignController {
private final OwnerAccountService ownerAccountService;
@ApiOperation(value = "冻结保证金", notes = "<br>By:胡宇帆")
@PostMapping("/ownerAccountFrozen")
public Result<Object> ownerAccountFrozen(FrozenAccountParam param) {
ownerAccountService.ownerAccountFrozen(param);
return Result.ok();
}
}
......@@ -162,14 +162,6 @@ public class OwnerAccountController {
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
}
@ApiOperation(value = "冻结保证金", notes = "<br>By:胡宇帆")
@PostMapping("/ownerAccountFrozen")
@UnitCovert()
public Result<Object> ownerAccountFrozen(FrozenAccountParam param) {
ownerAccountService.ownerAccountFrozen(param);
return Result.ok();
}
@ApiOperation(value = "创建账户", notes = "<br>By:胡宇帆")
@PostMapping("/createAccount")
public Result<Object> createAccount(CreteAccountParam param) {
......
......@@ -596,9 +596,9 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
@Override
@Transactional(rollbackFor = Exception.class)
public void ownerAccountFrozen(FrozenAccountParam param) {
String mobile = param.getMobile();
String mobile = "";
Long userNo = param.getUserNo();
String ownerName = param.getOwnerName();
String ownerName = "";
BigDecimal frozenBalance = param.getFrozenBalance();
BigDecimal ensureBalance = param.getEnsureBalance();
Integer orderId = param.getOrderId();
......@@ -610,6 +610,8 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
List<OwnerAccount> accountList = ownerAccountDao.accountInfo(userNo);
for (OwnerAccount ownerAccount : accountList) {
OwnerAccount entity = new OwnerAccount();
mobile = ownerAccount.getMobile();
ownerName = ownerAccount.getOwnerUserName();
entity.setAccountType(ownerAccount.getAccountType());
entity.setId(ownerAccount.getId());
entity.setModifiedTime(ownerAccount.getModifiedTime());
......@@ -621,9 +623,11 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
entity.setFrozenBalance(frozenBalance);
//可用余额
entity.setUsableBalance(frozenBalance);
//账户余额
entity.setAccountBalance(frozenBalance);
//updateList.add(entity);
flag += ownerAccountDao.updateAccountCAS(entity, now, false);
} else {
if (ownerAccount.getUsableBalance().compareTo(ensureBalance) < 0) {
throw new ServiceSystemException(PerformanceResultEnum.HTTP_ERROR, "当前货主预付运费账户可用余额不够冻结");
......@@ -632,6 +636,8 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
entity.setFrozenBalance(ensureBalance);
//可用余额
entity.setUsableBalance(ensureBalance);
//账户余额
entity.setAccountBalance(frozenBalance);
//updateList.add(entity);
flag += ownerAccountDao.updateAccountCAS(entity, now, false);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论