From 7e8eebdef592e632f5710a96e335257cc558573d Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Mon, 17 Mar 2025 18:32:24 +0800 Subject: [PATCH] free --- .../basic/model/mobile/goods/GoodsDetailVO.java | 1 + .../pc/device/entity/DeviceConfigEntity.java | 2 ++ .../pc/source/entity/MemberSourceEntity.java | 2 ++ .../basic/model/pc/source/resp/SourceRespVO.java | 1 + .../service/impl/mobile/GoodsServiceImpl.java | 2 +- .../service/task/impl/TaskFaceServiceImpl.java | 14 ++++++++++++++ src/main/resources/mapper/DeviceMapper.xml | 4 +++- src/main/resources/mapper/SourceMapper.xml | 16 ++++++++-------- 8 files changed, 32 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/ycwl/basic/model/mobile/goods/GoodsDetailVO.java b/src/main/java/com/ycwl/basic/model/mobile/goods/GoodsDetailVO.java index bf22a23..d9e58d9 100644 --- a/src/main/java/com/ycwl/basic/model/mobile/goods/GoodsDetailVO.java +++ b/src/main/java/com/ycwl/basic/model/mobile/goods/GoodsDetailVO.java @@ -43,4 +43,5 @@ public class GoodsDetailVO { private BigDecimal price; @ApiModelProperty("是否已购买 0否 1是") private Integer isBuy; + private Integer isFree; } diff --git a/src/main/java/com/ycwl/basic/model/pc/device/entity/DeviceConfigEntity.java b/src/main/java/com/ycwl/basic/model/pc/device/entity/DeviceConfigEntity.java index 3748344..743c7ab 100644 --- a/src/main/java/com/ycwl/basic/model/pc/device/entity/DeviceConfigEntity.java +++ b/src/main/java/com/ycwl/basic/model/pc/device/entity/DeviceConfigEntity.java @@ -58,4 +58,6 @@ public class DeviceConfigEntity { */ private BigDecimal cutPost; private Integer enablePreBook; + private Integer imageFree; + private Integer videoFree; } diff --git a/src/main/java/com/ycwl/basic/model/pc/source/entity/MemberSourceEntity.java b/src/main/java/com/ycwl/basic/model/pc/source/entity/MemberSourceEntity.java index af0cac5..1e232ac 100644 --- a/src/main/java/com/ycwl/basic/model/pc/source/entity/MemberSourceEntity.java +++ b/src/main/java/com/ycwl/basic/model/pc/source/entity/MemberSourceEntity.java @@ -14,4 +14,6 @@ public class MemberSourceEntity { private Long sourceId; private Integer isBuy; private Long orderId; + private Integer isFree; + private String waterUrl; } diff --git a/src/main/java/com/ycwl/basic/model/pc/source/resp/SourceRespVO.java b/src/main/java/com/ycwl/basic/model/pc/source/resp/SourceRespVO.java index c2423f0..26d1097 100644 --- a/src/main/java/com/ycwl/basic/model/pc/source/resp/SourceRespVO.java +++ b/src/main/java/com/ycwl/basic/model/pc/source/resp/SourceRespVO.java @@ -50,4 +50,5 @@ public class SourceRespVO { private Date createTime; @ApiModelProperty("是否购买:0未购买,1已购买") private Integer isBuy; + private Integer isFree; } diff --git a/src/main/java/com/ycwl/basic/service/impl/mobile/GoodsServiceImpl.java b/src/main/java/com/ycwl/basic/service/impl/mobile/GoodsServiceImpl.java index 1c9cc48..4d9e020 100644 --- a/src/main/java/com/ycwl/basic/service/impl/mobile/GoodsServiceImpl.java +++ b/src/main/java/com/ycwl/basic/service/impl/mobile/GoodsServiceImpl.java @@ -182,7 +182,7 @@ public class GoodsServiceImpl implements GoodsService { goodsDetailVO.setVideoUrl(sourceRespVO.getVideoUrl()); goodsDetailVO.setUrl(sourceRespVO.getUrl()); goodsDetailVO.setCreateTime(sourceRespVO.getCreateTime()); - + goodsDetailVO.setIsFree(sourceRespVO.getIsFree()); goodsDetailVOList.add(goodsDetailVO); i++; } diff --git a/src/main/java/com/ycwl/basic/service/task/impl/TaskFaceServiceImpl.java b/src/main/java/com/ycwl/basic/service/task/impl/TaskFaceServiceImpl.java index 74096ae..6c9e71b 100644 --- a/src/main/java/com/ycwl/basic/service/task/impl/TaskFaceServiceImpl.java +++ b/src/main/java/com/ycwl/basic/service/task/impl/TaskFaceServiceImpl.java @@ -25,6 +25,7 @@ import com.ycwl.basic.mapper.FaceSampleMapper; import com.ycwl.basic.mapper.ScenicMapper; import com.ycwl.basic.mapper.SourceMapper; import com.ycwl.basic.model.mobile.order.IsBuyRespVO; +import com.ycwl.basic.model.pc.device.entity.DeviceConfigEntity; import com.ycwl.basic.model.pc.device.entity.DeviceEntity; import com.ycwl.basic.model.pc.face.entity.FaceEntity; import com.ycwl.basic.model.pc.face.resp.FaceRespVO; @@ -137,6 +138,7 @@ public class TaskFaceServiceImpl implements TaskFaceService { if (sampleListIds != null && !sampleListIds.isEmpty()) {// 匹配原片:照片 List sourceEntities = sourceMapper.listBySampleIds(sampleListIds); List memberSourceEntityList = sourceEntities.stream().map(sourceEntity -> { + DeviceConfigEntity deviceConfig = deviceRepository.getDeviceConfig(sourceEntity.getDeviceId()); MemberSourceEntity memberSourceEntity = new MemberSourceEntity(); memberSourceEntity.setScenicId(scenicId); memberSourceEntity.setFaceId(faceEntity.getId()); @@ -151,6 +153,18 @@ public class TaskFaceServiceImpl implements TaskFaceService { } else { memberSourceEntity.setIsBuy(0); } + memberSourceEntity.setIsFree(0); + if (deviceConfig != null) { + if (sourceEntity.getType() == 1) { + if (Integer.valueOf(1).equals(deviceConfig.getVideoFree())) { + memberSourceEntity.setIsFree(1); + } + } else if (sourceEntity.getType() == 2) { + if (Integer.valueOf(1).equals(deviceConfig.getImageFree())) { + memberSourceEntity.setIsFree(1); + } + } + } return memberSourceEntity; }).collect(Collectors.toList()); if (!memberSourceEntityList.isEmpty()) { diff --git a/src/main/resources/mapper/DeviceMapper.xml b/src/main/resources/mapper/DeviceMapper.xml index fea2782..2c3333e 100644 --- a/src/main/resources/mapper/DeviceMapper.xml +++ b/src/main/resources/mapper/DeviceMapper.xml @@ -37,7 +37,9 @@ online_max_interval = #{onlineMaxInterval}, cut_pre = #{cutPre}, cut_post = #{cutPost}, - enable_pre_book = #{enablePreBook} + enable_pre_book = #{enablePreBook}, + image_free = #{imageFree}, + video_free = #{videoFree} where id = #{id} diff --git a/src/main/resources/mapper/SourceMapper.xml b/src/main/resources/mapper/SourceMapper.xml index a52f9f4..6906906 100644 --- a/src/main/resources/mapper/SourceMapper.xml +++ b/src/main/resources/mapper/SourceMapper.xml @@ -6,14 +6,14 @@ values (#{id}, #{scenicId}, #{deviceId}, #{url}, #{videoUrl}, #{type}, #{faceSampleId}, #{posJson}, #{createTime}) - replace member_source(scenic_id, face_id, member_id, source_id, is_buy, type, order_id) - values (#{scenicId}, #{faceId}, #{memberId}, #{sourceId}, #{isBuy}, #{type}, #{orderId}) + replace member_source(scenic_id, face_id, member_id, source_id, is_buy, type, order_id, is_free) + values (#{scenicId}, #{faceId}, #{memberId}, #{sourceId}, #{isBuy}, #{type}, #{orderId}, #{isFree}) - replace member_source(scenic_id, face_id, member_id, source_id, is_buy, type, order_id) + replace member_source(scenic_id, face_id, member_id, source_id, is_buy, type, order_id, is_free) values - (#{item.scenicId}, #{item.faceId}, #{item.memberId}, #{item.sourceId}, #{item.isBuy}, #{item.type}, #{item.orderId}) + (#{item.scenicId}, #{item.faceId}, #{item.memberId}, #{item.sourceId}, #{item.isBuy}, #{item.type}, #{item.orderId}, #{item.isFree}) @@ -75,7 +75,7 @@ order by so.create_time desc