添加样式并写出相应代码
要求是这样的:
参考以下代码:
/**
* 查询审核列表
*
* @return
*/
@RequestMapping(params = "method=findCheckList")
public String findCheckList(HttpServletRequest request,
ModelMap modelMap,
AssetsDeleteQuery assetsDeleteQuery,String page, String pagesize,String assetsTypeIdtxt,HttpServletResponse response) throws Exception {
findApply(request, modelMap, assetsDeleteQuery);
User user = (User) request.getSession().getAttribute("user");
if (pagesize != null && !"".equals(pagesize)) {
len = Integer.parseInt(pagesize);
//存入cookie
Cookie cookie = new Cookie(user.getId(), pagesize);
response.addCookie(cookie);
} else {
//用cookie得到用户名
Cookie[] cookies = request.getCookies();
if (cookies != null && cookies.length > 0) {
for (Cookie c : cookies) {
if (c.getName().equals(user.getId())) {
len = Integer.parseInt(c.getValue());
}
}
}
}
if (page != null && !"".equals(page)) {
pageNum = Integer.parseInt(page);
} else {
pageNum = 1;
}
// 下级
List<BaseCode> xiaJi = new ArrayList();
// 下级的下级
List<BaseCode> xiaJiNextJi = new ArrayList();
// 合并
List<BaseCode> allZCLB = new ArrayList<>();
String zclbId = assetsDeleteQuery.getAssetsTypeId();
if (!"".equals(zclbId) && null != zclbId) {
// 查询出所有的资产类别(经营性资产类别,非经营性资产)
List<BaseCode> baseCodeList = baseCodeService.findBaseCodeByType2("ZCLBJYX", "ZCLBFJYX");
// 根据页面传过来的资产类型Id查询到下级
for (int i = 0; i < baseCodeList.size(); i++) {
// parent不为空的情况下
if (!"".equals(baseCodeList.get(i).getParentId()) && null != baseCodeList.get(i).getParentId()) {
// 页面传过来的id与资产类别的parent对比,如果相等,就是他的下级,否则没有下级
if (zclbId.equals(baseCodeList.get(i).getParentId().getId())) {
xiaJi.add(baseCodeList.get(i));
}
}
}
// 如果nextJi.size()>0 表示他有下级
if (xiaJi.size() > 0) {
// 通过下级的id继续查询下级的下级
for (int i = 0; i < xiaJi.size(); i++) {
for (int j = 0; j < baseCodeList.size(); j++) {
if (!"".equals(baseCodeList.get(j).getParentId()) && null != baseCodeList.get(j).getParentId()) {
if (xiaJi.get(i).getId().equals(baseCodeList.get(j).getParentId().getId())) {
xiaJiNextJi.add(baseCodeList.get(j));
}
}
}
}
}
if (xiaJi.size() > 0) {
allZCLB.addAll(xiaJi);
}
if (xiaJiNextJi.size() > 0) {
allZCLB.addAll(xiaJiNextJi);
}
assetsDeleteQuery.setBaseCodeList(allZCLB);
}
if (assetsDeleteQuery.getUnitid() != null && !"".equals(assetsDeleteQuery.getUnitid())) {
assetsDeleteQuery.setUnitId(assetsDeleteQuery.getUnitid());
}
assetsDeleteQuery.setNeedFindZu(Constant.YES);
unitService.getQueryUnit(assetsDeleteQuery, request);
CommonTreeDto commonTreeDto=assetsDeleteQuery.getCommonTreeDto();
if(commonTreeDto==null){
commonTreeDto=new CommonTreeDto();
Dept dept = user.getDept();
Unit areaId = dept.getAreaId();
commonTreeDto.setUnitId(areaId.getId());
commonTreeDto.setAllpath(areaId.getAllPath());
commonTreeDto.setLevel(areaId.getLevel()+"");
commonTreeDto.setType("dq");
commonTreeDto.setName(areaId.getAreaName());
}
commonTreeDto.setDataDeptId("");
commonTreeDto.setUser(user);
assetsDeleteQuery.setCommonTreeDto(commonTreeDto);
String unitList=commonTreeService.buildCurrentUserTree(request,null);
PageControl applyList = assetsDeleteService.findCheckListNew(pageNum, len,assetsDeleteQuery);
String zcTypeList = baseCodeService.findBaseCodeJson2("ZCLBJYX", "ZCLBFJYX");
List<BaseCode> QCFSList = baseCodeService.findBaseCodeByType("ZCJSFS");
modelMap.addAttribute("QCFSList", QCFSList);
modelMap.addAttribute("zcTypeList", zcTypeList);
modelMap.addAttribute("pc", applyList);
modelMap.addAttribute("unitList", unitList);
modelMap.addAttribute("query",assetsDeleteQuery);
return "sanzgl/zichanggl/zcbd/check_list";
}
,在以下代码中添加功能代码:
/**
* 资产购入审核-列表
* @param request
* @param modelMap
* @param assetsPurchaseQuery
* @return
* @throws Exception
*/
@RequestMapping(params = "method=findCheck")
public String findCheck(HttpServletRequest request, ModelMap modelMap,
AssetsPurchaseQuery assetsPurchaseQuery,
String page, String pagesize,
String assetsTypeIdtxt, HttpServletResponse response) throws Exception {
User user = (User) request.getSession().getAttribute("user");
if(user == null){
return "login";
}
//待办事项处理,列表自动选择待办事项中点击的地区
HttpSession s = request.getSession();
String dbsx_unitId= (String) s.getAttribute("dbsx_unitId");
String dbsx_unitName= (String) s.getAttribute("dbsx_unitName");
String dbsx_allPath= (String) s.getAttribute("dbsx_allPath");
boolean useDb=false;
if(Util.n(assetsPurchaseQuery.getUnitid())&&!Util.n(dbsx_allPath)){
useDb=true;
s.removeAttribute("dbsx_unitId");
s.removeAttribute("dbsx_unitName");
s.removeAttribute("dbsx_allPath");
}
assetsPurchaseQuery.setNeedFindZu(Constant.YES);
CommonTreeDto commonTreeDto = assetsPurchaseQuery.getCommonTreeDto();
if(commonTreeDto==null){
commonTreeDto=new CommonTreeDto();
Dept dept = user.getDept();
Unit areaId = dept.getAreaId();
commonTreeDto.setUnitId(areaId.getId());
commonTreeDto.setAllpath(areaId.getAllPath());
commonTreeDto.setLevel(areaId.getLevel()+"");
commonTreeDto.setType("dq");
commonTreeDto.setName(areaId.getAreaName());
}
commonTreeDto.setDataDeptId("");
commonTreeDto.setUser(user);
assetsPurchaseQuery.setCommonTreeDto(commonTreeDto);
String unitList = commonTreeService.buildCurrentUserTree(request,null);
formatParam(assetsPurchaseQuery);
modelMap.addAttribute("unitList", unitList);
if(useDb){
assetsPurchaseQuery.setAllpathList(Arrays.asList(dbsx_allPath));
assetsPurchaseQuery.setUnitName(dbsx_unitName);
assetsPurchaseQuery.setUnitid(dbsx_unitId);
}
modelMap.addAttribute("pc", assetsPurchaseService.findCheck(assetsPurchaseQuery));
modelMap.addAttribute("query", assetsPurchaseQuery);
modelMap.addAttribute("user", user);
return "sanzgl/zichanggl/zcgz/find_check";
}
,其中,
我添加了这两个参数,也不知道对不对,求老哥们指点,有偿