提交 5e9045ca 作者: zgz

区分正式、测试数据

上级 1d4513ba
...@@ -160,10 +160,11 @@ public class SubjectManageController { ...@@ -160,10 +160,11 @@ public class SubjectManageController {
@GetMapping("/visiblePageList") @GetMapping("/visiblePageList")
public Result<?> visiblePageList(@RequestParam Integer type, public Result<?> visiblePageList(@RequestParam Integer type,
@RequestParam(required = false) String subjectName, @RequestParam(required = false) String subjectName,
@RequestParam(required = false) String environment,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
UserVo loginUser = UserUtil.getLoginUser(); UserVo loginUser = UserUtil.getLoginUser();
Page<Node> pageList = subjectService.visiblePageList(loginUser.getUsername(), type, subjectName, pageNo, pageSize); Page<Node> pageList = subjectService.visiblePageList(loginUser.getUsername(), type, subjectName, pageNo, pageSize,environment);
return Result.OK(pageList); return Result.OK(pageList);
} }
......
...@@ -109,10 +109,7 @@ public class SubjectSimpleController { ...@@ -109,10 +109,7 @@ public class SubjectSimpleController {
/** /**
* 专题详情(无验证版本) * 专题详情(无验证版本)
*
* @param subjectId 专题id * @param subjectId 专题id
* @author lkg
* @date 2025/1/9
*/ */
@GetMapping("/queryInfoNoSign") @GetMapping("/queryInfoNoSign")
public Result<?> queryInfoNoSign(@RequestParam String subjectId){ public Result<?> queryInfoNoSign(@RequestParam String subjectId){
......
...@@ -136,12 +136,13 @@ public class SubjectTypeController { ...@@ -136,12 +136,13 @@ public class SubjectTypeController {
* @date 2025/1/7 * @date 2025/1/7
*/ */
@GetMapping("/subjectAndTypeTree") @GetMapping("/subjectAndTypeTree")
public Result<?> subjectAndTypeTree(@RequestParam(required = false) Integer facePublic) { public Result<?> subjectAndTypeTree(@RequestParam(required = false) Integer facePublic,
@RequestParam(required = false) String environment) {
List<SubjectTreeVO> dataList = null; List<SubjectTreeVO> dataList = null;
if (facePublic == null) { if (facePublic == null) {
dataList = subjectTypeService.subjectAndTypeTree(); dataList = subjectTypeService.subjectAndTypeTree(environment);
} else if (facePublic == 1) { } else if (facePublic == 1) {
dataList = subjectTypeService.subjectsByFacePublic(facePublic); dataList = subjectTypeService.subjectsByFacePublic(facePublic,environment);
} }
return Result.OK(dataList); return Result.OK(dataList);
} }
......
...@@ -77,5 +77,7 @@ public class SubjectType implements Serializable { ...@@ -77,5 +77,7 @@ public class SubjectType implements Serializable {
* 状态(1启用 0不启用) * 状态(1启用 0不启用)
*/ */
private Integer status; private Integer status;
/** 环境 1-测试 2-正式 */
private String environment;
} }
...@@ -61,7 +61,7 @@ public interface SubjectMapper extends BaseMapper<Subject> { ...@@ -61,7 +61,7 @@ public interface SubjectMapper extends BaseMapper<Subject> {
* @author lkg * @author lkg
* @date 2025/2/8 * @date 2025/2/8
*/ */
Page<Node> visibleList(@Param("username") String username, @Param("type") Integer type, @Param("subjectName") String subjectName, Page<String> page); Page<Node> visibleList(@Param("username") String username, @Param("type") Integer type, @Param("subjectName") String subjectName, Page<String> page,@Param("environment") String environment);
/** /**
* 获取专题详情(包含样例文章信息) * 获取专题详情(包含样例文章信息)
......
...@@ -78,7 +78,7 @@ public interface SubjectTypeMapper extends BaseMapper<SubjectType> { ...@@ -78,7 +78,7 @@ public interface SubjectTypeMapper extends BaseMapper<SubjectType> {
* @author lkg * @author lkg
* @date 2025/1/7 * @date 2025/1/7
*/ */
List<SubjectTreeVO> subjectsByFacePublic(@Param("facePublic") Integer facePublic); List<SubjectTreeVO> subjectsByFacePublic(@Param("facePublic") Integer facePublic,@Param("environment") String environment);
/** /**
* 可用的事件和分类列表 * 可用的事件和分类列表
...@@ -86,7 +86,7 @@ public interface SubjectTypeMapper extends BaseMapper<SubjectType> { ...@@ -86,7 +86,7 @@ public interface SubjectTypeMapper extends BaseMapper<SubjectType> {
* @author lkg * @author lkg
* @date 2024/4/29 * @date 2024/4/29
*/ */
List<SubjectTreeVO> subjectAndTypeTree(@Param("username") String createBy); List<SubjectTreeVO> subjectAndTypeTree(@Param("username") String createBy,@Param("environment") String environment);
/** /**
* 获取分类下的专题列表 * 获取分类下的专题列表
......
...@@ -133,6 +133,9 @@ ...@@ -133,6 +133,9 @@
LEFT JOIN subject_type_map b ON b.subject_id = d.id LEFT JOIN subject_type_map b ON b.subject_id = d.id
LEFT JOIN subject_type c ON b.type_id = c.id LEFT JOIN subject_type c ON b.type_id = c.id
where d.face_public = 1 where d.face_public = 1
<if test="subjectCondition.environment !=null and subjectCondition.environment !=''">
and d.environment =#{subjectCondition.environment}
</if>
<if test="subjectCondition.id !=null and subjectCondition.id !=''"> <if test="subjectCondition.id !=null and subjectCondition.id !=''">
and d.id =#{subjectCondition.id} and d.id =#{subjectCondition.id}
</if> </if>
...@@ -198,6 +201,9 @@ ...@@ -198,6 +201,9 @@
<if test="subjectName != null and subjectName != ''"> <if test="subjectName != null and subjectName != ''">
and subject_name like concat('%',#{subjectName},'%') and subject_name like concat('%',#{subjectName},'%')
</if> </if>
<if test="environment != null and environment != ''">
and environment = #{environment}
</if>
<choose> <choose>
<when test="type == 1"> <when test="type == 1">
and create_by = #{username} and create_by = #{username}
......
...@@ -53,6 +53,9 @@ ...@@ -53,6 +53,9 @@
s.time_disable as end_time s.time_disable as end_time
from subject s from subject s
where s.face_public = #{facePublic} where s.face_public = #{facePublic}
<if test="environment!=null and environment != ''">
and s.environment = #{environment}
</if>
order by create_time order by create_time
</select> </select>
...@@ -73,6 +76,9 @@ ...@@ -73,6 +76,9 @@
<if test="username!=null and username != ''"> <if test="username!=null and username != ''">
and s.create_by = #{username} and s.create_by = #{username}
</if> </if>
<if test="environment!=null and environment != ''">
and s.environment = #{environment}
</if>
union union
select n.id, n.name, m.id as pid, 'true' as ynSubject, n.start_time, n.end_time, n.create_time select n.id, n.name, m.id as pid, 'true' as ynSubject, n.start_time, n.end_time, n.create_time
from ( from (
......
...@@ -79,7 +79,7 @@ public interface ISubjectTypeService extends IService<SubjectType> { ...@@ -79,7 +79,7 @@ public interface ISubjectTypeService extends IService<SubjectType> {
* @author lkg * @author lkg
* @date 2025/1/7 * @date 2025/1/7
*/ */
List<SubjectTreeVO> subjectsByFacePublic(Integer facePublic); List<SubjectTreeVO> subjectsByFacePublic(Integer facePublic,String environment);
/** /**
* 专题和分类列表-研究中心 * 专题和分类列表-研究中心
...@@ -87,7 +87,7 @@ public interface ISubjectTypeService extends IService<SubjectType> { ...@@ -87,7 +87,7 @@ public interface ISubjectTypeService extends IService<SubjectType> {
* @author lkg * @author lkg
* @date 2024/12/26 * @date 2024/12/26
*/ */
List<SubjectTreeVO> subjectAndTypeTree(); List<SubjectTreeVO> subjectAndTypeTree(String environment);
/** /**
* 获取分类下的所有节点id集合-研究中心 * 获取分类下的所有节点id集合-研究中心
......
...@@ -50,7 +50,7 @@ public interface SubjectService extends IService<Subject> { ...@@ -50,7 +50,7 @@ public interface SubjectService extends IService<Subject> {
* @author lkg * @author lkg
* @date 2025/2/8 * @date 2025/2/8
*/ */
Page<Node> visiblePageList(String username, Integer type, String subjectName, Integer pageNo, Integer pageSize); Page<Node> visiblePageList(String username, Integer type, String subjectName, Integer pageNo, Integer pageSize,String environment);
/** /**
* 获取专题详情(包含样例文章信息) * 获取专题详情(包含样例文章信息)
......
...@@ -180,9 +180,9 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl ...@@ -180,9 +180,9 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
} }
@Override @Override
public Page<Node> visiblePageList(String username, Integer type, String subjectName, Integer pageNo, Integer pageSize) { public Page<Node> visiblePageList(String username, Integer type, String subjectName, Integer pageNo, Integer pageSize,String environment) {
Page<String> page = new Page<>(pageNo, pageSize); Page<String> page = new Page<>(pageNo, pageSize);
return baseMapper.visibleList(username, type, subjectName, page); return baseMapper.visibleList(username, type, subjectName, page,environment);
} }
@Override @Override
......
...@@ -95,15 +95,15 @@ public class SubjectTypeServiceImpl extends ServiceImpl<SubjectTypeMapper, Subje ...@@ -95,15 +95,15 @@ public class SubjectTypeServiceImpl extends ServiceImpl<SubjectTypeMapper, Subje
} }
@Override @Override
public List<SubjectTreeVO> subjectsByFacePublic(Integer facePublic) { public List<SubjectTreeVO> subjectsByFacePublic(Integer facePublic,String environment) {
return baseMapper.subjectsByFacePublic(facePublic); return baseMapper.subjectsByFacePublic(facePublic,environment);
} }
@Override @Override
public List<SubjectTreeVO> subjectAndTypeTree() { public List<SubjectTreeVO> subjectAndTypeTree(String environment) {
String username = UserUtil.getLoginUser().getUsername(); String username = UserUtil.getLoginUser().getUsername();
List<SubjectTreeVO> tree = new ArrayList<>(); List<SubjectTreeVO> tree = new ArrayList<>();
List<SubjectTreeVO> subjectTreeVOS = baseMapper.subjectAndTypeTree(username); List<SubjectTreeVO> subjectTreeVOS = baseMapper.subjectAndTypeTree(username,environment);
if (CollectionUtils.isNotEmpty(subjectTreeVOS)) { if (CollectionUtils.isNotEmpty(subjectTreeVOS)) {
tree = TreeUtil.tree(subjectTreeVOS, "0"); tree = TreeUtil.tree(subjectTreeVOS, "0");
} }
......
...@@ -36,4 +36,6 @@ public class SubjectCondition { ...@@ -36,4 +36,6 @@ public class SubjectCondition {
private String userId; private String userId;
private String customerId; private String customerId;
/** 环境 1-测试 2-正式 */
private String environment;
} }
...@@ -159,7 +159,8 @@ python: ...@@ -159,7 +159,8 @@ python:
clearDuplicateHistoryUrl: http://1.95.13.40:8080/subject/delete_history_data clearDuplicateHistoryUrl: http://1.95.13.40:8080/subject/delete_history_data
jeecg: jeecg:
shiro: shiro:
excludeUrls: excludeUrls: /info/subjectPageListGroupByLabel,/subject/simple/queryInfoNoSign
kafka: kafka:
topic: topic:
subject: subject:
......
...@@ -161,7 +161,7 @@ python: ...@@ -161,7 +161,7 @@ python:
clearDuplicateHistoryUrl: http://1.95.13.40:8080/subject/delete_history_data clearDuplicateHistoryUrl: http://1.95.13.40:8080/subject/delete_history_data
jeecg: jeecg:
shiro: shiro:
excludeUrls: /info/subjectPageList excludeUrls: info/subjectPageListGroupByLabel,/subject/simple/queryInfoNoSign
kafka: kafka:
topic: topic:
subject: subject:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论