逻辑修改

This commit is contained in:
Jerry Yan 2024-12-29 11:09:43 +08:00
parent 80c8dc2b3c
commit 5af3a14f03
8 changed files with 22 additions and 31 deletions

View File

@ -35,7 +35,7 @@ public class FileController {
public ApiResponse<?> upload(@RequestParam(value = "file") MultipartFile file) throws IOException {
String[] split = file.getOriginalFilename().split("\\.");
String ext = split[split.length - 1];
String url = StorageFactory.use("assets").uploadFile(file, "web", UUID.randomUUID() + "." + ext);
String url = StorageFactory.use().uploadFile(file, "web", UUID.randomUUID() + "." + ext);
return ApiResponse.success(url);
}
@ -43,7 +43,7 @@ public class FileController {
@PostMapping("/delete")
@IgnoreToken
public ApiResponse<?> delete(@RequestParam(value = "fileName") String fileName) throws IOException {
boolean flag = StorageFactory.use("assets").deleteFile("web", fileName);
boolean flag = StorageFactory.use().deleteFile("web", fileName);
return flag ? ApiResponse.success(BizCodeEnum.REQUEST_OK) : ApiResponse.fail(BizCodeEnum.FAIL.getMessage());
}
}

View File

@ -35,18 +35,7 @@ AppFaceController {
*/
@ApiOperation("人脸照片上传")
@PostMapping("/faceUPload")
public ApiResponse faceUPload(@RequestParam("file")MultipartFile file, @RequestParam("scenicId") Long scenicId) {
public ApiResponse faceUpload(@RequestParam("file")MultipartFile file, @RequestParam("scenicId") Long scenicId) {
return faceService.faceUpload(file,scenicId);
}
@ApiOperation("查询人脸照片信息")
@GetMapping("/getFaceData")
public ApiResponse<FaceRespVO> getFaceData() {
JwtInfo worker = JwtTokenUtil.getWorker();
return faceService.getFaceByMemberId(worker.getUserId());
}
}

View File

@ -31,7 +31,7 @@ public interface TemplateMapper {
int updateConfigById(TemplateConfigEntity templateConfigEntity);
int deleteConfigByTemplateId(Long templateId);
int deleteConfigById(Long id);
List<TemplateEntity> listByScenicId(Long scenicId);
List<TemplateEntity> listEnabledByScenicId(Long scenicId);
List<ContentPageVO> listFor(@Param("scenicId") Long scenicId, @Param("faceId") Long faceId);
}

View File

@ -21,16 +21,19 @@ public class FaceSampleRespVO {
*/
@ApiModelProperty("景区ID")
private Long scenicId;
private String scenicName;
/**
* 来源设备
*/
@ApiModelProperty("来源设备")
private Long deviceId;
private String deviceName;
/**
* 人脸照片
*/
@ApiModelProperty("人脸照片")
private String faceUrl;
private Float score;
/**
* 与样本匹配的ID逗号隔开
*/

View File

@ -52,37 +52,34 @@
</if>
</delete>
<select id="list" resultType="com.ycwl.basic.model.pc.faceSample.resp.FaceSampleRespVO">
select id, scenic_id, device_id, face_url, source_id, match_sample_ids, first_match_rate, match_result,`status`
from face_sample
select f.id, f.scenic_id, s.name scenicName, device_id, d.name deviceName, face_url, source_id, f.score, match_sample_ids, first_match_rate, match_result, f.`status`, f.create_at
from face_sample f
left join scenic s on s.id = f.scenic_id
left join device d on d.id = f.device_id
<where>
<if test="scenicId!= null and scenicId!= ''">
and scenic_id = #{scenicId}
and f.scenic_id = #{scenicId}
</if>
<if test="deviceId!= null and deviceId!= ''">
and device_id = #{deviceId}
</if>
<if test="source_id!= null and source_id!= ''">
and source_id = #{source_id}
<if test="sourceId!= null and sourceId!= ''">
and source_id = #{sourceId}
</if>
<if test="matchSampleIds!= null and matchSampleIds!= ''">
and match_sample_ids like concat('%', #{matchSampleIds}, '%')
</if>
<if test="startMatchRate!= null ">
and first_match_rate &gt;= #{startMatchRate}
</if>
<if test="endMatchRate!= null ">
and first_match_rate &lt;= #{endMatchRate}
</if>
<if test="startTime!=null">
and create_at >= #{startTime}
and f.create_at >= #{startTime}
</if>
<if test="endTime!=null">
and create_at &lt;= #{endTime}
and f.create_at &lt;= #{endTime}
</if>
<if test="status!= null ">
and `status` = #{status}
and f.`status` = #{status}
</if>
</where>
ORDER BY f.create_at desc
</select>
<select id="getById" resultType="com.ycwl.basic.model.pc.faceSample.resp.FaceSampleRespVO">
select id, scenic_id, device_id, face_url, match_sample_ids, first_match_rate, source_id, match_result,`status`, create_at

View File

@ -59,6 +59,7 @@ from task
<where>
<if test="workerId!= null">and worker_id = #{workerId} </if>
<if test="memberId!= null">and member_id = #{memberId} </if>
<if test="faceId!= null">and face_id = #{faceId} </if>
<if test="templateId!= null">and template_id = #{templateId} </if>
<if test="scenicId!= null">and scenic_id = #{scenicId} </if>
<if test="status!= null">and `status` = #{status} </if>

View File

@ -92,10 +92,10 @@
<select id="getConfig" resultType="com.ycwl.basic.model.pc.template.entity.TemplateConfigEntity">
select * from template_config where template_id = #{templateId}
</select>
<select id="listByScenicId" resultType="com.ycwl.basic.model.pc.template.entity.TemplateEntity">
<select id="listEnabledByScenicId" resultType="com.ycwl.basic.model.pc.template.entity.TemplateEntity">
select *
from template
where scenic_id = #{scenicId} and pid = 0
where scenic_id = #{scenicId} and pid = 0 and status = 1
</select>
<select id="listFor" resultType="com.ycwl.basic.model.mobile.scenic.content.ContentPageVO">
select t.id templateId, t.scenic_id, s.name as scenic_name, t.`name`, pid, t.cover_url templateCoverUrl,

View File

@ -46,6 +46,7 @@
)
</if>
</where>
order by v.create_time desc
</select>
<select id="getById" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
select v.id, v.scenic_id, member_id, template_id, task_id, worker_id, video_url, v.create_time, v.update_time,