修改页面和接口
This commit is contained in:
parent
9a2097a7fa
commit
8ea7d365f9
cyx-admin/src/main/java/com/cyx/web/base/controller
cyx-system/src/main/resources/mapper/base
|
@ -1,9 +1,11 @@
|
||||||
package com.cyx.web.base.controller;
|
package com.cyx.web.base.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.cyx.common.core.controller.BaseController;
|
import com.cyx.common.core.controller.BaseController;
|
||||||
import com.cyx.common.core.domain.AjaxResult;
|
import com.cyx.common.core.domain.AjaxResult;
|
||||||
import com.cyx.common.core.domain.entity.SysUser;
|
import com.cyx.common.core.domain.entity.SysUser;
|
||||||
import com.cyx.common.json.JSONObject;
|
import com.cyx.common.json.JSONObject;
|
||||||
|
import com.cyx.common.utils.DateUtils;
|
||||||
import com.cyx.web.base.domain.TAmentAdvancedDept;
|
import com.cyx.web.base.domain.TAmentAdvancedDept;
|
||||||
import com.cyx.web.base.domain.TAmentAdvancedParty;
|
import com.cyx.web.base.domain.TAmentAdvancedParty;
|
||||||
import com.cyx.web.base.domain.TAmentPartyAffairs;
|
import com.cyx.web.base.domain.TAmentPartyAffairs;
|
||||||
|
@ -18,8 +20,12 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.TreeMap;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/base/index")
|
@RequestMapping("/base/index")
|
||||||
|
@ -34,13 +40,13 @@ public class BigScreenController extends BaseController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所有统计
|
* 所有统计
|
||||||
|
*
|
||||||
* @param am
|
* @param am
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/groupAll")
|
@PostMapping("/groupAll")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult groupAll(TAmentPartyAffairs am)
|
public AjaxResult groupAll(TAmentPartyAffairs am) {
|
||||||
{
|
|
||||||
SysUser u = getSysUser();
|
SysUser u = getSysUser();
|
||||||
am.setDeptId(u.getDeptId());
|
am.setDeptId(u.getDeptId());
|
||||||
List<Map<String, Object>> list = partyAffairsService.groupAll(am);
|
List<Map<String, Object>> list = partyAffairsService.groupAll(am);
|
||||||
|
@ -49,13 +55,13 @@ public class BigScreenController extends BaseController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 党务及意识形态
|
* 党务及意识形态
|
||||||
|
*
|
||||||
* @param am
|
* @param am
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/dwysxt")
|
@PostMapping("/dwysxt")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult dwysxt(TAmentPartyAffairs am)
|
public AjaxResult dwysxt(TAmentPartyAffairs am) {
|
||||||
{
|
|
||||||
SysUser u = getSysUser();
|
SysUser u = getSysUser();
|
||||||
am.setDeptId(u.getDeptId());
|
am.setDeptId(u.getDeptId());
|
||||||
List<Map<String, Object>> list = partyAffairsService.dwysxt(am);
|
List<Map<String, Object>> list = partyAffairsService.dwysxt(am);
|
||||||
|
@ -64,13 +70,13 @@ public class BigScreenController extends BaseController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 党风廉政建设
|
* 党风廉政建设
|
||||||
|
*
|
||||||
* @param am
|
* @param am
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/dflzjs")
|
@PostMapping("/dflzjs")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult dflzjs(TAmentPartyAffairs am)
|
public AjaxResult dflzjs(TAmentPartyAffairs am) {
|
||||||
{
|
|
||||||
SysUser u = getSysUser();
|
SysUser u = getSysUser();
|
||||||
am.setDeptId(u.getDeptId());
|
am.setDeptId(u.getDeptId());
|
||||||
List<Map<String, Object>> list = partyAffairsService.dflzjs(am);
|
List<Map<String, Object>> list = partyAffairsService.dflzjs(am);
|
||||||
|
@ -79,13 +85,13 @@ public class BigScreenController extends BaseController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 日常考核指标
|
* 日常考核指标
|
||||||
|
*
|
||||||
* @param am
|
* @param am
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/rckhzb")
|
@PostMapping("/rckhzb")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult rckhzb(TAmentPartyAffairs am)
|
public AjaxResult rckhzb(TAmentPartyAffairs am) {
|
||||||
{
|
|
||||||
SysUser u = getSysUser();
|
SysUser u = getSysUser();
|
||||||
am.setDeptId(u.getDeptId());
|
am.setDeptId(u.getDeptId());
|
||||||
List<Map<String, Object>> list = partyAffairsService.rckhzb(am);
|
List<Map<String, Object>> list = partyAffairsService.rckhzb(am);
|
||||||
|
@ -94,13 +100,13 @@ public class BigScreenController extends BaseController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 季度考核指标
|
* 季度考核指标
|
||||||
|
*
|
||||||
* @param am
|
* @param am
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/ndkhbz")
|
@PostMapping("/ndkhbz")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult ndkhbz(TAmentPartyAffairs am)
|
public AjaxResult ndkhbz(TAmentPartyAffairs am) {
|
||||||
{
|
|
||||||
SysUser u = getSysUser();
|
SysUser u = getSysUser();
|
||||||
am.setDeptId(u.getDeptId());
|
am.setDeptId(u.getDeptId());
|
||||||
List<Map<String, Object>> list = partyAffairsService.ndkhbz(am);
|
List<Map<String, Object>> list = partyAffairsService.ndkhbz(am);
|
||||||
|
@ -109,13 +115,13 @@ public class BigScreenController extends BaseController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门完成情况
|
* 部门完成情况
|
||||||
|
*
|
||||||
* @param am
|
* @param am
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/bmwcqk")
|
@PostMapping("/bmwcqk")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult bmwcqk(TAmentPartyAffairs am)
|
public AjaxResult bmwcqk(TAmentPartyAffairs am) {
|
||||||
{
|
|
||||||
SysUser u = getSysUser();
|
SysUser u = getSysUser();
|
||||||
am.setDeptId(u.getDeptId());
|
am.setDeptId(u.getDeptId());
|
||||||
List<Map<String, Object>> list = partyAffairsService.bmwcqk(am);
|
List<Map<String, Object>> list = partyAffairsService.bmwcqk(am);
|
||||||
|
@ -127,31 +133,70 @@ public class BigScreenController extends BaseController {
|
||||||
|
|
||||||
@PostMapping("/tradeEcharts")
|
@PostMapping("/tradeEcharts")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult tradeEcharts(TAmentTrade tAmentTrade)
|
public AjaxResult tradeEcharts(TAmentTrade tAmentTrade) {
|
||||||
{
|
AtomicInteger yearCount = new AtomicInteger();
|
||||||
int yearCount = 0;
|
AtomicReference<Double> yearMoney = new AtomicReference<>(0.0000);
|
||||||
double yearMoney = 0.0000;
|
int monthCount = 0;
|
||||||
|
double monthMoney = 0.0000;
|
||||||
JSONObject object = new JSONObject();
|
JSONObject object = new JSONObject();
|
||||||
List<Map<String, Object>> list = tAmentTradeService.tradeEcharts(tAmentTrade);
|
List<Map<String, Object>> list = tAmentTradeService.tradeEcharts(tAmentTrade);
|
||||||
|
Map<String, String> tradeMap = new TreeMap<>();
|
||||||
|
JSONArray typeArray = new JSONArray();
|
||||||
|
JSONArray dataArray = new JSONArray();
|
||||||
|
String month = DateUtils.parseDateToStr("YYYY-MM", new Date());
|
||||||
|
list.forEach(l -> {
|
||||||
|
typeArray.add(l.get("type"));
|
||||||
|
JSONArray array = JSONArray.parseArray("[" + l.get("json").toString() + "]");
|
||||||
|
array.forEach(a -> {
|
||||||
|
Map<String, Object> m = (Map<String, Object>) a;
|
||||||
|
tradeMap.put(m.get("label").toString(), m.get("label").toString());
|
||||||
|
yearCount.addAndGet(Integer.parseInt(m.get("count").toString()));
|
||||||
|
yearMoney.updateAndGet(v -> new Double((double) (v + Double.parseDouble(m.get("trade").toString()))));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// 所有小分类
|
||||||
|
for (Map.Entry<String, String> entry : tradeMap.entrySet()) {
|
||||||
|
JSONObject object1 = new JSONObject();
|
||||||
|
object1.put("name", entry.getKey());
|
||||||
|
JSONArray array1 = new JSONArray();
|
||||||
|
// 三个大分类
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
yearCount+=Integer.parseInt(list.get(i).get("count").toString());
|
String month1 = list.get(i).get("month").toString();
|
||||||
yearMoney+=Double.parseDouble(list.get(i).get("trade").toString());
|
JSONArray array = JSONArray.parseArray("[" + list.get(i).get("json").toString() + "]");
|
||||||
|
AtomicInteger count = new AtomicInteger();
|
||||||
|
AtomicReference<Double> trade = new AtomicReference<>(0.0);
|
||||||
|
array.forEach(a -> {
|
||||||
|
Map<String, Object> m = (Map<String, Object>) a;
|
||||||
|
if (entry.getKey().equals(m.get("label").toString()) && month1.equals(month)) {
|
||||||
|
count.set(Integer.parseInt(m.get("count").toString()));
|
||||||
|
trade.set(Double.parseDouble(m.get("trade").toString()));
|
||||||
}
|
}
|
||||||
object.put("list",list);
|
});
|
||||||
|
monthCount += count.get();
|
||||||
|
monthMoney += trade.get();
|
||||||
|
array1.add(trade.get());
|
||||||
|
}
|
||||||
|
object1.put("array", array1);
|
||||||
|
dataArray.add(object1);
|
||||||
|
}
|
||||||
|
object.put("monthCount", monthCount);
|
||||||
|
object.put("monthMoney", monthMoney);
|
||||||
object.put("yearCount", yearCount);
|
object.put("yearCount", yearCount);
|
||||||
object.put("yearMoney", yearMoney);
|
object.put("yearMoney", yearMoney);
|
||||||
|
object.put("type", typeArray);
|
||||||
|
object.put("data", dataArray);
|
||||||
return AjaxResult.success(object);
|
return AjaxResult.success(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 先进成员
|
* 先进成员
|
||||||
|
*
|
||||||
* @param pa
|
* @param pa
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/advanceParity")
|
@PostMapping("/advanceParity")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult advanceParity(TAmentAdvancedParty pa)
|
public AjaxResult advanceParity(TAmentAdvancedParty pa) {
|
||||||
{
|
|
||||||
SysUser u = getSysUser();
|
SysUser u = getSysUser();
|
||||||
List<Map<String, Object>> list = advancedPartyService.advanceParity(pa);
|
List<Map<String, Object>> list = advancedPartyService.advanceParity(pa);
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
|
@ -159,13 +204,13 @@ public class BigScreenController extends BaseController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 先进部门
|
* 先进部门
|
||||||
|
*
|
||||||
* @param dept
|
* @param dept
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/advanceDept")
|
@PostMapping("/advanceDept")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult advanceDept(TAmentAdvancedDept dept)
|
public AjaxResult advanceDept(TAmentAdvancedDept dept) {
|
||||||
{
|
|
||||||
SysUser u = getSysUser();
|
SysUser u = getSysUser();
|
||||||
List<Map<String, Object>> list = advancedDeptService.advanceDept(dept);
|
List<Map<String, Object>> list = advancedDeptService.advanceDept(dept);
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
|
|
|
@ -34,15 +34,19 @@
|
||||||
<select id="tradeEcharts" resultType="map">
|
<select id="tradeEcharts" resultType="map">
|
||||||
SELECT
|
SELECT
|
||||||
month_of 'month',
|
month_of 'month',
|
||||||
|
type,
|
||||||
ROUND( sum( trade_mony ), 4 ) trade,
|
ROUND( sum( trade_mony ), 4 ) trade,
|
||||||
SUM( trade_count ) count
|
SUM( trade_count ) count,
|
||||||
|
GROUP_CONCAT( '{"label":"', trade_type, '","trade":', trade_mony, ',"count":', trade_count, '}' ) json
|
||||||
FROM
|
FROM
|
||||||
t_ament_trade
|
t_ament_trade
|
||||||
WHERE
|
WHERE
|
||||||
month_of LIKE CONCAT( '%', DATE_FORMAT( NOW(), '%Y' ), '%' )
|
month_of LIKE CONCAT( '%', DATE_FORMAT( NOW(), '%Y' ), '%' )
|
||||||
GROUP BY
|
GROUP BY
|
||||||
month_of
|
month_of,
|
||||||
ORDER BY month_of desc
|
type
|
||||||
|
ORDER BY
|
||||||
|
month_of DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertTAmentTrade" parameterType="TAmentTrade" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertTAmentTrade" parameterType="TAmentTrade" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
|
Loading…
Reference in New Issue