Merge branch 'master' of 10.10.14.250:huanghai/dsMin

master
wubin 5 years ago
commit 02aa1e5d56

@ -22,7 +22,7 @@
"width": 30 "width": 30
}, },
{ {
"col_name": "登录", "col_name": "登录账号",
"col_field": "login_name", "col_field": "login_name",
"width": 30 "width": 30
}, },

@ -1,5 +1,5 @@
{ {
"title": "单位管理员账号", "title": "市级机构管理员账号",
"cols": [ "cols": [
{ {
"col_name": "序号", "col_name": "序号",

@ -0,0 +1,25 @@
{
"title": "区县级机构管理员账号",
"cols": [
{
"col_name": "序号",
"col_field": "number",
"width": 15
},
{
"col_name": "管理员名称",
"col_field": "person_name",
"width": 40
},
{
"col_name": "登录名",
"col_field": "login_name",
"width": 30
},
{
"col_name": "初始密码",
"col_field": "original_pwd",
"width": 20
}
]
}

@ -23,4 +23,8 @@ go get github.com/go-delve/delve/cmd/dlv
# Goland配置方法 # Goland配置方法
https://www.jianshu.com/p/e74e940a64d9 https://www.jianshu.com/p/e74e940a64d9
dlv --listen=:2345 --headless=true --api-version=2 exec ./dsBaseRpc dlv --listen=:2345 --headless=true --api-version=2 exec ./dsBaseRpc
//构建一个强制转换的错误~~~~
//panic(400)

@ -10,7 +10,6 @@ import (
"dsBaseRpc/Utils/SqlKit" "dsBaseRpc/Utils/SqlKit"
"dsBaseRpc/models" "dsBaseRpc/models"
"errors" "errors"
"fmt"
"github.com/xormplus/builder" "github.com/xormplus/builder"
"strings" "strings"
"time" "time"
@ -169,10 +168,6 @@ func PageBaseOrganization(in *BaseOrganizationProto.QueryArg) ([]map[string]inte
//通过SQL获取带缓存的数据 //通过SQL获取带缓存的数据
list, count, err := SqlKit.QueryForPk(sql) list, count, err := SqlKit.QueryForPk(sql)
//构建一个强制转换的错误~~~~
fmt.Println(list[0]["bureau_id"].(int64))
//修改密码的显示项目 //修改密码的显示项目
SysLoginpersonDao.FillPwd(&list) SysLoginpersonDao.FillPwd(&list)
return list, count, err return list, count, err

@ -206,7 +206,7 @@ func ExportStudentInfoExcel(targetPath string, bureauId string, ExportExcelStatu
if ExportExcelStatus > 0 { if ExportExcelStatus > 0 {
//将现有数据填充到下载的模板中 //将现有数据填充到下载的模板中
var myBuilder = builder.Dialect(builder.MYSQL).Select(`t2.stage_id,t2.rxnf,t2.bh,t1.xm, var myBuilder = builder.Dialect(builder.MYSQL).Select(`t2.stage_id,t2.rxnf,t2.bh,t1.xm,
(case t1.sfzjh when '-1' then '' else t1.sfzjh end ) as sfzjh, (case t1.sfzjh when '-1' then '' else t1.sfzjh end ) as sfzjh,
t1.mzm,t1.zzmmm,t1.sfzjlxm,t1.dszybz,t1.sqznbz,t1.jcwgrysqznbz, t1.mzm,t1.zzmmm,t1.sfzjlxm,t1.dszybz,t1.sqznbz,t1.jcwgrysqznbz,
t1.gebz,t1.lsetbz,t1.cjbz`). t1.gebz,t1.lsetbz,t1.cjbz`).
From("t_base_student as t1").InnerJoin("t_base_class as t2", "t1.class_id=t2.class_id"). From("t_base_student as t1").InnerJoin("t_base_class as t2", "t1.class_id=t2.class_id").

@ -270,14 +270,14 @@ func ExportTeacherInfoExcel(targetPath string, bureauId string, ExportExcelStatu
} }
//学段限定 //学段限定
dvRange := excelize.NewDataValidation(true) dvRange := excelize.NewDataValidation(true)
dvRange.Sqref = "K" + CommonUtil.ConvertIntToString(ExcelUtil.HiddenRows+2) + ":L" + CommonUtil.ConvertIntToString(ExcelUtil.RowsCount+ExcelUtil.HiddenRows) dvRange.Sqref = "K" + CommonUtil.ConvertIntToString(ExcelUtil.HiddenRows+2) + ":K" + CommonUtil.ConvertIntToString(ExcelUtil.RowsCount+ExcelUtil.HiddenRows)
dvRange.SetSqrefDropList("$"+startDictCName+"$1:$"+stopDictCName+"$1", true) dvRange.SetSqrefDropList("$"+startDictCName+"$1:$"+stopDictCName+"$1", true)
f.AddDataValidation(SheetName, dvRange) f.AddDataValidation(SheetName, dvRange)
//学科级联绑定 //学科级联绑定
dvRange = excelize.NewDataValidation(true) dvRange = excelize.NewDataValidation(true)
dvRange.Sqref = "L" + CommonUtil.ConvertIntToString(2+ExcelUtil.HiddenRows) + ":M" + CommonUtil.ConvertIntToString(ExcelUtil.RowsCount+ExcelUtil.HiddenRows) dvRange.Sqref = "L" + CommonUtil.ConvertIntToString(2+ExcelUtil.HiddenRows) + ":L" + CommonUtil.ConvertIntToString(ExcelUtil.RowsCount+ExcelUtil.HiddenRows)
dvRange.SetSqrefDropList("INDIRECT($L"+CommonUtil.ConvertIntToString(ExcelUtil.HiddenRows+2)+")", true) dvRange.SetSqrefDropList("INDIRECT($K"+CommonUtil.ConvertIntToString(ExcelUtil.HiddenRows+2)+")", true)
f.AddDataValidation(SheetName, dvRange) f.AddDataValidation(SheetName, dvRange)
//部门 //部门

@ -255,8 +255,13 @@ func (s *Rpc) PageSysLoginpersonExcel(ctx context.Context, in *SysLoginpersonPro
LogUtil.Error(ErrorConst.SqlQueryError, "执行PageSysLoginperson时发生严重错误"+err.Error()) LogUtil.Error(ErrorConst.SqlQueryError, "执行PageSysLoginperson时发生严重错误"+err.Error())
return &reply, err return &reply, err
} }
//1、配置文件 //6位我们需要取最后两位
jsonTemplate := "sysLoginperson_account.json" //配置文件
jsonTemplate := "sysLoginperson_account_city.json"
//如果是县区,那么修改一下配置文件名称
if in.AreaCode[4:6]!="00" {
jsonTemplate = "sysLoginperson_account_district.json"
}
//2、导出 //2、导出
TargetPath := CommonUtil.GetExportExcelFilePath() TargetPath := CommonUtil.GetExportExcelFilePath()
ExcelUtil.ExportExcel(jsonTemplate, list, TargetPath) ExcelUtil.ExportExcel(jsonTemplate, list, TargetPath)

@ -1,24 +1,21 @@
package Test package Test
import ( import (
"dsBaseRpc/Const"
"dsBaseRpc/RpcService/BaseStudent/BaseStudentDao" "dsBaseRpc/RpcService/BaseStudent/BaseStudentDao"
"dsBaseRpc/RpcService/BaseTeacher/BaseTeacherDao"
"github.com/360EntSecGroup-Skylar/excelize/v2"
"testing" "testing"
) )
func TestStyle(t *testing.T) { func TestStyle(t *testing.T) {
excelPath := `E:\Work\dsMin\dsBaseRpc\Config\ImportExcelTemplate\teacher.xlsx` //excelPath := `E:\Work\dsMin\dsBaseRpc\Config\ImportExcelTemplate\teacher.xlsx`
tPath := `E:\Work\dsMin\dsBaseRpc\Config\ImportExcelTemplate\teacher2222.xlsx` //tPath := `E:\Work\dsMin\dsBaseRpc\Config\ImportExcelTemplate\teacher2222.xlsx`
f, _ := excelize.OpenFile(excelPath) //f, _ := excelize.OpenFile(excelPath)
//
style, _ := f.GetCellStyle("教工信息", Const.RedCell) //style, _ := f.GetCellStyle("教工信息", Const.RedCell)
f.SetCellStyle("教工信息", "A202", "A202", style) //f.SetCellStyle("教工信息", "A202", "A202", style)
//
if err := f.SaveAs(tPath); err != nil { //if err := f.SaveAs(tPath); err != nil {
println(err.Error()) // println(err.Error())
} //}
} }
func TestImportTeacher(t *testing.T) { func TestImportTeacher(t *testing.T) {
@ -41,10 +38,10 @@ func TestImportTeacher(t *testing.T) {
*/ */
func TestTeacherExportExcel(t *testing.T) { func TestTeacherExportExcel(t *testing.T) {
//哪个单位 //哪个单位
bureauId := "042F28BE-296C-40F4-8AD4-A68A6D852CF0" //bureauId := "042F28BE-296C-40F4-8AD4-A68A6D852CF0"
//文件在哪里 ////文件在哪里
fileName := "E:\\Work\\dsMin\\dsBaseWeb\\Html\\ExcelTemp\\" + bureauId + ".xlsx" //fileName := "E:\\Work\\dsMin\\dsBaseWeb\\Html\\ExcelTemp\\" + bureauId + ".xlsx"
BaseTeacherDao.ExportTeacherInfoExcel(fileName, bureauId, 1) //BaseTeacherDao.ExportTeacherInfoExcel(fileName, bureauId, 1)
} }
/** /**
@ -54,7 +51,7 @@ func TestTeacherExportExcel(t *testing.T) {
*/ */
func TestStudentExportExcel(t *testing.T) { func TestStudentExportExcel(t *testing.T) {
//哪个单位 //哪个单位
bureauId := "042F28BE-296C-40F4-8AD4-A68A6D852CF0" bureauId := "7ED4080B-924F-40F0-9004-881A2B833E44"
//文件在哪里 //文件在哪里
fileName := "E:\\Work\\dsMin\\dsBaseWeb\\Html\\ExcelTemp\\" + bureauId + ".xlsx" fileName := "E:\\Work\\dsMin\\dsBaseWeb\\Html\\ExcelTemp\\" + bureauId + ".xlsx"
BaseStudentDao.ExportStudentInfoExcel(fileName, bureauId, 1, []string{}) BaseStudentDao.ExportStudentInfoExcel(fileName, bureauId, 1, []string{})

Loading…
Cancel
Save