Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-cr20g
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
dsk-cr20g
Commits
c9b8058d
Commit
c9b8058d
authored
Jul 31, 2023
by
lcl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
逻辑优化
parent
6a8ded58
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
44 additions
and
89 deletions
+44
-89
BusinessInfoController.java
...m/dsk/web/controller/business/BusinessInfoController.java
+1
-2
SysUser.java
.../main/java/com/dsk/common/core/domain/entity/SysUser.java
+12
-0
BusinessListDto.java
...a/com/dsk/system/domain/business/dto/BusinessListDto.java
+6
-6
BusinessInfoServiceImpl.java
.../com/dsk/system/service/impl/BusinessInfoServiceImpl.java
+6
-15
CustomerServiceImpl.java
...java/com/dsk/system/service/impl/CustomerServiceImpl.java
+1
-0
BusinessInfoMapper.xml
...src/main/resources/mapper/business/BusinessInfoMapper.xml
+9
-64
SysUserMapper.xml
...system/src/main/resources/mapper/system/SysUserMapper.xml
+9
-2
No files found.
dsk-admin/src/main/java/com/dsk/web/controller/business/BusinessInfoController.java
View file @
c9b8058d
...
@@ -52,8 +52,7 @@ public class BusinessInfoController extends BaseController
...
@@ -52,8 +52,7 @@ public class BusinessInfoController extends BaseController
public
TableDataInfo
list
(
BusinessListDto
dto
)
public
TableDataInfo
list
(
BusinessListDto
dto
)
{
{
startPage
();
startPage
();
List
<
BusinessListVo
>
list
=
businessInfoService
.
selectBusinessInfoList
(
dto
);
return
getDataTable
(
businessInfoService
.
selectBusinessInfoList
(
dto
));
return
getDataTable
(
list
);
}
}
/**
/**
...
...
dsk-common/src/main/java/com/dsk/common/core/domain/entity/SysUser.java
View file @
c9b8058d
...
@@ -69,6 +69,9 @@ public class SysUser extends BaseEntity
...
@@ -69,6 +69,9 @@ public class SysUser extends BaseEntity
@Excel
(
name
=
"最后登录时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd HH:mm:ss"
,
type
=
Excel
.
Type
.
EXPORT
)
@Excel
(
name
=
"最后登录时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd HH:mm:ss"
,
type
=
Excel
.
Type
.
EXPORT
)
private
Date
loginDate
;
private
Date
loginDate
;
//是否体验用户 0否 1是
private
Integer
isExperience
;
/** 部门对象 */
/** 部门对象 */
@Excels
({
@Excels
({
@Excel
(
name
=
"部门名称"
,
targetAttr
=
"deptName"
,
type
=
Excel
.
Type
.
EXPORT
),
@Excel
(
name
=
"部门名称"
,
targetAttr
=
"deptName"
,
type
=
Excel
.
Type
.
EXPORT
),
...
@@ -296,6 +299,14 @@ public class SysUser extends BaseEntity
...
@@ -296,6 +299,14 @@ public class SysUser extends BaseEntity
this
.
roleId
=
roleId
;
this
.
roleId
=
roleId
;
}
}
public
Integer
getIsExperience
()
{
return
isExperience
;
}
public
void
setIsExperience
(
Integer
isExperience
)
{
this
.
isExperience
=
isExperience
;
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
...
@@ -312,6 +323,7 @@ public class SysUser extends BaseEntity
...
@@ -312,6 +323,7 @@ public class SysUser extends BaseEntity
.
append
(
"delFlag"
,
getDelFlag
())
.
append
(
"delFlag"
,
getDelFlag
())
.
append
(
"loginIp"
,
getLoginIp
())
.
append
(
"loginIp"
,
getLoginIp
())
.
append
(
"loginDate"
,
getLoginDate
())
.
append
(
"loginDate"
,
getLoginDate
())
.
append
(
"isExperience"
,
getIsExperience
())
.
append
(
"createBy"
,
getCreateBy
())
.
append
(
"createBy"
,
getCreateBy
())
.
append
(
"createTime"
,
getCreateTime
())
.
append
(
"createTime"
,
getCreateTime
())
.
append
(
"updateBy"
,
getUpdateBy
())
.
append
(
"updateBy"
,
getUpdateBy
())
...
...
dsk-system/src/main/java/com/dsk/system/domain/business/dto/BusinessListDto.java
View file @
c9b8058d
...
@@ -11,6 +11,11 @@ import java.util.List;
...
@@ -11,6 +11,11 @@ import java.util.List;
**/
**/
@Data
@Data
public
class
BusinessListDto
{
public
class
BusinessListDto
{
/**
* 是否私人数据 0:否 1:是
*/
private
Integer
isPrivate
;
/**
/**
* 项目名称
* 项目名称
*/
*/
...
@@ -19,12 +24,7 @@ public class BusinessListDto {
...
@@ -19,12 +24,7 @@ public class BusinessListDto {
/**
/**
* 用户id
* 用户id
*/
*/
private
Integer
userId
;
private
Long
userId
;
/**
* 用户查看全部他人可见项目标示
*/
private
Long
others
;
/**
/**
* 省id
* 省id
...
...
dsk-system/src/main/java/com/dsk/system/service/impl/BusinessInfoServiceImpl.java
View file @
c9b8058d
...
@@ -9,10 +9,7 @@ import com.dsk.acc.openapi.client.util.CommonUtils;
...
@@ -9,10 +9,7 @@ import com.dsk.acc.openapi.client.util.CommonUtils;
import
com.dsk.common.config.RuoYiConfig
;
import
com.dsk.common.config.RuoYiConfig
;
import
com.dsk.common.constant.HttpStatus
;
import
com.dsk.common.constant.HttpStatus
;
import
com.dsk.common.core.domain.AjaxResult
;
import
com.dsk.common.core.domain.AjaxResult
;
import
com.dsk.common.core.domain.entity.BusinessInfo
;
import
com.dsk.common.core.domain.entity.*
;
import
com.dsk.common.core.domain.entity.BusinessLabel
;
import
com.dsk.common.core.domain.entity.BusinessRelateCompany
;
import
com.dsk.common.core.domain.entity.BusinessUser
;
import
com.dsk.common.exception.ServiceException
;
import
com.dsk.common.exception.ServiceException
;
import
com.dsk.common.exception.base.BaseException
;
import
com.dsk.common.exception.base.BaseException
;
import
com.dsk.common.utils.*
;
import
com.dsk.common.utils.*
;
...
@@ -95,18 +92,12 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
...
@@ -95,18 +92,12 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
*/
*/
@Override
@Override
public
List
<
BusinessListVo
>
selectBusinessInfoList
(
BusinessListDto
dto
)
{
public
List
<
BusinessListVo
>
selectBusinessInfoList
(
BusinessListDto
dto
)
{
List
<
BusinessListVo
>
othersList
=
new
ArrayList
<>();
SysUser
user
=
SecurityUtils
.
getLoginUser
().
getUser
();
//userId不传值,就查询全部他人可见项目+自己的
dto
.
setUserId
(
user
.
getUserId
());
if
(
dto
.
getUserId
()
==
null
)
{
if
(
user
.
getIsExperience
()
==
1
){
dto
.
setOthers
(
SecurityUtils
.
getUserId
());
dto
.
setIsPrivate
(
1
);
//查询他人可见项目
othersList
=
businessInfoMapper
.
selectBusinessInfoList
(
dto
);
}
}
dto
.
setOthers
(
null
);
return
businessInfoMapper
.
selectBusinessInfoList
(
dto
);
//查询自己参与的项目
List
<
BusinessListVo
>
businessList
=
businessInfoMapper
.
selectBusinessInfoList
(
dto
);
businessList
.
addAll
(
othersList
);
return
businessList
;
}
}
@Override
@Override
...
...
dsk-system/src/main/java/com/dsk/system/service/impl/CustomerServiceImpl.java
View file @
c9b8058d
...
@@ -7,6 +7,7 @@ import cn.hutool.core.util.ObjectUtil;
...
@@ -7,6 +7,7 @@ import cn.hutool.core.util.ObjectUtil;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.dsk.common.annotation.DataScope
;
import
com.dsk.common.annotation.DataScope
;
import
com.dsk.common.core.domain.R
;
import
com.dsk.common.core.domain.R
;
import
com.dsk.common.core.domain.entity.SysUser
;
import
com.dsk.common.exception.ServiceException
;
import
com.dsk.common.exception.ServiceException
;
import
com.dsk.common.utils.SecurityUtils
;
import
com.dsk.common.utils.SecurityUtils
;
import
com.dsk.common.utils.StringUtils
;
import
com.dsk.common.utils.StringUtils
;
...
...
dsk-system/src/main/resources/mapper/business/BusinessInfoMapper.xml
View file @
c9b8058d
...
@@ -105,9 +105,12 @@
...
@@ -105,9 +105,12 @@
LEFT JOIN business_label l on l.business_id = i.id
LEFT JOIN business_label l on l.business_id = i.id
LEFT JOIN sys_user u on u.user_id = bu.user_id
LEFT JOIN sys_user u on u.user_id = bu.user_id
<where>
<where>
<if
test=
"
userId != null
"
>
<if
test=
"
isPrivate == 1
"
>
and bu.user_id = #{userId}
and bu.user_id = #{userId}
</if>
</if>
<if
test=
"isPrivate == 0 "
>
and (bu.user_id = #{userId} or i.is_private = 1)
</if>
<if
test=
"projectType != null and projectType != ''"
>
<if
test=
"projectType != null and projectType != ''"
>
and i.project_type in
and i.project_type in
<foreach
collection=
"projectType"
item=
"projectType"
open=
"("
separator=
","
close=
")"
>
<foreach
collection=
"projectType"
item=
"projectType"
open=
"("
separator=
","
close=
")"
>
...
@@ -123,85 +126,27 @@
...
@@ -123,85 +126,27 @@
</foreach>
</foreach>
</if>
</if>
<if
test=
"projectName != null and projectName != ''"
>
<if
test=
"projectName != null and projectName != ''"
>
and i.project_name like concat('%',#{projectName},'%')
and ( i.project_name like concat('%',#{projectName},'%')
</if>
or i.construction_unit like concat('%',#{projectName},'%') )
<if
test=
"ownerCompany != null and ownerCompany != ''"
>
or i.construction_unit like concat('%',#{ownerCompany},'%')
</if>
<if
test=
"others != null"
>
and bu.user_id != #{others} and i.is_private = 1
</if>
</if>
<if
test=
"provinceId != null and provinceId.size > 0 "
>
<if
test=
"provinceId != null and provinceId.size > 0 and cityId == null and districtId == null"
>
and i.province_id in
and i.province_id in
<foreach
collection=
"provinceId"
item=
"provinceId"
open=
"("
separator=
","
close=
")"
>
<foreach
collection=
"provinceId"
item=
"provinceId"
open=
"("
separator=
","
close=
")"
>
#{provinceId}
#{provinceId}
</foreach>
</foreach>
</if>
</if>
<if
test=
"cityId != null and cityId.size > 0
and provinceId == null and districtId == null
"
>
<if
test=
"cityId != null and cityId.size > 0 "
>
and i.city_id in
and i.city_id in
<foreach
collection=
"cityId"
item=
"cityId"
open=
"("
separator=
","
close=
")"
>
<foreach
collection=
"cityId"
item=
"cityId"
open=
"("
separator=
","
close=
")"
>
#{cityId}
#{cityId}
</foreach>
</foreach>
</if>
</if>
<if
test=
"districtId != null and districtId.size > 0
and provinceId == null and cityId == null
"
>
<if
test=
"districtId != null and districtId.size > 0"
>
and i.district_id in
and i.district_id in
<foreach
collection=
"districtId"
item=
"districtId"
open=
"("
separator=
","
close=
")"
>
<foreach
collection=
"districtId"
item=
"districtId"
open=
"("
separator=
","
close=
")"
>
#{districtId}
#{districtId}
</foreach>
</foreach>
</if>
</if>
<if
test=
"provinceId != null and provinceId.size > 0 and cityId != null and cityId.size > 0 and districtId == null"
>
and (
i.province_id in
<foreach
collection=
"provinceId"
item=
"provinceId"
open=
"("
separator=
","
close=
")"
>
#{provinceId}
</foreach>
or i.city_id in
<foreach
collection=
"cityId"
item=
"cityId"
open=
"("
separator=
","
close=
")"
>
#{cityId}
</foreach>
)
</if>
<if
test=
"provinceId != null and provinceId.size > 0 and districtId != null and districtId.size > 0 and cityId == null"
>
and (
i.province_id in
<foreach
collection=
"provinceId"
item=
"provinceId"
open=
"("
separator=
","
close=
")"
>
#{provinceId}
</foreach>
or i.district_id in
<foreach
collection=
"districtId"
item=
"districtId"
open=
"("
separator=
","
close=
")"
>
#{districtId}
</foreach>
)
</if>
<if
test=
"cityId != null and cityId.size > 0 and districtId != null and districtId.size > 0 and provinceId ==null"
>
and (
i.city_id in
<foreach
collection=
"cityId"
item=
"cityId"
open=
"("
separator=
","
close=
")"
>
#{cityId}
</foreach>
or i.district_id in
<foreach
collection=
"districtId"
item=
"districtId"
open=
"("
separator=
","
close=
")"
>
#{districtId}
</foreach>
)
</if>
<if
test=
"provinceId != null and provinceId.size > 0 and cityId != null and cityId.size > 0 and districtId != null and districtId.size > 0"
>
and (
i.province_id in
<foreach
collection=
"provinceId"
item=
"provinceId"
open=
"("
separator=
","
close=
")"
>
#{provinceId}
</foreach>
or i.city_id in
<foreach
collection=
"cityId"
item=
"cityId"
open=
"("
separator=
","
close=
")"
>
#{cityId}
</foreach>
or i.district_id in
<foreach
collection=
"districtId"
item=
"districtId"
open=
"("
separator=
","
close=
")"
>
#{districtId}
</foreach>
)
</if>
</where>
</where>
GROUP BY i.id
GROUP BY i.id
ORDER BY i.create_time DESC
ORDER BY i.create_time DESC
...
...
dsk-system/src/main/resources/mapper/system/SysUserMapper.xml
View file @
c9b8058d
...
@@ -18,6 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -18,6 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"delFlag"
column=
"del_flag"
/>
<result
property=
"delFlag"
column=
"del_flag"
/>
<result
property=
"loginIp"
column=
"login_ip"
/>
<result
property=
"loginIp"
column=
"login_ip"
/>
<result
property=
"loginDate"
column=
"login_date"
/>
<result
property=
"loginDate"
column=
"login_date"
/>
<result
property=
"isExperience"
column=
"is_experience"
/>
<result
property=
"createBy"
column=
"create_by"
/>
<result
property=
"createBy"
column=
"create_by"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateBy"
column=
"update_by"
/>
<result
property=
"updateBy"
column=
"update_by"
/>
...
@@ -47,7 +48,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -47,7 +48,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
</resultMap>
<sql
id=
"selectUserVo"
>
<sql
id=
"selectUserVo"
>
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber,
u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.is_experience, u.create_by, u.create_time, u.remark,
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
from sys_user u
from sys_user u
...
@@ -57,7 +59,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -57,7 +59,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
</sql>
<select
id=
"selectUserList"
parameterType=
"SysUser"
resultMap=
"SysUserResult"
>
<select
id=
"selectUserList"
parameterType=
"SysUser"
resultMap=
"SysUserResult"
>
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status,
u.del_flag, u.login_ip, u.login_date, u.is_experience, u.create_by, u.create_time, u.remark, d.dept_name, d.leader
from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
left join sys_dept d on u.dept_id = d.dept_id
where u.del_flag = '0'
where u.del_flag = '0'
<if
test=
"userId != null and userId != 0"
>
<if
test=
"userId != null and userId != 0"
>
...
@@ -154,6 +158,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -154,6 +158,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"sex != null and sex != ''"
>
sex,
</if>
<if
test=
"sex != null and sex != ''"
>
sex,
</if>
<if
test=
"password != null and password != ''"
>
password,
</if>
<if
test=
"password != null and password != ''"
>
password,
</if>
<if
test=
"status != null and status != ''"
>
status,
</if>
<if
test=
"status != null and status != ''"
>
status,
</if>
<if
test=
"isExperience != null "
>
is_experience,
</if>
<if
test=
"createBy != null and createBy != ''"
>
create_by,
</if>
<if
test=
"createBy != null and createBy != ''"
>
create_by,
</if>
<if
test=
"remark != null and remark != ''"
>
remark,
</if>
<if
test=
"remark != null and remark != ''"
>
remark,
</if>
create_time
create_time
...
@@ -168,6 +173,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -168,6 +173,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"sex != null and sex != ''"
>
#{sex},
</if>
<if
test=
"sex != null and sex != ''"
>
#{sex},
</if>
<if
test=
"password != null and password != ''"
>
#{password},
</if>
<if
test=
"password != null and password != ''"
>
#{password},
</if>
<if
test=
"status != null and status != ''"
>
#{status},
</if>
<if
test=
"status != null and status != ''"
>
#{status},
</if>
<if
test=
"isExperience != null "
>
#{isExperience},
</if>
<if
test=
"createBy != null and createBy != ''"
>
#{createBy},
</if>
<if
test=
"createBy != null and createBy != ''"
>
#{createBy},
</if>
<if
test=
"remark != null and remark != ''"
>
#{remark},
</if>
<if
test=
"remark != null and remark != ''"
>
#{remark},
</if>
sysdate()
sysdate()
...
@@ -188,6 +194,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -188,6 +194,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"status != null and status != ''"
>
status = #{status},
</if>
<if
test=
"status != null and status != ''"
>
status = #{status},
</if>
<if
test=
"loginIp != null and loginIp != ''"
>
login_ip = #{loginIp},
</if>
<if
test=
"loginIp != null and loginIp != ''"
>
login_ip = #{loginIp},
</if>
<if
test=
"loginDate != null"
>
login_date = #{loginDate},
</if>
<if
test=
"loginDate != null"
>
login_date = #{loginDate},
</if>
<if
test=
"isExperience != null"
>
is_experience = #{isExperience},
</if>
<if
test=
"updateBy != null and updateBy != ''"
>
update_by = #{updateBy},
</if>
<if
test=
"updateBy != null and updateBy != ''"
>
update_by = #{updateBy},
</if>
<if
test=
"remark != null"
>
remark = #{remark},
</if>
<if
test=
"remark != null"
>
remark = #{remark},
</if>
update_time = sysdate()
update_time = sysdate()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment