|
|
@ -68,7 +68,6 @@ public class BizSignTypeController { |
|
|
|
*/ |
|
|
|
@GetMapping("/getById/{id}") |
|
|
|
@SysLog(module = SystemModule.BIZ, title = "", biz = BizType.QUERY) |
|
|
|
@PreAuthorize("hasRole('biz:signType:query')") |
|
|
|
public R<BizSignTypeVo> getById(@PathVariable("id") String id){ |
|
|
|
BizSignType bizSignType = bizSignTypeService.getById(id); |
|
|
|
BizSignTypeVo typeVo = CopierUtil.copy(bizSignType, new BizSignTypeVo()); |
|
|
@ -93,6 +92,12 @@ public class BizSignTypeController { |
|
|
|
//@PreAuthorize("hasRole('biz:signType:update')")
|
|
|
|
public R<?> updateById(@RequestBody @Valid BizSignType param){ |
|
|
|
BizSignType entity = CopierUtil.copy(param,new BizSignType()); |
|
|
|
long count = bizSignTypeService.count(new LambdaQueryWrapper<BizSignType>() |
|
|
|
.eq(BizSignType::getTypeName,param.getTypeName()) |
|
|
|
.ne(BizSignType::getId,param.getId())); |
|
|
|
if(count>0){ |
|
|
|
return R.error("类型的标题不可重复"); |
|
|
|
} |
|
|
|
boolean result = bizSignTypeService.updateById(entity); |
|
|
|
return R.isTrue(result); |
|
|
|
} |
|
|
@ -106,6 +111,11 @@ public class BizSignTypeController { |
|
|
|
@SysLog(module = SystemModule.BIZ, title = "", biz = BizType.INSERT) |
|
|
|
public R<?> save(@RequestBody @Valid BizSignType param){ |
|
|
|
BizSignType entity = CopierUtil.copy(param,new BizSignType()); |
|
|
|
long count = bizSignTypeService.count(new LambdaQueryWrapper<BizSignType>() |
|
|
|
.eq(BizSignType::getTypeName,param.getTypeName())); |
|
|
|
if(count>0){ |
|
|
|
return R.error("类型的标题不可重复"); |
|
|
|
} |
|
|
|
boolean result = bizSignTypeService.save(entity); |
|
|
|
return R.isTrue(result); |
|
|
|
} |
|
|
|