|
|
|
@ -1,15 +1,26 @@ |
|
|
|
|
package com.bellmann.service.impl; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import com.bellmann.common.base.BasePageQuery; |
|
|
|
|
import com.bellmann.common.base.IBaseEnum; |
|
|
|
|
import com.bellmann.common.enums.ServiceFlagEnum; |
|
|
|
|
import com.bellmann.common.result.PageResult; |
|
|
|
|
import com.bellmann.common.result.Result; |
|
|
|
|
import com.bellmann.converter.OrderServiceConverter; |
|
|
|
|
import com.bellmann.mapper.OrderInfoDetailMapper; |
|
|
|
|
import com.bellmann.mapper.OrderServiceMapper; |
|
|
|
|
import com.bellmann.model.entity.OrderInfoDetail; |
|
|
|
|
import com.bellmann.model.entity.OrderService; |
|
|
|
|
import com.bellmann.model.vo.OrderInfoBusinessVO; |
|
|
|
|
import com.bellmann.model.vo.OrderServiceVO; |
|
|
|
|
import com.bellmann.service.OrderServiceService; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* <p> |
|
|
|
@ -26,12 +37,54 @@ public class OrderServiceServiceImpl implements OrderServiceService { |
|
|
|
|
private final OrderServiceMapper orderServiceMapper; |
|
|
|
|
|
|
|
|
|
private final OrderServiceConverter orderServiceConverter; |
|
|
|
|
|
|
|
|
|
private final OrderInfoDetailMapper orderInfoDetailMapper; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public PageResult<OrderInfoBusinessVO> orderInfoBusinessPage(BasePageQuery query, Long orderId) { |
|
|
|
|
int pageNum = query.getPageNum(); |
|
|
|
|
int pageSize = query.getPageSize(); |
|
|
|
|
Page<OrderService> page = new Page<>(pageNum,pageSize); |
|
|
|
|
Page<OrderService> dataPage = orderServiceMapper.orderInfoBusinessPage(page,orderId); |
|
|
|
|
Page<OrderService> page = new Page<>(pageNum, pageSize); |
|
|
|
|
Page<OrderService> dataPage = orderServiceMapper.orderInfoBusinessPage(page, orderId); |
|
|
|
|
return PageResult.success(orderServiceConverter.entity2PageVo(dataPage)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public PageResult<OrderServiceVO> orderServiceParameterPage(BasePageQuery query, Long orderId, String service) { |
|
|
|
|
int pageNum = query.getPageNum(); |
|
|
|
|
int pageSize = query.getPageSize(); |
|
|
|
|
Page<OrderService> page = new Page<>(pageNum, pageSize); |
|
|
|
|
Page<OrderService> voPage = orderServiceMapper.selectPage(page, new LambdaQueryWrapper<OrderService>() |
|
|
|
|
.eq(OrderService::getOrderId, orderId) |
|
|
|
|
.eq(OrderService::getService, service) |
|
|
|
|
); |
|
|
|
|
return PageResult.success(orderServiceConverter.entity2VOPage(voPage)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@Transactional |
|
|
|
|
public Result<String> updateOrderServiceParameter(List<OrderServiceVO> list, Long orderId, String service, String serviceFlag) { |
|
|
|
|
|
|
|
|
|
int rows = orderServiceMapper.delete(new LambdaQueryWrapper<OrderService>() |
|
|
|
|
.eq(OrderService::getService, service) |
|
|
|
|
.eq(OrderService::getOrderId, orderId) |
|
|
|
|
); |
|
|
|
|
if (rows > 0) { |
|
|
|
|
List<OrderService> serviceList = orderServiceConverter.vos2Entities(list); |
|
|
|
|
for (OrderService orderService : serviceList) { |
|
|
|
|
orderService.setServiceId(-999L); |
|
|
|
|
orderService.setServiceFlag((String) IBaseEnum.getValueByLabel(serviceFlag, ServiceFlagEnum.class)); |
|
|
|
|
orderServiceMapper.insert(orderService); |
|
|
|
|
if (orderService.getArgsName().equals("user_tid") || orderService.getArgsName().equals("rg_port_id")) { |
|
|
|
|
orderInfoDetailMapper.update(null, |
|
|
|
|
new LambdaUpdateWrapper<OrderInfoDetail>() |
|
|
|
|
.eq(OrderInfoDetail::getOrderId, orderService.getOrderId()) |
|
|
|
|
.set(OrderInfoDetail::getDetailRemark3, orderService.getArgsValueNew()) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return Result.success(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|