修复bug:解决用户管理中不选择机构就不能排序的问题

This commit is contained in:
jishenghua
2026-01-31 14:27:07 +08:00
parent 43d50cdaf0
commit 6be053a5c1
4 changed files with 13 additions and 16 deletions

View File

@@ -580,7 +580,7 @@ INSERT INTO `jsh_msg` VALUES (2, '标题1', '内容1', '2019-09-10 00:11:39', '
DROP TABLE IF EXISTS `jsh_orga_user_rel`;
CREATE TABLE `jsh_orga_user_rel` (
`id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
`orga_id` bigint(0) NOT NULL COMMENT '机构id',
`orga_id` bigint(0) NULL DEFAULT NULL COMMENT '机构id',
`user_id` bigint(0) NOT NULL COMMENT '用户id',
`user_blng_orga_dspl_seq` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户在所属机构中显示顺序',
`delete_flag` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '删除标记0未删除1删除',

View File

@@ -190,8 +190,8 @@ select '060301', '销售订单', '0603', '../materials/sale_orders_list.html', b
-- ----------------------------
-- 改管理员的功能权限
-- ----------------------------
update jsh_userbusiness SET Type = 'RoleFunctions', KeyId = '4',
Value = '[13][12][16][14][15][234][236][22][23][220][240][25][217][218][26][194][195][31][59][207][208][209][226][227][228][229][235][237][210][211][242][33][199][243][41][200][201][202][40][232][233][197][203][204][205][206][212]'
update jsh_userbusiness SET Type = 'RoleFunctions', KeyId = '4',
Value = '[13][12][16][14][15][234][236][22][23][220][240][25][217][218][26][194][195][31][59][207][208][209][226][227][228][229][235][237][210][211][242][33][199][243][41][200][201][202][40][232][233][197][203][204][205][206][212]'
where Id = 5;
-- ----------------------------
@@ -1744,4 +1744,11 @@ create index material_id on jsh_serial_number(material_id) using btree;
create index depot_id on jsh_serial_number(depot_id) using btree;
create index type on jsh_user_business(type) using btree;
create index key_id on jsh_user_business(key_id) using btree;
create index tenant_id on jsh_user_business(tenant_id) using btree;
create index tenant_id on jsh_user_business(tenant_id) using btree;
-- --------------------------------------------------------
-- 时间 2026年1月31日
-- by jishenghua
-- 给jsh_user表的orga_id字段改为非必填
-- --------------------------------------------------------
alter table jsh_orga_user_rel change orga_id orga_id bigint(0) NULL DEFAULT NULL COMMENT '机构id';

View File

@@ -553,10 +553,6 @@ public class UserService {
ubObj.put("value", "[" + ue.getRoleId() + "]");
userBusinessService.insertUserBusiness(ubObj, request);
}
if(ue.getOrgaId()==null){
//如果没有选择机构,就不建机构和用户的关联关系
return;
}
if(ue.getOrgaId()!=null && "1".equals(ue.getLeaderFlag())){
//检查当前机构是否存在经理
List<User> checkList = userMapperEx.getListByOrgaId(ue.getId(), ue.getOrgaId());
@@ -707,10 +703,6 @@ public class UserService {
userBusinessService.insertUserBusiness(ubObj, request);
}
}
if (ue.getOrgaId() == null) {
//如果没有选择机构,就不建机构和用户的关联关系
return;
}
if(ue.getOrgaId()!=null && "1".equals(ue.getLeaderFlag())){
//检查当前机构是否存在经理
List<User> checkList = userMapperEx.getListByOrgaId(ue.getId(), ue.getOrgaId());

View File

@@ -17,9 +17,7 @@
<update id="updateOrgaUserRel" parameterType="com.jsh.erp.datasource.entities.OrgaUserRel" >
update jsh_orga_user_rel
<set >
<if test="orgaId != null" >
orga_id = #{orgaId},
</if>
orga_id = #{orgaId},
<if test="userId != null" >
user_id = #{userId},
</if>
@@ -41,4 +39,4 @@
</update>
</mapper>
</mapper>