|
@@ -40,10 +40,10 @@ public class MgeAuditRptController {
|
|
|
|
|
|
@ApiImplicitParam(name = "SearchDTO", value = "查询条件")
|
|
|
@PostMapping(value = "audits")
|
|
|
- public Result<List<UserMgeLogRptVo>> getMgeAuditRpt(SearchDTO searchDTO){
|
|
|
+ public Result<List<UserMgeLogRptVo>> getMgeAuditRpt(SearchDTO searchDTO) {
|
|
|
searchDTO.setSort("");
|
|
|
Searchable searchable = Searchable.toSearchable(searchDTO);
|
|
|
- searchable.addSort(Sort.Direction.DESC,"operate_time");
|
|
|
+ searchable.addSort(Sort.Direction.DESC, "operate_time");
|
|
|
Page<com.dragoninfo.dcuc.user.user.vo.UserMgeLogRptVo> userMgeLogSummary = iMgeLogFacade.findUserMgeLogSummary(searchDTO);
|
|
|
List<UserMgeLogRptVo> vos = new ArrayList<>();
|
|
|
for (com.dragoninfo.dcuc.user.user.vo.UserMgeLogRptVo userMgeLogRptVo : userMgeLogSummary) {
|
|
@@ -51,20 +51,20 @@ public class MgeAuditRptController {
|
|
|
BeanUtils.copyProperties(userMgeLogRptVo, vo);
|
|
|
vos.add(vo);
|
|
|
}
|
|
|
- Result result = Result.success(userMgeLogSummary.getTotalElements(),vos);
|
|
|
+ Result result = Result.success(userMgeLogSummary.getTotalElements(), vos);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "查询管理员审计详情")
|
|
|
@ApiImplicitParam(name = "id", value = "id")
|
|
|
@GetMapping(value = "/detail/{id}")
|
|
|
- public Result<MgeLogVo> orgAuditDetail(@PathVariable("id") String id){
|
|
|
+ public Result<MgeLogVo> orgAuditDetail(@PathVariable("id") String id) {
|
|
|
MgeLog mgeLog = iMgeLogFacade.getMgeLog(id);
|
|
|
List<MgeLog> mgeLogList = new ArrayList<MgeLog>();
|
|
|
mgeLogList.add(mgeLog);
|
|
|
- formatMgeLog(mgeLogList,"rpt");
|
|
|
+ formatMgeLog(mgeLogList, "rpt");
|
|
|
MgeLogVo mgeLogVo = new MgeLogVo();
|
|
|
- BeanUtils.copyProperties(mgeLog,mgeLogVo);
|
|
|
+ BeanUtils.copyProperties(mgeLog, mgeLogVo);
|
|
|
return Result.success(mgeLogVo);
|
|
|
}
|
|
|
|
|
@@ -89,11 +89,11 @@ public class MgeAuditRptController {
|
|
|
@GetMapping(value = "auditList/{type}/{userId}")
|
|
|
public Result<List<MgeLogVo>> auditList(@PathVariable("type") String type, @PathVariable("userId") String userId) {
|
|
|
List<MgeLog> mgeLogList = iMgeLogFacade.queryList(type, userId);
|
|
|
- mgeLogList = formatMgeLog(mgeLogList,"list");
|
|
|
+ mgeLogList = formatMgeLog(mgeLogList, "list");
|
|
|
List<MgeLogVo> vos = new ArrayList<>();
|
|
|
for (MgeLog mgeLog : mgeLogList) {
|
|
|
MgeLogVo vo = new MgeLogVo();
|
|
|
- BeanUtils.copyProperties(mgeLog,vo);
|
|
|
+ BeanUtils.copyProperties(mgeLog, vo);
|
|
|
vos.add(vo);
|
|
|
}
|
|
|
return Result.success(vos);
|
|
@@ -101,22 +101,23 @@ public class MgeAuditRptController {
|
|
|
|
|
|
/**
|
|
|
* 格式化审计Log
|
|
|
+ *
|
|
|
* @param mgeLogList
|
|
|
* @return
|
|
|
*/
|
|
|
- private List<MgeLog> formatMgeLog(List<MgeLog> mgeLogList,String listOrRpt){
|
|
|
- for(MgeLog mgeLog : mgeLogList){
|
|
|
+ private List<MgeLog> formatMgeLog(List<MgeLog> mgeLogList, String listOrRpt) {
|
|
|
+ for (MgeLog mgeLog : mgeLogList) {
|
|
|
String type = mgeLog.getObjectType();//操作对象类型
|
|
|
String ids = mgeLog.getObjectId();
|
|
|
ids = StringUtils.isEmpty(ids) ? "" : ids;
|
|
|
- if (!AdminObjectTypeEnum.GLY.getValue().equals(type) && !AdminObjectTypeEnum.PTCD.getValue().equals(type)){
|
|
|
+ if (!AdminObjectTypeEnum.GLY.getValue().equals(type) && !AdminObjectTypeEnum.PTCD.getValue().equals(type)) {
|
|
|
if (AdminObjectTypeEnum.JGGL.getValue().equals(type) || AdminObjectTypeEnum.RYGL.getValue().equals(type) || AdminObjectTypeEnum.SQGL.getValue().equals(type) || AdminObjectTypeEnum.GLYGL.getValue().equals(type)) {
|
|
|
ids = iOrgInfoFacade.changeIdsToNames(ids);
|
|
|
ids = ids.replace(":-1", "(及其下属机构)").replace(":0", "").replace(":1", "").replace(":2", "(及其下属机构)");
|
|
|
mgeLog.setObjectName(ids);
|
|
|
}
|
|
|
|
|
|
- }else if(type.equals(AdminObjectTypeEnum.PTCD.getValue())){
|
|
|
+ } else if (type.equals(AdminObjectTypeEnum.PTCD.getValue())) {
|
|
|
Map<String, MgeLog> resultMap = new TreeMap<String, MgeLog>(new Comparator<String>() {
|
|
|
@Override
|
|
|
public int compare(String o1, String o2) {
|
|
@@ -127,9 +128,9 @@ public class MgeAuditRptController {
|
|
|
mgeLogListTemp.add(mgeLog);
|
|
|
String s = JsonUtils.toJSONString(mgeLogListTemp);
|
|
|
Map<Object, Object> mgeLogMap = new HashMap<>();
|
|
|
- mgeLogMap.put("mgeLogMap",s);
|
|
|
+ mgeLogMap.put("mgeLogMap", s);
|
|
|
mgeLogListTemp = iMenuMtAuthFacade.convertIdsToNames(mgeLogMap);
|
|
|
- if(listOrRpt.equals("list")){
|
|
|
+ if (listOrRpt.equals("list")) {
|
|
|
mgeLog = mgeLogListTemp.get(0);
|
|
|
String key = mgeLog.getOperateTime().toString() + mgeLog.getOperateUserId();
|
|
|
if (resultMap.containsKey(key)) {
|
|
@@ -145,8 +146,8 @@ public class MgeAuditRptController {
|
|
|
mgeLogListTemp.add(entry.getValue());
|
|
|
}
|
|
|
mgeLog = mgeLogListTemp.get(0);
|
|
|
- }else{
|
|
|
- if(CollectionUtils.isNotEmpty(mgeLogListTemp)){
|
|
|
+ } else {
|
|
|
+ if (CollectionUtils.isNotEmpty(mgeLogListTemp)) {
|
|
|
mgeLog.setObjectName(mgeLogListTemp.get(0).getObjectName());
|
|
|
}
|
|
|
}
|