feat(bszx): 为百色一小项目添加定制化证书生成逻辑
- 在 BszxBmServiceImpl 和 BszxPayServiceImpl 中添加了针对百色一小项目的证书生成逻辑 - 更新了 ShopDealerBankController 中的用户登录检查逻辑- 修改了 application.yml 中的文件服务器 URL
This commit is contained in:
@@ -107,6 +107,13 @@ public class BszxBmServiceImpl extends ServiceImpl<BszxBmMapper, BszxBm> impleme
|
||||
return null;
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(item)) {
|
||||
|
||||
// 百色一小项目
|
||||
if(item.getTenantId().equals(10547)){
|
||||
return "https://oss.wsdns.cn/20250908/f8b88d734aac4006a89b9aeb5c3f4f75.png";
|
||||
}
|
||||
|
||||
|
||||
// Font font = new Font("阿里巴巴普惠体", Font.PLAIN, 40);
|
||||
//合成器(指定背景图和输出格式,整个图片的宽高和相关计算依赖于背景图,所以背景图的大小是个基准)
|
||||
ImageCombiner combiner = new ImageCombiner(article.getAddress(), OutputFormat.JPG);
|
||||
|
||||
@@ -93,6 +93,54 @@ public class BszxPayServiceImpl extends ServiceImpl<BszxPayMapper, BszxPay> impl
|
||||
if (StrUtil.isBlank(item.getAddress())) {
|
||||
return null;
|
||||
}
|
||||
// 百色一小项目
|
||||
if(payCert.getTenantId().equals(10547) && ObjectUtil.isNotEmpty(payCert)){
|
||||
//合成器(指定背景图和输出格式,整个图片的宽高和相关计算依赖于背景图,所以背景图的大小是个基准)
|
||||
ImageCombiner combiner = new ImageCombiner("https://oss.wsdns.cn/20250908/97f0891f3e4048f5b20ffb07ff370a3a.png?x-oss-process=image/resize,w_750/quality,Q_90", OutputFormat.JPG);
|
||||
//加图片元素:盖章
|
||||
// combiner.addImageElement("https://oss.wsdns.cn/20250304/6936b109b09b4919a3498ac5027e728b.png", 550, 926);
|
||||
//加文本元素:姓名
|
||||
String str;
|
||||
if (bm.getType().equals(0)) {
|
||||
str = bm.getName();
|
||||
combiner.addTextElement(str, 26, 200, 468);
|
||||
} else {
|
||||
str = bm.getName();
|
||||
combiner.addTextElement(str, 22, 200, 468);
|
||||
}
|
||||
// combiner.addTextElement(bm.getName(), 32,900, 450);
|
||||
//加文本元素:捐款证书内容
|
||||
// combiner.addTextElement(" 承您慷慨解囊,襄助百色市百色中学", 32,200, 650);
|
||||
// combiner.addTextElement("百廿校庆“" + item.getTitle() + "”项目,捐赠人民币", 32,200, 700);
|
||||
combiner.addTextElement(totalMoney + "", 26, 420, 584);
|
||||
// combiner.addTextElement(" 您对学校的支持,为我们共同教育理", 32,200, 800);
|
||||
// combiner.addTextElement("想的实现增添了一份动力。", 32,200, 850);
|
||||
// combiner.addTextElement(" 承蒙惠赠,隆情铭感,特颁此证,以资谢旌!", 32, 200, 900);
|
||||
// combiner.addTextElement("百色市百色中学", 32,560, 1015);
|
||||
// final Date createTime = payCert.getCreateTime();
|
||||
// combiner.addTextElement(DateUtil.format(createTime, "yyyy年MM月"), 28,586, 1060);
|
||||
// combiner.addTextElement("2025年4月15日", 28,580, 1060);
|
||||
|
||||
//执行图片合并
|
||||
combiner.combine();
|
||||
|
||||
if (!FileUtil.exist(uploadPath + "/file/poster/" + payCert.getTenantId() + "/pay")) {
|
||||
FileUtil.mkdir(uploadPath + "/file/poster/" + payCert.getTenantId() + "/pay");
|
||||
}
|
||||
String basePath = "/poster/" + payCert.getTenantId() + "/pay/big-" + id + ".jpg";
|
||||
String smallPath = "/poster/" + payCert.getTenantId() + "/pay/" + id + ".jpg";
|
||||
String filename = uploadPath + "/file" + basePath;
|
||||
String smallFileName = uploadPath + "/file" + smallPath;
|
||||
combiner.save(filename);
|
||||
|
||||
File input = new File(filename);
|
||||
File output = new File(smallFileName);
|
||||
ImageUtil.adjustQuality(input, output, 0.8f);
|
||||
if (input.exists()) {
|
||||
input.delete();
|
||||
}
|
||||
return fileServer + smallPath + "?r=" + RandomUtil.randomNumbers(4);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(payCert)) {
|
||||
//合成器(指定背景图和输出格式,整个图片的宽高和相关计算依赖于背景图,所以背景图的大小是个基准)
|
||||
ImageCombiner combiner = new ImageCombiner("https://oss.wsdns.cn/20250420/811a380e8e124097aa0940a7c68a1f72.jpeg", OutputFormat.JPG);
|
||||
@@ -138,7 +186,7 @@ public class BszxPayServiceImpl extends ServiceImpl<BszxPayMapper, BszxPay> impl
|
||||
if (input.exists()) {
|
||||
input.delete();
|
||||
}
|
||||
return fileServer + smallPath + "?r=" + RandomUtil.randomNumbers(4);
|
||||
return fileServer + smallPath + "?v=" + RandomUtil.randomNumbers(4);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,103 +1,105 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.shop.entity.ShopDealerBank;
|
||||
import com.gxwebsoft.shop.param.ShopDealerBankParam;
|
||||
import com.gxwebsoft.shop.service.ShopDealerBankService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.shop.entity.ShopDealerBank;
|
||||
import com.gxwebsoft.shop.param.ShopDealerBankParam;
|
||||
import com.gxwebsoft.shop.service.ShopDealerBankService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分销商提现银行卡控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Tag(name = "分销商提现银行卡管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/shop-dealer-bank")
|
||||
public class ShopDealerBankController extends BaseController {
|
||||
/**
|
||||
* 分销商提现银行卡控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Tag(name = "分销商提现银行卡管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/shop-dealer-bank")
|
||||
public class ShopDealerBankController extends BaseController {
|
||||
@Resource
|
||||
private ShopDealerBankService shopDealerBankService;
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopDealerBank:list')")
|
||||
@Operation(summary = "分页查询分销商提现银行卡")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<ShopDealerBank>> page(ShopDealerBankParam param) {
|
||||
final User loginUser = getLoginUser();
|
||||
if(loginUser == null){
|
||||
return fail("请先登录",null);
|
||||
if (loginUser == null) {
|
||||
return fail("请先登录", null);
|
||||
}
|
||||
param.setUserId(loginUser.getUserId());
|
||||
return success(shopDealerBankService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopDealerBank:list')")
|
||||
@Operation(summary = "查询全部分销商提现银行卡")
|
||||
@GetMapping()
|
||||
public ApiResult<List<ShopDealerBank>> list(ShopDealerBankParam param) {
|
||||
final User loginUser = getLoginUser();
|
||||
if(loginUser == null){
|
||||
return fail("请先登录",null);
|
||||
}
|
||||
param.setUserId(loginUser.getUserId());
|
||||
return success(shopDealerBankService.listRel(param));
|
||||
final User loginUser = getLoginUser();
|
||||
if (loginUser == null) {
|
||||
return fail("请先登录", null);
|
||||
}
|
||||
param.setUserId(loginUser.getUserId());
|
||||
return success(shopDealerBankService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopDealerBank:list')")
|
||||
@Operation(summary = "根据id查询分销商提现银行卡")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<ShopDealerBank> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(shopDealerBankService.getByIdRel(id));
|
||||
// 使用关联查询
|
||||
return success(shopDealerBankService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopDealerBank:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加分销商提现银行卡")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody ShopDealerBank shopDealerBank) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
shopDealerBank.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (shopDealerBankService.save(shopDealerBank)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
shopDealerBank.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (shopDealerBankService.save(shopDealerBank)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopDealerBank:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改分销商提现银行卡")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody ShopDealerBank shopDealerBank) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
shopDealerBank.setUserId(loginUser.getUserId());
|
||||
if (shopDealerBankService.updateById(shopDealerBank)) {
|
||||
return success("修改成功");
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopDealerBank:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除分销商提现银行卡")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (shopDealerBankService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
final User loginUser = getLoginUser();
|
||||
if (loginUser == null) {
|
||||
return fail("请先登录", null);
|
||||
}
|
||||
if (shopDealerBankService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopDealerBank:save')")
|
||||
@@ -105,10 +107,10 @@ public class ShopDealerBankController extends BaseController {
|
||||
@Operation(summary = "批量添加分销商提现银行卡")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<ShopDealerBank> list) {
|
||||
if (shopDealerBankService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
if (shopDealerBankService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopDealerBank:update')")
|
||||
@@ -116,10 +118,10 @@ public class ShopDealerBankController extends BaseController {
|
||||
@Operation(summary = "批量修改分销商提现银行卡")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<ShopDealerBank> batchParam) {
|
||||
if (batchParam.update(shopDealerBankService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
if (batchParam.update(shopDealerBankService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopDealerBank:remove')")
|
||||
@@ -127,10 +129,10 @@ public class ShopDealerBankController extends BaseController {
|
||||
@Operation(summary = "批量删除分销商提现银行卡")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (shopDealerBankService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
if (shopDealerBankService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ config:
|
||||
# 主服务器
|
||||
server-url: https://server.websoft.top/api
|
||||
# 文件服务器
|
||||
file-server: https://file.wsdns.cn
|
||||
file-server: https://file.websoft.top
|
||||
# 其他
|
||||
api-url: https://server.websoft.top/api
|
||||
upload-path: /Users/gxwebsoft/Documents/uploads/
|
||||
|
||||
Reference in New Issue
Block a user