|
|
@ -26,10 +26,7 @@ import org.springblade.core.tool.utils.StringUtil; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.*; |
|
|
|
import java.util.Calendar; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -246,6 +243,29 @@ public class GenerateServiceImpl extends BaseServiceImpl<GenerateMapper, Generat |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public boolean test(GenerateEntity entity) { |
|
|
|
|
|
|
|
Calendar calendar = Calendar.getInstance(); |
|
|
|
|
|
|
|
Date end = calendar.getTime(); |
|
|
|
|
|
|
|
calendar.add(Calendar.MONTH,-calendar.get(Calendar.MONTH)); |
|
|
|
|
|
|
|
calendar.add(Calendar.MONTH,-calendar.get(Calendar.MONTH)); |
|
|
|
|
|
|
|
calendar.add(Calendar.DAY_OF_MONTH,-calendar.get(Calendar.DAY_OF_MONTH)); |
|
|
|
|
|
|
|
calendar.add(Calendar.HOUR_OF_DAY,-calendar.get(Calendar.HOUR_OF_DAY)); |
|
|
|
|
|
|
|
calendar.add(Calendar.MINUTE,-calendar.get(Calendar.MINUTE)); |
|
|
|
|
|
|
|
calendar.add(Calendar.SECOND,-calendar.get(Calendar.SECOND)); |
|
|
|
|
|
|
|
Random random = new Random(); |
|
|
|
|
|
|
|
Date start = calendar.getTime(); |
|
|
|
|
|
|
|
while (end.compareTo(start) > 0){ |
|
|
|
|
|
|
|
entity.setId(null); |
|
|
|
|
|
|
|
entity.setFillDate(DateUtil.format(start,DateUtil.PATTERN_DATE)); |
|
|
|
|
|
|
|
entity.setGenerate((random.nextDouble() * 10000) + 50000); |
|
|
|
|
|
|
|
this.save(entity); |
|
|
|
|
|
|
|
calendar.add(Calendar.DAY_OF_MONTH,1); |
|
|
|
|
|
|
|
start = calendar.getTime(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 获取近年月份集合 |
|
|
|
* 获取近年月份集合 |
|
|
|