qa-prevention-gwj/src/main/java/com/zcloud/controller/xgf/TrainingBatchController.java

203 lines
6.2 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package com.zcloud.controller.xgf;
import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.service.xgf.TrainingBatchService;
import com.zcloud.service.xgf.XgfUserService;
import com.zcloud.util.*;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.*;
/**
* 说明:培训批次管理
* 作者luoxiaobao
* 时间2023-05-08
* 官网www.zcloudchina.com
*/
@Controller
@RequestMapping("/trainingbatch")
public class TrainingBatchController extends BaseController {
@Autowired
private TrainingBatchService trainingbatchService;
@Autowired
private XgfUserService xgfUserService;
/**
* 新增
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/add")
@RequiresPermissions("trainingbatch:add")
@ResponseBody
public Object add() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
trainingbatchService.save(pd);
map.put("result", errInfo);
return map;
}
/**
* 删除
*
*/
@RequestMapping(value = "/delete")
@RequiresPermissions("trainingbatch:del")
@ResponseBody
public Object delete() throws Exception {
Map<String, String> map = new HashMap<String, String>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
trainingbatchService.delete(pd);
map.put("result", errInfo); //返回结果
return map;
}
/**
* 修改
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/edit")
@RequiresPermissions("trainingbatch:edit")
@ResponseBody
public Object edit() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
trainingbatchService.edit(pd);
map.put("result", errInfo);
return map;
}
/**
* 列表
*
* @param page
* @throws Exception
*/
@RequestMapping(value = "/list")
@RequiresPermissions("trainingbatch:list")
@ResponseBody
public Object list(Page page) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
page.setPd(pd);
List<PageData> varList = trainingbatchService.list(page); //列出TrainingBatch列表
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);
return map;
}
/**
* 列表
*
* @param page
* @throws Exception
*/
@RequestMapping(value = "/userList")
@ResponseBody
public Object userList(Page page) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
page.setPd(pd);
List<PageData> varList = xgfUserService.flowlistPage(page); //列出TrainingBatch列表
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);
return map;
}
/**
* 列表
*
* @param page
* @throws Exception
*/
@RequestMapping(value = "/batchUserList")
@RequiresPermissions("trainingbatch:list")
@ResponseBody
public Object batchUserList(Page page) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
page.setPd(pd);
List<PageData> varList = trainingbatchService.batchUserlistPage(page); //列出TrainingBatch列表
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);
return map;
}
/**
* 去修改页面获取数据
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/goEdit")
@RequiresPermissions("trainingbatch:edit")
@ResponseBody
public Object goEdit() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd = trainingbatchService.findById(pd); //根据ID读取
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
/**
* 批量删除
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/deleteAll")
@RequiresPermissions("trainingbatch:del")
@ResponseBody
public Object deleteAll() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
PageData pd = this.getPageData();
String DATA_IDS = pd.getString("DATA_IDS");
if (Tools.notEmpty(DATA_IDS)) {
String ArrayDATA_IDS[] = DATA_IDS.split(",");
trainingbatchService.deleteAll(ArrayDATA_IDS);
}
map.put("result", "success"); //返回结果
return map;
}
}