commit
This commit is contained in:
+24
-24
@@ -51,13 +51,13 @@ public class ActivityReimbursementBoardController {
|
||||
@ApiOperation("获取参与人数和活动报销经费数据")
|
||||
@SaCheckPermission("activityReimbursement.board")
|
||||
public Result getNumData(Integer startYear, Integer endYear){
|
||||
Sql schoolSignNum = activityReimbursementService.getActivityUserNumAndMoneySql(startYear, endYear, false).setParam("type", ActivityDeclareReimbursement.SCHOOL_UNION.name());
|
||||
Sql unionSignNum = activityReimbursementService.getActivityUserNumAndMoneySql(startYear, endYear, false).setParam("type", ActivityDeclareReimbursement.BRANCH_UNION.name());
|
||||
Sql clubSignNum = activityReimbursementService.getActivityUserNumAndMoneySql(startYear, endYear, false).setParam("type", ActivityDeclareReimbursement.CLUB.name());
|
||||
Sql schoolSignNum = activityReimbursementService.getActivityUserNumAndMoneySql(startYear, endYear, false).setParam("type", "ACTIVITY_BUDGET_TYPE_ONE");
|
||||
Sql unionSignNum = activityReimbursementService.getActivityUserNumAndMoneySql(startYear, endYear, false).setParam("type", "ACTIVITY_BUDGET_TYPE_TWO");
|
||||
Sql clubSignNum = activityReimbursementService.getActivityUserNumAndMoneySql(startYear, endYear, false).setParam("type", "ACTIVITY_BUDGET_TYPE_THREE");
|
||||
|
||||
Sql schoolActivityMoney = activityReimbursementService.getActivityUserNumAndMoneySql(startYear, endYear, true).setParam("type", ActivityDeclareReimbursement.SCHOOL_UNION.name());
|
||||
Sql unionActivityMoney = activityReimbursementService.getActivityUserNumAndMoneySql(startYear, endYear, true).setParam("type", ActivityDeclareReimbursement.BRANCH_UNION.name());
|
||||
Sql clubActivityMoney = activityReimbursementService.getActivityUserNumAndMoneySql(startYear, endYear, true).setParam("type", ActivityDeclareReimbursement.CLUB.name());
|
||||
Sql schoolActivityMoney = activityReimbursementService.getActivityUserNumAndMoneySql(startYear, endYear, true).setParam("type", "ACTIVITY_BUDGET_TYPE_ONE");
|
||||
Sql unionActivityMoney = activityReimbursementService.getActivityUserNumAndMoneySql(startYear, endYear, true).setParam("type", "ACTIVITY_BUDGET_TYPE_TWO");
|
||||
Sql clubActivityMoney = activityReimbursementService.getActivityUserNumAndMoneySql(startYear, endYear, true).setParam("type", "ACTIVITY_BUDGET_TYPE_THREE");
|
||||
HashMap result = new HashMap() {{
|
||||
put("schoolSignNum", activityReimbursementService.listMap(schoolSignNum).stream().mapToInt(v->v.getInt("activityNum")).sum());
|
||||
put("unionSignNum", activityReimbursementService.listMap(unionSignNum).stream().mapToInt(v->v.getInt("activityNum")).sum());
|
||||
@@ -82,8 +82,8 @@ public class ActivityReimbursementBoardController {
|
||||
activity_reimbursement_info info
|
||||
LEFT JOIN wf_process_instance ins ON info.id = ins.businessNo
|
||||
WHERE
|
||||
ins.state = 30
|
||||
AND info.activityType = @type
|
||||
ins.state = 20
|
||||
AND info.outlayManageSource = @type
|
||||
AND info.`year` = @year
|
||||
""");
|
||||
|
||||
@@ -99,19 +99,19 @@ public class ActivityReimbursementBoardController {
|
||||
list.add(new NutMap() {{
|
||||
put("year", year);
|
||||
put("type", "校工会活动");
|
||||
put("num", activityReimbursementService.count(sql.setParam("type", ActivityDeclareReimbursement.SCHOOL_UNION.name()).setParam("year", year)));
|
||||
put("num", activityReimbursementService.count(sql.setParam("type", "ACTIVITY_BUDGET_TYPE_ONE").setParam("year", year)));
|
||||
}});
|
||||
|
||||
list.add(new NutMap() {{
|
||||
put("year", year);
|
||||
put("type", "分工会活动");
|
||||
put("num", activityReimbursementService.count(sql.setParam("type", ActivityDeclareReimbursement.BRANCH_UNION.name()).setParam("year", year)));
|
||||
put("num", activityReimbursementService.count(sql.setParam("type","ACTIVITY_BUDGET_TYPE_TWO").setParam("year", year)));
|
||||
}});
|
||||
|
||||
list.add(new NutMap() {{
|
||||
put("year", year);
|
||||
put("type", "社团活动");
|
||||
put("num", activityReimbursementService.count(sql.setParam("type", ActivityDeclareReimbursement.CLUB.name()).setParam("year", year)));
|
||||
put("num", activityReimbursementService.count(sql.setParam("type", "ACTIVITY_BUDGET_TYPE_THREE").setParam("year", year)));
|
||||
}});
|
||||
}
|
||||
return Result.success().addData(list);
|
||||
@@ -129,8 +129,8 @@ public class ActivityReimbursementBoardController {
|
||||
activity_reimbursement_info info
|
||||
LEFT JOIN wf_process_instance ins ON info.id = ins.businessNo
|
||||
WHERE
|
||||
ins.state = 30
|
||||
AND activityType = @type
|
||||
ins.state = 20
|
||||
AND outlayManageSource = @type
|
||||
AND `year` <= @startYear
|
||||
AND `year` >= @endYear
|
||||
""").setParam("startYear", startYear).setParam("endYear", endYear);
|
||||
@@ -138,15 +138,15 @@ public class ActivityReimbursementBoardController {
|
||||
List<NutMap> list = new ArrayList<>();
|
||||
list.add(new NutMap() {{
|
||||
put("type", "校工会活动");
|
||||
put("num", activityReimbursementService.count(sql.setParam("type", ActivityDeclareReimbursement.SCHOOL_UNION.name())));
|
||||
put("num", activityReimbursementService.count(sql.setParam("type", "ACTIVITY_BUDGET_TYPE_ONE")));
|
||||
}});
|
||||
list.add(new NutMap() {{
|
||||
put("type", "分工会活动");
|
||||
put("num", activityReimbursementService.count(sql.setParam("type", ActivityDeclareReimbursement.BRANCH_UNION.name())));
|
||||
put("num", activityReimbursementService.count(sql.setParam("type", "ACTIVITY_BUDGET_TYPE_TWO")));
|
||||
}});
|
||||
list.add(new NutMap() {{
|
||||
put("type", "社团活动");
|
||||
put("num", activityReimbursementService.count(sql.setParam("type", ActivityDeclareReimbursement.CLUB.name())));
|
||||
put("num", activityReimbursementService.count(sql.setParam("type", "ACTIVITY_BUDGET_TYPE_THREE")));
|
||||
}});
|
||||
return Result.success(list);
|
||||
}
|
||||
@@ -163,8 +163,8 @@ public class ActivityReimbursementBoardController {
|
||||
activity_reimbursement_info info
|
||||
LEFT JOIN wf_process_instance ins ON info.id = ins.businessNo
|
||||
WHERE
|
||||
ins.state = 30
|
||||
AND info.activityType = @type
|
||||
ins.state = 20
|
||||
AND info.outlayManageSource = @type
|
||||
AND info.`year` = @year
|
||||
""");
|
||||
|
||||
@@ -180,19 +180,19 @@ public class ActivityReimbursementBoardController {
|
||||
list.add(new NutMap() {{
|
||||
put("year", year);
|
||||
put("type", "校工会费用");
|
||||
put("num", activityReimbursementService.list(sql.setParam("type", ActivityDeclareReimbursement.SCHOOL_UNION.name()).setParam("year", year)).get(0).getDouble("money"));
|
||||
put("num", activityReimbursementService.list(sql.setParam("type", "ACTIVITY_BUDGET_TYPE_ONE").setParam("year", year)).get(0).getDouble("money"));
|
||||
}});
|
||||
|
||||
list.add(new NutMap() {{
|
||||
put("year", year);
|
||||
put("type", "分工会费用");
|
||||
put("num", activityReimbursementService.list(sql.setParam("type", ActivityDeclareReimbursement.BRANCH_UNION.name()).setParam("year", year)).get(0).getDouble("money"));
|
||||
put("num", activityReimbursementService.list(sql.setParam("type", "ACTIVITY_BUDGET_TYPE_TWO").setParam("year", year)).get(0).getDouble("money"));
|
||||
}});
|
||||
|
||||
list.add(new NutMap() {{
|
||||
put("year", year);
|
||||
put("type", "社团费用");
|
||||
put("num", activityReimbursementService.list(sql.setParam("type", ActivityDeclareReimbursement.CLUB.name()).setParam("year", year)).get(0).getDouble("money"));
|
||||
put("num", activityReimbursementService.list(sql.setParam("type", "ACTIVITY_BUDGET_TYPE_THREE").setParam("year", year)).get(0).getDouble("money"));
|
||||
}});
|
||||
}
|
||||
|
||||
@@ -204,9 +204,9 @@ public class ActivityReimbursementBoardController {
|
||||
@ApiOperation("获取活动的经费饼图")
|
||||
@SaCheckPermission("activityReimbursement.board")
|
||||
public Result getActivityMoneyPieNum(Integer startYear, Integer endYear){
|
||||
Sql schoolSql = activityReimbursementService.getActivityUserNumAndMoneySql(startYear, endYear, true).setParam("type", ActivityDeclareReimbursement.SCHOOL_UNION.name());
|
||||
Sql unionSql = activityReimbursementService.getActivityUserNumAndMoneySql(startYear, endYear, true).setParam("type", ActivityDeclareReimbursement.BRANCH_UNION.name());
|
||||
Sql clubSql = activityReimbursementService.getActivityUserNumAndMoneySql(startYear, endYear, true).setParam("type", ActivityDeclareReimbursement.CLUB.name());
|
||||
Sql schoolSql = activityReimbursementService.getActivityUserNumAndMoneySql(startYear, endYear, true).setParam("type", "ACTIVITY_BUDGET_TYPE_ONE");
|
||||
Sql unionSql = activityReimbursementService.getActivityUserNumAndMoneySql(startYear, endYear, true).setParam("type", "ACTIVITY_BUDGET_TYPE_TWO");
|
||||
Sql clubSql = activityReimbursementService.getActivityUserNumAndMoneySql(startYear, endYear, true).setParam("type", "ACTIVITY_BUDGET_TYPE_THREE");
|
||||
|
||||
List<NutMap> list = new ArrayList<>();
|
||||
list.add(new NutMap() {{
|
||||
|
||||
+1
-1
@@ -108,7 +108,7 @@ public class ActivityReimbursementDeputySchoolUnionController {
|
||||
pageParam.buildSearch(cnd, "info.");
|
||||
|
||||
cnd.and("t.taskName", "=", "f9b8379f-f348-4985-ba58-b6ba28deb9af");
|
||||
// cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
cnd.andEX("outlay.budgetReimburseType", "=", pageParam.getBudgetReimburseType());
|
||||
cnd.andEX("info.outlayManageSource", "=", pageParam.getOutlayManageSource());
|
||||
cnd.andEX("info.activityReimbursementMode", "=", pageParam.getActivityReimbursementMode());
|
||||
|
||||
+4
-4
@@ -45,8 +45,8 @@ public class ActivityReimbursementServiceImpl extends BaseServiceImpl<ActivityRe
|
||||
activity_reimbursement_info info
|
||||
LEFT JOIN wf_process_instance ins ON info.id = ins.businessNo
|
||||
WHERE
|
||||
ins.state = 30
|
||||
AND info.activityType = @type
|
||||
ins.state = 20
|
||||
AND info.outlayManageSource = @type
|
||||
AND info.`year` >= @startYear
|
||||
AND info.`year` <= @endYear
|
||||
""")
|
||||
@@ -59,8 +59,8 @@ public class ActivityReimbursementServiceImpl extends BaseServiceImpl<ActivityRe
|
||||
activity_reimbursement_info info
|
||||
LEFT JOIN wf_process_instance ins ON info.id = ins.businessNo
|
||||
WHERE
|
||||
ins.state = 30
|
||||
AND info.activityType = @type
|
||||
ins.state = 20
|
||||
AND info.outlayManageSource = @type
|
||||
AND info.`year` >= @startYear
|
||||
AND info.`year` <= @endYear
|
||||
""").setParam("startYear", startYear).setParam("endYear", endYear);
|
||||
|
||||
@@ -0,0 +1,207 @@
|
||||
package com.budwk.app.zhgh.dayofficework.careData;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.sys.services.SysUserService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.entity.Record;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.sql.SqlCallback;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.log.Log;
|
||||
import org.nutz.log.Logs;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: 1V
|
||||
* @DateTime: 2020/10/15 10:37
|
||||
* @Description: 职工关爱大数据
|
||||
*/
|
||||
@At("/platform/careData/staff")
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
public class StaffCareDataCon {
|
||||
private static final Log log = Logs.get();
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/careData/staff/index.html")
|
||||
@SaCheckPermission("careData.staff")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@Inject
|
||||
private SysUserService sysUserService;
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("careData.staff")
|
||||
public Object getNumByYear(Integer yearnum, String userid, Integer startYear, Integer endYear) {
|
||||
try {
|
||||
Sys_user user = sysUserService.fetch(userid);
|
||||
|
||||
ArrayList<Object> result = new ArrayList<>();
|
||||
|
||||
if (startYear == null && endYear == null) {
|
||||
int year = Calendar.getInstance().get(Calendar.YEAR);
|
||||
yearnum = yearnum == null ? 10 : yearnum;
|
||||
startYear = year - yearnum + 1;
|
||||
endYear = year;
|
||||
}
|
||||
|
||||
for (int i = startYear; i <= endYear; i++) {
|
||||
final int y = i;
|
||||
List list = baseService.list(Sqls.create("SELECT '职工慰问' type,count( 1 ) value, YEAR ( con.createTime ) `year` FROM condolence con WHERE YEAR ( con.createTime ) = @year and con.applyUserId = @user GROUP BY YEAR ( con.createTime )").setParam("year", i).setParam("user", userid));
|
||||
result.addAll(list.size() > 0 ? list : new ArrayList<Object>() {{
|
||||
add(new HashMap<String, Object>() {{
|
||||
put("type", "职工慰问");
|
||||
put("value", 0);
|
||||
put("year", y);
|
||||
}});
|
||||
}});
|
||||
List list1 = baseService.list(Sqls.create("SELECT '困难帮扶' type,count(1) value,year(bf.applyTime) `year` from difficult_help_info bf WHERE YEAR ( bf.applyTime ) = @year and bf.proxyUserId = @user GROUP BY YEAR(bf.applyTime) ").setParam("year", i).setParam("user", userid));
|
||||
result.addAll(list1.size() > 0 ? list1 : new ArrayList<Object>() {{
|
||||
add(new HashMap<String, Object>() {{
|
||||
put("type", "困难帮扶");
|
||||
put("value", 0);
|
||||
put("year", y);
|
||||
}});
|
||||
}});
|
||||
|
||||
result.add(new HashMap<String, Object>() {{
|
||||
put("type", "撰写提案");
|
||||
put("value", baseService.count(Sqls.create("SELECT count(1) from proposal_info info where info.createUserId = @user and YEAR(info.createTime) = @year").setParam("year", y).setParam("user", userid)));
|
||||
put("year", y);
|
||||
}});
|
||||
|
||||
result.add(new HashMap<String, Object>() {{
|
||||
put("type", "经费报销");
|
||||
put("value", baseService.count(Sqls.create("SELECT count(1) from activity_reimbursement_info bx WHERE bx.userId = @user and year(bx.applyTime) = @year").setParam("year", y).setParam("user", userid)));
|
||||
put("year", y);
|
||||
}});
|
||||
}
|
||||
|
||||
return Result.success().addData(result);
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("careData.staff")
|
||||
public Result getYearNumAndAllNum(String userid) {
|
||||
HashMap<Object, Object> map = new HashMap<>();
|
||||
int year = Calendar.getInstance().get(Calendar.YEAR);
|
||||
Sys_user user = sysUserService.fetch(userid);
|
||||
|
||||
map.put("now_year", new HashMap<String, Object>() {{
|
||||
put("zgww", baseService.count(Sqls.create("SELECT count(1) FROM condolence con WHERE YEAR ( con.createTime ) = @year and con.applyUserId = @user").setParam("year", year).setParam("user", userid)));
|
||||
put("knbf", baseService.count(Sqls.create("SELECT count(1) FROM difficult_help_info bf WHERE YEAR ( bf.applyTime ) = @year and bf.userId = @user").setParam("year", year).setParam("user", userid)));
|
||||
put("ta", baseService.count(Sqls.create("SELECT count(1) from proposal_info info where info.createUserId = @user and YEAR(info.createTime) = @year").setParam("year", year).setParam("user", userid)));
|
||||
put("jfbx", baseService.count(Sqls.create("SELECT count(1) from activity_reimbursement_info bx WHERE bx.userId = @user and year(bx.applyTime) = @year").setParam("year", year).setParam("user", userid)));
|
||||
}});
|
||||
|
||||
map.put("all", new HashMap<String, Object>() {{
|
||||
put("zgww", baseService.count(Sqls.create("SELECT count(1) FROM condolence con WHERE YEAR ( con.createTime ) = @year and con.applyUserId = @user").setParam("year", year).setParam("user", userid)));
|
||||
put("knbf", baseService.count(Sqls.create("SELECT count(1) FROM difficult_help_info bf WHERE YEAR ( bf.applyTime ) = @year and bf.userId = @user").setParam("year", year).setParam("user", userid)));
|
||||
put("ta", baseService.count(Sqls.create("SELECT count(1) from proposal_info info where info.createUserId = @user and YEAR(info.createTime) = @year").setParam("year", year).setParam("user", userid)));
|
||||
put("jfbx", baseService.count(Sqls.create("SELECT count(1) from activity_reimbursement_info bx WHERE bx.userId = @user").setParam("user", userid)));
|
||||
}});
|
||||
return Result.success(map);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("careData.staff")
|
||||
public Object queryUser(String key) {
|
||||
try {
|
||||
Sql sql = Sqls.create("select id,username,loginname,sex,birthday,unitName,unionName FROM vw_user $condition");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.orLike("username", key);
|
||||
group.orLike("loginname", key);
|
||||
cnd.and(group);
|
||||
|
||||
sql.setCondition(cnd);
|
||||
return Result.success().addData(baseService.listPage(1, 50, sql));
|
||||
} catch (Exception e) {
|
||||
log.error(e);
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("careData.staff")
|
||||
public Object timeLine(String userid, String type, Boolean desc, String startTime, String endTime) {
|
||||
try {
|
||||
Sys_user user = sysUserService.fetch(userid);
|
||||
Sql sql = Sqls.create("SELECT * from (\n" +
|
||||
"SELECT con.id id,con.createTime time,'zgww' type FROM condolence con WHERE con.applyUserId= @user\n" +
|
||||
"union all \n" +
|
||||
"SELECT bf.id id ,bf.applyTime time,'knbf' type FROM difficult_help_info bf WHERE bf.userId = @user\n" +
|
||||
"union all\n" +
|
||||
"SELECT info.id id, info.createTime time , 'ta' type from proposal_info info where info.createUserId = @user\n" +
|
||||
"union all\n" +
|
||||
"SELECT school.id, school.startTime time , 'xhd' type from activity_school_apply apply left join activity_school school on apply.activityId = school.id WHERE apply.userId = @user\n" +
|
||||
"union all\n" +
|
||||
"SELECT bx.id id , bx.applyTime time ,'yybx' type from activity_reimbursement_info bx WHERE bx.userId = @user\n" +
|
||||
") tab WHERE 1=1 $type $year\n" +
|
||||
"ORDER BY tab.time $order");
|
||||
if (Strings.isNotBlank(type) && !type.equals("all")) {
|
||||
sql.setVar("type", "AND tab.type = '" + type + "'");
|
||||
}
|
||||
if (Strings.isNotBlank(startTime) && Strings.isNotBlank(endTime)) {
|
||||
sql.setVar("year", "AND tab.time >= '" + startTime + "' AND tab.time <= '" + endTime + "'");
|
||||
}
|
||||
|
||||
if (desc == null || desc) {
|
||||
sql.setVar("order", "desc");
|
||||
} else {
|
||||
sql.setVar("order", "asc");
|
||||
}
|
||||
|
||||
sql.setParam("user", userid);
|
||||
sql.setParam("loginname", user.getLoginname());
|
||||
|
||||
List<Record> list = sysUserService.list(sql);
|
||||
|
||||
return Result.success().addData(list);
|
||||
} catch (Exception e) {
|
||||
log.error(e);
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("careData.staff")
|
||||
public Result initUser() {
|
||||
Sql sql = Sqls.create("""
|
||||
select id,username,loginname,sex,birthday,unitName,unionName FROM vw_user WHERE id=@id
|
||||
""").setParam("id", SecurityUtil.getUserId());
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
sysUserService.execute(sql);
|
||||
return Result.success().addData(sql.getResult());
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
package com.budwk.app.zhgh.dayofficework.caredata;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.sys.services.SysUserService;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import com.budwk.app.zhgh.dayofficework.outlay.activityBudget.service.ActivityBudgetApplyStatisticsService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.entity.Record;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.log.Log;
|
||||
import org.nutz.log.Logs;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Author: 1V
|
||||
* @DateTime: 2020/10/15 11:39
|
||||
* @Description: 工会大数据
|
||||
*/
|
||||
@At("/platform/careData/union")
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
public class UnionCareDataCon {
|
||||
private static final Log log = Logs.get();
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/careData/unionCare/index.html")
|
||||
@SaCheckPermission("careData.union")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@Inject
|
||||
private SysUserService sysUserService;
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@Inject
|
||||
private ActivityBudgetApplyStatisticsService activityBudgetService;
|
||||
|
||||
@At
|
||||
@SaCheckPermission("careData.union")
|
||||
public Result getNumData() {
|
||||
Sql sql1 = Sqls.create("SELECT count(1) FROM sys_user u WHERE u.member=1");
|
||||
Sql sql2 = Sqls.create("SELECT count(1) from sys_union");
|
||||
List<SysClub> myManageClub = sysClubService.getMyManageClub();
|
||||
|
||||
Map result = new HashMap() {{
|
||||
put("hy_num", baseService.count(sql1));
|
||||
put("fgh_num", baseService.count(sql2));
|
||||
put("st_num", myManageClub.size());
|
||||
}};
|
||||
return Result.success(result);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("careData.union")
|
||||
public Result getHyNumBySex() {
|
||||
Sql sql1 = Sqls.create("SELECT IFNULL(count(1),0) FROM vw_user u WHERE u.member=1 and u.sex='男' and u.unionId!='' $fgh");
|
||||
Sql sql2 = Sqls.create("SELECT IFNULL(count(1),0) FROM vw_user u WHERE u.member=1 and u.sex='女' and u.unionId!='' $fgh");
|
||||
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())
|
||||
&& AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
|
||||
sql1.setVar("fgh", "AND u.unionId = %s".formatted(SecurityUtil.getUnionId()));
|
||||
sql2.setVar("fgh", "AND u.unionId = %s".formatted(SecurityUtil.getUnionId()));
|
||||
}
|
||||
|
||||
return Result.success().addData(new ArrayList<Object>() {{
|
||||
add(new HashMap<String, Object>() {{
|
||||
put("name", "男");
|
||||
put("value", baseService.count(sql1));
|
||||
}});
|
||||
add(new HashMap<String, Object>() {{
|
||||
put("name", "女");
|
||||
put("value", baseService.count(sql2));
|
||||
}});
|
||||
}});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("careData.union")
|
||||
public Result getActivityBudget(){
|
||||
int nowYear = Calendar.getInstance().get(Calendar.YEAR);
|
||||
Integer startYear = nowYear - 9;
|
||||
Integer endYear = nowYear;
|
||||
List<Object> list = new ArrayList<>();
|
||||
for (int i = startYear; i <= endYear; i++) {
|
||||
final int year = i;
|
||||
|
||||
Sql sql = activityBudgetService.getsql(year, null, null, "ACTIVITY_BUDGET_TYPE_ONE", null, null);
|
||||
List<NutMap> mapList = activityBudgetService.listMap(sql);
|
||||
mapList = mapList.stream().filter(v -> !v.getBoolean("isSchoolBudget")).toList();
|
||||
double totalBudgetMoney = mapList.stream().mapToDouble(map -> map.getDouble("totalBudgetMoney")).sum();
|
||||
list.add(new HashMap<String, Object>() {{
|
||||
put("year", year);
|
||||
put("type", "校工会经费");
|
||||
put("value", totalBudgetMoney);
|
||||
}});
|
||||
|
||||
Sql sql2 = activityBudgetService.getsql(year, null, null, "ACTIVITY_BUDGET_TYPE_TWO", null, null);
|
||||
List<NutMap> mapList2 = activityBudgetService.listMap(sql2);
|
||||
mapList2 = mapList2.stream().filter(v -> !v.getBoolean("isSchoolBudget")).toList();
|
||||
double totalBudgetMoney2 = mapList2.stream().mapToDouble(map -> map.getDouble("totalBudgetMoney")).sum();
|
||||
list.add(new HashMap<String, Object>() {{
|
||||
put("year", year);
|
||||
put("type", "分工会经费");
|
||||
put("value", totalBudgetMoney2);
|
||||
}});
|
||||
|
||||
Sql sql3 = activityBudgetService.getsql(year, null, null, "ACTIVITY_BUDGET_TYPE_THREE", null, null);
|
||||
List<NutMap> mapList3 = activityBudgetService.listMap(sql3);
|
||||
mapList3 = mapList3.stream().filter(v -> !v.getBoolean("isSchoolBudget")).toList();
|
||||
double totalBudgetMoney3 = mapList3.stream().mapToDouble(map -> map.getDouble("totalBudgetMoney")).sum();
|
||||
list.add(new HashMap<String, Object>() {{
|
||||
put("year", year);
|
||||
put("type", "协会经费");
|
||||
put("value", totalBudgetMoney3);
|
||||
}});
|
||||
|
||||
}
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("careData.union")
|
||||
public Result getDifficultHelpNum(){
|
||||
int nowYear = Calendar.getInstance().get(Calendar.YEAR);
|
||||
Integer startYear = nowYear - 9;
|
||||
Integer endYear = nowYear;
|
||||
List<Object> list = new ArrayList<>();
|
||||
|
||||
|
||||
String sqls= """
|
||||
SELECT
|
||||
COUNT(info.id)
|
||||
FROM
|
||||
difficult_help_info info
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id
|
||||
AND t.taskState = 10
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
$condition
|
||||
""";
|
||||
for (int i = startYear; i <= endYear; i++) {
|
||||
final int year = i;
|
||||
|
||||
Sql sql = Sqls.create(sqls);
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("YEAR(info.applyTime)", "=", year);
|
||||
sql.setCondition(cnd);
|
||||
int count = baseService.count(sql);
|
||||
list.add(new HashMap<String, Object>() {{
|
||||
put("value", count);
|
||||
put("year", year);
|
||||
}});
|
||||
|
||||
}
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
+9
-9
@@ -69,7 +69,7 @@ layout("/layouts/platform.html"){
|
||||
placeholder="选择年">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<el-col :span="4" style="position: relative">
|
||||
<!--<el-col :span="4" style="position: relative">
|
||||
<div class="top_title">校工会活动总人数</div>
|
||||
<div class="top_num">{{numData.schoolSignNum?numData.schoolSignNum:'0'}}</div>
|
||||
<div class="cut-off-line"></div>
|
||||
@@ -83,22 +83,22 @@ layout("/layouts/platform.html"){
|
||||
<div class="top_title">协会活动总人数</div>
|
||||
<div class="top_num">{{numData.clubSignNum?numData.clubSignNum:'0'}}</div>
|
||||
<div class="cut-off-line"></div>
|
||||
</el-col>
|
||||
<el-col :span="4" style="position: relative">
|
||||
</el-col>-->
|
||||
<el-col :span="8" style="position: relative">
|
||||
<div class="top_title">校工会活动报销费用(元)
|
||||
</div>
|
||||
|
||||
<div class="top_num">{{numData.schoolActivityMoney?numData.schoolActivityMoney:'0'}}</div>
|
||||
<div class="cut-off-line"></div>
|
||||
</el-col>
|
||||
<el-col :span="4" style="position: relative">
|
||||
<el-col :span="8" style="position: relative">
|
||||
<div class="top_title">分工会活动报销费用(元)
|
||||
</div>
|
||||
|
||||
<div class="top_num">{{numData.unionActivityMoney?numData.unionActivityMoney:'0'}}</div>
|
||||
<div class="cut-off-line"></div>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-col :span="8">
|
||||
<div class="top_title">社团活动报销费用(元)
|
||||
</div>
|
||||
<div class="top_num">{{numData.clubActivityMoney?numData.clubActivityMoney:'0'}}</div>
|
||||
@@ -106,7 +106,7 @@ layout("/layouts/platform.html"){
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<el-row style="padding: 30px 0;border-bottom: 10px solid rgb(240, 240, 240)">
|
||||
<!-- <el-row style="padding: 30px 0;border-bottom: 10px solid rgb(240, 240, 240)">
|
||||
<div style="position: absolute;top: 25px;right: 40px;z-index: 200">
|
||||
<el-date-picker
|
||||
class="year"
|
||||
@@ -140,7 +140,7 @@ layout("/layouts/platform.html"){
|
||||
<div class="chartTitle">活动类型占比</div>
|
||||
<div id="activityTypePieChart" style="width: 100%;height: 330px;"></div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row>-->
|
||||
|
||||
<el-row style="padding: 30px 0;border-bottom: 10px solid rgb(240, 240, 240)">
|
||||
<div style="position: absolute;top: 25px;right: 40px;z-index: 2000">
|
||||
@@ -558,8 +558,8 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
async mounted() {
|
||||
await this.getActivityJfChart()
|
||||
await this.getActivityTypeChart()
|
||||
await this.getActivityTypePieNum()
|
||||
// await this.getActivityTypeChart()
|
||||
// await this.getActivityTypePieNum()
|
||||
await this.getActivityJfPieNum()
|
||||
await this.allUnionActivityAndJf()
|
||||
await this.allClubActivityAndJf()
|
||||
|
||||
@@ -0,0 +1,509 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-collapse-item__arrow {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.top_block {
|
||||
width: 100%;
|
||||
padding: 30px 80px;
|
||||
}
|
||||
|
||||
.tr {
|
||||
text-align: right;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.tl {
|
||||
text-align: left;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.top_title {
|
||||
font-size: 14px;
|
||||
color: #808492;
|
||||
}
|
||||
|
||||
.fs18 {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.fs26 {
|
||||
font-size: 26px;
|
||||
}
|
||||
|
||||
.fs20 {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 18px;
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
}
|
||||
|
||||
.none-data {
|
||||
min-height: 300px;
|
||||
background: url("/none.png") no-repeat center center;
|
||||
background-size: 360px 260px;
|
||||
}
|
||||
|
||||
.none-data-title {
|
||||
position: absolute;
|
||||
display: block;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
bottom: 20%;
|
||||
left: 0;
|
||||
color: rgb(160, 160, 160);
|
||||
}
|
||||
|
||||
.item-title {
|
||||
color: rgb(160, 160, 160);
|
||||
}
|
||||
|
||||
.item-content {
|
||||
color: rgb(100, 100, 100);
|
||||
}
|
||||
|
||||
.mb20 {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.item-type {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
height: 100px;
|
||||
line-height: 100px;
|
||||
}
|
||||
|
||||
.el-collapse, .el-collapse-item__header, .el-collapse-item__wrap {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.el-collapse-item__content {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.status {
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
margin: auto;
|
||||
height: 90px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.status-icon {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
.status-name {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
font-size: 12px;
|
||||
color: rgb(180, 180, 180);
|
||||
}
|
||||
|
||||
.chartTitle {
|
||||
font-size: 14px;
|
||||
color: #808492;
|
||||
margin: 20px 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<div class="p10">
|
||||
<el-card shadow="never">
|
||||
<el-row style="border-bottom: 10px solid rgb(240,240,240);padding: 20px;">
|
||||
<template>
|
||||
|
||||
<span style="font-weight: bold">查找用户:</span>
|
||||
<el-select
|
||||
style="width: 300px"
|
||||
v-model="userid"
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
placeholder="请输入姓名或工号进行查询"
|
||||
:remote-method="remoteMethod"
|
||||
:loading="search_user_loading" @change="userChange">
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
:label="item.username+'('+item.loginname+')'"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<div class="pull-right offscreen-right mt5">
|
||||
<div class="btn-group tool-button mt5">
|
||||
<span style="font-weight: bold">{{user.sex?user.sex:''}}{{user.unitName?' / '+user.unitName:''}} {{user.unionName?' / '+user.unionName:''}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-row>
|
||||
<div class="top_block" style="border-bottom: 10px solid rgb(240,240,240);" v-loading="top_block_loading">
|
||||
<el-row style="height: 40px">
|
||||
<el-col :offset="4" class="tr" :span="3">
|
||||
<span class="top_title">职工慰问申请数</span>
|
||||
</el-col>
|
||||
<el-col :span="3" class="tr">
|
||||
<span class="top_title">困难帮扶申请数</span>
|
||||
</el-col>
|
||||
<el-col :span="3" class="tr">
|
||||
<span class="top_title">子女入学登记数</span>
|
||||
</el-col>
|
||||
<el-col :span="3" class="tr">
|
||||
<span class="top_title">撰写提案数</span>
|
||||
</el-col>
|
||||
<el-col :span="3" class="tr">
|
||||
<span class="top_title">参与活动数</span>
|
||||
</el-col>
|
||||
<el-col :span="3" class="tr">
|
||||
<span class="top_title">经费报销次数</span>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row style="height: 60px;line-height: 60px">
|
||||
<el-col class="tl" :span="4">
|
||||
<span class="top_title">今年</span>
|
||||
</el-col>
|
||||
<el-col class="tr" :span="3">
|
||||
<span class="fs26"
|
||||
style="color: #409EFF;">{{numData.now_year.zgww?numData.now_year.zgww:0}}</span>
|
||||
</el-col>
|
||||
<el-col class="tr" :span="3">
|
||||
<span class="fs26"
|
||||
style="color: #409EFF;">{{numData.now_year.knbf?numData.now_year.knbf:0}}</span>
|
||||
</el-col>
|
||||
<el-col class="tr" :span="3">
|
||||
<span class="fs26"
|
||||
style="color: #409EFF;">{{numData.now_year.znrx?numData.now_year.znrx:0}}</span>
|
||||
</el-col>
|
||||
<el-col class="tr" :span="3">
|
||||
<span class="fs26" style="color: #409EFF;">{{numData.now_year.ta?numData.now_year.ta:0}}</span>
|
||||
</el-col>
|
||||
<el-col class="tr" :span="3">
|
||||
<span class="fs26" style="color: #409EFF;">{{numData.now_year.hd?numData.now_year.hd:0}}</span>
|
||||
</el-col>
|
||||
<el-col class="tr" :span="3">
|
||||
<span class="fs26"
|
||||
style="color: #409EFF;">{{numData.now_year.jfbx?numData.now_year.jfbx:0}}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row style="height: 40px;line-height: 40px">
|
||||
<el-col class="tl" :span="4">
|
||||
<span class="top_title">全部</span>
|
||||
</el-col>
|
||||
<el-col class="tr" :span="3">
|
||||
<span class="fs18">{{numData.all.zgww?numData.all.zgww:0}}</span>
|
||||
</el-col>
|
||||
<el-col class="tr" :span="3">
|
||||
<span class="fs18">{{numData.all.knbf?numData.all.knbf:0}}</span>
|
||||
</el-col>
|
||||
<el-col class="tr" :span="3">
|
||||
<span class="fs18">{{numData.all.znrx?numData.all.znrx:0}}</span>
|
||||
</el-col>
|
||||
<el-col class="tr" :span="3">
|
||||
<span class="fs18">{{numData.all.ta?numData.all.ta:0}}</span>
|
||||
</el-col>
|
||||
<el-col class="tr" :span="3">
|
||||
<span class="fs18">{{numData.all.hd?numData.all.hd:0}}</span>
|
||||
</el-col>
|
||||
<el-col class="tr" :span="3">
|
||||
<span class="fs18">{{numData.all.jfbx?numData.all.jfbx:0}}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<el-row style="height: 500px;border-bottom: 10px solid rgb(240,240,240);padding: 20px 30px;padding-top: 10px;"
|
||||
v-loading="chart_one_loading">
|
||||
<div style="position: absolute;top: 25px;right: 40px;z-index: 999">
|
||||
<el-date-picker
|
||||
class="year"
|
||||
style="width: 120px;"
|
||||
size="mini"
|
||||
v-model="numYear.startYear"
|
||||
type="year" :clearable="false"
|
||||
value-format="yyyy"
|
||||
placeholder="选择年">
|
||||
</el-date-picker>
|
||||
-
|
||||
<el-date-picker
|
||||
class="year"
|
||||
style="width: 120px;"
|
||||
size="mini"
|
||||
v-model="numYear.endYear"
|
||||
type="year" :clearable="false"
|
||||
value-format="yyyy"
|
||||
placeholder="选择年">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<div class="chartTitle">职工动态曲线</div>
|
||||
<div id="chart_one" style="width: 100%;height:85%;margin-top: 40px"></div>
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix" style="position: relative">
|
||||
<span class="title">职工动态时间线</span>
|
||||
<el-select v-model="type" @change="timeLine" placeholder="请选择" style="float: right; padding: 0;">
|
||||
<el-option v-for="(v,k) in typeObj" :key="k" :label="v.name" :value="k"></el-option>
|
||||
</el-select>
|
||||
<div style="float: right; padding: 0;margin-right: 10px">
|
||||
<el-date-picker
|
||||
@change="timeLine"
|
||||
v-model="dateRange"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text item" v-loading="timeline_loading">
|
||||
<el-timeline v-if="list.length">
|
||||
<el-timeline-item v-for="item in list" :color="typeObj[item.type]['color']"
|
||||
:timestamp="item.time"
|
||||
placement="top">
|
||||
<el-card shadow="hover">
|
||||
<el-collapse>
|
||||
<el-collapse-item name="1">
|
||||
<template slot="title">
|
||||
<div :style="'color:'+ typeObj[item.type].color">
|
||||
<i :class="typeObj[item.type].icon"></i> {{typeObj[item.type].name}}
|
||||
</div>
|
||||
</template>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
|
||||
<el-row v-else class="none-data">
|
||||
<span class="none-data-title">暂无数据</span>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script nonce="${cspNonce!}">
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
data: () => {
|
||||
return {
|
||||
dateRange: [],
|
||||
type: 'all',
|
||||
chart_one_loading: false,
|
||||
top_block_loading: false,
|
||||
search_user_loading: false,
|
||||
timeline_loading: false,
|
||||
userid: '',
|
||||
yearnum: 10,
|
||||
typeObj: {
|
||||
all: {
|
||||
name: '全部',
|
||||
color: ''
|
||||
},
|
||||
zgww: {
|
||||
name: '职工慰问',
|
||||
color: '#5B8FF9',
|
||||
icon: 'fa fa-bed'
|
||||
},
|
||||
knbf: {
|
||||
name: '困难帮扶',
|
||||
color: '#5AD8A6',
|
||||
icon: 'fa fa-handshake-o'
|
||||
},
|
||||
znrx: {
|
||||
name: '子女入学',
|
||||
color: '#F6BD16',
|
||||
icon: 'fa fa-graduation-cap'
|
||||
},
|
||||
ta: {
|
||||
name: '撰写提案',
|
||||
color: "#E8684A",
|
||||
icon: 'fa fa-lightbulb-o'
|
||||
},
|
||||
xhd: {
|
||||
name: '校工会活动',
|
||||
color: "#6DC8EC",
|
||||
icon: 'el-icon-basketball'
|
||||
},
|
||||
fhhd: {
|
||||
name: '分工会活动',
|
||||
color: "#6DC8EC",
|
||||
icon: 'el-icon-basketball'
|
||||
},
|
||||
sthd: {
|
||||
name: '社团活动',
|
||||
color: "#6DC8EC",
|
||||
icon: 'el-icon-basketball'
|
||||
},
|
||||
yybx: {
|
||||
name: '经费报销',
|
||||
color: "#9270CA",
|
||||
icon: 'fa fa-money'
|
||||
},
|
||||
},
|
||||
numData: {
|
||||
now_year: {},
|
||||
all: {},
|
||||
},
|
||||
userOptions: [],
|
||||
user: {},
|
||||
list: [],
|
||||
desc: true,
|
||||
numYear: {
|
||||
startYear: new Date().getFullYear() - 9 + '',
|
||||
endYear: new Date().getFullYear() + '',
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
timeLine() {
|
||||
this.timeline_loading = true
|
||||
$.post("/platform/careData/staff/timeLine", {
|
||||
userid: this.userid,
|
||||
type: this.type,
|
||||
desc: this.desc,
|
||||
startTime: this.dateRange && this.dateRange.length ? this.dateRange[0] : '',
|
||||
endTime: this.dateRange && this.dateRange.length ? this.dateRange[1] : '',
|
||||
}, (res) => {
|
||||
if (res.code == 0) {
|
||||
let {data} = res
|
||||
this.list = data
|
||||
}
|
||||
this.timeline_loading = false
|
||||
}, "json");
|
||||
},
|
||||
userChange(id) {
|
||||
this.queryAll()
|
||||
this.user = this.userOptions.find(v => v.id == id)
|
||||
},
|
||||
queryAll() {
|
||||
this.getNumByYear()
|
||||
this.getYearNumAndAllNum()
|
||||
this.timeLine()
|
||||
},
|
||||
remoteMethod(str) {
|
||||
this.search_user_loading = true
|
||||
$.get("/platform/careData/staff/queryUser", {
|
||||
key: str,
|
||||
}, (res) => {
|
||||
if (res.code == 0) {
|
||||
let {list} = res.data
|
||||
this.userOptions = list
|
||||
}
|
||||
this.search_user_loading = false
|
||||
}, "json");
|
||||
},
|
||||
getNumByYear() {
|
||||
this.chart_one_loading = true
|
||||
|
||||
let container = document.getElementById('chart_one');
|
||||
container.innerHTML = ''
|
||||
|
||||
const config = {
|
||||
"title": {
|
||||
"visible": true,
|
||||
"text": "职工动态曲线"
|
||||
},
|
||||
"description": {
|
||||
"visible": true,
|
||||
"text": "单位(条)"
|
||||
},
|
||||
"legend": {
|
||||
"position": "top-right",
|
||||
"flipPage": false
|
||||
},
|
||||
"point": {
|
||||
"visible": true
|
||||
},
|
||||
"smooth": true,
|
||||
"forceFit": false,
|
||||
"width": $('#chart_one').width(),
|
||||
"height": $('#chart_one').height(),
|
||||
"xField": "year",
|
||||
"yField": "value",
|
||||
"stackField": "type",
|
||||
|
||||
}
|
||||
let plot
|
||||
|
||||
if (this.userid) {
|
||||
$.post("/platform/careData/staff/getNumByYear", {
|
||||
userid: this.userid,
|
||||
yearnum: this.yearnum,
|
||||
startYear: this.numYear.startYear,
|
||||
endYear: this.numYear.endYear,
|
||||
}, (res) => {
|
||||
if (res.code == 0) {
|
||||
let {data} = res
|
||||
|
||||
plot = new G2Plot.Area(container, {
|
||||
data,
|
||||
...config,
|
||||
});
|
||||
|
||||
plot.render();
|
||||
|
||||
this.chart_one_loading = false
|
||||
}
|
||||
}, "json");
|
||||
} else {
|
||||
let data = []
|
||||
let year = new Date().getFullYear()
|
||||
for (let i = year - this.yearnum + 1; i <= year; i++) {
|
||||
for (let k in this.typeObj) {
|
||||
data.push({
|
||||
type: this.typeObj[k]['name'],
|
||||
value: 0,
|
||||
year: i
|
||||
})
|
||||
}
|
||||
}
|
||||
plot = new G2Plot.StackArea(container, {data, ...config,});
|
||||
plot.render();
|
||||
this.chart_one_loading = false
|
||||
}
|
||||
},
|
||||
getYearNumAndAllNum() {
|
||||
this.top_block_loading = true
|
||||
this.$axios.post('/platform/careData/staff/getYearNumAndAllNum',{userid: this.userid,}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.numData = res.data
|
||||
this.top_block_loading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.$axios.post('/platform/careData/staff/initUser').then(res => {
|
||||
if (res.code === 0) {
|
||||
this.userOptions = [res.data]
|
||||
this.userid = this.userOptions[0].id
|
||||
this.userChange(this.userOptions[0].id)
|
||||
}
|
||||
})
|
||||
},
|
||||
mounted() {
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,462 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.top_block {
|
||||
width: 100%;
|
||||
padding: 20px 80px;
|
||||
border-bottom: 10px solid rgb(240, 240, 240);
|
||||
}
|
||||
|
||||
.tr {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.tl {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.top_title {
|
||||
font-size: 14px;
|
||||
color: #808492;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.fs18 {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.fs26 {
|
||||
font-size: 26px;
|
||||
}
|
||||
|
||||
.fs20 {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 18px;
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
}
|
||||
|
||||
.none-data {
|
||||
min-height: 300px;
|
||||
background: url("/none.png") no-repeat center center;
|
||||
background-size: 360px 260px;
|
||||
}
|
||||
|
||||
.none-data-title {
|
||||
position: absolute;
|
||||
display: block;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
bottom: 20%;
|
||||
left: 0;
|
||||
color: rgb(160, 160, 160);
|
||||
}
|
||||
|
||||
.item-title {
|
||||
color: rgb(160, 160, 160);
|
||||
}
|
||||
|
||||
.item-content {
|
||||
color: rgb(100, 100, 100);
|
||||
}
|
||||
|
||||
.mb20 {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.top_num {
|
||||
font-size: 26px;
|
||||
}
|
||||
|
||||
.cut-off-line {
|
||||
width: 1px;
|
||||
height: 70%;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
background-color: rgb(230, 230, 230);
|
||||
}
|
||||
|
||||
.year input {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.chartTitle {
|
||||
font-size: 14px;
|
||||
color: #808492;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<div class="p10">
|
||||
<el-card shadow="never">
|
||||
<div class="top_block">
|
||||
<el-row :gutter="60">
|
||||
<el-col :span="8" style="position: relative">
|
||||
<div class="top_title">会员数</div>
|
||||
<div class="top_num">{{numData.hy_num?numData.hy_num:'0'}}</div>
|
||||
<div class="cut-off-line"></div>
|
||||
</el-col>
|
||||
<el-col :span="8" style="position: relative">
|
||||
<div class="top_title">分工会数</div>
|
||||
<div class="top_num">{{numData.fgh_num?numData.fgh_num:'0'}}</div>
|
||||
<div class="cut-off-line"></div>
|
||||
</el-col>
|
||||
<el-col :span="8" style="position: relative">
|
||||
<div class="top_title">社团数</div>
|
||||
<div class="top_num">{{numData.st_num?numData.st_num:'0'}}</div>
|
||||
<div class="cut-off-line"></div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<el-row style="padding: 30px 0;">
|
||||
<el-col :span="12" style="border-right: 1px solid rgb(230,230,230);padding: 0 20px;position: relative">
|
||||
<div class="chartTitle">会员性别占比</div>
|
||||
<div id="memberSexChart" style="width: 100%;height: 280px;"></div>
|
||||
</el-col>
|
||||
<el-col :span="12" style="border-right: 1px solid rgb(230,230,230);padding: 0 20px;position: relative">
|
||||
<div class="chartTitle">年度经费</div>
|
||||
<div id="activityBudgetColumn" style="width: 100%;height: 280px;"></div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row style="padding: 30px 0;">
|
||||
<el-col :span="24" style="border-right: 1px solid rgb(230,230,230);padding: 0 20px;position: relative">
|
||||
<div class="chartTitle">困难帮扶申请趋势</div>
|
||||
<div id="difficultHelpNumLine" style="width: 100%;height: 280px;"></div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row style="padding: 30px 0;border-bottom: 10px solid rgb(240, 240, 240)">
|
||||
<div style="position: absolute;top: 25px;right: 40px;z-index: 999">
|
||||
<el-date-picker
|
||||
class="year"
|
||||
style="width: 120px;"
|
||||
size="mini"
|
||||
v-model="allUnionYear"
|
||||
type="year" :clearable="false"
|
||||
value-format="yyyy" @change="allUnionActivityAndJf"
|
||||
placeholder="选择年">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<el-col :span="24" style="padding: 0 20px"
|
||||
v-loading="all_union_loading">
|
||||
<div class="chartTitle" style="margin-bottom: 50px">{{allUnionYear}}年工会报销费用及活动情况
|
||||
<el-tooltip class="item" effect="dark" :content="'点击切换为' + unionTip " placement="top">
|
||||
<el-button type="text" icon="el-icon-sort" @click="doUnionSwitch"></el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div id="allUnionChart" style="width: 100%;height: 300px;"></div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row style="padding: 30px 0;border-bottom: 10px solid rgb(240, 240, 240)">
|
||||
<div style="position: absolute;top: 25px;right: 40px;z-index: 999">
|
||||
<el-date-picker
|
||||
class="year"
|
||||
style="width: 120px;"
|
||||
size="mini"
|
||||
v-model="allClubYear"
|
||||
type="year" :clearable="false"
|
||||
value-format="yyyy" @change="allClubActivityAndJf"
|
||||
placeholder="选择年">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<el-col :span="24" style="padding: 0 20px"
|
||||
v-loading="all_club_loading">
|
||||
<div class="chartTitle" style="margin-bottom: 50px">{{allClubYear}}年社团报销费用及活动情况
|
||||
<el-tooltip class="item" effect="dark" :content="'点击切换为' + clubTip " placement="top">
|
||||
<el-button type="text" icon="el-icon-sort" @click="doClubSwitch"></el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div id="allClubChart" style="width: 100%;height: 300px;"></div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script nonce="${cspNonce!}">
|
||||
let memberSexChart, activityBudgetColumn, difficultHelpNumLine = null
|
||||
new Vue({
|
||||
el: "#app",
|
||||
data() {
|
||||
return {
|
||||
numData: {},
|
||||
|
||||
|
||||
all_club_loading: false,
|
||||
clubTip:'协会活动数',
|
||||
allClubYear: moment().format('YYYY'),
|
||||
isClubJf:true,
|
||||
|
||||
all_union_loading: false,
|
||||
unionTip:'分工会活动数',
|
||||
allUnionYear: moment().format('YYYY'),
|
||||
isUnionJf:true,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getNumData() {
|
||||
this.$axios.post("/platform/caredata/union/getNumData").then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.numData = resp.data
|
||||
}
|
||||
})
|
||||
},
|
||||
// 会员性别统计图
|
||||
memberSexNum() {
|
||||
this.$axios.post("/platform/caredata/union/getHyNumBySex").then(resp => {
|
||||
if (resp.code === 0) {
|
||||
// 初始化饼图
|
||||
memberSexChart && memberSexChart.destroy()
|
||||
memberSexChart = new G2Plot.Pie("memberSexChart", {
|
||||
data: resp.data,
|
||||
angleField: "value",
|
||||
colorField: "name",
|
||||
radius: 0.8,
|
||||
label: {
|
||||
type: "性别",
|
||||
content: "{name}"
|
||||
}
|
||||
})
|
||||
memberSexChart.render()
|
||||
}
|
||||
})
|
||||
},
|
||||
//年度经费统计
|
||||
activityBudget() {
|
||||
this.$axios.post(loc() + "/getActivityBudget", this.pageForm).then((res) => {
|
||||
if (res.code === 0) {
|
||||
if (activityBudgetColumn) {
|
||||
activityBudgetColumn.changeData(res.data)
|
||||
return
|
||||
}
|
||||
activityBudgetColumn = new G2Plot.Column("activityBudgetColumn", {
|
||||
data: res.data,
|
||||
xField: "year",
|
||||
yField: "value",
|
||||
seriesField: "type",
|
||||
isGroup: true,
|
||||
columnStyle: {
|
||||
radius: [20, 20, 0, 0],
|
||||
},
|
||||
})
|
||||
activityBudgetColumn.render()
|
||||
}
|
||||
})
|
||||
},
|
||||
//困难帮扶申请趋势
|
||||
getDifficultHelpNum() {
|
||||
this.$axios.post(loc() + "/getDifficultHelpNum", this.pageForm).then((res) => {
|
||||
if (res.code === 0) {
|
||||
if (difficultHelpNumLine) {
|
||||
difficultHelpNumLine.changeData(res.data)
|
||||
return
|
||||
}
|
||||
difficultHelpNumLine = new G2Plot.Line("difficultHelpNumLine", {
|
||||
data: res.data,
|
||||
xField: 'year',
|
||||
yField: 'value',
|
||||
meta: {
|
||||
year: {
|
||||
alias: '年份',
|
||||
},
|
||||
value: {
|
||||
alias: '数量',
|
||||
}
|
||||
},
|
||||
point: {
|
||||
size: 5,
|
||||
shape: 'diamond',
|
||||
style: {
|
||||
fill: 'white',
|
||||
stroke: '#5B8FF9',
|
||||
lineWidth: 2,
|
||||
},
|
||||
},
|
||||
tooltip: {showMarkers: false},
|
||||
state: {
|
||||
active: {
|
||||
style: {
|
||||
shadowBlur: 4,
|
||||
stroke: '#000',
|
||||
fill: 'red',
|
||||
},
|
||||
},
|
||||
},
|
||||
interactions: [{type: 'marker-active'}],
|
||||
})
|
||||
difficultHelpNumLine.render()
|
||||
}
|
||||
})
|
||||
},
|
||||
//社团报销费用及活动情况
|
||||
async doClubSwitch(){
|
||||
this.isClubJf = !this.isClubJf
|
||||
this.clubTip = this.isClubJf ? '协会活动数' : '协会经费详情'
|
||||
await this.allClubActivityAndJf();
|
||||
},
|
||||
async allClubActivityAndJf(){
|
||||
this.all_club_loading = true
|
||||
const resp = await this.$axios.post("/platform/activityReimbursement/board/allClubActivityAndMoney",{
|
||||
year:this.allClubYear,
|
||||
isClubMoney:this.isClubJf
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
let {data} = resp
|
||||
document.getElementById("allClubChart").innerHTML = ''
|
||||
const config = {
|
||||
isStack: true,
|
||||
"legend": {
|
||||
"position": "top-right",
|
||||
"flipPage": false
|
||||
},
|
||||
autoFit: true,
|
||||
title: {
|
||||
visible: true,
|
||||
text: this.allClubYear + '年工会经费及活动详情',
|
||||
},
|
||||
description: {
|
||||
visible: true,
|
||||
text: '单位(元)',
|
||||
},
|
||||
xField: 'clubName',
|
||||
yField: 'money',
|
||||
stackField: 'type',
|
||||
color: ["#5B8FF9", "#5AD8A6"],
|
||||
"xAxis": {
|
||||
label: {
|
||||
formatter: (v) => {
|
||||
if (data.length > 30 && v.length > 3) {
|
||||
return v.substr(0, 2) + '...'
|
||||
} else if (data.length > 20 && v.length > 4) {
|
||||
return v.substr(0, 3) + '...'
|
||||
} else if (data.length > 10 && v.length > 6) {
|
||||
return v.substr(0, 5) + '...'
|
||||
}
|
||||
return v
|
||||
}
|
||||
}
|
||||
},
|
||||
"yAxis": {},
|
||||
meta: {
|
||||
clubName: {
|
||||
alias: '协会',
|
||||
},
|
||||
money: {
|
||||
alias: this.isClubJf?'金额':'活动数',
|
||||
}
|
||||
},
|
||||
connectedArea: {
|
||||
visible: true,
|
||||
triggerOn: false,
|
||||
},
|
||||
}
|
||||
const plot = new G2Plot.Column(document.getElementById("allClubChart"), {
|
||||
data,
|
||||
...config,
|
||||
});
|
||||
plot.render();
|
||||
}
|
||||
this.all_club_loading = false
|
||||
},
|
||||
//部门报销费用和活动情况
|
||||
async doUnionSwitch(){
|
||||
this.isUnionJf = !this.isUnionJf
|
||||
this.unionTip = this.isUnionJf ? '分工会活动数' : '分工会经费详情'
|
||||
await this.allUnionActivityAndJf();
|
||||
},
|
||||
async allUnionActivityAndJf() {
|
||||
this.all_union_loading = true
|
||||
const resp = await this.$axios.post("/platform/activityReimbursement/board/allUnionActivityAndMoney",{
|
||||
year:this.allUnionYear,
|
||||
isUnionMoney:this.isUnionJf
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
let {data} = resp
|
||||
document.getElementById("allUnionChart").innerHTML = ''
|
||||
const config = {
|
||||
isStack: true,
|
||||
"legend": {
|
||||
"position": "top-right",
|
||||
"flipPage": false
|
||||
},
|
||||
autoFit: true,
|
||||
title: {
|
||||
visible: true,
|
||||
text: this.allUnionYear + '年工会经费及活动详情',
|
||||
},
|
||||
description: {
|
||||
visible: true,
|
||||
text: '单位(元)',
|
||||
},
|
||||
xField: 'unionname',
|
||||
yField: 'money',
|
||||
stackField: 'type',
|
||||
color: ["#5B8FF9", "#5AD8A6"],
|
||||
"xAxis": {
|
||||
label: {
|
||||
formatter: (v) => {
|
||||
if (data.length > 30 && v.length > 3) {
|
||||
return v.substr(0, 2) + '...'
|
||||
} else if (data.length > 20 && v.length > 4) {
|
||||
return v.substr(0, 3) + '...'
|
||||
} else if (data.length > 10 && v.length > 6) {
|
||||
return v.substr(0, 5) + '...'
|
||||
}
|
||||
return v
|
||||
}
|
||||
}
|
||||
},
|
||||
"yAxis": {},
|
||||
meta: {
|
||||
unionname: {
|
||||
alias: '工会',
|
||||
},
|
||||
money: {
|
||||
alias: this.isUnionJf?'金额':'活动数',
|
||||
}
|
||||
},
|
||||
connectedArea: {
|
||||
visible: true,
|
||||
triggerOn: false,
|
||||
},
|
||||
}
|
||||
const plot = new G2Plot.Column(document.getElementById("allUnionChart"), {
|
||||
data,
|
||||
...config,
|
||||
});
|
||||
plot.render();
|
||||
}
|
||||
this.all_union_loading = false
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getNumData()
|
||||
this.memberSexNum()
|
||||
this.activityBudget()
|
||||
this.getDifficultHelpNum()
|
||||
this.allClubActivityAndJf()
|
||||
this.allUnionActivityAndJf()
|
||||
},
|
||||
mounted() {
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user