Commit 6deae528 by 向延琳

修改命名

1 parent 9c146672
......@@ -206,7 +206,7 @@ public final class Constants {
/**
* 失效状态
*/
public static final int STATUS_ENABLE = 0;
public static final int STATUS_UNABLE = 0;
/**
......
......@@ -7,10 +7,10 @@ import cn.com.glsx.stdinterface.modules.converter.FakeOfflineChangeConverter;
import cn.com.glsx.stdinterface.modules.entity.FakeOfflineChangeFrequently;
import cn.com.glsx.stdinterface.modules.mapper.FakeOfflineChangeFrequentlyMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.Date;
import java.util.List;
......@@ -45,15 +45,15 @@ public class FakeOfflineChangeService {
Date date = DateUtil.addDateDays(new Date(), -1);
List<FakeOfflineChangeFrequently> ableList =
fakeOfflineChangeFrequentlyMapper.listByFakeOfflineTimeAndStatus(date, Constants.STATUS_ABLE);
if(!CollectionUtils.isEmpty(ableList)) {
if(CollectionUtils.isNotEmpty(ableList)) {
List<Long> ids = ableList.stream().map(FakeOfflineChangeFrequently::getId).collect(Collectors.toList());
fakeOfflineChangeFrequentlyMapper.updateStatusByIds(ids, Constants.STATUS_ENABLE);
fakeOfflineChangeFrequentlyMapper.updateStatusByIds(ids, Constants.STATUS_UNABLE);
}
//2查出今天的成效数据并且 生效
List<FakeOfflineChangeFrequently> enableList =
fakeOfflineChangeFrequentlyMapper.listByFakeOfflineTimeAndStatus(new Date(), Constants.STATUS_ENABLE);
if(!CollectionUtils.isEmpty(enableList)) {
fakeOfflineChangeFrequentlyMapper.listByFakeOfflineTimeAndStatus(new Date(), Constants.STATUS_UNABLE);
if(CollectionUtils.isNotEmpty(enableList)) {
List<Long> ids = enableList.stream().map(FakeOfflineChangeFrequently::getId).collect(Collectors.toList());
fakeOfflineChangeFrequentlyMapper.updateStatusByIds(ids, Constants.STATUS_ABLE);
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!