Commit 32854f06 authored by 周健威's avatar 周健威

用户信息接口、日价格接口

parent 7bff03d5
......@@ -110,7 +110,7 @@
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>4.5.10</version>
<version>5.4.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
......
......@@ -193,6 +193,6 @@ public class BaseMemberLevel implements Serializable {
public static void main(String[] args) {
BaseUserMemberLevel memberLevel = new BaseUserMemberLevel();
System.out.println(JSONUtil.wrap(memberLevel,false));
//System.out.println(JSONUtil.wrap(memberLevel,false));
}
}
......@@ -4,6 +4,8 @@ import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* 用户详情信息表
*/
......@@ -98,6 +100,8 @@ public class AppUserDTO {
private Boolean isBindQQ;
//用户上线
private Integer parentId;
//用户上线
private List<Integer> businessCompanyIds;
//用户上线身份id
private Integer parentPositionId;
......
......@@ -254,7 +254,7 @@ public class UserBiz extends BaseBiz<UserMapper,User> {
return new ObjectRestResponse<User>().rel(true).data(user);
}
public ObjectRestResponse userinfoByMobilePhone(String mobilePhone){
public ObjectRestResponse<User> userinfoByMobilePhone(String mobilePhone){
User user = selectOne(new User(){{
setMobilePhone(mobilePhone);
setIsDel(SYS_FALSE);
......
......@@ -78,7 +78,8 @@ public class AppUserController extends CommonBaseController{
@Autowired
private AppUserRelationBiz relationBiz;
@Autowired
private UserBiz userBiz;
@GetMapping("page")
public TableResultResponse list(@RequestParam Map<String, Object> params) {
......@@ -179,6 +180,8 @@ public class AppUserController extends CommonBaseController{
AppUserLogin appUserLogin = appUserLoginBiz.selectById(userid);
userDTO.setIsBindWx(StringUtils.isNotEmpty(appUserLogin.getWxOpenid()));
userDTO.setIsBindQQ(StringUtils.isNotEmpty(appUserLogin.getOpenid()));
ObjectRestResponse<User> objectRestResponse = userBiz.userinfoByMobilePhone(appUserLogin.getUsername());
userDTO.setBusinessCompanyIds(null == objectRestResponse.getData()? null : objectRestResponse.getData().getCompanyIds());
return ObjectRestResponse.succ(userDTO);
}
......
......@@ -77,7 +77,7 @@
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>4.5.10</version>
<version>5.4.2</version>
</dependency>
<dependency>
......
......@@ -42,7 +42,7 @@
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>4.5.10</version>
<version>5.4.2</version>
</dependency>
</dependencies>
......
......@@ -2,7 +2,10 @@ package com.xxfc.platform.vehicle.rest;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
import com.github.wxiaoqi.security.admin.entity.BaseUserMember;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
......@@ -13,19 +16,13 @@ import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.vehicle.biz.VehicleBiz;
import com.xxfc.platform.vehicle.biz.VehicleBookRecordBiz;
import com.xxfc.platform.vehicle.biz.VehicleHolidayPriceInfoBiz;
import com.xxfc.platform.vehicle.biz.VehiclePlatCataBiz;
import com.xxfc.platform.vehicle.biz.*;
import com.xxfc.platform.vehicle.common.BaseController;
import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.constant.BookType;
import com.xxfc.platform.vehicle.constant.VehicleBookRecordStatus;
import com.xxfc.platform.vehicle.constant.VehicleMemberType;
import com.xxfc.platform.vehicle.entity.Vehicle;
import com.xxfc.platform.vehicle.entity.VehicleBookRecord;
import com.xxfc.platform.vehicle.entity.VehicleCommonPriceInfo;
import com.xxfc.platform.vehicle.entity.VehicleHolidayPriceInfo;
import com.xxfc.platform.vehicle.entity.*;
import com.xxfc.platform.vehicle.pojo.*;
import com.xxfc.platform.vehicle.pojo.dto.VehicleModelCalendarPriceDTO;
import com.xxfc.platform.vehicle.pojo.vo.UsableVeicleVO;
......@@ -43,6 +40,7 @@ import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
......@@ -76,6 +74,9 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
@Autowired
VehicleBookRecordBiz vehicleBookRecordBiz;
@Autowired
VehicleBookInfoBiz vehicleBookInfoBiz;
@Autowired
VehicleHolidayPriceInfoBiz vehicleHolidayPriceInfoBiz;
......@@ -492,25 +493,62 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
return priceDTOS;
}
// /**获取价格日历**/
// public List getChwCalendarPrice (String vehicleId, String startDate, String endDate, Integer userId, Integer startCompanyId, Integer endCompanyId) {
// //根据时间获取预约记录
// vehicleBookRecordBiz.selectByWeekend(w -> {
// w.andLessThanOrEqualTo(VehicleBookRecord::getBookStartDate,)
// })
//
// return null;
// }
//
// @Data
// public static class CalendarPriceChwDTO {
// private List<String> dateStrs;
// }
//
// @Data
// public static class CalendarPriceChwDTO {
// private String dateStrs;
// private
// }
@GetMapping(value = "/app/unauth/getDayCalendarPrice")
@IgnoreUserToken
public ObjectRestResponse<List<VehicleModelCalendarPriceDTO>> getDayCalendarPrice(DayCalendarDTO dto) {
return ObjectRestResponse.succ(getChwDayCalendarPrice(dto));
}
/**获取价格日历**/
public CalendarPriceChwDTO getChwDayCalendarPrice (DayCalendarDTO dto) {
//根据时间获取预约记录 bookinfo
//转换为月份
String startMonth = StrUtil.subBefore(DateUtil.parseDateTime(dto.startDate).toDateStr(), "-", true);
String endMonth = StrUtil.subBefore(DateUtil.parseDateTime(dto.endDate).toDateStr(), "-", true);
List<VehicleBookInfo> list = vehicleBookInfoBiz.selectByWeekend(w -> {
w
.andEqualTo(VehicleBookInfo::getVehicle, dto.vehicleId)
.andGreaterThanOrEqualTo(VehicleBookInfo::getYearMonth, startMonth)
.andLessThanOrEqualTo(VehicleBookInfo::getYearMonth, endMonth)
;
return w;
});
CalendarPriceChwDTO calendarPriceChwDTO = new CalendarPriceChwDTO(){{
setDateStrs(CollUtil.newArrayList());
}};
list.forEach(info -> {
//月第一天
DateTime firstDay = DateUtil.parseDate(info.getYearMonth()+ "-01");
//月总天数
Integer monthDays = DateUtil.lengthOfMonth(firstDay.month(), firstDay.isLeapYear());
//与运算
String monthStr = NumberUtil.getBinaryStr(info.getBookedDate());
for(int i = 0; i < monthDays; i++) {
if(i > monthStr.length() || StrUtil.equalsCharAt(monthStr, monthStr.length() - i - 1, '1')) {
calendarPriceChwDTO.getDateStrs().add(firstDay.offset(DateField.DAY_OF_MONTH, i).toDateStr());
}
}
});
return calendarPriceChwDTO;
}
@Data
public static class CalendarPriceChwDTO {
private List<String> dateStrs;
}
@Data
public static class DayCalendarDTO {
String vehicleId;
String startDate;
String endDate;
// Integer userId;
// Integer startCompanyId;
// Integer endCompanyId;
}
}
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