Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zh-baseversion-project
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
王浩
zh-baseversion-project
Commits
2a38f679
Commit
2a38f679
authored
Sep 20, 2024
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1 基础信息维护-居住区(村庄)新增-外部对接接口开发
parent
6d824f6e
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
455 additions
and
26 deletions
+455
-26
lpgGasController.java
...b/controller/externaldocking/lpggas/lpgGasController.java
+291
-0
DESEncoder.java
.../main/java/com/zehong/web/controller/tool/DESEncoder.java
+33
-22
TUserManageVillage.java
...ain/java/com/zehong/system/domain/TUserManageVillage.java
+28
-0
TCountyLevelRegionMapper.java
...va/com/zehong/system/mapper/TCountyLevelRegionMapper.java
+7
-0
TUserManageVillageMapper.java
...va/com/zehong/system/mapper/TUserManageVillageMapper.java
+14
-0
ITCountyLevelRegionService.java
...com/zehong/system/service/ITCountyLevelRegionService.java
+7
-0
ITUserManageVillageService.java
...com/zehong/system/service/ITUserManageVillageService.java
+14
-0
TCountyLevelRegionServiceImpl.java
...ng/system/service/impl/TCountyLevelRegionServiceImpl.java
+11
-1
TUserManageVillageServiceImpl.java
...ng/system/service/impl/TUserManageVillageServiceImpl.java
+23
-2
TCountyLevelRegionMapper.xml
...main/resources/mapper/system/TCountyLevelRegionMapper.xml
+7
-0
TUserManageVillageMapper.xml
...main/resources/mapper/system/TUserManageVillageMapper.xml
+20
-1
No files found.
zh-baseversion-admin/src/main/java/com/zehong/web/controller/externaldocking/lpggas/lpgGasController.java
View file @
2a38f679
...
@@ -74,6 +74,18 @@ public class lpgGasController {
...
@@ -74,6 +74,18 @@ public class lpgGasController {
@Resource
@Resource
private
ITLpgDeliveryRecordService
itLpgDeliveryRecordService
;
private
ITLpgDeliveryRecordService
itLpgDeliveryRecordService
;
/**
* 县级行政区
*/
@Resource
private
ITCountyLevelRegionService
countyLevelRegionService
;
/**
* 居住区(村庄) service
*/
@Resource
private
ITUserManageVillageService
itUserManageVillageService
;
@Resource
@Resource
DecryptService
decryptService
;
DecryptService
decryptService
;
...
@@ -2138,6 +2150,285 @@ public class lpgGasController {
...
@@ -2138,6 +2150,285 @@ public class lpgGasController {
}
}
/**
* 创建 居住区(村庄)接口
* @return r
*/
@PostMapping
(
"/createUserManageVillage"
)
public
AjaxResult
createUserManageVillage
(
@RequestBody
Encryption
encryption
)
{
keyInformation
selectkey
=
decryptService
.
selectkey
(
encryption
.
getQybm
());
if
(
selectkey
==
null
)
{
return
AjaxResult
.
error
(
"企业编码不存在!!!"
);
}
DESEncoder
desEncoder
=
new
DESEncoder
();
String
data
=
encryption
.
getData
();
String
decrypt
=
desEncoder
.
decrypt
(
data
,
selectkey
.
getSecretKey
());
TEnterpriseInfo
tEnterpriseInfo
=
tEnterpriseInfoMapper
.
selectTEnterpriseInfoById
(
selectkey
.
getEnterpriseId
());
if
(
tEnterpriseInfo
==
null
)
{
return
AjaxResult
.
error
(
"监管平台配置企业信息不存在!!!"
);
}
int
successNum
=
0
;
int
errorNum
=
0
;
int
repeatNum
=
0
;
if
(
StringUtils
.
isNotBlank
(
decrypt
))
{
JSONArray
jsonArray
=
JSON
.
parseArray
(
decrypt
);
String
js
=
JSONObject
.
toJSONString
(
jsonArray
,
SerializerFeature
.
WriteClassName
);
List
<
JSONObject
>
list
=
JSONObject
.
parseArray
(
js
,
JSONObject
.
class
);
if
(
list
.
size
()
>
500
)
{
return
AjaxResult
.
error
(
"每次最多处理500条数据"
);
}
List
<
TUserManageVillage
>
userManageVillages
=
new
ArrayList
<>();
List
<
TUserManageVillage
>
noRepeatList
=
new
ArrayList
<>();
TUserManageVillage
userManageVillage
;
String
dateFormat
=
"yyyy-MM-dd HH:mm:ss"
;
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
dateFormat
);
// 接口保存记录
List
<
TLpgThirdPartyDockingInterfaceRecord
>
lpgThirdPartyDockingInterfaceRecords
=
new
ArrayList
<>();
TLpgThirdPartyDockingInterfaceRecord
lpgThirdPartyDockingInterfaceRecord
;
for
(
JSONObject
object
:
list
)
{
userManageVillage
=
new
TUserManageVillage
();
//居住区(村庄)名称
String
fVillageName
=
object
.
getString
(
"fVillageName"
);
if
(
StringUtils
.
isBlank
(
fVillageName
))
{
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createUserManageVillage"
,
object
.
toJSONString
(),
"居住区(村庄)名称不许为空!!!"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
continue
;
}
if
(
fVillageName
.
length
()
>
50
)
{
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createUserManageVillage"
,
object
.
toJSONString
(),
"居住区(村庄)名称不符合要求!!!"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
continue
;
}
//居民总户数
String
fTotalNumHouse
=
object
.
getString
(
"fTotalNumHouse"
);
if
(
StringUtils
.
isBlank
(
fTotalNumHouse
))
{
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createUserManageVillage"
,
object
.
toJSONString
(),
"居民总户数不许为空!!!"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
continue
;
}
long
fTotalNumHousel
=
0L
;
try
{
fTotalNumHousel
=
Long
.
parseLong
(
fTotalNumHouse
);
}
catch
(
NumberFormatException
e
)
{
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createUserManageVillage"
,
object
.
toJSONString
(),
"居民总户数不符合要求!!!"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
continue
;
}
// 县(市、区)行政区划编码
String
countyCode
=
object
.
getString
(
"countyCode"
)
==
null
?
""
:
object
.
getString
(
"countyCode"
);
if
(
countyCode
.
length
()>
50
)
{
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createLpgDeliveryRecord"
,
object
.
toJSONString
(),
"县(市、区)行政区划编码不符合要求!!!"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
continue
;
}
// 瓶装燃气用户数
String
fBottledGasUsers
=
object
.
getString
(
"fBottledGasUsers"
)
==
null
?
""
:
object
.
getString
(
"fBottledGasUsers"
);
long
fBottledGasUsersl
=
0L
;
if
(
fBottledGasUsers
.
length
()
>
0
)
{
try
{
fBottledGasUsersl
=
Long
.
parseLong
(
fBottledGasUsers
);
}
catch
(
NumberFormatException
e
)
{
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createUserManageVillage"
,
object
.
toJSONString
(),
"瓶装燃气用户数不符合要求!!!"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
continue
;
}
}
// 管道燃气用户数
String
fPipeGasUsers
=
object
.
getString
(
"fPipeGasUsers"
)
==
null
?
""
:
object
.
getString
(
"fPipeGasUsers"
);
long
fPipeGasUsersl
=
0L
;
if
(
fPipeGasUsers
.
length
()
>
0
)
{
try
{
fPipeGasUsersl
=
Long
.
parseLong
(
fPipeGasUsers
);
}
catch
(
NumberFormatException
e
)
{
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createUserManageVillage"
,
object
.
toJSONString
(),
"管道燃气用户数不符合要求!!!"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
continue
;
}
}
// 经度
String
longitude
=
object
.
getString
(
"longitude"
)
==
null
?
""
:
object
.
getString
(
"longitude"
);
BigDecimal
bigDecimalLongitude
=
BigDecimal
.
ZERO
;
if
(
longitude
.
length
()
>
0
)
{
try
{
bigDecimalLongitude
=
new
BigDecimal
(
longitude
);
}
catch
(
NumberFormatException
e
)
{
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createUserManageVillage"
,
object
.
toJSONString
(),
"经度不符合要求!!!"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
continue
;
}
}
// 纬度
String
latitude
=
object
.
getString
(
"latitude"
)
==
null
?
""
:
object
.
getString
(
"latitude"
);
BigDecimal
bigDecimalLatitude
=
BigDecimal
.
ZERO
;
if
(
latitude
.
length
()
>
0
)
{
try
{
bigDecimalLatitude
=
new
BigDecimal
(
latitude
);
}
catch
(
NumberFormatException
e
)
{
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createUserManageVillage"
,
object
.
toJSONString
(),
"纬度不符合要求!!!"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
continue
;
}
}
// 备注
String
remarks
=
object
.
getString
(
"remarks"
)
==
null
?
""
:
object
.
getString
(
"remarks"
);
if
(
remarks
.
length
()
>
255
)
{
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createUserManageVillage"
,
object
.
toJSONString
(),
"备注不符合要求!!!"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
continue
;
}
userManageVillage
.
setfVillageName
(
fVillageName
);
userManageVillage
.
setCountyCoude
(
countyCode
);
userManageVillage
.
setfTotalNumHouse
(
fTotalNumHousel
);
userManageVillage
.
setfPipeGasUsers
(
fPipeGasUsersl
);
userManageVillage
.
setfBottledGasUsers
(
fBottledGasUsersl
);
if
(!
BigDecimal
.
ZERO
.
equals
(
bigDecimalLongitude
))
{
userManageVillage
.
setLongitude
(
bigDecimalLongitude
);
}
if
(!
BigDecimal
.
ZERO
.
equals
(
bigDecimalLatitude
))
{
userManageVillage
.
setLatitude
(
bigDecimalLatitude
);
}
userManageVillage
.
setRemarks
(
remarks
);
userManageVillages
.
add
(
userManageVillage
);
}
if
(
userManageVillages
.
size
()
>
0
)
{
//1 查看 录入的行政区是否符合要求
List
<
String
>
collect
=
userManageVillages
.
stream
().
filter
(
item
->
StringUtils
.
isNotBlank
(
item
.
getCountyCoude
()))
.
map
(
TUserManageVillage:
:
getCountyCoude
).
collect
(
Collectors
.
toList
());
List
<
TCountyLevelRegion
>
tCountyLevelRegions
=
countyLevelRegionService
.
queryByCountyCodes
(
collect
);
Map
<
String
,
List
<
TCountyLevelRegion
>>
collect1
=
tCountyLevelRegions
.
stream
().
collect
(
Collectors
.
groupingBy
(
TCountyLevelRegion:
:
getfCountyCode
));
Iterator
<
TUserManageVillage
>
iterator
=
userManageVillages
.
iterator
();
while
(
iterator
.
hasNext
())
{
TUserManageVillage
next
=
iterator
.
next
();
if
(
StringUtils
.
isNotBlank
(
next
.
getCountyCoude
()))
{
List
<
TCountyLevelRegion
>
tCountyLevelRegions1
=
collect1
.
get
(
next
.
getCountyCoude
());
if
(
tCountyLevelRegions1
==
null
||
tCountyLevelRegions1
.
size
()
==
0
)
{
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createUserManageVillage"
,
next
.
toString
(),
"县(市、区)行政区划编码 不符合要求!!!"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
iterator
.
remove
();
}
else
{
next
.
setfRegion
(
tCountyLevelRegions1
.
get
(
0
).
getfId
());
}
}
}
//2 过滤完 行政区后 再过滤 村 是否在系统里面已存在。
if
(
userManageVillages
.
size
()
>
0
)
{
List
<
String
>
collect2
=
userManageVillages
.
stream
().
map
(
TUserManageVillage:
:
getfVillageName
).
collect
(
Collectors
.
toList
());
List
<
TUserManageVillage
>
userManageVillages1
=
itUserManageVillageService
.
queryByVillageNames
(
collect2
);
Map
<
String
,
List
<
TUserManageVillage
>>
collect3
=
userManageVillages1
.
stream
().
collect
(
Collectors
.
groupingBy
(
TUserManageVillage:
:
getfVillageName
));
Iterator
<
TUserManageVillage
>
iterator1
=
userManageVillages
.
iterator
();
while
(
iterator
.
hasNext
())
{
TUserManageVillage
next
=
iterator1
.
next
();
List
<
TUserManageVillage
>
userManageVillages2
=
collect3
.
get
(
next
.
getfVillageName
());
if
(
userManageVillages2
!=
null
&&
userManageVillages2
.
size
()
>
0
)
{
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createUserManageVillage"
,
next
.
toString
(),
"居住区(村庄) 名称已存在!!!"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
iterator
.
remove
();
}
}
}
//3 都过滤完后 看看 集合里面名称有没有重复的。
if
(
userManageVillages
.
size
()
>
0
)
{
Set
<
TUserManageVillage
>
set
=
new
HashSet
<>(
userManageVillages
);
int
i
=
userManageVillages
.
size
()
-
set
.
size
();
if
(
i
>
0
)
{
repeatNum
=
i
;
}
noRepeatList
=
new
ArrayList
<>(
set
);
}
//4 都验证后 入库
if
(
noRepeatList
.
size
()
>
0
)
{
successNum
=
noRepeatList
.
size
();
for
(
TUserManageVillage
tUserManageVillage
:
noRepeatList
)
{
lpgThirdPartyDockingInterfaceRecord
=
successRecord
(
"createUserManageVillage"
,
tUserManageVillage
.
toString
(),
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
}
itUserManageVillageService
.
insertBatch
(
noRepeatList
);
}
}
// 5接口记录直接插入
if
(
lpgThirdPartyDockingInterfaceRecords
.
size
()
>
0
)
{
lpgThirdPartyDockingInterfaceRecordService
.
insertBatch
(
lpgThirdPartyDockingInterfaceRecords
);
}
}
StringBuilder
sb
=
new
StringBuilder
();
if
(
errorNum
>
0
||
repeatNum
>
0
)
{
sb
.
append
(
"成功:"
).
append
(
successNum
).
append
(
"条;失败:"
).
append
(
errorNum
).
append
(
"条;重复:"
).
append
(
repeatNum
).
append
(
"条"
);
return
AjaxResult
.
success
(
sb
.
toString
());
}
sb
.
append
(
"成功:"
).
append
(
successNum
).
append
(
"条"
);
return
AjaxResult
.
success
(
sb
.
toString
());
}
/**
/**
* 封装一个 失败的接口对象
* 封装一个 失败的接口对象
* @return r
* @return r
...
...
zh-baseversion-admin/src/main/java/com/zehong/web/controller/tool/DESEncoder.java
View file @
2a38f679
...
@@ -159,28 +159,39 @@ public class DESEncoder {
...
@@ -159,28 +159,39 @@ public class DESEncoder {
// System.out.println(DESEncoder.encrypt(skcs1,"23546324"));
// System.out.println(DESEncoder.encrypt(skcs1,"23546324"));
String
lpggasdata
=
"[\n"
+
String
lpggasdata
=
"[\n"
+
" {\n"
+
"\t{\n"
+
" \"bottleCode\": \"32323\",\n"
+
"\t\t\"fVillageName\":\"村庄名称-接口来的-01\",\n"
+
" \"userOwnId\": \"1\",\n"
+
"\t\t\"fTotalNumHouse\":\"49\",\n"
+
" \"stationName\": \"储备站-接口来的-01\",\n"
+
"\t\t\"countyCode\":\"130104\",\n"
+
" \"deliveryPerson\": \"配送人-接口来的-01\",\n"
+
"\t\t\"fBottledGasUsers\":\"15\",\n"
+
" \"vehicleCode\": \"车辆代码-接口来的-01\",\n"
+
"\t\t\"fPipeGasUsers\":\"14\",\n"
+
" \"gasUserType\": \"1\",\n"
+
"\t\t\"longitude\":\"14.56\",\n"
+
" \"deliveryAddress\": \"配送地址-接口来的-01\",\n"
+
"\t\t\"latitude\":\"18.96\",\n"
+
" \"deliveryDate\": \"2024-12-21 23:12:20\"\n"
+
"\t\t\"remarks\":\"备注-接口来的-01\"\n"
+
" },\n"
+
"\t},\n"
+
" {\n"
+
"\t{\n"
+
" \"bottleCode\": \"222222\",\n"
+
"\n"
+
" \"userOwnId\": \"89\",\n"
+
"\t\t\"fVillageName\":\"村庄名称-接口来的-02\",\n"
+
" \"stationName\": \"储备站-接口来的-01\",\n"
+
"\t\t\"fTotalNumHouse\":\"49\",\n"
+
" \"deliveryPerson\": \"配送人-接口来的-01\",\n"
+
"\t\t\"countyCode\":\"130105\",\n"
+
" \"vehicleCode\": \"车辆代码-接口来的-01\",\n"
+
"\t\t\"fBottledGasUsers\":\"15\",\n"
+
" \"gasUserType\": \"0\",\n"
+
"\t\t\"fPipeGasUsers\":\"14\",\n"
+
" \"deliveryAddress\": \"配送地址-接口来的-01\",\n"
+
"\t\t\"longitude\":\"14.56\",\n"
+
" \"deliveryDate\": \"2024-12-21 23:12:21\"\n"
+
"\t\t\"latitude\":\"18.96\",\n"
+
" }\n"
+
"\t\t\"remarks\":\"备注-接口来的-01\"\n"
+
"]\n"
+
"\t},\n"
+
"\n"
;
"\t{\n"
+
"\n"
+
"\t\t\"fVillageName\":\"村庄名称-接口来的-02\",\n"
+
"\t\t\"fTotalNumHouse\":\"49\",\n"
+
"\t\t\"countyCode\":\"130107\",\n"
+
"\t\t\"fBottledGasUsers\":\"15\",\n"
+
"\t\t\"fPipeGasUsers\":\"14\",\n"
+
"\t\t\"longitude\":\"14.56\",\n"
+
"\t\t\"latitude\":\"18.96\",\n"
+
"\t\t\"remarks\":\"备注-接口来的-01\"\n"
+
"\t}\n"
+
"]"
;
JSONArray
objects
=
JSON
.
parseArray
(
lpggasdata
);
JSONArray
objects
=
JSON
.
parseArray
(
lpggasdata
);
System
.
out
.
println
(
objects
);
System
.
out
.
println
(
objects
);
...
...
zh-baseversion-system/src/main/java/com/zehong/system/domain/TUserManageVillage.java
View file @
2a38f679
package
com
.
zehong
.
system
.
domain
;
package
com
.
zehong
.
system
.
domain
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.Objects
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
com.zehong.common.annotation.Excel
;
import
com.zehong.common.annotation.Excel
;
...
@@ -61,6 +63,11 @@ public class TUserManageVillage extends BaseEntity
...
@@ -61,6 +63,11 @@ public class TUserManageVillage extends BaseEntity
/** 备注 */
/** 备注 */
private
String
remarks
;
private
String
remarks
;
/**
* 县(市、区)行政区划编码 第三方接口对接时使用
*/
private
String
countyCoude
;
public
void
setfVillageId
(
Long
fVillageId
)
public
void
setfVillageId
(
Long
fVillageId
)
{
{
this
.
fVillageId
=
fVillageId
;
this
.
fVillageId
=
fVillageId
;
...
@@ -167,6 +174,26 @@ public class TUserManageVillage extends BaseEntity
...
@@ -167,6 +174,26 @@ public class TUserManageVillage extends BaseEntity
this
.
beyondEnterpriseName
=
beyondEnterpriseName
;
this
.
beyondEnterpriseName
=
beyondEnterpriseName
;
}
}
public
String
getCountyCoude
()
{
return
countyCoude
;
}
public
void
setCountyCoude
(
String
countyCoude
)
{
this
.
countyCoude
=
countyCoude
;
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
obj
)
return
true
;
if
(
obj
==
null
||
getClass
()
!=
obj
.
getClass
())
return
false
;
TUserManageVillage
tUserManageVillage
=
(
TUserManageVillage
)
obj
;
return
Objects
.
equals
(
fVillageName
,
tUserManageVillage
.
getfVillageName
());
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
fVillageName
);
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
...
@@ -178,6 +205,7 @@ public class TUserManageVillage extends BaseEntity
...
@@ -178,6 +205,7 @@ public class TUserManageVillage extends BaseEntity
.
append
(
"fBottledGasUsers"
,
getfBottledGasUsers
())
.
append
(
"fBottledGasUsers"
,
getfBottledGasUsers
())
.
append
(
"longitude"
,
getLongitude
())
.
append
(
"longitude"
,
getLongitude
())
.
append
(
"latitude"
,
getLatitude
())
.
append
(
"latitude"
,
getLatitude
())
.
append
(
"countyCoude"
,
getCountyCoude
())
.
append
(
"remarks"
,
getRemarks
())
.
append
(
"remarks"
,
getRemarks
())
.
toString
();
.
toString
();
}
}
...
...
zh-baseversion-system/src/main/java/com/zehong/system/mapper/TCountyLevelRegionMapper.java
View file @
2a38f679
...
@@ -2,6 +2,7 @@ package com.zehong.system.mapper;
...
@@ -2,6 +2,7 @@ package com.zehong.system.mapper;
import
java.util.List
;
import
java.util.List
;
import
com.zehong.system.domain.TCountyLevelRegion
;
import
com.zehong.system.domain.TCountyLevelRegion
;
import
org.apache.ibatis.annotations.Param
;
/**
/**
* 县级行政区Mapper接口
* 县级行政区Mapper接口
...
@@ -27,6 +28,12 @@ public interface TCountyLevelRegionMapper
...
@@ -27,6 +28,12 @@ public interface TCountyLevelRegionMapper
*/
*/
public
List
<
TCountyLevelRegion
>
selectTCountyLevelRegionList
(
TCountyLevelRegion
tCountyLevelRegion
);
public
List
<
TCountyLevelRegion
>
selectTCountyLevelRegionList
(
TCountyLevelRegion
tCountyLevelRegion
);
/**
* 根据 countyCodes 集合查询数据
* @param list c
* @return r
*/
public
List
<
TCountyLevelRegion
>
queryByCountyCodes
(
@Param
(
"list"
)
List
<
String
>
list
);
/**
/**
* 根据city_code 查询
* 根据city_code 查询
* @param fCityId c
* @param fCityId c
...
...
zh-baseversion-system/src/main/java/com/zehong/system/mapper/TUserManageVillageMapper.java
View file @
2a38f679
...
@@ -2,6 +2,8 @@ package com.zehong.system.mapper;
...
@@ -2,6 +2,8 @@ package com.zehong.system.mapper;
import
java.util.List
;
import
java.util.List
;
import
com.zehong.system.domain.TUserManageVillage
;
import
com.zehong.system.domain.TUserManageVillage
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.security.core.parameters.P
;
/**
/**
* 基本信息维护-用户管理-居住区(村庄)Mapper接口
* 基本信息维护-用户管理-居住区(村庄)Mapper接口
...
@@ -34,6 +36,12 @@ public interface TUserManageVillageMapper
...
@@ -34,6 +36,12 @@ public interface TUserManageVillageMapper
*/
*/
public
List
<
TUserManageVillage
>
exportUserManageVillageList
(
TUserManageVillage
tUserManageVillage
);
public
List
<
TUserManageVillage
>
exportUserManageVillageList
(
TUserManageVillage
tUserManageVillage
);
/**
* 根据 村名称集合 查询 村列表
* @param list v
* @return r
*/
List
<
TUserManageVillage
>
queryByVillageNames
(
@Param
(
"list"
)
List
<
String
>
list
);
/**
/**
* 新增基本信息维护-用户管理-居住区(村庄)
* 新增基本信息维护-用户管理-居住区(村庄)
*
*
...
@@ -42,6 +50,12 @@ public interface TUserManageVillageMapper
...
@@ -42,6 +50,12 @@ public interface TUserManageVillageMapper
*/
*/
public
int
insertTUserManageVillage
(
TUserManageVillage
tUserManageVillage
);
public
int
insertTUserManageVillage
(
TUserManageVillage
tUserManageVillage
);
/**
* 批量插入
* @param userManageVillages s
* @return s
*/
int
insertBatch
(
List
<
TUserManageVillage
>
userManageVillages
);
/**
/**
* 修改基本信息维护-用户管理-居住区(村庄)
* 修改基本信息维护-用户管理-居住区(村庄)
*
*
...
...
zh-baseversion-system/src/main/java/com/zehong/system/service/ITCountyLevelRegionService.java
View file @
2a38f679
...
@@ -27,6 +27,13 @@ public interface ITCountyLevelRegionService
...
@@ -27,6 +27,13 @@ public interface ITCountyLevelRegionService
*/
*/
public
List
<
TCountyLevelRegion
>
selectTCountyLevelRegionList
(
TCountyLevelRegion
tCountyLevelRegion
);
public
List
<
TCountyLevelRegion
>
selectTCountyLevelRegionList
(
TCountyLevelRegion
tCountyLevelRegion
);
/**
* 根据县(市、区)行政区划编码 集合查询数据
* @param countyCodes c
* @return r
*/
public
List
<
TCountyLevelRegion
>
queryByCountyCodes
(
List
<
String
>
countyCodes
);
/**
/**
* 新增县级行政区
* 新增县级行政区
*
*
...
...
zh-baseversion-system/src/main/java/com/zehong/system/service/ITUserManageVillageService.java
View file @
2a38f679
...
@@ -34,6 +34,13 @@ public interface ITUserManageVillageService
...
@@ -34,6 +34,13 @@ public interface ITUserManageVillageService
* @return 基本信息维护-用户管理-居住区(村庄)集合
* @return 基本信息维护-用户管理-居住区(村庄)集合
*/
*/
public
List
<
TUserManageVillage
>
exportTUserManageVillageList
(
TUserManageVillage
tUserManageVillage
);
public
List
<
TUserManageVillage
>
exportTUserManageVillageList
(
TUserManageVillage
tUserManageVillage
);
/**
* 根据 名称集合查询 村列表
* @param villageNames v
* @return r
*/
public
List
<
TUserManageVillage
>
queryByVillageNames
(
List
<
String
>
villageNames
);
/**
/**
* 新增基本信息维护-用户管理-居住区(村庄)
* 新增基本信息维护-用户管理-居住区(村庄)
*
*
...
@@ -42,6 +49,13 @@ public interface ITUserManageVillageService
...
@@ -42,6 +49,13 @@ public interface ITUserManageVillageService
*/
*/
public
int
insertTUserManageVillage
(
TUserManageVillage
tUserManageVillage
);
public
int
insertTUserManageVillage
(
TUserManageVillage
tUserManageVillage
);
/**
* 批量插入
* @param userManageVillages s
* @return r
*/
public
int
insertBatch
(
List
<
TUserManageVillage
>
userManageVillages
);
/**
/**
* 修改基本信息维护-用户管理-居住区(村庄)
* 修改基本信息维护-用户管理-居住区(村庄)
*
*
...
...
zh-baseversion-system/src/main/java/com/zehong/system/service/impl/TCountyLevelRegionServiceImpl.java
View file @
2a38f679
...
@@ -23,7 +23,7 @@ import javax.annotation.Resource;
...
@@ -23,7 +23,7 @@ import javax.annotation.Resource;
@Service
@Service
public
class
TCountyLevelRegionServiceImpl
implements
ITCountyLevelRegionService
public
class
TCountyLevelRegionServiceImpl
implements
ITCountyLevelRegionService
{
{
@
Autowired
@
Resource
private
TCountyLevelRegionMapper
tCountyLevelRegionMapper
;
private
TCountyLevelRegionMapper
tCountyLevelRegionMapper
;
@Resource
@Resource
...
@@ -53,6 +53,16 @@ public class TCountyLevelRegionServiceImpl implements ITCountyLevelRegionService
...
@@ -53,6 +53,16 @@ public class TCountyLevelRegionServiceImpl implements ITCountyLevelRegionService
return
tCountyLevelRegionMapper
.
selectTCountyLevelRegionList
(
tCountyLevelRegion
);
return
tCountyLevelRegionMapper
.
selectTCountyLevelRegionList
(
tCountyLevelRegion
);
}
}
/**
* 根据 县(市、区)行政区划编码 查询数据
* @param countyCodes c
* @return r
*/
@Override
public
List
<
TCountyLevelRegion
>
queryByCountyCodes
(
List
<
String
>
countyCodes
)
{
return
tCountyLevelRegionMapper
.
queryByCountyCodes
(
countyCodes
);
}
/**
/**
* 新增县级行政区
* 新增县级行政区
*
*
...
...
zh-baseversion-system/src/main/java/com/zehong/system/service/impl/TUserManageVillageServiceImpl.java
View file @
2a38f679
...
@@ -4,12 +4,13 @@ import java.util.List;
...
@@ -4,12 +4,13 @@ import java.util.List;
import
com.zehong.common.core.domain.entity.SysUser
;
import
com.zehong.common.core.domain.entity.SysUser
;
import
com.zehong.common.utils.SecurityUtils
;
import
com.zehong.common.utils.SecurityUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.zehong.system.mapper.TUserManageVillageMapper
;
import
com.zehong.system.mapper.TUserManageVillageMapper
;
import
com.zehong.system.domain.TUserManageVillage
;
import
com.zehong.system.domain.TUserManageVillage
;
import
com.zehong.system.service.ITUserManageVillageService
;
import
com.zehong.system.service.ITUserManageVillageService
;
import
javax.annotation.Resource
;
/**
/**
* 基本信息维护-用户管理-居住区(村庄)Service业务层处理
* 基本信息维护-用户管理-居住区(村庄)Service业务层处理
*
*
...
@@ -19,7 +20,7 @@ import com.zehong.system.service.ITUserManageVillageService;
...
@@ -19,7 +20,7 @@ import com.zehong.system.service.ITUserManageVillageService;
@Service
@Service
public
class
TUserManageVillageServiceImpl
implements
ITUserManageVillageService
public
class
TUserManageVillageServiceImpl
implements
ITUserManageVillageService
{
{
@
Autowired
@
Resource
private
TUserManageVillageMapper
tUserManageVillageMapper
;
private
TUserManageVillageMapper
tUserManageVillageMapper
;
/**
/**
...
@@ -63,6 +64,16 @@ public class TUserManageVillageServiceImpl implements ITUserManageVillageService
...
@@ -63,6 +64,16 @@ public class TUserManageVillageServiceImpl implements ITUserManageVillageService
return
tUserManageVillageMapper
.
exportUserManageVillageList
(
tUserManageVillage
);
return
tUserManageVillageMapper
.
exportUserManageVillageList
(
tUserManageVillage
);
}
}
/**
* 根据 村名称集合 查询 村集合
* @param villageNames v
* @return r
*/
@Override
public
List
<
TUserManageVillage
>
queryByVillageNames
(
List
<
String
>
villageNames
)
{
return
tUserManageVillageMapper
.
queryByVillageNames
(
villageNames
);
}
/**
/**
* 新增基本信息维护-用户管理-居住区(村庄)
* 新增基本信息维护-用户管理-居住区(村庄)
*
*
...
@@ -75,6 +86,16 @@ public class TUserManageVillageServiceImpl implements ITUserManageVillageService
...
@@ -75,6 +86,16 @@ public class TUserManageVillageServiceImpl implements ITUserManageVillageService
return
tUserManageVillageMapper
.
insertTUserManageVillage
(
tUserManageVillage
);
return
tUserManageVillageMapper
.
insertTUserManageVillage
(
tUserManageVillage
);
}
}
/**
* 批量插入
* @param userManageVillages s
* @return r
*/
@Override
public
int
insertBatch
(
List
<
TUserManageVillage
>
userManageVillages
)
{
return
tUserManageVillageMapper
.
insertBatch
(
userManageVillages
);
}
/**
/**
* 修改基本信息维护-用户管理-居住区(村庄)
* 修改基本信息维护-用户管理-居住区(村庄)
*
*
...
...
zh-baseversion-system/src/main/resources/mapper/system/TCountyLevelRegionMapper.xml
View file @
2a38f679
...
@@ -26,6 +26,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -26,6 +26,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"fIsMajor != null "
>
and f_is_major = #{fIsMajor}
</if>
<if
test=
"fIsMajor != null "
>
and f_is_major = #{fIsMajor}
</if>
</where>
</where>
</select>
</select>
<select
id=
"queryByCountyCodes"
resultMap=
"TCountyLevelRegionResult"
>
<include
refid=
"selectTCountyLevelRegionVo"
></include>
where f_county_code in
<foreach
collection=
"list"
index=
"i"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</select>
<select
id=
"queryByCityId"
resultMap=
"TCountyLevelRegionResult"
>
<select
id=
"queryByCityId"
resultMap=
"TCountyLevelRegionResult"
>
<include
refid=
"selectTCountyLevelRegionVo"
/>
<include
refid=
"selectTCountyLevelRegionVo"
/>
where f_city_id = #{fCityId}
where f_city_id = #{fCityId}
...
...
zh-baseversion-system/src/main/resources/mapper/system/TUserManageVillageMapper.xml
View file @
2a38f679
...
@@ -87,12 +87,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -87,12 +87,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"beyondEnterpriseId != null and beyondEnterpriseId != '-2' and beyondEnterpriseId != ''"
>
and f_beyond_enterprise_id = #{beyondEnterpriseId}
</if>
<if
test=
"beyondEnterpriseId != null and beyondEnterpriseId != '-2' and beyondEnterpriseId != ''"
>
and f_beyond_enterprise_id = #{beyondEnterpriseId}
</if>
</where>
</where>
</select>
</select>
<select
id=
"queryByVillageNames"
parameterType=
"list"
resultMap=
"TUserManageVillageResult"
>
<include
refid=
"exportTUserManageVillageVo"
/>
where f_village_name in
<foreach
collection=
"list"
close=
")"
separator=
","
open=
"("
item=
"item"
index=
"i"
>
#{item}
</foreach>
</select>
<select
id=
"selectTUserManageVillageById"
parameterType=
"Long"
resultMap=
"TUserManageVillageResult"
>
<select
id=
"selectTUserManageVillageById"
parameterType=
"Long"
resultMap=
"TUserManageVillageResult"
>
<include
refid=
"selectTUserManageVillageVo"
/>
<include
refid=
"selectTUserManageVillageVo"
/>
where f_village_id = #{fVillageId}
where f_village_id = #{fVillageId}
</select>
</select>
<insert
id=
"insertBatch"
parameterType=
"list"
>
insert into t_user_manage_village (f_village_name, f_region,f_total_num_house, f_pipe_gas_users, f_bottled_gas_users,
longitude,latitude,remarks)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
#{item.fVillageName,jdbcType=VARCHAR}, #{item.fRegion}, #{item.fTotalNumHouse},
#{item.fPipeGasUsers}, #{item.fBottledGasUsers},#{item.longitude},#{item.latitude},#{item.remarks}
)
</foreach>
</insert>
<insert
id=
"insertTUserManageVillage"
parameterType=
"TUserManageVillage"
useGeneratedKeys=
"true"
keyProperty=
"fVillageId"
>
<insert
id=
"insertTUserManageVillage"
parameterType=
"TUserManageVillage"
useGeneratedKeys=
"true"
keyProperty=
"fVillageId"
>
insert into t_user_manage_village
insert into t_user_manage_village
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
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