|
@@ -105,6 +105,7 @@ func getQueryParams(condition string, pars []interface{}, sysUser *system.Admin,
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -131,6 +132,7 @@ func (this *ContractAllocationController) CompanyContractList() {
|
|
|
keyword := this.GetString("Keyword")
|
|
|
startDate := this.GetString("StartDate")
|
|
|
endDate := this.GetString("EndDate")
|
|
|
+ researcherRealName := this.GetString("ResearcherRealName")
|
|
|
isAllocation, _ := this.GetInt("IsAllocation", -1)
|
|
|
if startDate == "" {
|
|
|
startDate = "2015-01-01"
|
|
@@ -195,7 +197,35 @@ func (this *ContractAllocationController) CompanyContractList() {
|
|
|
|
|
|
|
|
|
condition += ` AND c.product_id = ? AND a.start_date > ? `
|
|
|
- pars = append(pars, 2, "2023-06-01")
|
|
|
+ pars = append(pars, 2, "2023-01-01")
|
|
|
+
|
|
|
+ mapMoneyPoint := make(map[int]float64)
|
|
|
+
|
|
|
+ if researcherRealName != "" {
|
|
|
+ var conditionAllocation string
|
|
|
+ var parsAllocation []interface{}
|
|
|
+
|
|
|
+ conditionAllocation = " AND real_name = ? "
|
|
|
+ parsAllocation = append(parsAllocation, researcherRealName)
|
|
|
+ allocationCompanyContractList, err := cygx.GetCygxAllocationCompanyContractList(conditionAllocation, parsAllocation)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取失败,GetCygxAllocationCompanyContractListErr:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var companyContractIds []int
|
|
|
+ for _, v := range allocationCompanyContractList {
|
|
|
+ companyContractIds = append(companyContractIds, v.CompanyContractId)
|
|
|
+ mapMoneyPoint[v.CompanyContractId] = v.Money
|
|
|
+ }
|
|
|
+ lenCon := len(companyContractIds)
|
|
|
+ if lenCon == 0 {
|
|
|
+ condition += ` AND a.company_contract_id = 0 `
|
|
|
+ } else {
|
|
|
+ condition += ` AND a.company_contract_id IN (` + utils.GetOrmInReplace(lenCon) + `)`
|
|
|
+ pars = append(pars, companyContractIds)
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
var list []*cygx.CompanyContractResp
|
|
|
|
|
@@ -248,6 +278,7 @@ func (this *ContractAllocationController) CompanyContractList() {
|
|
|
}
|
|
|
for _, v := range list {
|
|
|
v.ContractId = mapContractCode[v.ContractCode]
|
|
|
+ v.MoneyPoint = mapMoneyPoint[v.CompanyContractId]
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -697,7 +728,7 @@ func (this *ContractAllocationController) CompanyContractStatistics() {
|
|
|
item.GroupProportion += "%"
|
|
|
|
|
|
|
|
|
- item.DepartmentProportion = fmt.Sprint(mapPermissionMoney[k] / totalMoney * 100)
|
|
|
+ item.DepartmentProportion = fmt.Sprint(mapPermissionMoney[k] / totalMoney * 100 / float64(len(mapPermissionUser[k])))
|
|
|
if item.DepartmentProportion == "" {
|
|
|
item.DepartmentProportion = "0"
|
|
|
}
|