|
@@ -284,28 +284,31 @@ public class OrderInfoServiceImpl implements OrderInfoService {
|
|
|
//更新订单信息
|
|
|
String orderId = goodsPayOrderForm.getFkOrderId();
|
|
|
GoodsOrderInfo goodsOrderInfo = goodsOrderInfoMapper.selectByPrimaryKey(orderId);
|
|
|
- goodsOrderInfo.setOrderStatus(state);
|
|
|
- goodsOrderInfo.setModifiedTime(new Date());
|
|
|
- int i = goodsOrderInfoMapper.updateByPrimaryKeySelective(goodsOrderInfo);
|
|
|
- if (i > 0) {
|
|
|
- //更新支付订单信息
|
|
|
- goodsPayOrderForm.setPayStatus(state);
|
|
|
- goodsPayOrderForm.setPayTime(new Date());
|
|
|
- int j = orderPayService.modifyByPrimaryKeySelective(goodsPayOrderForm);
|
|
|
- if (j == 0) {
|
|
|
- throw new RuntimeException();
|
|
|
+ if(!StringUtils.isEmpty(goodsOrderInfo)){
|
|
|
+ goodsOrderInfo.setOrderStatus(state);
|
|
|
+ goodsOrderInfo.setModifiedTime(new Date());
|
|
|
+ int i = goodsOrderInfoMapper.updateByPrimaryKeySelective(goodsOrderInfo);
|
|
|
+ if (i > 0) {
|
|
|
+ //更新支付订单信息
|
|
|
+ goodsPayOrderForm.setPayStatus(state);
|
|
|
+ goodsPayOrderForm.setPayTime(new Date());
|
|
|
+ int j = orderPayService.modifyByPrimaryKeySelective(goodsPayOrderForm);
|
|
|
+ if (j == 0) {
|
|
|
+ throw new RuntimeException();
|
|
|
+ }
|
|
|
+ //更新农户收入信息
|
|
|
+ updateFarmerSaleInfo(orderId);
|
|
|
+ //生成证书信息
|
|
|
+ applicationContext.publishEvent(new CredentialInfoEvent(this, orderId));
|
|
|
+ //生成购买碳汇数据
|
|
|
+ applicationContext.publishEvent(new CustomerCarbonValEvent(this, orderId));
|
|
|
+
|
|
|
+ return i;
|
|
|
}
|
|
|
- //更新农户收入信息
|
|
|
- updateFarmerSaleInfo(orderId);
|
|
|
- //生成证书信息
|
|
|
- applicationContext.publishEvent(new CredentialInfoEvent(this, orderId));
|
|
|
- //生成购买碳汇数据
|
|
|
- applicationContext.publishEvent(new CustomerCarbonValEvent(this, orderId));
|
|
|
-
|
|
|
- return i;
|
|
|
- } else {
|
|
|
- throw new RuntimeException();
|
|
|
+ }else{
|
|
|
+ log.info("订单不存在无法更新!");
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|