use of com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper in project GMall by 18391713434.
the class OrderServiceImpl method updateOrderStatus.
@Override
public void updateOrderStatus(String out_trade_no) {
// 发送订单已支付的队列提供给库存
Connection connection = null;
Session session = null;
try {
connection = activeMQUtil.getConnectionFactory().createConnection();
session = connection.createSession(true, Session.SESSION_TRANSACTED);
} catch (Exception e) {
e.printStackTrace();
}
try {
OmsOrder omsOrder = new OmsOrder();
omsOrder.setStatus(1);
orderMapper.update(omsOrder, new UpdateWrapper<OmsOrder>().eq("out_trade_no", out_trade_no));
// 调用mq发送支付成功的消息
Queue order_pay_quene = session.createQueue("ORDER_PAY_QUENE");
MessageProducer producer = session.createProducer(order_pay_quene);
// 字符串文本
TextMessage textMessage = new ActiveMQTextMessage();
// hash结构
MapMessage mapMessage = new ActiveMQMapMessage();
mapMessage.setString("out_trade_no", out_trade_no);
session.commit();
} catch (Exception e) {
// 消息回滚
try {
session.rollback();
} catch (Exception e1) {
e1.printStackTrace();
}
} finally {
try {
connection.close();
} catch (JMSException e) {
e.printStackTrace();
}
}
}
use of com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper in project kms by mahonelau.
the class SysBaseApiImpl method updateSysAnnounReadFlag.
@Override
public void updateSysAnnounReadFlag(String busType, String busId) {
SysAnnouncement announcement = sysAnnouncementMapper.selectOne(new QueryWrapper<SysAnnouncement>().eq("bus_type", busType).eq("bus_id", busId));
if (announcement != null) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String userId = sysUser.getId();
LambdaUpdateWrapper<SysAnnouncementSend> updateWrapper = new UpdateWrapper().lambda();
updateWrapper.set(SysAnnouncementSend::getReadFlag, CommonConstant.HAS_READ_FLAG);
updateWrapper.set(SysAnnouncementSend::getReadTime, new Date());
updateWrapper.last("where annt_id ='" + announcement.getId() + "' and user_id ='" + userId + "'");
SysAnnouncementSend announcementSend = new SysAnnouncementSend();
sysAnnouncementSendMapper.update(announcementSend, updateWrapper);
}
}
use of com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper in project kykms by mahonelau.
the class SysBaseApiImpl method updateSysAnnounReadFlag.
@Override
public void updateSysAnnounReadFlag(String busType, String busId) {
SysAnnouncement announcement = sysAnnouncementMapper.selectOne(new QueryWrapper<SysAnnouncement>().eq("bus_type", busType).eq("bus_id", busId));
if (announcement != null) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String userId = sysUser.getId();
LambdaUpdateWrapper<SysAnnouncementSend> updateWrapper = new UpdateWrapper().lambda();
updateWrapper.set(SysAnnouncementSend::getReadFlag, CommonConstant.HAS_READ_FLAG);
updateWrapper.set(SysAnnouncementSend::getReadTime, new Date());
updateWrapper.last("where annt_id ='" + announcement.getId() + "' and user_id ='" + userId + "'");
SysAnnouncementSend announcementSend = new SysAnnouncementSend();
sysAnnouncementSendMapper.update(announcementSend, updateWrapper);
}
}
use of com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper in project kykms by mahonelau.
the class SysAnnouncementSendController method readAll.
/**
* @功能:一键已读
* @return
*/
@PutMapping(value = "/readAll")
public Result<SysAnnouncementSend> readAll() {
Result<SysAnnouncementSend> result = new Result<SysAnnouncementSend>();
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String userId = sysUser.getId();
LambdaUpdateWrapper<SysAnnouncementSend> updateWrapper = new UpdateWrapper().lambda();
updateWrapper.set(SysAnnouncementSend::getReadFlag, CommonConstant.HAS_READ_FLAG);
updateWrapper.set(SysAnnouncementSend::getReadTime, new Date());
updateWrapper.last("where user_id ='" + userId + "'");
SysAnnouncementSend announcementSend = new SysAnnouncementSend();
sysAnnouncementSendService.update(announcementSend, updateWrapper);
result.setSuccess(true);
result.setMessage("全部已读");
return result;
}
use of com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper in project springboot-cli by liangqiding.
the class UserServiceImpl method updUser.
@Override
public boolean updUser(User user) {
StrUtil.isNotBlank(user.getPassword());
UpdateWrapper<User> set = new UpdateWrapper<User>().eq("user_id", user.getUserId()).set(StrUtil.isNotBlank(user.getPassword()), "password", user.getPassword()).set(StrUtil.isNotBlank(user.getUsername()), "username", user.getUsername()).set("updated_date", new Date());
return this.update(set);
}
Aggregations