perry 2023-05-08 10:25:54 +08:00
parent 0f918d8810
commit a20462db8f
2 changed files with 311 additions and 324 deletions

View File

@ -1,266 +1,255 @@
package cn.iocoder.yudao.module.product.controller.admin.order; //package cn.iocoder.yudao.module.product.controller.admin.order;
//
import com.zbkj.common.page.CommonPage; //import cn.iocoder.yudao.module.product.service.order.StoreOrderService;
import com.zbkj.common.request.*; //import io.swagger.v3.oas.annotations.tags.Tag;
import com.zbkj.common.response.*; //import lombok.extern.slf4j.Slf4j;
import com.zbkj.common.vo.ExpressSheetVo; //import org.hibernate.validator.constraints.Range;
import com.zbkj.common.vo.LogisticsResultVo; //import org.springframework.beans.factory.annotation.Autowired;
import com.zbkj.service.service.StoreOrderService; //import org.springframework.security.access.prepost.PreAuthorize;
import com.zbkj.service.service.StoreOrderVerification; //import org.springframework.validation.annotation.Validated;
import io.swagger.annotations.Api; //import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.ApiImplicitParam; //
import io.swagger.annotations.ApiImplicitParams; //import java.util.List;
import io.swagger.annotations.ApiOperation; //
import lombok.extern.slf4j.Slf4j; ///**
import org.hibernate.validator.constraints.Range; // * 订单表 前端控制器
import org.springframework.beans.factory.annotation.Autowired; // * +----------------------------------------------------------------------
import org.springframework.security.access.prepost.PreAuthorize; // * | CRMEB [ CRMEB赋能开发者助力企业发展 ]
import org.springframework.validation.annotation.Validated; // * +----------------------------------------------------------------------
import org.springframework.web.bind.annotation.*; // * | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
// * +----------------------------------------------------------------------
import java.util.List; // * | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// * +----------------------------------------------------------------------
/** // * | Author: CRMEB Team <admin@crmeb.com>
* // * +----------------------------------------------------------------------
* +---------------------------------------------------------------------- // */
* | CRMEB [ CRMEB ] //@Slf4j
* +---------------------------------------------------------------------- //@RestController
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved. //@RequestMapping("api/admin/store/order")
* +---------------------------------------------------------------------- //@Tag(name = "管理后台 - 订单") //配合swagger使用
* | Licensed CRMEBCRMEB //public class StoreOrderController {
* +---------------------------------------------------------------------- //
* | Author: CRMEB Team <admin@crmeb.com> // @Autowired
* +---------------------------------------------------------------------- // private StoreOrderService storeOrderService;
*/ //
@Slf4j //
@RestController // /**
@RequestMapping("api/admin/store/order") // * 分页显示订单表
@Api(tags = "订单") //配合swagger使用 // * @param request 搜索条件
public class StoreOrderController { // * @param pageParamRequest 分页参数
// */
@Autowired // @PreAuthorize("hasAuthority('admin:order:list')")
private StoreOrderService storeOrderService; // @ApiOperation(value = "分页列表") //配合swagger使用
// @RequestMapping(value = "/list", method = RequestMethod.GET)
@Autowired // public CommonResult<CommonPage<StoreOrderDetailResponse>> getList(@Validated StoreOrderSearchRequest request, @Validated PageParamRequest pageParamRequest) {
private StoreOrderVerification storeOrderVerification; // return CommonResult.success(storeOrderService.getAdminList(request, pageParamRequest));
// }
/** //
* // /**
* @param request // * 获取订单各状态数量
* @param pageParamRequest // */
*/ // @PreAuthorize("hasAuthority('admin:order:status:num')")
@PreAuthorize("hasAuthority('admin:order:list')") // @ApiOperation(value = "获取订单各状态数量")
@ApiOperation(value = "分页列表") //配合swagger使用 // @RequestMapping(value = "/status/num", method = RequestMethod.GET)
@RequestMapping(value = "/list", method = RequestMethod.GET) // public CommonResult<StoreOrderCountItemResponse> getOrderStatusNum(
public CommonResult<CommonPage<StoreOrderDetailResponse>> getList(@Validated StoreOrderSearchRequest request, @Validated PageParamRequest pageParamRequest) { // @RequestParam(value = "dateLimit", defaultValue = "") String dateLimit,
return CommonResult.success(storeOrderService.getAdminList(request, pageParamRequest)); // @RequestParam(value = "type", defaultValue = "2") @Range(min = 0, max = 2, message = "未知的订单类型") Integer type) {
} // return CommonResult.success(storeOrderService.getOrderStatusNum(dateLimit, type));
// }
/** //
* // /**
*/ // * 获取订单统计数据
@PreAuthorize("hasAuthority('admin:order:status:num')") // */
@ApiOperation(value = "获取订单各状态数量") // @PreAuthorize("hasAuthority('admin:order:list:data')")
@RequestMapping(value = "/status/num", method = RequestMethod.GET) // @ApiOperation(value = "获取订单统计数据")
public CommonResult<StoreOrderCountItemResponse> getOrderStatusNum( // @RequestMapping(value = "/list/data", method = RequestMethod.GET)
@RequestParam(value = "dateLimit", defaultValue = "") String dateLimit, // public CommonResult<StoreOrderTopItemResponse> getOrderData(@RequestParam(value = "dateLimit", defaultValue = "")String dateLimit) {
@RequestParam(value = "type", defaultValue = "2") @Range(min = 0, max = 2, message = "未知的订单类型") Integer type) { // return CommonResult.success(storeOrderService.getOrderData(dateLimit));
return CommonResult.success(storeOrderService.getOrderStatusNum(dateLimit, type)); // }
} //
//
/** // /**
* // * 订单删除
*/ // */
@PreAuthorize("hasAuthority('admin:order:list:data')") // @PreAuthorize("hasAuthority('admin:order:delete')")
@ApiOperation(value = "获取订单统计数据") // @ApiOperation(value = "订单删除")
@RequestMapping(value = "/list/data", method = RequestMethod.GET) // @RequestMapping(value = "/delete", method = RequestMethod.GET)
public CommonResult<StoreOrderTopItemResponse> getOrderData(@RequestParam(value = "dateLimit", defaultValue = "")String dateLimit) { // public CommonResult<String> delete(@RequestParam(value = "orderNo") String orderNo) {
return CommonResult.success(storeOrderService.getOrderData(dateLimit)); // if (storeOrderService.delete(orderNo)) {
} // return CommonResult.success();
// } else {
// return CommonResult.failed();
/** // }
* // }
*/ //
@PreAuthorize("hasAuthority('admin:order:delete')") // /**
@ApiOperation(value = "订单删除") // * 备注订单
@RequestMapping(value = "/delete", method = RequestMethod.GET) // */
public CommonResult<String> delete(@RequestParam(value = "orderNo") String orderNo) { // @PreAuthorize("hasAuthority('admin:order:mark')")
if (storeOrderService.delete(orderNo)) { // @ApiOperation(value = "备注")
return CommonResult.success(); // @RequestMapping(value = "/mark", method = RequestMethod.POST)
} else { // public CommonResult<String> mark(@RequestParam String orderNo, @RequestParam String mark) {
return CommonResult.failed(); // if (storeOrderService.mark(orderNo, mark)) {
} // return CommonResult.success();
} // } else {
// return CommonResult.failed();
/** // }
* // }
*/ //
@PreAuthorize("hasAuthority('admin:order:mark')") // /**
@ApiOperation(value = "备注") // * 修改订单(改价)
@RequestMapping(value = "/mark", method = RequestMethod.POST) // */
public CommonResult<String> mark(@RequestParam String orderNo, @RequestParam String mark) { // @PreAuthorize("hasAuthority('admin:order:update:price')")
if (storeOrderService.mark(orderNo, mark)) { // @ApiOperation(value = "修改订单(改价)")
return CommonResult.success(); // @RequestMapping(value = "/update/price", method = RequestMethod.POST)
} else { // public CommonResult<String> updatePrice(@RequestBody @Validated StoreOrderUpdatePriceRequest request) {
return CommonResult.failed(); // if (storeOrderService.updatePrice(request)) {
} // return CommonResult.success();
} // } else {
// return CommonResult.failed();
/** // }
* () // }
*/ //
@PreAuthorize("hasAuthority('admin:order:update:price')") // /**
@ApiOperation(value = "修改订单(改价)") // * 订单详情
@RequestMapping(value = "/update/price", method = RequestMethod.POST) // */
public CommonResult<String> updatePrice(@RequestBody @Validated StoreOrderUpdatePriceRequest request) { // @PreAuthorize("hasAuthority('admin:order:info')")
if (storeOrderService.updatePrice(request)) { // @ApiOperation(value = "详情")
return CommonResult.success(); // @RequestMapping(value = "/info", method = RequestMethod.GET)
} else { // public CommonResult<StoreOrderInfoResponse> info(@RequestParam(value = "orderNo") String orderNo) {
return CommonResult.failed(); // return CommonResult.success(storeOrderService.info(orderNo));
} // }
} //
// /**
/** // * 发送货
* // */
*/ // @PreAuthorize("hasAuthority('admin:order:send')")
@PreAuthorize("hasAuthority('admin:order:info')") // @ApiOperation(value = "发送货")
@ApiOperation(value = "详情") // @RequestMapping(value = "/send", method = RequestMethod.POST)
@RequestMapping(value = "/info", method = RequestMethod.GET) // public CommonResult<Boolean> send(@RequestBody @Validated StoreOrderSendRequest request) {
public CommonResult<StoreOrderInfoResponse> info(@RequestParam(value = "orderNo") String orderNo) { // if (storeOrderService.send(request)) {
return CommonResult.success(storeOrderService.info(orderNo)); // return CommonResult.success();
} // }
// return CommonResult.failed();
/** // }
* //
*/ // /**
@PreAuthorize("hasAuthority('admin:order:send')") // * 退款
@ApiOperation(value = "发送货") // */
@RequestMapping(value = "/send", method = RequestMethod.POST) // @PreAuthorize("hasAuthority('admin:order:refund')")
public CommonResult<Boolean> send(@RequestBody @Validated StoreOrderSendRequest request) { // @ApiOperation(value = "退款")
if (storeOrderService.send(request)) { // @RequestMapping(value = "/refund", method = RequestMethod.GET)
return CommonResult.success(); // public CommonResult<Boolean> send(@Validated StoreOrderRefundRequest request) {
} // return CommonResult.success(storeOrderService.refund(request));
return CommonResult.failed(); // }
} //
// /**
/** // * 拒绝退款
* 退 // */
*/ // @PreAuthorize("hasAuthority('admin:order:refund:refuse')")
@PreAuthorize("hasAuthority('admin:order:refund')") // @ApiOperation(value = "拒绝退款")
@ApiOperation(value = "退款") // @RequestMapping(value = "/refund/refuse", method = RequestMethod.GET)
@RequestMapping(value = "/refund", method = RequestMethod.GET) // public CommonResult<Object> refundRefuse(@RequestParam String orderNo, @RequestParam String reason) {
public CommonResult<Boolean> send(@Validated StoreOrderRefundRequest request) { // if (storeOrderService.refundRefuse(orderNo, reason)) {
return CommonResult.success(storeOrderService.refund(request)); // return CommonResult.success();
} // }
// return CommonResult.failed();
/** // }
* 退 //
*/ // /**
@PreAuthorize("hasAuthority('admin:order:refund:refuse')") // * 快递查询
@ApiOperation(value = "拒绝退款") // */
@RequestMapping(value = "/refund/refuse", method = RequestMethod.GET) // @PreAuthorize("hasAuthority('admin:order:logistics:info')")
public CommonResult<Object> refundRefuse(@RequestParam String orderNo, @RequestParam String reason) { // @ApiOperation(value = "快递查询")
if (storeOrderService.refundRefuse(orderNo, reason)) { // @RequestMapping(value = "/getLogisticsInfo", method = RequestMethod.GET)
return CommonResult.success(); // public CommonResult<LogisticsResultVo> getLogisticsInfo(@RequestParam(value = "orderNo") String orderNo) {
} // return CommonResult.success(storeOrderService.getLogisticsInfo(orderNo));
return CommonResult.failed(); // }
} //
// /**
/** // * 核销订单头部数据
* // *
*/ // * @author stivepeim
@PreAuthorize("hasAuthority('admin:order:logistics:info')") // * @since 2020-08-29
@ApiOperation(value = "快递查询") // */
@RequestMapping(value = "/getLogisticsInfo", method = RequestMethod.GET) // @PreAuthorize("hasAuthority('admin:order:statistics')")
public CommonResult<LogisticsResultVo> getLogisticsInfo(@RequestParam(value = "orderNo") String orderNo) { // @ApiOperation(value = "核销订单头部数据")
return CommonResult.success(storeOrderService.getLogisticsInfo(orderNo)); // @RequestMapping(value = "/statistics", method = RequestMethod.GET)
} // public CommonResult<StoreStaffTopDetail> getStatistics() {
// return CommonResult.success(storeOrderVerification.getOrderVerificationData());
/** // }
* //
* // /**
* @author stivepeim // * 核销订单 月列表数据
* @since 2020-08-29 // *
*/ // * @author stivepeim
@PreAuthorize("hasAuthority('admin:order:statistics')") // * @since 2020-08-29
@ApiOperation(value = "核销订单头部数据") // */
@RequestMapping(value = "/statistics", method = RequestMethod.GET) // @PreAuthorize("hasAuthority('admin:order:statistics:data')")
public CommonResult<StoreStaffTopDetail> getStatistics() { // @ApiOperation(value = "核销订单 月列表数据")
return CommonResult.success(storeOrderVerification.getOrderVerificationData()); // @RequestMapping(value = "/statisticsData", method = RequestMethod.GET)
} // public CommonResult<List<StoreStaffDetail>> getStaffDetail(StoreOrderStaticsticsRequest request) {
// return CommonResult.success(storeOrderVerification.getOrderVerificationDetail(request));
/** // }
* //
* //
* @author stivepeim // /**
* @since 2020-08-29 // * 核销码核销订单
*/ // *
@PreAuthorize("hasAuthority('admin:order:statistics:data')") // * @author stivepeim
@ApiOperation(value = "核销订单 月列表数据") // * @since 2020-09-01
@RequestMapping(value = "/statisticsData", method = RequestMethod.GET) // */
public CommonResult<List<StoreStaffDetail>> getStaffDetail(StoreOrderStaticsticsRequest request) { // @PreAuthorize("hasAuthority('admin:order:write:update')")
return CommonResult.success(storeOrderVerification.getOrderVerificationDetail(request)); // @ApiOperation(value = "核销码核销订单")
} // @RequestMapping(value = "/writeUpdate/{vCode}", method = RequestMethod.GET)
// public CommonResult<Object> verificationOrder(@PathVariable String vCode) {
// return CommonResult.success(storeOrderVerification.verificationOrderByCode(vCode));
/** // }
* //
* // /**
* @author stivepeim // * 核销码查询待核销订单
* @since 2020-09-01 // *
*/ // * @author stivepeim
@PreAuthorize("hasAuthority('admin:order:write:update')") // * @since 2020-09-01
@ApiOperation(value = "核销码核销订单") // */
@RequestMapping(value = "/writeUpdate/{vCode}", method = RequestMethod.GET) // @PreAuthorize("hasAuthority('admin:order:write:confirm')")
public CommonResult<Object> verificationOrder(@PathVariable String vCode) { // @ApiOperation(value = "核销码查询待核销订单")
return CommonResult.success(storeOrderVerification.verificationOrderByCode(vCode)); // @RequestMapping(value = "/writeConfirm/{vCode}", method = RequestMethod.GET)
} // public CommonResult<Object> verificationConfirmOrder(
// @PathVariable String vCode) {
/** // return CommonResult.success(storeOrderVerification.getVerificationOrderByCode(vCode));
* // }
* //
* @author stivepeim // /**
* @since 2020-09-01 // * 订单统计详情
*/ // *
@PreAuthorize("hasAuthority('admin:order:write:confirm')") // * @author stivepeim
@ApiOperation(value = "核销码查询待核销订单") // * @since 2020-09-01
@RequestMapping(value = "/writeConfirm/{vCode}", method = RequestMethod.GET) // */
public CommonResult<Object> verificationConfirmOrder( // @PreAuthorize("hasAuthority('admin:order:time')")
@PathVariable String vCode) { // @ApiOperation(value = "订单统计详情")
return CommonResult.success(storeOrderVerification.getVerificationOrderByCode(vCode)); // @RequestMapping(value = "/time", method = RequestMethod.GET)
} // @ApiImplicitParams({
// @ApiImplicitParam(name = "dateLimit", value = "today,yesterday,lately7,lately30,month,year,/yyyy-MM-dd hh:mm:ss,yyyy-MM-dd hh:mm:ss/",
/** // dataType = "String", required = true),
* // @ApiImplicitParam(name = "type", value = "1=price 2=order", required = true)
* // })
* @author stivepeim // public CommonResult<Object> statisticsOrderTime(@RequestParam String dateLimit,
* @since 2020-09-01 // @RequestParam Integer type) {
*/ // return CommonResult.success(storeOrderService.orderStatisticsByTime(dateLimit, type));
@PreAuthorize("hasAuthority('admin:order:time')") // }
@ApiOperation(value = "订单统计详情") //
@RequestMapping(value = "/time", method = RequestMethod.GET) // /**
@ApiImplicitParams({ // * 获取面单默认配置信息
@ApiImplicitParam(name = "dateLimit", value = "today,yesterday,lately7,lately30,month,year,/yyyy-MM-dd hh:mm:ss,yyyy-MM-dd hh:mm:ss/", // */
dataType = "String", required = true), // @PreAuthorize("hasAuthority('admin:order:sheet:info')")
@ApiImplicitParam(name = "type", value = "1=price 2=order", required = true) // @ApiOperation(value = "获取面单默认配置信息")
}) // @RequestMapping(value = "/sheet/info", method = RequestMethod.GET)
public CommonResult<Object> statisticsOrderTime(@RequestParam String dateLimit, // public CommonResult<ExpressSheetVo> getDeliveryInfo() {
@RequestParam Integer type) { // return CommonResult.success(storeOrderService.getDeliveryInfo());
return CommonResult.success(storeOrderService.orderStatisticsByTime(dateLimit, type)); // }
} //
//}
/** //
* //
*/ //
@PreAuthorize("hasAuthority('admin:order:sheet:info')")
@ApiOperation(value = "获取面单默认配置信息")
@RequestMapping(value = "/sheet/info", method = RequestMethod.GET)
public CommonResult<ExpressSheetVo> getDeliveryInfo() {
return CommonResult.success(storeOrderService.getDeliveryInfo());
}
}

