三只松鼠 4 роки тому
джерело
коміт
97b798f5f8
2 змінених файлів з 7 додано та 3 видалено
  1. +1
    -1
      src/main/java/com/taauav/app/mapper/InspectAppMapper.xml
  2. +6
    -2
      src/main/java/com/taauav/app/service/impl/DriverServiceImpl.java

+ 1
- 1
src/main/java/com/taauav/app/mapper/InspectAppMapper.xml Переглянути файл

@@ -14,7 +14,7 @@

<!-- 获取巡检记录详情 -->
<select id="getInspectInfo" parameterType="java.lang.Integer" resultType="com.taauav.app.vo.InspectListVo">
SELECT a.id as 'inspectId',a.`status`,i.id as 'inspectDriverId',a.inspect_no as 'inspectNo',a.driver_id AS 'driverId',d.`name` AS 'driverName',d.driver_area AS 'driverArea',a.begin_time AS 'beginTime',a.end_time AS 'endTime',u.realname,(SELECT TIMESTAMPDIFF( MINUTE,a.begin_time,NOW())) AS 'timeUse' FROM tauv_inspect_app AS a
SELECT a.id as 'inspectId',a.`status`,i.id as 'inspectDriverId',a.inspect_no as 'inspectNo',a.driver_id AS 'driverId',d.`name` AS 'driverName',d.driver_area AS 'driverArea',a.begin_time AS 'beginTime',a.end_time AS 'endTime',u.realname,(SELECT TIMESTAMPDIFF( MINUTE,a.begin_time,a.end_time)) AS 'timeUse' FROM tauv_inspect_app AS a
INNER JOIN tauv_inspect_driver AS i ON i.inspect_id=a.id
INNER JOIN tauv_driver AS d ON a.driver_id=d.id
INNER JOIN user_admin AS u ON a.create_user=u.id

+ 6
- 2
src/main/java/com/taauav/app/service/impl/DriverServiceImpl.java Переглянути файл

@@ -7,7 +7,6 @@ import com.taauav.admin.entity.TauvDriver;
import com.taauav.admin.entity.TauvDriverPoint;
import com.taauav.admin.mapper.TauvDriverPointMapper;
import com.taauav.admin.service.ISysCityService;
import com.taauav.admin.service.ITauvDriverPointService;
import com.taauav.app.mapper.DriverMapper;
import com.taauav.app.query.DriverQuery;
import com.taauav.app.service.IDriverService;
@@ -15,6 +14,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.taauav.app.vo.DriverListVo;
import com.taauav.common.bean.Response;
import com.taauav.common.util.ShiroUtils;
import com.taauav.front.entity.UserAdmin;
import com.taauav.front.mapper.UserAdminMapper;
import com.taauav.front.service.IUserAuthGroupService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -48,6 +49,8 @@ public class DriverServiceImpl extends ServiceImpl<DriverMapper, TauvDriver> imp
@Autowired
private TauvDriverPointMapper driverPointMapper;
@Autowired
private UserAdminMapper userAdminMapper;
@Autowired
private Response response;

@Value("${server.IMAGE_URL}")
@@ -62,8 +65,9 @@ public class DriverServiceImpl extends ServiceImpl<DriverMapper, TauvDriver> imp
@Override
public Response getDriverList(DriverQuery query) {

UserAdmin userAdmin = userAdminMapper.selectById(ShiroUtils.getAdminId());
// 数据权限
List<BigInteger> driverAreaList = userAuthGroupService.getDriverAreaList(ShiroUtils.getAdminId());
List<BigInteger> driverAreaList = userAuthGroupService.getDriverListByDataAuth(userAdmin.getDriverArea());
BigInteger[] driverArea = driverAreaList.toArray(new BigInteger[driverAreaList.size()]);

// 查询条件

Завантаження…
Відмінити
Зберегти