| | |
| | | import com.oying.modules.sh.domain.Order; |
| | | import com.oying.modules.sh.domain.OrderAddressSnapshot; |
| | | import com.oying.modules.sh.domain.OrderOperationLog; |
| | | import com.oying.modules.sh.domain.vo.OrderResponse; |
| | | import com.oying.modules.sh.mapper.OrderMapper; |
| | | import com.oying.utils.*; |
| | | import com.oying.utils.enums.OrderStatusEnum; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | public class OrderOperationLogServiceImpl extends ServiceImpl<OrderOperationLogMapper, OrderOperationLog> implements OrderOperationLogService { |
| | | |
| | | private final OrderOperationLogMapper orderOperationLogMapper; |
| | | private final OrderMapper orderMapper; |
| | | |
| | | @Override |
| | | public PageResult<OrderOperationLog> queryAll(OrderOperationLogQueryCriteria criteria, Page<Object> page) { |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void create(Order order, OrderAddressSnapshot addressSnapshot) { |
| | | Map<String, Object> map = new LinkedHashMap<>(); |
| | | map.put("order", order); |
| | | map.put("address", addressSnapshot); |
| | | OrderResponse response = new OrderResponse(); |
| | | response.setOrder(order); |
| | | response.setAddress(addressSnapshot); |
| | | String username = SecurityUtils.getCurrentUsername(); |
| | | Timestamp time = new Timestamp(System.currentTimeMillis()); |
| | | OrderOperationLog resources = new OrderOperationLog(); |
| | |
| | | resources.setOperation(OrderStatusEnum.ZERO.getKey()); |
| | | resources.setOperationDescribe(OrderStatusEnum.ZERO.getValue()); |
| | | resources.setRemark(username + ":" + time + ">" + OrderStatusEnum.ZERO.getValue() + ":" + order.getOrderNum()); |
| | | resources.setSnapshotData(JSON.toJSONString(map)); |
| | | resources.setSnapshotData(JSON.toJSONString(response)); |
| | | resources.setOperationTime(time); |
| | | } |
| | | |