Commit 5cfada0d authored by jiaorz's avatar jiaorz

后台订单接口优化

parent 55ce9119
......@@ -46,6 +46,10 @@ public class BackgroundBaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder>
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) {
......@@ -59,10 +63,6 @@ public class BackgroundBaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder>
companyIds.add(dto.getStartCompanyId());
}
}
//有当前大区权限才能搜索到数据
if (dto.getZoneId() != null && (userDTO.getDataAll() == 1 || userDTO.getZoneId().equals(dto.getZoneId()) || userDTO.getDataZone().contains(dto.getZoneId()+""))) {
companyIds.clear();
}
dto.setCompanyIds(companyIds);
if (dto.getStartTime() != null) {
if (dto.getEndTime() == null) {
......
......@@ -290,7 +290,7 @@
and v1.number_plate like CONCAT ("%", #{plateNumber}, "%")
</if>
<if test="vehicleCode != null">
and o1.code = #{vehicleCode}
and v1.code = #{vehicleCode}
</if>
<if test="startTime != null">
and o1.start_time between #{startTime} and #{endTime}
......@@ -308,18 +308,7 @@
)
</if>
<if test="zoneId != null">
and (bc1.zone_id = #{zoneId} or bc1.zone_id = #{zoneId})
</if>
<if test="zoneIds != null and zoneIds.size > 0">
and (o1.start_zone_id in
<foreach collection="zoneIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
<!-- or t.start_zone_id in-->
<!-- <foreach collection="zoneIds" item="id" open="(" separator="," close=")">-->
<!-- #{id}-->
<!-- </foreach>-->
)
and (bc1.zone_id = #{zoneId} or bc2.zone_id = #{zoneId})
</if>
</where>
order by b1.crt_time desc
......
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