refactor: delete unuse 代码
This commit is contained in:
parent
5403009737
commit
01cb982a69
@ -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,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,155 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
import com.yzt.common.model.system.SystemStore;
|
|
||||||
import com.yzt.common.page.CommonPage;
|
|
||||||
import com.yzt.common.request.PageParamRequest;
|
|
||||||
import com.yzt.common.request.SystemStoreRequest;
|
|
||||||
import com.yzt.common.request.SystemStoreSearchRequest;
|
|
||||||
import com.yzt.common.result.CommonResult;
|
|
||||||
import com.yzt.service.service.SystemStoreService;
|
|
||||||
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.HashMap;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 门店自提 前端控制器
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("api/admin/system/store")
|
|
||||||
@Api(tags = "设置 -- 提货点 -- 提货点")
|
|
||||||
public class SystemStoreController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SystemStoreService systemStoreService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页显示门店自提
|
|
||||||
* @param request SystemStoreSearchRequest 搜索条件
|
|
||||||
* @param pageParamRequest 分页参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:system:store:list')")
|
|
||||||
@ApiOperation(value = "门店自提分页列表")
|
|
||||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
||||||
public CommonResult<CommonPage<SystemStore>> getList(@Validated SystemStoreSearchRequest request, @Validated PageParamRequest pageParamRequest) {
|
|
||||||
CommonPage<SystemStore> expressCommonPage = CommonPage.restPage(systemStoreService.getList(request.getKeywords(), request.getStatus(), pageParamRequest));
|
|
||||||
return CommonResult.success(expressCommonPage);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 数量
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:system:store:count')")
|
|
||||||
@ApiOperation(value = "数量")
|
|
||||||
@RequestMapping(value = "/getCount", method = RequestMethod.GET)
|
|
||||||
public CommonResult<HashMap<String, Integer>> getCount( @RequestParam(value = "keywords", defaultValue = "") String keywords) {
|
|
||||||
return CommonResult.success(systemStoreService.getCount(keywords));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增门店自提
|
|
||||||
* @param request SystemStoreRequest 新增参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:system:store:save')")
|
|
||||||
@ApiOperation(value = "新增")
|
|
||||||
@RequestMapping(value = "/save", method = RequestMethod.POST)
|
|
||||||
public CommonResult<String> save(@RequestBody @Validated SystemStoreRequest request) {
|
|
||||||
if (systemStoreService.create(request)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
}
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除门店自提
|
|
||||||
* @param id Integer
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:system:store:delete')")
|
|
||||||
@ApiOperation(value = "删除")
|
|
||||||
@RequestMapping(value = "/delete", method = RequestMethod.GET)
|
|
||||||
public CommonResult<String> delete(@RequestParam(value = "id") Integer id) {
|
|
||||||
if (systemStoreService.delete(id)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
}
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改门店自提
|
|
||||||
* @param id integer id
|
|
||||||
* @param request 修改参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:system:store:update')")
|
|
||||||
@ApiOperation(value = "修改")
|
|
||||||
@RequestMapping(value = "/update", method = RequestMethod.POST)
|
|
||||||
public CommonResult<String> update(@RequestParam Integer id, @RequestBody @Validated SystemStoreRequest request) {
|
|
||||||
if (systemStoreService.update(id, request)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
}
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改门店显示状态
|
|
||||||
* @param id integer id
|
|
||||||
* @param status 状态
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:system:store:update:status')")
|
|
||||||
@ApiOperation(value = "修改门店显示状态")
|
|
||||||
@RequestMapping(value = "/update/status", method = RequestMethod.GET)
|
|
||||||
public CommonResult<String> updateStatus(@RequestParam Integer id, @RequestParam Boolean status) {
|
|
||||||
if (systemStoreService.updateStatus(id, status)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
}
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 门店自提详情
|
|
||||||
* @param id Integer
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:system:store:info')")
|
|
||||||
@ApiOperation(value = "详情")
|
|
||||||
@RequestMapping(value = "/info", method = RequestMethod.GET)
|
|
||||||
public CommonResult<SystemStore> info(@RequestParam(value = "id") Integer id) {
|
|
||||||
return CommonResult.success(systemStoreService.getInfo(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 彻底删除
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:system:store:completely:delete')")
|
|
||||||
@ApiOperation(value = "彻底删除")
|
|
||||||
@RequestMapping(value = "/completely/delete", method = RequestMethod.GET)
|
|
||||||
public CommonResult<Object> completeLyDelete(@RequestParam(value = "id") Integer id) {
|
|
||||||
if (systemStoreService.completeLyDelete(id)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
}
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 恢复
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:system:store:recovery')")
|
|
||||||
@ApiOperation(value = "提货点恢复")
|
|
||||||
@RequestMapping(value = "/recovery", method = RequestMethod.GET)
|
|
||||||
public CommonResult<Object> recovery(@RequestParam(value = "id") Integer id) {
|
|
||||||
if (systemStoreService.recovery(id)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
}
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,117 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
import com.yzt.common.model.system.SystemStoreStaff;
|
|
||||||
import com.yzt.common.page.CommonPage;
|
|
||||||
import com.yzt.common.request.PageParamRequest;
|
|
||||||
import com.yzt.common.request.SystemStoreStaffRequest;
|
|
||||||
import com.yzt.common.response.SystemStoreStaffResponse;
|
|
||||||
import com.yzt.common.result.CommonResult;
|
|
||||||
import com.yzt.service.service.SystemStoreStaffService;
|
|
||||||
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.*;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 门店店员表 前端控制器
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("api/admin/system/store/staff")
|
|
||||||
@Api(tags = "设置 -- 提货点 -- 核销员")
|
|
||||||
public class SystemStoreStaffController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SystemStoreStaffService systemStoreStaffService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页显示门店核销员列表
|
|
||||||
* @param storeId 门店id
|
|
||||||
* @param pageParamRequest 分页参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:system:staff:list')")
|
|
||||||
@ApiOperation(value = "分页列表")
|
|
||||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
||||||
public CommonResult<CommonPage<SystemStoreStaffResponse>> getList(@RequestParam(name = "storeId", required = false, defaultValue = "0") Integer storeId,
|
|
||||||
@ModelAttribute PageParamRequest pageParamRequest) {
|
|
||||||
CommonPage<SystemStoreStaffResponse> systemStoreStaffCommonPage =
|
|
||||||
CommonPage.restPage(systemStoreStaffService.getList(storeId, pageParamRequest));
|
|
||||||
return CommonResult.success(systemStoreStaffCommonPage);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增门店店员表
|
|
||||||
* @param systemStoreStaffRequest 新增参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:system:staff:save')")
|
|
||||||
@ApiOperation(value = "新增")
|
|
||||||
@RequestMapping(value = "/save", method = RequestMethod.POST)
|
|
||||||
public CommonResult<String> save(@RequestBody @ModelAttribute SystemStoreStaffRequest systemStoreStaffRequest) {
|
|
||||||
if (systemStoreStaffService.saveUnique(systemStoreStaffRequest)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
}
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除门店店员表
|
|
||||||
* @param id Integer
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:system:staff:delete')")
|
|
||||||
@ApiOperation(value = "删除")
|
|
||||||
@RequestMapping(value = "/delete", method = RequestMethod.GET)
|
|
||||||
public CommonResult<String> delete(@RequestParam(value = "id") Integer id) {
|
|
||||||
if (systemStoreStaffService.removeById(id)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
}
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改门店店员表
|
|
||||||
* @param id integer id
|
|
||||||
* @param systemStoreStaffRequest 修改参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:system:staff:update')")
|
|
||||||
@ApiOperation(value = "修改")
|
|
||||||
@RequestMapping(value = "/update", method = RequestMethod.POST)
|
|
||||||
public CommonResult<String> update(@RequestParam Integer id, @RequestBody @ModelAttribute SystemStoreStaffRequest systemStoreStaffRequest) {
|
|
||||||
if (systemStoreStaffService.edit(id, systemStoreStaffRequest)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
}
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改门店店员表
|
|
||||||
* @param id integer id
|
|
||||||
* @param status 状态
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:system:staff:update:status')")
|
|
||||||
@ApiOperation(value = "修改状态")
|
|
||||||
@RequestMapping(value = "/update/status", method = RequestMethod.GET)
|
|
||||||
public CommonResult<String> updateStatus(@RequestParam Integer id, @RequestParam Integer status) {
|
|
||||||
if (systemStoreStaffService.updateStatus(id, status)) {
|
|
||||||
return CommonResult.success();
|
|
||||||
}
|
|
||||||
return CommonResult.failed();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询门店店员表信息
|
|
||||||
* @param id Integer
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:system:staff:info')")
|
|
||||||
@ApiOperation(value = "详情")
|
|
||||||
@RequestMapping(value = "/info", method = RequestMethod.GET)
|
|
||||||
public CommonResult<SystemStoreStaff> info(@RequestParam(value = "id") Integer id) {
|
|
||||||
return CommonResult.success(systemStoreStaffService.getById(id));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
import com.yzt.common.request.PageParamRequest;
|
|
||||||
import com.yzt.common.request.SystemWriteOffOrderSearchRequest;
|
|
||||||
import com.yzt.common.response.SystemWriteOffOrderResponse;
|
|
||||||
import com.yzt.common.result.CommonResult;
|
|
||||||
import com.yzt.service.service.StoreOrderService;
|
|
||||||
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/system/store/order")
|
|
||||||
@Api(tags = "设置 -- 提货点 -- 核销订单") //配合swagger使用
|
|
||||||
public class SystemWriteOffOrderController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private StoreOrderService storeOrderService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页显示订单表
|
|
||||||
* @param request 搜索条件
|
|
||||||
* @param pageParamRequest 分页参数
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:system:order:list')")
|
|
||||||
@ApiOperation(value = "分页列表") //配合swagger使用
|
|
||||||
@RequestMapping(value = "/list", method = RequestMethod.POST)
|
|
||||||
public CommonResult<SystemWriteOffOrderResponse> getList(
|
|
||||||
@Validated SystemWriteOffOrderSearchRequest request,
|
|
||||||
@Validated PageParamRequest pageParamRequest) {
|
|
||||||
return CommonResult.success(storeOrderService.getWriteOffList(request, pageParamRequest));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,57 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
|
|
||||||
import com.yzt.common.result.CommonResult;
|
|
||||||
import com.yzt.service.service.TemplateMessageService;
|
|
||||||
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.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 微信模板 前端控制器
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("api/admin/wechat/template")
|
|
||||||
@Api(tags = "微信 -- 消息模版") //配合swagger使用
|
|
||||||
public class TemplateMessageController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private TemplateMessageService templateMessageService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 公众号模板消息同步
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:wechat:whcbqhn:sync')")
|
|
||||||
@ApiOperation(value = "公众号模板消息同步")
|
|
||||||
@RequestMapping(value = "/whcbqhn/sync", method = RequestMethod.POST)
|
|
||||||
public CommonResult<String> whcbqhnSync() {
|
|
||||||
if (templateMessageService.whcbqhnSync()) {
|
|
||||||
return CommonResult.success("公众号模板消息同步成功");
|
|
||||||
}
|
|
||||||
return CommonResult.failed("公众号模板消息同步失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 小程序订阅消息同步
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('admin:wechat:routine:sync')")
|
|
||||||
@ApiOperation(value = "小程序订阅消息同步")
|
|
||||||
@RequestMapping(value = "/routine/sync", method = RequestMethod.POST)
|
|
||||||
public CommonResult<String> routineSync() {
|
|
||||||
if (templateMessageService.routineSync()) {
|
|
||||||
return CommonResult.success("小程序订阅消息同步成功");
|
|
||||||
}
|
|
||||||
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,61 +0,0 @@
|
|||||||
package com.yzt.admin.controller;
|
|
||||||
|
|
||||||
import com.yzt.common.page.CommonPage;
|
|
||||||
import com.yzt.common.request.PageParamRequest;
|
|
||||||
import com.yzt.common.request.UserRechargeSearchRequest;
|
|
||||||
import com.yzt.common.response.UserRechargeResponse;
|
|
||||||
import com.yzt.common.result.CommonResult;
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user