Commit b5c88ab3 by 王璐琦 Committed by 崔彦峰

fix(upgrade): 修正商品升级服务中的错误枚举

- 将 DefaultErrorEnum.SERVICE_ERROR 替换为 DefaultErrorEnum.SERVER_ERROR
- 确保错误处理与服务器端错误分类一致
1 parent 0aef0776
......@@ -142,7 +142,7 @@ public class UpgradeGoodsRemoteImpl implements UpgradeGoodsRemote {
if (upgradeGoodsDTO != null) {
List<UpgradeGoodsDTO> list = upgradeGoodsService.listByBaseGoodsId(upgradeGoodsDTO.getBaseGoodsId(), null);
if (CollectionUtils.isNotEmpty(list) && list.size() <= 1) {
throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, "当前sku是spu的最后一条数据,不能删除");
throw new RpcServiceException(DefaultErrorEnum.SERVER_ERROR, "当前sku是spu的最后一条数据,不能删除");
}
}
......
......@@ -485,7 +485,8 @@ public class GoodsOrderService {
.orderStatus(record.getStatus()).createdBy(record.getCreatedBy()).build();
orderStatusRecordService.add(orderStatusRecord);
goodsOrderMapper.insertUseGeneratedKeys(record);
//goodsOrderMapper.insertUseGeneratedKeys(record);
goodsOrderMapper.insertSelective(record);
return record;
} catch (RpcServiceException e) {
throw e;
......@@ -568,7 +569,8 @@ public class GoodsOrderService {
// 补充businessType字段
compileOrderBusinessType(record);
// 存储主订单信息
goodsOrderMapper.insertUseGeneratedKeys(record);
//goodsOrderMapper.insertUseGeneratedKeys(record);
goodsOrderMapper.insertSelective(record);
// 保存订单状态变更记录
orderStatusRecordService.saveOrderStatusRecord(record);
// 后续处理-异步
......@@ -4309,7 +4311,8 @@ public class GoodsOrderService {
// 保存客户信息
goodsOrderCustomerService.insertByOrderInfo(record);
// 存储主订单信息
goodsOrderMapper.insertUseGeneratedKeys(record);
//goodsOrderMapper.insertUseGeneratedKeys(record);
goodsOrderMapper.insertSelective(record);
// 保存订单状态变更记录
orderStatusRecordService.saveOrderStatusRecord(record);
orderAfterWorkExecuteService.handleCreateOrder(record.getOrderCode());
......@@ -4436,7 +4439,8 @@ public class GoodsOrderService {
goodsOrderCustomerService.insertByOrderInfo(record);
//存储主订单信息
if (oldOrder == null) {
goodsOrderMapper.insertUseGeneratedKeys(record);
//goodsOrderMapper.insertUseGeneratedKeys(record);
goodsOrderMapper.insertSelective(record);
} else {
record.setId(oldOrder.getId());
goodsOrderMapper.updateByPrimaryKeySelective(record);
......@@ -4951,7 +4955,8 @@ public class GoodsOrderService {
goodsOrderCustomerService.insertByOrderInfo(record);
//存储主订单信息
if (oldOrder == null) {
goodsOrderMapper.insertUseGeneratedKeys(record);
//goodsOrderMapper.insertUseGeneratedKeys(record);
goodsOrderMapper.insertSelective(record);
} else {
record.setId(oldOrder.getId());
goodsOrderMapper.updateByPrimaryKeySelective(record);
......
......@@ -291,7 +291,7 @@ public class PayOrderService {
payOrder.setServiceCharge(BigDecimal.ZERO);
payOrder.setActualIncomeMoney(payOrder.getActualMoney().subtract(payOrder.getServiceCharge()));
//特殊订单类型判断
if(Objects.equals(DjOrderTypeEnum.NORMAL.getValue(), goodsOrder.getDjOrderType())){
if(ObjectUtil.isNull(goodsOrder.getDjOrderType()) || Objects.equals(DjOrderTypeEnum.NORMAL.getValue(), goodsOrder.getDjOrderType())){
if (Objects.equals(SceneTypeEnum.SCENE1_0.getValue(), goodsOrder.getSceneType())
&& Objects.equals(ZYVoucherStatusEnum.WAIT_TO_UPLOAD.getValue(), payOrder.getZyVoucherStatus())) {
o.setStatus(OrderStatus.WAIT_UPLOAD.getValue());
......@@ -955,7 +955,7 @@ public class PayOrderService {
o.setInstallUpgradeTime(now);
o.setOrderCode(orderCode);
o.setUpdatedBy(payOrder.getUpdatedBy());
if(Objects.equals(DjOrderTypeEnum.NORMAL.getValue(),goodsOrder.getDjOrderType())){
if(ObjectUtil.isNull(goodsOrder.getDjOrderType()) || Objects.equals(DjOrderTypeEnum.NORMAL.getValue(),goodsOrder.getDjOrderType())){
if (Objects.equals(SceneTypeEnum.SCENE1_0.getValue(), goodsOrder.getSceneType())
&& Objects.equals(ZYVoucherStatusEnum.WAIT_TO_UPLOAD.getValue(), p.getZyVoucherStatus())) {
o.setStatus(OrderStatus.WAIT_UPLOAD.getValue());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!