| | |
| | | import com.xzx.gc.common.constant.Constants; |
| | | import com.xzx.gc.common.dto.log.OperationAppLog; |
| | | import com.xzx.gc.common.request.BaseController; |
| | | import com.xzx.gc.entity.ScoreDetails; |
| | | import com.xzx.gc.entity.ScoreOrder; |
| | | import com.xzx.gc.model.JsonResult; |
| | | import com.xzx.gc.shop.dto.*; |
| | | import com.xzx.gc.shop.mapper.ScoreDetailsMapper; |
| | | import com.xzx.gc.shop.mapper.ScoreOrderMapper; |
| | | import com.xzx.gc.shop.service.OrderService; |
| | | import com.xzx.gc.shop.vo.QueryOrderListVo; |
| | |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import tk.mybatis.mapper.entity.Example; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | |
| | | private OrderService orderService; |
| | | @Resource |
| | | private ScoreOrderMapper scoreOrderMapper; |
| | | @Resource |
| | | private ScoreDetailsMapper scoreDetailsMapper; |
| | | |
| | | /** |
| | | * 查询订单列表 |
| | |
| | | if(ObjectUtil.isEmpty(scoreOrder)){ |
| | | return JsonResult.failMessage("订单不存在!"); |
| | | } |
| | | Integer status = scoreOrder.getStatus(); |
| | | if(ScoreOrder.STATUS_DOING != status){ |
| | | return JsonResult.failMessage("当前订单不是已收货状态!"); |
| | | } |
| | | // Integer status = scoreOrder.getStatus(); |
| | | // if(ScoreOrder.STATUS_DOING != status){ |
| | | // return JsonResult.failMessage("当前订单不是已收货状态!"); |
| | | // } |
| | | List<String> voucherImgs = model.getVoucherImgs(); |
| | | if(CollUtil.isEmpty(voucherImgs)){ |
| | | return JsonResult.failMessage("凭证不能为空!"); |
| | |
| | | if(ScoreOrder.STATUS_READY != status){ |
| | | return JsonResult.failMessage("当前订单不是待发货状态!"); |
| | | } |
| | | Long aLong = orderService.cancelOrder(model); |
| | | if(aLong > 0){ |
| | | OperationAppLog build = OperationAppLog.builder().appPrograme(CommonEnum.后台.getValue()).opreateName(getAdminName(request)) |
| | | .methodName(Constants.SCORESHOP_MODUL_NAME).operateAction("订单管理-取消-" + id).build(); |
| | | mqUtil.sendApp(build); |
| | | return JsonResult.success("操作成功!"); |
| | | }else{ |
| | | return JsonResult.success("操作失败!"); |
| | | } |
| | | |
| | | orderService.cancelOrder(id,scoreOrder.getUserId()); |
| | | OperationAppLog build = OperationAppLog.builder().appPrograme(CommonEnum.后台.getValue()).opreateName(getAdminName(request)) |
| | | .methodName(Constants.SCORESHOP_MODUL_NAME).operateAction("订单管理-取消-" + id).build(); |
| | | mqUtil.sendApp(build); |
| | | return JsonResult.success("操作成功!"); |
| | | } |
| | | |
| | | |