修改后台相关权限
parent
40022006d2
commit
9527450844
|
|
@ -33,7 +33,7 @@ public class BizCarController extends BaseController
|
|||
/**
|
||||
* 查询车辆列表(分页)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('biz:car:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('biz:car:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BizCar bizCar,
|
||||
@RequestParam(defaultValue = "1") int pageNum,
|
||||
|
|
@ -51,7 +51,7 @@ public class BizCarController extends BaseController
|
|||
/**
|
||||
* 查询车辆列表(不分页)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('biz:car:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('biz:car:list')")
|
||||
@GetMapping("/list2")
|
||||
public AjaxResult list2(BizCar bizCar)
|
||||
{
|
||||
|
|
@ -117,7 +117,7 @@ public class BizCarController extends BaseController
|
|||
/**
|
||||
* 查询车辆轨迹信息(不分页)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('biz:car:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('biz:car:list')")
|
||||
@GetMapping("/track/list")
|
||||
public AjaxResult trackList(@RequestParam Long carId,
|
||||
@RequestParam String startTime,
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public class BizCustomerController extends BaseController
|
|||
/**
|
||||
* 查询客户列表(分页)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('biz:customer:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('biz:customer:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BizCustomer bizCustomer,
|
||||
@RequestParam(defaultValue = "1") int pageNum,
|
||||
|
|
@ -52,7 +52,7 @@ public class BizCustomerController extends BaseController
|
|||
/**
|
||||
* 查询客户列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('biz:customer:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('biz:customer:list')")
|
||||
@GetMapping("/list2")
|
||||
public AjaxResult list(BizCustomer bizCustomer)
|
||||
{
|
||||
|
|
@ -62,7 +62,7 @@ public class BizCustomerController extends BaseController
|
|||
/**
|
||||
* 导出客户列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('biz:customer:export')")
|
||||
// @PreAuthorize("@ss.hasPermi('biz:customer:export')")
|
||||
@Log(title = "客户", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BizCustomer bizCustomer)
|
||||
|
|
@ -75,7 +75,7 @@ public class BizCustomerController extends BaseController
|
|||
/**
|
||||
* 获取客户详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('biz:customer:query')")
|
||||
// @PreAuthorize("@ss.hasPermi('biz:customer:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public class BizOrderController extends BaseController {
|
|||
/**
|
||||
* 查询订单列表(分页)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('biz:order:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('biz:order:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BizOrder bizOrder,
|
||||
@RequestParam(defaultValue = "1") int pageNum,
|
||||
|
|
@ -59,7 +59,7 @@ public class BizOrderController extends BaseController {
|
|||
/**
|
||||
* 查询订单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('biz:order:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('biz:order:list')")
|
||||
@GetMapping("/list2")
|
||||
public AjaxResult list(BizOrder bizOrder) {
|
||||
return AjaxResult.success(bizOrderService.selectBizOrderList(bizOrder));
|
||||
|
|
@ -97,7 +97,7 @@ public class BizOrderController extends BaseController {
|
|||
}
|
||||
|
||||
@Log(title = "订单管理", businessType = BusinessType.IMPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:user:import')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:import')")
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
|
||||
SysUser user = sysUserService.selectUserById(SecurityUtils.getLoginUser().getUserId());
|
||||
|
|
@ -117,7 +117,7 @@ public class BizOrderController extends BaseController {
|
|||
/**
|
||||
* 导出订单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('biz:order:export')")
|
||||
// @PreAuthorize("@ss.hasPermi('biz:order:export')")
|
||||
@Log(title = "订单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BizOrder bizOrder) {
|
||||
|
|
@ -129,7 +129,7 @@ public class BizOrderController extends BaseController {
|
|||
/**
|
||||
* 获取订单详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('biz:order:query')")
|
||||
// @PreAuthorize("@ss.hasPermi('biz:order:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(bizOrderService.selectBizOrderById(id));
|
||||
|
|
@ -138,7 +138,7 @@ public class BizOrderController extends BaseController {
|
|||
/**
|
||||
* 新增订单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('biz:order:add')")
|
||||
// @PreAuthorize("@ss.hasPermi('biz:order:add')")
|
||||
@Log(title = "订单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BizOrder bizOrder) {
|
||||
|
|
@ -158,7 +158,7 @@ public class BizOrderController extends BaseController {
|
|||
/**
|
||||
* 修改订单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('biz:order:edit')")
|
||||
// @PreAuthorize("@ss.hasPermi('biz:order:edit')")
|
||||
@Log(title = "订单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BizOrder bizOrder) {
|
||||
|
|
@ -168,7 +168,7 @@ public class BizOrderController extends BaseController {
|
|||
/**
|
||||
* 删除订单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('biz:order:remove')")
|
||||
// @PreAuthorize("@ss.hasPermi('biz:order:remove')")
|
||||
@Log(title = "订单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.cpxt.common.utils.DateUtils;
|
||||
import com.cpxt.common.utils.SecurityUtils;
|
||||
import com.cpxt.system.mapper.SysUserMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.cpxt.biz.mapper.BizCarMapper;
|
||||
|
|
|
|||
|
|
@ -11,8 +11,10 @@ import com.cpxt.biz.domain.BizCarModel;
|
|||
import com.cpxt.common.core.domain.entity.SysDept;
|
||||
import com.cpxt.common.core.domain.entity.SysUser;
|
||||
import com.cpxt.common.utils.DateUtils;
|
||||
import com.cpxt.system.domain.SysUserRole;
|
||||
import com.cpxt.system.mapper.SysDeptMapper;
|
||||
import com.cpxt.system.mapper.SysUserMapper;
|
||||
import com.cpxt.system.mapper.SysUserRoleMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.core.parameters.P;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -39,6 +41,9 @@ public class BizCustomerServiceImpl implements IBizCustomerService
|
|||
@Autowired
|
||||
private SysUserMapper sysUserMapper;
|
||||
|
||||
@Autowired
|
||||
private SysUserRoleMapper sysUserRoleMapper;
|
||||
|
||||
/**
|
||||
* 查询客户
|
||||
*
|
||||
|
|
@ -113,6 +118,7 @@ public class BizCustomerServiceImpl implements IBizCustomerService
|
|||
sysDept.setAncestors("0," + parentId);
|
||||
sysDept.setDeptName(bizCustomer.getName());
|
||||
sysDeptMapper.insertDept(sysDept);
|
||||
sysDept.setDeptId(sysDeptMapper.selectDeptIdByDeptName(bizCustomer.getName()));
|
||||
}else {
|
||||
sysDept.setDeptId(aLong);
|
||||
}
|
||||
|
|
@ -122,6 +128,11 @@ public class BizCustomerServiceImpl implements IBizCustomerService
|
|||
SysUser sysUser = new SysUser();
|
||||
setSysUser(bizCustomer,sysUser,sysDept);
|
||||
sysUserMapper.insertUser(sysUser);
|
||||
|
||||
SysUserRole sysUserRole = new SysUserRole();
|
||||
sysUserRole.setUserId(sysUser.getUserId());
|
||||
sysUserRole.setRoleId(101L); // 大客户
|
||||
sysUserRoleMapper.insert(sysUserRole);
|
||||
}
|
||||
return bizCustomerMapper.insert(bizCustomer);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,8 +11,10 @@ import com.cpxt.biz.domain.BizCustomerWarehouse;
|
|||
import com.cpxt.common.core.domain.entity.SysDept;
|
||||
import com.cpxt.common.core.domain.entity.SysUser;
|
||||
import com.cpxt.common.utils.DateUtils;
|
||||
import com.cpxt.system.domain.SysUserRole;
|
||||
import com.cpxt.system.mapper.SysDeptMapper;
|
||||
import com.cpxt.system.mapper.SysUserMapper;
|
||||
import com.cpxt.system.mapper.SysUserRoleMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.cpxt.biz.mapper.BizDriverMapper;
|
||||
|
|
@ -38,6 +40,9 @@ public class BizDriverServiceImpl implements IBizDriverService
|
|||
@Autowired
|
||||
private SysDeptMapper sysDeptMapper;
|
||||
|
||||
@Autowired
|
||||
private SysUserRoleMapper sysUserRoleMapper;
|
||||
|
||||
/**
|
||||
* 查询司机
|
||||
*
|
||||
|
|
@ -103,6 +108,12 @@ public class BizDriverServiceImpl implements IBizDriverService
|
|||
SysUser sysUser = new SysUser();
|
||||
setSysUser(bizDriver,sysUser);
|
||||
sysUserMapper.insertUser(sysUser);
|
||||
|
||||
SysUserRole sysUserRole = new SysUserRole();
|
||||
sysUserRole.setUserId(sysUser.getUserId());
|
||||
sysUserRole.setRoleId(102L); // 司机
|
||||
sysUserRoleMapper.insert(sysUserRole);
|
||||
|
||||
bizDriver.setUserId(sysUser.getUserId());
|
||||
}else {
|
||||
bizDriver.setUserId(user.getUserId());
|
||||
|
|
|
|||
|
|
@ -14,11 +14,13 @@ import com.cpxt.biz.domain.*;
|
|||
import com.cpxt.biz.domain.vo.BizOrderVo;
|
||||
import com.cpxt.biz.domain.vo.BizOrderVoCustomer;
|
||||
import com.cpxt.biz.mapper.*;
|
||||
import com.cpxt.common.core.domain.entity.SysUser;
|
||||
import com.cpxt.common.exception.ServiceException;
|
||||
import com.cpxt.common.utils.Helper;
|
||||
import com.cpxt.common.utils.PositionUtil;
|
||||
import com.cpxt.common.utils.SecurityUtils;
|
||||
import com.cpxt.common.utils.StringUtils;
|
||||
import com.cpxt.system.mapper.SysUserMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
|
@ -67,6 +69,9 @@ public class BizOrderServiceImpl implements IBizOrderService {
|
|||
@Autowired
|
||||
private BizDriverMapper bizDriverMapper;
|
||||
|
||||
@Autowired
|
||||
private SysUserMapper sysUserMapper;
|
||||
|
||||
/**
|
||||
* 查询订单
|
||||
*
|
||||
|
|
@ -119,7 +124,14 @@ public class BizOrderServiceImpl implements IBizOrderService {
|
|||
}
|
||||
|
||||
private LambdaQueryWrapper<BizOrder> buildQueryWrapper(BizOrder bizOrder) {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
SysUser user = sysUserMapper.selectUserById(userId);
|
||||
BizCustomer bizCustomer = bizCustomerMapper.selectByLinkPhone(user.getUserName());
|
||||
|
||||
LambdaQueryWrapper<BizOrder> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (user.getUserType().equals("2") && bizCustomer != null){
|
||||
queryWrapper.eq(BizOrder::getCustomerId,bizCustomer.getId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getOrderSn())) {
|
||||
queryWrapper.like(BizOrder::getOrderSn, bizOrder.getOrderSn());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package com.cpxt.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.cpxt.common.core.domain.entity.SysUser;
|
||||
|
||||
|
|
@ -9,7 +12,8 @@ import com.cpxt.common.core.domain.entity.SysUser;
|
|||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface SysUserMapper
|
||||
@Mapper
|
||||
public interface SysUserMapper extends BaseMapper<SysUser>
|
||||
{
|
||||
/**
|
||||
* 根据条件分页查询用户列表
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package com.cpxt.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.cpxt.system.domain.SysUserRole;
|
||||
|
||||
|
|
@ -9,7 +12,8 @@ import com.cpxt.system.domain.SysUserRole;
|
|||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface SysUserRoleMapper
|
||||
@Mapper
|
||||
public interface SysUserRoleMapper extends BaseMapper<SysUserRole>
|
||||
{
|
||||
/**
|
||||
* 通过用户ID删除用户和角色关联
|
||||
|
|
|
|||
Loading…
Reference in New Issue