修改了对应登录接口,

This commit is contained in:
chendaze 2024-07-22 09:32:45 +08:00
parent 6f9d0aaeb3
commit e511aae84a
7 changed files with 30 additions and 8 deletions

View File

@ -192,6 +192,8 @@ public class CustomerStaffController extends BaseController {
StaffCustomer staffCustomer = new StaffCustomer();
staffCustomer.setIcsCustomerId(icsCustomerStaff.getIcsCustomerId());
staffCustomer.setStaffId(customerStaff.getId());
staffCustomer.setParkId(customer1.getParkId());
staffCustomer.setTenantId(customer1.getTenantId());
List<StaffCustomer> staffCustomers = staffCustomerService.selectStaffCustomerList(staffCustomer);
if (staffCustomers.isEmpty()) {
staffCustomerService.insertStaffCustomer(staffCustomer);

View File

@ -219,6 +219,12 @@ public class IcsCustomerStaffServiceImpl extends ServiceImpl<IcsCustomerStaffMap
staffCustomer.setIcsCustomerId(customerId);
StaffCustomer staffCustomer1 = staffCustomerService.selectStaffIdAndCustomerId(customerId, user.getId());
if (staffCustomer1 == null) {
Customer customer = customerService.selectCustomerById(customerId);
if (customer != null){
staffCustomer.setParkId(customer.getParkId());
staffCustomer.setTenantId(customer.getTenantId());
}
staffCustomerService.insertStaffCustomer(staffCustomer);
}
//根据用户添加对应企业设备

View File

@ -256,7 +256,7 @@ public class ReservationServiceImpl extends ServiceImpl<ReservationMapper, Reser
//查询楼层号
BuildingDetail buildingDetail = buildingDetailService.selectBuildingDetailById(room.getBuildingDetailId());
if (buildingDetail != null) {
roomContent.setBuildingName(buildingDetail.getFloorName() +"F");
roomContent.setBuildingName(buildingDetail.getFloorName());
}
}
reservation1.setRoomContent(roomContent);

View File

@ -219,7 +219,7 @@ public class RoomContentServiceImpl extends ServiceImpl<RoomContentMapper, RoomC
//查询楼层号
BuildingDetail buildingDetail = buildingDetailService.selectBuildingDetailById(room.getBuildingDetailId());
if (buildingDetail != null) {
content.setBuildingName(buildingDetail.getFloorName() +"F");
content.setBuildingName(buildingDetail.getFloorName());
}
}
RoomItemByRoom roomItemByRoom = new RoomItemByRoom();
@ -276,7 +276,7 @@ public class RoomContentServiceImpl extends ServiceImpl<RoomContentMapper, RoomC
//查询楼层号
BuildingDetail buildingDetail = buildingDetailService.selectBuildingDetailById(room.getBuildingDetailId());
if (buildingDetail != null) {
roomContent.setBuildingName(buildingDetail.getFloorName() +"F");
roomContent.setBuildingName(buildingDetail.getFloorName());
}
}

View File

@ -98,6 +98,8 @@ public class WxLoginAPIController extends BaseController {
String jsCode = paramMap.get("jsCode");
String appId = paramMap.get("appId");
String appSecret = paramMap.get("appSecret");
String parkId = paramMap.get("parkId");
// 必填
if (org.apache.commons.lang3.StringUtils.isBlank(jsCode)) {
throw new RuntimeException("请传递jsCode");
@ -113,11 +115,19 @@ public class WxLoginAPIController extends BaseController {
if (staffOpen != null) {
IcsCustomerStaff sysUser = icsCustomerStaffService.selectIcsCustomerStaffById(staffOpen.getStaffId());
if (null != sysUser) {
Long parkId = sysUser.getParkId();
if (parkId != null) {
Park park = parkService.selectParkById(parkId);
Park park = parkService.selectParkById(Long.valueOf(parkId));
sysUser.setParkName(park.getName());
}
log.info("parkId:{}",parkId);
if (parkId != null && parkId.equals("26")){
List<StaffCustomer> staffCustomers = staffCustomerService.selectStaffCustomerByStaffIdAndParkId(sysUser.getId(),parkId);
log.info("用户信息为staffCustomers+++++++++++++++:{}",staffCustomers);
if (CollUtil.isEmpty(staffCustomers)) {
throw new RuntimeException("外部人员注册,请联系管理员");
}
}
User user = new User();
PublishFactory.recordLoginInfo(sysUser.getUsername(), Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"));
BeanUtils.copyBeanProp(user, sysUser);
@ -125,7 +135,6 @@ public class WxLoginAPIController extends BaseController {
ajax.put(Constants.TOKEN, token);
ajax.put("user", sysUser);
ajax.put("openid", openid);
return ajax;
}
ajax.put("openid", openid);
@ -151,6 +160,9 @@ public class WxLoginAPIController extends BaseController {
throw new RuntimeException("请传递code");
}
if (StringUtils.isBlank(openid)) {
if (parkId.equals("26")){
throw new RuntimeException("外部人员注册,请联系管理员");
}
throw new RuntimeException("请传递openid");
}
// 获取微信小程序 AccessToken

View File

@ -217,6 +217,8 @@ public class ApiRoomContentController extends BaseController {
Assert.isFalse(b, "会议室不可用");
IcsCustomerStaff customerStaff = customerStaffService.selectIcsCustomerStaffById(reservation.getUserId());
Assert.isTrue(customerStaff != null, "用户不存在");
reservation.setCreateTime(new Date());
reservation.setCreateBy(customerStaff.getUsername());
boolean save = reservationService.save(reservation);
Assert.isTrue(save, "预约失败");

View File

@ -72,7 +72,7 @@ public class ApiShowroomController extends BaseController {
//查询楼层号
BuildingDetail buildingDetail = buildingDetailService.selectBuildingDetailById(room.getBuildingDetailId());
if (buildingDetail != null) {
showroom.setBuildingName(buildingDetail.getFloorName() +"F");
showroom.setBuildingName(buildingDetail.getFloorName());
}
}
}
@ -96,7 +96,7 @@ public class ApiShowroomController extends BaseController {
//查询楼层号
BuildingDetail buildingDetail = buildingDetailService.selectBuildingDetailById(room.getBuildingDetailId());
if (buildingDetail != null) {
showroom1.setBuildingName(buildingDetail.getFloorName() +"F");
showroom1.setBuildingName(buildingDetail.getFloorName());
}
}
}