View File

@ -1,58 +1,56 @@
package cn.iocoder.yudao.module.product.controller.admin.order; //package cn.iocoder.yudao.module.product.controller.admin.order;
//
import com.zbkj.common.model.order.StoreOrderStatus; //
import com.zbkj.common.page.CommonPage; //import cn.iocoder.yudao.framework.common.pojo.PageParam;
import com.zbkj.common.request.PageParamRequest; //import cn.iocoder.yudao.module.product.dal.dataobject.order.StoreOrderStatus;
import com.zbkj.common.request.StoreOrderStatusSearchRequest; //import cn.iocoder.yudao.module.product.request.order.StoreOrderStatusSearchRequest;
import com.zbkj.common.response.CommonResult; //import cn.iocoder.yudao.module.product.service.order.StoreOrderStatusService;
import com.zbkj.service.service.StoreOrderStatusService; //import io.swagger.v3.oas.annotations.Operation;
import io.swagger.annotations.Api; //import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.annotations.ApiOperation; //import lombok.extern.slf4j.Slf4j;
import lombok.extern.slf4j.Slf4j; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PreAuthorize; //import org.springframework.validation.annotation.Validated;
import org.springframework.validation.annotation.Validated; //import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMapping; //import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestMethod; //import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RestController; //
//
///**
/** // * 订单操作记录表 前端控制器
* // * +----------------------------------------------------------------------
* +---------------------------------------------------------------------- // * | CRMEB [ CRMEB赋能开发者助力企业发展 ]
* | CRMEB [ CRMEB ] // * +----------------------------------------------------------------------
* +---------------------------------------------------------------------- // * | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved. // * +----------------------------------------------------------------------
* +---------------------------------------------------------------------- // * | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
* | Licensed CRMEBCRMEB // * +----------------------------------------------------------------------
* +---------------------------------------------------------------------- // * | Author: CRMEB Team <admin@crmeb.com>
* | Author: CRMEB Team <admin@crmeb.com> // * +----------------------------------------------------------------------
* +---------------------------------------------------------------------- // */
*/ //@Slf4j
@Slf4j //@RestController
@RestController //@RequestMapping("api/admin/store/order/status")
@RequestMapping("api/admin/store/order/status") //@Tag(name = "管理后台 - 订单 -- 操作记录") //配合swagger使用
@Api(tags = "订单 -- 操作记录") //配合swagger使用 //public class StoreOrderStatusController {
//
public class StoreOrderStatusController { // @Autowired
// private StoreOrderStatusService storeOrderStatusService;
@Autowired //
private StoreOrderStatusService storeOrderStatusService; // /**
// * 分页显示订单操作记录表
/** // * @param request 搜索条件
* // * @param pageParamRequest 分页参数
* @param request // */
* @param pageParamRequest // @PreAuthorize("hasAuthority('admin:order:status:list')")
*/ // @Operation(value = "分页列表") //配合swagger使用
@PreAuthorize("hasAuthority('admin:order:status:list')") // @RequestMapping(value = "/list", method = RequestMethod.GET)
@ApiOperation(value = "分页列表") //配合swagger使用 // public CommonResult<CommonPage<StoreOrderStatus>> getList(@Validated StoreOrderStatusSearchRequest request,
@RequestMapping(value = "/list", method = RequestMethod.GET) // @Validated PageParam pageParamRequest){
public CommonResult<CommonPage<StoreOrderStatus>> getList(@Validated StoreOrderStatusSearchRequest request, // CommonPage<StoreOrderStatus> storeOrderStatusCommonPage = CommonPage.restPage(storeOrderStatusService.getList(request, pageParamRequest));
@Validated PageParamRequest pageParamRequest){ // return CommonResult.success(storeOrderStatusCommonPage);
CommonPage<StoreOrderStatus> storeOrderStatusCommonPage = CommonPage.restPage(storeOrderStatusService.getList(request, pageParamRequest)); // }
return CommonResult.success(storeOrderStatusCommonPage); //}
} //
} //
//