部门删除修改,清除日志修改

master
anthonywj 2 years ago
parent b9f5c4b93d
commit dcb1b16049

@ -277,6 +277,10 @@ public class DeptController extends BaseController {
} }
DeptEntity deptEntity = deptService.selectById(deleteRequest.getId()); DeptEntity deptEntity = deptService.selectById(deleteRequest.getId());
if(deptEntity.getLevel()!=null && deptEntity.getLevel() == 1){
return ResultVOUtils.error(500,"删除失败,一级部门不允许删除!");
}
List<InvWarehouseEntity> invSubWarehouseEntities = invWarehouseService.findByParentId(deptEntity.getCode()); List<InvWarehouseEntity> invSubWarehouseEntities = invWarehouseService.findByParentId(deptEntity.getCode());
if (CollUtil.isNotEmpty(invSubWarehouseEntities)) { if (CollUtil.isNotEmpty(invSubWarehouseEntities)) {
return ResultVOUtils.error(500, "删除失败,请先移除该部门关联仓库信息!"); return ResultVOUtils.error(500, "删除失败,请先移除该部门关联仓库信息!");

@ -76,31 +76,32 @@ public class CleanLogTask implements SchedulingConfigurer {
} }
private void process() { private void process() {
//查询删除日志时间配置
String value = systemParamConfigDao.selectValueByParamKey("clean_log_days"); //查询系统日志删除是否开启
if (StrUtil.isBlank(value)) { String cleanSystemLog = systemParamConfigDao.selectValueByParamKey("clean_system_log");
log.info("删除日志天数参数未配置,结束任务"); Integer cleanSystemLogValue = Integer.parseInt(cleanSystemLog);
} else { if (cleanSystemLogValue > 0) {
int days = Integer.parseInt(value); String date = DateUtil.offsetDay(new Date(), -cleanSystemLogValue).toString("yyyy-MM-dd");
if (days > 0) { cleanSystemLog(date);
String date = DateUtil.offsetDay(new Date(), -days).toString("yyyy-MM-dd"); }
//查询系统日志删除是否开启
String cleanSystemLogValue = systemParamConfigDao.selectValueByParamKey("clean_system_log");
if ("1".equals(cleanSystemLogValue)) { String cleanThrLogValue = systemParamConfigDao.selectValueByParamKey("clean_thr_log");
cleanSystemLog(date); Integer cleanThrLogValueInt = Integer.parseInt(cleanThrLogValue);
} if (cleanThrLogValueInt > 0) {
String cleanThrLogValue = systemParamConfigDao.selectValueByParamKey("clean_thr_log"); String date = DateUtil.offsetDay(new Date(), -cleanThrLogValueInt).toString("yyyy-MM-dd");
if ("1".equals(cleanThrLogValue)) { cleanThrLog(date);
cleanThrLog(date);
}
String cleanSyncLogValue = systemParamConfigDao.selectValueByParamKey("clean_sync_log");
if ("1".equals(cleanSyncLogValue)) {
cleanSyncLog(date);
}
} else {
log.info("配置删除日志天数为0不进行删除");
}
} }
String cleanSyncLogValue = systemParamConfigDao.selectValueByParamKey("clean_sync_log");
Integer cleanSyncLogValueInt = Integer.parseInt(cleanSyncLogValue);
if (cleanSyncLogValueInt > 0) {
String date = DateUtil.offsetDay(new Date(), -cleanSyncLogValueInt).toString("yyyy-MM-dd");
cleanSyncLog(date);
}
} }
/** /**

Loading…
Cancel
Save