From 838b8475711ae530986a5da43ba1c271449c5426 Mon Sep 17 00:00:00 2001 From: zhaoyu Date: Tue, 6 Feb 2024 14:46:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/map/CorpDepartmentService.java | 164 ----------- .../map/impl/CorpDepartmentServiceImpl.java | 267 ------------------ .../java/com/zcloud/util/CzksPerLocUtil.java | 3 +- 3 files changed, 2 insertions(+), 432 deletions(-) delete mode 100644 src/main/java/com/zcloud/service/map/CorpDepartmentService.java delete mode 100644 src/main/java/com/zcloud/service/map/impl/CorpDepartmentServiceImpl.java diff --git a/src/main/java/com/zcloud/service/map/CorpDepartmentService.java b/src/main/java/com/zcloud/service/map/CorpDepartmentService.java deleted file mode 100644 index a775ca28..00000000 --- a/src/main/java/com/zcloud/service/map/CorpDepartmentService.java +++ /dev/null @@ -1,164 +0,0 @@ -package com.zcloud.service.map; - -import com.zcloud.entity.Page; -import com.zcloud.entity.PageData; -import com.zcloud.entity.system.Department; - -import java.util.List; - -/** - * 说明: 组织机构接接口 - * 创建人:FH Q313596790 - * 官网: - */ -public interface CorpDepartmentService { - - /**新增 - * @param pd - * @throws Exception - */ - public void save(PageData pd)throws Exception; - - /**删除 - * @param pd - * @throws Exception - */ - public void delete(PageData pd)throws Exception; - - /**修改 - * @param pd - * @throws Exception - */ - public void edit(PageData pd)throws Exception; - - /**列表 - * @param page - * @throws Exception - */ - public List list(Page page)throws Exception; - - /**通过id获取数据 - * @param pd - * @throws Exception - */ - public PageData findById(PageData pd)throws Exception; - /**通过名称获取数据 - * @param pd - * @throws Exception - */ - public PageData findByName(PageData pd)throws Exception; - - /**通过编码获取数据 - * @param pd - * @throws Exception - */ - public PageData findByBianma(PageData pd)throws Exception; - - /** - * 通过ID获取其子级列表 - * @param parentId - * @return - * @throws Exception - */ - public List listSubDepartmentByParentId(String parentId) throws Exception; - - /** - * 获取所有数据并填充每条数据的子级列表(递归处理) - * @param MENU_ID - * @return - * @throws Exception - */ - public List listAllDepartment(String parentId) throws Exception; - - /** - * 获取所有数据并填充每条数据的子级列表(递归处理) - * @param MENU_ID - * @return - * @throws Exception - */ - public List listAllDepartment(String parentId,String url) throws Exception; - - /** - * 获取所有数据并填充每条数据的子级列表(递归处理)下拉ztree用 - * @param MENU_ID - * @return - * @throws Exception - */ - public List listAllDepartmentToSelect(String parentId, List zdepartmentPdList) throws Exception; - - /**获取某个部门所有下级部门ID(返回拼接字符串 in的形式) - * @param DEPARTMENT_ID - * @return - * @throws Exception - */ - public String getDEPARTMENT_IDS(String DEPARTMENT_ID) throws Exception; - - /**通过条件获取全部 - * @param pd - * @throws Exception - */ - public List listAll(PageData pd)throws Exception; - - /**通过企业主部门 - * @param pd - * @throws Exception - */ - public PageData findByCorpId(PageData pd)throws Exception; - /**列表 关联 部门级别名称 - * @param page - * @throws Exception - */ - public List listForLevelName(Page page)throws Exception; - - /** - * 向下递归查询企业部门 - * @param pd - * @return - */ - List listTreeCorpDept(PageData pd)throws Exception; - - /** - * 向下递归查询企业部门(集团部门+子公司部门) - * @param pd - * @return - * @throws Exception - */ - List listTreeManageAndCorp(PageData pd)throws Exception; - - /** - * pc新增需求,重点工程中添加处罚人功能所用的 根据企业ID查询部门的service - * @param pd - * @return - * @throws Exception - */ - List listTreeManageAndCorpForPcPunishThePerson(PageData pd)throws Exception; - /** - * 向下递归查询企业部门(只查监管端部门) - * @param pd - * @return - * @throws Exception - */ - List listTreeManageAndCorp1(PageData pd)throws Exception; - /** - * 向下递归查询企业部门(只查企业端部门) - * @param pd - * @return - * @throws Exception - */ - List listTreeManageAndCorp2(PageData pd)throws Exception; - - List listTreeManageAndCorpHasOrder(PageData pd)throws Exception; - List listDept(PageData pd)throws Exception; - - public List listTreeCorp(String s)throws Exception; - - /** - * 使用数据库中的函数 - * 获取pid下的所有子集id - * @param pd - * @return - * @throws Exception - */ - public List getSonIdsByParid(PageData pd)throws Exception; -} - diff --git a/src/main/java/com/zcloud/service/map/impl/CorpDepartmentServiceImpl.java b/src/main/java/com/zcloud/service/map/impl/CorpDepartmentServiceImpl.java deleted file mode 100644 index 41b9b2f5..00000000 --- a/src/main/java/com/zcloud/service/map/impl/CorpDepartmentServiceImpl.java +++ /dev/null @@ -1,267 +0,0 @@ -package com.zcloud.service.map.impl; - -import com.zcloud.entity.Page; -import com.zcloud.entity.PageData; -import com.zcloud.entity.system.Department; -import com.zcloud.mapper.datasource.system.DepartmentMapper; -import com.zcloud.service.map.CorpDepartmentService; -import com.zcloud.util.Tools; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.ArrayList; -import java.util.List; - -/** - * 说明: 组织机构 - * 创建人:FH Q313596790 - * 官网: - */ -@Service(value="corpDepartmentService") -@Transactional //开启事物 -public class CorpDepartmentServiceImpl implements CorpDepartmentService { - - @Autowired - private DepartmentMapper departmentMapper; - - /**新增 - * @param pd - * @throws Exception - */ - public void save(PageData pd)throws Exception{ - departmentMapper.save(pd); - } - - /**删除 - * @param pd - * @throws Exception - */ - public void delete(PageData pd)throws Exception{ - departmentMapper.delete(pd); - } - - /**修改 - * @param pd - * @throws Exception - */ - public void edit(PageData pd)throws Exception{ - departmentMapper.edit(pd); - } - - /**列表 - * @param page - * @throws Exception - */ - public List list(Page page)throws Exception{ - return (List)departmentMapper.datalistPage(page); - } - - /**通过id获取数据 - * @param pd - * @throws Exception - */ - public PageData findById(PageData pd)throws Exception{ - return (PageData)departmentMapper.findById(pd); - } - /**通过名称获取数据 - * @param pd - * @throws Exception - */ - public PageData findByName(PageData pd)throws Exception{ - List dept = departmentMapper.findByName(pd); - if(dept != null && dept.size() > 0) { - return dept.get(0); - } else { - return null; - } - - } - - /**通过编码获取数据 - * @param pd - * @throws Exception - */ - public PageData findByBianma(PageData pd)throws Exception{ - return (PageData)departmentMapper.findByBianma(pd); - } - - /** - * 通过ID获取其子级列表 - * @param parentId - * @return - * @throws Exception - */ - public List listSubDepartmentByParentId(String parentId) throws Exception { - return (List)departmentMapper.listSubDepartmentByParentId(parentId); - } - - /** - * 获取所有数据并填充每条数据的子级列表(递归处理) - * @return - * @throws Exception - */ - public List listAllDepartment(String parentId) throws Exception { - List departmentList = this.listSubDepartmentByParentId(parentId); - for(Department depar : departmentList){ - depar.setTreeurl("department_list.html?DEPARTMENT_ID="+depar.getDEPARTMENT_ID()); - depar.setSubDepartment(this.listAllDepartment(depar.getDEPARTMENT_ID())); - depar.setTarget("treeFrame"); - depar.setIcon("../../../assets/images/user.gif"); - } - return departmentList; - } - - /** - * 获取所有数据并填充每条数据的子级列表(递归处理) - * @return - * @throws Exception - */ - public List listAllDepartment(String parentId,String url) throws Exception { - List departmentList = this.listSubDepartmentByParentId(parentId); - for(Department depar : departmentList){ - depar.setTreeurl(url+depar.getDEPARTMENT_ID()); - depar.setSubDepartment(this.listAllDepartment(depar.getDEPARTMENT_ID(),url)); - depar.setTarget("treeFrame"); - depar.setIcon("../../../assets/images/user.gif"); - } - return departmentList; - } - - /** - * 获取所有数据并填充每条数据的子级列表(递归处理)下拉ztree用 - * @return - * @throws Exception - */ - public List listAllDepartmentToSelect(String parentId,List zdepartmentPdList) throws Exception { - List[] arrayDep = this.listAllbyPd(parentId,zdepartmentPdList); - List departmentPdList = arrayDep[1]; - for(PageData pd : departmentPdList){ - this.listAllDepartmentToSelect(pd.getString("id"),arrayDep[0]); - } - return arrayDep[0]; - } - - /**下拉ztree用 - * @param parentId - * @return - * @throws Exception - */ - @SuppressWarnings("unchecked") - public List[] listAllbyPd(String parentId,List zdepartmentPdList) throws Exception { - List departmentList = this.listSubDepartmentByParentId(parentId); - List departmentPdList = new ArrayList(); - for(Department depar : departmentList){ - PageData pd = new PageData(); - pd.put("id", depar.getDEPARTMENT_ID()); - pd.put("parentId", depar.getPARENT_ID()); - pd.put("name", depar.getNAME()); - pd.put("icon", "../../../assets/images/user.gif"); - departmentPdList.add(pd); - zdepartmentPdList.add(pd); - } - List[] arrayDep = new List[2]; - arrayDep[0] = zdepartmentPdList; - arrayDep[1] = departmentPdList; - return arrayDep; - } - - /**获取某个部门所有下级部门ID(返回拼接字符串 in的形式, ('a','b','c')) - * @param DEPARTMENT_ID - * @return - * @throws Exception - */ - public String getDEPARTMENT_IDS(String DEPARTMENT_ID) throws Exception { - DEPARTMENT_ID = Tools.notEmpty(DEPARTMENT_ID)?DEPARTMENT_ID:"0"; - List zdepartmentPdList = new ArrayList(); - zdepartmentPdList = this.listAllDepartmentToSelect(DEPARTMENT_ID,zdepartmentPdList); - StringBuffer sb = new StringBuffer(); - sb.append(""); - for(PageData dpd : zdepartmentPdList){ - sb.append(dpd.getString("id")); - sb.append(","); - } - sb.append("'fh'"); - return sb.toString(); - } - - /**通过条件获取全部 - * @param pd - * @throws Exception - */ - public List listAll(PageData pd)throws Exception{ - return (List)departmentMapper.listAll(pd); - } - - /**通过企业主部门 - * @param pd - * @throws Exception - */ - public PageData findByCorpId(PageData pd)throws Exception{ - return departmentMapper.findByCorpId(pd); - } - /**列表 关联 部门级别名称 - * @param page - * @throws Exception - */ - @Override - public List listForLevelName(Page page) throws Exception { - // TODO Auto-generated method stub - return departmentMapper.forLevelNamedatalistPage(page); - } - - @Override - public List listTreeCorpDept(PageData pd) throws Exception { - return departmentMapper.listTreeCorpDept(pd); - } - - @Override - public List listTreeManageAndCorp(PageData pd) throws Exception { - return departmentMapper.listTreeManageAndCorp(pd); - } - @Override - public List listTreeManageAndCorpForPcPunishThePerson(PageData pd) throws Exception { - return departmentMapper.listTreeManageAndCorpForPcPunishThePerson(pd); - } - @Override - public List listTreeManageAndCorp1(PageData pd) throws Exception { - return departmentMapper.listTreeManageAndCorp1(pd); - } - @Override - public List listTreeManageAndCorp2(PageData pd) throws Exception { - return departmentMapper.listTreeManageAndCorp2(pd); - } - @Override - public List listTreeManageAndCorpHasOrder(PageData pd) throws Exception { - return departmentMapper.listTreeManageAndCorpHasOrder(pd); - } - - - @Override - public List listDept(PageData pd) throws Exception { - return departmentMapper.listDept(pd); - } - - /** - * 获取所有数据并填充每条数据的子级列表(递归处理) - * @param MENU_ID - * @return - * @throws Exception - */ - public List listTreeCorp(String parentId) throws Exception { - List departmentList = this.listSubDepartmentByParentId(parentId); - for(Department depar : departmentList){ - depar.setTreeurl("department_list.html?DEPARTMENT_ID="+depar.getDEPARTMENT_ID()); - depar.setSubDepartment(this.listTreeCorp(depar.getDEPARTMENT_ID())); - depar.setTarget("treeFrame"); - depar.setIcon("../../../assets/images/user.gif"); - } - return departmentList; - } - - public List getSonIdsByParid(PageData pd) throws Exception { - return departmentMapper.getSonIdsByParid(pd); - } - -} - diff --git a/src/main/java/com/zcloud/util/CzksPerLocUtil.java b/src/main/java/com/zcloud/util/CzksPerLocUtil.java index 0414b2a1..aa7f6112 100644 --- a/src/main/java/com/zcloud/util/CzksPerLocUtil.java +++ b/src/main/java/com/zcloud/util/CzksPerLocUtil.java @@ -35,7 +35,8 @@ public class CzksPerLocUtil { JSONObject request = new JSONObject(); request.put("pageNum", 1); request.put("pageSize", 10); - String httpResponseStr = HttpRequestUtil.doPost(perLocToken, perLocUrl + "/system/menu/menuTree",request.toJSONString()); + String httpResponseStr = ""; + //String httpResponseStr = HttpRequestUtil.doPost(perLocToken, perLocUrl + "/system/menu/menuTree",request.toJSONString()); JSONObject httpResponse = JSONObject.parseObject(httpResponseStr); // token 有效 if (Tools.notEmpty(httpResponseStr) && httpResponse != null && httpResponse.get("code") != null && httpResponse.getInteger("code") == 200) {