|
|
|
|
@ -26,7 +26,9 @@ public class HandleResultMapingController {
|
|
|
|
|
@GetMapping |
|
|
|
|
public Result<Page<SupDictHandleResultMaping>> list(DepartMapingQueryParam param) { |
|
|
|
|
LambdaQueryWrapper<SupDictHandleResultMaping> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
queryWrapper.like(StrUtil.isNotBlank(param.getExternalName()), SupDictHandleResultMaping::getExternalName, param.getExternalName()) |
|
|
|
|
queryWrapper |
|
|
|
|
.eq(SupDictHandleResultMaping::getSource, param.getSource()) |
|
|
|
|
.like(StrUtil.isNotBlank(param.getExternalName()), SupDictHandleResultMaping::getExternalName, param.getExternalName()) |
|
|
|
|
.eq(StrUtil.isNotBlank(param.getInternalId()), SupDictHandleResultMaping::getInternalId, param.getInternalId()) |
|
|
|
|
.orderByDesc(SupDictHandleResultMaping::getCreateTime); |
|
|
|
|
return Result.success(handleResultMapingService.page(Page.of(param.getCurrent(), param.getSize()), queryWrapper)); |
|
|
|
|
@ -49,8 +51,9 @@ public class HandleResultMapingController {
|
|
|
|
|
public Result<Void> update(@RequestBody SupDictHandleResultMaping data) { |
|
|
|
|
if (handleResultMapingService.exists(new LambdaQueryWrapper<SupDictHandleResultMaping>() |
|
|
|
|
.eq(SupDictHandleResultMaping::getExternalName, data.getExternalName()) |
|
|
|
|
.eq(SupDictHandleResultMaping::getSource, data.getSource()) |
|
|
|
|
.ne(SupDictHandleResultMaping::getId, data.getId()))) { |
|
|
|
|
throw new RuntimeException(String.format("单位编码【%s】已存在", data.getExternalName())); |
|
|
|
|
throw new RuntimeException(String.format("处理结果【%s】已存在", data.getExternalName())); |
|
|
|
|
} |
|
|
|
|
data.setUpdateTime(LocalDateTime.now()); |
|
|
|
|
handleResultMapingService.updateById(data); |
|
|
|
|
|