Commit 751c5de1 authored by 周健威's avatar 周健威

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

parents 770a6157 53b5616e
...@@ -93,6 +93,12 @@ ...@@ -93,6 +93,12 @@
<artifactId>ace-interface</artifactId> <artifactId>ace-interface</artifactId>
<version>2.0-SNAPSHOT</version> <version>2.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency>
<groupId>com.github.wxiaoqi</groupId>
<artifactId>ace-admin-api</artifactId>
<version>2.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency> <dependency>
<groupId>com.github.wxiaoqi</groupId> <groupId>com.github.wxiaoqi</groupId>
<artifactId>ace-auth-client</artifactId> <artifactId>ace-auth-client</artifactId>
......
...@@ -4,7 +4,6 @@ import com.github.wxiaoqi.security.api.vo.config.HeaderConfig; ...@@ -4,7 +4,6 @@ import com.github.wxiaoqi.security.api.vo.config.HeaderConfig;
import com.github.wxiaoqi.security.auth.client.EnableAceAuthClient; import com.github.wxiaoqi.security.auth.client.EnableAceAuthClient;
import com.github.wxiaoqi.security.gate.utils.DBLog; import com.github.wxiaoqi.security.gate.utils.DBLog;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.SpringCloudApplication; import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.EnableFeignClients;
...@@ -17,7 +16,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients; ...@@ -17,7 +16,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringCloudApplication @SpringCloudApplication
@EnableDiscoveryClient @EnableDiscoveryClient
@EnableAceAuthClient @EnableAceAuthClient
@EnableFeignClients(value = {"com.github.wxiaoqi.security.auth.client.feign","com.github.wxiaoqi.security.gate.feign"},defaultConfiguration = HeaderConfig.class) @EnableFeignClients(value = {"com.github.wxiaoqi.security.auth.client.feign","com.github.wxiaoqi.security.gate.feign","com.github.wxiaoqi.security.admin.feign"},defaultConfiguration = HeaderConfig.class)
public class GatewayServerBootstrap { public class GatewayServerBootstrap {
public static void main(String[] args) { public static void main(String[] args) {
DBLog.getInstance().start(); DBLog.getInstance().start();
......
package com.github.wxiaoqi.security.gate.filter; package com.github.wxiaoqi.security.gate.filter;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
import com.github.wxiaoqi.security.api.vo.authority.PermissionInfo; import com.github.wxiaoqi.security.api.vo.authority.PermissionInfo;
import com.github.wxiaoqi.security.api.vo.log.LogInfo; import com.github.wxiaoqi.security.api.vo.log.LogInfo;
import com.github.wxiaoqi.security.auth.client.config.ServiceAuthConfig; import com.github.wxiaoqi.security.auth.client.config.ServiceAuthConfig;
...@@ -67,6 +70,9 @@ public class AccessGatewayFilter implements GlobalFilter { ...@@ -67,6 +70,9 @@ public class AccessGatewayFilter implements GlobalFilter {
@Lazy @Lazy
private ILogService logService; private ILogService logService;
@Autowired
UserFeign userFeign;
@Value("${gate.ignore.startWith}") @Value("${gate.ignore.startWith}")
private String startWith; private String startWith;
...@@ -314,6 +320,8 @@ public class AccessGatewayFilter implements GlobalFilter { ...@@ -314,6 +320,8 @@ public class AccessGatewayFilter implements GlobalFilter {
private void recordLog(ServerHttpRequest request, Object body) { private void recordLog(ServerHttpRequest request, Object body) {
// 记录要访问的url // 记录要访问的url
if (!getNotLogUri().contains(request.getURI().getRawPath())) { if (!getNotLogUri().contains(request.getURI().getRawPath())) {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
log.info("=================请求uri:" + request.getURI().getRawPath()); log.info("=================请求uri:" + request.getURI().getRawPath());
// 记录访问的方法 // 记录访问的方法
...@@ -325,6 +333,12 @@ public class AccessGatewayFilter implements GlobalFilter { ...@@ -325,6 +333,12 @@ public class AccessGatewayFilter implements GlobalFilter {
builder.append(", header { "); builder.append(", header { ");
for (Map.Entry<String, List<String>> entry : request.getHeaders().entrySet()) { for (Map.Entry<String, List<String>> entry : request.getHeaders().entrySet()) {
builder.append(entry.getKey()).append(":").append(StringUtils.join(entry.getValue(), ",")).append(","); builder.append(entry.getKey()).append(":").append(StringUtils.join(entry.getValue(), ",")).append(",");
if("Authorization".equals(entry.getKey())) {
if(entry.getValue() != null && entry.getValue().size() > 0) {
getAdminUserInfo(entry.getValue().get(0));
}
}
} }
log.info("=================请求头header:" + builder.toString()); log.info("=================请求头header:" + builder.toString());
// 记录参数 // 记录参数
...@@ -343,10 +357,29 @@ public class AccessGatewayFilter implements GlobalFilter { ...@@ -343,10 +357,29 @@ public class AccessGatewayFilter implements GlobalFilter {
log.info("=================请求参数:" + builder.toString()); log.info("=================请求参数:" + builder.toString());
} }
} }
private void getAdminUserInfo(String token) {
if(token !=null) {
UserDTO userDTO = userFeign.userinfoByToken(token).getData();
if(userDTO != null) {
log.info("=================后台用户名:username = {}", userDTO.getUsername());
log.info("=================后台姓名: name = {}", userDTO.getName());
} else {
AppUserDTO appUserDTO = userFeign.userDetailByToken(token).getData();
if(appUserDTO != null) {
log.info("=================APP用户名:userId = {}", appUserDTO.getUserid());
log.info("=================APP姓名: name = {}", appUserDTO.getRealname());
log.info("=================APP手机号: phone = {}", appUserDTO.getUsername());
}
}
}
}
@Value("${logback.ignore-log-path}") @Value("${logback.ignore-log-path}")
String[] path; String[] path;
public List<String> getNotLogUri() { public List<String> getNotLogUri() {
return Arrays.asList(path); return Arrays.asList(path);
} }
} }
...@@ -10,6 +10,7 @@ import com.github.wxiaoqi.security.common.exception.BaseException; ...@@ -10,6 +10,7 @@ import com.github.wxiaoqi.security.common.exception.BaseException;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.beanutils.BeanUtilsBean; import org.apache.commons.beanutils.BeanUtilsBean;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.aop.framework.AopContext; import org.springframework.aop.framework.AopContext;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.task.TaskExecutor; import org.springframework.core.task.TaskExecutor;
...@@ -146,14 +147,14 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper, BaseUserMem ...@@ -146,14 +147,14 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper, BaseUserMem
if (freeDays > 0 && freeDays >= days) { if (freeDays > 0 && freeDays >= days) {
freeDays = freeDays - days; freeDays = freeDays - days;
baseUserMember.setRentFreeDays(freeDays); baseUserMember.setRentFreeDays(freeDays);
} }
Integer payCount = userMemberVo.getPayCount() == null ? 0 : userMemberVo.getPayCount(); Integer payCount = userMemberVo.getPayCount() == null ? 0 : userMemberVo.getPayCount();
/* if (days > 0) { /* if (days > 0) {
payCount = payCount + 1; payCount = payCount + 1;
}*/ }*/
baseUserMember.setPayCount(payCount); baseUserMember.setPayCount(payCount);
getMyBiz().updateSelectiveById(baseUserMember); getMyBiz().updateSelectiveById(baseUserMember);
num = freeDays; num = freeDays;
} else if (type == 2) { } else if (type == 2) {
/*Integer payCount=userMemberVo.getPayCount()==null?0:userMemberVo.getPayCount(); /*Integer payCount=userMemberVo.getPayCount()==null?0:userMemberVo.getPayCount();
payCount=payCount+1; payCount=payCount+1;
...@@ -220,15 +221,14 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper, BaseUserMem ...@@ -220,15 +221,14 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper, BaseUserMem
WeekendSqls.<BaseUserMember>custom() WeekendSqls.<BaseUserMember>custom()
.andEqualTo(BaseUserMember::getUserId, baseUserMemberVO.getUserId()) .andEqualTo(BaseUserMember::getUserId, baseUserMemberVO.getUserId())
).build(); ).build();
List<BaseUserMember> baseUserMembers = mapper.selectByExample(exa); List<BaseUserMember> baseUserMembers = mapper.selectByExample(exa);
BaseUserMember baseUserMember = new BaseUserMember(); BaseUserMember baseUserMember = new BaseUserMember();
BeanUtilsBean.getInstance().copyProperties(baseUserMember, baseUserMemberVO); BeanUtilsBean.getInstance().copyProperties(baseUserMember, baseUserMemberVO);
if (baseUserMembers == null || baseUserMembers.size() == 0) { if (CollectionUtils.isEmpty(baseUserMembers)) {
if (baseUserMemberVO.getMemberLevel() == null || baseUserMember.getValidTime() == null||baseUserMember.getValidTime()<0) {
if (baseUserMemberVO.getMemberLevel() == null || baseUserMember.getValidTime() == null) return; throw new BaseException("设置无效!无会员等级、会员有效期或会员有效期为负数!");
}
baseUserMember.setCrtTime(System.currentTimeMillis()); baseUserMember.setCrtTime(System.currentTimeMillis());
baseUserMember.setIsDel(0); baseUserMember.setIsDel(0);
baseUserMember.setPayCount(0); baseUserMember.setPayCount(0);
...@@ -238,21 +238,13 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper, BaseUserMem ...@@ -238,21 +238,13 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper, BaseUserMem
baseUserMember.setBuyCount(buyCount + 1); baseUserMember.setBuyCount(buyCount + 1);
insertSelective(baseUserMember); insertSelective(baseUserMember);
return; return;
} else if (baseUserMembers.size() == 1) { } else if (baseUserMembers.size() == 1) {
if (baseUserMemberVO.getMemberLevel() == null || baseUserMember.getValidTime() == null) {
baseUserMember.setTotalNumber(0);
baseUserMember.setRentFreeDays(0);
} else {
}
baseUserMember.setUpdTime(System.currentTimeMillis()); baseUserMember.setUpdTime(System.currentTimeMillis());
baseUserMember.setBuyCount(baseUserMembers.get(0).getBuyCount() + 1); baseUserMember.setBuyCount(baseUserMembers.get(0).getBuyCount() + 1);
baseUserMember.setId(baseUserMembers.get(0).getId()); baseUserMember.setId(baseUserMembers.get(0).getId());
mapper.updateByPrimaryKeySelective(baseUserMember); mapper.updateByPrimaryKeySelective(baseUserMember);
} else { } else {
throw new BaseException("Member purchase repeat!"); throw new BaseException("错误!该账号有多条会员信息!");
} }
......
...@@ -32,6 +32,19 @@ public class BaseUserMemberController extends BaseController<BaseUserMemberBiz, ...@@ -32,6 +32,19 @@ public class BaseUserMemberController extends BaseController<BaseUserMemberBiz,
// /**
// * 设置用户会员
// * @param userMemberDTO
// * @return
// */
// @PutMapping("/setUserMember")
// public ObjectRestResponse UpdateUserMember(@RequestBody BaseUserMemberVO baseUserMemberVO)
// throws Exception {
// baseBiz.UpdateUserMember(baseUserMemberVO);
// return ObjectRestResponse.succ();
// }
/** /**
* 设置用户会员 * 设置用户会员
* @param userMemberDTO * @param userMemberDTO
......
...@@ -84,9 +84,12 @@ public class BackStageOrderController extends CommonBaseController implements Us ...@@ -84,9 +84,12 @@ public class BackStageOrderController extends CommonBaseController implements Us
if (userDTO == null) { if (userDTO == null) {
return ObjectRestResponse.succ(new PageDataVO<>()); return ObjectRestResponse.succ(new PageDataVO<>());
} }
List<BranchCompany> branchCompanies = vehicleFeign.companyAll(userDTO.getDataAll(), userDTO.getDataCompany(), userDTO.getDataZone()); if(dto.getType() != 3) {
List<Integer> companyIds = branchCompanies.stream().map(BranchCompany::getId).collect(Collectors.toList()); List<BranchCompany> branchCompanies = vehicleFeign.companyAll(userDTO.getDataAll(), userDTO.getDataCompany(), userDTO.getDataZone());
dto.setCompanyIds(companyIds); List<Integer> companyIds = branchCompanies.stream().map(BranchCompany::getId).collect(Collectors.toList());
dto.setCompanyIds(companyIds);
}
Query query = new Query(dto); Query query = new Query(dto);
PageDataVO pageDataVO = PageDataVO.pageInfo(query, () -> baseOrderBiz.listOrder(query.getSuper())); PageDataVO pageDataVO = PageDataVO.pageInfo(query, () -> baseOrderBiz.listOrder(query.getSuper()));
List<OrderListVo> list = pageDataVO.getData(); List<OrderListVo> list = pageDataVO.getData();
......
...@@ -301,7 +301,10 @@ public class BaseOrderController extends CommonBaseController implements UserRes ...@@ -301,7 +301,10 @@ public class BaseOrderController extends CommonBaseController implements UserRes
Integer page; Integer page;
@ApiModelProperty("每页限制") @ApiModelProperty("每页限制")
Integer limit; Integer limit;
/**
* 会员等级
*/
Integer memberLevel;
List<Integer> companyIds; List<Integer> companyIds;
} }
......
...@@ -115,6 +115,7 @@ ...@@ -115,6 +115,7 @@
from base_order b from base_order b
LEFT JOIN order_rent_vehicle_detail r on r.order_id = b.id LEFT JOIN order_rent_vehicle_detail r on r.order_id = b.id
LEFT JOIN order_tour_detail t on t.order_id = b.id LEFT JOIN order_tour_detail t on t.order_id = b.id
LEFT JOIN order_member_detail m on m.order_id = b.id
<where> <where>
<if test="crtUser != null"> <if test="crtUser != null">
and b.crt_user = #{crtUser} and b.crt_user = #{crtUser}
...@@ -128,7 +129,10 @@ ...@@ -128,7 +129,10 @@
<if test="type != null"> <if test="type != null">
and b.type = #{type} and b.type = #{type}
</if> </if>
<if test="no != null"> <if test="memberLevel != null and memberLevel != ''">
and m.member_level = #{memberLevel}
</if>
<if test="no != null and no != '' ">
and no like CONCAT ("%", #{no}, "%") and no like CONCAT ("%", #{no}, "%")
</if> </if>
<if test="name != null"> <if test="name != null">
...@@ -179,7 +183,7 @@ ...@@ -179,7 +183,7 @@
<if test="status != null and status != -1"> <if test="status != null and status != -1">
and b.status = #{status} and b.status = #{status}
</if> </if>
<if test="no != null"> <if test="no != null and no != ''">
and no like CONCAT ("%", #{no}, "%") and no like CONCAT ("%", #{no}, "%")
</if> </if>
<if test="startTime != null and status == 4"> <if test="startTime != null and status == 4">
......
...@@ -168,4 +168,13 @@ public class VehicleModelVo extends VehicleModel implements Serializable { ...@@ -168,4 +168,13 @@ public class VehicleModelVo extends VehicleModel implements Serializable {
@ApiModelProperty(value = "品牌") @ApiModelProperty(value = "品牌")
private String brandName; private String brandName;
// @Column(name = "status")
// @ApiModelProperty(value = "状态 0--下架;1--上架")
// private String status;
// @Column(name = "cover_pic")
// @ApiModelProperty(value = "封面图")
// private String coverPic;
} }
...@@ -54,7 +54,7 @@ public class VehicleCataBiz extends BaseBiz<VehicleCataMapper, VehicleCata> { ...@@ -54,7 +54,7 @@ public class VehicleCataBiz extends BaseBiz<VehicleCataMapper, VehicleCata> {
} }
public void inserts(ArrayList<com.xxfc.platform.vehicle.entity.VehicleCata> vcs) { public void inserts(ArrayList<VehicleCata> vcs) {
mapper.addCataList(vcs); mapper.addCataList(vcs);
} }
......
...@@ -475,7 +475,7 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl ...@@ -475,7 +475,7 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
* @param isMore * @param isMore
* @return * @return
*/ */
@Transactional @Transactional(rollbackFor = Exception.class)
public ObjectRestResponse setIsore(Integer id, Integer isMore) { public ObjectRestResponse setIsore(Integer id, Integer isMore) {
VehiclePlatCata vehiclePlatCata = new VehiclePlatCata(); VehiclePlatCata vehiclePlatCata = new VehiclePlatCata();
vehiclePlatCata.setId(id); vehiclePlatCata.setId(id);
......
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