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

ibizdev提交

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