修改 gitgnore

This commit is contained in:
Jack 2024-11-12 09:42:42 +08:00
parent 3777caf93c
commit 9d47ff0b3f
4 changed files with 36 additions and 18 deletions

View File

@ -60,7 +60,7 @@ public class ShopStoreOrderProductPrintVO implements Serializable {
// 处理显示数量字段
this.s_quantity = addSpaceBetween(order_item_quantity > 1 ? "x" + orderItemQuantity.toString() : orderItemQuantity.toString(), this.quantity_blen);
// 处理显示金额字段
this.s_amount = addSpaceLeft(new DecimalFormat("#.00").format(order_item_amount), this.amount_blen);
this.s_amount = addSpaceLeft(new DecimalFormat("0.00").format(order_item_amount), this.amount_blen);
}
/**

View File

@ -45,41 +45,43 @@ public class OrderPayedListener {
try {
boolean flag = false;
logger.info("收到微信异步通知消息data:{}-chanel:{}-message:{}", data, channel, message);
logger.info("收到微信异步通知消息data:{}-chanel:{}-message:{},订单ID:{}", data, channel, message, order_id_row);
for (String orderId : order_id_row) {
//判断是否为线下支付订单
ShopOrderInfo orderInfoOld = shopOrderInfoService.get(orderId);
if (orderInfoOld.getOrder_state_id().intValue() == StateCode.ORDER_STATE_WAIT_PAY) {
// 待支付状态
logger.info("#### 待支付业务分支 ####");
flag = shopOrderBaseService.setPaidYes(Collections.singletonList(orderId));
} else {
//判断是否线下支付
if (StateCode.PAYMENT_TYPE_OFFLINE == orderInfoOld.getPayment_type_id().intValue()) {
//线下支付直接处理订单支付状态 不处理订单状态
logger.info("#### 线下业务分支 ####");
ShopOrderInfo orderInfo = new ShopOrderInfo();
orderInfo.setOrder_id(orderId);
orderInfo.setOrder_is_paid(StateCode.ORDER_PAID_STATE_YES);
flag = shopOrderInfoService.edit(orderInfo);
} else {
// 非线下支付
logger.info("#### 非线下业务分支 ####");
flag = shopOrderBaseService.setPaidYes(Collections.singletonList(orderId));
}
}
logger.info("#### 支付异步通知回调处理是否成功:{} ####", flag);
logger.info("#### 支付异步通知回调处理是否成功:{} ####", flag);
// 生成取单号和打印小票
if (flag) {
logger.info("####开始生成取单号####");
// 生成取单号和打印小票
if (flag) {
logger.info("####开始生成取单号####");
ShopOrderInfo orderInfo = new ShopOrderInfo();
orderInfo.setOrder_id(orderId);
// 生成取单号写入order_info
orderInfo.setOrder_pickup_num(shopOrderInfoService.genTodayPickupNum(orderInfoOld.getStore_id()));
shopOrderInfoService.edit(orderInfo);
ShopOrderInfo orderInfo = new ShopOrderInfo();
orderInfo.setOrder_id(orderId);
// 生成取单号写入order_info
orderInfo.setOrder_pickup_num(shopOrderInfoService.genTodayPickupNum(orderInfoOld.getStore_id()));
shopOrderInfoService.edit(orderInfo);
// 订单状态处理成功之后打印小票
shopStorePrinterService.printShopStoreOrder(orderId);
}
// 订单状态处理成功之后打印小票
shopStorePrinterService.printShopStoreOrder(orderId);
}
}

View File

@ -2678,10 +2678,12 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
@Override
@Transactional
public boolean setPaidYes(List<String> order_ids) {
logger.debug("设置付款状态的订单ID:{}", order_ids);
Date time = new Date();
// 判断订单类型
for (String order_id : order_ids) {
logger.debug("设置付款状态的单个订单ID:{}", order_id);
String prefix = order_id.substring(0, 2);
if ("XX".equals(prefix)) {
// 线下消费分佣处理
@ -2707,6 +2709,7 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
ShopStoreAnalytics analytics_row = shopStoreAnalyticsService.get(store_id);
analytics_row.setStore_trade_amount(NumberUtil.add(payConsumeTrade.getOrder_payment_amount(), analytics_row.getStore_trade_amount()));
if (!shopStoreAnalyticsService.saveOrUpdate(analytics_row)) {
logger.error("ShopStoreAnalytics 统计总营业额异常!");
throw new ApiException(ResultCode.FAILED);
}
@ -2748,6 +2751,7 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
order_data_update_row.setOrder_id(orderId);
if (!shopOrderDataService.edit(order_data_update_row)) {
logger.error("ShopOrderData 修改订单数据信息,比如支付额度、赠送积分、优惠等等异常!");
throw new ApiException(ResultCode.FAILED);
}
}
@ -2769,16 +2773,19 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
}
}
} else {
logger.error("order_ids 请选择需要设置支付的订单!");
throw new ApiException(I18nUtil._("请选择需要设置支付的订单!"));
}
if (CollUtil.isEmpty(review_id_row)) {
logger.error("review_id_row 无符合审核条件的订单!");
throw new ApiException(I18nUtil._("无符合审核条件的订单!"));
}
order_ids = review_id_row;
if (CollUtil.isEmpty(order_rows)) {
logger.error("order_rows 订单空!");
throw new ApiException(ResultCode.FAILED);
}
// 修改订单状态, 随机去一个订单获取店铺编号
@ -2792,6 +2799,7 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
List<ShopOrderItem> itemList = shopOrderItemService.find(itemQueryWrapperOne);
if (CollectionUtil.isEmpty(itemList)) {
logger.error("订单商品表为空!");
throw new ApiException(I18nUtil._("订单商品表为空!"));
}
editOrderInfo(time, order_ids);
@ -2981,6 +2989,7 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
// todo 教育购买课程记录不放在这
Long product_id = item.getProduct_id();
if (!eduService.saveUserCourseStock(user_id, product_id)) {
logger.error("保存购买课程记录失败product_id{}",product_id);
throw new ApiException(String.format(I18nUtil._("保存购买课程记录失败product_id【%s】"), product_id));
}
}
@ -3011,6 +3020,7 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
}
if (StrUtil.isBlank(chain_code)) {
logger.error("chain_code 提货码生成失败!");
throw new ApiException(I18nUtil._("提货码生成失败!"));
}
@ -3019,6 +3029,7 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
shopOrderChainCode.setOrder_id(order_id);
shopOrderChainCode.setChain_code(chain_code);
if (!orderChainCodeService.saveOrUpdate(shopOrderChainCode)) {
logger.error("chain_code 提货码保存失败!");
throw new ApiException(I18nUtil._("提货码生成失败!"));
}
@ -3117,6 +3128,7 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
if (ObjectUtil.equal(1002, order_item_inventory_lock) && CheckUtil.isEmpty(item_src_id)) {
Long item_id = order_item_row.getItem_id();
if (shopProductItemService.lockSkuStock(item_id, order_item_row.getOrder_item_quantity()) <= 0) {
logger.error("更改: {} 冻结库存失败!",item_id);
throw new ApiException(String.format(I18nUtil._("更改: %s 冻结库存失败!"), item_id));
}
}
@ -3183,6 +3195,7 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
ShopOrderInvoice invoice = orderInvoiceService.findOne(invoiceQueryWrapper);
if (invoice != null) {
if (!orderInvoiceService.edit(shopOrderInvoice, invoiceQueryWrapper)) {
logger.error("更改: {} 发票失败!",order_ids);
throw new ApiException(ResultCode.FAILED);
}
}
@ -8248,7 +8261,7 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
// 重构实体类处理标题数量价格适应长度
List<ShopStoreOrderProductPrintVO> orderItems = new ArrayList<>();
for(ShopStoreOrderProductPrintVO ent:shopStoreOrderProductPrintVOList) {
for (ShopStoreOrderProductPrintVO ent : shopStoreOrderProductPrintVOList) {
orderItems.add(ent.rebuild());
}
@ -8258,6 +8271,9 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
m.put("order_items", orderItems);//订单商品列表
m.put("order_items_count", orderItems.size());//商品数量
// 配送时间= 支付时间+20分钟
m.put("delivery_time", DateUtil.offsetMinute((Date) m.get("payment_time"), 20));
return m;
}
}

View File

@ -21,8 +21,8 @@ public class ShopStorePrinterController {
@ApiOperation(value = "测试打印模版消息", notes = "测试打印模版消息")
@RequestMapping(value = "/print/order", method = {RequestMethod.POST})
public boolean printOrder() {
return shopStorePrinterService.printShopStoreOrder("DD-20241105-7");
public boolean printOrder(@RequestParam(name = "orderId" , required = true) String orderId) {
return shopStorePrinterService.printShopStoreOrder(orderId);
}
@ApiOperation(value = "门店打票机分页列表查询", notes = "门店打票机分页列表查询")