Commit 2b445f03 authored by jiaorz's avatar jiaorz

Merge branch 'master-modify-cutAmount' into base-modify

parents 2386865d 3c5379aa
......@@ -18,6 +18,8 @@ public class ResultCode {
//IM消息删除失败
public static int IM_DELETE_FAIL_CODE = Integer.valueOf(SystemProperty.getResultConfig("IM_DELETE_FAIL_CODE"));
public static int IM_MSG_NOT_EXIST_CODE = Integer.valueOf(SystemProperty.getResultConfig("IM_MSG_NOT_EXIST_CODE"));
// 车辆预定失败,请重试
public static int BOOKED_FAILED_CODE = Integer.valueOf(SystemProperty.getResultConfig("BOOKED_FAILED_CODE"));
//预定时间不能为空 DATE_TIME_IS_NULL
......
......@@ -8,6 +8,8 @@ FAILED_CODE=1001
1001=操作失败
IM_DELETE_FAIL_CODE = 10011
10011 = 删除消息失败
IM_MSG_NOT_EXIST_CODE = 10012
10012 = 消息不存在
#数据已存在
EXIST_CODE=1002
1002=数据已存在
......
......@@ -183,6 +183,10 @@ public class MsgBiz {
set.addAll(list);
Query query = new Query(Criteria.where("id").in(set));
query.addCriteria(Criteria.where("userId").is(userId));
List<Msg> msgList = mongoTemplate.find(query, Msg.class, "s_msg");
if(msgList.size() != set.size()) { //查询到的消息条数不等于查询的Id数
return ObjectRestResponse.createFailedResult(ResultCode.IM_DELETE_FAIL_CODE, ResultCode.getMsg(ResultCode.IM_DELETE_FAIL_CODE));
}
DeleteResult deleteResult = mongoTemplate.remove(query, Msg.class, "s_msg");
if (deleteResult != null && deleteResult.getDeletedCount() == set.size()) {
return ObjectRestResponse.succ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment