记得上下班打卡 | 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;
import com.liquidnet.client.admin.zhengzai.kylin.service.IKylinExpressModuleService;
import com.liquidnet.service.kylin.dto.param.admin.ExpressModuleFromParam;
import com.liquidnet.service.kylin.entity.KylinExpressModule;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
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.*;
......@@ -33,9 +33,8 @@ import javax.validation.constraints.NotNull;
* @author jiangxiulong
* @since 2021-11-15
*/
@Api(tags = "快递模板管理")
@Validated
@RestController
@Controller
@RequestMapping("/kylin/expressModule")
public class KylinExpressModuleController extends BaseController {
private String prefix = "zhengzai/kylin/expressModule";
......@@ -46,9 +45,8 @@ public class KylinExpressModuleController extends BaseController {
@Log(title = "快递模版创建", businessType = BusinessType.INSERT)
@RequiresPermissions("kylin:expressModule:create")
@PostMapping("create")
@ApiOperation(value = "快递模版创建")
@ResponseBody
public AjaxResult create(@Valid @RequestBody ExpressModuleFromParam param) {
public AjaxResult create(ExpressModuleFromParam param) {
Integer result = expressModuleService.createForm(param);
if (result > 0) {
return success("操作成功");
......@@ -59,10 +57,9 @@ public class KylinExpressModuleController extends BaseController {
@Log(title = "快递模版编辑", businessType = BusinessType.UPDATE)
@RequiresPermissions("kylin:expressModule:update")
@PutMapping("update")
@ApiOperation(value = "快递模版编辑")
@PostMapping("update")
@ResponseBody
public AjaxResult update(@Valid @RequestBody ExpressModuleFromParam param) {
public AjaxResult update(ExpressModuleFromParam param) {
Integer result = expressModuleService.updateForm(param);
if (result > 0) {
return success("操作成功");
......@@ -73,7 +70,6 @@ public class KylinExpressModuleController extends BaseController {
@Log(title = "快递模版上下线", businessType = BusinessType.UPDATE)
@RequiresPermissions("kylin:expressModule:isOnline")
@ApiOperation(value = "快递模版上下线")
@PutMapping("isOnline")
@ResponseBody
@ApiImplicitParams({
......@@ -94,7 +90,6 @@ public class KylinExpressModuleController extends BaseController {
@Log(title = "快递模版详情", businessType = BusinessType.DETAIL)
@GetMapping("details")
@ApiOperation(value = "快递模版详情")
@ResponseBody
@ApiImplicitParams({
@ApiImplicitParam(type = "query", required = true, dataType = "String", name = "moduleId", value = "快递模版id"),
......@@ -106,7 +101,6 @@ public class KylinExpressModuleController extends BaseController {
@Log(title = "快递模版列表数据", businessType = BusinessType.LIST)
@RequiresPermissions("kylin:expressModule:list")
@ApiOperation(value = "快递模版列表数据")
@PostMapping("list")
@ResponseBody
public TableDataInfo list() {
......@@ -114,15 +108,20 @@ public class KylinExpressModuleController extends BaseController {
return getDataTable(result.getList());
}
@GetMapping("listView")
@ApiOperation(value = "快递模版列表view")
@GetMapping()
public String listView() {
return prefix + "/list";
return prefix + "/listView";
}
@GetMapping("formView")
@ApiOperation(value = "快递模版添加编辑view")
public String formView() {
return prefix + "/form";
@GetMapping("/create")
public String createView() {
return prefix + "/create";
}
@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>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('积分活动列表')"/>
<th:block th:include="include :: header('快递模版列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
<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">
<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> 添加
</a>
</div>
......@@ -37,73 +18,42 @@
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
var updateFlag = [[${@permission.hasPermi('sweet:integralActivity:create')}]];
var isOnlineFlag = [[${@permission.hasPermi('sweet:integralActivity:isOnline')}]];
var drawListFlag = [[${@permission.hasPermi('sweet:integralActivityDraw:list')}]];
var exportExcelFlag = [[${@permission.hasPermi('sweet:integralActivityDraw:export')}]];
var updateFlag = [[${@permission.hasPermi('kylin:expressModule:create')}]];
var isOnlineFlag = [[${@permission.hasPermi('kylin:expressModule:isOnline')}]];
var prefix = ctx + "sweet/integralActivity";
function exportExcel(integralActivityId) {
var data = {"ids": integralActivityId};
$.table.exportExcel("", data)
}
var prefix = ctx + "kylin/expressModule";
$(function () {
var options = {
url: prefix + "/list",
updateUrl: prefix + "/formView?id={id}", // /update/{id}
createUrl: prefix + "/formView",
detailUrl: "/sweet/IntegralActivityDraw/listView/{id}",
exportUrl: "/sweet/IntegralActivityDraw/export",
modalName: "积分活动",
updateUrl: prefix + "/update/{id}",
createUrl: prefix + "/create",
modalName: "快递模版",
columns: [{
checkbox: true
},
{
field: 'activityTitle',
title: '活动名称'
field: 'title',
title: '快件产品名称'
},
{
field: 'activityImg',
title: '活动图片',
formatter: function (value, row, index) {
return $.table.imageView(value, "300", "600");
}
field: 'productCode',
title: '产品编码'
},
{
field: 'activityType',
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: 'agingType',
title: '时效类型'
},
{
field: '',
title: '奖品剩余',
formatter: function (value, row) {
var prizeNum = row.prizeNum;
var drawNum = row.drawNum;
return prizeNum - drawNum;
title: '快递预估价',
formatter: function (value, row, index) {
return row.estimatePriceMin + ' ~ ' + row.estimatePriceMax;
}
},
{
field: 'isOnline',
title: '活动状态',
title: '状态',
formatter: function (value, row) {
var isOnline = row.isOnline;
if (row.isOnline == 1) {
......@@ -123,10 +73,8 @@
align: 'center',
formatter: function (value, row, index) {
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.editTab(\'' + row.integralActivityId + '\')"></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> ');
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-danger btn-xs ${isOnlineFlag}" href="javascript:void(0)" onclick="openModal('${row.moduleId}','${row.isOnline}')"></i>上下线</a> `);
return actions.join('');
}
}]
......@@ -136,7 +84,6 @@
});
function openModal(id, data) {
console.log(id, data, 'dhsa')
let title = '';
let lineId = null;
if (data == 1) {
......@@ -149,10 +96,9 @@
$.modal.confirm(`确定要${title}此活动吗`, function() {
$.ajax({
type: 'put',
url: '/sweet/integralActivity/isOnline',
data: {integralActivityId: id, isOnline: lineId},
url: '/kylin/expressModule/isOnline',
data: {expressModuleId: id, isOnline: lineId},
success:function(e) {
console.log(e)
$("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