|
|
@@ -2,6 +2,8 @@ package oilcontract
|
|
|
|
|
|
import (
|
|
|
"dashoo.cn/backend/api/business/oilcontract/contractSumScoreItems"
|
|
|
+ "dashoo.cn/business/permission"
|
|
|
+
|
|
|
//"dashoo.cn/backend/api/business/oilcontract/contractReview"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
|
|
|
"dashoo.cn/backend/api/business/workflow"
|
|
|
@@ -31,7 +33,7 @@ func (this *OilContractSumScoreController) GetEntityList() {
|
|
|
//获取分页信息
|
|
|
page := this.GetPageInfoForm()
|
|
|
where := " 1=1 "
|
|
|
- orderby := "Id"
|
|
|
+ orderby := "score.Id"
|
|
|
asc := false
|
|
|
Order := this.GetString("Order")
|
|
|
Prop := this.GetString("Prop")
|
|
|
@@ -42,160 +44,82 @@ func (this *OilContractSumScoreController) GetEntityList() {
|
|
|
}
|
|
|
}
|
|
|
Id := this.GetString("Id")
|
|
|
- ContractId := this.GetString("ContractId")
|
|
|
+ SupplierId := this.GetString("SupplierId")
|
|
|
ContractClass := this.GetString("ContractClass")
|
|
|
- SumScore := this.GetString("SumScore")
|
|
|
- NormalSumScore1 := this.GetString("NormalSumScore1")
|
|
|
- SumScore1 := this.GetString("SumScore1")
|
|
|
- Content1 := this.GetString("Content1")
|
|
|
- NormalSumScore2 := this.GetString("NormalSumScore2")
|
|
|
- SumScore2 := this.GetString("SumScore2")
|
|
|
- Content2 := this.GetString("Content2")
|
|
|
- NormalSumScore3 := this.GetString("NormalSumScore3")
|
|
|
- SumScore3 := this.GetString("SumScore3")
|
|
|
- Content3 := this.GetString("Content3")
|
|
|
- NormalSumScore4 := this.GetString("NormalSumScore4")
|
|
|
- SumScore4 := this.GetString("SumScore4")
|
|
|
- Content4 := this.GetString("Content4")
|
|
|
- NormalSumScore5 := this.GetString("NormalSumScore5")
|
|
|
- SumScore5 := this.GetString("SumScore5")
|
|
|
- Content5 := this.GetString("Content5")
|
|
|
- ConclusionReason := this.GetString("ConclusionReason")
|
|
|
- Conclusion := this.GetString("Conclusion")
|
|
|
+ SupplierName := this.GetString("SupplierName")
|
|
|
+ Year := this.GetString("Year")
|
|
|
+ Status := this.GetString("Status")
|
|
|
CreateOn := this.GetString("CreateOn")
|
|
|
CreateUserId := this.GetString("CreateUserId")
|
|
|
CreateBy := this.GetString("CreateBy")
|
|
|
ModifiedOn := this.GetString("ModifiedOn")
|
|
|
ModifiedUserId := this.GetString("ModifiedUserId")
|
|
|
ModifiedBy := this.GetString("ModifiedBy")
|
|
|
-
|
|
|
if Id != "" {
|
|
|
- where = where + " and Id like '%" + Id + "%'"
|
|
|
+ where = where + " and score.Id like '%" + Id + "%'"
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- if ContractId != "" {
|
|
|
- where = where + " and ContractId like '%" + ContractId + "%'"
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- if ContractClass != "" {
|
|
|
- where = where + " and ContractClass like '%" + ContractClass + "%'"
|
|
|
- }
|
|
|
-
|
|
|
- if SumScore != "" {
|
|
|
- where = where + " and SumScore like '%" + SumScore + "%'"
|
|
|
- }
|
|
|
-
|
|
|
- if Content1 != "" {
|
|
|
- where = where + " and Content1 like '%" + Content1 + "%'"
|
|
|
- }
|
|
|
-
|
|
|
- if NormalSumScore1 != "" {
|
|
|
- where = where + " and NormalSumScore1 like '%" + NormalSumScore1 + "%'"
|
|
|
- }
|
|
|
-
|
|
|
- if SumScore1 != "" {
|
|
|
- where = where + " and SumScore1 like '%" + SumScore1 + "%'"
|
|
|
- }
|
|
|
-
|
|
|
- if Content2 != "" {
|
|
|
- where = where + " and Content2 like '%" + Content2 + "%'"
|
|
|
- }
|
|
|
-
|
|
|
- if NormalSumScore2 != "" {
|
|
|
- where = where + " and NormalSumScore2 like '%" + NormalSumScore2 + "%'"
|
|
|
- }
|
|
|
-
|
|
|
- if SumScore2 != "" {
|
|
|
- where = where + " and SumScore2 like '%" + SumScore2 + "%'"
|
|
|
- }
|
|
|
-
|
|
|
- if Content3 != "" {
|
|
|
- where = where + " and Content3 like '%" + Content3 + "%'"
|
|
|
- }
|
|
|
-
|
|
|
- if NormalSumScore3 != "" {
|
|
|
- where = where + " and NormalSumScore3 like '%" + NormalSumScore3 + "%'"
|
|
|
- }
|
|
|
-
|
|
|
- if SumScore3 != "" {
|
|
|
- where = where + " and SumScore3 like '%" + SumScore3 + "%'"
|
|
|
- }
|
|
|
-
|
|
|
- if Content4 != "" {
|
|
|
- where = where + " and Content4 like '%" + Content4 + "%'"
|
|
|
- }
|
|
|
-
|
|
|
- if NormalSumScore4 != "" {
|
|
|
- where = where + " and NormalSumScore4 like '%" + NormalSumScore4 + "%'"
|
|
|
+ if SupplierId != "" {
|
|
|
+ where = where + " and score.SupplierId like '%" + SupplierId + "%'"
|
|
|
}
|
|
|
-
|
|
|
- if SumScore4 != "" {
|
|
|
- where = where + " and SumScore4 like '%" + SumScore4 + "%'"
|
|
|
- }
|
|
|
- if Content5 != "" {
|
|
|
- where = where + " and Content5 like '%" + Content5 + "%'"
|
|
|
- }
|
|
|
-
|
|
|
- if NormalSumScore5 != "" {
|
|
|
- where = where + " and NormalSumScore5 like '%" + NormalSumScore5 + "%'"
|
|
|
+ if SupplierName != "" {
|
|
|
+ where = where + " and score.SupplierName like '%" + SupplierName + "%'"
|
|
|
}
|
|
|
-
|
|
|
- if SumScore5 != "" {
|
|
|
- where = where + " and SumScore5 like '%" + SumScore5 + "%'"
|
|
|
+ if ContractClass != "" {
|
|
|
+ where = where + " and score.ContractClass like '%" + ContractClass + "%'"
|
|
|
}
|
|
|
- if ConclusionReason != "" {
|
|
|
- where = where + " and ConclusionReason like '%" + ConclusionReason + "%'"
|
|
|
+ if Year != "" {
|
|
|
+ where = where + " and score.Year like '%" + Year + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- if Conclusion != "" {
|
|
|
- where = where + " and Conclusion like '%" + Conclusion + "%'"
|
|
|
+ if Status != "" {
|
|
|
+ where = where + " and score.Status = '" + Status + "'"
|
|
|
}
|
|
|
-
|
|
|
//if CreateOn != "" {
|
|
|
// where = where + " and CreateOn like '%" + CreateOn + "%'"
|
|
|
//}
|
|
|
|
|
|
-
|
|
|
if CreateUserId != "" {
|
|
|
- where = where + " and CreateUserId like '%" + CreateUserId + "%'"
|
|
|
+ where = where + " and score.CreateUserId like '%" + CreateUserId + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if CreateBy != "" {
|
|
|
- where = where + " and CreateBy like '%" + CreateBy + "%'"
|
|
|
+ where = where + " and score.CreateBy like '%" + CreateBy + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if ModifiedOn != "" {
|
|
|
- where = where + " and ModifiedOn like '%" + ModifiedOn + "%'"
|
|
|
+ where = where + " and score.ModifiedOn like '%" + ModifiedOn + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if ModifiedUserId != "" {
|
|
|
- where = where + " and ModifiedUserId like '%" + ModifiedUserId + "%'"
|
|
|
+ where = where + " and score.ModifiedUserId like '%" + ModifiedUserId + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if ModifiedBy != "" {
|
|
|
- where = where + " and ModifiedBy like '%" + ModifiedBy + "%'"
|
|
|
+ where = where + " and score.ModifiedBy like '%" + ModifiedBy + "%'"
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
if CreateOn != "" {
|
|
|
dates := strings.Split(CreateOn, ",")
|
|
|
if len(dates) == 2 {
|
|
|
minDate := dates[0]
|
|
|
maxDate := dates[1]
|
|
|
- where = where + " and CreateOn>='" + minDate + "' and CreateOn<='" + maxDate + "'"
|
|
|
+ where = where + " and score.CreateOn>='" + minDate + "' and score.CreateOn<='" + maxDate + "'"
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ //超级管理员和有查看所有数据权限的用户不加条件
|
|
|
+ svcPerm := permission.GetPermissionService(utils.DBE)
|
|
|
+ isauth := svcPerm.IsAuthorized(this.User.Id, "oil_contract.SumStore.AllRecord")
|
|
|
+ if(!isauth){
|
|
|
+ // 权限过滤 自己创建的评价 ,同二级部门创建的评价 ,企管法规处能看
|
|
|
+ where = where + " and ( score.CreateUserId = '" + this.User.Id + "' "
|
|
|
+ where = where + " or score.UnitId = '" + strconv.Itoa(this.User.UnitId) + "' "
|
|
|
+ where = where + " )"
|
|
|
+ }
|
|
|
+
|
|
|
svc := contractSumScore.GetOilContractSumScoreService(utils.DBE)
|
|
|
- var list []contractSumScore.OilContractSumScore
|
|
|
- total := svc.GetPagingEntitiesWithOrderBytbl("", page.CurrentPage, page.Size, orderby, asc, &list, where)
|
|
|
+ var list []contractSumScore.OilContractSumScoreVo
|
|
|
+ total := svc.GetMyPagingEntitiesWithOrderBytbl( page.CurrentPage, page.Size, orderby, asc, &list, where)
|
|
|
var datainfo DataInfo
|
|
|
datainfo.Items = list
|
|
|
datainfo.CurrentItemCount = total
|
|
|
@@ -288,16 +212,17 @@ func (this *OilContractSumScoreController) GetDictList() {
|
|
|
// @Title 获取实体
|
|
|
// @Description 获取实体
|
|
|
// @Success 200 {object} contractSumScore.OilContractSumScore
|
|
|
-// @router /get/:id [get]
|
|
|
+// @router /get/:id/:category [get]
|
|
|
func (this *OilContractSumScoreController) GetEntity() {
|
|
|
- Id := this.Ctx.Input.Param(":id")
|
|
|
+ Id := this.Ctx.Input.Param(":id")
|
|
|
+ Category := this.Ctx.Input.Param(":category")
|
|
|
var model contractSumScore.OilContractSumScore
|
|
|
svc := contractSumScore.GetOilContractSumScoreService(utils.DBE)
|
|
|
svc.GetEntityByIdBytbl(OilContractSumScoreName, Id, &model)
|
|
|
|
|
|
var item contractSumScoreItems.OilContractSumScoreItems
|
|
|
itemSvc := contractSumScoreItems.GetOilContractSumScoreItemsService(utils.DBE)
|
|
|
- where := " 1=1 AND SumScoreId= '" + utils.ToStr( model.Id) + "' AND Category = 0 "
|
|
|
+ where := " 1=1 AND SumScoreId= '" + utils.ToStr( model.Id) + "' AND Category = '" + Category + "'"
|
|
|
itemSvc.GetEntityByWhere(OilContractSumScoreItemsName,where,&item)
|
|
|
|
|
|
var result contractSumScore.OilContractSumScoreVo
|
|
|
@@ -307,6 +232,8 @@ func (this *OilContractSumScoreController) GetEntity() {
|
|
|
result.ContractClass= model.ContractClass
|
|
|
result.Year = model.Year
|
|
|
result.Status = model.Status
|
|
|
+ result.WorkflowId = model.WorkflowId
|
|
|
+ result.Processkey = model.Processkey
|
|
|
result.Category = item.Category
|
|
|
result.SumScoreId = item.SumScoreId
|
|
|
result.SumScore = item.SumScore
|
|
|
@@ -327,6 +254,15 @@ func (this *OilContractSumScoreController) GetEntity() {
|
|
|
result.NormalSumScore5 = item.NormalSumScore5
|
|
|
result.Note = item.Note
|
|
|
result.Conclusion = item.Conclusion
|
|
|
+
|
|
|
+ result.B1 = item.B1
|
|
|
+ result.B2 = item.B2
|
|
|
+ result.B3 = item.B3
|
|
|
+ result.B4 = item.B4
|
|
|
+ result.B5 = item.B5
|
|
|
+ result.B6 = item.B6
|
|
|
+ result.B7 = item.B7
|
|
|
+ result.B8 = item.B8
|
|
|
this.Data["json"] = &result
|
|
|
this.ServeJSON()
|
|
|
}
|
|
|
@@ -347,6 +283,8 @@ func (this *OilContractSumScoreController) AddEntity() {
|
|
|
entity.ContractClass= model.ContractClass
|
|
|
entity.Year = model.Year
|
|
|
entity.Status = "0"
|
|
|
+ entity.Unit = this.User.Unit
|
|
|
+ entity.UnitId = this.User.UnitId
|
|
|
entity.CreateOn = time.Now()
|
|
|
entity.CreateBy = this.User.Realname
|
|
|
entity.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
@@ -373,12 +311,30 @@ func (this *OilContractSumScoreController) AddEntity() {
|
|
|
item.Content5 = model.Content5
|
|
|
item.NormalSumScore5 = model.NormalSumScore5
|
|
|
item.SumScore5 = model.SumScore5
|
|
|
+ item.Content6 = model.Content6
|
|
|
+ item.NormalSumScore6 = model.NormalSumScore6
|
|
|
+ item.SumScore6 = model.SumScore6
|
|
|
+ item.Content7 = model.Content7
|
|
|
+ item.NormalSumScore7 = model.NormalSumScore7
|
|
|
+ item.SumScore7 = model.SumScore7
|
|
|
+ item.Content8 = model.Content8
|
|
|
+ item.NormalSumScore8 = model.NormalSumScore8
|
|
|
+ item.SumScore8 = model.SumScore8
|
|
|
item.Conclusion = model.Conclusion
|
|
|
item.Note = model.Note
|
|
|
item.CreateOn = time.Now()
|
|
|
item.CreateBy = this.User.Realname
|
|
|
item.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
|
|
|
+ item.B1 = model.B1
|
|
|
+ item.B2 = model.B2
|
|
|
+ item.B3 = model.B3
|
|
|
+ item.B4 = model.B4
|
|
|
+ item.B5 = model.B5
|
|
|
+ item.B6 = model.B6
|
|
|
+ item.B7 = model.B7
|
|
|
+ item.B8 = model.B8
|
|
|
+
|
|
|
itemSvc := contractSumScoreItems.GetOilContractSumScoreItemsService(utils.DBE)
|
|
|
itemSvc.InsertEntityBytbl(OilContractSumScoreItemsName, &item)
|
|
|
var errinfo ErrorDataInfo
|
|
|
@@ -418,15 +374,10 @@ func (this *OilContractSumScoreController) UpdateEntity() {
|
|
|
var jsonBlob = this.Ctx.Input.RequestBody
|
|
|
json.Unmarshal(jsonBlob, &model)
|
|
|
|
|
|
- var entity contractSumScore.OilContractSumScore
|
|
|
- entity.SupplierId = model.SupplierId
|
|
|
- entity.SupplierName = model.SupplierName
|
|
|
- entity.ContractClass= model.ContractClass
|
|
|
- entity.Year = model.Year
|
|
|
- entity.Status = "0"
|
|
|
- entity.ModifiedOn = time.Now()
|
|
|
- entity.ModifiedBy = this.User.Realname
|
|
|
- entity.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
+ model.Status = "0"
|
|
|
+ model.ModifiedOn = time.Now()
|
|
|
+ model.ModifiedBy = this.User.Realname
|
|
|
+ model.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
cols := []string{
|
|
|
"SupplierId",
|
|
|
"SupplierName",
|
|
|
@@ -441,9 +392,9 @@ func (this *OilContractSumScoreController) UpdateEntity() {
|
|
|
|
|
|
var item contractSumScoreItems.OilContractSumScoreItems
|
|
|
itemSvc := contractSumScoreItems.GetOilContractSumScoreItemsService(utils.DBE)
|
|
|
- where := " 1=1 AND SumScoreId= '" + utils.ToStr( entity.Id) + "' AND Category = 0 "
|
|
|
+ where := " 1=1 AND SumScoreId= '" + utils.ToStr( model.Id) + "' AND Category = 0 "
|
|
|
itemSvc.GetEntityByWhere(OilContractSumScoreItemsName,where,&item)
|
|
|
- item.Category = 1 // 二级单位创建
|
|
|
+ item.Category = 0 // 二级单位创建
|
|
|
item.SumScore = model.SumScore
|
|
|
item.Content1 = model.Content1
|
|
|
item.NormalSumScore1 = model.NormalSumScore1
|
|
|
@@ -465,6 +416,15 @@ func (this *OilContractSumScoreController) UpdateEntity() {
|
|
|
item.ModifiedBy = this.User.Realname
|
|
|
item.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
|
|
|
+ item.B1 = model.B1
|
|
|
+ item.B2 = model.B2
|
|
|
+ item.B3 = model.B3
|
|
|
+ item.B4 = model.B4
|
|
|
+ item.B5 = model.B5
|
|
|
+ item.B6 = model.B6
|
|
|
+ item.B7 = model.B7
|
|
|
+ item.B8 = model.B8
|
|
|
+
|
|
|
cols2 := []string{
|
|
|
"Category",
|
|
|
"SumScore",
|
|
|
@@ -473,22 +433,122 @@ func (this *OilContractSumScoreController) UpdateEntity() {
|
|
|
"Content3",
|
|
|
"Content4",
|
|
|
"Content5",
|
|
|
+ "Content6",
|
|
|
+ "Content7",
|
|
|
+ "Content8",
|
|
|
"NormalSumScore1",
|
|
|
"NormalSumScore2",
|
|
|
"NormalSumScore3",
|
|
|
"NormalSumScore4",
|
|
|
"NormalSumScore5",
|
|
|
+ "NormalSumScore6",
|
|
|
+ "NormalSumScore7",
|
|
|
+ "NormalSumScore8",
|
|
|
"SumScore1",
|
|
|
"SumScore2",
|
|
|
"SumScore3",
|
|
|
"SumScore4",
|
|
|
"SumScore5",
|
|
|
+ "SumScore6",
|
|
|
+ "SumScore7",
|
|
|
+ "SumScore8",
|
|
|
"Note",
|
|
|
"ModifiedOn",
|
|
|
"ModifiedBy",
|
|
|
"ModifiedUserId",
|
|
|
+ "B1",
|
|
|
+ "B2",
|
|
|
+ "B3",
|
|
|
+ "B4",
|
|
|
+ "B5",
|
|
|
+ "B6",
|
|
|
+ "B7",
|
|
|
+ "B8",
|
|
|
+ }
|
|
|
+ err2 := itemSvc.UpdateEntityBytbl(OilContractSumScoreItemsName,item.Id,&item,cols2)
|
|
|
+
|
|
|
+ if err == nil && err2 == 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 专业科室保存评价
|
|
|
+// @Param body body contractSumScore.OilContractSumScore
|
|
|
+// @Success 200 {object} controllers.Request
|
|
|
+// @router /save-sec-score/:id [post]
|
|
|
+func (this *OilContractSumScoreController) SaveScoreItemsBySec(){
|
|
|
+ id := this.Ctx.Input.Param(":id")
|
|
|
+ var errinfo ErrorInfo
|
|
|
+ if id == "" {
|
|
|
+ errinfo.Message = "操作失败!请求信息不完整"
|
|
|
+ errinfo.Code = -2
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ return
|
|
|
}
|
|
|
- itemSvc.UpdateEntityBytbl(OilContractSumScoreItemsName,item.Id,&item,cols2)
|
|
|
+ var model contractSumScore.OilContractSumScoreVo
|
|
|
+ itemSvc := contractSumScore.GetOilContractSumScoreService(utils.DBE)
|
|
|
+ var jsonBlob = this.Ctx.Input.RequestBody
|
|
|
+ json.Unmarshal(jsonBlob, &model)
|
|
|
+
|
|
|
+ where := "SumScoreId=" + id + " AND Category = 1 "
|
|
|
+ // 清除掉之前的
|
|
|
+ itemSvc.DeleteEntityBytbl(OilContractSumScoreItemsName,where)
|
|
|
+
|
|
|
+ var item contractSumScoreItems.OilContractSumScoreItems
|
|
|
+ item.SumScoreId,_ = strconv.Atoi(id)
|
|
|
+ item.Category = 1 // 二级单位创建
|
|
|
+ item.SumScore = model.SumScore
|
|
|
+ item.Content1 = model.Content1
|
|
|
+ item.NormalSumScore1 = model.NormalSumScore1
|
|
|
+ item.SumScore1 = model.SumScore1
|
|
|
+ item.Content2 = model.Content2
|
|
|
+ item.NormalSumScore2 = model.NormalSumScore2
|
|
|
+ item.SumScore2 = model.SumScore2
|
|
|
+ item.Content3 = model.Content3
|
|
|
+ item.NormalSumScore3 = model.NormalSumScore3
|
|
|
+ item.SumScore3 = model.SumScore3
|
|
|
+ item.Content4 = model.Content4
|
|
|
+ item.NormalSumScore4 = model.NormalSumScore4
|
|
|
+ item.SumScore4 = model.SumScore4
|
|
|
+ item.Content5 = model.Content5
|
|
|
+ item.NormalSumScore5 = model.NormalSumScore5
|
|
|
+ item.SumScore5 = model.SumScore5
|
|
|
+ item.Content6 = model.Content6
|
|
|
+ item.NormalSumScore6 = model.NormalSumScore6
|
|
|
+ item.SumScore6 = model.SumScore6
|
|
|
+ item.Content7 = model.Content7
|
|
|
+ item.NormalSumScore7 = model.NormalSumScore7
|
|
|
+ item.SumScore7 = model.SumScore7
|
|
|
+ item.Content8 = model.Content8
|
|
|
+ item.NormalSumScore8 = model.NormalSumScore8
|
|
|
+ item.SumScore8 = model.SumScore8
|
|
|
+ item.Conclusion = model.Conclusion
|
|
|
+ item.Note = model.Note
|
|
|
+ item.CreateOn = time.Now()
|
|
|
+ item.CreateBy = this.User.Realname
|
|
|
+ item.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
+
|
|
|
+ item.B1 = model.B1
|
|
|
+ item.B2 = model.B2
|
|
|
+ item.B3 = model.B3
|
|
|
+ item.B4 = model.B4
|
|
|
+ item.B5 = model.B5
|
|
|
+ item.B6 = model.B6
|
|
|
+ item.B7 = model.B7
|
|
|
+ item.B8 = model.B8
|
|
|
+
|
|
|
+ _,err := itemSvc.InsertEntityBytbl(OilContractSumScoreItemsName, &item)
|
|
|
|
|
|
if err == nil {
|
|
|
errinfo.Message = "修改成功!"
|
|
|
@@ -503,6 +563,7 @@ func (this *OilContractSumScoreController) UpdateEntity() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
// @Title 删除单条信息
|
|
|
// @Description
|
|
|
// @Success 200 {object} ErrorInfo
|
|
|
@@ -521,6 +582,18 @@ func (this *OilContractSumScoreController) DeleteEntity() {
|
|
|
var model contractSumScore.OilContractSumScore
|
|
|
var entityempty contractSumScore.OilContractSumScore
|
|
|
svc := contractSumScore.GetOilContractSumScoreService(utils.DBE)
|
|
|
+
|
|
|
+ // 审核中不能删除
|
|
|
+ svc.GetEntityByIdBytbl(OilContractSumScoreName, Id, &model)
|
|
|
+ if model.Status > "0" && model.Status < "8" {
|
|
|
+ errinfo.Message = "该年度评价正在审核,不允许删除!"
|
|
|
+ errinfo.Code = -1
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
opdesc := "删除-" + Id
|
|
|
err := svc.DeleteOperationAndWriteLogBytbl(this.User.AccCode+OilContractSumScoreName, BaseOperationLogName, Id, &model, &entityempty, utils.ToStr(this.User.Id), this.User.Username, opdesc, this.User.AccCode, "钻井日报")
|
|
|
if err == nil {
|