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

Commit bb6af255 authored by Tice's avatar Tice

场地管理

parent 94961735
package com.liquidnet.service.merchant.dto.param.admin;
public class MerchantFieldsListParam {
/**
* 场地Id
*/
private String fieldId;
/**
* 上线状态 [0-下线 1-上线]
*/
private Integer isOnline;
/**
* 认领状态 [0-未认领 1-已认领 2-认领中]
*/
private Integer claimStatus;
public String getFieldId() {
return fieldId;
}
public Integer getIsOnline() {
return isOnline;
}
public Integer getClaimStatus() {
return claimStatus;
}
}
package com.liquidnet.client.admin.web.controller.zhengzai.merchant;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.liquidnet.client.admin.common.annotation.Log;
import com.liquidnet.client.admin.common.core.controller.BaseController;
import com.liquidnet.client.admin.common.core.domain.AjaxResult;
import com.liquidnet.client.admin.common.core.page.TableDataInfo;
import com.liquidnet.client.admin.common.enums.BusinessType;
import com.liquidnet.client.admin.common.utils.ShiroUtils;
import com.liquidnet.client.admin.zhengzai.merchant.service.IMerchantCompaniesAdminService;
import com.liquidnet.client.admin.zhengzai.merchant.service.IMerchantFieldsAdminService;
import com.liquidnet.client.admin.zhengzai.merchant.utils.MerchantMongoUtil;
import com.liquidnet.service.merchant.dto.param.admin.MerchantFieldsListParam;
import com.liquidnet.service.merchant.dto.vo.MerchantCompaniesVo;
import com.liquidnet.service.merchant.dto.vo.MerchantFieldsVo;
import com.liquidnet.service.merchant.entity.MerchantCompanies;
import com.liquidnet.service.merchant.entity.MerchantFields;
import io.swagger.annotations.Api;
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.web.bind.annotation.*;
import java.util.List;
@Api(tags = "场地管理")
@Controller
@RequestMapping("merchant/field")
public class MerchantFieldsController extends BaseController {
private final String prefix = "zhengzai/kylin/field";
@Autowired
IMerchantFieldsAdminService merchantFieldsAdminService;
@Autowired
IMerchantCompaniesAdminService merchantCompaniesAdminService;
@Autowired
MerchantMongoUtil merchantMongoUtil;
@RequiresPermissions("merchant:field:view")
@GetMapping()
public String applyList() {
return prefix + "/list";
}
@Log(title = "场地列表", businessType = BusinessType.LIST)
@RequiresPermissions("merchant:field:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(MerchantFieldsListParam param) {
startPage();
return getDataTable(merchantFieldsAdminService.list(
Wrappers.lambdaQuery(MerchantFields.class)
.eq(param.getFieldId().length() > 0, MerchantFields::getFieldId, param.getFieldId())
.eq(param.getIsOnline() >= 0, MerchantFields::getIsOnline, param.getIsOnline())
.eq(param.getClaimStatus() >= 0, MerchantFields::getClaimStatus, param.getClaimStatus())
.select(
MerchantFields::getFieldId, MerchantFields::getIsOnline, MerchantFields::getClaimStatus, MerchantFields::getUid,
MerchantFields::getName, MerchantFields::getLogo,
MerchantFields::getCreatedAt
)
));
}
@Log(title = "场地详情", businessType = BusinessType.DETAIL)
@RequiresPermissions("merchant:field:detail")
@GetMapping("/details/{fieldId}")
public String detail(@PathVariable("fieldId") String fieldId, ModelMap mmap) {
LambdaQueryWrapper<MerchantFields> fieldsLambdaQueryWrapper = Wrappers.lambdaQuery(MerchantFields.class);
fieldsLambdaQueryWrapper.eq(MerchantFields::getFieldId, fieldId);
MerchantFields fields = merchantFieldsAdminService.getOne(fieldsLambdaQueryWrapper);
MerchantFieldsVo fieldsVo = MerchantFieldsVo.getNew();
fieldsVo.copy(fields);
if (null != fieldsVo.getCompanyId() && !fieldsVo.getCompanyId().isEmpty()) {
LambdaQueryWrapper<MerchantCompanies> companiesLambdaQueryWrapper = Wrappers.lambdaQuery(MerchantCompanies.class);
companiesLambdaQueryWrapper.eq(MerchantCompanies::getCompanyId, fieldsVo.getCompanyId());
MerchantCompanies companies = merchantCompaniesAdminService.getOne(companiesLambdaQueryWrapper);
MerchantCompaniesVo companiesVo = MerchantCompaniesVo.getNew();
companiesVo.copy(companies);
fieldsVo.setCompaniesVo(companiesVo);
}
mmap.put("fieldInfo", fieldsVo);
return prefix + "/detail";
}
@ApiOperation(value = "同步Mysql到MongoDB")
@Log(title = "同步Mysql到MongoDB", businessType = BusinessType.OTHER)
@RequiresPermissions("merchant:field:sync:mongo")
@GetMapping("/sync/mongo")
@ResponseBody
public AjaxResult approve() {
String authUid = ShiroUtils.getUserId().toString();
String authName = ShiroUtils.getLoginName();
List<MerchantFields> fields = merchantFieldsAdminService.list();
for (MerchantFields field : fields) {
MerchantFieldsVo fieldsVo = MerchantFieldsVo.getNew().copy(field);
merchantMongoUtil.setFieldsVoByFieldId(fieldsVo.getFieldId(), fieldsVo);
}
return toAjax(true);
}
}
package com.liquidnet.client.admin.web.controller.zhengzai.merchant;
import com.liquidnet.client.admin.common.core.controller.BaseController;
import io.swagger.annotations.Api;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Api(tags = "主办管理")
@Controller
@RequestMapping("merchant/sponsors")
public class MerchantSponsorsController extends BaseController {
}
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<option value="-1">所有</option> <option value="-1">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"th:value="${dict.dictValue}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}"th:value="${dict.dictValue}"></option>
</select> </select>
</li>
<li> <li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a> class="fa fa-search"></i>&nbsp;搜索</a>
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>
\ No newline at end of file
<!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('场地列表')"/>
</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>场地Id:</label>
<input type="text" name="fieldId"/>
</li>
<li>
上线状态:<select name="isOnline" th:with="type=${@dict.getType('zhengzai_field_is_online')}">
<option value="all">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
认领状态:<select name="claimStatus" th:with="type=${@dict.getType('zhengzai_field_claim_status')}">
<option value="-1">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"th:value="${dict.dictValue}"></option>
</select>
</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="col-sm-12 select-table table-bordered">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
var dicFieldIsOnline = [[${@dict.getType('zhengzai_field_is_online')}]];
var dicFieldClaimStatus = [[${@dict.getType('zhengzai_field_claim_status')}]];
var detailFlag = [[${@permission.hasPermi('merchant:field:detail')}]];
var prefix = ctx + "merchant/field";
$(function () {
var options = {
url: prefix + "/list",
detailUrl: prefix + "/details/{id}",
sortName: "createdAt",
sortOrder: "desc",
modalName: "-场地列表",
columns: [
{
checkbox: true
},
{
field: 'fieldId',
title: '场地id'
},
{
field: 'name',
title: '场地名称'
},
{
field: 'isOnline',
title: '类型',
formatter: function(value, row, index) {
return $.table.selectDictLabel(dicFieldIsOnline, value);
}
},
{
field: 'claimStatus',
title: '状态',
formatter: function(value, row, index) {
return $.table.selectDictLabel(dicFieldClaimStatus, value);
}
},
{
field: 'createdAt',
title: '创建时间',
sortable: true,
formatter: function (value, row, index) {
return $.common.sprintf("<span>%s</span>", null != value ? value.substring(0, 19) : value);
}
},
{
title: '操作',
align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-info btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detailTab(\'' + row.fieldId + '\')"></i>查看</a> ');
return actions.join('');
}
}]
};
$.table.init(options);
});
</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