定密管理

pg_adapter
20918 6 months ago
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>

@ -3,6 +3,8 @@ package com.ruoyi.system.mapper.secreting;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.domain.secreting.TdSecreting;
import java.util.List;
/**
* @author Administrator
* @description td_secretingMapper
@ -10,6 +12,7 @@ import com.ruoyi.system.domain.secreting.TdSecreting;
* @Entity generator.domain.TdSecreting
*/
public interface TdSecretingMapper extends BaseMapper<TdSecreting> {
public List<TdSecreting> selectSecretList(TdSecreting tdSecreting);
}

@ -3,11 +3,14 @@ package com.ruoyi.system.service.secreting;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.system.domain.secreting.TdSecreting;
import java.util.List;
/**
* @author Administrator
* @description td_secretingService
* @createDate 2024-10-21 09:37:17
*/
public interface TdSecretingService extends IService<TdSecreting> {
public List<TdSecreting> selectSecretList(TdSecreting tdSecreting);
}

@ -6,6 +6,9 @@ import com.ruoyi.system.mapper.secreting.TdSecretingMapper;
import com.ruoyi.system.service.secreting.TdSecretingService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* @author Administrator
* @description td_secretingService
@ -15,6 +18,13 @@ import org.springframework.stereotype.Service;
public class TdSecretingServiceImpl extends ServiceImpl<TdSecretingMapper, TdSecreting>
implements TdSecretingService {
@Resource
private TdSecretingMapper tdSecretingMapper;
@Override
public List<TdSecreting> selectSecretList(TdSecreting tdSecreting) {
return tdSecretingMapper.selectSecretList(tdSecreting);
}
}

@ -28,4 +28,16 @@
responsible,scope,secret_degree,
term,key_point
</sql>
<select id="selectSecretList" resultType="com.ruoyi.system.domain.secreting.TdSecreting">
select <include refid="Base_Column_List"/> from td_secreting
<trim prefix="where" prefixOverrides="and|or">
<if test="secretDegree!=null and secretDegree!=''">
AND secret_degree = #{secretDegree}
</if>
<if test="responsible!=null and responsible!=''">
AND responsible = #{responsible}
</if>
</trim>
</select>
</mapper>

Loading…
Cancel
Save