|
@@ -17,6 +17,8 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.validation.Valid;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -92,27 +94,80 @@ public class MuseumInfoController {
|
|
|
// Map<> 键值对
|
|
|
@GetMapping("/sampleTypeCount")
|
|
|
@Operation(summary = "标本类型计数")
|
|
|
- public CommonResult<Map<MuseumInfoRespVO,Integer>> getMap(@RequestParam("sampleType") Integer sampleType){
|
|
|
- Map<MuseumInfoRespVO,Integer> result =museumInfoService.MuseumInfoBySampleType(sampleType);
|
|
|
-// 标本类型:矿石-1 岩石-2 矿物-3 陨石-4
|
|
|
-// Integer Type = sampleType;
|
|
|
-// result.put(Type);
|
|
|
-// "标本类型:"
|
|
|
- return CommonResult.success(result);
|
|
|
+ public CommonResult<HashMap<Integer,Integer>> getMap(@RequestParam("sampleType") Integer sampleType) {
|
|
|
+ Integer result = museumInfoService.MuseumInfoBySampleType(sampleType);
|
|
|
+// 标本类型:矿石-1 岩石-2 矿物-3 陨石-4>
|
|
|
+ HashMap<Integer, Integer> Sites = new HashMap<Integer, Integer>();
|
|
|
+ Integer Type = sampleType;
|
|
|
+ Sites.put(Type, result);
|
|
|
+ return CommonResult.success(Sites);
|
|
|
+
|
|
|
}
|
|
|
+// 1(初版)
|
|
|
+// public CommonResult<Map<String,Integer>> getMap(@RequestParam("sampleType") Integer sampleType){
|
|
|
+// Map<String,Integer> result =museumInfoService.MuseumInfoBySampleType(sampleType);
|
|
|
+// Integer Type = sampleType;
|
|
|
+// result.put("标本类型:",Type);
|
|
|
+// return CommonResult.success(result);
|
|
|
+
|
|
|
+
|
|
|
+// 2
|
|
|
+// @GetMapping("/sampleTypeCount")
|
|
|
+// @Operation(summary = "标本类型计数")
|
|
|
+// public CommonResult<HashMap<Integer,List<Integer>>> getMap(@RequestParam("sampleType") Integer sampleType){
|
|
|
+// List<Integer> result =museumInfoService.MuseumInfoBySampleType(sampleType);
|
|
|
+// HashMap<Integer,List<Integer>> Sites = new HashMap<Integer,List<Integer>>();
|
|
|
+// Sites.put(1,result);
|
|
|
+// Sites.put(2,result);
|
|
|
+// Sites.put(3,result);
|
|
|
+// Sites.put(4,result);
|
|
|
+// return CommonResult.success(Sites);
|
|
|
+//
|
|
|
+//}
|
|
|
+// 3
|
|
|
+//@GetMapping("/sampleTypeCount")
|
|
|
+//@Operation(summary = "标本类型计数")
|
|
|
+//public CommonResult<HashMap<Integer,Integer>> getMap(@RequestParam("sampleType") Integer sampleType) {
|
|
|
+// Integer result = museumInfoService.MuseumInfoBySampleType(sampleType);
|
|
|
+//// 标本类型:矿石-1 岩石-2 矿物-3 陨石-4>
|
|
|
+// HashMap<Integer, Integer> Sites = new HashMap<Integer, Integer>();
|
|
|
+// Integer Type = sampleType;
|
|
|
+// Sites.put(Type, result);
|
|
|
+// return CommonResult.success(Sites);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
@GetMapping("/saveCount")
|
|
|
@Operation(summary = "标本出入库状态计数")
|
|
|
- public CommonResult<Map<String,Integer>> getSave(@RequestParam("save") Integer save){
|
|
|
- Map<String,Integer> result =museumInfoService.MuseumInfoBySave(save);
|
|
|
+ public CommonResult<HashMap<Integer,Integer>> getSave(@RequestParam("save") Integer save){
|
|
|
+ Integer result1 =museumInfoService.MuseumInfoBySave(save);
|
|
|
// 状态:在库-1 出库-0
|
|
|
+ HashMap<Integer, Integer> result2 = new HashMap<Integer, Integer>();
|
|
|
Integer Condition = save;
|
|
|
- result.put("状态",Condition);
|
|
|
- return CommonResult.success(result);
|
|
|
+ result2.put(Condition,result1);
|
|
|
+ return CommonResult.success(result2);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/originCount")
|
|
|
+ @Operation(summary = "标本来源计数")
|
|
|
+ public CommonResult<HashMap<Integer,Integer>> getOrigin(@RequestParam("origin") Integer origin){
|
|
|
+ Integer result1 =museumInfoService.MuseumInfoByOrigin(origin);
|
|
|
+// 来源:采购-1 捐赠-2 采集-3
|
|
|
+ HashMap<Integer, Integer> result2 = new HashMap<Integer, Integer>();
|
|
|
+ Integer Origin = origin;
|
|
|
+// LocalDateTime SampleSaveTime = sampleSaveTime;
|
|
|
+ result2.put(Origin, result1);
|
|
|
+
|
|
|
+ return CommonResult.success(result2);
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
// public CommonResult<MuseumTextRespVO> getdo(@RequestParam("id") Integer id){
|
|
|
// MuseumTextRespVO DO =new MuseumTextRespVO();
|
|
|
//// Integer Ynmber = selectMuseumInfoBySampleType(1)
|