相关bug修改

master
wany 2026-04-01 14:01:30 +08:00
parent 907c2f429f
commit 294b6fa699
7 changed files with 35 additions and 11 deletions

View File

@ -17,7 +17,7 @@
<packaging>pom</packaging> <packaging>pom</packaging>
<description> <description>
黑石咀水库系统 - 父级POM 双石水库系统 - 父级POM
</description> </description>
<modules> <modules>

View File

@ -33,7 +33,7 @@ public class DocCategoryController {
return R.ok(flg); return R.ok(flg);
} }
@Operation(summary = "更新分类") @Operation(summary = "删除分类")
@GetMapping("/del/{id}") @GetMapping("/del/{id}")
public R<Boolean> edit(@PathVariable("id") Long id){ public R<Boolean> edit(@PathVariable("id") Long id){
Boolean flg = docCategoryService.del(id); Boolean flg = docCategoryService.del(id);

View File

@ -30,7 +30,7 @@ public class FundBudgetController extends AbstractCommonFileController {
@Operation(description = "根据年份查询") @Operation(description = "根据年份查询")
@GetMapping("/get/{year}") @GetMapping("/get/{year}")
public R<FundBudget> get(@PathVariable("year") Integer year){ public R<FundBudget> get(@PathVariable("year") String year){
FundBudget res = fundBudgetService.getByYear(year); FundBudget res = fundBudgetService.getByYear(year);
if(res!=null){ if(res!=null){
List<FileAssociations> files = fileService.getFiles(getGroupId(), res.getId().toString()); List<FileAssociations> files = fileService.getFiles(getGroupId(), res.getId().toString());
@ -51,7 +51,7 @@ public class FundBudgetController extends AbstractCommonFileController {
@Operation(description = "统计") @Operation(description = "统计")
@GetMapping("stat") @GetMapping("stat")
public R<FundBudget> stat(@RequestParam(value = "year",required = false) @Parameter(description = "年份") Integer year){ public R<FundBudget> stat(@RequestParam(value = "year",required = false) @Parameter(description = "年份") String year){
FundBudget res = fundBudgetService.stat(year); FundBudget res = fundBudgetService.stat(year);
return R.ok(res); return R.ok(res);
} }

View File

@ -118,15 +118,34 @@ public class DocCategoryService extends ServiceImpl<DocCategoryMapper, DocCatego
} }
public Boolean edit(DocCategory docCategory) { public Boolean edit(DocCategory docCategory) {
Long id = docCategory.getId();
DocCategory oldCat = this.getById(id);
Integer level = docCategory.getLevel();
//如果三级类目下有档案,则不能修改成二级类目
if(oldCat.getLevel() == 3 && level == 2){
LambdaQueryWrapper<DocCenter> lambdaQueryWrapper= new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(DocCenter::getDocCategoryId, id);
Long count = docCenterMapper.selectCount(lambdaQueryWrapper);
if(count > 0){
throw new IllegalArgumentException("对不起,该类目下关联有档案,无法修改为二级类目");
}
}
//如果该二级类目下有三级类目则不能改成三级类目
if(oldCat.getLevel() == 2 && level == 3){
LambdaQueryWrapper<DocCategory> query= new LambdaQueryWrapper<>();
query.eq(DocCategory::getParentId, id);
Long cnt = baseMapper.selectCount(query);
if(cnt > 0){
throw new IllegalArgumentException("对不起,该类目下有三级类目,无法修改为三级类目");
}
}
updateById(docCategory); updateById(docCategory);
docPermissionConfigService.deleteByDocCategoryId(docCategory.getId()); docPermissionConfigService.deleteByDocCategoryId(id);
if(docCategory.getPermissions() != null){ if(docCategory.getPermissions() != null){
List<DocPermissionConfig> permissions = docCategory.getPermissions(); List<DocPermissionConfig> permissions = docCategory.getPermissions();
permissions.stream().forEach(item -> {item.setCategoryId(docCategory.getId());}); permissions.stream().forEach(item -> {item.setCategoryId(id);});
docPermissionConfigService.saveBatch(permissions); docPermissionConfigService.saveBatch(permissions);
} }
//TODO 同步更新所有关联档案的档案号(这里不用该,我到时候直接递归查上来然后进行拼接即可)
return true; return true;
} }

View File

@ -204,6 +204,11 @@ public class DocCenterService extends ServiceImpl<DocCenterMapper, DocCenter> {
//设置废止时间(为替换档案的新增时间) //设置废止时间(为替换档案的新增时间)
replaceOne.setAbolishTime(now); replaceOne.setAbolishTime(now);
updateById(replaceOne); updateById(replaceOne);
//老的替换档案的废止时间置空
DocCenter old = lambdaQuery().eq(DocCenter::getId, oldReplaceId).one();
old.setAbolishTime(null);
updateById(old);
} }
boolean flag = updateById(docCenter); boolean flag = updateById(docCenter);
docOperateLogService.saveLog(docCenter,2); docOperateLogService.saveLog(docCenter,2);

View File

@ -64,14 +64,14 @@ public class FundBudgetService extends ServiceImpl<FundBudgetMapper, FundBudget
return update; return update;
} }
public FundBudget getByYear(Integer year) { public FundBudget getByYear(String year) {
LambdaQueryWrapper<FundBudget> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<FundBudget> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(FundBudget::getBudgetYear, year); queryWrapper.eq(FundBudget::getBudgetYear, year);
FundBudget one = baseMapper.selectOne(queryWrapper); FundBudget one = baseMapper.selectOne(queryWrapper);
return one; return one;
} }
public FundBudget stat(Integer year) { public FundBudget stat(String year) {
FundBudget fundBudget = new FundBudget(); FundBudget fundBudget = new FundBudget();
LambdaQueryWrapper<FundBudget> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<FundBudget> queryWrapper = new LambdaQueryWrapper<>();
if(year != null){ if(year != null){

View File

@ -412,7 +412,7 @@ public class RainBasinDivisionService {
//接口不知道是好的还是坏的,反正这个接口坏了别影响其它的接口 //接口不知道是好的还是坏的,反正这个接口坏了别影响其它的接口
e.printStackTrace(); e.printStackTrace();
} }
stPptnDetailsVo.setStnm(stStatusVo.getStnm());
res.add(stPptnDetailsVo); res.add(stPptnDetailsVo);
} }