|
@@ -3301,8 +3301,6 @@ func (c *HisApiController) CreateHisPrescription() {
|
3301
|
3301
|
advices := items["advices"].([]interface{})
|
3302
|
3302
|
//group := service.GetMaxAdviceGroupID(adminInfo.CurrentOrgId)
|
3303
|
3303
|
groupNo := int64(0)
|
3304
|
|
- ctime := time.Now().Unix()
|
3305
|
|
- mtime := ctime
|
3306
|
3304
|
if len(advices) > 0 {
|
3307
|
3305
|
for _, advice := range advices {
|
3308
|
3306
|
tx := db.Begin()
|
|
@@ -3326,8 +3324,7 @@ func (c *HisApiController) CreateHisPrescription() {
|
3326
|
3324
|
s.RecordDate = theTime3.Unix()
|
3327
|
3325
|
s.StartTime = tempPrescription.PreTime
|
3328
|
3326
|
s.Groupno = groupNo
|
3329
|
|
- s.CreatedTime = ctime
|
3330
|
|
- s.UpdatedTime = mtime
|
|
3327
|
+
|
3331
|
3328
|
s.PatientId = patient_id
|
3332
|
3329
|
s.HisPatientId = his_patient_id
|
3333
|
3330
|
s.StartTime = pTime
|
|
@@ -3380,127 +3377,181 @@ func (c *HisApiController) CreateHisPrescription() {
|
3380
|
3377
|
// 查询该药品最后一次出库记录
|
3381
|
3378
|
druginfo, _ := service.GetLastDrugWarehouseOutByDrugIdTwenty(s.DrugId, patient_id, recordDateTime, s.ID)
|
3382
|
3379
|
|
|
3380
|
+ var is_user_total int64
|
|
3381
|
+ var no_user_total int64
|
|
3382
|
+
|
|
3383
|
+ //fmt.Println("s-------------------------------------------", s.PrescribingNumber)
|
|
3384
|
+ //fmt.Println("s.PrescribingNumberUnit------------------", s.PrescribingNumberUnit)
|
|
3385
|
+ //fmt.Println("drug.MaxUnit", drug.MaxUnit)
|
|
3386
|
+ //fmt.Println("drug.MinUnit", drug.MinUnit)
|
|
3387
|
+
|
|
3388
|
+ if s.PrescribingNumberUnit == drug.MaxUnit && drug.MaxUnit != drug.MinUnit {
|
|
3389
|
+
|
|
3390
|
+ prescribingNumberTenty := strconv.FormatFloat(s.PrescribingNumber, 'f', -1, 64)
|
|
3391
|
+ prescribingNumberSevenTy, _ := strconv.ParseInt(prescribingNumberTenty, 10, 64)
|
|
3392
|
+
|
|
3393
|
+ no_user_total += prescribingNumberSevenTy * drug.MinNumber
|
|
3394
|
+ }
|
|
3395
|
+
|
|
3396
|
+ if s.PrescribingNumberUnit == drug.MinUnit && drug.MaxUnit != drug.MinUnit {
|
|
3397
|
+
|
|
3398
|
+ prescribingNumberTenty := strconv.FormatFloat(s.PrescribingNumber, 'f', -1, 64)
|
|
3399
|
+ prescribingNumberSevenTy, _ := strconv.ParseInt(prescribingNumberTenty, 10, 64)
|
|
3400
|
+ no_user_total += prescribingNumberSevenTy
|
|
3401
|
+ }
|
|
3402
|
+
|
|
3403
|
+ if s.PrescribingNumberUnit == drug.MaxUnit && drug.MaxUnit == drug.MinUnit {
|
|
3404
|
+
|
|
3405
|
+ prescribingNumberTenty := strconv.FormatFloat(s.PrescribingNumber, 'f', -1, 64)
|
|
3406
|
+ prescribingNumberSevenTy, _ := strconv.ParseInt(prescribingNumberTenty, 10, 64)
|
|
3407
|
+ no_user_total += prescribingNumberSevenTy
|
|
3408
|
+ }
|
3383
|
3409
|
if len(druginfo) > 0 {
|
3384
|
|
- //回退库存
|
3385
|
3410
|
for _, it := range druginfo {
|
3386
|
3411
|
if it.CountUnit == drug.MaxUnit && drug.MaxUnit != drug.MinUnit {
|
3387
|
|
-
|
3388
|
|
- service.ModifyDrugWarehouseInfoStockMaxNumber(it.Count, it.DrugId, it.OrgId, it.WarehouseInfoId)
|
3389
|
|
-
|
|
3412
|
+ it.Count = it.Count * drug.MinNumber
|
|
3413
|
+ is_user_total += it.Count
|
3390
|
3414
|
}
|
3391
|
|
- if it.CountUnit == drug.MinUnit && drug.MaxUnit != drug.MinUnit {
|
3392
|
|
-
|
3393
|
|
- service.ModifyDrugWarehouseInfoStockMinNumber(it.Count, it.DrugId, it.OrgId, it.WarehouseInfoId)
|
3394
|
3415
|
|
|
3416
|
+ if it.CountUnit == drug.MinUnit && drug.MaxUnit != drug.MinUnit {
|
|
3417
|
+ is_user_total += it.Count
|
3395
|
3418
|
}
|
3396
|
|
- if it.CountUnit == drug.MaxUnit && drug.MaxUnit == drug.MinUnit {
|
3397
|
3419
|
|
3398
|
|
- service.ModifyDrugWarehouseInfoStockMaxNumber(it.Count, it.DrugId, it.OrgId, it.WarehouseInfoId)
|
|
3420
|
+ if it.CountUnit == drug.MaxUnit && drug.MaxUnit == drug.MinUnit {
|
|
3421
|
+ is_user_total += it.Count
|
3399
|
3422
|
|
3400
|
3423
|
}
|
3401
|
3424
|
}
|
3402
|
3425
|
|
3403
|
|
- //删除记录
|
3404
|
|
- service.DeleteNewDrugAutoWarehouseSeven(s.DrugId, patient_id, recordDateTime, s.ID)
|
3405
|
|
-
|
3406
|
3426
|
}
|
3407
|
3427
|
|
3408
|
|
- service.CreateHisDoctorAdviceOne(&s, tx)
|
3409
|
|
-
|
3410
|
|
- advicelast, _ := service.GetLastHisAdvicesList(s.PatientId, s.AdviceDate, s.UserOrgId, tx)
|
3411
|
|
-
|
3412
|
|
- //出库
|
3413
|
|
- if drug.IsUse == 2 {
|
3414
|
|
- creater := adminInfo.AdminUser.Id
|
3415
|
|
- newadviceInfo := &models.HisDoctorAdviceInfo{
|
3416
|
|
- ID: advicelast.ID,
|
3417
|
|
- UserOrgId: s.UserOrgId,
|
3418
|
|
- PatientId: s.PatientId,
|
3419
|
|
- HisPatientId: s.HisPatientId,
|
3420
|
|
- AdviceType: s.AdviceType,
|
3421
|
|
- AdviceDate: s.AdviceDate,
|
3422
|
|
- StartTime: s.StartTime,
|
3423
|
|
- AdviceName: s.AdviceName,
|
3424
|
|
- AdviceDesc: s.AdviceDesc,
|
3425
|
|
- ReminderDate: s.ReminderDate,
|
3426
|
|
- SingleDose: s.SingleDose,
|
3427
|
|
- SingleDoseUnit: s.SingleDoseUnit,
|
3428
|
|
- PrescribingNumber: s.PrescribingNumber,
|
3429
|
|
- PrescribingNumberUnit: s.PrescribingNumberUnit,
|
3430
|
|
- DeliveryWay: s.DeliveryWay,
|
3431
|
|
- ExecutionFrequency: s.ExecutionFrequency,
|
3432
|
|
- AdviceDoctor: s.AdviceDoctor,
|
3433
|
|
- Status: s.Status,
|
3434
|
|
- CreatedTime: s.CreatedTime,
|
3435
|
|
- UpdatedTime: s.UpdatedTime,
|
3436
|
|
- AdviceAffirm: s.AdviceAffirm,
|
3437
|
|
- Remark: s.Remark,
|
3438
|
|
- StopTime: s.StopTime,
|
3439
|
|
- StopReason: s.StopReason,
|
3440
|
|
- StopDoctor: s.StopDoctor,
|
3441
|
|
- StopState: s.StopState,
|
3442
|
|
- ParentId: s.ParentId,
|
3443
|
|
- ExecutionTime: s.ExecutionTime,
|
3444
|
|
- ExecutionStaff: s.ExecutionStaff,
|
3445
|
|
- ExecutionState: s.ExecutionState,
|
3446
|
|
- Checker: s.Checker,
|
3447
|
|
- RecordDate: s.RecordDate,
|
3448
|
|
- DialysisOrderId: s.DialysisOrderId,
|
3449
|
|
- CheckTime: s.CheckTime,
|
3450
|
|
- CheckState: s.CheckState,
|
3451
|
|
- DrugSpec: s.DrugSpec,
|
3452
|
|
- DrugSpecUnit: s.DrugSpecUnit,
|
3453
|
|
- Groupno: s.Groupno,
|
3454
|
|
- RemindType: s.RemindType,
|
3455
|
|
- FrequencyType: s.FrequencyType,
|
3456
|
|
- DayCount: s.DayCount,
|
3457
|
|
- WeekDay: s.WeekDay,
|
3458
|
|
- TemplateId: s.TemplateId,
|
3459
|
|
- Modifier: s.Modifier,
|
3460
|
|
- DrugId: s.DrugId,
|
3461
|
|
- Price: s.Price,
|
3462
|
|
- PrescriptionId: s.PrescriptionId,
|
3463
|
|
- MedListCodg: s.MedListCodg,
|
3464
|
|
- FeedetlSn: s.FeedetlSn,
|
3465
|
|
- Day: s.DayCount,
|
3466
|
|
- ChildDoctorAdvice: nil,
|
3467
|
|
- Drug: models.Drug{},
|
3468
|
|
- Diagnosis: s.Diagnosis,
|
3469
|
|
- Way: s.Way,
|
3470
|
|
- HospApprFlag: s.HospApprFlag,
|
3471
|
|
- LmtUsedFlag: s.LmtUsedFlag,
|
3472
|
|
- HisOrderInfo: models.HisOrderInfo{},
|
3473
|
|
- IsMedicine: s.IsMedicine,
|
3474
|
|
- ExecutionFrequencyId: s.ExecutionFrequencyId,
|
3475
|
|
- Child: nil,
|
3476
|
|
- IsSettle: s.IsSettle,
|
3477
|
|
- IsMobile: s.IsMobile,
|
3478
|
|
- IsSelfDrug: s.IsSelfDrug,
|
3479
|
|
- DrugWayCount: s.DrugWayCount,
|
|
3428
|
+ //fmt.Println("is_user_total-----------------------------", is_user_total)
|
|
3429
|
+ //fmt.Println("no_user_total-----------------------------", no_user_total)
|
|
3430
|
+
|
|
3431
|
+ if is_user_total != no_user_total {
|
|
3432
|
+
|
|
3433
|
+ if len(druginfo) > 0 {
|
|
3434
|
+ //回退库存
|
|
3435
|
+ for _, it := range druginfo {
|
|
3436
|
+ if it.CountUnit == drug.MaxUnit && drug.MaxUnit != drug.MinUnit {
|
|
3437
|
+
|
|
3438
|
+ service.ModifyDrugWarehouseInfoStockMaxNumber(it.Count, it.DrugId, it.OrgId, it.WarehouseInfoId)
|
|
3439
|
+
|
|
3440
|
+ }
|
|
3441
|
+ if it.CountUnit == drug.MinUnit && drug.MaxUnit != drug.MinUnit {
|
|
3442
|
+
|
|
3443
|
+ service.ModifyDrugWarehouseInfoStockMinNumber(it.Count, it.DrugId, it.OrgId, it.WarehouseInfoId)
|
|
3444
|
+
|
|
3445
|
+ }
|
|
3446
|
+ if it.CountUnit == drug.MaxUnit && drug.MaxUnit == drug.MinUnit {
|
|
3447
|
+
|
|
3448
|
+ service.ModifyDrugWarehouseInfoStockMaxNumber(it.Count, it.DrugId, it.OrgId, it.WarehouseInfoId)
|
|
3449
|
+
|
|
3450
|
+ }
|
|
3451
|
+ }
|
|
3452
|
+
|
|
3453
|
+ //删除记录
|
|
3454
|
+ service.DeleteNewDrugAutoWarehouseSeven(s.DrugId, patient_id, recordDateTime, s.ID)
|
|
3455
|
+
|
3480
|
3456
|
}
|
3481
|
3457
|
|
3482
|
|
- service.NewHisDrugsDelivery(s.UserOrgId, creater, newadviceInfo, tx)
|
|
3458
|
+ service.CreateHisDoctorAdviceOne(&s, tx)
|
|
3459
|
+
|
|
3460
|
+ advicelast, _ := service.GetLastHisAdvicesList(s.PatientId, s.AdviceDate, s.UserOrgId, tx)
|
|
3461
|
+
|
|
3462
|
+ //出库
|
|
3463
|
+ if drug.IsUse == 2 {
|
|
3464
|
+ creater := adminInfo.AdminUser.Id
|
|
3465
|
+ newadviceInfo := &models.HisDoctorAdviceInfo{
|
|
3466
|
+ ID: advicelast.ID,
|
|
3467
|
+ UserOrgId: s.UserOrgId,
|
|
3468
|
+ PatientId: s.PatientId,
|
|
3469
|
+ HisPatientId: s.HisPatientId,
|
|
3470
|
+ AdviceType: s.AdviceType,
|
|
3471
|
+ AdviceDate: s.AdviceDate,
|
|
3472
|
+ StartTime: s.StartTime,
|
|
3473
|
+ AdviceName: s.AdviceName,
|
|
3474
|
+ AdviceDesc: s.AdviceDesc,
|
|
3475
|
+ ReminderDate: s.ReminderDate,
|
|
3476
|
+ SingleDose: s.SingleDose,
|
|
3477
|
+ SingleDoseUnit: s.SingleDoseUnit,
|
|
3478
|
+ PrescribingNumber: s.PrescribingNumber,
|
|
3479
|
+ PrescribingNumberUnit: s.PrescribingNumberUnit,
|
|
3480
|
+ DeliveryWay: s.DeliveryWay,
|
|
3481
|
+ ExecutionFrequency: s.ExecutionFrequency,
|
|
3482
|
+ AdviceDoctor: s.AdviceDoctor,
|
|
3483
|
+ Status: s.Status,
|
|
3484
|
+ CreatedTime: s.CreatedTime,
|
|
3485
|
+ UpdatedTime: s.UpdatedTime,
|
|
3486
|
+ AdviceAffirm: s.AdviceAffirm,
|
|
3487
|
+ Remark: s.Remark,
|
|
3488
|
+ StopTime: s.StopTime,
|
|
3489
|
+ StopReason: s.StopReason,
|
|
3490
|
+ StopDoctor: s.StopDoctor,
|
|
3491
|
+ StopState: s.StopState,
|
|
3492
|
+ ParentId: s.ParentId,
|
|
3493
|
+ ExecutionTime: s.ExecutionTime,
|
|
3494
|
+ ExecutionStaff: s.ExecutionStaff,
|
|
3495
|
+ ExecutionState: s.ExecutionState,
|
|
3496
|
+ Checker: s.Checker,
|
|
3497
|
+ RecordDate: s.RecordDate,
|
|
3498
|
+ DialysisOrderId: s.DialysisOrderId,
|
|
3499
|
+ CheckTime: s.CheckTime,
|
|
3500
|
+ CheckState: s.CheckState,
|
|
3501
|
+ DrugSpec: s.DrugSpec,
|
|
3502
|
+ DrugSpecUnit: s.DrugSpecUnit,
|
|
3503
|
+ Groupno: s.Groupno,
|
|
3504
|
+ RemindType: s.RemindType,
|
|
3505
|
+ FrequencyType: s.FrequencyType,
|
|
3506
|
+ DayCount: s.DayCount,
|
|
3507
|
+ WeekDay: s.WeekDay,
|
|
3508
|
+ TemplateId: s.TemplateId,
|
|
3509
|
+ Modifier: s.Modifier,
|
|
3510
|
+ DrugId: s.DrugId,
|
|
3511
|
+ Price: s.Price,
|
|
3512
|
+ PrescriptionId: s.PrescriptionId,
|
|
3513
|
+ MedListCodg: s.MedListCodg,
|
|
3514
|
+ FeedetlSn: s.FeedetlSn,
|
|
3515
|
+ Day: s.DayCount,
|
|
3516
|
+ ChildDoctorAdvice: nil,
|
|
3517
|
+ Drug: models.Drug{},
|
|
3518
|
+ Diagnosis: s.Diagnosis,
|
|
3519
|
+ Way: s.Way,
|
|
3520
|
+ HospApprFlag: s.HospApprFlag,
|
|
3521
|
+ LmtUsedFlag: s.LmtUsedFlag,
|
|
3522
|
+ HisOrderInfo: models.HisOrderInfo{},
|
|
3523
|
+ IsMedicine: s.IsMedicine,
|
|
3524
|
+ ExecutionFrequencyId: s.ExecutionFrequencyId,
|
|
3525
|
+ Child: nil,
|
|
3526
|
+ IsSettle: s.IsSettle,
|
|
3527
|
+ IsMobile: s.IsMobile,
|
|
3528
|
+ IsSelfDrug: s.IsSelfDrug,
|
|
3529
|
+ DrugWayCount: s.DrugWayCount,
|
|
3530
|
+ }
|
3483
|
3531
|
|
3484
|
|
- }
|
|
3532
|
+ service.NewHisDrugsDelivery(s.UserOrgId, creater, newadviceInfo, tx)
|
3485
|
3533
|
|
3486
|
|
- //更新字典里面的库存
|
3487
|
|
- stockInfo, _ := service.GetNewDrugAllStockInfo(storeConfig.DrugStorehouseOut, s.UserOrgId, s.DrugId, tx)
|
3488
|
|
- var sum_count int64
|
3489
|
|
- for _, its := range stockInfo {
|
3490
|
|
- baseDrug, _ := service.GetNewBaseDrugMedical(its.DrugId, tx)
|
3491
|
|
- if its.MaxUnit == baseDrug.MaxUnit {
|
3492
|
|
- its.StockMaxNumber = its.StockMaxNumber * baseDrug.MinNumber
|
3493
|
3534
|
}
|
3494
|
|
- sum_count += its.StockMaxNumber + its.StockMinNumber
|
3495
|
|
- }
|
3496
|
|
- //更新基础库存
|
3497
|
|
- service.UpdateNewBaseDrugSumTwo(s.DrugId, sum_count, s.UserOrgId, tx)
|
3498
|
|
- //剩余库存
|
3499
|
|
- service.UpdateNewDrugStockCount(s.DrugId, s.UserOrgId, storeConfig.DrugStorehouseOut, sum_count, tx)
|
3500
|
3535
|
|
3501
|
|
- over, _ := service.FindNewOverCount(s.DrugId, s.UserOrgId, storeConfig.DrugStorehouseOut, tx)
|
3502
|
|
- service.UpdateNewActOut(over.ID, over.SumInCount, over.FlushCount, over.SumCancelCount, tx)
|
|
3536
|
+ //更新字典里面的库存
|
|
3537
|
+ stockInfo, _ := service.GetNewDrugAllStockInfo(storeConfig.DrugStorehouseOut, s.UserOrgId, s.DrugId, tx)
|
|
3538
|
+ var sum_count int64
|
|
3539
|
+ for _, its := range stockInfo {
|
|
3540
|
+ baseDrug, _ := service.GetNewBaseDrugMedical(its.DrugId, tx)
|
|
3541
|
+ if its.MaxUnit == baseDrug.MaxUnit {
|
|
3542
|
+ its.StockMaxNumber = its.StockMaxNumber * baseDrug.MinNumber
|
|
3543
|
+ }
|
|
3544
|
+ sum_count += its.StockMaxNumber + its.StockMinNumber
|
|
3545
|
+ }
|
|
3546
|
+ //更新基础库存
|
|
3547
|
+ service.UpdateNewBaseDrugSumTwo(s.DrugId, sum_count, s.UserOrgId, tx)
|
|
3548
|
+ //剩余库存
|
|
3549
|
+ service.UpdateNewDrugStockCount(s.DrugId, s.UserOrgId, storeConfig.DrugStorehouseOut, sum_count, tx)
|
|
3550
|
+
|
|
3551
|
+ over, _ := service.FindNewOverCount(s.DrugId, s.UserOrgId, storeConfig.DrugStorehouseOut, tx)
|
|
3552
|
+ service.UpdateNewActOut(over.ID, over.SumInCount, over.FlushCount, over.SumCancelCount, tx)
|
3503
|
3553
|
|
|
3554
|
+ }
|
3504
|
3555
|
}
|
3505
|
3556
|
|
3506
|
3557
|
//记录日志
|
|
@@ -3612,8 +3663,7 @@ func (c *HisApiController) CreateHisPrescription() {
|
3612
|
3663
|
|
3613
|
3664
|
var p models.HisPrescriptionProject
|
3614
|
3665
|
p.PrescriptionId = tempPrescription.ID
|
3615
|
|
- p.Ctime = time.Now().Unix()
|
3616
|
|
- p.Mtime = time.Now().Unix()
|
|
3666
|
+
|
3617
|
3667
|
p.PatientId = patient_id
|
3618
|
3668
|
p.RecordDate = theTime3.Unix()
|
3619
|
3669
|
p.Doctor = doctor_id
|
|
@@ -4103,8 +4153,6 @@ func (c *HisApiController) CreateHisPrescription() {
|
4103
|
4153
|
advices := items["advices"].([]interface{})
|
4104
|
4154
|
//group := service.GetMaxAdviceGroupID(adminInfo.CurrentOrgId)
|
4105
|
4155
|
groupNo := int64(0)
|
4106
|
|
- ctime := time.Now().Unix()
|
4107
|
|
- mtime := ctime
|
4108
|
4156
|
if len(advices) > 0 {
|
4109
|
4157
|
for _, advice := range advices {
|
4110
|
4158
|
var s models.HisDoctorAdviceInfo
|
|
@@ -4119,8 +4167,7 @@ func (c *HisApiController) CreateHisPrescription() {
|
4119
|
4167
|
s.RecordDate = theTime3.Unix()
|
4120
|
4168
|
s.StartTime = tempPrescription.PreTime
|
4121
|
4169
|
s.Groupno = groupNo
|
4122
|
|
- s.CreatedTime = ctime
|
4123
|
|
- s.UpdatedTime = mtime
|
|
4170
|
+
|
4124
|
4171
|
s.PatientId = patient_id
|
4125
|
4172
|
s.HisPatientId = his_patient_id
|
4126
|
4173
|
s.StartTime = pTime
|
|
@@ -4214,8 +4261,7 @@ func (c *HisApiController) CreateHisPrescription() {
|
4214
|
4261
|
|
4215
|
4262
|
var p models.HisPrescriptionProject
|
4216
|
4263
|
p.PrescriptionId = tempPrescription.ID
|
4217
|
|
- p.Ctime = time.Now().Unix()
|
4218
|
|
- p.Mtime = time.Now().Unix()
|
|
4264
|
+
|
4219
|
4265
|
p.PatientId = patient_id
|
4220
|
4266
|
p.RecordDate = theTime3.Unix()
|
4221
|
4267
|
p.Doctor = doctor_id
|
|
@@ -6918,6 +6964,7 @@ func SetAdviceWithJSON(advice *models.HisDoctorAdviceInfo, json map[string]inter
|
6918
|
6964
|
advice.CheckTime = 0
|
6919
|
6965
|
advice.Checker = 0
|
6920
|
6966
|
advice.CheckState = 2
|
|
6967
|
+ advice.UpdatedTime = time.Now().Unix()
|
6921
|
6968
|
}
|
6922
|
6969
|
}
|
6923
|
6970
|
|
|
@@ -7306,7 +7353,6 @@ func (c *HisApiController) setAdviceWithJSON(advice *models.HisDoctorAdviceInfo,
|
7306
|
7353
|
hisAdvice, err := service.GetHisDoctorAdvicesById(advice.ID)
|
7307
|
7354
|
if err == nil {
|
7308
|
7355
|
if hisAdvice.ID > 0 {
|
7309
|
|
-
|
7310
|
7356
|
advice.ExecutionTime = hisAdvice.ExecutionTime
|
7311
|
7357
|
advice.ExecutionStaff = hisAdvice.ExecutionStaff
|
7312
|
7358
|
advice.ExecutionState = hisAdvice.ExecutionState
|
|
@@ -7333,13 +7379,28 @@ func (c *HisApiController) setAdviceWithJSON(advice *models.HisDoctorAdviceInfo,
|
7333
|
7379
|
advice.CheckTime = 0
|
7334
|
7380
|
advice.Checker = 0
|
7335
|
7381
|
advice.CheckState = 2
|
|
7382
|
+ //advice.UpdatedTime = time.Now().Unix()
|
|
7383
|
+ advice.CreatedTime = hisAdvice.CreatedTime
|
|
7384
|
+ advice.UpdatedTime = time.Now().Unix()
|
|
7385
|
+ } else {
|
|
7386
|
+ advice.CreatedTime = hisAdvice.CreatedTime
|
|
7387
|
+ advice.UpdatedTime = hisAdvice.UpdatedTime
|
|
7388
|
+
|
7336
|
7389
|
}
|
7337
|
7390
|
}
|
7338
|
|
-
|
7339
|
7391
|
//advice.Groupno = hisAdvice.Groupno
|
|
7392
|
+ } else {
|
|
7393
|
+ ctime := time.Now().Unix()
|
|
7394
|
+ advice.CreatedTime = ctime
|
|
7395
|
+ advice.UpdatedTime = ctime
|
7340
|
7396
|
|
7341
|
7397
|
}
|
7342
|
7398
|
}
|
|
7399
|
+ } else {
|
|
7400
|
+ ctime := time.Now().Unix()
|
|
7401
|
+ advice.CreatedTime = ctime
|
|
7402
|
+ advice.UpdatedTime = ctime
|
|
7403
|
+
|
7343
|
7404
|
}
|
7344
|
7405
|
}
|
7345
|
7406
|
|
|
@@ -7484,6 +7545,7 @@ func (c *HisApiController) setProjectWithJSON(project *models.HisPrescriptionPro
|
7484
|
7545
|
project.CheckState = temp_project.CheckState
|
7485
|
7546
|
project.CheckTime = temp_project.CheckTime
|
7486
|
7547
|
project.TeamId = temp_project.TeamId
|
|
7548
|
+
|
7487
|
7549
|
}
|
7488
|
7550
|
if json["type"] != nil || reflect.TypeOf(json["type"]).String() == "float64" {
|
7489
|
7551
|
types := int64(json["type"].(float64))
|
|
@@ -7599,7 +7661,26 @@ func (c *HisApiController) setProjectWithJSON(project *models.HisPrescriptionPro
|
7599
|
7661
|
// }
|
7600
|
7662
|
//
|
7601
|
7663
|
//}
|
|
7664
|
+ if json["id"] != nil || reflect.TypeOf(json["id"]).String() == "float64" {
|
|
7665
|
+ id := int64(json["id"].(float64))
|
|
7666
|
+ if id > 0 {
|
|
7667
|
+ temp_project, _ := service.GetHisPrescriptionProjectByID(id)
|
|
7668
|
+
|
|
7669
|
+ if temp_project.ExecutionFrequency != project.ExecutionFrequency || temp_project.Count != project.Count || temp_project.Remark != project.Remark {
|
|
7670
|
+ fmt.Println("666666")
|
|
7671
|
+ project.Mtime = time.Now().Unix()
|
|
7672
|
+ project.Ctime = temp_project.Ctime
|
7602
|
7673
|
|
|
7674
|
+ } else {
|
|
7675
|
+ project.Mtime = temp_project.Mtime
|
|
7676
|
+ project.Ctime = temp_project.Ctime
|
|
7677
|
+ }
|
|
7678
|
+ } else {
|
|
7679
|
+ ctime := time.Now().Unix()
|
|
7680
|
+ project.Mtime = ctime
|
|
7681
|
+ project.Ctime = ctime
|
|
7682
|
+ }
|
|
7683
|
+ }
|
7603
|
7684
|
return 0
|
7604
|
7685
|
}
|
7605
|
7686
|
|