|
|
@@ -41,6 +41,7 @@ import com.kxs.user.api.model.KxsUser;
|
|
|
import com.kxs.user.api.model.KxsUserAdvance;
|
|
|
import io.seata.spring.annotation.GlobalTransactional;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@@ -60,6 +61,7 @@ import java.util.stream.Collectors;
|
|
|
*/
|
|
|
@Service("kxsMachineApplyService")
|
|
|
@RequiredArgsConstructor
|
|
|
+@Slf4j
|
|
|
public class KxsMachineApplyServiceImpl extends ServiceImpl<KxsMachineApplyMapper, KxsMachineApply> implements KxsMachineApplyService {
|
|
|
|
|
|
private final KxsMachineApplyDetailMapper kxsMachineApplyDetailMapper;
|
|
|
@@ -300,13 +302,13 @@ public class KxsMachineApplyServiceImpl extends ServiceImpl<KxsMachineApplyMappe
|
|
|
baseMapper.insert(order);
|
|
|
for (int i = 0; i < param.getSnList().size(); i++) {
|
|
|
|
|
|
+ String sn = param.getSnList().get(i);
|
|
|
+
|
|
|
//查询广电的虚拟SN在库
|
|
|
R<KxsMachine> machineResult = remoteKxsProductService.loadByWhsGdSn(whsId, SecurityConstants.FROM_IN);
|
|
|
KxsMachine machine = RetOps.of(machineResult)
|
|
|
.getData()
|
|
|
.orElseThrow(() -> new GlobalCustomerException(StoreErrorTypeEnum.MACHINE_IS_NULL.getDescription()));
|
|
|
-
|
|
|
- String sn = param.getSnList().get(i);
|
|
|
//新增订单详情
|
|
|
KxsMachineApplyDetail orderDetail = new KxsMachineApplyDetail();
|
|
|
orderDetail.setOrderId(order.getId());
|
|
|
@@ -316,7 +318,6 @@ public class KxsMachineApplyServiceImpl extends ServiceImpl<KxsMachineApplyMappe
|
|
|
KxsTicket ticket = RetOps.of(ticketResult)
|
|
|
.getData()
|
|
|
.orElseThrow(() -> new GlobalCustomerException(StoreErrorTypeEnum.TICKET_NOT_FIND.getDescription()));
|
|
|
-
|
|
|
//券码被使用返回错误
|
|
|
if (!ticket.getStatus().equals(TicketStatusEnum.TICKET_UNUSED.getType())) {
|
|
|
throw new GlobalCustomerException(StoreErrorTypeEnum.TICKET_CODE_UN.getDescription());
|
|
|
@@ -347,7 +348,7 @@ public class KxsMachineApplyServiceImpl extends ServiceImpl<KxsMachineApplyMappe
|
|
|
throw new GlobalCustomerException(ErrorTypeEnum.REMOTE_DATA_ERROR.getDescription());
|
|
|
}
|
|
|
}
|
|
|
- //发货统计
|
|
|
+// 发货统计
|
|
|
kxsSendTotalService.shipmentStatistics(param.getSnList().size(), whsId, order.getBrandId());
|
|
|
|
|
|
return R.ok();
|