qa-prevention-gwj/src/main/java/com/zcloud/controller/app/AppRegulatoryUsersControlle...

110 lines
3.8 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package com.zcloud.controller.app;
import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.entity.system.Department;
import com.zcloud.entity.system.Dictionaries;
import com.zcloud.entity.system.Role;
import com.zcloud.service.bus.*;
import com.zcloud.service.system.*;
import com.zcloud.util.*;
import net.sf.json.JSONArray;
import org.apache.commons.collections.map.ListOrderedMap;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.crypto.hash.SimpleHash;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.util.*;
/**
* 说明:获取港股公司部门人员信息
* 作者luoxiaobao
* 官网www.qdkjchina.com
*/
@Controller
@RequestMapping("/app/regulatory/user")
public class AppRegulatoryUsersController extends BaseController {
@Autowired
private RegulatoryUsersService regulatoryUsersService;
/**
* 显示列表ztree
* @return
*/
@RequestMapping(value="/deptListTree")
@ResponseBody
public Object listTree()throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData dept=regulatoryUsersService.getDeptByShares(pd).get(0);;
PageData depar = new PageData();
depar.put("DEPARTMENT_ID",dept.get("DEPARTMENT_ID"));
depar.put("PARENT_ID",dept.get("PARENT_ID"));
depar.put("NAME",dept.get("NAME"));
depar.put("subDepartment",regulatoryUsersService.listAllDepartment(depar.get("DEPARTMENT_ID").toString()));
// depar.setDEPARTMENT_ID(dept.getDEPARTMENT_ID());
// depar.setPARENT_ID(dept.getPARENT_ID());
// depar.setNAME(dept.getNAME());
// depar.setSubDepartment(regulatoryUsersService.listAllDepartment(depar.getDEPARTMENT_ID()));
List<PageData> zdepartmentPdList = new ArrayList<PageData>();
zdepartmentPdList.add(depar);
// zdepartmentPdList.addAll(departmentService.listAllDepartment(ZDEPARTMENT_ID));
JSONArray arr = JSONArray.fromObject(zdepartmentPdList);
String json = arr.toString();
json = json.replaceAll("DEPARTMENT_ID", "id").replaceAll("NAME", "name").replaceAll("subDepartment", "children");
map.put("zTreeNodes", json);
map.put("result", errInfo);
return map;
}
/**列表
* @param page
* @throws Exception
*/
@RequestMapping(value="/listUser")
@ResponseBody
public Object listAll() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
List<PageData> userList = regulatoryUsersService.listAllUser(pd); //列出Post列表
map.put("userList", userList);
map.put("result", errInfo);
return map;
}
/**
* 显示列表ztree
* @return
*/
@RequestMapping(value="/departListTree")
@ResponseBody
public Object departListTree()throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
JSONArray arr = JSONArray.fromObject(regulatoryUsersService.listAllDepartment("0"));
String json = arr.toString();
json = json.replaceAll("DEPARTMENT_ID", "id").replaceAll("PARENT_ID", "pId").replaceAll("NAME", "name").replaceAll("subDepartment", "nodes").replaceAll("hasDepartment", "checked").replaceAll("treeurl", "url");
map.put("zTreeNodes", json);
map.put("result", errInfo);
return map;
}
}