基础管理
This commit is contained in:
parent
ad4d37ffe6
commit
c6a424fe54
|
|
@ -66,12 +66,16 @@ public class ProServiceImpl implements IProService {
|
|||
@Override
|
||||
public List<ProVo> getProLists(ProDto dto) {
|
||||
List<ProVo> list = new ArrayList<>();
|
||||
list = mapper.getProLists(dto);
|
||||
list.forEach(item -> {
|
||||
List<Integer> fileNums = mapper.getProFiles(item.getProId());
|
||||
item.setProImgFileNum(fileNums.get(0));
|
||||
item.setProFileNum(fileNums.get(1));
|
||||
});
|
||||
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,25 +160,29 @@ public class ProServiceImpl implements IProService {
|
|||
@Override
|
||||
public AjaxResult getProById(ProDto dto) {
|
||||
ProVo vo = new ProVo();
|
||||
vo = mapper.getProById(dto);
|
||||
List<ResourceFileVo> resourceFileVos = mapper.getFiles(vo.getProId());
|
||||
if (CollectionUtils.isNotEmpty(resourceFileVos)) {
|
||||
List<ProVo.FileData> list = new ArrayList<>();
|
||||
for (ResourceFileVo fileVo : resourceFileVos) {
|
||||
String base64 = null;
|
||||
Result<SysFile> result = remoteFileService.getImgBase64(fileVo.getFileId(), SecurityConstants.INNER);
|
||||
if (result != null && result.getCode() == HttpStatus.SUCCESS && result.getData() != null) {
|
||||
String jsonString = JSON.toJSONString(result.getData());
|
||||
JSONObject item = JSON.parseObject(jsonString);
|
||||
base64 = item.getString("url");
|
||||
try {
|
||||
vo = mapper.getProById(dto);
|
||||
List<ResourceFileVo> resourceFileVos = mapper.getFiles(vo.getProId());
|
||||
if (CollectionUtils.isNotEmpty(resourceFileVos)) {
|
||||
List<ProVo.FileData> list = new ArrayList<>();
|
||||
for (ResourceFileVo fileVo : resourceFileVos) {
|
||||
String base64 = null;
|
||||
Result<SysFile> result = remoteFileService.getImgBase64(fileVo.getFileId(), SecurityConstants.INNER);
|
||||
if (result != null && result.getCode() == HttpStatus.SUCCESS && result.getData() != null) {
|
||||
String jsonString = JSON.toJSONString(result.getData());
|
||||
JSONObject item = JSON.parseObject(jsonString);
|
||||
base64 = item.getString("url");
|
||||
}
|
||||
ProVo.FileData fileData = new ProVo.FileData();
|
||||
fileData.setFileId(fileVo.getFileId());
|
||||
fileData.setBase64Url(base64);
|
||||
fileData.setFileSourceType(fileVo.getSourceType());
|
||||
list.add(fileData);
|
||||
}
|
||||
ProVo.FileData fileData = new ProVo.FileData();
|
||||
fileData.setFileId(fileVo.getFileId());
|
||||
fileData.setBase64Url(base64);
|
||||
fileData.setFileSourceType(fileVo.getSourceType());
|
||||
list.add(fileData);
|
||||
vo.setFileData(list);
|
||||
}
|
||||
vo.setFileData(list);
|
||||
} catch (Exception e) {
|
||||
log.error("工程详情",e);
|
||||
}
|
||||
return AjaxResult.success(vo);
|
||||
}
|
||||
|
|
@ -225,24 +233,28 @@ public class ProServiceImpl implements IProService {
|
|||
@Override
|
||||
public AjaxResult viewProFile(ProDto dto) {
|
||||
List<ProVo.FileData> list = new ArrayList<>();
|
||||
List<ResourceFileVo> resourceFileVos = mapper.getFiles(dto.getProId());
|
||||
if (CollectionUtils.isNotEmpty(resourceFileVos)) {
|
||||
for (ResourceFileVo fileVo : resourceFileVos) {
|
||||
if (Objects.equals(dto.getFileType(), fileVo.getSourceType())) {
|
||||
String base64 = null;
|
||||
Result<SysFile> result = remoteFileService.getImgBase64(fileVo.getFileId(), SecurityConstants.INNER);
|
||||
if (result != null && result.getCode() == HttpStatus.SUCCESS && result.getData() != null) {
|
||||
String jsonString = JSON.toJSONString(result.getData());
|
||||
JSONObject item = JSON.parseObject(jsonString);
|
||||
base64 = item.getString("url");
|
||||
try {
|
||||
List<ResourceFileVo> resourceFileVos = mapper.getFiles(dto.getProId());
|
||||
if (CollectionUtils.isNotEmpty(resourceFileVos)) {
|
||||
for (ResourceFileVo fileVo : resourceFileVos) {
|
||||
if (Objects.equals(dto.getFileType(), fileVo.getSourceType())) {
|
||||
String base64 = null;
|
||||
Result<SysFile> result = remoteFileService.getImgBase64(fileVo.getFileId(), SecurityConstants.INNER);
|
||||
if (result != null && result.getCode() == HttpStatus.SUCCESS && result.getData() != null) {
|
||||
String jsonString = JSON.toJSONString(result.getData());
|
||||
JSONObject item = JSON.parseObject(jsonString);
|
||||
base64 = item.getString("url");
|
||||
}
|
||||
ProVo.FileData fileData = new ProVo.FileData();
|
||||
fileData.setFileId(fileVo.getFileId());
|
||||
fileData.setBase64Url(base64);
|
||||
fileData.setFileSourceType(fileVo.getSourceType());
|
||||
list.add(fileData);
|
||||
}
|
||||
ProVo.FileData fileData = new ProVo.FileData();
|
||||
fileData.setFileId(fileVo.getFileId());
|
||||
fileData.setBase64Url(base64);
|
||||
fileData.setFileSourceType(fileVo.getSourceType());
|
||||
list.add(fileData);
|
||||
}
|
||||
}
|
||||
} 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<>();
|
||||
list = mapper.getGxPlanLists(dto);
|
||||
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();
|
||||
vo = mapper.getGxPlanById(dto);
|
||||
try {
|
||||
vo = mapper.getGxPlanById(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("工序计划详情",e);
|
||||
}
|
||||
return AjaxResult.success(vo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,11 @@ public class RoleServiceImpl implements IRoleService {
|
|||
@Override
|
||||
public List<RoleVo> getRoleLists(RoleDto dto) {
|
||||
List<RoleVo> list = new ArrayList<>();
|
||||
list = mapper.getRoleLists(dto);
|
||||
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();
|
||||
vo = mapper.getRoleById(dto);
|
||||
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<>();
|
||||
list = mapper.getAuthMenu(dto);
|
||||
try {
|
||||
list = mapper.getAuthMenu(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("获取角色授权的菜单",e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,11 @@ public class SelectServiceImpl implements ISelectService {
|
|||
@Override
|
||||
public AjaxResult getRoleLists() {
|
||||
List<SelectVo> list = new ArrayList<>();
|
||||
list = mapper.getRoleLists();
|
||||
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<>();
|
||||
list = mapper.getBuildLists();
|
||||
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<>();
|
||||
list = mapper.getDictLists(dto);
|
||||
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<>();
|
||||
list = mapper.getTowerLists(dto);
|
||||
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<>();
|
||||
list = mapper.getTeamLists(dto);
|
||||
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<>();
|
||||
list = mapper.getProLists(dto);
|
||||
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<>();
|
||||
list = mapper.getAreaLists(dto);
|
||||
try {
|
||||
list = mapper.getAreaLists(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("区域下拉选");
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,11 @@ public class TeamQuEvalServiceImpl implements ITeamQuEvalService {
|
|||
@Override
|
||||
public List<TeamQuEvalVo> getTeamQuEvalLists(TeamQuEvalDto dto) {
|
||||
List<TeamQuEvalVo> list = new ArrayList<>();
|
||||
list = mapper.getTeamQuEvalLists(dto);
|
||||
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();
|
||||
vo = mapper.getTeamEvalById(dto);
|
||||
try {
|
||||
vo = mapper.getTeamEvalById(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("班组质量评价详情",e);
|
||||
}
|
||||
return AjaxResult.success(vo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,11 @@ public class UserServiceImpl implements IUserService {
|
|||
@Override
|
||||
public List<UserVo> getUserLists(UserDto dto) {
|
||||
List<UserVo> list = new ArrayList<>();
|
||||
list = mapper.getUserLists(dto);
|
||||
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) {
|
||||
mapper.delUser(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();
|
||||
vo = mapper.getUserById(dto);
|
||||
try {
|
||||
vo = mapper.getUserById(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("用户详情",e);
|
||||
}
|
||||
return AjaxResult.success(vo);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue