|
@@ -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": "批量删除成功",
|