|
|
@@ -7,6 +7,8 @@ import com.poteviohealth.cgp.common.facade.log.OperationLog;
|
|
|
import com.poteviohealth.cgp.common.filter.TokenContext;
|
|
|
import com.poteviohealth.cgp.common.integrated.StringParams;
|
|
|
import com.poteviohealth.cgp.common.integrated.customer.CustomerFeignClient;
|
|
|
+import com.poteviohealth.cgp.common.integrated.customer.model.GroupLeaderDTO;
|
|
|
+import com.poteviohealth.cgp.common.integrated.customer.model.GroupLeaderParams;
|
|
|
import com.poteviohealth.cgp.common.model.CommonPage;
|
|
|
import com.poteviohealth.cgp.common.model.VaultsResponse;
|
|
|
import com.poteviohealth.cgp.common.utils.CgpTool;
|
|
|
@@ -23,7 +25,6 @@ import com.poteviohealth.ym.ipos.service.ISplitWithdrawService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
@@ -48,8 +49,6 @@ public class SettlementAppController extends BaseWebController {
|
|
|
private ISplitWithdrawService splitWithdrawService;
|
|
|
@Resource
|
|
|
private CustomerFeignClient customerFeignClient;
|
|
|
- @Value("${sync.dbName}")
|
|
|
- private String dbName;
|
|
|
|
|
|
@PostMapping("/merchantQuery")
|
|
|
@ApiOperation(value = "结算查询")
|
|
|
@@ -78,7 +77,7 @@ public class SettlementAppController extends BaseWebController {
|
|
|
|
|
|
return splitService.accountBalanceQuery(params.getId());*/
|
|
|
|
|
|
- Integer money = splitWithdrawService.getGroupLeaderWithdrawSumPrice(TokenContext.cureOperatorId(),dbName, TokenContext.cureMiniUser().getGroupLeaderId());
|
|
|
+ Integer money = splitWithdrawService.getGroupLeaderWithdrawSumPrice(TokenContext.cureOperatorId(), TokenContext.cureMiniUser().getGroupLeaderId());
|
|
|
AccountBalanceBack balanceBack = new AccountBalanceBack();
|
|
|
List<AccountBalanceList> list = Lists.newArrayList();
|
|
|
AccountBalanceList abList = new AccountBalanceList();
|
|
|
@@ -95,7 +94,7 @@ public class SettlementAppController extends BaseWebController {
|
|
|
public VaultsResponse<Long> accountBalanceUse() {
|
|
|
|
|
|
//TODO 暂时去掉三方支付
|
|
|
- Long money = splitWithdrawService.getGroupLeaderWithdrawPrice(TokenContext.cureOperatorId(),dbName, TokenContext.cureMiniUser().getGroupLeaderId());
|
|
|
+ Long money = splitWithdrawService.getGroupLeaderWithdrawPrice(TokenContext.cureOperatorId(), TokenContext.cureMiniUser().getGroupLeaderId());
|
|
|
return VaultsResponse.success(money<0L?0L:money);
|
|
|
/*if(StringUtils.isEmpty(TokenContext.cureMiniUser().getIposMerchantId())){
|
|
|
return VaultsResponse.success(0L);
|
|
|
@@ -143,7 +142,11 @@ public class SettlementAppController extends BaseWebController {
|
|
|
}*//*
|
|
|
dto.setAmount(dto.getAmount());
|
|
|
return splitService.withdraw(dto);*/
|
|
|
-
|
|
|
+ GroupLeaderParams groupLeaderParams = new GroupLeaderParams();
|
|
|
+ groupLeaderParams.setOperatorId(TokenContext.cureOperatorId());
|
|
|
+ groupLeaderParams.setGroupLeaderId(Integer.parseInt(TokenContext.cureMiniUser().getGroupLeaderId().toString()));
|
|
|
+ VaultsResponse<GroupLeaderDTO> vaultsResponse = customerFeignClient.getGroupLeaderById(groupLeaderParams);
|
|
|
+ GroupLeaderDTO groupLeaderDTO = vaultsResponse.getData();
|
|
|
SplitWithdraw splitWithdraw = new SplitWithdraw();
|
|
|
splitWithdraw.setOperatorId(TokenContext.cureOperatorId());
|
|
|
splitWithdraw.setWithdrawId(CgpTool.generateKey());
|
|
|
@@ -153,7 +156,9 @@ public class SettlementAppController extends BaseWebController {
|
|
|
splitWithdraw.setTransDate(new Date());
|
|
|
splitWithdraw.setTransStatus("p");
|
|
|
splitWithdraw.setAcctStatus("p");
|
|
|
+ splitWithdraw.setName(groupLeaderDTO.getName());
|
|
|
splitWithdrawService.save(splitWithdraw);
|
|
|
+ splitWithdrawService.updateOrderGroupLeaderWithdraw(TokenContext.cureOperatorId(), TokenContext.cureMiniUser().getGroupLeaderId(),splitWithdraw.getId());
|
|
|
return VaultsResponse.success();
|
|
|
}
|
|
|
|