diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/SecretManager.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/SecretManager.java new file mode 100644 index 0000000..1b45430 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/SecretManager.java @@ -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 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 list = Arrays.asList(Convert.toStrArray(ids)); + return secretingService.removeByIds(list); + } + + +} + + + diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/secret/TdSecretingController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/secret/TdSecretingController.java new file mode 100644 index 0000000..ab210ef --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/secret/TdSecretingController.java @@ -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 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)); + } + +} diff --git a/ruoyi-admin/src/main/resources/templates/system/secreting/add.html b/ruoyi-admin/src/main/resources/templates/system/secreting/add.html new file mode 100644 index 0000000..566549b --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/secreting/add.html @@ -0,0 +1,10 @@ + + + + + Title + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/secreting/detail.html b/ruoyi-admin/src/main/resources/templates/system/secreting/detail.html new file mode 100644 index 0000000..566549b --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/secreting/detail.html @@ -0,0 +1,10 @@ + + + + + Title + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/secreting/edit.html b/ruoyi-admin/src/main/resources/templates/system/secreting/edit.html new file mode 100644 index 0000000..566549b --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/secreting/edit.html @@ -0,0 +1,10 @@ + + + + + Title + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/secreting/secreting.html b/ruoyi-admin/src/main/resources/templates/system/secreting/secreting.html new file mode 100644 index 0000000..c4ec13a --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/secreting/secreting.html @@ -0,0 +1,10 @@ + + + + + Title + + +1 + + \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/secreting/TdSecretingMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/secreting/TdSecretingMapper.java index c40bffd..d216c70 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/secreting/TdSecretingMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/secreting/TdSecretingMapper.java @@ -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_secreting】的数据库操作Mapper @@ -10,6 +12,7 @@ import com.ruoyi.system.domain.secreting.TdSecreting; * @Entity generator.domain.TdSecreting */ public interface TdSecretingMapper extends BaseMapper { + public List selectSecretList(TdSecreting tdSecreting); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/secreting/TdSecretingService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/secreting/TdSecretingService.java index a8827e4..9559553 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/secreting/TdSecretingService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/secreting/TdSecretingService.java @@ -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_secreting】的数据库操作Service * @createDate 2024-10-21 09:37:17 */ public interface TdSecretingService extends IService { + public List selectSecretList(TdSecreting tdSecreting); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/secreting/impl/TdSecretingServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/secreting/impl/TdSecretingServiceImpl.java index e0c6475..8a670ef 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/secreting/impl/TdSecretingServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/secreting/impl/TdSecretingServiceImpl.java @@ -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_secreting】的数据库操作Service实现 @@ -15,6 +18,13 @@ import org.springframework.stereotype.Service; public class TdSecretingServiceImpl extends ServiceImpl implements TdSecretingService { + @Resource + private TdSecretingMapper tdSecretingMapper; + + @Override + public List selectSecretList(TdSecreting tdSecreting) { + return tdSecretingMapper.selectSecretList(tdSecreting); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/TdSecretingMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TdSecretingMapper.xml index f502cd3..7706dc3 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TdSecretingMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TdSecretingMapper.xml @@ -28,4 +28,16 @@ responsible,scope,secret_degree, term,key_point + +