|
|
@@ -20,7 +20,6 @@ import com.zd.common.response.ResultData;
|
|
|
import com.zd.common.security.annotation.PreAuthorize;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
-import org.apache.hadoop.security.SecurityUtil;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
@@ -28,7 +27,6 @@ import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -47,14 +45,15 @@ public class UseRecordController extends BaseController<UseRecord> {
|
|
|
@Resource
|
|
|
private UseRecordService useRecordService;
|
|
|
|
|
|
+ private static final String ORDER_BY_DESC="descending";
|
|
|
+
|
|
|
/**
|
|
|
* 查询使用记录列表(学生端)
|
|
|
*/
|
|
|
- @PreAuthorize(hasPermi = PerPrefix.BOTTLE_USERECORD + PerFun.LIST)
|
|
|
@GetMapping("/list")
|
|
|
@ApiOperation(value = "查询使用记录列表")
|
|
|
public TableDataInfo<UseRecordVo> list(UseRecord useRecord) {
|
|
|
- startPage("use_time","descending");
|
|
|
+ startPage("use_time",ORDER_BY_DESC);
|
|
|
useRecord.setUserId(SecurityUtils.getUserId());
|
|
|
List<UseRecord> records =useRecordService.getList(useRecord);
|
|
|
TableDataInfo<UseRecord> dataTable = getDataTable(records);
|
|
|
@@ -75,7 +74,7 @@ public class UseRecordController extends BaseController<UseRecord> {
|
|
|
@GetMapping("/listByAdmin")
|
|
|
@ApiOperation(value = "查询使用记录列表")
|
|
|
public TableDataInfo<UseRecordVo> listByAdmin(UseRecord useRecord) {
|
|
|
- startPage("use_time","descending");
|
|
|
+ startPage("use_time",ORDER_BY_DESC);
|
|
|
List<UseRecord> records =useRecordService.getList(useRecord);
|
|
|
TableDataInfo<UseRecord> dataTable = getDataTable(records);
|
|
|
TableDataInfo<UseRecordVo> info = new TableDataInfo<>();
|
|
|
@@ -101,7 +100,6 @@ public class UseRecordController extends BaseController<UseRecord> {
|
|
|
/**
|
|
|
* 导出使用记录列表(学生端)
|
|
|
*/
|
|
|
- @PreAuthorize(hasPermi = PerPrefix.BOTTLE_USERECORD + PerFun.EXPORT)
|
|
|
@ApiOperation(value = "导出使用记录列表")
|
|
|
@Log(title = "使用记录", businessType = BusinessType.EXPORT)
|
|
|
@PostMapping("/export")
|
|
|
@@ -151,7 +149,6 @@ public class UseRecordController extends BaseController<UseRecord> {
|
|
|
/**
|
|
|
* 管理端端获取使用记录详细信息(学生端)
|
|
|
*/
|
|
|
- @PreAuthorize(hasPermi = PerPrefix.BOTTLE_USERECORD + PerFun.QUERY)
|
|
|
@ApiOperation(value = "管理端端获取使用记录详细信息")
|
|
|
@GetMapping(value = "/bottle/{id}")
|
|
|
public ResultData<WebUseRecordVo> getBottleInfo(@PathVariable("id") Long id) {
|
|
|
@@ -240,7 +237,6 @@ public class UseRecordController extends BaseController<UseRecord> {
|
|
|
* 4:气瓶正在使用中
|
|
|
*/
|
|
|
@ApiOperation(value = "领用气瓶-学生端")
|
|
|
- @PreAuthorize(hasPermi = PerPrefix.BOTTLE_USERECORDADMIN + PerFun.ADD)
|
|
|
@Log(title = "领用气瓶-学生端", businessType = BusinessType.INSERT)
|
|
|
@PostMapping("/student")
|
|
|
public ResultData<Integer> addStudent(@RequestBody UseRecordDto recordDto) {
|
|
|
@@ -251,7 +247,6 @@ public class UseRecordController extends BaseController<UseRecord> {
|
|
|
* 归还登记-学生端
|
|
|
*/
|
|
|
@ApiOperation(value = "归还登记-学生端")
|
|
|
- @PreAuthorize(hasPermi = PerPrefix.BOTTLE_USERECORDADMIN + PerFun.EDIT)
|
|
|
@Log(title = "归还登记-学生端", businessType = BusinessType.UPDATE)
|
|
|
@PostMapping("/editStudent")
|
|
|
public ResultData<Boolean> editStudent(@RequestBody UseRecord useRecord) {
|
|
|
@@ -261,11 +256,10 @@ public class UseRecordController extends BaseController<UseRecord> {
|
|
|
/***
|
|
|
* 查询使用记录(学生端)
|
|
|
*/
|
|
|
- @PreAuthorize(hasPermi = PerPrefix.BOTTLE_USERECORD + PerFun.LISTDETAIL)
|
|
|
@ApiOperation(value = "查询使用记录")
|
|
|
@GetMapping(value = "/getUseDetails")
|
|
|
public TableDataInfo<UseRecord> getUseDetails(UseRecord useRecord) {
|
|
|
- startPage("create_time","descending");
|
|
|
+ startPage("create_time",ORDER_BY_DESC);
|
|
|
useRecord.setUserId(SecurityUtils.getUserId());
|
|
|
List<UseRecord> records =useRecordService.getList(useRecord);
|
|
|
return getDataTable(records);
|
|
|
@@ -279,7 +273,7 @@ public class UseRecordController extends BaseController<UseRecord> {
|
|
|
@ApiOperation(value = "查询使用记录")
|
|
|
@GetMapping(value = "/getUseDetailsByAdmin")
|
|
|
public TableDataInfo<UseRecord> getUseDetailsByAdmin(UseRecord useRecord) {
|
|
|
- startPage("create_time","descending");
|
|
|
+ startPage("create_time",ORDER_BY_DESC);
|
|
|
List<UseRecord> records =useRecordService.getList(useRecord);
|
|
|
return getDataTable(records);
|
|
|
}
|