refactor: delete unuse code
This commit is contained in:
parent
970fb1152a
commit
3257f125c7
@ -5,7 +5,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.yzt.fightwine</groupId>
|
<groupId>com.yzt.fightwine</groupId>
|
||||||
<artifactId>yzt-fightwine</artifactId>
|
<artifactId>zp-fightwine</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|||||||
@ -1,132 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import com.yzt.common.constants.DateConstants;
|
|
||||||
import com.yzt.common.model.acticitystyle.ActivityStyle;
|
|
||||||
import com.yzt.common.page.CommonPage;
|
|
||||||
import com.yzt.common.request.ActivityStyleRequest;
|
|
||||||
import com.yzt.common.request.ActivityStyleSearchRequest;
|
|
||||||
import com.yzt.common.request.ActivityStyleUpdateStatusRequest;
|
|
||||||
import com.yzt.common.request.PageParamRequest;
|
|
||||||
import com.yzt.common.response.ActivityStyleResponse;
|
|
||||||
import com.yzt.common.result.CommonResult;
|
|
||||||
import com.yzt.common.utils.YztDateUtil;
|
|
||||||
import com.yzt.service.service.ActivityStyleService;
|
|
||||||
import com.yzt.service.service.SystemAttachmentService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.BeanUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 活动样式 前端控制器
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("api/admin/activitystyle")
|
|
||||||
@Api(tags = "活动样式") //配合swagger使用
|
|
||||||
public class ActivityStyleController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ActivityStyleService activityStyleService;
|
|
||||||
@Autowired
|
|
||||||
private SystemAttachmentService systemAttachmentService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页显示
|
|
||||||
*
|
|
||||||
* @param request 搜索条件
|
|
||||||
* @param pageParamRequest 分页参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:activitystyle:list')")
|
|
||||||
@ApiOperation(value = "分页列表") //配合swagger使用
|
|
||||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
||||||
public CommonResult<CommonPage<ActivityStyleResponse>> getList(@Validated ActivityStyleSearchRequest request,
|
|
||||||
@ModelAttribute PageParamRequest pageParamRequest) {
|
|
||||||
CommonPage<ActivityStyleResponse> activityStyleCommonPage = CommonPage.restPage(activityStyleService.getList(request, pageParamRequest));
|
|
||||||
return CommonResult.success(activityStyleCommonPage);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增
|
|
||||||
*
|
|
||||||
* @param activityStyleRequest 新增参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:activitystyle:save')")
|
|
||||||
@ApiOperation(value = "新增")
|
|
||||||
@RequestMapping(value = "/save", method = RequestMethod.POST)
|
|
||||||
public CommonResult<String> save(@RequestBody @Validated ActivityStyleRequest activityStyleRequest) {
|
|
||||||
ActivityStyle activityStyle = new ActivityStyle();
|
|
||||||
BeanUtils.copyProperties(activityStyleRequest, activityStyle);
|
|
||||||
activityStyle.setStarttime(YztDateUtil.strToDate(activityStyleRequest.getStarttime(), DateConstants.DATE_FORMAT));
|
|
||||||
activityStyle.setEndtime(YztDateUtil.strToDate(activityStyleRequest.getEndtime(), DateConstants.DATE_FORMAT));
|
|
||||||
activityStyle.setStyle(systemAttachmentService.clearPrefix(activityStyle.getStyle()));
|
|
||||||
if (activityStyleService.save(activityStyle)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
} else {
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除
|
|
||||||
*
|
|
||||||
* @param id Integer
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:activitystyle:delete')")
|
|
||||||
@ApiOperation(value = "删除")
|
|
||||||
@RequestMapping(value = "/delete", method = RequestMethod.GET)
|
|
||||||
public CommonResult<String> delete(@RequestParam(value = "id") Integer id) {
|
|
||||||
if (activityStyleService.removeById(id)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
} else {
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改
|
|
||||||
*
|
|
||||||
* @param activityStyleRequest 修改参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:activitystyle:edite')")
|
|
||||||
@ApiOperation(value = "修改")
|
|
||||||
@RequestMapping(value = "/update", method = RequestMethod.POST)
|
|
||||||
public CommonResult<String> update(@RequestBody @Validated ActivityStyleRequest activityStyleRequest) {
|
|
||||||
ActivityStyle activityStyle = new ActivityStyle();
|
|
||||||
BeanUtils.copyProperties(activityStyleRequest, activityStyle);
|
|
||||||
activityStyle.setId(activityStyleRequest.getId());
|
|
||||||
activityStyle.setStyle(systemAttachmentService.clearPrefix(activityStyle.getStyle()));
|
|
||||||
activityStyle.setStarttime(YztDateUtil.strToDate(activityStyleRequest.getStarttime(), DateConstants.DATE_FORMAT));
|
|
||||||
activityStyle.setEndtime(YztDateUtil.strToDate(activityStyleRequest.getEndtime(), DateConstants.DATE_FORMAT));
|
|
||||||
activityStyle.setUpdatetime(DateUtil.date());
|
|
||||||
if (activityStyleService.updateById(activityStyle)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
} else {
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新状态
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:activitystyle:updatestatus')")
|
|
||||||
@ApiOperation(value = "更新状态")
|
|
||||||
@RequestMapping(value = "/status", method = RequestMethod.POST)
|
|
||||||
public CommonResult<String> updateStatus(@RequestBody @Validated ActivityStyleUpdateStatusRequest activityStyleUpdateStatusRequest) {
|
|
||||||
boolean result = activityStyleService.updateStatus(activityStyleUpdateStatusRequest.getId(), activityStyleUpdateStatusRequest.getStatus());
|
|
||||||
if (result) {
|
|
||||||
return CommonResult.success();
|
|
||||||
} else {
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
import com.yzt.service.service.CallbackService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 支付回调
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("api/admin/payment/callback")
|
|
||||||
@Api(tags = "支付回调")
|
|
||||||
public class CallbackController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private CallbackService callbackService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 微信支付回调
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "微信支付回调")
|
|
||||||
@RequestMapping(value = "/wechat", method = RequestMethod.POST)
|
|
||||||
public String weChat(@RequestBody String request) {
|
|
||||||
System.out.println("微信支付回调 request ===> " + request);
|
|
||||||
String response = callbackService.weChat(request);
|
|
||||||
System.out.println("微信支付回调 response ===> " + response);
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 微信退款回调
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "微信退款回调")
|
|
||||||
@RequestMapping(value = "/wechat/refund", method = RequestMethod.POST)
|
|
||||||
public String weChatRefund(@RequestBody String request) {
|
|
||||||
System.out.println("微信退款回调 request ===> " + request);
|
|
||||||
String response = callbackService.weChatRefund(request);
|
|
||||||
System.out.println("微信退款回调 response ===> " + response);
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,102 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
import com.yzt.common.model.user.UserBrokerageRecord;
|
|
||||||
import com.yzt.common.page.CommonPage;
|
|
||||||
import com.yzt.common.request.BrokerageRecordRequest;
|
|
||||||
import com.yzt.common.request.FundsMonitorRequest;
|
|
||||||
import com.yzt.common.request.PageParamRequest;
|
|
||||||
import com.yzt.common.response.MonitorResponse;
|
|
||||||
import com.yzt.common.result.CommonResult;
|
|
||||||
import com.yzt.service.service.UserBillService;
|
|
||||||
import com.yzt.service.service.UserFundsMonitorService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户提现表 前端控制器
|
|
||||||
* fw_
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("api/admin/finance/founds/monitor")
|
|
||||||
@Api(tags = "财务 -- 资金监控")
|
|
||||||
public class FundsMonitorController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private UserBillService userBillService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private UserFundsMonitorService userFundsMonitorService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页显示资金监控
|
|
||||||
* @param request 搜索条件
|
|
||||||
* @param pageParamRequest 分页参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:finance:monitor:list')")
|
|
||||||
@ApiOperation(value = "资金监控")
|
|
||||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
||||||
public CommonResult<CommonPage<MonitorResponse>> getList(@Validated FundsMonitorRequest request, @Validated PageParamRequest pageParamRequest){
|
|
||||||
CommonPage<MonitorResponse> userExtractCommonPage = CommonPage.restPage(userBillService.fundMonitoring(request, pageParamRequest));
|
|
||||||
return CommonResult.success(userExtractCommonPage);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 佣金记录
|
|
||||||
* @param request 搜索条件
|
|
||||||
* @param pageParamRequest 分页参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:finance:monitor:brokerage:record')")
|
|
||||||
@ApiOperation(value = "佣金记录")
|
|
||||||
@RequestMapping(value = "/brokerage/record", method = RequestMethod.GET)
|
|
||||||
public CommonResult<CommonPage<UserBrokerageRecord>> brokerageRecord(@Validated BrokerageRecordRequest request, @Validated PageParamRequest pageParamRequest){
|
|
||||||
return CommonResult.success(CommonPage.restPage(userFundsMonitorService.getBrokerageRecord(request, pageParamRequest)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 佣金收益类型枚举
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:finance:monitor:brokerage:record')")
|
|
||||||
@ApiOperation(value = "佣金收益类型枚举")
|
|
||||||
@RequestMapping(value = "/brokerage/linkType/list", method = RequestMethod.GET)
|
|
||||||
public CommonResult<List<Map<String, String>>> getBrokerageLinkTypeList() {
|
|
||||||
Map<String, String> saleReward = new HashMap<>();
|
|
||||||
saleReward.put("value", "sale_reward");
|
|
||||||
saleReward.put("label", "销售奖励");
|
|
||||||
|
|
||||||
Map<String, String> queue = new HashMap<>();
|
|
||||||
queue.put("value", "queue");
|
|
||||||
queue.put("label", "免单奖");
|
|
||||||
|
|
||||||
Map<String, String> incubatorAll = new HashMap<>();
|
|
||||||
incubatorAll.put("value", "incubator_all");
|
|
||||||
incubatorAll.put("label", "孵化奖");
|
|
||||||
|
|
||||||
Map<String, String> manageReward = new HashMap<>();
|
|
||||||
manageReward.put("value", "manage_reward");
|
|
||||||
manageReward.put("label", "管理奖");
|
|
||||||
|
|
||||||
Map<String, String> subsidyReward = new HashMap<>();
|
|
||||||
subsidyReward.put("value", "subsidy_reward");
|
|
||||||
subsidyReward.put("label", "补贴奖励");
|
|
||||||
|
|
||||||
List<Map<String, String>> list = Arrays.asList(saleReward, queue, incubatorAll, manageReward, subsidyReward);
|
|
||||||
return CommonResult.success(list);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,132 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.yzt.common.constants.InvoiceConstants;
|
|
||||||
import com.yzt.common.model.order.StoreOrderInvoice;
|
|
||||||
import com.yzt.common.page.CommonPage;
|
|
||||||
import com.yzt.common.request.PageParamRequest;
|
|
||||||
import com.yzt.common.result.CommonResult;
|
|
||||||
import com.yzt.service.service.StoreOrderInvoiceService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import io.swagger.annotations.ApiParam;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单发票后台管理控制器
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("api/admin/order/invoice")
|
|
||||||
@Api(tags = "后台-订单发票管理")
|
|
||||||
public class OrderInvoiceController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private StoreOrderInvoiceService storeOrderInvoiceService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询发票列表
|
|
||||||
*/
|
|
||||||
@GetMapping("/list")
|
|
||||||
@ApiOperation("分页查询发票列表")
|
|
||||||
public CommonResult<CommonPage<StoreOrderInvoice>> getList(
|
|
||||||
@ApiParam("订单号") @RequestParam(required = false) String orderId,
|
|
||||||
@ApiParam("发票抬头类型") @RequestParam(required = false) Integer invoiceType,
|
|
||||||
@ApiParam("开票状态") @RequestParam(required = false) Integer invoiceStatus,
|
|
||||||
PageParamRequest pageParamRequest) {
|
|
||||||
|
|
||||||
LambdaQueryWrapper<StoreOrderInvoice> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
|
|
||||||
if (orderId != null && !orderId.trim().isEmpty()) {
|
|
||||||
wrapper.like(StoreOrderInvoice::getOrderId, orderId);
|
|
||||||
}
|
|
||||||
if (invoiceType != null) {
|
|
||||||
wrapper.eq(StoreOrderInvoice::getInvoiceType, invoiceType);
|
|
||||||
}
|
|
||||||
if (invoiceStatus != null) {
|
|
||||||
wrapper.eq(StoreOrderInvoice::getInvoiceStatus, invoiceStatus);
|
|
||||||
}
|
|
||||||
|
|
||||||
wrapper.orderByDesc(StoreOrderInvoice::getCreateTime);
|
|
||||||
|
|
||||||
Page<StoreOrderInvoice> page = new Page<>(pageParamRequest.getPage(), pageParamRequest.getLimit());
|
|
||||||
Page<StoreOrderInvoice> pageResult = storeOrderInvoiceService.page(page, wrapper);
|
|
||||||
|
|
||||||
// 手动构建分页结果
|
|
||||||
CommonPage<StoreOrderInvoice> result = new CommonPage<>();
|
|
||||||
result.setPage(pageParamRequest.getPage());
|
|
||||||
result.setLimit(pageParamRequest.getLimit());
|
|
||||||
result.setTotal(pageResult.getTotal());
|
|
||||||
result.setTotalPage((int) pageResult.getPages());
|
|
||||||
result.setList(pageResult.getRecords());
|
|
||||||
|
|
||||||
return CommonResult.success(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询订单发票详情
|
|
||||||
*/
|
|
||||||
@GetMapping("/detail/{orderId}")
|
|
||||||
@ApiOperation("查询订单发票详情")
|
|
||||||
public CommonResult<StoreOrderInvoice> getInvoiceDetail(@PathVariable String orderId) {
|
|
||||||
StoreOrderInvoice invoice = storeOrderInvoiceService.getByOrderId(orderId);
|
|
||||||
if (invoice == null) {
|
|
||||||
return CommonResult.failed("该订单暂无发票信息");
|
|
||||||
}
|
|
||||||
return CommonResult.success(invoice);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新发票状态(开票)
|
|
||||||
*/
|
|
||||||
@PostMapping("/issue")
|
|
||||||
@ApiOperation("更新发票状态为已开票")
|
|
||||||
public CommonResult<Boolean> issueInvoice(
|
|
||||||
@ApiParam("订单号") @RequestParam String orderId,
|
|
||||||
@ApiParam("发票代码") @RequestParam(required = false) String invoiceCode,
|
|
||||||
@ApiParam("发票号码") @RequestParam(required = false) String invoiceNumber,
|
|
||||||
@ApiParam("电子发票URL") @RequestParam(required = false) String invoiceUrl) {
|
|
||||||
|
|
||||||
boolean result = storeOrderInvoiceService.updateInvoiceStatus(
|
|
||||||
orderId,
|
|
||||||
InvoiceConstants.INVOICE_STATUS_ISSUED,
|
|
||||||
invoiceCode,
|
|
||||||
invoiceNumber,
|
|
||||||
invoiceUrl
|
|
||||||
);
|
|
||||||
|
|
||||||
if (result) {
|
|
||||||
return CommonResult.success(true);
|
|
||||||
} else {
|
|
||||||
return CommonResult.failed("开票失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新发票状态为开票失败
|
|
||||||
*/
|
|
||||||
@PostMapping("/fail")
|
|
||||||
@ApiOperation("更新发票状态为开票失败")
|
|
||||||
public CommonResult<Boolean> failInvoice(
|
|
||||||
@ApiParam("订单号") @RequestParam String orderId,
|
|
||||||
@ApiParam("失败原因") @RequestParam String remark) {
|
|
||||||
|
|
||||||
StoreOrderInvoice invoice = storeOrderInvoiceService.getByOrderId(orderId);
|
|
||||||
if (invoice == null) {
|
|
||||||
return CommonResult.failed("该订单暂无发票信息");
|
|
||||||
}
|
|
||||||
|
|
||||||
invoice.setInvoiceStatus(InvoiceConstants.INVOICE_STATUS_FAILED);
|
|
||||||
invoice.setRemark(remark);
|
|
||||||
boolean result = storeOrderInvoiceService.updateById(invoice);
|
|
||||||
|
|
||||||
if (result) {
|
|
||||||
return CommonResult.success(true);
|
|
||||||
} else {
|
|
||||||
return CommonResult.failed("操作失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,121 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
import com.yzt.common.model.user.User;
|
|
||||||
import com.yzt.common.page.CommonPage;
|
|
||||||
import com.yzt.common.request.PageParamRequest;
|
|
||||||
import com.yzt.common.request.RetailShopRequest;
|
|
||||||
import com.yzt.common.request.RetailShopStairUserRequest;
|
|
||||||
import com.yzt.common.response.SpreadOrderResponse;
|
|
||||||
import com.yzt.common.response.SpreadUserResponse;
|
|
||||||
import com.yzt.common.result.CommonResult;
|
|
||||||
import com.yzt.service.service.RetailShopService;
|
|
||||||
import com.yzt.service.service.UserService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分销模块
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("api/admin/store/retail")
|
|
||||||
@Api(tags = "分销")
|
|
||||||
public class RetailShopController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RetailShopService retailShopService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private UserService userService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分销员列表
|
|
||||||
* @param keywords 搜索参数
|
|
||||||
* @param dateLimit 时间参数
|
|
||||||
* @param pageParamRequest 分页参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:retail:list')")
|
|
||||||
@ApiOperation(value = "分销员列表")
|
|
||||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
||||||
@ApiImplicitParams({
|
|
||||||
@ApiImplicitParam(name = "keywords", value = "搜索关键字[姓名、电话、uid]"),
|
|
||||||
@ApiImplicitParam(name = "dateLimit", value = "today,yesterday,lately7,lately30,month,year,/yyyy-MM-dd hh:mm:ss,yyyy-MM-dd hh:mm:ss/")
|
|
||||||
})
|
|
||||||
public CommonResult<CommonPage<SpreadUserResponse>> getList(@RequestParam(required = false) String keywords,
|
|
||||||
@RequestParam(required = false) String dateLimit,
|
|
||||||
@ModelAttribute PageParamRequest pageParamRequest) {
|
|
||||||
return CommonResult.success(retailShopService.getSpreadPeopleList(keywords, dateLimit, pageParamRequest));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据用户参数获取推广人列表
|
|
||||||
* @param request 查询参数
|
|
||||||
* @param pageParamRequest 分页参数
|
|
||||||
* @return 查询结果推广人列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:retail:spread:list')")
|
|
||||||
@ApiOperation(value = "根据条件获取推广人列表")
|
|
||||||
@RequestMapping(value = "/spread/userlist", method = RequestMethod.POST)
|
|
||||||
public CommonResult<CommonPage<User>> getUserListBySpreadLevel(@RequestBody @Validated RetailShopStairUserRequest request,
|
|
||||||
@ModelAttribute PageParamRequest pageParamRequest) {
|
|
||||||
return CommonResult.success(CommonPage.restPage(userService.getUserListBySpreadLevel(request, pageParamRequest)));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据参数获取推广订单列表
|
|
||||||
* @param request 查询参数
|
|
||||||
* @param pageParamRequest 分页参数
|
|
||||||
* @return 查询结果推广人订单列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:retail:spread:order:list')")
|
|
||||||
@ApiOperation(value = "根据条件获取推广人订单")
|
|
||||||
@RequestMapping(value = "/spread/orderlist", method = RequestMethod.POST)
|
|
||||||
public CommonResult<CommonPage<SpreadOrderResponse>> getOrdersBySpreadLevel(@RequestBody @Validated RetailShopStairUserRequest request,
|
|
||||||
@ModelAttribute PageParamRequest pageParamRequest) {
|
|
||||||
return CommonResult.success(CommonPage.restPage(userService.getOrderListBySpreadLevel(request, pageParamRequest)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 清除上级推广人
|
|
||||||
* @param id 当前被清理的用户id
|
|
||||||
* @return 推广关系清理后的结果
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:retail:spread:clean')")
|
|
||||||
@ApiOperation(value = "清除上级推广人")
|
|
||||||
@RequestMapping(value = "/spread/clean/{id}", method = RequestMethod.GET)
|
|
||||||
public CommonResult<Object> clearSpread(@PathVariable Integer id) {
|
|
||||||
return CommonResult.success(userService.clearSpread(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分销设置获取
|
|
||||||
* @return 保存分销设置
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:retail:spread:manage:get')")
|
|
||||||
@ApiOperation(value = "分销配置信息获取")
|
|
||||||
@RequestMapping(value = "/spread/manage/get", method = RequestMethod.GET)
|
|
||||||
public CommonResult<Object> getSpreadInfo() {
|
|
||||||
return CommonResult.success(retailShopService.getManageInfo());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分销管理信息保存
|
|
||||||
* @param retailShopRequest 分销管理对象
|
|
||||||
* @return 保存结果
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:retail:spread:manage:set')")
|
|
||||||
@ApiOperation(value = "分销管理信息保存")
|
|
||||||
@RequestMapping(value = "/spread/manage/set", method = RequestMethod.POST)
|
|
||||||
public CommonResult<Object> setSpreadInfo(@RequestBody @Validated RetailShopRequest retailShopRequest) {
|
|
||||||
return CommonResult.success(retailShopService.setManageInfo(retailShopRequest));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,119 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
import com.yzt.common.model.coupon.StoreCoupon;
|
|
||||||
import com.yzt.common.page.CommonPage;
|
|
||||||
import com.yzt.common.request.PageParamRequest;
|
|
||||||
import com.yzt.common.request.SearchAndPageRequest;
|
|
||||||
import com.yzt.common.request.StoreCouponRequest;
|
|
||||||
import com.yzt.common.request.StoreCouponSearchRequest;
|
|
||||||
import com.yzt.common.response.StoreCouponInfoResponse;
|
|
||||||
import com.yzt.common.result.CommonResult;
|
|
||||||
import com.yzt.service.service.StoreCouponService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 优惠券表 前端控制器
|
|
||||||
* fw_
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("api/admin/marketing/coupon")
|
|
||||||
@Api(tags = "营销 -- 优惠券")
|
|
||||||
public class StoreCouponController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private StoreCouponService storeCouponService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页显示优惠券表
|
|
||||||
* @param request 搜索条件
|
|
||||||
* @param pageParamRequest 分页参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:coupon:list')")
|
|
||||||
@ApiOperation(value = "分页列表")
|
|
||||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
||||||
public CommonResult<CommonPage<StoreCoupon>> getList(@Validated StoreCouponSearchRequest request, @Validated PageParamRequest pageParamRequest) {
|
|
||||||
CommonPage<StoreCoupon> storeCouponCommonPage = CommonPage.restPage(storeCouponService.getList(request, pageParamRequest));
|
|
||||||
return CommonResult.success(storeCouponCommonPage);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存优惠券表
|
|
||||||
* @param request StoreCouponRequest 新增参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:coupon:save')")
|
|
||||||
@ApiOperation(value = "新增")
|
|
||||||
@RequestMapping(value = "/save", method = RequestMethod.POST)
|
|
||||||
public CommonResult<String> save(@RequestBody @Validated StoreCouponRequest request) {
|
|
||||||
if (storeCouponService.create(request)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
} else {
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否有效
|
|
||||||
* @param id integer id
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:coupon:update:status')")
|
|
||||||
@ApiOperation(value = "修改")
|
|
||||||
@RequestMapping(value = "/update/status", method = RequestMethod.POST)
|
|
||||||
public CommonResult<String> updateStatus(@RequestParam Integer id, @RequestParam Boolean status) {
|
|
||||||
if (storeCouponService.updateStatus(id, status)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
} else {
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 详情
|
|
||||||
* @param id integer id
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:coupon:info')")
|
|
||||||
@ApiOperation(value = "详情")
|
|
||||||
@RequestMapping(value = "/info", method = RequestMethod.POST)
|
|
||||||
@ApiImplicitParam(name="id", value="优惠券ID", required = true)
|
|
||||||
public CommonResult<StoreCouponInfoResponse> info(@RequestParam Integer id) {
|
|
||||||
return CommonResult.success(storeCouponService.info(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发送优惠券列表
|
|
||||||
* @param searchAndPageRequest 搜索分页参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:coupon:send:list')")
|
|
||||||
@ApiOperation(value = "发送优惠券列表")
|
|
||||||
@RequestMapping(value = "/send/list", method = RequestMethod.GET)
|
|
||||||
public CommonResult<CommonPage<StoreCoupon>> getSendList(@Validated SearchAndPageRequest searchAndPageRequest) {
|
|
||||||
CommonPage<StoreCoupon> storeCouponCommonPage = CommonPage.restPage(storeCouponService.getSendList(searchAndPageRequest));
|
|
||||||
return CommonResult.success(storeCouponCommonPage);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除优惠券
|
|
||||||
* @param id 优惠券id
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:coupon:delete')")
|
|
||||||
@ApiOperation(value = "删除优惠券")
|
|
||||||
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
|
||||||
public CommonResult<StoreCouponInfoResponse> delete(@RequestParam Integer id) {
|
|
||||||
if (storeCouponService.delete(id)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
} else {
|
|
||||||
return CommonResult.failed("删除失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,64 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
import com.yzt.common.page.CommonPage;
|
|
||||||
import com.yzt.common.request.PageParamRequest;
|
|
||||||
import com.yzt.common.request.StoreCouponUserRequest;
|
|
||||||
import com.yzt.common.request.StoreCouponUserSearchRequest;
|
|
||||||
import com.yzt.common.response.StoreCouponUserResponse;
|
|
||||||
import com.yzt.common.result.CommonResult;
|
|
||||||
import com.yzt.service.service.StoreCouponUserService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 优惠券发放记录表 前端控制器
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("api/admin/marketing/coupon/user")
|
|
||||||
@Api(tags = "营销 -- 优惠券 -- 领取记录")
|
|
||||||
public class StoreCouponUserController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private StoreCouponUserService storeCouponUserService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页显示优惠券发放记录表
|
|
||||||
* @param request 搜索条件
|
|
||||||
* @param pageParamRequest 分页参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:coupon:user:list')")
|
|
||||||
@ApiOperation(value = "分页列表")
|
|
||||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
||||||
public CommonResult<CommonPage<StoreCouponUserResponse>> getList(@Validated StoreCouponUserSearchRequest request, @Validated PageParamRequest pageParamRequest) {
|
|
||||||
CommonPage<StoreCouponUserResponse> storeCouponUserCommonPage = CommonPage.restPage(storeCouponUserService.getList(request, pageParamRequest));
|
|
||||||
return CommonResult.success(storeCouponUserCommonPage);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 领券
|
|
||||||
* @param storeCouponUserRequest 新增参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:coupon:user:receive')")
|
|
||||||
@ApiOperation(value = "领券")
|
|
||||||
@RequestMapping(value = "/receive", method = RequestMethod.POST)
|
|
||||||
public CommonResult<String> receive(@Validated StoreCouponUserRequest storeCouponUserRequest) {
|
|
||||||
if(storeCouponUserService.receive(storeCouponUserRequest)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
} else {
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,117 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
import com.yzt.common.page.CommonPage;
|
|
||||||
import com.yzt.common.request.PageParamRequest;
|
|
||||||
import com.yzt.common.request.StoreSeckillAddRequest;
|
|
||||||
import com.yzt.common.request.StoreSeckillSearchRequest;
|
|
||||||
import com.yzt.common.response.StoreProductInfoResponse;
|
|
||||||
import com.yzt.common.response.StoreSeckillResponse;
|
|
||||||
import com.yzt.common.result.CommonResult;
|
|
||||||
import com.yzt.service.service.StoreSeckillService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品秒杀产品表 前端控制器
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("api/admin/store/seckill")
|
|
||||||
@Api(tags = "商品 -- 秒杀 -- 商品") //配合swagger使用
|
|
||||||
public class StoreSeckillController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private StoreSeckillService storeSeckillService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页显示商品秒杀产品表
|
|
||||||
* @param request 搜索条件
|
|
||||||
* @param pageParamRequest 分页参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:seckill:list')")
|
|
||||||
@ApiOperation(value = "分页列表") //配合swagger使用
|
|
||||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
||||||
public CommonResult<CommonPage<StoreSeckillResponse>> getList(@Validated StoreSeckillSearchRequest request, @Validated PageParamRequest pageParamRequest) {
|
|
||||||
CommonPage<StoreSeckillResponse> storeSeckillCommonPage =
|
|
||||||
CommonPage.restPage(storeSeckillService.getList(request, pageParamRequest));
|
|
||||||
return CommonResult.success(storeSeckillCommonPage);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增商品秒杀产品表
|
|
||||||
* @param storeSeckillRequest 新增参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:seckill:save')")
|
|
||||||
@ApiOperation(value = "新增")
|
|
||||||
@RequestMapping(value = "/save", method = RequestMethod.POST)
|
|
||||||
public CommonResult<String> save(@RequestBody @Validated StoreSeckillAddRequest storeSeckillRequest) {
|
|
||||||
if (storeSeckillService.saveSeckill(storeSeckillRequest)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
} else {
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除商品秒杀产品表
|
|
||||||
* @param id Integer
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:seckill:delete')")
|
|
||||||
@ApiOperation(value = "删除")
|
|
||||||
@RequestMapping(value = "/delete", method = RequestMethod.GET)
|
|
||||||
public CommonResult<String> delete(@RequestParam(value = "id") Integer id) {
|
|
||||||
if (storeSeckillService.deleteById(id)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
} else {
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改商品秒杀产品表
|
|
||||||
* @param storeSeckillRequest 修改参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:seckill:update')")
|
|
||||||
@ApiOperation(value = "修改")
|
|
||||||
@RequestMapping(value = "/update", method = RequestMethod.POST)
|
|
||||||
public CommonResult<String> update(@RequestBody @Validated StoreSeckillAddRequest storeSeckillRequest) {
|
|
||||||
if (storeSeckillService.updateSeckill(storeSeckillRequest)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
} else {
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('admin:seckill:update:status')")
|
|
||||||
@ApiOperation(value = "修改秒杀商品状态")
|
|
||||||
@RequestMapping(value = "/update/status", method = RequestMethod.POST)
|
|
||||||
public CommonResult<String> updateStatus(@RequestParam @Validated Integer id, @RequestParam @Validated boolean status) {
|
|
||||||
if (storeSeckillService.updateSecKillStatus(id,status)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
} else {
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询商品秒杀产品表信息
|
|
||||||
* @param id Integer
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:seckill:info')")
|
|
||||||
@ApiOperation(value = "详情")
|
|
||||||
@RequestMapping(value = "/info", method = RequestMethod.GET)
|
|
||||||
public CommonResult<StoreProductInfoResponse> info(@RequestParam(value = "id") Integer id) {
|
|
||||||
StoreProductInfoResponse storeSeckill = storeSeckillService.getDetailAdmin(id);
|
|
||||||
return CommonResult.success(storeSeckill);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,122 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
import com.yzt.common.page.CommonPage;
|
|
||||||
import com.yzt.common.request.PageParamRequest;
|
|
||||||
import com.yzt.common.request.StoreSeckillMangerRequest;
|
|
||||||
import com.yzt.common.request.StoreSeckillMangerSearchRequest;
|
|
||||||
import com.yzt.common.response.StoreSeckillManagerResponse;
|
|
||||||
import com.yzt.common.result.CommonResult;
|
|
||||||
import com.yzt.service.service.StoreSeckillMangerService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 秒杀配置 前端控制器
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("api/admin/store/seckill/manger")
|
|
||||||
@Api(tags = "商品 -- 秒杀 -- 配置") //配合swagger使用
|
|
||||||
public class StoreSeckillMangerController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private StoreSeckillMangerService storeSeckillMangerService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页显示
|
|
||||||
* @param request 搜索条件
|
|
||||||
* @param pageParamRequest 分页参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:seckill:manger:list')")
|
|
||||||
@ApiOperation(value = "分页列表") //配合swagger使用
|
|
||||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
||||||
public CommonResult<CommonPage<StoreSeckillManagerResponse>> getList(
|
|
||||||
@Validated StoreSeckillMangerSearchRequest request, @Validated PageParamRequest pageParamRequest) {
|
|
||||||
return CommonResult.success(CommonPage.restPage(storeSeckillMangerService.getList(request, pageParamRequest)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增
|
|
||||||
* @param storeSeckillMangerRequest 新增参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:seckill:manger:save')")
|
|
||||||
@ApiOperation(value = "新增")
|
|
||||||
@RequestMapping(value = "/save", method = RequestMethod.POST)
|
|
||||||
public CommonResult<String> save(@RequestBody @Validated StoreSeckillMangerRequest storeSeckillMangerRequest) {
|
|
||||||
if (storeSeckillMangerService.saveManger(storeSeckillMangerRequest)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
} else {
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除
|
|
||||||
* @param id Integer
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:seckill:manger:delete')")
|
|
||||||
@ApiOperation(value = "删除")
|
|
||||||
@RequestMapping(value = "/delete", method = RequestMethod.GET)
|
|
||||||
public CommonResult<String> delete(@RequestParam(value = "id") Integer id) {
|
|
||||||
if (storeSeckillMangerService.deleteLogicById(id)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
} else {
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改
|
|
||||||
* @param id integer id
|
|
||||||
* @param storeSeckillMangerRequest 修改参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:seckill:manger:update')")
|
|
||||||
@ApiOperation(value = "修改")
|
|
||||||
@RequestMapping(value = "/update", method = RequestMethod.POST)
|
|
||||||
public CommonResult<String> update(@RequestParam Integer id, @RequestBody @Validated StoreSeckillMangerRequest storeSeckillMangerRequest) {
|
|
||||||
return storeSeckillMangerService.update(id, storeSeckillMangerRequest) ? CommonResult.success() : CommonResult.failed();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询信息
|
|
||||||
* @param id Integer
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:seckill:manger:info')")
|
|
||||||
@ApiOperation(value = "详情")
|
|
||||||
@RequestMapping(value = "/info", method = RequestMethod.GET)
|
|
||||||
public CommonResult<StoreSeckillManagerResponse> info(@RequestParam(value = "id") Integer id) {
|
|
||||||
return CommonResult.success(storeSeckillMangerService.detail(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新秒杀配置状态
|
|
||||||
* @param id 配置id
|
|
||||||
* @param status 待更新配置状态
|
|
||||||
* @return 更新结果
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:seckill:manger:update:status')")
|
|
||||||
@ApiOperation(value = "秒杀配置状态更新")
|
|
||||||
@RequestMapping(value = "/update/status/{id}", method = RequestMethod.POST)
|
|
||||||
@ApiImplicitParams({
|
|
||||||
@ApiImplicitParam(name = "id", value = "商品id", dataType = "int", required = true),
|
|
||||||
@ApiImplicitParam(name = "status", value = "状态", dataType = "string", required = true)
|
|
||||||
})
|
|
||||||
public CommonResult<Object> updateStatus(@PathVariable(value = "id") Integer id, String status) {
|
|
||||||
return CommonResult.success(storeSeckillMangerService.updateStatus(id,status));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,99 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
|
|
||||||
import com.yzt.common.model.system.SystemUserLevel;
|
|
||||||
import com.yzt.common.request.SystemUserLevelRequest;
|
|
||||||
import com.yzt.common.request.SystemUserLevelUpdateShowRequest;
|
|
||||||
import com.yzt.common.result.CommonResult;
|
|
||||||
import com.yzt.service.service.SystemUserLevelService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置用户等级表 前端控制器
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("api/admin/system/user/level")
|
|
||||||
@Api(tags = "设置 -- 会员等级")
|
|
||||||
public class SystemUserLevelController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SystemUserLevelService systemUserLevelService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页显示设置用户等级表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:system:user:level:list')")
|
|
||||||
@ApiOperation(value = "分页列表")
|
|
||||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
||||||
public CommonResult<List<SystemUserLevel>> getList() {
|
|
||||||
return CommonResult.success(systemUserLevelService.getList());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增等级
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:system:user:level:save')")
|
|
||||||
@ApiOperation(value = "新增等级")
|
|
||||||
@RequestMapping(value = "/save", method = RequestMethod.POST)
|
|
||||||
public CommonResult<Object> save(@RequestBody @Validated SystemUserLevelRequest request) {
|
|
||||||
if (systemUserLevelService.create(request)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
}
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除等级
|
|
||||||
* @param id 等级id
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:system:user:level:delete')")
|
|
||||||
@ApiOperation(value = "删除等级")
|
|
||||||
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
|
|
||||||
public CommonResult<Object> delete(@PathVariable(value = "id") Integer id) {
|
|
||||||
if (systemUserLevelService.delete(id)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
}
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新等级
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:system:user:level:update')")
|
|
||||||
@ApiOperation(value = "更新等级")
|
|
||||||
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
|
|
||||||
public CommonResult<Object> update(@PathVariable(value = "id") Integer id,
|
|
||||||
@RequestBody @Validated SystemUserLevelRequest request) {
|
|
||||||
if (systemUserLevelService.update(id, request)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
}
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 使用/禁用
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:system:user:level:use')")
|
|
||||||
@ApiOperation(value = "使用/禁用")
|
|
||||||
@RequestMapping(value = "/use", method = RequestMethod.POST)
|
|
||||||
public CommonResult<Object> use(@RequestBody @Validated SystemUserLevelUpdateShowRequest request) {
|
|
||||||
if (systemUserLevelService.updateShow(request)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
}
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,122 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
import com.yzt.common.model.finance.UserExtract;
|
|
||||||
import com.yzt.common.page.CommonPage;
|
|
||||||
import com.yzt.common.request.PageParamRequest;
|
|
||||||
import com.yzt.common.request.UserExtractRequest;
|
|
||||||
import com.yzt.common.request.UserExtractSearchRequest;
|
|
||||||
import com.yzt.common.response.BalanceResponse;
|
|
||||||
import com.yzt.common.response.UserExtractDetailResponse;
|
|
||||||
import com.yzt.common.result.CommonResult;
|
|
||||||
import com.yzt.service.service.UserExtractService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户提现表 前端控制器
|
|
||||||
* fw_
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("api/admin/finance/apply")
|
|
||||||
@Api(tags = "财务 -- 提现申请")
|
|
||||||
public class UserExtractController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private UserExtractService userExtractService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页显示用户提现表
|
|
||||||
* @param request 搜索条件
|
|
||||||
* @param pageParamRequest 分页参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:finance:apply:list')")
|
|
||||||
@ApiOperation(value = "分页列表")
|
|
||||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
||||||
public CommonResult<CommonPage<UserExtract>> getList(@Validated UserExtractSearchRequest request, @Validated PageParamRequest pageParamRequest){
|
|
||||||
CommonPage<UserExtract> userExtractCommonPage = CommonPage.restPage(userExtractService.getList(request, pageParamRequest));
|
|
||||||
return CommonResult.success(userExtractCommonPage);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改用户提现表
|
|
||||||
* @param id integer id
|
|
||||||
* @param userExtractRequest 修改参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:finance:apply:update')")
|
|
||||||
@ApiOperation(value = "修改")
|
|
||||||
@RequestMapping(value = "/update", method = RequestMethod.POST)
|
|
||||||
public CommonResult<String> update(@RequestParam Integer id, @Validated UserExtractRequest userExtractRequest){
|
|
||||||
if (userExtractService.updateExtract(id, userExtractRequest)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
} else {
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 提现申请详情
|
|
||||||
* @param id 提现申请记录id
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:finance:apply:list')")
|
|
||||||
@ApiOperation(value = "提现申请详情")
|
|
||||||
@RequestMapping(value = "/detail", method = RequestMethod.GET)
|
|
||||||
public CommonResult<UserExtractDetailResponse> detail(@RequestParam Integer id) {
|
|
||||||
return CommonResult.success(userExtractService.getDetailById(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 提现统计
|
|
||||||
* @Param dateLimit 时间限制 today,yesterday,lately7,lately30,month,year,/yyyy-MM-dd hh:mm:ss,yyyy-MM-dd hh:mm:ss/
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:finance:apply:balance')")
|
|
||||||
@ApiOperation(value = "提现统计")
|
|
||||||
@RequestMapping(value = "/balance", method = RequestMethod.POST)
|
|
||||||
public CommonResult<BalanceResponse> balance(@RequestParam(value = "dateLimit", required = false,defaultValue = "")
|
|
||||||
String dateLimit){
|
|
||||||
return CommonResult.success(userExtractService.getBalance(dateLimit));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 提现审核
|
|
||||||
* @param id 提现id
|
|
||||||
* @param status 审核状态 -1 未通过 0 审核中 1 已提现
|
|
||||||
* @param backMessage 驳回原因
|
|
||||||
* @return 审核结果
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:finance:apply:apply')")
|
|
||||||
@ApiOperation(value = "提现申请审核")
|
|
||||||
@ApiImplicitParams({
|
|
||||||
@ApiImplicitParam(name = "id", value = "提现申请记录ID", required = true, dataType = "int", paramType = "query"),
|
|
||||||
@ApiImplicitParam(name = "status", value = "审核状态:-1-未通过,0-审核中,1-已提现", required = true, dataType = "int", paramType = "query"),
|
|
||||||
@ApiImplicitParam(name = "backMessage", value = "驳回原因(status=-1 时必填)", required = false, dataType = "string", paramType = "query"),
|
|
||||||
@ApiImplicitParam(name = "auditRemark", value = "审核备注(记录本次审核说明)", required = false, dataType = "string", paramType = "query"),
|
|
||||||
@ApiImplicitParam(name = "transferVoucherUrl", value = "转账凭证地址(打款截图URL)", required = false, dataType = "string", paramType = "query")
|
|
||||||
})
|
|
||||||
@RequestMapping(value = "/apply", method = RequestMethod.POST)
|
|
||||||
public CommonResult<String> updateStatus(@RequestParam(value = "id") Integer id,
|
|
||||||
@RequestParam(value = "status",defaultValue = "审核状态 -1 未通过 0 审核中 1 已提现") Integer status,
|
|
||||||
@RequestParam(value = "backMessage",defaultValue = "驳回原因", required = false) String backMessage,
|
|
||||||
@RequestParam(value = "auditRemark",required = false) String auditRemark,
|
|
||||||
@RequestParam(value = "transferVoucherUrl",required = false) String transferVoucherUrl){
|
|
||||||
if(userExtractService.updateStatus(id, status, backMessage, auditRemark, transferVoucherUrl)){
|
|
||||||
return CommonResult.success();
|
|
||||||
}else{
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,47 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
import com.yzt.common.page.CommonPage;
|
|
||||||
import com.yzt.common.request.AdminIntegralSearchRequest;
|
|
||||||
import com.yzt.common.request.PageParamRequest;
|
|
||||||
import com.yzt.common.response.UserIntegralRecordResponse;
|
|
||||||
import com.yzt.common.result.CommonResult;
|
|
||||||
import com.yzt.service.service.UserIntegralRecordService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户积分管理控制器
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("api/admin/user/integral")
|
|
||||||
@Api(tags = "用户积分管理")
|
|
||||||
public class UserIntegralController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private UserIntegralRecordService integralRecordService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 积分分页列表
|
|
||||||
* @param request 搜索条件
|
|
||||||
* @param pageParamRequest 分页参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:user:integral:list')")
|
|
||||||
@ApiOperation(value = "积分分页列表")
|
|
||||||
@RequestMapping(value = "/list", method = RequestMethod.POST)
|
|
||||||
public CommonResult<CommonPage<UserIntegralRecordResponse>> getList(@RequestBody @Validated AdminIntegralSearchRequest request, @Validated PageParamRequest pageParamRequest) {
|
|
||||||
CommonPage<UserIntegralRecordResponse> restPage = CommonPage.restPage(integralRecordService.findAdminList(request, pageParamRequest));
|
|
||||||
return CommonResult.success(restPage);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,46 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
import com.yzt.common.model.user.UserLevel;
|
|
||||||
import com.yzt.common.page.CommonPage;
|
|
||||||
import com.yzt.common.request.PageParamRequest;
|
|
||||||
import com.yzt.common.result.CommonResult;
|
|
||||||
import com.yzt.service.service.UserLevelService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户等级记录表 前端控制器
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("api/admin/user/level")
|
|
||||||
@Api(tags = "会员 -- 等级")
|
|
||||||
public class UserLevelController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private UserLevelService userLevelService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页显示用户等级记录表
|
|
||||||
* @param pageParamRequest 分页参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:user:level:list')")
|
|
||||||
@ApiOperation(value = "分页列表")
|
|
||||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
||||||
public CommonResult<CommonPage<UserLevel>> getList(@Validated PageParamRequest pageParamRequest) {
|
|
||||||
CommonPage<UserLevel> userLevelCommonPage = CommonPage.restPage(userLevelService.getList(pageParamRequest));
|
|
||||||
return CommonResult.success(userLevelCommonPage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,111 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
import com.yzt.common.model.system.SystemAdmin;
|
|
||||||
import com.yzt.common.model.user.User;
|
|
||||||
import com.yzt.common.model.user.UserLevelUpgradeAudit;
|
|
||||||
import com.yzt.common.page.CommonPage;
|
|
||||||
import com.yzt.common.request.PageParamRequest;
|
|
||||||
import com.yzt.common.request.SystemStoreStaffRequest;
|
|
||||||
import com.yzt.common.request.UserLevelUpgradeAuditQueryRequest;
|
|
||||||
import com.yzt.common.request.UserLevelUpgradeAuditRequest;
|
|
||||||
import com.yzt.common.response.UserLevelUpgradeAuditResponse;
|
|
||||||
import com.yzt.common.result.CommonResult;
|
|
||||||
import com.yzt.common.vo.LoginUserVo;
|
|
||||||
import com.yzt.service.service.UserLevelUpgradeAuditService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.security.core.context.SecurityContextHolder;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: pengsz
|
|
||||||
* @Date: 2025/11/22
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("api/admin/user/upgrade-audit")
|
|
||||||
@Api(tags = "会员 -- 等级审核")
|
|
||||||
public class UserLevelUpgradeAuditController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private UserLevelUpgradeAuditService userLevelUpgradeAuditService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页显示用户等级记录表
|
|
||||||
* @param pageParamRequest 分页参数
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "分页列表")
|
|
||||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
||||||
public CommonResult<CommonPage<UserLevelUpgradeAuditResponse>> getList(@Validated PageParamRequest pageParamRequest, UserLevelUpgradeAuditQueryRequest request) {
|
|
||||||
CommonPage<UserLevelUpgradeAuditResponse> userLevelUpgradeAuditCommonPage = CommonPage.restPage(userLevelUpgradeAuditService.getList(pageParamRequest,request));
|
|
||||||
return CommonResult.success(userLevelUpgradeAuditCommonPage);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改
|
|
||||||
* @RequestBody UserLevelUpgradeAudit 新增参数
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "修改")
|
|
||||||
@RequestMapping(value = "/edit", method = RequestMethod.POST)
|
|
||||||
public CommonResult<String> edit(@RequestBody UserLevelUpgradeAudit request) {
|
|
||||||
if (userLevelUpgradeAuditService.edit(request)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
}
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增
|
|
||||||
* @RequestBody UserLevelUpgradeAudit 新增参数
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "新增")
|
|
||||||
@RequestMapping(value = "/save", method = RequestMethod.POST)
|
|
||||||
public CommonResult<String> save(@RequestBody UserLevelUpgradeAudit request) {
|
|
||||||
if (userLevelUpgradeAuditService.create(request)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
}
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户详情
|
|
||||||
* @param id Integer
|
|
||||||
*/@ApiOperation(value = "详情")
|
|
||||||
@RequestMapping(value = "/info", method = RequestMethod.GET)
|
|
||||||
public CommonResult<UserLevelUpgradeAuditResponse> info(@RequestParam(value = "id") Integer id) {
|
|
||||||
return CommonResult.success(userLevelUpgradeAuditService.getInfoById(id));
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 审核通过
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "审核通过")
|
|
||||||
@RequestMapping(value = "/approve", method = RequestMethod.POST)
|
|
||||||
public CommonResult<Object> approve(@Validated @RequestBody UserLevelUpgradeAuditRequest request) {
|
|
||||||
LoginUserVo loginUser = (LoginUserVo) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
|
|
||||||
SystemAdmin systemAdmin = loginUser.getUser();
|
|
||||||
if (userLevelUpgradeAuditService.approve(request, systemAdmin.getId().longValue())) {
|
|
||||||
return CommonResult.success("审核通过成功");
|
|
||||||
}
|
|
||||||
return CommonResult.failed("审核通过失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 审核拒绝
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "审核拒绝")
|
|
||||||
@RequestMapping(value = "/reject", method = RequestMethod.POST)
|
|
||||||
public CommonResult<Object> reject(@Validated @RequestBody UserLevelUpgradeAuditRequest request) {
|
|
||||||
LoginUserVo loginUser = (LoginUserVo) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
|
|
||||||
SystemAdmin systemAdmin = loginUser.getUser();
|
|
||||||
if (userLevelUpgradeAuditService.reject(request, systemAdmin.getId().longValue())) {
|
|
||||||
return CommonResult.success("审核拒绝成功");
|
|
||||||
}
|
|
||||||
return CommonResult.failed("审核拒绝失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,90 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
import com.yzt.common.model.user.UserRechargeApplication;
|
|
||||||
import com.yzt.common.page.CommonPage;
|
|
||||||
import com.yzt.common.request.PageParamRequest;
|
|
||||||
import com.yzt.common.request.UserRechargeApplicationRequest;
|
|
||||||
import com.yzt.common.request.UserRechargeApplicationSearchRequest;
|
|
||||||
import com.yzt.common.request.UserRechargeSearchRequest;
|
|
||||||
import com.yzt.common.response.UserRechargeApplicationResponse;
|
|
||||||
import com.yzt.common.response.UserRechargeResponse;
|
|
||||||
import com.yzt.common.result.CommonResult;
|
|
||||||
import com.yzt.service.service.UserRechargeApplicationService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: pengsz
|
|
||||||
* @Date: 2025/12/01
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("api/admin/user/recharge")
|
|
||||||
@Api(tags = "财务 -- 充值申请")
|
|
||||||
public class UserRechargeApplicationController {
|
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private UserRechargeApplicationService userRechargeApplicationService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页显示用户充值表
|
|
||||||
* @param request 搜索条件
|
|
||||||
* @param pageParamRequest 分页参数
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "分页列表")
|
|
||||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
||||||
public CommonResult<CommonPage<UserRechargeApplicationResponse>> getList(@Validated UserRechargeApplicationSearchRequest request, @Validated PageParamRequest pageParamRequest){
|
|
||||||
CommonPage<UserRechargeApplicationResponse> userRechargeCommonPage = CommonPage.restPage(userRechargeApplicationService.getList(request, pageParamRequest));
|
|
||||||
return CommonResult.success(userRechargeCommonPage);
|
|
||||||
}
|
|
||||||
|
|
||||||
// /**
|
|
||||||
// * 用户充值审核
|
|
||||||
// * @param status 充值状态userRechargeApprove
|
|
||||||
// * */
|
|
||||||
// @ApiOperation(value = "用户充值审核")
|
|
||||||
// @RequestMapping(value = "/approve", method = RequestMethod.POST)
|
|
||||||
// public CommonResult<Boolean> approve(@Validated Integer status, Integer id){
|
|
||||||
// return CommonResult.success(userRechargeApplicationService.approve(status,id));
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户充值审核
|
|
||||||
* @param request 充值状态
|
|
||||||
* */
|
|
||||||
@ApiOperation(value = "用户充值审核")
|
|
||||||
@RequestMapping(value = "/approve", method = RequestMethod.POST)
|
|
||||||
public CommonResult<Boolean> userRechargeApprove(@Validated @RequestBody UserRechargeApplicationRequest request){
|
|
||||||
return CommonResult.success(userRechargeApplicationService.approve(request));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户充值审核
|
|
||||||
* @param request 充值状态
|
|
||||||
* */
|
|
||||||
@ApiOperation(value = "用户充值申请记录新增")
|
|
||||||
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
|
||||||
public CommonResult<Boolean> create(@Validated @RequestBody UserRechargeApplicationRequest request){
|
|
||||||
return CommonResult.success(userRechargeApplicationService.create(request));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户充值申请信息
|
|
||||||
* @param id 充值状态
|
|
||||||
* */
|
|
||||||
@ApiOperation(value = "用户充值申请记录信息")
|
|
||||||
@RequestMapping(value = "/info", method = RequestMethod.GET)
|
|
||||||
public CommonResult<UserRechargeApplicationResponse> info(@Validated Integer id){
|
|
||||||
return CommonResult.success(userRechargeApplicationService.info(id));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,63 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
import com.yzt.common.page.CommonPage;
|
|
||||||
import com.yzt.common.request.PageParamRequest;
|
|
||||||
import com.yzt.common.request.UserRechargeApplicationRequest;
|
|
||||||
import com.yzt.common.request.UserRechargeSearchRequest;
|
|
||||||
import com.yzt.common.response.UserRechargeResponse;
|
|
||||||
import com.yzt.common.result.CommonResult;
|
|
||||||
import com.yzt.service.service.UserRechargeApplicationService;
|
|
||||||
import com.yzt.service.service.UserRechargeService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户充值表 前端控制器
|
|
||||||
* fw_
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("api/admin/user/topUpLog")
|
|
||||||
@Api(tags = "财务 -- 充值")
|
|
||||||
public class UserRechargeController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private UserRechargeService userRechargeService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页显示用户充值表
|
|
||||||
* @param request 搜索条件
|
|
||||||
* @param pageParamRequest 分页参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:recharge:list')")
|
|
||||||
@ApiOperation(value = "分页列表")
|
|
||||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
||||||
public CommonResult<CommonPage<UserRechargeResponse>> getList(@Validated UserRechargeSearchRequest request, @Validated PageParamRequest pageParamRequest){
|
|
||||||
CommonPage<UserRechargeResponse> userRechargeCommonPage = CommonPage.restPage(userRechargeService.getList(request, pageParamRequest));
|
|
||||||
return CommonResult.success(userRechargeCommonPage);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 充值总金额
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:recharge:balance')")
|
|
||||||
@ApiOperation(value = "提现总金额")
|
|
||||||
@RequestMapping(value = "/balance", method = RequestMethod.POST)
|
|
||||||
public CommonResult<HashMap<String, BigDecimal>> balance(){
|
|
||||||
return CommonResult.success(userRechargeService.getBalanceList());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,41 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
|
|
||||||
import com.yzt.common.response.WeChatJsSdkConfigResponse;
|
|
||||||
import com.yzt.common.result.CommonResult;
|
|
||||||
import com.yzt.service.service.WechatNewService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 微信 -- 开放平台 admin
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController("WeChatAdminController")
|
|
||||||
@RequestMapping("api/admin/wechat")
|
|
||||||
@Api(tags = "微信 -- 开放平台 admin")
|
|
||||||
public class WeChatAdminController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private WechatNewService wechatNewService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取微信公众号js配置
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:wechat:config')")
|
|
||||||
@ApiOperation(value = "获取微信公众号js配置")
|
|
||||||
@RequestMapping(value = "/config", method = RequestMethod.GET)
|
|
||||||
@ApiImplicitParam(name = "url", value = "页面地址url")
|
|
||||||
public CommonResult<WeChatJsSdkConfigResponse> configJs(@RequestParam(value = "url") String url) {
|
|
||||||
return CommonResult.success(wechatNewService.getJsSdkConfig(url));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,71 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.yzt.common.result.CommonResult;
|
|
||||||
import com.yzt.service.service.WechatNewService;
|
|
||||||
import com.yzt.service.service.WechatPublicService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 微信缓存表 前端控制器
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("api/admin/wechat/menu")
|
|
||||||
@Api(tags = "微信开放平台 -- 菜单管理")
|
|
||||||
public class WeChatController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private WechatPublicService wechatPublicService;
|
|
||||||
@Autowired
|
|
||||||
private WechatNewService wechatNewService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取微信菜单
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:wechat:menu:public:get')")
|
|
||||||
@ApiOperation(value = "获取自定义菜单")
|
|
||||||
@RequestMapping(value = "/public/get", method = RequestMethod.GET)
|
|
||||||
public CommonResult<Object> get() {
|
|
||||||
return CommonResult.success(wechatPublicService.getCustomizeMenus());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建微信菜单
|
|
||||||
* @param data 菜单数据,具体json格式参考微信开放平台
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:wechat:menu:public:create')")
|
|
||||||
@ApiOperation(value = "保存自定义菜单")
|
|
||||||
@RequestMapping(value = "/public/create", method = RequestMethod.POST)
|
|
||||||
public CommonResult<JSONObject> create(@RequestBody String data) {
|
|
||||||
if (wechatPublicService.createMenus(data)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
}
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除微信菜单
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:wechat:menu:public:delete')")
|
|
||||||
@ApiOperation(value = "删除自定义菜单")
|
|
||||||
@RequestMapping(value = "/public/delete", method = RequestMethod.GET)
|
|
||||||
public CommonResult<JSONObject> delete() {
|
|
||||||
if (wechatPublicService.deleteMenus()) {
|
|
||||||
return CommonResult.success();
|
|
||||||
}
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,70 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
import com.yzt.service.service.WechatCallbackService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.PrintWriter;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 微信小程序回调
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("api/public/wechat/mini/callback")
|
|
||||||
@Api(tags = "微信开放平台 -- 小程序回调")
|
|
||||||
public class WechatCallbackController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private WechatCallbackService wechatCallbackService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 小程序回调-自己模拟
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "小程序回调-自己模拟")
|
|
||||||
@RequestMapping(value = "/test", method = RequestMethod.POST)
|
|
||||||
public String test(@RequestBody String request) {
|
|
||||||
return wechatCallbackService.callback(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 小程序回调
|
|
||||||
* 目前只用于视频号直播
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "小程序回调")
|
|
||||||
@RequestMapping(value = "/index", method = RequestMethod.POST)
|
|
||||||
public String webHook(@RequestBody String request) {
|
|
||||||
return wechatCallbackService.callback(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 微信推送地址验证
|
|
||||||
* @param signature 微信加密签名,signature结合了开发者填写的token参数和请求中的timestamp参数、nonce参数。
|
|
||||||
* @param timestamp 时间戳
|
|
||||||
* @param nonce 随机数
|
|
||||||
* @param echostr 随机字符串
|
|
||||||
*/
|
|
||||||
@RequestMapping(value = { "/index" }, method = RequestMethod.GET)
|
|
||||||
private void webHook(
|
|
||||||
@RequestParam(value = "signature", required = false) String signature,
|
|
||||||
@RequestParam(value = "timestamp", required = false) String timestamp,
|
|
||||||
@RequestParam(value = "nonce", required = false) String nonce,
|
|
||||||
@RequestParam(value = "echostr") String echostr,
|
|
||||||
HttpServletResponse response) throws IOException {
|
|
||||||
System.out.println("微信小程序回调测试成功");
|
|
||||||
PrintWriter writer = response.getWriter();
|
|
||||||
writer.print(echostr);
|
|
||||||
writer.flush();
|
|
||||||
writer.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
|
|
||||||
import com.yzt.common.result.CommonResult;
|
|
||||||
import com.yzt.service.service.WechatMediaService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import io.swagger.annotations.ApiParam;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 微信回复表 前端控制器
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("api/admin/wechat/media")
|
|
||||||
@Api(tags = "微信开放平台 -- 素材")
|
|
||||||
public class WechatMediaController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private WechatMediaService wechatMediaService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 上传
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:wechat:media:upload')")
|
|
||||||
@ApiOperation(value = "上传")
|
|
||||||
@RequestMapping(value = "/upload", method = RequestMethod.POST)
|
|
||||||
public CommonResult<Map<String, String>> upload(
|
|
||||||
@RequestParam("media") @ApiParam(name = "media", value = "待上传素材图片文件", required = true) MultipartFile file,
|
|
||||||
@RequestParam("type") @ApiParam(name = "type", value = "媒体文件类型,分别有图片(image)、语音(voice", required = true, allowableValues = "range[image,voice]") String type
|
|
||||||
) {
|
|
||||||
return CommonResult.success(wechatMediaService.upload(file, type));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,132 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
import com.yzt.common.model.wechat.WechatReply;
|
|
||||||
import com.yzt.common.page.CommonPage;
|
|
||||||
import com.yzt.common.request.PageParamRequest;
|
|
||||||
import com.yzt.common.request.WechatReplyRequest;
|
|
||||||
import com.yzt.common.request.WechatReplySearchRequest;
|
|
||||||
import com.yzt.common.result.CommonResult;
|
|
||||||
import com.yzt.service.service.WechatReplyService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.BeanUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 微信关键字回复表 前端控制器
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("api/admin/wechat/keywords/reply")
|
|
||||||
@Api(tags = "微信开放平台 -- 微信关键字回复")
|
|
||||||
public class WechatReplyController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private WechatReplyService wechatReplyService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页显示微信关键字回复表
|
|
||||||
* @param request 搜索条件
|
|
||||||
* @param pageParamRequest 分页参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:wechat:keywords:reply:list')")
|
|
||||||
@ApiOperation(value = "分页列表")
|
|
||||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
||||||
public CommonResult<CommonPage<WechatReply>> getList(@Validated WechatReplySearchRequest request, @Validated PageParamRequest pageParamRequest) {
|
|
||||||
CommonPage<WechatReply> wechatReplyCommonPage = CommonPage.restPage(wechatReplyService.getList(request, pageParamRequest));
|
|
||||||
return CommonResult.success(wechatReplyCommonPage);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增微信关键字回复表
|
|
||||||
* @param wechatReplyRequest 新增参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:wechat:keywords:reply:save')")
|
|
||||||
@ApiOperation(value = "新增")
|
|
||||||
@RequestMapping(value = "/save", method = RequestMethod.POST)
|
|
||||||
public CommonResult<String> save(@RequestBody @Validated WechatReplyRequest wechatReplyRequest) {
|
|
||||||
WechatReply wechatReply = new WechatReply();
|
|
||||||
BeanUtils.copyProperties(wechatReplyRequest, wechatReply);
|
|
||||||
if (wechatReplyService.create(wechatReply)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
}else{
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除微信关键字回复表
|
|
||||||
* @param id Integer
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:wechat:keywords:reply:delete')")
|
|
||||||
@ApiOperation(value = "删除")
|
|
||||||
@RequestMapping(value = "/delete", method = RequestMethod.GET)
|
|
||||||
public CommonResult<String> delete(@RequestParam(value = "id") Integer id) {
|
|
||||||
if (wechatReplyService.removeById(id)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
}
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改微信关键字回复表
|
|
||||||
* @param wechatReplyRequest 修改参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:wechat:keywords:reply:update')")
|
|
||||||
@ApiOperation(value = "修改")
|
|
||||||
@RequestMapping(value = "/update", method = RequestMethod.POST)
|
|
||||||
public CommonResult<String> update(@RequestBody @Validated WechatReplyRequest wechatReplyRequest) {
|
|
||||||
if (wechatReplyService.updateReply(wechatReplyRequest)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
}
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改状态
|
|
||||||
* @param id integer id
|
|
||||||
* @param status boolean 状态
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:wechat:keywords:reply:status')")
|
|
||||||
@ApiOperation(value = "状态")
|
|
||||||
@RequestMapping(value = "/status", method = RequestMethod.POST)
|
|
||||||
public CommonResult<String> update(@RequestParam(value = "id") Integer id, @RequestParam(value = "status") Boolean status) {
|
|
||||||
if (wechatReplyService.updateStatus(id, status)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
}
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询微信关键字回复表信息
|
|
||||||
* @param id Integer
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:wechat:keywords:reply:info')")
|
|
||||||
@ApiOperation(value = "详情")
|
|
||||||
@RequestMapping(value = "/info", method = RequestMethod.GET)
|
|
||||||
public CommonResult<WechatReply> info(@RequestParam(value = "id") Integer id) {
|
|
||||||
WechatReply wechatReply = wechatReplyService.getInfo(id);
|
|
||||||
return CommonResult.success(wechatReply);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据关键字查询数据
|
|
||||||
* @param keywords String 关键字
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:wechat:keywords:reply:info:keywords')")
|
|
||||||
@ApiOperation(value = "根据关键字查询数据")
|
|
||||||
@RequestMapping(value = "/info/keywords", method = RequestMethod.GET)
|
|
||||||
public CommonResult<WechatReply> info(@RequestParam(value = "keywords") String keywords) {
|
|
||||||
WechatReply wechatReply = wechatReplyService.getVoByKeywords(keywords);
|
|
||||||
return CommonResult.success(wechatReply);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,37 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
|
|
||||||
import com.yzt.common.result.CommonResult;
|
|
||||||
import com.yzt.service.service.YlyPrintService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 易联云打印订单
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("api/admin/yly")
|
|
||||||
@Api(tags = "易联云 打印订单小票") //配合swagger使用
|
|
||||||
public class YlyPrintController {
|
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private YlyPrintService ylyPrintService;
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('admin:yly:print')")
|
|
||||||
@ApiOperation(value = "打印小票")
|
|
||||||
@RequestMapping(value = "/print/{ordid}", method = RequestMethod.GET)
|
|
||||||
public CommonResult<String> updateStatus(@PathVariable String ordid) {
|
|
||||||
ylyPrintService.YlyPrint(ordid,false);
|
|
||||||
return CommonResult.success();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -5,7 +5,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.yzt.fightwine</groupId>
|
<groupId>com.yzt.fightwine</groupId>
|
||||||
<artifactId>yzt-fightwine</artifactId>
|
<artifactId>zp-fightwine</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.yzt.fightwine</groupId>
|
<groupId>com.yzt.fightwine</groupId>
|
||||||
<artifactId>yzt-fightwine</artifactId>
|
<artifactId>zp-fightwine</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.yzt.fightwine</groupId>
|
<groupId>com.yzt.fightwine</groupId>
|
||||||
<artifactId>yzt-fightwine</artifactId>
|
<artifactId>zp-fightwine</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@ -5,7 +5,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>com.yzt.fightwine</groupId>
|
<groupId>com.yzt.fightwine</groupId>
|
||||||
<artifactId>yzt-fightwine</artifactId>
|
<artifactId>zp-fightwine</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<name>yzt-fightwine</name>
|
<name>yzt-fightwine</name>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user