From c0abf1b8be71aef5089151ca8601a3b69b21a09d Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期二, 01 四月 2025 18:10:10 +0800
Subject: [PATCH] 惠民卡代码
---
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/WorldCupController.java | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/WorldCupController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/WorldCupController.java
index 4249541..8a5a69f 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/WorldCupController.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/WorldCupController.java
@@ -199,12 +199,17 @@
if(worldCup1.getStartTime().before(DateUtil.getDate())){
return ResultUtil.error("赛事已开始,不能编辑");
}
+ Integer maxPeople = worldCup1.getMaxPeople();
+ int registeredNumber = worldCupClient.getRegisteredNumber(worldCup.getId());
+ if(maxPeople.compareTo(registeredNumber) < 0){
+ return ResultUtil.error("报名人数不能小于已报名人数");
+ }
if(worldCup.getStartTime().before(new Date())){
worldCup.setStatus(2);
}else{
worldCup.setStatus(1);
}
- worldCupClient.editWorldCup(worldCup);
+ worldCupClient.editWorldCup(JSON.toJSONString(worldCup));
worldCupStoreClient.delWorldCupStore(worldCup.getId());
JSONArray jsonArray = JSON.parseArray(stores);
for (int i = 0; i < jsonArray.size(); i++) {
@@ -232,7 +237,7 @@
WorldCup worldCup = new WorldCup();
worldCup.setId(id);
worldCup.setStatus(state);
- worldCupClient.editWorldCup(worldCup);
+ worldCupClient.editWorldCup(JSON.toJSONString(worldCup));
//开始处理已支付的退费
worldCupClient.cancelWorldCupRefund(id);
return ResultUtil.success();
@@ -267,11 +272,13 @@
response.setContentType("APPLICATION/OCTET-STREAM");
response.setHeader("Content-Disposition","attachment; filename=" + URLEncoder.encode("二维码", "UTF-8") + ".zip");
ZipOutputStream out = new ZipOutputStream(response.getOutputStream());
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
for(Map<String, Object> map : list){
String id = map.get("id").toString();
String isStudent = map.get("isStudent").toString();
- String name = map.get("name").toString();
- QRCodeUtils.encode("{\"id\":" + id + ",\"isStudent\":" + isStudent + "}", name, "/usr/playpai/qrcode", false);
+ String name = map.get("name").toString() + sdf.format(new Date());
+ String content = "{\"id\":" + id + ",\"isStudent\":" + isStudent + "}";
+ QRCodeUtils.encode(content, name, "/usr/playpai/qrcode", false);
File file = new File("/usr/playpai/qrcode/" + name + ".jpg");
FileInputStream fileInputStream = new FileInputStream(file);
--
Gitblit v1.7.1