Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.account.dto.area.ShopAreaAddDTO;
|
||||
import com.czg.account.dto.area.ShopAreaEditDTO;
|
||||
import com.czg.account.entity.ShopTableArea;
|
||||
import com.czg.account.service.ShopTableAreaService;
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 区域管理
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/shopArea")
|
||||
public class ShopTableAreaController {
|
||||
@Resource
|
||||
private ShopTableAreaService shopTableAreaService;
|
||||
|
||||
/**
|
||||
* 区域获取
|
||||
* 权限标识: shopArea:add
|
||||
* @param name 区域名称
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission("shopArea:list")
|
||||
@GetMapping
|
||||
public CzgResult<Page<ShopTableArea>> list(String name) {
|
||||
return CzgResult.success(shopTableAreaService.pageInfo(StpKit.USER.getShopId(), name));
|
||||
}
|
||||
|
||||
/**
|
||||
* 区域修改
|
||||
* 权限标识: shopArea:edit
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission("shopArea:edit")
|
||||
@PutMapping
|
||||
public CzgResult<Boolean> edit(@RequestBody @Validated ShopAreaEditDTO shopAreaEditDTO) {
|
||||
return CzgResult.success(shopTableAreaService.edit(StpKit.USER.getShopId(), shopAreaEditDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 区域删除
|
||||
* 权限标识: shopArea:del
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission("shopArea:del")
|
||||
@DeleteMapping
|
||||
public CzgResult<Boolean> remove(@RequestBody @Validated ShopAreaEditDTO shopAreaEditDTO) {
|
||||
return CzgResult.success(shopTableAreaService.remove(new QueryWrapper().eq(ShopTableArea::getShopId, StpKit.USER.getShopId()).eq(ShopTableArea::getId, shopAreaEditDTO.getId())));
|
||||
}
|
||||
|
||||
/**
|
||||
* 区域新增
|
||||
* 权限标识: shopArea:add
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission("shopArea:add")
|
||||
@PostMapping
|
||||
public CzgResult<Boolean> add(@RequestBody @Validated ShopAreaAddDTO shopAreaAddDTO) {
|
||||
return CzgResult.success(shopTableAreaService.add(shopAreaAddDTO));
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.czg.controller.admin;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.account.dto.table.ShopTableAddDTO;
|
||||
import com.czg.account.dto.table.ShopTableBindDTO;
|
||||
import com.czg.account.dto.table.ShopTableDTO;
|
||||
import com.czg.account.entity.ShopTable;
|
||||
import com.czg.account.service.ShopTableService;
|
||||
@@ -100,4 +101,15 @@ public class ShopTableController {
|
||||
}
|
||||
return CzgResult.success(shopTableService.add(StpKit.USER.getShopId(), shopTableAddDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 台桌绑定
|
||||
* 权限标识: shopTable:bind
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission("shopTable:bind")
|
||||
@PostMapping("/bind")
|
||||
public CzgResult<Boolean> bind(@RequestBody @Validated ShopTableBindDTO shopTableBindDTO) {
|
||||
return CzgResult.success(shopTableService.bind(StpKit.USER.getShopId(), shopTableBindDTO));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("notify")
|
||||
@RequestMapping("/notify")
|
||||
public class NotifyController {
|
||||
private static final String SUCCESS = "SUCCESS";
|
||||
|
||||
@@ -25,7 +25,7 @@ public class NotifyController {
|
||||
private OrderInfoService orderInfoService;
|
||||
|
||||
|
||||
@RequestMapping("payCallBack")
|
||||
@RequestMapping("/payCallBack")
|
||||
public String notifyCallBack(@RequestBody CzgBaseRespParams respParams){
|
||||
JSONObject czg = CzgPayUtils.getCzg(respParams);
|
||||
AssertUtil.isNull(czg, "回调数据为空");
|
||||
|
||||
@@ -28,6 +28,11 @@ public class OrderPayController {
|
||||
private PayService payService;
|
||||
|
||||
|
||||
@PostMapping("/cashPay")
|
||||
public CzgResult<Object> cashPayOrder(@Validated @RequestBody OrderPayParamDTO payParam) {
|
||||
return payService.cashPayOrder(payParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员支付
|
||||
* payType 必填
|
||||
@@ -37,7 +42,7 @@ public class OrderPayController {
|
||||
* <p>
|
||||
* accountPay(小程序使用) 密码支付 用户密码pwd 必填
|
||||
*/
|
||||
@PostMapping("vipPay")
|
||||
@PostMapping("/vipPay")
|
||||
public CzgResult<Object> vipPayOrder(@Validated @RequestBody OrderPayParamDTO payParam) {
|
||||
AssertUtil.isBlank(payParam.getPayType(), "支付类型不可为空");
|
||||
return payService.vipPayOrder(payParam);
|
||||
@@ -46,7 +51,7 @@ public class OrderPayController {
|
||||
/**
|
||||
* h5支付
|
||||
*/
|
||||
@PostMapping("h5Pay")
|
||||
@PostMapping("/h5Pay")
|
||||
public CzgResult<Map<String, Object>> h5PayOrder(HttpServletRequest request, @Validated @RequestBody OrderPayParamDTO payParam) {
|
||||
return payService.h5PayOrder(ServletUtil.getClientIPByHeader(request), payParam);
|
||||
}
|
||||
@@ -57,7 +62,7 @@ public class OrderPayController {
|
||||
* payType 必填 支付方式,aliPay 支付宝,wechatPay 微信
|
||||
* openId 必填
|
||||
*/
|
||||
@PostMapping("jsPay")
|
||||
@PostMapping("/jsPay")
|
||||
public CzgResult<Map<String, Object>> jsPayOrder(HttpServletRequest request, @Validated @RequestBody OrderPayParamDTO payParam) {
|
||||
return payService.jsPayOrder(ServletUtil.getClientIPByHeader(request), payParam);
|
||||
}
|
||||
@@ -67,7 +72,7 @@ public class OrderPayController {
|
||||
* payType 必填 支付方式,aliPay 支付宝,wechatPay 微信
|
||||
* openId 必填
|
||||
*/
|
||||
@PostMapping("ltPayOrder")
|
||||
@PostMapping("/ltPayOrder")
|
||||
public CzgResult<Map<String, Object>> ltPayOrder(HttpServletRequest request, @Validated @RequestBody OrderPayParamDTO payParam) {
|
||||
return payService.ltPayOrder(ServletUtil.getClientIPByHeader(request), payParam);
|
||||
}
|
||||
@@ -75,7 +80,7 @@ public class OrderPayController {
|
||||
/**
|
||||
* 正扫
|
||||
*/
|
||||
@PostMapping("scanPay")
|
||||
@PostMapping("/scanPay")
|
||||
public CzgResult<Map<String, Object>> scanPayOrder(HttpServletRequest request, @Validated @RequestBody OrderPayParamDTO payParam) {
|
||||
return payService.scanPayOrder(ServletUtil.getClientIPByHeader(request), payParam);
|
||||
}
|
||||
@@ -84,7 +89,7 @@ public class OrderPayController {
|
||||
* 反扫
|
||||
* authCode 必填 扫描码
|
||||
*/
|
||||
@PostMapping("microPay")
|
||||
@PostMapping("/microPay")
|
||||
public CzgResult<Map<String, Object>> microPayOrder(@Validated @RequestBody OrderPayParamDTO payParam) {
|
||||
return payService.microPayOrder(payParam);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class VipPayController {
|
||||
* 现金充值
|
||||
* 如果shop_info的 is_member_in_pwd=1 则pwd必填 店铺操作密码
|
||||
*/
|
||||
@PostMapping("cashPayVip")
|
||||
@PostMapping("/cashPayVip")
|
||||
public CzgResult<Object> cashPayVip(@Validated @RequestBody VipPayParamDTO payParam) {
|
||||
AssertUtil.isNull(payParam.getShopUserId(), "充值失败 未指定店铺用户Id");
|
||||
payParam.setPlatformType(ServletUtil.getHeaderIgnoreCase(ServletUtil.getRequest(), "platformType"));
|
||||
@@ -43,7 +43,7 @@ public class VipPayController {
|
||||
* payType 必填 支付方式,aliPay 支付宝,wechatPay 微信
|
||||
* openId 必填
|
||||
*/
|
||||
@PostMapping("jsPayVip")
|
||||
@PostMapping("/jsPayVip")
|
||||
public CzgResult<Map<String, Object>> jsPayVip(HttpServletRequest request, @Validated @RequestBody VipPayParamDTO payParam) {
|
||||
AssertUtil.isNull(payParam.getShopUserId(), "充值失败 未指定店铺用户Id");
|
||||
payParam.setPlatformType(ServletUtil.getHeaderIgnoreCase(ServletUtil.getRequest(), "platformType"));
|
||||
@@ -55,7 +55,7 @@ public class VipPayController {
|
||||
* payType 必填 支付方式,aliPay 支付宝,wechatPay 微信
|
||||
* openId 必填
|
||||
*/
|
||||
@PostMapping("ltPayVip")
|
||||
@PostMapping("/ltPayVip")
|
||||
public CzgResult<Map<String, Object>> ltPayVip(HttpServletRequest request, @Validated @RequestBody VipPayParamDTO payParam) {
|
||||
AssertUtil.isNull(payParam.getShopUserId(), "充值失败 未指定店铺用户Id");
|
||||
payParam.setPlatformType(ServletUtil.getHeaderIgnoreCase(ServletUtil.getRequest(), "platformType"));
|
||||
@@ -65,7 +65,7 @@ public class VipPayController {
|
||||
/**
|
||||
* 正扫
|
||||
*/
|
||||
@PostMapping("scanPayVip")
|
||||
@PostMapping("/scanPayVip")
|
||||
public CzgResult<Map<String, Object>> scanPayVip(HttpServletRequest request, @Validated @RequestBody VipPayParamDTO payParam) {
|
||||
AssertUtil.isNull(payParam.getShopUserId(), "充值失败 未指定店铺用户Id");
|
||||
payParam.setPlatformType(ServletUtil.getHeaderIgnoreCase(ServletUtil.getRequest(), "platformType"));
|
||||
@@ -76,7 +76,7 @@ public class VipPayController {
|
||||
* 反扫
|
||||
* authCode 必填 扫描码
|
||||
*/
|
||||
@PostMapping("microPayVip")
|
||||
@PostMapping("/microPayVip")
|
||||
public CzgResult<Map<String, Object>> microPayVip(@Validated @RequestBody VipPayParamDTO payParam) {
|
||||
AssertUtil.isNull(payParam.getShopUserId(), "充值失败 未指定店铺用户Id");
|
||||
payParam.setPlatformType(ServletUtil.getHeaderIgnoreCase(ServletUtil.getRequest(), "platformType"));
|
||||
|
||||
@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
* @description
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("admin/order")
|
||||
@RequestMapping("/admin/order")
|
||||
public class AdminOrderController {
|
||||
|
||||
@Resource
|
||||
|
||||
Reference in New Issue
Block a user