打印工单 完成

This commit is contained in:
xiaofajia 2024-10-30 18:07:27 +08:00
parent c1cf26a98c
commit fd3b9c0aec
2 changed files with 14 additions and 4 deletions

View File

@ -111,6 +111,6 @@ public class RepairOrderInfoController {
@GetMapping("/toPay") @GetMapping("/toPay")
@Operation(summary = "PC支付按钮") @Operation(summary = "PC支付按钮")
public CommonResult<?> toPay(@RequestParam("id")String id) throws IOException, NoSuchAlgorithmException, SignatureException, InvalidKeyException { public CommonResult<?> toPay(@RequestParam("id")String id) throws IOException, NoSuchAlgorithmException, SignatureException, InvalidKeyException {
return success(repairOrderInfoService.payTransactions(id)); return success(repairOrderInfoService.payTransactionsCode(id));
} }
} }

View File

@ -743,11 +743,11 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
params.put("bankAddress", bankAddress); params.put("bankAddress", bankAddress);
params.put("account", account); params.put("account", account);
// 调支付接口 todo 这个地方应该还要加东西 // 调支付接口
String payUrl = ""; String payUrl = "";
try { try {
Map<String, Object> stringObjectMap = repairOrderInfoService.payTransactions(orderInfo.getId()); Map<String, Object> stringObjectMap = repairOrderInfoService.payTransactionsCode(orderInfo.getId());
payUrl = (String) stringObjectMap.get("prepay_id"); payUrl = (String) stringObjectMap.get("code_url");
// 这个地方可能报错报错就不生成二维码了保证工单是能出来的 // 这个地方可能报错报错就不生成二维码了保证工单是能出来的
// 生成收款二维码 // 生成收款二维码
int width = 100, height = 100; int width = 100, height = 100;
@ -1357,6 +1357,16 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
BigDecimal confirmFaultMoney = ObjectUtil.isNotEmpty(oldTicket.getConfirmFaultMoney()) ? oldTicket.getConfirmFaultMoney() : new BigDecimal("0"); BigDecimal confirmFaultMoney = ObjectUtil.isNotEmpty(oldTicket.getConfirmFaultMoney()) ? oldTicket.getConfirmFaultMoney() : new BigDecimal("0");
tickets.setTotalPrice(tickets.getTotalPrice().add(managerMoney).add(rescueMoney).add(threePackMoney).add(confirmFaultMoney)); tickets.setTotalPrice(tickets.getTotalPrice().add(managerMoney).add(rescueMoney).add(threePackMoney).add(confirmFaultMoney));
// 因为订单是在工单创建的时候就新增了后面加的配件之类的金额没有同步到订单这里同步一下
RepairOrderInfo orderInfo = repairOrderInfoService.getOne(new LambdaQueryWrapper<RepairOrderInfo>().eq(RepairOrderInfo::getGoodsId, ticketId));
RepairOrderInfo newOrderInfo = new RepairOrderInfo();
newOrderInfo.setId(orderInfo.getId());
// 更新商品原价和实付金额
newOrderInfo.setGoodsPrice(tickets.getTotalPrice());
newOrderInfo.setPayMoney(tickets.getTotalPrice());
repairOrderInfoService.updateById(newOrderInfo);
return baseMapper.updateById(tickets) > 0; return baseMapper.updateById(tickets) > 0;
} }