主管部门单选变多选
parent
cf538631ff
commit
a255cf3044
|
@ -1,8 +1,12 @@
|
||||||
package com.zcloud.controller.xgf;
|
package com.zcloud.controller.xgf;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.zcloud.entity.Page;
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.service.bus.CorpInfoService;
|
||||||
|
import com.zcloud.service.system.DepartmentService;
|
||||||
import com.zcloud.util.ObjectExcelView;
|
import com.zcloud.util.ObjectExcelView;
|
||||||
import net.sf.json.JSONArray;
|
import net.sf.json.JSONArray;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
@ -20,6 +24,8 @@ import com.zcloud.util.HttpClientService;
|
||||||
import com.zcloud.util.Jurisdiction;
|
import com.zcloud.util.Jurisdiction;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/xgf/corp")
|
@RequestMapping("/xgf/corp")
|
||||||
public class XgfCorpController extends BaseController {
|
public class XgfCorpController extends BaseController {
|
||||||
|
@ -31,6 +37,9 @@ public class XgfCorpController extends BaseController {
|
||||||
@Value("${qa-regulatory-gwj.api.url}")
|
@Value("${qa-regulatory-gwj.api.url}")
|
||||||
private String regulatoryUrl;
|
private String regulatoryUrl;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DepartmentService departmentService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 相关方单位账号管理-列表
|
* 相关方单位账号管理-列表
|
||||||
*
|
*
|
||||||
|
@ -53,6 +62,15 @@ public class XgfCorpController extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Map result = HttpClientService.doPost(url + "/api/corpinfo/JiTuanTeShulist", pd);
|
Map result = HttpClientService.doPost(url + "/api/corpinfo/JiTuanTeShulist", pd);
|
||||||
|
// created by liu jun (为了不在相关方连表查询,只能在这里这么写,兼容老数据)
|
||||||
|
List<HashMap> list = (List<HashMap> )result.get("varList");
|
||||||
|
for (HashMap x : list) {
|
||||||
|
if (x.get("MAIN_DEPARTMENT") != null && x.get("MAIN_DEPARTMENT").toString().contains("]")) {
|
||||||
|
List<String> departmentIds = JSONObject.parseObject(x.get("MAIN_DEPARTMENT").toString(),List.class);
|
||||||
|
List<PageData> departmentList = departmentService.getCorpDepartmentByIds(departmentIds);
|
||||||
|
x.put("MAIN_DEPARTMENT_NAME", departmentList.stream().map(n -> n.getString("NAME")).collect(Collectors.joining(",")));
|
||||||
|
}
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -183,5 +183,7 @@ public interface DepartmentMapper{
|
||||||
PageData findByCorpDepartmentId(PageData condition);
|
PageData findByCorpDepartmentId(PageData condition);
|
||||||
|
|
||||||
List<PageData> listTreeManageAndCorp(PageData pd);
|
List<PageData> listTreeManageAndCorp(PageData pd);
|
||||||
|
|
||||||
|
List<PageData> getCorpDepartmentByIds(List<String> departmentList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -231,5 +231,7 @@ public interface DepartmentService{
|
||||||
List<Department> listAllCorpDepartment(String number) throws Exception;
|
List<Department> listAllCorpDepartment(String number) throws Exception;
|
||||||
|
|
||||||
PageData getCorpDepartment(PageData condition) throws Exception;
|
PageData getCorpDepartment(PageData condition) throws Exception;
|
||||||
|
|
||||||
|
List<PageData> getCorpDepartmentByIds(List<String> departmentList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -441,6 +441,11 @@ public class DepartmentServiceImpl implements DepartmentService{
|
||||||
return departmentMapper.findByCorpDepartmentId(condition);
|
return departmentMapper.findByCorpDepartmentId(condition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PageData> getCorpDepartmentByIds(List<String> departmentList) {
|
||||||
|
return departmentMapper.getCorpDepartmentByIds(departmentList);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过ID获取其子级列表
|
* 通过ID获取其子级列表
|
||||||
* @param parentId
|
* @param parentId
|
||||||
|
|
|
@ -627,4 +627,11 @@
|
||||||
(COR_ORDER+0) asc,
|
(COR_ORDER+0) asc,
|
||||||
NAME,DEP_ORDER asc
|
NAME,DEP_ORDER asc
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getCorpDepartmentByIds" parameterType="List" resultType="pd" >
|
||||||
|
select * from `qa-gwj-regulatory`.SYS_DEPARTMENT
|
||||||
|
where DEPARTMENT_ID in
|
||||||
|
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue