提交 d4892296 编写于 作者: ibizdev's avatar ibizdev

xignzi006 发布系统代码,后台体系[Spring Boot]

上级 18244a38
package cn.ibizlab.businesscentral.core.extensions.service;
import cn.ibizlab.businesscentral.core.odoo_base.service.impl.Res_usersServiceImpl;
import lombok.extern.slf4j.Slf4j;
import cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Primary;
import java.util.*;
/**
* 实体[用户] 自定义服务对象
*/
@Slf4j
@Primary
@Service("Res_usersExService")
public class Res_usersExService extends Res_usersServiceImpl {
@Override
protected Class currentModelClass() {
return com.baomidou.mybatisplus.core.toolkit.ReflectionKit.getSuperClassGenericType(this.getClass().getSuperclass(), 1);
}
/**
* 自定义行为[A]用户扩展
* @param et
* @return
*/
@Override
@Transactional
public Res_users a(Res_users et) {
return super.a(et);
}
}
......@@ -64,6 +64,10 @@ public class res_usersFallback implements res_usersFeignClient{
public Res_users a( Long id, Res_users res_users){
return null;
}
public Boolean checkKey(Res_users res_users){
return false;
}
......
......@@ -60,6 +60,10 @@ public interface res_usersFeignClient {
Res_users getDraft();
@RequestMapping(method = RequestMethod.POST, value = "/res_users/{id}/a")
Res_users a(@PathVariable("id") Long id,@RequestBody Res_users res_users);
@RequestMapping(method = RequestMethod.POST, value = "/res_users/checkkey")
Boolean checkKey(@RequestBody Res_users res_users);
......
......@@ -33,6 +33,7 @@ public interface IRes_usersService extends IService<Res_users>{
void removeBatch(Collection<Long> idList) ;
Res_users get(Long key) ;
Res_users getDraft(Res_users et) ;
Res_users a(Res_users et) ;
boolean checkKey(Res_users et) ;
boolean save(Res_users et) ;
void saveBatch(List<Res_users> list) ;
......
......@@ -1391,6 +1391,13 @@ public class Res_usersServiceImpl extends EBSServiceImpl<Res_usersMapper, Res_us
return et;
}
@Override
@Transactional
public Res_users a(Res_users et) {
//自定义代码
return et;
}
@Override
public boolean checkKey(Res_users et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
......
......@@ -115,6 +115,17 @@ public class Res_usersResource {
return ResponseEntity.status(HttpStatus.OK).body(res_usersMapping.toDto(res_usersService.getDraft(new Res_users())));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Res_users-A-all')")
@ApiOperation(value = "A", tags = {"用户" }, notes = "A")
@RequestMapping(method = RequestMethod.POST, value = "/res_users/{res_users_id}/a")
public ResponseEntity<Res_usersDTO> a(@PathVariable("res_users_id") Long res_users_id, @RequestBody Res_usersDTO res_usersdto) {
Res_users domain = res_usersMapping.toDomain(res_usersdto);
domain.setId(res_users_id);
domain = res_usersService.a(domain);
res_usersdto = res_usersMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(res_usersdto);
}
@ApiOperation(value = "检查用户", tags = {"用户" }, notes = "检查用户")
@RequestMapping(method = RequestMethod.POST, value = "/res_users/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody Res_usersDTO res_usersdto) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册