|
|
|
|
@ -20,6 +20,7 @@ import com.flossom.system.service.ISysDeptService;
|
|
|
|
|
import com.flossom.system.service.ISysTagService;
|
|
|
|
|
import com.flossom.system.service.IWxScriptTagService;
|
|
|
|
|
import com.flossom.system.service.IWxUserTagService;
|
|
|
|
|
import org.apache.commons.compress.utils.Lists;
|
|
|
|
|
import org.apache.commons.lang3.ArrayUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
@ -194,7 +195,27 @@ public class SysTagController extends BaseController {
|
|
|
|
|
List<WxUserTag> wxUserTags = userTagService.selectWxUserTagList(userTag);
|
|
|
|
|
sysTag.setTagUsers(wxUserTags.size());
|
|
|
|
|
}
|
|
|
|
|
// 数据填充好后,处理排序
|
|
|
|
|
List<SysTag> topTagList = Lists.newArrayList();
|
|
|
|
|
List<SysTag> secondTagList = Lists.newArrayList();
|
|
|
|
|
for (SysTag sysTag: list) {
|
|
|
|
|
if(sysTag.getParentId() == 0) {
|
|
|
|
|
topTagList.add(sysTag);
|
|
|
|
|
} else {
|
|
|
|
|
secondTagList.add(sysTag);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 构建新的数组
|
|
|
|
|
List<SysTag> resultList = Lists.newArrayList();
|
|
|
|
|
ExcelUtil<SysTag> util = new ExcelUtil<SysTag>(SysTag.class);
|
|
|
|
|
util.exportExcel(response, list, sheetName);
|
|
|
|
|
for(SysTag topTag : topTagList) {
|
|
|
|
|
resultList.add(topTag);
|
|
|
|
|
for (SysTag secondTag : secondTagList) {
|
|
|
|
|
if (String.valueOf(secondTag.getParentId()).equals(String.valueOf(topTag.getId())) ) {
|
|
|
|
|
resultList.add(secondTag);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
util.exportExcel(response, resultList, sheetName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|