Commit 77ae591a authored by hezhen's avatar hezhen

Merge branch 'dev' into hz_dev

parents 92448e05 9561bc88
...@@ -103,9 +103,9 @@ public class AppUserManageBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail ...@@ -103,9 +103,9 @@ public class AppUserManageBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail
if (CollectionUtils.isEmpty(appUserManageVos)) { if (CollectionUtils.isEmpty(appUserManageVos)) {
return new PageInfo<AppUserManageVo>(); return new PageInfo<AppUserManageVo>();
} }
Set<Integer> usSet = appUserManageDTO.getCitySet(); // Set<Integer> usSet = appUserManageDTO.getCitySet();
List<AppUserManageVo> results = appUserManageVos.parallelStream().filter(us -> usSet.contains(us.getCityCode())).collect(Collectors.toList()); // List<AppUserManageVo> results = appUserManageVos.parallelStream().filter(us -> usSet.contains(us.getCityCode())).collect(Collectors.toList());
PageInfo<AppUserManageVo> pageInfo = PageInfo.of(results); PageInfo<AppUserManageVo> pageInfo = PageInfo.of(appUserManageVos);
return getAppUserManageVoPageInfo(pageInfo); return getAppUserManageVoPageInfo(pageInfo);
} }
......
...@@ -208,11 +208,12 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper, BaseUserMem ...@@ -208,11 +208,12 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper, BaseUserMem
if (baseUserMemberVO != null) { if (baseUserMemberVO != null) {
return baseUserMemberVO; return baseUserMemberVO;
} }
return new BaseUserMemberVO(); return null;
} }
/** /**
* 设置用户会员 * 设置用户会员
* *
......
...@@ -45,19 +45,20 @@ public class AppUsersManageController extends BaseController<AppUserManageBiz,Ap ...@@ -45,19 +45,20 @@ public class AppUsersManageController extends BaseController<AppUserManageBiz,Ap
@Autowired @Autowired
private VehicleFeign vehicleFeign; private VehicleFeign vehicleFeign;
private Integer ALL_PERMISSIONS=1;
/** /**
* 查询所有 * 查询所有
* @return * @return
*/ */
@PostMapping("/findAll") @PostMapping("/findAll")
public ObjectRestResponse<PageInfo<AppUserManageVo>> findAllByQuery(@RequestBody AppUserManageDTO appUserManageDTO, HttpServletRequest request) throws Exception { public ObjectRestResponse<PageInfo<AppUserManageVo>> findAllByQuery(@RequestBody AppUserManageDTO appUserManageDTO) throws Exception {
String token = userAuthConfig.getToken(request); String token = userAuthConfig.getToken(request);
ObjectRestResponse objectRestResponse = publicController.userinfoByToken(token); ObjectRestResponse objectRestResponse = publicController.userinfoByToken(token);
User user = (User) objectRestResponse.getData(); User user = (User) objectRestResponse.getData();
if (user==null){ if (user==null){
throw new BaseException("User error!"); throw new BaseException("User error!");
} }
if (user.getDataAll()==1) { if (ALL_PERMISSIONS.equals(user.getDataAll())) {
return ObjectRestResponse.succ(baseBiz.findAllByQuery(appUserManageDTO)); return ObjectRestResponse.succ(baseBiz.findAllByQuery(appUserManageDTO));
} }
ObjectRestResponse<Set<Integer>> setObjectRestResponse = vehicleFeign.corporationCity(user.getDataZone(), user.getDataCompany()); ObjectRestResponse<Set<Integer>> setObjectRestResponse = vehicleFeign.corporationCity(user.getDataZone(), user.getDataCompany());
......
...@@ -3,7 +3,6 @@ package com.github.wxiaoqi.security.admin.rest; ...@@ -3,7 +3,6 @@ package com.github.wxiaoqi.security.admin.rest;
import com.github.wxiaoqi.security.admin.biz.BaseUserMemberBiz; import com.github.wxiaoqi.security.admin.biz.BaseUserMemberBiz;
import com.github.wxiaoqi.security.admin.dto.BaseUserMemberVO; import com.github.wxiaoqi.security.admin.dto.BaseUserMemberVO;
import com.github.wxiaoqi.security.admin.dto.UserMemberDTO; import com.github.wxiaoqi.security.admin.dto.UserMemberDTO;
import com.github.wxiaoqi.security.admin.entity.AppUserManage;
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;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO; import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
...@@ -15,7 +14,6 @@ import io.swagger.annotations.ApiOperation; ...@@ -15,7 +14,6 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.lang.reflect.InvocationTargetException;
import java.util.Objects; import java.util.Objects;
/** /**
...@@ -40,7 +38,9 @@ public class BaseUserMemberController extends BaseController<BaseUserMemberBiz, ...@@ -40,7 +38,9 @@ public class BaseUserMemberController extends BaseController<BaseUserMemberBiz,
@ApiOperation(value = "根据用户id获取用户会员信息") @ApiOperation(value = "根据用户id获取用户会员信息")
@GetMapping("/findOne/{userId}") @GetMapping("/findOne/{userId}")
public ObjectRestResponse<BaseUserMemberVO> findOneByUserId(@PathVariable Integer userId)throws Exception{ public ObjectRestResponse<BaseUserMemberVO> findOneByUserId(@PathVariable Integer userId)throws Exception{
return ObjectRestResponse.succ(baseBiz.findOneByUserId(userId)); BaseUserMemberVO oneByUserId = baseBiz.findOneByUserId(userId);
oneByUserId=(oneByUserId==null? new BaseUserMemberVO(): oneByUserId);
return ObjectRestResponse.succ(oneByUserId);
} }
......
...@@ -133,6 +133,12 @@ ...@@ -133,6 +133,12 @@
<if test="source !=null "> <if test="source !=null ">
and d.source = #{source} and d.source = #{source}
</if> </if>
<if test="citySet != null ">
and d.city_code in
<foreach collection="citySet" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</if>
order by l.id ASC order by l.id ASC
</select> </select>
......
...@@ -87,7 +87,10 @@ ...@@ -87,7 +87,10 @@
<artifactId>spring-cloud-starter-openfeign</artifactId> <artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency> </dependency>
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-consul-all</artifactId> </dependency> <dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-consul-all</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
......
...@@ -36,8 +36,14 @@ ...@@ -36,8 +36,14 @@
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId> <artifactId>spring-cloud-config-server</artifactId>
</dependency> </dependency>
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-consul-all</artifactId> </dependency> <dependency>
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-consul-all</artifactId> </dependency> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-consul-all</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.cloud</groupId>-->
<!-- <artifactId>spring-cloud-starter-consul-all</artifactId>-->
<!-- </dependency>-->
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId> <artifactId>spring-cloud-starter-openfeign</artifactId>
......
...@@ -36,7 +36,10 @@ ...@@ -36,7 +36,10 @@
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId> <artifactId>spring-cloud-config-server</artifactId>
</dependency> </dependency>
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-consul-all</artifactId> </dependency> <dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-consul-all</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -5,20 +5,16 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; ...@@ -5,20 +5,16 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController; import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.vo.PageDataVO; import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.tour.biz.TourGoodVerificationBiz; import com.xxfc.platform.tour.biz.TourGoodVerificationBiz;
import com.xxfc.platform.tour.common.TourBaseController;
import com.xxfc.platform.tour.entity.TourGoodVerification; import com.xxfc.platform.tour.entity.TourGoodVerification;
import com.xxfc.platform.tour.vo.TourGoodOrderFindVo; import com.xxfc.platform.tour.vo.TourGoodOrderFindVo;
import com.xxfc.platform.tour.vo.TourGoodOrderVo; import com.xxfc.platform.tour.vo.TourGoodOrderVo;
import com.xxfc.platform.tour.vo.TourVerificationInfoVo;
import com.xxfc.platform.vehicle.feign.VehicleFeign;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@RestController @RestController
@RequestMapping("/tourGood/verfication") @RequestMapping("/tourGood/verfication")
@IgnoreClientToken @IgnoreClientToken
public class TourGoodVerificationController extends TourBaseController<TourGoodVerificationBiz> { public class TourGoodVerificationController extends BaseController<TourGoodVerificationBiz, TourGoodVerification> {
/** /**
......
...@@ -251,16 +251,16 @@ public class CertificationService { ...@@ -251,16 +251,16 @@ public class CertificationService {
} }
idInformation.setExpirationDate(expirationDate); idInformation.setExpirationDate(expirationDate);
CertificationService cs = applicationContext.getBean(this.getClass()); CertificationService cs = applicationContext.getBean(this.getClass());
ObjectRestResponse objRR =cs.addIdInformation(idInformation); return cs.addIdInformation(idInformation);
log.info("----请求admin=========" + objRR); // log.info("----请求admin=========" + objRR);
if (objRR.getRel()) { // if (objRR.getRel()) {
return ObjectRestResponse.succ(objRR.getData()); // return ObjectRestResponse.succ(objRR.getData());
} // }
} }
} }
return ObjectRestResponse.succ(); return ObjectRestResponse.createFailedResult(ResultCode.INCOMPLETE_DATA,"网络异常,请稍后再试");
} }
...@@ -344,7 +344,8 @@ public class CertificationService { ...@@ -344,7 +344,8 @@ public class CertificationService {
// idInformation.setId(idInformation1.getId()); // idInformation.setId(idInformation1.getId());
// idInformation.setUpdTime(new Date()); // idInformation.setUpdTime(new Date());
// idInformationMapper.updateByPrimaryKeySelective(idInformation); // idInformationMapper.updateByPrimaryKeySelective(idInformation);
throw new BaseException("该身份证已存在,不要重复认证!"); log.error("该身份证已存在,不要重复认证");
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE,"该身份证已存在,不要重复认证");
} }
log.info("----addIdInformation---userid==="+idInformation.getUserLoginId()+"----name====" + idInformation.getName()+"---IdNumber==="+idInformation.getIdNumber()); log.info("----addIdInformation---userid==="+idInformation.getUserLoginId()+"----name====" + idInformation.getName()+"---IdNumber==="+idInformation.getIdNumber());
//认证成功后修改用户,用户认证状态 //认证成功后修改用户,用户认证状态
......
...@@ -23,6 +23,7 @@ public enum ResCode { ...@@ -23,6 +23,7 @@ public enum ResCode {
VEHICLE_BOOKED_RECORD_ALREADY_CHANGED(103001,"车辆预定申请已被审批"), VEHICLE_BOOKED_RECORD_ALREADY_CHANGED(103001,"车辆预定申请已被审批"),
VEHICLE_BOOKED_RECORD_STATUS_CHANGED(103002,"车辆预定申请状态已变更"), VEHICLE_BOOKED_RECORD_STATUS_CHANGED(103002,"车辆预定申请状态已变更"),
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED(103003,"请输入仪表盘内当前显示的公里数"), VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED(103003,"请输入仪表盘内当前显示的公里数"),
VEHICLE_BOOKED_RECORD_NOT_EXIST(103004, "预定记录不存在"),
CHECKUSER_AND_PHONE_NOT_NULL(103999, "收车或交车人姓名和电话不能为空"), CHECKUSER_AND_PHONE_NOT_NULL(103999, "收车或交车人姓名和电话不能为空"),
USERNAME_AND_TELE_NOT_NULL(104000, "使用人和电话不能为空"), USERNAME_AND_TELE_NOT_NULL(104000, "使用人和电话不能为空"),
......
...@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.time.Instant; import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneOffset; import java.time.ZoneOffset;
import java.util.List; import java.util.List;
...@@ -94,7 +95,7 @@ public class RentVehicleBookDTO extends PageParam { ...@@ -94,7 +95,7 @@ public class RentVehicleBookDTO extends PageParam {
this.bookStartDate = bookStartDate; this.bookStartDate = bookStartDate;
//首次设置 //首次设置
if(null == this.startDateExtend) { if(null == this.startDateExtend) {
this.startDateExtend = YMR_SLASH_FORMATTER.format(LocalDateTime.parse(bookStartDate, YMR_SLASH_FORMATTER).minusDays(1L)); this.startDateExtend = YMR_SLASH_FORMATTER.format(LocalDate.parse(bookStartDate, YMR_SLASH_FORMATTER).minusDays(1L));
} }
} }
...@@ -102,7 +103,7 @@ public class RentVehicleBookDTO extends PageParam { ...@@ -102,7 +103,7 @@ public class RentVehicleBookDTO extends PageParam {
this.bookEndDate = bookEndDate; this.bookEndDate = bookEndDate;
//首次设置 //首次设置
if(null == this.endDateExtend) { if(null == this.endDateExtend) {
this.endDateExtend = YMR_SLASH_FORMATTER.format(LocalDateTime.parse(bookEndDate, YMR_SLASH_FORMATTER).plusDays(1L)); this.endDateExtend = YMR_SLASH_FORMATTER.format(LocalDate.parse(bookEndDate, YMR_SLASH_FORMATTER).plusDays(1L));
} }
} }
} }
\ No newline at end of file
...@@ -436,6 +436,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR ...@@ -436,6 +436,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
if(yearMonthAndDate.size()>3){//连续的日期最多夸3个月 if(yearMonthAndDate.size()>3){//连续的日期最多夸3个月
throw new BaseException(ResultCode.ONLY_BOOK_TWO_MONTH); throw new BaseException(ResultCode.ONLY_BOOK_TWO_MONTH);
} }
//检验时间是否可以预定
Map<String, Integer> map = vehicleBookHourInfoBiz.getPredictableHours(bookVehicleVo.getBookStartDate(), bookVehicleVo.getBookEndDate(), bookVehicleVo.getNotCheckTimeLegal()); Map<String, Integer> map = vehicleBookHourInfoBiz.getPredictableHours(bookVehicleVo.getBookStartDate(), bookVehicleVo.getBookEndDate(), bookVehicleVo.getNotCheckTimeLegal());
for(Map.Entry<String,List<String>> entry:yearMonthAndDate.entrySet()){ for(Map.Entry<String,List<String>> entry:yearMonthAndDate.entrySet()){
Boolean rsEach = applyVehicle4EmployeePerMonth(bookVehicleVo.getVehicleId(),entry.getValue(),entry.getKey(), map); Boolean rsEach = applyVehicle4EmployeePerMonth(bookVehicleVo.getVehicleId(),entry.getValue(),entry.getKey(), map);
...@@ -458,10 +459,19 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR ...@@ -458,10 +459,19 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
vehicleBookRecordBiz.save(vehicleBookRecord); vehicleBookRecordBiz.save(vehicleBookRecord);
} else { } else {
vehicleBookRecord = vehicleBookRecordBiz.selectById(bookVehicleVo.getVehicleBookRecordId()); vehicleBookRecord = vehicleBookRecordBiz.selectById(bookVehicleVo.getVehicleBookRecordId());
if(vehicleBookRecord == null) {
throw new BaseException(ResCode.VEHICLE_BOOKED_RECORD_NOT_EXIST.getDesc(), ResCode.VEHICLE_BOOKED_RECORD_NOT_EXIST.getCode());
} else {
//先取消预定,然后再修改
bookVehicleVo.setUnbookStartDate(new DateTime(vehicleBookRecord.getBookStartDate()).toString(DATE_TIME_FORMATTER));
bookVehicleVo.setUnbookEndDate(new DateTime(vehicleBookRecord.getBookEndDate()).toString(DATE_TIME_FORMATTER));
unbookVehicle(bookVehicleVo);
vehicleBookRecord.setBookStartDate(startDay.toDate()); vehicleBookRecord.setBookStartDate(startDay.toDate());
vehicleBookRecord.setBookEndDate(endDay.toDate()); vehicleBookRecord.setBookEndDate(endDay.toDate());
vehicleBookRecordBiz.updateSelectiveByIdRe(vehicleBookRecord); vehicleBookRecordBiz.updateSelectiveByIdRe(vehicleBookRecord);
} }
}
// //添加预定时间记录 // //添加预定时间记录
for(Map.Entry<String, Integer> entry : map.entrySet()) { for(Map.Entry<String, Integer> entry : map.entrySet()) {
......
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