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
6d824f6e
Commit
6d824f6e
authored
Sep 19, 2024
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1液化气-燃气用户外部接口开发-开发中
parent
a9ce7ee1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
120 additions
and
26 deletions
+120
-26
lpgGasController.java
...b/controller/externaldocking/lpggas/lpgGasController.java
+120
-24
TYehuaqiUserController.java
.../zehong/web/controller/system/TYehuaqiUserController.java
+0
-2
No files found.
zh-baseversion-admin/src/main/java/com/zehong/web/controller/externaldocking/lpggas/lpgGasController.java
View file @
6d824f6e
...
...
@@ -1829,12 +1829,10 @@ public class lpgGasController {
for
(
JSONObject
object
:
list
)
{
lpgDeliveryRecord
=
new
TLpgDeliveryRecord
();
JSONObject
jsonObject
=
object
;
// 气瓶条码不许为空
String
bottleCode
=
jsonO
bject
.
getString
(
"bottleCode"
);
String
bottleCode
=
o
bject
.
getString
(
"bottleCode"
);
if
(
StringUtils
.
isBlank
(
bottleCode
))
{
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createLpgDeliveryRecord"
,
jsonO
bject
.
toJSONString
(),
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createLpgDeliveryRecord"
,
o
bject
.
toJSONString
(),
"气瓶条码不许为空!!!"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
...
...
@@ -1842,7 +1840,7 @@ public class lpgGasController {
}
if
(
bottleCode
.
length
()
>
255
)
{
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createLpgDeliveryRecord"
,
jsonO
bject
.
toJSONString
(),
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createLpgDeliveryRecord"
,
o
bject
.
toJSONString
(),
"气瓶条码不符合要求!!!"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
...
...
@@ -1850,10 +1848,10 @@ public class lpgGasController {
}
// 用户自有编号 可以为空 为空时 就不关联 燃气用户了
String
userOwnId
=
jsonObject
.
getString
(
"userOwnId"
)
==
null
?
""
:
jsonO
bject
.
getString
(
"userOwnId"
);
String
userOwnId
=
object
.
getString
(
"userOwnId"
)
==
null
?
""
:
o
bject
.
getString
(
"userOwnId"
);
if
(
userOwnId
.
length
()
>
50
)
{
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createLpgDeliveryRecord"
,
jsonO
bject
.
toJSONString
(),
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createLpgDeliveryRecord"
,
o
bject
.
toJSONString
(),
"用户自有编号不符合要求!!!"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
...
...
@@ -1861,11 +1859,11 @@ public class lpgGasController {
}
// 储备站 可以为空
String
stationName
=
jsonObject
.
getString
(
"stationName"
)
==
null
?
""
:
jsonO
bject
.
getString
(
"stationName"
);
String
stationName
=
object
.
getString
(
"stationName"
)
==
null
?
""
:
o
bject
.
getString
(
"stationName"
);
if
(
stationName
.
length
()
>
64
)
{
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createLpgDeliveryRecord"
,
jsonO
bject
.
toJSONString
(),
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createLpgDeliveryRecord"
,
o
bject
.
toJSONString
(),
"储备站不符合要求!!!"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
...
...
@@ -1873,11 +1871,11 @@ public class lpgGasController {
}
// 配送人员 可以为空
String
deliveryPerson
=
jsonObject
.
getString
(
"deliveryPerson"
)
==
null
?
""
:
jsonO
bject
.
getString
(
"deliveryPerson"
);
String
deliveryPerson
=
object
.
getString
(
"deliveryPerson"
)
==
null
?
""
:
o
bject
.
getString
(
"deliveryPerson"
);
if
(
deliveryPerson
.
length
()
>
20
)
{
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createLpgDeliveryRecord"
,
jsonO
bject
.
toJSONString
(),
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createLpgDeliveryRecord"
,
o
bject
.
toJSONString
(),
"储备站不符合要求!!!"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
...
...
@@ -1885,11 +1883,11 @@ public class lpgGasController {
}
// 车辆代码 可以为空
String
vehicleCode
=
jsonObject
.
getString
(
"vehicleCode"
)
==
null
?
""
:
jsonO
bject
.
getString
(
"vehicleCode"
);
String
vehicleCode
=
object
.
getString
(
"vehicleCode"
)
==
null
?
""
:
o
bject
.
getString
(
"vehicleCode"
);
if
(
vehicleCode
.
length
()
>
50
)
{
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createLpgDeliveryRecord"
,
jsonO
bject
.
toJSONString
(),
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createLpgDeliveryRecord"
,
o
bject
.
toJSONString
(),
"车辆代码不符合要求!!!"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
...
...
@@ -1897,11 +1895,11 @@ public class lpgGasController {
}
// 用户类型 可以为空
String
gasUserType
=
jsonObject
.
getString
(
"gasUserType"
)
==
null
?
""
:
jsonO
bject
.
getString
(
"gasUserType"
);
String
gasUserType
=
object
.
getString
(
"gasUserType"
)
==
null
?
""
:
o
bject
.
getString
(
"gasUserType"
);
if
(
gasUserType
.
length
()
>
2
)
{
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createLpgDeliveryRecord"
,
jsonO
bject
.
toJSONString
(),
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createLpgDeliveryRecord"
,
o
bject
.
toJSONString
(),
"用户类型不符合要求!!!"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
...
...
@@ -1910,7 +1908,7 @@ public class lpgGasController {
if
(
gasUserType
.
length
()
>
0
&&
!
"0"
.
equals
(
gasUserType
)
&&
!
"1"
.
equals
(
gasUserType
))
{
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createLpgDeliveryRecord"
,
jsonO
bject
.
toJSONString
(),
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createLpgDeliveryRecord"
,
o
bject
.
toJSONString
(),
"用户类型不符合要求!!!"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
...
...
@@ -1918,10 +1916,10 @@ public class lpgGasController {
}
// 配送地址 可以为空
String
deliveryAddress
=
jsonObject
.
getString
(
"deliveryAddress"
)
==
null
?
""
:
jsonO
bject
.
getString
(
"deliveryAddress"
);
String
deliveryAddress
=
object
.
getString
(
"deliveryAddress"
)
==
null
?
""
:
o
bject
.
getString
(
"deliveryAddress"
);
if
(
deliveryAddress
.
length
()
>
50
)
{
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createLpgDeliveryRecord"
,
jsonO
bject
.
toJSONString
(),
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createLpgDeliveryRecord"
,
o
bject
.
toJSONString
(),
"配送地址不符合要求!!!"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
...
...
@@ -1929,10 +1927,10 @@ public class lpgGasController {
}
// 配送时间 可以为空
String
deliveryDate
=
jsonObject
.
getString
(
"deliveryDate"
)
==
null
?
""
:
jsonO
bject
.
getString
(
"deliveryDate"
);
String
deliveryDate
=
object
.
getString
(
"deliveryDate"
)
==
null
?
""
:
o
bject
.
getString
(
"deliveryDate"
);
if
(
deliveryDate
.
length
()
>
0
&&
!
isValidDate
(
sdf
,
deliveryDate
))
{
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createLpgDeliveryRecord"
,
jsonO
bject
.
toJSONString
(),
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createLpgDeliveryRecord"
,
o
bject
.
toJSONString
(),
"配送时间不符合要求!!!"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
...
...
@@ -2042,10 +2040,108 @@ public class lpgGasController {
return
AjaxResult
.
success
(
sb
.
toString
());
}
/**
* 封装一个 失败的接口对象
* @return r
*/
/**
* 创建 液化气用户接口
* @return r
*/
@PostMapping
(
"/createLpgLiquefiedGasUser"
)
public
AjaxResult
createLpgLiquefiedGasUser
(
@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
;
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
<
TYehuaqiUser
>
yehuaqiUsers
=
new
ArrayList
<>();
TYehuaqiUser
yehuaqiUser
;
String
dateFormat
=
"yyyy-MM-dd HH:mm:ss"
;
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
dateFormat
);
// 接口保存记录
List
<
TLpgThirdPartyDockingInterfaceRecord
>
lpgThirdPartyDockingInterfaceRecords
=
new
ArrayList
<>();
TLpgThirdPartyDockingInterfaceRecord
lpgThirdPartyDockingInterfaceRecord
;
for
(
JSONObject
object
:
list
)
{
yehuaqiUser
=
new
TYehuaqiUser
();
String
userOwnId
=
object
.
getString
(
"userOwnId"
);
if
(
StringUtils
.
isBlank
(
userOwnId
))
{
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createLpgDeliveryRecord"
,
object
.
toJSONString
(),
"用户自有编号不许为空!!!"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
continue
;
}
if
(
userOwnId
.
length
()
>
50
)
{
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createLpgDeliveryRecord"
,
object
.
toJSONString
(),
"用户自有编号不符合要求!!!"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
continue
;
}
// 用户名称
String
nickName
=
object
.
getString
(
"nickName"
);
if
(
StringUtils
.
isBlank
(
nickName
))
{
lpgThirdPartyDockingInterfaceRecord
=
errorRecord
(
"createLpgDeliveryRecord"
,
object
.
toJSONString
(),
"用户名称不符合要求!!!"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
continue
;
}
}
}
StringBuilder
sb
=
new
StringBuilder
();
if
(
errorNum
>
0
)
{
sb
.
append
(
"成功:"
).
append
(
successNum
).
append
(
"条;失败:"
).
append
(
errorNum
).
append
(
"条"
);
return
AjaxResult
.
success
(
sb
.
toString
());
}
sb
.
append
(
"成功:"
).
append
(
successNum
).
append
(
"条"
);
return
AjaxResult
.
success
(
sb
.
toString
());
}
/**
* 封装一个 失败的接口对象
* @return r
*/
private
TLpgThirdPartyDockingInterfaceRecord
errorRecord
(
String
interfaceName
,
String
receiveData
,
String
failureReason
,
String
qybm
){
...
...
zh-baseversion-admin/src/main/java/com/zehong/web/controller/system/TYehuaqiUserController.java
View file @
6d824f6e
...
...
@@ -12,10 +12,8 @@ import cn.afterturn.easypoi.excel.ExcelExportUtil;
import
cn.afterturn.easypoi.excel.entity.TemplateExportParams
;
import
com.zehong.common.core.domain.entity.SysUser
;
import
com.zehong.common.utils.SecurityUtils
;
import
com.zehong.system.domain.TDetectorUser
;
import
com.zehong.system.domain.vo.GasUserAndSafetyDeviceVo
;
import
com.zehong.system.domain.vo.UserManageGasUserExportVo
;
import
com.zehong.system.domain.vo.UserManageSafetyDeviceExportVo
;
import
com.zehong.system.domain.vo.YeHuaqiUserManageSafetyDeviceExportVo
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.springframework.beans.BeanUtils
;
...
...
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