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

xignzi006 发布系统代码

上级 00e0e421
......@@ -1256,10 +1256,6 @@ zuul:
path: /res_partner_titles/**
serviceId: ${ibiz.ref.service.odoo-base:odoo-base}
stripPrefix: false
res_users:
path: /res_users/**
serviceId: ${ibiz.ref.service.odoo-base:odoo-base}
stripPrefix: false
res_users_log:
path: /res_users_logs/**
serviceId: ${ibiz.ref.service.odoo-base:odoo-base}
......
......@@ -17,14 +17,30 @@ import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.businesscentral.util.filter.SearchContextBase;
import cn.ibizlab.businesscentral.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users;
/**
* ServiceApi数据实体[Res_users] 查询条件对象
* 关系型数据实体[Res_users] 查询条件对象
*/
@Slf4j
@Data
public class Res_usersSearchContext extends SearchContextBase {
public class Res_usersSearchContext extends QueryWrapperContext<Res_users> {
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("name", query)
);
}
}
}
package cn.ibizlab.businesscentral.core.odoo_base.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users;
import cn.ibizlab.businesscentral.core.odoo_base.filter.Res_usersSearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface Res_usersMapper extends BaseMapper<Res_users>{
Page<Res_users> searchDefault(IPage page, @Param("srf") Res_usersSearchContext context, @Param("ew") Wrapper<Res_users> wrapper) ;
@Override
Res_users selectById(Serializable id);
@Override
int insert(Res_users entity);
@Override
int updateById(@Param(Constants.ENTITY) Res_users entity);
@Override
int update(@Param(Constants.ENTITY) Res_users entity, @Param("ew") Wrapper<Res_users> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
}
......@@ -19,10 +19,12 @@ import cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users;
import cn.ibizlab.businesscentral.core.odoo_base.filter.Res_usersSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[Res_users] 服务对象接口
*/
public interface IRes_usersService{
public interface IRes_usersService extends IService<Res_users>{
boolean create(Res_users et) ;
void createBatch(List<Res_users> list) ;
......@@ -32,8 +34,23 @@ public interface IRes_usersService{
void removeBatch(Collection<Long> idList) ;
Res_users get(Long key) ;
Page<Res_users> searchDefault(Res_usersSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
List<Res_users> getResUsersByIds(List<String> ids) ;
List<Res_users> getResUsersByEntities(List<Res_users> entities) ;
}
......@@ -45,6 +45,9 @@ public class Res_companyServiceImpl implements IRes_companyService {
@Autowired
res_companyFeignClient res_companyFeignClient;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_base.service.IRes_usersService resUsersService;
@Override
public boolean create(Res_company et) {
......
......@@ -45,6 +45,9 @@ public class Res_partnerServiceImpl implements IRes_partnerService {
@Autowired
res_partnerFeignClient res_partnerFeignClient;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_base.service.IRes_usersService resUsersService;
@Override
public boolean create(Res_partner et) {
......
......@@ -45,6 +45,9 @@ public class Crm_teamServiceImpl implements ICrm_teamService {
@Autowired
crm_teamFeignClient crm_teamFeignClient;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_base.service.IRes_usersService resUsersService;
@Override
public boolean create(Crm_team et) {
......
......@@ -45,6 +45,9 @@ public class Mail_aliasServiceImpl implements IMail_aliasService {
@Autowired
mail_aliasFeignClient mail_aliasFeignClient;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_base.service.IRes_usersService resUsersService;
@Override
public boolean create(Mail_alias et) {
......
......@@ -629,6 +629,7 @@
<!--输出实体[RES_USERS]数据结构 -->
......@@ -790,5 +791,6 @@
<!--输出实体[RES_USERS]外键关系 -->
</databaseChangeLog>
......@@ -47,6 +47,7 @@ public class Res_usersResource {
@Lazy
public Res_usersMapping res_usersMapping;
@PreAuthorize("hasPermission(this.res_usersMapping.toDomain(#res_usersdto),'iBizBusinessCentral-Res_users-Create')")
@ApiOperation(value = "新建用户", tags = {"用户" }, notes = "新建用户")
@RequestMapping(method = RequestMethod.POST, value = "/res_users")
public ResponseEntity<Res_usersDTO> create(@Validated @RequestBody Res_usersDTO res_usersdto) {
......@@ -56,6 +57,7 @@ public class Res_usersResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.res_usersMapping.toDomain(#res_usersdtos),'iBizBusinessCentral-Res_users-Create')")
@ApiOperation(value = "批量新建用户", tags = {"用户" }, notes = "批量新建用户")
@RequestMapping(method = RequestMethod.POST, value = "/res_users/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<Res_usersDTO> res_usersdtos) {
......@@ -64,6 +66,7 @@ public class Res_usersResource {
}
@VersionCheck(entity = "res_users" , versionfield = "writeDate")
@PreAuthorize("hasPermission(this.res_usersService.get(#res_users_id),'iBizBusinessCentral-Res_users-Update')")
@ApiOperation(value = "更新用户", tags = {"用户" }, notes = "更新用户")
@RequestMapping(method = RequestMethod.PUT, value = "/res_users/{res_users_id}")
public ResponseEntity<Res_usersDTO> update(@PathVariable("res_users_id") Long res_users_id, @RequestBody Res_usersDTO res_usersdto) {
......@@ -74,6 +77,7 @@ public class Res_usersResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.res_usersService.getResUsersByEntities(this.res_usersMapping.toDomain(#res_usersdtos)),'iBizBusinessCentral-Res_users-Update')")
@ApiOperation(value = "批量更新用户", tags = {"用户" }, notes = "批量更新用户")
@RequestMapping(method = RequestMethod.PUT, value = "/res_users/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<Res_usersDTO> res_usersdtos) {
......@@ -81,12 +85,14 @@ public class Res_usersResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.res_usersService.get(#res_users_id),'iBizBusinessCentral-Res_users-Remove')")
@ApiOperation(value = "删除用户", tags = {"用户" }, notes = "删除用户")
@RequestMapping(method = RequestMethod.DELETE, value = "/res_users/{res_users_id}")
public ResponseEntity<Boolean> remove(@PathVariable("res_users_id") Long res_users_id) {
return ResponseEntity.status(HttpStatus.OK).body(res_usersService.remove(res_users_id));
}
@PreAuthorize("hasPermission(this.res_usersService.getResUsersByIds(#ids),'iBizBusinessCentral-Res_users-Remove')")
@ApiOperation(value = "批量删除用户", tags = {"用户" }, notes = "批量删除用户")
@RequestMapping(method = RequestMethod.DELETE, value = "/res_users/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<Long> ids) {
......@@ -94,6 +100,7 @@ public class Res_usersResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.res_usersMapping.toDomain(returnObject.body),'iBizBusinessCentral-Res_users-Get')")
@ApiOperation(value = "获取用户", tags = {"用户" }, notes = "获取用户")
@RequestMapping(method = RequestMethod.GET, value = "/res_users/{res_users_id}")
public ResponseEntity<Res_usersDTO> get(@PathVariable("res_users_id") Long res_users_id) {
......@@ -102,6 +109,7 @@ public class Res_usersResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Res_users-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Res_users-Get')")
@ApiOperation(value = "获取默认查询", tags = {"用户" } ,notes = "获取默认查询")
@RequestMapping(method= RequestMethod.GET , value="/res_users/fetchdefault")
public ResponseEntity<List<Res_usersDTO>> fetchDefault(Res_usersSearchContext context) {
......@@ -114,6 +122,7 @@ public class Res_usersResource {
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Res_users-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Res_users-Get')")
@ApiOperation(value = "查询默认查询", tags = {"用户" } ,notes = "查询默认查询")
@RequestMapping(method= RequestMethod.POST , value="/res_users/searchdefault")
public ResponseEntity<Page<Res_usersDTO>> searchDefault(@RequestBody Res_usersSearchContext context) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册