|
|
@@ -7,7 +7,7 @@ import com.izouma.nineth.dto.PageQuery;
|
|
|
import com.izouma.nineth.dto.UserHistory;
|
|
|
import com.izouma.nineth.exception.BusinessException;
|
|
|
import com.izouma.nineth.repo.AssetRepo;
|
|
|
-import com.izouma.nineth.repo.TokenHistoryRepo;
|
|
|
+import com.izouma.nineth.repo.OrderRepo;
|
|
|
import com.izouma.nineth.service.AssetService;
|
|
|
import com.izouma.nineth.service.GiftOrderService;
|
|
|
import com.izouma.nineth.utils.ObjUtils;
|
|
|
@@ -16,7 +16,6 @@ import com.izouma.nineth.utils.excel.ExcelUtils;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
-import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
@@ -32,7 +31,7 @@ public class AssetController extends BaseController {
|
|
|
private AssetService assetService;
|
|
|
private AssetRepo assetRepo;
|
|
|
private GiftOrderService giftOrderService;
|
|
|
- private TokenHistoryRepo tokenHistoryRepo;
|
|
|
+ private OrderRepo orderRepo;
|
|
|
|
|
|
//@PreAuthorize("hasRole('ADMIN')")
|
|
|
@PostMapping("/save")
|
|
|
@@ -54,7 +53,9 @@ public class AssetController extends BaseController {
|
|
|
|
|
|
@GetMapping("/get/{id}")
|
|
|
public Asset get(@PathVariable Long id) {
|
|
|
- return assetRepo.findById(id).orElseThrow(new BusinessException("无记录"));
|
|
|
+ Asset asset = assetRepo.findById(id).orElseThrow(new BusinessException("无记录"));
|
|
|
+ orderRepo.findByIdAndDelFalse(asset.getOrderId()).ifPresent(order -> asset.setOpened(order.isOpened()));
|
|
|
+ return asset;
|
|
|
}
|
|
|
|
|
|
@PostMapping("/del/{id}")
|