Browse Source

Merge branch 'master' into test

syh 5 years ago
parent
commit
38b42bc990

+ 0 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java

@@ -143,8 +143,6 @@ public class ShiroConfig {
 		//爬虫接口
 		filterChainDefinitionMap.put("/graphql/video", "anon");
 		filterChainDefinitionMap.put("/ks/web/test", "anon");
-		filterChainDefinitionMap.put("/ctop/materialInfo/excellent/set", "anon");
-        filterChainDefinitionMap.put("/ctop/materialInfo/excellent/list", "anon");
         filterChainDefinitionMap.put("/ureport/**", "anon");
 
 		// 添加自己的过滤器并且取名为jwt

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/config/ureport/ServletConfig.java

@@ -9,7 +9,7 @@ import org.springframework.context.annotation.ImportResource;
 import javax.servlet.Servlet;
 
 @Configuration
-//@ImportResource("classpath:ureport-console-context.xml")
+@ImportResource("classpath:ureport-console-context.xml")
 public class ServletConfig {
 
     @Bean

+ 33 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/DramaInfoController.java

@@ -1,5 +1,7 @@
 package org.jeecg.modules.ctop.controller;
 
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -12,17 +14,18 @@ import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.modules.ctop.entity.DramaInfo;
+import org.jeecg.modules.ctop.entity.DramaItemInfo;
+import org.jeecg.modules.ctop.entity.DramaRoleInfo;
 import org.jeecg.modules.ctop.service.IDramaInfoService;
+import org.jeecg.modules.ctop.service.IDramaItemInfoService;
+import org.jeecg.modules.ctop.service.IDramaRoleInfoService;
 import org.jeecg.modules.system.entity.SysCategory;
 import org.jeecg.modules.system.service.ISysCategoryService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 /**
  * 剧本信息
@@ -38,8 +41,33 @@ public class DramaInfoController {
 	@Autowired
 	private IDramaInfoService dramaInfoService;
 	@Autowired
+	private IDramaItemInfoService dramaItemInfoService;
+	@Autowired
+	private IDramaRoleInfoService dramaRoleInfoService;
+	@Autowired
 	private ISysCategoryService categoryService;
 
+	@GetMapping("/detail")
+	public Map<String, Object> getDetail(Long dramaId) {
+		Map<String, Object> result = new HashMap<>();
+		List<DramaItemInfo> itemInfos = dramaItemInfoService.getByDramaId(dramaId);
+		List<DramaRoleInfo> roleInfos = dramaRoleInfoService.getByDramaId(dramaId);
+		List<DramaRoleInfo> returnRoleInfos = new ArrayList<>();
+		DramaRoleInfo dramaRoleInfo1 = new DramaRoleInfo("情节描述", "scence");
+		returnRoleInfos.add(dramaRoleInfo1);
+		if (null != roleInfos && roleInfos.size() > 0) {
+			for (DramaRoleInfo roleInfo : roleInfos) {
+				roleInfo.setButtonType("dialogue_" + roleInfo.getId());
+				returnRoleInfos.add(roleInfo);
+			}
+		}
+		DramaRoleInfo dramaRoleInfo2 = new DramaRoleInfo("创建角色", "createRole");
+		returnRoleInfos.add(dramaRoleInfo2);
+		result.put("itemInfos", itemInfos);
+		result.put("roleInfos", returnRoleInfos);
+		ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+		return result;
+	}
 	/**
 	  * 分页列表查询
 	 * @param dramaInfo
@@ -109,7 +137,7 @@ public class DramaInfoController {
 	 */
 	@AutoLog(value = "剧本信息-编辑")
 	@ApiOperation(value="剧本信息-编辑", notes="剧本信息-编辑")
-	@PutMapping(value = "/edit")
+	@PostMapping(value = "/edit")
 	public Result<DramaInfo> edit(@RequestBody DramaInfo dramaInfo) {
 		Result<DramaInfo> result = new Result<DramaInfo>();
 		DramaInfo dramaInfoEntity = dramaInfoService.getById(dramaInfo.getId());

+ 179 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/DramaItemInfoController.java

@@ -0,0 +1,179 @@
+package org.jeecg.modules.ctop.controller;
+
+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;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.modules.ctop.entity.DramaItemInfo;
+import org.jeecg.modules.ctop.service.IDramaItemInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+
+/**
+ * 剧本内容信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-06
+ */
+@Slf4j
+@Api(tags = "剧本内容信息")
+@RestController
+@RequestMapping("/ctop/dramaItemInfo")
+public class DramaItemInfoController {
+    @Autowired
+    private IDramaItemInfoService dramaItemInfoService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param dramaItemInfo
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "剧本内容信息-分页列表查询")
+    @ApiOperation(value = "剧本内容信息-分页列表查询", notes = "剧本内容信息-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<DramaItemInfo>> queryPageList(DramaItemInfo dramaItemInfo,
+                                                      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                      @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                      HttpServletRequest req) {
+        Result<IPage<DramaItemInfo>> result = new Result<IPage<DramaItemInfo>>();
+        QueryWrapper<DramaItemInfo> queryWrapper = QueryGenerator.initQueryWrapper(dramaItemInfo, req.getParameterMap());
+        Page<DramaItemInfo> page = new Page<DramaItemInfo>(pageNo, pageSize);
+        IPage<DramaItemInfo> pageList = dramaItemInfoService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param dramaItemInfo
+     * @return
+     */
+    @AutoLog(value = "剧本内容信息-添加")
+    @ApiOperation(value = "剧本内容信息-添加", notes = "剧本内容信息-添加")
+    @PostMapping(value = "/add")
+    public Result<DramaItemInfo> add(@RequestBody DramaItemInfo dramaItemInfo) {
+        Result<DramaItemInfo> result = new Result<>();
+        try {
+            String buttonType = dramaItemInfo.getButtonType();
+            if (buttonType.startsWith("dialogue")) {
+                dramaItemInfo.setType("dialogue");
+                String[] infos = buttonType.split("_");
+                dramaItemInfo.setRoleId(Long.parseLong(infos[1]));
+            } else if (buttonType.startsWith("scence")) {
+                dramaItemInfo.setType("scence");
+            }
+            dramaItemInfoService.save(dramaItemInfo);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param dramaItemInfo
+     * @return
+     */
+    @AutoLog(value = "剧本内容信息-编辑")
+    @ApiOperation(value = "剧本内容信息-编辑", notes = "剧本内容信息-编辑")
+    @PostMapping(value = "/edit")
+    public Result<DramaItemInfo> edit(@RequestBody DramaItemInfo dramaItemInfo) {
+        Result<DramaItemInfo> result = new Result<>();
+        DramaItemInfo dramaItemInfoEntity = dramaItemInfoService.getById(dramaItemInfo.getId());
+        if (dramaItemInfoEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            String buttonType = dramaItemInfo.getButtonType();
+            if (buttonType.startsWith("dialogue")) {
+                dramaItemInfo.setType("dialogue");
+                String[] infos = buttonType.split("_");
+                dramaItemInfo.setRoleId(Long.parseLong(infos[1]));
+            } else if (buttonType.startsWith("scence")) {
+                dramaItemInfo.setType("scence");
+            }
+            boolean ok = dramaItemInfoService.updateById(dramaItemInfo);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @return
+     */
+    @AutoLog(value = "剧本内容信息-通过id删除")
+    @ApiOperation(value = "剧本内容信息-通过id删除", notes = "剧本内容信息-通过id删除")
+    @PostMapping(value = "/delete")
+    public Result<?> delete(@RequestBody DramaItemInfo dramaItemInfo) {
+        try {
+            dramaItemInfoService.removeById(dramaItemInfo.getId());
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "剧本内容信息-批量删除")
+    @ApiOperation(value = "剧本内容信息-批量删除", notes = "剧本内容信息-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<DramaItemInfo> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<DramaItemInfo> result = new Result<DramaItemInfo>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.dramaItemInfoService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "剧本内容信息-通过id查询")
+    @ApiOperation(value = "剧本内容信息-通过id查询", notes = "剧本内容信息-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<DramaItemInfo> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<DramaItemInfo> result = new Result<DramaItemInfo>();
+        DramaItemInfo dramaItemInfo = dramaItemInfoService.getById(id);
+        if (dramaItemInfo == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(dramaItemInfo);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+}

+ 0 - 84
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/DramaRoleInfoController.java

@@ -1,6 +1,5 @@
 package org.jeecg.modules.ctop.controller;
 
-import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -10,28 +9,13 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.ctop.entity.DramaRoleInfo;
 import org.jeecg.modules.ctop.service.IDramaRoleInfoService;
-import org.jeecgframework.poi.excel.ExcelImportUtil;
-import org.jeecgframework.poi.excel.def.NormalExcelConstants;
-import org.jeecgframework.poi.excel.entity.ExportParams;
-import org.jeecgframework.poi.excel.entity.ImportParams;
-import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-import org.springframework.web.multipart.MultipartHttpServletRequest;
-import org.springframework.web.servlet.ModelAndView;
 
 import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
 import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
 
 /**
  * 剧本角色信息
@@ -177,72 +161,4 @@ public class DramaRoleInfoController {
         }
         return result;
     }
-
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<DramaRoleInfo> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                DramaRoleInfo dramaRoleInfo = JSON.parseObject(deString, DramaRoleInfo.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(dramaRoleInfo, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<DramaRoleInfo> pageList = dramaRoleInfoService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "剧本角色信息列表");
-        mv.addObject(NormalExcelConstants.CLASS, DramaRoleInfo.class);
-        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("剧本角色信息列表数据", "导出人:Jeecg", "导出信息"));
-        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
-        return mv;
-    }
-
-    /**
-     * 通过excel导入数据
-     *
-     * @param request
-     * @param response
-     * @return
-     */
-    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
-    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
-        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
-        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
-        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
-            MultipartFile file = entity.getValue();
-            ImportParams params = new ImportParams();
-            params.setTitleRows(2);
-            params.setHeadRows(1);
-            params.setNeedSave(true);
-            try {
-                List<DramaRoleInfo> listDramaRoleInfos = ExcelImportUtil.importExcel(file.getInputStream(), DramaRoleInfo.class, params);
-                dramaRoleInfoService.saveBatch(listDramaRoleInfos);
-                return Result.ok("文件导入成功!数据行数:" + listDramaRoleInfos.size());
-            } catch (Exception e) {
-                log.error(e.getMessage(), e);
-                return Result.error("文件导入失败:" + e.getMessage());
-            } finally {
-                try {
-                    file.getInputStream().close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-        return Result.ok("文件导入失败!");
-    }
-
 }

+ 89 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/DramaItemInfo.java

@@ -0,0 +1,89 @@
+package org.jeecg.modules.ctop.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 剧本内容信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-06
+ */
+@Data
+@TableName("ctop_drama_item_info")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_drama_item_info对象", description = "剧本内容信息")
+public class DramaItemInfo {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 元素类型1:描述 2:对话
+     */
+    @Excel(name = "元素类型1:描述 2:对话", width = 15)
+    @ApiModelProperty(value = "元素类型1:描述 2:对话")
+    private String type;
+    /**
+     * 剧本id
+     */
+    @Excel(name = "剧本id", width = 15)
+    @ApiModelProperty(value = "剧本id")
+    private Long dramaId;
+    /**
+     * roleId
+     */
+    @Excel(name = "roleId", width = 15)
+    @ApiModelProperty(value = "roleId")
+    private Long roleId;
+    /**
+     * content
+     */
+    @Excel(name = "content", width = 15)
+    @ApiModelProperty(value = "content")
+    private String content;
+    /**
+     * 排序号
+     */
+    @Excel(name = "排序号", width = 15)
+    @ApiModelProperty(value = "排序号")
+    private Integer rank;
+    /**
+     * enabled
+     */
+    @Excel(name = "enabled", width = 15)
+    @ApiModelProperty(value = "enabled")
+    private Integer enabled;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+
+    @TableField(exist = false)
+    private String roleName;
+
+    @TableField(exist = false)
+    private String buttonType;
+
+}

+ 12 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/DramaRoleInfo.java

@@ -1,6 +1,7 @@
 package org.jeecg.modules.ctop.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import io.swagger.annotations.ApiModel;
@@ -62,4 +63,15 @@ public class DramaRoleInfo {
      */
     @ApiModelProperty(value = "updateTime")
     private Date updateTime;
+
+    @TableField(exist = false)
+    private String buttonType;
+
+    public DramaRoleInfo(String name, String buttonType) {
+        this.name = name;
+        this.buttonType = buttonType;
+    }
+
+    public DramaRoleInfo() {
+    }
 }

+ 15 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/DramaItemInfoMapper.java

@@ -0,0 +1,15 @@
+package org.jeecg.modules.ctop.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.ctop.entity.DramaItemInfo;
+
+/**
+ * 剧本内容信息
+ *
+ * @author: jeecg-boot
+ * @date: 2020-03-06
+ * @cersion: V1.0
+ */
+public interface DramaItemInfoMapper extends BaseMapper<DramaItemInfo> {
+
+}

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/DramaItemInfoMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.ctop.mapper.DramaItemInfoMapper">
+
+</mapper>

+ 18 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IDramaItemInfoService.java

@@ -0,0 +1,18 @@
+package org.jeecg.modules.ctop.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.ctop.entity.DramaItemInfo;
+
+import java.util.List;
+
+/**
+ * 剧本内容信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-06
+ */
+public interface IDramaItemInfoService extends IService<DramaItemInfo> {
+
+    List<DramaItemInfo> getByDramaId(Long dramaId);
+}

+ 3 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IDramaRoleInfoService.java

@@ -3,6 +3,8 @@ package org.jeecg.modules.ctop.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.modules.ctop.entity.DramaRoleInfo;
 
+import java.util.List;
+
 /**
  * 剧本角色信息
  *
@@ -12,4 +14,5 @@ import org.jeecg.modules.ctop.entity.DramaRoleInfo;
  */
 public interface IDramaRoleInfoService extends IService<DramaRoleInfo> {
 
+    List<DramaRoleInfo> getByDramaId(Long dramaId);
 }

+ 46 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/DramaItemInfoServiceImpl.java

@@ -0,0 +1,46 @@
+package org.jeecg.modules.ctop.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.modules.ctop.entity.DramaItemInfo;
+import org.jeecg.modules.ctop.entity.DramaRoleInfo;
+import org.jeecg.modules.ctop.mapper.DramaItemInfoMapper;
+import org.jeecg.modules.ctop.service.IDramaItemInfoService;
+import org.jeecg.modules.ctop.service.IDramaRoleInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 剧本内容信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-06
+ */
+@Service
+public class DramaItemInfoServiceImpl extends ServiceImpl<DramaItemInfoMapper, DramaItemInfo> implements IDramaItemInfoService {
+
+    @Autowired
+    private IDramaRoleInfoService roleInfoService;
+
+    @Override
+    public List<DramaItemInfo> getByDramaId(Long dramaId) {
+        QueryWrapper<DramaItemInfo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("drama_id", dramaId).eq("enabled", 1).orderByAsc("rank");
+        List<DramaItemInfo> infos = this.list(queryWrapper);
+        List<DramaItemInfo> returnInfos = new ArrayList<>();
+        if (null != infos && infos.size() > 0) {
+            for (DramaItemInfo itemInfo : infos) {
+                if (null != itemInfo.getRoleId()) {
+                    DramaRoleInfo roleInfo = roleInfoService.getById(itemInfo.getRoleId());
+                    itemInfo.setRoleName(roleInfo.getName());
+                }
+                returnInfos.add(itemInfo);
+            }
+        }
+        return returnInfos;
+    }
+}

+ 9 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/DramaRoleInfoServiceImpl.java

@@ -1,11 +1,14 @@
 package org.jeecg.modules.ctop.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.jeecg.modules.ctop.entity.DramaRoleInfo;
 import org.jeecg.modules.ctop.mapper.DramaRoleInfoMapper;
 import org.jeecg.modules.ctop.service.IDramaRoleInfoService;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * 剧本角色信息
  *
@@ -16,4 +19,10 @@ import org.springframework.stereotype.Service;
 @Service
 public class DramaRoleInfoServiceImpl extends ServiceImpl<DramaRoleInfoMapper, DramaRoleInfo> implements IDramaRoleInfoService {
 
+    @Override
+    public List<DramaRoleInfo> getByDramaId(Long dramaId) {
+        QueryWrapper<DramaRoleInfo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("drama_id", dramaId);
+        return this.list(queryWrapper);
+    }
 }