|
@@ -409,25 +409,22 @@ public class IotXycbController extends BaseController
|
|
|
*
|
|
*
|
|
|
* 删除图片
|
|
* 删除图片
|
|
|
*/
|
|
*/
|
|
|
- @DeleteMapping("/image/delete/{xycbimgBid}")
|
|
|
|
|
- public AjaxResult imageDelete(@PathVariable String xycbimgBid){
|
|
|
|
|
|
|
+ @DeleteMapping("/image/delete")
|
|
|
|
|
+ public AjaxResult imageDelete(@RequestParam String[] xycbimgBids){
|
|
|
// 调用通用方法必须有设备devBid, 否则无法定位到具体是那个实现类
|
|
// 调用通用方法必须有设备devBid, 否则无法定位到具体是那个实现类
|
|
|
// 没有devBid 的情况下,实现可以写道Controller层
|
|
// 没有devBid 的情况下,实现可以写道Controller层
|
|
|
- Map<String, String> selectMap = new HashMap<>();
|
|
|
|
|
- selectMap.put("xycbimgBid", xycbimgBid);
|
|
|
|
|
- IotXycbimg iotXycbimg = (IotXycbimg) mongoService.findOne(IotXycbimg.class, selectMap, null, null);
|
|
|
|
|
- if(iotXycbimg == null){
|
|
|
|
|
- throw new IotBizException(IotErrorCode.INVALID_DEVICE_ID.getCode(), "图片不存在");
|
|
|
|
|
|
|
+ if(xycbimgBids == null || xycbimgBids.length < 1){
|
|
|
|
|
+ throw new IotBizException(IotErrorCode.PARAM_INVALID.getCode(),"参数不能为空");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- Criteria criteria = Criteria.where("xycbimgBid").is(xycbimgBid);
|
|
|
|
|
|
|
+ List<String> xycbimgBidsList = Arrays.asList(xycbimgBids);
|
|
|
|
|
+ Criteria criteria = Criteria.where("xycbimgBid").in(xycbimgBidsList);
|
|
|
Query query = new Query(criteria);
|
|
Query query = new Query(criteria);
|
|
|
|
|
|
|
|
Map<String, Object> updateField = new HashMap<>();
|
|
Map<String, Object> updateField = new HashMap<>();
|
|
|
updateField.put("xycbimgDelstatus", "1");
|
|
updateField.put("xycbimgDelstatus", "1");
|
|
|
updateField.put("xycbimgModifieddate", DateUtils.dateTimeNow());
|
|
updateField.put("xycbimgModifieddate", DateUtils.dateTimeNow());
|
|
|
|
|
|
|
|
- mongoService.update(IotXycbimg.class, query, updateField);
|
|
|
|
|
- return AjaxResult.success();
|
|
|
|
|
|
|
+ int status = mongoService.updateMulti(IotXycbimg.class, query, updateField);
|
|
|
|
|
+ return toAjax(status);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|