2 文件已重命名
8个文件已添加
24个文件已修改
New file |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.TAppealAuditDTO; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.InsepectorListQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.system.AppealDetailVO; |
| | | import com.ruoyi.system.vo.system.AppealListVO; |
| | | import com.ruoyi.web.util.OssUploadUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 任务申诉 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-05-28 |
| | | */ |
| | | @Api(tags = "任务申诉") |
| | | @RestController |
| | | @RequestMapping("/oss") |
| | | public class OssController { |
| | | @PostMapping("/upload") |
| | | @ApiOperation(value = "文件上传",tags = "文件上传") |
| | | public R<String> uploadOSS(@RequestPart("file") MultipartFile file) { |
| | | try { |
| | | // 上传并返回访问地址 |
| | | String fileName = file.getOriginalFilename(); |
| | | String prefix = fileName.substring(fileName.lastIndexOf(".")); |
| | | long fileSize = file.getSize(); |
| | | String url = OssUploadUtil.ossUpload(file); |
| | | return R.ok(url); |
| | | } catch (Exception e) { |
| | | System.err.println("上传文件失败"+e); |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.BaseModel; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.TAppealAuditDTO; |
| | | import com.ruoyi.system.dto.TTaskAuditDTO; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.InsepectorListQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.system.AppealDetailVO; |
| | | import com.ruoyi.system.vo.system.AppealListVO; |
| | | import com.ruoyi.system.vo.system.InspectorListVO; |
| | | import com.ruoyi.system.vo.system.TaskDetailVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.util.StringUtils; |
| | |
| | | @RequestMapping("/t-appeal") |
| | | public class TAppealController { |
| | | @Resource |
| | | private TTaskService taskService; |
| | | private TTaskCleanService taskCleanService; |
| | | |
| | | @Resource |
| | | private TTaskDetailService taskDetailService; |
| | | |
| | | |
| | | |
| | | @Resource |
| | |
| | | @Resource |
| | | private TProjectDeptService projectDeptService; |
| | | @Resource |
| | | private TCleanerService cleanerService; |
| | | @Resource |
| | | private TTaskService tTaskService; |
| | | @Resource |
| | | private TTaskDetailService tTaskDetailService; |
| | | @Resource |
| | | private TDeptService deptService; |
| | | @Resource |
| | | private ISysUserService sysUserService; |
| | | @Resource |
| | | private TDictDataService dictDataService; |
| | | |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private TInspectorService inspectorService; |
| | | |
| | | @Resource |
| | | private TAppealService appealService; |
| | | @ApiOperation(value = "申诉记录分页列表") |
| | |
| | | AppealDetailVO appealDetailVO = new AppealDetailVO(); |
| | | TAppeal appeal = appealService.getById(id); |
| | | BeanUtils.copyProperties(appeal,appealDetailVO); |
| | | TTask byId = taskService.getById(appeal.getTaskId()); |
| | | TTask byId = taskCleanService.getById(appeal.getTaskId()); |
| | | TLocation byId1 = locationService.getById(byId.getLocationId()); |
| | | TLocationType byId2 = locationTypeService.getById(byId1.getLocationType()); |
| | | appealDetailVO.setLocationAddress(byId1.getLocationAddress()); |
| | |
| | | dto.setAuditTime(LocalDateTime.now()); |
| | | if (dto.getStatus()==2){ |
| | | // 通过 |
| | | TTask byId = taskService.getById(dto.getTaskId()); |
| | | TTask byId = taskCleanService.getById(dto.getTaskId()); |
| | | byId.setStatus(6); |
| | | taskService.updateById(byId); |
| | | taskCleanService.updateById(byId); |
| | | } |
| | | dto.setAuditPerson(tokenService.getLoginUser().getUserId()+""); |
| | | appealService.updateById(dto); |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.dto.CleanerDTO; |
| | | import com.ruoyi.system.dto.ProjectDeptDTO; |
| | | import com.ruoyi.system.model.TCleaner; |
| | | import com.ruoyi.system.model.TProjectDept; |
| | | import com.ruoyi.system.query.CleanerListQuery; |
| | | import com.ruoyi.system.query.ProjectDeptListQuery; |
| | | import com.ruoyi.system.service.TCleanerService; |
| | | import com.ruoyi.system.service.TProjectDeptService; |
| | | import com.ruoyi.system.vo.system.CleanerListVO; |
| | | import com.ruoyi.system.vo.system.ProjectDeptListVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | */ |
| | | @Api(tags = "部门管理") |
| | | @RestController |
| | | @RequestMapping("/t-project-dept") |
| | | @RequestMapping("/t-dept") |
| | | public class TDeptController { |
| | | @Resource |
| | | private TDeptService deptService; |
| | |
| | | import com.ruoyi.system.model.TProjectDept; |
| | | import com.ruoyi.system.model.TTaskDetail; |
| | | import com.ruoyi.system.query.InsepectorListQuery; |
| | | import com.ruoyi.system.query.TaskListQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.system.InspectorListVO; |
| | | import com.ruoyi.system.vo.system.TaskListVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.util.StringUtils; |
| | |
| | | @RestController |
| | | @RequestMapping("/t-inspector") |
| | | public class TInspectorController { |
| | | @Resource |
| | | private TTaskService taskService; |
| | | |
| | | @Resource |
| | | private TTaskDetailService taskDetailService; |
| | | |
| | | |
| | | @Resource |
| | | private TLocationTypeService locationTypeService; |
| | | @Resource |
| | | private TLocationService locationService; |
| | | @Resource |
| | | private TProjectDeptService projectDeptService; |
| | | @Resource |
| | | private TCleanerService cleanerService; |
| | | @Resource |
| | | private TTaskService tTaskService; |
| | | |
| | | @Resource |
| | | private TTaskDetailService tTaskDetailService; |
| | | @Resource |
| | | private TDeptService deptService; |
| | | @Resource |
| | | private ISysUserService sysUserService; |
| | | @Resource |
| | | private TDictDataService dictDataService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | @Resource |
| | | private TInspectorService inspectorService; |
| | | @ApiOperation(value = "督察记录分页列表") |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.query.LeaveListQuery; |
| | | import com.ruoyi.system.query.ProjectDeptListQuery; |
| | | import com.ruoyi.system.service.TLeaveService; |
| | | import com.ruoyi.system.vo.system.LeaveListVO; |
| | | import com.ruoyi.system.vo.system.ProjectDeptListVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.system.dto.LocationDTO; |
| | | import com.ruoyi.system.dto.LocationTypeDTO; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.LocationListQuery; |
| | | import com.ruoyi.system.query.LocationListTaskQuery; |
| | | import com.ruoyi.system.query.LocationTypeListQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.system.LocationListTaskVO; |
| | | import com.ruoyi.system.vo.system.LocationListVO; |
| | |
| | | @Resource |
| | | private TCleanerService cleanerService; |
| | | @Resource |
| | | private TTaskService tTaskService; |
| | | private TTaskCleanService tTaskCleanService; |
| | | @Resource |
| | | private TTaskDetailService tTaskDetailService; |
| | | @Resource |
| | |
| | | } |
| | | } |
| | | PageInfo<LocationListTaskVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TTask> list = tTaskService.lambdaQuery() |
| | | List<TTask> list = tTaskCleanService.lambdaQuery() |
| | | .eq(TTask::getLocationId, query.getId()) |
| | | .between(StringUtils.hasLength(query.getStartTime()), TTask::getImplementTime, query.getStartTime(), query.getEndTime()) |
| | | .eq(query.getStatus() != null, TTask::getStatus, query.getStatus()) |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.system.dto.DeptDTO; |
| | | import com.ruoyi.system.dto.ProjectDeptDTO; |
| | | import com.ruoyi.system.model.TDept; |
| | | import com.ruoyi.system.model.TLocationType; |
| | | import com.ruoyi.system.model.TProjectDept; |
| | | import com.ruoyi.system.query.DeptListQuery; |
| | | import com.ruoyi.system.query.ProjectDeptListQuery; |
| | | import com.ruoyi.system.service.TDeptService; |
| | | import com.ruoyi.system.service.TProjectDeptService; |
| | | import com.ruoyi.system.vo.system.DeptListVO; |
| | | import com.ruoyi.system.vo.system.ProjectDeptListNoLimitVO; |
| | | import com.ruoyi.system.vo.system.ProjectDeptListVO; |
| | | import io.swagger.annotations.Api; |
| | |
| | | |
| | | @ApiOperation(value = "项目部分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<ProjectDeptListVO>> pageList(@RequestBody ProjectDeptListQuery query) { |
| | | public R<PageInfo<ProjectDeptListVO>> pageList(@RequestBody DeptListQuery query) { |
| | | return R.ok(deptService.pageList(query)); |
| | | } |
| | | @ApiOperation(value = "选择项目部/片区不分页列表") |
| | |
| | | } |
| | | @Log(title = "启用/禁用项目部", businessType = BusinessType.OTHER) |
| | | @ApiOperation(value = "启用/禁用项目部") |
| | | @DeleteMapping(value = "/editStatus") |
| | | @GetMapping(value = "/editStatus") |
| | | public R<Boolean> editStatus(@RequestParam String id) { |
| | | TProjectDept byId = deptService.getById(id); |
| | | if (byId.getStatus()==1){ |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | import com.google.common.collect.Lists; |
| | | import java.time.LocalDateTime; |
| | | |
| | | import com.ruoyi.common.core.domain.BaseModel; |
| | |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.system.dto.TTaskDTO; |
| | | import com.ruoyi.system.dto.TTemplateDTO; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.ProjectDeptListQuery; |
| | | import com.ruoyi.system.query.TaskListQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.system.*; |
| | |
| | | @RequestMapping("/t-task") |
| | | public class TTaskController { |
| | | @Resource |
| | | private TTaskService taskService; |
| | | private TTaskCleanService taskCleanerService; |
| | | |
| | | @Resource |
| | | private TTaskDetailService taskDetailService; |
| | |
| | | private TLocationService locationService; |
| | | @Resource |
| | | private TProjectDeptService projectDeptService; |
| | | @Resource |
| | | private TCleanerService cleanerService; |
| | | @Resource |
| | | private TTaskService tTaskService; |
| | | |
| | | @Resource |
| | | private TTaskDetailService tTaskDetailService; |
| | | @Resource |
| | |
| | | query.setLocationIds(collect); |
| | | } |
| | | } |
| | | return R.ok(taskService.pageList(query)); |
| | | return R.ok(taskCleanerService.pageList(query)); |
| | | } |
| | | |
| | | @Log(title = "新增任务", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "新增任务") |
| | | @PostMapping(value = "/add") |
| | | public R<Boolean> add(@RequestBody TTaskDTO dto) { |
| | | taskService.save(dto); |
| | | taskCleanerService.save(dto); |
| | | return R.ok(); |
| | | } |
| | | @Log(title = "审核任务", businessType = BusinessType.UPDATE) |
| | |
| | | if (dto.getAuditStatus()==2){ |
| | | dto.setHandleType(3); |
| | | // 将任务修改为待整改 |
| | | TTask byId = taskService.getById(dto.getTaskId()); |
| | | TTask byId = taskCleanerService.getById(dto.getTaskId()); |
| | | byId.setStatus(4); |
| | | taskService.updateById(byId); |
| | | taskCleanerService.updateById(byId); |
| | | }else{ |
| | | dto.setHandleType(2); |
| | | } |
| | |
| | | if (dto.getAuditStatus()==2){ |
| | | tTaskDetail.setHandleType(3); |
| | | // 将任务修改为待整改 |
| | | TTask byId = taskService.getById(tTaskDetail.getTaskId()); |
| | | TTask byId = taskCleanerService.getById(tTaskDetail.getTaskId()); |
| | | byId.setStatus(4); |
| | | taskService.updateById(byId); |
| | | taskCleanerService.updateById(byId); |
| | | }else{ |
| | | tTaskDetail.setHandleType(2); |
| | | } |
| | |
| | | List<TTaskDetail> list = taskDetailService.lambdaQuery().eq(TTaskDetail::getTaskId, id) |
| | | .orderByDesc(BaseModel::getCreateTime).list(); |
| | | TaskDetailVO taskDetailVO = new TaskDetailVO(); |
| | | TTask byId = taskService.getById(id); |
| | | TTask byId = taskCleanerService.getById(id); |
| | | BeanUtils.copyProperties(byId, taskDetailVO); |
| | | TLocation byId1 = locationService.getById(byId.getLocationId()); |
| | | TLocationType byId2 = locationTypeService.getById(byId1.getLocationType()); |
| | |
| | | |
| | | TaskRecordDetailVO taskDetailVO = new TaskRecordDetailVO(); |
| | | TTaskDetail byId4 = taskDetailService.getById(id); |
| | | TTask byId = taskService.getById(byId4.getTaskId()); |
| | | TTask byId = taskCleanerService.getById(byId4.getTaskId()); |
| | | BeanUtils.copyProperties(byId, taskDetailVO); |
| | | TLocation byId1 = locationService.getById(byId.getLocationId()); |
| | | TLocationType byId2 = locationTypeService.getById(byId1.getLocationType()); |
| | |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public R<Boolean> deleteByIds(@RequestParam String ids) { |
| | | String[] split = ids.split(","); |
| | | taskService.removeBatchByIds(Arrays.asList(split)); |
| | | taskCleanerService.removeBatchByIds(Arrays.asList(split)); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.google.gson.JsonArray; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.system.dto.LocationDTO; |
| | | import com.ruoyi.system.dto.TTemplateDTO; |
| | | import com.ruoyi.system.model.TLocation; |
| | | import com.ruoyi.system.model.TLocationType; |
| | | import com.ruoyi.system.model.TTemplate; |
| | | import com.ruoyi.system.model.TTemplateDetail; |
| | | import com.ruoyi.system.query.LocationTypeListQuery; |
| | | import com.ruoyi.system.query.ProjectDeptListQuery; |
| | | import com.ruoyi.system.query.TemplateListQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.system.LocationTypeListVO; |
| | | import com.ruoyi.system.vo.system.ProjectDeptListVO; |
| | | import com.ruoyi.system.vo.system.TemplateDetailVO; |
| | | import com.ruoyi.system.vo.system.TemplateListVO; |
| | | import io.swagger.annotations.Api; |
| | |
| | | |
| | | @ApiOperation(value = "任务模板分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<TemplateListVO>> pageList(@RequestBody ProjectDeptListQuery query) { |
| | | public R<PageInfo<TemplateListVO>> pageList(@RequestBody TemplateListQuery query) { |
| | | return R.ok(templateService.pageList(query)); |
| | | } |
| | | @ApiOperation(value = "点位类型不分页列表") |
| | |
| | | @PostMapping(value = "/add") |
| | | public R<Boolean> add(@RequestBody TTemplateDTO dto) { |
| | | templateService.save(dto); |
| | | List<TTemplateDetail> list = dto.getList(); |
| | | for (TTemplateDetail tTemplateDetail : list) { |
| | | tTemplateDetail.setTemplateId(dto.getId()); |
| | | } |
| | | templateDetailService.saveBatch(list); |
| | | return R.ok(); |
| | | } |
| | | @Log(title = "编辑任务模板", businessType = BusinessType.UPDATE) |
| | |
| | | @PostMapping(value = "/edit") |
| | | public R<Boolean> edit(@RequestBody TTemplateDTO dto) { |
| | | templateService.updateById(dto); |
| | | templateDetailService.remove(new LambdaQueryWrapper<TTemplateDetail>() |
| | | .eq(TTemplateDetail::getTemplateId, dto.getId())); |
| | | templateDetailService.saveBatch(dto.getList()); |
| | | return R.ok(); |
| | | } |
| | | @Log(title = "批量删除任务模板", businessType = BusinessType.DELETE) |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.core.domain.model.LoginUserApplet; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | |
| | | * @param loginBody 登录信息 |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation(value = "账号密码登录",notes = "账号密码登录") |
| | | @ApiOperation(value = "管理后台账号密码登录",notes = "账号密码登录") |
| | | @PostMapping("/login") |
| | | public AjaxResult login(@RequestBody LoginBody loginBody) |
| | | { |
| | |
| | | ajax.put("userInfo",loginUser); |
| | | return ajax; |
| | | } |
| | | /** |
| | | * 账号密码登录 |
| | | * |
| | | * @param loginBody 登录信息 |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation(value = "小程序账号密码登录",notes = "账号密码登录") |
| | | @PostMapping("/loginApplet") |
| | | public AjaxResult loginApplet(@RequestBody LoginBody loginBody) |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | // 生成令牌 |
| | | LoginUserApplet loginUser = loginService.loginApplet(loginBody.getUsername(), loginBody.getPassword()); |
| | | ajax.put(Constants.TOKEN, tokenService.createTokenApplet(loginUser)); |
| | | ajax.put("userInfo",loginUser); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 账号密码登录 |
New file |
| | |
| | | package com.ruoyi.web.util; |
| | | |
| | | import okhttp3.OkHttpClient; |
| | | import okhttp3.Request; |
| | | import okhttp3.Response; |
| | | |
| | | import java.io.IOException; |
| | | |
| | | public class AmapApiClient { |
| | | private static final String KEY = "e700a58329a38b2d8980790d9b1b5b06"; |
| | | 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?" + |
| | | "origin=" + startLon + "," + startLat + |
| | | "&destination=" + endLon + "," + endLat + |
| | | "&key=" + KEY; |
| | | |
| | | Request request = new Request.Builder() |
| | | .url(url) |
| | | .build(); |
| | | |
| | | try (Response response = client.newCall(request).execute()) { |
| | | return response.body().string(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.util; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class GeoChecker { |
| | | public static boolean isInAnyCircle(double userLat, double userLon, List<double[]> circleCenters, double radius) { |
| | | for (double[] center : circleCenters) { |
| | | double distance = PathParser.calculateDistance(userLat, userLon, center[0], center[1]); |
| | | if (distance <= radius) { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.util; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class MainApp { |
| | | public static void main(String[] args) { |
| | | double startLat = 39.9042; |
| | | double startLon = 116.4074; |
| | | double endLat = 39.9042; |
| | | double endLon = 116.4074; |
| | | |
| | | double userLat = 39.9042; |
| | | double userLon = 116.4074; |
| | | |
| | | double radius = 50; // 单位:米 |
| | | int segments = 4; // 四段,共 5 个点 |
| | | try { |
| | | String routeJson = AmapApiClient.getDrivingRoute(startLat, startLon, endLat, endLon); |
| | | List<double[]> fivePoints = PathParser.parseAndInterpolate(routeJson, segments,startLat, startLon, endLat, endLon); |
| | | |
| | | if (GeoChecker.isInAnyCircle(userLat, userLon, fivePoints, radius)) { |
| | | System.out.println("✅ 成功!您位于某个圆形电子围栏范围内。"); |
| | | } else { |
| | | System.out.println("❌ 失败!您不在任何圆形电子围栏范围内。"); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.util; |
| | | |
| | | import com.aliyun.oss.OSSClient; |
| | | import com.aliyun.oss.model.ObjectMetadata; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.UUID; |
| | | |
| | | public class OssUploadUtil { |
| | | //OSS图片访问域名 |
| | | public static String oss_domain = "https://bjxj.oss-cn-guangzhou.aliyuncs.com/"; |
| | | public static String accessKeyId = "LTAI5t7iBqAKndrt7BArjH1k"; |
| | | public static String accessKeySecret = "LIes9z8wS2dz7psGrFjx7DWZUdZIAp"; |
| | | public static String bucketName="bjxj"; |
| | | public static String filePath="bjxj/"; |
| | | public static String endpoint = "oss-cn-guangzhou.aliyuncs.com"; |
| | | |
| | | public static OSSClient ossClient = new OSSClient(endpoint, accessKeyId,accessKeySecret); |
| | | |
| | | public static String ossUpload( MultipartFile file) throws IOException{ |
| | | String fileName = ""; |
| | | if(file!=null && !"".equals(file.getOriginalFilename()) && file.getOriginalFilename()!=null){ |
| | | InputStream content = file.getInputStream();//获得指定文件的输入流 |
| | | ObjectMetadata meta = new ObjectMetadata();// 创建上传Object的Metadata |
| | | meta.setContentLength(file.getSize()); // 必须设置ContentLength |
| | | String originalFilename = file.getOriginalFilename(); |
| | | fileName = UUID.randomUUID().toString().replaceAll("-","") + originalFilename.subSequence(originalFilename.lastIndexOf("."), originalFilename.length()); |
| | | ossClient.putObject(bucketName, filePath + fileName, content, meta);// 上传Object. |
| | | if(fileName != null && !"".equals(fileName)){ |
| | | System.out.println(fileName); |
| | | fileName = oss_domain+ filePath +fileName; |
| | | } |
| | | } |
| | | return fileName; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.util; |
| | | |
| | | import com.fasterxml.jackson.databind.JsonNode; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | public class PathParser { |
| | | public static List<double[]> parseAndInterpolate(String jsonResponse, int segments,double startLat, double startLon, double endLat, double endLon) throws Exception { |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | JsonNode root = mapper.readTree(jsonResponse); |
| | | JsonNode steps = root.at("/route/paths/0/steps"); |
| | | List<double[]> allPoints = new ArrayList<>(); |
| | | allPoints.add(new double[]{startLat, startLon}); |
| | | |
| | | if (startLat==endLat&&startLon==endLon){ |
| | | allPoints.add(new double[]{startLat, startLon}); |
| | | }else{ |
| | | for (JsonNode step : steps) { |
| | | String polyline = step.get("polyline").asText(); |
| | | String[] points = polyline.split(";"); |
| | | for (String point : points) { |
| | | String[] lonlat = point.split(","); |
| | | double lon = Double.parseDouble(lonlat[0]); |
| | | double lat = Double.parseDouble(lonlat[1]); |
| | | allPoints.add(new double[]{lat, lon}); |
| | | } |
| | | } |
| | | } |
| | | |
| | | allPoints.add(new double[]{endLat, endLon}); |
| | | |
| | | // 计算总距离 |
| | | double totalDistance = 0; |
| | | for (int i = 1; i < allPoints.size(); i++) { |
| | | totalDistance += calculateDistance(allPoints.get(i - 1)[0], allPoints.get(i - 1)[1], |
| | | allPoints.get(i)[0], allPoints.get(i)[1]); |
| | | } |
| | | |
| | | // 均分距离 |
| | | double segmentLength = totalDistance / segments; |
| | | List<double[]> resultPoints = new ArrayList<>(); |
| | | resultPoints.add(allPoints.get(0)); |
| | | |
| | | double accumulatedDistance = 0; |
| | | int currentPointIndex = 0; |
| | | for (int i = 1; i < segments; i++) { |
| | | double targetDistance = i * segmentLength; |
| | | while (accumulatedDistance < targetDistance && currentPointIndex < allPoints.size() - 1) { |
| | | double[] p1 = allPoints.get(currentPointIndex); |
| | | double[] p2 = allPoints.get(currentPointIndex + 1); |
| | | double d = calculateDistance(p1[0], p1[1], p2[0], p2[1]); |
| | | if (accumulatedDistance + d >= targetDistance) { |
| | | double ratio = (targetDistance - accumulatedDistance) / d; |
| | | double lat = p1[0] + ratio * (p2[0] - p1[0]); |
| | | double lon = p1[1] + ratio * (p2[1] - p1[1]); |
| | | resultPoints.add(new double[]{lat, lon}); |
| | | accumulatedDistance = targetDistance; |
| | | } else { |
| | | accumulatedDistance += d; |
| | | currentPointIndex++; |
| | | } |
| | | } |
| | | } |
| | | |
| | | resultPoints.add(allPoints.get(allPoints.size() - 1)); |
| | | return resultPoints; |
| | | } |
| | | |
| | | public static double calculateDistance(double lat1, double lon1, double lat2, double lon2) { |
| | | double R = 6371000; // 地球半径单位米 |
| | | double dLat = Math.toRadians(lat2 - lat1); |
| | | double dLon = Math.toRadians(lon2 - lon1); |
| | | |
| | | double a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + |
| | | Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) * |
| | | Math.sin(dLon / 2) * Math.sin(dLon / 2); |
| | | double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); |
| | | return R * c; |
| | | } |
| | | } |
| | |
| | | * 令牌前缀 |
| | | */ |
| | | public static final String LOGIN_USER_KEY = "login_user_key"; |
| | | public static final String APPLET_USER_KEY = "applet_user_key"; |
| | | /** |
| | | * 小程序 |
| | | */ |
New file |
| | |
| | | package com.ruoyi.common.core.domain.model; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | /** |
| | | * 用户登录对象 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @ApiModel(value = "小程序登录对象Body") |
| | | public class LoginBodyApplet |
| | | { |
| | | /** |
| | | * 用户名 |
| | | */ |
| | | @ApiModelProperty(value = "用户名",notes = "用户名") |
| | | private String username; |
| | | |
| | | /** |
| | | * 用户密码 |
| | | */ |
| | | @ApiModelProperty(value = "用户密码") |
| | | private String password; |
| | | |
| | | /** |
| | | * 验证码 |
| | | */ |
| | | |
| | | |
| | | public String getUsername() |
| | | { |
| | | return username; |
| | | } |
| | | |
| | | public void setUsername(String username) |
| | | { |
| | | this.username = username; |
| | | } |
| | | |
| | | public String getPassword() |
| | | { |
| | | return password; |
| | | } |
| | | |
| | | public void setPassword(String password) |
| | | { |
| | | this.password = password; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | .authorizeRequests() |
| | | // 对于登录login 注册register 验证码captchaImage 允许匿名访问 |
| | | .antMatchers("/getPrivacyAgreement/{agreementType}", |
| | | "/applet/queryProtocolConfigByType","/applet/login", |
| | | "/applet/queryProtocolConfigByType","/applet/login","/oss/upload", |
| | | "/login","/applet/queryProtocolConfigByType", |
| | | "/register","/applet/getCode","/applet/loginCode", |
| | | "/applet/changepwd", "/captchaImage","/getCode","/loginCode", |
| | |
| | | // 生成token |
| | | return loginUser; |
| | | } |
| | | /** |
| | | * 小程序登录验证 |
| | | * |
| | | * @param username 用户名 |
| | | * @param password 密码 |
| | | |
| | | * @return 结果 |
| | | */ |
| | | public LoginUserApplet loginApplet(String username, String password) |
| | | { |
| | | // 验证码校验 |
| | | // validateCaptcha(username); |
| | | // 登录前置校验 |
| | | loginPreCheck(username, password); |
| | | // 用户验证 |
| | | Authentication authentication = null; |
| | | // 用户验证 |
| | | SysUser user = userService.selectUserByUserName(username); |
| | | if (StringUtils.isNull(user)){ |
| | | log.info("登录用户:{} 不存在.", username); |
| | | throw new ServiceException(MessageUtils.message("user.not.exists")); |
| | | } else if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) { |
| | | log.info("登录用户:{} 已被删除.", username); |
| | | throw new ServiceException(MessageUtils.message("user.password.delete")); |
| | | } else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) { |
| | | log.info("登录用户:{} 已被停用.", username); |
| | | throw new ServiceException(MessageUtils.message("user.blocked")); |
| | | } |
| | | try |
| | | { |
| | | UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, password); |
| | | AuthenticationContextHolder.setContext(authenticationToken); |
| | | // 该方法会去调用UserDetailsServiceImpl.loadUserByUsername |
| | | authentication = authenticationManager.authenticate(authenticationToken); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (e instanceof BadCredentialsException) |
| | | { |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match"))); |
| | | throw new UserPasswordNotMatchException(); |
| | | } |
| | | else |
| | | { |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage())); |
| | | throw new ServiceException(e.getMessage()); |
| | | } |
| | | } |
| | | finally |
| | | { |
| | | AuthenticationContextHolder.clearContext(); |
| | | } |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"))); |
| | | LoginUserApplet loginUser = (LoginUserApplet) authentication.getPrincipal(); |
| | | recordLoginInfo(loginUser.getUserId()); |
| | | // 生成token |
| | | return loginUser; |
| | | } |
| | | |
| | | /** |
| | | * 登录验证 |
| | |
| | | |
| | | import com.ruoyi.system.model.TLocation; |
| | | import com.ruoyi.system.model.TTemplate; |
| | | import com.ruoyi.system.model.TTemplateDetail; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "任务模板新增编辑DTO") |
| | | public class TTemplateDTO extends TTemplate { |
| | | |
| | | |
| | | |
| | | @ApiModelProperty("周期循环计划") |
| | | private List<TTemplateDetail> list; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TProjectDept; |
| | | import com.ruoyi.system.query.ProjectDeptListQuery; |
| | | import com.ruoyi.system.query.DeptListQuery; |
| | | import com.ruoyi.system.vo.system.ProjectDeptListVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | */ |
| | | public interface TProjectDeptMapper extends BaseMapper<TProjectDept> { |
| | | |
| | | List<ProjectDeptListVO> pageList(@Param("query")ProjectDeptListQuery query, @Param("pageInfo")PageInfo<ProjectDeptListVO> pageInfo); |
| | | List<ProjectDeptListVO> pageList(@Param("query") DeptListQuery query, @Param("pageInfo")PageInfo<ProjectDeptListVO> pageInfo); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TTemplate; |
| | | import com.ruoyi.system.query.ProjectDeptListQuery; |
| | | import com.ruoyi.system.query.TemplateListQuery; |
| | | import com.ruoyi.system.vo.system.TemplateListVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | */ |
| | | public interface TTemplateMapper extends BaseMapper<TTemplate> { |
| | | |
| | | List<TemplateListVO> pageList(@Param("query")ProjectDeptListQuery query, @Param("pageInfo") PageInfo<TemplateListVO> pageInfo); |
| | | List<TemplateListVO> pageList(@Param("query") TemplateListQuery query, @Param("pageInfo") PageInfo<TemplateListVO> pageInfo); |
| | | |
| | | } |
| | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "项目部门分页列表query") |
| | | @ApiModel(value = "部门分页列表query") |
| | | public class ProjectDeptListQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "模板名称") |
| | | private String templateName; |
| | | @ApiModelProperty(value = "开始时间 yyyy-MM-dd HH:mm:ss") |
| | | private String startTime; |
| | | @ApiModelProperty(value = "结束时间 yyyy-MM-dd HH:mm:ss") |
| | | private String endTime; |
| | | @ApiModelProperty(value = "部门名称") |
| | | private String projectName; |
| | | @ApiModelProperty(value = "状态 1启用 2禁用") |
| | | private Integer status; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.ruoyi.common.core.domain.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "模板分页列表query") |
| | | public class TemplateListQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "模板名称") |
| | | private String templateName; |
| | | @ApiModelProperty(value = "开始时间 yyyy-MM-dd HH:mm:ss") |
| | | private String startTime; |
| | | @ApiModelProperty(value = "结束时间 yyyy-MM-dd HH:mm:ss") |
| | | private String endTime; |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TProjectDept; |
| | | import com.ruoyi.system.query.ProjectDeptListQuery; |
| | | import com.ruoyi.system.vo.system.DeptListVO; |
| | | import com.ruoyi.system.query.DeptListQuery; |
| | | import com.ruoyi.system.vo.system.ProjectDeptListVO; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface TProjectDeptService extends IService<TProjectDept> { |
| | | |
| | | PageInfo<ProjectDeptListVO> pageList(ProjectDeptListQuery query); |
| | | PageInfo<ProjectDeptListVO> pageList(DeptListQuery query); |
| | | |
| | | } |
File was renamed from ruoyi-system/src/main/java/com/ruoyi/system/service/TTaskService.java |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TTask; |
| | | import com.ruoyi.system.query.LocationListTaskQuery; |
| | | import com.ruoyi.system.query.TaskListQuery; |
| | | import com.ruoyi.system.vo.system.LocationListTaskVO; |
| | | import com.ruoyi.system.vo.system.TaskListVO; |
| | | |
| | | /** |
| | |
| | | * @author xiaochen |
| | | * @since 2025-05-28 |
| | | */ |
| | | public interface TTaskService extends IService<TTask> { |
| | | public interface TTaskCleanService extends IService<TTask> { |
| | | |
| | | |
| | | PageInfo<TaskListVO> pageList(TaskListQuery query); |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TTemplate; |
| | | import com.ruoyi.system.query.ProjectDeptListQuery; |
| | | import com.ruoyi.system.query.TemplateListQuery; |
| | | import com.ruoyi.system.vo.system.TemplateListVO; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface TTemplateService extends IService<TTemplate> { |
| | | |
| | | PageInfo<TemplateListVO> pageList(ProjectDeptListQuery query); |
| | | PageInfo<TemplateListVO> pageList(TemplateListQuery query); |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.mapper.TLeaveMapper; |
| | | import com.ruoyi.system.mapper.TLocationMapper; |
| | | import com.ruoyi.system.mapper.TLocationTypeMapper; |
| | | import com.ruoyi.system.model.TLocation; |
| | | import com.ruoyi.system.model.TLocationType; |
| | | import com.ruoyi.system.query.LocationTypeListQuery; |
| | | import com.ruoyi.system.service.TLocationTypeService; |
| | | import com.ruoyi.system.vo.system.LocationTypeListVO; |
| | | import com.ruoyi.system.vo.system.ProjectDeptListVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | |
| | | @Service |
| | | public class TLocationTypeServiceImpl extends ServiceImpl<TLocationTypeMapper, TLocationType> implements TLocationTypeService { |
| | | |
| | | @Autowired |
| | | private TLocationMapper locationMapper; |
| | | @Override |
| | | public PageInfo<LocationTypeListVO> pageList(LocationTypeListQuery query) { |
| | | PageInfo<LocationTypeListVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<LocationTypeListVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | for (LocationTypeListVO locationTypeListVO : list) { |
| | | locationTypeListVO.setLocationCount(locationMapper.selectCount(new LambdaQueryWrapper<TLocation>() |
| | | .eq(TLocation::getLocationType,locationTypeListVO.getId()))+""); |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.mapper.TProjectDeptMapper; |
| | | import com.ruoyi.system.model.TProjectDept; |
| | | import com.ruoyi.system.query.ProjectDeptListQuery; |
| | | import com.ruoyi.system.query.DeptListQuery; |
| | | import com.ruoyi.system.service.TProjectDeptService; |
| | | import com.ruoyi.system.vo.system.DeptListVO; |
| | | import com.ruoyi.system.vo.system.ProjectDeptListVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | public class TProjectDeptServiceImpl extends ServiceImpl<TProjectDeptMapper, TProjectDept> implements TProjectDeptService { |
| | | |
| | | @Override |
| | | public PageInfo<ProjectDeptListVO> pageList(ProjectDeptListQuery query) { |
| | | public PageInfo<ProjectDeptListVO> pageList(DeptListQuery query) { |
| | | PageInfo<ProjectDeptListVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<ProjectDeptListVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
File was renamed from ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TTaskServiceImpl.java |
| | |
| | | import com.ruoyi.system.mapper.TTaskDetailMapper; |
| | | import com.ruoyi.system.mapper.TTaskMapper; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.LocationListTaskQuery; |
| | | import com.ruoyi.system.query.TaskListQuery; |
| | | import com.ruoyi.system.service.TTaskService; |
| | | import com.ruoyi.system.vo.system.LocationListTaskVO; |
| | | import com.ruoyi.system.vo.system.LocationListVO; |
| | | import com.ruoyi.system.vo.system.LocationTypeListVO; |
| | | import com.ruoyi.system.service.TTaskCleanService; |
| | | import com.ruoyi.system.vo.system.TaskListVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.sql.Array; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | |
| | | * @since 2025-05-28 |
| | | */ |
| | | @Service |
| | | public class TTaskServiceImpl extends ServiceImpl<TTaskMapper, TTask> implements TTaskService { |
| | | public class TTaskCleanServiceImpl extends ServiceImpl<TTaskMapper, TTask> implements TTaskCleanService { |
| | | |
| | | |
| | | @Autowired |
| | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.mapper.TTemplateMapper; |
| | | import com.ruoyi.system.model.TTemplate; |
| | | import com.ruoyi.system.query.ProjectDeptListQuery; |
| | | import com.ruoyi.system.query.TemplateListQuery; |
| | | import com.ruoyi.system.service.TTemplateService; |
| | | import com.ruoyi.system.vo.system.LocationListTaskVO; |
| | | import com.ruoyi.system.vo.system.TemplateListVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | public class TTemplateServiceImpl extends ServiceImpl<TTemplateMapper, TTemplate> implements TTemplateService { |
| | | |
| | | @Override |
| | | public PageInfo<TemplateListVO> pageList(ProjectDeptListQuery query) { |
| | | public PageInfo<TemplateListVO> pageList(TemplateListQuery query) { |
| | | PageInfo<TemplateListVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TemplateListVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | |
| | | id, create_time, update_time, create_by, update_by, disabled, location_icon, location_name |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.system.LocationTypeListVO"> |
| | | select t1.*,count(t2.id) as locationCount from t_location_type t1 |
| | | select t1.* from t_location_type t1 |
| | | left join t_location t2 on t2.location_type=t1.id |
| | | where 1=1 |
| | | <if test="query.locationName != null and query.locationName != ''"> |
| | |
| | | t_project_dept t1 |
| | | left join sys_user t2 on t2.deptId = t1.id |
| | | where 1=1 |
| | | <if test="query.deptName != null and query.deptName != ''"> |
| | | and t1.dept_name like concat('%',#{query.deptName},'%') |
| | | <if test="query.projectName != null and query.projectName != ''"> |
| | | and t1.project_name like concat('%',#{query.projectName},'%') |
| | | </if> |
| | | <if test="query.status != null and query.status != ''"> |
| | | and t1.status = #{query.status} |