| | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.business.web.request.GoodsorderBackDTO; |
| | | import com.doumee.dao.business.web.request.GoodsorderCanBanlanceDTO; |
| | | import com.doumee.dao.business.web.response.UserResponse; |
| | | import com.doumee.dao.system.dto.WebLoginDTO; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | |
| | | private SystemLoginService systemLoginService; |
| | | @Autowired |
| | | private SystemUserService systemUserService; |
| | | /** 订单退款/可退款信息查询(web 端 JWT 场景) */ |
| | | @Autowired |
| | | private GoodsorderService goodsorderService; |
| | | @LoginRequired |
| | | @PreventRepeat(limit = 10, lockTime = 10000) |
| | | @ApiOperation("登录管理员账号") |
| | |
| | | return ApiResponse.success(list); |
| | | } |
| | | |
| | | @LoginRequired |
| | | @ApiOperation("获取可退款信息") |
| | | @GetMapping("/getGoodsorderCanBanlanceDTO") |
| | | public ApiResponse<GoodsorderCanBanlanceDTO> getGoodsorderCanBanlanceDTO(@RequestParam String orderId) { |
| | | // 仅查询,无登录人写入;校验管理员 |
| | | UserResponse user = this.getUserResponse(); |
| | | if (user.getSysuser() == null) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED); |
| | | } |
| | | return ApiResponse.success(goodsorderService.getGoodsorderCanBanlanceDTO(orderId)); |
| | | } |
| | | |
| | | @PreventRepeat |
| | | @LoginRequired |
| | | @ApiOperation("退款") |
| | | @PostMapping("/backGoodsorder") |
| | | public ApiResponse backGoodsorder(@RequestBody GoodsorderBackDTO goodsorderBackDTO) { |
| | | // 退款为管理员操作:校验已绑定系统管理员,creator 取 sysuser.id(与 platform Shiro 口径一致) |
| | | UserResponse user = this.getUserResponse(); |
| | | if (user.getSysuser() == null) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED); |
| | | } |
| | | if (Objects.nonNull(goodsorderBackDTO) && Objects.isNull(goodsorderBackDTO.getBackType())) { |
| | | goodsorderBackDTO.setBackType(Constants.ONE); |
| | | } |
| | | goodsorderService.backGoodsorder(goodsorderBackDTO, user.getSysuser().getId()); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | } |