Merge remote-tracking branch 'origin/master' into master-jxthTV
1个文件已删除
3个文件已添加
104个文件已修改
| | |
| | | <parent> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-parent</artifactId> |
| | | <version>2.5.14</version> |
| | | <version>3.5.11</version> |
| | | <relativePath/> <!-- lookup parent from repository --> |
| | | </parent> |
| | | <groupId>com.zy</groupId> |
| | |
| | | <packaging>war</packaging> |
| | | |
| | | <properties> |
| | | <java.version>1.8</java.version> |
| | | <java.version>17</java.version> |
| | | <cool.version>3.4.0</cool.version> |
| | | <mysql-driver.version>5.1.47</mysql-driver.version> |
| | | <mybatis-plus.version>2.3.2</mybatis-plus.version> |
| | | <mybatis-plus.version>3.5.14</mybatis-plus.version> |
| | | <spring-ai.version>1.1.2</spring-ai.version> |
| | | <fastjson.version>1.2.83</fastjson.version> |
| | | <springfox.version>2.7.0</springfox.version> |
| | | </properties> |
| | | |
| | | <dependencyManagement> |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.springframework.ai</groupId> |
| | | <artifactId>spring-ai-bom</artifactId> |
| | | <version>${spring-ai.version}</version> |
| | | <type>pom</type> |
| | | <scope>import</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | </dependencyManagement> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | |
| | | <version>${cool.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>mysql</groupId> |
| | | <artifactId>mysql-connector-java</artifactId> |
| | | <version>5.1.46</version> |
| | | <groupId>com.mysql</groupId> |
| | | <artifactId>mysql-connector-j</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.microsoft.sqlserver</groupId> |
| | | <artifactId>mssql-jdbc</artifactId> |
| | | <version>8.2.2.jre8</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-boot-starter</artifactId> |
| | | <artifactId>mybatis-plus-spring-boot3-starter</artifactId> |
| | | <version>${mybatis-plus.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-jsqlparser</artifactId> |
| | | <version>${mybatis-plus.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | |
| | | <version>${fastjson.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-swagger2</artifactId> |
| | | <version>${springfox.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-swagger-ui</artifactId> |
| | | <version>${springfox.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.github.xiaoymin</groupId> |
| | | <artifactId>swagger-bootstrap-ui</artifactId> |
| | | <version>1.8.9</version> |
| | | <groupId>io.swagger.core.v3</groupId> |
| | | <artifactId>swagger-annotations-jakarta</artifactId> |
| | | <version>2.2.39</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | <version>1.16.22</version> |
| | | <scope>provided</scope> |
| | | </dependency> |
| | | <!-- okHttp3 --> |
| | |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-aop</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.ai</groupId> |
| | | <artifactId>spring-ai-client-chat</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | |
| | | @RequestMapping(value = "/apiLog/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(apiLogService.selectById(String.valueOf(id))); |
| | | return R.ok(apiLogService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/apiLog/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<ApiLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<ApiLog> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(ApiLog.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} else { |
| | | wrapper.orderBy("create_time", false); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} else { |
| | | wrapper.orderBy(true, false, "create_time"); |
| | | } |
| | | return R.ok(apiLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | return R.ok(apiLogService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | @RequestMapping(value = "/apiLog/add/auth") |
| | | @ManagerAuth |
| | | public R add(ApiLog apiLog) { |
| | | apiLogService.insert(apiLog); |
| | | apiLogService.save(apiLog); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | apiLogService.deleteById(id); |
| | | apiLogService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @RequestMapping(value = "/apiLog/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<ApiLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<ApiLog> wrapper = new QueryWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("apiLog")); |
| | | convert(map, wrapper); |
| | | List<ApiLog> list = apiLogService.selectList(wrapper); |
| | | List<ApiLog> list = apiLogService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/apiLogQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<ApiLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<ApiLog> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("uuid", condition); |
| | | Page<ApiLog> page = apiLogService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<ApiLog> page = apiLogService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (ApiLog apiLog : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/apiLog/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<ApiLog> wrapper = new EntityWrapper<ApiLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != apiLogService.selectOne(wrapper)){ |
| | | Wrapper<ApiLog> wrapper = new QueryWrapper<ApiLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != apiLogService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(ApiLog.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | |
| | | @RequestMapping(value = "/apkBuildTask/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok(apkBuildTaskService.selectById(id)); |
| | | return R.ok(apkBuildTaskService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @RequestParam(required = false) String orderByType, |
| | | @RequestParam Map<String, Object> param) { |
| | | excludeTrash(param); |
| | | EntityWrapper<ApkBuildTask> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<ApkBuildTask> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | |
| | | if (!Cools.isEmpty(orderByField)) { |
| | | wrapper.orderBy(orderByField, "asc".equalsIgnoreCase(orderByType)); |
| | | wrapper.orderBy(true, "asc".equalsIgnoreCase(orderByType), orderByField); |
| | | } else { |
| | | wrapper.orderBy("id", false); |
| | | wrapper.orderBy(true, false, "id"); |
| | | } |
| | | |
| | | return R.ok(apkBuildTaskService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | return R.ok(apkBuildTaskService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | /** |
| | | * æç´¢åæ°è½¬æ¢ |
| | | */ |
| | | private void convert(Map<String, Object> map, EntityWrapper<ApkBuildTask> wrapper) { |
| | | private void convert(Map<String, Object> map, QueryWrapper<ApkBuildTask> wrapper) { |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | String key = entry.getKey(); |
| | | Object value = entry.getValue(); |
| | |
| | | try { |
| | | int count = apkBuildTaskService.refreshAllPendingTasks(); |
| | | // è¿åææä»»å¡å表 |
| | | EntityWrapper<ApkBuildTask> wrapper = new EntityWrapper<>(); |
| | | wrapper.orderBy("id", false); |
| | | List<ApkBuildTask> tasks = apkBuildTaskService.selectList(wrapper); |
| | | QueryWrapper<ApkBuildTask> wrapper = new QueryWrapper<>(); |
| | | wrapper.orderBy(true, false, "id"); |
| | | List<ApkBuildTask> tasks = apkBuildTaskService.list(wrapper); |
| | | Map<String, Object> result = new HashMap<>(); |
| | | result.put("tasks", tasks); |
| | | result.put("refreshedCount", count); |
| | |
| | | if (ids == null || ids.length == 0) { |
| | | return R.error(); |
| | | } |
| | | apkBuildTaskService.deleteBatchIds(Arrays.asList(ids)); |
| | | apkBuildTaskService.removeByIds(Arrays.asList(ids)); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.BasStation; |
| | | import com.zy.asrs.service.BasStationService; |
| | |
| | | @RequestMapping(value = "/basStation/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(basStationService.selectById(String.valueOf(id))); |
| | | return R.ok(basStationService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basStation/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<BasStation> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasStation> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(BasStation.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(basStationService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | return R.ok(basStationService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | @RequestMapping(value = "/basStation/add/auth") |
| | | @ManagerAuth |
| | | public R add(BasStation basStation) { |
| | | basStationService.insert(basStation); |
| | | basStationService.save(basStation); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Integer[] ids){ |
| | | for (Integer id : ids){ |
| | | basStationService.deleteById(id); |
| | | basStationService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @RequestMapping(value = "/basStation/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<BasStation> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasStation> wrapper = new QueryWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("basStation")); |
| | | convert(map, wrapper); |
| | | List<BasStation> list = basStationService.selectList(wrapper); |
| | | List<BasStation> list = basStationService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basStationQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<BasStation> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasStation> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("station_id", condition); |
| | | Page<BasStation> page = basStationService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<BasStation> page = basStationService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasStation basStation : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/basStation/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasStation> wrapper = new EntityWrapper<BasStation>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basStationService.selectOne(wrapper)){ |
| | | Wrapper<BasStation> wrapper = new QueryWrapper<BasStation>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basStationService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasStation.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.R; |
| | | import com.core.controller.AbstractBaseController; |
| | |
| | | public R getData() { |
| | | // 1. è·åææç«ç¹ |
| | | List<BasStation> stations = basStationService |
| | | .selectList(new EntityWrapper<BasStation>().orderBy("station_id", true)); |
| | | .list(new QueryWrapper<BasStation>().orderBy(true, true, "station_id")); |
| | | |
| | | // 2. è·åææçµè§æº (æåç§°æåº) |
| | | List<TvDevice> tvs = tvDeviceService.selectList(new EntityWrapper<TvDevice>().orderBy("name", true)); |
| | | List<TvDevice> tvs = tvDeviceService.list(new QueryWrapper<TvDevice>().orderBy(true, true, "name")); |
| | | |
| | | // 3. è·åææç»å®å
³ç³» |
| | | List<BasStationTv> relations = basStationTvService.selectList(new EntityWrapper<>()); |
| | | List<BasStationTv> relations = basStationTvService.list(new QueryWrapper<>()); |
| | | |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("stations", stations); |
| | |
| | | |
| | | // å
¨éæ¿æ¢çç¥ï¼å
å é¤æææ§å
³ç³»ï¼åæå
¥æ°å
³ç³» |
| | | // 注æï¼è¿é没æäºå¡æ§å¶ï¼å¦æè¦æ±ä¸¥æ ¼ä¸è´æ§ï¼å»ºè®®å¨Serviceå±å @Transactional |
| | | basStationTvService.delete(new EntityWrapper<>()); |
| | | basStationTvService.remove(new QueryWrapper<>()); |
| | | |
| | | if (relations != null && !relations.isEmpty()) { |
| | | basStationTvService.insertBatch(relations); |
| | | basStationTvService.saveBatch(relations); |
| | | } |
| | | |
| | | return R.ok(); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.HttpRequestLog; |
| | | import com.zy.asrs.service.HttpRequestLogService; |
| | |
| | | @RequestMapping(value = "/httpRequestLog/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(httpRequestLogService.selectById(String.valueOf(id))); |
| | | return R.ok(httpRequestLogService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/httpRequestLog/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<HttpRequestLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<HttpRequestLog> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(HttpRequestLog.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | wrapper.orderBy("create_time desc"); |
| | | return R.ok(httpRequestLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | wrapper.orderByDesc("create_time"); |
| | | return R.ok(httpRequestLogService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | @RequestMapping(value = "/httpRequestLog/add/auth") |
| | | @ManagerAuth |
| | | public R add(HttpRequestLog httpRequestLog) { |
| | | httpRequestLogService.insert(httpRequestLog); |
| | | httpRequestLogService.save(httpRequestLog); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Integer[] ids){ |
| | | for (Integer id : ids){ |
| | | httpRequestLogService.deleteById(id); |
| | | httpRequestLogService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @RequestMapping(value = "/httpRequestLog/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<HttpRequestLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<HttpRequestLog> wrapper = new QueryWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("httpRequestLog")); |
| | | convert(map, wrapper); |
| | | List<HttpRequestLog> list = httpRequestLogService.selectList(wrapper); |
| | | List<HttpRequestLog> list = httpRequestLogService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/httpRequestLogQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<HttpRequestLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<HttpRequestLog> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<HttpRequestLog> page = httpRequestLogService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<HttpRequestLog> page = httpRequestLogService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (HttpRequestLog httpRequestLog : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/httpRequestLog/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<HttpRequestLog> wrapper = new EntityWrapper<HttpRequestLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != httpRequestLogService.selectOne(wrapper)){ |
| | | Wrapper<HttpRequestLog> wrapper = new QueryWrapper<HttpRequestLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != httpRequestLogService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(HttpRequestLog.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | |
| | | public R getLedInfos(HttpServletRequest request) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | String remoteAddr = request.getRemoteAddr(); |
| | | TvDevice tvDevice = tvDeviceService.selectOne( |
| | | new EntityWrapper<TvDevice>().eq("ip", remoteAddr)); |
| | | TvDevice tvDevice = tvDeviceService.getOne( |
| | | new QueryWrapper<TvDevice>().eq("ip", remoteAddr)); |
| | | if (tvDevice == null) { |
| | | return R.error("æªæ¾å°IP对åºççµè§æºè®¾å¤: " + remoteAddr); |
| | | } |
| | | map.put("deviceName", tvDevice.getName()); |
| | | |
| | | List<BasStationTv> relations = basStationTvService |
| | | .selectList(new EntityWrapper<BasStationTv>().eq("tv_id", tvDevice.getId())); |
| | | .list(new QueryWrapper<BasStationTv>().eq("tv_id", tvDevice.getId())); |
| | | if (relations == null || relations.isEmpty()) { |
| | | map.put("data", new ArrayList<>()); |
| | | return R.ok().add(map); |
| | |
| | | } |
| | | |
| | | String remoteAddr = request.getRemoteAddr(); |
| | | TvDevice tvDevice = tvDeviceService.selectOne( |
| | | new EntityWrapper<TvDevice>().eq("ip", remoteAddr)); |
| | | TvDevice tvDevice = tvDeviceService.getOne( |
| | | new QueryWrapper<TvDevice>().eq("ip", remoteAddr)); |
| | | if (tvDevice != null) { |
| | | List<BasStationTv> relations = basStationTvService |
| | | .selectList(new EntityWrapper<BasStationTv>().eq("tv_id", tvDevice.getId())); |
| | | .list(new QueryWrapper<BasStationTv>().eq("tv_id", tvDevice.getId())); |
| | | if (relations != null && !relations.isEmpty()) { |
| | | for (BasStationTv relation : relations) { |
| | | WcsStationDto wcsStationDto = stationUtils.stationMap.get(relation.getStationId()); |
| | |
| | | |
| | | @GetMapping("/announcement") |
| | | public R top5(){ |
| | | EntityWrapper<Announcement> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Announcement> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("status", 1); |
| | | wrapper.orderBy("create_time", false); |
| | | wrapper.orderBy(true, false, "create_time"); |
| | | wrapper.last("limit 5"); |
| | | return R.ok(announcementService.selectList(wrapper)); |
| | | return R.ok(announcementService.list(wrapper)); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | |
| | | @RequestMapping(value = "/tvDevice/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok(tvDeviceService.selectById(id)); |
| | | return R.ok(tvDeviceService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @RequestParam(defaultValue = "10") Integer limit, |
| | | @RequestParam Map<String, Object> param) { |
| | | excludeTrash(param); |
| | | EntityWrapper<TvDevice> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<TvDevice> wrapper = new QueryWrapper<>(); |
| | | |
| | | for (Map.Entry<String, Object> entry : param.entrySet()) { |
| | | String key = entry.getKey(); |
| | |
| | | } |
| | | } |
| | | |
| | | wrapper.orderBy("id", false); |
| | | return R.ok(tvDeviceService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | wrapper.orderBy(true, false, "id"); |
| | | return R.ok(tvDeviceService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @RequestMapping(value = "/tvDevice/all/auth") |
| | | @ManagerAuth |
| | | public R listAll() { |
| | | EntityWrapper<TvDevice> wrapper = new EntityWrapper<>(); |
| | | wrapper.orderBy("name", true); |
| | | return R.ok(tvDeviceService.selectList(wrapper)); |
| | | QueryWrapper<TvDevice> wrapper = new QueryWrapper<>(); |
| | | wrapper.orderBy(true, true, "name"); |
| | | return R.ok(tvDeviceService.list(wrapper)); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | // æ£æ¥IPæ¯å¦å·²åå¨ |
| | | EntityWrapper<TvDevice> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<TvDevice> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("ip", device.getIp()); |
| | | if (tvDeviceService.selectCount(wrapper) > 0) { |
| | | if (tvDeviceService.count(wrapper) > 0) { |
| | | return R.error("该IPå·²åå¨"); |
| | | } |
| | | |
| | |
| | | device.setStatus((short) 0); |
| | | device.setCreateTime(new Date()); |
| | | device.setUpdateTime(new Date()); |
| | | tvDeviceService.insert(device); |
| | | tvDeviceService.save(device); |
| | | return R.ok(device); |
| | | } |
| | | |
| | |
| | | |
| | | // æ£æ¥IPæ¯å¦å·²è¢«å
¶ä»è®¾å¤ä½¿ç¨ |
| | | if (!Cools.isEmpty(device.getIp())) { |
| | | EntityWrapper<TvDevice> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<TvDevice> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("ip", device.getIp()).ne("id", device.getId()); |
| | | if (tvDeviceService.selectCount(wrapper) > 0) { |
| | | if (tvDeviceService.count(wrapper) > 0) { |
| | | return R.error("该IP已被å
¶ä»è®¾å¤ä½¿ç¨"); |
| | | } |
| | | } |
| | |
| | | if (ids == null || ids.length == 0) { |
| | | return R.error(); |
| | | } |
| | | tvDeviceService.deleteBatchIds(Arrays.asList(ids)); |
| | | tvDeviceService.removeByIds(Arrays.asList(ids)); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | String result = tvDeviceService.testConnection(id); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("result", result); |
| | | data.put("device", tvDeviceService.selectById(id)); |
| | | data.put("device", tvDeviceService.getById(id)); |
| | | return R.ok(data); |
| | | } catch (Exception e) { |
| | | return R.error("è¿æ¥å¤±è´¥: " + e.getMessage()); |
| | |
| | | return R.error("è¯·éæ©å®è£
设å¤"); |
| | | } |
| | | |
| | | ApkBuildTask task = apkBuildTaskService.selectById(taskId); |
| | | ApkBuildTask task = apkBuildTaskService.getById(taskId); |
| | | if (task == null) { |
| | | return R.error("æå
ä»»å¡ä¸åå¨"); |
| | | } |
| | |
| | | String result = tvDeviceService.launchApp(id, packageName); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("result", result); |
| | | data.put("device", tvDeviceService.selectById(id)); |
| | | data.put("device", tvDeviceService.getById(id)); |
| | | return R.ok(data); |
| | | } catch (Exception e) { |
| | | return R.error("å¯å¨å¤±è´¥: " + e.getMessage()); |
| | |
| | | String base64Image = tvDeviceService.captureScreen(id); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("image", base64Image); |
| | | data.put("device", tvDeviceService.selectById(id)); |
| | | data.put("device", tvDeviceService.getById(id)); |
| | | return R.ok(data); |
| | | } catch (Exception e) { |
| | | return R.error("æªå¾å¤±è´¥: " + e.getMessage()); |
| | |
| | | String result = tvDeviceService.restartApp(id, packageName); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("result", result); |
| | | data.put("device", tvDeviceService.selectById(id)); |
| | | data.put("device", tvDeviceService.getById(id)); |
| | | return R.ok(data); |
| | | } catch (Exception e) { |
| | | return R.error("éå¯å¤±è´¥: " + e.getMessage()); |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | @Schema(description = "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * æ¥å¿ç¼å· |
| | | */ |
| | | @ApiModelProperty(value= "æ¥å¿ç¼å·") |
| | | @Schema(description = "æ¥å¿ç¼å·") |
| | | private String uuid; |
| | | |
| | | /** |
| | | * åç§°ç©ºé´ |
| | | */ |
| | | @ApiModelProperty(value= "å称空é´") |
| | | @Schema(description = "å称空é´") |
| | | private String namespace; |
| | | |
| | | /** |
| | | * æ¥å£å°å |
| | | */ |
| | | @ApiModelProperty(value= "æ¥å£å°å") |
| | | @Schema(description = "æ¥å£å°å") |
| | | private String url; |
| | | |
| | | /** |
| | | * å¹³å°å¯é¥ |
| | | */ |
| | | @ApiModelProperty(value= "å¹³å°å¯é¥") |
| | | @Schema(description = "å¹³å°å¯é¥") |
| | | private String appkey; |
| | | |
| | | /** |
| | | * æ¶é´æ³ |
| | | */ |
| | | @ApiModelProperty(value= "æ¶é´æ³") |
| | | @Schema(description = "æ¶é´æ³") |
| | | private String timestamp; |
| | | |
| | | /** |
| | | * 客æ·ç«¯IP |
| | | */ |
| | | @ApiModelProperty(value= "客æ·ç«¯IP") |
| | | @Schema(description = "客æ·ç«¯IP") |
| | | @TableField("client_ip") |
| | | private String clientIp; |
| | | |
| | | /** |
| | | * 请æ±å
容 |
| | | */ |
| | | @ApiModelProperty(value= "请æ±å
容") |
| | | @Schema(description = "请æ±å
容") |
| | | private String request; |
| | | |
| | | /** |
| | | * ååºå
容 |
| | | */ |
| | | @ApiModelProperty(value= "ååºå
容") |
| | | @Schema(description = "ååºå
容") |
| | | private String response; |
| | | |
| | | /** |
| | | * å¼å¸¸å
容 |
| | | */ |
| | | @ApiModelProperty(value= "å¼å¸¸å
容") |
| | | @Schema(description = "å¼å¸¸å
容") |
| | | private String err; |
| | | |
| | | /** |
| | | * ç»æ 1: æå 0: 失败 |
| | | */ |
| | | @ApiModelProperty(value= "ç»æ 1: æå 0: 失败 ") |
| | | @Schema(description = "ç»æ 1: æå 0: 失败 ") |
| | | private Integer result; |
| | | |
| | | /** |
| | | * ç¶æ 1: æ£å¸¸ 0: ç¦ç¨ |
| | | */ |
| | | @ApiModelProperty(value= "ç¶æ 1: æ£å¸¸ 0: ç¦ç¨ ") |
| | | @Schema(description = "ç¶æ 1: æ£å¸¸ 0: ç¦ç¨ ") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * æ·»å æ¶é´ |
| | | */ |
| | | @ApiModelProperty(value= "æ·»å æ¶é´") |
| | | @Schema(description = "æ·»å æ¶é´") |
| | | @TableField("create_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | |
| | | /** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @ApiModelProperty(value= "ä¿®æ¹æ¶é´") |
| | | @Schema(description = "ä¿®æ¹æ¶é´") |
| | | @TableField("update_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ApiModelProperty(value= "夿³¨") |
| | | @Schema(description = "夿³¨") |
| | | private String memo; |
| | | |
| | | public ApiLog() {} |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | |
| | | /** |
| | | * ç¼å· |
| | | */ |
| | | @ApiModelProperty(value= "ç¼å·") |
| | | @Schema(description = "ç¼å·") |
| | | @TableId(value = "station_id", type = IdType.INPUT) |
| | | @TableField("station_id") |
| | | private Integer stationId; |
| | |
| | | /** |
| | | * ç¶æ 1: æ£å¸¸ 0: ç¦ç¨ |
| | | */ |
| | | @ApiModelProperty(value= "ç¶æ 1: æ£å¸¸ 0: ç¦ç¨ ") |
| | | @Schema(description = "ç¶æ 1: æ£å¸¸ 0: ç¦ç¨ ") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * å·¥ä½å· |
| | | */ |
| | | @ApiModelProperty(value= "å·¥ä½å·") |
| | | @Schema(description = "å·¥ä½å·") |
| | | @TableField("wrk_no") |
| | | private Integer wrkNo; |
| | | |
| | | /** |
| | | * å¯å
¥(checkBox) |
| | | */ |
| | | @ApiModelProperty(value= "å¯å
¥(checkBox)") |
| | | @Schema(description = "å¯å
¥(checkBox)") |
| | | @TableField("in_enable") |
| | | private String inEnable; |
| | | |
| | | /** |
| | | * å¯åº(checkBox) |
| | | */ |
| | | @ApiModelProperty(value= "å¯åº(checkBox)") |
| | | @Schema(description = "å¯åº(checkBox)") |
| | | @TableField("out_enable") |
| | | private String outEnable; |
| | | |
| | | /** |
| | | * å建人å |
| | | */ |
| | | @ApiModelProperty(value= "å建人å") |
| | | @Schema(description = "å建人å") |
| | | @TableField("create_by") |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @ApiModelProperty(value= "å建æ¶é´") |
| | | @Schema(description = "å建æ¶é´") |
| | | @TableField("create_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | |
| | | /** |
| | | * ä¿®æ¹äººå |
| | | */ |
| | | @ApiModelProperty(value= "ä¿®æ¹äººå") |
| | | @Schema(description = "ä¿®æ¹äººå") |
| | | @TableField("update_by") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @ApiModelProperty(value= "ä¿®æ¹æ¶é´") |
| | | @Schema(description = "ä¿®æ¹æ¶é´") |
| | | @TableField("update_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ApiModelProperty(value= "夿³¨") |
| | | @Schema(description = "夿³¨") |
| | | private String memo; |
| | | |
| | | public BasStation() {} |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import java.io.Serializable; |
| | | |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @Schema(description = "") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @Schema(description = "") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @Schema(description = "") |
| | | private String request; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @Schema(description = "") |
| | | private String response; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @Schema(description = "") |
| | | @TableField("create_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @Schema(description = "") |
| | | private Integer result; |
| | | |
| | | public HttpRequestLog() {} |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.ApiLog; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.ApkBuildTask; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.BasStation; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.BasStationTv; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.HttpRequestLog; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.TvDevice; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.asrs.entity.ApiLog; |
| | | |
| | | public interface ApiLogService extends IService<ApiLog> { |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.asrs.entity.ApkBuildTask; |
| | | |
| | | import java.util.List; |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.BasStation; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface BasStationService extends IService<BasStation> { |
| | | |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.asrs.entity.BasStationTv; |
| | | |
| | | /** |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.HttpRequestLog; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface HttpRequestLogService extends IService<HttpRequestLog> { |
| | | |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.asrs.entity.TvDevice; |
| | | |
| | | import java.util.List; |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.core.common.SnowflakeIdWorker; |
| | | import com.zy.asrs.entity.ApiLog; |
| | | import com.zy.asrs.mapper.ApiLogMapper; |
| | |
| | | null, // ä¿®æ¹æ¶é´ |
| | | null // 夿³¨ |
| | | ); |
| | | if (!this.insert(apiLog)) { |
| | | if (!this.save(apiLog)) { |
| | | log.error("æ¥å£è°ç¨æ¥å¿ä¿å失败ï¼"); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.asrs.entity.ApkBuildTask; |
| | | import com.zy.asrs.mapper.ApkBuildTaskMapper; |
| | | import com.zy.asrs.service.ApkBuildTaskService; |
| | |
| | | task.setQueueSize(queueSize); |
| | | task.setCreatedAt(new Date()); |
| | | |
| | | this.insert(task); |
| | | this.save(task); |
| | | return task; |
| | | } |
| | | |
| | | @Override |
| | | public ApkBuildTask refreshStatus(Long id) throws Exception { |
| | | ApkBuildTask task = this.selectById(id); |
| | | ApkBuildTask task = this.getById(id); |
| | | if (task == null) { |
| | | throw new RuntimeException("ä»»å¡ä¸åå¨"); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public String downloadApk(Long id) throws Exception { |
| | | ApkBuildTask task = this.selectById(id); |
| | | ApkBuildTask task = this.getById(id); |
| | | if (task == null) { |
| | | throw new RuntimeException("ä»»å¡ä¸åå¨"); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public String installApk(Long id, String deviceIp) throws Exception { |
| | | ApkBuildTask task = this.selectById(id); |
| | | ApkBuildTask task = this.getById(id); |
| | | if (task == null) { |
| | | throw new RuntimeException("ä»»å¡ä¸åå¨"); |
| | | } |
| | |
| | | import com.zy.asrs.mapper.BasStationMapper; |
| | | import com.zy.asrs.entity.BasStation; |
| | | import com.zy.asrs.service.BasStationService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("basStationService") |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.asrs.entity.BasStationTv; |
| | | import com.zy.asrs.mapper.BasStationTvMapper; |
| | | import com.zy.asrs.service.BasStationTvService; |
| | |
| | | import com.zy.asrs.mapper.HttpRequestLogMapper; |
| | | import com.zy.asrs.entity.HttpRequestLog; |
| | | import com.zy.asrs.service.HttpRequestLogService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("httpRequestLogService") |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.asrs.entity.TvDevice; |
| | | import com.zy.asrs.mapper.TvDeviceMapper; |
| | | import com.zy.asrs.service.TvDeviceService; |
| | |
| | | |
| | | @Override |
| | | public String testConnection(Long id) throws Exception { |
| | | TvDevice device = this.selectById(id); |
| | | TvDevice device = this.getById(id); |
| | | if (device == null) { |
| | | throw new RuntimeException("设å¤ä¸åå¨"); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public int refreshAllStatus() { |
| | | List<TvDevice> devices = this.selectList(null); |
| | | List<TvDevice> devices = this.list(new QueryWrapper<>()); |
| | | int count = 0; |
| | | for (TvDevice device : devices) { |
| | | try { |
| | |
| | | |
| | | @Override |
| | | public String installApk(Long deviceId, String apkPath) throws Exception { |
| | | TvDevice device = this.selectById(deviceId); |
| | | TvDevice device = this.getById(deviceId); |
| | | if (device == null) { |
| | | throw new RuntimeException("设å¤ä¸åå¨"); |
| | | } |
| | |
| | | public List<String> batchInstallApk(List<Long> deviceIds, String apkPath) { |
| | | List<String> results = new ArrayList<>(); |
| | | for (Long deviceId : deviceIds) { |
| | | TvDevice device = this.selectById(deviceId); |
| | | TvDevice device = this.getById(deviceId); |
| | | String deviceName = device != null ? device.getName() : "ID:" + deviceId; |
| | | try { |
| | | String result = installApk(deviceId, apkPath); |
| | |
| | | |
| | | @Override |
| | | public List<TvDevice> getOnlineDevices() { |
| | | return this.selectList(new EntityWrapper<TvDevice>().eq("status", 1)); |
| | | return this.list(new QueryWrapper<TvDevice>().eq("status", 1)); |
| | | } |
| | | |
| | | @Override |
| | | public String launchApp(Long deviceId, String packageName) throws Exception { |
| | | TvDevice device = this.selectById(deviceId); |
| | | TvDevice device = this.getById(deviceId); |
| | | if (device == null) { |
| | | throw new RuntimeException("设å¤ä¸åå¨"); |
| | | } |
| | |
| | | public List<String> batchLaunchApp(List<Long> deviceIds, String packageName) { |
| | | List<String> results = new ArrayList<>(); |
| | | for (Long deviceId : deviceIds) { |
| | | TvDevice device = this.selectById(deviceId); |
| | | TvDevice device = this.getById(deviceId); |
| | | String deviceName = device != null ? device.getName() : "ID:" + deviceId; |
| | | try { |
| | | String result = launchApp(deviceId, packageName); |
| | |
| | | |
| | | @Override |
| | | public String captureScreen(Long deviceId) throws Exception { |
| | | TvDevice device = this.selectById(deviceId); |
| | | TvDevice device = this.getById(deviceId); |
| | | if (device == null) { |
| | | throw new RuntimeException("设å¤ä¸åå¨"); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public String stopApp(Long deviceId, String packageName) throws Exception { |
| | | TvDevice device = this.selectById(deviceId); |
| | | TvDevice device = this.getById(deviceId); |
| | | if (device == null) { |
| | | throw new RuntimeException("设å¤ä¸åå¨"); |
| | | } |
| | |
| | | public List<String> batchRestartApp(List<Long> deviceIds, String packageName) { |
| | | List<String> results = new ArrayList<>(); |
| | | for (Long deviceId : deviceIds) { |
| | | TvDevice device = this.selectById(deviceId); |
| | | TvDevice device = this.getById(deviceId); |
| | | String deviceName = device != null ? device.getName() : "ID:" + deviceId; |
| | | try { |
| | | String result = restartApp(deviceId, packageName); |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.zy.asrs.entity.BasStation; |
| | | import com.zy.asrs.entity.dto.WcsStationDto; |
| | | import com.zy.asrs.service.BasStationService; |
| | |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | public synchronized void execute() { |
| | | Config wcsStationUrlConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wcsStationUrl")); |
| | | Config wcsStationUrlConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "wcsStationUrl")); |
| | | if (wcsStationUrlConfig == null) { |
| | | return; |
| | | } |
| | |
| | | HashMap<String, Object> requestParam = new HashMap<>(); |
| | | |
| | | List<Integer> list = new ArrayList<>(); |
| | | List<BasStation> basStations = basStationService.selectList(new EntityWrapper<>()); |
| | | List<BasStation> basStations = basStationService.list(new QueryWrapper<>()); |
| | | for (BasStation basStation : basStations) { |
| | | list.add(basStation.getStationId()); |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.BasStation; |
| | | import com.zy.asrs.entity.dto.*; |
| | |
| | | //WMS任塿¥è¯¢æ¥å£ |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | public synchronized void taskQuery() { |
| | | Config wmsTaskQueryUrlConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsTaskQueryUrl")); |
| | | Config wmsTaskQueryUrlConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "wmsTaskQueryUrl")); |
| | | if (wmsTaskQueryUrlConfig == null) { |
| | | return; |
| | | } |
| | |
| | | try { |
| | | HashMap<String, Object> requestParam = new HashMap<>(); |
| | | |
| | | List<BasStation> basStations = basStationService.selectList(new EntityWrapper<BasStation>().eq("out_enable", "Y")); |
| | | List<BasStation> basStations = basStationService.list(new QueryWrapper<BasStation>().eq("out_enable", "Y")); |
| | | for (BasStation basStation : basStations) { |
| | | WcsStationDto wcsStationDto = stationUtils.stationMap.get(basStation.getStationId()); |
| | | if (wcsStationDto == null) { |
| | |
| | | //WMSå
¥åºä»»å¡æ¥è¯¢æ¥å£ |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | public synchronized void inTaskQuery() { |
| | | Config wmsCombQueryUrlConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsCombQueryUrl")); |
| | | Config wmsCombQueryUrlConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "wmsCombQueryUrl")); |
| | | if (wmsCombQueryUrlConfig == null) { |
| | | return; |
| | | } |
| | |
| | | try { |
| | | HashMap<String, Object> requestParam = new HashMap<>(); |
| | | |
| | | List<BasStation> basStations = basStationService.selectList(new EntityWrapper<BasStation>().eq("in_enable", "Y")); |
| | | List<BasStation> basStations = basStationService.list(new QueryWrapper<BasStation>().eq("in_enable", "Y")); |
| | | for (BasStation basStation : basStations) { |
| | | WcsStationDto wcsStationDto = stationUtils.stationMap.get(basStation.getStationId()); |
| | | if (wcsStationDto == null) { |
| | |
| | | @Synchronized |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | public void locQuery() { |
| | | Config wmsUrlConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsLocQueryUrl")); |
| | | Config wmsUrlConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "wmsLocQueryUrl")); |
| | | if (wmsUrlConfig == null) { |
| | | return; |
| | | } |
| | |
| | | @Synchronized |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | public void inOutLineCharts() { |
| | | Config wmsUrlConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsInOutLineChartsQueryUrl")); |
| | | Config wmsUrlConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "wmsInOutLineChartsQueryUrl")); |
| | | if (wmsUrlConfig == null) { |
| | | return; |
| | | } |
| | |
| | | @Synchronized |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | public void locDetlStatistics() { |
| | | Config wmsUrlConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsLocDetlStatisticsQueryUrl")); |
| | | Config wmsUrlConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "wmsLocDetlStatisticsQueryUrl")); |
| | | if (wmsUrlConfig == null) { |
| | | return; |
| | | } |
| | |
| | | package com.zy.common.config; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.method.HandlerMethod; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; |
| | | import org.springframework.web.servlet.HandlerInterceptor; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.lang.reflect.Method; |
| | | |
| | | /** |
| | | * Created by vincent on 2019-06-13 |
| | | */ |
| | | @Component |
| | | public class AdminInterceptor extends HandlerInterceptorAdapter { |
| | | public class AdminInterceptor implements HandlerInterceptor { |
| | | |
| | | @Value("${super.pwd}") |
| | | private String superPwd; |
| | |
| | | // if (obj instanceof OperateLog) { |
| | | // OperateLog operate = (OperateLog) obj; |
| | | // operate.setResponse(String.valueOf(response.getStatus())); |
| | | // operateLogService.insert(operate); |
| | | // operateLogService.save(operate); |
| | | // } |
| | | } |
| | | |
| | | private boolean check(HttpServletRequest request, HttpServletResponse response, String memo) { |
| | | try { |
| | | String token = request.getHeader("token"); |
| | | UserLogin userLogin = userLoginService.selectOne(new EntityWrapper<UserLogin>().eq("token", token).eq("system", "WCS")); |
| | | UserLogin userLogin = userLoginService.getOne(new QueryWrapper<UserLogin>().eq("token", token).eq("system", "WCS")); |
| | | if (null == userLogin){ |
| | | Http.response(response, BaseRes.DENIED); |
| | | return false; |
| | | } |
| | | User user = userService.selectById(userLogin.getUserId()); |
| | | User user = userService.getById(userLogin.getUserId()); |
| | | String deToken = Cools.deTokn(token, user.getPassword()); |
| | | long timestamp = Long.parseLong(deToken.substring(0, 13)); |
| | | // 1天åè¿æ |
| | |
| | | operateLog.setUserId(user.getId()); |
| | | operateLog.setRequest(JSON.toJSONString(request.getParameterMap())); |
| | | operateLog.setResponse(JSON.toJSONString(request.getRequestURI())); |
| | | operateLogService.insert(operateLog); |
| | | operateLogService.save(operateLog); |
| | | // 请æ±ç¼å |
| | | request.setAttribute("userId", user.getId()); |
| | | // request.setAttribute("operateLog", operateLog); |
| | |
| | | Permission permission = new Permission(); |
| | | permission.setAction(action); |
| | | permission.setStatus((short) 1); |
| | | Permission one = permissionService.selectOne(new EntityWrapper<>(permission)); |
| | | Permission one = permissionService.getOne(new QueryWrapper<>(permission)); |
| | | if (!Cools.isEmpty(one)) { |
| | | RolePermission rolePermission = rolePermissionService.selectOne(new EntityWrapper<>(new RolePermission(user.getRoleId(), permission.getId()))); |
| | | RolePermission rolePermission = rolePermissionService.getOne(new QueryWrapper<>(new RolePermission(user.getRoleId(), permission.getId()))); |
| | | return !Cools.isEmpty(rolePermission); |
| | | } |
| | | return true; |
| | |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.lang.reflect.Method; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | |
| | | } |
| | | |
| | | private void saveLog(ProceedingJoinPoint joinPoint, HttpServletRequest request, Object result, String memo) { |
| | | apiLogService.insert(new ApiLog( |
| | | apiLogService.save(new ApiLog( |
| | | null, |
| | | memo, |
| | | request != null ? Optional.ofNullable(String.valueOf(request.getRequestURI())).orElse(null) : null, |
| | |
| | | |
| | | private void saveErrLog(ProceedingJoinPoint joinPoint, HttpServletRequest request, Object response, Throwable ex, |
| | | String memo) { |
| | | apiLogService.insert(new ApiLog( |
| | | apiLogService.save(new ApiLog( |
| | | null, |
| | | memo, |
| | | request != null ? Optional.ofNullable(String.valueOf(request.getRequestURI())).orElse(null) : null, |
| New file |
| | |
| | | package com.zy.common.config; |
| | | |
| | | import com.core.common.SnowflakeIdWorker; |
| | | import com.core.common.SpringUtils; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | @Configuration |
| | | public class CoreCompatConfig { |
| | | |
| | | @Bean |
| | | public SnowflakeIdWorker snowflakeIdWorker() { |
| | | return new SnowflakeIdWorker(); |
| | | } |
| | | |
| | | @Bean |
| | | public SpringUtils springUtils() { |
| | | return new SpringUtils(); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.common.config; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.DbType; |
| | | import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; |
| | | import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | @Configuration |
| | | @MapperScan({"com.zy.asrs.mapper", "com.zy.system.mapper"}) |
| | | public class MybatisPlusConfig { |
| | | |
| | | @Bean |
| | | public MybatisPlusInterceptor mybatisPlusInterceptor() { |
| | | MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); |
| | | interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); |
| | | return interceptor; |
| | | } |
| | | } |
| | |
| | | package com.zy.common.entity; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.entity.Config; |
| | |
| | | */ |
| | | public static Parameter reset() { |
| | | ConfigService configService = SpringUtils.getBean(ConfigService.class); |
| | | List<Config> configs = configService.selectList(new EntityWrapper<Config>().eq("status", "1")); |
| | | List<Config> configs = configService.list(new QueryWrapper<Config>().eq("status", "1")); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | for (Config config : configs) { |
| | | if (config.getType() == 1) { |
| | |
| | | package com.zy.common.model; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | |
| | | /** |
| | | * å页忰 |
| | |
| | | */ |
| | | public class PageParam { |
| | | |
| | | @ApiModelProperty(value="å页索å¼",required=true) |
| | | @Schema(description = "å页索å¼", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | private int page = 1; |
| | | |
| | | @ApiModelProperty(value="å页æ°é",required=true) |
| | | @Schema(description = "å页æ°é", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | private int size = 10; |
| | | |
| | | public Integer getPage() { |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.core.common.R; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | | |
| | | /** |
| | |
| | | package com.zy.common.utils; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.awt.*; |
| | | import java.awt.image.BufferedImage; |
| | | import java.util.Map; |
| | |
| | | package com.zy.common.web; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | res.put("token", Cools.enToken(System.currentTimeMillis() + mobile, superPwd)); |
| | | return R.ok(res); |
| | | } |
| | | EntityWrapper<User> userWrapper = new EntityWrapper<>(); |
| | | QueryWrapper<User> userWrapper = new QueryWrapper<>(); |
| | | userWrapper.eq("mobile", mobile); |
| | | User user = userService.selectOne(userWrapper); |
| | | User user = userService.getOne(userWrapper); |
| | | if (Cools.isEmpty(user)){ |
| | | return R.parse(CodeRes.USER_10001); |
| | | } |
| | |
| | | return R.parse(CodeRes.USER_10003); |
| | | } |
| | | String token = Cools.enToken(System.currentTimeMillis() + mobile, user.getPassword()); |
| | | userLoginService.delete(new EntityWrapper<UserLogin>().eq("user_id", user.getId()).eq("system", "WCS")); |
| | | userLoginService.remove(new QueryWrapper<UserLogin>().eq("user_id", user.getId()).eq("system", "WCS")); |
| | | UserLogin userLogin = new UserLogin(); |
| | | userLogin.setUserId(user.getId()); |
| | | userLogin.setToken(token); |
| | | userLogin.setSystem("WCS"); |
| | | userLoginService.insert(userLogin); |
| | | userLoginService.save(userLogin); |
| | | Map<String, Object> res = new HashMap<>(); |
| | | res.put("username", user.getUsername()); |
| | | res.put("token", token); |
| | |
| | | @RequestMapping("/user/detail/auth") |
| | | @ManagerAuth |
| | | public R userDetail(){ |
| | | return R.ok(userService.selectById(getUserId())); |
| | | return R.ok(userService.getById(getUserId())); |
| | | } |
| | | |
| | | @RequestMapping("/menu/auth") |
| | | @ManagerAuth(memo = "é¦é¡µèå") |
| | | public R menu(){ |
| | | // è·åææä¸çº§èå |
| | | List<Resource> oneLevel = resourceService.selectList(new EntityWrapper<Resource>().eq("level", 1).eq("status", 1).orderBy("sort")); |
| | | List<Resource> oneLevel = resourceService.list(new QueryWrapper<Resource>().eq("level", 1).eq("status", 1).orderByAsc("sort")); |
| | | User user = null; |
| | | Wrapper<Resource> resourceWrapper; |
| | | if (getUserId() == 9527) { |
| | | resourceWrapper = new EntityWrapper<Resource>().eq("level", 2).eq("status", 1).orderBy("sort"); |
| | | resourceWrapper = new QueryWrapper<Resource>().eq("level", 2).eq("status", 1).orderByAsc("sort"); |
| | | } else { |
| | | // è·åå½åç¨æ·çææäºçº§èå |
| | | user = userService.selectById(getUserId()); |
| | | List<RoleResource> roleResources = roleResourceService.selectList(new EntityWrapper<RoleResource>().eq("role_id", user.getRoleId())); |
| | | user = userService.getById(getUserId()); |
| | | List<RoleResource> roleResources = roleResourceService.list(new QueryWrapper<RoleResource>().eq("role_id", user.getRoleId())); |
| | | List<Long> resourceIds = new ArrayList<>(); |
| | | roleResources.forEach(roleResource -> resourceIds.add(roleResource.getResourceId())); |
| | | if (resourceIds.isEmpty()){ |
| | | return R.ok(); |
| | | } |
| | | resourceWrapper = new EntityWrapper<Resource>().in("id", resourceIds).eq("level", 2).eq("status", 1).orderBy("sort"); |
| | | resourceWrapper = new QueryWrapper<Resource>().in("id", resourceIds).eq("level", 2).eq("status", 1).orderByAsc("sort"); |
| | | } |
| | | List<Resource> twoLevel = resourceService.selectList(resourceWrapper); |
| | | List<Resource> twoLevel = resourceService.list(resourceWrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (Resource menu : oneLevel) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | |
| | | // æ¯å¦æ¥ææ¥çæé |
| | | if (getUserId() != 9527) { |
| | | Resource view = resourceService.selectOne(new EntityWrapper<Resource>().eq("resource_id", resource.getId()).like("code", "view")); |
| | | Resource view = resourceService.getOne(new QueryWrapper<Resource>().eq("resource_id", resource.getId()).like("code", "view")); |
| | | if (!Cools.isEmpty(view)){ |
| | | RoleResource param = new RoleResource(); |
| | | param.setResourceId(view.getId()); |
| | | param.setRoleId(user.getRoleId()); |
| | | if (null == roleResourceService.selectOne(new EntityWrapper<>(param))){ |
| | | if (null == roleResourceService.getOne(new QueryWrapper<>(param))){ |
| | | continue; |
| | | } |
| | | } |
| | |
| | | @RequestMapping("/power/list/auth") |
| | | @ManagerAuth |
| | | public R powerList(){ |
| | | List<Resource> oneLevels = resourceService.selectList(new EntityWrapper<Resource>().eq("level", 1).eq("status", 1).orderBy("sort")); |
| | | List<Resource> oneLevels = resourceService.list(new QueryWrapper<Resource>().eq("level", 1).eq("status", 1).orderByAsc("sort")); |
| | | List<Map> result = new ArrayList<>(); |
| | | // ä¸çº§ |
| | | for (Resource oneLevel : oneLevels){ |
| | |
| | | oneLevelMap.put("id", oneLevel.getId()); |
| | | oneLevelMap.put("spread", true); |
| | | oneLevelMap.put("children", twoLevelsList); |
| | | List<Resource> twoLevels = resourceService.selectList(new EntityWrapper<Resource>().eq("resource_id", oneLevel.getId()).eq("level", 2).eq("status", 1).orderBy("sort")); |
| | | List<Resource> twoLevels = resourceService.list(new QueryWrapper<Resource>().eq("resource_id", oneLevel.getId()).eq("level", 2).eq("status", 1).orderByAsc("sort")); |
| | | // äºçº§ |
| | | for (Resource twoLevel : twoLevels){ |
| | | Map<String, Object> twoLevelMap = new HashMap<>(); |
| | |
| | | List<Map> threeLevelsList = new ArrayList<>(); |
| | | twoLevelMap.put("children", threeLevelsList); |
| | | // ä¸çº§ |
| | | List<Resource> threeLevels = resourceService.selectList(new EntityWrapper<Resource>().eq("resource_id", twoLevel.getId()).eq("level", 3).eq("status", 1).orderBy("sort")); |
| | | List<Resource> threeLevels = resourceService.list(new QueryWrapper<Resource>().eq("resource_id", twoLevel.getId()).eq("level", 3).eq("status", 1).orderByAsc("sort")); |
| | | for (Resource threeLevel : threeLevels){ |
| | | Map<String, Object> threeLevelMap = new HashMap<>(); |
| | | threeLevelMap.put("title", threeLevel.getName()); |
| | |
| | | functions.put("spread", true); |
| | | List<Map> funcs = new ArrayList<>(); |
| | | functions.put("children", funcs); |
| | | List<Permission> permissions = permissionService.selectList(new EntityWrapper<Permission>().eq("status", 1)); |
| | | List<Permission> permissions = permissionService.list(new QueryWrapper<Permission>().eq("status", 1)); |
| | | for (Permission permission : permissions) { |
| | | Map<String, Object> func = new HashMap<>(); |
| | | func.put("title", permission.getName()); |
| | |
| | | public R get(@PathVariable("roleId") Long roleId) { |
| | | List<Object> result = new ArrayList<>(); |
| | | // èå |
| | | List<RoleResource> roleResources = roleResourceService.selectList(new EntityWrapper<RoleResource>().eq("role_id", roleId)); |
| | | List<RoleResource> roleResources = roleResourceService.list(new QueryWrapper<RoleResource>().eq("role_id", roleId)); |
| | | for (RoleResource roleResource : roleResources){ |
| | | Resource resource = resourceService.selectById(roleResource.getResourceId()); |
| | | Resource resource = resourceService.getById(roleResource.getResourceId()); |
| | | if (!Cools.isEmpty(resource)){ |
| | | if (resource.getLevel() == 3){ |
| | | result.add(resource.getId()); |
| | |
| | | } |
| | | } |
| | | // åè½ |
| | | List<RolePermission> rolePermissions = rolePermissionService.selectList(new EntityWrapper<RolePermission>().eq("role_id", roleId)); |
| | | List<RolePermission> rolePermissions = rolePermissionService.list(new QueryWrapper<RolePermission>().eq("role_id", roleId)); |
| | | for (RolePermission rolePermission : rolePermissions){ |
| | | Permission permission = permissionService.selectById(rolePermission.getPermissionId()); |
| | | Permission permission = permissionService.getById(rolePermission.getPermissionId()); |
| | | if (!Cools.isEmpty(permission)){ |
| | | result.add(permission.getAction()); |
| | | } |
| | |
| | | @ManagerAuth(memo = "ææ") |
| | | @Transactional |
| | | public R power(Long roleId, String powers){ |
| | | Role role = roleService.selectById(roleId); |
| | | Role role = roleService.getById(roleId); |
| | | Long leaderId = role.getLeader(); |
| | | roleResourceService.delete(new EntityWrapper<RoleResource>().eq("role_id", roleId)); |
| | | rolePermissionService.delete(new EntityWrapper<RolePermission>().eq("role_id", roleId)); |
| | | roleResourceService.remove(new QueryWrapper<RoleResource>().eq("role_id", roleId)); |
| | | rolePermissionService.remove(new QueryWrapper<RolePermission>().eq("role_id", roleId)); |
| | | if (!Cools.isEmpty(powers)){ |
| | | List<PowerDto> dtos = JSON.parseArray(powers, PowerDto.class); |
| | | for (PowerDto dto : dtos) { |
| | | Resource resource = resourceService.selectOne(new EntityWrapper<Resource>().eq("id", dto.getTwo()).eq("level", 2)); |
| | | Resource resource = resourceService.getOne(new QueryWrapper<Resource>().eq("id", dto.getTwo()).eq("level", 2)); |
| | | if (!Cools.isEmpty(resource)) { |
| | | // æ ¡éªä¸çº§æé |
| | | if (leaderId != null) { |
| | | RoleResource roleResource = roleResourceService.selectOne(new EntityWrapper<RoleResource>().eq("role_id", leaderId).eq("resource_id", resource.getId())); |
| | | RoleResource roleResource = roleResourceService.getOne(new QueryWrapper<RoleResource>().eq("role_id", leaderId).eq("resource_id", resource.getId())); |
| | | if (null == roleResource) { |
| | | throw new CoolException(resource.getName().concat("æ æ³ææç»").concat(role.getName())); |
| | | } |
| | |
| | | RoleResource roleResource = new RoleResource(); |
| | | roleResource.setRoleId(roleId); |
| | | roleResource.setResourceId(resource.getId()); |
| | | roleResourceService.insert(roleResource); |
| | | roleResourceService.save(roleResource); |
| | | } else { |
| | | Permission permission = permissionService.selectOne(new EntityWrapper<Permission>().eq("action", dto.getTwo())); |
| | | Permission permission = permissionService.getOne(new QueryWrapper<Permission>().eq("action", dto.getTwo())); |
| | | if (!Cools.isEmpty(permission)){ |
| | | RolePermission rolePermission = new RolePermission(); |
| | | rolePermission.setRoleId(roleId); |
| | | rolePermission.setPermissionId(permission.getId()); |
| | | rolePermissionService.insert(rolePermission); |
| | | rolePermissionService.save(rolePermission); |
| | | } |
| | | } |
| | | for (String three : dto.getThree()){ |
| | | Resource resource1 = resourceService.selectOne(new EntityWrapper<Resource>().eq("id", three).eq("level", 3)); |
| | | Resource resource1 = resourceService.getOne(new QueryWrapper<Resource>().eq("id", three).eq("level", 3)); |
| | | if (!Cools.isEmpty(resource1)) { |
| | | // æ ¡éªä¸çº§æé |
| | | if (leaderId != null) { |
| | | RoleResource roleResource = roleResourceService.selectOne(new EntityWrapper<RoleResource>().eq("role_id", leaderId).eq("resource_id", resource1.getId())); |
| | | RoleResource roleResource = roleResourceService.getOne(new QueryWrapper<RoleResource>().eq("role_id", leaderId).eq("resource_id", resource1.getId())); |
| | | if (null == roleResource) { |
| | | throw new CoolException(resource.getName().concat("ç").concat(resource1.getName().concat("æ æ³ææç»").concat(role.getName()))); |
| | | } |
| | |
| | | RoleResource roleResource = new RoleResource(); |
| | | roleResource.setRoleId(roleId); |
| | | roleResource.setResourceId(resource1.getId()); |
| | | roleResourceService.insert(roleResource); |
| | | roleResourceService.save(roleResource); |
| | | } |
| | | } |
| | | } |
| | |
| | | public R buttonResource(@PathVariable("resourceId") Long resourceId) { |
| | | List<Resource> resources; |
| | | if (getUserId() == 9527) { |
| | | resources = resourceService.selectList(new EntityWrapper<Resource>().eq("level", 3).eq("resource_id", resourceId)); |
| | | resources = resourceService.list(new QueryWrapper<Resource>().eq("level", 3).eq("resource_id", resourceId)); |
| | | } else { |
| | | resources = roleResourceService.getMenuButtomResource(resourceId, getUserId()); |
| | | } |
| | |
| | | package com.zy.common.web; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.controller.AbstractBaseController; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import java.lang.reflect.Field; |
| | | import java.lang.reflect.Modifier; |
| | | import java.util.ArrayList; |
| | |
| | | } |
| | | |
| | | protected User getUser(){ |
| | | User user = userService.selectById(getUserId()); |
| | | User user = userService.getById(getUserId()); |
| | | if (null == user) { |
| | | throw new CoolException(BaseRes.DENIED); |
| | | } |
| | |
| | | Field[] fields = Cools.getAllFields(cls); |
| | | for (Field field : fields){ |
| | | if (fieldName.equals(field.getName())){ |
| | | return field.getAnnotation(ApiModelProperty.class).value(); |
| | | Schema schema = field.getAnnotation(Schema.class); |
| | | return schema == null ? "" : schema.description(); |
| | | } |
| | | } |
| | | return ""; |
| | |
| | | * @param set æé¤å段éå |
| | | * @param condition æç´¢å
容 |
| | | */ |
| | | protected <T> void allLike(Class<T> cls, Set<String> set, EntityWrapper<T> wrapper, String condition){ |
| | | protected <T> void allLike(Class<T> cls, Set<String> set, QueryWrapper<T> wrapper, String condition){ |
| | | if (Cools.isEmpty(condition)) { |
| | | return; |
| | | } |
| | |
| | | if (columns.isEmpty()) { |
| | | return; |
| | | } |
| | | for (int i=0;i<columns.size();i++){ |
| | | if (i==0){ |
| | | wrapper.andNew(); |
| | | } else { |
| | | wrapper.or(); |
| | | wrapper.and(inner -> { |
| | | for (int i = 0; i < columns.size(); i++) { |
| | | if (i > 0) { |
| | | inner.or(); |
| | | } |
| | | inner.like(columns.get(i), condition); |
| | | } |
| | | wrapper.like(columns.get(i), condition); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | |
| | |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * Created by vincent on 2019-07-30 |
| | |
| | | package com.zy.system.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | |
| | | @RequestMapping(value = "/announcement/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok(announcementService.selectById(String.valueOf(id))); |
| | | return R.ok(announcementService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/announcement/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<Announcement> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Announcement> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){ |
| | | wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField)); |
| | | } |
| | | return R.ok(announcementService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | return R.ok(announcementService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | private void convert(Map<String, Object> map, QueryWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if ("status".equals(entry.getKey())) { |
| | | wrapper.eq(entry.getKey(), entry.getValue()); |
| | |
| | | if (null == announcement.getId()){ |
| | | announcement.setCreateTime(new Date()); |
| | | announcement.setUpdateTime(new Date()); |
| | | announcementService.insert(announcement); |
| | | announcementService.save(announcement); |
| | | } else { |
| | | announcement.setUpdateTime(new Date()); |
| | | announcementService.updateById(announcement); |
| | |
| | | public R add(Announcement announcement) { |
| | | announcement.setCreateTime(new Date()); |
| | | announcement.setUpdateTime(new Date()); |
| | | announcementService.insert(announcement); |
| | | announcementService.save(announcement); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | if (Cools.isEmpty(ids)){ |
| | | return R.error(); |
| | | } |
| | | announcementService.deleteBatchIds(Arrays.asList(ids)); |
| | | announcementService.removeByIds(Arrays.asList(ids)); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<Announcement> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Announcement> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("announcement")); |
| | | convert(map, wrapper); |
| | | List<Announcement> list = announcementService.selectList(wrapper); |
| | | List<Announcement> list = announcementService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @GetMapping("/announcement/top5") |
| | | public R top5(){ |
| | | EntityWrapper<Announcement> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Announcement> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("status", 1); |
| | | wrapper.orderBy("create_time", false); |
| | | wrapper.orderBy(true, false, "create_time"); |
| | | wrapper.last("limit 5"); |
| | | return R.ok(announcementService.selectList(wrapper)); |
| | | return R.ok(announcementService.list(wrapper)); |
| | | } |
| | | } |
| | |
| | | package com.zy.system.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | |
| | | @RequestMapping(value = "/api/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok(apiService.selectById(String.valueOf(id))); |
| | | return R.ok(apiService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/api/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<Api> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Api> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | wrapper.orderBy("id", false); |
| | | return R.ok(apiService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | wrapper.orderBy(true, false, "id"); |
| | | return R.ok(apiService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | private void convert(Map<String, Object> map, QueryWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if (entry.getKey().endsWith(">")) { |
| | | wrapper.ge(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue()))); |
| | |
| | | return R.error(); |
| | | } |
| | | if (null == api.getId()){ |
| | | apiService.insert(api); |
| | | apiService.save(api); |
| | | } else { |
| | | apiService.updateById(api); |
| | | } |
| | |
| | | @RequestMapping(value = "/api/add/auth") |
| | | @ManagerAuth |
| | | public R add(Api api) { |
| | | apiService.insert(api); |
| | | apiService.save(api); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | if (Cools.isEmpty(ids)){ |
| | | return R.error(); |
| | | } |
| | | apiService.deleteBatchIds(Arrays.asList(ids)); |
| | | apiService.removeByIds(Arrays.asList(ids)); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<Api> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Api> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("api")); |
| | | convert(map, wrapper); |
| | | List<Api> list = apiService.selectList(wrapper); |
| | | List<Api> list = apiService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/apiQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<Api> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Api> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<Api> page = apiService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<Api> page = apiService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (Api api : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | |
| | | @RequestMapping(value = "/config/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok(configService.selectById(String.valueOf(id))); |
| | | return R.ok(configService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/config/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<Config> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Config> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | wrapper.orderBy("id", false); |
| | | return R.ok(configService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | wrapper.orderBy(true, false, "id"); |
| | | return R.ok(configService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/config/listAll/auth") |
| | | @ManagerAuth |
| | | public R listAll(){ |
| | | EntityWrapper<Config> wrapper = new EntityWrapper<>(); |
| | | wrapper.orderBy("id", false); |
| | | return R.ok(configService.selectList(wrapper)); |
| | | QueryWrapper<Config> wrapper = new QueryWrapper<>(); |
| | | wrapper.orderBy(true, false, "id"); |
| | | return R.ok(configService.list(wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | private void convert(Map<String, Object> map, QueryWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if (entry.getKey().endsWith(">")) { |
| | | wrapper.ge(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue()))); |
| | |
| | | } |
| | | } |
| | | if (null == config.getId()){ |
| | | configService.insert(config); |
| | | configService.save(config); |
| | | } else { |
| | | configService.updateById(config); |
| | | Parameter.reset(); |
| | |
| | | return R.error("jsonè§£æå¤±è´¥"); |
| | | } |
| | | } |
| | | configService.insert(config); |
| | | configService.save(config); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | if (Cools.isEmpty(ids)){ |
| | | return R.error(); |
| | | } |
| | | configService.deleteBatchIds(Arrays.asList(ids)); |
| | | configService.removeByIds(Arrays.asList(ids)); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<Config> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Config> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("config")); |
| | | convert(map, wrapper); |
| | | List<Config> list = configService.selectList(wrapper); |
| | | List<Config> list = configService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/configQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<Config> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Config> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<Config> page = configService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<Config> page = configService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (Config config : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/config/getSelectTypes") |
| | | @ManagerAuth |
| | | public R getSelectTypes() { |
| | | EntityWrapper<Config> wrapper = new EntityWrapper<>(); |
| | | wrapper.setSqlSelect("DISTINCT select_type as selectType"); |
| | | QueryWrapper<Config> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("DISTINCT select_type as selectType"); |
| | | wrapper.isNotNull("select_type"); |
| | | List<Map<String, Object>> maps = configService.selectMaps(wrapper); |
| | | List<Map<String, Object>> maps = configService.listMaps(wrapper); |
| | | List<String> types = new ArrayList<>(); |
| | | for (Map<String, Object> map : maps) { |
| | | if (map != null && map.get("selectType") != null) { |
| | |
| | | package com.zy.system.controller; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Arith; |
| | | import com.core.common.R; |
| | |
| | | @RequestMapping("/top") |
| | | @ManagerAuth |
| | | public R top(){ |
| | | int logTotal = operateLogService.selectCount(new EntityWrapper<>()); |
| | | long logTotal = operateLogService.count(new QueryWrapper<>()); |
| | | int logWeek = operateLogService.selectCountByCurrentWeek(); |
| | | int userTotal = userService.selectCount(new EntityWrapper<>()); |
| | | long userTotal = userService.count(new QueryWrapper<>()); |
| | | int loginWeek = userLoginService.selectCountByCurrentWeek(); |
| | | |
| | | Map<String, Object> result = new HashMap<>(); |
| | |
| | | package com.zy.system.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | |
| | | @RequestMapping(value = "/host/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok(hostService.selectById(String.valueOf(id))); |
| | | return R.ok(hostService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/host/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<Host> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Host> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | wrapper.orderBy("id", false); |
| | | return R.ok(hostService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | wrapper.orderBy(true, false, "id"); |
| | | return R.ok(hostService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | private void convert(Map<String, Object> map, QueryWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if (entry.getKey().endsWith(">")) { |
| | | wrapper.ge(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue()))); |
| | |
| | | return R.error(); |
| | | } |
| | | if (null == host.getId()){ |
| | | hostService.insert(host); |
| | | hostService.save(host); |
| | | } else { |
| | | hostService.updateById(host); |
| | | } |
| | |
| | | @RequestMapping(value = "/host/add/auth") |
| | | @ManagerAuth |
| | | public R add(Host host) { |
| | | hostService.insert(host); |
| | | hostService.save(host); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | if (Cools.isEmpty(ids)){ |
| | | return R.error(); |
| | | } |
| | | hostService.deleteBatchIds(Arrays.asList(ids)); |
| | | hostService.removeByIds(Arrays.asList(ids)); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<Host> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Host> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("host")); |
| | | convert(map, wrapper); |
| | | List<Host> list = hostService.selectList(wrapper); |
| | | List<Host> list = hostService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/hostQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<Host> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Host> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("name", condition); |
| | | Page<Host> page = hostService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<Host> page = hostService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (Host host : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | package com.zy.system.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | |
| | | @RequestMapping(value = "/operateLog/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok(operateLogService.selectById(String.valueOf(id))); |
| | | return R.ok(operateLogService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/operateLog/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<OperateLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<OperateLog> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | wrapper.orderBy("id", false); |
| | | return R.ok(operateLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | wrapper.orderBy(true, false, "id"); |
| | | return R.ok(operateLogService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | private void convert(Map<String, Object> map, QueryWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if (entry.getKey().endsWith(">")) { |
| | | wrapper.ge(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue()))); |
| | |
| | | return R.error(); |
| | | } |
| | | if (null == operateLog.getId()){ |
| | | operateLogService.insert(operateLog); |
| | | operateLogService.save(operateLog); |
| | | } else { |
| | | operateLogService.updateById(operateLog); |
| | | } |
| | |
| | | @RequestMapping(value = "/operateLog/add/auth") |
| | | @ManagerAuth |
| | | public R add(OperateLog operateLog) { |
| | | operateLogService.insert(operateLog); |
| | | operateLogService.save(operateLog); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | if (Cools.isEmpty(ids)){ |
| | | return R.error(); |
| | | } |
| | | operateLogService.deleteBatchIds(Arrays.asList(ids)); |
| | | operateLogService.removeByIds(Arrays.asList(ids)); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<OperateLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<OperateLog> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("operateLog")); |
| | | convert(map, wrapper); |
| | | List<OperateLog> list = operateLogService.selectList(wrapper); |
| | | List<OperateLog> list = operateLogService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/operateLogQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<OperateLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<OperateLog> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<OperateLog> page = operateLogService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<OperateLog> page = operateLogService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (OperateLog operateLog : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | package com.zy.system.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | |
| | | @RequestMapping(value = "/permission/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok(permissionService.selectById(String.valueOf(id))); |
| | | return R.ok(permissionService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/permission/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<Permission> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Permission> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | wrapper.orderBy("id", false); |
| | | return R.ok(permissionService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | wrapper.orderBy(true, false, "id"); |
| | | return R.ok(permissionService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | private void convert(Map<String, Object> map, QueryWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if (entry.getKey().endsWith(">")) { |
| | | wrapper.ge(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue()))); |
| | |
| | | return R.error(); |
| | | } |
| | | if (null == permission.getId()){ |
| | | permissionService.insert(permission); |
| | | permissionService.save(permission); |
| | | } else { |
| | | permissionService.updateById(permission); |
| | | } |
| | |
| | | @RequestMapping(value = "/permission/add/auth") |
| | | @ManagerAuth |
| | | public R add(Permission permission) { |
| | | permissionService.insert(permission); |
| | | permissionService.save(permission); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | if (Cools.isEmpty(ids)){ |
| | | return R.error(); |
| | | } |
| | | permissionService.deleteBatchIds(Arrays.asList(ids)); |
| | | permissionService.removeByIds(Arrays.asList(ids)); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<Permission> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Permission> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("permission")); |
| | | convert(map, wrapper); |
| | | List<Permission> list = permissionService.selectList(wrapper); |
| | | List<Permission> list = permissionService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/permissionQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<Permission> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Permission> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("name", condition); |
| | | Page<Permission> page = permissionService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<Permission> page = permissionService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (Permission permission : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | package com.zy.system.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | |
| | | @RequestMapping(value = "/resource/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok(resourceService.selectById(String.valueOf(id))); |
| | | return R.ok(resourceService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/resource/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<Resource> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Resource> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | wrapper.orderBy("id", false); |
| | | return R.ok(resourceService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | wrapper.orderBy(true, false, "id"); |
| | | return R.ok(resourceService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | private void convert(Map<String, Object> map, QueryWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if (entry.getKey().endsWith(">")) { |
| | | wrapper.ge(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue()))); |
| | |
| | | if (resource.getSort() == null){ |
| | | resource.setSort(999); |
| | | } |
| | | resourceService.insert(resource); |
| | | resourceService.save(resource); |
| | | } else { |
| | | resourceService.updateById(resource); |
| | | } |
| | |
| | | @RequestMapping(value = "/resource/add/auth") |
| | | @ManagerAuth(memo = "èåæ·»å ") |
| | | public R add(Resource resource) { |
| | | resourceService.insert(resource); |
| | | resourceService.save(resource); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth(memo = "èåå é¤") |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | resourceService.deleteById(id); |
| | | resourceService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @ManagerAuth(memo = "èå导åº") |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<Resource> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Resource> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("resource")); |
| | | convert(map, wrapper); |
| | | List<Resource> list = resourceService.selectList(wrapper); |
| | | List<Resource> list = resourceService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/resourceQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<Resource> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Resource> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("name", condition); |
| | | Page<Resource> page = resourceService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<Resource> page = resourceService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (Resource resource : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<Resource> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Resource> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | else { |
| | | wrapper.orderBy("sort"); |
| | | wrapper.orderByAsc("sort"); |
| | | } |
| | | return R.parse("0-æä½æå").add(resourceService.selectList(wrapper)); |
| | | return R.parse("0-æä½æå").add(resourceService.list(wrapper)); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.zy.system.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | |
| | | @RequestMapping(value = "/role/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok(roleService.selectById(String.valueOf(id))); |
| | | return R.ok(roleService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/role/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<Role> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Role> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | wrapper.orderBy("id", false); |
| | | wrapper.orderBy(true, false, "id"); |
| | | |
| | | if (9527 == getUserId()) { |
| | | return R.ok(roleService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | return R.ok(roleService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | Long roleId = getUser().getRoleId(); |
| | | Role role = roleService.selectById(roleId); |
| | | Role role = roleService.getById(roleId); |
| | | Long leaderId = role.getLeader(); |
| | | if (null != leaderId) { |
| | | List<Long> leaderIds = new ArrayList<>(); |
| | | leaderIds.add(roleId); |
| | | while (leaderId != null) { |
| | | Role leader = roleService.selectById(leaderId); |
| | | Role leader = roleService.getById(leaderId); |
| | | leaderIds.add(leader.getId()); |
| | | leaderId = leader.getLeader(); |
| | | } |
| | |
| | | // if (null != role.getLevel()) { |
| | | // wrapper.gt("level", role.getLevel()); |
| | | // } |
| | | return R.ok(roleService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | return R.ok(roleService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | private void convert(Map<String, Object> map, QueryWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if (entry.getKey().endsWith(">")) { |
| | | wrapper.ge(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue()))); |
| | |
| | | return R.error(); |
| | | } |
| | | if (null == role.getId()){ |
| | | roleService.insert(role); |
| | | roleService.save(role); |
| | | } else { |
| | | roleService.updateById(role); |
| | | } |
| | |
| | | @RequestMapping(value = "/role/add/auth") |
| | | @ManagerAuth(memo = "è§è²æ·»å ") |
| | | public R add(Role role) { |
| | | roleService.insert(role); |
| | | roleService.save(role); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | if (Cools.isEmpty(ids)){ |
| | | return R.error(); |
| | | } |
| | | roleService.deleteBatchIds(Arrays.asList(ids)); |
| | | roleService.removeByIds(Arrays.asList(ids)); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth(memo = "è§è²å¯¼åº") |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<Role> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Role> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("role")); |
| | | convert(map, wrapper); |
| | | List<Role> list = roleService.selectList(wrapper); |
| | | List<Role> list = roleService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/roleQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<Role> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Role> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("name", condition); |
| | | // ä¸ä¸çº§ç®¡ç |
| | | if (9527 != getUserId()) { |
| | | Long roleId = getUser().getRoleId(); |
| | | Role role = roleService.selectById(roleId); |
| | | Role role = roleService.getById(roleId); |
| | | Long leaderId = role.getLeader(); |
| | | if (null != leaderId) { |
| | | List<Long> leaderIds = new ArrayList<>(); |
| | | while (leaderId != null) { |
| | | Role leader = roleService.selectById(leaderId); |
| | | Role leader = roleService.getById(leaderId); |
| | | leaderIds.add(leader.getId()); |
| | | leaderId = leader.getLeader(); |
| | | } |
| | |
| | | // } |
| | | } |
| | | |
| | | Page<Role> page = roleService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<Role> page = roleService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (Role role : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | package com.zy.system.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | |
| | | @RequestMapping(value = "/user/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok(userService.selectById(String.valueOf(id))); |
| | | return R.ok(userService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/user/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<User> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<User> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | wrapper.orderBy("id", false); |
| | | wrapper.orderBy(true, false, "id"); |
| | | if (9527 == getUserId()) { |
| | | return R.ok(userService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | return R.ok(userService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | Long roleId = getUser().getRoleId(); |
| | | Role role = roleService.selectById(roleId); |
| | | Role role = roleService.getById(roleId); |
| | | Long leaderId = role.getLeader(); |
| | | if (null != leaderId) { |
| | | List<Long> leaderIds = new ArrayList<>(); |
| | | leaderIds.add(role.getId()); |
| | | while (leaderId != null) { |
| | | Role leader = roleService.selectById(leaderId); |
| | | Role leader = roleService.getById(leaderId); |
| | | leaderIds.add(leader.getId()); |
| | | leaderId = leader.getLeader(); |
| | | } |
| | | wrapper.notIn("role_id", leaderIds); |
| | | } |
| | | |
| | | return R.ok(userService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | return R.ok(userService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | private void convert(Map<String, Object> map, QueryWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if (entry.getKey().endsWith(">")) { |
| | | wrapper.ge(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue()))); |
| | |
| | | return R.error(); |
| | | } |
| | | if (null == user.getId()){ |
| | | userService.insert(user); |
| | | userService.save(user); |
| | | } else { |
| | | userService.updateById(user); |
| | | } |
| | |
| | | @RequestMapping(value = "/user/add/auth") |
| | | @ManagerAuth(memo = "ç³»ç»ç¨æ·æ·»å ") |
| | | public R add(User user) { |
| | | userService.insert(user); |
| | | userService.save(user); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | if (Cools.isEmpty(user) || null==user.getId()){ |
| | | return R.error(); |
| | | } |
| | | User entity = userService.selectById(user.getId()); |
| | | User entity = userService.getById(user.getId()); |
| | | if (user.getPassword()!=null) { |
| | | entity.setPassword(user.getPassword()); |
| | | } |
| | |
| | | @ManagerAuth(memo = "ç³»ç»ç¨æ·å é¤") |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | userService.deleteById(id); |
| | | userService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @ManagerAuth(memo = "ç³»ç»ç¨æ·å¯¼åº") |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<User> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<User> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("user")); |
| | | convert(map, wrapper); |
| | | List<User> list = userService.selectList(wrapper); |
| | | List<User> list = userService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/userQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<User> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<User> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("username", condition); |
| | | Page<User> page = userService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<User> page = userService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (User user : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | package com.zy.system.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | |
| | | @RequestMapping(value = "/userLogin/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok(userLoginService.selectById(String.valueOf(id))); |
| | | return R.ok(userLoginService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/userLogin/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<UserLogin> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<UserLogin> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | wrapper.orderBy("id", false); |
| | | return R.ok(userLoginService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | wrapper.orderBy(true, false, "id"); |
| | | return R.ok(userLoginService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | private void convert(Map<String, Object> map, QueryWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if (entry.getKey().endsWith(">")) { |
| | | wrapper.ge(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue()))); |
| | |
| | | return R.error(); |
| | | } |
| | | if (null == userLogin.getId()){ |
| | | userLoginService.insert(userLogin); |
| | | userLoginService.save(userLogin); |
| | | } else { |
| | | userLoginService.updateById(userLogin); |
| | | } |
| | |
| | | @RequestMapping(value = "/userLogin/add/auth") |
| | | @ManagerAuth |
| | | public R add(UserLogin userLogin) { |
| | | userLoginService.insert(userLogin); |
| | | userLoginService.save(userLogin); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | if (Cools.isEmpty(ids)){ |
| | | return R.error(); |
| | | } |
| | | userLoginService.deleteBatchIds(Arrays.asList(ids)); |
| | | userLoginService.removeByIds(Arrays.asList(ids)); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<UserLogin> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<UserLogin> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("userLogin")); |
| | | convert(map, wrapper); |
| | | List<UserLogin> list = userLoginService.selectList(wrapper); |
| | | List<UserLogin> list = userLoginService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/userLoginQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<UserLogin> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<UserLogin> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("token", condition); |
| | | Page<UserLogin> page = userLoginService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<UserLogin> page = userLoginService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (UserLogin userLogin : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.UserService; |
| | |
| | | |
| | | public String getUserId$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.userId); |
| | | User user = service.getById(this.userId); |
| | | if (!Cools.isEmpty(user)){ |
| | | return user.getUsername(); |
| | | } |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.ResourceService; |
| | |
| | | |
| | | public String getResourceName(){ |
| | | ResourceService service = SpringUtils.getBean(ResourceService.class); |
| | | Resource resource = service.selectById(this.resourceId); |
| | | Resource resource = service.getById(this.resourceId); |
| | | if (!Cools.isEmpty(resource)){ |
| | | return resource.getName(); |
| | | } |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.ResourceService; |
| | |
| | | |
| | | public String getResourceName(){ |
| | | ResourceService service = SpringUtils.getBean(ResourceService.class); |
| | | Resource resource = service.selectById(this.resourceId); |
| | | Resource resource = service.getById(this.resourceId); |
| | | if (!Cools.isEmpty(resource)){ |
| | | return resource.getName(); |
| | | } |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.RoleService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | |
| | | /** |
| | | * ç¼å· |
| | | */ |
| | | @ApiModelProperty(value= "ç¼å·") |
| | | @Schema(description = "ç¼å·") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * ç¼ç |
| | | */ |
| | | @ApiModelProperty(value= "ç¼ç ") |
| | | @Schema(description = "ç¼ç ") |
| | | private String code; |
| | | |
| | | /** |
| | | * åç§° |
| | | */ |
| | | @ApiModelProperty(value= "åç§°") |
| | | @Schema(description = "åç§°") |
| | | private String name; |
| | | |
| | | /** |
| | | * ä¸çº§ |
| | | */ |
| | | @ApiModelProperty(value= "ä¸çº§") |
| | | @Schema(description = "ä¸çº§") |
| | | private Long leader; |
| | | |
| | | /** |
| | | * è§è²ç级 1: ä¸çº§ 2: äºçº§ 3: ä¸çº§ 4: å级 5: äºçº§ |
| | | */ |
| | | @ApiModelProperty(value= "è§è²ç级 1: ä¸çº§ 2: äºçº§ 3: ä¸çº§ 4: å级 5: äºçº§ ") |
| | | @Schema(description = "è§è²ç级 1: ä¸çº§ 2: äºçº§ 3: ä¸çº§ 4: å级 5: äºçº§ ") |
| | | private Short level; |
| | | |
| | | public Role() {} |
| | |
| | | |
| | | public String getLeader$(){ |
| | | RoleService service = SpringUtils.getBean(RoleService.class); |
| | | Role role = service.selectById(this.leader); |
| | | Role role = service.getById(this.leader); |
| | | if (!Cools.isEmpty(role)){ |
| | | return String.valueOf(role.getName()); |
| | | } |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.PermissionService; |
| | |
| | | |
| | | public String getRoleName(){ |
| | | RoleService service = SpringUtils.getBean(RoleService.class); |
| | | Role role = service.selectById(this.roleId); |
| | | Role role = service.getById(this.roleId); |
| | | if (!Cools.isEmpty(role)){ |
| | | return role.getName(); |
| | | } |
| | |
| | | |
| | | public String getPermissionName(){ |
| | | PermissionService service = SpringUtils.getBean(PermissionService.class); |
| | | Permission permission = service.selectById(this.permissionId); |
| | | Permission permission = service.getById(this.permissionId); |
| | | if (!Cools.isEmpty(permission)){ |
| | | return permission.getName(); |
| | | } |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.HostService; |
| | |
| | | |
| | | public String getHostName() { |
| | | HostService service = SpringUtils.getBean(HostService.class); |
| | | Host host = service.selectById(this.hostId); |
| | | Host host = service.getById(this.hostId); |
| | | if (!Cools.isEmpty(host)){ |
| | | return host.getName(); |
| | | } |
| | |
| | | |
| | | public String getRoleName(){ |
| | | RoleService service = SpringUtils.getBean(RoleService.class); |
| | | Role role = service.selectById(this.roleId); |
| | | Role role = service.getById(this.roleId); |
| | | if (!Cools.isEmpty(role)){ |
| | | return role.getName(); |
| | | } |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.UserService; |
| | |
| | | |
| | | public String getUserUsername(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.userId); |
| | | User user = service.getById(this.userId); |
| | | if (!Cools.isEmpty(user)){ |
| | | return user.getUsername(); |
| | | } |
| | |
| | | package com.zy.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.system.entity.Announcement; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.system.entity.Api; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.system.entity.Config; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.system.entity.Host; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.system.entity.OperateLog; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | package com.zy.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.system.entity.Permission; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.system.entity.Resource; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.system.entity.Role; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.system.entity.RolePermission; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.system.entity.Resource; |
| | | import com.zy.system.entity.RoleResource; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | package com.zy.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.system.entity.UserLogin; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Select; |
| | |
| | | package com.zy.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.system.entity.User; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.system.entity.Announcement; |
| | | |
| | | public interface AnnouncementService extends IService<Announcement> { |
| | |
| | | package com.zy.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.system.entity.Api; |
| | | |
| | | public interface ApiService extends IService<Api> { |
| | |
| | | package com.zy.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.system.entity.Config; |
| | | |
| | | public interface ConfigService extends IService<Config> { |
| | |
| | | package com.zy.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.system.entity.Host; |
| | | |
| | | public interface HostService extends IService<Host> { |
| | |
| | | package com.zy.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.system.entity.OperateLog; |
| | | |
| | | import java.util.List; |
| | |
| | | package com.zy.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.system.entity.Permission; |
| | | |
| | | public interface PermissionService extends IService<Permission> { |
| | |
| | | package com.zy.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.system.entity.Resource; |
| | | |
| | | public interface ResourceService extends IService<Resource> { |
| | |
| | | package com.zy.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.system.entity.RolePermission; |
| | | |
| | | public interface RolePermissionService extends IService<RolePermission> { |
| | |
| | | package com.zy.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.system.entity.Resource; |
| | | import com.zy.system.entity.RoleResource; |
| | | |
| | |
| | | package com.zy.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.system.entity.Role; |
| | | |
| | | public interface RoleService extends IService<Role> { |
| | |
| | | package com.zy.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.system.entity.UserLogin; |
| | | |
| | | public interface UserLoginService extends IService<UserLogin> { |
| | |
| | | package com.zy.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.system.entity.User; |
| | | |
| | | public interface UserService extends IService<User> { |
| | |
| | | package com.zy.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.system.entity.Announcement; |
| | | import com.zy.system.mapper.AnnouncementMapper; |
| | | import com.zy.system.service.AnnouncementService; |
| | |
| | | package com.zy.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.system.entity.Api; |
| | | import com.zy.system.mapper.ApiMapper; |
| | | import com.zy.system.service.ApiService; |
| | |
| | | package com.zy.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.mapper.ConfigMapper; |
| | | import com.zy.system.service.ConfigService; |
| | |
| | | package com.zy.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.system.entity.Host; |
| | | import com.zy.system.mapper.HostMapper; |
| | | import com.zy.system.service.HostService; |
| | |
| | | package com.zy.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.core.common.Cools; |
| | | import com.zy.system.entity.OperateLog; |
| | | import com.zy.system.mapper.OperateLogMapper; |
| | |
| | | package com.zy.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.system.entity.Permission; |
| | | import com.zy.system.mapper.PermissionMapper; |
| | | import com.zy.system.service.PermissionService; |
| | |
| | | package com.zy.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.system.entity.Resource; |
| | | import com.zy.system.mapper.ResourceMapper; |
| | | import com.zy.system.service.ResourceService; |
| | |
| | | package com.zy.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.system.entity.RolePermission; |
| | | import com.zy.system.mapper.RolePermissionMapper; |
| | | import com.zy.system.service.RolePermissionService; |
| | |
| | | package com.zy.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.system.entity.Resource; |
| | | import com.zy.system.entity.RoleResource; |
| | | import com.zy.system.mapper.RoleResourceMapper; |
| | |
| | | package com.zy.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.system.entity.Role; |
| | | import com.zy.system.mapper.RoleMapper; |
| | | import com.zy.system.service.RoleService; |
| | |
| | | package com.zy.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.system.entity.UserLogin; |
| | | import com.zy.system.mapper.UserLoginMapper; |
| | | import com.zy.system.service.UserLoginService; |
| | |
| | | package com.zy.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.mapper.UserMapper; |
| | | import com.zy.system.service.UserService; |
| | |
| | | hikari: |
| | | validation-timeout: 3000 |
| | | connection-test-query: select 1 |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://127.0.0.1:3306/monitor?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: root |
| | | mvc: |
| | | static-path-pattern: /** |
| | | redis: |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | database: 6 |
| | | # password: 123456 |
| | | data: |
| | | redis: |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | database: 0 |
| | | # password: 123456 |
| | | servlet: |
| | | multipart: |
| | | max-file-size: 100MB |
| | |
| | | |
| | | logging: |
| | | file: |
| | | path: /stock/out/@pom.build.finalName@/logs |
| | | path: ./stock/out/@pom.build.finalName@/logs |
| | | |
| | | super: |
| | | pwd: xltys1995 |
| | |
| | | default-package: com.zy |
| | | |
| | | file: |
| | | upload-path: D:/zy_monitor_files/upload_files/ |
| | | upload-path: D:/zy_monitor_files/upload_files/ |
| New file |
| | |
| | | # API æ¥å£ææ¡£ |
| | | |
| | | - **ææ¡£çæ¬**ï¼v1.0.0 |
| | | - **æåæ´æ°**ï¼2026-2-24 |
| | | |
| | | --- |
| | | |
| | | ## 1. æ¦è¿° |
| | | |
| | | ### 1.1 ç®æ |
| | | - ç¬¬ä¸æ¹æ¥å£ææ¡£ï¼æºè½å¤§å±ç³»ç»ä¸ç¬¬ä¸æ¹ç³»ç»æ°æ®äº¤äºæ¥å£ææ¡£ã |
| | | |
| | | --- |
| | | |
| | | ## 2. éç¨çº¦å® |
| | | |
| | | ### 2.1 æ°æ®æ ¼å¼ |
| | | - **请æ±/ååºæ ¼å¼**ï¼`application/json; charset=utf-8` |
| | | - **å符é**ï¼UTF-8 |
| | | |
| | | ### 2.2 éç¨ Header |
| | | | Header | å¿
å¡« | ç¤ºä¾ | 说æ | |
| | | |---|---:|---|---| |
| | | |
| | | ### 2.4 éç¨ååºç»æ |
| | | |
| | | ```json |
| | | { |
| | | "code": 200, |
| | | "message": "success", |
| | | "data": {} |
| | | } |
| | | ``` |
| | | |
| | | --- |
| | | |
| | | ## 3. WCSæ¥å£ |
| | | |
| | | ### 3.1 WCSç«ç¹ä¿¡æ¯åæ¥ |
| | | |
| | | - **API URL(WCSå®é
æä¾ä¸ºå)**ï¼`/openapi/stationStatus` |
| | | - **请æ±/ååºæ ¼å¼**ï¼`application/json; charset=utf-8` |
| | | - **å符é**ï¼UTF-8 |
| | | - **è¯·æ±æ¹å¼**: POST |
| | | |
| | | #### 3.1.1 Header |
| | | | Header | å¿
å¡« | ç¤ºä¾ | 说æ | |
| | | |---|---:|---|---| |
| | | |
| | | #### 3.1.2 Body |
| | | | Body | å¿
å¡« | ç±»å | ç¤ºä¾ | 说æ | |
| | | |------|---:|-------|---------------|-------------| |
| | | |stationIds| æ¯ | int[] | [100,101,102] | éè¦æ¥è¯¢çç«ç¹ç¼å·å表 | |
| | | |
| | | #### 3.1.3 ååºå段 |
| | | | åæ®µ | ç±»å | ç¤ºä¾ | 说æ | |
| | | |------------|------|------|--------| |
| | | | stationIds | int | 100 | ç«ç¹ç¼å· | |
| | | | autoing | bool | true | èªå¨ | |
| | | | loading | bool | true | æç© | |
| | | | error | int | 0 | é误ç | |
| | | | errorMsg | str | | éè¯¯ä¿¡æ¯ | |
| | | | systemWarning | str | | ç³»ç»æ¥è¦ä¿¡æ¯ | |
| | | | superTaskNo | str | | WMSä»»å¡å· | |
| | | |
| | | ### 3.1.4 ååºJSON |
| | | ```json |
| | | { |
| | | "msg" : "æä½æå", |
| | | "code" : 200, |
| | | "data" : [ { |
| | | "stationId" : 1152, |
| | | "autoing" : true, |
| | | "loading" : false, |
| | | "error" : 0, |
| | | "errorMsg" : null, |
| | | "systemWarning" : null, |
| | | "superTaskNo" : "0" |
| | | }, { |
| | | "stationId" : 1157, |
| | | "autoing" : true, |
| | | "loading" : true, |
| | | "error" : 0, |
| | | "errorMsg" : null, |
| | | "systemWarning" : null, |
| | | "superTaskNo" : "0" |
| | | }] |
| | | } |
| | | ``` |
| | | ### 3.2 WMS任塿¥è¯¢æ¥å£ |
| | | |
| | | - **API URL(WCSå®é
æä¾ä¸ºå)**ï¼`/open/asrs/queryTask` |
| | | - **请æ±/ååºæ ¼å¼**ï¼`application/json; charset=utf-8` |
| | | - **å符é**ï¼UTF-8 |
| | | - **è¯·æ±æ¹å¼**: POST |
| | | |
| | | #### 3.2.1 Header |
| | | | Header | å¿
å¡« | ç¤ºä¾ | 说æ | |
| | | |---|---:|---|---| |
| | | |
| | | #### 3.2.2 Body |
| | | | Body | å¿
å¡« | ç±»å | ç¤ºä¾ | 说æ | |
| | | |------|---:|-----|------|-----| |
| | | |barcode| æ¯ | str | 1234 | æçç | |
| | | |
| | | #### 3.2.3 ååºå段 |
| | | | åæ®µ | ç±»å | ç¤ºä¾ | 说æ | |
| | | |------------|--------|------|-----------------------------------------------------------------------------| |
| | | | matnr | str | | ç©æå· | |
| | | | maktx | str | | ç©æåç§° | |
| | | | batch | str | | æ¹æ¬¡å· | |
| | | | specs | str | | è§æ ¼ | |
| | | | anfme | double | | æ°é | |
| | | | ioType | int | | ä»»å¡ç±»åï¼<br/>1ãå
¥åº<br/>53ãæ£æååº<br/>57ãçç¹ååº<br/>101ãåºåº<br/>103ãæ£æåºåº<br/>107ãçç¹åºåº | |
| | | |
| | | ### 3.2.4 ååºJSON |
| | | ```json |
| | | { |
| | | "msg" : "æä½æå", |
| | | "code" : 200, |
| | | "data" : { |
| | | "wrkDetls" : [ { |
| | | "anfme" : 100.0, |
| | | "matnr" : "50001LR-71", |
| | | "maktx" : "æ°æ³¡è¢", |
| | | "batch" : null, |
| | | "specs" : "50001LR-71" |
| | | } ], |
| | | "ioType": 1 |
| | | } |
| | | } |
| | | ``` |
| | | |
| | | ### 3.3 WMSå
¥åºä»»å¡æ¥è¯¢æ¥å£ |
| | | |
| | | - **API URL(WCSå®é
æä¾ä¸ºå)**ï¼`/open/asrs/queryComb` |
| | | - **请æ±/ååºæ ¼å¼**ï¼`application/json; charset=utf-8` |
| | | - **å符é**ï¼UTF-8 |
| | | - **è¯·æ±æ¹å¼**: POST |
| | | |
| | | #### 3.3.1 Header |
| | | | Header | å¿
å¡« | ç¤ºä¾ | 说æ | |
| | | |---|---:|---|---| |
| | | |
| | | #### 3.3.2 Body |
| | | | Body | å¿
å¡« | ç±»å | ç¤ºä¾ | 说æ | |
| | | |------|---:|-----|------|-----| |
| | | |barcode| æ¯ | str | 1234 | æçç | |
| | | |
| | | #### 3.3.3 ååºå段 |
| | | | åæ®µ | ç±»å | ç¤ºä¾ | 说æ | |
| | | |------------|--------|------|------| |
| | | | matnr | str | | ç©æå· | |
| | | | maktx | str | | ç©æåç§° | |
| | | | batch | str | | æ¹æ¬¡å· | |
| | | | specs | str | | è§æ ¼ | |
| | | | anfme | double | | æ°é | |
| | | |
| | | ### 3.3.4 ååºJSON |
| | | ```json |
| | | { |
| | | "msg" : "æä½æå", |
| | | "code" : 200, |
| | | "data" : { |
| | | "combDetls" : [ { |
| | | "anfme" : 100.0, |
| | | "matnr" : "50001LR-71", |
| | | "maktx" : "æ°æ³¡è¢", |
| | | "batch" : null, |
| | | "specs" : "50001LR-71" |
| | | } ] |
| | | } |
| | | } |
| | | ``` |
| | | |
| | | ### 3.4 WMSåºåæ°æ®æ¥è¯¢ |
| | | |
| | | - **API URL(WCSå®é
æä¾ä¸ºå)**ï¼`/open/asrs/queryLoc` |
| | | - **请æ±/ååºæ ¼å¼**ï¼`application/json; charset=utf-8` |
| | | - **å符é**ï¼UTF-8 |
| | | - **è¯·æ±æ¹å¼**: GET |
| | | |
| | | #### 3.4.1 Header |
| | | | Header | å¿
å¡« | ç¤ºä¾ | 说æ | |
| | | |---|---:|---|---| |
| | | |
| | | #### 3.4.2 Body |
| | | | Body | å¿
å¡« | ç±»å | ç¤ºä¾ | 说æ | |
| | | |------|---:|-----|------|-----| |
| | | |
| | | #### 3.4.3 ååºå段 |
| | | | åæ®µ | ç±»å | ç¤ºä¾ | 说æ | |
| | | |------------|--------|------|------| |
| | | | emptyCount | int | | 空åºä½æ°é | |
| | | | disableCount | int | | ç¦ç¨åºä½æ°é | |
| | | | total | int | | æ»åºä½æ°é | |
| | | | stockCount | int | | å¨åºä½æ°é | |
| | | | usedPr | double | | åºä½ä½¿ç¨ç | |
| | | | used | int | | åºä½ä½¿ç¨æ°é | |
| | | | pie | list | | 饼徿°æ® | |
| | | |
| | | ### 3.4.4 ååºJSON |
| | | ```json |
| | | { |
| | | "msg" : "æä½æå", |
| | | "code" : 200, |
| | | "data" : { |
| | | "emptyCount" : 52994, |
| | | "total" : 53130, |
| | | "usedPr" : 0.3, |
| | | "disableCount" : 0, |
| | | "used" : 136, |
| | | "pie" : [ { |
| | | "name" : "å¨åº", |
| | | "value" : 122 |
| | | }, { |
| | | "name" : "空", |
| | | "value" : 52994 |
| | | }, { |
| | | "name" : "使ç¨", |
| | | "value" : 14 |
| | | }, { |
| | | "name" : "ç¦ç¨", |
| | | "value" : 0 |
| | | } ], |
| | | "stockCount" : 122 |
| | | } |
| | | } |
| | | ``` |
| | | |
| | | ### 3.5 WMSå
¥åºåºæçº¿å¾ |
| | | |
| | | - **API URL(WCSå®é
æä¾ä¸ºå)**ï¼`/open/asrs/line/charts` |
| | | - **请æ±/ååºæ ¼å¼**ï¼`application/json; charset=utf-8` |
| | | - **å符é**ï¼UTF-8 |
| | | - **è¯·æ±æ¹å¼**: GET |
| | | |
| | | #### 3.5.1 Header |
| | | | Header | å¿
å¡« | ç¤ºä¾ | 说æ | |
| | | |---|---:|---|---| |
| | | |
| | | #### 3.5.2 Body |
| | | | Body | å¿
å¡« | ç±»å | ç¤ºä¾ | 说æ | |
| | | |------|---:|-----|------|-----| |
| | | |
| | | #### 3.5.3 ååºå段 |
| | | | åæ®µ | ç±»å | ç¤ºä¾ | 说æ | |
| | | |------------|--------|------|------| |
| | | |
| | | ### 3.5.4 ååºJSON |
| | | ```json |
| | | { |
| | | "msg" : "æä½æå", |
| | | "code" : 200, |
| | | "data" : { |
| | | "rows" : [ { |
| | | "name" : "å
¥åºæ°é", |
| | | "data" : [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 198 ] |
| | | }, { |
| | | "name" : "åºåºæ°é", |
| | | "data" : [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] |
| | | } ] |
| | | } |
| | | } |
| | | ``` |
| | | |
| | | ### 3.6 WMSåºåæ°æ®ç»è®¡ |
| | | |
| | | - **API URL(WCSå®é
æä¾ä¸ºå)**ï¼`/open/asrs/locDetl/statistics` |
| | | - **请æ±/ååºæ ¼å¼**ï¼`application/json; charset=utf-8` |
| | | - **å符é**ï¼UTF-8 |
| | | - **è¯·æ±æ¹å¼**: GET |
| | | |
| | | #### 3.6.1 Header |
| | | | Header | å¿
å¡« | ç¤ºä¾ | 说æ | |
| | | |---|---:|---|---| |
| | | |
| | | #### 3.6.2 Body |
| | | | Body | å¿
å¡« | ç±»å | ç¤ºä¾ | 说æ | |
| | | |------|---:|-----|------|-----| |
| | | |
| | | #### 3.6.3 ååºå段 |
| | | | åæ®µ | ç±»å | ç¤ºä¾ | 说æ | |
| | | |------------|--------|------|------| |
| | | |
| | | ### 3.6.4 ååºJSON |
| | | ```json |
| | | { |
| | | "msg" : "æä½æå", |
| | | "code" : 200, |
| | | "data" : { |
| | | "records" : [ { |
| | | "anfme" : 19500.0, |
| | | "matnr" : "50001LR-71", |
| | | "maktx" : "æ°æ³¡è¢", |
| | | "batch" : null, |
| | | "specs" : "50001LR-71" |
| | | } ] |
| | | } |
| | | } |
| | | ``` |