基础管理

This commit is contained in:
cwchen 2024-03-22 18:28:30 +08:00
parent ad4d37ffe6
commit c6a424fe54
5 changed files with 138 additions and 55 deletions

View File

@ -66,12 +66,16 @@ public class ProServiceImpl implements IProService {
@Override
public List<ProVo> getProLists(ProDto dto) {
List<ProVo> list = new ArrayList<>();
try {
list = mapper.getProLists(dto);
list.forEach(item -> {
List<Integer> fileNums = mapper.getProFiles(item.getProId());
item.setProImgFileNum(fileNums.get(0));
item.setProFileNum(fileNums.get(1));
});
} catch (Exception e) {
log.error("获取工程列表",e);
}
return list;
}
@ -156,6 +160,7 @@ public class ProServiceImpl implements IProService {
@Override
public AjaxResult getProById(ProDto dto) {
ProVo vo = new ProVo();
try {
vo = mapper.getProById(dto);
List<ResourceFileVo> resourceFileVos = mapper.getFiles(vo.getProId());
if (CollectionUtils.isNotEmpty(resourceFileVos)) {
@ -176,6 +181,9 @@ public class ProServiceImpl implements IProService {
}
vo.setFileData(list);
}
} catch (Exception e) {
log.error("工程详情",e);
}
return AjaxResult.success(vo);
}
@ -225,6 +233,7 @@ public class ProServiceImpl implements IProService {
@Override
public AjaxResult viewProFile(ProDto dto) {
List<ProVo.FileData> list = new ArrayList<>();
try {
List<ResourceFileVo> resourceFileVos = mapper.getFiles(dto.getProId());
if (CollectionUtils.isNotEmpty(resourceFileVos)) {
for (ResourceFileVo fileVo : resourceFileVos) {
@ -244,6 +253,9 @@ public class ProServiceImpl implements IProService {
}
}
}
} catch (Exception e) {
log.error("工程图片/平面图预览",e);
}
return AjaxResult.success(list);
}
@ -511,7 +523,11 @@ public class ProServiceImpl implements IProService {
@Override
public List<GxPlanVo> getGxPlanLists(GxPlanDto dto) {
List<GxPlanVo> list = new ArrayList<>();
try {
list = mapper.getGxPlanLists(dto);
} catch (Exception e) {
log.error("获取工序列表",e);
}
return list;
}
@ -603,7 +619,11 @@ public class ProServiceImpl implements IProService {
@Override
public AjaxResult getGxPlanById(GxPlanDto dto) {
GxPlanVo vo = new GxPlanVo();
try {
vo = mapper.getGxPlanById(dto);
} catch (Exception e) {
log.error("工序计划详情",e);
}
return AjaxResult.success(vo);
}

View File

@ -31,7 +31,11 @@ public class RoleServiceImpl implements IRoleService {
@Override
public List<RoleVo> getRoleLists(RoleDto dto) {
List<RoleVo> list = new ArrayList<>();
try {
list = mapper.getRoleLists(dto);
} catch (Exception e) {
log.error("获取角色列表",e);
}
return list;
}
@ -67,7 +71,11 @@ public class RoleServiceImpl implements IRoleService {
@Override
public AjaxResult getRoleById(RoleDto dto) {
RoleVo vo = new RoleVo();
try {
vo = mapper.getRoleById(dto);
} catch (Exception e) {
log.error("角色详情",e);
}
return AjaxResult.success(vo);
}
@ -96,7 +104,11 @@ public class RoleServiceImpl implements IRoleService {
@Override
public AjaxResult getAuthMenu(RoleDto dto) {
List<String> list = new ArrayList<>();
try {
list = mapper.getAuthMenu(dto);
} catch (Exception e) {
log.error("获取角色授权的菜单",e);
}
return AjaxResult.success(list);
}
}

View File

@ -49,7 +49,11 @@ public class SelectServiceImpl implements ISelectService {
@Override
public AjaxResult getRoleLists() {
List<SelectVo> list = new ArrayList<>();
try {
list = mapper.getRoleLists();
} catch (Exception e) {
log.error("角色下拉选",e);
}
return AjaxResult.success(list);
}
@ -100,42 +104,66 @@ public class SelectServiceImpl implements ISelectService {
@Override
public AjaxResult getBuildLists() {
List<SelectVo> list = new ArrayList<>();
try {
list = mapper.getBuildLists();
} catch (Exception e) {
log.error("建管单位下拉选",e);
}
return AjaxResult.success(list);
}
@Override
public AjaxResult getDictLists(SelectDto dto) {
List<SelectVo> list = new ArrayList<>();
try {
list = mapper.getDictLists(dto);
} catch (Exception e) {
log.error("字典表下拉选",e);
}
return AjaxResult.success(list);
}
@Override
public AjaxResult getTowerLists(SelectDto dto) {
List<SelectVo> list = new ArrayList<>();
try {
list = mapper.getTowerLists(dto);
} catch (Exception e) {
log.error("杆塔下拉选",e);
}
return AjaxResult.success(list);
}
@Override
public AjaxResult getTeamLists(SelectDto dto) {
List<SelectVo> list = new ArrayList<>();
try {
list = mapper.getTeamLists(dto);
} catch (Exception e) {
log.error("班组下拉选",e);
}
return AjaxResult.success(list);
}
@Override
public AjaxResult getProLists(SelectDto dto) {
List<SelectVo> list = new ArrayList<>();
try {
list = mapper.getProLists(dto);
} catch (Exception e) {
log.error("工程下拉选",e);
}
return AjaxResult.success(list);
}
@Override
public AjaxResult getAreaLists(SelectDto dto) {
List<SelectVo> list = new ArrayList<>();
try {
list = mapper.getAreaLists(dto);
} catch (Exception e) {
log.error("区域下拉选");
}
return AjaxResult.success(list);
}
}

View File

@ -34,7 +34,11 @@ public class TeamQuEvalServiceImpl implements ITeamQuEvalService {
@Override
public List<TeamQuEvalVo> getTeamQuEvalLists(TeamQuEvalDto dto) {
List<TeamQuEvalVo> list = new ArrayList<>();
try {
list = mapper.getTeamQuEvalLists(dto);
} catch (Exception e) {
log.error("获取班组质量评价列表",e);
}
return list;
}
@ -64,7 +68,11 @@ public class TeamQuEvalServiceImpl implements ITeamQuEvalService {
@Override
public AjaxResult getTeamEvalById(TeamQuEvalDto dto) {
TeamQuEvalVo vo = new TeamQuEvalVo();
try {
vo = mapper.getTeamEvalById(dto);
} catch (Exception e) {
log.error("班组质量评价详情",e);
}
return AjaxResult.success(vo);
}

View File

@ -34,7 +34,11 @@ public class UserServiceImpl implements IUserService {
@Override
public List<UserVo> getUserLists(UserDto dto) {
List<UserVo> list = new ArrayList<>();
try {
list = mapper.getUserLists(dto);
} catch (Exception e) {
log.error("获取用户列表",e);
}
return list;
}
@ -69,14 +73,25 @@ public class UserServiceImpl implements IUserService {
@Override
@Transactional(rollbackFor = Exception.class)
public AjaxResult delUser(UserDto dto) {
try {
mapper.delUser(dto);
} catch (Exception e) {
log.error("删除用户",e);
//手动回滚异常
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return AjaxResult.error();
}
return AjaxResult.success();
}
@Override
public AjaxResult getUserById(UserDto dto) {
UserVo vo = new UserVo();
try {
vo = mapper.getUserById(dto);
} catch (Exception e) {
log.error("用户详情",e);
}
return AjaxResult.success(vo);
}