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 { ...@@ -142,7 +142,7 @@ public class UpgradeGoodsRemoteImpl implements UpgradeGoodsRemote {
if (upgradeGoodsDTO != null) { if (upgradeGoodsDTO != null) {
List<UpgradeGoodsDTO> list = upgradeGoodsService.listByBaseGoodsId(upgradeGoodsDTO.getBaseGoodsId(), null); List<UpgradeGoodsDTO> list = upgradeGoodsService.listByBaseGoodsId(upgradeGoodsDTO.getBaseGoodsId(), null);
if (CollectionUtils.isNotEmpty(list) && list.size() <= 1) { 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 { ...@@ -485,7 +485,8 @@ public class GoodsOrderService {
.orderStatus(record.getStatus()).createdBy(record.getCreatedBy()).build(); .orderStatus(record.getStatus()).createdBy(record.getCreatedBy()).build();
orderStatusRecordService.add(orderStatusRecord); orderStatusRecordService.add(orderStatusRecord);
goodsOrderMapper.insertUseGeneratedKeys(record); //goodsOrderMapper.insertUseGeneratedKeys(record);
goodsOrderMapper.insertSelective(record);
return record; return record;
} catch (RpcServiceException e) { } catch (RpcServiceException e) {
throw e; throw e;
...@@ -568,7 +569,8 @@ public class GoodsOrderService { ...@@ -568,7 +569,8 @@ public class GoodsOrderService {
// 补充businessType字段 // 补充businessType字段
compileOrderBusinessType(record); compileOrderBusinessType(record);
// 存储主订单信息 // 存储主订单信息
goodsOrderMapper.insertUseGeneratedKeys(record); //goodsOrderMapper.insertUseGeneratedKeys(record);
goodsOrderMapper.insertSelective(record);
// 保存订单状态变更记录 // 保存订单状态变更记录
orderStatusRecordService.saveOrderStatusRecord(record); orderStatusRecordService.saveOrderStatusRecord(record);
// 后续处理-异步 // 后续处理-异步
...@@ -4309,7 +4311,8 @@ public class GoodsOrderService { ...@@ -4309,7 +4311,8 @@ public class GoodsOrderService {
// 保存客户信息 // 保存客户信息
goodsOrderCustomerService.insertByOrderInfo(record); goodsOrderCustomerService.insertByOrderInfo(record);
// 存储主订单信息 // 存储主订单信息
goodsOrderMapper.insertUseGeneratedKeys(record); //goodsOrderMapper.insertUseGeneratedKeys(record);
goodsOrderMapper.insertSelective(record);
// 保存订单状态变更记录 // 保存订单状态变更记录
orderStatusRecordService.saveOrderStatusRecord(record); orderStatusRecordService.saveOrderStatusRecord(record);
orderAfterWorkExecuteService.handleCreateOrder(record.getOrderCode()); orderAfterWorkExecuteService.handleCreateOrder(record.getOrderCode());
...@@ -4436,7 +4439,8 @@ public class GoodsOrderService { ...@@ -4436,7 +4439,8 @@ public class GoodsOrderService {
goodsOrderCustomerService.insertByOrderInfo(record); goodsOrderCustomerService.insertByOrderInfo(record);
//存储主订单信息 //存储主订单信息
if (oldOrder == null) { if (oldOrder == null) {
goodsOrderMapper.insertUseGeneratedKeys(record); //goodsOrderMapper.insertUseGeneratedKeys(record);
goodsOrderMapper.insertSelective(record);
} else { } else {
record.setId(oldOrder.getId()); record.setId(oldOrder.getId());
goodsOrderMapper.updateByPrimaryKeySelective(record); goodsOrderMapper.updateByPrimaryKeySelective(record);
...@@ -4951,7 +4955,8 @@ public class GoodsOrderService { ...@@ -4951,7 +4955,8 @@ public class GoodsOrderService {
goodsOrderCustomerService.insertByOrderInfo(record); goodsOrderCustomerService.insertByOrderInfo(record);
//存储主订单信息 //存储主订单信息
if (oldOrder == null) { if (oldOrder == null) {
goodsOrderMapper.insertUseGeneratedKeys(record); //goodsOrderMapper.insertUseGeneratedKeys(record);
goodsOrderMapper.insertSelective(record);
} else { } else {
record.setId(oldOrder.getId()); record.setId(oldOrder.getId());
goodsOrderMapper.updateByPrimaryKeySelective(record); goodsOrderMapper.updateByPrimaryKeySelective(record);
......
...@@ -291,7 +291,7 @@ public class PayOrderService { ...@@ -291,7 +291,7 @@ public class PayOrderService {
payOrder.setServiceCharge(BigDecimal.ZERO); payOrder.setServiceCharge(BigDecimal.ZERO);
payOrder.setActualIncomeMoney(payOrder.getActualMoney().subtract(payOrder.getServiceCharge())); 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()) if (Objects.equals(SceneTypeEnum.SCENE1_0.getValue(), goodsOrder.getSceneType())
&& Objects.equals(ZYVoucherStatusEnum.WAIT_TO_UPLOAD.getValue(), payOrder.getZyVoucherStatus())) { && Objects.equals(ZYVoucherStatusEnum.WAIT_TO_UPLOAD.getValue(), payOrder.getZyVoucherStatus())) {
o.setStatus(OrderStatus.WAIT_UPLOAD.getValue()); o.setStatus(OrderStatus.WAIT_UPLOAD.getValue());
...@@ -955,7 +955,7 @@ public class PayOrderService { ...@@ -955,7 +955,7 @@ public class PayOrderService {
o.setInstallUpgradeTime(now); o.setInstallUpgradeTime(now);
o.setOrderCode(orderCode); o.setOrderCode(orderCode);
o.setUpdatedBy(payOrder.getUpdatedBy()); 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()) if (Objects.equals(SceneTypeEnum.SCENE1_0.getValue(), goodsOrder.getSceneType())
&& Objects.equals(ZYVoucherStatusEnum.WAIT_TO_UPLOAD.getValue(), p.getZyVoucherStatus())) { && Objects.equals(ZYVoucherStatusEnum.WAIT_TO_UPLOAD.getValue(), p.getZyVoucherStatus())) {
o.setStatus(OrderStatus.WAIT_UPLOAD.getValue()); 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!