From 1def3f300dc7362c1e7506b8f7da7086d8a1446f Mon Sep 17 00:00:00 2001 From: ovo Date: Fri, 18 Oct 2024 17:34:46 +0800 Subject: [PATCH] =?UTF-8?q?=E9=95=BF=E5=BA=86=E9=A1=B9=E7=9B=AEday2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/enter/CqEnterController.java | 97 +++++++++++++++ .../modules/iCq/controller/enter/to/FTo.java | 19 +++ .../iCq/controller/enter/vo/FirstVo.java | 18 +++ .../iCq/controller/enter/vo/PeronType.java | 13 ++ .../iCq/controller/enter/vo/TypeRules.java | 14 +++ .../controller/member/CqMemberController.java | 71 ++++++++--- .../iCq/controller/member/dto/VisitorDto.java | 2 +- .../controller/member/vo/MemberListVo.java | 1 + .../video/CqSafeVideoController.java | 111 ++++++------------ .../controller/video/dto/UpdateVideoDto.java | 2 +- .../controller/video/dto/UploadVideoDto.java | 3 +- .../modules/iCq/controller/video/vo/Unit.java | 2 +- .../enter/TenEnterConfigEntity.java | 44 +++++++ .../video/{File.java => FileEntity.java} | 11 +- .../dataobject/video/TenSafeVideoEntity.java | 12 +- .../iCq/dal/mysql/enter/CqEnterMapper.java | 23 ++++ .../iCq/dal/mysql/member/CqMemberMapper.java | 2 +- .../iCq/dal/mysql/video/CqFileMapper.java | 9 +- .../dal/mysql/video/CqSafeVideoMapper.java | 4 +- .../ten/service/TenPersonCertService.java | 2 + .../resources/mapper/iCq/CqEnterMapper.xml | 41 +++++++ .../resources/mapper/iCq/CqFileMapper.xml | 2 +- .../resources/mapper/iCq/CqMemberMapper.xml | 4 +- .../mapper/iCq/CqSafeVideoMapper.xml | 25 ++-- 24 files changed, 415 insertions(+), 117 deletions(-) create mode 100644 shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/enter/CqEnterController.java create mode 100644 shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/enter/to/FTo.java create mode 100644 shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/enter/vo/FirstVo.java create mode 100644 shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/enter/vo/PeronType.java create mode 100644 shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/enter/vo/TypeRules.java create mode 100644 shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/dataobject/enter/TenEnterConfigEntity.java rename shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/dataobject/video/{File.java => FileEntity.java} (50%) create mode 100644 shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/mysql/enter/CqEnterMapper.java create mode 100644 shapelight-admin/src/main/resources/mapper/iCq/CqEnterMapper.xml diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/enter/CqEnterController.java b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/enter/CqEnterController.java new file mode 100644 index 0000000..eca0545 --- /dev/null +++ b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/enter/CqEnterController.java @@ -0,0 +1,97 @@ +package net.shapelight.modules.iCq.controller.enter; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.minio.MinioClient; +import io.minio.PutObjectOptions; +import io.swagger.annotations.Api; +import lombok.RequiredArgsConstructor; +import net.shapelight.common.config.MinioConfig; +import net.shapelight.common.utils.R; +import net.shapelight.common.utils.SnowflakeIdWorker; +import net.shapelight.common.utils.UUIDUtil; +import net.shapelight.modules.iCq.controller.enter.to.FTo; +import net.shapelight.modules.iCq.controller.enter.vo.FirstVo; +import net.shapelight.modules.iCq.controller.enter.vo.PeronType; +import net.shapelight.modules.iCq.controller.enter.vo.TypeRules; +import net.shapelight.modules.iCq.controller.member.dto.VisitorDto; +import net.shapelight.modules.iCq.controller.member.vo.MemberListVo; +import net.shapelight.modules.iCq.dal.dataobject.member.TenPersonEntity; +import net.shapelight.modules.iCq.dal.dataobject.video.FileEntity; +import net.shapelight.modules.iCq.dal.mysql.enter.CqEnterMapper; +import net.shapelight.modules.iCq.dal.mysql.member.CqMemberMapper; +import net.shapelight.modules.iCq.dal.mysql.video.CqFileMapper; +import net.shapelight.modules.iCq.dal.mysql.video.CqSafeVideoMapper; +import net.shapelight.modules.ten.service.TenPersonService; +import org.apache.commons.io.FilenameUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.UUID; + + +@RestController +@RequestMapping("cq/enterConfig") +@Api(value = "入场校验", tags = {"入场校验"}) +@RequiredArgsConstructor +public class CqEnterController { + + private final CqEnterMapper cqEnterMapper; + + private final CqSafeVideoMapper safeVideoMapper; + private final CqMemberMapper cqMemberMapper; + + + + @GetMapping("list") + public R find(String operator, String cellId){ + + List fTo = cqEnterMapper.classifiedQuery(cellId); + System.out.println(fTo); + + ArrayList firstVos = new ArrayList<>(); + + for (FTo f : fTo) { + FirstVo firstVo = new FirstVo(); + + firstVo.setOrgId(f.getCellId()); + firstVo.setUnitName(safeVideoMapper.findTheNameById(f.getCellId())); + firstVo.setPerson(operator); + firstVo.setConfigurationTime(f.getOperateTime()); + firstVos.add(firstVo); + } + + return R.ok().put("data", firstVos); + } + + @GetMapping("/getPersonType") + public R getPersonType(){ + List personType = cqEnterMapper.getPersonType(); + return R.ok().put("data", personType); + } + + @GetMapping("/rulesByType") + public R rulesByType(int typeId){ + if(typeId == 0){ + typeId = cqMemberMapper.speciallyForVisitors(); + } + List typeRules = cqEnterMapper.rulesByType(typeId); + return R.ok().put("data", typeRules); + } + + @PutMapping("/changeState/{id}") + public R changeState(@PathVariable("id") int ruleId){ + if (cqEnterMapper.changeState(ruleId) == 1) { + return R.ok(); + }else { + return R.error(); + } + + } + +} \ No newline at end of file diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/enter/to/FTo.java b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/enter/to/FTo.java new file mode 100644 index 0000000..b40e67f --- /dev/null +++ b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/enter/to/FTo.java @@ -0,0 +1,19 @@ +package net.shapelight.modules.iCq.controller.enter.to; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class FTo { + + private String cellId; + + + private Date operateTime; + +} diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/enter/vo/FirstVo.java b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/enter/vo/FirstVo.java new file mode 100644 index 0000000..88fa819 --- /dev/null +++ b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/enter/vo/FirstVo.java @@ -0,0 +1,18 @@ +package net.shapelight.modules.iCq.controller.enter.vo; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class FirstVo { + private String orgId; + private String unitName; + private String person; + private Date configurationTime; + +} diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/enter/vo/PeronType.java b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/enter/vo/PeronType.java new file mode 100644 index 0000000..52d9d00 --- /dev/null +++ b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/enter/vo/PeronType.java @@ -0,0 +1,13 @@ +package net.shapelight.modules.iCq.controller.enter.vo; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class PeronType { + private int labelId; + private String name; +} diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/enter/vo/TypeRules.java b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/enter/vo/TypeRules.java new file mode 100644 index 0000000..aa1bd81 --- /dev/null +++ b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/enter/vo/TypeRules.java @@ -0,0 +1,14 @@ +package net.shapelight.modules.iCq.controller.enter.vo; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class TypeRules { + private String checkItem; + private String remark; + private int state; +} diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/member/CqMemberController.java b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/member/CqMemberController.java index 6c66960..3add067 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/member/CqMemberController.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/member/CqMemberController.java @@ -1,5 +1,6 @@ package net.shapelight.modules.iCq.controller.member; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.minio.MinioClient; @@ -13,7 +14,9 @@ import net.shapelight.common.utils.UUIDUtil; import net.shapelight.modules.iCq.controller.member.dto.VisitorDto; import net.shapelight.modules.iCq.controller.member.vo.MemberListVo; import net.shapelight.modules.iCq.dal.dataobject.member.TenPersonEntity; +import net.shapelight.modules.iCq.dal.dataobject.video.FileEntity; import net.shapelight.modules.iCq.dal.mysql.member.CqMemberMapper; +import net.shapelight.modules.iCq.dal.mysql.video.CqFileMapper; import net.shapelight.modules.iCq.dal.mysql.video.CqSafeVideoMapper; import net.shapelight.modules.ten.service.TenPersonService; import org.apache.commons.io.FilenameUtils; @@ -24,7 +27,9 @@ import org.springframework.web.multipart.MultipartFile; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; +import java.util.Date; import java.util.List; +import java.util.UUID; /** * 宣传片表 @@ -40,6 +45,7 @@ public class CqMemberController { private final CqSafeVideoMapper cqSafeVideoMapper; private final CqMemberMapper cqMemberMapper; + private final CqFileMapper cqFileMapper; private final MinioConfig minioConfig; @@ -47,14 +53,23 @@ public class CqMemberController { private final MinioClient minioClient; - - @GetMapping("/list") public R list(@RequestParam(defaultValue = "1") int page, - @RequestParam(defaultValue = "10") int size) { + @RequestParam(defaultValue = "10") int size, + String unitName) { // 创建分页对象 Page pageRequest = new Page<>(page, size); + /* QueryWrapper queryWrapper = new QueryWrapper<>(); + + // 假设你想按名字进行筛选(name 为数据库中的字段名) + if (!unitName.isEmpty()){ + queryWrapper.eq("cell_name", unitName); + } + + queryWrapper.orderByDesc("upload_time");*/ + + // 使用 MyBatis-Plus 提供的分页查询 IPage pageResult = cqMemberMapper.selectPage(pageRequest, null); @@ -65,8 +80,9 @@ public class CqMemberController { for (TenPersonEntity tenSafeVideoEntity : list) { MemberListVo memberListVo = new MemberListVo(); memberListVo.setId(tenSafeVideoEntity.getPersonId()); + memberListVo.setUnitId(tenSafeVideoEntity.getOrgId()); memberListVo.setUnitName(cqMemberMapper.lookUpTheNameBasedOnTheDepartmentId - (tenSafeVideoEntity.getDeptId())); + (tenSafeVideoEntity.getOrgId())); memberListVo.setName(tenSafeVideoEntity.getName()); memberListVo.setSex(tenSafeVideoEntity.getGender() == 0 ? "女" : "男"); memberListVo.setPhone(tenSafeVideoEntity.getMobile()); @@ -113,15 +129,26 @@ public class CqMemberController { return R.ok(); } - @PostMapping("/gbUpload") + @PostMapping("/Upload") public R gbUpload(MultipartFile file) { if (file.isEmpty() || file.getSize() == 0) { System.out.println("文件不能为空"); } String fileName = null; + + String catalogue; + try { String extension = FilenameUtils.getExtension(file.getOriginalFilename()); //后缀名 - fileName = "temp/" + "t_" + UUIDUtil.uuid() + "." + extension; + if (extension.equals("png") || extension.equals("jpg")){ + catalogue = "temp/"; + }else if (extension.equals("mp4")){ + catalogue = "cqyt/"; + }else { + return R.error().put("info", "不允许上传此类型!"); + } + + fileName = catalogue + "t_" + UUIDUtil.uuid() + "." + extension; InputStream inputStream = file.getInputStream(); PutObjectOptions putObjectOptions = new PutObjectOptions(inputStream.available(), -1); putObjectOptions.setContentType(file.getContentType()); @@ -132,12 +159,28 @@ public class CqMemberController { System.out.println(e.getMessage()); } System.out.println("方法结束"); - return R.ok().put("data", fileName); + + + UUID uuid = UUID.randomUUID(); + String replace = uuid.toString().replace("-", ""); + + int lastDotIndex = file.getOriginalFilename().lastIndexOf('.'); + + String substring = file.getOriginalFilename().substring(0, lastDotIndex); + + FileEntity fileEntity = new FileEntity(replace, + substring, fileName, new Date()); + cqFileMapper.insert(fileEntity); + + return R.ok().put("data", fileEntity); } - - //修改 + /** + * 添加访客记录 + * @param visitorDto + * @return + */ @PostMapping("/newVisitor") public R newVisitor(@RequestBody VisitorDto visitorDto) { @@ -148,9 +191,8 @@ public class CqMemberController { tenPersonEntity.setUuid(UUIDUtil.uuid()); tenPersonEntity.setCellId(1255898969448382468L); tenPersonEntity.setAppFlag(0); - - tenPersonEntity.setDeptId(cqSafeVideoMapper.runTheNameById(visitorDto.getUnitName())); - + //tenPersonEntity.setDeptId(cqSafeVideoMapper.runTheNameById(visitorDto.getUnitName())); + tenPersonEntity.setDeptId(Long.valueOf(visitorDto.getUnitId())); tenPersonEntity.setLabelId(cqMemberMapper.speciallyForVisitors()); tenPersonEntity.setName(visitorDto.getName()); tenPersonEntity.setGender(visitorDto.getSex()); @@ -163,14 +205,9 @@ public class CqMemberController { net.shapelight.modules.ten.entity.TenPersonEntity tenPersonEntity1 = new net.shapelight.modules.ten.entity.TenPersonEntity(); - //把前面的复制到后面 BeanUtils.copyProperties(tenPersonEntity, tenPersonEntity1); - - /* int i = tenPersonService.saveTenPerson(tenPersonEntity1); - System.out.println(i);*/ - if (tenPersonService.saveTenPerson(tenPersonEntity1) == 0) { return R.ok(); } else { diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/member/dto/VisitorDto.java b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/member/dto/VisitorDto.java index edd66cc..c6a5de9 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/member/dto/VisitorDto.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/member/dto/VisitorDto.java @@ -9,7 +9,7 @@ import net.shapelight.common.base.BaseEntity; @AllArgsConstructor @NoArgsConstructor public class VisitorDto extends BaseEntity { - private String unitName; + private Integer unitId; private String name; private int sex; private String idCard; diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/member/vo/MemberListVo.java b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/member/vo/MemberListVo.java index c2d8e51..9bdebf3 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/member/vo/MemberListVo.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/member/vo/MemberListVo.java @@ -10,6 +10,7 @@ import lombok.NoArgsConstructor; public class MemberListVo { // id 或者 person id 一样的 private Long id; + private String unitId; //单位名称 private String unitName; //姓名 diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/video/CqSafeVideoController.java b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/video/CqSafeVideoController.java index 83d4543..a69eac8 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/video/CqSafeVideoController.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/video/CqSafeVideoController.java @@ -1,5 +1,6 @@ package net.shapelight.modules.iCq.controller.video; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.annotations.Api; @@ -11,7 +12,6 @@ import net.shapelight.modules.face.rtsp.RtspFrameGrabber; import net.shapelight.modules.iCq.controller.video.dto.UpdateVideoDto; import net.shapelight.modules.iCq.controller.video.dto.UploadVideoDto; import net.shapelight.modules.iCq.controller.video.vo.Unit; -import net.shapelight.modules.iCq.dal.dataobject.video.File; import net.shapelight.modules.iCq.dal.dataobject.video.TenSafeVideoEntity; import net.shapelight.modules.iCq.dal.mysql.video.CqFileMapper; import net.shapelight.modules.iCq.dal.mysql.video.CqSafeVideoMapper; @@ -22,7 +22,6 @@ import org.springframework.web.multipart.MultipartFile; import java.io.IOException; import java.util.Date; import java.util.List; -import java.util.UUID; /** * 宣传片表 @@ -51,57 +50,21 @@ public class CqSafeVideoController { return R.ok().put("data", queryUnit); } - @GetMapping("/getChildUnits") - public R getChildUnits(String name) { - //查询子级 - List queryUnit = cqSafeVideoMapper.queryChildUnit(name); - return R.ok().put("data", queryUnit); - } - - - - @PostMapping("/upload") - - public R upload(@RequestParam("file")MultipartFile file){ - - /* String contentType = file.getContentType(); // 获取文件的 MIME 类型 - - UUID uuid = UUID.randomUUID(); - String fileName = uuid.toString().replace("-", "") + - file.getOriginalFilename(); - return;*/ - File file1 = new File(); - file1.setFileName(file.getOriginalFilename()); - UUID uuid = UUID.randomUUID(); - String replace = uuid.toString().replace("-", ""); - file1.setFileId(replace); - - - //TODO:生成URL - - - file1.setFileUrl("测试的URL"); - - cqFileMapper.insert(file1); - return R.ok().put("data",file1); - - } - - - - @PostMapping("/insert") - public R insert(@ModelAttribute UploadVideoDto uploadVideoDto) throws IOException { + public R insert(@RequestBody UploadVideoDto uploadVideoDto) throws IOException { TenSafeVideoEntity tenSafeVideoEntity = new TenSafeVideoEntity(); tenSafeVideoEntity.setName(cqFileMapper.selectByFileId(uploadVideoDto.getFileId()).getFileName()); - tenSafeVideoEntity.setCellId(cqSafeVideoMapper.runTheNameById(uploadVideoDto.getUnitName())); - tenSafeVideoEntity.setCellName(uploadVideoDto.getUnitName()); + /* tenSafeVideoEntity.setCellId(cqSafeVideoMapper.runTheNameById(uploadVideoDto.getUnitName())); + tenSafeVideoEntity.setCellName(uploadVideoDto.getUnitName());*/ + tenSafeVideoEntity.setCellId(uploadVideoDto.getUnitId()); + tenSafeVideoEntity.setCellName(cqSafeVideoMapper.findTheNameById(uploadVideoDto.getUnitId())); tenSafeVideoEntity.setUploadId(uploadVideoDto.getUploaderId()); tenSafeVideoEntity.setUploadName(uploadVideoDto.getUploader()); tenSafeVideoEntity.setUploadTime(new Date()); tenSafeVideoEntity.setUrl(cqFileMapper.selectByFileId(uploadVideoDto.getFileId()).getFileUrl()); tenSafeVideoEntity.setPlayCount(0); + tenSafeVideoEntity.setFileId(uploadVideoDto.getFileId()); if (cqSafeVideoMapper.insert(tenSafeVideoEntity) == 1) { return R.ok(); @@ -113,12 +76,21 @@ public class CqSafeVideoController { @GetMapping("/list") public R list(@RequestParam(defaultValue = "1") int page, - @RequestParam(defaultValue = "10") int size) { + @RequestParam(defaultValue = "10") int size, + String unitId) { // 创建分页对象 Page pageRequest = new Page<>(page, size); + QueryWrapper queryWrapper = new QueryWrapper<>(); + // 假设你想按名字进行筛选(name 为数据库中的字段名) + if (unitId != null && !unitId.isEmpty()){ + queryWrapper.eq("cell_id", unitId); + } + + queryWrapper.orderByDesc("upload_time"); + // 使用 MyBatis-Plus 提供的分页查询 - IPage pageResult = cqSafeVideoMapper.selectPage(pageRequest, null); + IPage pageResult = cqSafeVideoMapper.selectPage(pageRequest, queryWrapper); List list = pageResult.getRecords(); @@ -141,19 +113,17 @@ public class CqSafeVideoController { //修改 @PostMapping("/update") - public R update(@ModelAttribute UpdateVideoDto updateVideoDto) { - + public R update(@RequestBody UpdateVideoDto updateVideoDto) { TenSafeVideoEntity tenSafeVideoEntity = new TenSafeVideoEntity(); - tenSafeVideoEntity.setName(cqFileMapper.selectByFileId(updateVideoDto.getFileId()).getFileName()); - tenSafeVideoEntity.setId(updateVideoDto.getVideoId()); - tenSafeVideoEntity.setCellId(cqSafeVideoMapper.runTheNameById(updateVideoDto.getUnitName())); - tenSafeVideoEntity.setCellName(updateVideoDto.getUnitName()); + /* tenSafeVideoEntity.setCellId(cqSafeVideoMapper.runTheNameById(updateVideoDto.getUnitName())); + tenSafeVideoEntity.setCellName(updateVideoDto.getUnitName());*/ + tenSafeVideoEntity.setCellId(updateVideoDto.getUnitId()); + tenSafeVideoEntity.setCellName(cqSafeVideoMapper.findTheNameById(updateVideoDto.getUnitId())); tenSafeVideoEntity.setUploadTime(new Date()); - tenSafeVideoEntity.setUrl(cqFileMapper.selectByFileId(updateVideoDto.getFileId()).getFileUrl()); - + tenSafeVideoEntity.setFileId(updateVideoDto.getFileId()); if (cqSafeVideoMapper.updateById(tenSafeVideoEntity) == 1) { return R.ok(); } else { @@ -162,29 +132,22 @@ public class CqSafeVideoController { } - @GetMapping("/show") - public R show(@RequestParam(defaultValue = "1") int page, - @RequestParam(defaultValue = "10") int size) { - // 创建分页对象 - Page pageRequest = new Page<>(page, size); - - // 使用 MyBatis-Plus 提供的分页查询 - IPage pageResult = cqFileMapper.selectPage(pageRequest, null); - - List list = pageResult.getRecords(); + @GetMapping("/inquireVideo") + public R inquireVideo(@RequestParam(defaultValue = "1") int page, + @RequestParam(defaultValue = "10") int size, + String unitId, String videoName, String uploader){ + System.out.println("uploader + 上传人 = " + uploader); + List list = cqSafeVideoMapper.relatedQuery(unitId, videoName, uploader); return R.ok().put("data", list); } - - @GetMapping("/inquireVideo") - public R inquireVideo(String unitName, String videoName, String uploader){ - - List list = cqSafeVideoMapper.relatedQuery(unitName, videoName, uploader); - - - return R.ok(); + @GetMapping("/singleFind") + public R singleFind(int videoId){ + TenSafeVideoEntity tenSafeVideoEntity = cqSafeVideoMapper.selectById(videoId); + return R.ok().put("data", tenSafeVideoEntity); } + @GetMapping("/camara") public R watchStart(String cellId) { rtspFrameGrabber.startGrabber(cellId); @@ -192,8 +155,8 @@ public class CqSafeVideoController { } - @GetMapping("/face/recognition") - public R aWatchStart(@RequestParam("image") MultipartFile image,@RequestParam String cellId) { + @PostMapping("/face/recognition") + public R aWatchStart(@RequestParam("image") MultipartFile image, @RequestParam String cellId) { rtspFrameGrabber.recognition(image,cellId); return R.ok(); } diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/video/dto/UpdateVideoDto.java b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/video/dto/UpdateVideoDto.java index a12cb69..bf4bb3f 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/video/dto/UpdateVideoDto.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/video/dto/UpdateVideoDto.java @@ -6,5 +6,5 @@ import lombok.Data; public class UpdateVideoDto { private String fileId; private Long videoId; - private String unitName; + private String unitId; } diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/video/dto/UploadVideoDto.java b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/video/dto/UploadVideoDto.java index 0eeb599..8f7505b 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/video/dto/UploadVideoDto.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/video/dto/UploadVideoDto.java @@ -1,5 +1,6 @@ package net.shapelight.modules.iCq.controller.video.dto; +import io.swagger.models.auth.In; import lombok.Data; import org.springframework.web.multipart.MultipartFile; @@ -8,5 +9,5 @@ public class UploadVideoDto { private String fileId; private String uploader; private Long uploaderId; - private String unitName; + private String unitId; } diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/video/vo/Unit.java b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/video/vo/Unit.java index 695bac1..9637f7f 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/video/vo/Unit.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/controller/video/vo/Unit.java @@ -9,6 +9,6 @@ import lombok.NoArgsConstructor; @AllArgsConstructor @NoArgsConstructor public class Unit { - private Long deptId; + private String orgId; private String name; } diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/dataobject/enter/TenEnterConfigEntity.java b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/dataobject/enter/TenEnterConfigEntity.java new file mode 100644 index 0000000..d043e2d --- /dev/null +++ b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/dataobject/enter/TenEnterConfigEntity.java @@ -0,0 +1,44 @@ +package net.shapelight.modules.iCq.dal.dataobject.enter; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 宣传片表 + */ +@Data +@TableName("ten_enter_config") +public class TenEnterConfigEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId + private Long id; + + /** + * 视频名称 + */ + private String checkItem; + + + private String remark; + + + private String assignId; + + + private Long assignName; + + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private String operateTime; + +} + diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/dataobject/video/File.java b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/dataobject/video/FileEntity.java similarity index 50% rename from shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/dataobject/video/File.java rename to shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/dataobject/video/FileEntity.java index 971890a..30000c1 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/dataobject/video/File.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/dataobject/video/FileEntity.java @@ -1,16 +1,23 @@ package net.shapelight.modules.iCq.dal.dataobject.video; -import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; import java.io.Serializable; +import java.util.Date; @Data +@AllArgsConstructor +@NoArgsConstructor @TableName("ten_file") -public class File implements Serializable { +public class FileEntity implements Serializable { private static final long serialVersionUID = 1L; private String fileId; private String fileName; private String fileUrl; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date uploadTime; } diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/dataobject/video/TenSafeVideoEntity.java b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/dataobject/video/TenSafeVideoEntity.java index 9758cbb..e984806 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/dataobject/video/TenSafeVideoEntity.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/dataobject/video/TenSafeVideoEntity.java @@ -30,7 +30,7 @@ public class TenSafeVideoEntity implements Serializable { /** * 单位ID */ - private Long cellId; + private String cellId; /** * 单位名称 @@ -68,4 +68,12 @@ public class TenSafeVideoEntity implements Serializable { * 播放次数 */ private Integer playCount; -} \ No newline at end of file + + private String fileId; +} + +//checkItem +//remark + +//assignPeople +//operatingTime \ No newline at end of file diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/mysql/enter/CqEnterMapper.java b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/mysql/enter/CqEnterMapper.java new file mode 100644 index 0000000..57f7007 --- /dev/null +++ b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/mysql/enter/CqEnterMapper.java @@ -0,0 +1,23 @@ +package net.shapelight.modules.iCq.dal.mysql.enter; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import net.shapelight.modules.iCq.controller.enter.to.FTo; +import net.shapelight.modules.iCq.controller.enter.vo.PeronType; +import net.shapelight.modules.iCq.controller.enter.vo.TypeRules; +import net.shapelight.modules.iCq.dal.dataobject.enter.TenEnterConfigEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface CqEnterMapper extends BaseMapper { + + + List classifiedQuery(String cellId); + + List getPersonType(); + + List rulesByType(int typeId); + + int changeState(int ruleId); +} diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/mysql/member/CqMemberMapper.java b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/mysql/member/CqMemberMapper.java index f296e36..1d99b91 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/mysql/member/CqMemberMapper.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/mysql/member/CqMemberMapper.java @@ -11,7 +11,7 @@ import java.util.List; public interface CqMemberMapper extends BaseMapper { - String lookUpTheNameBasedOnTheDepartmentId(Long deptId); + String lookUpTheNameBasedOnTheDepartmentId(String orgId); String takeTheNameAccordingToType(Integer personType); diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/mysql/video/CqFileMapper.java b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/mysql/video/CqFileMapper.java index bcd8bb5..b4a7c93 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/mysql/video/CqFileMapper.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/mysql/video/CqFileMapper.java @@ -1,20 +1,17 @@ package net.shapelight.modules.iCq.dal.mysql.video; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import net.shapelight.modules.iCq.dal.dataobject.video.File; -import net.shapelight.modules.iCq.dal.dataobject.video.TenSafeVideoEntity; +import net.shapelight.modules.iCq.dal.dataobject.video.FileEntity; import org.apache.ibatis.annotations.Mapper; -import java.util.List; - @Mapper -public interface CqFileMapper extends BaseMapper { +public interface CqFileMapper extends BaseMapper { /** * 根据文件id获取文件信息 * @param fileId * @return */ - File selectByFileId(String fileId); + FileEntity selectByFileId(String fileId); } diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/mysql/video/CqSafeVideoMapper.java b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/mysql/video/CqSafeVideoMapper.java index ea3613b..3dd8c32 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/mysql/video/CqSafeVideoMapper.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/iCq/dal/mysql/video/CqSafeVideoMapper.java @@ -36,5 +36,7 @@ public interface CqSafeVideoMapper extends BaseMapper { //目前没用 明天测试 待删除 List queryChildUnit(String name); - List relatedQuery(String unitName, String videoName, String uploader); + List relatedQuery(String unitId, String videoName, String uploader); + + String findTheNameById(String unitId); } diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/TenPersonCertService.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/TenPersonCertService.java index 544bda6..781b107 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/TenPersonCertService.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/TenPersonCertService.java @@ -2,6 +2,7 @@ package net.shapelight.modules.ten.service; import com.baomidou.mybatisplus.extension.service.IService; import net.shapelight.modules.ten.entity.TenPersonCert; +import org.springframework.stereotype.Service; /** @@ -9,6 +10,7 @@ import net.shapelight.modules.ten.entity.TenPersonCert; * @description 针对表【ten_person_cert】的数据库操作Service * @createDate 2024-10-16 19:43:27 */ + public interface TenPersonCertService extends IService { public void saveOrUpdateByField(TenPersonCert entity, String fieldName); diff --git a/shapelight-admin/src/main/resources/mapper/iCq/CqEnterMapper.xml b/shapelight-admin/src/main/resources/mapper/iCq/CqEnterMapper.xml new file mode 100644 index 0000000..656542e --- /dev/null +++ b/shapelight-admin/src/main/resources/mapper/iCq/CqEnterMapper.xml @@ -0,0 +1,41 @@ + + + + + + UPDATE ten_enter_config_type + SET state = NOT state + WHERE id = #{ruleId}; + + + + + + + \ No newline at end of file diff --git a/shapelight-admin/src/main/resources/mapper/iCq/CqFileMapper.xml b/shapelight-admin/src/main/resources/mapper/iCq/CqFileMapper.xml index 9022ca4..766054d 100644 --- a/shapelight-admin/src/main/resources/mapper/iCq/CqFileMapper.xml +++ b/shapelight-admin/src/main/resources/mapper/iCq/CqFileMapper.xml @@ -3,7 +3,7 @@ - SELECT file_id, file_name, file_url FROM ten_file WHERE file_id = #{fileId} diff --git a/shapelight-admin/src/main/resources/mapper/iCq/CqMemberMapper.xml b/shapelight-admin/src/main/resources/mapper/iCq/CqMemberMapper.xml index 56e9295..cff486b 100644 --- a/shapelight-admin/src/main/resources/mapper/iCq/CqMemberMapper.xml +++ b/shapelight-admin/src/main/resources/mapper/iCq/CqMemberMapper.xml @@ -5,12 +5,12 @@ \ No newline at end of file diff --git a/shapelight-admin/src/main/resources/mapper/iCq/CqSafeVideoMapper.xml b/shapelight-admin/src/main/resources/mapper/iCq/CqSafeVideoMapper.xml index 2aa14aa..8384f76 100644 --- a/shapelight-admin/src/main/resources/mapper/iCq/CqSafeVideoMapper.xml +++ b/shapelight-admin/src/main/resources/mapper/iCq/CqSafeVideoMapper.xml @@ -20,8 +20,8 @@ SELECT cell_id from ten_cell WHERE delete_flag = 0 + \ No newline at end of file