final stage update bugs
This commit is contained in:
@ -113,6 +113,10 @@ class SumasenExcel:
|
|||||||
|
|
||||||
self.basic = basic
|
self.basic = basic
|
||||||
|
|
||||||
|
self.output_path = basic.get("output_path")
|
||||||
|
if not os.path.exists(self.output_path):
|
||||||
|
os.makedirs(self.output_path, exist_ok=True)
|
||||||
|
|
||||||
logging.info("step-2")
|
logging.info("step-2")
|
||||||
|
|
||||||
# basicセクションから必要なパラメータを取得
|
# basicセクションから必要なパラメータを取得
|
||||||
@ -143,7 +147,7 @@ class SumasenExcel:
|
|||||||
logging.error("sections not found in basic section")
|
logging.error("sections not found in basic section")
|
||||||
|
|
||||||
# 出力ファイルパスを設定
|
# 出力ファイルパスを設定
|
||||||
self.output_filepath = f"{self.docpath}/{doc_file}"
|
self.output_filepath = f"{self.output_path}/{doc_file}"
|
||||||
# 新規のExcelワークブックを作成
|
# 新規のExcelワークブックを作成
|
||||||
self.workbook = openpyxl.Workbook()
|
self.workbook = openpyxl.Workbook()
|
||||||
# デフォルトで作成されるシートを削除
|
# デフォルトで作成されるシートを削除
|
||||||
|
|||||||
Binary file not shown.
@ -4,6 +4,7 @@ doc_file=certificate_[zekken_number].xlsx
|
|||||||
sections=section1
|
sections=section1
|
||||||
maxcol=10
|
maxcol=10
|
||||||
column_width=3,5,16,16,16,16,16,8,8,12,3
|
column_width=3,5,16,16,16,16,16,8,8,12,3
|
||||||
|
output_path=media/reports/[event_code]
|
||||||
|
|
||||||
[section1]
|
[section1]
|
||||||
template_sheet=certificate
|
template_sheet=certificate
|
||||||
|
|||||||
@ -134,8 +134,7 @@ FROM
|
|||||||
AND CAST(e.zekken_number AS TEXT) = cs.zekken_number
|
AND CAST(e.zekken_number AS TEXT) = cs.zekken_number
|
||||||
LEFT JOIN v_category_rankings cr ON e.id = cr.id
|
LEFT JOIN v_category_rankings cr ON e.id = cr.id
|
||||||
LEFT JOIN rog_member m ON t.id = m.team_id
|
LEFT JOIN rog_member m ON t.id = m.team_id
|
||||||
LEFT JOIN rog_goalimages gi ON ev.event_name = gi.event_code
|
LEFT JOIN rog_goalimages gi ON e.owner_id = gi.user_id
|
||||||
AND CAST(e.zekken_number AS TEXT) = gi.zekken_number
|
|
||||||
|
|
||||||
GROUP BY
|
GROUP BY
|
||||||
e.id, e.zekken_number, e.is_active, e."hasParticipated", e."hasGoaled", e.date,
|
e.id, e.zekken_number, e.is_active, e."hasParticipated", e."hasGoaled", e.date,
|
||||||
@ -177,6 +176,7 @@ SELECT
|
|||||||
FROM
|
FROM
|
||||||
gps_checkins g
|
gps_checkins g
|
||||||
LEFT JOIN rog_location l ON g.cp_number = l.cp
|
LEFT JOIN rog_location l ON g.cp_number = l.cp
|
||||||
|
AND l."group" LIKE '%' || g.event_code || '%'
|
||||||
ORDER BY
|
ORDER BY
|
||||||
g.event_code,
|
g.event_code,
|
||||||
g.zekken_number,
|
g.zekken_number,
|
||||||
|
|||||||
@ -2561,7 +2561,7 @@ def update_checkins(request):
|
|||||||
checkin.buy_flag = update.get('buy_flag', False)
|
checkin.buy_flag = update.get('buy_flag', False)
|
||||||
checkin.validate_location = update.get('validation', False)
|
checkin.validate_location = update.get('validation', False)
|
||||||
checkin.points = update.get('points', 0)
|
checkin.points = update.get('points', 0)
|
||||||
checkin.update_at = timezone.now()
|
# checkin.update_at = timezone.now() チェックイン時刻は更新しない
|
||||||
checkin.update_user = request.user.email if request.user.is_authenticated else None
|
checkin.update_user = request.user.email if request.user.is_authenticated else None
|
||||||
checkin.save()
|
checkin.save()
|
||||||
logger.info(f"Updated existing checkin result: {checkin}")
|
logger.info(f"Updated existing checkin result: {checkin}")
|
||||||
@ -2583,7 +2583,7 @@ def update_checkins(request):
|
|||||||
validate_location=update.get('validation', False),
|
validate_location=update.get('validation', False),
|
||||||
buy_flag=update.get('buy_flag', False),
|
buy_flag=update.get('buy_flag', False),
|
||||||
points=update.get('points', 0),
|
points=update.get('points', 0),
|
||||||
create_at=timezone.now(),
|
# create_at=timezone.now(), チェックイン時刻は更新しない
|
||||||
update_at=timezone.now(),
|
update_at=timezone.now(),
|
||||||
create_user=request.user.email if request.user.is_authenticated else None,
|
create_user=request.user.email if request.user.is_authenticated else None,
|
||||||
update_user=request.user.email if request.user.is_authenticated else None
|
update_user=request.user.email if request.user.is_authenticated else None
|
||||||
|
|||||||
@ -253,6 +253,16 @@
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const newTime = new Date(input.value);
|
const newTime = new Date(input.value);
|
||||||
|
// inputがnullの場合は棄権処理
|
||||||
|
if (!input) {
|
||||||
|
const validateElement = document.getElementById('validate');
|
||||||
|
display.textContent = '棄権';
|
||||||
|
if (validateElement) {
|
||||||
|
validateElement.textContent = '棄権';
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
display.textContent = newTime.toLocaleString();
|
display.textContent = newTime.toLocaleString();
|
||||||
|
|
||||||
const eventCodeSelect = document.getElementById('eventCode');
|
const eventCodeSelect = document.getElementById('eventCode');
|
||||||
@ -322,6 +332,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
calculatePoints(); // 総合ポイントの計算
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('Error updating goal time:', e);
|
console.error('Error updating goal time:', e);
|
||||||
@ -453,6 +464,8 @@
|
|||||||
'未ゴール';
|
'未ゴール';
|
||||||
goalTimeDisplay.textContent = goalTime;
|
goalTimeDisplay.textContent = goalTime;
|
||||||
|
|
||||||
|
updateGoalTime(goalTime) // ゴール時刻の表示を更新
|
||||||
|
|
||||||
console.info('teamData.goal_photo = ',teamData.goal_photo );
|
console.info('teamData.goal_photo = ',teamData.goal_photo );
|
||||||
|
|
||||||
if (goalTime === '-') {
|
if (goalTime === '-') {
|
||||||
@ -510,7 +523,11 @@
|
|||||||
`<img src="/media/compressed/${checkin.photos}" class="h-20 w-20 object-cover rounded" onclick="showLargeImage(this.src)">` : ''}
|
`<img src="/media/compressed/${checkin.photos}" class="h-20 w-20 object-cover rounded" onclick="showLargeImage(this.src)">` : ''}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-2 py-3">
|
<td class="px-2 py-3">
|
||||||
${checkin.cp_number===-1 || checkin.image_address===null ? "" : `<img src="${checkin.image_address}" class="h-20 w-20 object-cover rounded" onclick="showLargeImage(this.src)">`}
|
${checkin.cp_number===-1 || checkin.image_address===null ? "" :
|
||||||
|
`<img src="${checkin.image_address}"
|
||||||
|
class="h-20 w-20 object-cover rounded"
|
||||||
|
onclick="showLargeImage(this.src)"
|
||||||
|
onerror="this.parentElement.innerHTML=''">`}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-2 py-3 ${bgColor}">
|
<td class="px-2 py-3 ${bgColor}">
|
||||||
<div class="font-bold">${checkin.sub_loc_id}</div>
|
<div class="font-bold">${checkin.sub_loc_id}</div>
|
||||||
@ -996,6 +1013,7 @@ function applyImageOrientation(imgElement) {
|
|||||||
let totalPoints = 0; // チェックインポイントの合計をクリア
|
let totalPoints = 0; // チェックインポイントの合計をクリア
|
||||||
let cpPoints = 0; // チェックインポイントの合計をクリア
|
let cpPoints = 0; // チェックインポイントの合計をクリア
|
||||||
let buyPoints = 0; // 買い物ポイントの合計をクリア
|
let buyPoints = 0; // 買い物ポイントの合計をクリア
|
||||||
|
let latePoints = 0; // 遅刻ポイントの合計をクリア
|
||||||
|
|
||||||
// 各行のチェックインポイント及び買い物ポイントを合算
|
// 各行のチェックインポイント及び買い物ポイントを合算
|
||||||
rows.forEach(row => {
|
rows.forEach(row => {
|
||||||
@ -1013,7 +1031,7 @@ function applyImageOrientation(imgElement) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 遅刻ポイントの計算=ゴール時刻がEventのゴール時刻を超えていたら1分につき-50点を加算する。
|
// 遅刻ポイントの計算=ゴール時刻がEventのゴール時刻を超えていたら1分につき-50点を加算する。
|
||||||
const latePoints = parseInt(document.getElementById('latePoints').textContent) || 0;
|
latePoints = parseInt(document.getElementById('latePoints').textContent) || 0;
|
||||||
// 総合得点を計算
|
// 総合得点を計算
|
||||||
const finalPoints = totalPoints + latePoints;
|
const finalPoints = totalPoints + latePoints;
|
||||||
|
|
||||||
@ -1022,6 +1040,7 @@ function applyImageOrientation(imgElement) {
|
|||||||
|
|
||||||
document.getElementById('totalPoints').textContent = cpPoints;
|
document.getElementById('totalPoints').textContent = cpPoints;
|
||||||
document.getElementById('buyPoints').textContent = buyPoints;
|
document.getElementById('buyPoints').textContent = buyPoints;
|
||||||
|
document.getElementById('latePoints').textContent = latePoints;
|
||||||
document.getElementById('finalPoints').textContent = finalPoints;
|
document.getElementById('finalPoints').textContent = finalPoints;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user