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

ibizdev提交

上级 a22c77d3
......@@ -22,7 +22,7 @@ mock.onGet('v7/ouindex-viewappmenu').reply((config: any) => {
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
iconcls: 'fa fa-university',
icon: '',
textcls: '',
appfunctag: 'Auto3',
......@@ -40,7 +40,7 @@ mock.onGet('v7/ouindex-viewappmenu').reply((config: any) => {
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
iconcls: 'fa fa-sitemap',
icon: '',
textcls: '',
appfunctag: 'Auto2',
......@@ -58,7 +58,7 @@ mock.onGet('v7/ouindex-viewappmenu').reply((config: any) => {
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
iconcls: 'fa fa-user',
icon: '',
textcls: '',
appfunctag: 'Auto1',
......
......@@ -17,10 +17,3 @@
// this is less
.view-container.degridview{
>.view-card.view-no-caption{
>.ivu-card-body{
height: 100%;
}
}
}
\ No newline at end of file
......@@ -17,10 +17,3 @@
// this is less
.view-container.degridview{
>.view-card.view-no-caption{
>.ivu-card-body{
height: 100%;
}
}
}
\ No newline at end of file
......@@ -17,10 +17,3 @@
// this is less
.view-container.degridview{
>.view-card.view-no-caption{
>.ivu-card-body{
height: 100%;
}
}
}
\ No newline at end of file
......@@ -7,6 +7,7 @@ import * as mutations from './mutations';
import * as getters from './getters';
import viewaction from './modules/view-action'
import unifiedresource from './modules/unified-resource'
const state = {
...rootstate
......@@ -20,7 +21,8 @@ const store = new Vuex.Store({
mutations,
getters,
modules: {
viewaction
viewaction,
unifiedresource
},
});
......
/**
* 提交统一资源数据
*
* @param param0
* @param data
*/
export const commitResourceData = ({ commit, state }: { commit: any, state: any }, { unires, enablepermissionvalid }: { unires: Array<any>, enablepermissionvalid: boolean }) => {
if(unires && unires.length > 0){
commit('setResourceData', unires);
}
if(enablepermissionvalid){
commit('setEnablePermissionValid', enablepermissionvalid);
}
}
\ No newline at end of file
/**
* 判断指定统一资源是否存在
*
* @param state
*/
export const getResourceData = (state: any) => (resourcetag: string) => {
let itemIndex: any = state.resourceData.findIndex((obj: any, objIndex: any, objs: any) => {
return Object.is(obj.unirescode, resourcetag);
})
return itemIndex === -1 ? false : true;
}
/**
* 获取是否开启权限认证
*
* @param state
*/
export const getEnablePermissionValid = (state: any) => {
return state.enablePermissionValid;
}
\ No newline at end of file
import { resourcestate } from './state';
import * as actions from './actions';
import * as mutations from './mutations';
import * as getters from './getters';
const state = {
...resourcestate
}
export default {
namespaced: true,
state,
getters,
actions,
mutations
}
\ No newline at end of file
/**
* 设置统一资源数据
*
* @param state
* @param resourceArray
*/
export const setResourceData = (state: any, resourceArray:Array<any>) => {
if(resourceArray && resourceArray.length === 0){
return;
}
state.resourceData = resourceArray;
}
/**
* 设置是否开启权限认证
*
* @param state
* @param resourceArray
*/
export const setEnablePermissionValid = (state: any, enablepermissionvalid:boolean) => {
state.enablePermissionValid = enablepermissionvalid;
}
/**
* 所有资源状态
*/
export const resourcestate: any = {
// 统一资源数据
resourceData: [],
// 是否开启权限认证
enablePermissionValid: false
}
\ No newline at end of file
......@@ -206,6 +206,15 @@
padding-bottom: 16px;
}
}
.view-container.degridview, .view-container.degridview9, .view-container.dewfgridview{
>.view-card.view-no-caption{
>.ivu-card-body{
height: 100%;
}
}
}
/*** END:多数据视图属性布局 ***/
// 看板视图,卡片模式
......
......@@ -56,6 +56,8 @@ export class AuthGuard {
const { data }: { data: any } = response;
if (data) {
router.app.$store.commit('addAppData', data);
// 提交统一资源数据
router.app.$store.dispatch('unifiedresource/commitResourceData', data);
}
}
resolve(true);
......
......@@ -449,7 +449,9 @@ export default class OUIndexViewBase extends Vue implements ControlInterface {
if (Object.keys(item).length === 0) {
return;
}
this.click(item);
if(!item.hidden){
this.click(item);
}
}
/**
......@@ -633,11 +635,41 @@ export default class OUIndexViewBase extends Vue implements ControlInterface {
* @memberof OUIndexView
*/
public load(data: any) {
this.handleMenusResource(this.menuMode.getAppMenuItems());
}
/**
* 通过统一资源标识计算菜单
*
* @param {*} data
* @memberof OUIndexView
*/
public handleMenusResource(inputMenus:Array<any>){
if(this.$store.getters['unifiedresource/getEnablePermissionValid']){
this.computedEffectiveMenus(inputMenus);
}
this.dataProcess(this.menuMode.getAppMenuItems());
this.menus = this.menuMode.getAppMenuItems();
this.doMenuSelect();
}
/**
* 计算有效菜单项
*
* @param {*} data
* @memberof OUIndexView
*/
public computedEffectiveMenus(inputMenus:Array<any>){
inputMenus.forEach((_item:any) =>{
if(_item.resourcetag && !this.$store.getters['unifiedresource/getResourceData'](_item.resourcetag)){
_item.hidden = true;
if (_item.items && _item.items.length > 0) {
this.computedEffectiveMenus(_item.items);
}
}
})
}
/**
* 数据处理
*
......
......@@ -26,7 +26,7 @@ export default class OUIndexViewModel {
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
iconcls: 'fa fa-university',
icon: '',
textcls: '',
appfunctag: 'Auto3',
......@@ -44,7 +44,7 @@ export default class OUIndexViewModel {
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
iconcls: 'fa fa-sitemap',
icon: '',
textcls: '',
appfunctag: 'Auto2',
......@@ -62,7 +62,7 @@ export default class OUIndexViewModel {
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
iconcls: 'fa fa-user',
icon: '',
textcls: '',
appfunctag: 'Auto1',
......
......@@ -37,11 +37,6 @@
git clone -b master $para2 ibzou/
export NODE_OPTIONS=--max-old-space-size=4096
cd ibzou/
mvn clean package -Pweb
cd ibzou-app/ibzou-app-web
mvn -Pweb docker:build
mvn -Pweb docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzou-app-web.yaml ibzlab-rt --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
......
......@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBZ_SLEEP}s..." && \
sleep ${IBZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzou-app-web.jar
EXPOSE 30001
EXPOSE 8080
ADD ibzou-app-web.jar /ibzou-app-web.jar
......@@ -3,11 +3,9 @@ services:
ibzou-app-web:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/ibzou-app-web:latest
ports:
- "30001:30001"
- "8080:8080"
networks:
- agent_network
environment:
SPRING_CLOUD_NACOS_DISCOVERY_IP: 172.16.180.237
deploy:
mode: replicated
replicas: 1
......
server:
port: 30001
\ No newline at end of file
port: 8080
\ No newline at end of file
server:
port: 30001
port: 8080
#zuul网关路由设置
zuul:
......
......@@ -2,6 +2,7 @@ package cn.ibizlab.core.ou.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;
......@@ -38,7 +39,7 @@ public interface IBZDepartmentMapper extends BaseMapper<IBZDepartment>{
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql);
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
......@@ -46,7 +47,7 @@ public interface IBZDepartmentMapper extends BaseMapper<IBZDepartment>{
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql);
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
......@@ -54,7 +55,7 @@ public interface IBZDepartmentMapper extends BaseMapper<IBZDepartment>{
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql);
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
......@@ -62,7 +63,7 @@ public interface IBZDepartmentMapper extends BaseMapper<IBZDepartment>{
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql);
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<IBZDepartment> selectByParentdeptid(@Param("deptid") Serializable deptid) ;
......
......@@ -2,6 +2,7 @@ package cn.ibizlab.core.ou.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;
......@@ -37,7 +38,7 @@ public interface IBZEmployeeMapper extends BaseMapper<IBZEmployee>{
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql);
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
......@@ -45,7 +46,7 @@ public interface IBZEmployeeMapper extends BaseMapper<IBZEmployee>{
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql);
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
......@@ -53,7 +54,7 @@ public interface IBZEmployeeMapper extends BaseMapper<IBZEmployee>{
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql);
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
......@@ -61,7 +62,7 @@ public interface IBZEmployeeMapper extends BaseMapper<IBZEmployee>{
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql);
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<IBZEmployee> selectByMdeptid(@Param("deptid") Serializable deptid) ;
......
......@@ -2,6 +2,7 @@ package cn.ibizlab.core.ou.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;
......@@ -39,7 +40,7 @@ public interface IBZOrganizationMapper extends BaseMapper<IBZOrganization>{
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql);
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
......@@ -47,7 +48,7 @@ public interface IBZOrganizationMapper extends BaseMapper<IBZOrganization>{
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql);
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
......@@ -55,7 +56,7 @@ public interface IBZOrganizationMapper extends BaseMapper<IBZOrganization>{
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql);
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
......@@ -63,7 +64,7 @@ public interface IBZOrganizationMapper extends BaseMapper<IBZOrganization>{
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql);
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<IBZOrganization> selectByParentorgid(@Param("orgid") Serializable orgid) ;
......
......@@ -37,17 +37,24 @@ public interface IIBZDepartmentService extends IService<IBZDepartment>{
void updateBatch(List<IBZDepartment> list) ;
Page<IBZDepartment> searchCurDept(IBZDepartmentSearchContext context) ;
Page<IBZDepartment> searchDefault(IBZDepartmentSearchContext context) ;
List<IBZDepartment> selectByParentdeptid(String deptid) ;
void removeByParentdeptid(String deptid) ;
List<IBZDepartment> selectByOrgid(String orgid) ;
void removeByOrgid(String orgid) ;
List<JSONObject> select(String sql);
boolean execute(String sql);
/**
*自定义查询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);
}
......
......@@ -37,17 +37,24 @@ public interface IIBZEmployeeService extends IService<IBZEmployee>{
IBZEmployee get(String key) ;
IBZEmployee getDraft(IBZEmployee et) ;
Page<IBZEmployee> searchDefault(IBZEmployeeSearchContext context) ;
List<IBZEmployee> selectByMdeptid(String deptid) ;
void removeByMdeptid(String deptid) ;
List<IBZEmployee> selectByOrgid(String orgid) ;
void removeByOrgid(String orgid) ;
List<JSONObject> select(String sql);
boolean execute(String sql);
/**
*自定义查询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);
}
......
......@@ -38,14 +38,22 @@ public interface IIBZOrganizationService extends IService<IBZOrganization>{
Page<IBZOrganization> searchSelectSOrg(IBZOrganizationSearchContext context) ;
Page<IBZOrganization> searchSelectPOrg(IBZOrganizationSearchContext context) ;
Page<IBZOrganization> searchDefault(IBZOrganizationSearchContext context) ;
List<IBZOrganization> selectByParentorgid(String orgid) ;
void removeByParentorgid(String orgid) ;
List<JSONObject> select(String sql);
boolean execute(String sql);
/**
*自定义查询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);
}
......
......@@ -4,6 +4,7 @@ import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
......@@ -29,7 +30,6 @@ import cn.ibizlab.core.ou.service.IIBZDepartmentService;
import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.ou.mapper.IBZDepartmentMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -50,11 +50,17 @@ public class IBZDepartmentServiceImpl extends ServiceImpl<IBZDepartmentMapper, I
@Autowired
@Lazy
private cn.ibizlab.core.ou.service.IIBZEmployeeService ibzemployeeService;
@Autowired
@Lazy
private cn.ibizlab.core.ou.service.IIBZOrganizationService ibzorganizationService;
private int batchSize = 500;
@Override
@Transactional
public boolean create(IBZDepartment et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getDeptid()),et);
......@@ -129,6 +135,7 @@ public class IBZDepartmentServiceImpl extends ServiceImpl<IBZDepartmentMapper, I
@Override
@Transactional
public boolean update(IBZDepartment et) {
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("deptid",et.getDeptid())))
return false;
CachedBeanCopier.copy(get(et.getDeptid()),et);
......@@ -182,25 +189,52 @@ public class IBZDepartmentServiceImpl extends ServiceImpl<IBZDepartmentMapper, I
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(IBZDepartment et){
//实体关系[DER1N_IBZDEPT_IBZDEPT_PDEPTID]
if(!ObjectUtils.isEmpty(et.getParentdeptid())){
cn.ibizlab.core.ou.domain.IBZDepartment parentdept=et.getParentdept();
if(ObjectUtils.isEmpty(parentdept)){
cn.ibizlab.core.ou.domain.IBZDepartment majorEntity=ibzdepartmentService.get(et.getParentdeptid());
et.setParentdept(majorEntity);
parentdept=majorEntity;
}
et.setParentdeptname(parentdept.getDeptname());
}
//实体关系[DER1N_IBZDEPT_IBZORG_ORGID]
if(!ObjectUtils.isEmpty(et.getOrgid())){
cn.ibizlab.core.ou.domain.IBZOrganization org=et.getOrg();
if(ObjectUtils.isEmpty(org)){
cn.ibizlab.core.ou.domain.IBZOrganization majorEntity=ibzorganizationService.get(et.getOrgid());
et.setOrg(majorEntity);
org=majorEntity;
}
et.setOrgname(org.getOrgname());
}
}
@Override
public List<JSONObject> select(String sql){
return this.baseMapper.selectBySQL(sql);
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql){
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql);
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql);
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql);
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
......
......@@ -4,6 +4,7 @@ import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
......@@ -29,7 +30,6 @@ import cn.ibizlab.core.ou.service.IIBZEmployeeService;
import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.ou.mapper.IBZEmployeeMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -44,6 +44,14 @@ import org.springframework.util.StringUtils;
@Service("IBZEmployeeServiceImpl")
public class IBZEmployeeServiceImpl extends ServiceImpl<IBZEmployeeMapper, IBZEmployee> implements IIBZEmployeeService {
@Autowired
@Lazy
private cn.ibizlab.core.ou.service.IIBZDepartmentService ibzdepartmentService;
@Autowired
@Lazy
private cn.ibizlab.core.ou.service.IIBZOrganizationService ibzorganizationService;
private int batchSize = 500;
@Override
......@@ -68,6 +76,7 @@ public class IBZEmployeeServiceImpl extends ServiceImpl<IBZEmployeeMapper, IBZEm
@Override
@Transactional
public boolean create(IBZEmployee et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getUserid()),et);
......@@ -87,6 +96,7 @@ public class IBZEmployeeServiceImpl extends ServiceImpl<IBZEmployeeMapper, IBZEm
@Override
@Transactional
public boolean update(IBZEmployee et) {
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("userid",et.getUserid())))
return false;
CachedBeanCopier.copy(get(et.getUserid()),et);
......@@ -174,25 +184,54 @@ public class IBZEmployeeServiceImpl extends ServiceImpl<IBZEmployeeMapper, IBZEm
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(IBZEmployee et){
//实体关系[DER1N_IBZEMP_IBZDEPT_MDEPTID]
if(!ObjectUtils.isEmpty(et.getMdeptid())){
cn.ibizlab.core.ou.domain.IBZDepartment maindept=et.getMaindept();
if(ObjectUtils.isEmpty(maindept)){
cn.ibizlab.core.ou.domain.IBZDepartment majorEntity=ibzdepartmentService.get(et.getMdeptid());
et.setMaindept(majorEntity);
maindept=majorEntity;
}
et.setMdeptcode(maindept.getDeptcode());
et.setMdeptname(maindept.getDeptname());
}
//实体关系[DER1N_IBZEMP_IBZORG_ORGID]
if(!ObjectUtils.isEmpty(et.getOrgid())){
cn.ibizlab.core.ou.domain.IBZOrganization org=et.getOrg();
if(ObjectUtils.isEmpty(org)){
cn.ibizlab.core.ou.domain.IBZOrganization majorEntity=ibzorganizationService.get(et.getOrgid());
et.setOrg(majorEntity);
org=majorEntity;
}
et.setOrgcode(org.getOrgcode());
et.setOrgname(org.getOrgname());
}
}
@Override
public List<JSONObject> select(String sql){
return this.baseMapper.selectBySQL(sql);
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql){
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql);
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql);
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql);
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
......
......@@ -4,6 +4,7 @@ import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
......@@ -29,7 +30,6 @@ import cn.ibizlab.core.ou.service.IIBZOrganizationService;
import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.ou.mapper.IBZOrganizationMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -53,6 +53,8 @@ public class IBZOrganizationServiceImpl extends ServiceImpl<IBZOrganizationMappe
@Autowired
@Lazy
private cn.ibizlab.core.ou.service.IIBZOrganizationService ibzorganizationService;
private int batchSize = 500;
@Override
......@@ -63,6 +65,7 @@ public class IBZOrganizationServiceImpl extends ServiceImpl<IBZOrganizationMappe
@Override
@Transactional
public boolean update(IBZOrganization et) {
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("orgid",et.getOrgid())))
return false;
CachedBeanCopier.copy(get(et.getOrgid()),et);
......@@ -77,6 +80,7 @@ public class IBZOrganizationServiceImpl extends ServiceImpl<IBZOrganizationMappe
@Override
@Transactional
public boolean create(IBZOrganization et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getOrgid()),et);
......@@ -184,25 +188,42 @@ public class IBZOrganizationServiceImpl extends ServiceImpl<IBZOrganizationMappe
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(IBZOrganization et){
//实体关系[DER1N_IBZORG_IBZORG_PORGID]
if(!ObjectUtils.isEmpty(et.getParentorgid())){
cn.ibizlab.core.ou.domain.IBZOrganization parentorg=et.getParentorg();
if(ObjectUtils.isEmpty(parentorg)){
cn.ibizlab.core.ou.domain.IBZOrganization majorEntity=ibzorganizationService.get(et.getParentorgid());
et.setParentorg(majorEntity);
parentorg=majorEntity;
}
et.setParentorgname(parentorg.getOrgname());
}
}
@Override
public List<JSONObject> select(String sql){
return this.baseMapper.selectBySQL(sql);
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql){
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql);
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql);
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql);
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
......
......@@ -21,7 +21,7 @@ import java.io.IOException;
/**
* 权限:向uaa同步当前系统菜单、权限资源任务类
*/
@Component //开启此类需要保证Main中开启了feign :EnableFeignClients
//@Component //开启此类需要保证Main中开启了feign :EnableFeignClients
public class PermissionSyncJob implements ApplicationRunner {
private Log log = LogFactory.getLog(PermissionSyncJob.class);
......@@ -32,7 +32,7 @@ public class PermissionSyncJob implements ApplicationRunner {
@Value("${ibiz.enablePermissionValid:false}")
boolean enablePermissionValid; //是否开启权限校验
@Value("${ibiz.systemid:110B1A3E-4944-47C8-B4C4-EC15FB8982F3}")
@Value("${ibiz.systemid:2C40DFCD-0DF5-47BF-91A5-C45F810B0001}")
private String systemId;
@Override
......
......@@ -80,7 +80,7 @@ ribbon:
#系统是否开启权限验证、是否开启缓存
#缓存模式:关闭缓存(无配置项)、本地缓存(enableCaffeineCache=true-默认)、caffeine+redis两级缓存(enableRedisCache=true)
ibiz:
enablePermissionValid: false
enablePermissionValid: true
enableCaffeineCache: true
#enableRedisCache: true
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册