feat(设备管理):新增航线管理,执行任务时候根据二维码参数获取航线链接
This commit is contained in:
+1
@@ -88,6 +88,7 @@ public class ApiDeviceController {
|
||||
|
||||
JsonObject data = jsonObject.getAsJsonObject("data");
|
||||
data.addProperty("order_no", value);
|
||||
data.addProperty("waylineUrl", orderCenterService.getWaylineByOrderNo(value));
|
||||
|
||||
}else {
|
||||
return Result.succeed("暂未开放控制权限");
|
||||
|
||||
+10
-11
@@ -1,20 +1,19 @@
|
||||
package com.central.device.controller;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||
import com.central.common.model.PageResult;
|
||||
import com.central.common.model.Result;
|
||||
import com.central.device.model.LineFile;
|
||||
import com.central.device.service.ILineFileService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.central.device.model.LineFile;
|
||||
import com.central.device.service.ILineFileService;
|
||||
import com.central.common.model.PageResult;
|
||||
import com.central.common.model.Result;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Wayline file information
|
||||
@@ -48,7 +47,7 @@ public class LineFileController {
|
||||
*/
|
||||
@Operation(summary = "查询")
|
||||
@GetMapping("/{id}")
|
||||
public Result findUserById(@PathVariable Long id) {
|
||||
public Result findById(@PathVariable Long id) {
|
||||
LineFile model = lineFileService.getById(id);
|
||||
return Result.succeed(model, "查询成功");
|
||||
}
|
||||
|
||||
+3
@@ -25,4 +25,7 @@ public interface OrderCenterService {
|
||||
|
||||
@GetMapping("/{orderNo}/status")
|
||||
String getOrderStatusByOrderNo(@PathVariable("orderNo") String orderNo);
|
||||
|
||||
@GetMapping("/qrcode/wayline/{orderNo}")
|
||||
String getWaylineByOrderNo(@PathVariable("orderNo") String orderNo);
|
||||
}
|
||||
|
||||
+5
@@ -31,6 +31,11 @@ public class OrderCenterServiceFallbackFactory implements FallbackFactory<OrderC
|
||||
public String getOrderStatusByOrderNo(String orderNo) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getWaylineByOrderNo(String orderNo) {
|
||||
return "";
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+10
-2
@@ -1,5 +1,6 @@
|
||||
package com.central.order.controller;
|
||||
|
||||
import com.alibaba.csp.sentinel.util.StringUtil;
|
||||
import com.central.common.constant.CommonConstant;
|
||||
import com.central.common.context.LoginUserContextHolder;
|
||||
import com.central.common.context.TenantContextHolder;
|
||||
@@ -9,6 +10,7 @@ import com.central.common.model.Result;
|
||||
import com.central.common.model.SysUser;
|
||||
import com.central.log.annotation.AuditLog;
|
||||
import com.central.order.config.TencentPayProperties;
|
||||
import com.central.order.enums.CommonStatus;
|
||||
import com.central.order.enums.OrderStatus;
|
||||
import com.central.order.feign.FileCenterService;
|
||||
import com.central.order.feign.UserCenterService;
|
||||
@@ -135,6 +137,9 @@ public class OrderController {
|
||||
LoginAppUser user = LoginUserContextHolder.getUser();
|
||||
params.put("userId", user.getId());
|
||||
String fileType = MapUtils.getString(params, "fileType");
|
||||
if (StringUtil.isBlank(fileType)) {
|
||||
fileType = "image/jpeg";
|
||||
}
|
||||
|
||||
PageResult<Order> result = orderService.findListByUser(params);
|
||||
if (result.getCount() > 0){
|
||||
@@ -147,8 +152,7 @@ public class OrderController {
|
||||
orderFileMap.put("addr", tourismService.getTourismById(order.getTourismId()).getTourismAddress());
|
||||
orderFileMap.put("orderNo", order.getOrderNo());
|
||||
|
||||
// List<OrderFile> list = orderFileService.getOrderFileByOrderNoAndFileType(order.getOrderNo(),fileType);
|
||||
List<OrderFile> list = orderFileService.getOrderFileByOrderNo(order.getOrderNo());
|
||||
List<OrderFile> list = orderFileService.getOrderFileByOrderNoAndFileType(order.getOrderNo(),fileType);
|
||||
List<Map<String,String>> resultList = new ArrayList<>();
|
||||
if (!list.isEmpty()){
|
||||
for (OrderFile orderFile : list){
|
||||
@@ -198,6 +202,9 @@ public class OrderController {
|
||||
|
||||
QrCode qrCode = qrCodeService.getByCodeId(order.getCodeId());
|
||||
if (qrCode != null){
|
||||
if (qrCode.getStatus().equals(CommonStatus.UNABLE.getId())){
|
||||
return Result.failed("该二维码已过期");
|
||||
}
|
||||
order.setTourismId(qrCode.getTourismId());
|
||||
order.setDeviceSn(qrCode.getDeviceSn());
|
||||
order.setOrderAmount(qrCode.getPrice());
|
||||
@@ -324,6 +331,7 @@ public class OrderController {
|
||||
@Operation(summary = "获取排队中的第一个订单")
|
||||
@GetMapping("/queue/first")
|
||||
public Result<Order> getOrdersInQueueFirstOne(@RequestParam String deviceSn) {
|
||||
Assert.notNull(deviceSn,"设备SN不能为空");
|
||||
List<Order> orders = orderService.getOrdersInQueueByDevice(deviceSn);
|
||||
if (!orders.isEmpty()){
|
||||
return Result.succeed(orders.get(0),"获取成功");
|
||||
|
||||
+15
-4
@@ -3,10 +3,8 @@ package com.central.order.controller;
|
||||
import com.central.common.model.PageResult;
|
||||
import com.central.common.model.Result;
|
||||
import com.central.order.feign.FileCenterService;
|
||||
import com.central.order.model.QrCode;
|
||||
import com.central.order.model.QrCodeVO;
|
||||
import com.central.order.model.Tourism;
|
||||
import com.central.order.model.TourismFile;
|
||||
import com.central.order.model.*;
|
||||
import com.central.order.service.IOrderService;
|
||||
import com.central.order.service.IQrCodeService;
|
||||
import com.central.order.service.ITourismFileService;
|
||||
import com.central.order.service.ITourismService;
|
||||
@@ -51,6 +49,8 @@ public class QrCodeController {
|
||||
@Autowired
|
||||
private ITourismFileService tourismFileService;
|
||||
|
||||
@Autowired
|
||||
private IOrderService orderService;
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@@ -130,4 +130,15 @@ public class QrCodeController {
|
||||
qrCodeService.removeById(id);
|
||||
return Result.succeed("操作成功");
|
||||
}
|
||||
|
||||
@GetMapping("/wayline/{orderNo}")
|
||||
public String getWaylineByOrderNo(@PathVariable("orderNo") String orderNo){
|
||||
|
||||
Order order = orderService.getOrderByNumber(orderNo);
|
||||
Assert.notNull(order,"订单No不能为空");
|
||||
QrCode qrCode = qrCodeService.getByCodeId(order.getCodeId());
|
||||
Assert.notNull(qrCode,"二维码数据不能为空");
|
||||
String waylineFilePath = fileCenterService.getFileViewUrl(qrCode.getWaylineId());
|
||||
return waylineFilePath;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.central.order.enums;
|
||||
|
||||
public enum QrcodeStatus {
|
||||
}
|
||||
@@ -35,6 +35,7 @@ public class QrCode extends SuperEntity {
|
||||
private String fileId;
|
||||
private Integer status;
|
||||
|
||||
private String waylineId;
|
||||
private String price;
|
||||
|
||||
private String deviceSn;
|
||||
|
||||
+2
-2
@@ -117,11 +117,11 @@ public class OrderServiceImpl extends SuperServiceImpl<OrderMapper, Order> imple
|
||||
|
||||
@Override
|
||||
public List<Order> getOrdersInQueueByDevice(String deviceSn) {
|
||||
baseMapper.selectList(new QueryWrapper<Order>()
|
||||
|
||||
return baseMapper.selectList(new QueryWrapper<Order>()
|
||||
.eq("device_sn", deviceSn)
|
||||
.eq("order_status", OrderStatus.PAID.getId())
|
||||
.orderByAsc("id"));
|
||||
return List.of();
|
||||
}
|
||||
|
||||
// 处理排队中的订单,当排在前面的用户消费完成后通知下一位用户进行消费操作(此处简化逻辑,实际需结合业务深入实现)
|
||||
|
||||
@@ -231,7 +231,8 @@ const TableList: React.FC = () => {
|
||||
options={[
|
||||
{ label: '北塘古镇', value: 33 },
|
||||
{ label: '海丝首港', value: 32 },
|
||||
{ label: '武汉东湖', value: 35 },
|
||||
{ label: '武汉东湖牡丹园', value: 35 },
|
||||
{ label: '武汉东湖樱花园', value: 36 },
|
||||
// 添加更多选项...
|
||||
]}
|
||||
/>
|
||||
|
||||
@@ -268,7 +268,8 @@ const TableList: React.FC = () => {
|
||||
options={[
|
||||
{ label: '北塘古镇', value: 33 },
|
||||
{ label: '海丝首港', value: 32 },
|
||||
{ label: '武汉东湖', value: 35 },
|
||||
{ label: '武汉东湖牡丹园', value: 35 },
|
||||
{ label: '武汉东湖樱花园', value: 36 },
|
||||
// 添加更多选项...
|
||||
]}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user