| | |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.jfpt.catalog.entitly.catalog; |
| | | import org.springblade.jfpt.catalog.service.catalogService; |
| | | import org.springblade.jfpt.catalog.vo.catalogVO; |
| | | import org.springblade.system.vo.DeptVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springblade.jfpt.catalog.wrapper.catalogWrapper; |
| | | |
| | |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials","true"); |
| | | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式 |
| | | List<Map<String, Object>> listc = new ArrayList<>(); |
| | | String[] str={"内部","周边","挟持","救护","旁路","火警","紧急","出入","防拆"}; |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | String endTime = df.format(new Date());// new Date()为获取当前系统时间 |
| | | String beginTime = getPastDate(7); |
| | | List<Map<String, Object>> list = catalogService.selectWar(beginTime,endTime); |
| | | return R.data(list); |
| | | map.put("lists",list); |
| | | map.put("type",str); |
| | | listc.add(map); |
| | | return R.data(listc); |
| | | } |
| | | public static String getPastDate(int past) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | |
| | | String result = format.format(today); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 懒加载获取部门树形结构 |
| | | */ |
| | | @GetMapping("/lazy-tree") |
| | | public R<List<catalogVO>> lazyTree(String tenantId, Long parentId, BladeUser bladeUser) { |
| | | List<catalogVO> tree = catalogService.lazyTree(Func.toStrWithEmpty(tenantId, bladeUser.getTenantId()), parentId); |
| | | return R.data(tree); |
| | | } |
| | | } |