opt:提交用户页面 部门和角色未回显,提交任务查询优化
This commit is contained in:
@@ -25,38 +25,40 @@
|
||||
sys_user.extuser_id as extuserId
|
||||
</sql>
|
||||
<insert id="insertDataPermission">
|
||||
INSERT INTO sys_user_data_permission(user_id, permission_scope_type, permission_id)
|
||||
VALUES (#{dataPermission.user_id}, #{dataPermission.permission_scope_type}, #{dataPermission.permission_id})
|
||||
INSERT INTO sys_user_data_permission(user_id, permission_scope_type, permission_id) VALUES (#{dataPermission.user_id}, #{dataPermission.permission_scope_type}, #{dataPermission.permission_id})
|
||||
</insert>
|
||||
<delete id="deleteDataPermissionById">
|
||||
DELETE
|
||||
FROM sys_user_data_permission
|
||||
WHERE user_id = #{userId}
|
||||
DELETE FROM sys_user_data_permission WHERE user_id = #{userId}
|
||||
</delete>
|
||||
<resultMap id="UserDetail" type="org.nl.system.service.user.dto.SysUserDetail">
|
||||
<id column="userId" property="user_id"/>
|
||||
<result column="username" property="username"/>
|
||||
<result column="personName" property="person_name"/>
|
||||
<result column="gender" property="gender"/>
|
||||
<result column="phone" property="phone"/>
|
||||
<result column="email" property="email"/>
|
||||
<result column="avatarName" property="avatar_name"/>
|
||||
<result column="avatarPath" property="avatar_path"/>
|
||||
<result column="password" property="password"/>
|
||||
<result column="isAdmin" property="is_admin"/>
|
||||
<result column="isUsed" property="is_used"/>
|
||||
<result column="pwdResetUserId" property="pwd_reset_user_id"/>
|
||||
<result column="pwdResetTime" property="pwd_reset_time"/>
|
||||
<result column="create_id" property="create_id"/>
|
||||
<result column="createName" property="create_name"/>
|
||||
<result column="createTime" property="create_time"/>
|
||||
<result column="updateId" property="update_id"/>
|
||||
<result column="updateName" property="update_name"/>
|
||||
<result column="updateTime" property="update_time"/>
|
||||
<result column="extpersonId" property="extperson_id"/>
|
||||
<result column="extuserId" property="extuser_id"/>
|
||||
<collection property="depts" ofType="org.nl.system.service.dept.dao.SysDept" column="user_id" select="selectDept"></collection>
|
||||
<collection property="roles" ofType="org.nl.system.service.role.dao.SysRole" column="user_id" select="selectRole"></collection>
|
||||
<resultMap id="UserDetail" type="org.nl.system.service.user.dto.SysUserDetail" >
|
||||
<id column="userId" property="user_id" />
|
||||
<result column="username" property="username" />
|
||||
<result column="personName" property="person_name" />
|
||||
<result column="gender" property="gender" />
|
||||
<result column="phone" property="phone" />
|
||||
<result column="email" property="email" />
|
||||
<result column="avatarName" property="avatar_name" />
|
||||
<result column="avatarPath" property="avatar_path" />
|
||||
<result column="password" property="password" />
|
||||
<result column="isAdmin" property="is_admin" />
|
||||
<result column="isUsed" property="is_used" />
|
||||
<result column="pwdResetUserId" property="pwd_reset_user_id" />
|
||||
<result column="pwdResetTime" property="pwd_reset_time" />
|
||||
<result column="create_id" property="create_id" />
|
||||
<result column="createName" property="create_name" />
|
||||
<result column="createTime" property="create_time" />
|
||||
<result column="updateId" property="update_id" />
|
||||
<result column="updateName" property="update_name" />
|
||||
<result column="updateTime" property="update_time" />
|
||||
<result column="extpersonId" property="extperson_id" />
|
||||
<result column="extuserId" property="extuser_id" />
|
||||
<collection property="depts" ofType="org.nl.system.service.dept.dao.SysDept">
|
||||
<id property="dept_id" column="dept_id"/>
|
||||
<result column="dept_name" property="name"/>
|
||||
</collection>
|
||||
<collection property="roles" ofType="org.nl.system.service.role.dao.SysRole">
|
||||
<id property="role_id" column="role_id"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
<select id="getUserDetail" resultMap="UserDetail">
|
||||
SELECT
|
||||
@@ -78,30 +80,17 @@
|
||||
and sys_user.is_used = #{query.is_used}
|
||||
</if>
|
||||
<if test="query.start_time != null">
|
||||
and sys_user.create_time >= #{query.startTime}
|
||||
and and sys_user.create_time >= #{query.startTime}
|
||||
</if>
|
||||
<if test="query.end_time != null">
|
||||
and #{query.end_time} >= sys_user.create_time
|
||||
</if>
|
||||
<if test="query.blurry != null">
|
||||
and (email like #{query.blurry} or username like concat('%',#{query.blurry},'%') or person_name like concat('%',#{query.blurry},'%'))
|
||||
and (email like #{query.blurry} or username like #{query.blurry} or person_name like #{query.blurry})
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectDept" resultType="org.nl.system.service.dept.dao.SysDept">
|
||||
select
|
||||
sys_dept.dept_id as deptId,
|
||||
sys_dept.name as name
|
||||
from sys_dept
|
||||
left join sys_user_dept
|
||||
on sys_user_dept.dept_id = sys_dept.dept_id
|
||||
where user_id = #{user_id}
|
||||
</select>
|
||||
<select id="selectRole" resultType="org.nl.system.service.role.dao.SysRole">
|
||||
select role_id as roleId
|
||||
from sys_users_roles
|
||||
where user_id = #{user_id}
|
||||
</select>
|
||||
|
||||
<select id="getDetailForMap" resultType="java.util.Map">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
@@ -134,15 +123,11 @@
|
||||
</select>
|
||||
<select id="getUserDataPermissionByPermissionId"
|
||||
resultType="org.nl.system.service.user.dto.UserDataPermissionDto">
|
||||
SELECT *
|
||||
FROM sys_user_data_permission
|
||||
WHERE permission_id = #{permissionId}
|
||||
SELECT * FROM sys_user_data_permission WHERE permission_id = #{permissionId}
|
||||
</select>
|
||||
<select id="getUserDataPermissionByUserId"
|
||||
resultType="org.nl.system.service.user.dto.UserDataPermissionDto">
|
||||
SELECT *
|
||||
FROM sys_user_data_permission
|
||||
WHERE user_id = #{userId}
|
||||
SELECT * FROM sys_user_data_permission WHERE user_id = #{userId}
|
||||
</select>
|
||||
<select id="getUserIdByDeptId" resultType="java.lang.String">
|
||||
SELECT
|
||||
|
||||
@@ -93,10 +93,10 @@ public class TaskServiceImpl implements TaskService {
|
||||
map.put("finishTypeList", whereJson.getString("finishTypeList"));
|
||||
}
|
||||
if (StrUtil.isNotEmpty(whereJson.getString("begin_time"))) {
|
||||
map.put("begin_time", whereJson.getString("begin_time"));
|
||||
map.put("begin_time", whereJson.getString("begin_time").substring(0, 10)+" 00:00:00");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(whereJson.getString("end_time"))) {
|
||||
map.put("end_time", whereJson.getString("end_time"));
|
||||
map.put("end_time", whereJson.getString("end_time").substring(0, 10)+" 99:99:99");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(whereJson.getString("is_delete"))) {
|
||||
map.put("is_delete", whereJson.getString("is_delete"));
|
||||
|
||||
@@ -52,60 +52,59 @@
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
SELECT * FROM (
|
||||
SELECT
|
||||
task.*,
|
||||
md.class_name task_type_name,
|
||||
user.person_name AS create_name1,
|
||||
dict.label task_status_name,
|
||||
case when task.task_type like '0105%' then 'LK' when task.task_type like '0107%' then 'LK' ELSE task.product_area end AS final_product_area
|
||||
FROM
|
||||
sch_base_task task
|
||||
LEFT JOIN md_pb_classstandard md ON task.task_type = md.class_code
|
||||
LEFT JOIN sys_user user ON user.username = task.create_name
|
||||
LEFT JOIN sys_dict dict ON dict.`value` = task.task_status AND dict.`code` = 'task_status'
|
||||
WHERE
|
||||
1=1
|
||||
OPTION 输入.is_delete <> ""
|
||||
task.is_delete = 输入.is_delete
|
||||
SELECT
|
||||
task.*,
|
||||
md.class_name task_type_name,
|
||||
user.person_name AS create_name1,
|
||||
dict.label task_status_name,
|
||||
case when task.task_type like '0105%' then 'LK' when task.task_type like '0107%' then 'LK' ELSE task.product_area end AS final_product_area
|
||||
FROM
|
||||
(select
|
||||
tas.*
|
||||
from
|
||||
sch_base_task tas
|
||||
where 1=1
|
||||
OPTION 输入.is_delete <> ""
|
||||
tas.is_delete = 输入.is_delete
|
||||
ENDOPTION
|
||||
OPTION 输入.finished_type <> ""
|
||||
tas.finished_type = 输入.finished_type
|
||||
ENDOPTION
|
||||
OPTION 输入.unFinish <> ""
|
||||
tas.task_status <> '07'
|
||||
ENDOPTION
|
||||
OPTION 输入.task_status <> ""
|
||||
find_in_set( tas.task_status, 输入.task_status)
|
||||
ENDOPTION
|
||||
OPTION 输入.vehicle_code <> ""
|
||||
(tas.vehicle_code like 输入.vehicle_code OR tas.material_code like 输入.vehicle_code OR tas.vehicle_code2 like 输入.vehicle_code)
|
||||
ENDOPTION
|
||||
OPTION 输入.task_code <> ""
|
||||
(tas.task_code like 输入.task_code)
|
||||
ENDOPTION
|
||||
OPTION 输入.point_code1 <> ""
|
||||
(tas.point_code1 like 输入.point_code1)
|
||||
ENDOPTION
|
||||
OPTION 输入.begin_time <> ""
|
||||
tas.create_time >= 输入.begin_time
|
||||
ENDOPTION
|
||||
OPTION 输入.end_time <> ""
|
||||
tas.create_time <= 输入.end_time
|
||||
ENDOPTION
|
||||
) task
|
||||
LEFT JOIN md_pb_classstandard md ON task.task_type = md.class_code
|
||||
LEFT JOIN sys_user user ON user.username = task.create_name
|
||||
LEFT JOIN sys_dict dict ON dict.`value` = task.task_status AND dict.`code` = 'task_status'
|
||||
WHERE
|
||||
1=1
|
||||
OPTION 输入.task_type <> ""
|
||||
md.class_id in 输入.task_type
|
||||
ENDOPTION
|
||||
) a
|
||||
WHERE 1=1
|
||||
OPTION 输入.in_area_id <> ""
|
||||
a.final_product_area IN 输入.in_area_id
|
||||
ENDOPTION
|
||||
OPTION 输入.task_type <> ""
|
||||
md.class_id in 输入.task_type
|
||||
ENDOPTION
|
||||
OPTION 输入.finished_type <> ""
|
||||
task.finished_type = 输入.finished_type
|
||||
ENDOPTION
|
||||
OPTION 输入.begin_time <> ""
|
||||
task.create_time >= 输入.begin_time
|
||||
ENDOPTION
|
||||
OPTION 输入.end_time <> ""
|
||||
task.create_time <= 输入.end_time
|
||||
ENDOPTION
|
||||
OPTION 输入.unFinish <> ""
|
||||
task.task_status <> '07'
|
||||
ENDOPTION
|
||||
OPTION 输入.task_status <> ""
|
||||
find_in_set( task.task_status, 输入.task_status)
|
||||
ENDOPTION
|
||||
OPTION 输入.vehicle_code <> ""
|
||||
(task.vehicle_code like 输入.vehicle_code OR task.material_code like 输入.vehicle_code OR task.vehicle_code2 like 输入.vehicle_code)
|
||||
ENDOPTION
|
||||
OPTION 输入.task_code <> ""
|
||||
(task.task_code like 输入.task_code)
|
||||
ENDOPTION
|
||||
OPTION 输入.point_code1 <> ""
|
||||
(task.point_code1 like 输入.point_code1)
|
||||
ENDOPTION
|
||||
OPTION 输入.begin_time <> ""
|
||||
task.create_time >= 输入.begin_time
|
||||
ENDOPTION
|
||||
OPTION 输入.end_time <> ""
|
||||
task.create_time <= 输入.end_time
|
||||
ENDOPTION
|
||||
) a
|
||||
WHERE 1=1
|
||||
OPTION 输入.in_area_id <> ""
|
||||
a.final_product_area IN 输入.in_area_id
|
||||
ENDOPTION
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
@change="crud.toQuery"
|
||||
@input="onInput()"
|
||||
@change="mytoQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -209,7 +210,6 @@ import crudTask from '@/views/wms/sch/task/task'
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
@@ -219,7 +219,7 @@ export default {
|
||||
name: 'Task',
|
||||
dicts: ['acs_task_type', 'vehicle_type'],
|
||||
components: {
|
||||
pagination, crudOperation, rrOperation, Treeselect, udOperation
|
||||
pagination, crudOperation, rrOperation, Treeselect
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds() {
|
||||
@@ -255,6 +255,7 @@ export default {
|
||||
permission: {
|
||||
|
||||
},
|
||||
query_flag: true,
|
||||
rules: {},
|
||||
classes1: []
|
||||
}
|
||||
@@ -267,13 +268,16 @@ export default {
|
||||
crudTask.getFinishType().then(data => {
|
||||
this.finishTypeList = data
|
||||
})
|
||||
// this.crud.query.task_status = ['-1']
|
||||
// this.crud.toQuery()
|
||||
this.crud.query.createTime = [new Date().daysAgo(7), new Date()]
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
if (this.query_flag) {
|
||||
this.crud.query.begin_time = (new Date().daysAgo(7)).strftime('%F', 'zh')
|
||||
this.crud.query.end_time = (new Date()).strftime('%F', 'zh')
|
||||
this.query_flag = false
|
||||
}
|
||||
},
|
||||
initClass1() {
|
||||
const param = {
|
||||
@@ -285,6 +289,19 @@ export default {
|
||||
this.classes1 = data
|
||||
})
|
||||
},
|
||||
onInput() {
|
||||
this.$forceUpdate()
|
||||
},
|
||||
mytoQuery(array1) {
|
||||
if (array1 === null) {
|
||||
this.crud.query.begin_time = ''
|
||||
this.crud.query.end_time = ''
|
||||
} else {
|
||||
this.crud.query.begin_time = array1[0]
|
||||
this.crud.query.end_time = array1[1]
|
||||
}
|
||||
this.crud.toQuery()
|
||||
},
|
||||
buildTree(classes) {
|
||||
classes.forEach(data => {
|
||||
if (data.children) {
|
||||
|
||||
Reference in New Issue
Block a user