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