Commit 8d5fba81 by 程裕兵

feat:get appId

parent ba816d8e
......@@ -12,8 +12,10 @@ import com.jiejing.fitness.finance.api.cashier.request.UnbindStudioCashierReques
import com.jiejing.fitness.finance.api.cashier.vo.StudioCashierRecordVO;
import com.jiejing.fitness.finance.api.cashier.vo.StudioCashierStatisticVO;
import com.jiejing.fitness.finance.api.cashier.vo.StudioSettleVO;
import com.jiejing.paycenter.common.enums.common.PayChannelEnums;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import java.util.Map;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -26,6 +28,11 @@ public interface StudioCashierApi {
String TAG = "【场馆】收银管理";
@ApiOperation(value = "获取收银所需appId", tags = {TAG})
@PostMapping(value = "/private/studioCashier/getAppId")
JsonResult<Map<PayChannelEnums, String>> getAppId();
@ApiOperation(value = "绑定流水", tags = {TAG})
@PostMapping(value = "/private/studioCashier/bind")
JsonResult<Void> bind(BindStudioCashierRequest request);
......
......@@ -12,8 +12,10 @@ import com.jiejing.fitness.finance.api.cashier.request.UnbindStudioCashierReques
import com.jiejing.fitness.finance.api.cashier.vo.StudioCashierRecordVO;
import com.jiejing.fitness.finance.api.cashier.vo.StudioCashierStatisticVO;
import com.jiejing.fitness.finance.api.cashier.vo.StudioSettleVO;
import com.jiejing.paycenter.common.enums.common.PayChannelEnums;
import feign.hystrix.FallbackFactory;
import java.util.List;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
......@@ -28,6 +30,12 @@ public class StudioCashierApiFallback implements FallbackFactory<StudioCashierAp
@Override
public StudioCashierApi create(Throwable throwable) {
return new StudioCashierApi() {
@Override
public JsonResult<Map<PayChannelEnums, String>> getAppId() {
return JsonResult.rpcError();
}
@Override
public JsonResult<Void> bind(BindStudioCashierRequest request) {
return JsonResult.rpcError();
......
......@@ -17,8 +17,10 @@ import com.jiejing.fitness.finance.api.cashier.vo.StudioSettleVO;
import com.jiejing.fitness.finance.service.cashier.StudioCashierService;
import com.jiejing.fitness.finance.service.cashier.params.PageStudioCashierParams;
import com.jiejing.fitness.finance.service.cashier.params.PageStudioSettleParams;
import com.jiejing.paycenter.common.enums.common.PayChannelEnums;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Resource;
import javax.validation.Valid;
......@@ -36,6 +38,13 @@ public class StudioCashierController implements StudioCashierApi {
@Resource
private StudioCashierService studioCashierService;
@ApiOperation(value = "获取收银所需appId", tags = {TAG})
@PostMapping(value = "/private/studioCashier/getAppId")
@Override
public JsonResult<Map<PayChannelEnums, String>> getAppId() {
return JsonResult.success(studioCashierService.getAppId());
}
@ApiOperation(value = "绑定流水", tags = {TAG})
@PostMapping(value = "/private/studioCashier/bind")
@Override
......
......@@ -6,7 +6,9 @@ import com.jiejing.fitness.finance.api.cashier.vo.StudioCashierStatisticVO;
import com.jiejing.fitness.finance.api.cashier.vo.StudioSettleVO;
import com.jiejing.fitness.finance.service.cashier.params.PageStudioCashierParams;
import com.jiejing.fitness.finance.service.cashier.params.PageStudioSettleParams;
import com.jiejing.paycenter.common.enums.common.PayChannelEnums;
import java.util.List;
import java.util.Map;
/**
* @author chengyubing
......@@ -15,6 +17,13 @@ import java.util.List;
public interface StudioCashierService {
/**
* 获取收银所需的所有appId
*
* @return 收银所需的所有appId
*/
Map<PayChannelEnums, String> getAppId();
/**
* 绑定收银流水
*
* @param ids 流水ID集合
......
......@@ -9,10 +9,12 @@ import com.jiejing.common.utils.text.StringUtil;
import com.jiejing.fitness.finance.api.cashier.vo.StudioCashierRecordVO;
import com.jiejing.fitness.finance.api.cashier.vo.StudioCashierStatisticVO;
import com.jiejing.fitness.finance.api.cashier.vo.StudioSettleVO;
import com.jiejing.fitness.finance.repository.entity.GlobalConfig;
import com.jiejing.fitness.finance.repository.entity.StudioCashierRecord;
import com.jiejing.fitness.finance.repository.entity.StudioSettleRecord;
import com.jiejing.fitness.finance.repository.query.PageBrandCashierRecordQuery;
import com.jiejing.fitness.finance.repository.query.PageStudioSettleQuery;
import com.jiejing.fitness.finance.repository.service.GlobalConfigRpService;
import com.jiejing.fitness.finance.repository.service.StudioCashierRecordRpService;
import com.jiejing.fitness.finance.repository.service.StudioSettleRecordRpService;
import com.jiejing.fitness.finance.service.cashier.StudioCashierService;
......@@ -20,8 +22,11 @@ import com.jiejing.fitness.finance.service.cashier.convert.CashierConvert;
import com.jiejing.fitness.finance.service.cashier.params.PageStudioCashierParams;
import com.jiejing.fitness.finance.service.cashier.params.PageStudioSettleParams;
import com.jiejing.fitness.finance.service.enums.FinanceErrorEnums;
import com.jiejing.fitness.finance.service.enums.GlobalConfigEnums;
import com.jiejing.paycenter.common.enums.common.PayChannelEnums;
import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Page;
......@@ -43,6 +48,16 @@ public class StudioCashierServiceImpl implements StudioCashierService {
@Resource
private StudioSettleRecordRpService studioSettleRecordRpService;
@Resource
private GlobalConfigRpService globalConfigRpService;
@Override
public Map<PayChannelEnums, String> getAppId() {
GlobalConfig config = globalConfigRpService.getById(GlobalConfigEnums.CASHIER_APP_IDS.getCode())
.orElse(new GlobalConfig());
return JSON.parseObject(config.getConfigValue(), Map.class);
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
@Override
public void bind(List<Long> ids, String subOrderNo) {
......
......@@ -16,6 +16,7 @@ public enum GlobalConfigEnums {
* 全局配置key
*/
BRAND_MERCHANT_SUB_CHANNELS("BRAND_MERCHANT_SUB_CHANNELS", "品牌商户默认开通的子渠道以及对应费率"),
CASHIER_APP_IDS("CASHIER_APP_IDS", "收银所需的appId"),
;
@EnumValue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment