ImportTeacherFaceNodeTest.java 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package com.xjrsoft.module.liteflow.node;
  2. import com.xjrsoft.XjrSoftApplication;
  3. import com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper;
  4. import com.xjrsoft.module.hikvision.util.FaceImportUtil;
  5. import com.xjrsoft.module.personnel.entity.TeacherFaceProcess;
  6. import com.xjrsoft.module.personnel.service.ITeacherFaceProcessService;
  7. import com.xjrsoft.module.teacher.mapper.FaceImportMapper;
  8. import org.junit.jupiter.api.Test;
  9. import org.junit.runner.RunWith;
  10. import org.springframework.beans.factory.annotation.Autowired;
  11. import org.springframework.boot.test.context.SpringBootTest;
  12. import org.springframework.test.context.junit4.SpringRunner;
  13. /**
  14. * @author dzx
  15. * @date 2024/5/27
  16. */
  17. @RunWith(SpringRunner.class)
  18. @SpringBootTest(classes = XjrSoftApplication.class)
  19. class ImportTeacherFaceNodeTest {
  20. @Autowired
  21. private ITeacherFaceProcessService teacherFaceProcessService;
  22. @Autowired
  23. private FaceImportMapper faceImportMapper;
  24. @Autowired
  25. private HikvisionDataMapper hikvisionDataMapper;
  26. @Test
  27. public void process() throws Exception {
  28. // 获取表单中数据编号
  29. Long formId = 1802867597624520704L;
  30. if (formId != null) {
  31. String fileUrl = faceImportMapper.GetTeacherHikvisionImgById(formId);
  32. // 数据处理
  33. TeacherFaceProcess dataObj = teacherFaceProcessService.getById(formId);
  34. dataObj.setStatus(1);
  35. dataObj.setExamStatus(1);
  36. String reslut = FaceImportUtil.ImportTeacherFace(hikvisionDataMapper.getTeacherHikvisionId(dataObj.getUserId()), fileUrl);
  37. dataObj.setHikvisionResult(reslut);
  38. teacherFaceProcessService.updateById(dataObj);
  39. }
  40. }
  41. }