|
|
@@ -123,11 +123,12 @@ public class WxMsgServiceImpl implements WxMsgService { |
|
|
|
|
|
|
|
|
//新增记录 |
|
|
//新增记录 |
|
|
if (wxMsg.getId() == null) { |
|
|
if (wxMsg.getId() == null) { |
|
|
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
|
|
wxMsg.setId(idWorker.nextId()); |
|
|
|
|
|
wxMsg.setCreatetime(new Date()); |
|
|
//草稿 |
|
|
//草稿 |
|
|
if (wxMsg.getStatus().equals(EnumMsgStatus.MSG_STATUS_DRAFT.getCode())) { |
|
|
if (wxMsg.getStatus().equals(EnumMsgStatus.MSG_STATUS_DRAFT.getCode())) { |
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
|
|
wxMsg.setId(idWorker.nextId()); |
|
|
|
|
|
wxMsg.setCreatetime(new Date()); |
|
|
|
|
|
|
|
|
|
|
|
wxMsgMapper.insert(wxMsg); |
|
|
wxMsgMapper.insert(wxMsg); |
|
|
return new ResultData(Result.SUCCESS, "已保存到草稿箱"); |
|
|
return new ResultData(Result.SUCCESS, "已保存到草稿箱"); |
|
|
|
|
|
|
|
|
@@ -155,19 +156,12 @@ public class WxMsgServiceImpl implements WxMsgService { |
|
|
return new ResultData(ErrorCode.MSG_REQUEST_PARAMS_ERROR); |
|
|
return new ResultData(ErrorCode.MSG_REQUEST_PARAMS_ERROR); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
|
|
wxMsg.setId(idWorker.nextId()); |
|
|
|
|
|
wxMsg.setCreatetime(new Date()); |
|
|
|
|
|
wxMsgMapper.insert(wxMsg); |
|
|
wxMsgMapper.insert(wxMsg); |
|
|
return new ResultData(Result.SUCCESS, "消息已发送"); |
|
|
return new ResultData(Result.SUCCESS, "消息已发送"); |
|
|
} else { |
|
|
} else { |
|
|
wxMsg.setStatus(EnumMsgStatus.MSG_STATUS_NOT_SEND.getCode()); |
|
|
wxMsg.setStatus(EnumMsgStatus.MSG_STATUS_NOT_SEND.getCode()); |
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
|
|
long id = idWorker.nextId(); |
|
|
|
|
|
wxMsg.setId(id); |
|
|
|
|
|
wxMsg.setCreatetime(new Date()); |
|
|
|
|
|
wxMsgMapper.insert(wxMsg); |
|
|
wxMsgMapper.insert(wxMsg); |
|
|
return new ResultData(Result.SUCCESS, "消息会在预设时间发送", id); |
|
|
|
|
|
|
|
|
return new ResultData(Result.SUCCESS, "消息会在预设时间发送", wxMsg.getId()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
@@ -195,10 +189,7 @@ public class WxMsgServiceImpl implements WxMsgService { |
|
|
}else{ |
|
|
}else{ |
|
|
return new ResultData(ErrorCode.MSG_REQUEST_PARAMS_ERROR); |
|
|
return new ResultData(ErrorCode.MSG_REQUEST_PARAMS_ERROR); |
|
|
} |
|
|
} |
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
|
|
wxMsg.setId(idWorker.nextId()); |
|
|
|
|
|
wxMsg.setCreatetime(new Date()); |
|
|
|
|
|
wxMsgMapper.insert(wxMsg); |
|
|
|
|
|
|
|
|
wxMsgMapper.updateById(wxMsg); |
|
|
return new ResultData(Result.SUCCESS, "消息已发送"); |
|
|
return new ResultData(Result.SUCCESS, "消息已发送"); |
|
|
} else { |
|
|
} else { |
|
|
//定时 |
|
|
//定时 |
|
|
|