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

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

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