记得上下班打卡 | git大法好,push需谨慎

Commit c1f03a35 authored by jiangxiulong's avatar jiangxiulong

快递模版 前端 模版和接口不支持api

parent e3037323
...@@ -10,12 +10,12 @@ import com.liquidnet.client.admin.common.enums.BusinessType; ...@@ -10,12 +10,12 @@ import com.liquidnet.client.admin.common.enums.BusinessType;
import com.liquidnet.client.admin.zhengzai.kylin.service.IKylinExpressModuleService; import com.liquidnet.client.admin.zhengzai.kylin.service.IKylinExpressModuleService;
import com.liquidnet.service.kylin.dto.param.admin.ExpressModuleFromParam; import com.liquidnet.service.kylin.dto.param.admin.ExpressModuleFromParam;
import com.liquidnet.service.kylin.entity.KylinExpressModule; import com.liquidnet.service.kylin.entity.KylinExpressModule;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; 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.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -33,9 +33,8 @@ import javax.validation.constraints.NotNull; ...@@ -33,9 +33,8 @@ import javax.validation.constraints.NotNull;
* @author jiangxiulong * @author jiangxiulong
* @since 2021-11-15 * @since 2021-11-15
*/ */
@Api(tags = "快递模板管理")
@Validated @Validated
@RestController @Controller
@RequestMapping("/kylin/expressModule") @RequestMapping("/kylin/expressModule")
public class KylinExpressModuleController extends BaseController { public class KylinExpressModuleController extends BaseController {
private String prefix = "zhengzai/kylin/expressModule"; private String prefix = "zhengzai/kylin/expressModule";
...@@ -46,9 +45,8 @@ public class KylinExpressModuleController extends BaseController { ...@@ -46,9 +45,8 @@ public class KylinExpressModuleController extends BaseController {
@Log(title = "快递模版创建", businessType = BusinessType.INSERT) @Log(title = "快递模版创建", businessType = BusinessType.INSERT)
@RequiresPermissions("kylin:expressModule:create") @RequiresPermissions("kylin:expressModule:create")
@PostMapping("create") @PostMapping("create")
@ApiOperation(value = "快递模版创建")
@ResponseBody @ResponseBody
public AjaxResult create(@Valid @RequestBody ExpressModuleFromParam param) { public AjaxResult create(ExpressModuleFromParam param) {
Integer result = expressModuleService.createForm(param); Integer result = expressModuleService.createForm(param);
if (result > 0) { if (result > 0) {
return success("操作成功"); return success("操作成功");
...@@ -59,10 +57,9 @@ public class KylinExpressModuleController extends BaseController { ...@@ -59,10 +57,9 @@ public class KylinExpressModuleController extends BaseController {
@Log(title = "快递模版编辑", businessType = BusinessType.UPDATE) @Log(title = "快递模版编辑", businessType = BusinessType.UPDATE)
@RequiresPermissions("kylin:expressModule:update") @RequiresPermissions("kylin:expressModule:update")
@PutMapping("update") @PostMapping("update")
@ApiOperation(value = "快递模版编辑")
@ResponseBody @ResponseBody
public AjaxResult update(@Valid @RequestBody ExpressModuleFromParam param) { public AjaxResult update(ExpressModuleFromParam param) {
Integer result = expressModuleService.updateForm(param); Integer result = expressModuleService.updateForm(param);
if (result > 0) { if (result > 0) {
return success("操作成功"); return success("操作成功");
...@@ -73,7 +70,6 @@ public class KylinExpressModuleController extends BaseController { ...@@ -73,7 +70,6 @@ public class KylinExpressModuleController extends BaseController {
@Log(title = "快递模版上下线", businessType = BusinessType.UPDATE) @Log(title = "快递模版上下线", businessType = BusinessType.UPDATE)
@RequiresPermissions("kylin:expressModule:isOnline") @RequiresPermissions("kylin:expressModule:isOnline")
@ApiOperation(value = "快递模版上下线")
@PutMapping("isOnline") @PutMapping("isOnline")
@ResponseBody @ResponseBody
@ApiImplicitParams({ @ApiImplicitParams({
...@@ -94,7 +90,6 @@ public class KylinExpressModuleController extends BaseController { ...@@ -94,7 +90,6 @@ public class KylinExpressModuleController extends BaseController {
@Log(title = "快递模版详情", businessType = BusinessType.DETAIL) @Log(title = "快递模版详情", businessType = BusinessType.DETAIL)
@GetMapping("details") @GetMapping("details")
@ApiOperation(value = "快递模版详情")
@ResponseBody @ResponseBody
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", required = true, dataType = "String", name = "moduleId", value = "快递模版id"), @ApiImplicitParam(type = "query", required = true, dataType = "String", name = "moduleId", value = "快递模版id"),
...@@ -106,7 +101,6 @@ public class KylinExpressModuleController extends BaseController { ...@@ -106,7 +101,6 @@ public class KylinExpressModuleController extends BaseController {
@Log(title = "快递模版列表数据", businessType = BusinessType.LIST) @Log(title = "快递模版列表数据", businessType = BusinessType.LIST)
@RequiresPermissions("kylin:expressModule:list") @RequiresPermissions("kylin:expressModule:list")
@ApiOperation(value = "快递模版列表数据")
@PostMapping("list") @PostMapping("list")
@ResponseBody @ResponseBody
public TableDataInfo list() { public TableDataInfo list() {
...@@ -114,15 +108,20 @@ public class KylinExpressModuleController extends BaseController { ...@@ -114,15 +108,20 @@ public class KylinExpressModuleController extends BaseController {
return getDataTable(result.getList()); return getDataTable(result.getList());
} }
@GetMapping("listView") @GetMapping()
@ApiOperation(value = "快递模版列表view")
public String listView() { public String listView() {
return prefix + "/list"; return prefix + "/listView";
} }
@GetMapping("formView") @GetMapping("/create")
@ApiOperation(value = "快递模版添加编辑view") public String createView() {
public String formView() { return prefix + "/create";
return prefix + "/form"; }
@GetMapping("/update/{moduleId}")
public String updateView(@PathVariable("moduleId") String moduleId, ModelMap mmap) {
KylinExpressModule result = expressModuleService.detail(moduleId);
mmap.put("KylinExpressModule", result);
return prefix + "/update";
} }
} }
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('添加快递模版')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-post-add">
<div class="form-group">
<label class="col-sm-2 control-label is-required">快件产品名称:</label>
<div class="col-sm-10">
<input class="form-control" type="text" name="title" id="title" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">产品编码:</label>
<div class="col-sm-10">
<input class="form-control" type="number" name="productCode" id="productCode">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label is-required">时效类型:</label>
<div class="col-sm-10">
<input class="form-control" type="text" name="agingType" id="agingType" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">快递预估价格小:</label>
<div class="col-sm-10">
<input class="form-control" type="number" name="estimatePriceMin" id="estimatePriceMin">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">快递预估价格大:</label>
<div class="col-sm-10">
<input class="form-control" type="number" name="estimatePriceMax" id="estimatePriceMax">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">是否上线</label>
<div class="col-sm-10">
<div class="radio check-box">
<label>
<input type="radio" value="1" name="isOnline" checked=""> <i></i> 未上线
</label>
</div>
<div class="radio check-box">
<label>
<input type="radio" value="2" name="isOnline"> <i></i> 已上线
</label>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer"/>
<script type="text/javascript">
var prefix = ctx + "kylin/expressModule";
function submitHandler() {
if ($.validate.form()) {
var data = $('#form-post-add').serializeArray();
$.operate.save(prefix + "/create", data);
}
}
</script>
</body>
</html>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head> <head>
<th:block th:include="include :: header('积分活动列表')"/> <th:block th:include="include :: header('快递模版列表')"/>
</head> </head>
<body class="gray-bg"> <body class="gray-bg">
<div class="container-div"> <div class="container-div">
<div class="row"> <div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>活动名称:</label>
<input type="text" name="activityTitle"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group"> <div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.addTab(1)" shiro:hasPermission="sweet:integralActivity:create"> <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="kylin:expressModule:create">
<i class="fa fa-plus"></i> 添加 <i class="fa fa-plus"></i> 添加
</a> </a>
</div> </div>
...@@ -37,73 +18,42 @@ ...@@ -37,73 +18,42 @@
</div> </div>
<th:block th:include="include :: footer"/> <th:block th:include="include :: footer"/>
<script th:inline="javascript"> <script th:inline="javascript">
var updateFlag = [[${@permission.hasPermi('sweet:integralActivity:create')}]]; var updateFlag = [[${@permission.hasPermi('kylin:expressModule:create')}]];
var isOnlineFlag = [[${@permission.hasPermi('sweet:integralActivity:isOnline')}]]; var isOnlineFlag = [[${@permission.hasPermi('kylin:expressModule:isOnline')}]];
var drawListFlag = [[${@permission.hasPermi('sweet:integralActivityDraw:list')}]];
var exportExcelFlag = [[${@permission.hasPermi('sweet:integralActivityDraw:export')}]];
var prefix = ctx + "sweet/integralActivity"; var prefix = ctx + "kylin/expressModule";
function exportExcel(integralActivityId) {
var data = {"ids": integralActivityId};
$.table.exportExcel("", data)
}
$(function () { $(function () {
var options = { var options = {
url: prefix + "/list", url: prefix + "/list",
updateUrl: prefix + "/formView?id={id}", // /update/{id} updateUrl: prefix + "/update/{id}",
createUrl: prefix + "/formView", createUrl: prefix + "/create",
detailUrl: "/sweet/IntegralActivityDraw/listView/{id}", modalName: "快递模版",
exportUrl: "/sweet/IntegralActivityDraw/export",
modalName: "积分活动",
columns: [{ columns: [{
checkbox: true checkbox: true
}, },
{ {
field: 'activityTitle', field: 'title',
title: '活动名称' title: '快件产品名称'
}, },
{ {
field: 'activityImg', field: 'productCode',
title: '活动图片', title: '产品编码'
formatter: function (value, row, index) {
return $.table.imageView(value, "300", "600");
}
}, },
{ {
field: 'activityType', field: 'agingType',
title: '活动类型', title: '时效类型'
formatter: function (value, row) {
var activityType = row.activityType;
if (row.activityType == 1) {
activityType = "转盘";
} else {
activityType = "未知";
}
return activityType;
}
},
{
field: 'prizeNum',
title: '奖品数量'
},
{
field: 'drawNum',
title: '已发出'
}, },
{ {
field: '', field: '',
title: '奖品剩余', title: '快递预估价',
formatter: function (value, row) { formatter: function (value, row, index) {
var prizeNum = row.prizeNum; return row.estimatePriceMin + ' ~ ' + row.estimatePriceMax;
var drawNum = row.drawNum;
return prizeNum - drawNum;
} }
}, },
{ {
field: 'isOnline', field: 'isOnline',
title: '活动状态', title: '状态',
formatter: function (value, row) { formatter: function (value, row) {
var isOnline = row.isOnline; var isOnline = row.isOnline;
if (row.isOnline == 1) { if (row.isOnline == 1) {
...@@ -123,20 +73,17 @@ ...@@ -123,20 +73,17 @@
align: 'center', align: 'center',
formatter: function (value, row, index) { formatter: function (value, row, index) {
var actions = []; var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + drawListFlag + '" href="javascript:void(0)" onclick="$.operate.detailTab(\'' + row.integralActivityId + '\')"><i class="fa fa-edit"></i>查看抽奖名单</a> '); actions.push('<a class="btn btn-success btn-xs ' + updateFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.moduleId + '\')"></i>编辑</a> ');
actions.push('<a class="btn btn-success btn-xs ' + updateFlag + '" href="javascript:void(0)" onclick="$.operate.editTab(\'' + row.integralActivityId + '\')"></i>编辑</a> '); actions.push(`<a class="btn btn-danger btn-xs ${isOnlineFlag}" href="javascript:void(0)" onclick="openModal('${row.moduleId}','${row.isOnline}')"></i>上下线</a> `);
actions.push(`<a class="btn btn-danger btn-xs ${isOnlineFlag}" href="javascript:void(0)" onclick="openModal('${row.integralActivityId}','${row.isOnline}')"></i>上下线</a> `);
actions.push('<a class="btn btn-warning btn-xs ' + exportExcelFlag + '" href="javascript:void(0)" onclick="exportExcel(\'' + row.integralActivityId + '\')"></i>导出抽奖信息</a> ');
return actions.join(''); return actions.join('');
} }
}] }]
}; };
$.table.init(options); $.table.init(options);
}); });
function openModal(id, data) { function openModal(id, data) {
console.log(id, data, 'dhsa')
let title = ''; let title = '';
let lineId = null; let lineId = null;
if (data == 1) { if (data == 1) {
...@@ -149,10 +96,9 @@ ...@@ -149,10 +96,9 @@
$.modal.confirm(`确定要${title}此活动吗`, function() { $.modal.confirm(`确定要${title}此活动吗`, function() {
$.ajax({ $.ajax({
type: 'put', type: 'put',
url: '/sweet/integralActivity/isOnline', url: '/kylin/expressModule/isOnline',
data: {integralActivityId: id, isOnline: lineId}, data: {expressModuleId: id, isOnline: lineId},
success:function(e) { success:function(e) {
console.log(e)
$("button[name=refresh]").click(); $("button[name=refresh]").click();
} }
}) })
......
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('编辑快递模版')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-post-add">
<div class="form-group">
<label class="col-sm-2 control-label is-required">快件产品名称:</label>
<div class="col-sm-10">
<input th:value="${KylinExpressModule.title}" class="form-control" type="text" name="title"
id="title" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label is-required">快件产品名称:</label>
<div class="col-sm-10">
<input th:value="${KylinExpressModule.productCode}" class="form-control" type="number" name="productCode"
id="productCode" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label is-required">时效类型:</label>
<div class="col-sm-10">
<input th:value="${KylinExpressModule.agingType}" class="form-control" type="text" name="agingType"
id="agingType" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label is-required">快递预估价格小:</label>
<div class="col-sm-10">
<input th:value="${KylinExpressModule.estimatePriceMin}" class="form-control" type="number" name="estimatePriceMin"
id="estimatePriceMin" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label is-required">快递预估价格大:</label>
<div class="col-sm-10">
<input th:value="${KylinExpressModule.estimatePriceMax}" class="form-control" type="number" name="estimatePriceMax"
id="estimatePriceMax" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">是否上线</label>
<div class="col-sm-10">
<div class="radio check-box">
<label>
<input type="radio" value="1" name="isOnline"
th:checked="${KylinExpressModule.isOnline==1 ? true : false}"> <i></i> 未上线
</label>
</div>
<div class="radio check-box">
<label>
<input type="radio" value="2" name="isOnline"
th:checked="${KylinExpressModule.isOnline==2 ? true : false}"> <i></i> 已上线
</label>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer"/>
<script type="text/javascript">
var prefix = ctx + "kylin/expressModule";
var moduleId = "[[${KylinExpressModule.moduleId}]]";
function submitHandler() {
if ($.validate.form()) {
var data = $('#form-post-add').serializeArray();
data.push({"name": "moduleId", "value": moduleId});
$.operate.save(prefix + "/update", data);
}
}
</script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment