| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 系统设置控制器 |
| | |
| | | @RequestMapping(value = "/redSet/list") |
| | | @ResponseBody |
| | | public Object redSetList() { |
| | | |
| | | List<String> strings = new ArrayList<>(); |
| | | strings.add("updateTime"); |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | if (ShiroKit.getUser().getRoleType() != 1){ |
| | | page.setRecords(null); |
| | |
| | | for (Map<String, Object> stringObjectMap : list) { |
| | | stringObjectMap.put(stringObjectMap.get("deductionRatio").toString(),stringObjectMap.get("deductionRatio")+"%"); |
| | | } |
| | | page.setRecords(list); |
| | | List<Map<String, Object>> sortedList = list.stream() |
| | | .sorted((map1, map2) -> { |
| | | // 获取 updateTime 字段 |
| | | String time1 = map1.get("updateTime").toString(); |
| | | String time2 = map2.get("updateTime").toString(); |
| | | // 倒序排列 |
| | | return time2.compareTo(time1); |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | page.setRecords(sortedList); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | |
| | | String s = replace + ":00"; |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Date date = dateFormat.parse(s); |
| | | tSysRedSet.setInsertTime(date); |
| | | tSysRedSet.setEffectiveDate(date); |
| | | tSysRedSet.setUpdateTime(new Date()); |
| | | redEnvelopePaymentSettingsService.updateById(tSysRedSet); |
| | | return SUCCESS_TIP; |