代码更新

This commit is contained in:
2022-12-08 10:29:29 +08:00
parent c0c50900db
commit d4dfe5c07d
16 changed files with 133 additions and 92 deletions

View File

@@ -26,8 +26,10 @@ public interface UserRelateService {
void inserDeptRelate(Long user,Set<Long> deptIds);
void inserRoleRelate(Long user,Set<Long> RoleIds);
void deleteDeptRelate(Set<Long> deptIds);
void deleteRoleRelate(Set<Long> RoleIds);
void deleteDeptRelate(Long user,Set<Long> deptIds);
void deleteRoleRelate(Long user,Set<Long> RoleIds);
void deleteDeptRelate(Set<Long> userIds);
void deleteRoleRelate(Set<Long> userIds);
void updateDeptRelate(Long user,Set<Long> deptIds);
void updateRoleRelate(Long user,Set<Long> RoleIds);
}

View File

@@ -39,28 +39,50 @@ public class UserRelateServiceImpl implements UserRelateService {
}
@Override
public void deleteDeptRelate(Set<Long> deptIds) {
public void deleteDeptRelate(Long user,Set<Long> deptIds) {
if (!CollectionUtils.isEmpty(deptIds)){
String collect = deptIds.stream().map(a -> String.valueOf(a)).collect(Collectors.joining("','"));
String sql="dept_id in ('"+collect+"')";
String sql="user_id = '"+user+"'"+" and dept_id in ('"+collect+"')";
WQLObject.getWQLObject("sys_user_dept").delete(sql);
}
}
@Override
public void deleteDeptRelate(Set<Long> userIds) {
if (!CollectionUtils.isEmpty(userIds)){
String collect = userIds.stream().map(a -> String.valueOf(a)).collect(Collectors.joining("','"));
String sql="user_id in ('"+collect+"')";
WQLObject.getWQLObject("sys_users_roles").delete(sql);
}
}
@Override
public void deleteRoleRelate(Set<Long> RoleIds) {
public void deleteRoleRelate(Long user,Set<Long> RoleIds) {
if (!CollectionUtils.isEmpty(RoleIds)){
String collect = RoleIds.stream().map(a -> String.valueOf(a)).collect(Collectors.joining("','"));
String sql="dept_id in ('"+collect+"')";
WQLObject.getWQLObject("sys_user_dept").delete(sql);
String sql="user_id = '"+user+"'"+" and role_id in ('"+collect+"')";
WQLObject.getWQLObject("sys_users_roles").delete(sql);
}
}
@Override
public void deleteRoleRelate(Set<Long> userIds) {
if (!CollectionUtils.isEmpty(userIds)){
String collect = userIds.stream().map(a -> String.valueOf(a)).collect(Collectors.joining("','"));
String sql="user_id in ('"+collect+"')";
WQLObject.getWQLObject("sys_users_roles").delete(sql);
}
}
@Override
@Transactional
public void updateDeptRelate(Long user, Set<Long> deptIds) {
if (user !=null){
this.deleteDeptRelate(deptIds);
this.deleteDeptRelate(user,deptIds);
this.inserDeptRelate(user,deptIds);
}
}
@@ -69,7 +91,7 @@ public class UserRelateServiceImpl implements UserRelateService {
@Transactional
public void updateRoleRelate(Long user, Set<Long> RoleIds) {
if (user !=null){
this.deleteRoleRelate(RoleIds);
this.deleteRoleRelate(user,RoleIds);
this.inserRoleRelate(user,RoleIds);
}
}

View File

@@ -213,12 +213,14 @@ public class UserServiceImpl implements UserService {
// 清理缓存
User user = findById(id);
delCaches(user.getUser_id(), user.getUsername());
//删除用户部门,角色关系表
}
String collectSql = ids.stream().map(a -> String.valueOf(a)).collect(Collectors.joining("','"));
WQLObject.getWQLObject("sys_user").delete("user_id in ('"+collectSql+"')");
//删除用户部门,角色关系表
userRelateService.deleteDeptRelate(ids);
userRelateService.deleteRoleRelate(ids);
}
@Override

View File

@@ -65,7 +65,7 @@
FROM
md_pb_storagevehicleinfo info
LEFT JOIN md_pb_storagevehicleext ext ON info.storagevehicle_id = ext.storagevehicle_id
LEFT JOIN sys_dict_detail d ON info.storagevehicle_type = d.value and d.name = 'storagevehicle_type'
LEFT JOIN sys_dict d ON info.storagevehicle_type = d.value and d.code = 'storagevehicle_type'
LEFT JOIN MD_ME_MaterialBase mdb ON ext.material_id = mdb.material_id
LEFT JOIN MD_ME_ProducMaterialExt mdp ON mdb.material_id = mdp.material_id
LEFT JOIN sch_base_point point ON info.storagevehicle_code = point.vehicle_code
@@ -102,9 +102,9 @@
dict.label,
dict.value
FROM
sys_dict_detail dict
sys_dict dict
WHERE
dict.name = 'storagevehicle_type'
dict.code = 'storagevehicle_type'
AND dict.value in (30,31,32,33)
ENDSELECT
ENDPAGEQUERY

View File

@@ -52,7 +52,7 @@
point.point_name
FROM
md_pb_storagevehicleinfo s
LEFT JOIN sys_dict_detail d ON s.storagevehicle_type = d.value and d.dict_id = '32'
LEFT JOIN sys_dict d ON s.storagevehicle_type = d.value and d.code = 'storagevehicle_type'
LEFT JOIN sch_base_point point ON point.vehicle_code = s.storagevehicle_code
LEFT JOIN ST_IVT_StructIvt ivt ON point.source_id = ivt.struct_id
LEFT JOIN md_me_materialbase mater ON mater.material_id = ivt.material_id

View File

@@ -52,7 +52,7 @@
FROM
sch_base_point point
LEFT JOIN md_pb_storagevehiclepoint svp ON point.point_id = svp.point_id and svp.set_type <>'02'
LEFT JOIN sys_dict_detail d ON svp.set_type = d.value and d.name = 'set_type'
LEFT JOIN sys_dict d ON svp.set_type = d.value and d.code = 'set_type'
WHERE
point.is_delete = '0'
AND point.is_used = '1'
@@ -77,9 +77,9 @@
dict.label,
dict.value
FROM
sys_dict_detail dict
sys_dict dict
WHERE
dict.name = 'storagevehicle_type'
dict.code = 'storagevehicle_type'
AND dict.value in (30,31,32,33)
ENDSELECT
ENDPAGEQUERY
@@ -91,9 +91,9 @@
dict.label,
dict.value
FROM
sys_dict_detail dict
sys_dict dict
WHERE
dict.name = 'sch_area_type'
dict.code = 'sch_area_type'
AND dict.value in (25,26,32,28)
ENDSELECT
ENDQUERY

View File

@@ -55,7 +55,7 @@
md_pb_storagevehicleinfo info
LEFT JOIN md_pb_storagevehiclepoint svp ON info.storagevehicle_id = svp.storagevehicle_id and svp.set_type <>'01'
LEFT JOIN sch_base_point point ON point.point_id = svp.point_id
LEFT JOIN sys_dict_detail d ON info.storagevehicle_type = d.value and d.name = 'storagevehicle_type'
LEFT JOIN sys_dict d ON info.storagevehicle_type = d.value and d.code = 'storagevehicle_type'
WHERE
info.is_delete = '0'
AND info.is_used = '1'
@@ -99,9 +99,9 @@
dict.label,
dict.value
FROM
sys_dict_detail dict
sys_dict dict
WHERE
dict.name = 'storagevehicle_type'
dict.code = 'storagevehicle_type'
AND dict.value in (30,31,32,33)
ENDSELECT
ENDPAGEQUERY

View File

@@ -1,10 +1,10 @@
[交易说明]
交易名: 产品参数分页查询
所属模块:
功能简述:
版权所有:
表引用:
版本经历:
所属模块:
功能简述:
版权所有:
表引用:
版本经历:
[数据库]
--指定数据库为空采用默认值默认为db.properties中列出的第一个库
@@ -21,26 +21,26 @@
[临时表]
--这边列出来的临时表就会在运行期动态创建
[临时变量]
--所有中间过程变量均可在此处定义
[业务过程]
##########################################
# 1、输入输出检查 #
##########################################
##########################################
# 2、主过程前处理 #
##########################################
##########################################
# 3、业务主过程 #
##########################################
IF 输入.flag = "1"
PAGEQUERY
SELECT
@@ -94,13 +94,13 @@
LEFT JOIN md_me_stockmaterialext s ON m.material_id = s.material_id
LEFT JOIN md_me_producmaterialext p ON m.material_id = p.material_id
LEFT JOIN md_pb_classstandard b ON m.material_type_id = b.class_id
LEFT JOIN sys_dict_detail d1 ON d1.value = p.product_mode and d1.name = 'product_mode'
LEFT JOIN sys_dict_detail d2 ON d2.value = s.is_need_plan and d2.name = 'IS_OR_NOT'
LEFT JOIN sys_dict_detail d3 ON d3.value = s.is_report and d3.name = 'IS_OR_NOT'
LEFT JOIN sys_dict_detail d7 ON d7.value = p.is_report and d7.name = 'IS_OR_NOT'
LEFT JOIN sys_dict_detail d4 ON d4.value = p.is_auto_open and d4.name = 'IS_OR_NOT'
LEFT JOIN sys_dict_detail d5 ON d5.value = p.is_again_put and d5.name = 'IS_OR_NOT'
LEFT JOIN sys_dict_detail d6 ON d6.value = p.product_series and d6.name = 'product_series'
LEFT JOIN sys_dict d1 ON d1.value = p.product_mode and d1.code = 'product_mode'
LEFT JOIN sys_dict d2 ON d2.value = s.is_need_plan and d2.code = 'IS_OR_NOT'
LEFT JOIN sys_dict d3 ON d3.value = s.is_report and d3.code = 'IS_OR_NOT'
LEFT JOIN sys_dict d7 ON d7.value = p.is_report and d7.code = 'IS_OR_NOT'
LEFT JOIN sys_dict d4 ON d4.value = p.is_auto_open and d4.code = 'IS_OR_NOT'
LEFT JOIN sys_dict d5 ON d5.value = p.is_again_put and d5.code = 'IS_OR_NOT'
LEFT JOIN sys_dict d6 ON d6.value = p.product_series and d6.code = 'product_series'
LEFT JOIN md_pb_measureunit u ON u.measure_unit_id = m.base_unit_id
WHERE
m.is_delete = '0'

View File

@@ -55,7 +55,7 @@
detail.label
FROM
st_ivt_bsrealstorattr stor
LEFT JOIN sys_dict_detail detail ON detail.value = stor.stor_type_scode AND detail.dict_id = '30'
LEFT JOIN sys_dict detail ON detail.value = stor.stor_type_scode AND detail.dict_id = '30'
WHERE
stor.is_delete = '0'
OPTION 输入.search <> ""

View File

@@ -117,9 +117,9 @@
label AS text,
value
FROM
sys_dict_detail
sys_dict
WHERE
name = 'product_area'
code = 'product_area'
ENDSELECT
ENDQUERY

View File

@@ -87,9 +87,9 @@
value,
label
FROM
sys_dict_detail
sys_dict
WHERE
name = 'product_area'
code = 'product_area'
ENDSELECT
ENDQUERY

View File

@@ -148,10 +148,10 @@
label AS text,
value
FROM
sys_dict_detail
sys_dict
WHERE
name = 'ST_INV_OUT_TYPE'
code = 'ST_INV_OUT_TYPE'
ENDSELECT
ENDQUERY
ENDIF
ENDIF

View File

@@ -53,7 +53,7 @@
FROM
sch_base_point point
LEFT JOIN SCH_BASE_Region region ON point.region_id = region.region_id
LEFT JOIN sys_dict_detail d3 ON point.lock_type = d3.value and d3.name='d_lock_type'
LEFT JOIN sys_dict d3 ON point.lock_type = d3.value and d3.code='d_lock_type'
WHERE
point.is_delete = '0'
OPTION 输入.region_id <> ""

View File

@@ -56,7 +56,7 @@
FROM
sch_base_task task
LEFT JOIN md_pb_classstandard md ON task.task_type = md.class_code
LEFT JOIN sys_dict_detail dict ON dict.`value` = task.task_status AND dict.`name` = 'task_status'
LEFT JOIN sys_dict dict ON dict.`value` = task.task_status AND dict.`code` = 'task_status'
WHERE
task.is_delete = '0'
OPTION 输入.task_type <> ""

View File

@@ -115,11 +115,10 @@
max(detail.VALUE) AS CODE,
max(detail.label) AS NAME
FROM
sys_dict_detail detail
LEFT JOIN sys_dict dict ON dict.dict_id = detail.dict_id
sys_dict detail
WHERE
1 = 1
AND dict. NAME LIKE '%INV_TYPE%'
AND detail.code LIKE '%INV_TYPE%'
group by detail.VALUE
ENDSELECT
ENDQUERY