添加大数据页面相关方法
This commit is contained in:
parent
45907a6179
commit
6d8499cd3c
@ -35,13 +35,12 @@ public class AuthClientSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
|
||||
@Override
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
http
|
||||
.formLogin()
|
||||
http.formLogin()
|
||||
.defaultSuccessUrl("/authorize", true)
|
||||
.and()
|
||||
.logout().logoutSuccessUrl(authServer.getOauthLogout())
|
||||
.and()
|
||||
.authorizeRequests().antMatchers("/app/**", "/route/file/**", "/assets/**").permitAll()
|
||||
.authorizeRequests().antMatchers("/app/**", "/route/file/**", "/assets/**","/resource/**").permitAll()
|
||||
.and()
|
||||
.authorizeRequests()
|
||||
.anyRequest()
|
||||
|
@ -0,0 +1,59 @@
|
||||
package com.cm.partybuilding.controller.resources.threemeetlesson;
|
||||
|
||||
import com.cm.common.base.AbstractController;
|
||||
import com.cm.common.constants.ISystemConstant;
|
||||
import com.cm.common.exception.SearchException;
|
||||
import com.cm.common.result.ErrorResult;
|
||||
import com.cm.common.result.SuccessResultData;
|
||||
import com.cm.partybuilding.pojo.dtos.threemeetlesson.ThreeMeetLessonDTO;
|
||||
import com.cm.partybuilding.service.threemeetlesson.IThreeMeetLessonService;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 组织生活分类统计接口
|
||||
* @ClassName: ThreeMeetLessonResourcesController
|
||||
* @Description:
|
||||
* @Author: WenG
|
||||
* @Date: 2020-10-19 09:46
|
||||
* @Version: 1.0
|
||||
**/
|
||||
@CrossOrigin(origins = "*", maxAge = 3600)
|
||||
@Api(tags = ISystemConstant.API_TAGS_RESOURCE_PREFIX + "组织生活接口")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.RESOURCE_PREFIX + "/threemeetlesson")
|
||||
public class ThreeMeetLessonResourcesController extends AbstractController {
|
||||
|
||||
@Autowired
|
||||
private IThreeMeetLessonService threeMeetLessonService;
|
||||
|
||||
@ApiOperation(value = "党组织下各类组织生活数量", notes = "党组织下各类组织生活数量接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "partyOrganizeId", value = "当前党组织ID", paramType = "query")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("getorgthreemeetlessoncount")
|
||||
public List<Map<String, Object>> getOrgThreeMeetLessonCount(){
|
||||
Map<String, Object> params = requestParams();
|
||||
return threeMeetLessonService.getOrgThreeMeetLessonCount(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "大数据组织生活按周统计量", notes = "大数据组织生活按月统计量接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "partyOrganizeId", value = "当前党组织ID", paramType = "query")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("getthreemeetlessonweekcount")
|
||||
public List<List<String>> getThreeMeetLessonWeekCount(){
|
||||
Map<String, Object> params = requestParams();
|
||||
return threeMeetLessonService.getThreeMeetLessonWeekCount(params);
|
||||
}
|
||||
|
||||
}
|
@ -167,4 +167,11 @@ public interface IThreeMeetLessonService {
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> getOrgThreeMeetLessonCount(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 大数据组织生活按周统计量
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<List<String>> getThreeMeetLessonWeekCount(Map<String, Object> params);
|
||||
}
|
@ -7,6 +7,7 @@ import com.cm.common.pojo.ListPage;
|
||||
import com.cm.common.result.SuccessResult;
|
||||
import com.cm.common.result.SuccessResultData;
|
||||
import com.cm.common.result.SuccessResultList;
|
||||
import com.cm.common.utils.DateUtil;
|
||||
import com.cm.common.utils.HashMapUtil;
|
||||
import com.cm.common.utils.UUIDUtil;
|
||||
import com.cm.partybuilding.dao.threemeetlesson.IThreeMeetLessonDao;
|
||||
@ -20,6 +21,7 @@ import com.google.common.base.Joiner;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
@ -201,41 +203,88 @@ public class ThreeMeetLessonServiceImpl extends AbstractService implements IThre
|
||||
String userIds = userIdsList.size() == 0 ? "" : Joiner.on(",").join(userIdsList);
|
||||
params.put("userIds",userIds);
|
||||
List<Map<String, Object>> countList = new ArrayList<>();
|
||||
//1支部委员会会议
|
||||
params.put("category","1");
|
||||
Integer oneCount = threeMeetLessonDao.getOrgThreeMeetLessonCount(params);
|
||||
Map<String,Object> oneDTO = new HashMap<>(4);
|
||||
oneDTO.put("categoryName","支部委员会会议");
|
||||
oneDTO.put("counts",oneCount);
|
||||
countList.add(oneDTO);
|
||||
//2全体党员大会
|
||||
params.put("category","2");
|
||||
Integer twoCount = threeMeetLessonDao.getOrgThreeMeetLessonCount(params);
|
||||
Map<String,Object> towDTO = new HashMap<>(4);
|
||||
towDTO.put("categoryName","全体党员大会");
|
||||
towDTO.put("counts",twoCount);
|
||||
countList.add(towDTO);
|
||||
//3党小组会议
|
||||
params.put("category","3");
|
||||
Integer threeCount = threeMeetLessonDao.getOrgThreeMeetLessonCount(params);
|
||||
Map<String,Object> threeDTO = new HashMap<>(4);
|
||||
threeDTO.put("categoryName","党小组会议");
|
||||
threeDTO.put("counts",threeCount);
|
||||
countList.add(threeDTO);
|
||||
//4民主评议党员
|
||||
params.put("category","4");
|
||||
Integer fourCount = threeMeetLessonDao.getOrgThreeMeetLessonCount(params);
|
||||
Map<String,Object> fourDTO = new HashMap<>(4);
|
||||
fourDTO.put("categoryName","民主评议党员");
|
||||
fourDTO.put("counts",fourCount);
|
||||
countList.add(fourDTO);
|
||||
//5组织生活会
|
||||
params.put("category","5");
|
||||
Integer fiveCount = threeMeetLessonDao.getOrgThreeMeetLessonCount(params);
|
||||
Map<String,Object> fiveDTO = new HashMap<>(4);
|
||||
fiveDTO.put("categoryName","组织生活会");
|
||||
fiveDTO.put("counts",fiveCount);
|
||||
countList.add(fiveDTO);
|
||||
String[] categoryName = {"支部委员会会议","全体党员大会","党小组会议","民主评议党员",
|
||||
"组织生活会","谈心谈话","党员教育培训","党课"};
|
||||
for(int i = 0; i < categoryName.length; i++){
|
||||
params.put("category",i + 1);
|
||||
Integer counts = threeMeetLessonDao.getOrgThreeMeetLessonCount(params);
|
||||
Map<String,Object> dto = new HashMap<>(4);
|
||||
dto.put("categoryName",categoryName[i]);
|
||||
dto.put("counts",counts);
|
||||
countList.add(dto);
|
||||
}
|
||||
return countList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<List<String>> getThreeMeetLessonWeekCount(Map<String, Object> params) {
|
||||
//查询党组织下所有人员列表
|
||||
List<String> userIdsList = threeMeetLessonDao.listOrgUserId(params);
|
||||
String userIds = userIdsList.size() == 0 ? "" : Joiner.on(",").join(userIdsList);
|
||||
params.put("userIds",userIds);
|
||||
String[] categoryName = {"支部委员会会议","全体党员大会","党小组会议","民主评议党员",
|
||||
"组织生活会","谈心谈话","党员教育培训","党课"};
|
||||
String startDate;
|
||||
String endDate;
|
||||
/**查询当前周数据**/
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
//当前周
|
||||
Date weekStartDate = DateUtil.weekStartDate();
|
||||
startDate = sdf.format(weekStartDate);
|
||||
endDate = DateUtil.getDay();
|
||||
params.put("startDate",startDate);
|
||||
params.put("endDate",endDate);
|
||||
List<String> weekCount = new ArrayList<>();
|
||||
weekCount.add("当前周");
|
||||
for(int i = 0; i < categoryName.length; i++){
|
||||
params.put("category",i + 1);
|
||||
Integer counts = threeMeetLessonDao.getOrgThreeMeetLessonCount(params);
|
||||
weekCount.add(counts +"");
|
||||
}
|
||||
//上周
|
||||
endDate = DateUtil.getBeforeDate(1,startDate);
|
||||
startDate = DateUtil.getBeforeDate(7,startDate);
|
||||
params.put("startDate",startDate + " 00:00:00");
|
||||
params.put("endDate",endDate + " 59:59:59");
|
||||
List<String> lastWeekCount = new ArrayList<>();
|
||||
lastWeekCount.add(startDate.substring(5,10) + "至" + endDate.substring(5,10));
|
||||
for(int i = 0; i < categoryName.length; i++){
|
||||
params.put("category",i + 1);
|
||||
Integer counts = threeMeetLessonDao.getOrgThreeMeetLessonCount(params);
|
||||
lastWeekCount.add(counts +"");
|
||||
}
|
||||
//上两周
|
||||
endDate = DateUtil.getBeforeDate(8,startDate);
|
||||
startDate = DateUtil.getBeforeDate(14,startDate);
|
||||
params.put("startDate",startDate);
|
||||
params.put("endDate",endDate);
|
||||
List<String> last2WeekCount = new ArrayList<>();
|
||||
last2WeekCount.add(startDate.substring(5,10) + "至" + endDate.substring(5,10));
|
||||
for(int i = 0; i < categoryName.length; i++){
|
||||
params.put("category",i + 1);
|
||||
Integer counts = threeMeetLessonDao.getOrgThreeMeetLessonCount(params);
|
||||
last2WeekCount.add(counts +"");
|
||||
}
|
||||
//上三周
|
||||
endDate = DateUtil.getBeforeDate(15,startDate);
|
||||
startDate = DateUtil.getBeforeDate(21,startDate);
|
||||
params.put("startDate",startDate);
|
||||
params.put("endDate",endDate);
|
||||
List<String> last3WeekCount = new ArrayList<>();
|
||||
last3WeekCount.add(startDate.substring(5,10) + "至" + endDate.substring(5,10));
|
||||
for(int i = 0; i < categoryName.length; i++){
|
||||
params.put("category",i + 1);
|
||||
Integer counts = threeMeetLessonDao.getOrgThreeMeetLessonCount(params);
|
||||
last3WeekCount.add(counts +"");
|
||||
}
|
||||
List<List<String>> result = new ArrayList<>();
|
||||
List<String> categoryList = new ArrayList<>(Arrays.asList(categoryName));
|
||||
categoryList.add(0,"分类");
|
||||
result.add(categoryList);
|
||||
result.add(last3WeekCount);
|
||||
result.add(last2WeekCount);
|
||||
result.add(lastWeekCount);
|
||||
result.add(weekCount);
|
||||
return result;
|
||||
}
|
||||
}
|
@ -222,7 +222,15 @@
|
||||
WHERE
|
||||
is_delete = '0'
|
||||
AND category = #{category}
|
||||
<if test="userIds !=null and partyOrganizeId !='' and partyOrganizeId != null">
|
||||
AND FIND_IN_SET(creator,#{userIds})
|
||||
</if>
|
||||
<if test="startDate != null and startDate !=''">
|
||||
AND gmt_create <![CDATA[>=]]> #{startDate}
|
||||
</if>
|
||||
<if test="endDate != null and endDate !=''">
|
||||
AND gmt_create <![CDATA[<=]]> #{endDate}
|
||||
</if>
|
||||
</select>
|
||||
<select id="listOrgUserId" parameterType="map" resultType="String">
|
||||
SELECT
|
||||
|
@ -183,7 +183,9 @@
|
||||
var self = this;
|
||||
var loadLayerIndex;
|
||||
top.restAjax.get('api/threemeetlesson/getorgthreemeetlessoncount', {partyOrganizeId: self.partyOrganizeId}, null, function(code, data) {
|
||||
self.orgThreeMeetLessonCount = data;
|
||||
if(typeof (data) != 'undefined' && data != null && data != ''){
|
||||
self.orgThreeMeetLessonCount = data.slice(0,5);
|
||||
}
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
|
Loading…
Reference in New Issue
Block a user