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
2b9f784c
Commit
2b9f784c
authored
Oct 23, 2024
by
韩桐桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):bug 24340 气瓶 校验制造单位统一信用代码与出场编码唯一
parent
28219b61
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
11 deletions
+20
-11
CommonMapper.java
.../yeejoin/amos/boot/module/jg/api/mapper/CommonMapper.java
+2
-2
CommonMapper.xml
...-module-jg-api/src/main/resources/mapper/CommonMapper.xml
+3
-0
IdxBizJgRegisterInfoServiceImpl.java
.../jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
+15
-9
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/CommonMapper.java
View file @
2b9f784c
...
...
@@ -118,11 +118,11 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
/**
* 查询出厂编码是否重复
* @param factoryNum 出厂编码
* @param
sequenceNbr i
d
* @param
record 设备recor
d
* @return Integer
*/
Integer
checkFactoryNumUnique
(
@Param
(
"factoryNum"
)
String
factoryNum
,
@Param
(
"
sequenceNbr"
)
String
sequenceNbr
,
@Param
(
"
record"
)
String
record
,
@Param
(
"produceUnitCreditCode"
)
String
produceUnitCreditCode
);
/**
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/CommonMapper.xml
View file @
2b9f784c
...
...
@@ -804,6 +804,9 @@
AND ibjfi."FACTORY_NUM" = #{factoryNum}
AND ibjfi."PRODUCE_UNIT_CREDIT_CODE" = #{produceUnitCreditCode}
AND joi.CLAIM_STATUS = '已认领'
<if
test=
"record != null and record !=''"
>
AND ibjfi."RECORD"
<![CDATA[ <> ]]>
#{record}
</if>
</select>
<select
id=
"useRegistrationCertificateAccountUnique"
resultType=
"java.lang.Integer"
>
...
...
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/IdxBizJgRegisterInfoServiceImpl.java
View file @
2b9f784c
...
...
@@ -13,7 +13,6 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil
;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.google.common.base.Joiner
;
...
...
@@ -24,6 +23,7 @@ import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil
;
import
com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.CodeGenerateDto
;
...
...
@@ -379,11 +379,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if
(
paramMap
==
null
)
{
throw
new
IllegalArgumentException
(
"参数Map不能为空"
);
}
String
record
=
null
;
LinkedHashMap
equipmentClassForm
=
(
LinkedHashMap
)
checkAndCast
(
paramMap
.
get
(
EQUIP_CLASS_FORM_ID
));
LinkedHashMap
equipmentInfoForm
=
(
LinkedHashMap
)
checkAndCast
(
paramMap
.
get
(
EQUIP_INFO_FORM_ID
));
LinkedHashMap
equipmentParamsForm
=
(
LinkedHashMap
)
checkAndCast
(
paramMap
.
get
(
EQUIP_PARAMS_FORM_ID
));
String
submitType
=
String
.
valueOf
(
paramMap
.
get
(
"submitType"
));
String
record
=
(
String
)
equipmentInfoForm
.
get
(
RECORD
);
try
{
// 设备代码 字段的唯一性校验
...
...
@@ -393,9 +393,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 96333码 字段的唯一性校验
check96333Code
(
equipmentInfoForm
);
// 气瓶 校验制造单位统一信用代码与出场编码唯一
if
(
equipmentInfoForm
.
get
(
EQU_LIST
).
equals
(
"2000"
)
&&
equipmentInfoForm
.
get
(
EQU_CATEGORY
).
equals
(
"2300"
)
&&
commonMapper
.
checkFactoryNumUnique
(
String
.
valueOf
(
equipmentInfoForm
.
get
(
FACTORY_NUM
)),
null
,
String
.
valueOf
(
equipmentInfoForm
.
get
(
"PRODUCE_UNIT_CREDIT_CODE"
)))
>
0
)
{
throw
new
BadRequest
(
"出厂编号/产品编码在该企业中已存在!"
);
}
checkFactoryNumUniqueWithGasCylinder
(
equipmentInfoForm
,
record
);
}
catch
(
Exception
e
)
{
handleError
(
e
,
null
);
}
...
...
@@ -405,7 +403,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
boolean
isManageType
=
(!
ObjectUtils
.
isEmpty
(
manageType
)
&&
MANAGE_TYPE_UNIT
.
equals
(
manageType
));
if
(!
isManageType
)
{
// 编辑校验
this
.
checkForEquipEdit
(
equipmentInfoForm
.
get
(
RECORD
)
);
this
.
checkForEquipEdit
(
record
);
}
// 操作类型
try
{
...
...
@@ -457,6 +455,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
}
private
void
checkFactoryNumUniqueWithGasCylinder
(
LinkedHashMap
equipmentInfoForm
,
String
record
)
{
if
(
equipmentInfoForm
.
get
(
EQU_LIST
).
equals
(
"2000"
)
&&
equipmentInfoForm
.
get
(
EQU_CATEGORY
).
equals
(
"2300"
)
&&
commonMapper
.
checkFactoryNumUnique
(
String
.
valueOf
(
equipmentInfoForm
.
get
(
FACTORY_NUM
)),
record
,
String
.
valueOf
(
equipmentInfoForm
.
get
(
"PRODUCE_UNIT_CREDIT_CODE"
)))
>
0
)
{
throw
new
BadRequest
(
"出厂编号/产品编码在该企业中已存在!"
);
}
}
private
void
checkFactoryNumUniqueness
(
LinkedHashMap
equipmentInfoForm
)
{
// 车用气瓶业务里面的 出厂编号/产品编码 校验唯一性(产品编号在车用气瓶范围内全局唯一)
Integer
factoryNum
=
commonMapper
.
checkFactoryNumUniquenessForVehicleCylinder
((
String
)
equipmentInfoForm
.
get
(
FACTORY_NUM
),
(
String
)
equipmentInfoForm
.
get
(
RECORD
));
...
...
@@ -484,10 +490,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
throw
new
BadRequest
(
e
.
getMessage
());
}
private
void
checkForEquipEdit
(
Object
record
)
{
private
void
checkForEquipEdit
(
String
record
)
{
// 标识编辑
if
(
record
!=
null
)
{
Integer
inUseTime
=
commonService
.
countEquipInUseTimesForEdit
(
record
.
toString
()
);
if
(
!
ValidationUtil
.
isEmpty
(
record
)
)
{
Integer
inUseTime
=
commonService
.
countEquipInUseTimesForEdit
(
record
);
if
(
inUseTime
>
0
)
{
throw
new
BadRequest
(
"此设备在被其他业务引用,不可编辑!"
);
}
...
...
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