|
|
@@ -667,6 +667,8 @@ func (this *SamplesSourceController) AnimalList() {
|
|
|
CreateOn := this.GetString("CreateOn")
|
|
|
SourceType := this.GetString("SourceType")
|
|
|
Address := this.GetString("Address")
|
|
|
+ AuditorStatus := this.GetString("AuditorStatus")
|
|
|
+ AuditorName := this.GetString("AuditorName")
|
|
|
|
|
|
svc := samplessource.GetSamplesSourceService(utils.DBE)
|
|
|
where := " 1=1"
|
|
|
@@ -711,6 +713,12 @@ func (this *SamplesSourceController) AnimalList() {
|
|
|
if Address != "" {
|
|
|
where = where + " and ( ProvinceName like '%" + Address + "% or CityName like '%" + Address + "% or StreetName like '%" + Address + "% or Address like '%" + Address + "%)'"
|
|
|
}
|
|
|
+ if AuditorStatus != "" {
|
|
|
+ where = where + " and AuditorStatus = '" + AuditorStatus + "'"
|
|
|
+ }
|
|
|
+ if AuditorName != "" {
|
|
|
+ where = where + " and AuditorName = '" + AuditorName + "'"
|
|
|
+ }
|
|
|
|
|
|
total := svc.GetPagingEntitiesWithOrderBytbl(this.User.AccCode, page.CurrentPage, page.Size, orderby, asc, &list, where)
|
|
|
var datainfo DataInfo
|
|
|
@@ -897,6 +905,49 @@ func (this *SamplesSourceController) DelBioInfo() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// @Title 审核生物样本来源信息
|
|
|
+// @Description 审核生物样本来源信息
|
|
|
+// @Param id path string true
|
|
|
+// @Success 200 {object}
|
|
|
+// @router /auditoranimal/:id [put]
|
|
|
+func (this *SamplesSourceController) AuditorAnimal() {
|
|
|
+
|
|
|
+ //进行部分修改
|
|
|
+ id := this.Ctx.Input.Param(":id")
|
|
|
+ var errinfo ErrorInfo
|
|
|
+ if id == "" {
|
|
|
+ errinfo.Message = "操作失败!请求信息不完整"
|
|
|
+ errinfo.Code = -2
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var model samplessource.AnimalInfo
|
|
|
+ var jsonblob = this.Ctx.Input.RequestBody
|
|
|
+ json.Unmarshal(jsonblob, &model)
|
|
|
+ var entity samplessource.AnimalInfo
|
|
|
+ model.AuditorName = this.User.Realname
|
|
|
+ model.AuditorId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
+ model.ModifiedBy = this.User.Realname
|
|
|
+ model.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
+ svc := samplessource.GetSamplesSourceService(utils.DBE)
|
|
|
+ opdesc := "审核样本来源-" + model.Name
|
|
|
+ var cols []string = []string{"AuditorStatus", "AuditorId", "AuditorName", "AuditorRemark", "ModifiedBy", "ModifiedUserId"}
|
|
|
+ err := svc.UpdateDonorAndWriteLogBytbl(this.User.AccCode+AnimaltbName, this.User.AccCode+DonorslogtbName, id, &model, &entity, cols, utils.ToStr(this.User.Id), this.User.Username, opdesc, this.User.AccCode, "样本采集")
|
|
|
+
|
|
|
+ if err == nil {
|
|
|
+ errinfo.Message = "操作成功!"
|
|
|
+ errinfo.Code = 0
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ } else {
|
|
|
+ errinfo.Message = "操作失败!" + utils.AlertProcess(err.Error())
|
|
|
+ errinfo.Code = -1
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
// @Title 获取微生物样本来源列表
|
|
|
// @Description get user by token
|
|
|
// @Success 200 {object} models.Userblood
|