| | |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.DateFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | @Component |
| | | public class ss { |
| | | @Autowired |
| | | private IRegionWeightService regionWeightService; |
| | | private IRegionWeightService regionWeightService; |
| | | |
| | | @Autowired |
| | | private IMountainrainService mountainrainService; |
| | | |
| | | @Scheduled(cron = "0 0 8 * * ?") |
| | | public R soleval() { |
| | | mountainrainService.soildel(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String dateNow = sdf.format(new Date()); |
| | | //mountainrainService.soildel(); |
| | | int intervals = 31; |
| | | ArrayList passDaysList = new ArrayList<>(); |
| | | for (int i = 0; i < intervals; i++) { |
| | |
| | | } |
| | | } |
| | | } |
| | | if (v1 > 60) { |
| | | mountainrainService.soleInster(stcd, "60"); |
| | | } else { |
| | | String a = String.valueOf(v1); |
| | | mountainrainService.soleInster(stcd, a); |
| | | if (stcd!=null) { |
| | | if (v1 > 60) { |
| | | mountainrainService.soleInster(stcd, "60", dateNow); |
| | | } else { |
| | | String a = String.valueOf(v1); |
| | | mountainrainService.soleInster(stcd, a, dateNow); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | return R.success("成功"); |
| | | } |
| | | |
| | |
| | | return result; |
| | | } |
| | | |
| | | private static String ss(int i,int j, boolean b) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | if (b) { |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + i); |
| | | } else { |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) - i); |
| | | } |
| | | calendar.add(Calendar.DATE, -j); |
| | | Date today = calendar.getTime(); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 08:00:00"); |
| | | String result = format.format(today); |
| | | return result; |
| | | } |
| | | |
| | | } |