文档拆分
This commit is contained in:
+7
@@ -50,4 +50,11 @@ public interface SysDepartMapper extends BaseMapper<SysDepart> {
|
||||
*/
|
||||
List<String> getSubDepIdsByOrgCodes(@org.apache.ibatis.annotations.Param("orgCodes") String[] orgCodes);
|
||||
|
||||
/**
|
||||
* 更新所有组织的父节点id
|
||||
* @return
|
||||
*/
|
||||
@Select("UPDATE sys_depart t1 JOIN sys_depart t2 ON t1.parent_code = t2.org_code SET t1.parent_id = t2.id")
|
||||
int updateAllParentId();
|
||||
|
||||
}
|
||||
|
||||
+8
-8
@@ -1,21 +1,19 @@
|
||||
package com.jero.modules.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.ResultType;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
import com.jero.common.system.vo.DictModel;
|
||||
import com.jero.common.system.vo.DictQuery;
|
||||
import com.jero.modules.system.entity.SysDict;
|
||||
import com.jero.modules.system.model.DuplicateCheckVo;
|
||||
import com.jero.modules.system.model.TreeSelectModel;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -49,6 +47,8 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
|
||||
|
||||
public String queryDictTextByKey(@Param("code") String code,@Param("key") String key);
|
||||
|
||||
public String queryDictKeyByText(@Param("code") String code,@Param("text") String key);
|
||||
|
||||
@Deprecated
|
||||
public String queryTableDictTextByKey(@Param("table") String table,@Param("text") String text,@Param("code") String code,@Param("key") String key);
|
||||
|
||||
|
||||
+6
@@ -16,6 +16,12 @@
|
||||
and s.item_value = #{key}
|
||||
</select>
|
||||
|
||||
<!-- 通过字典code获取字典数据 -->
|
||||
<select id="queryDictKeyByText" parameterType="String" resultType="String">
|
||||
select s.item_value from sys_dict_item s
|
||||
where s.dict_id = (select id from sys_dict where dict_code = #{code})
|
||||
and s.item_text = #{text}
|
||||
</select>
|
||||
|
||||
<!--通过查询指定table的 text code 获取字典-->
|
||||
<select id="queryTableDictItemsByCode" parameterType="String" resultType="com.jero.common.system.vo.DictModel">
|
||||
|
||||
+11
-1
@@ -17,7 +17,17 @@
|
||||
|
||||
<!-- 查询用户的所属部门名称信息 -->
|
||||
<select id="getDepNamesByUserIds" resultType="com.jero.modules.system.vo.SysUserDepVo">
|
||||
select d.depart_name,ud.user_id from sys_user_depart ud,sys_depart d where d.id = ud.dep_id and ud.user_id in
|
||||
SELECT
|
||||
d.depart_name,
|
||||
dru.user_id
|
||||
FROM
|
||||
sys_depart_role_user dru,
|
||||
sys_depart_role dr,
|
||||
sys_depart d
|
||||
WHERE
|
||||
d.id = dr.depart_id
|
||||
and dr.id = dru.drole_id
|
||||
and dru.user_id in
|
||||
<foreach collection="userIds" index="index" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
||||
+6
@@ -130,4 +130,10 @@ public interface ISysDepartService extends IService<SysDepart>{
|
||||
* @return
|
||||
*/
|
||||
List<SysDepart> queryByDepartCode(String departCode);
|
||||
|
||||
/**
|
||||
* 更新所有组织的父节点id
|
||||
* @return
|
||||
*/
|
||||
int updateAllParentId();
|
||||
}
|
||||
|
||||
+3
-1
@@ -99,6 +99,8 @@ public class SyncDataServiceImpl implements ISyncDataService{
|
||||
// int insertRowNum = insertDepartFromTree(ppo, 1);
|
||||
// log.info(ppo.getName() + "添加成功条数:" + insertRowNum);
|
||||
}
|
||||
//添加组织的父节点id
|
||||
sysDepartService.updateAllParentId();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -243,7 +245,7 @@ public class SyncDataServiceImpl implements ISyncDataService{
|
||||
sysUser.setThirdId(employee.getWorker_user_id());
|
||||
sysUser.setActivitiSync(CommonConstant.ACT_SYNC_1);
|
||||
sysUser.setWorkNo(employee.getEmployee_id());
|
||||
sysUser.setUpdateTime(employee.getUpdate_time());
|
||||
// sysUser.setUpdateTime(employee.getUpdate_time());
|
||||
|
||||
sysUser.setCreateTime(new Date());
|
||||
sysUser.setCreateBy("admin");
|
||||
|
||||
+5
@@ -534,4 +534,9 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
|
||||
queryWrapper.eq(SysDepart::getOrgCode, departCode);
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateAllParentId() {
|
||||
return this.updateAllParentId();
|
||||
}
|
||||
}
|
||||
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package com.jero.modules.system.util;
|
||||
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: liyawei
|
||||
* @Description:
|
||||
* @Date: Created in 17:23 2022/3/2
|
||||
*/
|
||||
public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
||||
public StringUtils() {
|
||||
}
|
||||
|
||||
public static String listToString(List<String> stringList) {
|
||||
if (CollectionUtils.isEmpty(stringList)) {
|
||||
return null;
|
||||
} else {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
for(int i = 0; i < stringList.size(); ++i) {
|
||||
builder.append((String)stringList.get(i));
|
||||
if (i < stringList.size() - 1) {
|
||||
builder.append(",");
|
||||
}
|
||||
}
|
||||
|
||||
return builder.toString();
|
||||
}
|
||||
}
|
||||
|
||||
public static List<String> stringToList(String string) {
|
||||
return isEmpty(string) ? null : Arrays.asList(string.split(","));
|
||||
}
|
||||
|
||||
public static List<Integer> stringToIntList(String string) {
|
||||
if (isEmpty(string)) {
|
||||
return null;
|
||||
} else {
|
||||
List<Integer> integerList = new ArrayList();
|
||||
String[] stringArray = string.split(",");
|
||||
|
||||
for(int i = 0; i < stringArray.length; ++i) {
|
||||
String str = stringArray[i];
|
||||
if (isNotEmpty(str)) {
|
||||
integerList.add(Integer.valueOf(str));
|
||||
}
|
||||
}
|
||||
|
||||
return integerList;
|
||||
}
|
||||
}
|
||||
|
||||
public static String FilterNull(Object o) {
|
||||
return o != null && !"null".equals(o.toString()) ? o.toString().trim() : "";
|
||||
}
|
||||
|
||||
public static boolean isEmptyWithFilterNull(Object o) {
|
||||
if (o == null) {
|
||||
return true;
|
||||
} else {
|
||||
return "".equals(FilterNull(o.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.jero.modules.system.util;
|
||||
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.UnavailableSecurityManagerException;
|
||||
import org.apache.shiro.session.InvalidSessionException;
|
||||
|
||||
public class UserUtils {
|
||||
|
||||
/**
|
||||
* 获取当前登录用户ID
|
||||
*
|
||||
*/
|
||||
public static String getUserId() {
|
||||
String userId = null;
|
||||
try {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
if(sysUser!=null){
|
||||
userId = sysUser.getId();
|
||||
}
|
||||
} catch (UnavailableSecurityManagerException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InvalidSessionException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return userId;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user