救援司机端

This commit is contained in:
xiao-fajia 2024-08-24 17:32:10 +08:00
parent 22209220b8
commit b760db71c9
3 changed files with 16 additions and 20 deletions

View File

@ -68,9 +68,11 @@ public class RescueInfoSystem extends BaseController {
@PostMapping("/update")
public CommonResult update(@RequestBody RescueInfo rescueInfo) {
if (ObjectUtil.isNotEmpty(rescueInfo.getSetMoney())){
RescueOrderInfo orderInfo = infoService.getById(rescueInfo.getRescueOrderId());
orderInfo.setSetMoney(rescueInfo.getSetMoney());
infoService.updateById(orderInfo);
}
rescueInfoService.updateById(rescueInfo);
return CommonResult.ok();
}

View File

@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.iocoder.yudao.module.rescue.mapper.RescueRefuelRecordMapper;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
/**
@ -19,8 +20,7 @@ import java.util.List;
* @date 2023-09-26
*/
@Service
public class RescueRefuelRecordServiceImpl extends ServiceImpl<RescueRefuelRecordMapper, RescueRefuelRecord> implements IRescueRefuelRecordService
{
public class RescueRefuelRecordServiceImpl extends ServiceImpl<RescueRefuelRecordMapper, RescueRefuelRecord> implements IRescueRefuelRecordService {
/**
* 查询加油记录
@ -29,8 +29,7 @@ public class RescueRefuelRecordServiceImpl extends ServiceImpl<RescueRefuelRecor
* @return 加油记录
*/
@Override
public RescueRefuelRecord selectRescueRefuelRecordById(Long id)
{
public RescueRefuelRecord selectRescueRefuelRecordById(Long id) {
return baseMapper.selectRescueRefuelRecordById(id);
}
@ -41,8 +40,7 @@ public class RescueRefuelRecordServiceImpl extends ServiceImpl<RescueRefuelRecor
* @return 加油记录
*/
@Override
public IPage<RescueRefuelRecord> selectRescueRefuelRecordList(RescueRefuelRecord rescueRefuelRecord, Page<RescueRefuelRecord> page)
{
public IPage<RescueRefuelRecord> selectRescueRefuelRecordList(RescueRefuelRecord rescueRefuelRecord, Page<RescueRefuelRecord> page) {
return baseMapper.selectRescueRefuelRecordList(rescueRefuelRecord, page);
}
@ -53,8 +51,7 @@ public class RescueRefuelRecordServiceImpl extends ServiceImpl<RescueRefuelRecor
* @return 结果
*/
@Override
public int insertRescueRefuelRecord(RescueRefuelRecord rescueRefuelRecord)
{
public int insertRescueRefuelRecord(RescueRefuelRecord rescueRefuelRecord) {
return baseMapper.insert(rescueRefuelRecord);
}
@ -65,8 +62,7 @@ public class RescueRefuelRecordServiceImpl extends ServiceImpl<RescueRefuelRecor
* @return 结果
*/
@Override
public int updateRescueRefuelRecord(RescueRefuelRecord rescueRefuelRecord)
{
public int updateRescueRefuelRecord(RescueRefuelRecord rescueRefuelRecord) {
return baseMapper.updateById(rescueRefuelRecord);
}
@ -77,9 +73,8 @@ public class RescueRefuelRecordServiceImpl extends ServiceImpl<RescueRefuelRecor
* @return 结果
*/
@Override
public int deleteRescueRefuelRecordByIds(Long[] ids)
{
return baseMapper.deleteRescueRefuelRecordByIds(ids);
public int deleteRescueRefuelRecordByIds(Long[] ids) {
return baseMapper.deleteByIds(Arrays.asList(ids));
}
/**
@ -89,8 +84,7 @@ public class RescueRefuelRecordServiceImpl extends ServiceImpl<RescueRefuelRecor
* @return 结果
*/
@Override
public int deleteRescueRefuelRecordById(Long id)
{
public int deleteRescueRefuelRecordById(Long id) {
return baseMapper.deleteRescueRefuelRecordById(id);
}
@ -98,7 +92,7 @@ public class RescueRefuelRecordServiceImpl extends ServiceImpl<RescueRefuelRecor
//通过司机主键和时间计算该月的加油总数和行驶总公里数
@Override
public JSONObject getMonthRescueRefuelRecord(Long driverId, String time, Long carId) {
return baseMapper.getMonthRescueRefuelRecord(driverId,time,carId);
return baseMapper.getMonthRescueRefuelRecord(driverId, time, carId);
}

View File

@ -28,7 +28,7 @@
INNER JOIN system_users su ON su.id = di.user_id
left join rescue_car_info rci on di.id = rci.possessor_id
where rrc.deleted = '0'
<if test="map.realName != null ">and su.real_name like concat('%',#{map.realName},'%')</if>
<if test="map.realName != null ">and su.nickname 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>