Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
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
9b6dff46
Commit
9b6dff46
authored
Feb 05, 2026
by
zhangjianqian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
入户安检上报接口
parent
d63ed985
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
155 additions
and
28 deletions
+155
-28
RhajController.java
...g/web/controller/externaldocking/rhaj/RhajController.java
+97
-4
TInspectReport.java
...rc/main/java/com/zehong/system/domain/TInspectReport.java
+24
-24
TInspectReportMapper.java
...n/java/com/zehong/system/mapper/TInspectReportMapper.java
+1
-0
TInspectReportMapper.xml
...src/main/resources/mapper/system/TInspectReportMapper.xml
+33
-0
No files found.
zh-baseversion-admin/src/main/java/com/zehong/web/controller/externaldocking/rhaj/RhajController.java
View file @
9b6dff46
...
...
@@ -7,10 +7,7 @@ import com.alibaba.fastjson.serializer.SerializerFeature;
import
com.zehong.common.core.domain.AjaxResult
;
import
com.zehong.common.utils.StringUtils
;
import
com.zehong.system.domain.*
;
import
com.zehong.system.mapper.TDetectorUserMapper
;
import
com.zehong.system.mapper.TEnterpriseInfoMapper
;
import
com.zehong.system.mapper.THiddenDangerStandingBookMapper
;
import
com.zehong.system.mapper.TSpecialUserMapper
;
import
com.zehong.system.mapper.*
;
import
com.zehong.system.service.DecryptService
;
import
com.zehong.system.service.ITLpgThirdPartyDockingInterfaceRecordService
;
import
com.zehong.web.controller.externaldocking.lpggas.lpgGasController
;
...
...
@@ -52,6 +49,8 @@ public class RhajController {
private
TDetectorUserMapper
detectorUserMapper
;
@Autowired
private
THiddenDangerStandingBookMapper
hiddenDangerStandingBookMapper
;
@Autowired
private
TInspectReportMapper
inspectReportMapper
;
/**
* 验证编码以及格式
...
...
@@ -238,6 +237,86 @@ public class RhajController {
return
AjaxResult
.
success
(
returnstr
(
successNum
,
errorNum
,
repeatNum
));
}
/**
* 入户安检结果上报接口
* @return r
*/
@PostMapping
(
"/createInspectResult"
)
public
AjaxResult
createInspectResult
(
@RequestBody
Encryption
encryption
)
{
keyInformation
selectkey
=
decryptService
.
selectkey
(
encryption
.
getQybm
());
AjaxResult
result
=
isFormatVerification
(
encryption
,
selectkey
);
if
((
int
)
result
.
get
(
"code"
)!=
200
){
return
result
;
}
int
successNum
=
0
;
int
errorNum
=
0
;
List
<
JSONObject
>
list
=
(
List
<
JSONObject
>)
result
.
get
(
"data"
);
List
<
TInspectReport
>
inspectReports
=
new
ArrayList
<>();
// 需要更新的数据
TInspectReport
inspectReport
;
// 接口保存记录
List
<
TLpgThirdPartyDockingInterfaceRecord
>
lpgThirdPartyDockingInterfaceRecords
=
new
ArrayList
<>();
TLpgThirdPartyDockingInterfaceRecord
lpgThirdPartyDockingInterfaceRecord
;
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
inspectReport
=
new
TInspectReport
();
JSONObject
jsonObject
=
list
.
get
(
i
);
//判断数据是否合格
String
resultstr
=
isqualifiedInspect
(
jsonObject
);
if
(!
resultstr
.
equals
(
"success"
))
{
lpgThirdPartyDockingInterfaceRecord
=
lpgGasService
.
errorRecord
(
"createInspectResult"
,
jsonObject
.
toJSONString
(),
resultstr
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
continue
;
}
TDetectorUser
user
=
detectorUserMapper
.
selectUserByOwnId
(
jsonObject
.
getString
(
"userOwnId"
));
if
(
user
==
null
){
lpgThirdPartyDockingInterfaceRecord
=
lpgGasService
.
errorRecord
(
"createSpecailUser"
,
jsonObject
.
toJSONString
(),
"用户不存在"
,
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
errorNum
++;
continue
;
}
try
{
inspectReport
.
setUserNo
(
user
.
getUserId
());
inspectReport
.
setAnnual
(
Integer
.
parseInt
(
jsonObject
.
getString
(
"annual"
)));
inspectReport
.
setSecurityCodeIn
(
jsonObject
.
getString
(
"securityCodeIn"
));
inspectReport
.
setSecurityCode
(
jsonObject
.
getString
(
"securityCode"
));
inspectReport
.
setUserName
(
jsonObject
.
getString
(
"userName"
));
inspectReport
.
setIndoorTime
(
jsonObject
.
getString
(
"indoorTime"
));
inspectReport
.
setIndoorStatus
(
jsonObject
.
getString
(
"indoorStatus"
));
inspectReport
.
setIndoorStatus
(
jsonObject
.
getString
(
"indoorStatus"
));
inspectReport
.
setVillage
(
user
.
getVillageId
());
inspectReport
.
setHouseNumber
(
jsonObject
.
getString
(
"houseNumber"
));
inspectReport
.
setPhoneNumber
(
jsonObject
.
getString
(
"phoneNumber"
));
inspectReport
.
setCreateTime
(
new
Date
());
inspectReport
.
setUserOwnId
(
jsonObject
.
getString
(
"userOwnId"
));
inspectReport
.
setCompanyInfoId
(
selectkey
.
getEnterpriseId
());
}
catch
(
Exception
e
){
throw
new
RuntimeException
(
e
);
}
inspectReports
.
add
(
inspectReport
);
lpgThirdPartyDockingInterfaceRecord
=
lpgGasService
.
successRecord
(
"createLpgVehicleInfo"
,
jsonObject
.
toJSONString
(),
encryption
.
getQybm
());
lpgThirdPartyDockingInterfaceRecords
.
add
(
lpgThirdPartyDockingInterfaceRecord
);
successNum
++;
}
if
(
inspectReports
.
size
()
>
0
)
{
// 新增的新增
inspectReportMapper
.
inserts
(
inspectReports
);
}
if
(
lpgThirdPartyDockingInterfaceRecords
.
size
()
>
0
)
{
lpgThirdPartyDockingInterfaceRecordService
.
insertBatch
(
lpgThirdPartyDockingInterfaceRecords
);
}
return
AjaxResult
.
success
(
returnstr
(
successNum
,
errorNum
,
0
));
}
/**
* 公共返回
* @param successNum
...
...
@@ -311,4 +390,18 @@ public class RhajController {
return
"success"
;
}
public
String
isqualifiedInspect
(
JSONObject
jsonObject
){
if
(
jsonObject
.
getString
(
"annual"
)==
null
||!
jsonObject
.
getString
(
"annual"
).
matches
(
"\\d+"
)||
jsonObject
.
getString
(
"annual"
).
length
()
>
5
)
return
"年度格式不合格!"
;
if
(
jsonObject
.
getString
(
"securityCodeIn"
)==
null
||
jsonObject
.
getString
(
"securityCodeIn"
).
length
()>
50
)
return
"安检编码不合格!"
;
if
(
jsonObject
.
getString
(
"securityCode"
)==
null
||
jsonObject
.
getString
(
"securityCode"
).
length
()>
50
)
return
"外部编码不合格!"
;
if
(
jsonObject
.
getString
(
"userName"
)==
null
||
jsonObject
.
getString
(
"userName"
).
length
()
>
20
)
return
"用户名称不合格!"
;
if
(
jsonObject
.
getString
(
"indoorTime"
)==
null
||
isValidDate
(
jsonObject
.
getString
(
"indoorTime"
),
"yyyy-MM-dd"
))
return
"上门日期格式不合格!"
;
if
(
jsonObject
.
getString
(
"indoorStatus"
)==
null
||
jsonObject
.
getString
(
"indoorStatus"
).
length
()
>
10
)
return
"状态式不合格!"
;
if
(
jsonObject
.
getString
(
"houseNumber"
)==
null
||
jsonObject
.
getString
(
"houseNumber"
).
length
()>
100
)
return
"门牌号格式不合格!"
;
if
(
jsonObject
.
getString
(
"phoneNumber"
)==
null
||
jsonObject
.
getString
(
"phoneNumber"
).
length
()>
100
)
return
"手机号格式不合格!"
;
return
"success"
;
}
}
zh-baseversion-system/src/main/java/com/zehong/system/domain/TInspectReport.java
View file @
9b6dff46
...
...
@@ -22,9 +22,9 @@ public class TInspectReport extends BaseEntity
@Excel
(
name
=
"年度"
)
private
Integer
annual
;
/** 安检记录编码
,11 位企业编码+4 位年+6 位顺
*/
@Excel
(
name
=
"安检记录编码
,11 位企业编码+4 位年+6 位顺
"
)
private
Lo
ng
securityCodeIn
;
/** 安检记录编码 */
@Excel
(
name
=
"安检记录编码"
)
private
Stri
ng
securityCodeIn
;
/** 外部安检记录编码 */
@Excel
(
name
=
"外部安检记录编码"
)
...
...
@@ -32,7 +32,7 @@ public class TInspectReport extends BaseEntity
/** 用户编码 */
@Excel
(
name
=
"用户编码"
)
private
Stri
ng
userNo
;
private
Lo
ng
userNo
;
/** 用户姓名 */
@Excel
(
name
=
"用户姓名"
)
...
...
@@ -68,7 +68,7 @@ public class TInspectReport extends BaseEntity
/** 企业id */
@Excel
(
name
=
"企业id"
)
private
Lo
ng
companyInfoId
;
private
Stri
ng
companyInfoId
;
/** 第三方用户id */
@Excel
(
name
=
"第三方用户id"
)
...
...
@@ -89,6 +89,22 @@ public class TInspectReport extends BaseEntity
//最后上报时间
private
String
lastTime
;
public
Long
getUserNo
()
{
return
userNo
;
}
public
void
setUserNo
(
Long
userNo
)
{
this
.
userNo
=
userNo
;
}
public
String
getCompanyInfoId
()
{
return
companyInfoId
;
}
public
void
setCompanyInfoId
(
String
companyInfoId
)
{
this
.
companyInfoId
=
companyInfoId
;
}
public
String
getEnterpriseName
()
{
return
enterpriseName
;
}
...
...
@@ -155,12 +171,12 @@ public class TInspectReport extends BaseEntity
{
return
annual
;
}
public
void
setSecurityCodeIn
(
Long
securityCodeIn
)
public
void
setSecurityCodeIn
(
String
securityCodeIn
)
{
this
.
securityCodeIn
=
securityCodeIn
;
}
public
Long
getSecurityCodeIn
()
public
String
getSecurityCodeIn
()
{
return
securityCodeIn
;
}
...
...
@@ -173,15 +189,7 @@ public class TInspectReport extends BaseEntity
{
return
securityCode
;
}
public
void
setUserNo
(
String
userNo
)
{
this
.
userNo
=
userNo
;
}
public
String
getUserNo
()
{
return
userNo
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
...
...
@@ -254,15 +262,7 @@ public class TInspectReport extends BaseEntity
{
return
deptCode
;
}
public
void
setCompanyInfoId
(
Long
companyInfoId
)
{
this
.
companyInfoId
=
companyInfoId
;
}
public
Long
getCompanyInfoId
()
{
return
companyInfoId
;
}
public
void
setUserOwnId
(
String
userOwnId
)
{
this
.
userOwnId
=
userOwnId
;
...
...
zh-baseversion-system/src/main/java/com/zehong/system/mapper/TInspectReportMapper.java
View file @
9b6dff46
...
...
@@ -41,6 +41,7 @@ public interface TInspectReportMapper
* @return 结果
*/
public
int
insertTInspectReport
(
TInspectReport
tInspectReport
);
public
int
inserts
(
List
<
TInspectReport
>
list
);
/**
* 修改入户安检结果
...
...
zh-baseversion-system/src/main/resources/mapper/system/TInspectReportMapper.xml
View file @
9b6dff46
...
...
@@ -100,6 +100,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
</insert>
<insert
id=
"inserts"
parameterType=
"TInspectReport"
>
insert into t_inspect_report
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
annual,
security_code_in,
security_code,
user_no,
user_name,
indoor_time,
indoor_status,
village,
house_number,
phone_number,
company_info_id,
user_own_id
</trim>
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(#{item.annual},
#{item.securityCodeIn},
#{item.securityCode},
#{item.userNo},
#{item.userName},
#{item.indoorTime},
#{item.indoorStatus},
#{item.village},
#{item.houseNumber},
#{item.phoneNumber},
#{item.companyInfoId},
#{item.userOwnId})
</foreach>
</insert>
<update
id=
"updateTInspectReport"
parameterType=
"TInspectReport"
>
update t_inspect_report
<trim
prefix=
"SET"
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