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

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

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