|
|
@ -0,0 +1,634 @@ |
|
|
|
|
|
|
|
--- |
|
|
|
|
|
|
|
layout: post |
|
|
|
|
|
|
|
type: handbook |
|
|
|
|
|
|
|
title: "psisRecord" |
|
|
|
|
|
|
|
date: 2013-11-12 |
|
|
|
|
|
|
|
tags: database |
|
|
|
|
|
|
|
--- |
|
|
|
|
|
|
|
Now all data in the past will be in another database. MongoDB it is. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### เป้าหมาย |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* ข้อมูลที่เก็บไว้จะต้องมีมากพอที่จะสร้างรายงานใหม่ได้ทันที โดยไม่มีโอกาสที่จะมีข้อมูลหายไปได้ เช่น ข้อมูลไร้สาระอย่างรายละเอียดเพิ่มเติมอย่างตัวอย่างคำอธิบายตัวย่อค่าคงที่จะไม่จำเป็นต้องใส่เพราะซ้ำซ้อนและสามารถเรียกได้แน่นอน ทุกเวลาจากฐานข้อมูลหลัก |
|
|
|
|
|
|
|
* ข้อมูลจะต้องเข้าถึงง่ายเพื่อสร้างรายงานเปรียบเทียบให้กับสำนักงานต่างๆ ได้ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### buffer |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เป็นส่วนที่มีการคำนวณข้อมูลเพื่อเก็บไว้สำหรับรายงานต่อๆไป หลักๆ คือ ms* report เท่านั้นที่ใช้สำหรับตอนนี้ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), # report_date |
|
|
|
|
|
|
|
"report": "*", |
|
|
|
|
|
|
|
... |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### report |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1. ms_est_receipt |
|
|
|
|
|
|
|
2. ms_actual |
|
|
|
|
|
|
|
3. ms_actual_receipt |
|
|
|
|
|
|
|
4. ms_actual_diff_receipt |
|
|
|
|
|
|
|
5. ms_matrix |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ค่าหนังสือเรียน ใบเสร็จ ประมาณการ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), # report_date |
|
|
|
|
|
|
|
"report": "ms_est_receipt", |
|
|
|
|
|
|
|
"data": { |
|
|
|
|
|
|
|
... |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ค่าหนังสือเรียน นักเรียนที่มีอยู่จริง Jun 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), # report_date |
|
|
|
|
|
|
|
"report": "ms_actual", |
|
|
|
|
|
|
|
"data": { |
|
|
|
|
|
|
|
... |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ค่าหนังสือเรียน ใบสำคัญรับขอเบิกเพิ่มเติม Jun 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), # report_date |
|
|
|
|
|
|
|
"report": "ms_actual_diff_receipt", |
|
|
|
|
|
|
|
"data": { |
|
|
|
|
|
|
|
... |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ค่าหนังสือเรียน นักเรียนที่มีอยู่จริง Nov 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), # report_date |
|
|
|
|
|
|
|
"report": "ms_actual", |
|
|
|
|
|
|
|
"data": { |
|
|
|
|
|
|
|
... |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ค่าหนังสือเรียน ใบสำคัญรับขอเบิก Nov 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), # report_date |
|
|
|
|
|
|
|
"report": "ms_actual_receipt", |
|
|
|
|
|
|
|
"data": { |
|
|
|
|
|
|
|
... |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## report |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
หลักๆ ข้อมูลตรงนี้ก็เอาไว้ออกรายงานโดยที่ไม่จำเป็นต้องประมวลผลจากข้อมูลใหม่ (หรือข้อมูลดิบไม่มีแล้ว) รายงานก็มีประมาณ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1. sub1 |
|
|
|
|
|
|
|
1. sub2 |
|
|
|
|
|
|
|
1. sub3 |
|
|
|
|
|
|
|
1. sub4 |
|
|
|
|
|
|
|
1. sub5 |
|
|
|
|
|
|
|
1. sub6 |
|
|
|
|
|
|
|
1. salary |
|
|
|
|
|
|
|
1. payment |
|
|
|
|
|
|
|
1. sub4_fake |
|
|
|
|
|
|
|
1. ms_est |
|
|
|
|
|
|
|
1. ms_est_receipt |
|
|
|
|
|
|
|
1. ms_actual_jun10 |
|
|
|
|
|
|
|
1. ms_actual_jun10_receipt |
|
|
|
|
|
|
|
1. ms_matrix |
|
|
|
|
|
|
|
1. ms_actual_nov10 |
|
|
|
|
|
|
|
1. ms_actual_nov10_receipt |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### รายงาน อน.1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), # report_date |
|
|
|
|
|
|
|
"report": "sub1", |
|
|
|
|
|
|
|
"is_charity": true/false, |
|
|
|
|
|
|
|
"data": { |
|
|
|
|
|
|
|
'disabled': { |
|
|
|
|
|
|
|
'sum': 0, |
|
|
|
|
|
|
|
'shift': [ |
|
|
|
|
|
|
|
{}, # day shift |
|
|
|
|
|
|
|
{}, # night shift |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
'normal': { |
|
|
|
|
|
|
|
'sum': 0, |
|
|
|
|
|
|
|
'shift': [ ## list consisting of 0, 1 indicating shift |
|
|
|
|
|
|
|
{ # shift start |
|
|
|
|
|
|
|
u'1-0': { # grade and course |
|
|
|
|
|
|
|
'text': {'grade': '1', 'course': u'0'}, |
|
|
|
|
|
|
|
'number': |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
'boarding': 0, |
|
|
|
|
|
|
|
'normal': 296, |
|
|
|
|
|
|
|
'tuition': 1937.0, |
|
|
|
|
|
|
|
'disabled': 0, |
|
|
|
|
|
|
|
'rate': {'normal': 7793.0, 'charity': 0} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
... # another shift if applied |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
"total": { |
|
|
|
|
|
|
|
'normal': { |
|
|
|
|
|
|
|
'0': {'normal':0, 'charity':0, 'sum':0}, |
|
|
|
|
|
|
|
'1': {'normal':0, 'charity':0, 'sum':0}, |
|
|
|
|
|
|
|
'all':{'normal':0, 'charity':0, 'sum':0}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
'disabled': { |
|
|
|
|
|
|
|
'0': {'disabled':0, 'boarding':0, 'sum':0}, |
|
|
|
|
|
|
|
'1': {'disabled':0, 'boarding':0, 'sum':0}, |
|
|
|
|
|
|
|
'all': {'disabled':0, 'boarding':0, 'sum':0}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### รายงาน อน.2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), # report_date |
|
|
|
|
|
|
|
"report": "sub2", |
|
|
|
|
|
|
|
"is_charity": true/false, |
|
|
|
|
|
|
|
"data": { |
|
|
|
|
|
|
|
'0': { # shift ! |
|
|
|
|
|
|
|
'0': { # coarse grade |
|
|
|
|
|
|
|
'sum': { |
|
|
|
|
|
|
|
'abs_total': 0, |
|
|
|
|
|
|
|
'charity': 0, 'normal': 0, 'boarding': 0, 'disabled': 0, |
|
|
|
|
|
|
|
'teachers': 0, 'salary': 0, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
'crs': [ |
|
|
|
|
|
|
|
{ # room thing and teacher data |
|
|
|
|
|
|
|
"room": xx, "all_students": 0, "boarding": 0, "disabled": 0, "eligible": 0, |
|
|
|
|
|
|
|
"full_name": xxx, "education": yyy, "employment_date": yyyy-mm-dd, |
|
|
|
|
|
|
|
"employment_document_number": xxx, "salary": 0 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{}, |
|
|
|
|
|
|
|
{}, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
'extra': [ |
|
|
|
|
|
|
|
{ # only teacher data |
|
|
|
|
|
|
|
"full_name": xxx, "education": yyy, "employment_date": yyyy-mm-dd, |
|
|
|
|
|
|
|
"employment_document_number": xxx, "salary": 0 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{}, |
|
|
|
|
|
|
|
{}, |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
'1': { # coarse grade |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
'1': { # shift if applied |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
"total": { |
|
|
|
|
|
|
|
'0': {'abs_total': 0, 'normal': 0, 'boarding': 0, 'disabled': 0, 'teachers': 0, 'salary': 0,}, |
|
|
|
|
|
|
|
'1': {'abs_total': 0, 'normal': 0, 'boarding': 0, 'disabled': 0, 'teachers': 0, 'salary': 0,}, |
|
|
|
|
|
|
|
'all': {'abs_total': 0, 'normal': 0, 'boarding': 0, 'disabled': 0, 'teachers': 0, 'salary': 0,} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### รายงาน อน.3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), # report_date |
|
|
|
|
|
|
|
"report": "sub3", |
|
|
|
|
|
|
|
"is_charity": true/false, |
|
|
|
|
|
|
|
"data": { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### รายงาน อน.4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), # report_date |
|
|
|
|
|
|
|
"report": "sub4", |
|
|
|
|
|
|
|
"is_charity": true/false, |
|
|
|
|
|
|
|
"data": { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### รายงาน อน.5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), # report_date |
|
|
|
|
|
|
|
"report": "sub5", |
|
|
|
|
|
|
|
"is_charity": true/false, |
|
|
|
|
|
|
|
"data": { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### รายงาน อน.6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), # report_date |
|
|
|
|
|
|
|
"report": "sub6", |
|
|
|
|
|
|
|
"is_charity": true/false, |
|
|
|
|
|
|
|
"data": { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### บัญชีการจ่ายเงินเดือนครู |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), # report_date |
|
|
|
|
|
|
|
"report": "salary", |
|
|
|
|
|
|
|
"is_charity": true/false, |
|
|
|
|
|
|
|
"data": { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### หลักฐานการจ่ายเงินเดือนครู |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), # report_date |
|
|
|
|
|
|
|
"report": "payment", |
|
|
|
|
|
|
|
"is_charity": true/false, |
|
|
|
|
|
|
|
"data": { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### ข้อมูลเก็บเผื่อสร้าง อน.4 ย้อนหลัง |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), # report_date |
|
|
|
|
|
|
|
"report": "sub4_fake", |
|
|
|
|
|
|
|
"data": { |
|
|
|
|
|
|
|
# student detail count enough to feed ReportSub4Mixin.get_processed_data() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## stat |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### original data |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This is what data with all grades; no dob cut; no student_status considered; no issue considered; but we only sum student in class. Student without class is out of luck ever. This is a pure query. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), |
|
|
|
|
|
|
|
"type": "original", |
|
|
|
|
|
|
|
"data": { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### raw data without any cut |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Raw data which met basic requirements, no further cut. (shift isn't considered) This should meet few requirements: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* eligible grade |
|
|
|
|
|
|
|
* verified & completed classroom |
|
|
|
|
|
|
|
* date of birth |
|
|
|
|
|
|
|
* student_status |
|
|
|
|
|
|
|
* resolved issue students |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
From get_subsidized_students_queryset() w/o any cut. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), |
|
|
|
|
|
|
|
"type": "raw", |
|
|
|
|
|
|
|
"data": { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
นร. ประเภทสามัญศึกษา ที่มีสิทธิ์รับเงินอุดหนุนรายบุคคล |
|
|
|
|
|
|
|
Data from get_subsidized_students_in_fine_grade() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), |
|
|
|
|
|
|
|
"type": "educational", |
|
|
|
|
|
|
|
"data": { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
นร. ประเภทอาชีวศึกษา ที่มีสิทธิ์รับเงินอุดหนุนรายบุคคล |
|
|
|
|
|
|
|
Data from get_subsidized_students_in_fine_grade() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), |
|
|
|
|
|
|
|
"type": "technical", |
|
|
|
|
|
|
|
"data": { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
นร. พิการในโรงเรียนเอกชน ประเภทสามัญศึกษา |
|
|
|
|
|
|
|
Filter verified disabled people from get_subsidized_students_queryset(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), |
|
|
|
|
|
|
|
"type": "disabled_educational", |
|
|
|
|
|
|
|
"data": { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
นร. พิการในโรงเรียนเอกชน ประเภทอาชีวศึกษา |
|
|
|
|
|
|
|
Filter verified disabled people from get_subsidized_students_queryset(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), |
|
|
|
|
|
|
|
"type": "disabled_technical", |
|
|
|
|
|
|
|
"data": { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
นร. โรงเรียนการกุศล และโรงเรียนสอนศาสนาอิสลามควบคู่กับวิชาสามัญที่มีมูลนิธิ/มัสยิดเป็นผู้รับใบอนุญาต |
|
|
|
|
|
|
|
Data from evaluate_errors() which (school).is_charity() has to return True |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), |
|
|
|
|
|
|
|
"type": "charity", |
|
|
|
|
|
|
|
"data": { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## history |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เป็นการเก็บข้อมูลนักเรียนเข้า-ออกทั้งหมด จาก `archive_students_transfer` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"people_id": "<people_id>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), |
|
|
|
|
|
|
|
"transfer": "in/out", |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
... # depending on whether it's transfer IN/OUT |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data is pretty much the same way sub5/sub6 is. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## searchArchive |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* school [yearly data] |
|
|
|
|
|
|
|
* teacher [monthly data in/out only] |
|
|
|
|
|
|
|
* student [every in/out] |
|
|
|
|
|
|
|
* report [not implemented -- using report] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### school |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"archive_type": "school", |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"basic": { |
|
|
|
|
|
|
|
"thai_name": "<thai_name>", |
|
|
|
|
|
|
|
"eng_name": "<eng_name>", |
|
|
|
|
|
|
|
"serv_area_code": "<serv_area_code>", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
"board": { |
|
|
|
|
|
|
|
"licensee": {"people_id": "", "full_name": "",}, |
|
|
|
|
|
|
|
"manager": {"people_id": "", "full_name": "",}, |
|
|
|
|
|
|
|
"principle": {"people_id": "", "full_name": "",}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
"bank": { |
|
|
|
|
|
|
|
"account_number": "", |
|
|
|
|
|
|
|
"account_name": "", |
|
|
|
|
|
|
|
"bank": "", |
|
|
|
|
|
|
|
"bank_branch": "", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
"license": [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"license_number": "", |
|
|
|
|
|
|
|
"license_date": "", |
|
|
|
|
|
|
|
"license_effective_date": "", |
|
|
|
|
|
|
|
"age": [min, max], |
|
|
|
|
|
|
|
"shift": { |
|
|
|
|
|
|
|
"0": {"capacity": 0, "room": 0, "time": ["0", "0"], "grade": ["0", "0"]}, |
|
|
|
|
|
|
|
"1": {"capacity": 0, "room": 0, "time": ["0", "0"], "grade": ["0", "0"]}, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
## more items |
|
|
|
|
|
|
|
{}, {}, ... |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### teacher |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"archive_type": "teacher", |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"people_id": "", |
|
|
|
|
|
|
|
"full_name": "", |
|
|
|
|
|
|
|
"transfer_type": "<in/out>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), |
|
|
|
|
|
|
|
"editor": "<user_id>" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### student |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"archive_type": "student", |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"people_id": "", |
|
|
|
|
|
|
|
"full_name": "", |
|
|
|
|
|
|
|
"transfer_type": "<in/out>", |
|
|
|
|
|
|
|
"xfer_status": "<DC/RM/QT/GD/RL/DN/CF/IW/II/IO>", |
|
|
|
|
|
|
|
"student_id": "", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), |
|
|
|
|
|
|
|
"editor": "<user_id>" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### confirmation |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ข้อมูลในส่วนยืนยันข้อมูลถูกต้องในส่วนต่างๆ |
|
|
|
|
|
|
|
ส่วนยืนยันของโรงเรียน |
|
|
|
|
|
|
|
ยืนยันความถูกต้องประจำปี (เฉพาะเดือน 6) |
|
|
|
|
|
|
|
ยืนยันความถูกต้องประจำเดือน |
|
|
|
|
|
|
|
ส่วนยืนยันคุณภาพของข้อมูลของสำนักงาน |
|
|
|
|
|
|
|
ยืนยันการยื่นเอกสาร |
|
|
|
|
|
|
|
ยืนยันความถูกต้องของข้อมูล |
|
|
|
|
|
|
|
ส่วนยืนยันของโรงเรียน - ยืนยันความถูกต้องประจำปี (เฉพาะเดือน 6) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"user_id": 000, |
|
|
|
|
|
|
|
"username": "<username> or <email>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"what": "confirmation", |
|
|
|
|
|
|
|
"type": "monthly", # only student for now. |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ส่วนยืนยันของโรงเรียน - ยืนยันความถูกต้องประจำเดือน |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"user_id": 000, |
|
|
|
|
|
|
|
"username": "<username> or <email>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"what": "confirmation", |
|
|
|
|
|
|
|
"type": "yearly", # only student for now. |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ส่วนยืนยันคุณภาพของข้อมูลของสำนักงาน - ยืนยันการยื่นเอกสาร |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"user_id": 000, |
|
|
|
|
|
|
|
"username": "<username> or <email>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"office": "<office_id>", |
|
|
|
|
|
|
|
"what": "dataQuality", |
|
|
|
|
|
|
|
"type": "delivered", |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ส่วนยืนยันคุณภาพของข้อมูลของสำนักงาน - ยืนยันความถูกต้องของข้อมูล |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"user_id": 000, |
|
|
|
|
|
|
|
"username": "<username> or <email>", |
|
|
|
|
|
|
|
"date": ISODate("xxx"), |
|
|
|
|
|
|
|
"school": "<school_id>", |
|
|
|
|
|
|
|
"office": "<office_id>", |
|
|
|
|
|
|
|
"what": "dataQuality", |
|
|
|
|
|
|
|
"type": "completeness", |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### preferences |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System-wide's key-value storage. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
no. | name | value | description |
|
|
|
|
|
|
|
--- | --- | --- | --- |
|
|
|
|
|
|
|
1 | `subsidy_rate_header` | text | |
|
|
|
|
|
|
|
2 | `ms_est_first_level_cut` | decimal 0-1 | |
|
|
|
|
|
|
|
__System Preferences__ | via <br/> `core.get_system_pref()` `core.set_system_pref() `| | |
|
|
|
|
|
|
|
--- | --- | --- | --- |
|
|
|
|
|
|
|
3 | `enforce_disability_expiration_date` | boolean |
|
|
|
|
|
|
|
4 | `enforce_people_id_validation` | boolean |
|
|
|
|
|
|
|
5 | `backfill_reviews_in_progress` | boolean | no more running repetitive back-filling reviews ever |
|
|
|
|
|
|
|
6 | `check_student_issue_in_progress` | boolean | no more running repetitive task |
|
|
|
|
|
|
|
7 | `check_teacher_issue_in_progress` | boolean | no more running repetitive task |
|
|
|
|
|
|
|
8 | `sub4sum_in_progress` | boolean | no more running repetitive task |
|
|
|
|
|
|
|
9 | `sub4sum_office_in_progress` | boolean | no more running repetitive task |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
หัวเรื่องของ subsidy rate |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"year": "2013", |
|
|
|
|
|
|
|
"name": "subsidy_rate_header", |
|
|
|
|
|
|
|
"value": "xxxxxxxxxxx", |
|
|
|
|
|
|
|
"user": "<user_pk>", |
|
|
|
|
|
|
|
"username": "<username>", |
|
|
|
|
|
|
|
"date": "utc" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
อัตราตัดของการสนับสนุนตามการประมาณการของเรียนฟรี 15 ปี |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"year": "2013", |
|
|
|
|
|
|
|
"name": "ms_est_first_level_cut", |
|
|
|
|
|
|
|
"value": "xxxxxxxxxxx", # 0-1 (or 0-100%) [default 0.8] |
|
|
|
|
|
|
|
"user": "<user_pk>", |
|
|
|
|
|
|
|
"username": "<username>", |
|
|
|
|
|
|
|
"date": "utc" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
การบังคับใช้วันหมดอายุของนักเรียนพิการ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"name": "enforce_disability_expiration_date", |
|
|
|
|
|
|
|
"value": "true/false", # boolean |
|
|
|
|
|
|
|
"user": "<user_pk>", |
|
|
|
|
|
|
|
"date": "utc" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
การบังคับการตรวจสอบเลขประจำตัวประชาชนทั้งหมด |
|
|
|
|
|
|
|
ถ้าเปิด true -- จะทำให้เลขประจำตัวประชาชนที่ผิดหลักและยังไม่ได้ตรวจสอบไม่ได้รับอุดหนุน |
|
|
|
|
|
|
|
ถ้าปิด false -- เลขประจำตัวที่ผิดหลักและยังไม่ได้ตรวจสอบก็จะได้รับอุดหนุน |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"name": "enforce_people_id_validation", |
|
|
|
|
|
|
|
"value": "true/false", # boolean |
|
|
|
|
|
|
|
"user": "<user_pk>", |
|
|
|
|
|
|
|
"date": "utc" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## userPreferences |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ค่าต่างๆ ที่เกี่ยวกับ user โดยตรง |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"key": "logout_3rd_party_all_together", |
|
|
|
|
|
|
|
"value": "True/False", |
|
|
|
|
|
|
|
"user": "<user.pk>" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
จะเป็นค่าในกรณีที่ต้องการออกจากระบบของ Google/Yahoo ด้วย (Facebook ยังไม่ sign out เองอัตโนมัติ) เหมาะกับเครื่องที่ไม่ใช่ของตัวเองเพราะจะได้ไม่ sign in พวกนี้ค้างไว้ ถ้าออกจาก PSIS ก็ออกจาก Google/Yahoo ให้ด้วยทันที [ซึ่งนั่นคือค่า default] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## userData |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"_id": xx, |
|
|
|
|
|
|
|
"date": "utc", |
|
|
|
|
|
|
|
"user": "<user.pk>", |
|
|
|
|
|
|
|
"name": "", |
|
|
|
|
|
|
|
"value": "", |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ตอนนี้จะเก็บเพียงแค่ task_id ซึ่งจะถูกลบหลังผ่านไป 2-3 วัน เพราะยังไง celery result task ก็ไม่มีเก็บหลังจากนั้นอยู่ดี |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
name | value |
|
|
|
|
|
|
|
--- | --- |
|
|
|
|
|
|
|
task_id | <many many character> |