|
@@ -194,7 +194,7 @@ func (this *MachineApiController) SaveManageInfo() {
|
194
|
194
|
//查询机位号是否绑定设备
|
195
|
195
|
thisAddmacher, err := service.GetEquitmentByBedID(bed_number, orgid)
|
196
|
196
|
if thisAddmacher.ID > 0 {
|
197
|
|
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDialysisNoExist)
|
|
197
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeEquitNoExist)
|
198
|
198
|
return
|
199
|
199
|
}
|
200
|
200
|
|
|
@@ -360,6 +360,11 @@ func (this *MachineApiController) UpdateMachineInfo() {
|
360
|
360
|
}
|
361
|
361
|
fmt.Println("ids", ids)
|
362
|
362
|
//service.GetModeName(unit_type)
|
|
363
|
+ thisAddmacher, err := service.GetEquitmentByBedID(bed_number, orgid)
|
|
364
|
+ if thisAddmacher.ID > 0 && thisAddmacher.ID != id {
|
|
365
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDialysisNoExist)
|
|
366
|
+ return
|
|
367
|
+ }
|
363
|
368
|
addmacher := models.DeviceAddmacher{
|
364
|
369
|
ID: id,
|
365
|
370
|
SerialNumber: serial_number,
|
|
@@ -850,7 +855,7 @@ func (this *MachineApiController) UpdatePlanInfo() {
|
850
|
855
|
//fmt.Println("基表消毒液", machinedisinfectant)
|
851
|
856
|
|
852
|
857
|
disinfectantway := int64(dataBody["disinfectant_way"].(float64))
|
853
|
|
- // fmt.Println("液路消毒方式", disinfectantway)
|
|
858
|
+ fmt.Println("液路消毒方式", disinfectantway)
|
854
|
859
|
|
855
|
860
|
disinfectant := int64(dataBody["disinfectant"].(float64))
|
856
|
861
|
//fmt.Println("液路消毒液", disinfectant)
|
|
@@ -1149,13 +1154,13 @@ func (this *MachineApiController) SaveInformation() {
|
1149
|
1154
|
//fmt.Println("签名", sign_name)
|
1150
|
1155
|
|
1151
|
1156
|
information, errinfor := service.GetInformation(eid, startdate, orgid)
|
1152
|
|
- fmt.Print("errinfor---------------------", errinfor)
|
|
1157
|
+ fmt.Print("errinfor", errinfor)
|
1153
|
1158
|
fmt.Print("information", information)
|
1154
|
1159
|
if errinfor == gorm.ErrRecordNotFound {
|
1155
|
1160
|
infor := models.DeviceInformation{
|
1156
|
|
- Date: startdate,
|
1157
|
|
- Class: classtype,
|
1158
|
|
- Zone: zone,
|
|
1161
|
+ Date: startdate,
|
|
1162
|
+ Class: classtype,
|
|
1163
|
+ // Zone: zone,
|
1159
|
1164
|
BedNumber: bednumber,
|
1160
|
1165
|
PatientId: patient_time,
|
1161
|
1166
|
Contagion: contagion,
|
|
@@ -2372,7 +2377,21 @@ func (this *MachineApiController) UpdateForm() {
|
2372
|
2377
|
fmt.Println("清洁", clean)
|
2373
|
2378
|
sign_name := int64(dataBody["sign_name"].(float64))
|
2374
|
2379
|
fmt.Println("签名", sign_name)
|
|
2380
|
+ equitment_id := int64(dataBody["equiment_id"].(float64))
|
|
2381
|
+ fmt.Println("设备ID", equitment_id)
|
2375
|
2382
|
|
|
2383
|
+ addmacher := models.DeviceAddmacher{
|
|
2384
|
+ BedId: bednumber,
|
|
2385
|
+ }
|
|
2386
|
+ //更新床位号
|
|
2387
|
+ err = service.UpdateAddMacherBedID(equitment_id, orgid, &addmacher)
|
|
2388
|
+ fmt.Println("更新设备失败", err)
|
|
2389
|
+ //更新区号
|
|
2390
|
+ deviceNumber := models.DeviceNumber{
|
|
2391
|
+ ZoneID: zone,
|
|
2392
|
+ }
|
|
2393
|
+ err = service.UpdatedZoneID(bednumber, orgid, &deviceNumber)
|
|
2394
|
+ fmt.Println("更新区号失败---", err)
|
2376
|
2395
|
information := models.DeviceInformation{
|
2377
|
2396
|
Date: startdate,
|
2378
|
2397
|
Class: classtype,
|
|
@@ -2534,6 +2553,7 @@ func (this *MachineApiController) GetBedForm() {
|
2534
|
2553
|
fmt.Println("id", id)
|
2535
|
2554
|
addmacher, err := service.GetZoneForm(id)
|
2536
|
2555
|
bed, err := service.GetZoneId(addmacher.BedId, orgId)
|
|
2556
|
+
|
2537
|
2557
|
number, err := service.GetBedForm(bed.ZoneID)
|
2538
|
2558
|
if err != nil {
|
2539
|
2559
|
this.ServeFailJsonSend(enums.ErrorCodeDBDelete, "查询:("+err.Error()+")")
|
|
@@ -3047,7 +3067,7 @@ func (this *MachineApiController) GetTimeData() {
|
3047
|
3067
|
func (this *MachineApiController) DeleteImages() {
|
3048
|
3068
|
id, _ := this.GetInt64("id")
|
3049
|
3069
|
err := service.DeleteImages(id)
|
3050
|
|
- fmt.Print("err", err)
|
|
3070
|
+ fmt.Print("err========", err)
|
3051
|
3071
|
if err != nil {
|
3052
|
3072
|
this.ServeFailJsonSend(enums.ErrorCodeDBDelete, "删除失败")
|
3053
|
3073
|
return
|