Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
baifang-java
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
单欣鑫
baifang-java
Commits
a3b2d1ba
Commit
a3b2d1ba
authored
Jun 09, 2025
by
法拉51246
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加部门管理得数据隔离,增加地图逆解析接口,选择地图自动填充省市区
首页大屏bug修复,业务员数量进行数据隔离 手机号取消校验 客户信息中得客户姓名非必填
parent
084e290c
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
121 additions
and
17 deletions
+121
-17
UserSaveReqVO.java
...e/system/controller/admin/user/vo/user/UserSaveReqVO.java
+1
-1
AdminUserMapper.java
...r/yudao/module/system/dal/mysql/user/AdminUserMapper.java
+4
-0
CustomerImportExcelVO.java
...ntroller/admin/customerinfo/vo/CustomerImportExcelVO.java
+0
-1
CustomerInfoRespVO.java
.../controller/admin/customerinfo/vo/CustomerInfoRespVO.java
+2
-2
CustomerInfoSaveReqVO.java
...ntroller/admin/customerinfo/vo/CustomerInfoSaveReqVO.java
+0
-2
HomeController.java
...ao/module/visit/controller/admin/home/HomeController.java
+11
-0
InfoPageReqVO.java
.../module/visit/controller/admin/info/vo/InfoPageReqVO.java
+1
-1
InfoRespVO.java
...dao/module/visit/controller/admin/info/vo/InfoRespVO.java
+2
-2
InfoSaveReqVO.java
.../module/visit/controller/admin/info/vo/InfoSaveReqVO.java
+1
-2
HomeServiceImpl.java
...oder/yudao/module/visit/service/home/HomeServiceImpl.java
+29
-4
index.ts
yudao-ui/yudao-ui-admin-vue3/src/api/visit/home/index.ts
+4
-0
UserForm.vue
...ui/yudao-ui-admin-vue3/src/views/system/user/UserForm.vue
+3
-0
index.vue
yudao-ui/yudao-ui-admin-vue3/src/views/system/user/index.vue
+1
-1
CustomerInfoForm.vue
...in-vue3/src/views/visit/customerinfo/CustomerInfoForm.vue
+31
-1
InfoForm.vue
...-ui/yudao-ui-admin-vue3/src/views/visit/info/InfoForm.vue
+31
-0
No files found.
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserSaveReqVO.java
View file @
a3b2d1ba
...
...
@@ -38,7 +38,7 @@ public class UserSaveReqVO {
private
String
remark
;
@Schema
(
description
=
"部门编号"
,
example
=
"我是一个用户"
)
@Not
Blank
(
message
=
"部门编号不能为空"
)
@Not
Null
(
message
=
"部门编号不能为空"
)
@DiffLogField
(
name
=
"部门"
,
function
=
DeptParseFunction
.
NAME
)
private
Long
deptId
;
...
...
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java
View file @
a3b2d1ba
...
...
@@ -9,6 +9,7 @@ import org.apache.ibatis.annotations.Mapper;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.Set
;
@Mapper
public
interface
AdminUserMapper
extends
BaseMapperX
<
AdminUserDO
>
{
...
...
@@ -48,4 +49,7 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
return
selectList
(
AdminUserDO:
:
getDeptId
,
deptIds
);
}
default
List
<
AdminUserDO
>
selectListInDeptIds
(
Set
<
Long
>
deptCondition
){
return
selectList
(
new
LambdaQueryWrapperX
<
AdminUserDO
>().
inIfPresent
(
AdminUserDO:
:
getDeptId
,
deptCondition
));
}
}
yudao-module-visit/src/main/java/cn/iocoder/yudao/module/visit/controller/admin/customerinfo/vo/CustomerImportExcelVO.java
View file @
a3b2d1ba
...
...
@@ -30,7 +30,6 @@ public class CustomerImportExcelVO {
private
String
customerName
;
@ExcelProperty
(
"联系方式"
)
@Pattern
(
regexp
=
"^$|^\\d{11}$"
,
message
=
"联系方式必须是11位数字"
)
private
String
contact
;
@ExcelProperty
(
"公司名称"
)
...
...
yudao-module-visit/src/main/java/cn/iocoder/yudao/module/visit/controller/admin/customerinfo/vo/CustomerInfoRespVO.java
View file @
a3b2d1ba
...
...
@@ -24,8 +24,8 @@ public class CustomerInfoRespVO {
@ExcelProperty
(
"客户姓名"
)
private
String
customerName
;
@Schema
(
description
=
"联系方式
(客户手机号)
"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@ExcelProperty
(
"联系方式
(客户手机号)
"
)
@Schema
(
description
=
"联系方式"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@ExcelProperty
(
"联系方式"
)
private
String
contact
;
@Schema
(
description
=
"公司名称"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
...
...
yudao-module-visit/src/main/java/cn/iocoder/yudao/module/visit/controller/admin/customerinfo/vo/CustomerInfoSaveReqVO.java
View file @
a3b2d1ba
...
...
@@ -14,11 +14,9 @@ public class CustomerInfoSaveReqVO {
private
Long
id
;
@Schema
(
description
=
"客户姓名"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@NotEmpty
(
message
=
"客户姓名不能为空"
)
private
String
customerName
;
@Schema
(
description
=
"联系方式"
)
@Pattern
(
regexp
=
"^$|^\\d{11}$"
,
message
=
"联系方式必须是11位数字"
)
private
String
contact
;
@Schema
(
description
=
"公司名称"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
...
...
yudao-module-visit/src/main/java/cn/iocoder/yudao/module/visit/controller/admin/home/HomeController.java
View file @
a3b2d1ba
package
cn
.
iocoder
.
yudao
.
module
.
visit
.
controller
.
admin
.
home
;
import
cn.hutool.http.HttpUtil
;
import
cn.iocoder.yudao.framework.common.pojo.CommonResult
;
import
cn.iocoder.yudao.module.visit.controller.admin.home.vo.*
;
import
cn.iocoder.yudao.module.visit.service.customerinfo.CustomerInfoService
;
import
cn.iocoder.yudao.module.visit.service.home.HomeService
;
import
cn.iocoder.yudao.module.visit.service.product.ProductService
;
import
com.alibaba.fastjson.JSON
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
org.springframework.validation.annotation.Validated
;
...
...
@@ -17,6 +19,7 @@ import java.time.LocalDate;
import
java.time.LocalDateTime
;
import
java.time.Year
;
import
java.time.YearMonth
;
import
java.util.Map
;
import
java.util.Objects
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
pojo
.
CommonResult
.
success
;
...
...
@@ -154,5 +157,13 @@ public class HomeController {
return
new
LocalDateTime
[]{
startTime
,
endTime
};
}
@GetMapping
(
"/api/map/geocoder"
)
public
CommonResult
<
Map
<
String
,
Object
>>
getGeocoder
(
@RequestParam
String
lat
,
@RequestParam
String
lng
)
{
String
key
=
"2OZBZ-WUCE7-SLKXP-HJVOW-3P6RF-WVB7H"
;
String
url
=
"https://apis.map.qq.com/ws/geocoder/v1/?location="
+
lat
+
","
+
lng
+
"&key="
+
key
;
String
json
=
HttpUtil
.
get
(
url
);
return
success
(
JSON
.
parseObject
(
json
));
}
}
\ No newline at end of file
yudao-module-visit/src/main/java/cn/iocoder/yudao/module/visit/controller/admin/info/vo/InfoPageReqVO.java
View file @
a3b2d1ba
...
...
@@ -21,7 +21,7 @@ public class InfoPageReqVO extends PageParam {
@Schema
(
description
=
"客户姓名"
)
private
String
customerName
;
@Schema
(
description
=
"联系方式
(客户手机号)
"
)
@Schema
(
description
=
"联系方式"
)
private
String
contact
;
@Schema
(
description
=
"客户公司名称"
)
...
...
yudao-module-visit/src/main/java/cn/iocoder/yudao/module/visit/controller/admin/info/vo/InfoRespVO.java
View file @
a3b2d1ba
...
...
@@ -29,8 +29,8 @@ public class InfoRespVO {
@ExcelProperty
(
"客户姓名"
)
private
String
customerName
;
@Schema
(
description
=
"联系方式
(客户手机号)
"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@ExcelProperty
(
"联系方式
(客户手机号)
"
)
@Schema
(
description
=
"联系方式"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@ExcelProperty
(
"联系方式"
)
private
String
contact
;
@Schema
(
description
=
"客户公司名称"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
...
...
yudao-module-visit/src/main/java/cn/iocoder/yudao/module/visit/controller/admin/info/vo/InfoSaveReqVO.java
View file @
a3b2d1ba
...
...
@@ -20,8 +20,7 @@ public class InfoSaveReqVO {
@NotEmpty
(
message
=
"客户姓名不能为空"
)
private
String
customerName
;
@Schema
(
description
=
"联系方式(客户手机号)"
)
@Pattern
(
regexp
=
"^$|^\\d{11}$"
,
message
=
"联系方式必须是11位数字"
)
@Schema
(
description
=
"联系方式"
)
private
String
contact
;
@Schema
(
description
=
"客户公司名称"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
...
...
yudao-module-visit/src/main/java/cn/iocoder/yudao/module/visit/service/home/HomeServiceImpl.java
View file @
a3b2d1ba
...
...
@@ -2,10 +2,13 @@ package cn.iocoder.yudao.module.visit.service.home;
import
cn.hutool.core.collection.CollUtil
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils
;
import
cn.iocoder.yudao.module.system.api.dict.DictDataApi
;
import
cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO
;
import
cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO
;
import
cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO
;
import
cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper
;
import
cn.iocoder.yudao.module.system.service.dept.DeptService
;
import
cn.iocoder.yudao.module.visit.controller.admin.customerinfo.vo.CustomerInfoPageReqVO
;
import
cn.iocoder.yudao.module.visit.controller.admin.home.vo.*
;
import
cn.iocoder.yudao.module.visit.controller.admin.info.vo.InfoPageReqVO
;
...
...
@@ -29,6 +32,8 @@ import java.util.*;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
util
.
collection
.
CollectionUtils
.
convertSet
;
/**
* 主页 Service 实现类
*
...
...
@@ -48,13 +53,20 @@ public class HomeServiceImpl implements HomeService {
private
AdminUserMapper
userMapper
;
@Resource
private
DictDataApi
dictDataApi
;
@Resource
private
DeptService
deptService
;
//首页第一排数据
@Override
public
HomeFirstRespVO
getHomeInfoFirst
(
HomeReqVO
reqVO
)
{
HomeFirstRespVO
homeFirstRespVO
=
new
HomeFirstRespVO
();
//业务员数量(不按时间)
List
<
AdminUserDO
>
userDOS
=
userMapper
.
selectList
();
Long
loginUserDeptId
=
SecurityFrameworkUtils
.
getLoginUserDeptId
();
//查出登录用户的deptId
Set
<
Long
>
deptCondition
=
Collections
.
emptySet
();
//默认不限制
if
(
loginUserDeptId
==
null
||
!
loginUserDeptId
.
equals
(
100L
))
{
//说明是总公司,不限制
deptCondition
=
getDeptCondition
(
loginUserDeptId
);
//不是总公司了,就递归查询该部门以及子部门的所有id
}
List
<
AdminUserDO
>
userDOS
=
userMapper
.
selectListInDeptIds
(
deptCondition
);
homeFirstRespVO
.
setYwysl
(
String
.
valueOf
(
userDOS
.
size
()));
//按创建时间查这段时间的客户数量
CustomerInfoPageReqVO
customerInfoPageReqVO
=
new
CustomerInfoPageReqVO
();
...
...
@@ -92,14 +104,27 @@ public class HomeServiceImpl implements HomeService {
.
count
()));
return
homeFirstRespVO
;
}
/**
* 获得部门条件:查询指定部门的子部门编号们,包括自身
*
* @param deptId 部门编号
* @return 部门编号集合
*/
private
Set
<
Long
>
getDeptCondition
(
Long
deptId
)
{
if
(
deptId
==
null
)
{
return
Collections
.
emptySet
();
}
Set
<
Long
>
deptIds
=
convertSet
(
deptService
.
getChildDeptList
(
deptId
),
DeptDO:
:
getId
);
deptIds
.
add
(
deptId
);
// 包括自身
return
deptIds
;
}
//拜访周统计
@Override
public
HomeBfztjRespVO
getHomeInfoBfztj
(
HomeReqVO
reqVO
)
{
//如果查询时间是空,则start = LocalDateTime.now().minusWeeks(10);
LocalDateTime
start
=
null
;
LocalDateTime
end
=
null
;
if
(
reqVO
.
getSearchTime
()
==
null
)
{
if
(
reqVO
.
getSearchTime
()
==
null
)
{
start
=
LocalDateTime
.
now
().
minusWeeks
(
9
);
end
=
LocalDateTime
.
now
();
}
else
{
...
...
@@ -114,7 +139,7 @@ public class HomeServiceImpl implements HomeService {
List
<
Integer
>
counts
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
LocalDateTime
weekStart
=
start
.
plusWeeks
(
i
);
LocalDateTime
weekStart
=
start
.
plusWeeks
(
i
)
.
with
(
LocalTime
.
MIN
);
;
LocalDateTime
weekEnd
=
weekStart
.
plusDays
(
6
).
with
(
LocalTime
.
MAX
);
LocalDateTime
[]
week
=
new
LocalDateTime
[]{
weekStart
,
weekEnd
};
if
(
weekStart
.
isAfter
(
end
))
break
;
...
...
yudao-ui/yudao-ui-admin-vue3/src/api/visit/home/index.ts
View file @
a3b2d1ba
...
...
@@ -38,4 +38,8 @@ export const homesApi = {
getHomeInfoBfcplxzbqk
:
async
(
params
:
any
)
=>
{
return
await
request
.
get
({
url
:
`/visit/home/getHomeInfoBfcplxzbqk`
,
params
})
},
// 地图逆解析
getMapGeocoder
:
async
(
params
:
any
)
=>
{
return
await
request
.
get
({
url
:
`/visit/home/api/map/geocoder`
,
params
})
},
}
yudao-ui/yudao-ui-admin-vue3/src/views/system/user/UserForm.vue
View file @
a3b2d1ba
...
...
@@ -104,6 +104,7 @@ import {FormRules} from 'element-plus'
import
{
getRefreshToken
,
getTenantId
,
setToken
}
from
"
@/utils/auth
"
;
import
axios
from
"
axios
"
;
import
{
config
}
from
"
@/config/axios/config
"
;
import
{
useUserStoreWithOut
}
from
"
@/store/modules/user
"
;
defineOptions
({
name
:
'
SystemUserForm
'
})
...
...
@@ -194,6 +195,8 @@ const submitForm = async () => {
const
refreshTokenRes
=
await
refreshToken
()
// 2.1 刷新成功,则回放队列的请求 + 当前请求
setToken
((
await
refreshTokenRes
).
data
.
data
)
const
userStore
=
useUserStoreWithOut
()
await
userStore
.
setUserInfoAction
()
message
.
success
(
t
(
'
common.updateSuccess
'
))
}
dialogVisible
.
value
=
false
...
...
yudao-ui/yudao-ui-admin-vue3/src/views/system/user/index.vue
View file @
a3b2d1ba
...
...
@@ -230,7 +230,7 @@ const queryFormRef = ref() // 搜索的表单
/** 查询列表 */
const
getList
=
async
()
=>
{
loading
.
value
=
true
if
(
userStore
.
user
.
deptId
!==
100
){
//如果不是总公司用户,再过滤,总公司用户可以看到所有
if
(
userStore
.
user
.
deptId
!==
100
&&
(
queryParams
.
deptId
===
null
||
queryParams
.
deptId
===
undefined
)
){
//如果不是总公司用户,再过滤,总公司用户可以看到所有
queryParams
.
deptId
=
userStore
.
user
.
deptId
}
try
{
...
...
yudao-ui/yudao-ui-admin-vue3/src/views/visit/customerinfo/CustomerInfoForm.vue
View file @
a3b2d1ba
...
...
@@ -104,6 +104,7 @@ import { CustomerInfoApi, CustomerInfoVO } from '@/api/visit/customerinfo'
import
{
pcaTextArr
}
from
'
element-china-area-data
'
import
MapPicker
from
'
../util/MapPicker.vue
'
import
productTable
from
'
./productTable.vue
'
import
{
homesApi
}
from
"
@/api/visit/home
"
;
/** 客户信息 表单 */
defineOptions
({
name
:
'
CustomerInfoForm
'
})
...
...
@@ -152,7 +153,6 @@ const formData = ref<CustomerFormData>({
department
:
undefined
,
})
const
formRules
=
reactive
({
customerName
:
[{
required
:
true
,
message
:
'
客户姓名不能为空
'
,
trigger
:
'
blur
'
}],
companyName
:
[{
required
:
true
,
message
:
'
公司名称不能为空
'
,
trigger
:
'
blur
'
}],
customerType
:
[{
required
:
true
,
message
:
'
性质等级不能为空
'
,
trigger
:
'
change
'
}],
department
:
[{
required
:
true
,
message
:
'
客户部门不能为空
'
,
trigger
:
'
change
'
}],
...
...
@@ -199,6 +199,36 @@ const handleLocation = ({ lat, lng, address }) => {
formData
.
value
.
locationImage
=
mapUrl
//逆地址解析
const
params
:
any
=
{
lat
:
lat
,
lng
:
lng
}
homesApi
.
getMapGeocoder
(
params
).
then
(
res
=>
{
console
.
log
(
'
逆地址解析结果:
'
,
res
)
if
(
res
.
status
===
0
)
{
const
comp
=
res
.
result
.
address_component
// 赋值到 formData
formData
.
value
.
provinceName
=
comp
.
province
||
''
formData
.
value
.
cityName
=
comp
.
city
||
''
formData
.
value
.
areaName
=
comp
.
district
||
''
formData
.
value
.
regionFullName
=
comp
.
province
+
comp
.
city
+
comp
.
district
const
province
=
formData
.
value
.
provinceName
??
''
let
city
=
formData
.
value
.
cityName
??
''
const
area
=
formData
.
value
.
areaName
??
''
//将省市区修改格式赋值给selectedOptions
if
(
province
.
match
(
/
(
北京|上海|天津|重庆
)
/
)){
city
=
'
市辖区
'
}
selectedOptions
.
value
=
[
province
,
city
,
area
]
//专门回显用的
}
else
{
console
.
warn
(
'
逆地址解析失败:
'
,
res
.
data
.
message
)
}
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
}
/** 打开弹窗 */
const
open
=
async
(
type
:
string
,
id
?:
number
)
=>
{
...
...
yudao-ui/yudao-ui-admin-vue3/src/views/visit/info/InfoForm.vue
View file @
a3b2d1ba
...
...
@@ -142,6 +142,8 @@ import productTable from "@/views/visit/customerinfo/productTable.vue";
import
{
pcaTextArr
}
from
'
element-china-area-data
'
import
MapPicker
from
'
../util/MapPicker.vue
'
import
{
onMounted
}
from
'
vue
'
import
request
from
"
@/config/axios
"
;
import
{
homesApi
}
from
"
@/api/visit/home
"
;
/** 客户拜访记录 表单 */
defineOptions
({
name
:
'
InfoForm
'
})
...
...
@@ -299,6 +301,35 @@ const handleLocation = ({ lat, lng, address }) => {
const
mapUrl
=
`https://apis.map.qq.com/ws/staticmap/v2/?center=
${
lat
}
,
${
lng
}
&zoom=13&size=600*300&maptype=roadmap&markers=size:large|color:0xFFCCFF|label:k|
${
lat
}
,
${
lng
}
&key=
${
mapKey
}
`
formData
.
value
.
locationImage
=
mapUrl
//逆地址解析
const
params
:
any
=
{
lat
:
lat
,
lng
:
lng
}
homesApi
.
getMapGeocoder
(
params
).
then
(
res
=>
{
console
.
log
(
'
逆地址解析结果:
'
,
res
)
if
(
res
.
status
===
0
)
{
const
comp
=
res
.
result
.
address_component
// 赋值到 formData
formData
.
value
.
provinceName
=
comp
.
province
||
''
formData
.
value
.
cityName
=
comp
.
city
||
''
formData
.
value
.
areaName
=
comp
.
district
||
''
formData
.
value
.
regionFullName
=
comp
.
province
+
comp
.
city
+
comp
.
district
const
province
=
formData
.
value
.
provinceName
??
''
let
city
=
formData
.
value
.
cityName
??
''
const
area
=
formData
.
value
.
areaName
??
''
//将省市区修改格式赋值给selectedOptions
if
(
province
.
match
(
/
(
北京|上海|天津|重庆
)
/
)){
city
=
'
市辖区
'
}
selectedOptions
.
value
=
[
province
,
city
,
area
]
//专门回显用的
}
else
{
console
.
warn
(
'
逆地址解析失败:
'
,
res
.
data
.
message
)
}
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
}
...
...
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