mirror of
https://gitee.com/elegant_wings/xiongan-meeting.git
synced 2025-06-21 03:49:36 +08:00
新增了平板的对应接口,修改了PC页面的优惠卷接口
This commit is contained in:
parent
de96a45eda
commit
52d615d5a9
@ -14,6 +14,8 @@ import com.ics.admin.domain.meeting.Reservation;
|
||||
import com.ics.admin.service.meeting.IReservationService;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 预约记录 提供者
|
||||
*
|
||||
@ -42,7 +44,11 @@ public class ReservationController extends BaseController {
|
||||
@GetMapping("list")
|
||||
public R list(Reservation reservation) {
|
||||
startPage();
|
||||
return result(reservationService.selectReservationList(reservation));
|
||||
List<Reservation> reservations = reservationService.selectReservationList(reservation);
|
||||
for (Reservation reservation1 : reservations) {
|
||||
//会议室名称
|
||||
}
|
||||
return result(reservations);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,7 +1,12 @@
|
||||
package com.ics.admin.controller.meeting;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import com.ics.admin.domain.Customer;
|
||||
import com.ics.admin.domain.meeting.CustomerTicket;
|
||||
import com.ics.admin.service.ICustomerService;
|
||||
import com.ics.admin.service.meeting.ICustomerTicketService;
|
||||
import com.ics.system.domain.User;
|
||||
import com.ics.system.service.IUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -20,7 +25,9 @@ import org.wf.jwtp.annotation.Ignore;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 优惠卷 提供者
|
||||
@ -41,12 +48,24 @@ public class TicketController extends BaseController {
|
||||
@Autowired
|
||||
private IUserService userService;
|
||||
|
||||
@Autowired
|
||||
private ICustomerTicketService customerTicketService;
|
||||
|
||||
/**
|
||||
* 查询优惠卷
|
||||
*/
|
||||
@Ignore
|
||||
@GetMapping("get/{id}")
|
||||
public Ticket get(@PathVariable("id") Long id) {
|
||||
return ticketService.selectTicketById(id);
|
||||
Ticket ticket = ticketService.selectTicketById(id);
|
||||
List<CustomerTicket> customerTickets = customerTicketService.selectCustomerTicketByTicketId(id);
|
||||
|
||||
List<Long> collect = customerTickets.stream().map(item -> {
|
||||
return item.getCustomerId();
|
||||
}).collect(Collectors.toList());
|
||||
Long[] array = collect.toArray(new Long[collect.size()]);
|
||||
ticket.setEnterpriseIds(array);
|
||||
return ticket;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -66,6 +85,32 @@ public class TicketController extends BaseController {
|
||||
@RequiresPermissions("meeting:ticket:add")
|
||||
@PostMapping("save")
|
||||
public R addSave(@RequestBody Ticket ticket) {
|
||||
System.out.println(ticket);
|
||||
CustomerTicket customerTicket = customerTicketService.selectCustomerTicketById(ticket.getId());
|
||||
// if (ticket.getType() == 1){
|
||||
// for (int j = 0; j < ticket.get; j++) {
|
||||
//
|
||||
// }
|
||||
if (customerTicket ==null){
|
||||
if (ticket.getType() == 1) {
|
||||
for (Long enterpriseId : ticket.getEnterpriseIds()) {
|
||||
|
||||
CustomerTicket customerTicket1 = new CustomerTicket();
|
||||
customerTicket1.setTicketId(ticket.getId());
|
||||
customerTicket1.setCustomerId(enterpriseId);
|
||||
customerTicket1.setIsVerification(0);
|
||||
customerTicketService.insertCustomerTicket(customerTicket1);
|
||||
}
|
||||
}else {
|
||||
for (Long enterpriseId : ticket.getEnterpriseIds()) {
|
||||
CustomerTicket customerTicket1 = new CustomerTicket();
|
||||
customerTicket1.setTicketId(ticket.getId());
|
||||
customerTicket1.setCustomerId(enterpriseId);
|
||||
customerTicket1.setIsVerification(0);
|
||||
customerTicketService.insertCustomerTicket(customerTicket1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return toAjax(ticketService.insertTicket(ticket));
|
||||
}
|
||||
|
||||
@ -75,7 +120,37 @@ public class TicketController extends BaseController {
|
||||
@RequiresPermissions("meeting:ticket:edit")
|
||||
@PostMapping("update")
|
||||
public R editSave(@RequestBody Ticket ticket) {
|
||||
return toAjax(ticketService.updateTicket(ticket));
|
||||
int i = ticketService.updateTicket(ticket);
|
||||
Assert.isTrue(i == 1, "修改失败");
|
||||
//修改企业和优惠卷数据 如果类型是 抵用卷,循环添加,如果是优惠卷,添加一条
|
||||
|
||||
CustomerTicket customerTicket = customerTicketService.selectCustomerTicketById(ticket.getId());
|
||||
// if (ticket.getType() == 1){
|
||||
// for (int j = 0; j < ticket.get; j++) {
|
||||
//
|
||||
// }
|
||||
if (customerTicket ==null){
|
||||
if (ticket.getType() == 1) {
|
||||
for (Long enterpriseId : ticket.getEnterpriseIds()) {
|
||||
// 循环数量
|
||||
CustomerTicket customerTicket1 = new CustomerTicket();
|
||||
customerTicket1.setTicketId(ticket.getId());
|
||||
customerTicket1.setCustomerId(enterpriseId);
|
||||
customerTicket1.setIsVerification(0);
|
||||
customerTicketService.insertCustomerTicket(customerTicket1);
|
||||
}
|
||||
}else {
|
||||
for (Long enterpriseId : ticket.getEnterpriseIds()) {
|
||||
CustomerTicket customerTicket1 = new CustomerTicket();
|
||||
customerTicket1.setTicketId(ticket.getId());
|
||||
customerTicket1.setCustomerId(enterpriseId);
|
||||
customerTicket1.setIsVerification(0);
|
||||
customerTicketService.insertCustomerTicket(customerTicket1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return toAjax(i);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -186,5 +186,7 @@ public class Repair extends BaseEntity<Repair> {
|
||||
@TableField(exist = false)
|
||||
private User user;
|
||||
|
||||
private Long parkId;
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.ics.admin.domain.meeting;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ics.common.core.domain.BaseEntity;
|
||||
@ -29,6 +30,8 @@ public class Ticket extends BaseEntity<Ticket> {
|
||||
/** 金额 */
|
||||
private Integer duration;
|
||||
|
||||
private String discount;
|
||||
|
||||
/** 地址 */
|
||||
private String address;
|
||||
|
||||
@ -52,4 +55,7 @@ public class Ticket extends BaseEntity<Ticket> {
|
||||
/** 是否默认 */
|
||||
private String isDefault;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Long[] enterpriseIds;
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.ics.admin.mapper.meeting;
|
||||
|
||||
import com.ics.admin.domain.meeting.Reservation;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ics.admin.domain.meeting.RoomContent;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Date;
|
||||
@ -65,4 +66,5 @@ public interface ReservationMapper extends BaseMapper<Reservation> {
|
||||
|
||||
List<Date> selectListByDate(Long meetingRoomId);
|
||||
|
||||
List<Reservation> todayMeeting(Long id);
|
||||
}
|
||||
|
@ -61,4 +61,6 @@ public interface RoomContentMapper extends BaseMapper<RoomContent> {
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteRoomContentByIds(String[] ids);
|
||||
|
||||
List<RoomContent> todayMeeting(Long id);
|
||||
}
|
||||
|
@ -134,4 +134,12 @@ public class CustomerTicketServiceImpl extends ServiceImpl<CustomerTicketMapper,
|
||||
customerTicket1.setIsVerification(1);
|
||||
baseMapper.updateCustomerTicket(customerTicket1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CustomerTicket> selectCustomerTicketByTicketId(Long id) {
|
||||
QueryWrapper<CustomerTicket> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("ticket_id", id);
|
||||
wrapper.groupBy("customer_id");
|
||||
return customerTicketMapper.selectList(wrapper);
|
||||
}
|
||||
}
|
||||
|
@ -161,6 +161,12 @@ public class ReservationServiceImpl extends ServiceImpl<ReservationMapper, Reser
|
||||
// duration去判断优惠卷
|
||||
if (null != reservation.getTicketId()){
|
||||
Ticket ticket = ticketMapper.selectTicketById(reservation.getTicketId());
|
||||
if (ticket.getDuration() ==null){
|
||||
String discount = ticket.getDiscount();
|
||||
BigDecimal paidMoney = new BigDecimal(roomContent.getMoney()).multiply(new BigDecimal(discount));
|
||||
meetingAmountVo.setPaidMoney(paidMoney);
|
||||
return meetingAmountVo;
|
||||
}
|
||||
// 获取优惠卷时长
|
||||
Integer duration1 = ticket.getDuration();
|
||||
if (duration1>duration){
|
||||
@ -186,6 +192,13 @@ public class ReservationServiceImpl extends ServiceImpl<ReservationMapper, Reser
|
||||
meetingAmountVo.setTotalMoney(totalMoney);
|
||||
if (null != reservation.getTicketId()) {
|
||||
Ticket ticket = ticketMapper.selectTicketById(reservation.getTicketId());
|
||||
if (ticket.getDuration() ==null){
|
||||
String discount = ticket.getDiscount();
|
||||
BigDecimal paidMoney = new BigDecimal(roomContent.getMoney()).multiply(new BigDecimal(discount));
|
||||
meetingAmountVo.setPaidMoney(paidMoney);
|
||||
return meetingAmountVo;
|
||||
}
|
||||
|
||||
// 获取优惠卷时长
|
||||
Integer duration1 = ticket.getDuration();
|
||||
if (duration1 > hour) {
|
||||
|
@ -19,8 +19,11 @@ import com.ics.admin.mapper.meeting.ReservationMapper;
|
||||
import com.ics.admin.mapper.meeting.RoomItemByRoomMapper;
|
||||
import com.ics.admin.mapper.meeting.RoomServeByRoomMapper;
|
||||
import com.ics.admin.service.IBuildingDetailService;
|
||||
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.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ics.admin.mapper.meeting.RoomContentMapper;
|
||||
@ -64,6 +67,9 @@ public class RoomContentServiceImpl extends ServiceImpl<RoomContentMapper, RoomC
|
||||
@Autowired
|
||||
private ReservationMapper reservationMapper;
|
||||
|
||||
@Autowired
|
||||
private IIcsCustomerStaffService staffService;
|
||||
|
||||
/**
|
||||
* 查询房间主体内容
|
||||
*
|
||||
@ -374,4 +380,17 @@ public class RoomContentServiceImpl extends ServiceImpl<RoomContentMapper, RoomC
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Reservation> todayMeeting(RoomContent roomContent) {
|
||||
|
||||
//查询当前之前以后,当前时间是否包含在会议室
|
||||
List<Reservation> reservations = reservationMapper.todayMeeting(roomContent.getId());
|
||||
for (Reservation reservation : reservations) {
|
||||
Long userId = reservation.getUserId();
|
||||
IcsCustomerStaff customerStaff = staffService.selectIcsCustomerStaffById(userId);
|
||||
reservation.setUserName(customerStaff.getUsername());
|
||||
}
|
||||
return reservations;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -65,4 +65,5 @@ public interface ICustomerTicketService extends IService<CustomerTicket> {
|
||||
|
||||
void updateCustomerTicketBYUserId(CustomerTicket customerTicket);
|
||||
|
||||
List<CustomerTicket> selectCustomerTicketByTicketId(Long id);
|
||||
}
|
||||
|
@ -75,4 +75,6 @@ public interface IRoomContentService extends IService<RoomContent> {
|
||||
int roomServeByRoom(RoomServeByRoom roomServeByRoom);
|
||||
|
||||
int addItemServe(RoomItemByRoom roomItemByRoom);
|
||||
|
||||
List<Reservation> todayMeeting(RoomContent roomContent);
|
||||
}
|
||||
|
@ -37,7 +37,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<sql id="selectReservationVo">
|
||||
SELECT id, room_content_id, user_id, ticket_id,
|
||||
customer_id, title, stauts,serve_id,end_date, is_after_sale,
|
||||
oder_number,reservation_number, order_money, cancel_time, cancel_resaon, visit_type, explain_need_type, meeting_need_type, photograph_type, start_time, end_time, delete_flag, create_by, create_time, update_by, update_time, remake FROM tb_reservation
|
||||
oder_number,reservation_number, order_money, cancel_time,
|
||||
cancel_resaon, visit_type, explain_need_type, meeting_need_type, photograph_type, start_time,
|
||||
delete_flag, create_by, create_time, update_by, update_time, remake FROM tb_reservation
|
||||
</sql>
|
||||
|
||||
<select id="selectReservationList" parameterType="Reservation" resultMap="ReservationResult">
|
||||
@ -54,6 +56,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
select date_format(start_time, '%Y-%m-%d') from tb_reservation where 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">
|
||||
<include refid="selectReservationVo"/>
|
||||
WHERE
|
||||
(
|
||||
DATE_FORMAT( start_time, '%Y-%m-%d' ) =
|
||||
DATE_FORMAT( NOW(), '%Y-%m-%d' ))
|
||||
and
|
||||
((
|
||||
DATE_FORMAT( start_time, '%Y-%m-%d %H:%i:%S' ) <
|
||||
DATE_FORMAT( NOW(), '%Y-%m-%d %H:%i:%S' ))
|
||||
OR (
|
||||
DATE_FORMAT( end_date, '%Y-%m-%d %H:%i:%S' ) >
|
||||
DATE_FORMAT( NOW(), '%Y-%m-%d %H:%i:%S' )
|
||||
AND DATE_FORMAT( start_time, '%Y-%m-%d %H:%i:%S' ) >
|
||||
DATE_FORMAT( NOW(), '%Y-%m-%d %H:%i:%S' )))
|
||||
and room_content_id =#{id}
|
||||
ORDER BY start_time ASC
|
||||
|
||||
</select>
|
||||
|
||||
<insert id="insertReservation" parameterType="Reservation">
|
||||
INSERT INTO tb_reservation
|
||||
|
@ -52,7 +52,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<include refid="selectRoomContentVo"/>
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="todayMeeting" resultType="com.ics.admin.domain.meeting.RoomContent">
|
||||
<include refid="selectRoomContentVo"/>
|
||||
WHERE
|
||||
(
|
||||
DATE_FORMAT( start_time, '%Y-%m-%d' ) =
|
||||
DATE_FORMAT( NOW(), '%Y-%m-%d' ))
|
||||
and
|
||||
(
|
||||
DATE_FORMAT( start_time, '%Y-%m-%d %H:%i:%S' ) <
|
||||
DATE_FORMAT( NOW(), '%Y-%m-%d %H:%i:%S' ))
|
||||
OR (
|
||||
DATE_FORMAT( end_date, '%Y-%m-%d %H:%i:%S' ) >
|
||||
DATE_FORMAT( NOW(), '%Y-%m-%d %H:%i:%S' )
|
||||
AND DATE_FORMAT( start_time, '%Y-%m-%d %H:%i:%S' ) >
|
||||
DATE_FORMAT( NOW(), '%Y-%m-%d %H:%i:%S' ))
|
||||
and id =#{id}
|
||||
ORDER BY start_time ASC
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<insert id="insertRoomContent" parameterType="RoomContent">
|
||||
INSERT INTO tb_room_content
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
@ -10,6 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="content" column="content" />
|
||||
<result property="type" column="type" />
|
||||
<result property="duration" column="duration" />
|
||||
<result property="discount" column="discount" />
|
||||
<result property="address" column="address" />
|
||||
<result property="isVerification" column="is_verification" />
|
||||
<result property="isShow" column="is_show" />
|
||||
@ -26,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTicketVo">
|
||||
SELECT id, title, content, type, duration, address, is_verification, is_show, start_time, end_date, remark, is_default, version, delete_flag, create_by, create_time, update_by, update_time FROM tb_ticket
|
||||
SELECT id, title, content, type, duration, address, is_verification,discount, is_show, start_time, end_date, remark, is_default, version, delete_flag, create_by, create_time, update_by, update_time FROM tb_ticket
|
||||
</sql>
|
||||
|
||||
<select id="selectTicketList" parameterType="Ticket" resultMap="TicketResult">
|
||||
@ -47,6 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="content != null and content != ''">content,</if>
|
||||
<if test="type != null ">type,</if>
|
||||
<if test="duration != null and duration != ''">duration,</if>
|
||||
<if test="discount != null and discount != ''">discount,</if>
|
||||
<if test="address != null and address != ''">address,</if>
|
||||
<if test="isVerification != null ">is_verification,</if>
|
||||
<if test="isShow != null ">is_show,</if>
|
||||
@ -66,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="content != null and content != ''">#{content},</if>
|
||||
<if test="type != null ">#{type},</if>
|
||||
<if test="duration != null and duration != ''">#{duration},</if>
|
||||
<if test="discount != null and discount != ''">#{discount},</if>
|
||||
<if test="address != null and address != ''">#{address},</if>
|
||||
<if test="isVerification != null ">#{isVerification},</if>
|
||||
<if test="isShow != null ">#{isShow},</if>
|
||||
@ -89,6 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="content != null and content != ''">content = #{content},</if>
|
||||
<if test="type != null ">type = #{type},</if>
|
||||
<if test="duration != null and duration != ''">duration = #{duration},</if>
|
||||
<if test="discount != null and discount != ''">discount = #{discount},</if>
|
||||
<if test="address != null and address != ''">address = #{address},</if>
|
||||
<if test="isVerification != null ">is_verification = #{isVerification},</if>
|
||||
<if test="isShow != null ">is_show = #{isShow},</if>
|
||||
|
@ -58,6 +58,7 @@ public class ActivityAPIController extends BaseController {
|
||||
public R list(Activity activity) {
|
||||
List<Map> activityMaps = Lists.newArrayList();
|
||||
startPage();
|
||||
activity.setParkId(1L);
|
||||
List<Activity> activities = activityService.selectActivityAppList(activity);
|
||||
if (CollectionUtil.isNotEmpty(activities)) {
|
||||
for (Activity item : activities) {
|
||||
|
@ -103,6 +103,32 @@ public class ApiEquipmentController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 扫描二维码开门 用户id 和设备id
|
||||
*/
|
||||
@RequiresPermissions("member:center:view")
|
||||
@PostMapping("/scanOpenDoor")
|
||||
public R scanOpenDoor( RoomRecord roomRecord){
|
||||
|
||||
// long currentUserId = getCurrentUserId();
|
||||
// roomRecord.setUserId(currentUserId);
|
||||
// 对比personId 和用户 id,
|
||||
// 对比equipmentId 和设备id
|
||||
String ip = equipmentService.selectEquipmentById(roomRecord.getDeviceId()).getIp();
|
||||
String openlock = DeviceUtils.openlock(ip);
|
||||
JSONObject jsonObject = JSONUtil.parseObj(openlock);
|
||||
Integer code = (Integer) jsonObject.get("status");
|
||||
Assert.isTrue(code == 0,"开门失败");
|
||||
|
||||
int i = roomRecordService.insertRoomRecord(roomRecord);
|
||||
Assert.isTrue(i == 1,"开门失败");
|
||||
|
||||
return R.ok("开门成功");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -324,6 +324,10 @@ public class ApiRoomContentController extends BaseController {
|
||||
return toAjax(i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,104 @@
|
||||
package com.ics.controller.mobile.meeting;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.ics.admin.domain.BuildingDetail;
|
||||
import com.ics.admin.domain.Park;
|
||||
import com.ics.admin.domain.Room;
|
||||
import com.ics.admin.domain.meeting.*;
|
||||
import com.ics.admin.domain.meeting.vo.MeetingAmountVo;
|
||||
import com.ics.admin.domain.meeting.vo.UserCustomerVo;
|
||||
import com.ics.admin.mapper.meeting.RoomContentMapper;
|
||||
import com.ics.admin.mapper.meeting.RoomEquipmentMapper;
|
||||
import com.ics.admin.service.*;
|
||||
import com.ics.admin.service.meeting.*;
|
||||
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.page.PageDomain;
|
||||
import com.ics.common.core.page.TableSupport;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.wf.jwtp.annotation.Ignore;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/api/room")
|
||||
public class ApiRoomController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IRoomContentService roomContentService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private ICustomerTicketService customerTicketService;
|
||||
|
||||
@Autowired
|
||||
private IReservationService reservationService;
|
||||
|
||||
@Autowired
|
||||
private IReservationPersonService reservationPersonService;
|
||||
|
||||
@Autowired
|
||||
private ICustomerService customerService;
|
||||
|
||||
@Autowired
|
||||
private RoomContentMapper roomContentMapper;
|
||||
|
||||
@Autowired
|
||||
private IRoomService roomService;
|
||||
|
||||
@Autowired
|
||||
private IBuildingDetailService buildingDetailService;
|
||||
|
||||
@Autowired
|
||||
private IIcsCustomerStaffService customerStaffService;
|
||||
|
||||
@Autowired
|
||||
private ITicketService ticketService;
|
||||
|
||||
@Autowired
|
||||
private IParkService parkService;
|
||||
|
||||
@Autowired
|
||||
private RoomEquipmentMapper roomEquipmentMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 获取房间内容
|
||||
*/
|
||||
@Ignore
|
||||
@PostMapping("list")
|
||||
public R list() {
|
||||
List<RoomContent> roomContents = roomContentService.selectApiRoomList(new RoomContent());
|
||||
|
||||
return R.data(roomContents);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询今日的会议和正常进行的会议
|
||||
*/
|
||||
@Ignore
|
||||
@PostMapping("todayMeeting")
|
||||
public R todayMeeting(@RequestBody RoomContent roomContent) {
|
||||
List<Reservation> roomContents=roomContentService.todayMeeting(roomContent);
|
||||
return R.data(roomContents);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -7,14 +7,12 @@ import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.ics.admin.domain.Customer;
|
||||
import com.ics.admin.domain.ServiceBanner;
|
||||
import com.ics.admin.domain.meeting.Reservation;
|
||||
import com.ics.admin.domain.meeting.VisitorPerson;
|
||||
import com.ics.admin.domain.meeting.vo.VisitorPersonVo;
|
||||
import com.ics.admin.mapper.meeting.RoomContentMapper;
|
||||
import com.ics.admin.service.IBuildingDetailService;
|
||||
import com.ics.admin.service.ICustomerService;
|
||||
import com.ics.admin.service.IIcsCustomerStaffService;
|
||||
import com.ics.admin.service.IRoomService;
|
||||
import com.ics.admin.service.*;
|
||||
import com.ics.admin.service.meeting.IReservationPersonService;
|
||||
import com.ics.admin.service.meeting.IVisitorPersonService;
|
||||
import com.ics.common.core.controller.BaseController;
|
||||
@ -28,6 +26,7 @@ import com.ics.common.utils.DeviceUtils;
|
||||
import com.ics.common.utils.UrlToBase64Util;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
@ -68,6 +67,9 @@ public class ApiVisitorController extends BaseController {
|
||||
@Autowired
|
||||
private IBuildingDetailService buildingDetailService;
|
||||
|
||||
@Autowired
|
||||
private IServiceBannerService bannerService;
|
||||
|
||||
/**
|
||||
* 获取所有的企业
|
||||
*/
|
||||
@ -87,9 +89,6 @@ public class ApiVisitorController extends BaseController {
|
||||
List<IcsCustomerStaff> customers = customerStaffService.selectUserByCustomer(customerId);
|
||||
return result(customers);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 被访客记录
|
||||
*/
|
||||
@ -255,14 +254,14 @@ public class ApiVisitorController extends BaseController {
|
||||
return toAjax(save);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 访客预约记录
|
||||
// */
|
||||
// @GetMapping("/selectVisitorRecordByIntervieweeId/{userId}")
|
||||
// public R selectVisitorRecordByIntervieweeId(@PathVariable Long userId){
|
||||
// List<VisitorPerson> list = visitorPersonService.selectVisitorRecordByIntervieweeId(userId);
|
||||
// return R.ok().put("list", list);
|
||||
// }
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
@RequiresPermissions("member:center:view")
|
||||
@GetMapping("/carousel")
|
||||
public R carousel(){
|
||||
|
||||
return R.data(bannerService.selectServiceBannerList(new ServiceBanner()));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,7 +3,10 @@ package com.ics.controller.mobile.member;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import com.ics.admin.domain.Customer;
|
||||
import com.ics.admin.domain.Park;
|
||||
import com.ics.admin.service.ICustomerService;
|
||||
import com.ics.admin.service.IIcsCustomerStaffService;
|
||||
import com.ics.admin.service.IParkService;
|
||||
import com.ics.admin.vo.ParkVO;
|
||||
import com.ics.admin.domain.Repair;
|
||||
@ -11,6 +14,7 @@ import com.ics.admin.domain.RepairLog;
|
||||
import com.ics.admin.vo.RepairVO;
|
||||
import com.ics.common.annotation.LoginUser;
|
||||
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.utils.DateUtils;
|
||||
import com.ics.common.utils.StringUtils;
|
||||
@ -45,6 +49,9 @@ public class RepairAPIController extends BaseController {
|
||||
@Autowired
|
||||
private IParkService parkService;
|
||||
|
||||
@Autowired
|
||||
private IIcsCustomerStaffService icsCustomerStaffService;
|
||||
|
||||
/**
|
||||
* 查询工单管理
|
||||
*/
|
||||
@ -83,11 +90,13 @@ public class RepairAPIController extends BaseController {
|
||||
*/
|
||||
@RequiresPermissions("member:center:view")
|
||||
@GetMapping("list")
|
||||
public R list(Repair.Status status, @LoginUser User user, Long parkId) {
|
||||
public R list(Repair.Status status, Long parkId) {
|
||||
long currentUserId = getCurrentUserId();
|
||||
IcsCustomerStaff staff = icsCustomerStaffService.selectIcsCustomerStaffById(currentUserId);
|
||||
Repair repair = new Repair();
|
||||
repair.setStatus(status);
|
||||
repair.setCreateBy(user.getUsername());
|
||||
repair.setParkId(parkId);
|
||||
repair.setCreateBy(staff.getUsername());
|
||||
repair.setParkId(1L);
|
||||
startPage();
|
||||
List<Repair> repairList = repairService.selectMyRepairList(repair);
|
||||
List<Map<String, Object>> repairVOList = Lists.newArrayList();
|
||||
@ -110,12 +119,14 @@ public class RepairAPIController extends BaseController {
|
||||
*/
|
||||
@RequiresPermissions("member:center:view")
|
||||
@GetMapping("/add")
|
||||
public R add(@LoginUser User user) {
|
||||
public R add() {
|
||||
Map<String, Object> map = Maps.newHashMap();
|
||||
map.put("userId", user.getId());
|
||||
map.put("mobile", user.getMobile());
|
||||
map.put("username", user.getUsername());
|
||||
map.put("nickname", user.getNickname());
|
||||
long currentUserId = getCurrentUserId();
|
||||
IcsCustomerStaff staff = icsCustomerStaffService.selectIcsCustomerStaffById(currentUserId);
|
||||
|
||||
map.put("userId", staff.getId());
|
||||
map.put("mobile", staff.getMobile());
|
||||
map.put("username", staff.getUsername());
|
||||
map.put("area", "");
|
||||
map.put("content", "");
|
||||
return R.data(map);
|
||||
@ -126,16 +137,17 @@ public class RepairAPIController extends BaseController {
|
||||
*/
|
||||
@RequiresPermissions("member:center:view")
|
||||
@PostMapping("save")
|
||||
public R addSave(@RequestBody Repair repair, @LoginUser User user, Long parkId) {
|
||||
if (parkId == null) {
|
||||
return R.error("请选择园区!!");
|
||||
}
|
||||
public R addSave(@RequestBody Repair repair, Long parkId) {
|
||||
long currentUserId = getCurrentUserId();
|
||||
IcsCustomerStaff staff = icsCustomerStaffService.selectIcsCustomerStaffById(currentUserId);
|
||||
|
||||
|
||||
Park park = parkService.selectParkById(parkId);
|
||||
ValidatorUtils.validateEntity(repair);
|
||||
repair.setParkId(parkId);
|
||||
repair.setParkId(1L);
|
||||
repair.setStatus(Repair.Status.PENDING_ASSIGN);
|
||||
repair.setRepairTime(DateUtils.getNowDate());
|
||||
repair.setCreateBy(user.getUsername());
|
||||
repair.setCreateBy(staff.getUsername());
|
||||
if(ObjectUtil.isNotEmpty(park)) {
|
||||
repair.setTenantId(park.getTenantId());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user