Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
net.mingsoft.init.action.ModelTableAction Maven / Gradle / Ivy
package net.mingsoft.init.action;
import java.util.List;
import java.io.File;
import java.util.ArrayList;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.util.ObjectUtil;
import java.util.*;
import com.alibaba.fastjson.JSON;
import net.mingsoft.base.entity.ResultData;
import org.apache.commons.lang3.StringUtils;
import org.springframework.validation.BindingResult;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.ui.ModelMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.*;
import net.mingsoft.init.biz.IModelTableBiz;
import net.mingsoft.init.entity.ModelTableEntity;
import net.mingsoft.base.util.JSONObject;
import net.mingsoft.base.entity.BaseEntity;
import net.mingsoft.basic.util.BasicUtil;
import net.mingsoft.basic.util.StringUtil;
import net.mingsoft.base.filter.DateValueFilter;
import net.mingsoft.base.filter.DoubleValueFilter;
import net.mingsoft.basic.bean.EUListBean;
import net.mingsoft.basic.annotation.LogAnn;
import net.mingsoft.basic.constant.e.BusinessTypeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import springfox.documentation.annotations.ApiIgnore;
/**
* 模块列表管理控制层
* @author 铭飞科技
* 创建日期:2020-5-29 16:04:15
* 历史修订:
*/
@Api(value = "模块列表接口")
@Controller("initModelTableAction")
@RequestMapping("/${ms.manager.path}/init/modelTable")
public class ModelTableAction extends BaseAction{
/**
* 注入模块列表业务层
*/
@Autowired
private IModelTableBiz modelTableBiz;
/**
* 返回主界面index
*/
@GetMapping("/index")
public String index(HttpServletResponse response,HttpServletRequest request){
return "/init/model-table/index";
}
/**
* 查询模块列表列表
* @param modelTable 模块列表实体
*/
@ApiOperation(value = "查询模块列表列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "mtName", value = "模块名称", required =false,paramType="query"),
@ApiImplicitParam(name = "mtFiles", value = "sql文件", required =false,paramType="query"),
@ApiImplicitParam(name = "createBy", value = "创建人", required =false,paramType="query"),
@ApiImplicitParam(name = "createDate", value = "创建时间", required =false,paramType="query"),
@ApiImplicitParam(name = "updateBy", value = "修改人", required =false,paramType="query"),
@ApiImplicitParam(name = "updateDate", value = "修改时间", required =false,paramType="query"),
@ApiImplicitParam(name = "del", value = "删除标记", required =false,paramType="query"),
@ApiImplicitParam(name = "id", value = "编号", required =false,paramType="query"),
})
@RequestMapping(value ="/list",method = {RequestMethod.GET,RequestMethod.POST})
@ResponseBody
public ResultData list(@ModelAttribute @ApiIgnore ModelTableEntity modelTable,HttpServletResponse response, HttpServletRequest request,@ApiIgnore ModelMap model,BindingResult result) {
BasicUtil.startPage();
List modelTableList = modelTableBiz.query(modelTable);
return ResultData.build().success(new EUListBean(modelTableList,(int)BasicUtil.endPage(modelTableList).getTotal()));
}
/**
* 返回编辑界面modelTable_form
*/
@GetMapping("/form")
public String form(@ModelAttribute ModelTableEntity modelTable,HttpServletResponse response,HttpServletRequest request,ModelMap model){
if(modelTable.getId()!=null){
BaseEntity modelTableEntity = modelTableBiz.getEntity(Integer.parseInt(modelTable.getId()));
model.addAttribute("modelTableEntity",modelTableEntity);
}
return "/init/model-table/form";
}
/**
* 返回编辑界面modelTable_form
*/
@PostMapping("/execute")
@ResponseBody
public ResultData execute(@ModelAttribute ModelTableEntity modelTable,HttpServletResponse response,HttpServletRequest request,ModelMap model){
modelTableBiz.execute(modelTable.getId());
return ResultData.build().success();
}
/**
* 获取模块列表
* @param modelTable 模块列表实体
*/
@ApiOperation(value = "获取模块列表列表接口")
@ApiImplicitParam(name = "id", value = "编号", required =true,paramType="query")
@GetMapping("/get")
@ResponseBody
public ResultData get(@ModelAttribute @ApiIgnore ModelTableEntity modelTable,HttpServletResponse response, HttpServletRequest request,@ApiIgnore ModelMap model){
if(modelTable.getId()==null) {
return ResultData.build().error();
}
ModelTableEntity _modelTable = (ModelTableEntity)modelTableBiz.getEntity(Integer.parseInt(modelTable.getId()));
return ResultData.build().success(_modelTable);
}
@ApiOperation(value = "保存模块列表列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "mtName", value = "模块名称", required =false,paramType="query"),
@ApiImplicitParam(name = "mtFiles", value = "sql文件", required =false,paramType="query"),
@ApiImplicitParam(name = "createBy", value = "创建人", required =false,paramType="query"),
@ApiImplicitParam(name = "createDate", value = "创建时间", required =false,paramType="query"),
@ApiImplicitParam(name = "updateBy", value = "修改人", required =false,paramType="query"),
@ApiImplicitParam(name = "updateDate", value = "修改时间", required =false,paramType="query"),
@ApiImplicitParam(name = "del", value = "删除标记", required =false,paramType="query"),
@ApiImplicitParam(name = "id", value = "编号", required =false,paramType="query"),
})
/**
* 保存模块列表
* @param modelTable 模块列表实体
*/
@PostMapping("/save")
@ResponseBody
@LogAnn(title = "保存模块列表", businessType = BusinessTypeEnum.INSERT)
@RequiresPermissions("init:modelTable:save")
public ResultData save(@ModelAttribute @ApiIgnore ModelTableEntity modelTable, HttpServletResponse response, HttpServletRequest request) {
modelTableBiz.saveEntity(modelTable);
return ResultData.build().success(modelTable);
}
/**
* @param modelTable 模块列表实体
*/
@ApiOperation(value = "批量删除模块列表列表接口")
@PostMapping("/delete")
@ResponseBody
@LogAnn(title = "删除模块列表", businessType = BusinessTypeEnum.DELETE)
@RequiresPermissions("init:modelTable:del")
public ResultData delete(@RequestBody List modelTables,HttpServletResponse response, HttpServletRequest request) {
int[] ids = new int[modelTables.size()];
for(int i = 0;i