修改了对应PC 页面的bug,和新增了多园区的功能

This commit is contained in:
chendaze 2024-04-03 14:28:17 +08:00
parent 812b3ec3a8
commit e5a866ab20
59 changed files with 1001 additions and 150 deletions

View File

@ -10,6 +10,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.wf.jwtp.annotation.RequiresPermissions;
import java.util.List;
/**
* 楼宇管理 提供者
*
@ -27,6 +29,7 @@ public class BuildingController extends BaseController {
private IParkService parkService;
/**
* 查询楼宇管理
*/
@ -44,7 +47,8 @@ public class BuildingController extends BaseController {
public R list(Building building) {
startPage();
building.setDeleteFlag(0);
return result(buildingService.selectBuildingList(building));
List<Building> buildings = buildingService.selectBuildingList(building);
return result(buildings);
}

View File

@ -130,5 +130,6 @@ public class ClueController extends BaseController {
context.putVar("date", "2031-04-15");
context.putVar("clueList", clueList);
new ExcelView("excel/招商线索导出模板.xls", "招商线索导出", context);
}
}

View File

@ -1,6 +1,8 @@
package com.ics.admin.controller;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Maps;
@ -15,6 +17,7 @@ import com.ics.common.constant.Constants;
import com.ics.common.core.controller.BaseController;
import com.ics.common.core.domain.IcsCustomerStaff;
import com.ics.common.core.domain.R;
import com.ics.common.core.text.Convert;
import com.ics.common.utils.ValidatorUtils;
import com.ics.common.utils.http.HttpUtils;
import com.ics.system.domain.User;
@ -24,8 +27,11 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.wf.jwtp.annotation.RequiresPermissions;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
@ -98,10 +104,16 @@ public class CustomerController extends BaseController {
public Customer get(@PathVariable("id") Long id) {
Customer customer = customerService.selectCustomerById(id);
Room room = roomService.selectRoomById(customer.getRoomId());
if (room != null){
customer.setRoomName(room.getName());
}
String roomId = customer.getRoomId();
List<String> roomIds = StrUtil.split(roomId, ',');
List<Long> collect = roomIds.stream().map(item -> Long.valueOf(item)).collect(Collectors.toList());
customer.setRoomIds(collect);
String buildId = customer.getBuildId();
List<String> buildIds = StrUtil.split(buildId, ',');
List<Long> collect1 = buildIds.stream().map(Long::valueOf).collect(Collectors.toList());
customer.setBuildingDetailIds(collect1);
return customer;
}
@ -125,17 +137,9 @@ public class CustomerController extends BaseController {
public R allList(Customer customer) {
List<Customer> customerList = customerService.selectCustomerList(customer);
List<Map> customerMaps = Lists.newArrayList();
for (Customer item : customerList) {
Long roomId = item.getRoomId();
Map<String, Object> customerMap = Maps.newHashMap();
getCustomerMap(customerMap, item);
customerMaps.add(customerMap);
@ -183,16 +187,33 @@ public class CustomerController extends BaseController {
// }
customer.setParkId(1L);
customer.setTenantId(1L);
//房间转成逗号隔开
List<Long> buildingDetailIds = customer.getBuildingDetailIds();
String buildIds = CollUtil.join(buildingDetailIds, ",");
customer.setBuildId(buildIds);
List<Long> roomIds = customer.getRoomIds();
String roomids = CollUtil.join(roomIds, ",");
customer.setRoomId(roomids);
customer.setParkId(customer.getParkId());
customer.setTenantId(customer.getTenantId());
ValidatorUtils.validateEntity(customer);
customer.setCreateBy(getLoginName());
int i = customerService.insertCustomer(customer);
//如果新增成功把房间的状态改为已启用
Room room = roomService.selectRoomById(customer.getRoomId());
room.setStatus(Room.Status.YES);
int i1 = roomService.updateRoom(room);
Assert.isTrue(i1 > 0, "修改房间已租状态失败");
for (Long roomId : roomIds) {
Room room = roomService.selectRoomById(roomId);
room.setStatus(Room.Status.YES);
int i1 = roomService.updateRoom(room);
Assert.isTrue(i1 > 0, "修改房间已租状态失败");
}
return toAjax(i);
}

View File

@ -1,31 +1,53 @@
package com.ics.admin.controller;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Assert;
import com.ics.admin.domain.Customer;
import com.ics.admin.domain.Room;
import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.EasyExcel;
import com.ics.admin.domain.*;
import com.ics.admin.domain.meeting.*;
import com.ics.admin.service.ICustomerService;
import com.ics.admin.service.IIcsCustomerStaffService;
import com.ics.admin.service.IRoomService;
import com.ics.admin.service.meeting.IDetailEquipmentService;
import com.ics.admin.service.meeting.IRoomContentService;
import com.ics.admin.service.meeting.IRoomEquipmentService;
import com.ics.admin.service.meeting.IUserEquipmentService;
import com.ics.admin.listener.ImportPowerWaterFeeListener;
import com.ics.admin.service.*;
import com.ics.admin.service.meeting.*;
import com.ics.admin.utils.ExcelView;
import com.ics.admin.vo.ImportPowerWaterFeeVO;
import com.ics.common.constant.Constants;
import com.ics.common.core.controller.BaseController;
import com.ics.common.core.domain.BaseEntity;
import com.ics.common.core.domain.IcsCustomerStaff;
import com.ics.common.core.domain.R;
import com.ics.common.utils.DateUtils;
import com.ics.common.utils.GuavaCacheUtil;
import com.ics.common.utils.StringUtils;
import com.ics.common.utils.poi.ExcelUtil;
import com.ics.system.domain.User;
import com.ics.system.service.ICurrentUserService;
import com.ics.system.service.IUserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.compress.utils.Lists;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.jxls.common.Context;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.wf.jwtp.annotation.Ignore;
import org.wf.jwtp.annotation.RequiresPermissions;
import org.wf.jwtp.util.SubjectUtil;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* 企业员工 提供者
@ -33,6 +55,7 @@ import java.util.List;
* @author ics
* @date 2024-02-19
*/
@Slf4j
@RestController
@RequestMapping("/admin/staff")
public class CustomerStaffController extends BaseController {
@ -52,6 +75,9 @@ public class CustomerStaffController extends BaseController {
@Autowired
private IRoomService roomService;
@Autowired
private ICurrentUserService currentUserService;
@Autowired
private IRoomEquipmentService roomEquipmentService;
@ -61,6 +87,18 @@ public class CustomerStaffController extends BaseController {
@Autowired
private IUserEquipmentService userEquipmentService;
@Autowired
private IEquipmentService equipmentService;
@Autowired
private IBuildingDetailService buildingDetailService;
/**
* app的密钥值
*/
@Value("${dfs.path}")
private String path;
/**
* 查询企业员工
*/
@ -82,7 +120,7 @@ public class CustomerStaffController extends BaseController {
}
// Integer customerId = getLoginCustomerId();
// icsCustomerStaff.setIcsCustomerId(customerId.longValue());
// icsCustomerStaff.setDataType(Constants.CUSTOMER_STAFF);
icsCustomerStaff.setDataType(Constants.CUSTOMER_VISIT);
return result(icsCustomerStaffService.selectIcsCustomerStaffList(icsCustomerStaff));
}
@ -110,9 +148,9 @@ public class CustomerStaffController extends BaseController {
icsCustomerStaff.setIcsCustomerId(Long.valueOf(customerId));
}
List<IcsCustomerStaff> staffListByUser = icsCustomerStaffService.getStaffListByUser(icsCustomerStaff);
if (icsCustomerStaff.getStaffId() != null){
if (icsCustomerStaff.getStaffId() != null) {
IcsCustomerStaff customerStaff = icsCustomerStaffService.selectIcsCustomerStaffById(icsCustomerStaff.getStaffId());
if (null != customerStaff){
if (null != customerStaff) {
staffListByUser.add(customerStaff);
}
}
@ -121,7 +159,6 @@ public class CustomerStaffController extends BaseController {
}
/**
* 新增保存企业员工
*/
@ -143,13 +180,14 @@ public class CustomerStaffController extends BaseController {
@PostMapping("update")
public R editSave(@RequestBody IcsCustomerStaff icsCustomerStaff) {
icsCustomerStaff.setDataType(Constants.CUSTOMER_STAFF);
icsCustomerStaff.setUpdateTime(new Date());
return toAjax(icsCustomerStaffService.updateIcsCustomerStaff(icsCustomerStaff));
}
/**
* 新增企业员工
*
* @param icsCustomerStaff
* @return
*/
@ -165,8 +203,13 @@ public class CustomerStaffController extends BaseController {
//根据企业id 查询对应的房间
Customer customer = customerService.selectCustomerById(Long.valueOf(icsCustomerStaff.getCustomerId()));
if (customer !=null ){
Room room = roomService.selectRoomById(customer.getRoomId());
if (customer != null) {
String roomId = customer.getRoomId();
List<String> roomIds = StrUtil.split(roomId, ',');
List<Long> collect = roomIds.stream().map(Long::valueOf).collect(Collectors.toList());
for (Long roomid : collect) {
Room room = roomService.selectRoomById(roomid);
if (null != room) {
Long id = room.getId();
RoomEquipment roomEquipment = roomEquipmentService.selectByRoomId(id);
@ -181,19 +224,19 @@ public class CustomerStaffController extends BaseController {
}
}
}
if (CollUtil.isNotEmpty(ids)) {
for (Long id : ids) {
// UserEquipment equipment = userEquipmentService.selectUserAndEquipment(Long.valueOf(icsCustomerStaff.getMobile()), id);
// if (null == equipment) {
UserEquipment userEquipment = new UserEquipment();
userEquipment.setEquipmentId(id);
userEquipment.setUserId(Long.valueOf(icsCustomerStaff.getMobile()));
userEquipment.setStartTime(customer.getStartDate());
userEquipment.setEndDate(customer.getEndDate());
userEquipmentService.insertUserEquipment(userEquipment);
// }
}
}
if (CollUtil.isNotEmpty(ids)) {
for (Long id : ids) {
UserEquipment userEquipment = new UserEquipment();
userEquipment.setEquipmentId(id);
userEquipment.setUserId(Long.valueOf(icsCustomerStaff.getMobile()));
userEquipment.setStartTime(customer.getStartDate());
userEquipment.setEndDate(customer.getEndDate());
userEquipmentService.insertUserEquipment(userEquipment);
}
}
}
customerStaff.setUpdateTime(new Date());
@ -202,6 +245,7 @@ public class CustomerStaffController extends BaseController {
/**
* 删除企业员工
*
* @param icsCustomerStaff
* @return
*/
@ -214,12 +258,6 @@ public class CustomerStaffController extends BaseController {
return toAjax(icsCustomerStaffService.updateByCustomer(customerStaff));
}
/**
* 删除企业员工
*/
@ -230,6 +268,179 @@ public class CustomerStaffController extends BaseController {
}
@Ignore
@GetMapping("selectCustomerStaffList")
public R selectCustomerStaffList(IcsCustomerStaff icsCustomerStaff) {
startPage();
String customerId = icsCustomerStaff.getCustomerId();
if (customerId != null && !"".equals(customerId)) {
icsCustomerStaff.setIcsCustomerId(Long.valueOf(customerId));
}
List<IcsCustomerStaff> icsCustomerStaffs = icsCustomerStaffService.selectCustomerStaffList(icsCustomerStaff);
for (IcsCustomerStaff customerStaff : icsCustomerStaffs) {
//获取设备数量
UserEquipment userEquipment = new UserEquipment();
userEquipment.setUserId(customerStaff.getId());
List<UserEquipment> equipments = userEquipmentService.selectUserEquipmentList(userEquipment);
customerStaff.setNum(equipments.size());
}
return result(icsCustomerStaffs);
}
// @RequiresPermissions("admin:staff:import")
@Ignore
@PostMapping("/importData")
public R importData(MultipartFile file) throws Exception {
// }
ExcelUtil<IcsCustomerStaff> util = new ExcelUtil<IcsCustomerStaff>(IcsCustomerStaff.class);
List<IcsCustomerStaff> userList = util.importExcel(file.getInputStream());
for (IcsCustomerStaff customerStaff : userList) {
long currentUserId = getCurrentUserId();
User user = userService.selectUserById(currentUserId);
if (user != null) {
customerStaff.setIcsCustomerId(user.getCustomerId());
}
}
String message = icsCustomerStaffService.importCustomerStaff(userList);
return R.data(message);
}
@Ignore
@PostMapping("/exportTemplate")
public void exportTemplate(HttpServletResponse response) throws IOException {
List<IcsCustomerStaff> icsCustomerStaffs = icsCustomerStaffService.selectIcsCustomerStaffList(new IcsCustomerStaff());
ExcelUtil<IcsCustomerStaff> util = new ExcelUtil<IcsCustomerStaff>(IcsCustomerStaff.class);
util.exportExcel(icsCustomerStaffs, "客户员工表");
}
//授权用户设备权限查询出所有的设备
@RequiresPermissions("meeting:roomContent:list")
@PostMapping("/selectUserDeviceList")
public R selectUserDeviceList() {
//根据园区 角色 查询所有的设备信息
boolean isAdmin = SubjectUtil.hasRole(getRequest(), "manager");
if (isAdmin) {
Long parkId = currentUserService.getParkId();
Long tenantId = currentUserService.getTenantId();
Equipment equipment1 = new Equipment();
equipment1.setParkId(parkId);
equipment1.setTenantId(tenantId);
//根据园区id 查询所有的设备信息
List<Equipment> equipment = equipmentService.selectEquipmentList(equipment1);
List<Equipment> equipment2 = selectEquipmentListByIds(equipment);
return R.data(equipment2);
}
boolean b = SubjectUtil.hasRole(getRequest(), "admin");
if (b) {
User user = userService.selectUserById(getCurrentUserId());
if (null != user.getCustomerId()) {
ArrayList<Long> ids = new ArrayList<>();
Customer customer = customerService.selectCustomerById(user.getCustomerId());
//根据企业 查询对应的 房间和对应的楼层
String roomId = customer.getRoomId();
List<String> roomIds = StrUtil.split(roomId, ',');
List<Long> collect = roomIds.stream().map(Long::valueOf).collect(Collectors.toList());
for (Long roomid : collect) {
Room room = roomService.selectRoomById(roomid);
if (null != room) {
Long id = room.getId();
RoomEquipment roomEquipment = roomEquipmentService.selectByRoomId(id);
if (null != roomEquipment) {
ids.add(roomEquipment.getEquipmentId());
}
List<DetailEquipment> detailEquipments = detailEquipmentService.selectByRoomId(id);
if (CollUtil.isNotEmpty(detailEquipments)) {
for (DetailEquipment detailEquipment : detailEquipments) {
ids.add(detailEquipment.getEquipmentId());
}
}
}
}
if (CollUtil.isNotEmpty(ids)) {
List<Equipment> equipment = equipmentService.selectListByIds(ids);
List<Equipment> equipment1 = selectEquipmentListByIds(equipment);
return R.data(equipment1);
} else {
return R.data(new ArrayList<Equipment>());
}
}
}
List<Equipment> equipment = equipmentService.selectEquipmentList(new Equipment());
List<Equipment> equipment1 = selectEquipmentListByIds(equipment);
return R.data(equipment1);
}
/**
* 查询当前用户的所有设备
*
* @return
*/
@RequiresPermissions("meeting:roomContent:list")
@PostMapping("/selectEquipmentListById")
public R selectEquipmentListById(@RequestBody UserEquipment equipment) {
List<UserEquipment> equipments = userEquipmentService.selectUserEquipmentList(equipment);
List<Long> collect = equipments.stream().map(UserEquipment::getEquipmentId).collect(Collectors.toList());
if (CollUtil.isNotEmpty(collect)) {
List<Equipment> equipment1 = equipmentService.selectListByIds(collect);
List<Equipment> equipment2 = selectEquipmentListByIds(equipment1);
return R.data(equipment2);
}
return R.data(equipments);
}
public List<Equipment> selectEquipmentListByIds(List<Equipment> equipment) {
for (Equipment equipment2 : equipment) {
RoomEquipment roomEquipment = roomEquipmentService.selectByEquipmentId(equipment2.getId());
if (roomEquipment != null) {
Room room = roomService.selectRoomById(roomEquipment.getRoomId());
equipment2.setRoomId(room.getId());
equipment2.setBuildId(room.getBuildingDetailId());
equipment2.setRoomName(room.getName());
BuildingDetail buildingDetail = buildingDetailService.selectBuildingDetailById(room.getBuildingDetailId());
if (buildingDetail != null) {
equipment2.setBuildName(buildingDetail.getFloorName());
}
} else {
DetailEquipment detailEquipment = detailEquipmentService.selectByEquipmentId(equipment2.getId());
if (null != detailEquipment) {
BuildingDetail buildingDetail = buildingDetailService.selectBuildingDetailById(detailEquipment.getBuildingDetailId());
if (buildingDetail != null) {
equipment2.setBuildName(buildingDetail.getFloorName());
}
}
}
}
return equipment;
}
@RequiresPermissions("meeting:roomContent:list")
@PostMapping("/saveUserEquipment")
public R saveUserEquipment(@RequestBody UserEquipment equipment) {
for (Long id : equipment.getUserIds()) {
UserEquipment userEquipment = new UserEquipment();
userEquipment.setEquipmentId(id);
userEquipment.setUserId(equipment.getUserId());
Customer customer = customerService.selectCustomerById(equipment.getUserId());
if (customer != null) {
userEquipment.setStartTime(customer.getStartDate());
userEquipment.setEndDate(customer.getEndDate());
}
userEquipmentService.insertUserEquipment(userEquipment);
}
return R.ok();
}
}

View File

@ -9,9 +9,12 @@ import com.ics.common.utils.ValidatorUtils;
import com.ics.system.domain.Dept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.wf.jwtp.annotation.Ignore;
import org.wf.jwtp.annotation.Logical;
import org.wf.jwtp.annotation.RequiresPermissions;
import java.util.List;
/**
* 园区管理 提供者
@ -122,4 +125,14 @@ public class ParkController extends BaseController {
return toAjax(parkService.initPark(dept));
}
/**
* 获取园区列表
*/
@Ignore
public R selectParkList(Park park) {
return R.data(parkService.selectParkList(park));
}
}

View File

@ -3,6 +3,7 @@ package com.ics.admin.controller.meeting;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.ics.admin.domain.BuildingDetail;
import com.ics.admin.domain.Customer;
import com.ics.admin.domain.Room;
@ -13,6 +14,9 @@ import com.ics.admin.service.IIcsCustomerStaffService;
import com.ics.admin.service.IRoomService;
import com.ics.admin.service.meeting.*;
import com.ics.common.core.domain.IcsCustomerStaff;
import com.ics.system.domain.User;
import com.ics.system.service.ICurrentUserService;
import com.ics.system.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@ -25,7 +29,9 @@ import com.ics.common.core.domain.R;
import com.ics.common.core.controller.BaseController;
import org.wf.jwtp.annotation.Ignore;
import org.wf.jwtp.annotation.RequiresPermissions;
import org.wf.jwtp.util.SubjectUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@ -75,6 +81,12 @@ public class EquipmentController extends BaseController {
@Autowired
private IReservationPersonService reservationPersonService;
@Autowired
private ICurrentUserService currentUserService;
@Autowired
private IUserService userService;
/**
* 查询设备
*/
@ -98,6 +110,27 @@ public class EquipmentController extends BaseController {
@GetMapping("list")
public R list(Equipment equipment) {
startPage();
boolean isAdmin = SubjectUtil.hasRole(getRequest(),"manager");
if (isAdmin){
Long parkId = currentUserService.getParkId();
Long tenantId = currentUserService.getTenantId();
equipment.setParkId(parkId);
equipment.setTenantId(tenantId);
}
boolean b = SubjectUtil.hasRole(getRequest(),"admin");
if (b){
User user = userService.selectUserById(getCurrentUserId());
if (null != user.getCustomerId()){
//todo 查询房间id
Customer customer = customerService.selectCustomerById(user.getCustomerId());
if (customer !=null){
String roomId = customer.getRoomId();
List<String> roomIds = StrUtil.split(roomId, ',');
List<Long> collect = roomIds.stream().map(Long::valueOf).collect(Collectors.toList());
equipment.setRoomIds(collect);
}
}
}
List<Equipment> equipment1 = equipmentService.selectEquipmentList(equipment);
for (Equipment equipment2 : equipment1) {
RoomEquipment roomEquipment = roomEquipmentService.selectByEquipmentId(equipment2.getId());
@ -151,14 +184,9 @@ public class EquipmentController extends BaseController {
addPersonDeviceByRoomContent(room,equipment.getId());
}
}
return toAjax(i);
}
/**
* 修改保存设备
*/
@ -178,27 +206,21 @@ public class EquipmentController extends BaseController {
addPersonDeviceByCustomer(room,equipment.getId());
addPersonDeviceByRoomContent(room,equipment.getId());
}
RoomEquipment roomEquipment1 = roomEquipmentService.selectByEquipmentId(equipment.getId());
if (null != roomEquipment1) {
roomEquipment1.setRoomId(equipment.getRoomId());
int i1 = roomEquipmentService.updateRoomEquipment(roomEquipment1);
Assert.isTrue(i1 > 0, "修改失败");
}
} else {
Equipment equipment1 = equipmentService.selectEquipmentById(equipment.getId());
if (!ObjectUtil.equals(equipment1.getBuildId(),equipment.getBuildId()) ) {
if (!ObjectUtil.equals(equipment1.getBuildId(),equipment.getBuildId())) {
List<Room> rooms = roomService.selectRoomByBuildId(equipment.getBuildId());
for (Room room : rooms) {
addPersonDeviceByCustomer(room,equipment.getId());
addPersonDeviceByRoomContent(room,equipment.getId());
}
}
DetailEquipment detailEquipment = new DetailEquipment();
detailEquipment.setEquipmentId(equipment.getId());
detailEquipment.setBuildingDetailId(equipment.getBuildId());
@ -268,7 +290,6 @@ public class EquipmentController extends BaseController {
}
/**
* 删除设备
*/
@ -306,11 +327,25 @@ public class EquipmentController extends BaseController {
* 获取所有的用户
*/
@Ignore
@RequiresPermissions("meeting:roomContent:list")
@GetMapping("getUserList")
public R getUserList(IcsCustomerStaff customerStaff) {
System.out.println(customerStaff);
boolean isAdmin = SubjectUtil.hasRole(getRequest(),"manager");
if (isAdmin){
Long parkId = currentUserService.getParkId();
Long tenantId = currentUserService.getTenantId();
customerStaff.setParkId(parkId);
customerStaff.setTenantId(tenantId);
}
boolean b = SubjectUtil.hasRole(getRequest(),"admin");
if (b){
User user = userService.selectUserById(getCurrentUserId());
if (null != user.getCustomerId()){
Customer customer = customerService.selectCustomerById(user.getCustomerId());
customerStaff.setIcsCustomerId(customer.getId());
}
}
List<IcsCustomerStaff> icsCustomerStaffs = staffService.selectIcsCustomerStaffList(customerStaff);
for (IcsCustomerStaff icsCustomerStaff : icsCustomerStaffs) {
Customer customer = customerService.selectCustomerById(icsCustomerStaff.getIcsCustomerId());
@ -325,12 +360,33 @@ public class EquipmentController extends BaseController {
* 获取所有的用户
*/
@Ignore
@RequiresPermissions("meeting:roomContent:list")
@GetMapping("getUserListByDeviceId/{id}")
public R getUserListByDeviceId(@PathVariable("id") Long id) {
UserEquipment userEquipment = new UserEquipment();
userEquipment.setEquipmentId(id);
ArrayList<Long> userId = new ArrayList<>();
boolean isAdmin = SubjectUtil.hasRole(getRequest(),"manager");
if (isAdmin){
Long parkId = currentUserService.getParkId();
Long tenantId = currentUserService.getTenantId();
userEquipment.setParkId(parkId);
userEquipment.setTenantId(tenantId);
}
boolean b = SubjectUtil.hasRole(getRequest(),"admin");
if (b){
User user = userService.selectUserById(getCurrentUserId());
if (null != user.getCustomerId()){
Customer customer = customerService.selectCustomerById(user.getCustomerId());
//根据企业查询对应用户id
List<IcsCustomerStaff> icsCustomerStaffs = staffService.selectUserByCustomer(customer.getId());
List<Long> ids = icsCustomerStaffs.stream().map(item -> {
return item.getId();
}).collect(Collectors.toList());
userId.addAll(ids);
}
}
userEquipment.setUserIds(userId);
List<UserEquipment> equipments = userEquipmentService.selectUserEquipmentList(userEquipment);
List<Long> userIds = equipments.stream().map(item -> {
return item.getUserId();

View File

@ -11,6 +11,7 @@ import com.ics.admin.service.meeting.IRoomContentService;
import com.ics.common.core.domain.IcsCustomerStaff;
import com.ics.system.domain.User;
import com.ics.system.mapper.DictDataMapper;
import com.ics.system.service.ICurrentUserService;
import com.ics.system.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -26,6 +27,7 @@ import com.ics.admin.domain.meeting.Reservation;
import com.ics.admin.service.meeting.IReservationService;
import org.wf.jwtp.annotation.Ignore;
import org.wf.jwtp.annotation.RequiresPermissions;
import org.wf.jwtp.util.SubjectUtil;
import java.util.Date;
import java.util.List;
@ -58,6 +60,9 @@ public class ReservationController extends BaseController {
@Autowired
private IUserService userService;
@Autowired
private ICurrentUserService currentUserService;
/**
* 查询预约记录
*/
@ -95,13 +100,34 @@ public class ReservationController extends BaseController {
@GetMapping("list")
public R list(Reservation reservation) {
startPage();
boolean isAdmin = SubjectUtil.hasRole(getRequest(),"manager");
if (isAdmin){
Long parkId = currentUserService.getParkId();
Long tenantId = currentUserService.getTenantId();
reservation.setParkId(parkId);
reservation.setTenantId(tenantId);
}
boolean b = SubjectUtil.hasRole(getRequest(),"admin");
if (b){
User user = userService.selectUserById(getCurrentUserId());
if (null != user.getCustomerId()){
reservation.setCustomerId(user.getCustomerId());
}
}
List<Reservation> reservations = reservationService.selectReservationList(reservation);
for (Reservation reservation1 : reservations) {
RoomContent roomContent = iRoomContentService.selectRoomContentById(reservation1.getRoomContentId());
String typeName = dictDataMapper.selectDictLabel("meeting_type", String.valueOf(roomContent.getType()));
roomContent.setTypeName(typeName);
if (reservation1.getOrderTime()!=null){
// 已经支付
reservation1.setIsPay("已支付");
}else {
reservation1.setIsPay("未支付");
}
//会议室名称
reservation1.setRoomContent(roomContent);
reservation1.setStatusName(reservation1.getStauts().getName());
@ -129,8 +155,8 @@ public class ReservationController extends BaseController {
long currentUserId1 = this.getCurrentUserId();
User user = userService.selectUserById(currentUserId1);
Assert.isTrue(user.getStaffId() !=null, "当前用户没有绑定小程序用户");
long currentUserId = this.getLoginStaffId();
reservation.setUserId(currentUserId);
reservation.setUserId(user.getStaffId());
return toAjax(reservationService.insertReservation(reservation));
}

View File

@ -1,6 +1,8 @@
package com.ics.admin.controller.meeting;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import com.ics.admin.domain.BuildingDetail;
import com.ics.admin.domain.Customer;
import com.ics.admin.domain.Room;
@ -12,7 +14,10 @@ import com.ics.admin.service.meeting.IRoomContentService;
import com.ics.admin.service.meeting.IRoomItemByRoomService;
import com.ics.admin.service.meeting.IRoomServeByRoomService;
import com.ics.common.core.controller.BaseController;
import com.ics.system.domain.User;
import com.ics.system.mapper.DictDataMapper;
import com.ics.system.service.ICurrentUserService;
import com.ics.system.service.IUserService;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -28,9 +33,12 @@ import com.ics.admin.domain.meeting.RoomContent;
import com.ics.admin.service.meeting.IRoomContentService;
import org.wf.jwtp.annotation.Ignore;
import org.wf.jwtp.annotation.RequiresPermissions;
import org.wf.jwtp.util.SubjectUtil;
import javax.security.auth.Subject;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 房间主体内容 提供者
@ -60,6 +68,11 @@ public class RoomContentController extends BaseController {
@Autowired
private ICustomerService customerService;
@Autowired
private ICurrentUserService currentUserService;
@Autowired
private IUserService userService;
/**
@ -88,6 +101,24 @@ public class RoomContentController extends BaseController {
@GetMapping("list")
public R list(RoomContent roomContent) {
startPage();
boolean isAdmin = SubjectUtil.hasRole(getRequest(),"manager");
if (isAdmin){
Long parkId = currentUserService.getParkId();
Long tenantId = currentUserService.getTenantId();
roomContent.setParkId(parkId);
roomContent.setTenantId(tenantId);
}
boolean b = SubjectUtil.hasRole(getRequest(),"admin");
if (b){
User user = userService.selectUserById(getCurrentUserId());
if (null != user.getCustomerId()){
Customer customer = customerService.selectCustomerById(user.getCustomerId());
String roomId = customer.getRoomId();
List<String> roomIds = StrUtil.split(roomId, ',');
List<Long> collect = roomIds.stream().map(Long::valueOf).collect(Collectors.toList());
roomContent.setRoomIds(collect);
}
}
List<RoomContent> roomContents = roomContentService.selectRoomContentList(roomContent);
for (RoomContent content : roomContents) {
RoomServeByRoom roomServeByRoom = new RoomServeByRoom();
@ -99,15 +130,14 @@ public class RoomContentController extends BaseController {
roomItemByRoom.setRoomContentId(content.getId());
List<RoomItemByRoom> roomItemByRooms = roomItemByRoomService.selectRoomItemByRoomList(roomItemByRoom);
content.setItemCount(roomItemByRooms.size());
Long roomId = content.getRoomId();
Room room = roomService.selectRoomById(roomId);
if (room != null){
content.setBuildId(room.getBuildingDetailId());
content.setArea(room.getArea());
content.setRoomName(room.getName());
content.setBuildingId(room.getBuildingId());
}
}
return result(roomContents);
}
@ -220,8 +250,30 @@ public class RoomContentController extends BaseController {
public R list(Room room) {
room.setDeleteFlag(0);
room.setBuildingDetailId(room.getBuildingDetailId());
return R.ok().put("data",roomService.selectRoomList(room));
List<Room> rooms = roomService.selectRoomList(room);
if (room.getId() != null ){
Room room1 = roomService.selectRoomById(room.getId());
rooms.add(room1);
}
return R.ok().put("data",rooms);
}
@Ignore
@PostMapping("/getRoomListByBuildIds")
public R getRoomListByBuildIds(@RequestBody Room room) {
room.setDeleteFlag(0);
room.setBuildingDetailIds(room.getBuildingDetailIds());
List<Room> rooms = roomService.selectRoomList(room);
if (CollUtil.isNotEmpty(room.getIds()) ){
for (Long id : room.getIds()) {
Room room1 = roomService.selectRoomById(id);
rooms.add(room1);
}
}
return R.ok().put("data",rooms);
}
@Ignore
@GetMapping("/selectRoomById")
@ -235,14 +287,31 @@ public class RoomContentController extends BaseController {
@GetMapping("/customerList")
public R list(Customer customer) {
List<Customer> customers = customerService.selectCustomerList(customer);
return result(customers);
return R.data(customers);
}
@Ignore
@RequiresPermissions("meeting:roomContent:list")
@GetMapping("/roomContentList")
public R roomContentList() {
return R.data(roomContentService.selectRoomContentList(new RoomContent()));
public R roomContentList(RoomContent roomContent) {
boolean isAdmin = SubjectUtil.hasRole(getRequest(),"manager");
if (isAdmin){
Long parkId = currentUserService.getParkId();
Long tenantId = currentUserService.getTenantId();
roomContent.setParkId(parkId);
roomContent.setTenantId(tenantId);
}
boolean b = SubjectUtil.hasRole(getRequest(),"admin");
if (b){
User user = userService.selectUserById(getCurrentUserId());
if (null != user.getCustomerId()){
Customer customer = customerService.selectCustomerById(user.getCustomerId());
String roomId = customer.getRoomId();
List<String> roomIds = StrUtil.split(roomId, ',');
List<Long> collect = roomIds.stream().map(Long::valueOf).collect(Collectors.toList());
roomContent.setRoomIds(collect);
}
}
return R.data(roomContentService.selectRoomContentList(roomContent));
}
}

View File

@ -1,5 +1,6 @@
package com.ics.admin.controller.meeting;
import com.ics.system.service.ICurrentUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@ -13,6 +14,7 @@ import com.ics.common.core.controller.BaseController;
import com.ics.admin.domain.meeting.RoomItem;
import com.ics.admin.service.meeting.IRoomItemService;
import org.wf.jwtp.annotation.RequiresPermissions;
import org.wf.jwtp.util.SubjectUtil;
/**
* 房间物品 提供者
@ -27,6 +29,9 @@ public class RoomItemController extends BaseController {
@Autowired
private IRoomItemService roomItemService;
@Autowired
private ICurrentUserService currentUserService;
/**
* 查询房间物品
*/
@ -42,6 +47,13 @@ public class RoomItemController extends BaseController {
@GetMapping("list")
public R list(RoomItem roomItem) {
startPage();
boolean isAdmin = SubjectUtil.hasRole(getRequest(),"manager");
if (isAdmin){
Long parkId = currentUserService.getParkId();
Long tenantId = currentUserService.getTenantId();
roomItem.setParkId(parkId);
roomItem.setTenantId(tenantId);
}
return result(roomItemService.selectRoomItemList(roomItem));
}

View File

@ -1,5 +1,6 @@
package com.ics.admin.controller.meeting;
import com.ics.system.service.ICurrentUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@ -13,6 +14,7 @@ import com.ics.common.core.controller.BaseController;
import com.ics.admin.domain.meeting.RoomServe;
import com.ics.admin.service.meeting.IRoomServeService;
import org.wf.jwtp.annotation.RequiresPermissions;
import org.wf.jwtp.util.SubjectUtil;
/**
* 服务 提供者
@ -27,6 +29,9 @@ public class RoomServeController extends BaseController {
@Autowired
private IRoomServeService roomServeService;
@Autowired
private ICurrentUserService currentUserService;
/**
* 查询服务
*/
@ -42,6 +47,14 @@ public class RoomServeController extends BaseController {
@GetMapping("list")
public R list(RoomServe roomServe) {
startPage();
boolean isAdmin = SubjectUtil.hasRole(getRequest(),"manager");
if (isAdmin){
Long parkId = currentUserService.getParkId();
Long tenantId = currentUserService.getTenantId();
roomServe.setParkId(parkId);
roomServe.setTenantId(tenantId);
}
return result(roomServeService.selectRoomServeList(roomServe));
}

View File

@ -1,10 +1,17 @@
package com.ics.admin.controller.meeting;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import com.ics.admin.domain.BuildingDetail;
import com.ics.admin.domain.Customer;
import com.ics.admin.domain.Room;
import com.ics.admin.service.IBuildingDetailService;
import com.ics.admin.service.ICustomerService;
import com.ics.admin.service.IRoomService;
import com.ics.system.domain.User;
import com.ics.system.service.ICurrentUserService;
import com.ics.system.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@ -19,8 +26,10 @@ import com.ics.admin.domain.meeting.Showroom;
import com.ics.admin.service.meeting.IShowroomService;
import org.wf.jwtp.annotation.Ignore;
import org.wf.jwtp.annotation.RequiresPermissions;
import org.wf.jwtp.util.SubjectUtil;
import java.util.List;
import java.util.stream.Collectors;
/**
* 展厅管理 提供者
@ -41,6 +50,17 @@ public class ShowroomController extends BaseController {
@Autowired
private IBuildingDetailService buildingDetailService;
@Autowired
private ICurrentUserService currentUserService;
@Autowired
private IUserService userService;
@Autowired
private ICustomerService customerService;
/**
* 查询展厅管理
*/
@ -66,6 +86,25 @@ public class ShowroomController extends BaseController {
@GetMapping("list")
public R list(Showroom showroom) {
startPage();
boolean isAdmin = SubjectUtil.hasRole(getRequest(),"manager");
if (isAdmin){
Long parkId = currentUserService.getParkId();
Long tenantId = currentUserService.getTenantId();
showroom.setParkId(parkId);
showroom.setTenantId(tenantId);
}
boolean b = SubjectUtil.hasRole(getRequest(),"admin");
if (b){
User user = userService.selectUserById(getCurrentUserId());
if (null != user.getCustomerId()){
Customer customer = customerService.selectCustomerById(user.getCustomerId());
String roomId = customer.getRoomId();
List<String> roomIds = StrUtil.split(roomId, ',');
List<Long> collect = roomIds.stream().map(Long::valueOf).collect(Collectors.toList());
showroom.setRoomIds(collect);
}
}
List<Showroom> showrooms = showroomService.selectShowroomList(showroom);
for (Showroom showroom1 : showrooms) {
Long roomId = showroom1.getRoomId();

View File

@ -9,6 +9,9 @@ import com.ics.admin.service.ICustomerService;
import com.ics.admin.service.IIcsCustomerStaffService;
import com.ics.admin.service.meeting.IShowroomService;
import com.ics.common.core.domain.IcsCustomerStaff;
import com.ics.system.domain.User;
import com.ics.system.service.ICurrentUserService;
import com.ics.system.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@ -23,10 +26,12 @@ import com.ics.admin.domain.meeting.ShowroomRecord;
import com.ics.admin.service.meeting.IShowroomRecordService;
import org.wf.jwtp.annotation.Ignore;
import org.wf.jwtp.annotation.RequiresPermissions;
import org.wf.jwtp.util.SubjectUtil;
import java.util.Date;
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;
/**
* 展厅预约记录 提供者
@ -50,6 +55,15 @@ public class ShowroomRecordController extends BaseController {
@Autowired
private ICustomerService customerService;
@Autowired
private ICurrentUserService currentUserService;
@Autowired
private IUserService userService;
@Autowired
private IIcsCustomerStaffService staffService;
/**
* 查询展厅预约记录
*/
@ -81,6 +95,27 @@ public class ShowroomRecordController extends BaseController {
@GetMapping("list")
public R list(ShowroomRecord showroomRecord) {
startPage();
boolean isAdmin = SubjectUtil.hasRole(getRequest(),"manager");
if (isAdmin){
Long parkId = currentUserService.getParkId();
Long tenantId = currentUserService.getTenantId();
showroomRecord.setParkId(parkId);
showroomRecord.setTenantId(tenantId);
}
boolean b = SubjectUtil.hasRole(getRequest(),"admin");
if (b){
User user = userService.selectUserById(getCurrentUserId());
if (null != user.getCustomerId()){
Customer customer = customerService.selectCustomerById(user.getCustomerId());
if (null != customer){
List<IcsCustomerStaff> icsCustomerStaffs = staffService.selectUserByCustomer(customer.getId());
List<Long> ids = icsCustomerStaffs.stream().map(item -> {
return item.getId();
}).collect(Collectors.toList());
showroomRecord.setStaffIds(ids);
}
}
}
List<ShowroomRecord> showroomRecords = showroomRecordService.selectShowroomRecordList(showroomRecord);
for (ShowroomRecord record : showroomRecords) {
Showroom showroom = showroomService.selectShowroomById(record.getShowroomId());
@ -98,8 +133,11 @@ public class ShowroomRecordController extends BaseController {
@RequiresPermissions("meeting:showroomRecord:add")
@PostMapping("save")
public R addSave(@RequestBody ShowroomRecord showroomRecord) {
long currentUserId = getLoginStaffId();
showroomRecord.setUserId(currentUserId);
User user = userService.selectUserById(getCurrentUserId());
if (null != user.getCustomerId()){
showroomRecord.setUserId(user.getCustomerId());
}
showroomRecord.setShowroomId(1L);
showroomRecord.setCreateTime(new Date());
showroomRecord.setStatus(1);

View File

@ -8,7 +8,9 @@ import com.ics.admin.domain.meeting.CustomerTicket;
import com.ics.admin.domain.meeting.vo.TicketCustomerVo;
import com.ics.admin.service.ICustomerService;
import com.ics.admin.service.meeting.ICustomerTicketService;
import com.ics.common.core.domain.IcsCustomerStaff;
import com.ics.system.domain.User;
import com.ics.system.service.ICurrentUserService;
import com.ics.system.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -24,6 +26,7 @@ import com.ics.admin.domain.meeting.Ticket;
import com.ics.admin.service.meeting.ITicketService;
import org.wf.jwtp.annotation.Ignore;
import org.wf.jwtp.annotation.RequiresPermissions;
import org.wf.jwtp.util.SubjectUtil;
import java.util.*;
import java.util.function.Function;
@ -51,6 +54,11 @@ public class TicketController extends BaseController {
@Autowired
private ICustomerTicketService customerTicketService;
@Autowired
private ICurrentUserService currentUserService;
/**
* 查询优惠卷
*/
@ -97,6 +105,14 @@ public class TicketController extends BaseController {
@GetMapping("list")
public R list(Ticket ticket) {
startPage();
boolean isAdmin = SubjectUtil.hasRole(getRequest(),"manager");
if (isAdmin){
Long parkId = currentUserService.getParkId();
Long tenantId = currentUserService.getTenantId();
ticket.setParkId(parkId);
ticket.setTenantId(tenantId);
}
List<Ticket> tickets = ticketService.selectTicketList(ticket);
return result(tickets);

View File

@ -7,6 +7,9 @@ import com.ics.admin.service.IIcsCustomerStaffService;
import com.ics.admin.service.meeting.IVisitorPersonService;
import com.ics.common.core.domain.IcsCustomerStaff;
import com.ics.common.utils.DateUtils;
import com.ics.system.domain.User;
import com.ics.system.service.ICurrentUserService;
import com.ics.system.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@ -20,9 +23,11 @@ import com.ics.common.core.controller.BaseController;
import com.ics.admin.domain.meeting.VisitorPerson;
import org.wf.jwtp.annotation.Ignore;
import org.wf.jwtp.annotation.RequiresPermissions;
import org.wf.jwtp.util.SubjectUtil;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* 访客预约表 提供者
@ -43,6 +48,14 @@ public class VisitorPersonController extends BaseController {
@Autowired
private ICustomerService customerService;
@Autowired
private ICurrentUserService currentUserService;
@Autowired
private IUserService userService;
/**
* 查询预约参观人员
*/
@ -74,6 +87,27 @@ public class VisitorPersonController extends BaseController {
@GetMapping("list")
public R list(VisitorPerson visitorPerson) {
startPage();
boolean isAdmin = SubjectUtil.hasRole(getRequest(),"manager");
if (isAdmin){
Long parkId = currentUserService.getParkId();
Long tenantId = currentUserService.getTenantId();
visitorPerson.setParkId(parkId);
visitorPerson.setTenantId(tenantId);
}
boolean b = SubjectUtil.hasRole(getRequest(),"admin");
if (b){
User user = userService.selectUserById(getCurrentUserId());
if (null != user.getCustomerId()){
Customer customer = customerService.selectCustomerById(user.getCustomerId());
if (null != customer){
List<IcsCustomerStaff> icsCustomerStaffs = staffService.selectUserByCustomer(customer.getId());
List<Long> ids = icsCustomerStaffs.stream().map(item -> {
return item.getId();
}).collect(Collectors.toList());
visitorPerson.setStaffIds(ids);
}
}
}
return result(visitorPersonService.selectReservationPersonList(visitorPerson));
}
@ -84,9 +118,16 @@ public class VisitorPersonController extends BaseController {
@RequiresPermissions("meeting:visitorPerson:add")
@PostMapping("save")
public R addSave(@RequestBody VisitorPerson visitorPerson) {
visitorPerson.setUserId(visitorPerson.getUserId());
long currentUserId = this.getCurrentUserId();
User user = userService.selectUserById(currentUserId);
if (null != user){
visitorPerson.setIntervieweeId(user.getStaffId());
}
visitorPerson.setStatus(1);
visitorPerson.setCreateTime(DateUtils.getNowDate());
visitorPerson.setUserId(getLoginCustomerId());
return toAjax(visitorPersonService.insertReservationPerson(visitorPerson));
}

View File

@ -334,9 +334,11 @@ public class Customer extends BaseEntity<Customer> {
private String channelName;
private Long buildId;
private String buildId;
private Long roomId;
private String roomId;
private Long buildingId;
@TableField(exist = false)
private String roomName;
@ -421,4 +423,10 @@ public class Customer extends BaseEntity<Customer> {
@TableField(exist = false)
private User user;
@TableField(exist = false)
private List<Long> buildingDetailIds;
@TableField(exist = false)
private List<Long> roomIds;
}

View File

@ -318,4 +318,10 @@ public class Room extends BaseEntity<Room> {
private String buildingName;
@TableField(exist = false)
private List<String> buildingDetailIds;
@TableField(exist = false)
private List<Long> ids;
}

View File

@ -8,6 +8,7 @@ import lombok.NoArgsConstructor;
import lombok.RequiredArgsConstructor;
import java.util.Date;
import java.util.List;
/**
* 设备对象 tb_equipment
@ -53,4 +54,13 @@ public class Equipment extends BaseEntity<Equipment> {
@TableField(exist = false)
private Integer personCount;
@TableField(exist = false)
private List<Long> staffIds;
@TableField(exist = false)
private List<Long> roomIds;
@TableField(exist = false)
private List<Long> buildingDetailIds;
}

View File

@ -168,4 +168,7 @@ public class Reservation extends BaseEntity<Reservation> {
@TableField(exist = false)
private Long duration;
@TableField(exist = false)
private String isPay;
}

View File

@ -74,6 +74,9 @@ public class RoomContent extends BaseEntity<RoomContent> {
/** 房间id */
private Long roomId;
@TableField(exist = false)
private List<Long> roomIds;
/** 是否收费 */
private Long isToll;
@ -85,7 +88,14 @@ public class RoomContent extends BaseEntity<RoomContent> {
private String remake;
private Long parkId;
private Long tenantId;
@TableField(exist = false)
private Long customerId;
@TableField(exist = false)
@ -153,6 +163,9 @@ public class RoomContent extends BaseEntity<RoomContent> {
@TableField(exist = false)
private String build;
@TableField(exist = false)
private Long buildingId;
@TableField(exist = false)
private Long buildId;

View File

@ -7,6 +7,7 @@ import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 展厅管理对象 tb_showroom
@ -75,4 +76,7 @@ public class Showroom extends BaseEntity<Showroom> {
@TableField(exist = false)
private Long buildId;
@TableField(exist = false)
private List<Long> roomIds;
}

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import com.ics.common.core.domain.BaseEntity;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* 展厅预约记录对象 tb_showroom_record
@ -92,4 +93,7 @@ public class ShowroomRecord extends BaseEntity<ShowroomRecord> {
@TableField(exist = false)
private String statusName;
@TableField(exist = false)
private List<Long> staffIds;
}

View File

@ -89,4 +89,7 @@ public class VisitorPerson extends BaseEntity<VisitorPerson> {
@TableField(exist = false)
private List<Long> userIds;
@TableField(exist = false)
private List<Long> staffIds;
}

View File

@ -73,4 +73,5 @@ public interface IcsCustomerStaffMapper extends BaseMapper<IcsCustomerStaff> {
int updateByCustomer(IcsCustomerStaff customerStaff);
IcsCustomerStaff selectUserByMobile(String mobile);
}

View File

@ -61,4 +61,6 @@ public interface UserEquipmentMapper extends BaseMapper<UserEquipment> {
* @return 结果
*/
int deleteUserEquipmentByIds(String[] ids);
int selectCountByUserIdAndDeviceId(UserEquipment userEquipment1);
}

View File

@ -80,4 +80,8 @@ public interface IIcsCustomerStaffService extends IService<IcsCustomerStaff> {
IcsCustomerStaff selectByPhone(String mobile);
int updateByCustomer(IcsCustomerStaff customerStaff);
List<IcsCustomerStaff> selectCustomerStaffList(IcsCustomerStaff icsCustomerStaff);
String importCustomerStaff(List<IcsCustomerStaff> userList);
}

View File

@ -1,6 +1,7 @@
package com.ics.admin.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.aliyun.oss.ServiceException;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ics.admin.mapper.IcsCustomerStaffMapper;
@ -118,7 +119,7 @@ public class IcsCustomerStaffServiceImpl extends ServiceImpl<IcsCustomerStaffMap
public List<IcsCustomerStaff> selectListByUserIds(List<Long> userIds) {
QueryWrapper<IcsCustomerStaff> objectQueryWrapper = new QueryWrapper<>();
objectQueryWrapper.in(CollUtil.isNotEmpty(userIds),"id",userIds);
objectQueryWrapper.in("id",userIds);
return icsCustomerStaffMapper.selectList(objectQueryWrapper);
}
@ -157,4 +158,63 @@ public class IcsCustomerStaffServiceImpl extends ServiceImpl<IcsCustomerStaffMap
return icsCustomerStaffMapper.updateByCustomer(customerStaff);
}
@Override
public List<IcsCustomerStaff> selectCustomerStaffList(IcsCustomerStaff icsCustomerStaff) {
QueryWrapper<IcsCustomerStaff> wrapper = new QueryWrapper<>();
wrapper.eq("ics_customer_id",icsCustomerStaff.getIcsCustomerId());
return icsCustomerStaffMapper.selectList(wrapper);
}
@Override
public String importCustomerStaff(List<IcsCustomerStaff> userList) {
if (StringUtils.isNull(userList) || userList.size() == 0)
{
throw new ServiceException("导入用户数据不能为空!");
}
int successNum = 0;
int failureNum = 0;
StringBuilder successMsg = new StringBuilder();
StringBuilder failureMsg = new StringBuilder();
for (IcsCustomerStaff user : userList)
{
try
{
// 验证是否存在这个用户
IcsCustomerStaff u = icsCustomerStaffMapper.selectUserByMobile(user.getMobile());
if (StringUtils.isNull(u))
{
user.setCardNo("0");
user.setDataType("1");
icsCustomerStaffMapper.insert(user);
successNum++;
successMsg.append("<br/>" + successNum + "、账号 " + user.getName() + " 导入成功");
}
else
{
failureNum++;
failureMsg.append("<br/>" + failureNum + "、账号 " + user.getName() + " 已存在");
}
}
catch (Exception e)
{
failureNum++;
String msg = "<br/>" + failureNum + "、账号 " + user.getName() + " 导入失败:";
failureMsg.append(msg + e.getMessage());
log.error(msg, e);
}
}
if (failureNum > 0)
{
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
throw new ServiceException(failureMsg.toString());
}
else
{
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
}
return successMsg.toString();
}
}

View File

@ -44,6 +44,8 @@ public class RoomServeServiceImpl extends ServiceImpl<RoomServeMapper, RoomServe
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq(roomServe.getServeType() !=null ,"serve_type",roomServe.getServeType());
queryWrapper.like(roomServe.getServeName() !=null ,"serve_name",roomServe.getServeName());
queryWrapper.eq(roomServe.getParkId() !=null,"park_id", roomServe.getParkId());
queryWrapper.eq(roomServe.getTenantId() !=null,"tenant_id", roomServe.getTenantId());
return roomServeMapper.selectList(queryWrapper);
}

View File

@ -42,6 +42,9 @@ public class TicketServiceImpl extends ServiceImpl<TicketMapper, Ticket> impleme
@Override
public List<Ticket> selectTicketList(Ticket ticket) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq(ticket.getParkId() !=null,"park_id", ticket.getParkId());
queryWrapper.eq(ticket.getTenantId() !=null,"tenant_id", ticket.getTenantId());
return ticketMapper.selectList(queryWrapper);
}

View File

@ -15,6 +15,7 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -38,6 +39,7 @@ import org.springframework.stereotype.Service;
import com.ics.admin.mapper.meeting.UserEquipmentMapper;
import com.ics.admin.domain.meeting.UserEquipment;
import com.ics.admin.service.meeting.IUserEquipmentService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
@ -92,6 +94,7 @@ public class UserEquipmentServiceImpl extends ServiceImpl<UserEquipmentMapper, U
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq(null != userEquipment.getEquipmentId(),"equipment_id",userEquipment.getEquipmentId());
queryWrapper.eq(null != userEquipment.getUserId(),"user_id",userEquipment.getUserId());
queryWrapper.in(CollUtil.isNotEmpty(userEquipment.getUserIds()),"user_id",userEquipment.getUserIds());
return userEquipmentMapper.selectList(queryWrapper);
}
@ -101,6 +104,7 @@ public class UserEquipmentServiceImpl extends ServiceImpl<UserEquipmentMapper, U
* @param userEquipment 用户设备关联
* @return 结果
*/
@Transactional
@Override
public int insertUserEquipment(UserEquipment userEquipment) {
return userEquipmentMapper.insert(userEquipment);
@ -197,12 +201,22 @@ public class UserEquipmentServiceImpl extends ServiceImpl<UserEquipmentMapper, U
@Override
public int selectCountByUserIdAndDeviceId(UserEquipment userEquipment1) {
QueryWrapper<UserEquipment> wrapper = new QueryWrapper<>();
wrapper.eq("equipment_id", userEquipment1.getEquipmentId());
wrapper.eq("user_id", userEquipment1.getUserId());
wrapper.gt("end_date", DateUtil.date());
wrapper.lt("start_time", DateUtil.date());
return userEquipmentMapper.selectCount(wrapper);
// 开门时时间提前
// QueryWrapper<UserEquipment> wrapper = new QueryWrapper<>();
// wrapper.eq("equipment_id", userEquipment1.getEquipmentId());
// wrapper.eq("user_id", userEquipment1.getUserId());
// wrapper.gt("end_date", DateUtil.date());
// wrapper.lt("start_time", DateUtil.date());
// return userEquipmentMapper.selectCount(wrapper);
// LambdaQueryWrapper<UserEquipment> queryWrapper = new LambdaQueryWrapper<>();
// queryWrapper.eq(UserEquipment::getEquipmentId, userEquipment1.getEquipmentId())
// .eq(UserEquipment::getUserId, userEquipment1.getUserId())
// .gt(UserEquipment::getEndDate, DateUtil.date())
// .lt(UserEquipment::getStartTime, DateUtil.date());
return userEquipmentMapper.selectCountByUserIdAndDeviceId(userEquipment1);
}

View File

@ -1,5 +1,6 @@
package com.ics.admin.service.impl.meeting;
import java.util.ArrayList;
import java.util.List;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
@ -41,8 +42,11 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
*/
@Override
public List<Equipment> selectEquipmentList(Equipment equipment) {
QueryWrapper queryWrapper = new QueryWrapper();
return equipmentMapper.selectList(queryWrapper);
// QueryWrapper queryWrapper = new QueryWrapper();
// queryWrapper.eq(equipment.getParkId() !=null,"park_id", equipment.getParkId());
// queryWrapper.eq(equipment.getTenantId() !=null,"tenant_id", equipment.getTenantId());
//
return equipmentMapper.selectEquipmentList(equipment);
}
/**
@ -89,4 +93,11 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
public int deleteEquipmentById(Long id) {
return equipmentMapper.deleteEquipmentById(id);
}
@Override
public List<Equipment> selectListByIds(List<Long> ids) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.in("id", ids);
return baseMapper.selectList(queryWrapper);
}
}

View File

@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ics.admin.mapper.meeting.VisitorPersonMapper;
import com.ics.admin.domain.meeting.VisitorPerson;
import org.springframework.transaction.annotation.Transactional;
/**
* 预约参观人员Service业务层处理
@ -52,6 +53,9 @@ public class IVisitorPersonServiceImpl extends ServiceImpl<VisitorPersonMapper,
@Override
public List<VisitorPerson> selectReservationPersonList(VisitorPerson visitorPerson) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq(visitorPerson.getParkId() !=null,"park_id", visitorPerson.getParkId());
queryWrapper.eq(visitorPerson.getTenantId() !=null,"tenant_id", visitorPerson.getTenantId());
queryWrapper.eq(CollUtil.isNotEmpty(visitorPerson.getStaffIds()),"interviewee_id", visitorPerson.getStaffIds());
return visitorPersonMapper.selectList(queryWrapper);
}
@ -61,6 +65,7 @@ public class IVisitorPersonServiceImpl extends ServiceImpl<VisitorPersonMapper,
* @param visitorPerson 预约参观人员
* @return 结果
*/
@Transactional
@Override
public int insertReservationPerson(VisitorPerson visitorPerson) {
return visitorPersonMapper.insert(visitorPerson);

View File

@ -31,6 +31,7 @@ import org.springframework.stereotype.Service;
import com.ics.admin.mapper.meeting.ReservationMapper;
import com.ics.admin.domain.meeting.Reservation;
import com.ics.admin.service.meeting.IReservationService;
import org.springframework.transaction.annotation.Transactional;
/**
* 预约记录Service业务层处理
@ -76,6 +77,9 @@ public class ReservationServiceImpl extends ServiceImpl<ReservationMapper, Reser
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.like(null != reservation.getTitle(), "title", reservation.getTitle());
queryWrapper.eq(null != reservation.getStatusValue(), "stauts", reservation.getStatusValue());
queryWrapper.eq(reservation.getParkId() !=null,"park_id", reservation.getParkId());
queryWrapper.eq(reservation.getTenantId() !=null,"tenant_id", reservation.getTenantId());
queryWrapper.eq(reservation.getCustomerId() !=null,"customer_id", reservation.getCustomerId());
queryWrapper.orderByDesc("create_time");
return reservationMapper.selectList(queryWrapper);
}
@ -87,6 +91,7 @@ public class ReservationServiceImpl extends ServiceImpl<ReservationMapper, Reser
* @return 结果
*/
@Override
@Transactional
public int insertReservation(Reservation reservation) {
return reservationMapper.insert(reservation);
}

View File

@ -102,6 +102,10 @@ public class RoomContentServiceImpl extends ServiceImpl<RoomContentMapper, RoomC
queryWrapper.eq(roomContent.getTypeName() !=null,"type", roomContent.getTypeName());
queryWrapper.eq(roomContent.getShape() !=null,"shape", roomContent.getShape());
queryWrapper.eq(roomContent.getCapacityNum() !=null,"capacity_num", roomContent.getCapacityNum());
queryWrapper.eq(roomContent.getParkId() !=null,"park_id", roomContent.getParkId());
queryWrapper.eq(roomContent.getTenantId() !=null,"tenant_id", roomContent.getTenantId());
queryWrapper.eq(roomContent.getRoomId() !=null,"room_id", roomContent.getRoomId());
queryWrapper.in(roomContent.getRoomIds() !=null,"room_id", roomContent.getRoomIds());
return roomContentMapper.selectList(queryWrapper);
}

View File

@ -42,6 +42,9 @@ public class RoomItemServiceImpl extends ServiceImpl<RoomItemMapper, RoomItem> i
@Override
public List<RoomItem> selectRoomItemList(RoomItem roomItem) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.like(StrUtil.isNotBlank(roomItem.getName()), "name", roomItem.getName());
queryWrapper.eq(roomItem.getParkId() !=null,"park_id", roomItem.getParkId());
queryWrapper.eq(roomItem.getTenantId() !=null,"tenant_id", roomItem.getTenantId());
return roomItemMapper.selectList(queryWrapper);
}

View File

@ -52,6 +52,9 @@ public class ShowroomRecordServiceImpl extends ServiceImpl<ShowroomRecordMapper,
@Override
public List<ShowroomRecord> selectShowroomRecordList(ShowroomRecord showroomRecord) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq(showroomRecord.getParkId() !=null,"park_id", showroomRecord.getParkId());
queryWrapper.eq(showroomRecord.getTenantId() !=null,"tenant_id", showroomRecord.getTenantId());
queryWrapper.eq(CollUtil.isNotEmpty(showroomRecord.getStaffIds()),"user_id", showroomRecord.getStaffIds());
return showroomRecordMapper.selectList(queryWrapper);
}
@ -105,14 +108,13 @@ public class ShowroomRecordServiceImpl extends ServiceImpl<ShowroomRecordMapper,
ArrayList<ShowroomRecordDTO> list = new ArrayList<>();
// 根据最近七天查询数据
showroomRecord.setShowroomId(1L);
List<Date> dates = showroomRecordMapper.selectListByDate(showroomRecord.getShowroomId());
for (Date dateTime : dates) {
ShowroomRecordDTO showroomRecordDTO = new ShowroomRecordDTO();
showroomRecordDTO.setNowDate(DateUtil.format(dateTime,"yyyy-MM-dd"));
// 查询会议室记录
QueryWrapper<ShowroomRecord> wrapper = new QueryWrapper<>();
wrapper.eq("showroom_id",1L);
wrapper.eq("showroom_id",showroomRecord.getShowroomId());
wrapper.gt("start_time", DateUtil.format(dateTime,"yyyy-MM-dd")+ " 00:00:00");
wrapper.lt("end_date",DateUtil.format(dateTime,"yyyy-MM-dd") + " 23:59:59");
List<ShowroomRecord> showroomRecords = showroomRecordMapper.selectList(wrapper);
@ -129,7 +131,7 @@ public class ShowroomRecordServiceImpl extends ServiceImpl<ShowroomRecordMapper,
QueryWrapper<ShowroomRecord> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("showroom_id",1L);
queryWrapper.eq("showroom_id",showroomRecord.getShowroomId());
Date startTime = showroomRecord.getStartTime();
Date endDate = showroomRecord.getEndDate();

View File

@ -42,6 +42,10 @@ public class ShowroomServiceImpl extends ServiceImpl<ShowroomMapper, Showroom> i
@Override
public List<Showroom> selectShowroomList(Showroom showroom) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq(showroom.getParkId() !=null,"park_id", showroom.getParkId());
queryWrapper.eq(showroom.getTenantId() !=null,"tenant_id", showroom.getTenantId());
queryWrapper.eq(showroom.getRoomId() !=null,"room_id", showroom.getRoomId());
queryWrapper.eq(showroom.getRoomIds() !=null,"room_id", showroom.getRoomIds());
return showroomMapper.selectList(queryWrapper);
}

View File

@ -2,6 +2,8 @@ package com.ics.admin.service.meeting;
import com.ics.admin.domain.meeting.Equipment;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.ArrayList;
import java.util.List;
/**
@ -58,4 +60,6 @@ public interface IEquipmentService extends IService<Equipment> {
* @return 结果
*/
int deleteEquipmentById(Long id);
List<Equipment> selectListByIds(List<Long> ids);
}

View File

@ -49,6 +49,7 @@
<where>
<if test="buildingName != null and buildingName != ''"> AND ib.building_name LIKE CONCAT('%', #{buildingName}, '%')</if>
<if test="deleteFlag != null"> and ib.delete_flag = #{deleteFlag} </if>
<if test="parkId != null and parkId != ''"> and ib.park_id = #{parkId} </if>
</where>
ORDER BY ib.id DESC
</select>

View File

@ -47,6 +47,7 @@
<result property="deleteFlag" column="delete_flag" />
<result property="tenantId" column="tenant_id" />
<result property="parkId" column="park_id" />
<result property="buildingId" column="building_id" />
<association property="park" javaType="com.ics.admin.domain.Park" resultMap="ParkResult" />
</resultMap>
@ -67,6 +68,7 @@
ic.country,
ic.process,
ic.contacts,
ic.building_id,
ic.phone,
ic.email,
ic.room_id,
@ -109,6 +111,7 @@
<if test="contacts != null and contacts != ''"> AND ic.contacts LIKE CONCAT('%', #{contacts}, '%')</if>
<if test="phone != null and phone != ''"> AND phone LIKE CONCAT('%', #{phone}, '%')</if>
<if test="deleteFlag != null"> and ic.delete_flag = #{deleteFlag} </if>
<if test="parkId != null"> and ic.park_id = #{parkId} </if>
</where>
order by ic.create_time desc
</select>

View File

@ -49,6 +49,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="icsCustomerId != null and icsCustomerId != ''"> AND ics_customer_id = #{icsCustomerId} </if>
<if test="mobile != null and mobile != ''"> AND mobile LIKE CONCAT('%', #{mobile}, '%') </if>
<if test="name != null and name != ''"> AND name LIKE CONCAT('%', #{name}, '%') </if>
<if test="dataType != null and dataType != ''"> AND data_type = #{dataType} </if>
<if test="parkId != null and parkId != ''"> AND park_id = #{parkId} </if>
<if test="tenantId != null and tenantId != ''"> AND tenant_id = #{tenantId} </if>
</where>
</select>
@ -185,6 +188,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkMobileUnique" resultType="java.lang.String">
SELECT count(1) FROM ics_customer_staff WHERE mobile=#{mobile}
</select>
<select id="selectUserByMobile" resultType="com.ics.common.core.domain.IcsCustomerStaff">
<include refid="selectIcsCustomerStaffVo"/>
WHERE mobile=#{mobile}
</select>
</mapper>

View File

@ -120,6 +120,12 @@
<if test="type != null">AND ir.status = #{type}</if>
<if test="isMarketable != null">AND ir.is_marketable = #{isMarketable}</if>
<if test="deleteFlag != null"> and ir.delete_flag = #{deleteFlag} </if>
<if test="buildingDetailIds != null and buildingDetailIds.size() > 0">
AND ir.building_detail_id IN
<foreach collection="buildingDetailIds" item="buildingDetailId" open="(" separator="," close=")">
#{buildingDetailId}
</foreach>
</if>
</where>
ORDER BY ir.create_time DESC
</select>

View File

@ -24,9 +24,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectEquipmentList" parameterType="Equipment" resultMap="EquipmentResult">
<include refid="selectEquipmentVo"/>
<where>
<if test="equipmentName != null and equipmentName != ''"> AND equipment_name LIKE CONCAT('%', #{equipmentName}, '%')</if>
SELECT e.id, e.type, e.equipment_name, e.status, e.equipment_num,e.ip, e.pic, e.delete_flag, e.create_by, e.create_time, e.update_by,
e.update_time,e.park_id,e.tenant_id FROM tb_equipment e
left join tb_room_equipment re on re.equipment_id = e.id
<where>
<if test="equipmentName != null and equipmentName != ''"> AND e.equipment_name LIKE CONCAT('%', #{equipmentName}, '%')</if>
<if test="parkId != null and parkId != ''"> AND e.park_id = #{parkId}</if>
<if test="tenantId != null and tenantId != ''"> AND e.tenant_id = #{tenantId}</if>
<if test="roomId != null and roomId != ''"> AND re.room_id = #{roomId}</if>
<if test="buildingDetailIds != null and buildingDetailIds.size() > 0">
AND re.building_detail_id IN
<foreach collection="buildingDetailIds" item="buildingDetailId" open="(" separator="," close=")">
#{buildingDetailId}
</foreach>
</if>
</where>
</select>

View File

@ -54,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE id = #{id}
</select>
<select id="selectListByDate" resultType="java.util.Date">
select date_format(start_time, '%Y-%m-%d') from tb_reservation where start_time >= date_format(now(), '%Y-%m-%d')
select date_format(start_time, '%Y-%m-%d') from tb_reservation where `stauts` != 4 and start_time >= date_format(now(), '%Y-%m-%d')
and room_content_id = #{roomContentId} group by date_format(start_time, '%Y-%m-%d');
</select>
<select id="todayMeeting" resultType="com.ics.admin.domain.meeting.Reservation">

View File

@ -46,6 +46,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="typeValue != null and typeValue != ''"> AND `type`= #{typeValue}</if>
<if test="capacityNum != null and capacityNum != ''"> AND capacity_num =#{capacityNum}</if>
<if test="shape != null and shape != ''"> AND shape =#{shape}</if>
<if test="parkId != null and parkId != ''"> AND park_id =#{parkId}</if>
<if test="tenantId != null and tenantId != ''"> AND tenant_id =#{tenantId}</if>
and is_show = 0
</where>
</select>

View File

@ -27,7 +27,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectUserEquipmentVo"/>
WHERE id = #{id}
</select>
<select id="selectCountByUserIdAndDeviceId" resultType="java.lang.Integer">
SELECT COUNT(1) FROM tb_user_equipment
WHERE user_id = #{userId} AND equipment_id = #{equipmentId}
AND now() &gt; DATE_SUB(create_time, INTERVAL 15 MINUTE)
AND now() &lt; end_date
</select>
<insert id="insertUserEquipment" parameterType="UserEquipment">
INSERT INTO tb_user_equipment
<trim prefix="(" suffix=")" suffixOverrides=",">

View File

@ -73,14 +73,14 @@ public class BaseEntity<T> implements Serializable {
/**
* 租户Id
*/
// @TableField(fill = FieldFill.INSERT)
@TableField(exist = false)
@TableField(fill = FieldFill.INSERT)
// @TableField(exist = false)
private Long tenantId;
/**
* 关联园区ID
*/
@TableField(fill = FieldFill.INSERT,exist = false)
@TableField(fill = FieldFill.INSERT)
// @TableField(exist = false)
private Long parkId;

View File

@ -3,6 +3,7 @@ package com.ics.common.core.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ics.common.annotation.Excel;
import lombok.Data;
import java.util.Date;
@ -17,23 +18,30 @@ import java.util.Date;
@TableName("ics_customer_staff")
public class IcsCustomerStaff extends BaseEntity<IcsCustomerStaff> {
private static final long serialVersionUID = 1L;
/** 姓名 */
@Excel(name = "微信昵称",type = Excel.Type.EXPORT)
private String username;
@Excel(name = "姓名",type = Excel.Type.EXPORT)
private String name;
private String photo;
@Excel(name = "地址",type = Excel.Type.EXPORT)
private String address;
@Excel(name = "邮箱")
private String email;
@Excel(name = "学历")
private String degree;
@Excel(name = "紧急联系人")
private String urgent;
/** 电话 */
@Excel(name = "手机号")
private String mobile;
/** 企业客户id */
@ -49,6 +57,7 @@ public class IcsCustomerStaff extends BaseEntity<IcsCustomerStaff> {
private String avatar;
/** 用户性别0男 1女 2未知 */
@Excel(name = "性别")
private String gender;
/** 帐号状态0正常 1停用 */
@ -57,10 +66,14 @@ public class IcsCustomerStaff extends BaseEntity<IcsCustomerStaff> {
/** 园区ID */
private Long parkId;
@TableField(exist = false)
private String parkName;
/**证件类型*/
private String cardType;
/**证件号码**/
@Excel(name = "身份证号")
private String cardNo;
/**来访时间*/
@ -95,4 +108,7 @@ public class IcsCustomerStaff extends BaseEntity<IcsCustomerStaff> {
@TableField(exist = false)
private Long staffId;
@TableField(exist = false)
private Integer num;
}

View File

@ -13,11 +13,13 @@ import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.util.HSSFColor.HSSFColorPredefined;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddressList;
import org.apache.poi.util.IOUtils;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFDataValidation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
@ -213,6 +215,11 @@ public class ExcelUtil<T> {
return exportExcel();
}
/**
* 对list数据源将其里面的数据导入到excel表单
*

View File

@ -40,7 +40,15 @@ public class UserController extends BaseController {
@RequiresPermissions("system:user:list")
@GetMapping("get/{userId}")
public User get(@PathVariable("userId") Long userId) {
return userService.selectUserById(userId);
User user = userService.selectUserById(userId);
Long customerId = user.getStaffId();
if (null != customerId){
IcsCustomerStaff customerStaff = userService.selectCustomerStaffById(customerId);
if (null != customerStaff){
user.setStaffPhone(customerStaff.getMobile());
}
}
return user;
}
/**

View File

@ -175,6 +175,9 @@ public class User extends BaseEntity<User> {
*/
private Long staffId;
@TableField
private String parkName;
/**
* 在线用户记录
*/
@ -187,6 +190,10 @@ public class User extends BaseEntity<User> {
@TableField(exist = false)
private List<Long> deptIds;
@TableField(exist = false)
private String staffPhone;
/**
* 是否超管
*

View File

@ -1,5 +1,6 @@
package com.ics.system.mapper;
import com.ics.common.core.domain.IcsCustomerStaff;
import com.ics.system.domain.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -166,4 +167,6 @@ public interface UserMapper {
List<Long> getStaffListByUser();
IcsCustomerStaff selectCustomerStaffById(Long customerId);
}

View File

@ -1,5 +1,6 @@
package com.ics.system.service;
import com.ics.common.core.domain.IcsCustomerStaff;
import com.ics.system.domain.User;
import java.util.List;
@ -202,4 +203,7 @@ public interface IUserService {
Set<Long> selectUserIdsInDepts(Long[] deptIds);
User selectUserByCustomer(Long id);
IcsCustomerStaff selectCustomerStaffById(Long customerId);
}

View File

@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ArrayUtil;
import com.ics.common.annotation.DataScope;
import com.ics.common.constant.UserConstants;
import com.ics.common.core.domain.IcsCustomerStaff;
import com.ics.common.core.text.Convert;
import com.ics.common.exception.BusinessException;
import com.ics.common.utils.StringUtils;
@ -418,4 +419,12 @@ public class UserServiceImpl implements IUserService {
return userMapper.selectUserByCustomer(id);
}
@Override
public IcsCustomerStaff selectCustomerStaffById(Long customerId) {
return userMapper.selectCustomerStaffById(customerId);
}
}

View File

@ -283,9 +283,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getStaffListByUser" resultType="java.lang.Long">
SELECT staff_id FROM sys_user where staff_id is not null GROUP BY staff_id
</select>
<select id="selectCustomerStaffById" resultType="com.ics.common.core.domain.IcsCustomerStaff">
SELECT id, username, mobile, create_by, create_time, update_by,name,photo,address,email,degree,urgent, update_time, delete_flag, ics_customer_id, openid, avatar, gender, status, park_id,card_no, visit_time,
leave_time,visit_content,to_name,to_phone,to_customer,to_customer_id,data_type
FROM ics_customer_staff
where id = #{customerId}
</select>
<delete id="deleteUserById" parameterType="Long">
<delete id="deleteUserById" parameterType="Long">
DELETE FROM sys_user WHERE id = #{id}
</delete>

View File

@ -3,7 +3,9 @@ package com.ics.controller.mobile;
import cn.binarywang.wx.miniapp.api.WxMaService;
import com.alibaba.fastjson.JSONObject;
import com.ics.admin.domain.Park;
import com.ics.admin.service.IIcsCustomerStaffService;
import com.ics.admin.service.IParkService;
import com.ics.common.constant.Constants;
import com.ics.common.core.controller.BaseController;
import com.ics.common.core.domain.IcsCustomerStaff;
@ -51,6 +53,9 @@ public class WxLoginAPIController extends BaseController {
@Autowired
private RedisTemplate<String, String> redisTemplate;
@Autowired
private IParkService parkService;
String smallWxAccessTokenKey = "smallWxAccessToken";
String smallWxUserPassword = "123456";
@ -77,6 +82,11 @@ public class WxLoginAPIController extends BaseController {
IcsCustomerStaff sysUser = icsCustomerStaffService.selectUserByOpenid(openid);
// 用户存在直接获取token
if (sysUser != null) {
Long parkId = sysUser.getParkId();
if (parkId !=null){
Park park = parkService.selectParkById(parkId);
sysUser.setParkName(park.getName());
}
String phonenumber = sysUser.getMobile();
User user = new User();
PublishFactory.recordLoginInfo(sysUser.getUsername(), Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"));
@ -124,7 +134,11 @@ public class WxLoginAPIController extends BaseController {
customerStaff.setOpenid(openid);
icsCustomerStaffService.updateIcsCustomerStaff(customerStaff);
}
Long parkId = customerStaff.getParkId();
if (parkId !=null){
Park park = parkService.selectParkById(parkId);
customerStaff.setParkName(park.getName());
}
User user = new User();
PublishFactory.recordLoginInfo(customerStaff.getUsername(), Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"));

View File

@ -431,9 +431,9 @@ public class ApiRoomContentController extends BaseController {
*/
@RequiresPermissions("member:center:view")
@GetMapping("/selectCoordinate")
public R selectCoordinate() {
public R selectCoordinate(Long parkId) {
//根据用户获取对应的企业id查询该企业下对应的优惠卷
Park park = parkService.selectParkById(1L);
Park park = parkService.selectParkById(parkId);
return R.ok().put("lat", park.getLat()).put("lng", park.getLng()).put("address", park.getAddress());
}

View File

@ -74,7 +74,7 @@ public class ApiRoomController extends BaseController {
/**
* 获取房间内容
*/
@Ignore
@RequiresPermissions("member:center:view")
@PostMapping("list")
public R list() {
List<RoomContent> roomContents = roomContentService.selectApiRoomList(new RoomContent());
@ -91,7 +91,7 @@ public class ApiRoomController extends BaseController {
/**
* 查询今日的会议和正常进行的会议
*/
@Ignore
@RequiresPermissions("member:center:view")
@PostMapping("todayMeeting")
public R todayMeeting(@RequestBody RoomContent roomContent) {
List<Reservation> roomContents=roomContentService.todayMeeting(roomContent);
@ -99,12 +99,15 @@ public class ApiRoomController extends BaseController {
}
/**
* 查询所有的园区
*/
@RequiresPermissions("member:center:view")
@GetMapping("selectParkList")
public R selectParkList() {
List<Park> parkList = parkService.selectParkList(new Park());
return R.data(parkList);
}
}

View File

@ -200,6 +200,37 @@ public class ApiVisitorController extends BaseController {
person.setReviewers(person.getUserId());
person.setReviewersTime(new Date());
int update = visitorPersonService.updateVisitorPersonStatus(person);
if (update > 0){
String s = DeviceUtils.queryPersons(String.valueOf(person.getIntervieweeId()));
JSONObject jsonObject = JSONUtil.parseObj(s);
Integer amount = (Integer) jsonObject.get("amount");
if (amount > 0){
//todo 需要修改 到底是按照访客时间
return toAjax(1);
}
// Assert.isTrue(IdcardUtil.isValidCard(person.getCardNo()), "身份证格式不正确");
// Assert.isTrue(Validator.isPlateNumber(person.getPhone()), "手机号格式不正确");
DevicePersonDto devicePersonDto = new DevicePersonDto();
ArrayList<FacesDto> facesDtos = new ArrayList<>();
devicePersonDto.setPersonId(String.valueOf(person.getIntervieweeId()));
devicePersonDto.setName(person.getName());
devicePersonDto.setPhone(String.valueOf(person.getPhone()));
devicePersonDto.setCertificateType("111");
devicePersonDto.setCertificateNumber(person.getCardNo());
//添加人员类型
devicePersonDto.setPersonType("visitor");
//添加访客时间
devicePersonDto.setVisitorValidStartTime(DateUtil.format(person.getVisitTime(), "yyyy-MM-dd'T'HH:mm:ss"));
devicePersonDto.setVisitorValidEndTime(DateUtil.format(person.getLeaveTime(), "yyyy-MM-dd'T'HH:mm:ss"));
FacesDto facesDto = new FacesDto();
facesDto.setFaceId(String.valueOf(person.getUserId()));
String faceData =BASE64_PREFIX+ UrlToBase64Util.imageUrlToBase64(person.getUrl());
facesDto.setData(faceData);
facesDtos.add(facesDto);
devicePersonDto.setFaces(facesDtos);
DeviceUtils.addPersons(devicePersonDto);
}
return toAjax(update);
}
@ -226,39 +257,11 @@ public class ApiVisitorController extends BaseController {
@PostMapping("visitorPerson")
public R visitorPerson(@RequestBody VisitorPerson person) {
person.setStatus(0);
boolean save = visitorPersonService.save(person);
Assert.isTrue(save, "添加访客预约失败");
int i = visitorPersonService.insertReservationPerson(person);
Assert.isTrue(i>0, "添加访客预约失败");
//添加成功后需要 往设备中添加一条数据
String s = DeviceUtils.queryPersons(String.valueOf(person.getIntervieweeId()));
JSONObject jsonObject = JSONUtil.parseObj(s);
Integer amount = (Integer) jsonObject.get("amount");
if (amount > 0){
//todo 需要修改 到底是按照访客时间
return toAjax(save);
}
// Assert.isTrue(IdcardUtil.isValidCard(person.getCardNo()), "身份证格式不正确");
// Assert.isTrue(Validator.isPlateNumber(person.getPhone()), "手机号格式不正确");
DevicePersonDto devicePersonDto = new DevicePersonDto();
ArrayList<FacesDto> facesDtos = new ArrayList<>();
devicePersonDto.setPersonId(String.valueOf(person.getIntervieweeId()));
devicePersonDto.setName(person.getName());
devicePersonDto.setPhone(String.valueOf(person.getPhone()));
devicePersonDto.setCertificateType("111");
devicePersonDto.setCertificateNumber(person.getCardNo());
//添加人员类型
devicePersonDto.setPersonType("visitor");
//添加访客时间
devicePersonDto.setVisitorValidStartTime(DateUtil.format(person.getVisitTime(), "yyyy-MM-dd'T'HH:mm:ss"));
devicePersonDto.setVisitorValidEndTime(DateUtil.format(person.getLeaveTime(), "yyyy-MM-dd'T'HH:mm:ss"));
FacesDto facesDto = new FacesDto();
facesDto.setFaceId(String.valueOf(person.getUserId()));
String faceData =BASE64_PREFIX+ UrlToBase64Util.imageUrlToBase64(person.getUrl());
facesDto.setData(faceData);
facesDtos.add(facesDto);
devicePersonDto.setFaces(facesDtos);
DeviceUtils.addPersons(devicePersonDto);
return toAjax(save);
return toAjax(i);
}
/**