|
|
@ -1,6 +1,7 @@ |
|
|
|
package com.epmet.service.impl; |
|
|
|
|
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.constant.ReginConstant; |
|
|
|
import com.epmet.dao.CustomerHomeDao; |
|
|
|
import com.epmet.dao.CustomerHomeDetailDao; |
|
|
|
import com.epmet.dao.HomeComponentDao; |
|
|
@ -42,23 +43,30 @@ public class HomeServiceImpl implements HomeService { |
|
|
|
@Override |
|
|
|
public Result<HomeDesignByCustomerResultDTO> getHomeDesignByCustomer(HomeDesignByCustomerFormDTO formDTO) { |
|
|
|
HomeDesignByCustomerResultDTO resultDTO = new HomeDesignByCustomerResultDTO(); |
|
|
|
//根据客户id,所属端获取客户首页配置的设计稿
|
|
|
|
List<CommonComponentDesignResultDTO> list = customerHomeDetailDao.getCustomerHomeDetailComponent(formDTO); |
|
|
|
List<CommonComponentDesignResultDTO> flist=new ArrayList<CommonComponentDesignResultDTO>();//功能组件
|
|
|
|
List<String> usedComponent=new ArrayList<>();//使用的组件集合
|
|
|
|
List<CommonComponentDesignResultDTO> titlelist=new ArrayList<CommonComponentDesignResultDTO>(); |
|
|
|
List<CommonComponentDesignResultDTO> toplist=new ArrayList<CommonComponentDesignResultDTO>(); |
|
|
|
List<CommonComponentDesignResultDTO> functionlist=new ArrayList<CommonComponentDesignResultDTO>(); |
|
|
|
List<CommonComponentDesignResultDTO> floatlist=new ArrayList<CommonComponentDesignResultDTO>(); |
|
|
|
List<String> usedComponent=new ArrayList<>();//使用过的组件集合
|
|
|
|
for(CommonComponentDesignResultDTO c:list){ |
|
|
|
usedComponent.add(c.getComponentId()); |
|
|
|
//所属区域:0.标题区、1.置顶区、2.功能区、3.悬浮区
|
|
|
|
if("0".equals(c.getRegion())){ |
|
|
|
resultDTO.setTitleList(c); |
|
|
|
}else if("1".equals(c.getRegion())){ |
|
|
|
resultDTO.setTopList(c); |
|
|
|
}else if("2".equals(c.getRegion())){ |
|
|
|
flist.add(c); |
|
|
|
}else if("3".equals(c.getRegion())){ |
|
|
|
resultDTO.setFloatingList(c); |
|
|
|
if(ReginConstant.titleList.equals(c.getRegion())){ |
|
|
|
titlelist.add(c); |
|
|
|
}else if(ReginConstant.topList.equals(c.getRegion())){ |
|
|
|
toplist.add(c); |
|
|
|
}else if(ReginConstant.functionList.equals(c.getRegion())){ |
|
|
|
functionlist.add(c); |
|
|
|
}else if(ReginConstant.floatingList.equals(c.getRegion())){ |
|
|
|
floatlist.add(c); |
|
|
|
} |
|
|
|
} |
|
|
|
resultDTO.setFunctionList(flist); |
|
|
|
resultDTO.setTitleList(titlelist); |
|
|
|
resultDTO.setTopList(toplist); |
|
|
|
resultDTO.setFloatingList(floatlist); |
|
|
|
resultDTO.setFunctionList(functionlist); |
|
|
|
resultDTO.setUsedComponentIdList(usedComponent); |
|
|
|
return new Result<HomeDesignByCustomerResultDTO>().ok(resultDTO); |
|
|
|
} |
|
|
|