| | |
| | | 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(ScoreOrder.STATUS_READY != status){ |
| | | return JsonResult.failMessage("当前订单不是待发货状态!"); |
| | | } |
| | | ScoreOrder order = scoreOrderMapper.selectByPrimaryKey(model.getId()); |
| | | Example exampleDetails = new Example(ScoreDetails.class); |
| | | Example.Criteria criteriaDetails = exampleDetails.createCriteria(); |
| | | criteriaDetails.andEqualTo("orderNo",order.getOrderNo()); |
| | | criteriaDetails.andEqualTo("userId",order.getUserId()); |
| | | criteriaDetails.andEqualTo("type",ScoreDetails.SCORE_TYPE_SHOPPING_RETURN); |
| | | |
| | | List<ScoreDetails> scoreDetails = scoreDetailsMapper.selectByExample(exampleDetails); |
| | | if(CollUtil.isNotEmpty(scoreDetails)){ |
| | | return JsonResult.failMessage("当前订单已经取消过了!"); |
| | | } |
| | | Long aLong = orderService.cancelOrder(model); |
| | | if(aLong > 0){ |
| | | OperationAppLog build = OperationAppLog.builder().appPrograme(CommonEnum.后台.getValue()).opreateName(getAdminName(request)) |