打印工单

This commit is contained in:
xiaofajia 2024-10-30 17:30:37 +08:00
parent d419653666
commit a93e59e5c6
2 changed files with 29 additions and 1 deletions

View File

@ -19,6 +19,11 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.SignatureException;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 维修模块 订单")
@ -95,4 +100,17 @@ public class RepairOrderInfoController {
public CommonResult<?> census() {
return success(repairOrderInfoService.census());
}
/**
* PC支付按钮
*
* @author 小李
* @date 17:26 2024/10/30
* @param id id
**/
@GetMapping("/toPay")
@Operation(summary = "PC支付按钮")
public CommonResult<?> toPay(@RequestParam("id")String id) throws IOException, NoSuchAlgorithmException, SignatureException, InvalidKeyException {
return success(repairOrderInfoService.payTransactions(id));
}
}

View File

@ -697,6 +697,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
}
// 结算日期
params.put("settleDate", date.format(LocalDateTime.now()));
// 取订单
RepairOrderInfo orderInfo = repairOrderInfoService.getOne(new LambdaQueryWrapper<RepairOrderInfo>().eq(RepairOrderInfo::getGoodsId, tickets.getId()));
if (ObjectUtil.isNotEmpty(orderInfo)) {
// 付款情况
@ -742,9 +743,18 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
params.put("bankAddress", bankAddress);
params.put("account", account);
// 调支付接口
String payUrl = "";
try {
Map<String, Object> stringObjectMap = repairOrderInfoService.payTransactions(orderInfo.getId());
payUrl = (String) stringObjectMap.get("prepay_id");
}catch (Exception e){
e.printStackTrace();
throw exception0(500, "系统异常");
}
// 生成收款二维码
int width = 100, height = 100;
byte[] texts = CreateQRCodeUtil.GenerateQRCode("hello world", width, height);
byte[] texts = CreateQRCodeUtil.GenerateQRCode(payUrl, width, height);
if (ObjectUtil.isNotEmpty(texts)){
params.put("qrCode", new PictureRenderData(width, height, PictureType.PNG, texts));
}