Please enter the commit message for your changes. Lines starting
with '#' will be ignored, and an empty message aborts the commit. On branch develop Your branch is ahead of 'goflyapp/develop' by 2 commits. (use "git push" to publish your local commits) Changes to be committed: modified: README.md modified: pom.xml modified: zlt-business/device-center/pom.xml modified: zlt-business/device-center/src/main/java/com/central/device/controller/AgeDeviceController.java modified: zlt-business/device-center/src/main/java/com/central/device/controller/ApiDeviceController.java modified: zlt-business/device-center/src/main/java/com/central/device/controller/LineFileController.java modified: zlt-business/device-center/src/main/java/com/central/device/feign/OrderCenterService.java modified: zlt-business/device-center/src/main/java/com/central/device/feign/fallback/OrderCenterServiceFallbackFactory.java modified: zlt-business/device-center/src/main/java/com/central/device/listener/DeviceImportListener.java modified: zlt-business/device-center/src/main/java/com/central/device/model/AgeDevice.java modified: zlt-business/device-center/src/main/java/com/central/device/model/LineFile.java modified: zlt-business/device-center/src/main/java/com/central/device/model/excel/AgeDeviceExcel.java modified: zlt-business/device-center/src/main/java/com/central/device/service/IAgeDeviceService.java modified: zlt-business/device-center/src/main/java/com/central/device/service/ILineFileService.java modified: zlt-business/device-center/src/main/java/com/central/device/service/impl/AgeDeviceServiceImpl.java modified: zlt-business/device-center/src/main/java/com/central/device/service/impl/LineFileServiceImpl.java modified: zlt-business/file-center/src/main/java/com/central/file/controller/FileController.java modified: zlt-business/file-center/src/main/java/com/central/file/service/impl/OssService.java modified: zlt-business/file-center/src/main/resources/application.yml modified: zlt-business/order-center/src/main/java/com/central/order/controller/OrderController.java modified: zlt-business/order-center/src/main/java/com/central/order/controller/QrCodeController.java modified: zlt-business/order-center/src/main/java/com/central/order/feign/DeviceCenterService.java modified: zlt-business/order-center/src/main/java/com/central/order/feign/fallback/DeviceCenterServiceFallbackFactory.java modified: zlt-business/order-center/src/main/java/com/central/order/model/Order.java modified: zlt-commons/zlt-common-core/src/main/java/com/central/common/model/FileInfo.java modified: zlt-web/react-web/src/main/frontend/config/config.ts modified: zlt-web/react-web/src/main/frontend/config/routes.ts modified: zlt-web/react-web/src/main/frontend/nginx.conf modified: zlt-web/react-web/src/main/frontend/package.json new file: zlt-web/react-web/src/main/frontend/src/pages/device/Device/components/UpdateForm.tsx new file: zlt-web/react-web/src/main/frontend/src/pages/device/Device/index.tsx modified: zlt-web/react-web/src/main/frontend/src/pages/device/Wayline/components/UpdateForm.tsx modified: zlt-web/react-web/src/main/frontend/src/pages/device/Wayline/index.tsx deleted: zlt-web/react-web/src/main/frontend/src/pages/device/Wayline1/components/UpdateForm.tsx deleted: zlt-web/react-web/src/main/frontend/src/pages/device/Wayline1/index.less deleted: zlt-web/react-web/src/main/frontend/src/pages/device/Wayline1/index.tsx modified: zlt-web/react-web/src/main/frontend/src/pages/orders/OrderFile/index.tsx modified: zlt-web/react-web/src/main/frontend/src/services/device/api.ts modified: zlt-web/react-web/src/main/frontend/src/services/device/typings.d.ts
This commit is contained in:
+19
-1
@@ -12,6 +12,7 @@ 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.DeviceCenterService;
|
||||
import com.central.order.feign.FileCenterService;
|
||||
import com.central.order.feign.UserCenterService;
|
||||
import com.central.order.model.*;
|
||||
@@ -93,6 +94,11 @@ public class OrderController {
|
||||
// 获取当前日期,格式化为 yyyyMMdd
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(CommonConstant.DATEMINUTE_FORMAT);
|
||||
|
||||
@Autowired
|
||||
private DeviceCenterService deviceCenterService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@@ -335,7 +341,19 @@ public class OrderController {
|
||||
if (orderService.getUnCompleteOrderCount(deviceSn)==0){
|
||||
List<Order> orders = orderService.getOrdersInQueueByDevice(deviceSn);
|
||||
if (!orders.isEmpty()){
|
||||
return Result.succeed(orders.get(0),"获取成功");
|
||||
Order order = orders.get(0);
|
||||
QrCode qrCode = qrCodeService.getByCodeId(order.getCodeId());
|
||||
Assert.notNull(qrCode,"二维码数据不能为空");
|
||||
|
||||
// 从二维码中获取航线ID
|
||||
String waylineId = qrCode.getWaylineId();
|
||||
// 根据航线ID获取对应的文件路径
|
||||
String waylineFilePath = fileCenterService.getFileViewUrl(waylineId);
|
||||
Assert.notNull(waylineFilePath,"订单航线数据不能为空");
|
||||
|
||||
order.setFileMd5(deviceCenterService.getLineFileSign(waylineId));
|
||||
order.setWaylineLinkUrl(waylineFilePath);
|
||||
return Result.succeed(order,"获取成功");
|
||||
}
|
||||
}
|
||||
return Result.failed("未存在排队队列");
|
||||
|
||||
+6
-2
@@ -20,6 +20,7 @@ import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
@@ -133,13 +134,16 @@ public class QrCodeController {
|
||||
}
|
||||
|
||||
@GetMapping("/wayline/{orderNo}")
|
||||
public String getWaylineByOrderNo(@PathVariable("orderNo") String orderNo){
|
||||
public Map<String,Object> 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;
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("waylineFilePath",waylineFilePath);
|
||||
map.put("waylineId",qrCode.getWaylineId());
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
+9
-26
@@ -1,46 +1,29 @@
|
||||
package com.central.order.feign;
|
||||
|
||||
import com.central.common.constant.ServiceNameConstants;
|
||||
import com.central.common.model.FileInfo;
|
||||
import com.central.common.model.Result;
|
||||
import com.central.order.feign.fallback.FileCenterServiceFallbackFactory;
|
||||
import com.central.order.feign.fallback.DeviceCenterServiceFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
||||
/**
|
||||
* user-center模块远程调用
|
||||
* device-center模块远程调用
|
||||
*
|
||||
* @author lsl
|
||||
* @version 1.0
|
||||
* @description user-center模块远程调用
|
||||
* @create 2025/1/13
|
||||
**/
|
||||
@FeignClient(name = ServiceNameConstants.FILE_SERVICE, fallbackFactory = FileCenterServiceFallbackFactory.class, dismiss404 = true)
|
||||
public interface FileCenterService {
|
||||
@FeignClient(name = ServiceNameConstants.DEVICE_SERVICE, fallbackFactory = DeviceCenterServiceFallbackFactory.class, dismiss404 = true)
|
||||
public interface DeviceCenterService {
|
||||
|
||||
/**
|
||||
* 通过ID查询预览地址
|
||||
* 通过ID查询文件sign
|
||||
*
|
||||
* @param id 文件ID
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/file/{id}")
|
||||
String getFileViewUrl(@PathVariable("id") String id);
|
||||
@GetMapping("/wayline/sign/{id}")
|
||||
String getLineFileSign(@PathVariable("id") String id);
|
||||
|
||||
@GetMapping("/type/{id}")
|
||||
String getFileContentType(@PathVariable("id") String id);
|
||||
|
||||
@GetMapping("/qrcode/{codeId}")
|
||||
Result<Map> uploadQrCodeFile(@PathVariable("codeId") String codeId) throws Exception;
|
||||
|
||||
@PostMapping("/path")
|
||||
FileInfo creatFileInfo(@RequestBody String path);
|
||||
|
||||
@GetMapping("/files/path")
|
||||
String getViewUrlByPath(@RequestParam("path") String path) ;
|
||||
|
||||
@GetMapping("/files/path/style")
|
||||
String getViewUrlByPathStyle(@RequestParam("params") Map<String,String> params) ;
|
||||
}
|
||||
|
||||
+6
-36
@@ -1,60 +1,30 @@
|
||||
package com.central.order.feign.fallback;
|
||||
|
||||
import com.central.common.model.FileInfo;
|
||||
import com.central.common.model.Result;
|
||||
import com.central.order.feign.FileCenterService;
|
||||
import com.central.order.feign.DeviceCenterService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 文件中心调用失败回调
|
||||
*
|
||||
* @author lsl
|
||||
* @version 1.0
|
||||
* @description 用户中心调用失败回调
|
||||
* @description 设备中心调用失败回调
|
||||
* @create 2025/1/17 11:33
|
||||
**/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class FileCenterServiceFallbackFactory implements FallbackFactory<FileCenterService> {
|
||||
public class DeviceCenterServiceFallbackFactory implements FallbackFactory<DeviceCenterService> {
|
||||
|
||||
@Override
|
||||
public FileCenterService create(Throwable cause) {
|
||||
return new FileCenterService() {
|
||||
public DeviceCenterService create(Throwable cause) {
|
||||
return new DeviceCenterService() {
|
||||
|
||||
@Override
|
||||
public String getFileViewUrl(String id) {
|
||||
public String getLineFileSign(String id) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileContentType(String id) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Map> uploadQrCodeFile(String codeId) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FileInfo creatFileInfo(String path) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getViewUrlByPath(String path) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getViewUrlByPathStyle(Map<String, String> params) {
|
||||
return "";
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ public class Order extends SuperEntity {
|
||||
private Date payTime;
|
||||
|
||||
private transient String createdTime;
|
||||
private transient String fileMd5;
|
||||
|
||||
private String codeId;
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@@ -48,5 +49,7 @@ public class Order extends SuperEntity {
|
||||
private String company;
|
||||
private Integer isDel;
|
||||
|
||||
private transient String waylineLinkUrl;
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user