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

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)) {
log.info("删除日志天数参数未配置,结束任务");
} else {
int days = Integer.parseInt(value);
if (days > 0) {
String date = DateUtil.offsetDay(new Date(), -days).toString("yyyy-MM-dd");
//查询系统日志删除是否开启 //查询系统日志删除是否开启
String cleanSystemLogValue = systemParamConfigDao.selectValueByParamKey("clean_system_log"); String cleanSystemLog = systemParamConfigDao.selectValueByParamKey("clean_system_log");
if ("1".equals(cleanSystemLogValue)) { Integer cleanSystemLogValue = Integer.parseInt(cleanSystemLog);
if (cleanSystemLogValue > 0) {
String date = DateUtil.offsetDay(new Date(), -cleanSystemLogValue).toString("yyyy-MM-dd");
cleanSystemLog(date); cleanSystemLog(date);
} }
String cleanThrLogValue = systemParamConfigDao.selectValueByParamKey("clean_thr_log"); String cleanThrLogValue = systemParamConfigDao.selectValueByParamKey("clean_thr_log");
if ("1".equals(cleanThrLogValue)) { Integer cleanThrLogValueInt = Integer.parseInt(cleanThrLogValue);
if (cleanThrLogValueInt > 0) {
String date = DateUtil.offsetDay(new Date(), -cleanThrLogValueInt).toString("yyyy-MM-dd");
cleanThrLog(date); cleanThrLog(date);
} }
String cleanSyncLogValue = systemParamConfigDao.selectValueByParamKey("clean_sync_log"); String cleanSyncLogValue = systemParamConfigDao.selectValueByParamKey("clean_sync_log");
if ("1".equals(cleanSyncLogValue)) { Integer cleanSyncLogValueInt = Integer.parseInt(cleanSyncLogValue);
if (cleanSyncLogValueInt > 0) {
String date = DateUtil.offsetDay(new Date(), -cleanSyncLogValueInt).toString("yyyy-MM-dd");
cleanSyncLog(date); cleanSyncLog(date);
} }
} else {
log.info("配置删除日志天数为0不进行删除");
}
}
} }
/** /**

Loading…
Cancel
Save