Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 36fd1d7d
authored
Aug 01, 2023
by
丁伟峰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-order-saas' into develop
2 parents
4598058a
cc7d2804
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
14 deletions
project-order/src/main/java/com/dituhui/pea/order/common/SaasUtils.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/CapacityQueryServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderCreateServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/common/SaasUtils.java
View file @
36fd1d7
...
@@ -19,7 +19,8 @@ import java.util.List;
...
@@ -19,7 +19,8 @@ import java.util.List;
@Slf4j
@Slf4j
public
class
SaasUtils
{
public
class
SaasUtils
{
@Value
(
"${SaaS.ak}"
)
// todo
@Value
(
"284c57cbabad4755a9c657885a8df3e2"
)
String
ak
;
String
ak
;
@Value
(
"${SaaS.url}"
)
@Value
(
"${SaaS.url}"
)
...
@@ -56,9 +57,9 @@ public class SaasUtils {
...
@@ -56,9 +57,9 @@ public class SaasUtils {
assert
rs
!=
null
;
assert
rs
!=
null
;
for
(
SaasXyFendanDTO
.
AreaInfo
r
:
rs
.
getResult
())
{
for
(
SaasXyFendanDTO
.
AreaInfo
r
:
rs
.
getResult
())
{
// 分单接口暂时无图层返回
// 分单接口暂时无图层返回
if
(
r
.
getField
2
()
!=
null
&&
r
.
getField1
()
!=
null
)
{
if
(
r
.
getField
3
()
!=
null
&&
r
.
getField1
()
!=
null
)
{
blocks
.
add
(
new
BlockInfo
()
blocks
.
add
(
new
BlockInfo
()
.
setBlockId
(
r
.
getField
2
())
.
setBlockId
(
r
.
getField
3
())
.
setBlockName
(
r
.
getField1
()));
.
setBlockName
(
r
.
getField1
()));
}
}
}
}
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/CapacityQueryServiceImpl.java
View file @
36fd1d7
...
@@ -51,8 +51,8 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
...
@@ -51,8 +51,8 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
public
Result
<?>
queryMatchCapacityData
(
CapacityOrderQueryDTO
.
Request
reqDTO
)
{
public
Result
<?>
queryMatchCapacityData
(
CapacityOrderQueryDTO
.
Request
reqDTO
)
{
// 单条容量查询
// 单条容量查询
log
.
info
(
"===> queryMatchCapacityData()"
);
log
.
info
(
"===> queryMatchCapacityData()"
);
List
<
String
>
layerIds
=
capacityUtils
.
getLayers
(
reqDTO
.
getBrand
(),
reqDTO
.
getType
(),
reqDTO
.
getSkill
());
String
peaBrand
=
fixBrand
(
reqDTO
.
getBrand
());
List
<
String
>
layerIds
=
capacityUtils
.
getLayers
(
peaBrand
,
reqDTO
.
getType
(),
reqDTO
.
getSkill
());
// 同步到saas,返回blockId
// 同步到saas,返回blockId
List
<
String
>
blockIds
=
null
;
List
<
String
>
blockIds
=
null
;
...
@@ -61,12 +61,12 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
...
@@ -61,12 +61,12 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
}
else
{
}
else
{
blockIds
=
saasUtils
.
queryBlocksByAddress
(
reqDTO
.
getAddress
()).
stream
().
map
(
SaasUtils
.
BlockInfo
::
getBlockId
).
collect
(
Collectors
.
toList
());
blockIds
=
saasUtils
.
queryBlocksByAddress
(
reqDTO
.
getAddress
()).
stream
().
map
(
SaasUtils
.
BlockInfo
::
getBlockId
).
collect
(
Collectors
.
toList
());
}
}
if
(
blockIds
.
size
()
==
0
)
{
if
(
blockIds
.
isEmpty
()
)
{
log
.
error
(
"分单接口没有查到对应的结果"
);
log
.
error
(
"分单接口没有查到对应的结果"
);
Result
.
failed
(
String
.
format
(
"分单接口(address:%s)(location:%s) 没有查到配置区块"
,
reqDTO
.
getAddress
(),
reqDTO
.
getLocation
()));
Result
.
failed
(
String
.
format
(
"分单接口(address:%s)(location:%s) 没有查到配置区块"
,
reqDTO
.
getAddress
(),
reqDTO
.
getLocation
()));
}
}
List
<
String
>
teamIds
=
capacityUtils
.
getTeamIdsByBlockIdsAndLayerIds
(
blockIds
,
layerIds
);
List
<
String
>
teamIds
=
capacityUtils
.
getTeamIdsByBlockIdsAndLayerIds
(
blockIds
,
layerIds
);
if
(
teamIds
==
null
||
teamIds
.
size
()
==
0
)
{
if
(
teamIds
==
null
||
teamIds
.
isEmpty
()
)
{
return
Result
.
failed
(
"没有找到匹配的工作队"
);
return
Result
.
failed
(
"没有找到匹配的工作队"
);
}
}
...
@@ -77,13 +77,13 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
...
@@ -77,13 +77,13 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
.
map
(
EngineerInfoEntity:
:
getEngineerCode
).
collect
(
Collectors
.
toList
());
.
map
(
EngineerInfoEntity:
:
getEngineerCode
).
collect
(
Collectors
.
toList
());
log
.
info
(
"======= enginerCode: {}"
,
engineerCodes
);
log
.
info
(
"======= enginerCode: {}"
,
engineerCodes
);
List
<
String
>
matchEngineerCodes
=
engineerSkillDao
.
findAllByBrandAndTypeAndSkillAndEngineerCodeIn
(
reqDTO
.
getBrand
()
,
reqDTO
.
getType
(),
reqDTO
.
getSkill
(),
engineerCodes
).
stream
()
List
<
String
>
matchEngineerCodes
=
engineerSkillDao
.
findAllByBrandAndTypeAndSkillAndEngineerCodeIn
(
peaBrand
,
reqDTO
.
getType
(),
reqDTO
.
getSkill
(),
engineerCodes
).
stream
()
.
map
(
EngineerSkillEntity:
:
getEngineerCode
).
collect
(
Collectors
.
toList
());
.
map
(
EngineerSkillEntity:
:
getEngineerCode
).
collect
(
Collectors
.
toList
());
log
.
info
(
"======= matchEngineerCodes: {}"
,
matchEngineerCodes
);
log
.
info
(
"======= matchEngineerCodes: {}"
,
matchEngineerCodes
);
log
.
info
(
"符合技能要求的工作队[{}]符合技能要求的技术员[{}]"
,
teamId
,
matchEngineerCodes
);
log
.
info
(
"符合技能要求的工作队[{}]符合技能要求的技术员[{}]"
,
teamId
,
matchEngineerCodes
);
SkillInfoEntity
skillInfoEntity
=
skillInfoDao
.
getByBrandAndTypeAndSkill
(
reqDTO
.
getBrand
()
,
reqDTO
.
getType
(),
reqDTO
.
getSkill
());
SkillInfoEntity
skillInfoEntity
=
skillInfoDao
.
getByBrandAndTypeAndSkill
(
peaBrand
,
reqDTO
.
getType
(),
reqDTO
.
getSkill
());
List
<
CapacityOrderQueryDTO
.
CalendarDTO
>
calendars
=
getSummaryOfEngineersCapacity
(
teamId
,
matchEngineerCodes
,
reqDTO
.
getStartDate
(),
reqDTO
.
getEndDate
(),
skillInfoEntity
.
getTakeTime
());
List
<
CapacityOrderQueryDTO
.
CalendarDTO
>
calendars
=
getSummaryOfEngineersCapacity
(
teamId
,
matchEngineerCodes
,
reqDTO
.
getStartDate
(),
reqDTO
.
getEndDate
(),
skillInfoEntity
.
getTakeTime
());
CapacityOrderQueryDTO
.
Result
rs
=
new
CapacityOrderQueryDTO
.
Result
();
CapacityOrderQueryDTO
.
Result
rs
=
new
CapacityOrderQueryDTO
.
Result
();
...
@@ -179,4 +179,12 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
...
@@ -179,4 +179,12 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
calendar
.
setTimes
(
List
.
of
(
timeDTO
));
calendar
.
setTimes
(
List
.
of
(
timeDTO
));
return
calendar
;
return
calendar
;
}
}
private
String
fixBrand
(
String
brand
){
if
(!
brand
.
equals
(
"嘉格纳"
)){
return
"博世/西门子以及其他品牌"
;
}
else
{
return
brand
;
}
}
}
}
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderCreateServiceImpl.java
View file @
36fd1d7
...
@@ -120,7 +120,8 @@ public class OrderCreateServiceImpl implements OrderCreateService {
...
@@ -120,7 +120,8 @@ public class OrderCreateServiceImpl implements OrderCreateService {
entity
.
setName
(
req
.
getName
());
entity
.
setName
(
req
.
getName
());
entity
.
setPhone
(
req
.
getPhone
());
entity
.
setPhone
(
req
.
getPhone
());
entity
.
setBeanBrand
(
req
.
getBrand
());
entity
.
setBeanBrand
(
req
.
getBrand
());
entity
.
setBrand
(
fixBrand
(
req
.
getBrand
()));
String
peaBrand
=
fixBrand
(
req
.
getBrand
());
entity
.
setBrand
(
peaBrand
);
entity
.
setType
(
req
.
getType
());
entity
.
setType
(
req
.
getType
());
entity
.
setSkill
(
req
.
getSkill
());
entity
.
setSkill
(
req
.
getSkill
());
entity
.
setFaultDescribe
(
req
.
getFaultDescribe
());
entity
.
setFaultDescribe
(
req
.
getFaultDescribe
());
...
@@ -151,7 +152,7 @@ public class OrderCreateServiceImpl implements OrderCreateService {
...
@@ -151,7 +152,7 @@ public class OrderCreateServiceImpl implements OrderCreateService {
entity
.
setAppointmentMethod
(
"AUTO_NOW"
);
entity
.
setAppointmentMethod
(
"AUTO_NOW"
);
entity
.
setWorkshop
(
false
);
entity
.
setWorkshop
(
false
);
SkillInfoEntity
skillInfoEntity
=
skillInfoDao
.
getByBrandAndTypeAndSkill
(
req
.
getBrand
()
,
req
.
getType
(),
req
.
getSkill
());
SkillInfoEntity
skillInfoEntity
=
skillInfoDao
.
getByBrandAndTypeAndSkill
(
peaBrand
,
req
.
getType
(),
req
.
getSkill
());
assert
skillInfoEntity
!=
null
;
assert
skillInfoEntity
!=
null
;
entity
.
setTakeTime
(
skillInfoEntity
.
getTakeTime
());
entity
.
setTakeTime
(
skillInfoEntity
.
getTakeTime
());
// 基础保存
// 基础保存
...
@@ -159,19 +160,19 @@ public class OrderCreateServiceImpl implements OrderCreateService {
...
@@ -159,19 +160,19 @@ public class OrderCreateServiceImpl implements OrderCreateService {
// 分单处理
// 分单处理
List
<
String
>
blockIds
=
null
;
List
<
String
>
blockIds
=
null
;
List
<
String
>
layerIds
=
capacityUtils
.
getLayers
(
req
.
getBrand
()
,
req
.
getType
(),
req
.
getSkill
());
List
<
String
>
layerIds
=
capacityUtils
.
getLayers
(
peaBrand
,
req
.
getType
(),
req
.
getSkill
());
if
(
req
.
getLocation
()
!=
null
)
{
if
(
req
.
getLocation
()
!=
null
)
{
String
loc
=
String
.
format
(
"%f,%f"
,
req
.
getLocation
().
getLng
(),
req
.
getLocation
().
getLat
());
String
loc
=
String
.
format
(
"%f,%f"
,
req
.
getLocation
().
getLng
(),
req
.
getLocation
().
getLat
());
blockIds
=
saasUtils
.
queryBlocksByLocation
(
loc
).
stream
().
map
(
SaasUtils
.
BlockInfo
::
getBlockId
).
collect
(
Collectors
.
toList
());
blockIds
=
saasUtils
.
queryBlocksByLocation
(
loc
).
stream
().
map
(
SaasUtils
.
BlockInfo
::
getBlockId
).
collect
(
Collectors
.
toList
());
}
else
{
}
else
{
blockIds
=
saasUtils
.
queryBlocksByAddress
(
req
.
getAddress
()).
stream
().
map
(
SaasUtils
.
BlockInfo
::
getBlockId
).
collect
(
Collectors
.
toList
());
blockIds
=
saasUtils
.
queryBlocksByAddress
(
req
.
getAddress
()).
stream
().
map
(
SaasUtils
.
BlockInfo
::
getBlockId
).
collect
(
Collectors
.
toList
());
}
}
if
(
blockIds
.
size
()
==
0
)
{
if
(
blockIds
.
isEmpty
()
)
{
log
.
error
(
"分单接口没有查到对应的结果"
);
log
.
error
(
"分单接口没有查到对应的结果"
);
return
Result
.
failed
(
String
.
format
(
"分单接口(address:%s)(location:%s) 没有查到配置区块"
,
req
.
getAddress
(),
req
.
getLocation
()));
return
Result
.
failed
(
String
.
format
(
"分单接口(address:%s)(location:%s) 没有查到配置区块"
,
req
.
getAddress
(),
req
.
getLocation
()));
}
}
List
<
String
>
teamIds
=
capacityUtils
.
getTeamIdsByBlockIdsAndLayerIds
(
blockIds
,
layerIds
);
List
<
String
>
teamIds
=
capacityUtils
.
getTeamIdsByBlockIdsAndLayerIds
(
blockIds
,
layerIds
);
if
(
teamIds
==
null
||
teamIds
.
size
()
==
0
)
{
if
(
teamIds
==
null
||
teamIds
.
isEmpty
()
)
{
return
Result
.
failed
(
"没有找到匹配的工作队"
);
return
Result
.
failed
(
"没有找到匹配的工作队"
);
}
}
// 选择一个工作队(理论上,只有1个合适的工作队),然后遍历下面的各个技术员,从符合技能的技术员中,汇总相关的容量
// 选择一个工作队(理论上,只有1个合适的工作队),然后遍历下面的各个技术员,从符合技能的技术员中,汇总相关的容量
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment