| | |
| | | private SqlSessionFactory sqlSessionFactory; |
| | | |
| | | @RequestMapping(value = "/staDesc/init/auth") |
| | | @ManagerAuth(memo = "初始化站点路径") |
| | | @ManagerAuth(memo = "response.station_path_init") |
| | | public R init(StaDescInitParam param) { |
| | | try{ |
| | | if (param.getTypeDesc()==1){ |
| | |
| | | // staDescService.insertBatch(staDescList); |
| | | }catch (Exception e){ |
| | | log.error("初始化站点路径异常:{}",e.getMessage()); |
| | | return R.error("初始化站点路径异常:"+e.getMessage()); |
| | | return R.error("response.station_path_init_exception"); |
| | | } |
| | | |
| | | return R.ok("ok1").add("ok2"); |
| | | return R.ok("response.init_success"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/staDesc/{id}/auth") |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/staDesc/add/auth") |
| | | @ManagerAuth(memo = "站点路径添加") |
| | | @ManagerAuth(memo = "response.station_path_add") |
| | | public R add(StaDesc staDesc) { |
| | | int sameRes = staDescService.selectCount(new EntityWrapper<StaDesc>() |
| | | .eq("type_no", staDesc.getTypeNo()) |
| | |
| | | .eq("crn_no", staDesc.getCrnNo()) |
| | | .eq("crn_stn", staDesc.getCrnStn())); |
| | | if (sameRes > 0) { |
| | | return R.error("路径已存在"); |
| | | return R.error("response.path_exists"); |
| | | } |
| | | staDesc.setModiUser(getUserId()); |
| | | staDesc.setModiTime(new Date()); |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/staDesc/update/auth") |
| | | @ManagerAuth(memo = "站点路径修改") |
| | | @ManagerAuth(memo = "response.station_path_update") |
| | | public R update(StaDesc staDesc){ |
| | | if (Cools.isEmpty(staDesc) || null==staDesc.getTypeId()){ |
| | | return R.error(); |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/staDesc/delete/auth") |
| | | @ManagerAuth(memo = "站点路径删除") |
| | | @ManagerAuth(memo = "response.station_path_delete") |
| | | public R delete(@RequestParam String param){ |
| | | List<StaDesc> list = JSONArray.parseArray(param, StaDesc.class); |
| | | if (Cools.isEmpty(list)){ |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/staDesc/export/auth") |
| | | @ManagerAuth(memo = "站点路径导出") |
| | | @ManagerAuth(memo = "response.station_path_export") |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<StaDesc> wrapper = new EntityWrapper<>(); |
| | |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != staDescService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(StaDesc.class, String.valueOf(param.get("key")))); |
| | | R r = R.parse(BaseRes.REPEAT); |
| | | r.put("data",getComment(StaDesc.class, String.valueOf(param.get("key")))); |
| | | return r; |
| | | } |
| | | return R.ok(); |
| | | } |