Merge branch 'prod' into test

This commit is contained in:
2026-05-06 09:30:39 +08:00
2 changed files with 10 additions and 5 deletions

View File

@@ -12,9 +12,11 @@ import com.czg.order.entity.MqLog;
import com.czg.order.entity.SysPrintData; import com.czg.order.entity.SysPrintData;
import com.czg.order.service.MqLogService; import com.czg.order.service.MqLogService;
import com.czg.order.service.SysPrintDataService; import com.czg.order.service.SysPrintDataService;
import com.czg.print.StockPrintDTO;
import com.czg.service.RedisService; import com.czg.service.RedisService;
import com.czg.service.order.print.PrintConfig; import com.czg.service.order.print.PrintConfig;
import com.czg.service.order.print.PrinterHandler; import com.czg.service.order.print.PrinterHandler;
import com.czg.utils.FunUtils;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.amqp.rabbit.annotation.RabbitListener;
@@ -100,9 +102,11 @@ public class PrintMqListener {
Long shopId = jsonObject.getLong("shopId"); Long shopId = jsonObject.getLong("shopId");
String printTypeEnum = jsonObject.getString("printTypeEnum"); String printTypeEnum = jsonObject.getString("printTypeEnum");
JSONObject data2 = jsonObject.getJSONObject("data"); JSONObject data2 = jsonObject.getJSONObject("data");
JSONArray data3 = null; JSONArray data3;
if (data2 == null) { if (data2 == null) {
data3 = jsonObject.getJSONArray("data"); data3 = jsonObject.getJSONArray("data");
} else {
data3 = null;
} }
PrinterHandler.PrintTypeEnum typeEnum = PrinterHandler.PrintTypeEnum.valueOf(printTypeEnum); PrinterHandler.PrintTypeEnum typeEnum = PrinterHandler.PrintTypeEnum.valueOf(printTypeEnum);
if (typeEnum != PrinterHandler.PrintTypeEnum.HANDOVER) { if (typeEnum != PrinterHandler.PrintTypeEnum.HANDOVER) {
@@ -117,6 +121,6 @@ public class PrintMqListener {
printDataService.save(sysPrintData); printDataService.save(sysPrintData);
rabbitPublisher.sendOtherPrintLocalMsg(shopId, printTypeEnum, sysPrintData.getId()); rabbitPublisher.sendOtherPrintLocalMsg(shopId, printTypeEnum, sysPrintData.getId());
} }
printConfig.otherHandler(shopId, data2, data3, typeEnum); FunUtils.asyncSafeRunVoid(() -> printConfig.otherHandler(shopId, data2, data3, typeEnum));
} }
} }

View File

@@ -558,10 +558,11 @@ public interface PrinterImpl {
List<StockPrintDTO.InStockItem> items = record.getItems(); List<StockPrintDTO.InStockItem> items = record.getItems();
if (CollUtil.isNotEmpty(items)) { if (CollUtil.isNotEmpty(items)) {
for (StockPrintDTO.InStockItem item : items) { for (StockPrintDTO.InStockItem item : items) {
String stockNumber = item.getStockNumber().stripTrailingZeros().toPlainString(); String stockNumber = bdToStr(item.getStockNumber());
String amount = item.getAmount().stripTrailingZeros().toPlainString(); String amount = bdToStr(item.getAmount());
// 左对齐排版,保证列对齐 // 左对齐排版,保证列对齐
String itemLine = key4(item.getConsName(), item.getUnit(), stockNumber, amount, 11, 9, 7); String itemLine = key4(item.getConsName(), StrUtil.isBlank(item.getUnit()) ? "" : item.getUnit(), stockNumber, amount, 11, 9, 7);
builder.append(formatLabel(itemLine, signLabelInfo.s)).append(signLabelInfo.br); builder.append(formatLabel(itemLine, signLabelInfo.s)).append(signLabelInfo.br);
} }
} }