mirror of
https://gitee.com/elegant_wings/xiongan-meeting.git
synced 2025-06-21 04:59:36 +08:00
修改了对应的后台接口
This commit is contained in:
parent
c1296add2e
commit
87e4e33aab
@ -1,5 +1,13 @@
|
||||
package com.ics.admin.controller.meeting;
|
||||
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.ics.admin.domain.Customer;
|
||||
import com.ics.admin.domain.meeting.RoomContent;
|
||||
import com.ics.admin.service.ICustomerService;
|
||||
import com.ics.admin.service.IIcsCustomerStaffService;
|
||||
import com.ics.admin.service.meeting.IRoomContentService;
|
||||
import com.ics.common.core.domain.IcsCustomerStaff;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@ -12,8 +20,10 @@ import com.ics.common.core.domain.R;
|
||||
import com.ics.common.core.controller.BaseController;
|
||||
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 java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -29,12 +39,29 @@ public class ReservationController extends BaseController {
|
||||
@Autowired
|
||||
private IReservationService reservationService;
|
||||
|
||||
@Autowired
|
||||
private IRoomContentService iRoomContentService;
|
||||
|
||||
@Autowired
|
||||
private ICustomerService customerService;
|
||||
|
||||
@Autowired
|
||||
private IIcsCustomerStaffService customerStaffService;
|
||||
|
||||
/**
|
||||
* 查询预约记录
|
||||
*/
|
||||
@Ignore
|
||||
@GetMapping("get/{id}")
|
||||
public Reservation get(@PathVariable("id") Long id) {
|
||||
return reservationService.selectReservationById(id);
|
||||
|
||||
Reservation reservation = reservationService.selectReservationById(id);
|
||||
Date endDate = reservation.getEndDate();
|
||||
Date startTime = reservation.getStartTime();
|
||||
long duration = DateUtil.between(startTime, endDate, DateUnit.HOUR);
|
||||
System.out.println(duration);
|
||||
reservation.setDuration(duration);
|
||||
return reservation;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -46,7 +73,16 @@ public class ReservationController extends BaseController {
|
||||
startPage();
|
||||
List<Reservation> reservations = reservationService.selectReservationList(reservation);
|
||||
for (Reservation reservation1 : reservations) {
|
||||
RoomContent roomContent = iRoomContentService.selectRoomContentById(reservation1.getRoomContentId());
|
||||
roomContent.setTypeName(roomContent.getType().getName());
|
||||
//会议室名称
|
||||
reservation1.setRoomContent(roomContent);
|
||||
reservation1.setStatusName(reservation1.getStauts().getName());
|
||||
Customer customer = customerService.selectCustomerById(reservation1.getCustomerId());
|
||||
reservation1.setCustomerName(customer.getName());
|
||||
IcsCustomerStaff customerStaff = customerStaffService.selectIcsCustomerStaffById(reservation1.getUserId());
|
||||
reservation1.setUserName(customerStaff.getUsername());
|
||||
|
||||
}
|
||||
return result(reservations);
|
||||
}
|
||||
|
@ -114,6 +114,8 @@ public class Reservation extends BaseEntity<Reservation> {
|
||||
/** 订单价格 */
|
||||
private String orderMoney;
|
||||
|
||||
private String prepayId;
|
||||
|
||||
/** 订单取消时间 */
|
||||
private Date cancelTime;
|
||||
|
||||
@ -157,4 +159,10 @@ public class Reservation extends BaseEntity<Reservation> {
|
||||
@TableField(exist = false)
|
||||
private Long equipmentId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String customerName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Long duration;
|
||||
|
||||
}
|
||||
|
@ -54,6 +54,8 @@ public class ShowroomRecord extends BaseEntity<ShowroomRecord> {
|
||||
private String persons;
|
||||
private Integer visitType;
|
||||
|
||||
private String visitArea;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String visitTypeName;
|
||||
|
||||
|
@ -96,6 +96,8 @@ public class IVisitorPersonServiceImpl extends ServiceImpl<VisitorPersonMapper,
|
||||
@Override
|
||||
public IPage<VisitorPerson> selectVisitorRecord(Long userId, Integer pageNum, Integer pageSize) {
|
||||
QueryWrapper<VisitorPerson> wrapper = new QueryWrapper<VisitorPerson>().eq("user_id", userId);
|
||||
wrapper.orderByDesc("create_time");
|
||||
|
||||
IPage<VisitorPerson> pages = new Page<>(pageNum,pageSize);
|
||||
IPage<VisitorPerson> userIPage = visitorPersonMapper.selectPage(pages,wrapper);
|
||||
return userIPage;
|
||||
@ -104,6 +106,7 @@ public class IVisitorPersonServiceImpl extends ServiceImpl<VisitorPersonMapper,
|
||||
@Override
|
||||
public IPage<VisitorPerson> selectVisitorRecordByIntervieweeId(Long intervieweeId, Integer pageNum, Integer pageSize) {
|
||||
QueryWrapper<VisitorPerson> wrapper = new QueryWrapper<VisitorPerson>().eq("interviewee_id", intervieweeId);
|
||||
wrapper.orderByDesc("create_time");
|
||||
IPage<VisitorPerson> pages = new Page<>(pageNum,pageSize);
|
||||
IPage<VisitorPerson> userIPage = visitorPersonMapper.selectPage(pages,wrapper);
|
||||
|
||||
|
@ -227,6 +227,7 @@ public class ReservationServiceImpl extends ServiceImpl<ReservationMapper, Reser
|
||||
|
||||
QueryWrapper<Reservation> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("user_id",reservation.getUserId());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<Reservation> pages = new Page<>(pageNum,pageSize);
|
||||
IPage<Reservation> userIPage = reservationMapper.selectPage(pages,queryWrapper);
|
||||
for (Reservation reservation1 : userIPage.getRecords()) {
|
||||
|
@ -385,16 +385,12 @@ public class RoomContentServiceImpl extends ServiceImpl<RoomContentMapper, RoomC
|
||||
|
||||
@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;
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ public class ShowroomRecordServiceImpl extends ServiceImpl<ShowroomRecordMapper,
|
||||
showroomRecordDTO.setNowDate(DateUtil.format(dateTime,"yyyy-MM-dd"));
|
||||
// 查询会议室记录
|
||||
QueryWrapper<ShowroomRecord> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("showroom_id",showroomRecord.getShowroomId());
|
||||
wrapper.eq("showroom_id",1L);
|
||||
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 +129,7 @@ public class ShowroomRecordServiceImpl extends ServiceImpl<ShowroomRecordMapper,
|
||||
|
||||
QueryWrapper<ShowroomRecord> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
queryWrapper.eq("showroom_id",showroomRecord.getShowroomId());
|
||||
queryWrapper.eq("showroom_id",1L);
|
||||
|
||||
Date startTime = showroomRecord.getStartTime();
|
||||
Date endDate = showroomRecord.getEndDate();
|
||||
|
@ -20,6 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="orderTime" column="order_time" />
|
||||
<result property="cancelResaon" column="cancel_resaon" />
|
||||
<result property="visitType" column="visit_type" />
|
||||
<result property="prepayId" column="prepay_id" />
|
||||
<result property="reservationNumber" column="reservation_number" />
|
||||
<result property="explainNeedType" column="explain_need_type" />
|
||||
<result property="meetingNeedType" column="meeting_need_type" />
|
||||
@ -37,7 +38,7 @@ 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,
|
||||
oder_number,reservation_number, order_money, cancel_time,prepay_id,
|
||||
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>
|
||||
@ -90,6 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="isAfterSale != null and isAfterSale != ''">is_after_sale,</if>
|
||||
<if test="oderNumber != null and oderNumber != ''">oder_number,</if>
|
||||
<if test="orderMoney != null and orderMoney != ''">order_money,</if>
|
||||
<if test="prepayId != null and prepayId != ''">prepay_id,</if>
|
||||
<if test="cancelTime != null ">cancel_time,</if>
|
||||
<if test="orderTime != null ">order_time,</if>
|
||||
<if test="cancelResaon != null and cancelResaon != ''">cancel_resaon,</if>
|
||||
@ -120,6 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="isAfterSale != null and isAfterSale != ''">#{isAfterSale},</if>
|
||||
<if test="oderNumber != null and oderNumber != ''">#{oderNumber},</if>
|
||||
<if test="orderMoney != null and orderMoney != ''">#{orderMoney},</if>
|
||||
<if test="prepayId != null and prepayId != ''">#{prepayId},</if>
|
||||
<if test="cancelTime != null ">#{cancelTime},</if>
|
||||
<if test="orderTime != null ">#{orderTime},</if>
|
||||
<if test="cancelResaon != null and cancelResaon != ''">#{cancelResaon},</if>
|
||||
@ -151,6 +154,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="isAfterSale != null and isAfterSale != ''">is_after_sale = #{isAfterSale},</if>
|
||||
<if test="oderNumber != null and oderNumber != ''">oder_number = #{oderNumber},</if>
|
||||
<if test="orderMoney != null and orderMoney != ''">order_money = #{orderMoney},</if>
|
||||
<if test="prepayId != null and prepayId != ''">prepay_id = #{prepayId},</if>
|
||||
<if test="cancelTime != null ">cancel_time = #{cancelTime},</if>
|
||||
<if test="reservationNumber != null ">reservation_number = #{reservationNumber},</if>
|
||||
<if test="cancelResaon != null and cancelResaon != ''">cancel_resaon = #{cancelResaon},</if>
|
||||
|
@ -55,7 +55,7 @@ public class WxLoginAPIController extends BaseController {
|
||||
|
||||
|
||||
|
||||
// todo 微信小程序登录后,新建一个token ,然后在新增LoginUser 这个注解,然后在拦截器中获取token,然后获取用户信息
|
||||
// 微信小程序登录后,新建一个token ,然后在新增LoginUser 这个注解,然后在拦截器中获取token,然后获取用户信息
|
||||
|
||||
@PostMapping("/weixin/login")
|
||||
public R login(@RequestBody Map<String, String> paramMap) {
|
||||
@ -123,7 +123,6 @@ public class WxLoginAPIController extends BaseController {
|
||||
Map<String, Object> token = tokenService.createToken(user);
|
||||
R ajax = R.ok();
|
||||
ajax.put(Constants.TOKEN, token);
|
||||
// ajax.put(Constants.TOKEN, token);
|
||||
ajax.put("user", user);
|
||||
ajax.put("openid", openid);
|
||||
return ajax;
|
||||
@ -138,7 +137,6 @@ public class WxLoginAPIController extends BaseController {
|
||||
Map<String, Object> token = tokenService.createStaffToken(icsCustomerStaff);
|
||||
R ajax = R.ok();
|
||||
ajax.put(Constants.TOKEN, token);
|
||||
// ajax.put(Constants.TOKEN, token);
|
||||
ajax.put("user", icsCustomerStaff);
|
||||
ajax.put("openid", openid);
|
||||
return ajax;
|
||||
|
@ -125,13 +125,4 @@ public class ApiEquipmentController extends BaseController {
|
||||
|
||||
return R.ok("开门成功");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -19,10 +19,15 @@ 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 com.ics.controller.mobile.pay.wx.WxPayCommon;
|
||||
import com.ics.controller.mobile.pay.wx.constant.WxNotifyConstants;
|
||||
import com.ics.controller.mobile.pay.wx.dto.WxChatBasePayDto;
|
||||
import com.ics.controller.mobile.pay.wx.dto.WxChatPayDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -68,6 +73,9 @@ public class ApiRoomContentController extends BaseController {
|
||||
@Autowired
|
||||
private RoomEquipmentMapper roomEquipmentMapper;
|
||||
|
||||
@Autowired
|
||||
WxPayCommon wxPayCommon;
|
||||
|
||||
|
||||
/**
|
||||
* 查询条件筛选
|
||||
@ -151,10 +159,31 @@ public class ApiRoomContentController extends BaseController {
|
||||
public R getMeetingRoomRecord(@RequestBody Reservation reservation) {
|
||||
//根据用户获取对应的企业id,查询该企业下对应的优惠卷
|
||||
reservation.setStauts(Reservation.Status.TO_BE_PAID);
|
||||
reservation.setOderNumber(RandomUtil.randomNumbers(8));
|
||||
reservation.setOderNumber(RandomUtil.randomNumbers(18));
|
||||
boolean b = reservationService.selectFreeMeetingRoom(reservation);
|
||||
Assert.isFalse(b, "会议室不可用");
|
||||
|
||||
IcsCustomerStaff customerStaff = customerStaffService.selectIcsCustomerStaffById(reservation.getUserId());
|
||||
Assert.isTrue(customerStaff != null , "用户不存在");
|
||||
|
||||
|
||||
|
||||
WxChatBasePayDto wxChatBasePayDto = new WxChatBasePayDto();
|
||||
wxChatBasePayDto.setDescription("会议室支付");
|
||||
wxChatBasePayDto.setOrderId(reservation.getOderNumber());
|
||||
BigDecimal price = new BigDecimal(reservation.getOrderMoney());
|
||||
wxChatBasePayDto.setPrice(price);
|
||||
wxChatBasePayDto.setNotify(WxNotifyConstants.CASE_PAY_NOTIFY);
|
||||
wxChatBasePayDto.setOpenId(customerStaff.getOpenid());
|
||||
String prepayId = wxPayCommon.wxJsApiPay(wxChatBasePayDto);
|
||||
|
||||
System.out.println("prepayId:"+prepayId);
|
||||
|
||||
reservation.setPrepayId(prepayId);
|
||||
|
||||
boolean save = reservationService.save(reservation);
|
||||
|
||||
|
||||
if (save){
|
||||
if (null !=reservation.getTicketId()){
|
||||
CustomerTicket customerTicket =new CustomerTicket();
|
||||
@ -317,6 +346,12 @@ public class ApiRoomContentController extends BaseController {
|
||||
System.out.println(stauts);
|
||||
Assert.isFalse(reservation1.getStauts().equals(Reservation.Status.APPOINTMENT),"您已经支付成功,请勿重复支付");
|
||||
|
||||
|
||||
|
||||
// WxChatPayDto wxChatPayDto = wxPayCommon.wxPayCall(prepayId);
|
||||
|
||||
|
||||
|
||||
Assert.notNull(reservation.getId(),"当前预约信息不存在");
|
||||
reservation.setStauts(Reservation.Status.APPOINTMENT);
|
||||
reservation.setOrderTime(new Date());
|
||||
@ -324,6 +359,10 @@ public class ApiRoomContentController extends BaseController {
|
||||
return toAjax(i);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
package com.ics.admin.controller.meeting;
|
||||
package com.ics.controller.mobile.meeting;
|
||||
|
||||
import com.ics.admin.domain.meeting.CustomerTicket;
|
||||
import com.ics.admin.pay.wx.WxPayCallbackUtil;
|
||||
import com.ics.admin.pay.wx.WxPayCommon;
|
||||
import com.ics.admin.pay.wx.dto.WxChatBasePayDto;
|
||||
import com.ics.admin.pay.wx.dto.WxChatPayDto;
|
||||
import com.ics.admin.domain.meeting.Reservation;
|
||||
import com.ics.controller.mobile.pay.wx.WxPayCallbackUtil;
|
||||
import com.ics.controller.mobile.pay.wx.WxPayCommon;
|
||||
import com.ics.controller.mobile.pay.wx.dto.WxChatBasePayDto;
|
||||
import com.ics.controller.mobile.pay.wx.dto.WxChatPayDto;
|
||||
import com.ics.admin.service.meeting.ICustomerTicketService;
|
||||
import com.ics.common.core.controller.BaseController;
|
||||
import com.ics.common.core.domain.R;
|
||||
@ -13,10 +13,8 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 微信支付
|
||||
@ -38,10 +36,10 @@ public class WxPayController extends BaseController {
|
||||
/**
|
||||
* 下载
|
||||
*/
|
||||
@PostMapping("placeOrder")
|
||||
public R placeOrder(@RequestBody WxChatBasePayDto wxChatBasePayDto) {
|
||||
String prepayId = wxPayCommon.wxJsApiPay(wxChatBasePayDto);
|
||||
WxChatPayDto wxChatPayDto = wxPayCommon.wxPayCall(prepayId);
|
||||
@PostMapping("paySign")
|
||||
public R paySign(@RequestBody Reservation reservation) {
|
||||
// String prepayId = wxPayCommon.wxJsApiPay(wxChatBasePayDto);
|
||||
WxChatPayDto wxChatPayDto = wxPayCommon.wxPayCall(reservation.getPrepayId());
|
||||
return R.data(wxChatPayDto);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.ics.admin.pay.wx;
|
||||
package com.ics.controller.mobile.pay.wx;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.wechat.pay.contrib.apache.httpclient.util.AesUtil;
|
@ -1,15 +1,14 @@
|
||||
package com.ics.admin.pay.wx;
|
||||
package com.ics.controller.mobile.pay.wx;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.ics.admin.pay.wx.constant.WxApiConstants;
|
||||
import com.ics.admin.pay.wx.dto.WxChatBasePayDto;
|
||||
import com.ics.admin.pay.wx.dto.WxChatPayDto;
|
||||
import com.ics.controller.mobile.pay.wx.constant.WxApiConstants;
|
||||
import com.ics.controller.mobile.pay.wx.dto.WxChatBasePayDto;
|
||||
import com.ics.controller.mobile.pay.wx.dto.WxChatPayDto;
|
||||
import com.wechat.pay.contrib.apache.httpclient.util.PemUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
@ -1,4 +1,4 @@
|
||||
package com.ics.admin.pay.wx;
|
||||
package com.ics.controller.mobile.pay.wx;
|
||||
|
||||
import com.wechat.pay.contrib.apache.httpclient.WechatPayHttpClientBuilder;
|
||||
import com.wechat.pay.contrib.apache.httpclient.auth.PrivateKeySigner;
|
@ -1,4 +1,4 @@
|
||||
package com.ics.admin.pay.wx.constant;
|
||||
package com.ics.controller.mobile.pay.wx.constant;
|
||||
|
||||
|
||||
/**
|
@ -1,4 +1,4 @@
|
||||
package com.ics.admin.pay.wx.constant;
|
||||
package com.ics.controller.mobile.pay.wx.constant;
|
||||
|
||||
/**
|
||||
* 微信回调地址
|
@ -1,4 +1,4 @@
|
||||
package com.ics.admin.pay.wx.dto;
|
||||
package com.ics.controller.mobile.pay.wx.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.ics.admin.pay.wx.dto;
|
||||
package com.ics.controller.mobile.pay.wx.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
Loading…
x
Reference in New Issue
Block a user