|
|
|
@ -3,6 +3,7 @@ package BaseStudentDao
|
|
|
|
|
import (
|
|
|
|
|
"dsBaseRpc/Const"
|
|
|
|
|
"dsBaseRpc/RpcService/BaseClass/BaseClassDao"
|
|
|
|
|
"dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationDao"
|
|
|
|
|
"dsBaseRpc/RpcService/BaseParent/BaseParentDao"
|
|
|
|
|
"dsBaseRpc/RpcService/BaseStudent/BaseStudentProto"
|
|
|
|
|
"dsBaseRpc/RpcService/SysDict/SysDictKit"
|
|
|
|
@ -19,6 +20,7 @@ import (
|
|
|
|
|
"dsBaseRpc/Utils/RedisUtil"
|
|
|
|
|
"dsBaseRpc/Utils/SqlKit"
|
|
|
|
|
"dsBaseRpc/models"
|
|
|
|
|
"errors"
|
|
|
|
|
"fmt"
|
|
|
|
|
"github.com/360EntSecGroup-Skylar/excelize/v2"
|
|
|
|
|
"github.com/xormplus/builder"
|
|
|
|
@ -142,7 +144,7 @@ func ExportStudentAccountInfoExcel(in *BaseStudentProto.ModelArg) ([]map[string]
|
|
|
|
|
InnerJoin("t_base_student as t2", "t1.person_id=t2.person_id").
|
|
|
|
|
InnerJoin("t_base_class as t3", "t2.class_id=t3.class_id").
|
|
|
|
|
InnerJoin("t_dm_stage as t4", "t3.stage_id=t4.stage_id").
|
|
|
|
|
InnerJoin("t_base_parent as t5","t2.person_id=t5.student_id")
|
|
|
|
|
InnerJoin("t_base_parent as t5", "t2.person_id=t5.student_id")
|
|
|
|
|
|
|
|
|
|
myBuilder.Where(builder.Eq{"t1.b_use": 1}).
|
|
|
|
|
And(builder.Eq{"t2.b_use": 1}).
|
|
|
|
@ -274,7 +276,7 @@ func ExportStudentInfoExcel(targetPath string, bureauId string, ExportExcelStatu
|
|
|
|
|
//单独填充上person_id,为了能在没有身份号的唯一标识的情况下,确定是新增还是修改
|
|
|
|
|
cName := "Q"
|
|
|
|
|
cName = cName + strconv.Itoa(i+2+ExcelUtil.HiddenRows)
|
|
|
|
|
f.SetCellValue(SheetName, cName, list[i]["person_id"])
|
|
|
|
|
_ = f.SetCellValue(SheetName, cName, list[i]["person_id"])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 6、根据指定路径保存文件
|
|
|
|
@ -985,3 +987,23 @@ func GetParentIds(studentIds []string) ([]string, error) {
|
|
|
|
|
}
|
|
|
|
|
return parentIds, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//学生的调转
|
|
|
|
|
func StudentTransfer(personId string, classId string) error {
|
|
|
|
|
//1、获取班级信息
|
|
|
|
|
list := SqlKit.QueryByIds([]string{classId}, "t_base_class")
|
|
|
|
|
if list == nil || len(list) == 0 {
|
|
|
|
|
return errors.New("没有找到指定的班级信息")
|
|
|
|
|
}
|
|
|
|
|
//单位ID
|
|
|
|
|
bureauId := list[0]["bureau_id"].(string)
|
|
|
|
|
_, provinceCode, cityCode, districtCode, mainSchoolId, _ := BaseOrganizationDao.GetBureauAdministrativeDivision(bureauId)
|
|
|
|
|
//2、修改学生信息
|
|
|
|
|
sql := `update t_base_student set bureau_id,class_id=?,province_code=?,city_code=?,district_code=?,main_school_id=? where student_id=? and b_use=1`
|
|
|
|
|
_,_=db.SQL(sql, bureauId, classId, provinceCode, cityCode, districtCode, mainSchoolId, personId).Execute()
|
|
|
|
|
//3、修改家长信息
|
|
|
|
|
sql = `update t_base_parent set bureau_id=?,class_id=?,province_code=?,city_code=?,district_code=?,main_school_id=? where student_id=? and b_use=1`
|
|
|
|
|
_,_=db.SQL(sql, bureauId, classId, provinceCode, cityCode, districtCode, mainSchoolId, personId).Execute()
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|