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 058a7f11
authored
Jul 12, 2023
by
丁伟峰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-dingwf-0715' into develop
2 parents
0b240194
9db5a71b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderCreateServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderCreateServiceImpl.java
View file @
058a7f1
...
...
@@ -19,6 +19,8 @@ package com.dituhui.pea.order.service.impl;
import
cn.hutool.core.util.IdUtil
;
import
cn.hutool.core.date.LocalDateTimeUtil
;
import
com.dituhui.pea.common.Result
;
import
com.dituhui.pea.order.common.CapacityUtils
;
import
com.dituhui.pea.order.common.SaasUtils
;
import
com.dituhui.pea.order.dao.OrderRequestDao
;
import
com.dituhui.pea.order.dao.OrgTeamDao
;
import
com.dituhui.pea.order.dao.ProductCategoryDao
;
...
...
@@ -59,6 +61,10 @@ public class OrderCreateServiceImpl implements OrderCreateService {
@Autowired
private
CommonService
commonService
;
@Autowired
private
CapacityUtils
capacityUtils
;
@Autowired
private
SaasUtils
saasUtils
;
private
List
<
LabelValueDTO
>
getPriorities
()
{
String
[]
priorities
=
{
"紧急"
,
"正常"
};
...
...
@@ -116,9 +122,23 @@ public class OrderCreateServiceImpl implements OrderCreateService {
entity
.
setCounty
(
location
.
getDistrict
());
entity
.
setAddress
(
location
.
getFormattedAddress
());
// 根据分单,填写clusterId/branchId/groupId/teamId等
String
layer
=
productCategoryDao
.
getLayerByBrandAndTypeAndSkill
(
req
.
getBrand
(),
req
.
getType
(),
req
.
getSkill
());
String
loc
=
String
.
format
(
"%f,%f"
,
req
.
getLocation
().
getLng
(),
req
.
getLocation
().
getLat
());
String
teamId
=
commonService
.
getTeamIdByInput
(
loc
,
req
.
getAddress
(),
layer
);
List
<
String
>
layerIds
=
capacityUtils
.
getLayers
(
req
.
getBrand
(),
req
.
getType
(),
req
.
getSkill
());
List
<
String
>
blockIds
=
saasUtils
.
queryBlockIds
(
loc
,
req
.
getAddress
());
if
(
blockIds
==
null
||
blockIds
.
size
()
==
0
)
{
log
.
error
(
"分单接口没有查到对应的结果"
);
Result
.
failed
(
String
.
format
(
"分单接口(address:%s)(location:%s) 没有查到配置区块"
,
req
.
getAddress
(),
req
.
getLocation
()));
}
List
<
String
>
teamIds
=
capacityUtils
.
getTeamIdsByBlockIdsAndLayerIds
(
blockIds
,
layerIds
);
if
(
teamIds
==
null
||
teamIds
.
size
()
==
0
)
{
Result
.
failed
(
"没有找到匹配的工作队"
);
}
// 选择一个工作队(理论上,只有1个合适的工作队),然后遍历下面的各个技术员,从符合技能的技术员中,汇总相关的容量
// 遍历工作队,每个工作队
String
teamId
=
teamIds
.
get
(
0
);
OrgTeamEntity
teamEntity
=
orgTeamDao
.
getByTeamId
(
teamId
);
entity
.
setOrgClusterId
(
teamEntity
.
getClusterId
());
entity
.
setOrgBranchId
(
teamEntity
.
getBranchId
());
...
...
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