|
|
@@ -133,13 +133,15 @@ func (this *OilContractSumScoreController) GetEntityList() {
|
|
|
}
|
|
|
|
|
|
// @Title 获取核算列表
|
|
|
+
|
|
|
// @Description get user by token
|
|
|
// @Success 200 {object} []contractSumScore.OilContractSumScore
|
|
|
// @router /compute-list [get]
|
|
|
func (this *OilContractSumScoreController) GetComputeEntityList() {
|
|
|
//获取分页信息
|
|
|
page := this.GetPageInfoForm()
|
|
|
- where := " 1=1 "
|
|
|
+ where := " 1=1 "
|
|
|
+ having := " 1=1 "
|
|
|
orderby := "contract.SupplierId"
|
|
|
asc := false
|
|
|
Order := this.GetString("Order")
|
|
|
@@ -162,14 +164,14 @@ func (this *OilContractSumScoreController) GetComputeEntityList() {
|
|
|
where = where + " and contract.ContractClass = '" + ContractClass + "'"
|
|
|
}
|
|
|
|
|
|
- if Evaluate == "1" {
|
|
|
|
|
|
- } else if Evaluate == "2" {
|
|
|
-
|
|
|
- } else if Evaluate == "3" {
|
|
|
+ if Evaluate == "1" { // 优秀
|
|
|
|
|
|
+ } else if Evaluate == "2" { // 合格
|
|
|
+ having = "ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in ('1') AND items.Type = 1 then 1 else 0 end),2) <80"
|
|
|
+ } else if Evaluate == "3" { // 不合格
|
|
|
+ having = "ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in ('1') AND items.Type = 1 then 1 else 0 end),2) <60"
|
|
|
}
|
|
|
-
|
|
|
// 今年的汇总
|
|
|
year := strconv.Itoa(time.Now().Year())
|
|
|
month := "01"
|
|
|
@@ -190,7 +192,7 @@ func (this *OilContractSumScoreController) GetComputeEntityList() {
|
|
|
|
|
|
svc := contractSumScore.GetOilContractSumScoreService(utils.DBE)
|
|
|
var list []contractSumScore.OilContractComputeSumScoreVo
|
|
|
- total := svc.GetPagingComputeEntitiesWithOrderBytbl(page.CurrentPage, page.Size, orderby, asc, &list, where)
|
|
|
+ total := svc.GetPagingComputeEntitiesWithOrderBytbl(page.CurrentPage, page.Size, orderby, asc, &list, where,having)
|
|
|
var datainfo DataInfo
|
|
|
datainfo.Items = list
|
|
|
datainfo.CurrentItemCount = total
|
|
|
@@ -205,8 +207,12 @@ func (this *OilContractSumScoreController) GetComputeEntityList() {
|
|
|
// @router /compute-entity/:id [get]
|
|
|
func (this *OilContractSumScoreController) GetComputeEntity(){
|
|
|
Id := this.Ctx.Input.Param(":id")
|
|
|
+ ContractClass := this.GetString("ContractClass", "01")
|
|
|
where := " contract.SupplierId = " + Id
|
|
|
where = where + " and review.Status='8' "
|
|
|
+ if ContractClass != "" {
|
|
|
+ where = where + " and contract.ContractClass = '" + ContractClass + "'"
|
|
|
+ }
|
|
|
// 今年的汇总
|
|
|
year := strconv.Itoa(time.Now().Year())
|
|
|
month := "01"
|