use of dataaccess.ex1.entity.Order in project jmix-docs by Haulmont.
the class Canvas method drawGeometry.
protected void drawGeometry() {
Order order = ordersTable.getSingleSelected();
CanvasLayer canvasLayer = map.getCanvas();
CanvasLayer.Point location = canvasLayer.addPoint(order.getLocation());
location.setStyle(geometryStyles.point().withFontIcon(JmixIcon.HOME).setIconPathFillColor("#f4d142").setIconTextFillColor("black").setIconPathStrokeColor("black")).setEditable(true);
}
use of dataaccess.ex1.entity.Order in project jmix-docs by Haulmont.
the class TaskAssignedNotificationSender2 method onOtherProcessTaskAssigned.
@EventListener
public void onOtherProcessTaskAssigned(UserTaskAssignedEvent event) {
Order order = (Order) runtimeService.getVariable(event.getTask().getExecutionId(), "order");
// ...
// end::get-variable-1[]
User user = dataManager.load(User.class).query("select u from smpl_User u where u.username = :username").parameter("username", event.getUsername()).one();
Task task = event.getTask();
String emailTitle = "New process task " + task.getName();
String emailBody = "Hi " + user.getFirstName() + "\n" + "The task " + task.getName() + " has been assigned.";
EmailInfo emailInfo = EmailInfoBuilder.create().setAddresses(user.getEmail()).setSubject(emailTitle).setFrom(null).setBody(emailBody).build();
emailer.sendEmailAsync(emailInfo);
// tag::get-variable-2[]
}
use of dataaccess.ex1.entity.Order in project Today-I-Learn by kha0213.
the class OrderServiceTest method 주문취소.
@Test
public void 주문취소() throws Exception {
// given
Member member = createMember();
Item book = createBook("JPA입문", 15000, 5);
int orderCount = 2;
// when
Long orderId = orderService.order(member.getId(), book.getId(), orderCount);
orderService.cancelOrder(orderId);
// then
Order getOrder = orderRepository.findOne(orderId);
// 주문 취소 상태 검증
assertEquals(OrderStatus.CANCEL, getOrder.getStatus());
// 재고 원복 검증
assertEquals(5, book.getStockQuantity());
}
Aggregations