parent
687c9ab90d
commit
c045bcc341
@ -0,0 +1,59 @@
|
||||
package com.ruoyi.web.controller.manager;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.system.domain.secreting.TdSecreting;
|
||||
import com.ruoyi.system.service.secreting.TdSecretingService;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* packageName com.ruoyi.web.controller.manager
|
||||
*
|
||||
* @author luo
|
||||
* @version JDK 8
|
||||
* @className SecretManager
|
||||
* @description 定密
|
||||
*/
|
||||
|
||||
@Component
|
||||
public class SecretManager {
|
||||
|
||||
@Resource
|
||||
private TdSecretingService secretingService;
|
||||
|
||||
|
||||
public List<TdSecreting> selectSecretList(TdSecreting tdSecreting) {
|
||||
return secretingService.selectSecretList(tdSecreting);
|
||||
}
|
||||
|
||||
public boolean saveOrUpdate(TdSecreting tdSecreting) {
|
||||
if (CharSequenceUtil.isNotBlank(tdSecreting.getId())) {
|
||||
tdSecreting.setUpdateBy(ShiroUtils.getSysUser().getLoginName());
|
||||
tdSecreting.setUpdateTime(new Date());
|
||||
} else {
|
||||
tdSecreting.setCreateBy(ShiroUtils.getSysUser().getLoginName());
|
||||
tdSecreting.setCreateTime(new Date());
|
||||
}
|
||||
return secretingService.saveOrUpdate(tdSecreting);
|
||||
}
|
||||
|
||||
public TdSecreting selectSecreting(String id) {
|
||||
return secretingService.getById(id);
|
||||
}
|
||||
|
||||
public boolean deleteSecretingByIds(String ids) {
|
||||
List<String> list = Arrays.asList(Convert.toStrArray(ids));
|
||||
return secretingService.removeByIds(list);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,107 @@
|
||||
package com.ruoyi.web.controller.secret;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.secreting.TdSecreting;
|
||||
import com.ruoyi.web.controller.manager.SecretManager;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/system/secreting")
|
||||
public class TdSecretingController extends BaseController {
|
||||
private String prefix = "system/secreting";
|
||||
|
||||
@Resource
|
||||
private SecretManager secretManager;
|
||||
|
||||
@RequiresPermissions("system:secreting:view")
|
||||
@GetMapping()
|
||||
public String secreting() {
|
||||
return prefix + "/secreting";
|
||||
}
|
||||
|
||||
/**
|
||||
* 定密列表
|
||||
*/
|
||||
@RequiresPermissions("system:secreting:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(TdSecreting tdSecreting) {
|
||||
startPage();
|
||||
List<TdSecreting> tdSecretings = secretManager.selectSecretList(tdSecreting);
|
||||
return getDataTable(tdSecretings);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增定密事项
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add() {
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增定密事项
|
||||
*/
|
||||
@RequiresPermissions("system:secreting:add")
|
||||
@Log(title = "定密事项管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(TdSecreting tdSecreting) {
|
||||
return toAjax(secretManager.saveOrUpdate(tdSecreting));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改定密事项
|
||||
*/
|
||||
@RequiresPermissions("system:secreting:edit")
|
||||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable("id") String id, ModelMap mmap) {
|
||||
TdSecreting tdSecreting = secretManager.selectSecreting(id);
|
||||
mmap.put("tdSecreting", tdSecreting);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改定密事项
|
||||
*/
|
||||
@RequiresPermissions("system:secreting:edit")
|
||||
@Log(title = "定密事项管理", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(TdSecreting tdSecreting) {
|
||||
return toAjax(secretManager.saveOrUpdate(tdSecreting));
|
||||
}
|
||||
|
||||
/**
|
||||
* 定密事项详情
|
||||
*/
|
||||
@RequiresPermissions("system:secreting:detail")
|
||||
@GetMapping("/detail/{id}")
|
||||
public String detail(@PathVariable("id") String id, ModelMap mmap) {
|
||||
TdSecreting tdSecreting = secretManager.selectSecreting(id);
|
||||
mmap.put("tdSecreting", tdSecreting);
|
||||
return prefix + "/detail";
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除定密事项
|
||||
*/
|
||||
@RequiresPermissions("system:secreting:remove")
|
||||
@Log(title = "定密事项管理", businessType = BusinessType.DELETE)
|
||||
@PostMapping("/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids) {
|
||||
return toAjax(secretManager.deleteSecretingByIds(ids));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
1
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in new issue