Jelajahi Sumber

承包商年审

Yikoo 5 tahun lalu
induk
melakukan
83166edb08

+ 2 - 0
src/dashoo.cn/backend/api/business/oilcontract/contractEvaluationItems/contractEvaluationItems.go

@@ -7,6 +7,7 @@ import (
 type OilContractEvaluationItems struct {
 	Id              int       `json:"Id" xorm:"not null pk autoincr comment('ID') INT(11) 'Id'"`
 	Category        int       `json:"Category" xorm:"default 0 comment('0二级单位创建1专业处创建') INT(11) 'Category'"`
+	Type            int       `json:"Type" xorm:"default 0 comment('项类型 1分值 2布尔') INT(11) 'Type'"`
 	ContentReviewId int       `json:"ContentReviewId" xorm:"default 0 comment('评价ID') INT(11) 'ContentReviewId'"`
 	ItemId          int       `json:"ItemId" xorm:"not null default 0 comment('当前节点ID') INT(11) 'ItemId'"`
 	ParentId        int       `json:"ParentId" xorm:"not null default 0 comment('上级节点ID') INT(11) 'ParentId'"`
@@ -22,6 +23,7 @@ type OilContractEvaluationItems struct {
 }
 type EvaluationItems struct {
 	Id             int       `json:"Id"`
+	Type           int       `json:"Type"`
 	ParentId       int       `json:"ParentId"`
 	SequenceNo     string    `json:"SequenceNo"`
 	Content        string    `json:"Content"`

+ 1 - 0
src/dashoo.cn/backend/api/business/oilcontract/contractReview/contractReview.go

@@ -91,6 +91,7 @@ type OilContractReviewVo struct {
 }
 type OilContractEvaluationItemsVo struct{
 	Id             int       `json:"Id" xorm:"not null pk autoincr comment('ID') INT(11) 'Id'"`
+	Type           int       `json:"Type" xorm:"default 1 comment('项类型 1分值 2布尔') INT(11) 'Type'"`
 	ContractId     int       `json:"ContractId" xorm:"default 0 comment('合同表ID') INT(11) 'ContractId'"`
 	ContractWorkId int       `json:"ContractId" xorm:"default 0 comment('ReviewWork表ID') INT(11) 'ContractWorkId'"`
 	ParentId       int       `json:"ParentId" xorm:"not null default 0 comment('上级节点ID') INT(11) 'ParentId'"`

+ 2 - 0
src/dashoo.cn/backend/api/business/oilcontract/evaluationItems/evaluationItems.go

@@ -8,6 +8,7 @@ type OilEvaluationItems struct {
 	Id             int       `json:"Id" xorm:"not null pk autoincr comment('ID') INT(11) 'Id'"`
 	ParentId       int       `json:"ParentId" xorm:"not null default 0 comment('上级节点ID') INT(11) 'ParentId'"`
 	Type           string    `json:"Type" xorm:"default '1' comment('分类:1服务商、2供应商、3承包商') VARCHAR(5) 'Type'"`
+	Category       int       `json:"Category" xorm:"default '1' comment('项类型 1分值 2布尔') INT(11) 'Category'"`
 	SequenceNo     string    `json:"SequenceNo" xorm:"default '0' comment('序号') VARCHAR(50) 'SequenceNo'"`
 	Content        string    `json:"Content" xorm:"comment('评价内容') VARCHAR(1000) 'Content'"`
 	NormalScore    string    `json:"NormalScore" xorm:"comment('标准分值') DECIMAL(11,2) 'NormalScore'"`
@@ -26,6 +27,7 @@ type DailyItems struct {
 	Id             int       `json:"Id"`
 	ParentId       int       `json:"ParentId"`
 	Type           string    `json:"Type"`
+	Category       int       `json:"Category"`
 	SequenceNo     string    `json:"SequenceNo"`
 	Content        string    `json:"Content"`
 	NormalScore    string    `json:"NormalScore"`

+ 4 - 0
src/dashoo.cn/backend/api/controllers/oilcontract/contractEvaluationItems.go

@@ -120,12 +120,16 @@ func (this *OilContractEvaluationItemsController) GetTreeList() {
 	where := " ParentId = 0 "
 	Id      := this.GetString("ContentReviewId")     // 评价主表ID
 	Category:= this.GetString("Category","0")   // 类型  0 二级部门创建  1 专业处创建
+	Type    := this.GetString("Type","0")       //  项类型 1分值 2布尔
 	if Id != "" {
 		where = where + " and ContentReviewId = '" + Id + "'"
 	}
 	if Category != "" {
 		where = where + " and Category = '" + Category + "'"
 	}
+	if Type != "" {
+		where = where + " and Type = '" + Type + "'"
+	}
 	svc := contractEvaluationItems.GetOilContractEvaluationItemsService(utils.DBE)
 	var list []contractEvaluationItems.OilContractEvaluationItems
 	var result []contractEvaluationItems.EvaluationItems

+ 56 - 0
src/dashoo.cn/backend/api/controllers/oilcontract/contractReview.go

@@ -179,6 +179,7 @@ func (this *OilContractReviewController) AddEntity() {
 		fmt.Print(i)
 		var temp contractEvaluationItems.OilContractEvaluationItems
 		temp.ContentReviewId = reviewMode.Id
+		temp.Type     = v.Type
 		temp.Category = 0
 		temp.ItemId = v.Id
 		temp.ParentId = v.ParentId
@@ -210,6 +211,60 @@ func (this *OilContractReviewController) AddEntity() {
 	}
 }
 
+// @Title 添加
+// @Description 二级科室保存评价
+// @Param 	body body contractReview.OilContractReviewWorkFlow
+// @Success	200	{object} controllers.Request
+// @router /save-sec-evaluation [post]
+func (this *OilContractReviewController) SaveEvaluationItemsBySec(){
+	id := this.Ctx.Input.Param(":id")
+	var errinfo ErrorInfo
+	if id == "" {
+		errinfo.Message = "操作失败!请求信息不完整"
+		errinfo.Code = -2
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+	var modeVO contractReview.OilContractReviewVo
+	itemSvc := contractEvaluationItems.GetOilContractEvaluationItemsService(utils.DBE)
+	var jsonBlob = this.Ctx.Input.RequestBody
+	json.Unmarshal(jsonBlob, &modeVO)
+	where := "ContentReviewId=" + id
+	// 清除掉之前的
+	itemSvc.DeleteEntityBytbl(OilContractReviewName,where)
+	var items []contractEvaluationItems.OilContractEvaluationItems
+	// 新增配置项
+	for i,v := range modeVO.Items{
+		fmt.Print(i)
+		var temp contractEvaluationItems.OilContractEvaluationItems
+		temp.ContentReviewId,_ = strconv.Atoi(id)
+		temp.Type     = v.Type
+		temp.Category = 1
+		temp.ParentId = v.ParentId
+		temp.SequenceNo = v.SequenceNo
+		temp.Content = v.Content
+		temp.NormalScore = v.NormalScore
+		temp.Score = v.Score
+		temp.LevelCode = v.LevelCode
+		temp.Remark = v.Remark
+		temp.Content = v.Content
+		items = append(items, temp)
+	}
+	_ , err := itemSvc.DBE.Insert(items)
+	if err == 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 contractReview.OilContractReviewWorkFlow
@@ -293,6 +348,7 @@ func (this *OilContractReviewController) UpdateEntity() {
 		fmt.Print(i)
 		var temp contractEvaluationItems.OilContractEvaluationItems
 		temp.ContentReviewId = reviewMode.Id
+		temp.Type     = v.Type
 		temp.Category = 0
 		temp.ParentId = v.ParentId
 		temp.SequenceNo = v.SequenceNo

+ 8 - 2
src/dashoo.cn/backend/api/controllers/oilcontract/evaluationItems.go

@@ -161,9 +161,10 @@ func (this *OilEvaluationItemsController) GetDictList() {
 // @Title 获取一级列表
 // @Description get user by token
 // @Success 200 {object} []evaluationItems.OilEvaluationItems
-// @router /onelist/:type [get]
+// @router /onelist/:type/:category [get]
 func (this *OilEvaluationItemsController) GetOneEntityList() {
-	Type := this.Ctx.Input.Param(":type")
+	Type     := this.Ctx.Input.Param(":type")
+	Category := this.Ctx.Input.Param(":category")
 	//获取分页信息
 	page := this.GetPageInfoForm()
 	orderby := "Id"
@@ -171,6 +172,9 @@ func (this *OilEvaluationItemsController) GetOneEntityList() {
 	if Type != "0" {
 		where += " AND Type = " + Type
 	}
+	if Category != "" {
+		where += " AND Category = " + Category
+	}
 	svc := evaluationItems.GetOilEvaluationItemsService(utils.DBE)
 	var list []evaluationItems.OilEvaluationItems
 	var result []evaluationItems.DailyItems
@@ -182,6 +186,7 @@ func (this *OilEvaluationItemsController) GetOneEntityList() {
 		firstTmp.ParentId = value.ParentId
 		firstTmp.Id = value.Id
 		firstTmp.Type = value.Type
+		firstTmp.Category = value.Category
 		firstTmp.SequenceNo = value.SequenceNo
 		firstTmp.NormalScore = value.NormalScore
 		firstTmp.Remark = value.Remark
@@ -197,6 +202,7 @@ func (this *OilEvaluationItemsController) GetOneEntityList() {
 			secTmp.ParentId = v.ParentId
 			secTmp.Id = v.Id
 			secTmp.Type = v.Type
+			secTmp.Category = v.Category
 			secTmp.SequenceNo = v.SequenceNo
 			secTmp.NormalScore = v.NormalScore
 			secTmp.Remark = v.Remark