|
@@ -155,6 +155,9 @@ func ManageRouters() {
|
155
|
155
|
beego.Router("/api/manage/getobjectregistrationbyidlist", &MachineApiController{}, "Get:GetObjectRegistrationByIdList")
|
156
|
156
|
beego.Router("/api/manage/updateobjectregistration", &MachineApiController{}, "Post:UpdateObjectRegistration")
|
157
|
157
|
beego.Router("/api/manage/deleteobjectregistration", &MachineApiController{}, "Get:DeleteObjectTregistration")
|
|
158
|
+
|
|
159
|
+ beego.Router("/api/manage/getregistgoodinforlist", &MachineApiController{}, "Get:GetRegistGoodInforList")
|
|
160
|
+ beego.Router("/api/manage/getregistnumber", &MachineApiController{}, "Get:GetRegistNumber")
|
158
|
161
|
}
|
159
|
162
|
|
160
|
163
|
func (this *MachineApiController) SaveManageInfo() {
|
|
@@ -230,6 +233,7 @@ func (this *MachineApiController) SaveManageInfo() {
|
230
|
233
|
work_time := dataBody["work_time"].(string)
|
231
|
234
|
treat_types := dataBody["treat_type"].([]interface{})
|
232
|
235
|
revers := int64(dataBody["revers_mode"].(float64))
|
|
236
|
+ zone_id := int64(dataBody["zone_id"].(float64))
|
233
|
237
|
ids := make([]int64, 0)
|
234
|
238
|
for _, treat := range treat_types {
|
235
|
239
|
id := int64(treat.(float64))
|
|
@@ -248,7 +252,7 @@ func (this *MachineApiController) SaveManageInfo() {
|
248
|
252
|
DeviceType: device_type,
|
249
|
253
|
BedNumber: number.Number,
|
250
|
254
|
BedId: bed_number,
|
251
|
|
- ZoneId: number.ZoneID,
|
|
255
|
+ ZoneId: zone_id,
|
252
|
256
|
DeviceName: device_name,
|
253
|
257
|
ManufactureFactory: manufacture_factory,
|
254
|
258
|
ServiceManufacturer: service_manufacturer,
|
|
@@ -363,6 +367,7 @@ func (this *MachineApiController) UpdateMachineInfo() {
|
363
|
367
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDialysisNoExist)
|
364
|
368
|
return
|
365
|
369
|
}
|
|
370
|
+ zone_id := int64(dataBody["zone_id"].(float64))
|
366
|
371
|
addmacher := models.DeviceAddmacher{
|
367
|
372
|
ID: id,
|
368
|
373
|
SerialNumber: serial_number,
|
|
@@ -388,6 +393,7 @@ func (this *MachineApiController) UpdateMachineInfo() {
|
388
|
393
|
RubbishReason: rubbish_reason,
|
389
|
394
|
UserYear: user_year,
|
390
|
395
|
WorkTime: work_time,
|
|
396
|
+ ZoneId: zone_id,
|
391
|
397
|
}
|
392
|
398
|
err = service.UpdateMachine(id, orgid, &addmacher)
|
393
|
399
|
errors := service.UpdateTreatMode(id, orgid, ids)
|
|
@@ -490,6 +496,7 @@ func (this *MachineApiController) UpdateMachinetwo() {
|
490
|
496
|
|
491
|
497
|
revers_modes := int64(dataBody["revers_mode"].(float64))
|
492
|
498
|
|
|
499
|
+ zone_id := int64(dataBody["zone_id"].(float64))
|
493
|
500
|
addmacher := models.DeviceAddmacher{
|
494
|
501
|
ID: id,
|
495
|
502
|
SerialNumber: serial_number,
|
|
@@ -516,6 +523,7 @@ func (this *MachineApiController) UpdateMachinetwo() {
|
516
|
523
|
WorkTime: work_time,
|
517
|
524
|
DisinfectionMode: disinfection_mode,
|
518
|
525
|
ReversMode: revers_modes,
|
|
526
|
+ ZoneId: zone_id,
|
519
|
527
|
}
|
520
|
528
|
fmt.Println("addmacher", addmacher)
|
521
|
529
|
err = service.UpdateMachine(id, orgid, &addmacher)
|
|
@@ -2748,32 +2756,20 @@ func (this *MachineApiController) GetTimeWarning() {
|
2748
|
2756
|
func (this *MachineApiController) SaveManageinfoTwo() {
|
2749
|
2757
|
adminUserInfo := this.GetAdminUserInfo()
|
2750
|
2758
|
orgid := adminUserInfo.CurrentOrgId
|
2751
|
|
- fmt.Println("机构id", orgid)
|
2752
|
2759
|
dataBody := make(map[string]interface{}, 0)
|
2753
|
2760
|
err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
2754
|
2761
|
fmt.Println("err", err)
|
2755
|
2762
|
serial_numbe := dataBody["serial_number"].(string)
|
2756
|
|
- fmt.Println("序列号", serial_numbe)
|
2757
|
2763
|
device_type := int64(dataBody["device_type"].(float64))
|
2758
|
|
- fmt.Println("设备类型", device_type)
|
2759
|
|
- //bed_number := dataBody["beds"].(string)
|
2760
|
|
- //fmt.Println("床位号", bed_number)
|
2761
|
2764
|
bed_number := this.GetString("beds")
|
2762
|
2765
|
device_name := dataBody["device_name"].(string)
|
2763
|
|
- fmt.Println("设备名称", device_name)
|
2764
|
2766
|
manufacture_factory := dataBody["manufacture_factory"].(string)
|
2765
|
|
- fmt.Println("生产厂家", manufacture_factory)
|
2766
|
2767
|
service_manufacturer := dataBody["service_manufacturer"].(string)
|
2767
|
|
- fmt.Println("维修厂家", service_manufacturer)
|
2768
|
2768
|
unit_type := int64(dataBody["unit_type"].(float64))
|
2769
|
|
- //unit_type := strconv.FormatInt(unittype, 10)
|
2770
|
|
- //fmt.Println("设备型号", unit_type)
|
2771
|
2769
|
use_section := dataBody["use_section"].(string)
|
2772
|
|
- fmt.Println("使用科室", use_section)
|
2773
|
2770
|
section_number := dataBody["section_number"].(string)
|
2774
|
|
- fmt.Println("科室编号", section_number)
|
2775
|
2771
|
buy_date := dataBody["buy_date"].(string)
|
2776
|
|
- fmt.Println("buy_date", buy_date)
|
|
2772
|
+
|
2777
|
2773
|
timeLayout := "2006-01-02 15:04:05"
|
2778
|
2774
|
theTime, err := utils.ParseTimeStringToTime(timeLayout, buy_date+" 00:00:00")
|
2779
|
2775
|
buydate := theTime.Unix()
|
|
@@ -2781,7 +2777,6 @@ func (this *MachineApiController) SaveManageinfoTwo() {
|
2781
|
2777
|
if int_num < 0 {
|
2782
|
2778
|
buydate = 0
|
2783
|
2779
|
}
|
2784
|
|
- fmt.Println("购买日期", buydate)
|
2785
|
2780
|
|
2786
|
2781
|
install_date := dataBody["install_date"].(string)
|
2787
|
2782
|
toTime, err := utils.ParseTimeStringToTime(timeLayout, install_date+" 00:00:00")
|
|
@@ -2790,7 +2785,6 @@ func (this *MachineApiController) SaveManageinfoTwo() {
|
2790
|
2785
|
if buy_num < 0 {
|
2791
|
2786
|
installdate = 0
|
2792
|
2787
|
}
|
2793
|
|
- fmt.Println("安装日期", installdate)
|
2794
|
2788
|
|
2795
|
2789
|
start_date := dataBody["start_date"].(string)
|
2796
|
2790
|
stringToTime, err := utils.ParseTimeStringToTime(timeLayout, start_date+" 00:00:00")
|
|
@@ -2799,20 +2793,12 @@ func (this *MachineApiController) SaveManageinfoTwo() {
|
2799
|
2793
|
if start_num < 0 {
|
2800
|
2794
|
startdate = 0
|
2801
|
2795
|
}
|
2802
|
|
- fmt.Println("启用日期", startdate)
|
2803
|
|
-
|
2804
|
2796
|
maintenance_engineer := dataBody["maintenance_engineer"].(string)
|
2805
|
|
- fmt.Println("维修工程", maintenance_engineer)
|
2806
|
2797
|
telephone := dataBody["telephone"].(string)
|
2807
|
|
- fmt.Println("telephone", telephone)
|
2808
|
2798
|
guarantee_date := dataBody["guarantee_date"].(string)
|
2809
|
|
- fmt.Println("保修期限", guarantee_date)
|
2810
|
2799
|
machine_status := int64(dataBody["machine_status"].(float64))
|
2811
|
|
- fmt.Println("机器状态", machine_status)
|
2812
|
2800
|
disinfection_mode := int64(dataBody["Disinfection_mode"].(float64))
|
2813
|
|
- fmt.Println("消毒方式", disinfection_mode)
|
2814
|
2801
|
remarks := dataBody["remarks"].(string)
|
2815
|
|
- fmt.Println("备注", remarks)
|
2816
|
2802
|
rubbish_date := dataBody["rubbish_date"].(string)
|
2817
|
2803
|
timeStringToTime, err := utils.ParseTimeStringToTime(timeLayout, rubbish_date+" 00:00:00")
|
2818
|
2804
|
rubbishdate := timeStringToTime.Unix()
|
|
@@ -2820,16 +2806,11 @@ func (this *MachineApiController) SaveManageinfoTwo() {
|
2820
|
2806
|
if rubb_num < 0 {
|
2821
|
2807
|
rubbishdate = 0
|
2822
|
2808
|
}
|
2823
|
|
- fmt.Println("报废日期", rubbishdate)
|
2824
|
2809
|
rubbish_reason := int64(dataBody["rubbish_reason"].(float64))
|
2825
|
|
- fmt.Println("报废原因", rubbish_reason)
|
2826
|
2810
|
user_year := dataBody["user_year"].(string)
|
2827
|
|
- fmt.Println("使用年限", user_year)
|
2828
|
2811
|
work_time := dataBody["work_time"].(string)
|
2829
|
|
- fmt.Println("工作时长", work_time)
|
2830
|
2812
|
revers := int64(dataBody["revers_mode"].(float64))
|
2831
|
|
- fmt.Println("反渗模式", revers)
|
2832
|
|
-
|
|
2813
|
+ zone_id := int64(dataBody["zone_id"].(float64))
|
2833
|
2814
|
addmacher := &models.DeviceAddmacher{
|
2834
|
2815
|
SerialNumber: serial_numbe,
|
2835
|
2816
|
DeviceType: device_type,
|
|
@@ -2857,6 +2838,7 @@ func (this *MachineApiController) SaveManageinfoTwo() {
|
2857
|
2838
|
Status: 1,
|
2858
|
2839
|
Ctime: time.Now().Unix(),
|
2859
|
2840
|
UserOrgId: orgid,
|
|
2841
|
+ ZoneId: zone_id,
|
2860
|
2842
|
}
|
2861
|
2843
|
err = service.CreateMacher(addmacher)
|
2862
|
2844
|
fmt.Println("什么原因啊", err)
|
|
@@ -3646,6 +3628,7 @@ func (this *MachineApiController) GetAllDoctorList() {
|
3646
|
3628
|
appId := this.GetAdminUserInfo().CurrentAppId
|
3647
|
3629
|
list, err := service.GetAllDoctorTwo(orgId, appId)
|
3648
|
3630
|
operators, err := service.GetAdminUserEsOne(orgId)
|
|
3631
|
+
|
3649
|
3632
|
if err != nil {
|
3650
|
3633
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)
|
3651
|
3634
|
return
|
|
@@ -5692,3 +5675,42 @@ func (this *MachineApiController) DeleteObjectTregistration() {
|
5692
|
5675
|
})
|
5693
|
5676
|
return
|
5694
|
5677
|
}
|
|
5678
|
+
|
|
5679
|
+func (this *MachineApiController) GetRegistGoodInforList() {
|
|
5680
|
+
|
|
5681
|
+ orgId := this.GetAdminUserInfo().CurrentOrgId
|
|
5682
|
+
|
|
5683
|
+ list, err := service.GetRegistGoodInforList(orgId)
|
|
5684
|
+
|
|
5685
|
+ if err != nil {
|
|
5686
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)
|
|
5687
|
+ return
|
|
5688
|
+ }
|
|
5689
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
5690
|
+ "list": list,
|
|
5691
|
+ })
|
|
5692
|
+ return
|
|
5693
|
+}
|
|
5694
|
+
|
|
5695
|
+func (this *MachineApiController) GetRegistNumber() {
|
|
5696
|
+
|
|
5697
|
+ id, _ := this.GetInt64("id")
|
|
5698
|
+ record_date := this.GetString("record_date")
|
|
5699
|
+ timeLayout := "2006-01-02"
|
|
5700
|
+ loc, _ := time.LoadLocation("Local")
|
|
5701
|
+ dataBody := make(map[string]interface{}, 0)
|
|
5702
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
5703
|
+ fmt.Println(err)
|
|
5704
|
+ recorddate, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
|
|
5705
|
+ recorddateunix := recorddate.Unix()
|
|
5706
|
+ orgId := this.GetAdminUserInfo().CurrentOrgId
|
|
5707
|
+ infor, err := service.GetRegistNumber(recorddateunix, id, orgId)
|
|
5708
|
+ if err != nil {
|
|
5709
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)
|
|
5710
|
+ return
|
|
5711
|
+ }
|
|
5712
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
5713
|
+ "list": infor,
|
|
5714
|
+ })
|
|
5715
|
+ return
|
|
5716
|
+}
|