Merge remote-tracking branch 'origin/master'

This commit is contained in:
赵旭 2024-08-23 01:10:16 +08:00
commit b95f9feac8
38 changed files with 1910 additions and 789 deletions

View File

@ -10,4 +10,5 @@ public interface CommonErrorCodeConstants extends ErrorCodeConstants {
ErrorCode STAFF_CHANGE_CREATE_REPEAT = new ErrorCode(2_002_000_001, "该员工工作已交接");
ErrorCode STAFF_NOT_CHANGE = new ErrorCode(2_002_000_003, "该员工还有工作未交接,不可删除");
ErrorCode LOGIN_ACCOUNT_EXIST = new ErrorCode(2_002_000_004, "登录账号已存在");
ErrorCode LOGIN_ACCOUNT_NOT_EXIST = new ErrorCode(2_002_000_005, "登录账号不存在");
}

View File

@ -21,6 +21,11 @@
<artifactId>dl-module-company</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-system-biz</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>8</maven.compiler.source>

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.appBase.controller;
package cn.iocoder.yudao.module.appBase.controller.admin;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.rescue.core.controller.BaseController;
import cn.iocoder.yudao.module.rescue.core.page.TableDataInfo;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
@ -117,7 +118,7 @@ public class SysAnnouncementController extends BaseController
public CommonResult getOwnNoRead()
{
//当前登录用户
LoginUser loginUser = getLoginUser();
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
SysAnnouncement sysAnnouncement =new SysAnnouncement();
sysAnnouncement.setToUserId(loginUser.getId());
LambdaQueryWrapper<SysAnnouncement> queryWrapper =new LambdaQueryWrapper<>();
@ -132,7 +133,8 @@ public class SysAnnouncementController extends BaseController
public CommonResult setAllRead()
{
//当前登录用户
LoginUser loginUser = getLoginUser();
// LoginUser loginUser = getLoginUser();
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
SysAnnouncement sysAnnouncement =new SysAnnouncement();
sysAnnouncement.setToUserId(loginUser.getId());
LambdaUpdateWrapper<SysAnnouncement> queryWrapper =new LambdaUpdateWrapper<>();

View File

@ -7,8 +7,8 @@ import cn.hutool.http.HttpRequest;
import cn.iocoder.yudao.module.appBase.domain.SysAnnouncement;
import cn.iocoder.yudao.module.appBase.mapper.SysAnnouncementMapper;
import cn.iocoder.yudao.module.appBase.service.ISysAnnouncementService;
import cn.iocoder.yudao.module.rescue.controller.app.AnnouncementSocket;
import cn.iocoder.yudao.module.rescue.controller.app.UserAnnouncementSocket;
import cn.iocoder.yudao.module.rescue.app.controller.admin.AnnouncementSocket;
import cn.iocoder.yudao.module.rescue.app.controller.admin.UserAnnouncementSocket;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.rescue.controller.app;
package cn.iocoder.yudao.module.rescue.app.controller.admin;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -0,0 +1,253 @@
package cn.iocoder.yudao.module.rescue.app.controller.admin;
import cn.hutool.core.collection.CollectionUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.rescue.core.controller.BaseController;
import cn.iocoder.yudao.module.rescue.domain.RescueInfo;
import cn.iocoder.yudao.module.rescue.service.IRescueInfoService;
import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
import cn.iocoder.yudao.module.system.api.permission.RoleApi;
import cn.iocoder.yudao.module.system.api.permission.dto.RoleReqDTO;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
/**
* 请填写功能名称Controller
*
* @author ruoyi
* @date 2023-07-14
*/
@RestController
@RequestMapping("/app/rescueInfo")
public class RescueInfoController extends BaseController {
@Resource
private AdminUserApi userService;
@Resource
private RoleApi roleApi;
@Resource
private PermissionApi permissionApi;
@Resource
private IRescueInfoService rescueInfoService;
// @Autowired
// private ISysUserService userService;
//
//
//
/**
* 获取救援订单
*/
@GetMapping("/getRescueList")
public CommonResult getRescueList(RescueInfo rescueInfo,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
Page<RescueInfo> page = new Page<>(pageNum, pageSize);
//获取当前登录用户
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
AdminUserRespDTO user = userService.getUser(loginUser.getId());
List<Long> roleIds = permissionApi.getRoleIdsByUserId(user.getId());
List<RoleReqDTO> roleList = roleApi.getRoleList();
List<RoleReqDTO> roles = roleList.stream().filter(item -> roleIds.contains(item.getId())).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(roles)) {
for (RoleReqDTO role : roles) {
//如果是调度中心
if (role.getCode().equals("admin") || role.getCode().equals("ddzx") || role.getCode().equals("qt") || role.getCode().equals("kj") || role.getCode().equals("cn")) {
IPage<RescueInfo> rescueInfos = rescueInfoService.selectRescueInfoListByAdmin(rescueInfo, page);
return success(rescueInfos);
}
}
}
IPage<RescueInfo> rescueInfos = rescueInfoService.selectRescueInfoList(rescueInfo, page);
return success(rescueInfos);
}
// @GetMapping("/getRescueStatistics")
// public AjaxResult getRescueStatistics(RescueInfo rescueInfo)
// {
//
// //获取当前登录用户
// LoginUser loginUser = SecurityUtils.getLoginUser();
// SysUser user = userService.selectUserById(loginUser.getUserId());
// List<SysRole> roles = user.getRoles();
// if (CollectionUtil.isNotEmpty(roles)){
// for (SysRole role : roles) {
// //如果是调度中心
// if (role.getRoleKey().equals("admin")||role.getRoleKey().equals("ddzx")||role.getRoleKey().equals("qt")||role.getRoleKey().equals("kj")||role.getRoleKey().equals("cn")){
// Map<String,Object> res = rescueInfoService.getRescueStatisticsByAdmin(rescueInfo);
// return success(res);
// }
// }
// }
//
// Map<String,Object> res = rescueInfoService.getRescueStatistics(rescueInfo);
// return success(res);
// }
// /**
// * 获取救援订单
// */
// @GetMapping("/rescueInfoDetail")
// public AjaxResult rescueInfoDetail(Long rescueId)
// {
// return success(rescueInfoService.rescueInfoDetail(rescueId));
// }
//
// /**
// * 新增道路救援发起
// */
// @Log(title = "【道路救援发起】", businessType = BusinessType.INSERT)
// @PostMapping("/add")
// public AjaxResult add(@RequestBody @Valid RescueInfo rescueInfo)
// {
// rescueInfoService.insertRescueInfo(rescueInfo);
// return success();
// }
//
// /**
// * 新增道路救援发起
// */
// @Log(title = "【道路救援编辑】", businessType = BusinessType.UPDATE)
// @PostMapping("/edit")
// public AjaxResult edit(@RequestBody @Valid RescueInfo rescueInfo)
// {
// rescueInfoService.updateRescueInfo(rescueInfo);
// return success();
// }
// /**
// * 取消道路救援
// */
// @Log(title = "取消【道路救援】", businessType = BusinessType.CLEAN)
// @PostMapping("/cancel")
// public AjaxResult cancel(Long id)
// {
// RescueInfo rescueInfo =new RescueInfo();
// rescueInfo.setId(id);
// rescueInfo.setRescueStatus("0");
// return toAjax(rescueInfoService.updateRescueInfo(rescueInfo));
// }
//
// /**
// * 删除道路救援
// */
// @Log(title = "删除道路救援", businessType = BusinessType.DELETE)
// @PostMapping("/delRescueInfo")
// public AjaxResult delRescueInfo(Long id)
// {
// rescueInfoService.deleteRescueInfoById(id);
// return success();
// }
//
// /**
// * 查询请填写功能名称列表
// */
// @GetMapping("/driverList")
// public TableDataInfo driverList(DriverInfoDto driverInfoDto)
// {
// startPage();
// List<DriverInfo2Dto> list = rescueInfoService.driverListApp(driverInfoDto);
// return getDataTable(list);
// }
// /**
// * 查询请填写功能名称列表
// */
// @GetMapping("/driverInMap")
// public AjaxResult driverInMap(DriverInfoDto driverInfoDto)
// {
// List<DriverInfo2Dto> driverList = rescueInfoService.driverInMap(driverInfoDto);
// return success(driverList);
// }
// /**
// * 查询请填写功能名称列表
// */
// @GetMapping("/driverInMap2")
// public AjaxResult driverInMap2()
// {
// return success(rescueInfoService.driverInMap2());
// }
// /**
// * 获取扣车订单
// */
// @GetMapping("/getKcList")
// public TableDataInfo getKcList(RescueInfo rescueInfo)
// {
//
// startPage();
// List<RescueInfo> rescueInfos = rescueInfoService.getKcList(rescueInfo);
// return getDataTable(rescueInfos);
// }
//
// /**
// * 获取扣车订单
// */
// @PostMapping("/openKc")
// public AjaxResult openKc(Long rescueId) throws Exception {
// //获取当前登录用户
// LoginUser loginUser = SecurityUtils.getLoginUser();
// SysUser user = userService.selectUserById(loginUser.getUserId());
// List<SysRole> roles = user.getRoles();
// if (CollectionUtil.isNotEmpty(roles)){
// for (SysRole role : roles) {
// //如果是交警大队
// if (role.getRoleKey().equals("jjdd")){
// rescueInfoService.openKc(rescueId);
// }
// }
// }
//
// return success();
// }
//
// /**
// * 进行还车
// */
// @PostMapping("/hcOpen")
// public AjaxResult hcOpen(Long rescueId)
// {
// //获取当前登录用户
// LoginUser loginUser = SecurityUtils.getLoginUser();
// SysUser user = userService.selectUserById(loginUser.getUserId());
// RescueInfo rescueInfo = rescueInfoService.getById(rescueId);
// rescueInfo.setHcTime(new Date());
// rescueInfo.setHcUserId(user.getUserId());
// rescueInfo.setHcUserName(user.getRealName());
// rescueInfo.setHcUserPhone(user.getPhonenumber());
// rescueInfo.setRescueStatus("8");
// rescueInfoService.updateById(rescueInfo);
// return success();
// }
//
// /**
// * 获取扣车订单
// */
// @GetMapping("/getHcList")
// public TableDataInfo getHcList(RescueInfo rescueInfo)
// {
//
// startPage();
// List<RescueInfo> rescueInfos = rescueInfoService.getHcList(rescueInfo);
// return getDataTable(rescueInfos);
// }
// /**
// * 获取扣车订单
// */
// @GetMapping("/statisticsInfo")
// public AjaxResult statisticsInfo(String type)
// {
// return success( rescueInfoService.statisticsInfo(type));
// }
}

View File

@ -0,0 +1,618 @@
package cn.iocoder.yudao.module.rescue.app.controller.admin;
import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.common.CommonErrorCodeConstants;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.rescue.domain.LoginBody;
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
import cn.iocoder.yudao.module.system.api.permission.RoleApi;
import cn.iocoder.yudao.module.system.api.permission.dto.RoleReqDTO;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import cn.iocoder.yudao.module.system.controller.admin.auth.vo.AuthLoginReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuDO;
import cn.iocoder.yudao.module.system.service.auth.AdminAuthService;
import cn.iocoder.yudao.module.system.service.permission.MenuService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
/**
* 登录验证
*
* @author ruoyi
*/
@RestController
@Slf4j
@RequestMapping("/rescue")
public class SysLoginController {
@Resource
private AdminAuthService loginService;
@Resource
private MenuService menuService;
//
// @Autowired
// private SysPermissionService permissionService;
@Resource
private AdminUserApi userService;
@Resource
private PermissionApi permissionApi;
@Resource
private RoleApi roleApi;
@Resource
private DictDataApi dataApi;
// @Resource
// @Autowired
// private RedisCache redisCache;
//
// @Autowired
// private RestTemplate restTemplate;
//
// @Resource
// private WechatPayConfig wxConfig;
// @Autowired
// private IUserBalanceService balanceService;
// @Autowired
// private IShopMallPartnersService partnersService;
// @Autowired
// private IPartnerWorkerService jcWorkerService;
// @Autowired
// private IShopConfigService configService;
// @Autowired
// private IDriverInfoService driverInfoService;
// @Autowired
// private IDriveSchoolInfoService driveSchoolInfoService;
//
/**
* 登录方法
*
* @param loginBody 登录信息
* @return 结果
*/
@PostMapping("/login")
public CommonResult login(@RequestBody LoginBody loginBody) {
return null;
// ajax = success();
// // 生成令牌
// String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
// loginBody.getUuid());
// ajax.put(Constants.TOKEN, token);
// return ajax;
}
@GetMapping("/dict/data/type/{type}")
public CommonResult getDictDataByType(@PathVariable("type") String type){
return success(dataApi.getDictDataList(type));
}
/**
* 登录方法
*
* @param loginBody 登录信息
* @return 结果
*/
@PostMapping("/loginApp")
public CommonResult loginApp(@RequestBody LoginBody loginBody) throws Exception {
String userName = loginBody.getUsername();
AdminUserRespDTO user = userService.getUserByUsername(userName);
if (ObjectUtil.isEmpty(user)) {
return error(CommonErrorCodeConstants.LOGIN_ACCOUNT_NOT_EXIST);
}
// 获取登录用户的角色信息
List<Long> roleIdsByUserId = permissionApi.getRoleIdsByUserId(user.getId());
if (ObjectUtil.isEmpty(roleIdsByUserId) || roleIdsByUserId.size() == 0) {
return error(CommonErrorCodeConstants.LOGIN_ACCOUNT_NOT_EXIST);
}
List<RoleReqDTO> roleList = roleApi.getRoleList();
List<String> roleNames = roleList.stream().filter(item -> roleIdsByUserId.contains(item.getId())).map(item -> item.getName()).collect(Collectors.toList());
Boolean flag = (loginBody.getType().equals("0") && roleNames.contains("救援业务管理员")) || (loginBody.getType().equals("1") && roleNames.contains("交警"));
// 角色认证登录
if (!flag) {
return error(CommonErrorCodeConstants.LOGIN_ACCOUNT_NOT_EXIST);
}
AuthLoginReqVO authLoginReqVO = new AuthLoginReqVO();
authLoginReqVO.setUsername(loginBody.getUsername());
authLoginReqVO.setPassword(loginBody.getPassword());
return success(loginService.login(authLoginReqVO));
}
// /**
// * 司机登录方法
// *
// * @param loginBody 司机登录方法
// * @return 结果
// */
// @PostMapping("/driverLogin")
// public AjaxResult driverLogin(@RequestBody LoginBody loginBody) throws Exception {
// AjaxResult ajax = success();
// // 生成令牌
// String token = loginService.driverLogin(loginBody);
// ajax.put(Constants.TOKEN, token);
// return ajax;
// }
// /**
// * 登录获取验证码
// *
// * @return 结果
// */
// @PostMapping("/loginSmsCode")
// public AjaxResult loginSmsCode(String phone) {
// return loginService.loginSmsCode(phone);
// }
// /**
// * 登录方法
// *
// * @param loginBody 登录信息
// * @return 结果
// */
// @PostMapping("/loginJx")
// public AjaxResult loginJx(@RequestBody LoginBody loginBody) throws Exception {
// AjaxResult ajax = success();
// // 生成令牌
// String token = loginService.loginJx(loginBody);
// ajax.put(Constants.TOKEN, token);
// return ajax;
// }
// @PostMapping("/loginSmsCodeJx")
// public AjaxResult loginSmsCodeJx(String phone) {
// return loginService.loginSmsCodeJx(phone);
// }
// /**
// * 忘记密码获取验证码
// *
// * @return 结果
// */
// @PostMapping("/pwdSmsCode")
// public AjaxResult pwdSmsCode(String phone) {
// return loginService.pwdSmsCode(phone);
// }
// /**
// * 更新密码
// *
// * @return 结果
// */
// @PostMapping("/updatePwd")
// public AjaxResult updatePwd(String phone, String msgCode,String password) {
// if (!redisCache.hasKey(phone+"-pwdCode")||!redisCache.getCacheObject(phone+"-pwdCode").equals(msgCode)){
// return error("验证码错误");
// }
// SysUser sysUser = userService.selectUserByPhone(phone);
// if (userService.resetUserPwd(sysUser.getUserName(), SecurityUtils.encryptPassword(password)) > 0)
// {
// // 更新缓存用户密码
// sysUser.setPassword(SecurityUtils.encryptPassword(password));
// userService.updateUser(sysUser);
// return success();
// }
// return error("修改密码异常,请联系管理员");
// }
//
//
//
/**
* 获取用户信息
*
* @return 用户信息
*/
@GetMapping("/getInfo")
public CommonResult getInfo() {
HashMap<String, Object> map = new HashMap<>();
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
map.put("user", loginUser);
// 角色集合
List<Long> roleIdsByUserId = permissionApi.getRoleIdsByUserId(loginUser.getId());
List<RoleReqDTO> roleList = roleApi.getRoleList();
List<String> roleNames = roleList.stream().filter(item -> roleIdsByUserId.contains(item.getId())).map(item -> item.getName()).collect(Collectors.toList());
map.put("roles", roleNames);
// 权限集合
List<MenuDO> menuList = menuService.getMenuList();
// Set<String> permissions = permissionService.getMenuPermission(user);
// ajax.put("permissions", permissions);
return success(map);
}
//
//
// @Resource
// private DriveSchoolCoachMapper driveSchoolCoachMapper;
//
// @Resource
// private SysUserMapper sysUserMapper;
//
// /**
// * 获取
// *
// * @return 用户信息
// */
// @GetMapping("getJxInfo")
// public AjaxResult getJxInfo()
// {
// SysUser user = SecurityUtils.getLoginUser().getUser();
// // 角色集合
// Set<String> roles = permissionService.getRolePermission(user);
// //获取驾校的
//
// Long userId = SecurityUtils.getUserId();
// SysUser sysUser = sysUserMapper.selectUserById(userId);
// String phonenumber = sysUser.getPhonenumber();
// DriveSchoolCoach driveSchoolCoach = driveSchoolCoachMapper.selectByPhonenumber(phonenumber);
//
// if (ObjectUtils.isNotEmpty(driveSchoolCoach)){
// user.setAvatar(driveSchoolCoach.getImage());
// }
// DriveSchoolInfo driveSchoolInfo = driveSchoolInfoService.getSchoolInfoByDeptId();
//
// AjaxResult ajax = success();
// ajax.put("user", user);
// ajax.put("roles", roles);
// ajax.put("schoolInfo", driveSchoolInfo);
// return ajax;
// }
// /**
// * 获取App用户信息
// *
// * @return 用户信息
// */
// @GetMapping("/getAppInfo")
// public AjaxResult getAppInfo()
// {
// SysUser user = SecurityUtils.getLoginUser().getUser();
// SysUser sysUser = userService.selectUserById(user.getUserId());
// // 角色集合
// Set<String> roles = permissionService.getRolePermission(user);
// UserBalance userBalance = balanceService.selectShopUserBalanceByUserId(user.getUserId());
// if (ObjectUtil.isNotEmpty(userBalance)) {
// sysUser.setBalance(userBalance.getBalance());
// } else {
// //新增用户积分表信息
// userBalance=new UserBalance();
// userBalance.setUserId(user.getUserId());
// userBalance.setAllBalance(0L);
// userBalance.setBalance(0L);
// userBalance.setFrozenBalance(0L);
// balanceService.insertShopUserBalance(userBalance);
// sysUser.setBalance(0L);
// }
// AjaxResult ajax = success();
// ajax.put("user", sysUser);
// ajax.put("role", roles);
// ShopConfig shopConfig = configService.selectShopConfigById(1L);
// if (StringUtils.isEmpty(shopConfig.getOpenRz())||shopConfig.getOpenRz().equals("0")){
// ajax.put("openRz", "0");
// }else {
// ajax.put("openRz", "1");
// }
// return ajax;
// }
//
// /**
// * 获取App用户信息
// *
// * @return 用户信息
// */
// @GetMapping("/getJcgfInfo")
// public AjaxResult getJcgfInfo() throws Exception {
// SysUser user = SecurityUtils.getLoginUser().getUser();
// SysUser sysUser = userService.selectUserById(user.getUserId());
// // 角色集合
// Set<String> roles = permissionService.getRolePermission(user);
// AjaxResult ajax = success();
// ajax.put("user", sysUser);
// ajax.put("role", roles);
// if (CollectionUtil.isNotEmpty(roles)){
// AtomicBoolean flag = new AtomicBoolean(false);
// roles.forEach(it->{
// if (it.equals("jcgf")){
// flag.set(true);
// }
// });
// if (!flag.get()){
// throw new Exception("身份有误");
// }
// }else {
// throw new Exception("身份有误");
// }
//
// return ajax;
// }
// //获取交警的信息
// @GetMapping("/getJjInfo")
// public AjaxResult getJjInfo() throws Exception {
// SysUser user = SecurityUtils.getLoginUser().getUser();
// SysUser sysUser = userService.selectUserById(user.getUserId());
// // 角色集合
// Set<String> roles = permissionService.getRolePermission(user);
// AjaxResult ajax = success();
// ajax.put("user", sysUser);
// ajax.put("role", roles);
// if (CollectionUtil.isNotEmpty(roles)){
// AtomicBoolean flag = new AtomicBoolean(false);
// roles.forEach(it->{
// if (it.equals("jjdd")){
// flag.set(true);
// }
// });
// if (!flag.get()){
// throw new Exception("身份有误");
// }
// }else {
// throw new Exception("身份有误");
// }
//
// return ajax;
// }
// /**
// * 获取App用户信息
// *
// * @return 用户信息
// */
// @GetMapping("/getJcPartnerInfo")
// public AjaxResult getJcPartnerInfo()
// {
// LambdaQueryWrapper<ShopMallPartners> queryWrapper =new LambdaQueryWrapper<>();
// SysUser user = SecurityUtils.getLoginUser().getUser();
// queryWrapper.eq(ShopMallPartners::getUserId,user.getUserId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0");
// ShopMallPartners partner = partnersService.getOne(queryWrapper);
// if (ObjectUtil.isEmpty(partner)){
// return error("信息有误");
// }
// SysUser sysUser = userService.selectUserById(user.getUserId());
// AjaxResult ajax = success();
// ajax.put("user", sysUser);
// return ajax;
// }
//
// /**
// * 获取救援司机用户信息
// *
// * @return 用户信息
// */
// @GetMapping("/getRescueDriverInfo")
// public AjaxResult getRescueDriverInfo()
// {
// LambdaQueryWrapper<DriverInfo> queryWrapper =new LambdaQueryWrapper<>();
// SysUser user = SecurityUtils.getLoginUser().getUser();
// queryWrapper.eq(DriverInfo::getUserId, user.getUserId());
// DriverInfo driverInfo = driverInfoService.getOne(queryWrapper);
// if (ObjectUtil.isEmpty(driverInfo)){
// return error("信息有误");
// }
// SysUser sysUser = userService.selectUserById(user.getUserId());
// AjaxResult ajax = success();
// ajax.put("user", sysUser);
// ajax.put("driverInfo", driverInfo);
// return ajax;
// }
//
//
// /**
// * 获取检测工用户信息
// *
// * @return 用户信息
// */
// @GetMapping("/getJcWorkerInfo")
// public AjaxResult getJcWorkerInfo()
// {
// AjaxResult ajax = success();
// LambdaQueryWrapper<PartnerWorker> queryWrapper =new LambdaQueryWrapper<>();
// SysUser user = SecurityUtils.getLoginUser().getUser();
// queryWrapper.eq(PartnerWorker::getUserId,user.getUserId());
// PartnerWorker worker = jcWorkerService.getOne(queryWrapper);
// if (ObjectUtil.isNotEmpty(worker)){
// LambdaQueryWrapper<ShopMallPartners> queryWrapper1 =new LambdaQueryWrapper<>();
// queryWrapper1.eq(ShopMallPartners::getPartnerId,worker.getPartnerId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0");
// ShopMallPartners partner = partnersService.getOne(queryWrapper1);
// if (ObjectUtil.isEmpty(partner)){
// return error("信息有误");
// }
// ajax.put("partnerInfo", partner);
// }else {
// return error("信息有误");
// }
// SysUser sysUser = userService.selectUserById(user.getUserId());
//
// ajax.put("user", sysUser);
//
// return ajax;
// }
// /**
// * 获取路由信息
// *
// * @return 路由信息
// */
// @GetMapping("getRouters")
// public AjaxResult getRouters()
// {
// Long userId = SecurityUtils.getUserId();
// List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
// return AjaxResult.success(menuService.buildMenus(menus));
// }
// @ApiOperation("微信登录")
//
// @ApiImplicitParams({
// @ApiImplicitParam(name = "WxLoginBody",dataType = "WxLoginBody", value = "jscode", required = true, paramType = "body")
// })
// @PostMapping("/wxLogin")
// public AjaxResult wxLogin(@RequestBody WxLoginBody wxLoginBody) {
// String code = wxLoginBody.getCode();
// //秘钥
// String encryptedIv = wxLoginBody.getEncryptedIv();
// //加密数据
// String encryptedData = wxLoginBody.getEncryptedData();
//
//
// //想微信服务器发送请求获取用户信息
// String url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + wxConfig.getAppId() + "&secret=" + wxConfig.getAppSecret() + "&js_code=" + code + "&grant_type=authorization_code";
// System.out.println(url);
// String res = restTemplate.getForObject(url, String.class);
// JSONObject jsonObject = JSONObject.parseObject(res);
//
// //获取session_key和openid
// String sessionKey = jsonObject.getString("session_key");
// String openId = jsonObject.getString("openid");
//
// System.out.println(sessionKey);
// System.out.println(openId);
// //解密
// String decryptResult = "";
// try {
// //如果没有绑定微信开放平台解析结果是没有unionid的
// decryptResult = decrypt(sessionKey, encryptedIv, encryptedData);
// } catch (Exception e) {
// e.printStackTrace();
// return AjaxResult.error("微信登录失败!");
// }
//
// if (StringUtils.hasText(decryptResult)) {
// //如果解析成功,获取token
// String token = loginService.wxLogin(decryptResult,openId,wxLoginBody.getInviteId());
// AjaxResult ajax = AjaxResult.success();
// ajax.put(Constants.TOKEN, token);
// return ajax;
// } else {
// return AjaxResult.error("微信登录失败!");
// }
// }
//
// @PostMapping("/wxLoginJc")
// public AjaxResult wxLoginJc(@RequestBody WxLoginBody wxLoginBody) {
// String code = wxLoginBody.getCode();
// //秘钥
// String encryptedIv = wxLoginBody.getEncryptedIv();
// //加密数据
// String encryptedData = wxLoginBody.getEncryptedData();
//
// //想微信服务器发送请求获取用户信息
// String url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + wxConfig.getAppId() + "&secret=" + wxConfig.getAppSecret() + "&js_code=" + code + "&grant_type=authorization_code";
// System.out.println(url);
// String res = restTemplate.getForObject(url, String.class);
// JSONObject jsonObject = JSONObject.parseObject(res);
//
// //获取session_key和openid
// String sessionKey = jsonObject.getString("session_key");
// String openId = jsonObject.getString("openid");
//
// System.out.println(sessionKey);
// System.out.println(openId);
// //解密
// String decryptResult = "";
// try {
// //如果没有绑定微信开放平台解析结果是没有unionid的
// decryptResult = decrypt(sessionKey, encryptedIv, encryptedData);
// } catch (Exception e) {
// e.printStackTrace();
// return AjaxResult.error("微信登录失败!");
// }
//
// if (StringUtils.hasText(decryptResult)) {
// //如果解析成功,获取token
// String token = loginService.wxLoginJc(decryptResult,openId,wxLoginBody.getInviteId());
// AjaxResult ajax = AjaxResult.success();
// ajax.put(Constants.TOKEN, token);
// return ajax;
// } else {
// return AjaxResult.error("微信登录失败!");
// }
// }
//
// @PostMapping("/wxLoginRescue")
// public AjaxResult wxLoginRescue(@RequestBody WxLoginBody wxLoginBody) {
// String code = wxLoginBody.getCode();
// //秘钥
// String encryptedIv = wxLoginBody.getEncryptedIv();
// //加密数据
// String encryptedData = wxLoginBody.getEncryptedData();
//
//
// //想微信服务器发送请求获取用户信息
// String url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + wxConfig.getAppId() + "&secret=" + wxConfig.getAppSecret() + "&js_code=" + code + "&grant_type=authorization_code";
// System.out.println(url);
// String res = restTemplate.getForObject(url, String.class);
// JSONObject jsonObject = JSONObject.parseObject(res);
//
// //获取session_key和openid
// String sessionKey = jsonObject.getString("session_key");
// String openId = jsonObject.getString("openid");
//
// System.out.println(sessionKey);
// System.out.println(openId);
// //解密
// String decryptResult = "";
// try {
// //如果没有绑定微信开放平台解析结果是没有unionid的
// decryptResult = decrypt(sessionKey, encryptedIv, encryptedData);
// } catch (Exception e) {
// e.printStackTrace();
// return AjaxResult.error("微信登录失败!");
// }
//
// if (StringUtils.hasText(decryptResult)) {
// //如果解析成功,获取token
// String token = loginService.wxLoginRescue(decryptResult,openId,wxLoginBody.getInviteId());
// AjaxResult ajax = AjaxResult.success();
// ajax.put(Constants.TOKEN, token);
// return ajax;
// } else {
// return AjaxResult.error("微信登录失败!");
// }
// }
//
// /**
// * AES解密
// */
// private String decrypt(String sessionKey,String encryptedIv,String encryptedData) throws Exception{
// // 转化为字节数组
// byte[] key = Base64.decode(sessionKey);
// byte[] iv = Base64.decode(encryptedIv);
// byte[] encData = Base64.decode(encryptedData);
// // 如果密钥不足16位那么就补足
// int base =16;
// if (key.length % base !=0) {
// int groups = key.length / base +(key.length % base != 0 ? 1 : 0);
// byte[] temp = new byte[groups * base];
// Arrays.fill(temp,(byte) 0);
// System.arraycopy(key,0,temp,0,key.length);
// key = temp;
// }
// // 如果初始向量不足16位也补足
// if (iv.length % base !=0) {
// int groups = iv.length / base +(iv.length % base != 0 ? 1 : 0);
// byte[] temp = new byte[groups * base];
// Arrays.fill(temp,(byte) 0);
// System.arraycopy(iv,0,temp,0,iv.length);
// iv = temp;
// }
//
// AlgorithmParameterSpec ivSpec = new IvParameterSpec(iv);
// String resultStr = null;
//
// try {
// Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
// SecretKeySpec keySpec = new SecretKeySpec(key,"AES");
// cipher.init(Cipher.DECRYPT_MODE,keySpec,ivSpec);
// resultStr = new String(cipher.doFinal(encData),"UTF-8");
// } catch (Exception e){
//// logger.info("解析错误");
// e.printStackTrace();
// }
//
// // 解析加密后的字符串
// return resultStr;
// }
}

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.rescue.controller.app;
package cn.iocoder.yudao.module.rescue.app.controller.admin;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -6,6 +6,8 @@ import cn.iocoder.yudao.module.rescue.core.page.TableDataInfo;
import cn.iocoder.yudao.module.rescue.domain.RescueCarSpend;
import cn.iocoder.yudao.module.rescue.service.IRescueCarSpendService;
import cn.iocoder.yudao.module.rescue.utils.ExcelUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@ -28,22 +30,24 @@ public class RescueCarSpendController extends BaseController {
/**
* 查询车辆消费管理列表
*/
@PreAuthorize("@ss.hasPermi('rescue:rescueCarSpend:list')")
@PreAuthorize("@ss.hasPermission('rescue:rescueCarSpend:list')")
@GetMapping("/list")
public TableDataInfo list(RescueCarSpend rescueCarSpend) {
startPage();
List<RescueCarSpend> list = rescueCarSpendService.selectRescueCarSpendList(rescueCarSpend);
return getDataTable(list);
public CommonResult list(RescueCarSpend rescueCarSpend,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
Page<RescueCarSpend> page = new Page<>(pageNo, pageSize);
IPage<RescueCarSpend> list = rescueCarSpendService.selectRescueCarSpendList(rescueCarSpend, page);
return success(list);
}
/**
* 导出车辆消费管理列表
*/
@PreAuthorize("@ss.hasPermi('rescue:rescueCarSpend:export')")
@PreAuthorize("@ss.hasPermission('rescue:rescueCarSpend:export')")
// @Log(title = "车辆消费管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, RescueCarSpend rescueCarSpend) {
List<RescueCarSpend> list = rescueCarSpendService.selectRescueCarSpendList(rescueCarSpend);
List<RescueCarSpend> list = rescueCarSpendService.list();
ExcelUtil<RescueCarSpend> util = new ExcelUtil<RescueCarSpend>(RescueCarSpend.class);
util.exportExcel(response, list, "车辆消费管理数据");
}
@ -51,7 +55,7 @@ public class RescueCarSpendController extends BaseController {
/**
* 获取车辆消费管理详细信息
*/
@PreAuthorize("@ss.hasPermi('rescue:rescueCarSpend:query')")
@PreAuthorize("@ss.hasPermission('rescue:rescueCarSpend:query')")
@GetMapping(value = "/{id}")
public CommonResult getInfo(@PathVariable("id") Long id) {
return success(rescueCarSpendService.selectRescueCarSpendById(id));
@ -60,7 +64,7 @@ public class RescueCarSpendController extends BaseController {
/**
* 新增车辆消费管理
*/
@PreAuthorize("@ss.hasPermi('rescue:rescueCarSpend:add')")
@PreAuthorize("@ss.hasPermission('rescue:rescueCarSpend:add')")
// @Log(title = "车辆消费管理", businessType = BusinessType.INSERT)
@PostMapping
public CommonResult add(@RequestBody RescueCarSpend rescueCarSpend) {
@ -70,7 +74,7 @@ public class RescueCarSpendController extends BaseController {
/**
* 修改车辆消费管理
*/
@PreAuthorize("@ss.hasPermi('rescue:rescueCarSpend:edit')")
@PreAuthorize("@ss.hasPermission('rescue:rescueCarSpend:edit')")
// @Log(title = "车辆消费管理", businessType = BusinessType.UPDATE)
@PutMapping
public CommonResult edit(@RequestBody RescueCarSpend rescueCarSpend) {
@ -80,7 +84,7 @@ public class RescueCarSpendController extends BaseController {
/**
* 删除车辆消费管理
*/
@PreAuthorize("@ss.hasPermi('rescue:rescueCarSpend:remove')")
@PreAuthorize("@ss.hasPermission('rescue:rescueCarSpend:remove')")
// @Log(title = "车辆消费管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public CommonResult remove(@PathVariable Long[] ids) {

View File

@ -2,10 +2,11 @@ package cn.iocoder.yudao.module.rescue.controller.admin;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.rescue.core.controller.BaseController;
import cn.iocoder.yudao.module.rescue.core.page.TableDataInfo;
import cn.iocoder.yudao.module.rescue.domain.RescueDeptDriver;
import cn.iocoder.yudao.module.rescue.service.IRescueDeptDriverService;
import cn.iocoder.yudao.module.rescue.utils.ExcelUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@ -30,10 +31,12 @@ public class RescueDeptDriverController extends BaseController {
* 查询救援客户司机分配列表
*/
@GetMapping("/list")
public TableDataInfo list(RescueDeptDriver rescueDeptDriver) {
startPage();
List<RescueDeptDriver> list = rescueDeptDriverService.selectRescueDeptDriverList(rescueDeptDriver);
return getDataTable(list);
public CommonResult<IPage<?>> list(RescueDeptDriver rescueDeptDriver,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
Page<RescueDeptDriver> page = new Page<>(pageNo, pageSize);
IPage<RescueDeptDriver> list = rescueDeptDriverService.selectRescueDeptDriverPage(rescueDeptDriver, page);
return success(list);
}
/**
@ -42,7 +45,7 @@ public class RescueDeptDriverController extends BaseController {
// @Log(title = "救援客户司机分配", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, RescueDeptDriver rescueDeptDriver) {
List<RescueDeptDriver> list = rescueDeptDriverService.selectRescueDeptDriverList(rescueDeptDriver);
List<RescueDeptDriver> list = rescueDeptDriverService.list();
ExcelUtil<RescueDeptDriver> util = new ExcelUtil<RescueDeptDriver>(RescueDeptDriver.class);
util.exportExcel(response, list, "救援客户司机分配数据");
}
@ -76,7 +79,7 @@ public class RescueDeptDriverController extends BaseController {
/**
* 删除救援客户司机分配
*/
@PreAuthorize("@ss.hasPermission('dept_driver:dept_driver:remove')")
// @PreAuthorize("@ss.hasPermission('dept_driver:dept_driver:remove')")
// @Log(title = "救援客户司机分配", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public CommonResult remove(@PathVariable Long[] ids) {

View File

@ -0,0 +1,113 @@
package cn.iocoder.yudao.module.rescue.controller.admin;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.rescue.core.controller.BaseController;
import cn.iocoder.yudao.module.rescue.domain.RescueDriverPosition;
import cn.iocoder.yudao.module.rescue.service.IRescueDriverPositionService;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 救援司机位置记录Controller
*
* @author zcy
* @date 2023-09-19
*/
@RestController
@RequestMapping("/rescue/rescue_driver_position")
public class RescueDriverPositionController extends BaseController {
@Autowired
private IRescueDriverPositionService rescueDriverPositionService;
// /**
// * 查询救援司机位置记录列表
// */
// @PreAuthorize("@ss.hasPermi('rescue:rescue_driver_position:list')")
// @GetMapping("/list")
// public TableDataInfo list(RescueDriverPosition rescueDriverPosition)
// {
// startPage();
// List<RescueDriverPosition> list = rescueDriverPositionService.selectRescueDriverPositionList(rescueDriverPosition);
// return getDataTable(list);
// }
//
// /**
// * 导出救援司机位置记录列表
// */
// @PreAuthorize("@ss.hasPermi('rescue:rescue_driver_position:export')")
// @Log(title = "救援司机位置记录", businessType = BusinessType.EXPORT)
// @PostMapping("/export")
// public void export(HttpServletResponse response, RescueDriverPosition rescueDriverPosition)
// {
// List<RescueDriverPosition> list = rescueDriverPositionService.selectRescueDriverPositionList(rescueDriverPosition);
// ExcelUtil<RescueDriverPosition> util = new ExcelUtil<RescueDriverPosition>(RescueDriverPosition.class);
// util.exportExcel(response, list, "救援司机位置记录数据");
// }
//
// /**
// * 获取救援司机位置记录详细信息
// */
// @PreAuthorize("@ss.hasPermi('rescue:rescue_driver_position:query')")
// @GetMapping(value = "/{id}")
// public AjaxResult getInfo(@PathVariable("id") Long id)
// {
// return success(rescueDriverPositionService.selectRescueDriverPositionById(id));
// }
//
// /**
// * 新增救援司机位置记录
// */
// @PreAuthorize("@ss.hasPermi('rescue:rescue_driver_position:add')")
// @Log(title = "救援司机位置记录", businessType = BusinessType.INSERT)
// @PostMapping
// public AjaxResult add(@RequestBody RescueDriverPosition rescueDriverPosition)
// {
// return toAjax(rescueDriverPositionService.insertRescueDriverPosition(rescueDriverPosition));
// }
//
// /**
// * 修改救援司机位置记录
// */
// @PreAuthorize("@ss.hasPermi('rescue:rescue_driver_position:edit')")
// @Log(title = "救援司机位置记录", businessType = BusinessType.UPDATE)
// @PutMapping
// public AjaxResult edit(@RequestBody RescueDriverPosition rescueDriverPosition)
// {
// return toAjax(rescueDriverPositionService.updateRescueDriverPosition(rescueDriverPosition));
// }
//
// /**
// * 删除救援司机位置记录
// */
// @PreAuthorize("@ss.hasPermi('rescue:rescue_driver_position:remove')")
// @Log(title = "救援司机位置记录", businessType = BusinessType.DELETE)
// @DeleteMapping("/{ids}")
// public AjaxResult remove(@PathVariable Long[] ids)
// {
// return toAjax(rescueDriverPositionService.deleteRescueDriverPositionByIds(ids));
// }
//
/**
* 查询救援司机位置记录列表
*/
@GetMapping("/listByInfoId")
public CommonResult listByInfoId(RescueDriverPosition rescueDriverPosition) {
List<RescueDriverPosition> list = rescueDriverPositionService.listByInfoId(rescueDriverPosition);
return success(list);
}
/**
* 查询救援司机位置记录列表
*/
@GetMapping("/routeInfo")
public CommonResult routeInfo(RescueDriverPosition rescueDriverPosition) {
List<JSONObject> res = rescueDriverPositionService.routeInfo(rescueDriverPosition);
return success(res);
}
}

View File

@ -2,6 +2,8 @@ package cn.iocoder.yudao.module.rescue.controller.admin;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.rescue.core.controller.BaseController;
import cn.iocoder.yudao.module.rescue.core.page.TableDataInfo;
@ -13,6 +15,7 @@ import cn.iocoder.yudao.module.rescue.dto.DriverInfoDto;
import cn.iocoder.yudao.module.rescue.dto.SysDictData;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.module.staff.entity.CompanyStaff;
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO;
import cn.iocoder.yudao.module.rescue.service.IRescueInfoDetailService;
@ -22,6 +25,8 @@ import cn.iocoder.yudao.module.rescue.utils.ExcelUtil;
import cn.iocoder.yudao.module.rescue.utils.StringUtils;
import cn.iocoder.yudao.module.rescue.vo.MoneyManagement;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@ -29,9 +34,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.*;
import java.util.stream.Collectors;
@ -102,10 +105,12 @@ public class RescueInfoSystem extends BaseController {
* 查询请填写功能名称列表
*/
@GetMapping("/list2")
public TableDataInfo list2(RescueInfo rescueInfo) {
startPage();
List<RescueInfo> list = rescueInfoService.selectRescueListSystem2(rescueInfo);
return getDataTable(list);
public CommonResult<IPage<?>> list2(RescueInfo rescueInfo,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
Page<RescueInfo> page = new Page<>(pageNo, pageSize);
IPage<RescueInfo> list = rescueInfoService.selectRescueListSystem2(rescueInfo, page);
return success(list);
}
@GetMapping("/watchImg")
@ -131,16 +136,32 @@ public class RescueInfoSystem extends BaseController {
/**
* 导出请填写功能名称列表
*/
@PreAuthorize("@ss.hasPermi('system:info:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, RescueInfo rescueInfo) {
List<RescueInfo> list = rescueInfoService.selectRescueListSystem2(rescueInfo);
for (RescueInfo info : list) {
info.setSetMoneyYuan(Double.valueOf(Optional.ofNullable(info.getSetMoney()).orElse(0L)) / 100);
info.setPayMoneyYuan(Double.valueOf(Optional.ofNullable(info.getPayMoney()).orElse(0L)) / 100);
// @PreAuthorize("@ss.hasPermission('system:info:export')")
@GetMapping("/export")
public void export(HttpServletResponse response, RescueInfo rescueInfo,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) throws Exception {
List<RescueInfo> list = new ArrayList<>();
while (true){
Page<RescueInfo> page = new Page<>(pageNo, pageSize);
IPage<RescueInfo> rescueInfoIPage = rescueInfoService.selectRescueListSystem2(rescueInfo, page);
if (ObjectUtil.isNotEmpty(rescueInfoIPage) && !rescueInfoIPage.getRecords().isEmpty()){
rescueInfoIPage.getRecords().forEach(item -> {
item.setSetMoneyYuan(Double.valueOf(Optional.ofNullable(item.getSetMoney()).orElse(0L)) / 100);
item.setPayMoneyYuan(Double.valueOf(Optional.ofNullable(item.getPayMoney()).orElse(0L)) / 100);
});
list.addAll(rescueInfoIPage.getRecords());
pageNo++;
}else {
break;
}
ExcelUtil<RescueInfo> util = new ExcelUtil<RescueInfo>(RescueInfo.class);
util.exportExcel(response, list, "救援订单数据");
}
// 导出 Excel
Map<Integer, Integer> columnWidthMap = new HashMap<>();
// 第一列的索引是0宽度设置为20个字符宽
columnWidthMap.put(9, 20);
columnWidthMap.put(10, 20);
ExcelUtils.write(response, "救援订单.xls", "数据", RescueInfo.class, list, columnWidthMap);
}
//指派司机
@ -154,10 +175,12 @@ public class RescueInfoSystem extends BaseController {
* 查询请填写功能名称列表
*/
@GetMapping("/driverList")
public TableDataInfo driverList(DriverInfoDto driverInfoDto) {
startPage();
List<DriverInfo> list = rescueInfoService.driverList(driverInfoDto);
return getDataTable(list);
public CommonResult<IPage<?>> driverList(DriverInfoDto driverInfoDto,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
Page<DriverInfo> page = new Page<>(pageNo, pageSize);
IPage<DriverInfo> list = rescueInfoService.driverList(driverInfoDto, page);
return success(list);
}
@GetMapping("/getDriverById")

View File

@ -6,6 +6,8 @@ import cn.iocoder.yudao.module.rescue.core.page.TableDataInfo;
import cn.iocoder.yudao.module.rescue.domain.RescueRefuelRecord;
import cn.iocoder.yudao.module.rescue.service.IRescueRefuelRecordService;
import cn.iocoder.yudao.module.rescue.utils.ExcelUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@ -21,8 +23,7 @@ import java.util.List;
*/
@RestController
@RequestMapping("/rescue/refuelRecord")
public class RescueRefuelRecordController extends BaseController
{
public class RescueRefuelRecordController extends BaseController {
@Autowired
private IRescueRefuelRecordService rescueRefuelRecordService;
@ -31,33 +32,31 @@ public class RescueRefuelRecordController extends BaseController
*/
@PreAuthorize("@ss.hasPermission('rescue:refuelRecord:list')")
@GetMapping("/list")
public TableDataInfo list(RescueRefuelRecord rescueRefuelRecord)
{
startPage();
List<RescueRefuelRecord> list = rescueRefuelRecordService.selectRescueRefuelRecordList(rescueRefuelRecord);
return getDataTable(list);
public CommonResult list(RescueRefuelRecord rescueRefuelRecord,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
Page<RescueRefuelRecord> page = new Page<>(pageNo, pageSize);
return success(rescueRefuelRecordService.selectRescueRefuelRecordList(rescueRefuelRecord, page));
}
/**
* 导出加油记录列表
*/
@PreAuthorize("@ss.hasPermission('rescue:refuelRecord:export')")
// @Log(title = "加油记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, RescueRefuelRecord rescueRefuelRecord)
{
List<RescueRefuelRecord> list = rescueRefuelRecordService.selectRescueRefuelRecordList(rescueRefuelRecord);
ExcelUtil<RescueRefuelRecord> util = new ExcelUtil<RescueRefuelRecord>(RescueRefuelRecord.class);
util.exportExcel(response, list, "加油记录数据");
}
// @PreAuthorize("@ss.hasPermission('rescue:refuelRecord:export')")
//// @Log(title = "加油记录", businessType = BusinessType.EXPORT)
// @PostMapping("/export")
// public void export(HttpServletResponse response, RescueRefuelRecord rescueRefuelRecord) {
// List<RescueRefuelRecord> list = rescueRefuelRecordService.selectRescueRefuelRecordList(rescueRefuelRecord);
// ExcelUtil<RescueRefuelRecord> util = new ExcelUtil<RescueRefuelRecord>(RescueRefuelRecord.class);
// util.exportExcel(response, list, "加油记录数据");
// }
/**
* 获取加油记录详细信息
*/
@PreAuthorize("@ss.hasPermission('rescue:refuelRecord:query')")
@GetMapping(value = "/{id}")
public CommonResult getInfo(@PathVariable("id") Long id)
{
public CommonResult getInfo(@PathVariable("id") Long id) {
return success(rescueRefuelRecordService.selectRescueRefuelRecordById(id));
}
@ -67,8 +66,7 @@ public class RescueRefuelRecordController extends BaseController
@PreAuthorize("@ss.hasPermission('rescue:refuelRecord:add')")
// @Log(title = "加油记录", businessType = BusinessType.INSERT)
@PostMapping
public CommonResult add(@RequestBody RescueRefuelRecord rescueRefuelRecord)
{
public CommonResult add(@RequestBody RescueRefuelRecord rescueRefuelRecord) {
return toAjax(rescueRefuelRecordService.insertRescueRefuelRecord(rescueRefuelRecord));
}
@ -78,8 +76,7 @@ public class RescueRefuelRecordController extends BaseController
@PreAuthorize("@ss.hasPermission('rescue:refuelRecord:edit')")
// @Log(title = "加油记录", businessType = BusinessType.UPDATE)
@PutMapping
public CommonResult edit(@RequestBody RescueRefuelRecord rescueRefuelRecord)
{
public CommonResult edit(@RequestBody RescueRefuelRecord rescueRefuelRecord) {
return toAjax(rescueRefuelRecordService.updateRescueRefuelRecord(rescueRefuelRecord));
}
@ -89,8 +86,7 @@ public class RescueRefuelRecordController extends BaseController
@PreAuthorize("@ss.hasPermission('rescue:refuelRecord:remove')")
// @Log(title = "加油记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public CommonResult remove(@PathVariable Long[] ids)
{
public CommonResult remove(@PathVariable Long[] ids) {
return toAjax(rescueRefuelRecordService.deleteRescueRefuelRecordByIds(ids));
}
}

View File

@ -73,6 +73,7 @@ public class DriverInfo extends TenantBaseDO
/** 用户账号 */
@TableField(exist = false)
private String userName;
private Integer age;
/** 用户昵称 */
@TableField(exist = false)

View File

@ -0,0 +1,37 @@
package cn.iocoder.yudao.module.rescue.domain;
import lombok.Data;
/**
* 用户登录对象
*
* @author ruoyi
*/
@Data
public class LoginBody
{
/**
* 用户名
*/
private String username;
/**
* 用户密码
*/
private String password;
/**
* 验证码
*/
private String code;
/**
* 唯一标识
*/
private String uuid;
//0账号密码登录1手机号登录 2:管理 3教练
private String type;
private String types;
private String phone;
private String realName;
}

View File

@ -109,6 +109,7 @@ public class RescueCarInfo extends TenantBaseDO {
/**
* 部门id
*/
@TableField(exist = false)
private Long deptId;
}

View File

@ -55,6 +55,7 @@ public class RescueCustomerInfo extends TenantBaseDO
private String defaultRescueType;
/** 部门主键 */
@TableField
private Long deptId;
@TableField(exist = false)
private String deptName;

View File

@ -3,7 +3,11 @@ package cn.iocoder.yudao.module.rescue.mapper;
import cn.iocoder.yudao.module.rescue.domain.RescueCarSpend;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -14,7 +18,7 @@ import java.util.List;
* @date 2023-11-30
*/
@Mapper
public interface RescueCarSpendMapper
public interface RescueCarSpendMapper extends BaseMapper<RescueCarSpend>
{
/**
* 查询车辆消费管理
@ -30,7 +34,7 @@ public interface RescueCarSpendMapper
* @param rescueCarSpend 车辆消费管理
* @return 车辆消费管理集合
*/
public List<RescueCarSpend> selectRescueCarSpendList(RescueCarSpend rescueCarSpend);
IPage<RescueCarSpend> selectRescueCarSpendList(@Param("map") RescueCarSpend rescueCarSpend, Page<RescueCarSpend> page);
/**
* 新增车辆消费管理

View File

@ -2,7 +2,10 @@ package cn.iocoder.yudao.module.rescue.mapper;
import cn.iocoder.yudao.module.rescue.domain.RescueDeptDriver;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -30,7 +33,16 @@ public interface RescueDeptDriverMapper extends BaseMapper<RescueDeptDriver>
* @param rescueDeptDriver 救援客户司机分配
* @return 救援客户司机分配集合
*/
public List<RescueDeptDriver> selectRescueDeptDriverList(RescueDeptDriver rescueDeptDriver);
List<RescueDeptDriver> selectRescueDeptDriverList(@Param("map") RescueDeptDriver rescueDeptDriver);
/**
* 分页查
* @author 小李
* @date 9:02 2024/8/20
* @param rescueDeptDriver
* @param page
**/
IPage<RescueDeptDriver> selectRescueDeptDriverList(@Param("map") RescueDeptDriver rescueDeptDriver, Page<RescueDeptDriver> page);
/**
* 删除救援客户司机分配

View File

@ -8,6 +8,8 @@ import cn.iocoder.yudao.module.rescue.dto.DriverInfoDto;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -30,9 +32,9 @@ public interface RescueInfoMapper extends BaseMapper<RescueInfo>
* @param rescueInfo 请填写功能名称
* @return 请填写功能名称集合
*/
public List<RescueInfo> selectRescueInfoList(RescueInfo rescueInfo);
public List<RescueInfo> selectRescueListSystem2(RescueInfo rescueInfo);
IPage<RescueInfo> selectRescueInfoList(@Param("map") RescueInfo rescueInfo, Page<RescueInfo> page);
IPage<RescueInfo> selectRescueListSystem2(@Param("map") RescueInfo rescueInfo, Page<RescueInfo> page);
JSONObject listData(RescueInfo rescueInfo);
/**
@ -41,12 +43,12 @@ public interface RescueInfoMapper extends BaseMapper<RescueInfo>
* @param rescueInfo 请填写功能名称
* @return 请填写功能名称集合
*/
public List<RescueInfo> selectRescueInfoListApp(RescueInfo rescueInfo);
IPage<RescueInfo> selectRescueInfoListApp(@Param("map") RescueInfo rescueInfo, Page<RescueInfo> page);
List<RescueInfo> getKcList(RescueInfo rescueInfo);
List<DriverInfo> driverList(DriverInfoDto user);
IPage<DriverInfo> driverList(@Param("map") DriverInfoDto user, Page<DriverInfo> page);
List<DriverInfo2Dto> driverListApp(DriverInfoDto user);
Map<String,Integer> driverInMap2();
void dealOverTimeRescue();

View File

@ -4,6 +4,8 @@ import cn.iocoder.yudao.module.rescue.domain.RescueInfo;
import cn.iocoder.yudao.module.rescue.domain.RescueRefuelRecord;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -32,7 +34,7 @@ public interface RescueRefuelRecordMapper extends BaseMapper<RescueRefuelRecord>
* @param rescueRefuelRecord 加油记录
* @return 加油记录集合
*/
public List<RescueRefuelRecord> selectRescueRefuelRecordList(RescueRefuelRecord rescueRefuelRecord);
IPage<RescueRefuelRecord> selectRescueRefuelRecordList(@Param("map") RescueRefuelRecord rescueRefuelRecord, Page<RescueRefuelRecord> page);
/**

View File

@ -1,8 +1,10 @@
package cn.iocoder.yudao.module.rescue.service;
import cn.iocoder.yudao.module.rescue.domain.RescueCarSpend;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
@ -12,8 +14,7 @@ import java.util.List;
* @author zcy
* @date 2023-11-30
*/
public interface IRescueCarSpendService
{
public interface IRescueCarSpendService extends IService<RescueCarSpend> {
/**
* 查询车辆消费管理
*
@ -28,7 +29,7 @@ public interface IRescueCarSpendService
* @param rescueCarSpend 车辆消费管理
* @return 车辆消费管理集合
*/
public List<RescueCarSpend> selectRescueCarSpendList(RescueCarSpend rescueCarSpend);
IPage<RescueCarSpend> selectRescueCarSpendList(RescueCarSpend rescueCarSpend, Page<RescueCarSpend> page);
/**
* 新增车辆消费管理

View File

@ -1,6 +1,8 @@
package cn.iocoder.yudao.module.rescue.service;
import cn.iocoder.yudao.module.rescue.domain.RescueDeptDriver;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
@ -28,7 +30,15 @@ public interface IRescueDeptDriverService extends IService<RescueDeptDriver>
* @param rescueDeptDriver 救援客户司机分配
* @return 救援客户司机分配集合
*/
public List<RescueDeptDriver> selectRescueDeptDriverList(RescueDeptDriver rescueDeptDriver);
List<RescueDeptDriver> selectRescueDeptDriverList(RescueDeptDriver rescueDeptDriver);
/**
* 分页查
* @author 小李
* @date 8:59 2024/8/20
* @param rescueDeptDriver
**/
IPage<RescueDeptDriver> selectRescueDeptDriverPage(RescueDeptDriver rescueDeptDriver, Page<RescueDeptDriver> page);
/**
* 新增救援客户司机分配

View File

@ -8,6 +8,8 @@ import cn.iocoder.yudao.module.rescue.dto.DriverInfo2Dto;
import cn.iocoder.yudao.module.rescue.dto.DriverInfoDto;
import cn.iocoder.yudao.module.rescue.vo.MoneyManagement;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
@ -36,16 +38,16 @@ public interface IRescueInfoService extends IService<RescueInfo>
* @param rescueInfo 请填写功能名称
* @return 请填写功能名称集合
*/
public List<RescueInfo> selectRescueInfoList(RescueInfo rescueInfo);
IPage<RescueInfo> selectRescueInfoList(RescueInfo rescueInfo, Page<RescueInfo> page);
List<RescueInfo> getKcList(RescueInfo rescueInfo);
List<RescueInfo> getHcList(RescueInfo rescueInfo);
void openKc(Long rescueId) throws Exception;
public List<RescueInfo> selectRescueInfoListByAdmin(RescueInfo rescueInfo);
IPage<RescueInfo> selectRescueInfoListByAdmin(RescueInfo rescueInfo, Page<RescueInfo> page);
JSONObject rescueInfoDetail(Long rescueId);
List<RescueInfo> selectRescueListSystem(RescueInfo rescueInfo);
List<RescueInfo> selectRescueListSystem2(RescueInfo rescueInfo);
IPage<RescueInfo> selectRescueListSystem2(RescueInfo rescueInfo, Page<RescueInfo> page);
JSONObject listData(RescueInfo rescueInfo);
void designateDriver(Long rescueId,Long driverId) throws Exception;
@ -81,7 +83,7 @@ public interface IRescueInfoService extends IService<RescueInfo>
* @return 结果
*/
public void deleteRescueInfoById(Long id);
List<DriverInfo> driverList(DriverInfoDto user);
IPage<DriverInfo> driverList(DriverInfoDto user, Page<DriverInfo> page);
DriverInfo getDriverById(Long driverId);
void addDriver(DriverInfo driverInfo) throws Exception;
void updateDriver(DriverInfo user);

View File

@ -4,6 +4,8 @@ package cn.iocoder.yudao.module.rescue.service;
import cn.iocoder.yudao.module.rescue.domain.RescueInfo;
import cn.iocoder.yudao.module.rescue.domain.RescueRefuelRecord;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
@ -30,7 +32,7 @@ public interface IRescueRefuelRecordService extends IService<RescueRefuelRecord
* @param rescueRefuelRecord 加油记录
* @return 加油记录集合
*/
public List<RescueRefuelRecord> selectRescueRefuelRecordList(RescueRefuelRecord rescueRefuelRecord);
IPage<RescueRefuelRecord> selectRescueRefuelRecordList(RescueRefuelRecord rescueRefuelRecord, Page<RescueRefuelRecord> page);
/**
* 新增加油记录

View File

@ -5,6 +5,9 @@ import cn.iocoder.yudao.module.rescue.domain.RescueCarSpend;
import cn.iocoder.yudao.module.rescue.mapper.RescueCarSpendMapper;
import cn.iocoder.yudao.module.rescue.service.IRescueCarInfoService;
import cn.iocoder.yudao.module.rescue.service.IRescueCarSpendService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -18,8 +21,7 @@ import java.util.List;
* @date 2023-11-30
*/
@Service
public class RescueCarSpendServiceImpl implements IRescueCarSpendService
{
public class RescueCarSpendServiceImpl extends ServiceImpl<RescueCarSpendMapper, RescueCarSpend> implements IRescueCarSpendService {
@Autowired
private RescueCarSpendMapper rescueCarSpendMapper;
@Autowired
@ -32,8 +34,7 @@ public class RescueCarSpendServiceImpl implements IRescueCarSpendService
* @return 车辆消费管理
*/
@Override
public RescueCarSpend selectRescueCarSpendById(Long id)
{
public RescueCarSpend selectRescueCarSpendById(Long id) {
return rescueCarSpendMapper.selectRescueCarSpendById(id);
}
@ -44,9 +45,8 @@ public class RescueCarSpendServiceImpl implements IRescueCarSpendService
* @return 车辆消费管理
*/
@Override
public List<RescueCarSpend> selectRescueCarSpendList(RescueCarSpend rescueCarSpend)
{
return rescueCarSpendMapper.selectRescueCarSpendList(rescueCarSpend);
public IPage<RescueCarSpend> selectRescueCarSpendList(RescueCarSpend rescueCarSpend, Page<RescueCarSpend> page) {
return rescueCarSpendMapper.selectRescueCarSpendList(rescueCarSpend, page);
}
/**
@ -56,8 +56,7 @@ public class RescueCarSpendServiceImpl implements IRescueCarSpendService
* @return 结果
*/
@Override
public int insertRescueCarSpend(@Valid RescueCarSpend rescueCarSpend)
{
public int insertRescueCarSpend(@Valid RescueCarSpend rescueCarSpend) {
RescueCarInfo rescueCarInfo = carInfoService.selectRescueCarInfoById(rescueCarSpend.getRescueCarId());
rescueCarSpend.setCarNum(rescueCarInfo.getRescueCarNum());
return rescueCarSpendMapper.insertRescueCarSpend(rescueCarSpend);
@ -70,8 +69,7 @@ public class RescueCarSpendServiceImpl implements IRescueCarSpendService
* @return 结果
*/
@Override
public int updateRescueCarSpend(@Valid RescueCarSpend rescueCarSpend)
{
public int updateRescueCarSpend(@Valid RescueCarSpend rescueCarSpend) {
RescueCarInfo rescueCarInfo = carInfoService.selectRescueCarInfoById(rescueCarSpend.getRescueCarId());
rescueCarSpend.setCarNum(rescueCarInfo.getRescueCarNum());
return rescueCarSpendMapper.updateRescueCarSpend(rescueCarSpend);
@ -84,8 +82,7 @@ public class RescueCarSpendServiceImpl implements IRescueCarSpendService
* @return 结果
*/
@Override
public int deleteRescueCarSpendByIds(Long[] ids)
{
public int deleteRescueCarSpendByIds(Long[] ids) {
return rescueCarSpendMapper.deleteRescueCarSpendByIds(ids);
}
@ -96,8 +93,7 @@ public class RescueCarSpendServiceImpl implements IRescueCarSpendService
* @return 结果
*/
@Override
public int deleteRescueCarSpendById(Long id)
{
public int deleteRescueCarSpendById(Long id) {
return rescueCarSpendMapper.deleteRescueCarSpendById(id);
}
}

View File

@ -80,8 +80,7 @@ public class RescueCustomerInfoServiceImpl extends ServiceImpl<RescueCustomerInf
*/
@Override
public int deleteRescueCustomerInfoByIds(Long[] ids) {
List<Long> longs = Arrays.asList(ids);
return baseMapper.deleteByIds(longs);
return baseMapper.deleteByIds(Arrays.asList(ids));
}
/**

View File

@ -9,12 +9,17 @@ import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import cn.iocoder.yudao.module.rescue.service.IDriverInfoService;
import cn.iocoder.yudao.module.rescue.service.IRescueDeptDriverService;
import cn.iocoder.yudao.module.rescue.utils.StringUtils;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.iocoder.yudao.module.rescue.mapper.RescueDeptDriverMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.StringJoiner;
/**
* 救援客户司机分配Service业务层处理
@ -23,8 +28,7 @@ import java.util.List;
* @date 2023-09-21
*/
@Service
public class RescueDeptDriverServiceImpl extends ServiceImpl<RescueDeptDriverMapper, RescueDeptDriver> implements IRescueDeptDriverService
{
public class RescueDeptDriverServiceImpl extends ServiceImpl<RescueDeptDriverMapper, RescueDeptDriver> implements IRescueDeptDriverService {
@Autowired
private DeptApi deptService;
@Autowired
@ -41,8 +45,7 @@ public class RescueDeptDriverServiceImpl extends ServiceImpl<RescueDeptDriverMap
* @return 救援客户司机分配
*/
@Override
public RescueDeptDriver selectRescueDeptDriverById(Long id)
{
public RescueDeptDriver selectRescueDeptDriverById(Long id) {
return baseMapper.selectRescueDeptDriverById(id);
}
@ -53,8 +56,7 @@ public class RescueDeptDriverServiceImpl extends ServiceImpl<RescueDeptDriverMap
* @return 救援客户司机分配
*/
@Override
public List<RescueDeptDriver> selectRescueDeptDriverList(RescueDeptDriver rescueDeptDriver)
{
public List<RescueDeptDriver> selectRescueDeptDriverList(RescueDeptDriver rescueDeptDriver) {
List<RescueDeptDriver> rescueDeptDrivers = baseMapper.selectRescueDeptDriverList(rescueDeptDriver);
for (RescueDeptDriver deptDriver : rescueDeptDrivers) {
DeptRespDTO dept = deptService.getDept(deptDriver.getDeptId());
@ -102,6 +104,55 @@ public class RescueDeptDriverServiceImpl extends ServiceImpl<RescueDeptDriverMap
return rescueDeptDrivers;
}
/**
* 分页查
* @author 小李
* @date 8:59 2024/8/20
* @param rescueDeptDriver
**/
@Override
public IPage<RescueDeptDriver> selectRescueDeptDriverPage(RescueDeptDriver rescueDeptDriver, Page<RescueDeptDriver> page){
IPage<RescueDeptDriver> driverIPage = baseMapper.selectRescueDeptDriverList(rescueDeptDriver, page);
for (RescueDeptDriver deptDriver : driverIPage.getRecords()) {
DeptRespDTO dept = deptService.getDept(deptDriver.getDeptId());
deptDriver.setDeptName(dept.getName());
String firstDriverIds = deptDriver.getFirstDriverIds();
if (StringUtils.isNotEmpty(firstDriverIds)) {
StringJoiner tempStr = new StringJoiner("|");
String[] driverIds = firstDriverIds.split(",");
for (String driverId : driverIds) {
DriverInfo driverInfo = driverInfoService.getById(driverId);
AdminUserRespDTO sysUser = userService.getUser(driverInfo.getUserId());
tempStr.add(sysUser.getNickname());
}
deptDriver.setFirstDriverName(tempStr.toString());
}
String secondDriverIds = deptDriver.getSecondDriverIds();
if (StringUtils.isNotEmpty(secondDriverIds)) {
String[] driverIds = secondDriverIds.split(",");
StringJoiner tempStr = new StringJoiner("|");
for (String driverId : driverIds) {
DriverInfo driverInfo = driverInfoService.getById(driverId);
AdminUserRespDTO sysUser = userService.getUser(driverInfo.getUserId());
tempStr.add(sysUser.getNickname());
}
deptDriver.setSecondDriverName(tempStr.toString());
}
String thirdDriverIds = deptDriver.getThirdDriverIds();
if (StringUtils.isNotEmpty(thirdDriverIds)) {
String[] driverIds = thirdDriverIds.split(",");
StringJoiner tempStr = new StringJoiner("|");
for (String driverId : driverIds) {
DriverInfo driverInfo = driverInfoService.getById(driverId);
AdminUserRespDTO sysUser = userService.getUser(driverInfo.getUserId());
tempStr.add(sysUser.getNickname());
}
deptDriver.setThirdDriverName(tempStr.toString());
}
}
return driverIPage;
}
/**
* 新增救援客户司机分配
*
@ -109,8 +160,7 @@ public class RescueDeptDriverServiceImpl extends ServiceImpl<RescueDeptDriverMap
* @return 结果
*/
@Override
public int insertRescueDeptDriver(RescueDeptDriver rescueDeptDriver)
{
public int insertRescueDeptDriver(RescueDeptDriver rescueDeptDriver) {
return baseMapper.insert(rescueDeptDriver);
}
@ -121,8 +171,7 @@ public class RescueDeptDriverServiceImpl extends ServiceImpl<RescueDeptDriverMap
* @return 结果
*/
@Override
public int updateRescueDeptDriver(RescueDeptDriver rescueDeptDriver)
{
public int updateRescueDeptDriver(RescueDeptDriver rescueDeptDriver) {
return baseMapper.updateById(rescueDeptDriver);
}
@ -133,9 +182,8 @@ public class RescueDeptDriverServiceImpl extends ServiceImpl<RescueDeptDriverMap
* @return 结果
*/
@Override
public int deleteRescueDeptDriverByIds(Long[] ids)
{
return baseMapper.deleteRescueDeptDriverByIds(ids);
public int deleteRescueDeptDriverByIds(Long[] ids) {
return baseMapper.deleteByIds(Arrays.asList(ids));
}
/**
@ -145,8 +193,7 @@ public class RescueDeptDriverServiceImpl extends ServiceImpl<RescueDeptDriverMap
* @return 结果
*/
@Override
public int deleteRescueDeptDriverById(Long id)
{
public int deleteRescueDeptDriverById(Long id) {
return baseMapper.deleteRescueDeptDriverById(id);
}
}

View File

@ -26,8 +26,11 @@ import cn.iocoder.yudao.module.rescue.vo.MoneyManagement;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -55,8 +58,7 @@ import static cn.iocoder.yudao.module.rescue.utils.DistanceUtil.getDistanceMeter
* @date 2023-07-14
*/
@Service
public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper,RescueInfo> implements IRescueInfoService
{
public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper, RescueInfo> implements IRescueInfoService {
@Resource
private AdminUserApi userService;
@Resource
@ -92,7 +94,6 @@ public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper,RescueIn
private RoleApi roleApi;
/**
* 查询请填写功能名称
*
@ -100,8 +101,7 @@ public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper,RescueIn
* @return 请填写功能名称
*/
@Override
public RescueInfo selectRescueInfoById(Long id)
{
public RescueInfo selectRescueInfoById(Long id) {
return baseMapper.selectById(id);
}
@ -112,17 +112,16 @@ public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper,RescueIn
* @return 请填写功能名称
*/
@Override
public List<RescueInfo> selectRescueInfoList(RescueInfo rescueInfo)
{
public IPage<RescueInfo> selectRescueInfoList(RescueInfo rescueInfo, Page<RescueInfo> page) {
LoginUser user = getLoginUser();
//当前用户创建的
rescueInfo.setUserId(user.getId());
AdminUserRespDTO user1 = userService.getUser(user.getId());
//当前用户手机号的
rescueInfo.setConnectionPhone(user1.getMobile());
List<RescueInfo> rescueInfos = baseMapper.selectRescueInfoListApp(rescueInfo);
IPage<RescueInfo> rescueInfos = baseMapper.selectRescueInfoListApp(rescueInfo, page);
for (RescueInfo info : rescueInfos) {
for (RescueInfo info : rescueInfos.getRecords()) {
String dljy_type = dictDataService.getDictDataLabel("dljy_type", info.getRescueType());
info.setRescueTypeStr(dljy_type);
String rescueStatus = dictDataService.getDictDataLabel("jy_status", info.getRescueStatus());
@ -140,8 +139,6 @@ public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper,RescueIn
info.setNeedTime(5 + (distanceMeter / 1000) * 2 + 5);
}
}
}
return rescueInfos;
}
@ -218,41 +215,41 @@ public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper,RescueIn
}
@Override
public List<RescueInfo> selectRescueInfoListByAdmin(RescueInfo rescueInfo)
{
public IPage<RescueInfo> selectRescueInfoListByAdmin(RescueInfo rescueInfo, Page<RescueInfo> page) {
LoginUser user = getLoginUser();
List<RescueInfo> rescueInfos = baseMapper.selectRescueInfoList(rescueInfo);
IPage<RescueInfo> rescueInfos = baseMapper.selectRescueInfoList(rescueInfo, page);
for (RescueInfo info : rescueInfos) {
String dljy_type = dictDataService.getDictDataLabel("dljy_type", info.getRescueType());
info.setRescueTypeStr(dljy_type);
String rescueStatus = dictDataService.getDictDataLabel("jy_status", info.getRescueStatus());
info.setRescueStatusStr(rescueStatus);
//获取当前司机的经纬度
if (ObjectUtils.isNotEmpty(info.getDriverId())){
//所在顶级机构
String driverKey = Redis_Driver_Key+user.getTenantId()+":"+info.getDriverId();
if (redisCache.hasKey(driverKey)){
try {
JSONObject driverInfo = (JSONObject) JSONObject.parse(JSONObject.toJSONString(redisCache.getCacheMap(driverKey)));
Double longitude = driverInfo.getDouble("longitude");
//纬度
Double latitude = driverInfo.getDouble("latitude");
Long distanceMeter = getDistanceMeter(Double.parseDouble(info.getRescueLongitude()),Double.parseDouble(info.getRescueLatitude()), longitude, latitude);
info.setDistance(Double.valueOf(distanceMeter*1.3d).longValue());
info.setNeedTime(5+ (distanceMeter / 1000)*2 +5);
}catch (Exception ignored){
}
}
}
}
// for (RescueInfo info : rescueInfos) {
// String dljy_type = dictDataService.getDictDataLabel("dljy_type", info.getRescueType());
// info.setRescueTypeStr(dljy_type);
// String rescueStatus = dictDataService.getDictDataLabel("jy_status", info.getRescueStatus());
// info.setRescueStatusStr(rescueStatus);
// //获取当前司机的经纬度
// if (ObjectUtils.isNotEmpty(info.getDriverId())) {
// //所在顶级机构
//
// String driverKey = Redis_Driver_Key + user.getTenantId() + ":" + info.getDriverId();
// if (redisCache.hasKey(driverKey)) {
// try {
// JSONObject driverInfo = (JSONObject) JSONObject.parse(JSONObject.toJSONString(redisCache.getCacheMap(driverKey)));
// Double longitude = driverInfo.getDouble("longitude");
// //纬度
// Double latitude = driverInfo.getDouble("latitude");
// Long distanceMeter = getDistanceMeter(Double.parseDouble(info.getRescueLongitude()), Double.parseDouble(info.getRescueLatitude()), longitude, latitude);
// info.setDistance(Double.valueOf(distanceMeter * 1.3d).longValue());
// info.setNeedTime(5 + (distanceMeter / 1000) * 2 + 5);
// } catch (Exception ignored) {
//
// }
//
// }
// }
//
//
// }
return rescueInfos;
}
@Override
public JSONObject rescueInfoDetail(Long rescueId) {
JSONObject res = new JSONObject();
@ -298,15 +295,13 @@ public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper,RescueIn
}
@Override
public List<RescueInfo> selectRescueListSystem(RescueInfo rescueInfo)
{
return baseMapper.selectRescueInfoList(rescueInfo);
public List<RescueInfo> selectRescueListSystem(RescueInfo rescueInfo) {
return baseMapper.selectList(new QueryWrapper<>());
}
@Override
public List<RescueInfo> selectRescueListSystem2(RescueInfo rescueInfo) {
return baseMapper.selectRescueListSystem2(rescueInfo);
public IPage<RescueInfo> selectRescueListSystem2(RescueInfo rescueInfo, Page<RescueInfo> page) {
return baseMapper.selectRescueListSystem2(rescueInfo, page);
}
@Override
@ -371,8 +366,7 @@ public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper,RescueIn
* @return 结果
*/
@Override
public void insertRescueInfo(RescueInfo rescueInfo)
{
public void insertRescueInfo(RescueInfo rescueInfo) {
// 获取当前的用户
LoginUser loginUser = getLoginUser();
@ -406,8 +400,7 @@ public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper,RescueIn
* @return 结果
*/
@Override
public int updateRescueInfo(RescueInfo rescueInfo)
{
public int updateRescueInfo(RescueInfo rescueInfo) {
if (rescueInfo.getRescueStatus().compareTo("9") > 0) {
rescueInfo.setRescueStatus(null);
}
@ -421,8 +414,7 @@ public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper,RescueIn
* @return 结果
*/
@Override
public int deleteRescueInfoByIds(Long[] ids)
{
public int deleteRescueInfoByIds(Long[] ids) {
return baseMapper.deleteBatchIds(Arrays.asList(ids));
}
@ -434,8 +426,7 @@ public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper,RescueIn
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteRescueInfoById(Long id)
{
public void deleteRescueInfoById(Long id) {
//主表删除
baseMapper.deleteById(id);
//删除其余子表
@ -444,9 +435,9 @@ public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper,RescueIn
}
@Override
public List<DriverInfo> driverList(DriverInfoDto driverInfo) {
List<DriverInfo> driverInfos = baseMapper.driverList(driverInfo);
for (DriverInfo info : driverInfos) {
public IPage<DriverInfo> driverList(DriverInfoDto driverInfo, Page<DriverInfo> page) {
IPage<DriverInfo> driverInfos = baseMapper.driverList(driverInfo, page);
for (DriverInfo info : driverInfos.getRecords()) {
LambdaQueryWrapper<RescueCarInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(RescueCarInfo::getCarOwn, "1").eq(RescueCarInfo::getPossessorId, info.getId());
List<RescueCarInfo> list = carInfoService.list(queryWrapper);
@ -509,6 +500,9 @@ public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper,RescueIn
List<Long> roleIds = new ArrayList<>();
roleIds.add((roleReqDTO.getId()));
staffRespVO.setRoleIds(roleIds);
staffRespVO.setName(driverInfoDto.getRealName());
staffRespVO.setSex(driverInfoDto.getSex());
staffRespVO.setTel(driverInfoDto.getPhonenumber());
Long userId = staffService.saveStaff(staffRespVO);
//代表为救援司机角色 需要添加到司机表中
driverInfoDto.setUserId(userId);
@ -575,7 +569,7 @@ public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper,RescueIn
DriverInfo driverInfo = driverInfoService.selectDriverInfoById(id);
Long userId = driverInfo.getUserId();
staffService.deleteStaffByUserId(userId);
driverInfoService.deleteDriverInfoById(id);
driverInfoService.removeById(id);
LambdaQueryWrapper<RescueCarInfo> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(RescueCarInfo::getPossessorId, id).eq(RescueCarInfo::getCarOwn, "1");
carInfoService.remove(queryWrapper1);
@ -603,6 +597,7 @@ public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper,RescueIn
}
return dtos;
}
//获取司机在地图上的位置分布
@Override
public List<DriverInfo2Dto> driverInMap(DriverInfoDto driverInfoDto) {
@ -835,9 +830,11 @@ public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper,RescueIn
sysAnnouncement.setContent("有新的救援订单请立即处理");
announcementService.insertSysAnnouncements(sysAnnouncement);
}
public List<RescueInfo> getRescueInfoByDriver(RescueInfo rescueInfo) {
return baseMapper.getRescueInfoByDriver(rescueInfo);
}
public List<MoneyManagement> moneyManagement2(List<RescueInfo> rescueInfos, String rescueStart) {
List<MoneyManagement> resList = new ArrayList<>();
Double rescueTcBig = 0d;
@ -864,7 +861,8 @@ public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper,RescueIn
queryWrapper.eq(RescueCarInfo::getRescueCarNum, info.getDriverCarNum()).last("limit 1");
RescueCarInfo carInfo = carInfoService.getOne(queryWrapper);
monthRescueRefuelRecord = refuelRecordService.getMonthRescueRefuelRecord(info.getDriverId(), DateUtil.format(info.getRescueTime(), "yyyy-MM"), carInfo.getId());
}catch (Exception ignored){}
} catch (Exception ignored) {
}
moneyManagement.setLicenseNum(info.getLicenseNum());
moneyManagement.setFeeType(info.getFeeType());
moneyManagement.setRescueTime(info.getRescueTime());
@ -940,7 +938,8 @@ public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper,RescueIn
queryWrapper.eq(RescueCarInfo::getRescueCarNum, info.getDriverCarNum()).last("limit 1");
RescueCarInfo carInfo = carInfoService.getOne(queryWrapper);
monthRescueRefuelRecord = refuelRecordService.getMonthRescueRefuelRecord(info.getDriverId(), DateUtil.format(info.getRescueTime(), "yyyy-MM"), carInfo.getId());
}catch (Exception ignored){}
} catch (Exception ignored) {
}
moneyManagement.setLicenseNum(info.getLicenseNum());
moneyManagement.setFeeType(info.getFeeType());
moneyManagement.setRescueTime(info.getRescueTime());

View File

@ -4,6 +4,8 @@ import cn.iocoder.yudao.module.rescue.domain.RescueInfo;
import cn.iocoder.yudao.module.rescue.domain.RescueRefuelRecord;
import cn.iocoder.yudao.module.rescue.service.IRescueRefuelRecordService;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.iocoder.yudao.module.rescue.mapper.RescueRefuelRecordMapper;
import org.springframework.stereotype.Service;
@ -39,9 +41,9 @@ public class RescueRefuelRecordServiceImpl extends ServiceImpl<RescueRefuelRecor
* @return 加油记录
*/
@Override
public List<RescueRefuelRecord> selectRescueRefuelRecordList(RescueRefuelRecord rescueRefuelRecord)
public IPage<RescueRefuelRecord> selectRescueRefuelRecordList(RescueRefuelRecord rescueRefuelRecord, Page<RescueRefuelRecord> page)
{
return baseMapper.selectRescueRefuelRecordList(rescueRefuelRecord);
return baseMapper.selectRescueRefuelRecordList(rescueRefuelRecord, page);
}
/**

View File

@ -6,7 +6,7 @@
<sql id="selectDriverInfoVo">
select id, user_id, phonenumber, license_image, id_card_right, id_card_back, auth_status, reject_info, driver_status, driver_longitude, driver_latitude, driver_position_info, driver_offline_time, create_time, creator, update_time, updater from driver_info
select id, user_id, phonenumber, license_image, id_card_right, id_card_back, auth_status, reject_info, driver_status, driver_longitude, driver_latitude, driver_position_info, driver_offline_time from driver_info
</sql>
<select id="selectDriverInfoList" parameterType="cn.iocoder.yudao.module.rescue.domain.DriverInfo" resultType="cn.iocoder.yudao.module.rescue.domain.DriverInfo">
@ -49,10 +49,6 @@
<if test="driverLatitude != null">driver_latitude,</if>
<if test="driverPositionInfo != null">driver_position_info,</if>
<if test="driverOfflineTime != null">driver_offline_time,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">creator,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">updater,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
@ -68,10 +64,6 @@
<if test="driverLatitude != null">#{driverLatitude},</if>
<if test="driverPositionInfo != null">#{driverPositionInfo},</if>
<if test="driverOfflineTime != null">#{driverOfflineTime},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
</trim>
</insert>
@ -90,10 +82,7 @@
<if test="driverLatitude != null">driver_latitude = #{driverLatitude},</if>
<if test="driverPositionInfo != null">driver_position_info = #{driverPositionInfo},</if>
<if test="driverOfflineTime != null">driver_offline_time = #{driverOfflineTime},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">creator = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">updater = #{updateBy},</if>
<if test="age != null">age = #{age},</if>
</trim>
where id = #{id}
</update>

View File

@ -20,11 +20,6 @@
<result property="carInsuranceTime" column="car_insurance_time"/>
<result property="carCheckTime" column="car_check_time"/>
<result property="possessorId" column="possessor_id"/>
<result property="deptId" column="dept_id"/>
<result property="creator" column="creator"/>
<result property="createTime" column="create_time"/>
<result property="updater" column="updater"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectRescueCarInfoVo">
@ -98,7 +93,6 @@
<if test="carInsuranceTime != null">car_insurance_time,</if>
<if test="carCheckTime != null">car_check_time,</if>
<if test="possessorId != null">possessor_id,</if>
<if test="deptId != null">dept_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="rescueCarType != null">#{rescueCarType},</if>
@ -115,7 +109,6 @@
<if test="carInsuranceTime != null">#{carInsuranceTime},</if>
<if test="carCheckTime != null">#{carCheckTime},</if>
<if test="possessorId != null">#{possessorId},</if>
<if test="deptId != null">#{deptId},</if>
</trim>
</insert>
@ -136,7 +129,6 @@
<if test="carInsuranceTime != null">car_insurance_time = #{carInsuranceTime},</if>
<if test="carCheckTime != null">car_check_time = #{carCheckTime},</if>
<if test="possessorId != null">possessor_id = #{possessorId},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
</trim>
where id = #{id}
</update>
@ -165,14 +157,10 @@
SELECT *
FROM `rescue_car_info`
where car_insurance_time <![CDATA[<]]> #{warnTime}
and dept_id = #{deptId}
</select>
<select id="warnListNj" resultType="cn.iocoder.yudao.module.rescue.domain.RescueCarInfo">
SELECT *
FROM `rescue_car_info`
where car_check_time <![CDATA[<]]> #{warnTime}
and dept_id = #{deptId}
</select>
</mapper>

View File

@ -10,17 +10,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectRescueCarSpendList" resultType="cn.iocoder.yudao.module.rescue.domain.RescueCarSpend">
<include refid="selectRescueCarSpendVo"/>
<where>
<if test="rescueCarId != null "> and rescue_car_id = #{rescueCarId}</if>
<if test="carNum != null and carNum != ''"> and car_num = #{carNum}</if>
<if test="maintenanceStart != null and maintenanceEnd != null"> and maintenance_time between concat(#{maintenanceStart},' 00:00:00') and concat(#{maintenanceEnd},' 23:59:59') </if>
<if test="maintenanceContent != null and maintenanceContent != ''"> and maintenance_content = #{maintenanceContent}</if>
<if test="maintenanceMoney != null "> and maintenance_money = #{maintenanceMoney}</if>
<if test="insuranceContent != null and insuranceContent != ''"> and insurance_content = #{insuranceContent}</if>
<if test="insuranceBuyStart != null and insuranceBuyEnd !=null "> and insurance_buy_time between concat(#{insuranceBuyStart},' 00:00:00') and concat(#{insuranceBuyEnd},' 23:59:59')</if>
<if test="insuranceMoney != null "> and insurance_money = #{insuranceMoney}</if>
<if test="annualAuditTime != null "> and annual_audit_time between concat(#{annualAuditStart},' 00:00:00') and concat(#{annualAuditEnd},' 23:59:59')</if>
<if test="annualAuditMoney != null "> and annual_audit_money = #{annualAuditMoney}</if>
<if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="map.rescueCarId != null "> and rescue_car_id = #{map.rescueCarId}</if>
<if test="map.carNum != null and map.carNum != ''"> and car_num = #{map.carNum}</if>
<if test="map.maintenanceStart != null and map.maintenanceEnd != null"> and maintenance_time between concat(#{map.maintenanceStart},' 00:00:00') and concat(#{map.maintenanceEnd},' 23:59:59') </if>
<if test="map.maintenanceContent != null and map.maintenanceContent != ''"> and maintenance_content = #{map.maintenanceContent}</if>
<if test="map.maintenanceMoney != null "> and maintenance_money = #{map.maintenanceMoney}</if>
<if test="map.insuranceContent != null and map.insuranceContent != ''"> and insurance_content = #{map.insuranceContent}</if>
<if test="map.insuranceBuyStart != null and map.insuranceBuyEnd !=null "> and insurance_buy_time between concat(#{map.insuranceBuyStart},' 00:00:00') and concat(#{map.insuranceBuyEnd},' 23:59:59')</if>
<if test="map.insuranceMoney != null "> and insurance_money = #{map.insuranceMoney}</if>
<if test="map.annualAuditTime != null "> and annual_audit_time between concat(#{map.annualAuditStart},' 00:00:00') and concat(#{map.annualAuditEnd},' 23:59:59')</if>
<if test="map.annualAuditMoney != null "> and annual_audit_money = #{map.annualAuditMoney}</if>
</where>
order by create_time desc
</select>

View File

@ -10,12 +10,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectRescueDeptDriverList" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueDeptDriver" resultType="cn.iocoder.yudao.module.rescue.domain.RescueDeptDriver">
select * from rescue_dept_driver
select * from rescue_dept_driver where deleted = '0'
<where>
<if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="firstDriverIds != null and firstDriverIds != ''"> and first_driver_ids = #{firstDriverIds}</if>
<if test="secondDriverIds != null and secondDriverIds != ''"> and second_driver_ids = #{secondDriverIds}</if>
<if test="thirdDriverIds != null and thirdDriverIds != ''"> and third_driver_ids = #{thirdDriverIds}</if>
<if test="map.deptId != null "> and dept_id = #{deptId}</if>
<if test="map.firstDriverIds != null and map.firstDriverIds != ''"> and first_driver_ids = #{map.firstDriverIds}</if>
<if test="map.secondDriverIds != null and map.secondDriverIds != ''"> and second_driver_ids = #{map.secondDriverIds}</if>
<if test="map.thirdDriverIds != null and map.thirdDriverIds != ''"> and third_driver_ids = #{map.thirdDriverIds}</if>
</where>
</select>

View File

@ -4,7 +4,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.rescue.mapper.RescueInfoMapper">
<select id="selectRescueInfoList" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueInfo" resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
<select id="selectRescueInfoList" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueInfo"
resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
SELECT
ri.*,roi.order_status,roi.set_money
FROM
@ -12,89 +13,90 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join rescue_order_info roi on roi.rescue_info_id = ri.id
<where>
1=1
<if test="rescueStatus != null ">
<if test="map.rescueStatus != null ">
<choose>
<when test="rescueStatus == '1'.toString()">
<when test="map.rescueStatus == '1'.toString()">
<!-- 救援中 -->
and (ri.rescue_status = '1' or ri.rescue_status = '2' or ri.rescue_status = '3')
</when>
<when test="rescueStatus == '2'.toString()">
<when test="map.rescueStatus == '2'.toString()">
<!--待支付 -->
and roi.order_status ='1'
</when>
<when test="rescueStatus == '3'.toString()">
<when test="map.rescueStatus == '3'.toString()">
<!-- 待取车 -->
and ri.rescue_status ='6'
</when>
<when test="rescueStatus == '4'.toString()">
<when test="map.rescueStatus == '4'.toString()">
<!-- 评价 -->
and roi.order_status ='2'
</when>
<when test="rescueStatus == '5'.toString()">
<when test="map.rescueStatus == '5'.toString()">
<!-- 评价 -->
and roi.order_status ='3'
</when>
<when test="rescueStatus == '8'.toString()">
<when test="map.rescueStatus == '8'.toString()">
<!-- 已还车 -->
and ri.rescue_status ='8'
</when>
<when test="rescueStatus == '9'.toString()">
<when test="map.rescueStatus == '9'.toString()">
<!-- 扣车中未解扣 -->
and (ri.rescue_type ='5' and ri.rescue_status <![CDATA[<]]> '6')
</when>
</choose>
</if>
<if test="licenseNum != null ">
and ri.license_num like concat('%',#{licenseNum},'%')
<if test="map.licenseNum != null ">
and ri.license_num like concat('%',#{map.licenseNum},'%')
</if>
${params.dataScope}
</where>
order by ri.create_time desc
</select>
<select id="selectRescueListSystem2" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueInfo" resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
<select id="selectRescueListSystem2" resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
SELECT
ri.*,roi.order_status,roi.set_money,roi.id as rescueOrderId,roi.pay_money,roi.pay_time
FROM
rescue_info ri
left join rescue_order_info roi on roi.rescue_info_id = ri.id
<where>
<if test="orderStatus != null and orderStatus != ''">
and roi.order_status = #{orderStatus}
where ri.deleted = '0'
<if test="map.orderStatus != null and map.orderStatus != ''">
and roi.order_status = #{map.orderStatus}
</if>
<if test="rescueStatus != null and rescueStatus != ''">
and ri.rescue_status = #{rescueStatus}
<if test="map.rescueStatus != null and map.rescueStatus != ''">
and ri.rescue_status = #{map.rescueStatus}
</if>
<if test="licenseNum != null ">
and ri.license_num like concat('%',#{licenseNum},'%')
<if test="map.licenseNum != null ">
and ri.license_num like concat('%',#{map.licenseNum},'%')
</if>
<if test="connectionName != null ">
and ri.connection_name like concat('%',#{connectionName},'%')
<if test="map.connectionName != null ">
and ri.connection_name like concat('%',#{map.connectionName},'%')
</if>
<if test="driverName != null ">
and ri.driver_name like concat('%',#{driverName},'%')
<if test="map.driverName != null ">
and ri.driver_name like concat('%',#{map.driverName},'%')
</if>
<if test="driverCarNum != null ">
and ri.driver_car_num like concat('%',#{driverCarNum},'%')
<if test="map.driverCarNum != null ">
and ri.driver_car_num like concat('%',#{map.driverCarNum},'%')
</if>
<if test="rescueType != null ">
and ri.rescue_type = #{rescueType}
<if test="map.rescueType != null ">
and ri.rescue_type = #{map.rescueType}
</if>
<if test="feeType != null ">
and ri.fee_type = #{feeType}
<if test="map.feeType != null ">
and ri.fee_type = #{map.feeType}
</if>
<if test="flag != null ">
<if test="map.flag != null ">
and ri.driver_id is not null
</if>
<if test="rescueStart != null and rescueEnd != null"> and rescue_time between concat(#{rescueStart},' 00:00:00') and concat(#{rescueEnd},' 23:59:59') </if>
</where>
<if test="map.rescueStart != null and map.rescueEnd != null">and rescue_time between
concat(#{map.rescueStart},' 00:00:00') and concat(#{map.rescueEnd},' 23:59:59')
</if>
order by ri.create_time desc
</select>
<select id="listData" resultType="com.alibaba.fastjson.JSONObject">
SELECT
sum(set_money/100) as allMoney,count(1) as allNum,sum(case when ri.car_type ='1' then (set_money/100)* ${rescueTcBig}
sum(set_money/100) as allMoney,count(1) as allNum,sum(case when ri.car_type ='1' then (set_money/100)*
${rescueTcBig}
when ri.car_type ='2' then (set_money/100)* ${rescueTcMid}
when ri.car_type ='3' then (set_money/100)* ${rescueTcSmall} else 0 end) as tcAll
FROM
@ -114,55 +116,59 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
${params.dataScope}
</where>
</select>
<select id="selectRescueInfoListApp" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueInfo" resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
<select id="selectRescueInfoListApp" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueInfo"
resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
SELECT
ri.*,roi.order_status,roi.set_money
FROM
rescue_info ri
left join rescue_order_info roi on roi.rescue_info_id = ri.id
<where>
(ri.user_id = #{userId} or connection_phone =#{connectionPhone})
<if test="rescueStatus != null ">
(ri.user_id = #{map.userId} or connection_phone =#{map.connectionPhone})
<if test="map.rescueStatus != null ">
<choose>
<when test="rescueStatus == '1'.toString()">
<when test="map.rescueStatus == '1'.toString()">
<!-- 救援中 -->
and (ri.rescue_status = '1' or ri.rescue_status = '2' or ri.rescue_status = '3')
</when>
<when test="rescueStatus == '2'.toString()">
<when test="map.rescueStatus == '2'.toString()">
<!--待支付 -->
and roi.order_status ='1'
</when>
<when test="rescueStatus == '3'.toString()">
<when test="map.rescueStatus == '3'.toString()">
<!-- 待取车 -->
and ri.rescue_status ='6'
</when>
<when test="rescueStatus == '4'.toString()">
<when test="map.rescueStatus == '4'.toString()">
<!-- 评价 -->
and roi.order_status ='2'
</when>
<when test="rescueStatus == '5'.toString()">
<when test="map.rescueStatus == '5'.toString()">
<!-- 评价 -->
and roi.order_status ='3'
</when>
<when test="rescueStatus == '8'.toString()">
<when test="map.rescueStatus == '8'.toString()">
<!-- 已还车 -->
and ri.rescue_status ='8'
</when>
</choose>
</if>
<if test="licenseNum != null ">
and ri.license_num like concat('%',#{licenseNum},'%')
<if test="map.licenseNum != null ">
and ri.license_num like concat('%',#{map.licenseNum},'%')
</if>
</where>
order by ri.create_time desc
</select>
<select id="getKcList" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueInfo" resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
<select id="getKcList" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueInfo"
resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
select * from rescue_info ri
<where>
dept_id = #{deptId} and rescue_type = '5'
<if test="connectionName != null and connectionName != ''">
and (connection_name like concat('%', #{connectionName}, '%') or connection_phone like concat('%', #{connectionPhone}, '%') or license_num like concat('%',#{licenseNum}, '%'))
and (connection_name like concat('%', #{connectionName}, '%') or connection_phone like concat('%',
#{connectionPhone}, '%') or license_num like concat('%',#{licenseNum}, '%'))
</if>
<if test="rescueStatus != null ">
<choose>
@ -182,40 +188,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="driverList" resultType="cn.iocoder.yudao.module.rescue.domain.DriverInfo">
SELECT
su.user_id AS userId,
su.nick_name AS nickName,
su.phonenumber AS phonenumber,
su.user_age as userAge,
su.id AS userId,
su.nickname AS nickName,
su.mobile AS phonenumber,
su.sex as sex,
su.avatar as avatar,
su.real_name as realName,
di.*
FROM
driver_info di
INNER JOIN sys_user su ON di.user_id = su.user_id
AND su.del_flag = '0'
INNER JOIN system_users su ON di.user_id = su.id
AND su.deleted = '0'
WHERE 1=1
<if test="realName!=null and realName!=''">
and su.real_name like concat('%',#{realName},'%')
<if test="map.nickName !=null and map.nickName !=''">
and su.nickname like concat('%',#{map.nickName},'%')
</if>
<if test="phonenumber!=null and phonenumber!=''">
and su.phonenumber = #{phonenumber}
<if test="map.phonenumber!=null and map.phonenumber!=''">
and su.mobile like concat('%', #{map.phonenumber}, '%')
</if>
<if test="driveStatus!=null and driveStatus!=''">
and di.driver_status = #{driveStatus}
<if test="map.driveStatus!=null and map.driveStatus!=''">
and di.driver_status = #{map.driveStatus}
</if>
<if test="authStatus!=null and authStatus!=''">
and di.auth_status = #{authStatus}
<if test="map.authStatus!=null and map.authStatus!=''">
and di.auth_status = #{map.authStatus}
</if>
<if test="carType!=null and carType!=''">
and di.car_type = #{carType}
<if test="map.carType!=null and map.carType!=''">
and di.car_type = #{map.carType}
</if>
<if test="carLicenseNum!=null and carLicenseNum!=''">
and di.car_license_num like concat('%',#{carLicenseNum},'%')
<if test="map.carLicenseNum!=null and map.carLicenseNum!=''">
and di.car_license_num like concat('%',#{map.carLicenseNum},'%')
</if>
${params.dataScope}
order by di.create_time desc
</select>
<select id="driverListApp" resultType="cn.iocoder.yudao.module.rescue.dto.DriverInfo2Dto">
SELECT
di.*,su.real_name,rci.rescue_car_num
@ -226,96 +230,88 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
inner join rescue_car_info rci on rci.possessor_id = di.id
WHERE di.auth_status='2'
<if test="searchValue!=null and searchValue!=''">
and (su.real_name like concat('%',#{searchValue},'%') or di.phonenumber like concat('%',#{searchValue},'%') or rci.rescue_car_num like concat('%',#{searchValue},'%'))
and (su.real_name like concat('%',#{searchValue},'%') or di.phonenumber like concat('%',#{searchValue},'%')
or rci.rescue_car_num like concat('%',#{searchValue},'%'))
</if>
order by di.create_time desc
</select>
<select id="driverInMap2" resultType="java.util.Map">
SELECT
IFNULL(sum(di.driver_status='1'),0) as kxNum,IFNULL(sum(di.driver_status='2'),0) as ztNum,IFNULL(sum(di.driver_status='3'),0) as mlNum,IFNULL(sum(di.driver_status='4'),0) as lxNum
FROM
driver_info di
SELECT IFNULL(sum(di.driver_status = '1'), 0) as kxNum,
IFNULL(sum(di.driver_status = '2'), 0) as ztNum,
IFNULL(sum(di.driver_status = '3'), 0) as mlNum,
IFNULL(sum(di.driver_status = '4'), 0) as lxNum
FROM driver_info di
INNER JOIN sys_user su ON di.user_id = su.user_id
AND su.del_flag = '0'
LEFT JOIN sys_dept sd ON sd.dept_id = di.dept_id
INNER JOIN rescue_car_info rci ON rci.possessor_id = di.id
WHERE
di.auth_status = '2'
WHERE di.auth_status = '2'
</select>
<update id="dealOverTimeRescue">
UPDATE rescue_info
SET need_system = '1'
WHERE
need_system = '0'
WHERE need_system = '0'
AND driver_id IS NULL
AND TIMESTAMPDIFF(
MINUTE,
rescue_time,
MINUTE, rescue_time,
NOW()) > 5
AND rescue_status = '2'
</update>
<select id="getOverTimeRescue" resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
SELECT
ri.*, MAX(rdi.driver_level) as driverLevel
FROM
rescue_info ri
SELECT ri.*,
MAX(rdi.driver_level) as driverLevel
FROM rescue_info ri
INNER JOIN rescue_driver_info rdi ON ri.id = rdi.rescue_id
WHERE
ri.driver_id IS NULL
WHERE ri.driver_id IS NULL
AND ri.rescue_status = '2'
GROUP BY ri.id
HAVING
TIMESTAMPDIFF(
MINUTE,
MAX(rdi.create_time),
HAVING TIMESTAMPDIFF(
MINUTE, MAX(rdi.create_time),
NOW()) <![CDATA[>]]> 3
</select>
<select id="getRescueStatistics" resultType="java.util.Map">
SELECT
IFNULL(sum(ri.rescue_status = '2' or ri.rescue_status = '3'),0) as jyzNum,
SELECT IFNULL(sum(ri.rescue_status = '2' or ri.rescue_status = '3'), 0) as jyzNum,
IFNULL(sum(roi.order_status = '1'), 0) as dzfNum,
IFNULL(sum(ri.rescue_status = '6'), 0) as dqcNum,
IFNULL(sum(ri.rescue_status <![CDATA[>=]]> '5'), 0) as ywcNum
FROM
rescue_info ri
FROM rescue_info ri
left join rescue_order_info roi on roi.rescue_info_id = ri.id
where ri.user_id = #{userId} or connection_phone =#{connectionPhone}
where ri.user_id = #{userId}
or connection_phone = #{connectionPhone}
</select>
<select id="getRescueStatisticsByAdmin" resultType="java.util.Map">
SELECT
IFNULL(sum(ri.rescue_status = '2' or ri.rescue_status = '3'),0) as jyzNum,
SELECT IFNULL(sum(ri.rescue_status = '2' or ri.rescue_status = '3'), 0) as jyzNum,
IFNULL(sum(roi.order_status = '1'), 0) as dzfNum,
IFNULL(sum(ri.rescue_status = '6'), 0) as dqcNum,
IFNULL(sum(ri.rescue_status <![CDATA[>=]]> '5'), 0) as ywcNum
FROM
rescue_info ri
FROM rescue_info ri
left join rescue_order_info roi on roi.rescue_info_id = ri.id
where 1 = 1
${params.dataScope}
</select>
<delete id="deleteOtherInfo1">
DELETE
FROM
rescue_info_detail
WHERE
rescue_info_id = #{rescueId};
FROM rescue_info_detail
WHERE rescue_info_id = #{rescueId};
</delete>
<delete id="deleteOtherInfo2">
DELETE
FROM
rescue_driver_info
WHERE
rescue_id = #{rescueId};
FROM rescue_driver_info
WHERE rescue_id = #{rescueId};
</delete>
<select id="getDriverCarNum" resultType="com.alibaba.fastjson.JSONObject">
SELECT
count( 1 ) as allNum,ifnull(sum(case when start_scale is null then 0 when end_scale is null then 0 else end_scale - start_scale end ),0) as allDistance
FROM
rescue_info
where driver_id = #{driverId} and driver_car_num = #{carNum} and rescue_time like concat(#{time},'%')
SELECT count(1) as allNum,
ifnull(sum(case
when start_scale is null then 0
when end_scale is null then 0
else end_scale - start_scale end), 0) as allDistance
FROM rescue_info
where driver_id = #{driverId}
and driver_car_num = #{carNum}
and rescue_time like concat(#{time}, '%')
</select>
<select id="getRescueInfoByDriver" resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
SELECT
@ -325,7 +321,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join rescue_order_info roi on roi.rescue_info_id = ri.id
where
driver_id is not null
<if test="rescueStart != null and rescueEnd != null"> and rescue_time between concat(#{rescueStart},' 00:00:00') and concat(#{rescueEnd},' 23:59:59') </if>
<if test="rescueStart != null and rescueEnd != null">and rescue_time between concat(#{rescueStart},' 00:00:00')
and concat(#{rescueEnd},' 23:59:59')
</if>
<if test="licenseNum != null ">
and ri.license_num like concat('%',#{licenseNum},'%')
</if>
@ -335,7 +333,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="flag != null ">
and ri.driver_id is not null
</if>
<if test="rescueStart != null and rescueEnd != null"> and rescue_time between concat(#{rescueStart},' 00:00:00') and concat(#{rescueEnd},' 23:59:59') </if>
<if test="rescueStart != null and rescueEnd != null">and rescue_time between concat(#{rescueStart},' 00:00:00')
and concat(#{rescueEnd},' 23:59:59')
</if>
<if test="driverName != null ">
and ri.driver_name like concat('%',#{driverName},'%')
@ -351,11 +351,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by ri.driver_name desc
</select>
<select id="statisticsInfo" resultType="com.alibaba.fastjson.JSONObject">
SELECT
IFNULL(sum(roi.set_money),0)/100 as money,count(ri.id) as rescueNum,su.real_name as driverName
FROM
driver_info di
LEFT JOIN rescue_info ri on ri.driver_id = di.id and ri.rescue_time <![CDATA[>=]]> #{startTime} and ri.rescue_time <![CDATA[<=]]> #{endTime}
SELECT IFNULL(sum(roi.set_money), 0) / 100 as money,
count(ri.id) as rescueNum,
su.real_name as driverName
FROM driver_info di
LEFT JOIN rescue_info ri on ri.driver_id = di.id and ri.rescue_time <![CDATA[>=]]> #{startTime} and
ri.rescue_time <![CDATA[<=]]> #{endTime}
LEFT JOIN rescue_order_info roi on ri.id = roi.rescue_info_id
INNER JOIN sys_user su on di.user_id = su.user_id
GROUP BY di.id

View File

@ -18,29 +18,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time"/>
</resultMap>
<select id="selectRescueRefuelRecordList" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueRefuelRecord" resultType="cn.iocoder.yudao.module.rescue.domain.RescueRefuelRecord">
<select id="selectRescueRefuelRecordList" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueRefuelRecord"
resultType="cn.iocoder.yudao.module.rescue.domain.RescueRefuelRecord">
SELECT
rrc.*,su.real_name,su.phonenumber,rci.rescue_car_num
rrc.*,su.nickname as real_name,su.mobile as phonenumber,rci.rescue_car_num
FROM
rescue_refuel_record rrc
inner join driver_info di ON rrc.driver_id = di.id
INNER JOIN sys_user su ON su.user_id = di.user_id
INNER JOIN system_users su ON su.id = di.user_id
left join rescue_car_info rci on di.id = rci.possessor_id
<where>
<if test="realName != null "> and su.real_name like concat('%',#{realName},'%')</if>
<if test="rescueCarNum != null "> and rci.rescue_car_num like concat('%',#{rescueCarNum},'%') </if>
</where>
where rrc.deleted = '0'
<if test="map.realName != null ">and su.real_name like concat('%',#{map.realName},'%')</if>
<if test="map.rescueCarNum != null ">and rci.rescue_car_num like concat('%',#{map.rescueCarNum},'%')</if>
order by rrc.record_time desc
</select>
<select id="selectRescueRefuelRecordById" parameterType="java.lang.Long" resultType="cn.iocoder.yudao.module.rescue.domain.RescueRefuelRecord">
select * from rescue_refuel_record
<select id="selectRescueRefuelRecordById" parameterType="java.lang.Long"
resultType="cn.iocoder.yudao.module.rescue.domain.RescueRefuelRecord">
select *
from rescue_refuel_record
where id = #{id}
</select>
<delete id="deleteRescueRefuelRecordById" parameterType="java.lang.Long">
delete from rescue_refuel_record where id = #{id}
delete
from rescue_refuel_record
where id = #{id}
</delete>
<delete id="deleteRescueRefuelRecordByIds" parameterType="java.lang.String">
@ -50,11 +54,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>
<select id="getMonthRescueRefuelRecord" resultType="com.alibaba.fastjson.JSONObject">
SELECT
ifnull(sum(refuel_money),0) as refuelMoney, ifnull(sum(refuel_num),0) as refuelNum
FROM
rescue_refuel_record
where driver_id = #{driverId} and car_id = #{carId} and record_time like CONCAT(#{time},'%')
SELECT ifnull(sum(refuel_money), 0) as refuelMoney,
ifnull(sum(refuel_num), 0) as refuelNum
FROM rescue_refuel_record
where driver_id = #{driverId}
and car_id = #{carId}
and record_time like CONCAT(#{time}, '%')
</select>
<select id="listData" resultType="com.alibaba.fastjson.JSONObject">
SELECT

View File

@ -129,6 +129,7 @@ public class YudaoWebSecurityConfigurerAdapter {
.authorizeRequests()
// 1.1 静态资源可匿名访问
.antMatchers(HttpMethod.GET, "/*.html", "/**/*.html", "/**/*.css", "/**/*.js").permitAll()
.antMatchers(HttpMethod.POST, "/admin-api/rescue/login", "/admin-api/rescue/loginApp").anonymous()
// 1.2 设置 @PermitAll 无需认证
.antMatchers(HttpMethod.GET, permitAllUrls.get(HttpMethod.GET).toArray(new String[0])).permitAll()
.antMatchers(HttpMethod.POST, permitAllUrls.get(HttpMethod.POST).toArray(new String[0])).permitAll()

View File

@ -257,6 +257,8 @@ yudao:
- /admin-api/pay/notify/** # 支付回调通知,不携带租户编号
- /jmreport/* # 积木报表,无法携带租户编号
- /admin-api/mp/open/** # 微信公众号开放平台,微信回调接口,无法携带租户编号
# - /admin-api/rescue/login
- /admin-api/rescue/loginApp
ignore-tables:
- system_tenant
- system_tenant_package