|
|
@@ -299,14 +299,30 @@ func (this *LimsDataEntryController) GetToDoList() {
|
|
|
orderby := "a.Id desc"
|
|
|
Order := this.GetString("Order")
|
|
|
Prop := this.GetString("Prop")
|
|
|
+ ENumber := this.GetString("ENumber")
|
|
|
if Order != "" && Prop != "" {
|
|
|
orderby = Prop + " " + Order
|
|
|
+ _, list := svc.GetBalanceEntrySerch(this.User.AccCode+LimsTaskBalanceName, this.User.AccCode+LimsDateEntryName, this.User.AccCode+LimsEntrustMainName, page.CurrentPage, page.Size, orderby, where)
|
|
|
+ if len(list) == 0 {
|
|
|
+ orderby = " a." + Prop + " " + Order
|
|
|
+ _, list := svc.GetBalanceEntrySerch(this.User.AccCode+LimsTaskBalanceName, this.User.AccCode+LimsDateEntryName, this.User.AccCode+LimsEntrustMainName, page.CurrentPage, page.Size, orderby, where)
|
|
|
+ if len(list) == 0 {
|
|
|
+ orderby = " b." + Prop + " " + Order
|
|
|
+ _, list := svc.GetBalanceEntrySerch(this.User.AccCode+LimsTaskBalanceName, this.User.AccCode+LimsDateEntryName, this.User.AccCode+LimsEntrustMainName, page.CurrentPage, page.Size, orderby, where)
|
|
|
+ if len(list) == 0 {
|
|
|
+ orderby = " c." + Prop + " " + Order
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
where += " and b.BalanceStatus <> 0 "
|
|
|
|
|
|
if EntrustNo != "" {
|
|
|
where = where + " and b.EntrustNo like '%" + EntrustNo + "%'"
|
|
|
}
|
|
|
+ if ENumber != "" {
|
|
|
+ where = where + " and b.EntrustNo like '%" + ENumber + "%'"
|
|
|
+ }
|
|
|
if testDetailId != "" {
|
|
|
where = where + " and b.TestDetailId = '" + testDetailId + "'"
|
|
|
}
|
|
|
@@ -339,6 +355,124 @@ func (this *LimsDataEntryController) GetToDoList() {
|
|
|
this.ServeJSON()
|
|
|
}
|
|
|
|
|
|
+// @Title 获取数据录入列表
|
|
|
+// @Description get user by token
|
|
|
+// @Success 200 {object} business.device.DeviceChannels
|
|
|
+// @router /todolistgroup [get]
|
|
|
+func (this *LimsDataEntryController) GetToDoListGroup() {
|
|
|
+ var list []limsdataentry.LimsDateEntryModel
|
|
|
+ //获取分页信息
|
|
|
+ page := this.GetPageInfoForm()
|
|
|
+ queryTaskStatus := this.GetString("queryTaskStatus")
|
|
|
+
|
|
|
+ svc := limsdataentry.GetLimsDataEntryService(utils.DBE)
|
|
|
+ //启动数据录入工作流
|
|
|
+ svcActiviti := workflow.GetActivitiService(utils.DBE)
|
|
|
+ var processInstanceId string
|
|
|
+ var RoleSet auditsetting.Base_OilAuditSetting
|
|
|
+ ListDone := make([]workflow.ActiMyTasksRetWithTimeVM, 0)
|
|
|
+ rsvc := auditsetting.GetOilAuditSettingService(utils.DBE)
|
|
|
+ rsvc.GetAuditStepRoleEntity(OilAuditSettingName, this.User.DepartmentId, workflow.DATAAUDIT, &RoleSet)
|
|
|
+ //processInstanceId = svcActiviti.GetMyTasks(RoleSet.WorkFlowCord, this.User.Id)
|
|
|
+ //查出所有的待办和已办任务
|
|
|
+ where := " 1=1 "
|
|
|
+ if len(queryTaskStatus) <= 0 { //保留原来的功能
|
|
|
+ processInstanceId = svcActiviti.GetMyTasks(RoleSet.WorkFlowCord, this.User.Id)
|
|
|
+ } else if queryTaskStatus == "1" { //待办
|
|
|
+ processInstanceId = svcActiviti.GetMyTasks(RoleSet.WorkFlowCord, this.User.Id)
|
|
|
+ if len(processInstanceId) > 0 {
|
|
|
+ where += " and a.Id in (" + processInstanceId + ")"
|
|
|
+ } else {
|
|
|
+ where += " and a.Id = 0"
|
|
|
+ }
|
|
|
+ } else if queryTaskStatus == "2" { //已办
|
|
|
+ ListDone = svcActiviti.GetMyFinishedTasksWithTime(RoleSet.WorkFlowCord, this.User.Id)
|
|
|
+
|
|
|
+ for _, value := range ListDone {
|
|
|
+ processInstanceId = processInstanceId + value.BusinessKey + ","
|
|
|
+ }
|
|
|
+ processInstanceId = strings.Trim(processInstanceId, ",")
|
|
|
+ if len(processInstanceId) > 0 {
|
|
|
+ where += " and a.Id in (" + processInstanceId + ")"
|
|
|
+ } else {
|
|
|
+ where += " and a.Id = 0"
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ organizeSvc := organize.GetOrganizeService(utils.DBE)
|
|
|
+ departList := organizeSvc.GetChildByTopId(this.User.DepartmentId)
|
|
|
+ //取出当前部门及下级部门的所有用户列表
|
|
|
+ var subUserList []userRole.Base_User
|
|
|
+ whereUser := " 1=1 "
|
|
|
+ whereUser += " and DepartmentId in (" + departList + ")"
|
|
|
+ svc.GetEntities(&subUserList, whereUser)
|
|
|
+ var userIds string
|
|
|
+
|
|
|
+ for _, tmpUser := range subUserList {
|
|
|
+ userIds += strconv.Itoa(tmpUser.Id) + ","
|
|
|
+ }
|
|
|
+ userIds = strings.Trim(userIds, ",")
|
|
|
+
|
|
|
+ where += " AND a.CreateUserId in (" + userIds + ")"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //switch this.User.DepartmentId {
|
|
|
+ //case "100000150":
|
|
|
+ // processInstanceId = svcActiviti.GetMyTasks(workflow.TJZ_DATA_KEY, this.User.Id)
|
|
|
+ //case "100000151":
|
|
|
+ // processInstanceId = svcActiviti.GetMyTasks(workflow.YX_DATA_KEY, this.User.Id)
|
|
|
+ //case "100000168":
|
|
|
+ // processInstanceId = svcActiviti.GetMyTasks(workflow.JL_DATA_KEY, this.User.Id)
|
|
|
+ //case "100000169":
|
|
|
+ // processInstanceId = svcActiviti.GetMyTasks(workflow.JN_DATA_KEY, this.User.Id)
|
|
|
+ //}
|
|
|
+ EntrustNo := this.GetString("EntrustNo")
|
|
|
+ testDetailId := this.GetString("TestDetailId")
|
|
|
+ department := this.GetString("department")
|
|
|
+ conUserBy := this.GetString("conUserBy")
|
|
|
+ CheckStatus := this.GetString("CheckStatus")
|
|
|
+ BalanceTime := this.GetString("BalanceTime")
|
|
|
+ DocId := this.GetString("docid")
|
|
|
+ orderby := " EntrustNo desc"
|
|
|
+ Order := this.GetString("Order")
|
|
|
+ PropG := this.GetString("PropG")
|
|
|
+ if Order != "" && PropG != "" {
|
|
|
+ orderby = PropG + " " + Order
|
|
|
+ }
|
|
|
+ if EntrustNo != "" {
|
|
|
+ where = where + " and b.EntrustNo like '%" + EntrustNo + "%'"
|
|
|
+ }
|
|
|
+ if testDetailId != "" {
|
|
|
+ where = where + " and b.TestDetailId = '" + testDetailId + "'"
|
|
|
+ }
|
|
|
+ if department != "" {
|
|
|
+ where = where + " and b.Department like '%" + department + "%'"
|
|
|
+ }
|
|
|
+ if conUserBy != "" {
|
|
|
+ where = where + " and b.ConUserBy = '" + conUserBy + "'"
|
|
|
+ }
|
|
|
+ if CheckStatus != "" {
|
|
|
+ where = where + " and a.CheckStatus = '" + CheckStatus + "'"
|
|
|
+ }
|
|
|
+ if DocId != "" {
|
|
|
+ where = where + " and a.DocId = '" + DocId + "'"
|
|
|
+ }
|
|
|
+ if BalanceTime != "" {
|
|
|
+ dates := strings.Split(BalanceTime, ",")
|
|
|
+ if len(dates) == 2 {
|
|
|
+ minDate := dates[0]
|
|
|
+ maxDate := dates[1]
|
|
|
+ where = where + " and b.BalanceTime>='" + minDate + "' and b.BalanceTime<='" + maxDate + "'"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ total, list := svc.GetBalanceEntrySerchGroup(this.User.AccCode+LimsTaskBalanceName, this.User.AccCode+LimsDateEntryName, this.User.AccCode+LimsEntrustMainName, page.CurrentPage, page.Size, orderby, where)
|
|
|
+ var datainfo DataInfo
|
|
|
+ datainfo.Items = list
|
|
|
+ datainfo.CurrentItemCount = total
|
|
|
+ this.Data["json"] = &datainfo
|
|
|
+ this.ServeJSON()
|
|
|
+}
|
|
|
+
|
|
|
// @Title 获取数据录入列表
|
|
|
// @Description get user by token
|
|
|
// @Success 200 {object} business.device.DeviceChannels
|