0927cmt
zhaoyu 2024-02-06 14:46:35 +08:00
parent 3cfd300df0
commit 838b847571
3 changed files with 2 additions and 432 deletions

View File

@ -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<PageData> 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<Department> listSubDepartmentByParentId(String parentId) throws Exception;
/**
* ()
* @param MENU_ID
* @return
* @throws Exception
*/
public List<Department> listAllDepartment(String parentId) throws Exception;
/**
* ()
* @param MENU_ID
* @return
* @throws Exception
*/
public List<Department> listAllDepartment(String parentId,String url) throws Exception;
/**
* ()ztree
* @param MENU_ID
* @return
* @throws Exception
*/
public List<PageData> listAllDepartmentToSelect(String parentId, List<PageData> 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<PageData> listAll(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public PageData findByCorpId(PageData pd)throws Exception;
/**
* @param page
* @throws Exception
*/
public List<PageData> listForLevelName(Page page)throws Exception;
/**
*
* @param pd
* @return
*/
List<PageData> listTreeCorpDept(PageData pd)throws Exception;
/**
* +
* @param pd
* @return
* @throws Exception
*/
List<PageData> listTreeManageAndCorp(PageData pd)throws Exception;
/**
* pc IDservice
* @param pd
* @return
* @throws Exception
*/
List<PageData> listTreeManageAndCorpForPcPunishThePerson(PageData pd)throws Exception;
/**
*
* @param pd
* @return
* @throws Exception
*/
List<PageData> listTreeManageAndCorp1(PageData pd)throws Exception;
/**
*
* @param pd
* @return
* @throws Exception
*/
List<PageData> listTreeManageAndCorp2(PageData pd)throws Exception;
List<PageData> listTreeManageAndCorpHasOrder(PageData pd)throws Exception;
List<PageData> listDept(PageData pd)throws Exception;
public List<Department> listTreeCorp(String s)throws Exception;
/**
* 使
* pidid
* @param pd
* @return
* @throws Exception
*/
public List<PageData> getSonIdsByParid(PageData pd)throws Exception;
}

View File

@ -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<PageData> list(Page page)throws Exception{
return (List<PageData>)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<PageData> 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<Department> listSubDepartmentByParentId(String parentId) throws Exception {
return (List<Department>)departmentMapper.listSubDepartmentByParentId(parentId);
}
/**
* ()
* @return
* @throws Exception
*/
public List<Department> listAllDepartment(String parentId) throws Exception {
List<Department> 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<Department> listAllDepartment(String parentId,String url) throws Exception {
List<Department> 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<PageData> listAllDepartmentToSelect(String parentId,List<PageData> zdepartmentPdList) throws Exception {
List<PageData>[] arrayDep = this.listAllbyPd(parentId,zdepartmentPdList);
List<PageData> 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<PageData>[] listAllbyPd(String parentId,List<PageData> zdepartmentPdList) throws Exception {
List<Department> departmentList = this.listSubDepartmentByParentId(parentId);
List<PageData> departmentPdList = new ArrayList<PageData>();
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<PageData>[] 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<PageData> zdepartmentPdList = new ArrayList<PageData>();
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<PageData> listAll(PageData pd)throws Exception{
return (List<PageData>)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<PageData> listForLevelName(Page page) throws Exception {
// TODO Auto-generated method stub
return departmentMapper.forLevelNamedatalistPage(page);
}
@Override
public List<PageData> listTreeCorpDept(PageData pd) throws Exception {
return departmentMapper.listTreeCorpDept(pd);
}
@Override
public List<PageData> listTreeManageAndCorp(PageData pd) throws Exception {
return departmentMapper.listTreeManageAndCorp(pd);
}
@Override
public List<PageData> listTreeManageAndCorpForPcPunishThePerson(PageData pd) throws Exception {
return departmentMapper.listTreeManageAndCorpForPcPunishThePerson(pd);
}
@Override
public List<PageData> listTreeManageAndCorp1(PageData pd) throws Exception {
return departmentMapper.listTreeManageAndCorp1(pd);
}
@Override
public List<PageData> listTreeManageAndCorp2(PageData pd) throws Exception {
return departmentMapper.listTreeManageAndCorp2(pd);
}
@Override
public List<PageData> listTreeManageAndCorpHasOrder(PageData pd) throws Exception {
return departmentMapper.listTreeManageAndCorpHasOrder(pd);
}
@Override
public List<PageData> listDept(PageData pd) throws Exception {
return departmentMapper.listDept(pd);
}
/**
* ()
* @param MENU_ID
* @return
* @throws Exception
*/
public List<Department> listTreeCorp(String parentId) throws Exception {
List<Department> 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<PageData> getSonIdsByParid(PageData pd) throws Exception {
return departmentMapper.getSonIdsByParid(pd);
}
}

View File

@ -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) {