|
|
@@ -110,20 +110,19 @@ func (this *OilContractSumScoreController) GetEntityList() {
|
|
|
|
|
|
where = where + " and items.Category = '0' "
|
|
|
|
|
|
-
|
|
|
//超级管理员和有查看所有数据权限的用户不加条件
|
|
|
svcPerm := permission.GetPermissionService(utils.DBE)
|
|
|
- isauth := svcPerm.IsAuthorized(this.User.Id, "oil_contract.SumStore.AllRecord")
|
|
|
- if(!isauth){
|
|
|
+ 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 + " or score.UnitId = '" + strconv.Itoa(this.User.UnitId) + "' "
|
|
|
where = where + " )"
|
|
|
}
|
|
|
|
|
|
svc := contractSumScore.GetOilContractSumScoreService(utils.DBE)
|
|
|
var list []contractSumScore.OilContractSumScoreVo
|
|
|
- total := svc.GetMyPagingEntitiesWithOrderBytbl( page.CurrentPage, page.Size, orderby, asc, &list, where)
|
|
|
+ total := svc.GetMyPagingEntitiesWithOrderBytbl(page.CurrentPage, page.Size, orderby, asc, &list, where)
|
|
|
var datainfo DataInfo
|
|
|
datainfo.Items = list
|
|
|
datainfo.CurrentItemCount = total
|
|
|
@@ -137,7 +136,7 @@ func (this *OilContractSumScoreController) GetEntityList() {
|
|
|
// @Description get user by token
|
|
|
// @Success 200 {object} []contractSumScore.OilContractSumScore
|
|
|
// @router /compute-list [get]
|
|
|
-func (this *OilContractSumScoreController) GetComputeEntityList(){
|
|
|
+func (this *OilContractSumScoreController) GetComputeEntityList() {
|
|
|
//获取分页信息
|
|
|
page := this.GetPageInfoForm()
|
|
|
where := " 1=1 "
|
|
|
@@ -153,19 +152,28 @@ func (this *OilContractSumScoreController) GetComputeEntityList(){
|
|
|
}
|
|
|
SupplierName := this.GetString("SupplierName")
|
|
|
//CreateOn := this.GetString("CreateOn")
|
|
|
- ContractClass := this.GetString("ContractClass","01")
|
|
|
+ ContractClass := this.GetString("ContractClass", "01")
|
|
|
+ Evaluate := this.GetString("Evaluate", "")
|
|
|
|
|
|
if SupplierName != "" {
|
|
|
where = where + " and contract.SupplierName like '%" + SupplierName + "%'"
|
|
|
}
|
|
|
- if ContractClass != ""{
|
|
|
+ if ContractClass != "" {
|
|
|
where = where + " and contract.ContractClass = '" + ContractClass + "'"
|
|
|
}
|
|
|
|
|
|
+ if Evaluate == "1" {
|
|
|
+
|
|
|
+ } else if Evaluate == "2" {
|
|
|
+
|
|
|
+ } else if Evaluate == "3" {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
// 今年的汇总
|
|
|
- year := strconv.Itoa(time.Now().Year())
|
|
|
- month := "01"
|
|
|
- day := "01"
|
|
|
+ year := strconv.Itoa(time.Now().Year())
|
|
|
+ month := "01"
|
|
|
+ day := "01"
|
|
|
where = where + " and review.CreateOn>='" + year + "-" + month + "-" + day + "' "
|
|
|
|
|
|
//if CreateOn != "" {
|
|
|
@@ -221,7 +229,7 @@ func (this *OilContractSumScoreController) GetDictList() {
|
|
|
// @Success 200 {object} contractSumScore.OilContractSumScore
|
|
|
// @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)
|
|
|
@@ -229,38 +237,38 @@ func (this *OilContractSumScoreController) GetEntity() {
|
|
|
|
|
|
var item contractSumScoreItems.OilContractSumScoreItems
|
|
|
itemSvc := contractSumScoreItems.GetOilContractSumScoreItemsService(utils.DBE)
|
|
|
- where := " 1=1 AND SumScoreId= '" + utils.ToStr( model.Id) + "' AND Category = '" + Category + "'"
|
|
|
- itemSvc.GetEntityByWhere(OilContractSumScoreItemsName,where,&item)
|
|
|
+ where := " 1=1 AND SumScoreId= '" + utils.ToStr(model.Id) + "' AND Category = '" + Category + "'"
|
|
|
+ itemSvc.GetEntityByWhere(OilContractSumScoreItemsName, where, &item)
|
|
|
|
|
|
var result contractSumScore.OilContractSumScoreVo
|
|
|
result.Id = model.Id
|
|
|
- result.SupplierId = model.SupplierId
|
|
|
+ result.SupplierId = model.SupplierId
|
|
|
result.SupplierName = model.SupplierName
|
|
|
- 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
|
|
|
- result.Content1 = item.Content1
|
|
|
- result.Content2 = item.Content2
|
|
|
- result.Content3 = item.Content3
|
|
|
- result.Content4 = item.Content4
|
|
|
- result.Content5 = item.Content5
|
|
|
- result.Content6 = item.Content6
|
|
|
- result.Content7 = item.Content7
|
|
|
- result.Content8 = item.Content8
|
|
|
-
|
|
|
- result.SumScore1 = item.SumScore1
|
|
|
- result.SumScore2 = item.SumScore2
|
|
|
- result.SumScore3 = item.SumScore3
|
|
|
- result.SumScore4 = item.SumScore4
|
|
|
- result.SumScore5 = item.SumScore5
|
|
|
- result.SumScore6 = item.SumScore6
|
|
|
- result.SumScore7 = item.SumScore7
|
|
|
- result.SumScore8 = item.SumScore8
|
|
|
+ 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
|
|
|
+ result.Content1 = item.Content1
|
|
|
+ result.Content2 = item.Content2
|
|
|
+ result.Content3 = item.Content3
|
|
|
+ result.Content4 = item.Content4
|
|
|
+ result.Content5 = item.Content5
|
|
|
+ result.Content6 = item.Content6
|
|
|
+ result.Content7 = item.Content7
|
|
|
+ result.Content8 = item.Content8
|
|
|
+
|
|
|
+ result.SumScore1 = item.SumScore1
|
|
|
+ result.SumScore2 = item.SumScore2
|
|
|
+ result.SumScore3 = item.SumScore3
|
|
|
+ result.SumScore4 = item.SumScore4
|
|
|
+ result.SumScore5 = item.SumScore5
|
|
|
+ result.SumScore6 = item.SumScore6
|
|
|
+ result.SumScore7 = item.SumScore7
|
|
|
+ result.SumScore8 = item.SumScore8
|
|
|
|
|
|
result.NormalSumScore1 = item.NormalSumScore1
|
|
|
result.NormalSumScore2 = item.NormalSumScore2
|
|
|
@@ -339,15 +347,15 @@ func (this *OilContractSumScoreController) AddEntity() {
|
|
|
json.Unmarshal(jsonBlob, &model)
|
|
|
|
|
|
var entity contractSumScore.OilContractSumScore
|
|
|
- entity.SupplierId = model.SupplierId
|
|
|
+ entity.SupplierId = model.SupplierId
|
|
|
entity.SupplierName = model.SupplierName
|
|
|
- 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.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()
|
|
|
|
|
|
svc := contractSumScore.GetOilContractSumScoreService(utils.DBE)
|
|
|
@@ -355,36 +363,36 @@ func (this *OilContractSumScoreController) AddEntity() {
|
|
|
|
|
|
var item contractSumScoreItems.OilContractSumScoreItems
|
|
|
item.SumScoreId = entity.Id
|
|
|
- item.Category = 0 // 二级单位创建
|
|
|
- item.SumScore = model.SumScore
|
|
|
- item.Content1 = model.Content1
|
|
|
+ item.Category = 0 // 二级单位创建
|
|
|
+ item.SumScore = model.SumScore
|
|
|
+ item.Content1 = model.Content1
|
|
|
item.NormalSumScore1 = model.NormalSumScore1
|
|
|
- item.SumScore1 = model.SumScore1
|
|
|
- item.Content2 = model.Content2
|
|
|
+ item.SumScore1 = model.SumScore1
|
|
|
+ item.Content2 = model.Content2
|
|
|
item.NormalSumScore2 = model.NormalSumScore2
|
|
|
- item.SumScore2 = model.SumScore2
|
|
|
- item.Content3 = model.Content3
|
|
|
+ item.SumScore2 = model.SumScore2
|
|
|
+ item.Content3 = model.Content3
|
|
|
item.NormalSumScore3 = model.NormalSumScore3
|
|
|
- item.SumScore3 = model.SumScore3
|
|
|
- item.Content4 = model.Content4
|
|
|
+ item.SumScore3 = model.SumScore3
|
|
|
+ item.Content4 = model.Content4
|
|
|
item.NormalSumScore4 = model.NormalSumScore4
|
|
|
- item.SumScore4 = model.SumScore4
|
|
|
- item.Content5 = model.Content5
|
|
|
+ item.SumScore4 = model.SumScore4
|
|
|
+ item.Content5 = model.Content5
|
|
|
item.NormalSumScore5 = model.NormalSumScore5
|
|
|
- item.SumScore5 = model.SumScore5
|
|
|
- item.Content6 = model.Content6
|
|
|
+ item.SumScore5 = model.SumScore5
|
|
|
+ item.Content6 = model.Content6
|
|
|
item.NormalSumScore6 = model.NormalSumScore6
|
|
|
- item.SumScore6 = model.SumScore6
|
|
|
- item.Content7 = model.Content7
|
|
|
+ item.SumScore6 = model.SumScore6
|
|
|
+ item.Content7 = model.Content7
|
|
|
item.NormalSumScore7 = model.NormalSumScore7
|
|
|
- item.SumScore7 = model.SumScore7
|
|
|
- item.Content8 = model.Content8
|
|
|
+ item.SumScore7 = model.SumScore7
|
|
|
+ item.Content8 = model.Content8
|
|
|
item.NormalSumScore8 = model.NormalSumScore8
|
|
|
- item.SumScore8 = model.SumScore8
|
|
|
+ item.SumScore8 = model.SumScore8
|
|
|
item.Conclusion = model.Conclusion
|
|
|
- item.Note = model.Note
|
|
|
- item.CreateOn = time.Now()
|
|
|
- item.CreateBy = this.User.Realname
|
|
|
+ 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
|
|
|
@@ -400,36 +408,36 @@ func (this *OilContractSumScoreController) AddEntity() {
|
|
|
|
|
|
var item2 contractSumScoreItems.OilContractSumScoreItems
|
|
|
item2.SumScoreId = entity.Id
|
|
|
- item2.Category = 1 // 二级单位创建
|
|
|
- item2.SumScore = model.SumScore
|
|
|
- item2.Content1 = model.Content1
|
|
|
+ item2.Category = 1 // 二级单位创建
|
|
|
+ item2.SumScore = model.SumScore
|
|
|
+ item2.Content1 = model.Content1
|
|
|
item2.NormalSumScore1 = model.NormalSumScore1
|
|
|
- item2.SumScore1 = model.SumScore1
|
|
|
- item2.Content2 = model.Content2
|
|
|
+ item2.SumScore1 = model.SumScore1
|
|
|
+ item2.Content2 = model.Content2
|
|
|
item2.NormalSumScore2 = model.NormalSumScore2
|
|
|
- item2.SumScore2 = model.SumScore2
|
|
|
- item2.Content3 = model.Content3
|
|
|
+ item2.SumScore2 = model.SumScore2
|
|
|
+ item2.Content3 = model.Content3
|
|
|
item2.NormalSumScore3 = model.NormalSumScore3
|
|
|
- item2.SumScore3 = model.SumScore3
|
|
|
- item2.Content4 = model.Content4
|
|
|
+ item2.SumScore3 = model.SumScore3
|
|
|
+ item2.Content4 = model.Content4
|
|
|
item2.NormalSumScore4 = model.NormalSumScore4
|
|
|
- item2.SumScore4 = model.SumScore4
|
|
|
- item2.Content5 = model.Content5
|
|
|
+ item2.SumScore4 = model.SumScore4
|
|
|
+ item2.Content5 = model.Content5
|
|
|
item2.NormalSumScore5 = model.NormalSumScore5
|
|
|
- item2.SumScore5 = model.SumScore5
|
|
|
- item2.Content6 = model.Content6
|
|
|
+ item2.SumScore5 = model.SumScore5
|
|
|
+ item2.Content6 = model.Content6
|
|
|
item2.NormalSumScore6 = model.NormalSumScore6
|
|
|
- item2.SumScore6 = model.SumScore6
|
|
|
- item2.Content7 = model.Content7
|
|
|
+ item2.SumScore6 = model.SumScore6
|
|
|
+ item2.Content7 = model.Content7
|
|
|
item2.NormalSumScore7 = model.NormalSumScore7
|
|
|
- item2.SumScore7 = model.SumScore7
|
|
|
- item2.Content8 = model.Content8
|
|
|
+ item2.SumScore7 = model.SumScore7
|
|
|
+ item2.Content8 = model.Content8
|
|
|
item2.NormalSumScore8 = model.NormalSumScore8
|
|
|
- item2.SumScore8 = model.SumScore8
|
|
|
+ item2.SumScore8 = model.SumScore8
|
|
|
item2.Conclusion = model.Conclusion
|
|
|
- item2.Note = model.Note
|
|
|
- item2.CreateOn = time.Now()
|
|
|
- item2.CreateBy = this.User.Realname
|
|
|
+ item2.Note = model.Note
|
|
|
+ item2.CreateOn = time.Now()
|
|
|
+ item2.CreateBy = this.User.Realname
|
|
|
item2.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
item2.B1 = model.B1
|
|
|
item2.B2 = model.B2
|
|
|
@@ -484,9 +492,9 @@ func (this *OilContractSumScoreController) UpdateEntity() {
|
|
|
var jsonBlob = this.Ctx.Input.RequestBody
|
|
|
json.Unmarshal(jsonBlob, &model)
|
|
|
|
|
|
- model.Status = "0"
|
|
|
- model.ModifiedOn = time.Now()
|
|
|
- model.ModifiedBy = this.User.Realname
|
|
|
+ model.Status = "0"
|
|
|
+ model.ModifiedOn = time.Now()
|
|
|
+ model.ModifiedBy = this.User.Realname
|
|
|
model.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
cols := []string{
|
|
|
"SupplierId",
|
|
|
@@ -502,38 +510,38 @@ func (this *OilContractSumScoreController) UpdateEntity() {
|
|
|
|
|
|
var item contractSumScoreItems.OilContractSumScoreItems
|
|
|
itemSvc := contractSumScoreItems.GetOilContractSumScoreItemsService(utils.DBE)
|
|
|
- where := " 1=1 AND SumScoreId= '" + utils.ToStr( model.Id) + "' AND Category = 0 "
|
|
|
- itemSvc.GetEntityByWhere(OilContractSumScoreItemsName,where,&item)
|
|
|
- item.Category = 0 // 二级单位创建
|
|
|
- item.SumScore = model.SumScore
|
|
|
- item.Content1 = model.Content1
|
|
|
+ where := " 1=1 AND SumScoreId= '" + utils.ToStr(model.Id) + "' AND Category = 0 "
|
|
|
+ itemSvc.GetEntityByWhere(OilContractSumScoreItemsName, where, &item)
|
|
|
+ item.Category = 0 // 二级单位创建
|
|
|
+ item.SumScore = model.SumScore
|
|
|
+ item.Content1 = model.Content1
|
|
|
item.NormalSumScore1 = model.NormalSumScore1
|
|
|
- item.SumScore1 = model.SumScore1
|
|
|
- item.Content2 = model.Content2
|
|
|
+ item.SumScore1 = model.SumScore1
|
|
|
+ item.Content2 = model.Content2
|
|
|
item.NormalSumScore2 = model.NormalSumScore2
|
|
|
- item.SumScore2 = model.SumScore2
|
|
|
- item.Content3 = model.Content3
|
|
|
+ item.SumScore2 = model.SumScore2
|
|
|
+ item.Content3 = model.Content3
|
|
|
item.NormalSumScore3 = model.NormalSumScore3
|
|
|
- item.SumScore3 = model.SumScore3
|
|
|
- item.Content4 = model.Content4
|
|
|
+ item.SumScore3 = model.SumScore3
|
|
|
+ item.Content4 = model.Content4
|
|
|
item.NormalSumScore4 = model.NormalSumScore4
|
|
|
- item.SumScore4 = model.SumScore4
|
|
|
- item.Content5 = model.Content5
|
|
|
+ item.SumScore4 = model.SumScore4
|
|
|
+ item.Content5 = model.Content5
|
|
|
item.NormalSumScore5 = model.NormalSumScore5
|
|
|
- item.SumScore5 = model.SumScore5
|
|
|
- item.Content6 = model.Content6
|
|
|
+ item.SumScore5 = model.SumScore5
|
|
|
+ item.Content6 = model.Content6
|
|
|
item.NormalSumScore6 = model.NormalSumScore6
|
|
|
- item.SumScore6 = model.SumScore6
|
|
|
- item.Content7 = model.Content7
|
|
|
+ item.SumScore6 = model.SumScore6
|
|
|
+ item.Content7 = model.Content7
|
|
|
item.NormalSumScore7 = model.NormalSumScore7
|
|
|
- item.SumScore7 = model.SumScore7
|
|
|
- item.Content8 = model.Content8
|
|
|
+ item.SumScore7 = model.SumScore7
|
|
|
+ item.Content8 = model.Content8
|
|
|
item.NormalSumScore8 = model.NormalSumScore8
|
|
|
- item.SumScore8 = model.SumScore8
|
|
|
+ item.SumScore8 = model.SumScore8
|
|
|
item.Conclusion = model.Conclusion
|
|
|
- item.Note = model.Note
|
|
|
- item.ModifiedOn = time.Now()
|
|
|
- item.ModifiedBy = this.User.Realname
|
|
|
+ item.Note = model.Note
|
|
|
+ item.ModifiedOn = time.Now()
|
|
|
+ item.ModifiedBy = this.User.Realname
|
|
|
item.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
item.B1 = model.B1
|
|
|
item.B2 = model.B2
|
|
|
@@ -590,41 +598,41 @@ func (this *OilContractSumScoreController) UpdateEntity() {
|
|
|
"Result1",
|
|
|
"Result2",
|
|
|
}
|
|
|
- err2 := itemSvc.UpdateEntityBytbl(OilContractSumScoreItemsName,item.Id,&item,cols2)
|
|
|
+ err2 := itemSvc.UpdateEntityBytbl(OilContractSumScoreItemsName, item.Id, &item, cols2)
|
|
|
|
|
|
var item3 contractSumScoreItems.OilContractSumScoreItems
|
|
|
- where3 := " 1=1 AND SumScoreId= '" + utils.ToStr( model.Id) + "' AND Category = 1 "
|
|
|
- itemSvc.GetEntityByWhere(OilContractSumScoreItemsName,where3,&item3)
|
|
|
- item3.Category = 1 // 专业科室单位创建
|
|
|
- item3.SumScore = model.SumScore
|
|
|
- item3.Content1 = model.Content1
|
|
|
+ where3 := " 1=1 AND SumScoreId= '" + utils.ToStr(model.Id) + "' AND Category = 1 "
|
|
|
+ itemSvc.GetEntityByWhere(OilContractSumScoreItemsName, where3, &item3)
|
|
|
+ item3.Category = 1 // 专业科室单位创建
|
|
|
+ item3.SumScore = model.SumScore
|
|
|
+ item3.Content1 = model.Content1
|
|
|
item3.NormalSumScore1 = model.NormalSumScore1
|
|
|
- item3.SumScore1 = model.SumScore1
|
|
|
- item3.Content2 = model.Content2
|
|
|
+ item3.SumScore1 = model.SumScore1
|
|
|
+ item3.Content2 = model.Content2
|
|
|
item3.NormalSumScore2 = model.NormalSumScore2
|
|
|
- item3.SumScore2 = model.SumScore2
|
|
|
- item3.Content3 = model.Content3
|
|
|
+ item3.SumScore2 = model.SumScore2
|
|
|
+ item3.Content3 = model.Content3
|
|
|
item3.NormalSumScore3 = model.NormalSumScore3
|
|
|
- item3.SumScore3 = model.SumScore3
|
|
|
- item3.Content4 = model.Content4
|
|
|
+ item3.SumScore3 = model.SumScore3
|
|
|
+ item3.Content4 = model.Content4
|
|
|
item3.NormalSumScore4 = model.NormalSumScore4
|
|
|
- item3.SumScore4 = model.SumScore4
|
|
|
- item3.Content5 = model.Content5
|
|
|
+ item3.SumScore4 = model.SumScore4
|
|
|
+ item3.Content5 = model.Content5
|
|
|
item3.NormalSumScore5 = model.NormalSumScore5
|
|
|
- item3.SumScore5 = model.SumScore5
|
|
|
- item3.Content6 = model.Content6
|
|
|
+ item3.SumScore5 = model.SumScore5
|
|
|
+ item3.Content6 = model.Content6
|
|
|
item3.NormalSumScore6 = model.NormalSumScore6
|
|
|
- item3.SumScore6 = model.SumScore6
|
|
|
- item3.Content7 = model.Content7
|
|
|
+ item3.SumScore6 = model.SumScore6
|
|
|
+ item3.Content7 = model.Content7
|
|
|
item3.NormalSumScore7 = model.NormalSumScore7
|
|
|
- item3.SumScore7 = model.SumScore7
|
|
|
- item3.Content8 = model.Content8
|
|
|
+ item3.SumScore7 = model.SumScore7
|
|
|
+ item3.Content8 = model.Content8
|
|
|
item3.NormalSumScore8 = model.NormalSumScore8
|
|
|
- item3.SumScore8 = model.SumScore8
|
|
|
+ item3.SumScore8 = model.SumScore8
|
|
|
item3.Conclusion = model.Conclusion
|
|
|
- item3.Note = model.Note
|
|
|
- item3.ModifiedOn = time.Now()
|
|
|
- item3.ModifiedBy = this.User.Realname
|
|
|
+ item3.Note = model.Note
|
|
|
+ item3.ModifiedOn = time.Now()
|
|
|
+ item3.ModifiedBy = this.User.Realname
|
|
|
item3.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
item3.B1 = model.B1
|
|
|
item3.B2 = model.B2
|
|
|
@@ -680,8 +688,7 @@ func (this *OilContractSumScoreController) UpdateEntity() {
|
|
|
"Result1",
|
|
|
"Result2",
|
|
|
}
|
|
|
- err3 := itemSvc.UpdateEntityBytbl(OilContractSumScoreItemsName,item3.Id,&item3,cols3)
|
|
|
-
|
|
|
+ err3 := itemSvc.UpdateEntityBytbl(OilContractSumScoreItemsName, item3.Id, &item3, cols3)
|
|
|
|
|
|
if err == nil && err2 == nil && err3 == nil {
|
|
|
errinfo.Message = "修改成功!"
|
|
|
@@ -719,40 +726,40 @@ func (this *OilContractSumScoreController) DocExport() {
|
|
|
|
|
|
var supplierModel supplier.OilSupplier
|
|
|
supplierSvc := supplier.GetOilSupplierService(utils.DBE)
|
|
|
- supplierSvc.GetEntityByIdBytbl(OilSupplierName,model.SupplierId,&supplierModel)
|
|
|
+ supplierSvc.GetEntityByIdBytbl(OilSupplierName, model.SupplierId, &supplierModel)
|
|
|
|
|
|
var supplierCertModel suppliercert.OilSupplierCert
|
|
|
suppliercertSvc := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
- suppliercertSvc.GetEntityByIdBytbl(OilSupplierCertName,model.SupplierId,&supplierCertModel)
|
|
|
+ suppliercertSvc.GetEntityByIdBytbl(OilSupplierCertName, model.SupplierId, &supplierCertModel)
|
|
|
|
|
|
var item contractSumScoreItems.OilContractSumScoreItems
|
|
|
itemSvc := contractSumScoreItems.GetOilContractSumScoreItemsService(utils.DBE)
|
|
|
- where := " 1=1 AND SumScoreId= '" + utils.ToStr( model.Id) + "' AND Category = '0' "
|
|
|
- itemSvc.GetEntityByWhere(OilContractSumScoreItemsName,where,&item)
|
|
|
+ where := " 1=1 AND SumScoreId= '" + utils.ToStr(model.Id) + "' AND Category = '0' "
|
|
|
+ itemSvc.GetEntityByWhere(OilContractSumScoreItemsName, where, &item)
|
|
|
|
|
|
datamap := structToMapDemo(model)
|
|
|
datamap["AccessCardNo"] = supplierCertModel.AccessCardNo
|
|
|
- datamap["ContactName"] = supplierModel.ContactName
|
|
|
- datamap["Mobile"] = supplierModel.Mobile
|
|
|
- datamap["Result1"] = item.Result2
|
|
|
- datamap["Result2"] = item.Result1
|
|
|
-
|
|
|
- datamap["SumScore1"] = item.SumScore1
|
|
|
- datamap["Content1"] = item.Content1
|
|
|
- datamap["SumScore2"] = item.SumScore2
|
|
|
- datamap["Content2"] = item.Content2
|
|
|
- datamap["SumScore3"] = item.SumScore3
|
|
|
- datamap["Content3"] = item.Content3
|
|
|
- datamap["SumScore4"] = item.SumScore4
|
|
|
- datamap["Content4"] = item.Content4
|
|
|
- datamap["SumScore5"] = item.SumScore5
|
|
|
- datamap["Content5"] = item.Content5
|
|
|
- datamap["SumScore6"] = item.SumScore6
|
|
|
- datamap["Content6"] = item.Content6
|
|
|
- datamap["SumScore7"] = item.SumScore7
|
|
|
- datamap["Content7"] = item.Content7
|
|
|
- datamap["SumScore8"] = item.SumScore8
|
|
|
- datamap["Content8"] = item.Content8
|
|
|
+ datamap["ContactName"] = supplierModel.ContactName
|
|
|
+ datamap["Mobile"] = supplierModel.Mobile
|
|
|
+ datamap["Result1"] = item.Result2
|
|
|
+ datamap["Result2"] = item.Result1
|
|
|
+
|
|
|
+ datamap["SumScore1"] = item.SumScore1
|
|
|
+ datamap["Content1"] = item.Content1
|
|
|
+ datamap["SumScore2"] = item.SumScore2
|
|
|
+ datamap["Content2"] = item.Content2
|
|
|
+ datamap["SumScore3"] = item.SumScore3
|
|
|
+ datamap["Content3"] = item.Content3
|
|
|
+ datamap["SumScore4"] = item.SumScore4
|
|
|
+ datamap["Content4"] = item.Content4
|
|
|
+ datamap["SumScore5"] = item.SumScore5
|
|
|
+ datamap["Content5"] = item.Content5
|
|
|
+ datamap["SumScore6"] = item.SumScore6
|
|
|
+ datamap["Content6"] = item.Content6
|
|
|
+ datamap["SumScore7"] = item.SumScore7
|
|
|
+ datamap["Content7"] = item.Content7
|
|
|
+ datamap["SumScore8"] = item.SumScore8
|
|
|
+ datamap["Content8"] = item.Content8
|
|
|
|
|
|
datamap["B1"] = item.B1
|
|
|
datamap["B2"] = item.B2
|
|
|
@@ -768,20 +775,20 @@ func (this *OilContractSumScoreController) DocExport() {
|
|
|
|
|
|
t := time.Now()
|
|
|
datamap["CreateDate"] = t.Format("2006年01月02日")
|
|
|
- datamap["Creater"] = this.User.Realname
|
|
|
+ datamap["Creater"] = this.User.Realname
|
|
|
|
|
|
if item.Conclusion == 1 {
|
|
|
datamap["Conclusion"] = "☑优秀 □合格 □观察使用 □不合格"
|
|
|
- }else if item.Conclusion == 2 {
|
|
|
+ } else if item.Conclusion == 2 {
|
|
|
datamap["Conclusion"] = "□优秀 ☑合格 □观察使用 □不合格"
|
|
|
- }else if item.Conclusion == 3 {
|
|
|
+ } else if item.Conclusion == 3 {
|
|
|
datamap["Conclusion"] = "□优秀 □合格 □观察使用 ☑不合格"
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
datamap["Conclusion"] = "□优秀 □合格 ☑观察使用 □不合格"
|
|
|
}
|
|
|
|
|
|
fileName := "承包商年度评价表和综合年度评价表.docx"
|
|
|
- Url := utils.Cfg.MustValue("workflow", "contractSumScoreUrl")
|
|
|
+ Url := utils.Cfg.MustValue("workflow", "contractSumScoreUrl")
|
|
|
|
|
|
//datamap["TableComment"] = []string{"MajorEquipments", "ThreeYears", "Patent", "Winning"}
|
|
|
retDocUrl := svcActiviti.FillWordTemplate(datamap, Url, fileName)
|
|
|
@@ -793,11 +800,12 @@ func (this *OilContractSumScoreController) DocExport() {
|
|
|
this.Data["json"] = &datainfo
|
|
|
this.ServeJSON()
|
|
|
}
|
|
|
+
|
|
|
// @Title 从数据录入数据导出到Excel文档
|
|
|
// @Description 数据存入Excel
|
|
|
// @Success 200 {object} controllers.Request
|
|
|
// @router /exportexcel [get]
|
|
|
-func (this *OilContractSumScoreController) ExcelExport(){
|
|
|
+func (this *OilContractSumScoreController) ExcelExport() {
|
|
|
//获取分页信息
|
|
|
where := " 1=1 "
|
|
|
orderby := "score.Id"
|
|
|
@@ -876,11 +884,11 @@ func (this *OilContractSumScoreController) ExcelExport(){
|
|
|
|
|
|
//超级管理员和有查看所有数据权限的用户不加条件
|
|
|
svcPerm := permission.GetPermissionService(utils.DBE)
|
|
|
- isauth := svcPerm.IsAuthorized(this.User.Id, "oil_contract.SumStore.AllRecord")
|
|
|
- if(!isauth){
|
|
|
+ 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 + " or score.UnitId = '" + strconv.Itoa(this.User.UnitId) + "' "
|
|
|
where = where + " )"
|
|
|
}
|
|
|
|
|
|
@@ -891,11 +899,11 @@ func (this *OilContractSumScoreController) ExcelExport(){
|
|
|
var Url string
|
|
|
var fileName string
|
|
|
fileName = ""
|
|
|
- Url = ""
|
|
|
+ Url = ""
|
|
|
if ContractClass == "03" {
|
|
|
fileName = "服务商年度评价表.xlsx"
|
|
|
Url = utils.Cfg.MustValue("workflow", "ServiceSumScoreUrl")
|
|
|
- } else if ContractClass == "01"{
|
|
|
+ } else if ContractClass == "01" {
|
|
|
fileName = "供应商年度评价表.xlsx"
|
|
|
Url = utils.Cfg.MustValue("workflow", "GoodsSumScoreUrl")
|
|
|
}
|
|
|
@@ -905,7 +913,7 @@ func (this *OilContractSumScoreController) ExcelExport(){
|
|
|
var datamap = make(map[string]interface{})
|
|
|
datamap["data"] = list
|
|
|
|
|
|
- retDocUrl := svcActiviti.FillExcel(datamap,ContractClass, Url, fileName)
|
|
|
+ retDocUrl := svcActiviti.FillExcel(datamap, ContractClass, Url, fileName)
|
|
|
var datainfo ErrorDataInfo
|
|
|
datainfo.Code = 0
|
|
|
datainfo.Item = retDocUrl
|
|
|
@@ -919,7 +927,7 @@ func (this *OilContractSumScoreController) ExcelExport(){
|
|
|
// @Param body body contractSumScore.OilContractSumScore
|
|
|
// @Success 200 {object} controllers.Request
|
|
|
// @router /save-sec-score/:id [post]
|
|
|
-func (this *OilContractSumScoreController) SaveScoreItemsBySec(){
|
|
|
+func (this *OilContractSumScoreController) SaveScoreItemsBySec() {
|
|
|
id := this.Ctx.Input.Param(":id")
|
|
|
var errinfo ErrorInfo
|
|
|
if id == "" {
|
|
|
@@ -936,40 +944,40 @@ func (this *OilContractSumScoreController) SaveScoreItemsBySec(){
|
|
|
|
|
|
where := "SumScoreId=" + id + " AND Category = 1 "
|
|
|
// 清除掉之前的
|
|
|
- itemSvc.DeleteEntityBytbl(OilContractSumScoreItemsName,where)
|
|
|
+ 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.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.SumScore1 = model.SumScore1
|
|
|
+ item.Content2 = model.Content2
|
|
|
item.NormalSumScore2 = model.NormalSumScore2
|
|
|
- item.SumScore2 = model.SumScore2
|
|
|
- item.Content3 = model.Content3
|
|
|
+ item.SumScore2 = model.SumScore2
|
|
|
+ item.Content3 = model.Content3
|
|
|
item.NormalSumScore3 = model.NormalSumScore3
|
|
|
- item.SumScore3 = model.SumScore3
|
|
|
- item.Content4 = model.Content4
|
|
|
+ item.SumScore3 = model.SumScore3
|
|
|
+ item.Content4 = model.Content4
|
|
|
item.NormalSumScore4 = model.NormalSumScore4
|
|
|
- item.SumScore4 = model.SumScore4
|
|
|
- item.Content5 = model.Content5
|
|
|
+ item.SumScore4 = model.SumScore4
|
|
|
+ item.Content5 = model.Content5
|
|
|
item.NormalSumScore5 = model.NormalSumScore5
|
|
|
- item.SumScore5 = model.SumScore5
|
|
|
- item.Content6 = model.Content6
|
|
|
+ item.SumScore5 = model.SumScore5
|
|
|
+ item.Content6 = model.Content6
|
|
|
item.NormalSumScore6 = model.NormalSumScore6
|
|
|
- item.SumScore6 = model.SumScore6
|
|
|
- item.Content7 = model.Content7
|
|
|
+ item.SumScore6 = model.SumScore6
|
|
|
+ item.Content7 = model.Content7
|
|
|
item.NormalSumScore7 = model.NormalSumScore7
|
|
|
- item.SumScore7 = model.SumScore7
|
|
|
- item.Content8 = model.Content8
|
|
|
+ item.SumScore7 = model.SumScore7
|
|
|
+ item.Content8 = model.Content8
|
|
|
item.NormalSumScore8 = model.NormalSumScore8
|
|
|
- item.SumScore8 = model.SumScore8
|
|
|
+ item.SumScore8 = model.SumScore8
|
|
|
item.Conclusion = model.Conclusion
|
|
|
- item.Note = model.Note
|
|
|
- item.CreateOn = time.Now()
|
|
|
- item.CreateBy = this.User.Realname
|
|
|
+ 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
|
|
|
@@ -984,7 +992,7 @@ func (this *OilContractSumScoreController) SaveScoreItemsBySec(){
|
|
|
item.Result1 = model.Result1
|
|
|
item.Result2 = model.Result2
|
|
|
|
|
|
- _,err := itemSvc.InsertEntityBytbl(OilContractSumScoreItemsName, &item)
|
|
|
+ _, err := itemSvc.InsertEntityBytbl(OilContractSumScoreItemsName, &item)
|
|
|
|
|
|
if err == nil {
|
|
|
errinfo.Message = "修改成功!"
|
|
|
@@ -999,7 +1007,6 @@ func (this *OilContractSumScoreController) SaveScoreItemsBySec(){
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// @Title 删除单条信息
|
|
|
// @Description
|
|
|
// @Success 200 {object} ErrorInfo
|
|
|
@@ -1021,7 +1028,7 @@ func (this *OilContractSumScoreController) DeleteEntity() {
|
|
|
|
|
|
// 审核中不能删除
|
|
|
svc.GetEntityByIdBytbl(OilContractSumScoreName, Id, &model)
|
|
|
- if model.Status > "0" && model.Status < "8" {
|
|
|
+ if model.Status > "0" && model.Status < "8" {
|
|
|
errinfo.Message = "该年度评价正在审核,不允许删除!"
|
|
|
errinfo.Code = -1
|
|
|
this.Data["json"] = &errinfo
|
|
|
@@ -1029,7 +1036,6 @@ func (this *OilContractSumScoreController) DeleteEntity() {
|
|
|
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 {
|
|
|
@@ -1045,7 +1051,6 @@ func (this *OilContractSumScoreController) DeleteEntity() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// @Title 二级单位提交审批 --启动工作流
|
|
|
// @Description 二级单位提交审批
|
|
|
// @Success 200 {object} controllers.Request
|