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

Merge branch 'master-zjw' into dev

parents 3029ea51 9b4bbabd
......@@ -239,7 +239,7 @@ public class AppPermissionService {
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
public JSONObject register(String username, String password, String headimgurl,
String nickname, String mobilecode, String openId, String unionid, Integer type,String code) {
log.info("register------code====="+code);
log.info("register------code====="+code+"----开始进入方法---time===="+System.currentTimeMillis()/1000L);
String activityCode = null;
// 判断参数和验证码
if (StringUtils.isBlank(username) || StringUtils.isBlank(password) || StringUtils.isBlank(mobilecode)) {
......@@ -247,7 +247,7 @@ public class AppPermissionService {
}
String redisLockKey = RedisKey.CONSTANT_CODE_PREFIX + username + mobilecode;
String mobilecodeRedis = userRedisTemplate.opsForValue().get(redisLockKey) == null ? "" : userRedisTemplate.opsForValue().get(redisLockKey).toString();
log.error("注册接口,获取redis中的验证码:" + mobilecodeRedis);
log.info("注册接口,获取redis中的验证码:" + mobilecodeRedis+"---time===="+System.currentTimeMillis()/1000L);
// 获取到缓存的验证码后要先清空缓存对应键的值
userRedisTemplate.delete(redisLockKey);
if (StringUtils.isBlank(mobilecodeRedis)) {
......@@ -282,7 +282,7 @@ public class AppPermissionService {
appUserLogin.setUpdatetime(now);
appUserLoginBiz.insertSelective(appUserLogin);
Integer userid = appUserLogin.getId();
log.error("注册:新增登陆用户信息: " + userid);
log.info("注册:新增登陆用户信息: " + userid+"---time===="+System.currentTimeMillis()/1000L);
// 新增用户详情
AppUserDetail rsUserDetail = new AppUserDetail();
rsUserDetail.setUserid(userid);
......@@ -292,7 +292,9 @@ public class AppPermissionService {
rsUserDetail.setUpdatetime(now);
rsUserDetail.setIsdel(0);
rsUserDetail.setCrtHost(getIp());
setCreateIPInfo(rsUserDetail);
//setCreateIPInfo(rsUserDetail);
log.info("注册:解析地址后: " + userid+"---time===="+System.currentTimeMillis()/1000L);
//邀请人id关系绑定
Integer parentId=0;
if (StringUtils.isNotBlank(code)){
......@@ -314,21 +316,27 @@ public class AppPermissionService {
//生成邀请码 长度改为8 不然重复率太高
rsUserDetail.setCode(ReferralCodeUtil.encode(userid));
appUserDetailBiz.insertSelective(rsUserDetail);
log.error("注册:新增用户详情: " + userid);
log.info("注册:新增用户详情: " + userid+"---time===="+System.currentTimeMillis()/1000L);
/* //绑定上下线关系
if(parentId!=null&&parentId>0){
relationBiz.bindRelation(userid,parentId,1);
}*/
//临时会员绑定
insertUserMemberByUserIdAndPhone(userid, username);
log.info("注册:临时会员绑定: " + userid+"---time===="+System.currentTimeMillis()/1000L);
//参加新人活动
jionActivity(userid);
log.info("注册:参加新人活动: " + userid+"---time===="+System.currentTimeMillis()/1000L);
//创建钱包
walletBiz.createWalletByUserId(appUserLogin.getId());
log.info("注册:创建钱包: " + userid+"---time===="+System.currentTimeMillis()/1000L);
// 登录结果要做做统一处理
JSONObject data = autoLogin(userid, username, headimgurl, nickname,code,activityCode,1);
log.info("注册:登录结果要做做统一处理: " + userid+"---time===="+System.currentTimeMillis()/1000L);
// 到im注册,获取返回结果
Map<String, Object> map = registerIm(username, appUserLogin.getPassword(), nickname);
log.info("注册:到im注册: " + userid+"---time===="+System.currentTimeMillis()/1000L);
if (map != null) {
Integer imUserId = Integer.parseInt(map.get("userId").toString());
//String access_token=map.get("access_token").toString();
......@@ -345,6 +353,7 @@ public class AppPermissionService {
//data.put("imToken",access_token);
data.put("imUserId", imUserId);
}
log.info("注册:处理im账号: " + userid+"---time===="+System.currentTimeMillis()/1000L);
if (data != null) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("userId", userid);
......@@ -352,6 +361,7 @@ public class AppPermissionService {
log.info("注册成功获取积分:发送消息 exchange = {}, routingKey = {}, json = {}", RabbitConstant.INTEGRAL_TOPIC, RabbitConstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
mqSenderFeign.sendMessage(RabbitConstant.INTEGRAL_TOPIC, RabbitConstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
sendQueue(username, password, headimgurl, nickname, mobilecode, openId, unionid, type, code, activityCode, userid,RegisterQueueDTO.SIGN_NEW);
log.info("注册:发消息队列: " + userid+"---time===="+System.currentTimeMillis()/1000L);
return JsonResultUtil.createSuccessResultWithObj(data);
} else {
return JsonResultUtil.createDefaultFail();
......@@ -535,7 +545,7 @@ public class AppPermissionService {
userDetail.setUpdatetime(now);
userDetail.setIsdel(0);
userDetail.setCrtHost(getIp());
setCreateIPInfo(userDetail);
//setCreateIPInfo(userDetail);
appUserDetailBiz.insertSelective(userDetail);
} /*else {
......@@ -949,7 +959,7 @@ public class AppPermissionService {
//设置来源
rsUserDetail.setChannel(UserSourceEnum.APPLET.getCode());
rsUserDetail.setCrtHost(getIp());
setCreateIPInfo(rsUserDetail);
//setCreateIPInfo(rsUserDetail);
rsUserDetail.setState(1);
appUserDetailBiz.insertSelective(rsUserDetail);
log.error("注册:新增用户详情: " + userid);
......@@ -1083,7 +1093,7 @@ public class AppPermissionService {
public void setCreateIPInfo(AppUserDetail appUserDetail) {
String crtHost = appUserDetail.getCrtHost();
if (log.isDebugEnabled()) {
log.debug("解析的地址:【{}】", crtHost);
log.debug("解析的地址:【{}】", crtHost+"---time==="+System.currentTimeMillis()/1000L);
}
try {
analyticalIPByWebSiteAndIPAddress(IPAddress.BASE_IP_PARSING_URL2, crtHost, appUserDetail);
......@@ -1100,13 +1110,15 @@ public class AppPermissionService {
private void analyticalIPByWebSiteAndIPAddress(String url, String crtHost, AppUserDetail appUserDetail) {
String ipAddress = restTemplate.getForObject(String.format("%s%s", url, crtHost), String.class);
String data = JSONObject.parseObject(ipAddress).getString(IPAddress.BASE_DATA);
JSONObject ipJsonObject = JSONObject.parseObject(data);
String cityName = ipJsonObject.getString(IPAddress.CITY_NAME);
RegionDTO regionDTO = regionFeign.getRegionByCityName(StringUtils.isEmpty(cityName) ? "东莞" : cityName);
if (null != regionDTO) {
appUserDetail.setProvinceCode(Integer.valueOf(String.valueOf(regionDTO.getParentId())));
appUserDetail.setCityCode(Integer.valueOf(String.valueOf(regionDTO.getId())));
log.debug("解析的调用网站后:【{}】", crtHost+"---time==="+System.currentTimeMillis()/1000L);
String data = JSONObject.parseObject(ipAddress).getString(IPAddress.BASE_DATA);
JSONObject ipJsonObject = JSONObject.parseObject(data);
String cityName = ipJsonObject.getString(IPAddress.CITY_NAME);
RegionDTO regionDTO = regionFeign.getRegionByCityName(StringUtils.isEmpty(cityName) ? "东莞" : cityName);
log.debug("解析的调用服务后:【{}】", crtHost+"---time==="+System.currentTimeMillis()/1000L);
if (null != regionDTO) {
appUserDetail.setProvinceCode(Integer.valueOf(String.valueOf(regionDTO.getParentId())));
appUserDetail.setCityCode(Integer.valueOf(String.valueOf(regionDTO.getId())));
}
}
......
......@@ -47,4 +47,10 @@ public class RentVehicleBO extends OrderRentVehicleDetail implements OrderDetail
* 创建用户 -1+后台用户id 后台系统
*/
String crtUser;
/**
* 用途 1 租车
*/
@ApiModelProperty(hidden = true)
Integer useType = 1;
}
......@@ -74,6 +74,7 @@ public class OrderRentVehicleController extends CommonBaseController {
bo.setAppUserDTO(userFeign.userDetailById(dto.getAppUserId()).getData());
bo.setCrtUser("-1"+ BaseContextHandler.getUserID());
bo.setUseType(null);
orderRentVehicleService.createOrder(bo);
return ObjectRestResponse.succ(bo.getOrder());
}
......
......@@ -459,6 +459,8 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
rentVehicleBookDTO.setOrderNo(detail.getOrder().getNo());
rentVehicleBookDTO.setNumberPlate(numberPlate);
rentVehicleBookDTO.setStatus(status);
rentVehicleBookDTO.setUseType(detail.getUseType());
if(null != detail.getAccompanyItems()) {
rentVehicleBookDTO.setSelectedAccItem(detail.getAccompanyItems().parallelStream().collect(Collectors.toMap(OrderAccompanyDTO::getId, OrderAccompanyDTO::getNum)));
}
......
......@@ -211,10 +211,16 @@
and r.end_time between #{startTime} and #{endTime}
</if>
<if test="companyIds != null and companyIds.size > 0">
and r.start_company_id in
and (r.start_company_id in
<foreach collection="companyIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
or
r.end_company_id in
<foreach collection="companyIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
)
</if>
<if test="status == 4">
order by r.start_time
......
......@@ -76,6 +76,7 @@ public class WeixinService {
try {
HttpSession session = request.getSession();
String frontSessionValue1 = (String) session.getAttribute(frontSessionKey);
log.info("---session获取===="+frontSessionValue1+"---sessionId==="+session.getId());
if (StringUtils.isBlank(frontSessionValue1)) {
return null;
}
......
......@@ -8,6 +8,7 @@ import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.UserAgentUtil;
import com.xxfc.platform.universal.biz.WeixinService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -20,6 +21,7 @@ import javax.servlet.http.HttpServletRequest;
@RestController
@RequestMapping("info")
@IgnoreUserToken
@Slf4j
public class UserInfoController {
......@@ -31,11 +33,12 @@ public class UserInfoController {
@RequestMapping(value = "getOpenId", method = RequestMethod.GET) //匹配的是href中的download请求
public ObjectRestResponse sendSms(HttpServletRequest request) throws Exception {
public ObjectRestResponse getOpenId(HttpServletRequest request) throws Exception {
boolean isWx = UserAgentUtil.isWexinBrowser(request);
if (isWx) {
//session里面获取用户信息
String openId=weixinService.getSession(request);
log.info("---进入方法getOpenId----openId===="+openId);
if (StringUtils.isBlank(openId)){
JSONObject json = new JSONObject();
json.put("sendUrl",sendUrl);
......
......@@ -91,6 +91,12 @@ public class RentVehicleBookDTO extends PageParam {
@ApiModelProperty("扩展结束时间")
String endDateExtend;
/**
* 用途 1 租车
*/
@ApiModelProperty(hidden = true)
Integer useType = 1;
public void setBookStartDate(String bookStartDate) {
this.bookStartDate = bookStartDate;
//首次设置
......
......@@ -57,6 +57,12 @@ public class UsableVeicleDTO extends PageParam {
@ApiModelProperty(hidden = true)
Integer withoutRecordWhere = 1;
/**
* 用途 1 租车
*/
@ApiModelProperty(hidden = true)
Integer useType = 1;
public void setStartDateTamp(Long startDateTamp) {
this.startDateTamp = startDateTamp;
this.startDate = DEFAULT_DATE_TIME_FORMATTER.format(LocalDateTime.ofInstant(Instant.ofEpochMilli(startDateTamp), ZoneOffset.ofHours(8)));
......
......@@ -125,6 +125,27 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
return ObjectRestResponse.succ(vehicleBiz.searchUsableModel(dto));
}
/**
* 后台查询可用车辆(车型)
*
* @param dto
* @return
*/
@ApiOperation("可用车辆查询")
@RequestMapping(value = "/rent/back-stage/usable-vehicle", method = RequestMethod.GET)
@IgnoreUserToken
public ObjectRestResponse<PageDataVO<UsableVehicleModelVO>> rentBgUsableVehicle(UsableVeicleDTO dto) throws Exception {
//根据时间 获得 可用车辆
//结合车型
if (StringUtils.isNotBlank(dto.getCatasStr())) {
dto.setCatas(vehiclePlatCataBiz.groupCatasByParent(dto.getCatasStr()));
}
//设置显示是否有车
dto.setYearNo4Where(Boolean.TRUE);
dto.setUseType(null);
return ObjectRestResponse.succ(vehicleBiz.searchUsableModel(dto));
}
/**
* 热门车型
*
......
......@@ -682,6 +682,9 @@
</if>
and v.is_del = 0
and v.status != 3
<if test="useType != null">
and v.use_type = #{useType}
</if>
and v.use_type = 1
and bc.is_del = 0
and bc.is_show = 1
......
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