feat:打印发票兼容外部用户
This commit is contained in:
1 parent
cfc2982081
commit
fab9e82b51
1 file changed
+11
-4
+11
-4
@@ -129,8 +129,15 @@ public class HardInvoiceServiceImpl extends ServiceImpl<HardInvoiceMapper, HardI
|
||||
.eq(HardCarEntity::getParentCarId, order.getParentCarId())
|
||||
);
|
||||
// 查询用户
|
||||
UserInfo user = Optional.of(userService.getInnerByUserId(order.getUserId())).map(R::getData).orElseThrow(() -> new RuntimeException("用户不存在"));
|
||||
SysUser sysUser = user.getSysUser();
|
||||
String username = "外部用户-未知用户";
|
||||
String userPhone = "外部用户-未知手机号";
|
||||
UserInfo user = userService.getInnerByUserId(order.getUserId()).getData();
|
||||
if (ObjectUtil.isNotEmpty(user)) {
|
||||
if (ObjectUtil.isNotEmpty(user.getSysUser())) {
|
||||
username = user.getSysUser().getName();
|
||||
userPhone = user.getSysUser().getPhone();
|
||||
}
|
||||
}
|
||||
// 查询商户
|
||||
MchManageVo mch = Optional.of(remoteMchService.getById(order.getMerchantId())).map(R::getData).orElseThrow(() -> new RuntimeException("商户不存在"));
|
||||
// 订单类型
|
||||
@@ -154,8 +161,8 @@ public class HardInvoiceServiceImpl extends ServiceImpl<HardInvoiceMapper, HardI
|
||||
drawing.setDefaultStyle()
|
||||
.drawingRowText("订单号", order.getId().toString())
|
||||
.drawingRowText("订单类型", orderType)
|
||||
.drawingRowText("用户", sysUser.getName())
|
||||
.drawingRowText("手机号", sysUser.getPhone())
|
||||
.drawingRowText("用户", username)
|
||||
.drawingRowText("手机号", userPhone)
|
||||
.drawingRowText("商户", mch.getName())
|
||||
.drawingRowText("部门", mch.getDeptName())
|
||||
.drawingRowText("下单时间", createTime)
|
||||
|
||||
Reference in new issue
Block a user