|
|
@@ -664,12 +664,14 @@ func (this *SamplesSourceController) AnimalList() {
|
|
|
name := this.GetString("Name")
|
|
|
innerno := this.GetString("InnerNo")
|
|
|
SurveyDate := this.GetString("SurveyDate")
|
|
|
+ CreateOn := this.GetString("CreateOn")
|
|
|
+ fmt.Println("[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p", CreateOn)
|
|
|
SourceType := this.GetString("SourceType")
|
|
|
Address := this.GetString("Address")
|
|
|
|
|
|
svc := samplessource.GetSamplesSourceService(utils.DBE)
|
|
|
where := " 1=1"
|
|
|
- orderby := "SurveyDate"
|
|
|
+ orderby := " CreateOn "
|
|
|
asc := false
|
|
|
Order := this.GetString("Order")
|
|
|
Prop := this.GetString("Prop")
|
|
|
@@ -696,6 +698,14 @@ func (this *SamplesSourceController) AnimalList() {
|
|
|
where = where + " and SurveyDate>='" + minDate + "' and SurveyDate<='" + maxDate + "'"
|
|
|
}
|
|
|
}
|
|
|
+ if CreateOn != "" {
|
|
|
+ dates := strings.Split(CreateOn, ",")
|
|
|
+ if len(dates) == 2 {
|
|
|
+ minDate := dates[0]
|
|
|
+ maxDate := dates[1]
|
|
|
+ where = where + " and CreateOn>='" + minDate + "' and CreateOn<='" + maxDate + "'"
|
|
|
+ }
|
|
|
+ }
|
|
|
if SourceType != "" {
|
|
|
where = where + " and SourceType = '" + SourceType + "'"
|
|
|
}
|
|
|
@@ -825,10 +835,10 @@ func (this *SamplesSourceController) EditAnimal() {
|
|
|
var jsonblob = this.Ctx.Input.RequestBody
|
|
|
json.Unmarshal(jsonblob, &model)
|
|
|
var entity samplessource.AnimalInfo
|
|
|
- model.ModifiedBy = this.User.Realname
|
|
|
+ model.ModifiedBy = this.User.Username
|
|
|
model.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
svc := samplessource.GetSamplesSourceService(utils.DBE)
|
|
|
- var cols []string = []string{"Genus", "InnerNo", "Name", "Amount", "Unit", "SourceType", "Weight", "Province", "ProvinceName", "City", "CityName", "Street", "StreetName", "Address", "AreaCode", "Longitude", "Latitude", "Altitude", "SurveyDate", "Remark", "ModifiedBy", "ModifiedUserId"}
|
|
|
+ var cols []string = []string{"Genus", "InnerNo", "Name", "Amount", "Unit", "SourceType", "Weight", "Province", "ProvinceName", "City", "CityName", "Street", "StreetName", "Address", "AreaCode", "Longitude", "Latitude", "Altitude", "SurveyDate", "ProjectId", "ProjectName", "Remark", "ModifiedBy", "ModifiedUserId"}
|
|
|
zback := svc.QueryZBackList(this.User.AccCode)
|
|
|
for i := 0; i < (len(zback)); i++ {
|
|
|
cols = append(cols, zback[i].Id)
|
|
|
@@ -869,6 +879,12 @@ func (this *SamplesSourceController) DelBioInfo() {
|
|
|
opdesc := "删除生物样本源-" + id
|
|
|
svc := samplessource.GetSamplesSourceService(utils.DBE)
|
|
|
err := svc.DeleteOperationAndWriteLogBytbl(this.User.AccCode+AnimaltbName, BaseOperationLogName, id, &entity, &entityempty, utils.ToStr(this.User.Id), this.User.Username, opdesc, this.User.AccCode, "样本来源")
|
|
|
+
|
|
|
+ if err == nil {
|
|
|
+ where_code := "SeqName = '" + id + "'"
|
|
|
+ svc.DeleteEntityBytbl(CodecSequenceName, where_code)
|
|
|
+ }
|
|
|
+
|
|
|
if err == nil {
|
|
|
errinfo.Message = "删除成功"
|
|
|
errinfo.Code = 0
|
|
|
@@ -882,7 +898,7 @@ func (this *SamplesSourceController) DelBioInfo() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// @Title 获取动物样本来源列表
|
|
|
+// @Title 获取微生物样本来源列表
|
|
|
// @Description get user by token
|
|
|
// @Success 200 {object} models.Userblood
|
|
|
// @router /microbiallist [get]
|