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
d6320625
Commit
d6320625
authored
Aug 02, 2023
by
lcl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
u
parent
d1b492f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
39 deletions
+27
-39
BusinessRelateCompanyServiceImpl.java
...system/service/impl/BusinessRelateCompanyServiceImpl.java
+18
-28
ContactInfoServiceImpl.java
...a/com/dsk/system/service/impl/ContactInfoServiceImpl.java
+9
-11
No files found.
dsk-system/src/main/java/com/dsk/system/service/impl/BusinessRelateCompanyServiceImpl.java
View file @
d6320625
...
@@ -9,7 +9,6 @@ import com.dsk.common.utils.DateUtils;
...
@@ -9,7 +9,6 @@ import com.dsk.common.utils.DateUtils;
import
com.dsk.system.domain.business.dto.BusinessIdDto
;
import
com.dsk.system.domain.business.dto.BusinessIdDto
;
import
com.dsk.system.dskService.EnterpriseService
;
import
com.dsk.system.dskService.EnterpriseService
;
import
com.dsk.system.mapper.BusinessRelateCompanyMapper
;
import
com.dsk.system.mapper.BusinessRelateCompanyMapper
;
import
com.dsk.system.service.IBusinessInfoService
;
import
com.dsk.system.service.IBusinessRelateCompanyService
;
import
com.dsk.system.service.IBusinessRelateCompanyService
;
import
org.apache.commons.collections4.MapUtils
;
import
org.apache.commons.collections4.MapUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -28,12 +27,9 @@ import java.util.stream.Collectors;
...
@@ -28,12 +27,9 @@ import java.util.stream.Collectors;
* @date 2023-05-17
* @date 2023-05-17
*/
*/
@Service
@Service
public
class
BusinessRelateCompanyServiceImpl
implements
IBusinessRelateCompanyService
public
class
BusinessRelateCompanyServiceImpl
implements
IBusinessRelateCompanyService
{
{
@Resource
@Resource
private
BusinessRelateCompanyMapper
businessRelateCompanyMapper
;
private
BusinessRelateCompanyMapper
businessRelateCompanyMapper
;
@Resource
private
IBusinessInfoService
businessInfoService
;
@Autowired
@Autowired
private
EnterpriseService
enterpriseService
;
private
EnterpriseService
enterpriseService
;
...
@@ -44,8 +40,7 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
...
@@ -44,8 +40,7 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
* @return 项目关联单位
* @return 项目关联单位
*/
*/
@Override
@Override
public
BusinessRelateCompany
selectBusinessRelateCompanyById
(
Long
id
)
public
BusinessRelateCompany
selectBusinessRelateCompanyById
(
Long
id
)
{
{
return
businessRelateCompanyMapper
.
selectBusinessRelateCompanyById
(
id
);
return
businessRelateCompanyMapper
.
selectBusinessRelateCompanyById
(
id
);
}
}
...
@@ -56,8 +51,7 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
...
@@ -56,8 +51,7 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
* @return 项目关联单位
* @return 项目关联单位
*/
*/
@Override
@Override
public
List
<
BusinessRelateCompany
>
selectBusinessRelateCompanyList
(
BusinessRelateCompany
businessRelateCompany
)
public
List
<
BusinessRelateCompany
>
selectBusinessRelateCompanyList
(
BusinessRelateCompany
businessRelateCompany
)
{
{
return
businessRelateCompanyMapper
.
selectBusinessRelateCompanyList
(
businessRelateCompany
);
return
businessRelateCompanyMapper
.
selectBusinessRelateCompanyList
(
businessRelateCompany
);
}
}
...
@@ -69,14 +63,14 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
...
@@ -69,14 +63,14 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
*/
*/
@Override
@Override
@Transactional
@Transactional
public
int
insertBusinessRelateCompany
(
BusinessRelateCompany
businessRelateCompany
)
public
int
insertBusinessRelateCompany
(
BusinessRelateCompany
businessRelateCompany
)
{
{
if
(
ObjectUtil
.
isNotEmpty
(
businessRelateCompany
.
getPhone
())
&&
!
CheckUtils
.
isPhone
(
businessRelateCompany
.
getPhone
()))
{
// if(!CheckUtils.isPhone(businessRelateCompany.getPhone())) throw new BaseException("500",
"请输入正确的电话号码");
throw
new
BaseException
(
"500"
,
"请输入正确的电话号码"
);
businessRelateCompany
.
setCreateTime
(
DateUtils
.
getNowDate
());
}
//查询企业的城投id和建设库id
//查询企业的城投id和建设库id
Map
<
String
,
Object
>
map
=
enterpriseService
.
getCidAndUipIdByCompanyName
(
businessRelateCompany
.
getCompanyName
());
Map
<
String
,
Object
>
map
=
enterpriseService
.
getCidAndUipIdByCompanyName
(
businessRelateCompany
.
getCompanyName
());
businessRelateCompany
.
setCompanyUipId
(
MapUtils
.
getString
(
map
,
"uipId"
,
null
));
businessRelateCompany
.
setCompanyUipId
(
MapUtils
.
getString
(
map
,
"uipId"
,
null
));
businessRelateCompany
.
setCompanyId
(
MapUtils
.
getInteger
(
map
,
"companyId"
,
null
));
businessRelateCompany
.
setCompanyId
(
MapUtils
.
getInteger
(
map
,
"companyId"
,
null
));
return
businessRelateCompanyMapper
.
insertBusinessRelateCompany
(
businessRelateCompany
);
return
businessRelateCompanyMapper
.
insertBusinessRelateCompany
(
businessRelateCompany
);
}
}
...
@@ -88,16 +82,14 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
...
@@ -88,16 +82,14 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
*/
*/
@Override
@Override
@Transactional
@Transactional
public
int
updateBusinessRelateCompany
(
BusinessRelateCompany
businessRelateCompany
)
public
int
updateBusinessRelateCompany
(
BusinessRelateCompany
businessRelateCompany
)
{
{
if
(
ObjectUtil
.
isNotEmpty
(
businessRelateCompany
.
getPhone
())
&&
!
CheckUtils
.
isPhone
(
businessRelateCompany
.
getPhone
()))
{
if
(
ObjectUtil
.
isNotEmpty
(
businessRelateCompany
.
getPhone
())){
throw
new
BaseException
(
"500"
,
"请输入正确的电话号码"
);
if
(!
CheckUtils
.
isPhone
(
businessRelateCompany
.
getPhone
()))
throw
new
BaseException
(
"500"
,
"请输入正确的电话号码"
);
}
}
businessRelateCompany
.
setUpdateTime
(
DateUtils
.
getNowDate
());
//查询企业的城投id和建设库id
//查询企业的城投id和建设库id
Map
<
String
,
Object
>
map
=
enterpriseService
.
getCidAndUipIdByCompanyName
(
businessRelateCompany
.
getCompanyName
());
Map
<
String
,
Object
>
map
=
enterpriseService
.
getCidAndUipIdByCompanyName
(
businessRelateCompany
.
getCompanyName
());
businessRelateCompany
.
setCompanyUipId
(
MapUtils
.
getString
(
map
,
"uipId"
,
null
));
businessRelateCompany
.
setCompanyUipId
(
MapUtils
.
getString
(
map
,
"uipId"
,
null
));
businessRelateCompany
.
setCompanyId
(
MapUtils
.
getInteger
(
map
,
"companyId"
,
null
));
businessRelateCompany
.
setCompanyId
(
MapUtils
.
getInteger
(
map
,
"companyId"
,
null
));
return
businessRelateCompanyMapper
.
updateBusinessRelateCompany
(
businessRelateCompany
);
return
businessRelateCompanyMapper
.
updateBusinessRelateCompany
(
businessRelateCompany
);
}
}
...
@@ -108,8 +100,7 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
...
@@ -108,8 +100,7 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
int
deleteBusinessRelateCompanyByIds
(
Long
[]
ids
)
public
int
deleteBusinessRelateCompanyByIds
(
Long
[]
ids
)
{
{
return
businessRelateCompanyMapper
.
deleteBusinessRelateCompanyByIds
(
ids
);
return
businessRelateCompanyMapper
.
deleteBusinessRelateCompanyByIds
(
ids
);
}
}
...
@@ -120,18 +111,17 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
...
@@ -120,18 +111,17 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
int
deleteBusinessRelateCompanyById
(
Long
id
)
public
int
deleteBusinessRelateCompanyById
(
Long
id
)
{
{
return
businessRelateCompanyMapper
.
deleteBusinessRelateCompanyById
(
id
);
return
businessRelateCompanyMapper
.
deleteBusinessRelateCompanyById
(
id
);
}
}
@Override
@Override
public
List
<
String
>
companyRoleList
(
BusinessIdDto
dto
)
{
public
List
<
String
>
companyRoleList
(
BusinessIdDto
dto
)
{
List
<
BusinessRelateCompany
>
roleList
=
businessRelateCompanyMapper
.
selectList
(
Wrappers
.<
BusinessRelateCompany
>
lambdaQuery
()
List
<
BusinessRelateCompany
>
roleList
=
businessRelateCompanyMapper
.
selectList
(
Wrappers
.<
BusinessRelateCompany
>
lambdaQuery
()
.
select
(
BusinessRelateCompany:
:
getCompanyRole
)
.
select
(
BusinessRelateCompany:
:
getCompanyRole
)
.
eq
(
BusinessRelateCompany:
:
getBusinessId
,
dto
.
getBusinessId
())
.
eq
(
BusinessRelateCompany:
:
getBusinessId
,
dto
.
getBusinessId
())
.
groupBy
(
BusinessRelateCompany:
:
getCompanyRole
)
.
groupBy
(
BusinessRelateCompany:
:
getCompanyRole
)
.
orderByDesc
(
BusinessRelateCompany:
:
getCreateTime
));
.
orderByDesc
(
BusinessRelateCompany:
:
getCreateTime
));
return
roleList
.
stream
().
map
(
p
->
p
.
getCompanyRole
()).
collect
(
Collectors
.
toList
());
return
roleList
.
stream
().
map
(
p
->
p
.
getCompanyRole
()).
collect
(
Collectors
.
toList
());
}
}
}
}
dsk-system/src/main/java/com/dsk/system/service/impl/ContactInfoServiceImpl.java
View file @
d6320625
...
@@ -6,11 +6,9 @@ import com.dsk.common.utils.SecurityUtils;
...
@@ -6,11 +6,9 @@ import com.dsk.common.utils.SecurityUtils;
import
com.dsk.system.domain.customer.ContactInfo
;
import
com.dsk.system.domain.customer.ContactInfo
;
import
com.dsk.system.domain.customer.dto.ContactInfoSearchDto
;
import
com.dsk.system.domain.customer.dto.ContactInfoSearchDto
;
import
com.dsk.system.domain.customer.vo.ContactInfoListVo
;
import
com.dsk.system.domain.customer.vo.ContactInfoListVo
;
import
com.dsk.system.domain.customer.vo.CustomerVo
;
import
com.dsk.system.dskService.EnterpriseService
;
import
com.dsk.system.dskService.EnterpriseService
;
import
com.dsk.system.mapper.ContactInfoMapper
;
import
com.dsk.system.mapper.ContactInfoMapper
;
import
com.dsk.system.service.IContactInfoService
;
import
com.dsk.system.service.IContactInfoService
;
import
com.dsk.system.service.ICustomerService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.MapUtils
;
import
org.apache.commons.collections4.MapUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -37,8 +35,8 @@ public class ContactInfoServiceImpl implements IContactInfoService {
...
@@ -37,8 +35,8 @@ public class ContactInfoServiceImpl implements IContactInfoService {
@Autowired
@Autowired
private
EnterpriseService
enterpriseService
;
private
EnterpriseService
enterpriseService
;
@Resource
//
@Resource
private
ICustomerService
customerService
;
//
private ICustomerService customerService;
@Override
@Override
public
List
<
ContactInfoListVo
>
selectList
(
ContactInfoSearchDto
dto
)
{
public
List
<
ContactInfoListVo
>
selectList
(
ContactInfoSearchDto
dto
)
{
...
@@ -73,17 +71,17 @@ public class ContactInfoServiceImpl implements IContactInfoService {
...
@@ -73,17 +71,17 @@ public class ContactInfoServiceImpl implements IContactInfoService {
* 参数验证
* 参数验证
*/
*/
private
void
verifyParameter
(
ContactInfo
bean
)
{
private
void
verifyParameter
(
ContactInfo
bean
)
{
if
(!
ObjectUtils
.
isEmpty
(
bean
.
getCompanyName
())
&&
!
ObjectUtils
.
isEmpty
(
bean
.
getProjectId
())
)
{
if
(!
ObjectUtils
.
isEmpty
(
bean
.
getCompanyName
()))
{
Map
<
String
,
Object
>
map
=
enterpriseService
.
getCidAndUipIdByCompanyName
(
bean
.
getCompanyName
());
Map
<
String
,
Object
>
map
=
enterpriseService
.
getCidAndUipIdByCompanyName
(
bean
.
getCompanyName
());
bean
.
setCompanyId
(
MapUtils
.
getInteger
(
map
,
"companyId"
));
bean
.
setCompanyId
(
MapUtils
.
getInteger
(
map
,
"companyId"
));
bean
.
setUipId
(
MapUtils
.
getString
(
map
,
"uipId"
));
bean
.
setUipId
(
MapUtils
.
getString
(
map
,
"uipId"
));
}
}
if
(!
ObjectUtils
.
isEmpty
(
bean
.
getCustomerId
())
&&
ObjectUtils
.
isEmpty
(
bean
.
getId
()))
{
//
if (!ObjectUtils.isEmpty(bean.getCustomerId()) && ObjectUtils.isEmpty(bean.getId())) {
CustomerVo
info
=
customerService
.
info
(
bean
.
getCustomerId
());
//
CustomerVo info = customerService.info(bean.getCustomerId());
bean
.
setCompanyName
(
info
.
getCompanyName
());
//
bean.setCompanyName(info.getCompanyName());
bean
.
setCompanyId
(
info
.
getCompanyId
());
//
bean.setCompanyId(info.getCompanyId());
bean
.
setUipId
(
info
.
getUipId
());
//
bean.setUipId(info.getUipId());
}
//
}
LoginUser
loginUser
=
SecurityUtils
.
getLoginUser
();
LoginUser
loginUser
=
SecurityUtils
.
getLoginUser
();
bean
.
setUpdateId
(
loginUser
.
getUserId
());
bean
.
setUpdateId
(
loginUser
.
getUserId
());
bean
.
setUpdateBy
(
loginUser
.
getUser
().
getNickName
());
bean
.
setUpdateBy
(
loginUser
.
getUser
().
getNickName
());
...
...
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