Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-cr20g
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
Administrator
dsk-cr20g
Commits
664603e1
Commit
664603e1
authored
Jul 27, 2023
by
lcl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
u
parent
b895e4a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
30 deletions
+36
-30
CheckUtils.java
...common/src/main/java/com/dsk/common/utils/CheckUtils.java
+5
-2
CustomerServiceImpl.java
...java/com/dsk/system/service/impl/CustomerServiceImpl.java
+31
-28
No files found.
dsk-common/src/main/java/com/dsk/common/utils/CheckUtils.java
View file @
664603e1
package
com
.
dsk
.
common
.
utils
;
import
java.math.BigDecimal
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
...
...
@@ -51,7 +52,8 @@ public class CheckUtils {
* @return
*/
public
static
int
checkIntegerPlaces
(
Double
number
)
{
String
strNumber
=
Double
.
toString
(
Math
.
abs
(
number
));
BigDecimal
bigDecimal
=
new
BigDecimal
(
number
);
String
strNumber
=
bigDecimal
.
toString
();
int
integerPlaces
=
strNumber
.
indexOf
(
'.'
);
if
(
integerPlaces
==
-
1
)
{
return
strNumber
.
length
();
...
...
@@ -66,7 +68,8 @@ public class CheckUtils {
* @return
*/
public
static
int
checkDecimalPlaces
(
Double
number
)
{
String
strNumber
=
Double
.
toString
(
Math
.
abs
(
number
));
BigDecimal
bigDecimal
=
new
BigDecimal
(
number
);
String
strNumber
=
bigDecimal
.
toString
();
int
decimalPlaces
=
0
;
int
index
=
strNumber
.
indexOf
(
'.'
);
if
(
index
!=
-
1
)
{
...
...
dsk-system/src/main/java/com/dsk/system/service/impl/CustomerServiceImpl.java
View file @
664603e1
...
...
@@ -3,6 +3,7 @@ package com.dsk.system.service.impl;
import
cn.hutool.core.bean.BeanException
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.map.MapUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.dsk.common.core.domain.R
;
import
com.dsk.common.exception.ServiceException
;
...
...
@@ -179,36 +180,38 @@ public class CustomerServiceImpl implements ICustomerService {
private
void
dealWithcustomerData
(
Customer
customer
)
{
if
(
ObjectUtils
.
isEmpty
(
customer
.
getCompanyName
()))
throw
new
BeanException
(
"企业名称不能为空"
);
if
(
ObjectUtils
.
isEmpty
(
customer
.
getCompanyId
()))
{
try
{
Map
<
String
,
Object
>
map
=
opportunityRadarService
.
enterpriseByName
(
customer
.
getCompanyName
());
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"data"
)))
{
customer
.
setCompanyId
(
MapUtil
.
getInt
(
BeanUtil
.
beanToMap
(
map
.
get
(
"data"
)),
"jskEid"
));
if
(
ObjectUtils
.
isEmpty
(
customer
.
getLegalPerson
()))
{
customer
.
setLegalPerson
(
MapUtil
.
getStr
(
map
,
"legalPerson"
));
}
if
(
ObjectUtils
.
isEmpty
(
customer
.
getRegisterCapital
()))
{
customer
.
setRegisterCapital
(
MapUtil
.
getStr
(
map
,
"registeredCapitalStr"
));
}
if
(
ObjectUtils
.
isEmpty
(
customer
.
getProvinceId
()))
{
customer
.
setProvinceId
(
MapUtil
.
getInt
(
map
,
"provinceId"
));
}
if
(
ObjectUtils
.
isEmpty
(
customer
.
getCityId
()))
{
customer
.
setCityId
(
MapUtil
.
getInt
(
map
,
"cityId"
));
}
if
(
ObjectUtils
.
isEmpty
(
customer
.
getDistrictId
()))
{
customer
.
setDistrictId
(
MapUtil
.
getInt
(
map
,
"countyId"
));
}
if
(
ObjectUtils
.
isEmpty
(
customer
.
getRegisterAddress
()))
{
customer
.
setRegisterAddress
(
MapUtil
.
getStr
(
map
,
"domicile"
));
}
if
(
ObjectUtils
.
isEmpty
(
customer
.
getCreditCode
()))
{
customer
.
setCreditCode
(
MapUtil
.
getStr
(
map
,
"creditCode"
));
}
try
{
Map
<
String
,
Object
>
map
=
opportunityRadarService
.
enterpriseByName
(
customer
.
getCompanyName
());
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"data"
)))
{
Integer
companyId
=
MapUtil
.
getInt
(
BeanUtil
.
beanToMap
(
map
.
get
(
"data"
)),
"jskEid"
);
if
(
ObjectUtil
.
isNotEmpty
(
customer
.
getCompanyId
())
&&
customer
.
getCompanyId
()
!=
companyId
)
{
return
;
}
customer
.
setCompanyId
(
companyId
);
if
(
ObjectUtils
.
isEmpty
(
customer
.
getLegalPerson
()))
{
customer
.
setLegalPerson
(
MapUtil
.
getStr
(
map
,
"legalPerson"
));
}
if
(
ObjectUtils
.
isEmpty
(
customer
.
getRegisterCapital
()))
{
customer
.
setRegisterCapital
(
MapUtil
.
getStr
(
map
,
"registeredCapitalStr"
));
}
if
(
ObjectUtils
.
isEmpty
(
customer
.
getProvinceId
()))
{
customer
.
setProvinceId
(
MapUtil
.
getInt
(
map
,
"provinceId"
));
}
if
(
ObjectUtils
.
isEmpty
(
customer
.
getCityId
()))
{
customer
.
setCityId
(
MapUtil
.
getInt
(
map
,
"cityId"
));
}
if
(
ObjectUtils
.
isEmpty
(
customer
.
getDistrictId
()))
{
customer
.
setDistrictId
(
MapUtil
.
getInt
(
map
,
"countyId"
));
}
if
(
ObjectUtils
.
isEmpty
(
customer
.
getRegisterAddress
()))
{
customer
.
setRegisterAddress
(
MapUtil
.
getStr
(
map
,
"domicile"
));
}
if
(
ObjectUtils
.
isEmpty
(
customer
.
getCreditCode
()))
{
customer
.
setCreditCode
(
MapUtil
.
getStr
(
map
,
"creditCode"
));
}
}
catch
(
Exception
e
)
{
log
.
debug
(
"获取企业id错误!error:{}"
,
e
.
getMessage
());
}
}
catch
(
Exception
e
)
{
log
.
debug
(
"获取企业id错误!error:{}"
,
e
.
getMessage
());
}
}
...
...
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