|
@@ -8,6 +8,7 @@ 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.app.entity.AppPageDesign;
|
|
|
import com.xjrsoft.module.personnel.entity.CarManagement;
|
|
|
import com.xjrsoft.module.personnel.entity.FaceManagement;
|
|
@@ -44,7 +45,7 @@ public class FaceManagementServiceImpl extends MPJBaseServiceImpl<FaceManagement
|
|
|
// 推送数据客户端
|
|
|
JSONObject jsonObject = JSONUtil.createObj()
|
|
|
.put("id", faceManagement.getId().toString())
|
|
|
- .put("register_base64", base64Handler(faceManagement.getRegisterBase64()));
|
|
|
+ .put("register_base64", ImageUtil.base64RemovePrefix(faceManagement.getRegisterBase64()));
|
|
|
|
|
|
try {
|
|
|
emqClient.publish("/face/device/personnel/image/verify", jsonObject);
|
|
@@ -69,7 +70,7 @@ public class FaceManagementServiceImpl extends MPJBaseServiceImpl<FaceManagement
|
|
|
// 推送数据客户端
|
|
|
JSONObject jsonObject = JSONUtil.createObj()
|
|
|
.put("id", faceManagement.getId().toString())
|
|
|
- .put("register_base64", base64Handler(faceManagement.getRegisterBase64()));
|
|
|
+ .put("register_base64", ImageUtil.base64RemovePrefix(faceManagement.getRegisterBase64()));
|
|
|
|
|
|
try {
|
|
|
emqClient.publish("/face/device/personnel/image/verify", jsonObject);
|
|
@@ -80,12 +81,7 @@ public class FaceManagementServiceImpl extends MPJBaseServiceImpl<FaceManagement
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- // base64图片处理
|
|
|
- private String base64Handler(String baseStr) {
|
|
|
- return baseStr.replace("data:image/jpg;base64,", "")
|
|
|
- .replace("data:image/jpeg;base64,", "")
|
|
|
- .replace("data:image/png;base64,", "");
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -101,9 +97,9 @@ public class FaceManagementServiceImpl extends MPJBaseServiceImpl<FaceManagement
|
|
|
.put("employee_number", item.getFaceCode());
|
|
|
|
|
|
try {
|
|
|
- emqClient.publish("/car/identify/delete", jsonObject);
|
|
|
+ emqClient.publish("/face/device/personnel/delete", jsonObject);
|
|
|
} catch (MqttException e) {
|
|
|
- log.error("mqtt", "publish", "/car/identify/delete", e.getMessage());
|
|
|
+ log.error("mqtt", "publish", "/face/device/personnel/delete", e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|