|
|
@@ -35,6 +35,7 @@ import (
|
|
|
"dashoo.cn/backend/api/business/workflow"
|
|
|
"dashoo.cn/business2/organize"
|
|
|
"dashoo.cn/business2/userRole"
|
|
|
+ userRole2 "dashoo.cn/business_lims/userRole"
|
|
|
|
|
|
"os"
|
|
|
|
|
|
@@ -237,10 +238,16 @@ func (this *LimsDataEntryController) GetToDoList() {
|
|
|
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)
|
|
|
|
|
|
@@ -248,25 +255,29 @@ func (this *LimsDataEntryController) GetToDoList() {
|
|
|
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 + ")"
|
|
|
}
|
|
|
- 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 := " 1=1 "
|
|
|
- where += " AND a.CreateUserId in (" + userIds + ")"
|
|
|
|
|
|
//switch this.User.DepartmentId {
|
|
|
//case "100000150":
|
|
|
@@ -292,9 +303,7 @@ func (this *LimsDataEntryController) GetToDoList() {
|
|
|
orderby = Prop + " " + Order
|
|
|
}
|
|
|
where += " and b.BalanceStatus <> 0 "
|
|
|
- if len(processInstanceId) > 0 {
|
|
|
- where += " and a.Id in (" + processInstanceId + ")"
|
|
|
- }
|
|
|
+
|
|
|
if EntrustNo != "" {
|
|
|
where = where + " and b.EntrustNo like '%" + EntrustNo + "%'"
|
|
|
}
|
|
|
@@ -4938,6 +4947,32 @@ func (this *LimsDataEntryController) GetEntrustEquipment() {
|
|
|
|
|
|
}
|
|
|
|
|
|
+// @Title 获取审批步骤编码
|
|
|
+// @Description
|
|
|
+// @Success 200 {object} controllers.Request
|
|
|
+// @router /getauditstepcode [get]
|
|
|
+func (this *LimsDataEntryController) GetAuditStepCode() {
|
|
|
+ svc := userRole2.GetUserService(utils.DBE)
|
|
|
+ roleofrole := svc.GetUserRoleIds(this.User.Id)
|
|
|
+ rids := ""
|
|
|
+ for _,item := range roleofrole {
|
|
|
+ rids += "," + strings.Trim(item, "rid_")
|
|
|
+ }
|
|
|
+ rids = strings.Trim(rids, ",")
|
|
|
+ var roleSet []auditsetting.Base_OilAuditSetting
|
|
|
+ svcr := auditsetting.GetOilAuditSettingService(utils.DBE)
|
|
|
+ where := "RoleId IN (" + rids + ")"
|
|
|
+ svcr.GetEntities(&roleSet, where)
|
|
|
+ stepCode := ""
|
|
|
+ for _,item := range roleSet {
|
|
|
+ stepCode += "," + item.AuditStepCode
|
|
|
+ }
|
|
|
+ stepCode = strings.Trim(stepCode, ",")
|
|
|
+ this.Data["json"] = stepCode
|
|
|
+ this.ServeJSON()
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
func (this *LimsDataEntryController) adddataentrydetail(entrustmainId, dataentryid, balanceid int, positionCheckId, entrustNo,templatecode, AccCode string) error {
|
|
|
var err error
|
|
|
svc := limsdataentry.GetLimsDataEntryService(utils.DBE)
|