Merge remote-tracking branch 'origin/master'

This commit is contained in:
sxu 2024-11-27 17:04:47 +08:00
commit 73463689be
6 changed files with 70 additions and 2 deletions

View File

@ -6,6 +6,7 @@ import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.material.book.domain.BookCarInfoDto; import com.bonus.material.book.domain.BookCarInfoDto;
import com.bonus.material.order.domain.OrderDetailDto; import com.bonus.material.order.domain.OrderDetailDto;
import com.bonus.material.order.domain.OrderInfoDto; import com.bonus.material.order.domain.OrderInfoDto;
import com.bonus.material.order.mapper.OrderMapper;
import com.bonus.material.order.service.OrderService; import com.bonus.material.order.service.OrderService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -27,6 +28,9 @@ public class OrderController extends BaseController {
@Resource @Resource
private OrderService orderService; private OrderService orderService;
@Resource
private OrderMapper orderMapper;
/** /**
* 提交预约车到订单 * 提交预约车到订单
*/ */
@ -42,7 +46,7 @@ public class OrderController extends BaseController {
} }
/** /**
* 提交预约车到订单 * 获取订单详情
*/ */
@ApiOperation(value = "获取订单详情") @ApiOperation(value = "获取订单详情")
@GetMapping("/getOrderDetails") @GetMapping("/getOrderDetails")
@ -50,4 +54,18 @@ public class OrderController extends BaseController {
startPage(); startPage();
return getDataTable(orderService.getOrderDetails(orderInfoDto)); return getDataTable(orderService.getOrderDetails(orderInfoDto));
} }
/**
* 获取单个订单详情
*/
@ApiOperation(value = "获取单个订单详情")
@GetMapping("/getOrderDetailsById")
public AjaxResult getOrderDetailsById(OrderDetailDto dto) {
if (dto.getId() != null) {
OrderInfoDto orderInfoDto = orderService.getOrderDetailsById(dto);
return success(orderInfoDto);
}else {
return error("参数错误");
}
}
} }

View File

@ -72,9 +72,15 @@ public class OrderInfoDto {
@ApiModelProperty(value = "出租方公司名称") @ApiModelProperty(value = "出租方公司名称")
private String czcompanyName; private String czcompanyName;
@ApiModelProperty(value = "出租方联系人")
private String person;
@ApiModelProperty(value = "出租方联系电话") @ApiModelProperty(value = "出租方联系电话")
private String personPhone; private String personPhone;
@ApiModelProperty(value = "承租方联系人")
private String nickName;
@ApiModelProperty(value = "承租方联系电话") @ApiModelProperty(value = "承租方联系电话")
private String phoneNumber; private String phoneNumber;

View File

@ -20,6 +20,7 @@ public interface OrderMapper {
Integer updateDeviceStatus(OrderDetailDto orderDetailDto); Integer updateDeviceStatus(OrderDetailDto orderDetailDto);
List<OrderInfoDto> getOrderDetails(OrderInfoDto orderInfoDto); List<OrderInfoDto> getOrderDetails(OrderInfoDto orderInfoDto);
OrderInfoDto getOrderDetailsById(OrderDetailDto orderInfoDto);
OrderDetailDto selectOrderDetailsById(String id); OrderDetailDto selectOrderDetailsById(String id);

View File

@ -14,4 +14,6 @@ public interface OrderService {
Integer submitOrderInfo(OrderInfoDto orderInfoDto); Integer submitOrderInfo(OrderInfoDto orderInfoDto);
List<OrderInfoDto> getOrderDetails(OrderInfoDto orderInfoDto); List<OrderInfoDto> getOrderDetails(OrderInfoDto orderInfoDto);
OrderInfoDto getOrderDetailsById(OrderDetailDto dto);
} }

View File

@ -75,4 +75,14 @@ public class OrderServiceImpl implements OrderService {
} }
return orderInfoDtos; return orderInfoDtos;
} }
@Override
public OrderInfoDto getOrderDetailsById(OrderDetailDto dto) {
OrderInfoDto orderInfoDto = orderMapper.getOrderDetailsById(dto);
List<OrderDetailDto> list = new ArrayList();
OrderDetailDto orderDetailDto = orderMapper.selectOrderDetailsById(dto.getId().toString());
list.add(orderDetailDto);
orderInfoDto.setDetailsList(list);
return orderInfoDto;
}
} }

View File

@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deviceName != null and deviceName != ''"> <if test="deviceName != null and deviceName != ''">
AND mdi.device_name like concat('%',#{deviceName},'%') AND mdi.device_name like concat('%',#{deviceName},'%')
</if> </if>
<if test="orderStatus != null"> <if test="orderStatus != null and orderStatus != ''">
AND moi.order_status = #{orderStatus} AND moi.order_status = #{orderStatus}
</if> </if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != '' "> <if test="startTime != null and startTime != '' and endTime != null and endTime != '' ">
@ -100,6 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
moi.order_status, moi.order_status,
hh.days, hh.days,
bfi.url, bfi.url,
hh.id,
hh.num, hh.num,
hh.costs, hh.costs,
hh.rent_begin_time, hh.rent_begin_time,
@ -113,4 +114,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE WHERE
hh.id = #{id} hh.id = #{id}
</select> </select>
<select id="getOrderDetailsById" resultType="com.bonus.material.order.domain.OrderInfoDto">
SELECT
moi.code AS code,
moi.order_time,
c.company_name AS czcompanyName,
mdi.person as person,
mdi.person_phone AS personPhone,
su.phonenumber AS phoneNumber,
su.nick_name AS nickName,
moi.address,
dept.companyName
FROM
ma_order_details hh
LEFT JOIN ma_order_info moi ON moi.order_id = hh.order_id
LEFT JOIN ma_dev_info mdi ON hh.ma_id = mdi.ma_id
LEFT JOIN bm_company_info c ON mdi.own_co = c.company_id
LEFT JOIN ma_type mt ON mdi.type_id = mt.type_id
LEFT JOIN sys_user su ON su.user_id = moi.order_user
LEFT JOIN (
SELECT
sd.dept_id AS deptId,
sd1.dept_name AS companyName
FROM
sys_dept sd
JOIN ( SELECT SUBSTRING_INDEX( ancestors, ',', 1 ) AS first_ancestor, dept_id FROM sys_dept ) AS subquery ON sd.dept_id = subquery.dept_id
LEFT JOIN sys_dept sd1 ON sd1.parent_id = subquery.first_ancestor
) dept ON dept.deptId = su.dept_id
WHERE
mt.del_flag = '0' and hh.id = #{id}
</select>
</mapper> </mapper>