fix[任务管理]:景区素材相关逻辑优化
This commit is contained in:
+1
-3
@@ -246,9 +246,7 @@ public class OrderController {
|
||||
public Result<Map> getQueueInfo(@RequestParam String codeId) {
|
||||
LoginAppUser user = LoginUserContextHolder.getUser();
|
||||
QrCode qrCode = qrCodeService.getByCodeId(codeId);
|
||||
if (qrCode == null){
|
||||
Assert.isNull(qrCode,"二维码CODEID不能为空");
|
||||
}
|
||||
Assert.notNull(qrCode,"二维码CODEID不能为空");
|
||||
Order order = orderService.getOrderyStatusAndUser(OrderStatus.PAID.getId(), user.getId());
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("price",appendPriceStr(qrCode.getPrice()));
|
||||
|
||||
+33
@@ -4,8 +4,12 @@ import com.central.common.model.PageResult;
|
||||
import com.central.common.model.Result;
|
||||
import com.central.order.feign.FileCenterService;
|
||||
import com.central.order.model.QrCode;
|
||||
import com.central.order.model.QrCodeVO;
|
||||
import com.central.order.model.Tourism;
|
||||
import com.central.order.model.TourismFile;
|
||||
import com.central.order.service.IQrCodeService;
|
||||
import com.central.order.service.ITourismFileService;
|
||||
import com.central.order.service.ITourismService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
@@ -14,8 +18,11 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -38,6 +45,12 @@ public class QrCodeController {
|
||||
@Autowired
|
||||
private FileCenterService fileCenterService;
|
||||
|
||||
@Autowired
|
||||
private ITourismService tourismService;
|
||||
|
||||
@Autowired
|
||||
private ITourismFileService tourismFileService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@@ -91,6 +104,26 @@ public class QrCodeController {
|
||||
return Result.succeed(qrCode,"获取成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "根据code查询二维码信息")
|
||||
@GetMapping("/info/{codeId}")
|
||||
public Result<QrCodeVO> getQrCodeInfo(@PathVariable("codeId") String codeId) {
|
||||
QrCode qrCode = qrCodeService.getByCodeId(codeId);
|
||||
Assert.notNull(qrCode,"QRCODE不能为空");
|
||||
Tourism tourism = tourismService.getTourismById(qrCode.getTourismId());
|
||||
Assert.notNull(tourism,"TOURISM数据不能为空");
|
||||
List<TourismFile> tourismFiles = tourismFileService.getByTourismId(qrCode.getTourismId());
|
||||
if (!CollectionUtils.isEmpty(tourismFiles)) {
|
||||
for (TourismFile tourismFile: tourismFiles) {
|
||||
tourismFile.setImageUrl(fileCenterService.getViewUrlByPath(tourismFile.getImageUrl()));
|
||||
}
|
||||
}
|
||||
QrCodeVO qrCodeVO = new QrCodeVO();
|
||||
qrCodeVO.setCodeId(codeId);
|
||||
qrCodeVO.setTourism(tourism);
|
||||
qrCodeVO.setTourismFiles(tourismFiles);
|
||||
return Result.succeed(qrCodeVO,"获取成功");
|
||||
}
|
||||
|
||||
|
||||
@DeleteMapping()
|
||||
public Result delete(@RequestBody Tourism tourism) {
|
||||
|
||||
+7
-7
@@ -3,7 +3,7 @@ package com.central.order.controller;
|
||||
import com.central.common.model.PageResult;
|
||||
import com.central.common.model.Result;
|
||||
import com.central.order.feign.FileCenterService;
|
||||
import com.central.order.model.HomeCarousel;
|
||||
import com.central.order.model.TourismFile;
|
||||
import com.central.order.service.ITourismFileService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
@@ -46,9 +46,9 @@ public class TourismFileController {
|
||||
})
|
||||
@GetMapping
|
||||
public PageResult list(@RequestParam Map<String, Object> params) {
|
||||
PageResult<HomeCarousel> pageResult = tourismFileService.findList(params);
|
||||
PageResult<TourismFile> pageResult = tourismFileService.findList(params);
|
||||
if (pageResult.getCount()>0){
|
||||
for (HomeCarousel tourismFile: pageResult.getData()){
|
||||
for (TourismFile tourismFile: pageResult.getData()){
|
||||
tourismFile.setImageUrl(fileCenterService.getViewUrlByPath(tourismFile.getImageUrl()));
|
||||
}
|
||||
}
|
||||
@@ -56,14 +56,14 @@ public class TourismFileController {
|
||||
}
|
||||
|
||||
@PostMapping()
|
||||
public Result saveOrUpdate(@RequestBody HomeCarousel tourismFile) {
|
||||
public Result saveOrUpdate(@RequestBody TourismFile tourismFile) {
|
||||
return tourismFileService.saveOrUpdateTourismFile(tourismFile);
|
||||
}
|
||||
|
||||
@Operation(summary = "查询TourismFile")
|
||||
@GetMapping("/{id}")
|
||||
public Result<HomeCarousel> getTourismFile(@PathVariable("id") Long id) {
|
||||
HomeCarousel tourismFile = tourismFileService.getById(id);
|
||||
public Result<TourismFile> getTourismFile(@PathVariable("id") Long id) {
|
||||
TourismFile tourismFile = tourismFileService.getById(id);
|
||||
if (tourismFile == null) {
|
||||
return Result.failed("暂无数据");
|
||||
}
|
||||
@@ -71,7 +71,7 @@ public class TourismFileController {
|
||||
}
|
||||
|
||||
@DeleteMapping()
|
||||
public Result delete(@RequestBody HomeCarousel tourismFile) {
|
||||
public Result delete(@RequestBody TourismFile tourismFile) {
|
||||
boolean result = tourismFileService.removeById(tourismFile.getId());
|
||||
return result ? Result.succeed(tourismFile, "操作成功") : Result.failed("操作失败");
|
||||
}
|
||||
|
||||
+5
-1
@@ -10,7 +10,11 @@ import lombok.Getter;
|
||||
*/
|
||||
@Getter
|
||||
public enum HomeCarouselType implements ZltEnum {
|
||||
HOME(0,"首页"), ACTIVITY(1, "活动");
|
||||
HOME(0,"首页"),
|
||||
ACTIVITY(1, "活动"),
|
||||
SHOOTING_ANGLE(2,"拍照角度"),
|
||||
GUIDANCE(3,"引导"),
|
||||
BIG_PICTURE(4,"大图");
|
||||
|
||||
private Integer id;
|
||||
private String content;
|
||||
|
||||
+4
-4
@@ -2,7 +2,7 @@ package com.central.order.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.central.db.mapper.SuperMapper;
|
||||
import com.central.order.model.HomeCarousel;
|
||||
import com.central.order.model.TourismFile;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.Map;
|
||||
* @date 2025-2-17 17:52:54
|
||||
*/
|
||||
@Mapper
|
||||
public interface TourismFileMapper extends SuperMapper<HomeCarousel> {
|
||||
public interface TourismFileMapper extends SuperMapper<TourismFile> {
|
||||
/**
|
||||
* 分页查询用户列表
|
||||
*
|
||||
@@ -24,9 +24,9 @@ public interface TourismFileMapper extends SuperMapper<HomeCarousel> {
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<HomeCarousel> findList(Page<HomeCarousel> page, @Param("p") Map<String, Object> params);
|
||||
List<TourismFile> findList(Page<TourismFile> page, @Param("p") Map<String, Object> params);
|
||||
|
||||
// ID查询
|
||||
HomeCarousel getByTourismId(@Param("tourismId") Long tourismId);
|
||||
List<TourismFile> getByTourismId(@Param("tourismId") Long tourismId);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.central.order.model;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* qrcodes information
|
||||
*
|
||||
* @author lsl
|
||||
* @date 2024-12-19 17:51:47
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class QrCodeVO {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String codeId;
|
||||
private Tourism tourism;
|
||||
private List<TourismFile> tourismFiles;
|
||||
|
||||
}
|
||||
@@ -26,7 +26,7 @@ public class TourismFile extends SuperEntity {
|
||||
|
||||
private Long tourismId;
|
||||
private String imageUrl;
|
||||
private String contentType;
|
||||
private int type;
|
||||
private Integer status;
|
||||
|
||||
private String linkUrl;
|
||||
|
||||
+6
-5
@@ -3,8 +3,9 @@ package com.central.order.service;
|
||||
import com.central.common.model.PageResult;
|
||||
import com.central.common.model.Result;
|
||||
import com.central.common.service.ISuperService;
|
||||
import com.central.order.model.HomeCarousel;
|
||||
import com.central.order.model.TourismFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -13,13 +14,13 @@ import java.util.Map;
|
||||
* @author lsl
|
||||
* @date 2024-12-19 17:52:54
|
||||
*/
|
||||
public interface ITourismFileService extends ISuperService<HomeCarousel> {
|
||||
public interface ITourismFileService extends ISuperService<TourismFile> {
|
||||
/**
|
||||
* 列表
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
PageResult<HomeCarousel> findList(Map<String, Object> params);
|
||||
PageResult<TourismFile> findList(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
@@ -27,13 +28,13 @@ public interface ITourismFileService extends ISuperService<HomeCarousel> {
|
||||
* @param tourismFile
|
||||
* @return
|
||||
*/
|
||||
Result saveOrUpdateTourismFile(HomeCarousel tourismFile) ;
|
||||
Result saveOrUpdateTourismFile(TourismFile tourismFile) ;
|
||||
|
||||
/**
|
||||
* id查询
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
HomeCarousel getByTourismId(Long id);
|
||||
List<TourismFile> getByTourismId(Long id);
|
||||
}
|
||||
|
||||
|
||||
+8
-8
@@ -5,7 +5,7 @@ import com.central.common.model.PageResult;
|
||||
import com.central.common.model.Result;
|
||||
import com.central.common.service.impl.SuperServiceImpl;
|
||||
import com.central.order.mapper.TourismFileMapper;
|
||||
import com.central.order.model.HomeCarousel;
|
||||
import com.central.order.model.TourismFile;
|
||||
import com.central.order.service.ITourismFileService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
@@ -22,7 +22,7 @@ import java.util.Map;
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class TourismFileServiceImpl extends SuperServiceImpl<TourismFileMapper, HomeCarousel> implements ITourismFileService {
|
||||
public class TourismFileServiceImpl extends SuperServiceImpl<TourismFileMapper, TourismFile> implements ITourismFileService {
|
||||
|
||||
/**
|
||||
* 列表
|
||||
@@ -30,20 +30,20 @@ public class TourismFileServiceImpl extends SuperServiceImpl<TourismFileMapper,
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public PageResult<HomeCarousel> findList(Map<String, Object> params){
|
||||
Page<HomeCarousel> page = new Page<>(MapUtils.getInteger(params, "page"), MapUtils.getInteger(params, "limit"));
|
||||
List<HomeCarousel> list = baseMapper.findList(page, params);
|
||||
return PageResult.<HomeCarousel>builder().data(list).resp_code(0).count(page.getTotal()).build();
|
||||
public PageResult<TourismFile> findList(Map<String, Object> params){
|
||||
Page<TourismFile> page = new Page<>(MapUtils.getInteger(params, "page"), MapUtils.getInteger(params, "limit"));
|
||||
List<TourismFile> list = baseMapper.findList(page, params);
|
||||
return PageResult.<TourismFile>builder().data(list).resp_code(0).count(page.getTotal()).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result saveOrUpdateTourismFile(HomeCarousel tourismFile) {
|
||||
public Result saveOrUpdateTourismFile(TourismFile tourismFile) {
|
||||
boolean result = saveOrUpdate(tourismFile);
|
||||
return result ? Result.succeed(tourismFile, "操作成功") : Result.failed("操作失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public HomeCarousel getByTourismId(Long id) {
|
||||
public List<TourismFile> getByTourismId(Long id) {
|
||||
return baseMapper.getByTourismId(id);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
|
||||
<mapper namespace="com.central.order.mapper.TourismFileMapper">
|
||||
|
||||
<select id="findList" resultType="com.central.order.model.HomeCarousel">
|
||||
<select id="findList" resultType="com.central.order.model.TourismFile">
|
||||
select * from tourisms_files t
|
||||
</select>
|
||||
|
||||
<resultMap id="TourismFileResultMap" type="com.central.order.model.HomeCarousel">
|
||||
<resultMap id="TourismFileResultMap" type="com.central.order.model.TourismFile">
|
||||
</resultMap>
|
||||
<select id="getByTourismId" resultMap="TourismFileResultMap">
|
||||
SELECT * FROM tourisms_files WHERE tourism_id = #{tourismId}
|
||||
|
||||
@@ -9,31 +9,38 @@
|
||||
export default {
|
||||
dev: {
|
||||
'/api-uaa/': {
|
||||
target: 'http://127.0.0.1:9900',
|
||||
target: 'http://119.45.169.13:9900',
|
||||
// target: 'http://127.0.0.1:9900',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/api-user/': {
|
||||
target: 'http://127.0.0.1:9900',
|
||||
// target: 'http://127.0.0.1:9900',
|
||||
target: 'http://119.45.169.13:9900',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/api-log/': {
|
||||
target: 'http://127.0.0.1:9900',
|
||||
// target: 'http://127.0.0.1:9900',
|
||||
target: 'http://119.45.169.13:9900',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/api-search/': {
|
||||
target: 'http://127.0.0.1:9900',
|
||||
// target: 'http://127.0.0.1:9900',
|
||||
target: 'http://119.45.169.13:9900',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/api-generator/': {
|
||||
target: 'http://127.0.0.1:9900',
|
||||
// target: 'http://127.0.0.1:9900',
|
||||
target: 'http://119.45.169.13:9900',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/api-file/': {
|
||||
target: 'http://127.0.0.1:9900',
|
||||
// target: 'http://127.0.0.1:9900',
|
||||
target: 'http://119.45.169.13:9900',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/api-order/': {
|
||||
target: 'http://127.0.0.1:9900',
|
||||
// target: 'http://127.0.0.1:9900',
|
||||
target: 'http://119.45.169.13:9900',
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user