水政执法、制度关联和法律法规库表设计,基础代码开发
parent
65e68706e6
commit
b8685a6b73
|
|
@ -0,0 +1,250 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.xyt.entity.so.SzCasePage;
|
||||
import com.gunshi.project.xyt.entity.vo.SzCaseStatisticsVo;
|
||||
import com.gunshi.project.xyt.model.SzCase;
|
||||
import com.gunshi.project.xyt.service.FileAssociationsService;
|
||||
import com.gunshi.project.xyt.service.SzCaseService;
|
||||
import com.gunshi.project.xyt.util.DateUtil;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 描述: 案件登记表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "案件登记表")
|
||||
@RestController
|
||||
@RequestMapping(value="/szCase")
|
||||
public class SzCaseController extends AbstractCommonFileController{
|
||||
|
||||
@Autowired
|
||||
private SzCaseService service;
|
||||
|
||||
@Autowired
|
||||
private FileAssociationsService fileService;
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<SzCase> insert(@Validated(Insert.class) @RequestBody SzCase dto) {
|
||||
|
||||
if (service.lambdaQuery().eq(SzCase::getCaseName,dto.getCaseName())
|
||||
.count() > 0) {
|
||||
throw new IllegalArgumentException("当前名称已存在");
|
||||
}
|
||||
|
||||
dto.setCreateTime(new Date());
|
||||
dto.setId(IdWorker.getId());
|
||||
|
||||
boolean result = service.save(dto);
|
||||
|
||||
|
||||
if (result){
|
||||
fileService.saveFile(dto.getFiles1(), getGroupId(1), String.valueOf( dto.getId()));
|
||||
fileService.saveFile(dto.getFiles2(), getGroupId(2), String.valueOf( dto.getId()));
|
||||
fileService.saveFile(dto.getFiles3(), getGroupId(3), String.valueOf( dto.getId()));
|
||||
fileService.saveFile(dto.getFiles4(), getGroupId(4), String.valueOf( dto.getId()));
|
||||
fileService.saveFile(dto.getFiles5(), getGroupId(5), String.valueOf( dto.getId()));
|
||||
fileService.saveFile(dto.getFiles6(), getGroupId(6), String.valueOf( dto.getId()));
|
||||
fileService.saveFile(dto.getFiles7(), getGroupId(7), String.valueOf( dto.getId()));
|
||||
fileService.saveFile(dto.getFiles8(), getGroupId(8), String.valueOf( dto.getId()));
|
||||
fileService.saveFile(dto.getFiles9(), getGroupId(9), String.valueOf( dto.getId()));
|
||||
}
|
||||
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<SzCase> update(@Validated(Update.class) @RequestBody SzCase dto) {
|
||||
|
||||
|
||||
if (service.lambdaQuery()
|
||||
.ne(SzCase::getId,dto.getId())
|
||||
.eq(SzCase::getCaseName,dto.getCaseName())
|
||||
.count() > 0) {
|
||||
throw new IllegalArgumentException("当前名称已存在");
|
||||
}
|
||||
|
||||
dto.setCreateTime(null);
|
||||
dto.setId(null);
|
||||
boolean result = service.updateById(dto);
|
||||
|
||||
if (result){
|
||||
fileService.saveFile(dto.getFiles1(), getGroupId(1), String.valueOf( dto.getId()));
|
||||
fileService.saveFile(dto.getFiles2(), getGroupId(2), String.valueOf( dto.getId()));
|
||||
fileService.saveFile(dto.getFiles3(), getGroupId(3), String.valueOf( dto.getId()));
|
||||
fileService.saveFile(dto.getFiles4(), getGroupId(4), String.valueOf( dto.getId()));
|
||||
fileService.saveFile(dto.getFiles5(), getGroupId(5), String.valueOf( dto.getId()));
|
||||
fileService.saveFile(dto.getFiles6(), getGroupId(6), String.valueOf( dto.getId()));
|
||||
fileService.saveFile(dto.getFiles7(), getGroupId(7), String.valueOf( dto.getId()));
|
||||
fileService.saveFile(dto.getFiles8(), getGroupId(8), String.valueOf( dto.getId()));
|
||||
fileService.saveFile(dto.getFiles9(), getGroupId(9), String.valueOf( dto.getId()));
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
if (Objects.isNull(service.getById(id))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<SzCase>> page(@RequestBody @Validated SzCasePage page) {
|
||||
LambdaQueryChainWrapper<SzCase> query = service.lambdaQuery();
|
||||
|
||||
if (Objects.nonNull(page.getCaseType())){
|
||||
query.eq(SzCase::getCaseType, page.getCaseType());
|
||||
}
|
||||
|
||||
if (Objects.nonNull(page.getCaseName())){
|
||||
query.like(SzCase::getCaseName, page.getCaseName());
|
||||
}
|
||||
|
||||
if (Objects.nonNull(page.getCaseId())){
|
||||
query.like(SzCase::getCaseId, page.getCaseId());
|
||||
}
|
||||
|
||||
if (Objects.nonNull(page.getStm())){
|
||||
query.ge(SzCase::getCreateTime, page.getStm());
|
||||
}
|
||||
|
||||
if (Objects.nonNull(page.getEtm())){
|
||||
query.le(SzCase::getCreateTime, page.getEtm());
|
||||
}
|
||||
|
||||
query.orderByDesc(SzCase::getCreateTime);
|
||||
return R.ok(service.page(page.getPageSo().toPage(),query));
|
||||
}
|
||||
|
||||
@Operation(summary = "获取详情(包含文件)")
|
||||
@GetMapping("/get/{id}")
|
||||
public R<SzCase> getFiles(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
SzCase o = service.getById(id);
|
||||
if (Objects.isNull(o)) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
|
||||
o.setFiles1(fileService.getFiles(getGroupId(1),String.valueOf(o.getId())));
|
||||
o.setFiles2(fileService.getFiles(getGroupId(2),String.valueOf(o.getId())));
|
||||
o.setFiles3(fileService.getFiles(getGroupId(3),String.valueOf(o.getId())));
|
||||
o.setFiles4(fileService.getFiles(getGroupId(4),String.valueOf(o.getId())));
|
||||
o.setFiles5(fileService.getFiles(getGroupId(5),String.valueOf(o.getId())));
|
||||
o.setFiles6(fileService.getFiles(getGroupId(6),String.valueOf(o.getId())));
|
||||
o.setFiles7(fileService.getFiles(getGroupId(7),String.valueOf(o.getId())));
|
||||
o.setFiles8(fileService.getFiles(getGroupId(8),String.valueOf(o.getId())));
|
||||
o.setFiles9(fileService.getFiles(getGroupId(9),String.valueOf(o.getId())));
|
||||
|
||||
return R.ok(o);
|
||||
}
|
||||
|
||||
@Operation(summary = "案件统计")
|
||||
@PostMapping("/statistics/{num}")
|
||||
public R<List<SzCaseStatisticsVo>> statistics(
|
||||
@Schema(name = "统计类型 0:案件来源,1:案件类型,2:执行类型") @PathVariable("num") Integer num,
|
||||
@RequestBody @Validated SzCasePage page) {
|
||||
LambdaQueryChainWrapper<SzCase> query = service.lambdaQuery();
|
||||
|
||||
if (Objects.nonNull(page.getStm())){
|
||||
query.ge(SzCase::getCreateTime, page.getStm());
|
||||
}
|
||||
|
||||
if (Objects.nonNull(page.getEtm())){
|
||||
query.le(SzCase::getCreateTime, page.getEtm());
|
||||
}
|
||||
|
||||
List<SzCaseStatisticsVo> vos = Lists.newArrayList();
|
||||
|
||||
List<SzCase> list = query.list();
|
||||
if (CollectionUtils.isNotEmpty(list)){
|
||||
Map<Integer, Long> sourceCount = Maps.newHashMap();
|
||||
switch (num){
|
||||
case 0:{ // 案件来源
|
||||
sourceCount = list.stream()
|
||||
.filter(o -> Objects.nonNull(o.getCaseSource()))
|
||||
.collect(Collectors.groupingBy(SzCase::getCaseSource, Collectors.counting()));
|
||||
break;
|
||||
}
|
||||
case 1:{ // 案件类型
|
||||
sourceCount = list.stream()
|
||||
.filter(o -> Objects.nonNull(o.getCaseType()))
|
||||
.collect(Collectors.groupingBy(SzCase::getCaseType, Collectors.counting()));
|
||||
break;
|
||||
}
|
||||
case 2:{ // 执行类型
|
||||
sourceCount = list.stream()
|
||||
.filter(o -> Objects.nonNull(o.getCaseImplementation()))
|
||||
.collect(Collectors.groupingBy(SzCase::getCaseImplementation, Collectors.counting()));
|
||||
break;
|
||||
}
|
||||
default:break;
|
||||
}
|
||||
|
||||
sourceCount.forEach((k,v) -> vos.add(new SzCaseStatisticsVo(null,k,v.intValue())));
|
||||
}
|
||||
|
||||
return R.ok(vos);
|
||||
}
|
||||
|
||||
@Operation(summary = "案件数量趋势")
|
||||
@GetMapping("/statisticsNum/{year}")
|
||||
public R<List<SzCaseStatisticsVo>> statisticsNum(@Schema(name = "年份") @PathVariable("year") Integer year) {
|
||||
LambdaQueryChainWrapper<SzCase> query = service.lambdaQuery();
|
||||
|
||||
query.ge(SzCase::getCreateTime, DateUtil.beginOfYearToDate(year));
|
||||
|
||||
query.le(SzCase::getCreateTime, DateUtil.endOfYearToDate(year));
|
||||
|
||||
List<SzCaseStatisticsVo> vos = Lists.newArrayList();
|
||||
|
||||
List<SzCase> list = query.list();
|
||||
|
||||
if (CollectionUtils.isNotEmpty(list)){
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
|
||||
for (int i = 1; i <= 12; i++) {
|
||||
int finalI = i;
|
||||
long count = list.stream()
|
||||
.filter(item ->
|
||||
{
|
||||
calendar.setTime(item.getCaseDate());
|
||||
return calendar.get(Calendar.MONTH) == finalI;
|
||||
})
|
||||
.count();
|
||||
vos.add(new SzCaseStatisticsVo(i,null,Integer.valueOf(String.valueOf(count))));
|
||||
}
|
||||
}
|
||||
|
||||
return R.ok(vos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "szCase";
|
||||
}
|
||||
public String getGroupId(Integer num) {
|
||||
return getGroupId() + num;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,131 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.xyt.entity.so.SzRegulatoryFrameworkPage;
|
||||
import com.gunshi.project.xyt.model.SzRegulatoryFramework;
|
||||
import com.gunshi.project.xyt.service.FileAssociationsService;
|
||||
import com.gunshi.project.xyt.service.SzRegulatoryFrameworkService;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 案件登记表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "案件登记表")
|
||||
@RestController
|
||||
@RequestMapping(value = "/SzRegulatoryFramework")
|
||||
public class SzRegulatoryFrameworkController extends AbstractCommonFileController {
|
||||
|
||||
@Autowired
|
||||
private SzRegulatoryFrameworkService service;
|
||||
|
||||
@Autowired
|
||||
private FileAssociationsService fileService;
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<SzRegulatoryFramework> insert(@Validated(Insert.class) @RequestBody SzRegulatoryFramework dto) {
|
||||
|
||||
if (service.lambdaQuery().eq(SzRegulatoryFramework::getName, dto.getName())
|
||||
.count() > 0) {
|
||||
throw new IllegalArgumentException("当前名称已存在");
|
||||
}
|
||||
|
||||
dto.setCreateTime(new Date());
|
||||
dto.setId(IdWorker.getId());
|
||||
|
||||
boolean result = service.save(dto);
|
||||
|
||||
|
||||
if (result) {
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), String.valueOf(dto.getId()));
|
||||
}
|
||||
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<SzRegulatoryFramework> update(@Validated(Update.class) @RequestBody SzRegulatoryFramework dto) {
|
||||
|
||||
|
||||
if (service.lambdaQuery()
|
||||
.ne(SzRegulatoryFramework::getId, dto.getId())
|
||||
.eq(SzRegulatoryFramework::getName, dto.getName())
|
||||
.count() > 0) {
|
||||
throw new IllegalArgumentException("当前名称已存在");
|
||||
}
|
||||
|
||||
dto.setCreateTime(null);
|
||||
dto.setId(null);
|
||||
boolean result = service.updateById(dto);
|
||||
|
||||
if (result) {
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), String.valueOf(dto.getId()));
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
if (Objects.isNull(service.getById(id))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<SzRegulatoryFramework>> page(@RequestBody @Validated SzRegulatoryFrameworkPage page) {
|
||||
LambdaQueryChainWrapper<SzRegulatoryFramework> query = service.lambdaQuery();
|
||||
|
||||
if (Objects.nonNull(page.getType())) {
|
||||
query.eq(SzRegulatoryFramework::getType, page.getType());
|
||||
}
|
||||
|
||||
if (Objects.nonNull(page.getName())) {
|
||||
query.like(SzRegulatoryFramework::getName, page.getName());
|
||||
}
|
||||
|
||||
if (Objects.nonNull(page.getFillUnit())) {
|
||||
query.like(SzRegulatoryFramework::getFillUnit, page.getFillUnit());
|
||||
}
|
||||
|
||||
if (Objects.nonNull(page.getStm())) {
|
||||
query.ge(SzRegulatoryFramework::getCreateTime, page.getStm());
|
||||
}
|
||||
|
||||
if (Objects.nonNull(page.getEtm())) {
|
||||
query.le(SzRegulatoryFramework::getCreateTime, page.getEtm());
|
||||
}
|
||||
|
||||
query.orderByDesc(SzRegulatoryFramework::getCreateTime);
|
||||
Page<SzRegulatoryFramework> data = service.page(page.getPageSo().toPage(), query);
|
||||
data.getRecords()
|
||||
.forEach(item -> item.setFiles(fileService.getFiles(getGroupId(), String.valueOf(item.getId()))));
|
||||
return R.ok(data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "SzRegulatoryFramework";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.xyt.entity.so.SzRuleByLawPage;
|
||||
import com.gunshi.project.xyt.model.SzRuleByLaw;
|
||||
import com.gunshi.project.xyt.service.FileAssociationsService;
|
||||
import com.gunshi.project.xyt.service.SzRuleByLawService;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 法律法规管理表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "法律法规管理表")
|
||||
@RestController
|
||||
@RequestMapping(value = "/SzRuleByLaw")
|
||||
public class SzRuleByLawController extends AbstractCommonFileController {
|
||||
|
||||
@Autowired
|
||||
private SzRuleByLawService service;
|
||||
|
||||
@Autowired
|
||||
private FileAssociationsService fileService;
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<SzRuleByLaw> insert(@Validated(Insert.class) @RequestBody SzRuleByLaw dto) {
|
||||
|
||||
if (service.lambdaQuery().eq(SzRuleByLaw::getName, dto.getName())
|
||||
.count() > 0) {
|
||||
throw new IllegalArgumentException("当前名称已存在");
|
||||
}
|
||||
|
||||
dto.setId(IdWorker.getId());
|
||||
dto.setCreateTime(new Date());
|
||||
|
||||
boolean result = service.save(dto);
|
||||
|
||||
|
||||
if (result) {
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), String.valueOf(dto.getId()));
|
||||
}
|
||||
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<SzRuleByLaw> update(@Validated(Update.class) @RequestBody SzRuleByLaw dto) {
|
||||
|
||||
|
||||
if (service.lambdaQuery()
|
||||
.ne(SzRuleByLaw::getId, dto.getId())
|
||||
.eq(SzRuleByLaw::getName, dto.getName())
|
||||
.count() > 0) {
|
||||
throw new IllegalArgumentException("当前名称已存在");
|
||||
}
|
||||
|
||||
dto.setId(null);
|
||||
dto.setCreateTime(null);
|
||||
dto.setCreateBy(null);
|
||||
dto.setCreateName(null);
|
||||
dto.setUpdateTime(new Date());
|
||||
boolean result = service.updateById(dto);
|
||||
|
||||
if (result) {
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), String.valueOf(dto.getId()));
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
if (Objects.isNull(service.getById(id))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<SzRuleByLaw>> page(@RequestBody @Validated SzRuleByLawPage page) {
|
||||
LambdaQueryChainWrapper<SzRuleByLaw> query = service.lambdaQuery();
|
||||
|
||||
if (Objects.nonNull(page.getType())) {
|
||||
query.eq(SzRuleByLaw::getType, page.getType());
|
||||
}
|
||||
|
||||
if (Objects.nonNull(page.getName())) {
|
||||
query.like(SzRuleByLaw::getName, page.getName());
|
||||
}
|
||||
|
||||
if (Objects.nonNull(page.getFillUnit())) {
|
||||
query.like(SzRuleByLaw::getFillUnit, page.getFillUnit());
|
||||
}
|
||||
|
||||
|
||||
query.orderByDesc(SzRuleByLaw::getCreateTime);
|
||||
Page<SzRuleByLaw> data = service.page(page.getPageSo().toPage(), query);
|
||||
data.getRecords()
|
||||
.forEach(item -> item.setFiles(fileService.getFiles(getGroupId(), String.valueOf(item.getId()))));
|
||||
return R.ok(data);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "SzRuleByLaw";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.xyt.model.SzTreatmentBasis;
|
||||
import com.gunshi.project.xyt.service.SzTreatmentBasisService;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 描述: 案件登记表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "处理依据表")
|
||||
@RestController
|
||||
@RequestMapping(value="/szTreatmentBasis")
|
||||
public class SzTreatmentBasisController{
|
||||
|
||||
@Autowired
|
||||
private SzTreatmentBasisService service;
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<SzTreatmentBasis> insert(@Validated(Insert.class) @RequestBody SzTreatmentBasis dto) {
|
||||
|
||||
if (service.lambdaQuery().eq(SzTreatmentBasis::getLegalContent,dto.getLegalContent())
|
||||
.count() > 0) {
|
||||
throw new IllegalArgumentException("当前名称已存在");
|
||||
}
|
||||
|
||||
if (Objects.isNull(dto.getPId())){
|
||||
dto.setPId(0L);
|
||||
}
|
||||
|
||||
dto.setCreateTime(new Date());
|
||||
dto.setId(IdWorker.getId());
|
||||
|
||||
boolean result = service.save(dto);
|
||||
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<SzTreatmentBasis> update(@Validated(Update.class) @RequestBody SzTreatmentBasis dto) {
|
||||
|
||||
|
||||
if (service.lambdaQuery()
|
||||
.ne(SzTreatmentBasis::getId,dto.getId())
|
||||
.eq(SzTreatmentBasis::getLegalContent,dto.getLegalContent())
|
||||
.count() > 0) {
|
||||
throw new IllegalArgumentException("当前名称已存在");
|
||||
}
|
||||
|
||||
dto.setCreateTime(null);
|
||||
dto.setId(null);
|
||||
dto.setUpdateTime(new Date());
|
||||
boolean result = service.updateById(dto);
|
||||
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取详情")
|
||||
@GetMapping("/get/{id}")
|
||||
public R<SzTreatmentBasis> get(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
if (Objects.isNull(service.getById(id))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
return R.ok(service.getById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "获取树")
|
||||
@GetMapping("/get/tree")
|
||||
public R<List<SzTreatmentBasis>> getTree() {
|
||||
List<SzTreatmentBasis> list = service.list();
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
return R.ok(list);
|
||||
}
|
||||
Map<Long, List<SzTreatmentBasis>> listMap = list.stream().collect(Collectors.groupingBy(SzTreatmentBasis::getPId));
|
||||
|
||||
list.forEach(o -> o.setChildren(listMap.get(o.getId())));
|
||||
List<SzTreatmentBasis> parentList = list.stream()
|
||||
.filter(o -> 0L == o.getPId())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
return R.ok(parentList);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
if (Objects.isNull(service.getById(id))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.gunshi.project.xyt.entity.so;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gunshi.core.dateformat.DateFormatString;
|
||||
import com.gunshi.project.xyt.entity.page.GenericPageParams;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/9/24.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class SzCasePage extends GenericPageParams {
|
||||
|
||||
@Schema(description="案件类型 0:违建,1:毁林垦荒,2:筑坝拦汊,3:填占库容,4:违法取水,5:其他")
|
||||
private Integer caseType;
|
||||
|
||||
@Schema(description="案件名称")
|
||||
private String caseName;
|
||||
|
||||
@Schema(description="案件编号")
|
||||
private String caseId;
|
||||
|
||||
@Schema(description="开始时间 格式:yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date stm;
|
||||
|
||||
@Schema(description="结束时间 格式:yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date etm;
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package com.gunshi.project.xyt.entity.so;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gunshi.core.dateformat.DateFormatString;
|
||||
import com.gunshi.project.xyt.entity.page.GenericPageParams;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/9/24.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class SzRegulatoryFrameworkPage extends GenericPageParams {
|
||||
|
||||
@Schema(description="制度类型 0:党支部工作制度,1:行政工作制度,2:部门工作制度,3:安全管理制度,4:工程管理制度,5:技术规程,6:岗位责任制")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description="标题")
|
||||
private String name;
|
||||
|
||||
@Schema(description="发布单位")
|
||||
private String fillUnit;
|
||||
|
||||
@Schema(description="开始时间 格式:yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date stm;
|
||||
|
||||
@Schema(description="结束时间 格式:yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date etm;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.gunshi.project.xyt.entity.so;
|
||||
|
||||
import com.gunshi.project.xyt.entity.page.GenericPageParams;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/9/24.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class SzRuleByLawPage extends GenericPageParams {
|
||||
|
||||
@Schema(description="法律性质 0:宪法,1:法律,2:行政法规,3:督察法规,4:司法解释,5:地方性法规")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description="标题")
|
||||
private String name;
|
||||
|
||||
@Schema(description="制定机关")
|
||||
private String fillUnit;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.gunshi.project.xyt.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/9/24.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SzCaseStatisticsVo {
|
||||
|
||||
@Schema(description="月份")
|
||||
private Integer month;
|
||||
|
||||
@Schema(description="类型")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description="数量")
|
||||
private Integer count;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.gunshi.project.xyt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.xyt.model.SzCase;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/9/24.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface SzCaseMapper extends BaseMapper<SzCase> {
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.gunshi.project.xyt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.xyt.model.SzRegulatoryFramework;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/9/24.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface SzRegulatoryFrameworkMapper extends BaseMapper<SzRegulatoryFramework> {
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.gunshi.project.xyt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.xyt.model.SzRuleByLaw;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/9/24.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface SzRuleByLawMapper extends BaseMapper<SzRuleByLaw> {
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.gunshi.project.xyt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.xyt.model.SzTreatmentBasis;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/9/24.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface SzTreatmentBasisMapper extends BaseMapper<SzTreatmentBasis> {
|
||||
}
|
||||
|
|
@ -19,6 +19,7 @@ import lombok.Data;
|
|||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
|
|
@ -93,6 +94,20 @@ public class SzCase implements Serializable {
|
|||
@NotNull(message = "案件类型不能为空",groups = {Insert.class, Update.class})
|
||||
private Integer caseType;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@TableField(value="lgtd")
|
||||
@Schema(description="经度")
|
||||
private String lgtd;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@TableField(value="lttd")
|
||||
@Schema(description="纬度")
|
||||
private String lttd;
|
||||
|
||||
/**
|
||||
* 发现时间
|
||||
*/
|
||||
|
|
@ -252,7 +267,86 @@ public class SzCase implements Serializable {
|
|||
*/
|
||||
@TableField(value="doc_num_name")
|
||||
@Schema(description="文件编号及名称 ")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
@Size(max = 100,message = "自动履行情况最大长度要小于 100")
|
||||
@Size(max = 100,message = "文件编号及名称最大长度要小于 100")
|
||||
private String docNumName;
|
||||
|
||||
/**
|
||||
* 督办单位类型
|
||||
*/
|
||||
@TableField(value="unit_type")
|
||||
@Schema(description="督办单位类型 0:上级督办,1:本级河长督办")
|
||||
private Integer unitType;
|
||||
|
||||
/**
|
||||
* 督办单位名称
|
||||
*/
|
||||
@TableField(value="unit_name")
|
||||
@Schema(description="督办单位名称")
|
||||
private String unitName;
|
||||
|
||||
/**
|
||||
* 行政复议情况
|
||||
*/
|
||||
@TableField(value="administrative_reconsideration")
|
||||
@Schema(description="行政复议情况 0:维护,1:变更,2:撤销,3:和解,4:调解")
|
||||
private Integer administrativeReconsideration;
|
||||
|
||||
/**
|
||||
* 行政应诉情况
|
||||
*/
|
||||
@TableField(value="administrative_response")
|
||||
@Schema(description="行政复议情况 0:驳回原告诉讼,1:撤销,2:变更,3:确认违法,4:确认无效,5:其他")
|
||||
private Integer administrativeResponse;
|
||||
|
||||
/**
|
||||
* 保管人员
|
||||
*/
|
||||
@TableField(value="custodian")
|
||||
@Schema(description="保管人员")
|
||||
private String custodian;
|
||||
|
||||
/**
|
||||
* 保管地点
|
||||
*/
|
||||
@TableField(value="storage_location")
|
||||
@Schema(description="保管地点")
|
||||
private String storageLocation;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "基本情况文件集合")
|
||||
private List<FileAssociations> files1;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "处理情况文件集合")
|
||||
private List<FileAssociations> files2;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "办案卷宗-立案文件集合")
|
||||
private List<FileAssociations> files3;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "办案卷宗-调查取证文件集合")
|
||||
private List<FileAssociations> files4;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "办案卷宗-审查处理文件集合")
|
||||
private List<FileAssociations> files5;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "办案卷宗-送达执行文件集合")
|
||||
private List<FileAssociations> files6;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "办案卷宗-结案文件集合")
|
||||
private List<FileAssociations> files7;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "历史影像及图片-整改前文件集合")
|
||||
private List<FileAssociations> files8;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "历史影像及图片-整改后文件集合")
|
||||
private List<FileAssociations> files9;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,131 @@
|
|||
package com.gunshi.project.xyt.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.gunshi.core.dateformat.DateFormatString;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/9/24.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
@Schema(description="制度管理表")
|
||||
@Data
|
||||
@TableName("public.sz_regulatory_framework")
|
||||
public class SzRegulatoryFramework implements Serializable {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value="id", type= IdType.AUTO)
|
||||
@Schema(description="主键")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@TableField(value="name")
|
||||
@Schema(description="标题")
|
||||
@Size(max = 30,message = "标题最大长度要小于 30")
|
||||
@NotBlank(message = "标题不能为空",groups = {Insert.class, Update.class})
|
||||
private String name;
|
||||
|
||||
|
||||
/**
|
||||
* 发布单位
|
||||
*/
|
||||
@TableField(value="fill_unit")
|
||||
@Schema(description="发布单位")
|
||||
@Size(max = 50,message = "发布单位最大长度要小于 50")
|
||||
private String fillUnit;
|
||||
|
||||
/**
|
||||
* 制度类型
|
||||
*/
|
||||
@TableField(value="type")
|
||||
@Schema(description="制度类型 0:党支部工作制度,1:行政工作制度,2:部门工作制度,3:安全管理制度,4:工程管理制度,5:技术规程,6:岗位责任制")
|
||||
@NotNull(message = "制度类型不能为空",groups = {Insert.class, Update.class})
|
||||
@Size(max = 1,message = "制度类型最大长度要小于 2")
|
||||
private Integer type;
|
||||
|
||||
|
||||
/**
|
||||
* 创建人Id
|
||||
*/
|
||||
@TableField(value="create_by")
|
||||
@Schema(description="填报人Id")
|
||||
@NotNull(message = "填报人Id不能为空",groups = {Insert.class, Update.class})
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 创建人名字
|
||||
*/
|
||||
@TableField(value="create_name")
|
||||
@Schema(description="填报人名字")
|
||||
@Size(max = 30,message = "填报人名字最大长度要小于 30")
|
||||
@NotBlank(message = "填报人名字不能为空",groups = {Insert.class, Update.class})
|
||||
private String createName;
|
||||
|
||||
/**
|
||||
* 创建人时间
|
||||
*/
|
||||
@Schema(description="填报时间 格式:" + DateFormatString.YYYY_MM_DD_HH_MM_SS)
|
||||
@NotNull(message = "填报时间不能为空")
|
||||
@TableField(value="create_time")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新人Id
|
||||
*/
|
||||
@TableField(value="update_by")
|
||||
@Schema(description="更新人Id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long updateBy;
|
||||
|
||||
/**
|
||||
* 更新人名字
|
||||
*/
|
||||
@TableField(value="update_name")
|
||||
@Schema(description="更新人名字")
|
||||
@NotBlank(message = "更新人名字不能为空",groups = {Insert.class, Update.class})
|
||||
private String updateName;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description="更新时间 格式:" + DateFormatString.YYYY_MM_DD_HH_MM_SS)
|
||||
@TableField(value="update_time")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "文件集合")
|
||||
private List<FileAssociations> files;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,152 @@
|
|||
package com.gunshi.project.xyt.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.gunshi.core.dateformat.DateFormatString;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/9/24.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
@Schema(description="法律法规管理表")
|
||||
@Data
|
||||
@TableName("public.sz_rule_by_law")
|
||||
public class SzRuleByLaw implements Serializable {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value="id", type= IdType.AUTO)
|
||||
@Schema(description="主键")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@TableField(value="name")
|
||||
@Schema(description="标题")
|
||||
@Size(max = 30,message = "标题最大长度要小于 30")
|
||||
@NotBlank(message = "标题不能为空",groups = {Insert.class, Update.class})
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 制定机关
|
||||
*/
|
||||
@TableField(value="fill_unit")
|
||||
@Schema(description="制定机关")
|
||||
@Size(max = 50,message = "制定机关最大长度要小于 50")
|
||||
private String fillUnit;
|
||||
|
||||
/**
|
||||
* 法律性质
|
||||
*/
|
||||
@TableField(value="type")
|
||||
@Schema(description="法律性质 0:宪法,1:法律,2:行政法规,3:督察法规,4:司法解释,5:地方性法规")
|
||||
@NotNull(message = "法律性质不能为空",groups = {Insert.class, Update.class})
|
||||
@Size(max = 1,message = "法律性质最大长度要小于 2")
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 时效性
|
||||
*/
|
||||
@TableField(value="timeliness")
|
||||
@Schema(description="时效性 0:尚未生效,1:有效,2:已修改,3:已废止")
|
||||
@NotNull(message = "时效性不能为空",groups = {Insert.class, Update.class})
|
||||
@Size(max = 1,message = "时效性最大长度要小于 2")
|
||||
private Integer timeliness;
|
||||
|
||||
|
||||
/**
|
||||
* 公布日期
|
||||
*/
|
||||
@Schema(description="公布日期 格式:" + DateFormatString.YYYY_MM_DD)
|
||||
@TableField(value="announcement_date")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD, timezone = "GMT+8")
|
||||
private Date announcementDate;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 施行日期
|
||||
*/
|
||||
@Schema(description="施行日期 格式:" + DateFormatString.YYYY_MM_DD)
|
||||
@TableField(value="implementation_date")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD, timezone = "GMT+8")
|
||||
private Date implementationDate;
|
||||
|
||||
|
||||
/**
|
||||
* 创建人Id
|
||||
*/
|
||||
@TableField(value="create_by")
|
||||
@Schema(description="填报人Id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 创建人名字
|
||||
*/
|
||||
@TableField(value="create_name")
|
||||
@Schema(description="填报人名字")
|
||||
@Size(max = 30,message = "填报人名字最大长度要小于 30")
|
||||
private String createName;
|
||||
|
||||
/**
|
||||
* 创建人时间
|
||||
*/
|
||||
@Schema(description="填报时间 格式:" + DateFormatString.YYYY_MM_DD_HH_MM_SS)
|
||||
@TableField(value="create_time")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新人Id
|
||||
*/
|
||||
@TableField(value="update_by")
|
||||
@Schema(description="更新人Id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long updateBy;
|
||||
|
||||
/**
|
||||
* 更新人名字
|
||||
*/
|
||||
@TableField(value="update_name")
|
||||
@Schema(description="更新人名字")
|
||||
@Size(max = 30,message = "更新人名字最大长度要小于 30")
|
||||
private String updateName;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description="更新时间 格式:" + DateFormatString.YYYY_MM_DD_HH_MM_SS)
|
||||
@TableField(value="update_time")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date updateTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "文件集合")
|
||||
private List<FileAssociations> files;
|
||||
}
|
||||
|
|
@ -0,0 +1,153 @@
|
|||
package com.gunshi.project.xyt.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.gunshi.core.dateformat.DateFormatString;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/9/24.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
@Schema(description="处理依据表")
|
||||
@Data
|
||||
@TableName("public.sz_treatment_basis")
|
||||
public class SzTreatmentBasis implements Serializable {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value="id", type= IdType.AUTO)
|
||||
@Schema(description="主键")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 节点id
|
||||
*/
|
||||
@TableField(value="p_id")
|
||||
@Schema(description="节点id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long pId;
|
||||
|
||||
/**
|
||||
* 创建人Id
|
||||
*/
|
||||
@TableField(value="create_by")
|
||||
@Schema(description="填报人Id")
|
||||
@NotNull(message = "填报人Id不能为空",groups = {Insert.class, Update.class})
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 创建人名字
|
||||
*/
|
||||
@TableField(value="create_name")
|
||||
@Schema(description="填报人名字")
|
||||
@Size(max = 30,message = "填报人名字最大长度要小于 30")
|
||||
@NotBlank(message = "填报人名字不能为空",groups = {Insert.class, Update.class})
|
||||
private String createName;
|
||||
|
||||
/**
|
||||
* 创建人时间
|
||||
*/
|
||||
@Schema(description="填报时间 格式:" + DateFormatString.YYYY_MM_DD_HH_MM_SS)
|
||||
@NotNull(message = "填报时间不能为空")
|
||||
@TableField(value="create_time")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@TableField(value="status")
|
||||
@Schema(description="状态 0:启用,1:禁用")
|
||||
@NotNull(message = "状态不能为空",groups = {Insert.class, Update.class})
|
||||
@Size(max = 1,message = "状态最大长度要小于 2")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 节点
|
||||
*/
|
||||
@TableField(value="legal_name")
|
||||
@Schema(description="法律名称")
|
||||
@Size(max = 50,message = "法律名称最大长度要小于 50")
|
||||
@NotBlank(message = "法律名称不能为空",groups = {Insert.class, Update.class})
|
||||
private String legalName;
|
||||
|
||||
/**
|
||||
* 法条内容
|
||||
*/
|
||||
@TableField(value="legal_content")
|
||||
@Schema(description="法条内容")
|
||||
@Size(max = 2000,message = "法条内容最大长度要小于 2000")
|
||||
private String legalContent;
|
||||
|
||||
/**
|
||||
* 违法行为描述
|
||||
*/
|
||||
@TableField(value="violation_desc")
|
||||
@Schema(description="违法行为描述")
|
||||
@Size(max = 2000,message = "违法行为描述最大长度要小于 2000")
|
||||
private String violationDesc;
|
||||
|
||||
/**
|
||||
* 处罚措施
|
||||
*/
|
||||
@TableField(value="penalties")
|
||||
@Schema(description="处罚措施")
|
||||
@Size(max = 2000,message = "处罚措施最大长度要小于 2000")
|
||||
private String penalties;
|
||||
|
||||
|
||||
/**
|
||||
* 更新人Id
|
||||
*/
|
||||
@TableField(value="update_by")
|
||||
@Schema(description="更新人Id")
|
||||
@NotNull(message = "更新人Id不能为空",groups = {Insert.class, Update.class})
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long updateBy;
|
||||
|
||||
/**
|
||||
* 更新人名字
|
||||
*/
|
||||
@TableField(value="update_name")
|
||||
@Schema(description="更新人名字")
|
||||
@Size(max = 30,message = "更新人名字最大长度要小于 30")
|
||||
private String updateName;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description="更新时间 格式:" + DateFormatString.YYYY_MM_DD_HH_MM_SS)
|
||||
@TableField(value="update_time")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "子集")
|
||||
private List<SzTreatmentBasis> children;
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.gunshi.project.xyt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gunshi.project.xyt.mapper.SzCaseMapper;
|
||||
import com.gunshi.project.xyt.model.SzCase;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/9/24.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class SzCaseService extends ServiceImpl<SzCaseMapper, SzCase> {
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.gunshi.project.xyt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gunshi.project.xyt.mapper.SzRegulatoryFrameworkMapper;
|
||||
import com.gunshi.project.xyt.model.SzRegulatoryFramework;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/9/24.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class SzRegulatoryFrameworkService extends ServiceImpl<SzRegulatoryFrameworkMapper, SzRegulatoryFramework> {
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.gunshi.project.xyt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gunshi.project.xyt.mapper.SzRuleByLawMapper;
|
||||
import com.gunshi.project.xyt.model.SzRuleByLaw;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/9/24.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class SzRuleByLawService extends ServiceImpl<SzRuleByLawMapper, SzRuleByLaw> {
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.gunshi.project.xyt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gunshi.project.xyt.mapper.SzTreatmentBasisMapper;
|
||||
import com.gunshi.project.xyt.model.SzTreatmentBasis;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/9/24.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class SzTreatmentBasisService extends ServiceImpl<SzTreatmentBasisMapper, SzTreatmentBasis> {
|
||||
}
|
||||
|
|
@ -85,6 +85,35 @@ public class DateUtil {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 年初
|
||||
* @param year
|
||||
* @return
|
||||
*/
|
||||
public static Date beginOfYearToDate(Integer year){
|
||||
if (year == null) {
|
||||
throw new IllegalArgumentException("Year cannot be null");
|
||||
}
|
||||
|
||||
LocalDate localDate = LocalDate.of(year, 1, 1);
|
||||
return Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
|
||||
}
|
||||
|
||||
/**
|
||||
* 年末
|
||||
* @param year
|
||||
* @return
|
||||
*/
|
||||
public static Date endOfYearToDate(Integer year){
|
||||
if (year == null) {
|
||||
throw new IllegalArgumentException("Year cannot be null");
|
||||
}
|
||||
LocalDateTime time = LocalDateTime.of(year, 1, 1, 0, 0, 0, 0);
|
||||
time = time.plusYears(1).minusSeconds(1);
|
||||
return Date.from(time.atZone(ZoneId.systemDefault()).toInstant());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 将Date对象转换为LocalDateTime对象.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gunshi.project.xyt.mapper.SzCaseMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gunshi.project.xyt.mapper.SzRegulatoryFrameworkMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gunshi.project.xyt.mapper.SzRuleByLawMapper">
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue