Commit 6c42ef52 authored by hezhen's avatar hezhen

Merge branch 'master-tiande' into dev-tiande

parents 241b5f48 c8ac0783
...@@ -155,6 +155,17 @@ public class OrderRentVehicleDetail implements Serializable { ...@@ -155,6 +155,17 @@ public class OrderRentVehicleDetail implements Serializable {
@ApiModelProperty(value = "出发公司Id") @ApiModelProperty(value = "出发公司Id")
private Integer startCompanyId; private Integer startCompanyId;
@Column(name = "actual_end_company_id")
@ApiModelProperty(value = "实际结束公司id")
private Integer actualEndCompanyId;
@Column(name = "vehicle_company_id")
@ApiModelProperty(value = "出发公司Id")
private Integer vehicleCompanyId;
/** /**
* 结束公司Id * 结束公司Id
*/ */
...@@ -162,6 +173,29 @@ public class OrderRentVehicleDetail implements Serializable { ...@@ -162,6 +173,29 @@ public class OrderRentVehicleDetail implements Serializable {
@ApiModelProperty(value = "结束公司Id") @ApiModelProperty(value = "结束公司Id")
private Integer endCompanyId; private Integer endCompanyId;
@Column(name = "start_branch_id")
@ApiModelProperty(value = "出发隶属的企业id")
private Integer startBranchId;
@Column(name = "actual_end_branch_id")
@ApiModelProperty(value = "实际结束隶属的企业id")
private Integer actualEndBranchId;
@Column(name = "vehicle_branch_id")
@ApiModelProperty(value = "车辆隶属企业id")
private Integer vehicleBranchId;
/**
* 结束公司Id
*/
@Column(name = "end_branch_id")
@ApiModelProperty(value = "结束隶属的企业id")
private Integer endBranchId;
/** /**
* 车型id * 车型id
*/ */
......
package com.xxfc.platform.order.pojo.bg; package com.xxfc.platform.order.pojo.bg;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
@Data @Data
public class BgOrderListVo { public class BgOrderListVo {
@ApiModelProperty(value = "出发公司Id")
private Integer startCompanyId;
@ApiModelProperty(value = "实际结束公司id")
private Integer actualEndCompanyId;
@ApiModelProperty(value = "出发公司Id")
private Integer vehicleCompanyId;
@ApiModelProperty(value = "结束公司Id")
private Integer endCompanyId;
@ApiModelProperty(value = "出发隶属的企业id")
private Integer startBranchId;
@ApiModelProperty(value = "实际结束隶属的企业id")
private Integer actualEndBranchId;
@ApiModelProperty(value = "车辆隶属企业id")
private Integer vehicleBranchId;
@ApiModelProperty(value = "实际结束公司")
private String actualEndCompanyName;
@ApiModelProperty(value = "车辆公司(门店)")
private String vehicleCompanyName;
@ApiModelProperty(value = "出发隶属的企业")
private String startBranchName;
@ApiModelProperty(value = "结束隶属的企业")
private String endBranchName;
@ApiModelProperty(value = "实际结束隶属的企业")
private String actualEndBranchName;
@ApiModelProperty(value = "车辆隶属企业")
private String vehicleBranchName;
//订单号 //订单号
private Integer orderId; private Integer orderId;
//用户名 //用户名
......
...@@ -36,34 +36,6 @@ public class BackgroundBaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> ...@@ -36,34 +36,6 @@ public class BackgroundBaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder>
} }
public ObjectRestResponse getAllOrderList(BaseOrderController.QueryOrderList dto) { public ObjectRestResponse getAllOrderList(BaseOrderController.QueryOrderList dto) {
//判断token是否存在
UserDTO userDTO = getAdminUserInfo();
if (userDTO == null) {
return ObjectRestResponse.succ(new PageDataVO<>());
}
//获取权限公司列表
List<BranchCompany> branchCompanies = vehicleFeign.companyAll(userDTO.getDataAll(), userDTO.getDataCompany(), userDTO.getDataZone());
List<Integer> companyIds = branchCompanies.stream().map(BranchCompany::getId).collect(Collectors.toList());
//大区搜索
//有当前大区权限才能搜索到数据
if (dto.getZoneId() != null && (userDTO.getDataAll() == 1 || userDTO.getZoneId().equals(dto.getZoneId()) || userDTO.getDataZone().contains(dto.getZoneId()+""))) {
companyIds.clear();
}
//所属公司筛选
if (dto.getStartCompanyId() != null) {
if (companyIds.size() > 0) {
if (companyIds.contains(dto.getStartCompanyId())) {
companyIds.clear();
companyIds.add(dto.getStartCompanyId());
} else {
return ObjectRestResponse.succ(new PageDataVO<>());
}
} else {
companyIds.add(dto.getStartCompanyId());
}
}
dto.setCompanyIds(companyIds);
if (dto.getStartTime() != null) { if (dto.getStartTime() != null) {
if (dto.getEndTime() == null) { if (dto.getEndTime() == null) {
dto.setEndTime(new Date().getTime()); dto.setEndTime(new Date().getTime());
......
...@@ -493,6 +493,7 @@ public class BackStageOrderController extends CommonBaseController implements Us ...@@ -493,6 +493,7 @@ public class BackStageOrderController extends CommonBaseController implements Us
@GetMapping(value = "/baseOrder/getAll") @GetMapping(value = "/baseOrder/getAll")
@ResponseBody @ResponseBody
public ObjectRestResponse getAllOrderList(BaseOrderController.QueryOrderList dto) { public ObjectRestResponse getAllOrderList(BaseOrderController.QueryOrderList dto) {
setPowerData(dto,true);
return backgroundBaseOrderBiz.getAllOrderList(dto); return backgroundBaseOrderBiz.getAllOrderList(dto);
} }
......
...@@ -166,24 +166,23 @@ ...@@ -166,24 +166,23 @@
and b.name like CONCAT ("%", #{name}, "%") and b.name like CONCAT ("%", #{name}, "%")
</if> </if>
<if test="startTime != null"> <if test="startTime != null">
and (r.start_time between #{startTime} and #{endTime} and ( t.start_time between #{startTime} and #{endTime})
or t.start_time between #{startTime} and #{endTime})
</if> </if>
<if test="vehicleIds != null and vehicleIds.size() > 0"> <!--<if test="vehicleIds != null and vehicleIds.size() > 0">
AND r.vehicle_id IN AND r.vehicle_id IN
<foreach collection="vehicleIds" item="vehicleId" open="(" close=")" separator=","> <foreach collection="vehicleIds" item="vehicleId" open="(" close=")" separator=",">
#{vehicleId} #{vehicleId}
</foreach> </foreach>
</if> </if>-->
<if test="startCompanyId != null and startCompanyId > 0 "> <if test="startCompanyId != null and startCompanyId > 0 ">
and (r.start_company_id = #{startCompanyId} or t.start_company_id = #{startCompanyId} and ( t.start_company_id = #{startCompanyId}
or t.company_id = #{startCompanyId}) or t.company_id = #{startCompanyId})
</if> </if>
<if test="corporationId != null and corporationId > 0 "> <if test="corporationId != null and corporationId > 0 ">
and (t.corporation_id = #{corporationId} or t.start_corporation_id = #{corporationId} and (t.corporation_id = #{corporationId} or t.start_corporation_id = #{corporationId}
</if> </if>
<if test="dataCompanyIds != null and dataCompanyIds.size > 0"> <if test="dataCompanyIds != null and dataCompanyIds.size > 0">
and (r.start_company_id in and (t.company_id in
<foreach collection="dataCompanyIds" item="id" open="(" separator="," close=")"> <foreach collection="dataCompanyIds" item="id" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
...@@ -298,7 +297,7 @@ ...@@ -298,7 +297,7 @@
<if test="startTime != null"> <if test="startTime != null">
and startTime between #{startTime} and #{endTime} and startTime between #{startTime} and #{endTime}
</if> </if>
<if test="companyIds != null and companyIds.size > 0"> <!--<if test="companyIds != null and companyIds.size > 0">
and (startCompanyId in and (startCompanyId in
<foreach collection="companyIds" item="id" open="(" separator="," close=")"> <foreach collection="companyIds" item="id" open="(" separator="," close=")">
#{id} #{id}
...@@ -309,6 +308,53 @@ ...@@ -309,6 +308,53 @@
#{id} #{id}
</foreach> </foreach>
) )
</if>-->
<if test="startCompanyId != null and startCompanyId > 0 ">
and (startCompanyId = #{startCompanyId} or endCompanyId = #{startCompanyId}
or actualEndCompanId = #{startCompanyId} or vehicleCompanId = #{startCompanyId} )
</if>
<if test="corporationId != null and corporationId > 0 ">
and (startBranchId = #{corporationId} or endBranchId = #{corporationId}
or actualEndBranchId = #{corporationId} or vehicleBranchId = #{corporationId} )
</if>
<if test="dataCompanyIds != null and dataCompanyIds.size > 0">
and (startCompanyId in
<foreach collection="dataCompanyIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
or endCompanyId in
<foreach collection="dataCompanyIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
or actualEndCompanId in
<foreach collection="dataCompanyIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
or vehicleCompanId in
<foreach collection="dataCompanyIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
)
</if>
<if test="dataCorporationIds != null and dataCorporationIds.size > 0">
and (startBranchId in
<foreach collection="dataCorporationIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
or endBranchId in
<foreach collection="dataCorporationIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
or actualEndBranchId in
<foreach collection="dataCorporationIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
or vehicleBranchId in
<foreach collection="dataCorporationIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
)
</if> </if>
<if test="zoneId != null"> <if test="zoneId != null">
and (startZoneId = #{zoneId} or endZoneId = #{zoneId}) and (startZoneId = #{zoneId} or endZoneId = #{zoneId})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment