Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
487c02df
Commit
487c02df
authored
Nov 20, 2024
by
韩桐桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):三环车用气瓶认领 接口 修改
parent
fd33d05e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
9 deletions
+71
-9
CommonMapper.xml
...-module-jg-api/src/main/resources/mapper/CommonMapper.xml
+8
-3
ShCarServiceImpl.java
...mos/boot/module/jg/biz/service/impl/ShCarServiceImpl.java
+63
-6
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/CommonMapper.xml
View file @
487c02df
...
...
@@ -813,10 +813,15 @@
SELECT COUNT( 1 )
FROM idx_biz_jg_register_info jri
LEFT JOIN idx_biz_jg_other_info joi ON joi."RECORD" = jri."RECORD"
WHERE
jri."USE_ORG_CODE" = #{useRegistrationCode}
AND jri."RECORD" != #{equipId}
<where>
<if
test=
"useRegistrationCode != null and useRegistrationCode != ''"
>
jri."USE_ORG_CODE" = #{useRegistrationCode}
</if>
<if
test=
"equipId != null and equipId != ''"
>
AND jri."RECORD" != #{equipId}
</if>
AND joi.CLAIM_STATUS = '已认领'
</where>
</select>
<select
id=
"queryOutOfMaintenanceRecord"
resultType=
"java.util.Map"
>
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/ShCarServiceImpl.java
View file @
487c02df
...
...
@@ -45,8 +45,11 @@ import javax.annotation.Resource;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
static
com
.
alibaba
.
fastjson
.
JSON
.
toJSONString
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
enums
.
VehicleApanageEnum
.
XIAN_YANG
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
enums
.
VehicleApanageEnum
.
XI_XIAN
;
/**
* 三环系统-车辆信息表服务实现类
...
...
@@ -137,12 +140,34 @@ public class ShCarServiceImpl extends BaseService<ShCar, ShCar, ShCarMapper> imp
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
()))
+
""
,
ReginParams
.
class
);
JSONArray
equList
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
paramMap
.
get
(
"equList"
)));
// 0. 必要校验
// 0.1 使用登记证的唯一校验
String
useRegistrationCode
=
String
.
valueOf
(
paramMap
.
get
(
"useRegistrationCode"
));
Boolean
used
=
commonService
.
useRegistrationCertificateAccountUnique
(
useRegistrationCode
,
null
);
if
(
used
)
{
throw
new
BadRequest
(
"使用登记证编号已存在!"
);
}
// 0.2 设备代码的唯一校验
Set
<
String
>
equCodeSet
=
equList
.
stream
().
map
(
equ
->
{
JSONObject
jsonObject
=
JSON
.
parseObject
(
toJSONString
(
equ
));
return
jsonObject
.
getString
(
"equCode"
);
}).
collect
(
Collectors
.
toSet
());
if
(
equCodeSet
.
size
()
<
equList
.
size
())
throw
new
BadRequest
(
"设备代码重复!"
);
equCodeSet
.
forEach
(
equCode
->
{
Boolean
useFlag
=
commonService
.
checkEquCodeUniqueness
(
equCode
);
if
(
useFlag
)
{
throw
new
BadRequest
(
"设备代码已存在系统中!"
);
}
});
try
{
// 清除seq,避免后续所有 业务表 都使用此 seq
paramMap
.
remove
(
"sequenceNbr"
);
// 1. 生成设备信息 + 保存es
this
.
claimGenEquInfo
(
equList
,
reginParams
);
this
.
claimGenEquInfo
(
useRegistrationCode
,
paramMap
,
equList
,
reginParams
);
// 2. 生成车用气瓶使用登记证单据( JgVehicleInformation JgVehicleInformationEq )信息
JgVehicleInformation
jgVehicleInformation
=
this
.
claimGenVehicleInfoAbout
(
paramMap
,
equList
,
reginParams
);
...
...
@@ -159,7 +184,7 @@ public class ShCarServiceImpl extends BaseService<ShCar, ShCar, ShCarMapper> imp
}
catch
(
Exception
e
)
{
log
.
error
(
"三环系统数据认领失败,使用登记证代码:{}"
,
paramMap
.
get
(
"useRegistrationCode"
));
log
.
error
(
"失败原因:{}"
,
e
.
getMessage
());
log
.
error
(
"失败原因:{}"
,
e
.
getMessage
());
this
.
handleClaimFailed
(
equList
);
throw
new
BadRequest
(
"认领时出现异常,请联系管理员!"
);
}
...
...
@@ -203,7 +228,7 @@ public class ShCarServiceImpl extends BaseService<ShCar, ShCar, ShCarMapper> imp
.
certificateStatus
(
CertificateStatusEnum
.
YIDENGJI
.
getName
())
.
regDate
(
jgVehicleInformation
.
getRegDate
())
.
createUserId
(
RequestContext
.
getExeUserId
())
.
volume
(
String
.
valueOf
(
totalVolume
))
.
volume
(
totalVolume
.
toPlainString
(
))
.
carNumber
(
jgVehicleInformation
.
getCarNumber
())
.
createDate
(
new
Date
())
.
gasNum
(
equList
.
size
())
...
...
@@ -251,7 +276,7 @@ public class ShCarServiceImpl extends BaseService<ShCar, ShCar, ShCarMapper> imp
*
* @param equList 设备集合
*/
public
void
claimGenEquInfo
(
JSONArray
equList
,
ReginParams
reginParams
)
{
public
void
claimGenEquInfo
(
String
useRegistrationCode
,
Map
<
String
,
Object
>
paramMap
,
JSONArray
equList
,
ReginParams
reginParams
)
{
CompanyBo
company
=
reginParams
.
getCompany
();
// 保存设备后 后续业务需要的设备信息
for
(
int
i
=
0
;
i
<
equList
.
size
();
i
++)
{
...
...
@@ -278,6 +303,10 @@ public class ShCarServiceImpl extends BaseService<ShCar, ShCar, ShCarMapper> imp
useInfo
.
setUseUnitName
(
company
.
getCompanyName
());
useInfo
.
setUseUnitCreditCode
(
company
.
getCompanyCode
());
}
useInfo
.
setORegUnit
((
String
)
paramMap
.
get
(
"oRegUnit"
));
useInfo
.
setORegDate
((
String
)
paramMap
.
get
(
"oRegDate"
));
useInfo
.
setOldUseRegistrationTable
(
JSON
.
toJSONString
(
paramMap
.
get
(
"oldUseRegistrationTable"
)));
useInfo
.
setOldUseRegistrationCertificate
(
JSON
.
toJSONString
(
paramMap
.
get
(
"oldUseRegistrationCertificate"
)));
idxBizJgUseInfoService
.
save
(
useInfo
);
// 设计信息
...
...
@@ -302,7 +331,8 @@ public class ShCarServiceImpl extends BaseService<ShCar, ShCar, ShCarMapper> imp
IdxBizJgRegisterInfo
registerInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equObj
),
IdxBizJgRegisterInfo
.
class
);
registerInfo
.
setRecord
(
equRecord
);
registerInfo
.
setRecDate
(
date
);
registerInfo
.
setUseOrgCode
(
equObj
.
getString
(
"useRegistrationCode"
));
registerInfo
.
setUseOrgCode
(
useRegistrationCode
);
registerInfo
.
setWhetherSkidMountedPressureVessel
(
"0"
);
registerInfo
.
setRegisterState
(
idxBizJgRegisterInfoService
.
getRegCode
());
idxBizJgRegisterInfoService
.
save
(
registerInfo
);
...
...
@@ -310,6 +340,15 @@ public class ShCarServiceImpl extends BaseService<ShCar, ShCar, ShCarMapper> imp
IdxBizJgSupervisionInfo
supervisionInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equObj
),
IdxBizJgSupervisionInfo
.
class
);
supervisionInfo
.
setRecord
(
equRecord
);
supervisionInfo
.
setRecDate
(
date
);
if
(!
StringUtils
.
isEmpty
(
supervisionInfo
.
getOrgBranchCode
()))
{
String
[]
orgBranchCode
=
supervisionInfo
.
getOrgBranchCode
().
split
(
"_"
);
supervisionInfo
.
setOrgBranchCode
(
orgBranchCode
[
0
]);
supervisionInfo
.
setOrgBranchName
(
orgBranchCode
[
1
]);
HashMap
<
String
,
Object
>
parentMessage
=
(
HashMap
<
String
,
Object
>)
Privilege
.
companyClient
.
queryByOrgcode
(
orgBranchCode
[
0
]).
getResult
();
// 目前平台返回key为compnay(存在拼写错误)
CompanyModel
parentModel
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
parentMessage
.
get
(
"compnay"
)),
CompanyModel
.
class
);
supervisionInfo
.
setCompanyOrgBranchCode
(
parentModel
.
getCompanyCode
());
}
idxBizJgSupervisionInfoService
.
save
(
supervisionInfo
);
// 其他信息
...
...
@@ -317,6 +356,18 @@ public class ShCarServiceImpl extends BaseService<ShCar, ShCar, ShCarMapper> imp
otherInfo
.
setRecord
(
equRecord
);
otherInfo
.
setClaimStatus
(
"已认领"
);
otherInfo
.
setRecDate
(
date
);
// ---生成监管码
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
String
vehicleApanage
=
(
String
)
paramMap
.
get
(
"vehicleApanage"
);
// 判断是否为西咸
String
isXiXian
=
XI_XIAN
.
getCode
().
equals
(
vehicleApanage
)
?
"1"
:
"0"
;
map
.
put
(
"cityCode"
,
XI_XIAN
.
getCode
().
equals
(
vehicleApanage
)
?
XIAN_YANG
.
getCode
()
:
vehicleApanage
);
map
.
put
(
"isXiXian"
,
isXiXian
);
map
.
put
(
"equCategory"
,
registerInfo
.
getEquCategory
());
map
.
put
(
"countyCode"
,
XI_XIAN
.
getCode
().
equals
(
vehicleApanage
)
?
XIAN_YANG
.
getCode
()
:
vehicleApanage
);
ResponseModel
<
Map
<
String
,
Object
>>
code
=
tzsServiceFeignClient
.
createCode
(
map
);
Map
<
String
,
Object
>
result
=
code
.
getResult
();
otherInfo
.
setSupervisoryCode
((
String
)
result
.
get
(
"superviseCode"
));
idxBizJgOtherInfoService
.
save
(
otherInfo
);
// 压力容器技术参数
...
...
@@ -329,6 +380,12 @@ public class ShCarServiceImpl extends BaseService<ShCar, ShCar, ShCarMapper> imp
IdxBizJgInspectionDetectionInfo
inspectionDetectionInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equObj
),
IdxBizJgInspectionDetectionInfo
.
class
);
inspectionDetectionInfo
.
setRecord
(
equRecord
);
inspectionDetectionInfo
.
setRecDate
(
date
);
// 检验机构信息
if
(!
StringUtils
.
isEmpty
(
inspectionDetectionInfo
.
getInspectOrgName
()))
{
String
[]
inspectOrg
=
inspectionDetectionInfo
.
getInspectOrgName
().
split
(
"_"
);
inspectionDetectionInfo
.
setInspectOrgCode
(
inspectOrg
[
0
]);
inspectionDetectionInfo
.
setInspectOrgName
(
inspectOrg
[
1
]);
}
if
(
inspectionDetectionInfo
.
getNextInspectDate
()
!=
null
)
{
inspectionDetectionInfo
.
setNextInspectDate
(
DateUtil
.
parse
(
DateUtil
.
format
(
inspectionDetectionInfo
.
getNextInspectDate
(),
DatePattern
.
NORM_DATE_PATTERN
)));
}
...
...
@@ -419,7 +476,7 @@ public class ShCarServiceImpl extends BaseService<ShCar, ShCar, ShCarMapper> imp
vehicleInformation
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
vehicleInformation
.
setGasNum
(
equList
.
size
());
vehicleInformation
.
setAuditPassDate
(
new
Date
());
vehicleInformation
.
setRegType
(
"1"
);
//历史登记
vehicleInformation
.
setRegType
(
"1"
);
//
历史登记
vehicleInformation
.
setStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
vehicleInformation
.
setCreateDate
(
new
Date
());
BigDecimal
totalVolume
=
equList
.
stream
().
map
(
x
->
new
BigDecimal
(
String
.
valueOf
(
JSON
.
parseObject
(
JSON
.
toJSONString
(
x
)).
get
(
"singleBottleVolume"
))))
...
...
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