TRX 1 yıl önce
ebeveyn
işleme
f84e84d1fe

+ 13 - 0
FullCardClient/src/main/java/com/zhongshu/card/client/model/school/DeviceInfoModel.java

@@ -4,6 +4,7 @@ import com.github.microservice.models.type.DeviceType;
 import com.zhongshu.card.client.model.base.SuperModel;
 import com.zhongshu.card.client.model.org.OrganizationModel;
 import com.zhongshu.card.client.model.org.OrganizationSimpleModel;
+import com.zhongshu.card.client.utils.type.DataState;
 import com.zhongshu.card.client.utils.type.OnLineState;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
@@ -61,4 +62,16 @@ public class DeviceInfoModel extends SuperModel {
 
     @Schema(description = "设备IP地址")
     private String ip;
+
+    @Schema(description = "数据状态")
+    private DataState state;
+
+    private String stateStr;
+
+    public String getStateStr() {
+        if (state != null) {
+            return state.getRemark();
+        }
+        return "";
+    }
 }

+ 4 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/domain/org/DeviceInfo.java

@@ -1,6 +1,7 @@
 package com.zhongshu.card.server.core.domain.org;
 
 import com.github.microservice.models.type.DeviceType;
+import com.zhongshu.card.client.utils.type.DataState;
 import com.zhongshu.card.client.utils.type.OnLineState;
 import com.zhongshu.card.server.core.domain.base.SuperMain;
 import io.swagger.v3.oas.annotations.media.Schema;
@@ -47,4 +48,7 @@ public class DeviceInfo extends SuperMain {
 
     @Schema(description = "设备IP地址")
     private String ip;
+
+    @Schema(description = "数据状态")
+    private DataState state = DataState.Enable;
 }

+ 8 - 1
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/payment/ExpenseFlowServiceImpl.java

@@ -256,6 +256,13 @@ public class ExpenseFlowServiceImpl extends SuperService implements ExpenseFlowS
             return;
         }
 
+        // 设备已停用
+        if (deviceInfo.getState() != null && deviceInfo.getState() == DataState.Disable) {
+            entity.setVerifyParamIsSuccess(Boolean.FALSE);
+            entity.setVerifyParamMsg(String.format("设备%s", deviceInfo.getState().getRemark()));
+            return;
+        }
+
         // 查询设备绑定德 商户 学校
         if (StringUtils.isNotEmpty(deviceId)) {
             DeviceBind deviceBind = deviceBindDao.findTopByDeviceId(deviceId);
@@ -305,7 +312,7 @@ public class ExpenseFlowServiceImpl extends SuperService implements ExpenseFlowS
             }
         }
 
-        //
+        // 验证用户信息
         if (StringUtils.isEmpty(entity.getUserId())) {
             entity.setVerifyParamIsSuccess(Boolean.FALSE);
             entity.setVerifyParamMsg("订单未找到用户");

+ 2 - 1
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/school/SchoolUserServiceImpl.java

@@ -209,13 +209,14 @@ public class SchoolUserServiceImpl extends SuperService implements SchoolUserSer
                 return ResultContent.buildFail("卡片类型不能为空");
             }
             if (StringUtils.isEmpty(cardInfo.getCode())) {
-                return ResultContent.buildFail("iccid不能为空");
+                return ResultContent.buildFail("code不能为空");
             }
             if (map.containsKey(cardInfo.getCode())) {
                 return ResultContent.buildFail(String.format("code已存在:%s", cardInfo.getCode()));
             }
             map.put(cardInfo.getCode(), cardInfo.getCode());
         }
+
         String cardNumber = param.getCardNumber();
         if (!ValidateUtils.isIDCard(cardNumber)) {
             return ResultContent.buildFail(String.format("证件号码格式错误"));

+ 1 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/sync/DeviceSyncFromIotService.java

@@ -83,6 +83,7 @@ public class DeviceSyncFromIotService {
         HashMap<String, Object> map = new HashMap<>();
         map.put("lastOnlineTime", param.getLastOnlineTime());
         map.put("onLineState", param.getOnLineState());
+        map.put("state", param.getState());
         map.put("lastOnlineTimeStr", DateUtils.paresTime(param.getLastOnlineTime(), DateUtils.FORMAT_LONG));
         commonService.updateData(where, map, DeviceInfo.class.getSimpleName());
         commonService.updateData(where, map, DeviceBind.class.getSimpleName());