调整剧场、任务、剧集模型

This commit is contained in:
kuang.yife 2024-05-09 16:29:48 +08:00
parent cb8f8007b5
commit 1c088dbdca
20 changed files with 402 additions and 234 deletions

View File

@ -4,12 +4,15 @@ import java.util.List;
import com.playlet.system.domain.PlayletItemType;
import com.playlet.system.service.IPlayletItemTypeService;
import com.playlet.system.service.ISysDictDataService;
import com.playlet.system.service.ISysDictTypeService;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
@ -42,6 +45,8 @@ public class PlayletItemController extends BaseController {
private final IPlayletItemTypeService playletItemTypeService;
private final ISysDictTypeService sysDictTypeService;
@RequiresPermissions("system:playlet:item:view")
@GetMapping()
public String item()
@ -89,6 +94,7 @@ public class PlayletItemController extends BaseController {
public String add(ModelMap modelMap)
{
List<PlayletItemType> itemTypes = playletItemTypeService.selectPlayletItemTypeList(new PlayletItemType());
modelMap.put("sourceTypes", sysDictTypeService.selectDictDataByType("playlet_source_type"));
modelMap.put("itemTypes", itemTypes);
return prefix + "/add";
}
@ -100,7 +106,7 @@ public class PlayletItemController extends BaseController {
@Log(title = "短剧基础", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(PlayletItem playletItem)
public AjaxResult addSave(@Validated PlayletItem playletItem)
{
return toAjax(playletItemService.insertPlayletItem(playletItem));
}

View File

@ -4,6 +4,7 @@ import java.util.List;
import com.github.pagehelper.PageInfo;
import com.playlet.common.core.domain.Result;
import com.playlet.system.service.IPlayletItemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
@ -36,6 +37,8 @@ public class PlayletTaskController extends BaseController {
private final IPlayletTaskService playletTaskService;
private final IPlayletItemService playletItemService;
@RequiresPermissions("playlet:task:view")
@GetMapping()
public String task() {
@ -71,7 +74,8 @@ public class PlayletTaskController extends BaseController {
* 新增任务
*/
@GetMapping("/add")
public String add() {
public String add(ModelMap modelMap) {
modelMap.put("playletItems", playletItemService.lambdaQuery().list());
return prefix + "/add";
}
@ -102,6 +106,7 @@ public class PlayletTaskController extends BaseController {
public String edit(@PathVariable("id") Long id, ModelMap mmap) {
PlayletTask playletTask = playletTaskService.selectPlayletTaskById(id);
mmap.put("playletTask", playletTask);
mmap.put("playletItems", playletItemService.lambdaQuery().list());
return prefix + "/edit";
}

View File

@ -96,11 +96,6 @@ public class PlayletTaskAppServiceImpl implements PlayletTaskAppService {
List<PlayletRevenueRecord> revenueRecordList = revenueRecordService.searchByTaskId(task.getId());
if (CollectionUtils.isNotEmpty(revenueRecordList)) {
Long totalMoney = revenueRecordList.stream().mapToLong(PlayletRevenueRecord::getPracticalEarnings).sum();
task.setBonusDividePercent(new DecimalFormat("#.0").format((totalMoney / task.getBonusDivideMoney() * 100)) + "%");
task.setBonusDividePercent(totalMoney.toString());
} else {
task.setBonusDividePercent("100%");
task.setBonusDividePercent("0");
}
}
return task;

View File

@ -49,7 +49,7 @@ public class PlayletUserItemAppServiceImpl implements PlayletUserItemAppService
model = playletUserItem;
}
// JSONObject body = new JSONObject();
return this.getPlayletUrl();
return this.getPlayletUrl(playletUserItem.getItemId());
}
@Override
@ -67,7 +67,8 @@ public class PlayletUserItemAppServiceImpl implements PlayletUserItemAppService
return PageInfo.of(list);
}
private String getPlayletUrl(){
private String getPlayletUrl(Long itemId){
PlayletItem item = iPlayletItemService.getById(itemId);
String token = "zlwaiSrEM9KEbilu5f";
String timestamp = String.valueOf((int)(System.currentTimeMillis()/1000));
String clientId = "10005693";
@ -76,7 +77,7 @@ public class PlayletUserItemAppServiceImpl implements PlayletUserItemAppService
JSONObject body = new JSONObject();
body.put("clientId", clientId);
body.put("channelId", channelId);
body.put("bookId","41000103084");
body.put("bookId",item.getItemId());
body.put("chapterIdx","1");
body.put("name","zhongcaodaren");
body.put("mediaSource","ks");

View File

@ -13,6 +13,12 @@
<input name="itemId" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">任务ID</label>
<div class="col-sm-8">
<input name="taskId" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">剧集名称:</label>
<div class="col-sm-8">
@ -20,18 +26,18 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">来源类型</label>
<label class="col-sm-3 control-label">平台</label>
<div class="col-sm-8">
<select name="sourceType" class="form-control m-b" th:with="type=${@dict.getType('playlet_source_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
<label th:each="sourceType:${sourceTypes}" class="check-box">
<input name="sourceType" type="checkbox" th:value="${sourceType.dictValue}" th:text="${sourceType.dictLabel}">
</label>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<label class="col-sm-3 control-label">集方</label>
<div class="col-sm-8">
<select id="itemType" name="itemType" class="form-control m-b" required>
<option th:each="itemType:${itemTypes}" th:value="${itemType.id}" th:text="${itemType.name}"></option>
<select name="producerType" class="form-control m-b" th:with="type=${@dict.getType('playlet_producer_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
@ -80,19 +86,15 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">剧集类型:</label>
<label class="col-sm-3 control-label is-required">剧集类型:</label>
<div class="col-sm-8">
<select name="videoType" class="form-control m-b" th:with="type=${@dict.getType('playlet_video_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
<input name="videoType" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">标签:</label>
<label class="col-sm-3 control-label is-required">标签:</label>
<div class="col-sm-8">
<select name="labelType" class="form-control m-b" th:with="type=${@dict.getType('playlet_label_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
<input name="labelType" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
@ -101,6 +103,12 @@
<input name="numberEpisode" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">收费集数:</label>
<div class="col-sm-8">
<input name="numberCost" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">上映时间:</label>
<div class="col-sm-8">
@ -111,7 +119,7 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">时间:</label>
<label class="col-sm-3 control-label is-required">线时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="upTime" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
@ -137,18 +145,21 @@
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-item-add').serialize());
var data = $("#form-item-add").serializeArray();
var sourceTypeIds = $.form.selectCheckeds("sourceType");
data.push({"name": "sourceTypeIds", "value": sourceTypeIds});
$.operate.save(prefix + "/add", data);
}
}
$("input[name='releaseTime']").datetimepicker({
format: "yyyy-mm-dd",
format: "yyyy-mm-dd hh:mm",
minView: "month",
autoclose: true
});
$("input[name='upTime']").datetimepicker({
format: "yyyy-mm-dd",
format: "yyyy-mm-dd hh:mm",
minView: "month",
autoclose: true
});

View File

@ -39,17 +39,13 @@
<div class="form-group">
<label class="col-sm-3 control-label">短剧类型:</label>
<div class="col-sm-8">
<select name="videoType" class="form-control m-b" th:with="type=${@dict.getType('playlet_video_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{videoType}"></option>
</select>
<input name="videoType" th:field="*{videoType}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">标签:</label>
<div class="col-sm-8">
<select name="labelType" class="form-control m-b" th:with="type=${@dict.getType('playlet_label_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{labelType}"></option>
</select>
<input name="labelType" th:field="*{labelType}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
@ -143,13 +139,13 @@
}
$("input[name='releaseTime']").datetimepicker({
format: "yyyy-mm-dd",
format: "yyyy-mm-dd hh:mm",
minView: "month",
autoclose: true
});
$("input[name='upTime']").datetimepicker({
format: "yyyy-mm-dd",
format: "yyyy-mm-dd hh:mm",
minView: "month",
autoclose: true
});

View File

@ -72,6 +72,10 @@
field: 'itemId',
title: '剧集ID'
},
{
field: 'taskId',
title: '任务ID'
},
{
field: 'itemTypeName',
title: '剧场'
@ -130,19 +134,11 @@
},
{
field: 'videoType',
title: '剧集类型',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(videoTypeDict, value);
}
title: '剧集类型'
},
{
field: 'labelType',
title: '剧集标签',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(labelTypeDict, value);
}
title: '剧集标签'
},
{
field: 'forUser',
@ -152,6 +148,10 @@
field: 'numberEpisode',
title: '前端剧集'
},
{
field: 'numberCost',
title: '收费集数'
},
{
field: 'isDelete',
title: '是否删除 1 正常 0 删除',

View File

@ -7,11 +7,19 @@
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-task-add">
<div class="form-group">
<label class="col-sm-3 control-label is-required">任务id 保留字段</label>
<label class="col-sm-3 control-label is-required">任务id</label>
<div class="col-sm-8">
<input name="taskId" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">短剧:</label>
<div class="col-sm-8">
<select id="itemId" name="itemId" class="form-control m-b" required>
<option th:each="playletItem:${playletItems}" th:value="${playletItem.id}" th:text="${playletItem.videoName}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">任务名称:</label>
<div class="col-sm-8">
@ -31,45 +39,57 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">任务规则</label>
<label class="col-sm-3 control-label is-required">参与人数</label>
<div class="col-sm-8">
<textarea name="rule" class="form-control" required></textarea>
<textarea name="peopleNumber" class="form-control" required></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">任务投稿开始时间</label>
<label class="col-sm-3 control-label is-required">提成比例</label>
<div class="col-sm-8">
<input id="contributeStartTime" name="contributeStartTime" class="form-control time-input" type="text">
<textarea name="commissionRate" class="form-control" required></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">任务投稿结束时间</label>
<label class="col-sm-3 control-label is-required">推荐标签</label>
<div class="col-sm-8">
<input id="contributeEndTime" name="contributeEndTime" class="form-control time-input" type="text">
<textarea name="recommendLabel" class="form-control" required></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">任务要求</label>
<label class="col-sm-3 control-label is-required">任务链接</label>
<div class="col-sm-8">
<textarea name="askFor" class="form-control" required></textarea>
<textarea name="taskUrl" class="form-control" required></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">任务总奖金,单位分 保留:</label>
<label class="col-sm-3 control-label is-required">任务网盘链接:</label>
<div class="col-sm-8">
<textarea name="taskDiskUrl" class="form-control" required></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">基础佣金:</label>
<div class="col-sm-8">
<textarea name="baseBonus" class="form-control" required></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">总佣金:</label>
<div class="col-sm-8">
<input name="totalBonus" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">任务奖励描述:</label>
<label class="col-sm-3 control-label is-required">任务状态</label>
<div class="col-sm-8">
<textarea name="awardDescribe" class="form-control" required></textarea>
<input name="state" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">任务状态 0 未开始 1 已开始 2 已结束 3 已失效 4 已完成:</label>
<label class="col-sm-3 control-label">任务介绍</label>
<div class="col-sm-8">
<input name="state" class="form-control" type="text" required>
<input name="taskContent" class="form-control" type="text">
</div>
</div>
<div class="form-group">

View File

@ -2,13 +2,14 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改任务')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-task-edit" th:object="${playletTask}">
<input name="id" th:field="*{id}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label is-required">任务id 保留字段</label>
<label class="col-sm-3 control-label is-required">任务id</label>
<div class="col-sm-8">
<input name="taskId" th:field="*{taskId}" class="form-control" type="text" required>
</div>
@ -20,68 +21,95 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">任务开始时间</label>
<label class="col-sm-3 control-label">短剧</label>
<div class="col-sm-8">
<input name="startTime" th:field="*{startTime}" class="form-control" type="text" required>
<select id="itemId" name="itemId" class="form-control m-b" required>
<option th:each="playletItem:${playletItems}" th:value="${playletItem.id}" th:text="${playletItem.videoName}" th:field="*{itemId}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">任务结束时间</label>
<label class="col-sm-3 control-label is-required">参与人数</label>
<div class="col-sm-8">
<input name="endTime" th:field="*{endTime}" class="form-control" type="text" required>
<textarea name="peopleNumber" th:field="*{peopleNumber}" class="form-control" required></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">任务规则</label>
<label class="col-sm-3 control-label is-required">提成比例</label>
<div class="col-sm-8">
<textarea name="rule" class="form-control" required>[[*{rule}]]</textarea>
<textarea name="commissionRate" th:field="*{commissionRate}" class="form-control" required></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">任务投稿开始时间</label>
<label class="col-sm-3 control-label is-required">推荐标签</label>
<div class="col-sm-8">
<input name="contributeStartTime" th:field="*{contributeStartTime}" class="form-control" type="text" required>
<textarea name="recommendLabel" th:field="*{recommendLabel}" class="form-control" required></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">任务投稿结束时间</label>
<label class="col-sm-3 control-label is-required">任务链接</label>
<div class="col-sm-8">
<input name="contributeEndTime" th:field="*{contributeEndTime}" class="form-control" type="text" required>
<textarea name="taskUrl" th:field="*{taskUrl}" class="form-control" required></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">任务要求</label>
<label class="col-sm-3 control-label is-required">任务网盘链接</label>
<div class="col-sm-8">
<textarea name="askFor" class="form-control" required>[[*{askFor}]]</textarea>
<textarea name="taskDiskUrl" th:field="*{taskDiskUrl}" class="form-control" required></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">任务总奖金,单位分 保留:</label>
<label class="col-sm-3 control-label is-required">开始时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="startTime" th:value="${#dates.format(playletTask.startTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">结束时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="endTime" th:value="${#dates.format(playletTask.endTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">基础佣金:</label>
<div class="col-sm-8">
<input name="totalBonus" th:field="*{baseBonus}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">总佣金:</label>
<div class="col-sm-8">
<input name="totalBonus" th:field="*{totalBonus}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">任务奖励描述:</label>
<div class="col-sm-8">
<textarea name="awardDescribe" class="form-control" required>[[*{awardDescribe}]]</textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">任务状态 0 未开始 1 已开始 2 已结束 3 已失效 4 已完成:</label>
<label class="col-sm-3 control-label is-required">任务状态:</label>
<div class="col-sm-8">
<input name="state" th:field="*{state}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">任务介绍:</label>
<div class="col-sm-8">
<input name="taskContent" th:field="*{taskContent}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input name="remark" th:field="*{remark}" class="form-control" type="text">
<input name="remark" th:field="*{remark}" readonly="true" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "system/playlet/task";
$("#form-task-edit").validate({
@ -93,6 +121,18 @@
$.operate.save(prefix + "/edit", $('#form-task-edit').serialize());
}
}
$("input[name='startTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='endTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

View File

@ -68,10 +68,34 @@
field: 'taskId',
title: '任务id'
},
{
field: 'itemId',
title: '短剧id'
},
{
field: 'name',
title: '任务名称'
},
{
field: 'peopleNumber',
title: '参与人数'
},
{
field: 'commissionRate',
title: '提成比例'
},
{
field: 'recommendLabel',
title: '推荐标签'
},
{
field: 'taskUrl',
title: '任务链接'
},
{
field: 'taskDiskUrl',
title: '网盘链接'
},
{
field: 'startTime',
title: '任务开始时间'
@ -85,32 +109,20 @@
title: '任务短剧平台'
},
{
field: 'rule',
title: '任务规则'
},
{
field: 'contributeStartTime',
title: '任务投稿开始时间'
},
{
field: 'contributeEndTime',
title: '任务投稿结束时间'
},
{
field: 'askFor',
title: '任务要求'
field: 'baseBonus',
title: '基础奖金'
},
{
field: 'totalBonus',
title: '任务总奖金,单位分 保留'
},
{
field: 'awardDescribe',
title: '任务奖励描述'
title: '任务总奖金'
},
{
field: 'state',
title: '任务状态 0 未开始 1 已开始 2 已结束 3 已失效 4 已完成'
title: '任务状态'
},
{
field: 'taskContent',
title: '任务介绍'
},
{
field: 'remark',

View File

@ -12,6 +12,22 @@
<input name="name" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">剧集方:</label>
<div class="col-sm-8">
<select name="producerType" class="form-control m-b" th:with="type=${@dict.getType('playlet_producer_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">平台:</label>
<div class="col-sm-8">
<select name="sourceType" class="form-control m-b" th:with="type=${@dict.getType('playlet_source_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">

View File

@ -13,6 +13,22 @@
<input name="name" th:field="*{name}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">剧集方:</label>
<div class="col-sm-8">
<select name="producerType" class="form-control m-b" th:with="type=${@dict.getType('playlet_producer_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{sourceType}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">平台:</label>
<div class="col-sm-8">
<select name="sourceType" class="form-control m-b" th:with="type=${@dict.getType('playlet_source_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{sourceType}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">

View File

@ -47,6 +47,8 @@
var editFlag = [[${@permission.hasPermi('playlet:type:edit')}]];
var removeFlag = [[${@permission.hasPermi('playlet:type:remove')}]];
var prefix = ctx + "system/playlet/type";
var producerDict = [[${@dict.getType('playlet_producer_type')}]];
var sourceDict = [[${@dict.getType('playlet_source_type')}]];
$(function() {
var options = {
@ -64,6 +66,22 @@
title: '剧场id',
visible: false
},
{
field: 'producerType',
title: '剧集方',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(producerDict, value);
}
},
{
field: 'sourceType',
title: '平台',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(sourceDict, value);
}
},
{
field: 'name',
title: '剧场名称'

View File

@ -41,6 +41,12 @@ public class PlayletItem extends BaseEntity{
@ApiModelProperty(value = "来源类型 1.抖音 2.快手 3.视频号")
private Long sourceType;
@TableField(exist = false)
private String [] sourceTypeIds;
@TableField(exist = false)
private String producerType;
/** 视频名称 */
@Excel(name = "短剧标题")
@ApiModelProperty(value = "短剧标题")
@ -84,17 +90,23 @@ public class PlayletItem extends BaseEntity{
/** 视频类型1 科幻 2 爱情 3 恐怖 4 悬疑.. */
@Excel(name = "类型1 科幻 2 爱情 3 恐怖 4 悬疑..")
@ApiModelProperty(value = "类型1 科幻 2 爱情 3 恐怖 4 悬疑..")
private Long videoType;
private String videoType;
@Excel(name = "标签")
@ApiModelProperty(value = "标签")
private Long labelType;
private String labelType;
/** 集数 */
@Excel(name = "集数")
@ApiModelProperty(value = "集数")
private Long numberEpisode;
@ApiModelProperty(value = "收费集数")
private Long numberCost;
@ApiModelProperty(value = "任务id")
private String taskId;
/** 是否删除 1 正常 0 删除 */
@Excel(name = "是否删除 1 正常 0 删除")
@ApiModelProperty(value = "是否删除 1 正常 0 删除")

View File

@ -25,6 +25,12 @@ public class PlayletItemType extends BaseEntity
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@Excel(name = "字典 playlet_producer_type")
private String producerType;
@Excel(name = "字典 playlet_source_type")
private String sourceType;
/** 剧场名称 */
@Excel(name = "剧场名称")
private String name;

View File

@ -12,6 +12,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import com.playlet.common.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
/**
@ -35,8 +36,8 @@ public class PlayletTask extends BaseEntity {
/**
* 任务id 保留字段
*/
@Excel(name = "任务id 保留字段")
@ApiModelProperty(value = "任务id 保留字段")
@Excel(name = "任务id")
@ApiModelProperty(value = "任务id")
private String taskId;
/**
@ -46,6 +47,29 @@ public class PlayletTask extends BaseEntity {
@ApiModelProperty(value = "任务名称")
private String name;
@Excel(name = "短剧ID")
@ApiModelProperty(value = "短剧ID")
private Long itemId;
@TableField(exist = false)
@ApiModelProperty(value = "短剧")
private PlayletItem playletItem;
@ApiModelProperty(value = "参与人数")
private Integer peopleNumber;
@ApiModelProperty(value = "提成比例")
private BigDecimal commissionRate;
@ApiModelProperty(value = "推荐标签")
private String recommendLabel;
@ApiModelProperty(value = "任务链接")
private String taskUrl;
@ApiModelProperty(value = "任务网盘地址")
private String taskDiskUrl;
/**
* 任务开始时间
*/
@ -67,34 +91,6 @@ public class PlayletTask extends BaseEntity {
@ApiModelProperty(value = "任务短剧平台")
private Long platformType;
/**
* 任务规则
*/
@Excel(name = "任务规则")
@ApiModelProperty(value = "任务规则")
private String rule;
/**
* 任务投稿开始时间
*/
@Excel(name = "任务投稿开始时间")
@ApiModelProperty(value = "任务投稿开始时间")
private Date contributeStartTime;
/**
* 任务投稿结束时间
*/
@Excel(name = "任务投稿结束时间")
@ApiModelProperty(value = "任务投稿结束时间")
private Date contributeEndTime;
/**
* 任务要求
*/
@Excel(name = "任务要求")
@ApiModelProperty(value = "任务要求")
private String askFor;
/**
* 任务总奖金,单位分 保留
*/
@ -106,6 +102,17 @@ public class PlayletTask extends BaseEntity {
@ApiModelProperty(value = "基础佣金,单位分")
private Long baseBonus;
/**
* 任务状态 0 未开始 1 已开始 2 已结束 3 已失效 4 已完成
*/
@Excel(name = "任务状态 0 未开始 1 已开始 2 已结束 3 已失效 4 已完成")
@ApiModelProperty(value = "任务状态 0 未开始 1 已开始 2 已结束 3 已失效 4 已完成")
private Long state;
@Excel(name = "活动介绍")
@ApiModelProperty(value = "活动介绍")
private String taskContent;
@Excel(name = "视频数")
@ApiModelProperty(value = "视频数")
private Long videoCount;
@ -122,40 +129,10 @@ public class PlayletTask extends BaseEntity {
@ApiModelProperty(value = "评论数")
private Long commentCount;
@Excel(name = "活动介绍")
@ApiModelProperty(value = "活动介绍")
private String taskContent;
@Excel(name = "活动图片")
@ApiModelProperty(value = "活动图片")
private String taskImg;
/**
* 任务奖励描述
*/
@Excel(name = "任务奖励描述")
@ApiModelProperty(value = "任务奖励描述")
private String awardDescribe;
/**
* 任务状态 0 未开始 1 已开始 2 已结束 3 已失效 4 已完成
*/
@Excel(name = "任务状态 0 未开始 1 已开始 2 已结束 3 已失效 4 已完成")
@ApiModelProperty(value = "任务状态 0 未开始 1 已开始 2 已结束 3 已失效 4 已完成")
private Long state;
@TableField(exist = false)
@Excel(name = "用户id")
@ApiModelProperty(value = "用户id")
private String userId;
@TableField(exist = false)
@Excel(name = "奖金划分 百分比 保留一位小数")
@ApiModelProperty(value = "奖金划分 百分比 保留一位小数")
private String bonusDividePercent;
@TableField(exist = false)
@Excel(name = "奖金划分 金额 单位分")
@ApiModelProperty(value = "奖金划分 金额 单位分")
private Long bonusDivideMoney;
}

View File

@ -3,10 +3,14 @@ package com.playlet.system.service.impl;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ArrayUtils;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.playlet.common.utils.DateUtils;
import com.playlet.system.domain.PlayletItemType;
import com.playlet.system.pojo.dto.PlayletItemSearchRequestDTO;
import com.playlet.system.service.IPlayletItemTypeService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -27,6 +31,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
public class PlayletItemServiceImpl extends ServiceImpl<PlayletItemMapper, PlayletItem> implements IPlayletItemService {
private final PlayletItemMapper playletItemMapper;
private final IPlayletItemTypeService playletItemTypeService;
/**
* 查询短剧基础
*
@ -57,8 +63,23 @@ public class PlayletItemServiceImpl extends ServiceImpl<PlayletItemMapper, Playl
*/
@Override
public int insertPlayletItem(PlayletItem playletItem) {
playletItem.setCreateTime(DateUtils.getNowDate());
return playletItemMapper.insertPlayletItem(playletItem);
int index = 0;
if(ArrayUtils.isNotEmpty(playletItem.getSourceTypeIds())){
for (String sourceTypeId : playletItem.getSourceTypeIds()) {
PlayletItemType itemType = playletItemTypeService.lambdaQuery()
.eq(PlayletItemType::getProducerType, playletItem.getProducerType())
.eq(PlayletItemType::getSourceType, sourceTypeId)
.one();
if(itemType != null){
playletItem.setItemType(Integer.parseInt(itemType.getId().toString()));
playletItem.setCreateTime(DateUtils.getNowDate());
playletItem.setSourceType(Long.valueOf(sourceTypeId));
playletItemMapper.insertPlayletItem(playletItem);
index = index + 1;
}
}
}
return index;
}
/**

View File

@ -7,6 +7,7 @@
<resultMap type="PlayletItem" id="PlayletItemResult">
<result property="id" column="id" />
<result property="itemId" column="item_id" />
<result property="taskId" column="task_id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
@ -25,13 +26,14 @@
<result property="specialItem" column="special_item" />
<result property="forUser" column="for_user" />
<result property="numberEpisode" column="number_episode" />
<result property="numberCost" column="number_cost" />
<result property="isDelete" column="is_delete" />
<result property="releaseTime" column="release_time" />
<result property="itemType" column="item_type" />
</resultMap>
<sql id="selectPlayletItemVo">
select id, item_id, source_type, video_name, complete_not, cover_pic, actor_name, producer, connect_site, release_time, video_type, label_type, item_type, number_episode, up_time, is_delete, special_item, for_user, remark, create_by, update_by, create_time, update_time from playlet_item
select id, item_id,task_id, number_cost, source_type, video_name, complete_not, cover_pic, actor_name, producer, connect_site, release_time, video_type, label_type, item_type, number_episode, up_time, is_delete, special_item, for_user, remark, create_by, update_by, create_time, update_time from playlet_item
</sql>
<select id="selectPlayletItemList" parameterType="PlayletItem" resultMap="PlayletItemResult">
@ -78,8 +80,10 @@
<if test="actorName!= null and actorName != ''">actor_name,</if>
<if test="videoType != null">video_type,</if>
<if test="numberEpisode != null">number_episode,</if>
<if test="numberCost != null">number_cost,</if>
<if test="isDelete != null">is_delete,</if>
<if test="itemId != null">item_id,</if>
<if test="taskId != null">task_id,</if>
<if test="releaseTime != null">release_time,</if>
<if test="itemType != null">item_type,</if>
<if test="labelType != null">label_type,</if>
@ -102,8 +106,10 @@
<if test="actorName!= null and actorName != ''">#{actorName},</if>
<if test="videoType != null">#{videoType},</if>
<if test="numberEpisode != null">#{numberEpisode},</if>
<if test="numberCost != null">#{numberCost},</if>
<if test="isDelete != null">#{isDelete},</if>
<if test="itemId != null">#{itemId},</if>
<if test="taskId != null">#{taskId},</if>
<if test="releaseTime != null">#{releaseTime},</if>
<if test="itemType != null">#{itemType},</if>
<if test="labelType != null">#{labelType},</if>
@ -128,12 +134,14 @@
<if test="connectSite != null and connectSite != ''">connect_site = #{connectSite},</if>
<if test="videoType != null">video_type = #{videoType},</if>
<if test="numberEpisode != null">number_episode = #{numberEpisode},</if>
<if test="numberCost != null">number_cost = #{numberCost},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="releaseTime != null">release_time = #{releaseTime},</if>
<if test="itemType != null ">item_type = #{itemType},</if>
<if test="producer != null and producer != ''">producer = #{producer},</if>
<if test="actorName!= null and actorName != ''">actor_name = #{actorName},</if>
<if test="itemId != null">item_id = #{itemId},</if>
<if test="taskId != null">task_id = #{taskId},</if>
<if test="labelType != null">label_type = #{labelType},</if>
<if test="forUser != null">for_user = #{forUser},</if>
<if test="upTime != null">up_time = #{upTime},</if>

View File

@ -7,6 +7,8 @@
<resultMap type="PlayletItemType" id="PlayletItemTypeResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="sourceType" column="source_type" />
<result property="producerType" column="producer_type" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
@ -16,7 +18,7 @@
</resultMap>
<sql id="selectPlayletItemTypeVo">
select id, name, status, create_by, create_time, update_by, update_time, remark from playlet_item_type
select id, name, status, source_type, producer_type, create_by, create_time, update_by, update_time, remark from playlet_item_type
</sql>
<select id="selectPlayletItemTypeList" parameterType="PlayletItemType" resultMap="PlayletItemTypeResult">
@ -36,6 +38,8 @@
insert into playlet_item_type
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if>
<if test="producerType != null">producer_type,</if>
<if test="sourceType != null">source_type,</if>
<if test="status != null">status,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
@ -45,6 +49,8 @@
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if>
<if test="producerType != null">#{producerType},</if>
<if test="sourceType != null">#{sourceType},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
@ -58,6 +64,8 @@
update playlet_item_type
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="producerType != null">producer_type = #{producerType},</if>
<if test="sourceType != null">source_type = #{sourceType},</if>
<if test="status != null">status = #{status},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>

View File

@ -11,10 +11,12 @@
<result property="startTime" column="start_time"/>
<result property="endTime" column="end_time"/>
<result property="platformType" column="platform_type"/>
<result property="rule" column="rule"/>
<result property="contributeStartTime" column="contribute_start_time"/>
<result property="contributeEndTime" column="contribute_end_time"/>
<result property="askFor" column="ask_for"/>
<result property="itemId" column="item_id"/>
<result property="peopleNumber" column="people_number"/>
<result property="commissionRate" column="commission_rate"/>
<result property="recommendLabel" column="recommend_label"/>
<result property="taskUrl" column="task_url"/>
<result property="taskDiskUrl" column="task_disk_url"/>
<result property="totalBonus" column="total_bonus"/>
<result property="videoCount" column="video_count"/>
<result property="playCount" column="play_count"/>
@ -22,8 +24,6 @@
<result property="commentCount" column="comment_count"/>
<result property="baseBonus" column="base_bonus"/>
<result property="taskContent" column="task_content"/>
<result property="taskImg" column="task_img"/>
<result property="awardDescribe" column="award_describe"/>
<result property="state" column="state"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
@ -36,23 +36,23 @@
select id,
task_id,
name,
item_id,
people_number,
commission_rate,
recommend_label,
task_url,
task_disk_url,
start_time,
end_time,
platform_type,
rule,
contribute_start_time,
contribute_end_time,
ask_for,
total_bonus,
video_count,
play_count,
star_count,
comment_count,
base_bonus,
task_content,
task_img,
award_describe,
total_bonus,
state,
task_content,
comment_count,
star_count,
play_count,
video_count,
create_time,
update_time,
create_by,
@ -66,46 +66,37 @@
<where>
<if test="taskId != null and taskId != ''">and task_id = #{taskId}</if>
<if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
<if test="startTime != null ">and start_time = #{startTime}</if>
<if test="endTime != null ">and end_time = #{endTime}</if>
<if test="platformType != null ">and platform_type = #{platformType}</if>
<if test="rule != null and rule != ''">and rule = #{rule}</if>
<if test="contributeStartTime != null ">and contribute_start_time = #{contributeStartTime}</if>
<if test="contributeEndTime != null ">and contribute_end_time = #{contributeEndTime}</if>
<if test="askFor != null and askFor != ''">and ask_for = #{askFor}</if>
<if test="totalBonus != null ">and total_bonus = #{totalBonus}</if>
<if test="awardDescribe != null and awardDescribe != ''">and award_describe = #{awardDescribe}</if>
<if test="state != null ">and state = #{state}</if>
</where>
</select>
<select id="selectPlayletTaskListByUser" parameterType="PlayletTask" resultMap="PlayletTaskResult">
select
playlet_task.`id`,
playlet_task.`task_id`,
playlet_task.`name`,
playlet_task.`start_time`,
playlet_task.`end_time`,
playlet_task.`platform_type`,
playlet_task.`rule`,
playlet_task.`contribute_start_time`,
playlet_task.`contribute_end_time`,
playlet_task.`ask_for`,
playlet_task.`total_bonus`,
playlet_task.video_count,
playlet_task.play_count,
playlet_task.star_count,
playlet_task.comment_count,
playlet_task.id,
playlet_task.task_id,
playlet_task.name,
playlet_task.item_id,
playlet_task.people_number,
playlet_task.commission_rate,
playlet_task.recommend_label,
playlet_task.task_url,
playlet_task.task_disk_url,
playlet_task.start_time,
playlet_task.end_time,
playlet_task.platform_type,
playlet_task.base_bonus,
playlet_task.total_bonus,
playlet_task.state,
playlet_task.task_content,
playlet_task.task_img,
playlet_task.`award_describe`,
playlet_task.`state`,
playlet_task.`create_time`,
playlet_task.`update_time`,
playlet_task.`create_by`,
playlet_task.`update_by`,
playlet_task.`remark`
playlet_task.comment_count,
playlet_task.star_count,
playlet_task.play_count,
playlet_task.video_count,
playlet_task.create_time,
playlet_task.update_time,
playlet_task.create_by,
playlet_task.update_by,
playlet_task.remark
from playlet_task right join playlet_user_task on playlet_task.`id` = playlet_user_task.`task_id`
<where>
playlet_user_task.`user_id` = #{userId}
@ -134,16 +125,19 @@
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="taskId != null and taskId != ''">task_id,</if>
<if test="name != null and name != ''">name,</if>
<if test="itemId != null and itemId != ''">item_id,</if>
<if test="peopleNumber != null and peopleNumber != ''">people_number,</if>
<if test="commissionRate != null and commissionRate != ''">commission_rate,</if>
<if test="recommendLabel != null and recommendLabel != ''">recommend_label,</if>
<if test="taskUrl != null and taskUrl != ''">task_url,</if>
<if test="taskDiskUrl != null and taskDiskUrl != ''">task_disk_url,</if>
<if test="startTime != null">start_time,</if>
<if test="endTime != null">end_time,</if>
<if test="platformType != null">platform_type,</if>
<if test="rule != null and rule != ''">rule,</if>
<if test="contributeStartTime != null">contribute_start_time,</if>
<if test="contributeEndTime != null">contribute_end_time,</if>
<if test="askFor != null and askFor != ''">ask_for,</if>
<if test="baseBonus != null">base_bonus,</if>
<if test="totalBonus != null">total_bonus,</if>
<if test="awardDescribe != null and awardDescribe != ''">award_describe,</if>
<if test="state != null">state,</if>
<if test="taskContent != null">task_content,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
@ -153,16 +147,19 @@
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="taskId != null and taskId != ''">#{taskId},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="itemId != null and itemId != ''">#{itemId},</if>
<if test="peopleNumber != null and peopleNumber != ''">#{peopleNumber},</if>
<if test="commissionRate != null and commissionRate != ''">#{commissionRate},</if>
<if test="recommendLabel != null and recommendLabel != ''">#{recommendLabel},</if>
<if test="taskUrl != null and taskUrl != ''">#{taskUrl},</if>
<if test="taskDiskUrl != null and taskDiskUrl != ''">#{taskDiskUrl},</if>
<if test="startTime != null">#{startTime},</if>
<if test="endTime != null">#{endTime},</if>
<if test="platformType != null">#{platformType},</if>
<if test="rule != null and rule != ''">#{rule},</if>
<if test="contributeStartTime != null">#{contributeStartTime},</if>
<if test="contributeEndTime != null">#{contributeEndTime},</if>
<if test="askFor != null and askFor != ''">#{askFor},</if>
<if test="baseBonus != null">#{baseBonus},</if>
<if test="totalBonus != null">#{totalBonus},</if>
<if test="awardDescribe != null and awardDescribe != ''">#{awardDescribe},</if>
<if test="state != null">#{state},</if>
<if test="taskContent != null">#{taskContent},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
@ -176,16 +173,19 @@
<trim prefix="SET" suffixOverrides=",">
<if test="taskId != null and taskId != ''">task_id = #{taskId},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="itemId != null and itemId != ''">item_id = #{itemId},</if>
<if test="peopleNumber != null and peopleNumber != ''">people_number = #{peopleNumber},</if>
<if test="commissionRate != null and commissionRate != ''">commission_rate = #{commissionRate},</if>
<if test="recommendLabel != null and recommendLabel != ''">recommend_label = #{recommendLabel},</if>
<if test="taskUrl != null and taskUrl != ''">task_url = #{taskUrl},</if>
<if test="taskDiskUrl != null and taskDiskUrl != ''">task_disk_url = #{taskDiskUrl},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="platformType != null">platform_type = #{platformType},</if>
<if test="rule != null and rule != ''">rule = #{rule},</if>
<if test="contributeStartTime != null">contribute_start_time = #{contributeStartTime},</if>
<if test="contributeEndTime != null">contribute_end_time = #{contributeEndTime},</if>
<if test="askFor != null and askFor != ''">ask_for = #{askFor},</if>
<if test="baseBonus != null">base_bonus = #{baseBonus},</if>
<if test="totalBonus != null">total_bonus = #{totalBonus},</if>
<if test="awardDescribe != null and awardDescribe != ''">award_describe = #{awardDescribe},</if>
<if test="state != null">state = #{state},</if>
<if test="taskContent != null">task_content = #{taskContent},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>