Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dili
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
dili
Commits
6e2dc04c
提交
6e2dc04c
authored
8月 29, 2019
作者:
renjianyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
6e156ab5
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
114 行增加
和
67 行删除
+114
-67
GeographysignServiceImpl.java
...hy/bg/service/geographysign/GeographysignServiceImpl.java
+114
-67
没有找到文件。
com.zrqx.geography/src/main/java/com/zrqx/geography/bg/service/geographysign/GeographysignServiceImpl.java
浏览文件 @
6e2dc04c
package
com
.
zrqx
.
geography
.
bg
.
service
.
geographysign
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Iterator
;
import
java.util.List
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -51,8 +53,8 @@ public class GeographysignServiceImpl extends BaseServiceImpl<Geographysign, Str
for
(
Geographysign
geographysign
:
list
)
{
String
path
=
geographysign
.
getProductName
();
String
path1
=
null
;
System
.
out
.
println
(
path
.
indexOf
(
"("
)
+
1
);
path1
=
path
.
substring
(
0
,
path
.
indexOf
(
"("
));
System
.
out
.
println
(
path
.
indexOf
(
"("
)
+
1
);
path1
=
path
.
substring
(
0
,
path
.
indexOf
(
"("
));
System
.
out
.
println
(
path1
);
String
http
=
"https://baike.baidu.com/item/"
+
path1
;
// 每条数据进行爬数据
...
...
@@ -141,45 +143,91 @@ public class GeographysignServiceImpl extends BaseServiceImpl<Geographysign, Str
@Override
public
CountyVo
queryPunct
(
GeographyForm
form
)
{
List
<
CountyTwoVo
>
list
=
mapper
.
querycity
(
form
);
// 最后的list
List
<
CountyTwoVo
>
haveList
=
new
ArrayList
<
CountyTwoVo
>();
// 拆分出来的list
List
<
CountyTwoVo
>
chaList
=
new
ArrayList
<
CountyTwoVo
>();
CountyTwoVo
vo
=
null
;
for
(
int
i
=
list
.
size
()
-
1
;
i
>=
0
;
i
--)
{
CountyTwoVo
s
=
list
.
get
(
i
);
if
(
StringUtils
.
isNotBlank
(
s
.
getName
()))
{
System
.
out
.
println
(
s
.
getName
());
String
[]
countys
=
s
.
getName
().
split
(
"、"
);
if
(
countys
.
length
<=
1
)
{
haveList
.
add
(
list
.
get
(
i
));
continue
;
}
for
(
String
county
:
countys
)
{
vo
=
new
CountyTwoVo
();
vo
.
setName
(
county
);
vo
.
setValue
(
list
.
get
(
i
).
getValue
());
chaList
.
add
(
vo
);
}
}
}
// 重复数据合并
for
(
int
i
=
0
;
i
<
chaList
.
size
()
-
1
;
i
++)
{
for
(
int
j
=
chaList
.
size
()
-
1
;
j
>
i
;
j
--)
{
if
(
chaList
.
get
(
j
).
getName
().
equals
(
chaList
.
get
(
i
).
getName
()))
{
chaList
.
get
(
i
).
setValue
(
chaList
.
get
(
i
).
getValue
()
+
chaList
.
get
(
j
).
getValue
());
chaList
.
remove
(
j
);
}
}
}
//数据合并
for
(
int
i
=
0
;
i
<
haveList
.
size
()
-
1
;
i
++)
{
for
(
int
j
=
chaList
.
size
()
-
1
;
j
>=
0
;
j
--)
{
System
.
out
.
println
(
chaList
.
get
(
j
).
getName
());
System
.
out
.
println
(
haveList
.
get
(
i
).
getName
());
System
.
out
.
println
(
chaList
.
get
(
j
).
getName
().
equals
(
haveList
.
get
(
i
).
getName
()));
if
(
chaList
.
get
(
j
).
getName
().
equals
(
haveList
.
get
(
i
).
getName
()))
{
System
.
out
.
println
();
haveList
.
get
(
i
).
setValue
(
haveList
.
get
(
i
).
getValue
()
+
chaList
.
get
(
j
).
getValue
());
chaList
.
remove
(
j
);
}
}
}
haveList
.
addAll
(
chaList
);
CountyVo
countyVo
=
new
CountyVo
();
countyVo
.
setTable
(
l
ist
);
countyVo
.
setTable
(
haveL
ist
);
countyVo
.
setCount
(
mapper
.
queryIcon
(
form
,
null
).
toString
());
countyVo
.
setRegioncount
(
this
.
getRegionCount
(
form
));
return
countyVo
;
}
/**
* 查询包含多少地区,多个地区重复的去掉
*
* @param form
* @return
*/
private
String
getRegionCount
(
GeographyForm
form
){
private
String
getRegionCount
(
GeographyForm
form
)
{
String
result
=
""
;
List
<
String
>
haveList
=
new
ArrayList
<
String
>();
List
<
Geographysign
>
list
=
mapper
.
getAllSign
(
form
);
for
(
int
i
=
list
.
size
()-
1
;
i
>=
0
;
i
--)
{
for
(
int
i
=
list
.
size
()
-
1
;
i
>=
0
;
i
--)
{
Geographysign
s
=
list
.
get
(
i
);
if
(
StringUtils
.
isNotBlank
(
s
.
getCounty
()))
{
if
(
StringUtils
.
isNotBlank
(
s
.
getCounty
()))
{
System
.
out
.
println
(
s
.
getCounty
());
String
[]
countys
=
s
.
getCounty
().
split
(
"、"
);
if
(
countys
.
length
<=
1
)
{
if
(!
haveList
.
contains
(
countys
[
0
])
)
{
if
(
countys
.
length
<=
1
)
{
if
(!
haveList
.
contains
(
countys
[
0
])
)
{
haveList
.
add
(
countys
[
0
]);
}
continue
;
}
for
(
String
county
:
countys
)
{
if
(!
haveList
.
contains
(
county
))
{
for
(
String
county
:
countys
)
{
if
(!
haveList
.
contains
(
county
))
{
haveList
.
add
(
county
);
}
}
}
}
result
=
haveList
.
size
()
+
""
;
result
=
haveList
.
size
()
+
""
;
return
result
;
}
...
...
@@ -189,18 +237,19 @@ public class GeographysignServiceImpl extends BaseServiceImpl<Geographysign, Str
String
province
=
form
.
getProvince
();
String
city
=
form
.
getCity
();
// 处理直辖市传区的问题
if
(
province
!=
null
)
{
if
(
province
.
equals
(
"天津"
)
||
province
.
equals
(
"北京"
)
||
province
.
equals
(
"上海"
)
||
province
.
equals
(
"重庆"
))
{
if
(
city
!=
null
)
{
if
((
province
.
equals
(
"天津"
)
||
province
.
equals
(
"北京"
)
||
province
.
equals
(
"上海"
)
||
province
.
equals
(
"重庆"
))
&&
(
city
.
equals
(
"天津市"
)
||
city
.
equals
(
"北京市"
)
||
city
.
equals
(
"上海市"
)
||
city
.
equals
(
"重庆市"
)))
{
}
else
{
form
.
setCounty
(
form
.
getCity
());
form
.
setCity
(
null
);
if
(
province
!=
null
)
{
if
(
province
.
equals
(
"天津"
)
||
province
.
equals
(
"北京"
)
||
province
.
equals
(
"上海"
)
||
province
.
equals
(
"重庆"
))
{
if
(
city
!=
null
)
{
if
((
province
.
equals
(
"天津"
)
||
province
.
equals
(
"北京"
)
||
province
.
equals
(
"上海"
)
||
province
.
equals
(
"重庆"
))
&&
(
city
.
equals
(
"天津市"
)
||
city
.
equals
(
"北京市"
)
||
city
.
equals
(
"上海市"
)
||
city
.
equals
(
"重庆市"
)))
{
}
else
{
form
.
setCounty
(
form
.
getCity
());
form
.
setCity
(
null
);
}
}
}
}
}
// 省明细数据
List
<
Geographysign
>
list
=
mapper
.
provinceQuery
(
form
);
...
...
@@ -253,37 +302,36 @@ public class GeographysignServiceImpl extends BaseServiceImpl<Geographysign, Str
@Override
public
List
<
Geographysign
>
imgsj
()
{
return
mapper
.
imgsj
();
return
mapper
.
imgsj
();
}
@Override
public
List
<
ProvinceVo
>
geographySign
(
GeographyForm
form
)
{
// 图标总和数据
List
<
ProvinceVo
>
ProvinceVo
=
new
ArrayList
<>();
List
<
ProvinceVo
>
ProvinceVo
=
new
ArrayList
<>();
ProvinceVo
.
add
(
mapper
.
querysign
(
form
,
"农产品地理标志"
));
ProvinceVo
.
add
(
mapper
.
querysign
(
form
,
"原产地地理标志"
));
ProvinceVo
.
add
(
mapper
.
querysign
(
form
,
"地理标志商标"
));
return
ProvinceVo
;
}
@Override
public
ProvinceTZVo
diagram
(
GeographyForm
form
)
{
ProvinceTZVo
vo
=
new
ProvinceTZVo
();
//
标准企业
ProvinceTZVo
vo
=
new
ProvinceTZVo
();
//
标准企业
vo
.
setCaregorylist
(
mapper
.
diagram
(
form
));
//
核准企业
//
核准企业
vo
.
setApprovallist
(
mapper
.
diagramhz
(
form
));
//日期
//
日期
vo
.
setApprovaldate
(
mapper
.
diagramdate
(
form
));
return
vo
;
}
@Override
...
...
@@ -293,50 +341,49 @@ public class GeographysignServiceImpl extends BaseServiceImpl<Geographysign, Str
@Override
public
List
<
ProvinceVo
>
provincecount
(
GeographyForm
form
)
{
if
(
StringUtils
.
isNotBlank
(
form
.
getProvince
()))
{
return
mapper
.
provincecounty
(
form
);
}
else
{
return
mapper
.
provincecount
(
form
);
if
(
StringUtils
.
isNotBlank
(
form
.
getProvince
()))
{
return
mapper
.
provincecounty
(
form
);
}
else
{
return
mapper
.
provincecount
(
form
);
}
}
@Override
public
CategoryDateVo
querycategory
(
GeographyForm
form
)
{
CategoryDateVo
category
=
new
CategoryDateVo
();
//查询品类
List
<
String
>
categoryall
=
mapper
.
categoryall
();
//注册数量
//
查询品类
List
<
String
>
categoryall
=
mapper
.
categoryall
();
//
注册数量
List
<
Integer
>
list
=
new
ArrayList
<>();
//核准数量
//
核准数量
List
<
Integer
>
hzlist
=
new
ArrayList
<>();
for
(
String
category2
:
categoryall
)
{
form
.
setCategoryOne
(
category2
);
//注册数量
List
<
Integer
>
count
=
mapper
.
registerNumber
(
form
);
if
(
count
.
size
()>
0
)
{
//
注册数量
List
<
Integer
>
count
=
mapper
.
registerNumber
(
form
);
if
(
count
.
size
()
>
0
)
{
list
.
add
(
count
.
get
(
0
));
}
else
{
list
.
add
(
0
);
}
//核准数量
List
<
Integer
>
hzcount
=
mapper
.
approvalNumber
(
form
);
if
(
hzcount
.
size
()>
0
)
{
}
else
{
list
.
add
(
0
);
}
//
核准数量
List
<
Integer
>
hzcount
=
mapper
.
approvalNumber
(
form
);
if
(
hzcount
.
size
()
>
0
)
{
hzlist
.
add
(
hzcount
.
get
(
0
));
}
else
{
hzlist
.
add
(
0
);
}
}
else
{
hzlist
.
add
(
0
);
}
}
//品类类型
//
品类类型
category
.
setCategory
(
categoryall
);
//品类注册数量
//
品类注册数量
category
.
setRegisterNumber
(
list
);
//品类核准企业数量
//
品类核准企业数量
category
.
setApprovalNumber
(
hzlist
);
return
category
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论