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 e2b36da3
authored
Jul 05, 2023
by
张晓
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
为临时解读增加本地profile
1 parent
f1ffb1ce
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
9 deletions
project-dispatch/src/main/java/com/dituhui/pea/dispatch/service/impl/DispatchServiceImpl.java
project-dispatch/src/main/resources/application-dev.yaml
project-dispatch/src/main/java/com/dituhui/pea/dispatch/service/impl/DispatchServiceImpl.java
View file @
e2b36da
...
@@ -48,6 +48,7 @@ import com.dituhui.pea.dispatch.pojo.Customer;
...
@@ -48,6 +48,7 @@ import com.dituhui.pea.dispatch.pojo.Customer;
import
com.dituhui.pea.dispatch.pojo.Depot
;
import
com.dituhui.pea.dispatch.pojo.Depot
;
import
com.dituhui.pea.dispatch.pojo.Location
;
import
com.dituhui.pea.dispatch.pojo.Location
;
import
com.dituhui.pea.dispatch.pojo.Technician
;
import
com.dituhui.pea.dispatch.pojo.Technician
;
import
org.springframework.util.ResourceUtils
;
/**
/**
* @author gpzhang
* @author gpzhang
...
@@ -98,7 +99,7 @@ public class DispatchServiceImpl implements DispatchService {
...
@@ -98,7 +99,7 @@ public class DispatchServiceImpl implements DispatchService {
private
static
Map
<
String
,
Integer
>
loadCustomerCodeServiceTimeMap
()
private
static
Map
<
String
,
Integer
>
loadCustomerCodeServiceTimeMap
()
throws
UncheckedIOException
,
FileNotFoundException
{
throws
UncheckedIOException
,
FileNotFoundException
{
List
<
String
>
customerServiceTime
=
IOUtils
.
readLines
(
new
FileInputStream
(
"data/customerServiceTime.csv"
),
"utf-8"
);
List
<
String
>
customerServiceTime
=
IOUtils
.
readLines
(
new
FileInputStream
(
ResourceUtils
.
getFile
(
"classpath:data/customerServiceTime.csv"
)
),
"utf-8"
);
Map
<
String
,
Integer
>
customerCodeServiceTimeMap
=
new
HashMap
<
String
,
Integer
>();
// code-time
Map
<
String
,
Integer
>
customerCodeServiceTimeMap
=
new
HashMap
<
String
,
Integer
>();
// code-time
for
(
int
i
=
0
;
i
<
customerServiceTime
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
customerServiceTime
.
size
();
i
++)
{
String
line
=
customerServiceTime
.
get
(
i
);
String
line
=
customerServiceTime
.
get
(
i
);
...
@@ -111,7 +112,7 @@ public class DispatchServiceImpl implements DispatchService {
...
@@ -111,7 +112,7 @@ public class DispatchServiceImpl implements DispatchService {
private
static
Map
<
String
,
Map
<
String
,
Long
>>
loadPreferredlocationDistanceMap
()
private
static
Map
<
String
,
Map
<
String
,
Long
>>
loadPreferredlocationDistanceMap
()
throws
UncheckedIOException
,
FileNotFoundException
{
throws
UncheckedIOException
,
FileNotFoundException
{
List
<
String
>
technicianCodeLocation
=
IOUtils
List
<
String
>
technicianCodeLocation
=
IOUtils
.
readLines
(
new
FileInputStream
(
"data/technicianLocation.csv"
),
"utf-8"
);
.
readLines
(
new
FileInputStream
(
ResourceUtils
.
getFile
(
"classpath:data/technicianLocation.csv"
)
),
"utf-8"
);
Map
<
String
,
String
>
technicianCodeLocationMap
=
new
HashMap
<
String
,
String
>();
// 序号-code
Map
<
String
,
String
>
technicianCodeLocationMap
=
new
HashMap
<
String
,
String
>();
// 序号-code
for
(
int
i
=
0
;
i
<
technicianCodeLocation
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
technicianCodeLocation
.
size
();
i
++)
{
String
line
=
technicianCodeLocation
.
get
(
i
);
String
line
=
technicianCodeLocation
.
get
(
i
);
...
@@ -120,7 +121,7 @@ public class DispatchServiceImpl implements DispatchService {
...
@@ -120,7 +121,7 @@ public class DispatchServiceImpl implements DispatchService {
}
}
List
<
String
>
customerCodeLocation
=
IOUtils
List
<
String
>
customerCodeLocation
=
IOUtils
.
readLines
(
new
FileInputStream
(
"data/customerLocation.csv"
),
"utf-8"
);
.
readLines
(
new
FileInputStream
(
ResourceUtils
.
getFile
(
"classpath:data/customerLocation.csv"
)
),
"utf-8"
);
Map
<
String
,
String
>
customerCodeLocationMap
=
new
HashMap
<
String
,
String
>();
// 序号-code
Map
<
String
,
String
>
customerCodeLocationMap
=
new
HashMap
<
String
,
String
>();
// 序号-code
for
(
int
i
=
0
;
i
<
customerCodeLocation
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
customerCodeLocation
.
size
();
i
++)
{
String
line
=
customerCodeLocation
.
get
(
i
);
String
line
=
customerCodeLocation
.
get
(
i
);
...
@@ -169,7 +170,7 @@ public class DispatchServiceImpl implements DispatchService {
...
@@ -169,7 +170,7 @@ public class DispatchServiceImpl implements DispatchService {
}
}
private
static
Map
<
String
,
String
>
loadCustomerCodeSkillMap
()
throws
UncheckedIOException
,
FileNotFoundException
{
private
static
Map
<
String
,
String
>
loadCustomerCodeSkillMap
()
throws
UncheckedIOException
,
FileNotFoundException
{
List
<
String
>
customerSkill
=
IOUtils
.
readLines
(
new
FileInputStream
(
"data/customerSkill.csv"
),
"utf-8"
);
List
<
String
>
customerSkill
=
IOUtils
.
readLines
(
new
FileInputStream
(
ResourceUtils
.
getFile
(
"classpath:data/customerSkill.csv"
)
),
"utf-8"
);
Map
<
String
,
String
>
customerCodeSkillMap
=
new
HashMap
<
String
,
String
>();
// code-技能
Map
<
String
,
String
>
customerCodeSkillMap
=
new
HashMap
<
String
,
String
>();
// code-技能
for
(
int
i
=
0
;
i
<
customerSkill
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
customerSkill
.
size
();
i
++)
{
String
line
=
customerSkill
.
get
(
i
);
String
line
=
customerSkill
.
get
(
i
);
...
@@ -181,7 +182,7 @@ public class DispatchServiceImpl implements DispatchService {
...
@@ -181,7 +182,7 @@ public class DispatchServiceImpl implements DispatchService {
private
static
Map
<
String
,
Set
<
String
>>
loadTechnicianCodeSkillsMap
()
private
static
Map
<
String
,
Set
<
String
>>
loadTechnicianCodeSkillsMap
()
throws
UncheckedIOException
,
FileNotFoundException
{
throws
UncheckedIOException
,
FileNotFoundException
{
List
<
String
>
technicianSkills
=
IOUtils
.
readLines
(
new
FileInputStream
(
"data/technicianSkills.csv"
),
"utf-8"
);
List
<
String
>
technicianSkills
=
IOUtils
.
readLines
(
new
FileInputStream
(
ResourceUtils
.
getFile
(
"classpath:data/technicianSkills.csv"
)
),
"utf-8"
);
Map
<
String
,
Set
<
String
>>
technicianCodeSkillsMap
=
new
HashMap
<
String
,
Set
<
String
>>();
// code-技能
Map
<
String
,
Set
<
String
>>
technicianCodeSkillsMap
=
new
HashMap
<
String
,
Set
<
String
>>();
// code-技能
for
(
int
i
=
0
;
i
<
technicianSkills
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
technicianSkills
.
size
();
i
++)
{
String
line
=
technicianSkills
.
get
(
i
);
String
line
=
technicianSkills
.
get
(
i
);
...
@@ -199,7 +200,7 @@ public class DispatchServiceImpl implements DispatchService {
...
@@ -199,7 +200,7 @@ public class DispatchServiceImpl implements DispatchService {
}
}
private
static
Map
<
Integer
,
String
>
loadTechnicianIndex
()
throws
UncheckedIOException
,
FileNotFoundException
{
private
static
Map
<
Integer
,
String
>
loadTechnicianIndex
()
throws
UncheckedIOException
,
FileNotFoundException
{
List
<
String
>
technicianIndexlines
=
IOUtils
.
readLines
(
new
FileInputStream
(
"data/technicianIndex.csv"
),
"utf-8"
);
List
<
String
>
technicianIndexlines
=
IOUtils
.
readLines
(
new
FileInputStream
(
ResourceUtils
.
getFile
(
"classpath:data/technicianIndex.csv"
)
),
"utf-8"
);
Map
<
Integer
,
String
>
technicianIndexMap
=
new
HashMap
<
Integer
,
String
>();
// 序号-code
Map
<
Integer
,
String
>
technicianIndexMap
=
new
HashMap
<
Integer
,
String
>();
// 序号-code
for
(
int
i
=
0
;
i
<
technicianIndexlines
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
technicianIndexlines
.
size
();
i
++)
{
technicianIndexMap
.
put
(
i
+
1
,
technicianIndexlines
.
get
(
i
));
technicianIndexMap
.
put
(
i
+
1
,
technicianIndexlines
.
get
(
i
));
...
@@ -208,7 +209,7 @@ public class DispatchServiceImpl implements DispatchService {
...
@@ -208,7 +209,7 @@ public class DispatchServiceImpl implements DispatchService {
}
}
private
static
Map
<
Integer
,
String
>
loadCustomerIndex
()
throws
UncheckedIOException
,
FileNotFoundException
{
private
static
Map
<
Integer
,
String
>
loadCustomerIndex
()
throws
UncheckedIOException
,
FileNotFoundException
{
List
<
String
>
customerIndexlines
=
IOUtils
.
readLines
(
new
FileInputStream
(
"data/customerIndex.csv"
),
"utf-8"
);
List
<
String
>
customerIndexlines
=
IOUtils
.
readLines
(
new
FileInputStream
(
ResourceUtils
.
getFile
(
"classpath:data/customerIndex.csv"
)
),
"utf-8"
);
Map
<
Integer
,
String
>
customerIndexMap
=
new
HashMap
<
Integer
,
String
>();
// 序号-code
Map
<
Integer
,
String
>
customerIndexMap
=
new
HashMap
<
Integer
,
String
>();
// 序号-code
for
(
int
i
=
0
;
i
<
customerIndexlines
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
customerIndexlines
.
size
();
i
++)
{
customerIndexMap
.
put
(
i
+
1
,
customerIndexlines
.
get
(
i
));
customerIndexMap
.
put
(
i
+
1
,
customerIndexlines
.
get
(
i
));
...
@@ -225,7 +226,7 @@ public class DispatchServiceImpl implements DispatchService {
...
@@ -225,7 +226,7 @@ public class DispatchServiceImpl implements DispatchService {
Map
<
String
,
Integer
>
customerIndexMap2
=
customerIndexMap
.
entrySet
().
stream
()
Map
<
String
,
Integer
>
customerIndexMap2
=
customerIndexMap
.
entrySet
().
stream
()
.
collect
(
Collectors
.
toMap
(
Map
.
Entry
::
getValue
,
Map
.
Entry
::
getKey
));
.
collect
(
Collectors
.
toMap
(
Map
.
Entry
::
getValue
,
Map
.
Entry
::
getKey
));
// 初始化距离矩阵
// 初始化距离矩阵
List
<
String
>
pathMatrixlines
=
IOUtils
.
readLines
(
new
FileInputStream
(
"data/pathMatrix.csv"
),
"utf-8"
);
List
<
String
>
pathMatrixlines
=
IOUtils
.
readLines
(
new
FileInputStream
(
ResourceUtils
.
getFile
(
"classpath:data/pathMatrix.csv"
)
),
"utf-8"
);
long
[][]
pathMatrix
=
new
long
[
customerIndexMap
.
keySet
().
size
()
+
1
][
customerIndexMap
.
keySet
().
size
()
+
1
];
long
[][]
pathMatrix
=
new
long
[
customerIndexMap
.
keySet
().
size
()
+
1
][
customerIndexMap
.
keySet
().
size
()
+
1
];
for
(
int
i
=
0
;
i
<
pathMatrixlines
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
pathMatrixlines
.
size
();
i
++)
{
String
line
=
pathMatrixlines
.
get
(
i
);
String
line
=
pathMatrixlines
.
get
(
i
);
...
@@ -250,7 +251,7 @@ public class DispatchServiceImpl implements DispatchService {
...
@@ -250,7 +251,7 @@ public class DispatchServiceImpl implements DispatchService {
// 初始化时间矩阵
// 初始化时间矩阵
// 初始化订单服务窗
// 初始化订单服务窗
List
<
String
>
customerWindowslines
=
IOUtils
.
readLines
(
new
FileInputStream
(
"data/customerWindows.csv"
),
"utf-8"
);
List
<
String
>
customerWindowslines
=
IOUtils
.
readLines
(
new
FileInputStream
(
ResourceUtils
.
getFile
(
"classpath:data/customerWindows.csv"
)
),
"utf-8"
);
Map
<
Integer
,
Integer
>
customerStartMap
=
new
HashMap
<
Integer
,
Integer
>();
Map
<
Integer
,
Integer
>
customerStartMap
=
new
HashMap
<
Integer
,
Integer
>();
Map
<
Integer
,
Integer
>
customerEndMap
=
new
HashMap
<
Integer
,
Integer
>();
Map
<
Integer
,
Integer
>
customerEndMap
=
new
HashMap
<
Integer
,
Integer
>();
for
(
int
i
=
0
;
i
<
customerWindowslines
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
customerWindowslines
.
size
();
i
++)
{
...
...
project-dispatch/src/main/resources/application-dev.yaml
0 → 100644
View file @
e2b36da
server
:
port
:
8011
spring
:
application
:
name
:
project-dispatch
cloud
:
nacos
:
discovery
:
server-addr
:
127.0.0.1:8848
group
:
project
config
:
server-addr
:
127.0.0.1:8848
group
:
project
file-extension
:
yaml
import-check
:
# no config file
enabled
:
false
datasource
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
url
:
jdbc:mysql://127.0.0.1:3306/saas_aftersale_test?serverTimezone=UTC
username
:
root
password
:
12345678
type
:
com.alibaba.druid.pool.DruidDataSource
seata
:
application-id
:
${spring.application.name}
tx-service-group
:
${spring.application.name}-group
service
:
vgroup-mapping
:
project-dispatch-group
:
default
grouplist
:
default
:
127.0.0.1:8091
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