|
|
@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import shop.alien.entity.result.R;
|
|
|
import shop.alien.entity.store.LawyerConsultationOrder;
|
|
|
import shop.alien.store.service.LawyerConsultationOrderService;
|
|
|
+import shop.alien.util.myBaticsPlus.QueryBuilder;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -28,49 +29,34 @@ public class LawyerConsultationOrderController {
|
|
|
|
|
|
private final LawyerConsultationOrderService consultationOrderService;
|
|
|
|
|
|
- @ApiOperation("获取所有咨询订单")
|
|
|
+ @ApiOperation("分页查询咨询订单列表(支持按律师姓名关联查询)")
|
|
|
@ApiOperationSupport(order = 1)
|
|
|
- @GetMapping("/getAll")
|
|
|
- public R<List<LawyerConsultationOrder>> getAll() {
|
|
|
- log.info("LawyerConsultationOrderController.getAll");
|
|
|
- return R.data(consultationOrderService.list());
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation("根据id获取咨询订单")
|
|
|
- @ApiOperationSupport(order = 2)
|
|
|
- @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query", required = true)})
|
|
|
- @GetMapping("/getOne")
|
|
|
- public R<LawyerConsultationOrder> getOne(Integer id) {
|
|
|
- log.info("LawyerConsultationOrderController.getOne?id={}", id);
|
|
|
- return R.data(consultationOrderService.getById(id));
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation("分页查询咨询订单列表")
|
|
|
- @ApiOperationSupport(order = 3)
|
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
|
|
|
- @ApiImplicitParam(name = "pageSize", value = "页容", dataType = "int", paramType = "query", required = true),
|
|
|
+ @ApiImplicitParam(name = "page", value = "页数(默认1)", dataType = "int", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "size", value = "页容(默认10)", dataType = "int", paramType = "query"),
|
|
|
@ApiImplicitParam(name = "orderNumber", value = "订单编号", dataType = "String", paramType = "query"),
|
|
|
@ApiImplicitParam(name = "clientUserId", value = "客户端用户ID", dataType = "Integer", paramType = "query"),
|
|
|
@ApiImplicitParam(name = "lawyerUserId", value = "律师用户ID", dataType = "Integer", paramType = "query"),
|
|
|
- @ApiImplicitParam(name = "lawyerName", value = "律师姓名", dataType = "String", paramType = "query"),
|
|
|
- @ApiImplicitParam(name = "orderStatus", value = "订单状态", dataType = "Integer", paramType = "query")
|
|
|
+ @ApiImplicitParam(name = "lawyerName", value = "律师姓名(支持模糊查询,关联查询)", dataType = "String", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "orderStatus", value = "订单状态, 0:待支付, 1:已支付, 2:进行中, 3:已完成, 4:已取消", dataType = "Integer", paramType = "query")
|
|
|
})
|
|
|
@GetMapping("/getConsultationOrderList")
|
|
|
- public R<IPage<LawyerConsultationOrder>> getConsultationOrderList(@RequestParam(defaultValue = "1") int pageNum,
|
|
|
- @RequestParam(defaultValue = "10") int pageSize,
|
|
|
+ public R<IPage<LawyerConsultationOrder>> getConsultationOrderList(@RequestParam(defaultValue = "1") int page,
|
|
|
+ @RequestParam(defaultValue = "10") int size,
|
|
|
@RequestParam(required = false) String orderNumber,
|
|
|
@RequestParam(required = false) Integer clientUserId,
|
|
|
@RequestParam(required = false) Integer lawyerUserId,
|
|
|
@RequestParam(required = false) String lawyerName,
|
|
|
@RequestParam(required = false) Integer orderStatus) {
|
|
|
- log.info("LawyerConsultationOrderController.getConsultationOrderList?pageNum={},pageSize={},orderNumber={},clientUserId={},lawyerUserId={},lawyerName={},orderStatus={}",
|
|
|
- pageNum, pageSize, orderNumber, clientUserId, lawyerUserId, lawyerName, orderStatus);
|
|
|
+ log.info("LawyerConsultationOrderController.getConsultationOrderList?page={},size={},orderNumber={},clientUserId={},lawyerUserId={},lawyerName={},orderStatus={}",
|
|
|
+ page, size, orderNumber, clientUserId, lawyerUserId, lawyerName, orderStatus);
|
|
|
+ int pageNum = page > 0 ? page : 1;
|
|
|
+ int pageSize = size > 0 ? size : 10;
|
|
|
return consultationOrderService.getConsultationOrderList(pageNum, pageSize, orderNumber, clientUserId, lawyerUserId, lawyerName, orderStatus);
|
|
|
}
|
|
|
|
|
|
@ApiOperation("新增咨询订单")
|
|
|
- @ApiOperationSupport(order = 4)
|
|
|
+ @ApiOperationSupport(order = 2)
|
|
|
@PostMapping("/addConsultationOrder")
|
|
|
public R<LawyerConsultationOrder> addConsultationOrder(@RequestBody LawyerConsultationOrder consultationOrder) {
|
|
|
log.info("LawyerConsultationOrderController.addConsultationOrder?consultationOrder={}", consultationOrder);
|
|
|
@@ -78,7 +64,7 @@ public class LawyerConsultationOrderController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation("编辑咨询订单")
|
|
|
- @ApiOperationSupport(order = 5)
|
|
|
+ @ApiOperationSupport(order = 3)
|
|
|
@PostMapping("/editConsultationOrder")
|
|
|
public R<LawyerConsultationOrder> editConsultationOrder(@RequestBody LawyerConsultationOrder consultationOrder) {
|
|
|
log.info("LawyerConsultationOrderController.editConsultationOrder?consultationOrder={}", consultationOrder);
|
|
|
@@ -86,7 +72,7 @@ public class LawyerConsultationOrderController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation("删除咨询订单")
|
|
|
- @ApiOperationSupport(order = 6)
|
|
|
+ @ApiOperationSupport(order = 4)
|
|
|
@DeleteMapping("/deleteConsultationOrder")
|
|
|
public R<Boolean> deleteConsultationOrder(@RequestParam(value = "id") Integer id) {
|
|
|
log.info("LawyerConsultationOrderController.deleteConsultationOrder?id={}", id);
|
|
|
@@ -94,7 +80,7 @@ public class LawyerConsultationOrderController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation("保存或更新咨询订单")
|
|
|
- @ApiOperationSupport(order = 7)
|
|
|
+ @ApiOperationSupport(order = 5)
|
|
|
@PostMapping("/saveOrUpdate")
|
|
|
public R<LawyerConsultationOrder> saveOrUpdate(@RequestBody LawyerConsultationOrder consultationOrder) {
|
|
|
log.info("LawyerConsultationOrderController.saveOrUpdate?consultationOrder={}", consultationOrder);
|
|
|
@@ -104,5 +90,58 @@ public class LawyerConsultationOrderController {
|
|
|
}
|
|
|
return R.fail("操作失败");
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation("通用列表查询")
|
|
|
+ @ApiOperationSupport(order = 6)
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "orderNumber", value = "订单编号(支持模糊查询)", dataType = "String", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "clientUserId", value = "客户端用户ID", dataType = "Integer", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "lawyerUserId", value = "律师用户ID", dataType = "Integer", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "problemScenarId", value = "法律问题场景ID", dataType = "Integer", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "orderStatus", value = "订单状态, 0:待支付, 1:已支付, 2:进行中, 3:已完成, 4:已取消", dataType = "Integer", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "paymentStatus", value = "支付状态, 0:未支付, 1:已支付", dataType = "Integer", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "createdTime_Start", value = "创建时间开始(范围查询)", dataType = "String", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "createdTime_End", value = "创建时间结束(范围查询)", dataType = "String", paramType = "query")
|
|
|
+ })
|
|
|
+ @GetMapping("/getList")
|
|
|
+ public R<List<LawyerConsultationOrder>> getList(@ModelAttribute LawyerConsultationOrder consultationOrder) {
|
|
|
+ log.info("LawyerConsultationOrderController.getList?consultationOrder={}", consultationOrder);
|
|
|
+ List<LawyerConsultationOrder> list = QueryBuilder.of(consultationOrder)
|
|
|
+ .likeFields("orderNumber") // 订单编号支持模糊查询
|
|
|
+ .build()
|
|
|
+ .list(consultationOrderService);
|
|
|
+ return R.data(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("通用分页查询")
|
|
|
+ @ApiOperationSupport(order = 7)
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "page", value = "页数(默认1)", dataType = "int", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "size", value = "页容(默认10)", dataType = "int", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "orderNumber", value = "订单编号(支持模糊查询)", dataType = "String", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "clientUserId", value = "客户端用户ID", dataType = "Integer", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "lawyerUserId", value = "律师用户ID", dataType = "Integer", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "problemScenarId", value = "法律问题场景ID", dataType = "Integer", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "orderStatus", value = "订单状态, 0:待支付, 1:已支付, 2:进行中, 3:已完成, 4:已取消", dataType = "Integer", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "paymentStatus", value = "支付状态, 0:未支付, 1:已支付", dataType = "Integer", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "createdTime_Start", value = "创建时间开始(范围查询)", dataType = "String", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "createdTime_End", value = "创建时间结束(范围查询)", dataType = "String", paramType = "query")
|
|
|
+ })
|
|
|
+ @GetMapping("/getPage")
|
|
|
+ public R<IPage<LawyerConsultationOrder>> getPage(@ModelAttribute LawyerConsultationOrder consultationOrder,
|
|
|
+ @RequestParam(defaultValue = "1") int page,
|
|
|
+ @RequestParam(defaultValue = "10") int size) {
|
|
|
+ log.info("LawyerConsultationOrderController.getPage?consultationOrder={},page={},size={}", consultationOrder, page, size);
|
|
|
+ int pageNum = page > 0 ? page : 1;
|
|
|
+ int pageSize = size > 0 ? size : 10;
|
|
|
+ IPage<LawyerConsultationOrder> pageResult = QueryBuilder.of(consultationOrder)
|
|
|
+ .likeFields("orderNumber") // 订单编号支持模糊查询
|
|
|
+ .page(pageNum, pageSize)
|
|
|
+ .build()
|
|
|
+ .page(consultationOrderService);
|
|
|
+ return R.data(pageResult);
|
|
|
+ }
|
|
|
}
|
|
|
|