Commit d8329299 authored by 周健威's avatar 周健威

Merge remote-tracking branch 'origin/base-modify' into base-modify

parents 92029788 5340dbf4
...@@ -46,7 +46,6 @@ public class TokenAop { ...@@ -46,7 +46,6 @@ public class TokenAop {
/** /**
* userFeign.userDetailByToken(""); 获取app用户的信息 * userFeign.userDetailByToken(""); 获取app用户的信息
* userFeign.userinfoByToken(""); 获取后台用户的信息 * userFeign.userinfoByToken(""); 获取后台用户的信息
* Todo 还有token 校验规则 ,是否过期 未加入检验 .......
* @param proceedingJoinPoint * @param proceedingJoinPoint
* @return * @return
*/ */
......
...@@ -161,16 +161,14 @@ public class BaseOrderController extends CommonBaseController implements UserRes ...@@ -161,16 +161,14 @@ public class BaseOrderController extends CommonBaseController implements UserRes
List<Integer> userIds = list.stream().map(OrderListVo::getUserId).distinct().collect(Collectors.toList()); List<Integer> userIds = list.stream().map(OrderListVo::getUserId).distinct().collect(Collectors.toList());
if(userIds != null && userIds.size() >0) { if(userIds != null && userIds.size() >0) {
ObjectRestResponse<List<AppUserVo>> objectRestResponse = userFeign.getByUserIds(userIds); ObjectRestResponse<List<AppUserVo>> objectRestResponse = userFeign.getByUserIds(userIds);
log.info("获取用户信息:objectRestResponse = {}", objectRestResponse.getMessage());
for (OrderListVo orderPageVO : list) { for (OrderListVo orderPageVO : list) {
if (objectRestResponse.getData() != null && objectRestResponse.getData().size() > 0) { if (objectRestResponse.getData() != null && objectRestResponse.getData().size() > 0) {
for (AppUserVo appUserVo : objectRestResponse.getData()) { for (AppUserVo appUserVo : objectRestResponse.getData()) {
if (appUserVo != null && appUserVo.getUserid() == orderPageVO.getUserId()) { if (appUserVo != null) {
orderPageVO.setTelephone(appUserVo.getUsername());
orderPageVO.setUsername(appUserVo.getNickname()); orderPageVO.setUsername(appUserVo.getNickname());
// ObjectRestResponse<AppUser> restResponse = userFeign.get(appUserVo.getUserid());
// if(restResponse.isRel()) {
// orderPageVO.setTelephone( restResponse.getData().getUsername());
// }
} }
} }
} }
......
...@@ -82,16 +82,15 @@ public class OrderPayController extends BaseController<OrderPayBiz,OrderPay> { ...@@ -82,16 +82,15 @@ public class OrderPayController extends BaseController<OrderPayBiz,OrderPay> {
} }
@PostMapping(value = "/app/notify/alipay") @PostMapping(value = "/app/unauth/notify/alipay")
@IgnoreUserToken @IgnoreUserToken
public String alipayNotify(){ public String alipayNotify(){
return baseBiz.alipayNotify(); return baseBiz.alipayNotify();
} }
@GetMapping(value = "/app/generate_payment") @GetMapping(value = "/app/generate_payment")
public Object generatePayment(@RequestParam("orderCode") String orderCode, @RequestParam("description") String description, public Object generatePayment(OrderPayVo orderPayVo) {
@RequestParam("payType") String payType, @RequestParam("amount") Integer amount) { Object resp = baseBiz.generatePayment(orderPayVo);
Object resp = baseBiz.generatePayment(orderCode, description, payType, amount);
return resp; return resp;
} }
......
...@@ -27,4 +27,7 @@ public class VehiclePlanDto extends PageParam { ...@@ -27,4 +27,7 @@ public class VehiclePlanDto extends PageParam {
@ApiModelProperty(value = "停车分公司Id") @ApiModelProperty(value = "停车分公司Id")
private Integer parkBranchCompanyId; private Integer parkBranchCompanyId;
@ApiModelProperty(value = "所属分公司大区")
private Integer zoneId;
} }
package com.xxfc.platform.vehicle.rest; package com.xxfc.platform.vehicle.rest;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import com.ace.cache.annotation.Cache;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONException; import com.alibaba.fastjson.JSONException;
import com.github.wxiaoqi.security.admin.feign.UserFeign; import com.github.wxiaoqi.security.admin.feign.UserFeign;
...@@ -24,11 +23,13 @@ import com.xxfc.platform.vehicle.common.CustomIllegalParamException; ...@@ -24,11 +23,13 @@ import com.xxfc.platform.vehicle.common.CustomIllegalParamException;
import com.xxfc.platform.vehicle.common.RestResponse; import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.constant.ResCode.ResCode; import com.xxfc.platform.vehicle.constant.ResCode.ResCode;
import com.xxfc.platform.vehicle.constant.VehicleBookRecordStatus; import com.xxfc.platform.vehicle.constant.VehicleBookRecordStatus;
import com.xxfc.platform.vehicle.entity.*; import com.xxfc.platform.vehicle.entity.Vehicle;
import com.xxfc.platform.vehicle.entity.VehicleBookInfo;
import com.xxfc.platform.vehicle.entity.VehicleBookRecord;
import com.xxfc.platform.vehicle.entity.VehicleWarningMsg;
import com.xxfc.platform.vehicle.pojo.*; import com.xxfc.platform.vehicle.pojo.*;
import com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto; import com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -39,12 +40,11 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -39,12 +40,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.weekend.WeekendSqls;
import java.util.*; import java.util.ArrayList;
import java.util.regex.Pattern; import java.util.HashSet;
import java.util.stream.Collectors; import java.util.List;
import java.util.Map;
import static com.xxfc.platform.vehicle.constant.VehicleConstant.USER_APP; import static com.xxfc.platform.vehicle.constant.VehicleConstant.USER_APP;
import static com.xxfc.platform.vehicle.constant.VehicleConstant.USER_APP_NAME; import static com.xxfc.platform.vehicle.constant.VehicleConstant.USER_APP_NAME;
...@@ -417,9 +417,10 @@ public class VehicleController extends BaseController<VehicleBiz> { ...@@ -417,9 +417,10 @@ public class VehicleController extends BaseController<VehicleBiz> {
} }
@RequestMapping(value = "/getVehiclePlanList", method = RequestMethod.GET) @RequestMapping(value = "/app/unauth/getVehiclePlanList", method = RequestMethod.GET)
@ApiOperation(value = "获取排车信息") @ApiOperation(value = "获取排车信息")
@IgnoreClientToken @IgnoreClientToken
@IgnoreUserToken
public ObjectRestResponse<Map<String, Object>> getVehiclePlanList(VehiclePlanDto vehiclePlanDto) { public ObjectRestResponse<Map<String, Object>> getVehiclePlanList(VehiclePlanDto vehiclePlanDto) {
//获取统计信息 //获取统计信息
List<VehicleCountVo> vehicleCountVos = baseBiz.countVehicleByParam(vehiclePlanDto); List<VehicleCountVo> vehicleCountVos = baseBiz.countVehicleByParam(vehiclePlanDto);
......
...@@ -425,6 +425,8 @@ ...@@ -425,6 +425,8 @@
<select id="getAllVehicle" parameterType="java.util.Map" resultMap="searchModel"> <select id="getAllVehicle" parameterType="java.util.Map" resultMap="searchModel">
select * select *
from vehicle v1 from vehicle v1
-- 所属分公司
LEFT JOIN branch_company bc2 ON v1.subordinate_branch = bc2.id
<where> <where>
<if test="startTime != null"> <if test="startTime != null">
and v1.create_time between #{startTime} and #{endTime} and v1.create_time between #{startTime} and #{endTime}
...@@ -441,36 +443,46 @@ ...@@ -441,36 +443,46 @@
<if test="parkBranchCompanyId != null"> <if test="parkBranchCompanyId != null">
and v1.park_branch_company_id = #{parkBranchCompanyId} and v1.park_branch_company_id = #{parkBranchCompanyId}
</if> </if>
<if test="zoneId !=null">
and bc2.zone_id = #{zoneId}
</if>
</where> </where>
</select> </select>
<select id="countVehicleByParam" parameterType="com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto" <select id="countVehicleByParam" parameterType="com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto"
resultType="com.xxfc.platform.vehicle.pojo.VehicleCountVo"> resultType="com.xxfc.platform.vehicle.pojo.VehicleCountVo">
SELECT count(*) total , SELECT count(*) total ,
CASE CASE
WHEN travel_status = 1 THEN WHEN v1.status = 1 THEN
'1' '1'
WHEN travel_status = 2 THEN WHEN v1.status = 2 THEN
'2' '2'
WHEN travel_status = 3 THEN WHEN v1.status = 3 THEN
'3' '3'
WHEN travel_status = 4 THEN WHEN v1.status = 4 THEN
'4' '4'
WHEN v1.status = 5 THEN
'5'
ELSE ELSE
'-1' '6'
END travel_status, END travel_status,
CASE CASE
WHEN travel_status = 1 THEN WHEN v1.status = 1 THEN
'出行中' '正常运行'
WHEN travel_status = 2 THEN WHEN v1.status = 2 THEN
'预约中' '维修'
WHEN travel_status = 3 THEN WHEN v1.status = 3 THEN
'空闲中' '报废'
WHEN travel_status = 4 THEN WHEN v1.status = 4 THEN
'保养中' '出车'
WHEN v1.status = 5 THEN
'保养'
ELSE ELSE
'不可用' '不可用'
END detail END detail
from vehicle v1 from vehicle v1
-- 所属分公司
LEFT JOIN branch_company bc1 ON v1.subordinate_branch = bc1.id
<where> <where>
<if test="startTime != null"> <if test="startTime != null">
and v1.create_time between #{startTime} and #{endTime} and v1.create_time between #{startTime} and #{endTime}
...@@ -487,10 +499,15 @@ ...@@ -487,10 +499,15 @@
<if test="parkBranchCompanyId != null"> <if test="parkBranchCompanyId != null">
and v1.park_branch_company_id = #{parkBranchCompanyId} and v1.park_branch_company_id = #{parkBranchCompanyId}
</if> </if>
<if test="zoneId !=null">
and bc1.zone_id = #{zoneId}
</if>
</where> </where>
GROUP BY travel_status GROUP BY v1.status
union all union all
SELECT count(*) total, '0' travel_status, '总数' detail from vehicle v2 SELECT count(*) total, '0' travel_status, '总数' detail from vehicle v2
-- 所属分公司
LEFT JOIN branch_company bc2 ON v2.subordinate_branch = bc2.id
<where> <where>
<if test="startTime != null"> <if test="startTime != null">
and v2.create_time between #{startTime} and #{endTime} and v2.create_time between #{startTime} and #{endTime}
...@@ -507,44 +524,10 @@ ...@@ -507,44 +524,10 @@
<if test="parkBranchCompanyId != null"> <if test="parkBranchCompanyId != null">
and v2.park_branch_company_id = #{parkBranchCompanyId} and v2.park_branch_company_id = #{parkBranchCompanyId}
</if> </if>
</where> <if test="zoneId !=null">
union all and bc2.zone_id = #{zoneId}
SELECT count(*) total,
CASE
WHEN status = 1 THEN
'5'
WHEN status = 2 THEN
'6'
ELSE
'7'
END travel_status,
CASE
WHEN status = 1 THEN
'正常运行'
WHEN status = 2 THEN
'维修'
ELSE
'报废'
END travel_status
FROM vehicle v3
<where>
<if test="startTime != null">
and v3.create_time between #{startTime} and #{endTime}
</if>
<if test="numberPlate != null">
and v3.number_plate = #{numberPlate}
</if>
<if test="status != null">
and v3.status = #{status}
</if>
<if test="subordinateBranch != null">
and v3.subordinate_branch = #{subordinateBranch}
</if>
<if test="parkBranchCompanyId != null">
and v3.park_branch_company_id = #{parkBranchCompanyId}
</if> </if>
</where> </where>
GROUP BY status
</select> </select>
<!-- 查询可用车辆/车型 的公用 from 和 where 部分条件 --> <!-- 查询可用车辆/车型 的公用 from 和 where 部分条件 -->
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
select w.* select w.*
from vehicle_warning_msg w from vehicle_warning_msg w
left join vehicle v on w.vehicle_id = v.id left join vehicle v on w.vehicle_id = v.id
LEFT JOIN branch_company bc2 ON v.subordinate_branch = bc2.id
<where> <where>
<if test="vehicleId != null"> <if test="vehicleId != null">
and w.vehicle_id = #{vehicleId} and w.vehicle_id = #{vehicleId}
...@@ -48,6 +49,9 @@ ...@@ -48,6 +49,9 @@
<if test="parkBranchCompanyId != null"> <if test="parkBranchCompanyId != null">
and v.park_branch_company_id = #{parkBranchCompanyId} and v.park_branch_company_id = #{parkBranchCompanyId}
</if> </if>
<if test="zoneId !=null">
and bc2.zone_id = #{zoneId}
</if>
</where> </where>
</select> </select>
......
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