瀏覽代碼

审核流程修改

Yikoo 5 年之前
父節點
當前提交
0f2597ebf7

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

@@ -43,4 +43,5 @@ type OilContract struct {
 	ModifiedOn           time.Time `json:"ModifiedOn" xorm:"DATETIME 'ModifiedOn'"`
 	ModifiedUserId       int       `json:"ModifiedUserId" xorm:"INT(11) 'ModifiedUserId'"`
 	ModifiedBy           string    `json:"ModifiedBy" xorm:"default '1' VARCHAR(50) 'ModifiedBy'"`
+	SubPackage           int       `json:"SubPackage" xorm:"default 0 comment('是否分包') INT(11) 'SubPackage'"`
 }

+ 3 - 1
src/dashoo.cn/backend/api/business/oilcontract/contractEvaluationItems/contractEvaluationItems.go

@@ -8,6 +8,7 @@ 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'"`
 	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'"`
 	SequenceNo      string    `json:"SequenceNo" xorm:"default '0' comment('序号') VARCHAR(50) 'SequenceNo'"`
 	Content         string    `json:"Content" xorm:"comment('评价内容') VARCHAR(1000) 'Content'"`
@@ -25,6 +26,7 @@ type EvaluationItems struct {
 	SequenceNo     string    `json:"SequenceNo"`
 	Content        string    `json:"Content"`
 	NormalScore    string    `json:"NormalScore"`
+	Score          string    `json:"Score"`
 	LevelCode      int       `json:"LevelCode"`
 	Remark         string    `json:"Remark"`
 	IsDelete       int       `json:"IsDelete"`
@@ -34,5 +36,5 @@ type EvaluationItems struct {
 	ModifiedOn     time.Time `json:"ModifiedOn"`
 	ModifiedUserId int       `json:"ModifiedUserId"`
 	ModifiedBy     string    `json:"ModifiedBy"`
-	Child		   []EvaluationItems
+	Son		   []EvaluationItems
 }

+ 5 - 1
src/dashoo.cn/backend/api/business/oilcontract/contractSumScore/contractSumScore.go

@@ -9,7 +9,7 @@ type OilContractSumScore struct {
 	SupplierId       int       `json:"SupplierId" xorm:"default 0 comment('供应商ID') INT(11) 'SupplierId'"`
 	SupplierName     string    `json:"SupplierName" xorm:"comment('企业名称') VARCHAR(255) 'SupplierName'"`
 	ContractClass    string    `json:"ContractClass" xorm:"comment('合同类别') VARCHAR(255) 'ContractClass'"`
-	Category         int       `json:"Category" xorm:"not null default 0 comment('0二级单位创建1专业处创建') INT(11) 'Category'"`
+	Year             string    `json:"Year" xorm:"VARCHAR(255) 'Year'"`
 	ConclusionReason string    `json:"ConclusionReason" xorm:"comment('不合格原因') VARCHAR(255) 'ConclusionReason'"`
 	Conclusion       int       `json:"Conclusion" xorm:"default 0 comment('0不合格,1观察使用,2合格,3优秀') INT(11) 'Conclusion'"`
 	WorkflowId     	 string    `json:"WorkflowId" xorm:"default '0' comment('工作流的ID') VARCHAR(50) 'WorkflowId'"`
@@ -36,7 +36,9 @@ type OilContractSumScoreVo struct {
 	SupplierName     string    `json:"SupplierName" xorm:"comment('企业名称') VARCHAR(255) 'SupplierName'"`
 	ContractClass    string    `json:"ContractClass" xorm:"comment('合同类别') VARCHAR(255) 'ContractClass'"`
 	Category         int       `json:"Category" xorm:"not null default 0 comment('0二级单位创建1专业处创建') INT(11) 'Category'"`
+	Year             string    `json:"Year" xorm:"VARCHAR(255) 'Year'"`
 	SumScore         float64   `json:"SumScore" xorm:"default 0.00 comment('实际分值') DECIMAL(11,2) 'SumScore'"`
+	SumScoreId       int       `json:"SumScoreId" xorm:"default 0 comment('主表ID') INT(11) 'SumScoreId'"`
 	Content1    	 string    `json:"Content1" xorm:"default '0' comment('评价内容') VARCHAR(50) 'Content1'"`
 	NormalSumScore1  float64   `json:"NormalSumScore1" xorm:"default 0.00 comment('标准分值') DECIMAL(11,2) 'NormalSumScore1'"`
 	SumScore1        float64   `json:"SumScore1" xorm:"default 0.00 comment('实际分值') DECIMAL(11,2) 'SumScore1'"`
@@ -52,6 +54,7 @@ type OilContractSumScoreVo struct {
 	Content5    	 string    `json:"Content5" xorm:"default '0' comment('评价内容') VARCHAR(50) 'Content5'"`
 	NormalSumScore5  float64   `json:"NormalSumScore5" xorm:"default 0.00 comment('标准分值') DECIMAL(11,2) 'NormalSumScore5'"`
 	SumScore5        float64   `json:"SumScore5" xorm:"default 0.00 comment('实际分值') DECIMAL(11,2) 'SumScore5'"`
+	Status           string    `json:"Status" xorm:"not null default '0' comment('状态标识( 0 初始 - 1待二级初审 - 2待二级复审 - 3-专业科室接收 4 待专业科室审核 - 5 待集中评审 - 6 待交费 - 7 待入库 - 8 完成 - 9审核未通过)') VARCHAR(10) 'Status'"`
 	Note			 string    `json:"Note" xorm:"comment('备注') VARCHAR(255) 'Note'"`
 	ConclusionReason string    `json:"ConclusionReason" xorm:"comment('不合格原因') VARCHAR(255) 'ConclusionReason'"`
 	Conclusion       int       `json:"Conclusion" xorm:"default 0 comment('0不合格,1观察使用,2合格,3优秀') INT(11) 'Conclusion'"`
@@ -76,6 +79,7 @@ type OilContractComputeSumScoreVo struct {
 	SupplierId    int       `json:"SupplierId"`
 	SupplierName  string    `json:"SupplierName"`
 	ContractClass string    `json:"ContractClass"`
+	Year          string    `json:"Year"`
 	Score         string    `json:"Score"`
 	Score1    	  string    `json:"Score1"`
 	Score2  	  string    `json:"Score2"`

+ 1 - 1
src/dashoo.cn/backend/api/business/oilcontract/contractSumScore/contractSumScoreService.go

@@ -30,7 +30,7 @@ func (s *OilContractSumScoreService) GetPagingComputeEntitiesWithOrderBytbl(page
 	sqlCount += ` ) t `
 
 	var sql string
-	sql =  `select contract.ContractClass,contract.SupplierId,contract.SupplierName,count(review.id) as count,ROUND(sum(items.Score)/count(review.id),2) as Score, `
+	sql =  `select YEAR(NOW()) as Year,contract.ContractClass,contract.SupplierId,contract.SupplierName,count(review.id) as count,ROUND(sum(items.Score)/count(review.id),2) as Score, `
 	sql += ` ROUND(sum(case when items.SequenceNo in  ('1') then items.Score else 0 end)/count(review.id),2) Score1,  `
 	sql += ` ROUND(sum(case when items.SequenceNo in  ('2') then items.Score else 0 end)/count(review.id),2) Score2,  `
 	sql += ` ROUND(sum(case when items.SequenceNo in  ('3') then items.Score else 0 end)/count(review.id),2) Score3,  `

+ 2 - 1
src/dashoo.cn/backend/api/business/oilcontract/contractSumScoreItems/contractSumScoreItems.go

@@ -5,7 +5,9 @@ import "time"
 type OilContractSumScoreItems struct{
 	Id               int       `json:"Id" xorm:"not null pk autoincr comment('ID') INT(11) 'Id'"`
 	SumScoreId       int       `json:"SumScoreId" xorm:"default 0 comment('主表ID') INT(11) 'SumScoreId'"`
+	Conclusion       int       `json:"Conclusion" xorm:"default 0 comment('0不合格,1观察使用,2合格,3优秀') INT(11) 'Conclusion'"`
 	SumScore         float64   `json:"SumScore" xorm:"default 0.00 comment('实际分值') DECIMAL(11,2) 'SumScore'"`
+	Category         int       `json:"Category" xorm:"not null default 0 comment('0二级单位创建1专业处创建') INT(11) 'Category'"`
 	Content1    	 string    `json:"Content1" xorm:"default '0' comment('评价内容') VARCHAR(50) 'Content1'"`
 	NormalSumScore1  float64   `json:"NormalSumScore1" xorm:"default 0.00 comment('标准分值') DECIMAL(11,2) 'NormalSumScore1'"`
 	SumScore1        float64   `json:"SumScore1" xorm:"default 0.00 comment('实际分值') DECIMAL(11,2) 'SumScore1'"`
@@ -21,7 +23,6 @@ type OilContractSumScoreItems struct{
 	Content5    	 string    `json:"Content5" xorm:"default '0' comment('评价内容') VARCHAR(50) 'Content5'"`
 	NormalSumScore5  float64   `json:"NormalSumScore5" xorm:"default 0.00 comment('标准分值') DECIMAL(11,2) 'NormalSumScore5'"`
 	SumScore5        float64   `json:"SumScore5" xorm:"default 0.00 comment('实际分值') DECIMAL(11,2) 'SumScore5'"`
-	Status           string    `json:"Status" xorm:"not null default '0' comment('状态标识( 0 初始 - 1待二级初审 - 2待二级复审 - 3-专业科室接收 4 待专业科室审核 - 5 待集中评审 - 6 待交费 - 7 待入库 - 8 完成 - 9审核未通过)') VARCHAR(10) 'Status'"`
 	Note			 string    `json:"Note" xorm:"comment('备注') VARCHAR(255) 'Note'"`
 	CreateOn       	 time.Time `json:"CreateOn" xorm:"DATETIME 'CreateOn'"`
 	CreateUserId     int       `json:"CreateUserId" xorm:"INT(11) 'CreateUserId'"`

+ 2 - 0
src/dashoo.cn/backend/api/controllers/oilcontract/contract.go

@@ -399,6 +399,8 @@ func (this *OilContractController) UpdateEntity() {
 		"ModifiedUserId",
 
 		"ModifiedBy",
+
+		"SubPackage",
 	}
 	err := svc.UpdateEntityBytbl(OilContractName, id, &model, cols)
 	if err == nil {

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

@@ -118,7 +118,7 @@ func (this *OilContractEvaluationItemsController) GetTreeList() {
 	page := this.GetPageInfoForm()
 	orderby := "Id"
 	where := " ParentId = 0 "
-	Id      := this.GetString("ContentReviewId")      // 评价主表ID
+	Id      := this.GetString("ContentReviewId")     // 评价主表ID
 	Category:= this.GetString("Category","0")   // 类型  0 二级部门创建  1 专业处创建
 	if Id != "" {
 		where = where + " and ContentReviewId = '" + Id + "'"
@@ -140,20 +140,20 @@ func (this *OilContractEvaluationItemsController) GetTreeList() {
 		firstTmp.Remark = value.Remark
 		firstTmp.LevelCode = value.LevelCode
 
-		var list1 []contractEvaluationItems.EvaluationItems
-		where1 := " ParentId = " + strconv.Itoa(value.Id)
+		var list1 []contractEvaluationItems.OilContractEvaluationItems
+		where1 := "ContentReviewId ='" + Id +"' AND ParentId = " + strconv.Itoa(value.ItemId)
 		svc.GetPagingEntitiesWithOrderBytbl("", page.CurrentPage, page.Size, orderby, true, &list1, where1)
 		for _, v := range list1 {
 			var secTmp contractEvaluationItems.EvaluationItems
-			secTmp.Content = v.Content
-			secTmp.Content = v.Content
+			secTmp.Content  = v.Content
+			secTmp.Score    = v.Score
 			secTmp.ParentId = v.ParentId
-			secTmp.Id = v.Id
+			secTmp.Id       = v.Id
 			secTmp.SequenceNo = v.SequenceNo
 			secTmp.NormalScore = v.NormalScore
 			secTmp.Remark = v.Remark
 			secTmp.LevelCode = v.LevelCode
-			firstTmp.Child = append(firstTmp.Child, secTmp)
+			firstTmp.Son = append(firstTmp.Son, secTmp)
 		}
 		result = append(result, firstTmp)
 	}

+ 5 - 2
src/dashoo.cn/backend/api/controllers/oilcontract/contractReview.go

@@ -180,6 +180,7 @@ func (this *OilContractReviewController) AddEntity() {
 		var temp contractEvaluationItems.OilContractEvaluationItems
 		temp.ContentReviewId = reviewMode.Id
 		temp.Category = 0
+		temp.ItemId = v.Id
 		temp.ParentId = v.ParentId
 		temp.SequenceNo = v.SequenceNo
 		temp.Content = v.Content
@@ -190,9 +191,11 @@ func (this *OilContractReviewController) AddEntity() {
 		temp.Content = v.Content
 		items = append(items, temp)
 	}
-	itemSvc.DBE.Insert(items)
+	_, err2 := itemSvc.DBE.Insert(items)
+
+
 	var errinfo ErrorDataInfo
-	if err == nil {
+	if err == nil && err2 == nil{
 		//新增
 		errinfo.Message = "添加成功!"
 		errinfo.Code = 0

+ 102 - 58
src/dashoo.cn/backend/api/controllers/oilcontract/contractSumScore.go

@@ -225,20 +225,20 @@ func (this *OilContractSumScoreController) GetComputeEntityList(){
 	}
 	SupplierName := this.GetString("SupplierName")
 	//CreateOn     := this.GetString("CreateOn")
-	Type         := this.GetString("Type","01")
+	ContractClass         := this.GetString("ContractClass","01")
 
 	if SupplierName != "" {
 		where = where + " and contract.SupplierName like '%" + SupplierName + "%'"
 	}
-	if Type != ""{
-		where = where + " and contract.ContractClass = '" + Type + "'"
+	if ContractClass != ""{
+		where = where + " and contract.ContractClass = '" + ContractClass + "'"
 	}
 
 	// 今年的汇总
 	year   := strconv.Itoa(time.Now().Year())
 	month  := "01"
 	day    := "01"
-	where = where + " and CreateOn>='" + year + "-" + month + "-" + day + "' "
+	where = where + " and review.CreateOn>='" + year + "-" + month + "-" + day + "' "
 
 	//if CreateOn != "" {
 	//	dates := strings.Split(CreateOn, ",")
@@ -293,8 +293,41 @@ func (this *OilContractSumScoreController) GetEntity() {
 	Id := this.Ctx.Input.Param(":id")
 	var model contractSumScore.OilContractSumScore
 	svc := contractSumScore.GetOilContractSumScoreService(utils.DBE)
-	svc.GetEntityByIdBytbl(this.User.AccCode+OilContractSumScoreName, Id, &model)
-	this.Data["json"] = &model
+	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 "
+	itemSvc.GetEntityByWhere(OilContractSumScoreItemsName,where,&item)
+
+	var result contractSumScore.OilContractSumScoreVo
+	result.Id = model.Id
+	result.SupplierId   = model.SupplierId
+	result.SupplierName = model.SupplierName
+	result.ContractClass= model.ContractClass
+	result.Year         = model.Year
+	result.Status       = model.Status
+	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.SumScore1    = item.SumScore1
+	result.SumScore2    = item.SumScore2
+	result.SumScore3    = item.SumScore3
+	result.SumScore4    = item.SumScore4
+	result.SumScore5    = item.SumScore5
+	result.NormalSumScore1 = item.NormalSumScore1
+	result.NormalSumScore2 = item.NormalSumScore2
+	result.NormalSumScore3 = item.NormalSumScore3
+	result.NormalSumScore4 = item.NormalSumScore4
+	result.NormalSumScore5 = item.NormalSumScore5
+	result.Note = item.Note
+	result.Conclusion = item.Conclusion
+	this.Data["json"] = &result
 	this.ServeJSON()
 }
 
@@ -312,7 +345,7 @@ func (this *OilContractSumScoreController) AddEntity() {
 	entity.SupplierId   = model.SupplierId
 	entity.SupplierName = model.SupplierName
 	entity.ContractClass= model.ContractClass
-	entity.Category   = 1                      // 二级单位创建
+	entity.Year         = model.Year
 	entity.Status     = "0"
 	entity.CreateOn   = time.Now()
 	entity.CreateBy   = this.User.Realname
@@ -323,6 +356,7 @@ func (this *OilContractSumScoreController) AddEntity() {
 
 	var item contractSumScoreItems.OilContractSumScoreItems
 	item.SumScoreId = entity.Id
+	item.Category   = 0                      // 二级单位创建
 	item.SumScore   = model.SumScore
 	item.Content1   = model.Content1
 	item.NormalSumScore1 = model.NormalSumScore1
@@ -339,13 +373,14 @@ func (this *OilContractSumScoreController) AddEntity() {
 	item.Content5   = model.Content5
 	item.NormalSumScore5 = model.NormalSumScore5
 	item.SumScore5  = model.SumScore5
+	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()
 
 	itemSvc := contractSumScoreItems.GetOilContractSumScoreItemsService(utils.DBE)
-	itemSvc.InsertEntityBytbl(OilContractSumScoreItemsName, &entity)
+	itemSvc.InsertEntityBytbl(OilContractSumScoreItemsName, &item)
 	var errinfo ErrorDataInfo
 	if err == nil {
 		//新增
@@ -378,74 +413,83 @@ func (this *OilContractSumScoreController) UpdateEntity() {
 		return
 	}
 
-	var model contractSumScore.OilContractSumScore
+	var model contractSumScore.OilContractSumScoreVo
 	svc := contractSumScore.GetOilContractSumScoreService(utils.DBE)
-
 	var jsonBlob = this.Ctx.Input.RequestBody
 	json.Unmarshal(jsonBlob, &model)
-	model.ModifiedOn = time.Now()
-	model.ModifiedBy = this.User.Realname
-	model.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
 
+	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()
 	cols := []string{
-
-		"Id",
-
-		"ContractId",
-
+		"SupplierId",
+		"SupplierName",
 		"ContractClass",
+		"Year",
+		"Status",
+		"CreateOn",
+		"CreateBy",
+		"CreateUserId",
+	}
+	err := svc.UpdateEntityBytbl(OilContractSumScoreName, id, &model, cols)
 
-		"SumScore",
+	var item contractSumScoreItems.OilContractSumScoreItems
+	itemSvc := contractSumScoreItems.GetOilContractSumScoreItemsService(utils.DBE)
+	where := " 1=1 AND SumScoreId= '" + utils.ToStr( entity.Id) + "' AND Category = 0 "
+	itemSvc.GetEntityByWhere(OilContractSumScoreItemsName,where,&item)
+	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.Note       = model.Note
+	item.ModifiedOn   = time.Now()
+	item.ModifiedBy   = this.User.Realname
+	item.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
 
+	cols2 := []string{
+		"Category",
+		"SumScore",
 		"Content1",
-
-		"NormalSumScore1",
-
-		"SumScore1",
-
 		"Content2",
-
-		"NormalSumScore2",
-
-		"SumScore2",
-
 		"Content3",
-
-		"NormalSumScore3",
-
-		"SumScore3",
-
 		"Content4",
-
-		"NormalSumScore4",
-
-		"SumScore4",
-
 		"Content5",
-
+		"NormalSumScore1",
+		"NormalSumScore2",
+		"NormalSumScore3",
+		"NormalSumScore4",
 		"NormalSumScore5",
-
+		"SumScore1",
+		"SumScore2",
+		"SumScore3",
+		"SumScore4",
 		"SumScore5",
-
-		"ConclusionReason",
-
-		"Conclusion",
-
-		"CreateOn",
-
-		"CreateUserId",
-
-		"CreateBy",
-
+		"Note",
 		"ModifiedOn",
-
-		"ModifiedUserId",
-
 		"ModifiedBy",
-
-
+		"ModifiedUserId",
 	}
-	err := svc.UpdateEntityBytbl(this.User.AccCode+OilContractSumScoreName, id, &model, cols)
+	itemSvc.UpdateEntityBytbl(OilContractSumScoreItemsName,item.Id,&item,cols2)
+
 	if err == nil {
 		errinfo.Message = "修改成功!"
 		errinfo.Code = 0