案件登记

pg_adapter
20918 8 months ago
parent 6b0c197638
commit 83307d0b32

@ -1,9 +1,16 @@
package com.ruoyi.web.controller.manager; 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.tdcase.TdCase;
import com.ruoyi.system.service.tdcase.TdCaseService; import com.ruoyi.system.service.tdcase.TdCaseService;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/** /**
* packageName com.ruoyi.web.controller.manager * packageName com.ruoyi.web.controller.manager
@ -19,4 +26,36 @@ public class TdCaseManager {
@Resource @Resource
private TdCaseService caseService; private TdCaseService caseService;
public List<TdCase> selecttdCaseList(TdCase tdCase) {
return caseService.selectTdCaseList(tdCase);
}
public boolean saveOrUpdate(TdCase tdCase) {
if (CharSequenceUtil.isNotBlank(tdCase.getId())) {
tdCase.setUpdateBy(ShiroUtils.getSysUser().getLoginName());
tdCase.setUpdateTime(new Date());
} else {
tdCase.setCreateBy(ShiroUtils.getSysUser().getLoginName());
tdCase.setCreateTime(new Date());
}
return caseService.saveOrUpdate(tdCase);
}
public TdCase selecttdCase(String id) {
return caseService.getById(id);
}
public boolean deletedCaseByids(String ids) {
List<String> list = Arrays.asList(Convert.toStrArray(ids));
return caseService.removeByIds(list);
}
public List<TdCase> selectList() {
return caseService.lambdaQuery().list();
}
} }

@ -1,11 +1,19 @@
package com.ruoyi.web.controller.tdcase; package com.ruoyi.web.controller.tdcase;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; 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.tdcase.TdCase;
import com.ruoyi.web.controller.manager.TdCaseManager; import com.ruoyi.web.controller.manager.TdCaseManager;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
/** /**
* packageName com.ruoyi.web.controller.tdcase * packageName com.ruoyi.web.controller.tdcase
@ -20,8 +28,102 @@ import javax.annotation.Resource;
@RequestMapping("/system/tdCase") @RequestMapping("/system/tdCase")
public class TdCaseController extends BaseController { public class TdCaseController extends BaseController {
private String prefix = "system/case";
@Resource @Resource
private TdCaseManager tdCaseManager; private TdCaseManager tdCaseManager;
@RequiresPermissions("system:case:view")
@GetMapping()
public String place() {
return prefix + "/case";
}
/**
*
*/
@RequiresPermissions("system:case:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(TdCase tdCase) {
startPage();
List<TdCase> tdCases = tdCaseManager.selecttdCaseList(tdCase);
return getDataTable(tdCases);
}
/**
*
*/
@GetMapping("/add")
public String add() {
return prefix + "/add";
}
/**
*
*/
@RequiresPermissions("system:case:add")
@Log(title = "失泄密案件", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(TdCase tdCase) {
return toAjax(tdCaseManager.saveOrUpdate(tdCase));
}
/**
*
*/
@RequiresPermissions("system:case:edit")
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") String id, ModelMap mmap) {
TdCase tdCase = tdCaseManager.selecttdCase(id);
mmap.put("tdCase", tdCase);
return prefix + "/edit";
}
/**
*
*/
@RequiresPermissions("system:case:edit")
@Log(title = "失泄密案件", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(TdCase tdCase) {
return toAjax(tdCaseManager.saveOrUpdate(tdCase));
}
/**
*
*/
@RequiresPermissions("system:case:detail")
@GetMapping("/detail/{id}")
public String detail(@PathVariable("id") String id, ModelMap mmap) {
TdCase tdCase = tdCaseManager.selecttdCase(id);
mmap.put("tdCase", tdCase);
return prefix + "/detail";
}
/**
*
*/
@RequiresPermissions("system:case:remove")
@Log(title = "失泄密案件", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids) {
return toAjax(tdCaseManager.deletedCaseByids(ids));
}
/**
*
*
* @return com.ruoyi.common.core.domain.AjaxResult
*/
@PostMapping("/getList")
@ResponseBody
public AjaxResult getList() {
return AjaxResult.success(tdCaseManager.selectList());
}
} }

@ -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>

@ -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>

@ -1,9 +1,12 @@
package com.ruoyi.system.mapper.tdcase; package com.ruoyi.system.mapper.tdcase;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.domain.place.TdPlace;
import com.ruoyi.system.domain.tdcase.TdCase; import com.ruoyi.system.domain.tdcase.TdCase;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/** /**
* @author 13560 * @author 13560
* @description td_case()Mapper * @description td_case()Mapper
@ -12,6 +15,7 @@ import org.apache.ibatis.annotations.Mapper;
*/ */
@Mapper @Mapper
public interface TdCaseMapper extends BaseMapper<TdCase> { public interface TdCaseMapper extends BaseMapper<TdCase> {
public List<TdCase> selectTdCaseList(TdCase tdCase);
} }

@ -1,13 +1,17 @@
package com.ruoyi.system.service.tdcase; package com.ruoyi.system.service.tdcase;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.system.domain.place.TdPlace;
import com.ruoyi.system.domain.tdcase.TdCase; import com.ruoyi.system.domain.tdcase.TdCase;
import java.util.List;
/** /**
* @author 13560 * @author 13560
* @description td_case()Service * @description td_case()Service
* @createDate 2024-08-13 15:55:39 * @createDate 2024-08-13 15:55:39
*/ */
public interface TdCaseService extends IService<TdCase> { public interface TdCaseService extends IService<TdCase> {
public List<TdCase> selectTdCaseList(TdCase tdCase);
} }

@ -1,11 +1,16 @@
package com.ruoyi.system.service.tdcase.impl; package com.ruoyi.system.service.tdcase.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.domain.place.TdPlace;
import com.ruoyi.system.domain.tdcase.TdCase; import com.ruoyi.system.domain.tdcase.TdCase;
import com.ruoyi.system.mapper.place.TdPlaceMapper;
import com.ruoyi.system.mapper.tdcase.TdCaseMapper; import com.ruoyi.system.mapper.tdcase.TdCaseMapper;
import com.ruoyi.system.service.tdcase.TdCaseService; import com.ruoyi.system.service.tdcase.TdCaseService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/** /**
* @author 13560 * @author 13560
* @description td_case()Service * @description td_case()Service
@ -14,6 +19,12 @@ import org.springframework.stereotype.Service;
@Service @Service
public class TdCaseServiceImpl extends ServiceImpl<TdCaseMapper, TdCase> public class TdCaseServiceImpl extends ServiceImpl<TdCaseMapper, TdCase>
implements TdCaseService { implements TdCaseService {
@Resource
private TdCaseMapper caseMapper;
@Override
public List<TdCase> selectTdCaseList(TdCase tdCase) {
return caseMapper.selectTdCaseList(tdCase);
}
} }

@ -32,4 +32,15 @@
create_by,create_time,update_by, create_by,create_time,update_by,
update_time,remark update_time,remark
</sql> </sql>
<select id="selectTdCaseList" resultType="com.ruoyi.system.domain.tdcase.TdCase">
select <include refid="Base_Column_List"/> from td_case
<trim prefix="where" prefixOverrides="and|or">
<if test="caseName!=null and caseName!=''">
AND case_name LIKE concat('%',#{caseName},'%')
</if>
</trim>
ORDER BY create_time DESC
</select>
</mapper> </mapper>

Loading…
Cancel
Save