|
|
@@ -7,14 +7,12 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
|
import com.xjrsoft.common.exception.MyException;
|
|
|
-import com.xjrsoft.common.mqtt.EmqClient;
|
|
|
import com.xjrsoft.common.utils.ImageUtil;
|
|
|
import com.xjrsoft.module.personnel.entity.FaceManagement;
|
|
|
import com.xjrsoft.module.personnel.mapper.FaceManagementMapper;
|
|
|
import com.xjrsoft.module.personnel.service.IFaceManagementService;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.eclipse.paho.mqttv5.common.MqttException;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
@@ -27,7 +25,6 @@ public class FaceManagementServiceImpl extends MPJBaseServiceImpl<FaceManagement
|
|
|
private final FaceManagementMapper faceManagementMapper;
|
|
|
|
|
|
|
|
|
- private EmqClient emqClient;
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@@ -40,16 +37,6 @@ public class FaceManagementServiceImpl extends MPJBaseServiceImpl<FaceManagement
|
|
|
faceManagement.setVerifyStatus(2); // 自动通过
|
|
|
faceManagementMapper.insert(faceManagement);
|
|
|
|
|
|
- // 推送数据客户端
|
|
|
-// JSONObject jsonObject = JSONUtil.createObj()
|
|
|
-// .put("id", faceManagement.getId().toString())
|
|
|
-// .put("register_base64", ImageUtil.base64RemovePrefix(faceManagement.getRegisterBase64()));
|
|
|
-//
|
|
|
-// try {
|
|
|
-// emqClient.publish("/face/device/personnel/image/verify", jsonObject);
|
|
|
-// } catch (MqttException e) {
|
|
|
-// log.error("mqtt", "publish", "/face/device/personnel/image/verify", e.getMessage());
|
|
|
-// }
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
@@ -70,11 +57,6 @@ public class FaceManagementServiceImpl extends MPJBaseServiceImpl<FaceManagement
|
|
|
.put("id", faceManagement.getId().toString())
|
|
|
.put("register_base64", ImageUtil.base64RemovePrefix(faceManagement.getRegisterBase64()));
|
|
|
|
|
|
- try {
|
|
|
- emqClient.publish("/face/device/personnel/image/verify", jsonObject);
|
|
|
- } catch (MqttException e) {
|
|
|
- log.error("mqtt", "publish", "/face/device/personnel/image/verify", e.getMessage());
|
|
|
- }
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
@@ -94,11 +76,6 @@ public class FaceManagementServiceImpl extends MPJBaseServiceImpl<FaceManagement
|
|
|
JSONObject jsonObject = JSONUtil.createObj()
|
|
|
.put("employee_number", item.getFaceCode());
|
|
|
|
|
|
- try {
|
|
|
- emqClient.publish("/face/device/personnel/delete", jsonObject);
|
|
|
- } catch (MqttException e) {
|
|
|
- log.error("mqtt", "publish", "/face/device/personnel/delete", e.getMessage());
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
return true;
|