|
|
@@ -1,6 +1,7 @@
|
|
|
package lims
|
|
|
|
|
|
import (
|
|
|
+ "dashoo.cn/backend/api/business/limscustomerposition"
|
|
|
"dashoo.cn/backend/api/business/testtype"
|
|
|
"encoding/json"
|
|
|
"strconv"
|
|
|
@@ -21,9 +22,6 @@ import (
|
|
|
"dashoo.cn/backend/api/business/limsentrustsample"
|
|
|
"dashoo.cn/backend/api/business/limsentrustsampletype"
|
|
|
|
|
|
- // "dashoo.cn/backend/api/business/testtype"
|
|
|
-
|
|
|
- //"dashoo.cn/backend/api/business/authcode"
|
|
|
. "dashoo.cn/backend/api/controllers"
|
|
|
"dashoo.cn/utils"
|
|
|
)
|
|
|
@@ -59,13 +57,14 @@ func (this *LimsEnturstController) GetEntrustPlanList() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- userSvc := userRole.GetUserService(utils.DBE)
|
|
|
- organizeSvc := organize.GetOrganizeService(utils.DBE)
|
|
|
- departList := organizeSvc.GetChildByTopId(this.User.DepartmentId)
|
|
|
+ // userSvc := userRole.GetUserService(utils.DBE)
|
|
|
+ // organizeSvc := organize.GetOrganizeService(utils.DBE)
|
|
|
+ // departList := organizeSvc.GetChildByTopId(this.User.DepartmentId)
|
|
|
//取出当前部门及下级部门的所有用户列表
|
|
|
- var subUserList []userRole.Base_User
|
|
|
- whereUser := " 1=1 "
|
|
|
- whereUser += " and DepartmentId in (" + departList + ")"
|
|
|
+ /*
|
|
|
+ * var subUserList []userRole.Base_User
|
|
|
+ "*/
|
|
|
+ /*whereUser += " and DepartmentId in (" + departList + ")"
|
|
|
// whereUser += " and EntrustStatus<0 "
|
|
|
userSvc.GetEntities(&subUserList, whereUser)
|
|
|
var userIds string
|
|
|
@@ -76,8 +75,9 @@ func (this *LimsEnturstController) GetEntrustPlanList() {
|
|
|
userIds = strings.Trim(userIds, ",")
|
|
|
|
|
|
where := " 1=1 "
|
|
|
- where += " AND CreateUserId in (" + userIds + ")"
|
|
|
+ where += " AND CreateUserId in (" + userIds + ")"*/
|
|
|
|
|
|
+ where := " 1=1 and IsPlan = '1' "
|
|
|
if entrustno != "" {
|
|
|
where = where + " and EntrustNo like '%" + entrustno + "%'"
|
|
|
}
|
|
|
@@ -186,7 +186,6 @@ func (this *LimsEnturstController) GetEntrustList() {
|
|
|
var subUserList []userRole.Base_User
|
|
|
whereUser := " 1=1 "
|
|
|
whereUser += " and DepartmentId in (" + departList + ")"
|
|
|
- whereUser += " and EntrustStatus>=0 "
|
|
|
userSvc.GetEntities(&subUserList, whereUser)
|
|
|
var userIds string
|
|
|
|
|
|
@@ -196,7 +195,9 @@ func (this *LimsEnturstController) GetEntrustList() {
|
|
|
userIds = strings.Trim(userIds, ",")
|
|
|
|
|
|
where := " 1=1 "
|
|
|
- where += " AND CreateUserId in (" + userIds + ")"
|
|
|
+ where += " and EntrustStatus>=0 "
|
|
|
+ where += " AND ( CreateUserId in (" + userIds + ")"
|
|
|
+ where += " OR ModifiedUserId = '" + this.User.Id + "')"
|
|
|
|
|
|
if entrustno != "" {
|
|
|
where = where + " and EntrustNo like '%" + entrustno + "%'"
|
|
|
@@ -378,7 +379,7 @@ func (this *LimsEnturstController) ReceiveEntrustInfo() {
|
|
|
Id := this.Ctx.Input.Param(":id")
|
|
|
var model limsentrust.CustomerEntrustModel
|
|
|
svc := limsentrust.GetLimsEnturstService(utils.DBE)
|
|
|
- sqlUpdate := "update " + this.User.AccCode + LimsEntrustMainName + " set EntrustStatus = '0' where Id='" + Id + "'"
|
|
|
+ sqlUpdate := "update " + this.User.AccCode + LimsEntrustMainName + " set EntrustStatus = '0', ModifiedOn=now(), ModifiedBy='" + this.User.Username + "', ModifiedUserId = '" + this.User.Id + "' where Id='" + Id + "'"
|
|
|
svc.DBE.Exec(sqlUpdate)
|
|
|
|
|
|
this.Data["json"] = &model
|
|
|
@@ -466,7 +467,7 @@ func (this *LimsEnturstController) EditEntrust() {
|
|
|
svc := limsentrust.GetLimsEnturstService(utils.DBE)
|
|
|
|
|
|
opdesc := "委托单-" + model.EntrustNo
|
|
|
- var cols []string = []string{"EntrustNo", "EntrustTime", "EndTime", "EntrustStatus", "EntrustType", "EntrustTypeId", "CustomerId", "CustomerName", "CustomerPerson", "CustomerTelephone", "AddressId", "Address", "ProjectType", "ProjectTypeId", "DetectSample", "DetectSampleId", "Samplelist", "SampleNum", "SampleCode", "Unit", "Remarks", "ModifiedUserId", "ModifiedBy"}
|
|
|
+ var cols []string = []string{"EntrustNo", "EntrustTime", "EndTime", "EntrustStatus", "EntrustType", "EntrustTypeId", "CustomerId", "CustomerName", "CustomerPerson", "CustomerTelephone", "AddressId", "Address", "ProjectType", "ProjectTypeId", "DetectSample", "DetectSampleId", "Samplelist", "SampleNum", "SampleCode", "Unit", "IsPlan", "Remarks", "ModifiedUserId", "ModifiedBy"}
|
|
|
err := svc.UpdateOperationAndWriteLogBytbl(this.User.AccCode+LimsEntrustMainName, BaseOperationLogName, id, &model, &entityempty, cols, utils.ToStr(this.User.Id), this.User.Username, opdesc, this.User.AccCode, "委托管理")
|
|
|
if err == nil {
|
|
|
errinfo.Message = "操作成功!"
|
|
|
@@ -1007,3 +1008,29 @@ func (this *LimsEnturstController) GetShow() {
|
|
|
this.Data["json"] = &datainfo
|
|
|
this.ServeJSON()
|
|
|
}
|
|
|
+
|
|
|
+// @Title 获取委托方信息
|
|
|
+// @Description 获取委托方信息
|
|
|
+// @Success 200 object} map[string]interface{}
|
|
|
+// @router /getallcheckposition [get]
|
|
|
+func (this *LimsReportZuhqController) GetAllCheckPosition() {
|
|
|
+ dictList := make(map[string]interface{})
|
|
|
+
|
|
|
+ var model []limscustomerposition.LimsCustomerPosition
|
|
|
+ svc := limscustomerposition.GetLimsCustomerpositionService(utils.DBE)
|
|
|
+
|
|
|
+ where := "ParentId = 0"
|
|
|
+ svc.GetEntitysByWhere(this.User.AccCode+LimsCustomerpositionName, where,&model)
|
|
|
+ dictList["PositionCheck"] = model
|
|
|
+
|
|
|
+ var Positionmodel []limscustomerposition.LimsCustomerPosition
|
|
|
+ //where = "CustomerId=" + cId + " and ParentId <> 0"
|
|
|
+ where = "ParentId <> 0"
|
|
|
+ svc.GetEntitysByWhere(this.User.AccCode+LimsCustomerpositionName,where, &Positionmodel)
|
|
|
+ dictList["Position"] = Positionmodel
|
|
|
+
|
|
|
+ var datainfo DataInfo
|
|
|
+ datainfo.Items = dictList
|
|
|
+ this.Data["json"] = &datainfo
|
|
|
+ this.ServeJSON()
|
|
|
+}
|