提交 8e573ba1 authored 作者: fit2cloud-chenyw's avatar fit2cloud-chenyw

feat: 增加消失超时默认30天

上级 41d42372
...@@ -69,10 +69,10 @@ public class ExcelReaderUtil { ...@@ -69,10 +69,10 @@ public class ExcelReaderUtil {
} }
} }
public static void main(String[] args) throws Exception { /* public static void main(String[] args) throws Exception {
String file ="修改日期为mm-dd-yyyy.xlsx"; String file ="修改日期为mm-dd-yyyy.xlsx";
ExcelReaderUtil.readExcel(file, new FileInputStream("/Users/taojinlong/Desktop/" + file)); ExcelReaderUtil.readExcel(file, new FileInputStream("/Users/taojinlong/Desktop/" + file));
} } */
} }
...@@ -23,6 +23,7 @@ import org.springframework.cache.annotation.Cacheable; ...@@ -23,6 +23,7 @@ import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -30,6 +31,8 @@ import java.util.stream.Collectors; ...@@ -30,6 +31,8 @@ import java.util.stream.Collectors;
@Service @Service
public class SysMsgService { public class SysMsgService {
private static final long overDays = 30;
@Resource @Resource
private SysMsgMapper sysMsgMapper; private SysMsgMapper sysMsgMapper;
...@@ -67,6 +70,8 @@ public class SysMsgService { ...@@ -67,6 +70,8 @@ public class SysMsgService {
criteria.andStatusEqualTo(msgRequest.getStatus()); criteria.andStatusEqualTo(msgRequest.getStatus());
} }
criteria.andCreateTimeGreaterThanOrEqualTo(overTime());
example.setOrderByClause(orderClause); example.setOrderByClause(orderClause);
List<SysMsg> sysMsgs = sysMsgMapper.selectByExample(example); List<SysMsg> sysMsgs = sysMsgMapper.selectByExample(example);
return sysMsgs; return sysMsgs;
...@@ -100,6 +105,8 @@ public class SysMsgService { ...@@ -100,6 +105,8 @@ public class SysMsgService {
criteria.andStatusEqualTo(msgRequest.getStatus()); criteria.andStatusEqualTo(msgRequest.getStatus());
} }
criteria.andCreateTimeGreaterThanOrEqualTo(overTime());
example.setOrderByClause(orderClause); example.setOrderByClause(orderClause);
List<MsgGridDto> msgGridDtos = extSysMsgMapper.queryGrid(example); List<MsgGridDto> msgGridDtos = extSysMsgMapper.queryGrid(example);
return msgGridDtos; return msgGridDtos;
...@@ -109,6 +116,7 @@ public class SysMsgService { ...@@ -109,6 +116,7 @@ public class SysMsgService {
SysMsgExample example = new SysMsgExample(); SysMsgExample example = new SysMsgExample();
SysMsgExample.Criteria criteria = example.createCriteria(); SysMsgExample.Criteria criteria = example.createCriteria();
criteria.andUserIdEqualTo(userId).andStatusEqualTo(false); criteria.andUserIdEqualTo(userId).andStatusEqualTo(false);
criteria.andCreateTimeGreaterThanOrEqualTo(overTime());
return sysMsgMapper.countByExample(example); return sysMsgMapper.countByExample(example);
} }
...@@ -320,4 +328,23 @@ public class SysMsgService { ...@@ -320,4 +328,23 @@ public class SysMsgService {
sysMsgMapper.updateByExampleSelective(record, example); sysMsgMapper.updateByExampleSelective(record, example);
} }
public Long overTime() {
Long currentTime = System.currentTimeMillis();
long oneDayTime = 24 * 60 * 60 * 1000;
long temp = overDays * oneDayTime;
return currentTime - (currentTime + 8 * 60 * 60 * 1000) % oneDayTime - temp;
}
/* public static void main(String[] args) {
Long overTime = overTime();
System.out.println(overTime);
} */
} }
...@@ -49,15 +49,18 @@ ...@@ -49,15 +49,18 @@
</div> </div>
</div> </div>
<div slot="reference"> <div slot="reference">
<div> <el-badge :value="count || paginationConfig.total" :hidden="!count && !paginationConfig.total" :max="99" class="item">
<svg-icon class-name="notification" icon-class="notification" />
</el-badge>
<!-- <div>
<svg-icon <svg-icon
class-name="notification" class-name="notification"
icon-class="notification" icon-class="notification"
/> />
<span v-if="count || paginationConfig.total" class="msg-number">{{ count || paginationConfig.total }}</span> <span v-if="count || paginationConfig.total" class="msg-number">{{ count || paginationConfig.total }}</span>
</div> </div>
</div> </div> -->
</el-popover> </div></el-popover>
</template> </template>
<script> <script>
...@@ -275,4 +278,9 @@ export default { ...@@ -275,4 +278,9 @@ export default {
background-color: #171422; background-color: #171422;
} }
} }
.item {
margin-top: 0px;
margin-right: 5px;
}
</style> </style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论