XMLWAN 3 年 前
コミット
b327fe93d1

+ 7 - 6
controllers/mobile_api_controllers/dialysis_api_controller.go ファイルの表示

@@ -4632,13 +4632,14 @@ func (c *DialysisAPIController) GetMobilePrintStockGood() {
4632 4632
 func (c *DialysisAPIController) BatchDeleteMonitor() {
4633 4633
 	dataBody := make(map[string]interface{}, 0)
4634 4634
 	err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
4635
-	idsInt := dataBody["ids"].([]interface{})
4636
-	ids := make([]int64, 0)
4637
-	for _, item := range idsInt {
4638
-		id, _ := strconv.ParseInt(item.(string), 10, 64)
4639
-		ids = append(ids, id)
4635
+	ids := c.GetString("ids")
4636
+	if len(ids) == 0 {
4637
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
4638
+		return
4640 4639
 	}
4641
-	err = service.BatchDeleteMonitor(ids)
4640
+
4641
+	idArray := strings.Split(ids, ",")
4642
+	err = service.BatchDeleteMonitor(idArray)
4642 4643
 	fmt.Print("err", err)
4643 4644
 	c.ServeSuccessJSON(map[string]interface{}{
4644 4645
 		"msg": "批量删除成功",

+ 1 - 1
controllers/mobile_api_controllers/mobile_api_router_register.go ファイルの表示

@@ -144,5 +144,5 @@ func MobileAPIControllersRegisterRouters() {
144 144
 	//获取单个患者1年的透析日期
145 145
 	beego.Router("/m/api/getPatientDialysisRecord", &DialysisAPIController{}, "Get:GetPatientDialysisRecord")
146 146
 	//批量删除医嘱
147
-	beego.Router("/m/api/batchDeleteAdvice", &DialysisAPIController{}, "Post:BathDeleteAdvice:")
147
+	//beego.Router("/m/api/batchDeleteAdvice", &DialysisAPIController{}, "Post:BathDeleteAdvice:")
148 148
 }

+ 1 - 1
service/mobile_dialysis_service.go ファイルの表示

@@ -1939,7 +1939,7 @@ func GetHisDoctorAdvicesOne(orgID int64, scheduleDate int64, deliverWay string,
1939 1939
 	return vms, err
1940 1940
 }
1941 1941
 
1942
-func BatchDeleteMonitor(ids []int64) (err error) {
1942
+func BatchDeleteMonitor(ids []string) (err error) {
1943 1943
 
1944 1944
 	if len(ids) == 1 {
1945 1945
 		err = XTWriteDB().Model(&models.MonitoringRecord{}).Where("id=?", ids[0]).Updates(map[string]interface{}{"status": 0, "updated_time": time.Now().Unix()}).Error