식자재(2) 나라장터 입찰계산기
사진처럼 예시로 입력을 해보았습니다. 추첨번호는 추천입찰가와 가장 가까운 추첨번호로를 골라서 사용자에게 보여줍니다. 또 식자재 종류별로 입력할 수 있고 결과는 각 시트별로 구분이 되어서 저장이됩니다.
[code]
// 입찰 정보 시트
const bidInfoSheet = XLSX.utils.json_to_sheet([{
"사업금액": calculationResults.businessAmount,
"배정예산": calculationResults.allocatedBudget,
"추정가격": calculationResults.estimatedPrice,
"낙찰하한율": calculationResults.lowestBidRate,
"예상 경쟁 업체 수": calculationResults.expectedCompetitors,
"전 업체 낙찰 투찰율": calculationResults.previousWinningRate || "N/A",
"사용자 지정 투찰율": calculationResults.customBidRate || "N/A",
"평균 예정가격": calculationResults.averageEstimatedPrice,
"추천 입찰가": calculationResults.recommendedBid,
"추천 투찰율": calculationResults.recommendedBidRate,
"낙찰 확률": calculationResults.winningProbability,
"사용자 지정 입찰가": calculationResults.userCustomBid || "N/A",
"사용자 지정 투찰율": calculationResults.userCustomBidRate || "N/A"
}]);
XLSX.utils.book_append_sheet(workbook, bidInfoSheet, "입찰 정보");
// 예가 범위 시트
const priceRangesSheet = XLSX.utils.json_to_sheet(
calculationResults.prices.map((price, index) => ({
"번호": index + 1,
"가격": price
}))
);
XLSX.utils.book_append_sheet(workbook, priceRangesSheet, "예가 범위");
// 추첨예가 범위 시트
const drawnPriceRangesSheet = XLSX.utils.json_to_sheet(
calculationResults.drawnPriceRanges.map((range, index) => ({
"범위 번호": index + 1,
"최소값": range.min,
"최대값": range.max
}))
);
XLSX.utils.book_append_sheet(workbook, drawnPriceRangesSheet, "추첨예가 범위");
// 추천 추첨번호 시트
const recommendedNumbersSheet = XLSX.utils.json_to_sheet([{
"추천 추첨번호": calculationResults.recommendedNumbers.join(", ")
}]);
XLSX.utils.book_append_sheet(workbook, recommendedNumbersSheet, "추천 추첨번호");
// 식자재 항목 시트 (있는 경우에만)
if (calculationResults.items) {
const itemsSheet = XLSX.utils.json_to_sheet(calculationResults.items);
XLSX.utils.book_append_sheet(workbook, itemsSheet, "식자재 항목");
// 수익성 분석 시트
const profitAnalysisSheet = XLSX.utils.json_to_sheet([{
"총 원가": calculationResults.totalCost,
"예상 순이익": calculationResults.estimatedProfit,
"예상 순이익률": calculationResults.estimatedProfitRate
}]);
XLSX.utils.book_append_sheet(workbook, profitAnalysisSheet, "수익성 분석");
}
// 엑셀 파일 생성 및 다운로드
XLSX.writeFile(workbook, '입찰전략_결과.xlsx');
});[/code]
위 처럼 구성되어있어요. 오프라인환경에서 작동할걸 염려해서. 우선 HTML으로 작성해서 클라이언트 사이드에서 모든 작업이 이루어지도록 하였습니다. 아마 저는 업무상 여기서 php로 코드변환해서 서버사이드에서 각 항목들이 DB에 저장되어서 과거기록을 확인하고 보다 정확한 입찰분석을 위해 모든걸 비교 후 정보를 제공하는 그런 차후 작업을 나중에 하게 될거같습니다.
몇번 시행착오를 거듭해서 완성이 되었다 싶으면 완성본으로 회원분들께 공유될거같습니다.
댓글 2개
베스트 댓글
@nekoieye 연락한번 드리고 싶은데, 비공개 해두셔서 쪽지가 안되네요.
저한테 쪽지한번 요청드려요.
게시판 목록
자유게시판
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 199717 | 3일 전 | 9 | ||
| 199716 |
느긋한카키쿠키
|
3일 전 | 5 | |
| 199715 |
현대적인무질서한까마귀
|
3일 전 | 10 | |
| 199714 | 3일 전 | 14 | ||
| 199713 | 4일 전 | 25 | ||
| 199712 | 2주 전 | 258 | ||
| 199711 |
안졸리니졸리니
|
2주 전 | 129 | |
| 199710 |
|
2주 전 | 143 | |
| 199709 |
|
2주 전 | 82 | |
| 199708 | 3주 전 | 97 | ||
| 199707 | 1개월 전 | 229 | ||
| 199706 | 1개월 전 | 34 | ||
| 199705 | 1개월 전 | 21 | ||
| 199704 | 1개월 전 | 38 | ||
| 199703 | 1개월 전 | 47 | ||
| 199702 | 1개월 전 | 86 | ||
| 199701 | 1개월 전 | 102 | ||
| 199700 | 1개월 전 | 76 | ||
| 199699 | 1개월 전 | 77 | ||
| 199698 | 1개월 전 | 123 | ||
| 199697 | 1개월 전 | 89 | ||
| 199696 |
|
1개월 전 | 235 | |
| 199695 | 1개월 전 | 77 | ||
| 199694 | 1개월 전 | 105 | ||
| 199693 | 1개월 전 | 172 | ||
| 199692 | 1개월 전 | 173 | ||
| 199691 |
|
1개월 전 | 146 | |
| 199690 | 1개월 전 | 241 | ||
| 199689 | 1개월 전 | 151 | ||
| 199688 | 1개월 전 | 178 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기