| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public R<PageInfo<DeptListVO>> pageList(@RequestBody DeptListQuery query) { |
| | | return R.ok(deptService.pageList(query)); |
| | | } |
| | | @ApiOperation(value = "部门不分页列表") |
| | | @PostMapping(value = "/listAll") |
| | | public R<List<TDept>> listAll() { |
| | | List<TDept> depts = deptService.list(); |
| | | return R.ok(depts); |
| | | } |
| | | @Log(title = "新增部门", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "新增部门") |
| | | @PostMapping(value = "/add") |
| | |
| | | public R<PageInfo<TemplateListVO>> pageList(@RequestBody TemplateListQuery query) { |
| | | return R.ok(templateService.pageList(query)); |
| | | } |
| | | @ApiOperation(value = "任务模板不分页列表") |
| | | @PostMapping(value = "/listAllTemplate") |
| | | public R<List<TTemplate>> listAllTemplate() { |
| | | return R.ok(templateService.list()); |
| | | } |
| | | @ApiOperation(value = "点位类型不分页列表") |
| | | @PostMapping(value = "/listAll") |
| | | public R<List<TLocationType>> pageList() { |
| | |
| | | res.add(jsonObject); |
| | | } |
| | | String num4 = tTemplateDetail.getNum4(); |
| | | JSONObject jsonObject = JSONObject.parseObject(num4); |
| | | JSONArray num5Array = jsonObject.getJSONArray("num5"); |
| | | JSONArray num5Array = JSONArray.parseArray(num4); |
| | | for (Object o : num5Array) { |
| | | JSONObject jsonObject1 = (JSONObject) o; |
| | | String string = jsonObject1.getString("id"); |
| | |
| | | private static final OkHttpClient client = new OkHttpClient(); |
| | | |
| | | public static String getDrivingRoute(double startLat, double startLon, double endLat, double endLon) throws IOException { |
| | | String url = "https://restapi.amap.com/v3/direction/walking?" + |
| | | String url = "https://restapi.amap.com/v3/direction/driving?" + |
| | | "origin=" + startLon + "," + startLat + |
| | | "&destination=" + endLon + "," + endLat + |
| | | "&key=" + KEY; |
| | |
| | | package com.ruoyi.web.util; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.google.gson.JsonObject; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | public class MainApp { |
| | | public static void main(String[] args) { |
| | | double startLat = 39.9042; |
| | | double startLon = 116.4074; |
| | | double startLon = 118.4074; |
| | | double endLat = 39.9042; |
| | | double endLon = 116.4074; |
| | | double endLon = 119.4074; |
| | | |
| | | double userLat = 39.9042; |
| | | double userLon = 116.4074; |
| | |
| | | int segments = 4; // 四段,共 5 个点 |
| | | try { |
| | | String routeJson = AmapApiClient.getDrivingRoute(startLat, startLon, endLat, endLon); |
| | | // 转化为json对象 |
| | | JSONObject jsonObject = JSONObject.parseObject(routeJson); |
| | | JSONObject route = jsonObject.getJSONObject("route"); |
| | | JSONArray paths = route.getJSONArray("paths"); |
| | | JSONObject o = (JSONObject)paths.get(0); |
| | | BigDecimal distance = o.getBigDecimal("distance"); |
| | | System.err.println( paths); |
| | | |
| | | List<double[]> fivePoints = PathParser.parseAndInterpolate(routeJson, segments,startLat, startLon, endLat, endLon); |
| | | |
| | | if (GeoChecker.isInAnyCircle(userLat, userLon, fivePoints, radius)) { |
| | |
| | | private String projectId; |
| | | |
| | | |
| | | @ApiModelProperty(value = "部门级编号") |
| | | @TableField("dept_code") |
| | | private String deptCode; |
| | | |
| | | @ApiModelProperty(value = "项目级编号") |
| | | @TableField("project_code") |
| | | private String projectCode; |
| | | } |
| | |
| | | @TableField("num3") |
| | | private Integer num3; |
| | | |
| | | @ApiModelProperty(value = "点位类型覆盖率json {\n" + |
| | | "\t\"num5\": [{\n" + |
| | | @ApiModelProperty(value = "点位类型覆盖率json [{\n" + |
| | | "\t\t\"id\": \"18678093453\",\n" + |
| | | "\t\t\"value\": 18\n" + |
| | | "\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"id\": \"18678093453\",\n" + |
| | | "\t\t\"value\": 18\n" + |
| | | "\t}]\n" + |
| | | "\n" + |
| | | "}") |
| | | "\t}]\n") |
| | | @TableField("num4") |
| | | private String num4; |
| | | |
| | |
| | | sysUserVO.setDeptName(tProjectDept.getProjectName()); |
| | | } |
| | | }else{ |
| | | if (sysUserVO.getUserId()==1){ |
| | | sysUserVO.setDeptName("公司"); |
| | | }else{ |
| | | TDept tDept = deptMapper.selectById(sysUserVO.getDeptId()); |
| | | sysUserVO.setDeptName(tDept.getDeptName()); |
| | | } |
| | | |
| | | } |
| | | } |
| | | pageInfo.setTotal(list.size()); |
| | | if (org.springframework.util.StringUtils.hasLength(query.getDeptName())){ |
| | |
| | | select a.role_id AS roleId, a.role_name AS roleName, a.role_key AS roleKey, a.role_sort AS roleSort, a.data_scope AS dataScope, |
| | | a.menu_check_strictly AS menuCheckStrictly, a.dept_check_strictly AS deptCheckStrictly,a.status AS status, a.del_flag AS delFlag, |
| | | a.create_time AS createTime,a.create_by AS createBy,a.postType AS postType,a.removeDays AS removeDays, |
| | | a.role_type as roleType,a.remark |
| | | a.role_type as roleType,a.remark, |
| | | IFNULL(b.userCount,0) as userCount |
| | | from sys_role a |
| | | LEFT JOIN |
| | |
| | | <if test="query.projectId != null and query.projectId != ''"> |
| | | and t1.projectId = #{query.projectId} |
| | | </if> |
| | | </where> |
| | | and t1.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | order by t1.create_time desc |
| | | </select> |
| | | |
| | | </mapper> |