|
@@ -8,9 +8,15 @@ import (
|
|
|
"time"
|
|
"time"
|
|
|
|
|
|
|
|
"dashoo.cn/backend/api/business/baseUser"
|
|
"dashoo.cn/backend/api/business/baseUser"
|
|
|
|
|
+ "dashoo.cn/backend/api/business/donorsinfo"
|
|
|
|
|
+ "dashoo.cn/backend/api/business/extend"
|
|
|
"dashoo.cn/backend/api/business/logsinfo"
|
|
"dashoo.cn/backend/api/business/logsinfo"
|
|
|
"dashoo.cn/backend/api/business/operationlog"
|
|
"dashoo.cn/backend/api/business/operationlog"
|
|
|
|
|
+ "dashoo.cn/backend/api/business/samplenoteitem"
|
|
|
|
|
+ "dashoo.cn/backend/api/business/samplesinfo"
|
|
|
|
|
+ "dashoo.cn/backend/api/business/stypenoteitem"
|
|
|
. "dashoo.cn/backend/api/controllers"
|
|
. "dashoo.cn/backend/api/controllers"
|
|
|
|
|
+ "dashoo.cn/backend/api/mydb"
|
|
|
"dashoo.cn/utils"
|
|
"dashoo.cn/utils"
|
|
|
"dashoo.cn/utils/db"
|
|
"dashoo.cn/utils/db"
|
|
|
)
|
|
)
|
|
@@ -302,85 +308,85 @@ func (this *LoginfosController) List() {
|
|
|
// @Description 样本日志列表
|
|
// @Description 样本日志列表
|
|
|
// @Success 200 {object} business.device.DeviceChannels
|
|
// @Success 200 {object} business.device.DeviceChannels
|
|
|
// @router /samplelist [get]
|
|
// @router /samplelist [get]
|
|
|
-//func (this *LoginfosController) ListSampleLog() {
|
|
|
|
|
-// var data []logsinfo.SamplesLog
|
|
|
|
|
-// page := this.GetPageInfoForm()
|
|
|
|
|
-// CreateBy := this.GetString("CreateBy")
|
|
|
|
|
-// search := this.GetString("search")
|
|
|
|
|
-// CreateOnstart, _ := this.GetInt64("CreateOnstart")
|
|
|
|
|
-// CreateOnend, _ := this.GetInt64("CreateOnend")
|
|
|
|
|
-// sbarcode := this.GetString("sbarcode")
|
|
|
|
|
-// id := this.GetString("id")
|
|
|
|
|
-// where := " 1=1 "
|
|
|
|
|
-// if id != "" {
|
|
|
|
|
-// where = where + " and Id= " + id
|
|
|
|
|
-// }
|
|
|
|
|
-// if search != "" {
|
|
|
|
|
-// where = where + " and SampleCode like '%" + search + "%' "
|
|
|
|
|
-// }
|
|
|
|
|
-// if sbarcode != "" {
|
|
|
|
|
-// where = where + " and BarCode like '%" + sbarcode + "%' "
|
|
|
|
|
-// }
|
|
|
|
|
-// if CreateBy != "" {
|
|
|
|
|
-// where = where + "and CreateBy ='" + CreateBy + "'"
|
|
|
|
|
-// }
|
|
|
|
|
-// if CreateOnstart != 0 {
|
|
|
|
|
-// where = where + " and CreateOn >'" + time.Unix(CreateOnstart, 0).Format("2006-01-02") + "'"
|
|
|
|
|
-// }
|
|
|
|
|
-// if CreateOnend != 0 {
|
|
|
|
|
-// where = where + " and CreateOn <'" + time.Unix(CreateOnend, 0).Format("2006-01-02") + " 23:59:59'"
|
|
|
|
|
-// }
|
|
|
|
|
-// svc := samplesinfo.GetSamplesInfoService(utils.DBE)
|
|
|
|
|
-// total := svc.GetPagingEntitiesWithOrderBytbl(this.User.AccCode, page.CurrentPage, page.Size, "Id", false, &data, where)
|
|
|
|
|
-
|
|
|
|
|
-// var datainfo DataInfo
|
|
|
|
|
-// datainfo.Items = data
|
|
|
|
|
-// datainfo.CurrentItemCount = total
|
|
|
|
|
-// this.Data["json"] = &datainfo
|
|
|
|
|
-// this.ServeJSON()
|
|
|
|
|
-//}
|
|
|
|
|
|
|
+func (this *LoginfosController) ListSampleLog() {
|
|
|
|
|
+ var data []logsinfo.SamplesLog
|
|
|
|
|
+ page := this.GetPageInfoForm()
|
|
|
|
|
+ CreateBy := this.GetString("CreateBy")
|
|
|
|
|
+ search := this.GetString("search")
|
|
|
|
|
+ CreateOnstart, _ := this.GetInt64("CreateOnstart")
|
|
|
|
|
+ CreateOnend, _ := this.GetInt64("CreateOnend")
|
|
|
|
|
+ sbarcode := this.GetString("sbarcode")
|
|
|
|
|
+ id := this.GetString("id")
|
|
|
|
|
+ where := " 1=1 "
|
|
|
|
|
+ if id != "" {
|
|
|
|
|
+ where = where + " and Id= " + id
|
|
|
|
|
+ }
|
|
|
|
|
+ if search != "" {
|
|
|
|
|
+ where = where + " and SampleCode like '%" + search + "%' "
|
|
|
|
|
+ }
|
|
|
|
|
+ if sbarcode != "" {
|
|
|
|
|
+ where = where + " and BarCode like '%" + sbarcode + "%' "
|
|
|
|
|
+ }
|
|
|
|
|
+ if CreateBy != "" {
|
|
|
|
|
+ where = where + "and CreateBy ='" + CreateBy + "'"
|
|
|
|
|
+ }
|
|
|
|
|
+ if CreateOnstart != 0 {
|
|
|
|
|
+ where = where + " and CreateOn >'" + time.Unix(CreateOnstart, 0).Format("2006-01-02") + "'"
|
|
|
|
|
+ }
|
|
|
|
|
+ if CreateOnend != 0 {
|
|
|
|
|
+ where = where + " and CreateOn <'" + time.Unix(CreateOnend, 0).Format("2006-01-02") + " 23:59:59'"
|
|
|
|
|
+ }
|
|
|
|
|
+ svc := samplesinfo.GetSamplesInfoService(utils.DBE)
|
|
|
|
|
+ total := svc.GetPagingEntitiesWithOrderBytbl(this.User.AccCode, page.CurrentPage, page.Size, "Id", false, &data, where)
|
|
|
|
|
+
|
|
|
|
|
+ var datainfo DataInfo
|
|
|
|
|
+ datainfo.Items = data
|
|
|
|
|
+ datainfo.CurrentItemCount = total
|
|
|
|
|
+ this.Data["json"] = &datainfo
|
|
|
|
|
+ this.ServeJSON()
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
// @Title 样本来源日志列表
|
|
// @Title 样本来源日志列表
|
|
|
// @Description 样本来源日志列表
|
|
// @Description 样本来源日志列表
|
|
|
// @Success 200 {object} business.device.DeviceChannels
|
|
// @Success 200 {object} business.device.DeviceChannels
|
|
|
// @router /donorlist [get]
|
|
// @router /donorlist [get]
|
|
|
-//func (this *LoginfosController) ListDonorLog() {
|
|
|
|
|
-// var data []logsinfo.DonorsLog
|
|
|
|
|
-// page := this.GetPageInfoForm()
|
|
|
|
|
-// CreateBy := this.GetString("CreateBy")
|
|
|
|
|
-// sourcename := this.GetString("sourcename")
|
|
|
|
|
-// CreateOnstart, _ := this.GetInt64("CreateOnstart")
|
|
|
|
|
-// CreateOnend, _ := this.GetInt64("CreateOnend")
|
|
|
|
|
-// optype := this.GetString("optype")
|
|
|
|
|
-// id := this.GetString("id")
|
|
|
|
|
-// where := " 1=1 "
|
|
|
|
|
-// if id != "" {
|
|
|
|
|
-// where = where + " and Id= " + id
|
|
|
|
|
-// }
|
|
|
|
|
-// if sourcename != "" {
|
|
|
|
|
-// where = where + " and SourceName like '%" + sourcename + "%' "
|
|
|
|
|
-// }
|
|
|
|
|
-// if optype != "" {
|
|
|
|
|
-// where = where + " and OpType like '%" + optype + "%' "
|
|
|
|
|
-// }
|
|
|
|
|
-// if CreateBy != "" {
|
|
|
|
|
-// where = where + "and CreateBy ='" + CreateBy + "'"
|
|
|
|
|
-// }
|
|
|
|
|
-// if CreateOnstart != 0 {
|
|
|
|
|
-// where = where + " and CreateOn >'" + time.Unix(CreateOnstart, 0).Format("2006-01-02") + "'"
|
|
|
|
|
-// }
|
|
|
|
|
-// if CreateOnend != 0 {
|
|
|
|
|
-// where = where + " and CreateOn <'" + time.Unix(CreateOnend, 0).Format("2006-01-02") + " 23:59:59'"
|
|
|
|
|
-// }
|
|
|
|
|
-// svc := donorsinfo.GetDonorsInfoService(utils.DBE)
|
|
|
|
|
-// total := svc.GetPagingEntitiesWithOrderBytbl(this.User.AccCode, page.CurrentPage, page.Size, "Id", false, &data, where)
|
|
|
|
|
-
|
|
|
|
|
-// var datainfo DataInfo
|
|
|
|
|
-// datainfo.Items = data
|
|
|
|
|
-// datainfo.CurrentItemCount = total
|
|
|
|
|
-// this.Data["json"] = &datainfo
|
|
|
|
|
-// this.ServeJSON()
|
|
|
|
|
-//}
|
|
|
|
|
|
|
+func (this *LoginfosController) ListDonorLog() {
|
|
|
|
|
+ var data []logsinfo.DonorsLog
|
|
|
|
|
+ page := this.GetPageInfoForm()
|
|
|
|
|
+ CreateBy := this.GetString("CreateBy")
|
|
|
|
|
+ sourcename := this.GetString("sourcename")
|
|
|
|
|
+ CreateOnstart, _ := this.GetInt64("CreateOnstart")
|
|
|
|
|
+ CreateOnend, _ := this.GetInt64("CreateOnend")
|
|
|
|
|
+ optype := this.GetString("optype")
|
|
|
|
|
+ id := this.GetString("id")
|
|
|
|
|
+ where := " 1=1 "
|
|
|
|
|
+ if id != "" {
|
|
|
|
|
+ where = where + " and Id= " + id
|
|
|
|
|
+ }
|
|
|
|
|
+ if sourcename != "" {
|
|
|
|
|
+ where = where + " and SourceName like '%" + sourcename + "%' "
|
|
|
|
|
+ }
|
|
|
|
|
+ if optype != "" {
|
|
|
|
|
+ where = where + " and OpType like '%" + optype + "%' "
|
|
|
|
|
+ }
|
|
|
|
|
+ if CreateBy != "" {
|
|
|
|
|
+ where = where + "and CreateBy ='" + CreateBy + "'"
|
|
|
|
|
+ }
|
|
|
|
|
+ if CreateOnstart != 0 {
|
|
|
|
|
+ where = where + " and CreateOn >'" + time.Unix(CreateOnstart, 0).Format("2006-01-02") + "'"
|
|
|
|
|
+ }
|
|
|
|
|
+ if CreateOnend != 0 {
|
|
|
|
|
+ where = where + " and CreateOn <'" + time.Unix(CreateOnend, 0).Format("2006-01-02") + " 23:59:59'"
|
|
|
|
|
+ }
|
|
|
|
|
+ svc := donorsinfo.GetDonorsInfoService(utils.DBE)
|
|
|
|
|
+ total := svc.GetPagingEntitiesWithOrderBytbl(this.User.AccCode, page.CurrentPage, page.Size, "Id", false, &data, where)
|
|
|
|
|
+
|
|
|
|
|
+ var datainfo DataInfo
|
|
|
|
|
+ datainfo.Items = data
|
|
|
|
|
+ datainfo.CurrentItemCount = total
|
|
|
|
|
+ this.Data["json"] = &datainfo
|
|
|
|
|
+ this.ServeJSON()
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
// @Title 样本日志列表
|
|
// @Title 样本日志列表
|
|
|
// @Description 样本日志列表
|
|
// @Description 样本日志列表
|
|
@@ -464,36 +470,60 @@ func (this *LoginfosController) ListLoginLog() {
|
|
|
// @Description 样本日志列表详情
|
|
// @Description 样本日志列表详情
|
|
|
// @Success 200 {object} business.device.DeviceChannels
|
|
// @Success 200 {object} business.device.DeviceChannels
|
|
|
// @router /samplelistinfo [get]
|
|
// @router /samplelistinfo [get]
|
|
|
-//func (this *LoginfosController) SamplesInfo() {
|
|
|
|
|
-// id := this.GetString("id")
|
|
|
|
|
-// svc := samplesinfo.GetSamplesInfoService(utils.DBE)
|
|
|
|
|
-// logmodel := svc.GetContantById(this.User.AccCode+SamplesLogtbName, id)
|
|
|
|
|
-// this.Data["logmodel"] = logmodel
|
|
|
|
|
-// switch logmodel.TableName {
|
|
|
|
|
-// case "SamplesMain":
|
|
|
|
|
-// this.GetLog_Info(logmodel.TableName, logmodel, svc, &SamplesMain_Log{}, &SamplesMain_Log{}, logmodel.SampleType)
|
|
|
|
|
-// case "SamplesInfoShow":
|
|
|
|
|
-// this.GetLog_Info(logmodel.TableName, logmodel, svc, &SamplesInfoShow_Log{}, &SamplesInfoShow_Log{}, logmodel.SampleType)
|
|
|
|
|
-// }
|
|
|
|
|
-//}
|
|
|
|
|
-
|
|
|
|
|
-//func (this *LoginfosController) GetLog_Info(tname string, logmodel *mydb.SamplesLog, svc *samplesinfo.SamplesInfoService, m1 interface{}, m2 interface{}, sampletype int) {
|
|
|
|
|
-// json.Unmarshal([]byte(logmodel.RecordData), m1)
|
|
|
|
|
-// var datatr2 string
|
|
|
|
|
-// if logmodel.TableName == "SamplesMain" {
|
|
|
|
|
-// datatr2 = svc.GetNextContantById(this.User.AccCode+SamplesLogtbName, utils.ToStr(logmodel.Id), this.User.AccCode+SamplesMaintbName, logmodel.MId, m2)
|
|
|
|
|
-// } else if logmodel.TableName == "SamplesInfoShow" {
|
|
|
|
|
-// datatr2 = svc.GetNextContantShowInfoById(this.User.AccCode+SamplesLogtbName, utils.ToStr(logmodel.Id), logmodel.RecordId, m2, this.User.AccCode)
|
|
|
|
|
-// }
|
|
|
|
|
-
|
|
|
|
|
-// json.Unmarshal([]byte(datatr2), m2)
|
|
|
|
|
-// maplistpublic, maplistprivate := GetSamplePublicNoteNameMap(this.User.AccCode)
|
|
|
|
|
-// data := LogcomparefuncByNoteSample(m1, m2, maplistpublic, maplistprivate, sampletype)
|
|
|
|
|
-// var datainfo DataInfo
|
|
|
|
|
-// datainfo.Items = data
|
|
|
|
|
-// this.Data["json"] = &datainfo
|
|
|
|
|
-// this.ServeJSON()
|
|
|
|
|
-//}
|
|
|
|
|
|
|
+func (this *LoginfosController) SamplesInfo() {
|
|
|
|
|
+ id := this.GetString("id")
|
|
|
|
|
+ svc := samplesinfo.GetSamplesInfoService(utils.DBE)
|
|
|
|
|
+ logmodel := svc.GetContantById(this.User.AccCode+SamplesLogtbName, id)
|
|
|
|
|
+ this.Data["logmodel"] = logmodel
|
|
|
|
|
+ switch logmodel.TableName {
|
|
|
|
|
+ case "SamplesMain":
|
|
|
|
|
+ this.GetLog_Info(logmodel.TableName, logmodel, svc, &SamplesMain_Log{}, &SamplesMain_Log{}, logmodel.SampleType)
|
|
|
|
|
+ case "SamplesInfoShow":
|
|
|
|
|
+ this.GetLog_Info(logmodel.TableName, logmodel, svc, &SamplesInfoShow_Log{}, &SamplesInfoShow_Log{}, logmodel.SampleType)
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+func (this *LoginfosController) GetLog_Info(tname string, logmodel *mydb.SamplesLog, svc *samplesinfo.SamplesInfoService, m1 interface{}, m2 interface{}, sampletype int) {
|
|
|
|
|
+ json.Unmarshal([]byte(logmodel.RecordData), m1)
|
|
|
|
|
+ var datatr2 string
|
|
|
|
|
+ if logmodel.TableName == "SamplesMain" {
|
|
|
|
|
+ datatr2 = svc.GetNextContantById(this.User.AccCode+SamplesLogtbName, utils.ToStr(logmodel.Id), this.User.AccCode+SamplesMaintbName, logmodel.MId, m2)
|
|
|
|
|
+ } else if logmodel.TableName == "SamplesInfoShow" {
|
|
|
|
|
+ datatr2 = svc.GetNextContantShowInfoById(this.User.AccCode+SamplesLogtbName, utils.ToStr(logmodel.Id), logmodel.RecordId, m2, this.User.AccCode)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ json.Unmarshal([]byte(datatr2), m2)
|
|
|
|
|
+ maplistpublic, maplistprivate := GetSamplePublicNoteNameMap(this.User.AccCode)
|
|
|
|
|
+ data := LogcomparefuncByNoteSample(m1, m2, maplistpublic, maplistprivate, sampletype)
|
|
|
|
|
+ var datainfo DataInfo
|
|
|
|
|
+ datainfo.Items = data
|
|
|
|
|
+ this.Data["json"] = &datainfo
|
|
|
|
|
+ this.ServeJSON()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+//获取扩展map
|
|
|
|
|
+func GetSamplePublicNoteNameMap(acccode string) (map[string]string, map[string]string) {
|
|
|
|
|
+ var PublicNoteitemList []samplenoteitem.SamplesNoteItem
|
|
|
|
|
+ svcdnote := samplenoteitem.GetSampleNoteItemService(utils.DBE)
|
|
|
|
|
+ wherenote := " AccCode='" + acccode + "'"
|
|
|
|
|
+ PublicNoteitemList = svcdnote.GetDNoteItemList(wherenote)
|
|
|
|
|
+
|
|
|
|
|
+ map_listpublic := make(map[string]string)
|
|
|
|
|
+ for i := 0; i < len(PublicNoteitemList); i++ {
|
|
|
|
|
+ map_listpublic[utils.ToStr(PublicNoteitemList[i].FieldName)] = PublicNoteitemList[i].Name
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ map_listprivate := make(map[string]string)
|
|
|
|
|
+ var sampletypedata []stypenoteitem.STypeNoteItem
|
|
|
|
|
+ svc1 := stypenoteitem.GetSTypenoteitemService(utils.DBE)
|
|
|
|
|
+ where := " AccCode='" + acccode + "' order by SampleType "
|
|
|
|
|
+ sampletypedata = svc1.GetSTypenoteitemSearch(where)
|
|
|
|
|
+ for i := 0; i < len(sampletypedata); i++ {
|
|
|
|
|
+ map_listprivate[utils.ToStr(sampletypedata[i].FieldName)+"-"+utils.ToStr(sampletypedata[i].SampleType)] = sampletypedata[i].Name
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return map_listpublic, map_listprivate
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
func LogcomparefuncByNoteSample(m1, m2 interface{}, map_listpublic, map_listprivate map[string]string, sampletype int) []Logcompare {
|
|
func LogcomparefuncByNoteSample(m1, m2 interface{}, map_listpublic, map_listprivate map[string]string, sampletype int) []Logcompare {
|
|
|
objT1 := reflect.TypeOf(m1).Elem()
|
|
objT1 := reflect.TypeOf(m1).Elem()
|
|
@@ -591,40 +621,40 @@ func LogcomparefuncByNoteSample(m1, m2 interface{}, map_listpublic, map_listpriv
|
|
|
// @Description 样本日志列表详情
|
|
// @Description 样本日志列表详情
|
|
|
// @Success 200 {object} business.device.DeviceChannels
|
|
// @Success 200 {object} business.device.DeviceChannels
|
|
|
// @router /donorlistinfo [get]
|
|
// @router /donorlistinfo [get]
|
|
|
-//func (this *LoginfosController) DonorsInfo() {
|
|
|
|
|
-// id := this.GetString("id")
|
|
|
|
|
-// svc := donorsinfo.GetDonorsInfoService(utils.DBE)
|
|
|
|
|
-// logmodel := svc.GetContantById(this.User.AccCode+DonorslogtbName, id)
|
|
|
|
|
-// this.Data["logmodel"] = logmodel
|
|
|
|
|
-// switch logmodel.TableName {
|
|
|
|
|
-// case "DonorsInfo":
|
|
|
|
|
-// this.GetLog_DonorsInfo(logmodel.TableName, logmodel, svc, &DonorsInfo_log{}, &DonorsInfo_log{})
|
|
|
|
|
-// }
|
|
|
|
|
-//}
|
|
|
|
|
-
|
|
|
|
|
-//func (this *LoginfosController) GetLog_DonorsInfo(tname string, logmodel *mydb.DonorsLog, svc *donorsinfo.DonorsInfoService, m1 interface{}, m2 interface{}) {
|
|
|
|
|
-// json.Unmarshal([]byte(logmodel.RecordData), m1)
|
|
|
|
|
-// datatr2 := svc.GetNextContantById(this.User.AccCode+DonorslogtbName, utils.ToStr(logmodel.Id), this.User.AccCode+DonorstbName, logmodel.RecordId, m2)
|
|
|
|
|
-// json.Unmarshal([]byte(datatr2), m2)
|
|
|
|
|
-// maplist := GetDonorNoteNameMap(this.User.AccCode)
|
|
|
|
|
-// data := LogcomparefuncByNote(m1, m2, maplist)
|
|
|
|
|
-// var datainfo DataInfo
|
|
|
|
|
-// datainfo.Items = data
|
|
|
|
|
-// this.Data["json"] = &datainfo
|
|
|
|
|
-// this.ServeJSON()
|
|
|
|
|
-//}
|
|
|
|
|
-
|
|
|
|
|
-//func GetDonorNoteNameMap(acccode string) map[string]string {
|
|
|
|
|
-// svcdnote := extend.GetExtendService(utils.DBE)
|
|
|
|
|
-// where1 := " AccCode='" + acccode + "' "
|
|
|
|
|
-// var DnoteitemList []extend.DonorsNoteItem
|
|
|
|
|
-// DnoteitemList = svcdnote.GetDNoteItemList(where1)
|
|
|
|
|
-// map_list := make(map[string]string)
|
|
|
|
|
-// for i := 0; i < len(DnoteitemList); i++ {
|
|
|
|
|
-// map_list[utils.ToStr(DnoteitemList[i].FieldName)] = DnoteitemList[i].Name
|
|
|
|
|
-// }
|
|
|
|
|
-// return map_list
|
|
|
|
|
-//}
|
|
|
|
|
|
|
+func (this *LoginfosController) DonorsInfo() {
|
|
|
|
|
+ id := this.GetString("id")
|
|
|
|
|
+ svc := donorsinfo.GetDonorsInfoService(utils.DBE)
|
|
|
|
|
+ logmodel := svc.GetContantById(this.User.AccCode+DonorslogtbName, id)
|
|
|
|
|
+ this.Data["logmodel"] = logmodel
|
|
|
|
|
+ switch logmodel.TableName {
|
|
|
|
|
+ case "DonorsInfo":
|
|
|
|
|
+ this.GetLog_DonorsInfo(logmodel.TableName, logmodel, svc, &DonorsInfo_log{}, &DonorsInfo_log{})
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+func (this *LoginfosController) GetLog_DonorsInfo(tname string, logmodel *mydb.DonorsLog, svc *donorsinfo.DonorsInfoService, m1 interface{}, m2 interface{}) {
|
|
|
|
|
+ json.Unmarshal([]byte(logmodel.RecordData), m1)
|
|
|
|
|
+ datatr2 := svc.GetNextContantById(this.User.AccCode+DonorslogtbName, utils.ToStr(logmodel.Id), this.User.AccCode+DonorstbName, logmodel.RecordId, m2)
|
|
|
|
|
+ json.Unmarshal([]byte(datatr2), m2)
|
|
|
|
|
+ maplist := GetDonorNoteNameMap(this.User.AccCode)
|
|
|
|
|
+ data := LogcomparefuncByNote(m1, m2, maplist)
|
|
|
|
|
+ var datainfo DataInfo
|
|
|
|
|
+ datainfo.Items = data
|
|
|
|
|
+ this.Data["json"] = &datainfo
|
|
|
|
|
+ this.ServeJSON()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+func GetDonorNoteNameMap(acccode string) map[string]string {
|
|
|
|
|
+ svcdnote := extend.GetExtendService(utils.DBE)
|
|
|
|
|
+ where1 := " AccCode='" + acccode + "' "
|
|
|
|
|
+ var DnoteitemList []extend.DonorsNoteItem
|
|
|
|
|
+ DnoteitemList = svcdnote.GetDNoteItemList(where1)
|
|
|
|
|
+ map_list := make(map[string]string)
|
|
|
|
|
+ for i := 0; i < len(DnoteitemList); i++ {
|
|
|
|
|
+ map_list[utils.ToStr(DnoteitemList[i].FieldName)] = DnoteitemList[i].Name
|
|
|
|
|
+ }
|
|
|
|
|
+ return map_list
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
func LogcomparefuncByNote(m1, m2 interface{}, map_list map[string]string) []Logcompare {
|
|
func LogcomparefuncByNote(m1, m2 interface{}, map_list map[string]string) []Logcompare {
|
|
|
objT1 := reflect.TypeOf(m1).Elem()
|
|
objT1 := reflect.TypeOf(m1).Elem()
|