Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
test
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
邬友楠
test
Commits
f35f1a14
Commit
f35f1a14
authored
Apr 29, 2021
by
邬友楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
流程仿真
parent
cc5ac70a
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
896 additions
and
35 deletions
+896
-35
pom.xml
huigou-desmoj/pom.xml
+37
-0
Applicant.java
huigou-desmoj/src/main/java/com/huigou/desmoj/Applicant.java
+22
-0
ApplicantGenerator.java
...j/src/main/java/com/huigou/desmoj/ApplicantGenerator.java
+35
-0
BusinessProcess.java
...smoj/src/main/java/com/huigou/desmoj/BusinessProcess.java
+20
-0
ProcessModel.java
...-desmoj/src/main/java/com/huigou/desmoj/ProcessModel.java
+86
-0
Processors.java
...ou-desmoj/src/main/java/com/huigou/desmoj/Processors.java
+22
-0
ProcessModelController.java
.../com/huigou/desmoj/controller/ProcessModelController.java
+33
-0
ClinicModel.java
...moj/src/main/java/com/huigou/desmoj/demo/ClinicModel.java
+164
-0
Nurse.java
...ou-desmoj/src/main/java/com/huigou/desmoj/demo/Nurse.java
+37
-0
Patient.java
...-desmoj/src/main/java/com/huigou/desmoj/demo/Patient.java
+72
-0
PatientGenerator.java
...rc/main/java/com/huigou/desmoj/demo/PatientGenerator.java
+32
-0
Specialist.java
...smoj/src/main/java/com/huigou/desmoj/demo/Specialist.java
+36
-0
pom.xml
huigou-uasp/pom.xml
+2
-2
pom.xml
huigou-xt/pom.xml
+19
-13
application.properties
huigou-xt/src/main/resources/application.properties
+12
-9
applicationContext.xml
huigou-xt/src/main/resources/applicationContext.xml
+8
-8
demol.js
huigou-xt/src/main/webapp/desmoj/demo/demol.js
+227
-0
demol.jsp
huigou-xt/src/main/webapp/desmoj/demo/demol.jsp
+28
-0
pom.xml
pom.xml
+4
-3
No files found.
huigou-desmoj/pom.xml
0 → 100644
View file @
f35f1a14
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
root
</artifactId>
<groupId>
com.huigou
</groupId>
<version>
1.2.12-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
huigou-desmoj
</artifactId>
<version>
1.2.12-SNAPSHOT
</version>
<dependencies>
<dependency>
<groupId>
desmoj
</groupId>
<artifactId>
desmoj
</artifactId>
<version>
2.5.1c-bin
</version>
</dependency>
<!-- 内部项目依赖 -->
<dependency>
<groupId>
com.huigou
</groupId>
<artifactId>
huigou-common
</artifactId>
</dependency>
<dependency>
<groupId>
com.huigou
</groupId>
<artifactId>
huigou-uasp
</artifactId>
</dependency>
<dependency>
<groupId>
com.huigou
</groupId>
<artifactId>
huigou-core-api
</artifactId>
</dependency>
</dependencies>
</project>
huigou-desmoj/src/main/java/com/huigou/desmoj/Applicant.java
0 → 100644
View file @
f35f1a14
package
com
.
huigou
.
desmoj
;
import
co.paralleluniverse.fibers.SuspendExecution
;
import
desmoj.core.simulator.Model
;
import
desmoj.core.simulator.SimProcess
;
/**
* @Author: wuyounan
* @Date: 2021/4/25 0025 上午 11:48
*/
public
class
Applicant
extends
SimProcess
{
public
Applicant
(
Model
owner
,
String
name
,
boolean
showInTrace
){
super
(
owner
,
name
,
showInTrace
);
}
@Override
public
void
lifeCycle
()
throws
SuspendExecution
{
ProcessModel
processModel
=
(
ProcessModel
)
this
.
getModel
();
}
}
huigou-desmoj/src/main/java/com/huigou/desmoj/ApplicantGenerator.java
0 → 100644
View file @
f35f1a14
package
com
.
huigou
.
desmoj
;
import
co.paralleluniverse.fibers.SuspendExecution
;
import
desmoj.core.simulator.Model
;
import
desmoj.core.simulator.SimProcess
;
import
desmoj.core.simulator.TimeSpan
;
import
java.util.concurrent.TimeUnit
;
/**
* @Author: wuyounan
* @Date: 2021/4/25 0025 下午 4:21
*/
public
class
ApplicantGenerator
extends
SimProcess
{
public
ApplicantGenerator
(
Model
owner
,
String
name
,
boolean
showInTrace
){
super
(
owner
,
name
,
showInTrace
);
}
@Override
public
void
lifeCycle
()
throws
SuspendExecution
{
ProcessModel
model
=
(
ProcessModel
)
this
.
getModel
();
int
cont
=
0
;
while
(
true
){
int
interarrivalTime
=
(
int
)
model
.
getInterArrivalTime
(
model
.
presentTime
().
getTimeAsDouble
());
System
.
out
.
println
(
"生成器"
+
cont
+
"到达时间:"
+
interarrivalTime
);
//wait for interarrival
this
.
hold
(
new
TimeSpan
(
interarrivalTime
,
TimeUnit
.
MINUTES
));
//create new patient and activate him/her
Applicant
applicant
=
new
Applicant
(
model
,
"申请人"
,
true
);
applicant
.
activate
();
cont
++;
}
}
}
huigou-desmoj/src/main/java/com/huigou/desmoj/BusinessProcess.java
0 → 100644
View file @
f35f1a14
package
com
.
huigou
.
desmoj
;
/**
* @Author: wuyounan
* @Date: 2021/4/26 0026 上午 8:20
*/
public
class
BusinessProcess
{
/**
* 处理时间 Minutes 分钟
*/
private
double
processTime
;
/**
* 流程节点名称
*/
private
String
name
;
/**
* 当前节点处理人数
*/
private
Integer
numberOfProcess
;
}
huigou-desmoj/src/main/java/com/huigou/desmoj/ProcessModel.java
0 → 100644
View file @
f35f1a14
package
com
.
huigou
.
desmoj
;
import
desmoj.core.dist.ContDistExponential
;
import
desmoj.core.simulator.Model
;
import
desmoj.core.simulator.ProcessQueue
;
import
java.util.Map
;
/**
* @Author: wuyounan
* @Date: 2021/4/25 0025 上午 11:29
*/
public
class
ProcessModel
extends
Model
{
private
Map
<
String
,
ProcessQueue
<
Applicant
>>
applicantProcessQueues
;
private
Map
<
String
,
ProcessQueue
<
Processors
>>
processorsProcessQueues
;
private
Map
<
String
,
ContDistExponential
>
processorsCommitDate
;
// private List<>
/**
* 业务发起时间段 上午8点-10点
*/
private
ContDistExponential
patientArrival8To10
;
/**
* 业务发起时间段 上午10点-下午1点
*/
private
ContDistExponential
patientArrival10To1
;
/**
* 业务发起时间段 下午1点-4点
*/
private
ContDistExponential
patientArrival1To4
;
/**
* 业务发起时间段 下午4点-8点
*/
private
ContDistExponential
patientArrival4To8
;
/**
* 所需要的处理时间
*/
private
ContDistExponential
processingTime
;
public
ProcessModel
(
Model
owner
,
String
modelName
,
boolean
showInReport
,
boolean
showInTrace
)
{
super
(
owner
,
modelName
,
showInReport
,
showInTrace
);
}
@Override
public
String
description
()
{
return
"以流程为向导的仿真测试"
;
}
@Override
public
void
doInitialSchedules
()
{
processorsProcessQueues
.
forEach
((
key
,
value
)
->
{
Processors
processors
=
new
Processors
(
this
,
key
,
true
);
processors
.
activate
();
});
}
@Override
public
void
init
()
{
processorsCommitDate
.
forEach
((
key
,
value
)
->{
});
/** (Model owner, String name, double mean, boolean showInReport, boolean showInTrace))
* owner 当前流程 name 描述(名称) mean 随机平均值 showInReport是否在报表显示,showInTrace 是否在追踪时显示
*/
patientArrival8To10
=
new
ContDistExponential
(
this
,
"早上发起"
,
15
,
true
,
false
);
patientArrival10To1
=
new
ContDistExponential
(
this
,
"中午发起"
,
6
,
true
,
false
);
patientArrival1To4
=
new
ContDistExponential
(
this
,
"下午发起"
,
6
,
true
,
false
);
patientArrival4To8
=
new
ContDistExponential
(
this
,
"晚上发起"
,
9
,
true
,
false
);
processorsCommitDate
.
put
(
"patientArrival8To10"
,
patientArrival8To10
);
processorsCommitDate
.
put
(
"patientArrival10To1"
,
patientArrival10To1
);
processorsCommitDate
.
put
(
"patientArrival1To4"
,
patientArrival1To4
);
processorsCommitDate
.
put
(
"patientArrival4To8"
,
patientArrival4To8
);
}
public
double
getInterArrivalTime
(
double
time
)
{
if
(
time
<=
120
)
{
return
patientArrival8To10
.
sample
();
}
else
if
(
time
<=
300
)
{
return
patientArrival10To1
.
sample
();
}
else
if
(
time
<=
480
)
{
return
patientArrival1To4
.
sample
();
}
else
{
return
patientArrival4To8
.
sample
();
}
}
}
huigou-desmoj/src/main/java/com/huigou/desmoj/Processors.java
0 → 100644
View file @
f35f1a14
package
com
.
huigou
.
desmoj
;
import
co.paralleluniverse.fibers.SuspendExecution
;
import
desmoj.core.simulator.Model
;
import
desmoj.core.simulator.SimProcess
;
/**
* @Author: wuyounan
* @Date: 2021/4/25 0025 上午 11:41
*/
public
class
Processors
extends
SimProcess
{
public
Processors
(
Model
owner
,
String
name
,
boolean
showInTrace
){
super
(
owner
,
name
,
showInTrace
);
}
@Override
public
void
lifeCycle
()
throws
SuspendExecution
{
ProcessModel
processModel
=
(
ProcessModel
)
this
.
getModel
();
}
}
huigou-desmoj/src/main/java/com/huigou/desmoj/controller/ProcessModelController.java
0 → 100644
View file @
f35f1a14
package
com
.
huigou
.
desmoj
.
controller
;
import
com.huigou.uasp.annotation.ControllerMapping
;
import
com.huigou.uasp.client.CommonController
;
import
com.huigou.uasp.exception.PageForwardException
;
import
org.springframework.stereotype.Controller
;
/**
* @Author: wuyounan
* @Date: 2021/4/26 0026 上午 9:22
*/
@Controller
@ControllerMapping
(
"processModel"
)
public
class
ProcessModelController
extends
CommonController
{
@Override
protected
String
getPagePath
()
{
return
"/desmoj/"
;
}
public
String
forwardPage
()
{
return
forward
(
"processModel"
);
}
public
String
forwardDemoPage
()
{
return
forward
(
"demo/demol"
);
}
public
String
fowardDemoRun
()
{
// return this.getRequest().getRequestDispatcher("").forward(this.getRequest(), this.getResponse());
return
""
;
}
}
huigou-desmoj/src/main/java/com/huigou/desmoj/demo/ClinicModel.java
0 → 100644
View file @
f35f1a14
package
com
.
huigou
.
desmoj
.
demo
;
import
desmoj.core.dist.BoolDistBernoulli
;
import
desmoj.core.dist.ContDistExponential
;
import
desmoj.core.simulator.Experiment
;
import
desmoj.core.simulator.Model
;
import
desmoj.core.simulator.ProcessQueue
;
import
desmoj.core.simulator.TimeInstant
;
import
desmoj.core.statistic.Count
;
import
java.util.concurrent.TimeUnit
;
public
class
ClinicModel
extends
Model
{
protected
ProcessQueue
<
Patient
>
patientWaitingForNurseQueue
;
protected
ProcessQueue
<
Patient
>
patientWaitingForSpecialistQueue
;
protected
ProcessQueue
<
Nurse
>
nurseIdleQueue
;
protected
ProcessQueue
<
Specialist
>
specialistIdleQueue
;
protected
final
int
numberOfRoomsForSpecialist
=
4
;
protected
final
int
numberOfNurses
=
1
;
protected
Count
costIncuredByClinic
;
private
ContDistExponential
patientArrival8To10
;
private
ContDistExponential
patientArrival10To1
;
private
ContDistExponential
patientArrival1To4
;
private
ContDistExponential
patientArrival4To8
;
private
ContDistExponential
nurseServiceTime
;
private
ContDistExponential
specialistServiceTime
;
public
ClinicModel
(
Model
owner
,
String
modelName
,
boolean
showInReport
,
boolean
showInTrace
)
{
super
(
owner
,
modelName
,
showInReport
,
showInTrace
);
}
public
String
description
()
{
return
"Process orientated description of the hospital clinic model. For details see project description in our paper"
;
}
public
void
doInitialSchedules
()
{
Nurse
nurse
=
new
Nurse
(
this
,
"Nurse"
,
true
);
//Nurse nurse2 = new Nurse(this,"Nurse2",true);
Specialist
specialist
=
new
Specialist
(
this
,
"Specialist"
,
true
);
nurse
.
activate
();
//nurse2.activate();
specialist
.
activate
();
PatientGenerator
generator
=
new
PatientGenerator
(
this
,
"Patient Generator"
,
false
);
generator
.
activate
();
}
public
void
init
()
{
patientArrival8To10
=
new
ContDistExponential
(
this
,
"Early Interarrival"
,
15
,
true
,
false
);
patientArrival10To1
=
new
ContDistExponential
(
this
,
"Afternoon Interarrival"
,
6
,
true
,
false
);
patientArrival1To4
=
new
ContDistExponential
(
this
,
"Late Afternoon"
,
6
,
true
,
false
);
patientArrival4To8
=
new
ContDistExponential
(
this
,
"Late"
,
9
,
true
,
false
);
nurseServiceTime
=
new
ContDistExponential
(
this
,
"Service time for Nurses"
,
8
,
true
,
false
);
specialistServiceTime
=
new
ContDistExponential
(
this
,
"Service time for Specialists"
,
25
,
true
,
false
);
patientWaitingForNurseQueue
=
new
ProcessQueue
<
Patient
>(
this
,
"Patients Waiting for Nurse"
,
true
,
true
);
patientWaitingForSpecialistQueue
=
new
ProcessQueue
<
Patient
>(
this
,
"Patients Waiting for Specialist"
,
true
,
true
);
nurseIdleQueue
=
new
ProcessQueue
<
Nurse
>(
this
,
"Nurse Waiting for Patients"
,
true
,
true
);
specialistIdleQueue
=
new
ProcessQueue
<
Specialist
>(
this
,
"Specialist Waiting for Patients"
,
true
,
true
);
costIncuredByClinic
=
new
Count
(
this
,
"Cost incured by the Clinic"
,
true
,
true
);
}
public
double
getInterArrivalTime
(
double
time
)
{
if
(
time
<=
120
)
{
return
patientArrival8To10
.
sample
();
}
else
if
(
time
<=
300
)
{
return
patientArrival10To1
.
sample
();
}
else
if
(
time
<=
480
)
{
return
patientArrival1To4
.
sample
();
}
else
{
return
patientArrival4To8
.
sample
();
}
}
public
double
getNurseServiceTime
()
{
return
nurseServiceTime
.
sample
();
}
public
double
getSpecialistServiceTime
()
{
return
specialistServiceTime
.
sample
();
}
/**
* If a patient arrives when there are already k patients in the waiting
* room (not including himself/herself), the arriving patient immediately
* leaves (i.e., balks) and instead seeks treatment at a nearby emergency
* care center with probability k=8 (fork= 1;2;3;:::;8)
**/
public
boolean
doesPatientBalk
(
int
numberOfPatientsInQueue
)
{
if
(
numberOfPatientsInQueue
>=
8
)
{
return
true
;
}
else
if
(
numberOfPatientsInQueue
==
0
)
{
return
false
;
}
else
{
BoolDistBernoulli
doesBalk
=
new
BoolDistBernoulli
(
this
,
"True = patient leaves, false = stays"
,
(
double
)
numberOfPatientsInQueue
/
8
,
true
,
false
);
return
doesBalk
.
sample
();
}
}
public
boolean
needsSpecialist
(){
BoolDistBernoulli
needsSpecialist
=
new
BoolDistBernoulli
(
this
,
"True = patient needs specialist, false = leaves"
,
.
4
,
true
,
false
);
return
needsSpecialist
.
sample
();
}
public
static
void
main
(
String
[]
args
)
{
// Added to get proper display
Experiment
.
setEpsilon
(
TimeUnit
.
MINUTES
);
// Can use minutes here
Experiment
.
setReferenceUnit
(
TimeUnit
.
MINUTES
);
// create model and experiment
ClinicModel
model
=
new
ClinicModel
(
null
,
"Clinic Model"
,
true
,
true
);
Experiment
exp
=
new
Experiment
(
"ClinicProcessSimulation"
);
// connect both
model
.
connectToExperiment
(
exp
);
// set experiment parameters
exp
.
setShowProgressBar
(
false
);
// display a progress bar (or not)
// set end of simulation at 720 minutes, runs for 12 hours
exp
.
stop
(
new
TimeInstant
(
720
,
TimeUnit
.
MINUTES
));
// set the period of the trace and debug
exp
.
tracePeriod
(
new
TimeInstant
(
0
,
TimeUnit
.
MINUTES
),
new
TimeInstant
(
720
,
TimeUnit
.
MINUTES
));
exp
.
debugPeriod
(
new
TimeInstant
(
0
,
TimeUnit
.
MINUTES
),
new
TimeInstant
(
720
,
TimeUnit
.
MINUTES
));
// start the experiment at simulation time 0.0
exp
.
start
();
// --> now the simulation is running until it reaches its end criterion
// ...
// ...
// <-- afterwards, the main thread returns here
if
(!(
model
.
nurseIdleQueue
.
length
()
==
model
.
numberOfNurses
)){
//if all nurses are not idle at the end of simulation you may have to send a patient to ER
boolean
lastPatientNeedSpecialist
=
model
.
needsSpecialist
();
if
(
lastPatientNeedSpecialist
){
model
.
costIncuredByClinic
.
update
(
500
);
}
}
while
(!
model
.
patientWaitingForNurseQueue
.
isEmpty
()){
System
.
out
.
println
(
"another one for nurse"
);
model
.
patientWaitingForNurseQueue
.
removeFirst
();
//remaining patients leave for ER
model
.
costIncuredByClinic
.
update
(
500
);
}
while
(!
model
.
patientWaitingForSpecialistQueue
.
isEmpty
()){
//treat the ones waiting for specialist
model
.
patientWaitingForSpecialistQueue
.
removeFirst
();
model
.
costIncuredByClinic
.
update
(
200
);
System
.
out
.
println
(
"another one for specialist"
);
}
// generate the report (and other output files)
exp
.
report
();
// stop all threads still alive and close all output files
exp
.
finish
();
}
}
huigou-desmoj/src/main/java/com/huigou/desmoj/demo/Nurse.java
0 → 100644
View file @
f35f1a14
package
com
.
huigou
.
desmoj
.
demo
;
import
co.paralleluniverse.fibers.SuspendExecution
;
import
desmoj.core.simulator.Model
;
import
desmoj.core.simulator.SimProcess
;
import
desmoj.core.simulator.TimeSpan
;
import
java.util.concurrent.TimeUnit
;
public
class
Nurse
extends
SimProcess
{
public
Nurse
(
Model
owner
,
String
name
,
boolean
showInTrace
)
{
super
(
owner
,
name
,
showInTrace
);
}
public
void
lifeCycle
()
throws
SuspendExecution
{
ClinicModel
model
=
(
ClinicModel
)
this
.
getModel
();
while
(
true
){
//check if something is waiting
if
(
model
.
patientWaitingForNurseQueue
.
isEmpty
()){
//nobody is waiting for nurse
model
.
nurseIdleQueue
.
insert
(
this
);
passivate
();
}
else
{
//patient waiting
Patient
patient
=
model
.
patientWaitingForNurseQueue
.
first
();
model
.
patientWaitingForNurseQueue
.
remove
(
patient
);
hold
(
new
TimeSpan
(
model
.
getNurseServiceTime
(),
TimeUnit
.
MINUTES
));
model
.
costIncuredByClinic
.
update
(
100
);
//let patient continue its life cycle
patient
.
activate
();
}
}
}
}
huigou-desmoj/src/main/java/com/huigou/desmoj/demo/Patient.java
0 → 100644
View file @
f35f1a14
package
com
.
huigou
.
desmoj
.
demo
;
import
co.paralleluniverse.fibers.SuspendExecution
;
import
desmoj.core.simulator.Model
;
import
desmoj.core.simulator.SimProcess
;
public
class
Patient
extends
SimProcess
{
protected
double
arrivalTime
;
/**
* The patients lifecycle.
*/
public
Patient
(
Model
owner
,
String
name
,
boolean
showInTrace
)
{
super
(
owner
,
name
,
showInTrace
);
}
public
void
lifeCycle
()
throws
SuspendExecution
{
ClinicModel
model
=
(
ClinicModel
)
this
.
getModel
();
this
.
arrivalTime
=
model
.
presentTime
().
getTimeAsDouble
();
model
.
sendTraceNote
(
"Patient is arriving in System at time "
+
this
.
arrivalTime
);
// k/8 chance of leaving for k patients in the queue already.
boolean
doesBalk
=
model
.
doesPatientBalk
(
model
.
patientWaitingForNurseQueue
.
length
());
if
(
doesBalk
==
true
)
{
//patient leaves the system and costs clinic big money.
model
.
costIncuredByClinic
.
update
(
500
);
model
.
sendTraceNote
(
"Patient is balking there was a "
+
model
.
patientWaitingForNurseQueue
.
length
()+
"/8 chance of balking"
);
}
else
{
//they stay and enter the system.
model
.
sendTraceNote
(
"Patient is entering service"
);
model
.
patientWaitingForNurseQueue
.
insert
(
this
);
if
(!
model
.
nurseIdleQueue
.
isEmpty
()){
//get nurse for service, and remove nurse from idle queue
Nurse
nurse
=
model
.
nurseIdleQueue
.
first
();
model
.
nurseIdleQueue
.
remove
(
nurse
);
nurse
.
activate
();
}
this
.
passivate
();
//after service by nurse
boolean
needsSpecialist
=
model
.
needsSpecialist
();
if
(
needsSpecialist
==
true
){
//patient leaves if he/she has spent 30 minutes in the system before getting sent to specialist
double
timeInSystem
=
model
.
presentTime
().
getTimeAsDouble
()
-
this
.
arrivalTime
;
//patient also leaves if no service rooms are available
if
(
timeInSystem
<
30
&&
model
.
patientWaitingForSpecialistQueue
.
length
()
<
model
.
numberOfRoomsForSpecialist
){
//send patient to specialist
model
.
patientWaitingForSpecialistQueue
.
insert
(
this
);
if
(!
model
.
specialistIdleQueue
.
isEmpty
()){
//get specialist for service, and remove specialist from idle queue.
Specialist
specialist
=
model
.
specialistIdleQueue
.
first
();
model
.
specialistIdleQueue
.
remove
(
specialist
);
specialist
.
activate
();
}
}
else
{
//the patient needed a specialist but spent too much time in system already or not enough rooms.
//cost clinic money
model
.
sendTraceNote
(
"Patient needed a specialist but was in system for longer then 30min"
);
model
.
costIncuredByClinic
.
update
(
500
);
}
}
//we are done.
}
this
.
passivate
();
double
timeInSystem
=
model
.
presentTime
().
getTimeAsDouble
()-
this
.
arrivalTime
;
model
.
sendTraceNote
(
"Patient leaves the system (after completion or any other reason) time spent in system was "
+
timeInSystem
);
}
}
huigou-desmoj/src/main/java/com/huigou/desmoj/demo/PatientGenerator.java
0 → 100644
View file @
f35f1a14
package
com
.
huigou
.
desmoj
.
demo
;
import
co.paralleluniverse.fibers.SuspendExecution
;
import
desmoj.core.simulator.Model
;
import
desmoj.core.simulator.SimProcess
;
import
desmoj.core.simulator.TimeSpan
;
import
java.util.concurrent.TimeUnit
;
public
class
PatientGenerator
extends
SimProcess
{
public
PatientGenerator
(
Model
owner
,
String
name
,
boolean
showInTrace
)
{
super
(
owner
,
name
,
showInTrace
);
}
//Generates patients for the duration of the simulation. 8am to 8pm (0 minutes to 720 minutes).
public
void
lifeCycle
()
throws
SuspendExecution
{
ClinicModel
model
=
(
ClinicModel
)
this
.
getModel
();
int
cont
=
0
;
while
(
true
){
int
interarrivalTime
=
(
int
)
model
.
getInterArrivalTime
(
model
.
presentTime
().
getTimeAsDouble
());
System
.
out
.
println
(
"生成器"
+
cont
+
"到达时间:"
+
interarrivalTime
);
//wait for interarrival
this
.
hold
(
new
TimeSpan
(
interarrivalTime
,
TimeUnit
.
MINUTES
));
//create new patient and activate him/her
Patient
patient
=
new
Patient
(
model
,
"Customer"
,
true
);
patient
.
activate
();
cont
++;
}
}
}
huigou-desmoj/src/main/java/com/huigou/desmoj/demo/Specialist.java
0 → 100644
View file @
f35f1a14
package
com
.
huigou
.
desmoj
.
demo
;
import
co.paralleluniverse.fibers.SuspendExecution
;
import
desmoj.core.simulator.Model
;
import
desmoj.core.simulator.SimProcess
;
import
desmoj.core.simulator.TimeSpan
;
import
java.util.concurrent.TimeUnit
;
public
class
Specialist
extends
SimProcess
{
public
Specialist
(
Model
owner
,
String
name
,
boolean
showInTrace
)
{
super
(
owner
,
name
,
showInTrace
);
}
public
void
lifeCycle
()
throws
SuspendExecution
{
ClinicModel
model
=
(
ClinicModel
)
this
.
getModel
();
while
(
true
)
{
// check if something is waiting
if
(
model
.
patientWaitingForSpecialistQueue
.
isEmpty
())
{
// nobody is waiting for specialist
model
.
specialistIdleQueue
.
insert
(
this
);
passivate
();
}
else
{
// patient waiting
Patient
patient
=
model
.
patientWaitingForSpecialistQueue
.
first
();
model
.
patientWaitingForSpecialistQueue
.
remove
(
patient
);
hold
(
new
TimeSpan
(
model
.
getSpecialistServiceTime
(),
TimeUnit
.
MINUTES
));
model
.
costIncuredByClinic
.
update
(
200
);
// let patient continue its life cycle
patient
.
activate
();
}
}
}
}
huigou-uasp/pom.xml
View file @
f35f1a14
...
@@ -194,10 +194,10 @@
...
@@ -194,10 +194,10 @@
<groupId>
org.apache.xmlbeans
</groupId>
<groupId>
org.apache.xmlbeans
</groupId>
<artifactId>
xmlbeans
</artifactId>
<artifactId>
xmlbeans
</artifactId>
</dependency>
</dependency>
<dependency>
<
!--<
dependency>
<groupId>xerces</groupId>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<artifactId>xercesImpl</artifactId>
</dependency>
</dependency>
-->
<!-- Microsoft Office格式档案读和写 -->
<!-- Microsoft Office格式档案读和写 -->
<dependency>
<dependency>
<groupId>
org.apache.poi
</groupId>
<groupId>
org.apache.poi
</groupId>
...
...
huigou-xt/pom.xml
View file @
f35f1a14
...
@@ -117,19 +117,14 @@
...
@@ -117,19 +117,14 @@
<artifactId>
huigou-index
</artifactId>
<artifactId>
huigou-index
</artifactId>
<version>
${project.version}
</version>
<version>
${project.version}
</version>
</dependency>
</dependency>
<!-- <dependency>
<groupId>com.huigou</groupId>
<artifactId>huigou-bpm</artifactId>
<version>${project.version}</version>
</dependency>-->
<dependency>
<dependency>
<groupId>
com.huigou
</groupId>
<groupId>
com.huigou
</groupId>
<artifactId>
huigou-
rule
</artifactId>
<artifactId>
huigou-
bpm
</artifactId>
<version>
${project.version}
</version>
<version>
${project.version}
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.huigou
</groupId>
<groupId>
com.huigou
</groupId>
<artifactId>
huigou-
webservic
e
</artifactId>
<artifactId>
huigou-
rul
e
</artifactId>
<version>
${project.version}
</version>
<version>
${project.version}
</version>
</dependency>
</dependency>
<!-- 公用的组件包 -->
<!-- 公用的组件包 -->
...
@@ -320,10 +315,10 @@
...
@@ -320,10 +315,10 @@
<groupId>
org.apache.xmlbeans
</groupId>
<groupId>
org.apache.xmlbeans
</groupId>
<artifactId>
xmlbeans
</artifactId>
<artifactId>
xmlbeans
</artifactId>
</dependency>
</dependency>
<dependency>
<
!--<
dependency>
<groupId>xerces</groupId>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<artifactId>xercesImpl</artifactId>
</dependency>
</dependency>
-->
<!-- Microsoft Office格式档案读和写 -->
<!-- Microsoft Office格式档案读和写 -->
<dependency>
<dependency>
<groupId>
org.apache.poi
</groupId>
<groupId>
org.apache.poi
</groupId>
...
@@ -502,16 +497,16 @@
...
@@ -502,16 +497,16 @@
<artifactId>
huigou-demo
</artifactId>
<artifactId>
huigou-demo
</artifactId>
<version>
${project.version}
</version>
<version>
${project.version}
</version>
</dependency>
</dependency>
<dependency>
<
!--<
dependency>
<groupId>com.huigou</groupId>
<groupId>com.huigou</groupId>
<artifactId>huigou-bpm</artifactId>
<artifactId>huigou-bpm</artifactId>
<version>${project.version}</version>
<version>${project.version}</version>
</dependency>
</dependency>
-->
<dependency>
<
!--<
dependency>
<groupId>com.huigou</groupId>
<groupId>com.huigou</groupId>
<artifactId>huigou-webservice</artifactId>
<artifactId>huigou-webservice</artifactId>
<version>${project.version}</version>
<version>${project.version}</version>
</dependency>
</dependency>
-->
<dependency>
<dependency>
<groupId>
com.huigou
</groupId>
<groupId>
com.huigou
</groupId>
<artifactId>
huigou-rule
</artifactId>
<artifactId>
huigou-rule
</artifactId>
...
@@ -521,6 +516,17 @@
...
@@ -521,6 +516,17 @@
<groupId>
org.quartz-scheduler
</groupId>
<groupId>
org.quartz-scheduler
</groupId>
<artifactId>
quartz
</artifactId>
<artifactId>
quartz
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
com.huigou
</groupId>
<artifactId>
huigou-desmoj
</artifactId>
<version>
${project.version}
</version>
<exclusions>
<exclusion>
<groupId>
*
</groupId>
<artifactId>
*
</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
<finalName>
huigou-xt
</finalName>
<finalName>
huigou-xt
</finalName>
...
...
huigou-xt/src/main/resources/application.properties
View file @
f35f1a14
pub.db.url
=
jdbc:oracle:thin:@127.0.0.1:1521:orcl
#pub.db.url=jdbc:oracle:thin:@127.0.0.1:1521:orcl
pub.db.user
=
contract
pub.db.url
=
jdbc:oracle:thin:@localhost:1521/ORCL
pub.db.password
=
contract
pub.db.user
=
oa_test
pub.db.password
=
oa_test
log.db.url
=
jdbc:oracle:thin:@127.0.0.1:1521:orcl
#log.db.url=jdbc:oracle:thin:@127.0.0.1:1521:orcl
log.db.user
=
contract
log.db.url
=
jdbc:oracle:thin:@localhost:1521/ORCL
log.db.password
=
contract
log.db.user
=
oa_test
log.db.password
=
oa_test
shiro.host
=
192.168.3.52
#shiro.host=192.168.3.52
shiro.host
=
127.0.0.1
shiro.port
=
6379
shiro.port
=
6379
shiro.expire
=
18000
shiro.expire
=
18000
shiro.passwod
=
topsunit.com
#
shiro.passwod=topsunit.com
system.dataSource
=
dataSource
system.dataSource
=
dataSource
system.hibernate.dialect
=
org.hibernate.dialect.Oracle10gDialect
system.hibernate.dialect
=
org.hibernate.dialect.Oracle10gDialect
...
@@ -58,4 +61,4 @@ cboard.dashboard.getAggregateData.url=
...
@@ -58,4 +61,4 @@ cboard.dashboard.getAggregateData.url=
cboard.corpId
=
cboard.corpId
=
cboard.corpSecret
=
cboard.corpSecret
=
cube.server.url
=
cube.server.url
=
\ No newline at end of file
huigou-xt/src/main/resources/applicationContext.xml
View file @
f35f1a14
...
@@ -4,17 +4,17 @@
...
@@ -4,17 +4,17 @@
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:util=
"http://www.springframework.org/schema/util"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:util=
"http://www.springframework.org/schema/util"
xmlns:task=
"http://www.springframework.org/schema/task"
xmlns:task=
"http://www.springframework.org/schema/task"
xsi:schemaLocation=
"
xsi:schemaLocation=
"
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.1.xsd
http://www.springframework.org/schema/util/spring-util-3.1.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task.xsd"
>
http://www.springframework.org/schema/task/spring-task.xsd"
>
<context:property-placeholder
location=
"classpath:application.properties"
/>
<context:property-placeholder
location=
"classpath:application.properties"
/>
<!-- 如果proxy-target-class 属性值被设置为true,那么基于类的代理将起作用(这时需要cglib库) -->
<!-- 如果proxy-target-class 属性值被设置为true,那么基于类的代理将起作用(这时需要cglib库) -->
<aop:config
proxy-target-class=
"true"
></aop:config>
<aop:config
proxy-target-class=
"true"
></aop:config>
...
@@ -22,11 +22,11 @@
...
@@ -22,11 +22,11 @@
<!-- 设定Spring 在哪些包中查找annotation -->
<!-- 设定Spring 在哪些包中查找annotation -->
<import
resource=
"classpath:config/spring/spring-component-scan.xml"
/>
<import
resource=
"classpath:config/spring/spring-component-scan.xml"
/>
<task:annotation-driven
executor=
"annotationExecutor"
/>
<task:annotation-driven
executor=
"annotationExecutor"
/>
<!-- 支持 @Async 注解 -->
<!-- 支持 @Async 注解 -->
<task:executor
id=
"annotationExecutor"
pool-size=
"2000"
/>
<task:executor
id=
"annotationExecutor"
pool-size=
"2000"
/>
<import
resource=
"classpath:config/spring/spring-cxf.xml"
/>
<import
resource=
"classpath:config/spring/spring-cxf.xml"
/>
<import
resource=
"classpath:activiti-context.xml"
/>
<import
resource=
"classpath:activiti-context.xml"
/>
<import
resource=
"classpath:config/spring/spring-dataSource.xml"
/>
<import
resource=
"classpath:config/spring/spring-dataSource.xml"
/>
...
...
huigou-xt/src/main/webapp/desmoj/demo/demol.js
0 → 100644
View file @
f35f1a14
var
gridManager
=
null
,
refreshFlag
=
false
;
$
(
function
()
{
bindEvent
();
initializeGrid
();
});
function
bindEvent
(){
$
(
"#queryName"
).
orgTree
({
filter
:
"psm"
,
excludePos
:
1
,
param
:
{
orgRoot
:
"55CC78F4502C46F6A174804E9D02F91F"
},
back
:
{
text
:
"#queryName"
},
// manageType: 'taskQuery,admin',
onChange
:
function
(
value
,
data
){
$
(
'#queryCode'
).
val
(
data
.
code
);
}
});
$
(
'#procName'
).
treebox
({
name
:
'procTreeView'
,
param
:
{
nodeKindId
:
"folder,proc"
},
back
:
{
text
:
"#procName"
},
onChange
:
function
(
value
,
data
){
$
(
'#procFullId'
).
val
(
data
.
fullId
);
}
});
$
(
'#selectDateRange'
).
combox
({
onChange
:
function
(){
setTimeout
(
function
(){
initdateRange
();},
10
);
}})
initdateRange
();
}
function
initdateRange
(){
var
dateRange
=
$
(
'#selectDateRange'
).
val
();
if
(
dateRange
==
'10'
){
UICtrl
.
enable
(
'#editStartDate'
);
UICtrl
.
enable
(
'#editEndDate'
);
}
else
{
UICtrl
.
disable
(
'#editStartDate'
);
UICtrl
.
disable
(
'#editEndDate'
);
}
}
function
initializeGrid
()
{
var
toolbarOptions
=
UICtrl
.
getDefaultToolbarOptions
({
addHandler
:
addOtherSystemConfig
,
updateHandler
:
updateHandler
,
deleteHandler
:
deleteHandler
,
enableHandler
:
enableHandler
,
disableHandler
:
disableHandler
});
gridManager
=
UICtrl
.
grid
(
"#maingrid"
,
{
columns
:
[
{
display
:
"系统名称"
,
name
:
"name"
,
width
:
350
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"系统编码"
,
name
:
"code"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"接口名称"
,
name
:
"systemServiceName"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"接口编码"
,
name
:
"systemServiceCategory"
,
width
:
120
,
minWidth
:
60
,
type
:
"date"
,
align
:
"left"
},
{
display
:
"是否启用规则验证"
,
name
:
"isEnableRuleTextView"
,
width
:
120
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
},
{
display
:
"规则编码"
,
name
:
"ruleCode"
,
width
:
120
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"规则名称"
,
name
:
"ruleName"
,
width
:
160
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"备注"
,
name
:
"remark"
,
width
:
220
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"状态"
,
name
:
"status"
,
width
:
"60"
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
,
render
:
function
(
item
)
{
return
UICtrl
.
getStatusInfo
(
item
.
status
);
}
}
],
dataAction
:
"server"
,
url
:
web_app
.
name
+
"/webservice/findOtherSystemConfig.ajax"
,
pageSize
:
20
,
checkbox
:
true
,
width
:
"99.8%"
,
height
:
'100%'
,
heightDiff
:
-
2
,
// fixedCellHeight: true,
// selectRowButtonOnly: true,
toolbar
:
toolbarOptions
// ,
// delayLoad: true
});
UICtrl
.
setSearchAreaToggle
(
gridManager
);
}
function
query
(
obj
)
{
var
param
=
$
(
obj
).
formToJSON
();
if
(
!
param
)
return
;
UICtrl
.
gridSearch
(
gridManager
,
param
);
}
function
reloadGrid
()
{
gridManager
.
loadData
();
}
function
resetForm
(
obj
)
{
$
(
obj
).
formClean
();
}
/**
* 新增第三方系统WEB SERVICE 配置
*/
function
addOtherSystemConfig
(){
UICtrl
.
showAjaxDialog
({
title
:
"新增配置"
,
url
:
web_app
.
name
+
"/webservice/forwardInsertWebServiceConfig.load"
,
width
:
800
,
height
:
400
,
ok
:
doSave
,
init
:
initSystem
,
close
:
dialogClose
});
}
/**
* 修改第三方系统WEB SERVICE 配置
*/
function
updateHandler
(){
var
row
=
DataUtil
.
getSelectedRow
(
gridManager
);
if
(
!
row
){
return
;
}
UICtrl
.
showAjaxDialog
({
title
:
"修改配置"
,
url
:
web_app
.
name
+
"/webservice/forwardUpdateWebServiceConfig.load"
,
width
:
800
,
param
:
row
,
height
:
400
,
ok
:
doSave
,
init
:
initSystem
,
close
:
dialogClose
});
}
/**
* 删除第三方系统WEB SERVICE 配置
*/
function
deleteHandler
(){
DataUtil
.
del
({
action
:
'webservice/deleteOtherSystemConfig.ajax'
,
gridManager
:
gridManager
,
idFieldName
:
'id'
,
onSuccess
:
function
()
{
reloadGrid
();
}
});
}
/**
* 启用第三方系统WEB SERVICE 配置
*/
function
enableHandler
(){
updateStatus
(
'您确定要启用选中数据吗?'
,
1
);
}
/**
* 禁用第三方系统WEB SERVICE 配置
*/
function
disableHandler
(){
updateStatus
(
'您确定要禁用选中数据吗?'
,
0
);
}
//修改状态
function
updateStatus
(
message
,
status
)
{
DataUtil
.
updateById
({
action
:
'webservice/updateOtherSystemConfigStatus.ajax'
,
gridManager
:
gridManager
,
param
:
{
status
:
status
},
message
:
message
,
onSuccess
:
function
()
{
reloadGrid
();
}
});
}
/**
* 保存表单数据
*/
function
doSave
(){
var
_self
=
this
;
var
url
=
"/webservice/saveOtherSystemConfig.ajax"
;
$
(
'#submitForm'
).
ajaxSubmit
({
url
:
web_app
.
name
+
url
,
success
:
function
()
{
refreshFlag
=
true
;
_self
.
close
();
}
});
}
//关闭对话框
function
dialogClose
(){
if
(
refreshFlag
){
reloadGrid
();
refreshFlag
=
false
;
}
}
/**
* 详情页加载组织机构
*/
function
initSystem
()
{
$
(
"#code"
).
orgTree
({
filter
:
"psm"
,
excludePos
:
1
,
param
:
{
orgRoot
:
"376D128202054464B0890B93ED774D72"
},
back
:
{
text
:
"#name"
},
// manageType: 'taskQuery,admin',
onChange
:
function
(
value
,
data
){
$
(
'#code'
).
setValue
(
data
.
code
);
$
(
'#systemId'
).
setValue
(
data
.
personId
);
}
});
$
(
"#systemServiceName"
).
searchbox
({
type
:
"webservice"
,
name
:
"webServiceConfigType"
,
back
:{
code
:
'#systemServiceCategory'
,
name
:
'#systemServiceName'
}
// onChange:function(value,data){
// $('#systemServiceCategory').val(data.code);
// }
});
initSelectRule
();
}
/**
* 加载 规则选择框
*/
function
initSelectRule
(){
$
(
"#ruleName"
).
searchbox
({
type
:
"rule"
,
name
:
"rule"
,
back
:{
code
:
'#ruleCode'
,
name
:
'#ruleName'
}
});
}
\ No newline at end of file
huigou-xt/src/main/webapp/desmoj/demo/demol.jsp
0 → 100644
View file @
f35f1a14
<%@ page
language=
"java"
contentType=
"text/html; charset=utf-8"
%>
<%@taglib
uri=
"/WEB-INF/taglib.tld"
prefix=
"x"
%>
<%@ taglib
uri=
"http://java.sun.com/jsp/jstl/core"
prefix=
"c"
%>
<html>
<head>
<x:base
include=
"layout,dialog,combox,grid,dateTime,tree,selectOrg,commonTree"
/>
<script
src=
'
<c:url
value=
"/system/bpm/BpmUtil.js"
/>
'
type=
"text/javascript"
></script>
<script
src=
'
<c:url
value=
"/desmoj/demo/demol.js"
/>
'
type=
"text/javascript"
></script>
</head>
<body>
<div
class=
"container-fluid"
>
<x:title
title=
"common.button.search"
hideTable=
"queryMainForm"
isHide=
"true"
/>
<form
class=
"hg-form"
method=
"post"
action=
""
id=
"queryMainForm"
>
<div
class=
"hg-form-row"
>
<x:hidden
name=
"code"
id=
"queryCode"
/>
<x:inputC
name=
"name"
id=
"queryName"
label=
"第三方系统"
readonly=
"false"
labelCol=
"1"
wrapper=
"tree"
/>
<x:inputC
name=
"systemServiceName"
id=
"querySystemServiceName"
label=
"接口名称"
labelCol=
"1"
/>
<x:selectC
name=
"status"
id=
"status"
label=
"启用"
dictionary=
"yesorno"
labelCol=
"1"
/>
</div>
<div
class=
"hg-form-row"
>
<x:button
value=
"运行"
/>
</div>
</form>
<div
class=
"blank_div clearfix"
></div>
<div
id=
"maingrid"
style=
"margin:2px;"
></div>
</div>
</body>
</html>
pom.xml
View file @
f35f1a14
...
@@ -22,11 +22,12 @@
...
@@ -22,11 +22,12 @@
<module>
huigou-demo
</module>
<module>
huigou-demo
</module>
<module>
huigou-xt
</module>
<module>
huigou-xt
</module>
<module>
query-spring
</module>
<module>
query-spring
</module>
<!-- <module>huigou-form</module>--
>
<module>
huigou-form
</module
>
<!-- <module>huigou-bpm</module>--
>
<module>
huigou-bpm
</module
>
<module>
huigou-webservice
</module>
<module>
huigou-webservice
</module>
<module>
huigou-rule
</module>
<module>
huigou-rule
</module>
<module>
huigou-index
</module>
<module>
huigou-index
</module>
<module>
huigou-desmoj
</module>
</modules>
</modules>
<properties>
<properties>
...
@@ -170,7 +171,7 @@
...
@@ -170,7 +171,7 @@
<fastjson.version>
1.2.59
</fastjson.version>
<fastjson.version>
1.2.59
</fastjson.version>
<jstyleparser.version>
3.5
</jstyleparser.version>
<jstyleparser.version>
3.5
</jstyleparser.version>
<mxgraph.version>
4.1.0
</mxgraph.version>
<mxgraph.version>
4.1.0
</mxgraph.version>
<lombok.version>
1.18.
12
</lombok.version>
<lombok.version>
1.18.
20
</lombok.version>
<camel.version>
2.24.2
</camel.version>
<camel.version>
2.24.2
</camel.version>
<activemq.version>
5.15.11
</activemq.version>
<activemq.version>
5.15.11
</activemq.version>
</properties>
</properties>
...
...
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