无关风月
2025-06-20 a9541d7a0ea793e6494b83f4517f13cf2cb64c85
保洁巡检本周代码
9个文件已修改
76 ■■■■ 已修改文件
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TDeptController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TTemplateController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/util/AmapApiClient.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/util/MainApp.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/model/TCleaner.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/model/TTemplateDetail.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TCleanerMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TDeptController.java
@@ -21,6 +21,7 @@
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
/**
 * <p>
@@ -43,6 +44,12 @@
    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")
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TTemplateController.java
@@ -58,6 +58,11 @@
    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() {
@@ -145,8 +150,7 @@
                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");
ruoyi-admin/src/main/java/com/ruoyi/web/util/AmapApiClient.java
@@ -11,7 +11,7 @@
    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;
ruoyi-admin/src/main/java/com/ruoyi/web/util/MainApp.java
@@ -1,13 +1,18 @@
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;
@@ -16,6 +21,14 @@
        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)) {
ruoyi-system/src/main/java/com/ruoyi/system/model/TCleaner.java
@@ -42,4 +42,11 @@
    private String projectId;
    @ApiModelProperty(value = "部门级编号")
    @TableField("dept_code")
    private String deptCode;
    @ApiModelProperty(value = "项目级编号")
    @TableField("project_code")
    private String projectCode;
}
ruoyi-system/src/main/java/com/ruoyi/system/model/TTemplateDetail.java
@@ -49,17 +49,14 @@
    @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;
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
@@ -692,16 +692,21 @@
            }
            Integer deptType = sysUserVO.getDeptType();
                if (1==deptType){
                    TProjectDept tProjectDept = projectDeptMapper.selectById(sysUserVO.getDeptId());
                    if (!tProjectDept.getParentId().equals("0")){
                        TProjectDept tProjectDept1 = projectDeptMapper.selectById(tProjectDept.getParentId());
                         sysUserVO.setDeptName(tProjectDept1.getProjectName()+">"+tProjectDept.getProjectName());
                    }else{
                        sysUserVO.setDeptName(tProjectDept.getProjectName());
                    }
                        TProjectDept tProjectDept = projectDeptMapper.selectById(sysUserVO.getDeptId());
                        if (!tProjectDept.getParentId().equals("0")){
                            TProjectDept tProjectDept1 = projectDeptMapper.selectById(tProjectDept.getParentId());
                            sysUserVO.setDeptName(tProjectDept1.getProjectName()+">"+tProjectDept.getProjectName());
                        }else{
                            sysUserVO.setDeptName(tProjectDept.getProjectName());
                        }
                }else{
                    TDept tDept = deptMapper.selectById(sysUserVO.getDeptId());
                     sysUserVO.setDeptName(tDept.getDeptName());
                    if (sysUserVO.getUserId()==1){
                        sysUserVO.setDeptName("公司");
                    }else{
                        TDept tDept = deptMapper.selectById(sysUserVO.getDeptId());
                        sysUserVO.setDeptName(tDept.getDeptName());
                    }
                }
            }
        pageInfo.setTotal(list.size());
ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml
@@ -99,7 +99,7 @@
        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
ruoyi-system/src/main/resources/mapper/system/TCleanerMapper.xml
@@ -31,9 +31,8 @@
            <if test="query.projectId != null and query.projectId != ''">
                 and t1.projectId = #{query.projectId}
            </if>
            and  t1.disabled  = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        and  t1.disabled  = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        order by t1.create_time desc
    </select>
</mapper>