|
@@ -3485,7 +3485,7 @@ func (c *HisApiController) CreateHisPrescription() {
|
3485
|
3485
|
var p models.HisPrescriptionProject
|
3486
|
3486
|
p.PrescriptionId = tempPrescription.ID
|
3487
|
3487
|
p.Ctime = time.Now().Unix()
|
3488
|
|
- p.Mtime = time.Now().Unix()
|
|
3488
|
+ p.Mtime = p.Ctime
|
3489
|
3489
|
p.PatientId = patient_id
|
3490
|
3490
|
p.RecordDate = theTime3.Unix()
|
3491
|
3491
|
p.Doctor = doctor_id
|
|
@@ -4116,6 +4116,16 @@ func (c *HisApiController) CreateHisPrescription() {
|
4116
|
4116
|
return
|
4117
|
4117
|
}
|
4118
|
4118
|
} else {
|
|
4119
|
+
|
|
4120
|
+ db := service.XTWriteDB()
|
|
4121
|
+ tx := db.Begin()
|
|
4122
|
+
|
|
4123
|
+
|
|
4124
|
+ defer func() {
|
|
4125
|
+ if r := recover(); r != nil {
|
|
4126
|
+ tx.Rollback()
|
|
4127
|
+ }
|
|
4128
|
+ }()
|
4119
|
4129
|
|
4120
|
4130
|
if dataBody["prescriptions"] != nil && reflect.TypeOf(dataBody["prescriptions"]).String() == "[]interface {}" {
|
4121
|
4131
|
prescriptions, _ := dataBody["prescriptions"].([]interface{})
|
|
@@ -7439,7 +7449,11 @@ func (c *HisApiController) setAdviceWithJSON(advice *models.HisDoctorAdviceInfo,
|
7439
|
7449
|
hisAdvice, err := service.GetHisDoctorAdvicesById(advice.ID)
|
7440
|
7450
|
if err == nil {
|
7441
|
7451
|
if hisAdvice.ID > 0 {
|
7442
|
|
-
|
|
7452
|
+ if hisAdvice.YbSyncStatus == 1 {
|
|
7453
|
+ advice.YbSyncStatus = 0
|
|
7454
|
+ }
|
|
7455
|
+ advice.UpdatedTime = time.Now().Unix()
|
|
7456
|
+ advice.CreatedTime = hisAdvice.CreatedTime
|
7443
|
7457
|
advice.ExecutionTime = hisAdvice.ExecutionTime
|
7444
|
7458
|
advice.ExecutionStaff = hisAdvice.ExecutionStaff
|
7445
|
7459
|
advice.ExecutionState = hisAdvice.ExecutionState
|
|
@@ -7610,13 +7624,22 @@ func (c *HisApiController) setProjectWithJSON(project *models.HisPrescriptionPro
|
7610
|
7624
|
id := int64(json["id"].(float64))
|
7611
|
7625
|
project.ID = id
|
7612
|
7626
|
temp_project, _ := service.GetHisPrescriptionProjectByID(id)
|
7613
|
|
- project.ExecutionStaff = temp_project.ExecutionStaff
|
7614
|
|
- project.ExecutionState = temp_project.ExecutionState
|
7615
|
|
- project.ExecutionTime = temp_project.ExecutionTime
|
7616
|
|
- project.Checker = temp_project.Checker
|
7617
|
|
- project.CheckState = temp_project.CheckState
|
7618
|
|
- project.CheckTime = temp_project.CheckTime
|
7619
|
|
- project.TeamId = temp_project.TeamId
|
|
7627
|
+ if temp_project.ID > 0 {
|
|
7628
|
+ if temp_project.YbSyncStatus == 1 {
|
|
7629
|
+ project.YbSyncStatus = 0
|
|
7630
|
+ }
|
|
7631
|
+ project.ExecutionStaff = temp_project.ExecutionStaff
|
|
7632
|
+ project.ExecutionState = temp_project.ExecutionState
|
|
7633
|
+ project.ExecutionTime = temp_project.ExecutionTime
|
|
7634
|
+ project.Checker = temp_project.Checker
|
|
7635
|
+ project.CheckState = temp_project.CheckState
|
|
7636
|
+ project.CheckTime = temp_project.CheckTime
|
|
7637
|
+ project.TeamId = temp_project.TeamId
|
|
7638
|
+ project.Ctime = temp_project.Ctime
|
|
7639
|
+ project.Mtime = time.Now().Unix()
|
|
7640
|
+
|
|
7641
|
+ }
|
|
7642
|
+
|
7620
|
7643
|
}
|
7621
|
7644
|
if json["type"] != nil || reflect.TypeOf(json["type"]).String() == "float64" {
|
7622
|
7645
|
types := int64(json["type"].(float64))
|