字典管理
资源管理 资源类型管理 团购卷订单管理 团购卷订单退款 团购卷商品(套餐商品修改与保存)
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
package cn.ysk.cashier.controller;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
@RestController
|
||||
@Api(tags = "通用组件")
|
||||
@RequestMapping("/api")
|
||||
public class CommonController {
|
||||
|
||||
@GetMapping("geocode")
|
||||
@ApiOperation("通过经纬度查询位置信息")
|
||||
public ResponseEntity<Object> getGeocode(String location){
|
||||
return new ResponseEntity<>(geocode(location), HttpStatus.OK);
|
||||
}
|
||||
|
||||
public JsonNode geocode(String location) {
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
String s = restTemplate.getForObject("https://restapi.amap.com/v3/geocode/regeo?key=7a7f2e4790ea222660a027352ee3af39&location="+location, String.class);
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
// 将 JSON 字符串解析为 JsonNode 对象
|
||||
try {
|
||||
JsonNode jsonNode = objectMapper.readTree(s).get("regeocode");
|
||||
return jsonNode;
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.ysk.cashier.controller;
|
||||
|
||||
import cn.ysk.cashier.annotation.Log;
|
||||
import cn.ysk.cashier.annotation.rest.AnonymousGetMapping;
|
||||
import cn.ysk.cashier.dto.TbPlatformDictDto;
|
||||
import cn.ysk.cashier.dto.TbPlatformDictQueryCriteria;
|
||||
import cn.ysk.cashier.pojo.TbPlatformDict;
|
||||
@@ -20,7 +21,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "新字典管理")
|
||||
@Api(tags = "资源管理")
|
||||
@RequestMapping("/api/tbPlatformDict")
|
||||
public class TbPlatformDictController {
|
||||
|
||||
@@ -28,8 +29,9 @@ public class TbPlatformDictController {
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation("查询新字典")
|
||||
public ResponseEntity<Object> queryTbPlatformDict(TbPlatformDictQueryCriteria criteria){
|
||||
return new ResponseEntity<>(tbPlatformDictService.queryAllPage(criteria),HttpStatus.OK);
|
||||
@AnonymousGetMapping
|
||||
public ResponseEntity<Object> queryTbPlatformDict(TbPlatformDictQueryCriteria criteria) {
|
||||
return new ResponseEntity<>(tbPlatformDictService.queryAllPage(criteria), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package cn.ysk.cashier.controller;
|
||||
|
||||
import cn.ysk.cashier.dto.TbPlatformDictTypeQueryCriteria;
|
||||
import cn.ysk.cashier.pojo.TbPlatformDictType;
|
||||
import cn.ysk.cashier.service.TbPlatformDictTypeService;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
/**
|
||||
* @author ww
|
||||
* @date 2024-05-11
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "资源类别管理")
|
||||
@RequestMapping("/api/tbPlatformDictType")
|
||||
public class TbPlatformDictTypeController {
|
||||
|
||||
private final TbPlatformDictTypeService tbPlatformDictTypeService;
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation("查询资源类别列表")
|
||||
public ResponseEntity<Object> queryTbPlatformDictType(TbPlatformDictTypeQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(tbPlatformDictTypeService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增资源类别")
|
||||
public ResponseEntity<Object> createTbPlatformDictType(@Validated @RequestBody TbPlatformDictType resources){
|
||||
return new ResponseEntity<>(tbPlatformDictTypeService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改资源类别")
|
||||
public ResponseEntity<Object> updateTbPlatformDictType(@Validated @RequestBody TbPlatformDictType resources){
|
||||
tbPlatformDictTypeService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除资源类别")
|
||||
public ResponseEntity<Object> deleteTbPlatformDictType(@RequestBody Integer[] ids) {
|
||||
tbPlatformDictTypeService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package cn.ysk.cashier.controller.order;
|
||||
|
||||
import cn.ysk.cashier.dto.order.ReturnGroupOrderDto;
|
||||
import cn.ysk.cashier.dto.order.TbGroupOrderInfoDto;
|
||||
import cn.ysk.cashier.dto.order.TbGroupOrderInfoQueryCriteria;
|
||||
import cn.ysk.cashier.service.order.TbGroupOrderInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "团购卷订单管理")
|
||||
@RequestMapping("/api/tbGroupOrderInfo")
|
||||
public class TbGroupOrderInfoController {
|
||||
|
||||
private final TbGroupOrderInfoService tbGroupOrderInfoService;
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("团购卷订单列表")
|
||||
public ResponseEntity<Object> queryTbGroupOrderInfo(@RequestBody TbGroupOrderInfoQueryCriteria criteria){
|
||||
Pageable pageable = PageRequest.of(criteria.getPage(), criteria.getSize(),Sort.by(criteria.getSort()));
|
||||
return new ResponseEntity<>(tbGroupOrderInfoService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
@ApiOperation("通过Id查询订单详情")
|
||||
public TbGroupOrderInfoDto queryTbGroupOrderInfo(@PathVariable("id") Integer id){
|
||||
return tbGroupOrderInfoService.findById(id);
|
||||
}
|
||||
|
||||
@RequestMapping("returnGpOrder")
|
||||
public ResponseEntity<Object> returnOrder(@RequestBody ReturnGroupOrderDto param){
|
||||
return tbGroupOrderInfoService.returnOrder(param);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user