|
@@ -1,158 +0,0 @@
|
|
|
-//package com.dragoninfo.dcuc.authweb.restcontroller.statisics;
|
|
|
-//
|
|
|
-//import com.dragoninfo.dcuc.authweb.restcontroller.sub.vo.org.OrgTreeNodeVo;
|
|
|
-//import com.dragoninfo.dcuc.duceap.enums.UserTypeEnum;
|
|
|
-//import com.dragoninfo.dcuc.org.facade.IOrgInfoFacade;
|
|
|
-//import com.dragoninfo.dcuc.org.vo.OrgTreeNode;
|
|
|
-//import com.dragonsoft.duceap.commons.util.string.StringUtils;
|
|
|
-//import com.dragonsoft.duceap.web.controller.BaseController;
|
|
|
-//import io.swagger.annotations.Api;
|
|
|
-//import io.swagger.annotations.ApiImplicitParam;
|
|
|
-//import io.swagger.annotations.ApiImplicitParams;
|
|
|
-//import io.swagger.annotations.ApiOperation;
|
|
|
-//import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-//import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-//import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-//import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-//import org.springframework.web.bind.annotation.RestController;
|
|
|
-//
|
|
|
-//import java.util.ArrayList;
|
|
|
-//import java.util.List;
|
|
|
-//
|
|
|
-///**
|
|
|
-// * Created by liws on 2018/9/21.
|
|
|
-// */
|
|
|
-//@Api(tags = {"用户统计"})
|
|
|
-//@RestController
|
|
|
-//@RequestMapping(value = "usersvr")
|
|
|
-//public class UserStatisicsController extends BaseController {
|
|
|
-// @Autowired
|
|
|
-// private IUserInfoFacade iUserInfoFacade;
|
|
|
-// @Autowired
|
|
|
-// private IOrgInfoFacade iOrgInfoFacade;
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 完整树
|
|
|
-// *
|
|
|
-// * @param id 节点机构id
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-// @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "机构ID", required = true
|
|
|
-// , example = "40288a8b699fc2500169a33b20540000")})
|
|
|
-// @ApiOperation(value = "获取完整树下各用户数量")
|
|
|
-// @GetMapping(value = "statisics/{id}")
|
|
|
-// public List<OrgTreeNodeVo> treeGrid(@PathVariable String id) {
|
|
|
-// if (StringUtils.isEmpty(id) || id.equals("null")) {
|
|
|
-// id = iOrgInfoFacade.getRootOrgId();
|
|
|
-// OrgTreeNode orgTreeNode = iOrgInfoFacade.getOrgTreeNode(id);
|
|
|
-// int orgCount = iOrgInfoFacade.allOrgNum();
|
|
|
-// int userCount = iUserInfoFacade.allUserNum();
|
|
|
-// orgTreeNode.setCount(orgCount);
|
|
|
-// int policeNum = iUserInfoFacade.allUserTypeNum(UserTypeEnum.POLICE.getValue());
|
|
|
-// orgTreeNode.setPoliceNum(policeNum);
|
|
|
-// int helperNum = iUserInfoFacade.allUserTypeNum(UserTypeEnum.HELPER.getValue());
|
|
|
-// orgTreeNode.setAuxiliaryNum(helperNum);
|
|
|
-// int externalNum = iUserInfoFacade.allUserTypeNum(UserTypeEnum.EXTERNAL.getValue());
|
|
|
-// orgTreeNode.setExternalNum(externalNum);
|
|
|
-// orgTreeNode.setUserNum(userCount);
|
|
|
-// List<OrgTreeNode> resultList = new ArrayList<OrgTreeNode>();
|
|
|
-// resultList.add(orgTreeNode);
|
|
|
-// List<OrgTreeNodeVo> orgTreeNodeVos = this.treeNodeToVo(resultList);
|
|
|
-// return orgTreeNodeVos;
|
|
|
-// } else {
|
|
|
-// List<OrgTreeNode> resultList = iOrgInfoFacade.countChildOrgTreeNode(id);
|
|
|
-// List<OrgTreeNodeVo> orgTreeNodeVos = this.treeNodeToVo(resultList);
|
|
|
-// return orgTreeNodeVos;
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-////
|
|
|
-//// @RequestMapping(value = "provinces")
|
|
|
-//// @ResponseBody
|
|
|
-//// public List provinces() {
|
|
|
-//// Searchable searchable = Searchable.newSearchable();
|
|
|
-//// searchable.addSearchFilter("ranged",SearchOperator.eq,dcucWebConfig.getStatisticsRange());
|
|
|
-//// SearchDTO searchDTO = searchable.toSearchDTO();
|
|
|
-//// searchDTO.setSize("100");
|
|
|
-//// searchDTO.setPage("1");
|
|
|
-//// List<Map<String, String>> result = new ArrayList<Map<String, String>>();
|
|
|
-//// Page<AreaInfo> page = iOrgInfoFacade.areaMap(searchDTO);
|
|
|
-//// List<AreaInfo> areas = page.getContent();
|
|
|
-//// for (AreaInfo area : areas) {
|
|
|
-//// Map<String, String> countMap = null;
|
|
|
-//// if (dcucWebConfig.getStatisticsRange().equals(UserAreaEnum.HZ_AREA.getValue())) {
|
|
|
-//// String areacode = area.getCode().substring(0, 2);
|
|
|
-//// countMap = iUserInfoFacade.countUserByArea(areacode, false, true);
|
|
|
-//// } else if (dcucWebConfig.getStatisticsRange().equals(UserAreaEnum.GD_AREA.getValue())) {
|
|
|
-//// String areacode = area.getCode().substring(0, 4);
|
|
|
-//// countMap = iUserInfoFacade.countUserByArea(areacode, false, false);
|
|
|
-//// }
|
|
|
-//// countMap.put("area", area.getName());
|
|
|
-//// result.add(countMap);
|
|
|
-//// }
|
|
|
-//// return result;
|
|
|
-//// }
|
|
|
-////
|
|
|
-//// /**
|
|
|
-//// * 导出列表
|
|
|
-//// *
|
|
|
-//// * @param searchDTO
|
|
|
-//// * @param request
|
|
|
-//// */
|
|
|
-//// @RequestMapping(value = "excel")
|
|
|
-//// public void listExport(Searchable searchable, HttpServletRequest request, HttpServletResponse response) {
|
|
|
-//// try {
|
|
|
-//// searchable.addSearchFilter("ranged",SearchOperator.eq,dcucWebConfig.getStatisticsRange());
|
|
|
-//// SearchDTO searchDTO = searchable.toSearchDTO();
|
|
|
-//// searchDTO.setSize(searchDTO.getTotal());
|
|
|
-//// searchDTO.setPage("1");
|
|
|
-//// List<Map<String, String>> result = new ArrayList<Map<String, String>>();
|
|
|
-//// Page<AreaInfo> page = iOrgInfoFacade.areaMap(searchDTO);
|
|
|
-//// List<AreaInfo> areas = page.getContent();
|
|
|
-//// for (AreaInfo area : areas) {
|
|
|
-//// String areacode = area.getCode().substring(0, 2);
|
|
|
-//// Map<String, String> countMap = iUserInfoFacade.countUserByArea(areacode, true, true);
|
|
|
-//// countMap.put("area", area.getName());
|
|
|
-//// result.add(countMap);
|
|
|
-//// }
|
|
|
-//// Map<String, String> countMap = iUserInfoFacade.countUserByArea(null, true, true);
|
|
|
-//// countMap.put("area", "总计");
|
|
|
-//// result.add(countMap);
|
|
|
-//// exportExcel("全国治安用户建设情况", result, Searchable.toSearchable(searchDTO).getMetaData(), request, response);
|
|
|
-//// } catch (IOException e) {
|
|
|
-//// logger.error(e.getMessage(), e);
|
|
|
-//// throw new ApplicationException(300, "导出失败", e);
|
|
|
-//// }
|
|
|
-//// }
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 组装树节点
|
|
|
-// *
|
|
|
-// * @param nodeList
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-// private List<OrgTreeNodeVo> treeNodeToVo(List<OrgTreeNode> nodeList) {
|
|
|
-// List<OrgTreeNodeVo> result = new ArrayList<>();
|
|
|
-// for (OrgTreeNode orgTreeNode : nodeList) {
|
|
|
-// OrgTreeNodeVo orgTreeNodeVo = new OrgTreeNodeVo();
|
|
|
-// orgTreeNodeVo.setId(orgTreeNode.getValue());
|
|
|
-// orgTreeNodeVo.setCode( orgTreeNode.getCode());
|
|
|
-// orgTreeNodeVo.setName(orgTreeNode.getLabel());
|
|
|
-// orgTreeNodeVo.setPid(orgTreeNode.getPid());
|
|
|
-// orgTreeNodeVo.setOrgNum(orgTreeNode.getCount());
|
|
|
-// orgTreeNodeVo.setUserNum(orgTreeNode.getUserNum());
|
|
|
-// orgTreeNodeVo.setPoliceUserCount(orgTreeNode.getPoliceNum());
|
|
|
-// orgTreeNodeVo.setAuxiliUserCount(orgTreeNode.getAuxiliaryNum());
|
|
|
-// orgTreeNodeVo.setExtcerUserCount(orgTreeNode.getExternalNum());
|
|
|
-// if (orgTreeNode.getChildIds() != null && orgTreeNode.getChildIds().size() > 0) {
|
|
|
-// orgTreeNodeVo.setIsParent(true);
|
|
|
-// } else {
|
|
|
-// orgTreeNodeVo.setIsParent(false);
|
|
|
-// }
|
|
|
-// result.add(orgTreeNodeVo);
|
|
|
-// }
|
|
|
-// return result;
|
|
|
-// }
|
|
|
-//}
|