Commit 3b7d0076 by ilal Committed by chenzg

提交

parent 58fd3a31
......@@ -229,6 +229,28 @@ public class ClockInTool {
return strArrLast;
}
/***
* 去除String数组中的空值
*/
public static String[] deleteArrayNull2(String string[]) {
String strArr[] = string;
// step1: 定义一个list列表,并循环赋值
ArrayList<String> strList = new ArrayList<String>();
for (int i = 0; i < strArr.length; i++) {
strList.add(strArr[i]);
}
// step2: 删除list列表中所有的空值
while (strList.remove(null));
// while (strList.remove(""));
// step3: 把list列表转换给一个新定义的中间数组,并赋值给它
String strArrLast[] = strList.toArray(new String[strList.size()]);
return strArrLast;
}
public static Date strToDateLong(String strDate) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
ParsePosition pos = new ParsePosition(0);
......
......@@ -34,6 +34,8 @@ import cn.hutool.core.lang.tree.TreeUtil;
import cn.hutool.core.util.StrUtil;
import cn.timer.api.aspect.lang.annotation.Log;
import cn.timer.api.aspect.lang.enums.BusinessType;
import cn.timer.api.bean.admin.AdminMenuTemplate;
import cn.timer.api.bean.qyzx.QyzxAdminMenu;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.bean.zzgl.ZzglAuth;
import cn.timer.api.bean.zzgl.ZzglBmgwM;
......@@ -42,12 +44,14 @@ import cn.timer.api.bean.zzgl.ZzglPostMenu;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.enuminterface.YgEnumInterface;
import cn.timer.api.controller.kqgl.ClockInTool;
import cn.timer.api.controller.zzgl.service.ZzglBmgwMService;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dao.zzgl.ZzglLogDgjlMapper;
import cn.timer.api.dao.zzgl.ZzglMenuMapper;
import cn.timer.api.dao.zzgl.ZzglPostMenuMapper;
import cn.timer.api.dto.qyzx.MenuStructureDto;
import cn.timer.api.dto.zzgl.DepartmentStaffDto;
import cn.timer.api.dto.zzgl.LogDgjlsDto;
import cn.timer.api.dto.zzgl.LogDgjlsQueryDto;
......@@ -412,7 +416,75 @@ public class ZzglController {
wp.select(ZzglAuth::getMenuId, ZzglAuth::getBmgwId).eq(ZzglAuth::getOrgCode, orgCode)
.and(i -> i.in(ZzglAuth::getBmgwId, list.toArray()));
List<ZzglAuth> zas = ZzglAuth.builder().build().selectList(wp);
return ResultUtil.data(zas);
List<MenuStructureDto> mestrs = new ArrayList<MenuStructureDto>();
List<QyzxAdminMenu> qyme = QyzxAdminMenu.builder().build().selectList(new QueryWrapper<QyzxAdminMenu>().lambda().eq(QyzxAdminMenu::getOrgCode, userBean.getOrgCode()).orderByAsc(QyzxAdminMenu::getSortNumber));
String[] zdy = new String[qyme.size()];
int i = 0;
for(QyzxAdminMenu me : qyme) {
MenuStructureDto metr = MenuStructureDto.builder().build();
metr.setMenuCode(me.getMenuCode());
metr.setMenuName(me.getMenuName());
metr.setSortNumber(me.getSortNumber());
AdminMenuTemplate adte = AdminMenuTemplate.builder().build().selectOne(new QueryWrapper<AdminMenuTemplate>().lambda().eq(AdminMenuTemplate::getMenuCode, me.getMenuCode()));
metr.setPath(adte.getPath());
mestrs.add(metr);
zdy[i] = me.getMenuCode();
i++;
}
//
List<AdminMenuTemplate> adtes = AdminMenuTemplate.builder().build().selectList(new QueryWrapper<AdminMenuTemplate>().lambda().eq(AdminMenuTemplate::getEnable, 1).orderByAsc(AdminMenuTemplate::getSortNumber));
for(AdminMenuTemplate adm : adtes) {
if(!ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(zdy), adm.getMenuCode())) {
if(adm.getDistribution() == 0 && userBean.getOrgCode() == 3) {
MenuStructureDto metr = MenuStructureDto.builder().build();
metr.setMenuCode(adm.getMenuCode());
metr.setMenuName(adm.getMenuName());
metr.setSortNumber(adm.getSortNumber());
metr.setPath(adm.getPath());
mestrs.add(metr);
}else if(adm.getDistribution() == 1) {
MenuStructureDto metr = MenuStructureDto.builder().build();
metr.setMenuCode(adm.getMenuCode());
metr.setMenuName(adm.getMenuName());
metr.setSortNumber(adm.getSortNumber());
metr.setPath(adm.getPath());
mestrs.add(metr);
}
}
}
List<ZzglAuth> zas_ = new ArrayList<ZzglAuth>();
String[] qhf = new String[mestrs.size()];
int y = 0;
for(MenuStructureDto metu : mestrs) {
ZzglAuth zd = ZzglAuth.builder().build();
for(ZzglAuth zg : zas) {
if(metu.getPath().equals(zg.getMenuId())) {
zd.setBmgwId(zg.getBmgwId());
zd.setMenuId(zg.getMenuId());
zas_.add(zd);
qhf[y] = zg.getMenuId();
y++;
break;
}
}
}
for(ZzglAuth zg : zas) {
if(!ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull2(qhf), zg.getMenuId())) {
ZzglAuth zd = ZzglAuth.builder().build();
zd.setBmgwId(zg.getBmgwId());
zd.setMenuId(zg.getMenuId());
zas_.add(zd);
}
}
return ResultUtil.data(zas_);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment