mirror of
https://gitee.com/elegant_wings/dbd-meeting.git
synced 2025-06-21 17:09:36 +08:00
Merge remote-tracking branch 'origin/shoot-hand' into shoot-hand
This commit is contained in:
commit
3efd98634c
@ -89,6 +89,13 @@ public class MeetingReservationController extends BaseController {
|
||||
* mrdate:预约日期,格式:2024-09-23
|
||||
* timeFormat:预约时间格式:0 任意时间(管理员),1上午,2下午,3晚上 4 全天。
|
||||
* 值为0时,读取startTime和endTime为预约会议时间范围;其他值读取mrdate,再拼接时间为预约会议时间范围。
|
||||
*
|
||||
* * floor 所属楼层名称,精确查询
|
||||
* * name 会议室名称,模糊查询
|
||||
* * typeName 会议室形式,精确查询
|
||||
* * devices 多个会议室设备,模糊查询,逻辑与关系
|
||||
* * min 容纳人数,下限(包含)
|
||||
* * max 容纳人数,上限(包含)
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator", "member:center:view"}, logical = Logical.OR)
|
||||
@PostMapping("getAllRoom")
|
||||
@ -124,7 +131,7 @@ public class MeetingReservationController extends BaseController {
|
||||
* 无参,返回所有部门id及名称,已去重。
|
||||
* */
|
||||
@RequiresPermissions(value = {"mr:manage:operator", "member:center:view"}, logical = Logical.OR)
|
||||
@PostMapping("getOrg")
|
||||
@RequestMapping("getOrg")
|
||||
public R getOrg() {
|
||||
return R.ok().put("data", meetingUtoService.getOrg());
|
||||
}
|
||||
@ -139,7 +146,7 @@ public class MeetingReservationController extends BaseController {
|
||||
* personNum 会议室容纳人数,已去重。
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator", "member:center:view"}, logical = Logical.OR)
|
||||
@PostMapping("getConstData")
|
||||
@RequestMapping("getConstData")
|
||||
public R getConstData() {
|
||||
JSONObject jsonObject = meetingReservationService.getConstData();
|
||||
return R.ok().put("data", jsonObject);
|
||||
@ -156,14 +163,18 @@ public class MeetingReservationController extends BaseController {
|
||||
public R booking(@RequestBody MeetingReservationDTO meetingReservationDTO) {
|
||||
MeetingReservation meetingReservation = new MeetingReservation();
|
||||
BeanUtils.copyBeanProp(meetingReservation, meetingReservationDTO.getMr());
|
||||
if (meetingReservation.getTimeFormat() > 0) {//非任意时间
|
||||
if (meetingReservation.getTimeFormat() > 0) {
|
||||
String bookingDate = DateUtils.dateTime(meetingReservation.getStart());
|
||||
if (!bookingDate.equals(meetingReservationDTO.getMr().getMrdate()))
|
||||
return R.error("预约日期与会议时间不符!");
|
||||
Date start = convert(meetingReservationDTO.getMr().getMrdate(), meetingReservation.getTimeFormat(), true);
|
||||
Date end = convert(meetingReservationDTO.getMr().getMrdate(), meetingReservation.getTimeFormat(), false);
|
||||
if (start == null || end == null) return R.error("预约时间解析错误");
|
||||
meetingReservation.setStart(start);
|
||||
meetingReservation.setEnd(end);
|
||||
meetingReservation.getParams().put("startTime",start);
|
||||
meetingReservation.getParams().put("endTime",end);//根据上、下午、晚上,确定具体时间
|
||||
}
|
||||
if (meetingReservation.getEnd().getTime() <= meetingReservation.getStart().getTime()) return R.error("预约时间无效");
|
||||
if (meetingReservation.getStart().getTime() <= new Date().getTime()) return R.error("已逝去的时间不能被预约");
|
||||
Long userId = getLoginStaffId();
|
||||
String result = meetingReservationService.insertMeetingReservation(userId, meetingReservation, meetingReservationDTO.getServe());
|
||||
if (IMeetingReservationService.OK.equals(result)) {
|
||||
@ -224,14 +235,17 @@ public class MeetingReservationController extends BaseController {
|
||||
BeanUtils.copyBeanProp(meetingReservation, meetingReservationDTO.getMr());
|
||||
meetingReservation.setStatus(status);//防止用户端修改预约记录状态
|
||||
if (meetingReservation.getTimeFormat() > 0) {//非任意时间
|
||||
if (!DateUtils.dateTime(meetingReservation.getStart()).equals(meetingReservationDTO.getMr().getMrdate()))
|
||||
return R.error("预约日期与会议时间不符!");
|
||||
Date start = convert(meetingReservationDTO.getMr().getMrdate(), meetingReservation.getTimeFormat(), true);
|
||||
Date end = convert(meetingReservationDTO.getMr().getMrdate(), meetingReservation.getTimeFormat(), false);
|
||||
meetingReservation.setStart(start);
|
||||
meetingReservation.setEnd(end);
|
||||
meetingReservation.getParams().put("startTime",start);
|
||||
meetingReservation.getParams().put("endTime",end);//根据上、下午、晚上,确定具体时间
|
||||
}
|
||||
if (meetingReservation.getStart() == null || meetingReservation.getEnd() == null)
|
||||
return R.error("预约时间解析错误");//防止用户端置空预约记录时间
|
||||
if (meetingReservation.getEnd().getTime() <= meetingReservation.getStart().getTime()) return R.error("预约时间无效");
|
||||
if (meetingReservation.getStart().getTime() <= new Date().getTime()) return R.error("已逝去的时间不能被预约");
|
||||
String result = meetingReservationService.updateMeetingReservation(userId, meetingReservation, meetingReservationDTO.getServe());
|
||||
if (IMeetingReservationService.OK.equals(result)) {
|
||||
return R.ok("操作成功");
|
||||
@ -257,19 +271,16 @@ public class MeetingReservationController extends BaseController {
|
||||
@PostMapping("beforehand")
|
||||
public R beforehand(@RequestBody MeetingReservationDTO meetingReservationDTO) {
|
||||
Long userId = getLoginStaffId();
|
||||
IcsCustomerStaff staff = customerStaffService.selectIcsCustomerStaffById(userId);
|
||||
if (staff.getRoomRole() != 5L) return R.error("权限不足!");
|
||||
MeetingReservation meetingReservation = new MeetingReservation();
|
||||
if (meetingReservationDTO.getMr().getTimeFormat() > 0) {//非任意时间
|
||||
Date start = convert(meetingReservationDTO.getMr().getMrdate(), meetingReservation.getTimeFormat(), true);
|
||||
Date end = convert(meetingReservationDTO.getMr().getMrdate(), meetingReservation.getTimeFormat(), false);
|
||||
meetingReservation.setStart(start);
|
||||
meetingReservation.setEnd(end);
|
||||
} else {
|
||||
meetingReservation.setRoomId(meetingReservationDTO.getMr().getRoomId());
|
||||
meetingReservation.setStart(meetingReservationDTO.getMr().getStart());
|
||||
meetingReservation.setEnd(meetingReservationDTO.getMr().getEnd());
|
||||
}
|
||||
meetingReservation.setTimeFormat(meetingReservationDTO.getMr().getTimeFormat());
|
||||
meetingReservation.setRoomId(meetingReservationDTO.getMr().getRoomId());
|
||||
meetingReservation.setTimeFormat(0);
|
||||
meetingReservation.setTitle("占用");
|
||||
if (meetingReservation.getEnd().getTime() <= meetingReservation.getStart().getTime()) return R.error("预约时间无效");
|
||||
if (meetingReservation.getStart().getTime() <= new Date().getTime()) return R.error("已逝去的时间不能被预约");
|
||||
String result = meetingReservationService.beforehand(userId, meetingReservation);
|
||||
if (IMeetingReservationService.OK.equals(result)) {
|
||||
return R.ok("占用成功");
|
||||
@ -285,7 +296,7 @@ public class MeetingReservationController extends BaseController {
|
||||
* serveWaiter:会务服务组
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator", "member:center:view"}, logical = Logical.OR)
|
||||
@PostMapping("getWaiter")
|
||||
@RequestMapping("getWaiter")
|
||||
public R getWaiter() {
|
||||
IcsCustomerStaff p = new IcsCustomerStaff();
|
||||
p.setRoomRole(3);
|
||||
@ -333,7 +344,7 @@ public class MeetingReservationController extends BaseController {
|
||||
* 参数:id,预约记录id。物理删除(包括所有关联数据),不可恢复
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator", "member:center:view"}, logical = Logical.OR)
|
||||
@RequestMapping("delete")
|
||||
@PostMapping("delete")
|
||||
public R delete(@RequestBody Map<String, Long> param) {
|
||||
Long id = param.get("id");
|
||||
return toAjax(meetingReservationService.deleteMeetingReservationById(id));
|
||||
@ -350,7 +361,7 @@ public class MeetingReservationController extends BaseController {
|
||||
* waiters,分配的会务人员
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator", "member:center:view"}, logical = Logical.OR)
|
||||
@RequestMapping("getInfo")
|
||||
@PostMapping("getInfo")
|
||||
public R get(@RequestBody Map<String, Long> param) {
|
||||
Long id = param.get("id");
|
||||
MeetingReservation meetingReservation = meetingReservationService.selectMeetingReservationById(id);
|
||||
|
@ -4,6 +4,7 @@ import com.ics.admin.domain.MeetingRoom;
|
||||
import com.ics.admin.domain.RepairAttach;
|
||||
import com.ics.admin.service.IMeetingRoomService;
|
||||
import com.ics.admin.service.IRepairAttachService;
|
||||
import com.ics.admin.utils.MeetingRoomDTO;
|
||||
import com.ics.admin.vo.MeetingRoomVo;
|
||||
import com.ics.common.core.controller.BaseController;
|
||||
import com.ics.common.core.domain.R;
|
||||
@ -13,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@ -108,26 +110,29 @@ public class MeetingRoomController extends BaseController {
|
||||
|
||||
/**
|
||||
* 新增会议室
|
||||
* @param files 附件id
|
||||
* files 附件id
|
||||
*/
|
||||
@RequiresPermissions("admin:room:add")
|
||||
@PostMapping("save")
|
||||
public R addSave(MeetingRoom meetingRoom, String[] files) {
|
||||
public R addSave(@RequestBody MeetingRoomDTO meetingRoomDTO) {
|
||||
Long userId = getLoginStaffId();
|
||||
meetingRoom.setDeleteFlag(0);
|
||||
meetingRoom.setCreateBy(userId.toString());
|
||||
meetingRoom.setCreateTime(new Date());
|
||||
return toAjax(meetingRoomService.insertMeetingRoom(meetingRoom,files));
|
||||
meetingRoomDTO.getRoom().setDeleteFlag(0);
|
||||
meetingRoomDTO.getRoom().setCreateBy(userId.toString());
|
||||
meetingRoomDTO.getRoom().setCreateTime(new Date());
|
||||
return toAjax(meetingRoomService.insertMeetingRoom(meetingRoomDTO.getRoom(), meetingRoomDTO.getFiles()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会议室
|
||||
* @param files 附件id
|
||||
* files 附件id
|
||||
*/
|
||||
@RequiresPermissions("admin:room:edit")
|
||||
@PostMapping("update")
|
||||
public R editSave(MeetingRoom meetingRoom, String[] files) {
|
||||
return toAjax(meetingRoomService.updateMeetingRoom(meetingRoom, files));
|
||||
public R editSave(@RequestBody MeetingRoomDTO meetingRoomDTO) {
|
||||
Long userId = getLoginStaffId();
|
||||
meetingRoomDTO.getRoom().setUpdateBy(userId.toString());
|
||||
meetingRoomDTO.getRoom().setUpdateTime(new Date());
|
||||
return toAjax(meetingRoomService.updateMeetingRoom(meetingRoomDTO.getRoom(), meetingRoomDTO.getFiles()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,104 @@
|
||||
package com.ics.admin.controller;
|
||||
|
||||
import com.ics.admin.service.IMeetingStatsService;
|
||||
import com.ics.common.core.domain.R;
|
||||
import com.ics.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 会议室预约统计接口
|
||||
* created at 2024-9-29 16:15
|
||||
*
|
||||
* @author lujiang
|
||||
* @version 1.0.0
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping({"/admin/ms"})
|
||||
public class MeetingStatsController {
|
||||
|
||||
@Autowired
|
||||
private IMeetingStatsService meetingStatsService;
|
||||
|
||||
/**
|
||||
* 会议室统计 第一行
|
||||
*
|
||||
* @param day 格式:2024-09-30
|
||||
* @return
|
||||
* alreadyBooking, 已预约会议室数量
|
||||
* noBooking,未预约会议室数量
|
||||
* going,开会中会议室数量
|
||||
* free,空闲中会议室数量
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator"})
|
||||
@RequestMapping("roomStats")
|
||||
public R roomStats(String day) {
|
||||
return R.ok().put("data", meetingStatsService.roomStats(day));
|
||||
}
|
||||
|
||||
/**
|
||||
* 日历 第二行左
|
||||
*
|
||||
* @param month 月份,格式:2024-09
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator"})
|
||||
@RequestMapping("calendar")
|
||||
public R calendar(String month) {
|
||||
return R.ok().put("data", meetingStatsService.calendar(month));
|
||||
}
|
||||
|
||||
/**
|
||||
* 会议状态 第二行右上
|
||||
*
|
||||
* @return
|
||||
* wait, 待开始会议数量
|
||||
* going,进行中会议数量
|
||||
* closed,已结束会议数量
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator"})
|
||||
@RequestMapping("meetingStats")
|
||||
public R meetingStats() {
|
||||
return R.ok().put("data", meetingStatsService.meetingStats());
|
||||
}
|
||||
|
||||
/**
|
||||
* 会议待办 第二行右下
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator"})
|
||||
@RequestMapping("meetingAudit")
|
||||
public R meetingAudit() {
|
||||
return R.ok().put("data", meetingStatsService.meetingAudit());
|
||||
}
|
||||
|
||||
/**
|
||||
* 图表统计数据
|
||||
*
|
||||
* @param startDate 统计数据开始时间,日期格式示例:2024-08-23
|
||||
* @param endDate 统计数据结束时间,日期格式示例:2024-09-23
|
||||
* @return
|
||||
* roomRank,会议室使用排名
|
||||
* serve,服务情况
|
||||
* roomType,会议室形式统计
|
||||
* orgMeeting,部门开会情况--top10
|
||||
* everyDay,开会情况--按天--top20
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator"})
|
||||
@RequestMapping("chartStats")
|
||||
public R chartStats(String startDate, String endDate) {
|
||||
Date start, end;
|
||||
try {
|
||||
start = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, startDate + " 00:00:00");
|
||||
end = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, endDate + " 23:59:59");
|
||||
} catch (Exception e) {
|
||||
return R.error("参数错误");
|
||||
}
|
||||
return R.ok().put("data", meetingStatsService.chartStats(start, end));
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -6,6 +6,7 @@ import com.ics.common.core.controller.BaseController;
|
||||
import com.ics.common.core.domain.R;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
@ -55,7 +56,7 @@ public class MeetingUtoController extends BaseController {
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator"})
|
||||
@PostMapping("save")
|
||||
public R addSave(MeetingUto meetingUto) {
|
||||
public R addSave(@RequestBody MeetingUto meetingUto) {
|
||||
Long userId = getLoginStaffId();
|
||||
meetingUto.setDeleteFlag(0);
|
||||
meetingUto.setCreateBy(userId.toString());
|
||||
@ -75,7 +76,7 @@ public class MeetingUtoController extends BaseController {
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator"})
|
||||
@PostMapping("update")
|
||||
public R editSave(MeetingUto meetingUto) {
|
||||
public R editSave(@RequestBody MeetingUto meetingUto) {
|
||||
Long userId = getLoginStaffId();
|
||||
meetingUto.setUpdateBy(userId.toString());
|
||||
meetingUto.setUpdateTime(new Date());
|
||||
|
@ -2,6 +2,7 @@ package com.ics.admin.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.ics.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@ -75,6 +76,20 @@ public class MeetingRoom extends BaseEntity<MeetingRoom> {
|
||||
@TableField(exist = false)
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 容纳人数 下限
|
||||
*/
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
@TableField(exist = false)
|
||||
private Integer min;
|
||||
|
||||
/**
|
||||
* 容纳人数 上限
|
||||
*/
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
@TableField(exist = false)
|
||||
private Integer max;
|
||||
|
||||
/**
|
||||
* 扩展1
|
||||
*/
|
||||
|
@ -0,0 +1,78 @@
|
||||
package com.ics.admin.mapper;
|
||||
|
||||
import com.ics.admin.vo.MRStatsVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface MeetingStatsMapper {
|
||||
|
||||
/**
|
||||
* 会议室统计 第一行
|
||||
* @param day 格式:2024-09-30
|
||||
* @return
|
||||
*/
|
||||
List<MRStatsVo> roomStats(@Param("day") String day);
|
||||
|
||||
/**
|
||||
* 日历 第二行左
|
||||
*/
|
||||
List<MRStatsVo> calendar(@Param("month") String month);
|
||||
|
||||
/**
|
||||
* 会议状态 第二行右上
|
||||
*/
|
||||
List<MRStatsVo> meetingStats();
|
||||
|
||||
/**
|
||||
* 会议待办 第二行右下
|
||||
*/
|
||||
List<MRStatsVo> meetingAudit();
|
||||
|
||||
/**
|
||||
* 会议室使用排名
|
||||
*
|
||||
* @param start 开始时间范围
|
||||
* @param end 结束时间范围
|
||||
* @return
|
||||
*/
|
||||
List<MRStatsVo> roomRankStats(@Param("start") Date start, @Param("end") Date end);
|
||||
|
||||
/**
|
||||
* 服务情况
|
||||
*
|
||||
* @param start 开始时间范围
|
||||
* @param end 结束时间范围
|
||||
* @return
|
||||
*/
|
||||
List<MRStatsVo> serveStats(@Param("start") Date start, @Param("end") Date end);
|
||||
|
||||
/**
|
||||
* 会议室形式统计
|
||||
*
|
||||
* @param start 开始时间范围
|
||||
* @param end 结束时间范围
|
||||
* @return
|
||||
*/
|
||||
List<MRStatsVo> roomTypeStats(@Param("start") Date start, @Param("end") Date end);
|
||||
|
||||
/**
|
||||
* 部门开会情况 top10
|
||||
*
|
||||
* @param start 开始时间范围
|
||||
* @param end 结束时间范围
|
||||
* @return
|
||||
*/
|
||||
List<MRStatsVo> orgMeetingStats(@Param("start") Date start, @Param("end") Date end);
|
||||
/**
|
||||
* 开会情况 top20
|
||||
*
|
||||
* @param start 开始时间范围
|
||||
* @param end 结束时间范围
|
||||
* @return
|
||||
*/
|
||||
List<MRStatsVo> everyDayStats(@Param("start") Date start, @Param("end") Date end);
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.ics.admin.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface IMeetingStatsService {
|
||||
|
||||
/**
|
||||
* 会议室统计 第一行
|
||||
* @param day 格式:2024-09-30
|
||||
* @return
|
||||
*/
|
||||
Map<String, Integer> roomStats(String day);
|
||||
|
||||
/**
|
||||
* 日历 第二行左
|
||||
* @param month 月份,格式:2024-09
|
||||
*/
|
||||
Map<String, List<JSONObject>> calendar(String month);
|
||||
|
||||
/**
|
||||
* 会议状态 第二行右上
|
||||
*/
|
||||
Map<String, Integer> meetingStats();
|
||||
|
||||
/**
|
||||
* 会议待办 第二行右下
|
||||
*/
|
||||
List<Map<String, Object>> meetingAudit();
|
||||
/**
|
||||
* 图表统计
|
||||
*
|
||||
* @param start 开始时间范围
|
||||
* @param end 结束时间范围
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> chartStats(Date start, Date end);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,166 @@
|
||||
package com.ics.admin.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ics.admin.mapper.MeetingStatsMapper;
|
||||
import com.ics.admin.service.IMeetingStatsService;
|
||||
import com.ics.admin.vo.MRStatsVo;
|
||||
import com.ics.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* created at 2024-9-29 16:32
|
||||
*
|
||||
* @author lujiang
|
||||
* @version 1.0.0
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Service
|
||||
public class IMeetingStatsServiceImpl implements IMeetingStatsService {
|
||||
@Autowired
|
||||
private MeetingStatsMapper meetingStatsMapper;
|
||||
|
||||
@Override
|
||||
public Map<String, Integer> roomStats(String day) {
|
||||
Map<String, Integer> map = new HashMap<>();
|
||||
List<MRStatsVo> list = meetingStatsMapper.roomStats(day);
|
||||
if (list.size() > 0) {
|
||||
MRStatsVo mrStatsVo = list.get(0);
|
||||
map.put("alreadyBooking", mrStatsVo.getBooking());
|
||||
map.put("noBooking", mrStatsVo.getZs() - mrStatsVo.getBooking());
|
||||
map.put("going", mrStatsVo.getGoing());
|
||||
map.put("free", mrStatsVo.getZs() - mrStatsVo.getGoing());
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<JSONObject>> calendar(String month) {
|
||||
Map<String, List<JSONObject>> map = new HashMap<>();
|
||||
Date date = DateUtils.dateTime(DateUtils.YYYY_MM_DD, month + "-01");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
int lastDay = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
|
||||
for (int i = 0; i < lastDay; i++) {
|
||||
if (i > 0) calendar.add(Calendar.DATE, 1);
|
||||
String key = DateUtils.dateTime(calendar.getTime());
|
||||
map.put(key, new ArrayList<>());
|
||||
}
|
||||
List<MRStatsVo> datas = meetingStatsMapper.calendar(month);
|
||||
for (MRStatsVo mrStatsVo : datas) {
|
||||
String key = mrStatsVo.getName();
|
||||
JSONObject one = new JSONObject();
|
||||
one.put("id", mrStatsVo.getId());
|
||||
one.put("sn", mrStatsVo.getSn());
|
||||
one.put("title", mrStatsVo.getTitle());
|
||||
one.put("time", mrStatsVo.getTime());
|
||||
one.put("org", mrStatsVo.getOrg());
|
||||
map.get(key).add(one);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Integer> meetingStats() {
|
||||
Map<String, Integer> map = new HashMap<>();
|
||||
List<MRStatsVo> list = meetingStatsMapper.meetingStats();
|
||||
if (list.size() > 0) {
|
||||
MRStatsVo mrStatsVo = list.get(0);
|
||||
map.put("wait", mrStatsVo.getWait());
|
||||
map.put("going", mrStatsVo.getGoing());
|
||||
map.put("closed", mrStatsVo.getClosed());
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> meetingAudit() {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
List<MRStatsVo> datas = meetingStatsMapper.meetingAudit();
|
||||
for (MRStatsVo mrStatsVo : datas) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", mrStatsVo.getId());
|
||||
map.put("title", mrStatsVo.getTitle());
|
||||
map.put("time", mrStatsVo.getTime());
|
||||
map.put("org", mrStatsVo.getOrg());
|
||||
list.add(map);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> chartStats(Date start, Date end) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if (true) { //会议室使用排名
|
||||
Map<String, Object> roomRank = new HashMap<>();
|
||||
List<String> y = new ArrayList<>();
|
||||
List<Long> zs = new ArrayList<>();
|
||||
List<MRStatsVo> list = meetingStatsMapper.roomRankStats(start, end);
|
||||
for (MRStatsVo mrStatsVo : list) {
|
||||
y.add(mrStatsVo.getName());
|
||||
zs.add(mrStatsVo.getValue());
|
||||
}
|
||||
roomRank.put("y", y);
|
||||
roomRank.put("total", zs);
|
||||
map.put("roomRank", roomRank);
|
||||
}
|
||||
if (true) {//服务情况
|
||||
List<Map<String, Object>> serve = new ArrayList<>();
|
||||
List<MRStatsVo> list = meetingStatsMapper.serveStats(start, end);
|
||||
for (MRStatsVo mrStatsVo : list) {
|
||||
serve.add(getMap(mrStatsVo.getName(), mrStatsVo.getValue()));
|
||||
}
|
||||
map.put("serve", serve);
|
||||
}
|
||||
if (true) {//会议室形式统计
|
||||
List<Map<String, Object>> roomType = new ArrayList<>();
|
||||
List<MRStatsVo> list = meetingStatsMapper.roomTypeStats(start, end);
|
||||
for (MRStatsVo mrStatsVo : list) {
|
||||
roomType.add(getMap(mrStatsVo.getName(), mrStatsVo.getValue()));
|
||||
}
|
||||
map.put("roomType", roomType);
|
||||
}
|
||||
if (true) {//部门开会情况
|
||||
Map<String, Object> orgMeeting = new HashMap<>();
|
||||
List<String> x = new ArrayList<>();
|
||||
List<Long> total = new ArrayList<>();
|
||||
List<MRStatsVo> list = meetingStatsMapper.orgMeetingStats(start, end);
|
||||
for (MRStatsVo mrStatsVo : list) {
|
||||
x.add(mrStatsVo.getName());
|
||||
total.add(mrStatsVo.getValue());
|
||||
}
|
||||
orgMeeting.put("x", x);
|
||||
orgMeeting.put("total", total);
|
||||
map.put("orgMeeting", orgMeeting);
|
||||
}
|
||||
if (true) {//开会情况--按天--top20
|
||||
Map<String, Object> everyDay = new HashMap<>();
|
||||
List<String> x = new ArrayList<>();
|
||||
List<Long> total = new ArrayList<>();
|
||||
List<MRStatsVo> list = meetingStatsMapper.everyDayStats(start, end);
|
||||
for (MRStatsVo mrStatsVo : list) {
|
||||
x.add(mrStatsVo.getName());
|
||||
total.add(mrStatsVo.getValue());
|
||||
}
|
||||
everyDay.put("x", x);
|
||||
everyDay.put("total", total);
|
||||
map.put("everyDay", everyDay);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
private Map<String, Object> getMap(String name, Object value) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("name", name);
|
||||
map.put("value", value);
|
||||
return map;
|
||||
}
|
||||
}
|
@ -130,7 +130,12 @@ public class MeetingReservationServiceImpl implements IMeetingReservationService
|
||||
@Transactional(rollbackFor = Exception.class, isolation = Isolation.SERIALIZABLE)
|
||||
@Override
|
||||
public String insertMeetingReservation(Long currentUserId, MeetingReservation meetingReservation, MeetingServe[] meetingServes) {
|
||||
List<Long> ids = meetingReservationMapper.checkBooking(meetingReservation.getRoomId(), null, meetingReservation.getStart(), meetingReservation.getEnd());
|
||||
List<Long> ids = meetingReservationMapper.checkBooking(
|
||||
meetingReservation.getRoomId(),
|
||||
null,
|
||||
meetingReservation.getTimeFormat() > 0 ? (Date) meetingReservation.getParams().get("startTime") : meetingReservation.getStart(),
|
||||
meetingReservation.getTimeFormat() > 0 ? (Date) meetingReservation.getParams().get("endTime") : meetingReservation.getEnd()
|
||||
);
|
||||
if (ids.size() > 0) return "会议室已被占用,预约失败";
|
||||
Date now = new Date();
|
||||
meetingReservation.setSn(snService.generate(Sn.Type.REPAIR));
|
||||
@ -156,7 +161,7 @@ public class MeetingReservationServiceImpl implements IMeetingReservationService
|
||||
repairRemindMapper.insertRepairRemind(repairRemind);
|
||||
}
|
||||
//提醒--end
|
||||
meetingServeService.saveOrUpdateMeetingServe(rid, list);
|
||||
if (list.size() > 0) meetingServeService.saveOrUpdateMeetingServe(rid, list);
|
||||
return IMeetingReservationService.OK;
|
||||
}
|
||||
|
||||
@ -165,7 +170,12 @@ public class MeetingReservationServiceImpl implements IMeetingReservationService
|
||||
public String operateMeetingReservation(Long currentUserId, Long id, MrOperate operate, String content) {
|
||||
MeetingReservation meetingReservation = meetingReservationMapper.selectMeetingReservationById(id);
|
||||
if (meetingReservation == null) return "未找到预约记录";
|
||||
if (meetingReservation.getStatus() != 5) return "预约记录不能" + operate.getValue();
|
||||
if (MrOperate.CANCEL.equals(operate) && (meetingReservation.getStatus() < 5 || meetingReservation.getStatus() > 7)) {
|
||||
return "预约记录不能" + operate.getValue();
|
||||
}
|
||||
if (!MrOperate.CANCEL.equals(operate) && meetingReservation.getStatus() != 5) {
|
||||
return "预约记录不能" + operate.getValue();
|
||||
}
|
||||
if (MrOperate.CANCEL.equals(operate) && !meetingReservation.getCreateBy().equals(currentUserId.toString()))
|
||||
return "不能取消非本人的预约记录";
|
||||
Date now = new Date();
|
||||
@ -240,7 +250,12 @@ public class MeetingReservationServiceImpl implements IMeetingReservationService
|
||||
rList = processRemind(meetingReservation, currentUserId, null, 0, null, null);
|
||||
//提醒--end
|
||||
}
|
||||
List<Long> ids = meetingReservationMapper.checkBooking(meetingReservation.getRoomId(), meetingReservation.getId(), meetingReservation.getStart(), meetingReservation.getEnd());
|
||||
List<Long> ids = meetingReservationMapper.checkBooking(
|
||||
meetingReservation.getRoomId(),
|
||||
meetingReservation.getId(),
|
||||
meetingReservation.getTimeFormat() > 0 ? (Date) meetingReservation.getParams().get("startTime") : meetingReservation.getStart(),
|
||||
meetingReservation.getTimeFormat() > 0 ? (Date) meetingReservation.getParams().get("endTime") : meetingReservation.getEnd()
|
||||
);
|
||||
if (ids.size() > 0) return "会议室已被占用,预约失败";
|
||||
Date now = new Date();
|
||||
meetingReservation.setUpdateTime(now);
|
||||
@ -256,7 +271,7 @@ public class MeetingReservationServiceImpl implements IMeetingReservationService
|
||||
list.add(meetingServe);
|
||||
}
|
||||
}
|
||||
meetingServeService.saveOrUpdateMeetingServe(meetingReservation.getId(), list);
|
||||
if (list.size() > 0) meetingServeService.saveOrUpdateMeetingServe(meetingReservation.getId(), list);
|
||||
//提醒--start
|
||||
for (RepairRemind repairRemind : rList) {
|
||||
repairRemindMapper.insertRepairRemind(repairRemind);
|
||||
|
@ -0,0 +1,23 @@
|
||||
package com.ics.admin.utils;
|
||||
|
||||
import com.ics.admin.domain.MeetingRoom;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* created at 2024-9-25 9:21
|
||||
*
|
||||
* @author lujiang
|
||||
* @version 1.0.0
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class MeetingRoomDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -202409220922L;
|
||||
|
||||
private MeetingRoom room;
|
||||
|
||||
private String[] files;
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package com.ics.admin.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* created at 2024-9-29 17:11
|
||||
*
|
||||
* @author lujiang
|
||||
* @version 1.0.0
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class MRStatsVo implements Serializable {
|
||||
private static final long serialVersionUID = -202409291712L;
|
||||
|
||||
private String name;
|
||||
|
||||
private Long value;
|
||||
|
||||
@JsonIgnore
|
||||
private Date start;
|
||||
|
||||
@JsonIgnore
|
||||
private Date end;
|
||||
|
||||
//总数
|
||||
private Integer zs;
|
||||
//预约数
|
||||
private Integer booking;
|
||||
//进行中会议数量
|
||||
private Integer going;
|
||||
|
||||
//待开始会议数量
|
||||
private Integer wait;
|
||||
|
||||
//已结束会议数量
|
||||
private Integer closed;
|
||||
|
||||
//---会议待办
|
||||
private Long id;
|
||||
private String sn;
|
||||
private String title;
|
||||
private String time;
|
||||
private String org;
|
||||
|
||||
}
|
@ -27,6 +27,7 @@ public class MeetingRoomVo implements Serializable {
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
|
||||
/** 预约日期 */
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
private String mrdate;
|
||||
@ -35,6 +36,18 @@ public class MeetingRoomVo implements Serializable {
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
private Integer timeFormat;
|
||||
|
||||
/**
|
||||
* 容纳人数 下限
|
||||
*/
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
private Integer min;
|
||||
|
||||
/**
|
||||
* 容纳人数 上限
|
||||
*/
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
private Integer max;
|
||||
|
||||
private Long id;
|
||||
/**
|
||||
* 所属楼层值
|
||||
@ -66,6 +79,9 @@ public class MeetingRoomVo implements Serializable {
|
||||
*/
|
||||
private String device;
|
||||
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
private String[] devices;
|
||||
|
||||
/**
|
||||
* 房间号
|
||||
*/
|
||||
|
@ -53,8 +53,12 @@
|
||||
<if test="floor != null and floor != ''"> AND room.floor = #{floor}</if>
|
||||
<if test="name != null and name != ''"> AND room.name LIKE CONCAT('%', #{name}, '%')</if>
|
||||
<if test="typeName != null and typeName != ''"> AND room.type_name = #{typeName}</if>
|
||||
<if test="device != null and device != ''"> AND room.device LIKE CONCAT('%', #{device}, '%')</if>
|
||||
<if test="capacityNum != null"> AND room.capacity_num = #{capacityNum}</if>
|
||||
<if test="devices != null">
|
||||
<foreach item="dev" collection="devices">
|
||||
AND device LIKE CONCAT('%', #{dev}, '%')
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="min != null and max !=null"> and room.capacity_num >= #{min} AND room.capacity_num <= #{max}</if>
|
||||
order by room_num
|
||||
</select>
|
||||
|
||||
@ -88,11 +92,10 @@
|
||||
<if test="floor != null and floor != ''"> AND floor = #{floor}</if>
|
||||
<if test="name != null and name != ''"> AND name LIKE CONCAT('%', #{name}, '%')</if>
|
||||
<if test="typeName != null and typeName != ''"> AND type_name = #{typeName}</if>
|
||||
<if test="device != null and device != ''"> AND device LIKE CONCAT('%', #{device}, '%')</if>
|
||||
<if test="capacityNum != null"> AND capacity_num = #{capacityNum}</if>
|
||||
<if test="device != null and device != ''"> AND room.device LIKE CONCAT('%', #{device}, '%')</if>
|
||||
<if test="capacityNum != null"> AND capacity_num <= #{capacityNum}</if>
|
||||
<if test="status != null"> AND status = #{status}</if>
|
||||
<if test="filterDate != null and filterDate != ''"> AND start LIKE CONCAT(#{filterDate}, '%')</if>
|
||||
|
||||
order by start desc,status
|
||||
</select>
|
||||
|
||||
|
@ -42,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="name != null and name != ''"> AND name LIKE CONCAT('%', #{name}, '%')</if>
|
||||
<if test="typeName != null and typeName != ''"> AND type_name = #{typeName}</if>
|
||||
<if test="device != null and device != ''"> AND device LIKE CONCAT('%', #{device}, '%')</if>
|
||||
<if test="capacityNum != null"> AND capacity_num = #{capacityNum}</if>
|
||||
<if test="min != null and max !=null"> and capacity_num >= #{min} AND capacity_num <= #{max}</if>
|
||||
</where>
|
||||
order by id
|
||||
</select>
|
||||
|
@ -0,0 +1,107 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ics.admin.mapper.MeetingStatsMapper">
|
||||
<!-- 会议室统计 第一行 -->
|
||||
<select id="roomStats" resultType="com.ics.admin.vo.MRStatsVo">
|
||||
<![CDATA[
|
||||
select
|
||||
count(name) zs ,sum(booking) booking,sum(going) going
|
||||
from (
|
||||
select room.name,
|
||||
case when count(mr.id)>0 then 1 else 0 end as booking,
|
||||
case when count(case when mr.status=9 then 1 else null end)>0 then 1 else 0 end as going
|
||||
from ics_meeting_room room left join ics_meeting_reservation mr on room.id=mr.room_id
|
||||
and room.delete_flag=0 and mr.delete_flag=0 and mr.status>3 and mr.start LIKE CONCAT(#{day}, '%')
|
||||
group by room.name
|
||||
) zj
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<!-- 日历 第二行左 -->
|
||||
<select id="calendar" resultType="com.ics.admin.vo.MRStatsVo">
|
||||
<![CDATA[
|
||||
select
|
||||
id,sn,title,DATE_FORMAT(start,'%Y-%m-%d') name,
|
||||
CONCAT(DATE_FORMAT(start,'%Y-%m-%d %H:%i'), '~',DATE_FORMAT(`end`,'%H:%i')) time,user_org org
|
||||
from ics_meeting_reservation mr where mr.delete_flag=0 and mr.status>3 and start like CONCAT(#{month}, '%') order by start
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<!-- 会议状态 第二行右上 -->
|
||||
<select id="meetingStats" resultType="com.ics.admin.vo.MRStatsVo">
|
||||
<![CDATA[
|
||||
select sum(`wait`) `wait`,sum(going) going,sum(closed) closed from
|
||||
(select
|
||||
case when mr.status=7 then 1 else 0 end as `wait`,
|
||||
case when mr.status=9 then 1 else 0 end as going,
|
||||
case when mr.status=11 then 1 else 0 end as closed
|
||||
from ics_meeting_reservation mr where mr.delete_flag=0 and mr.status>=7
|
||||
) zj
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<!-- 会议待办 第二行右下 -->
|
||||
<select id="meetingAudit" resultType="com.ics.admin.vo.MRStatsVo">
|
||||
<![CDATA[
|
||||
select
|
||||
id,title,CONCAT(DATE_FORMAT(start,'%Y-%m-%d %H:%i'), '~',DATE_FORMAT(`end`,'%H:%i')) `time`,user_org org
|
||||
from ics_meeting_reservation mr where mr.delete_flag=0 and mr.status=5 order by mr.start limit 10
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<!-- ====下面为图表======== -->
|
||||
<!--会议室使用排名-->
|
||||
<select id="roomRankStats" resultType="com.ics.admin.vo.MRStatsVo">
|
||||
<![CDATA[
|
||||
select room.name name,count(mr.id) value
|
||||
from ics_meeting_room room left join ics_meeting_reservation mr
|
||||
on room.id=mr.room_id and room.delete_flag=0 and mr.delete_flag=0 and mr.status>7 and mr.start between #{start} and #{end}
|
||||
GROUP BY room.name order by room.id
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<!-- 服务情况 -->
|
||||
<select id="serveStats" resultType="com.ics.admin.vo.MRStatsVo">
|
||||
<![CDATA[
|
||||
select type.dict_label name,count(zj.id) value from sys_dict_data type left join
|
||||
(select ms.value value,mr.id id
|
||||
from ics_meeting_serve ms,ics_meeting_reservation mr where ms.rid=mr.id and ms.delete_flag=0 and mr.delete_flag=0 and mr.status>7 and mr.start between #{start} and #{end}
|
||||
) zj on type.dict_value=zj.value
|
||||
where type.dict_type='mm_service' and type.status=0 group by type.dict_label order by type.dict_sort
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<!-- 会议室形式统计 -->
|
||||
<select id="roomTypeStats" resultType="com.ics.admin.vo.MRStatsVo">
|
||||
<![CDATA[
|
||||
select type.dict_label name,count(jl.id) value from sys_dict_data type left join
|
||||
(select room.type_id typeid,mr.id from ics_meeting_room room,ics_meeting_reservation mr
|
||||
where mr.room_id=room.id and room.delete_flag=0 and mr.delete_flag=0
|
||||
and mr.status>7 and mr.start between #{start} and #{end}) jl
|
||||
on type.dict_value=jl.typeid
|
||||
where type.dict_type='mm_type' and type.status=0
|
||||
group by type.dict_label,type.dict_type order by type.dict_sort
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<!-- 部门开会情况 -->
|
||||
<select id="orgMeetingStats" resultType="com.ics.admin.vo.MRStatsVo">
|
||||
<![CDATA[
|
||||
select mr.user_org name,count(mr.id) value from ics_meeting_reservation mr
|
||||
where mr.delete_flag=0 and mr.status>7 and mr.start between #{start} and #{end}
|
||||
GROUP BY mr.user_org order by value desc limit 10
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<!-- 开会情况 -->
|
||||
<select id="everyDayStats" resultType="com.ics.admin.vo.MRStatsVo">
|
||||
<![CDATA[
|
||||
select rq name,count(id) value FROM(
|
||||
select id,DATE_FORMAT(start,'%m月%d日') rq from ics_meeting_reservation mr where mr.delete_flag=0 and mr.status>7 and mr.start between #{start} and #{end}
|
||||
) d GROUP BY rq order by rq limit 20
|
||||
]]>
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -46,8 +46,12 @@ public class RepairRemindPushServiceImpl implements RepairRemindPushService {
|
||||
@Autowired
|
||||
private RedisTemplate<String, String> redisTemplate;
|
||||
|
||||
@Value("${webchatGZH.templateId}")
|
||||
private String templateId;
|
||||
@Value("${webchatGZH.templateRP}")
|
||||
private String templateRP;
|
||||
|
||||
|
||||
@Value("${webchatGZH.templateMR}")
|
||||
private String templateMR;
|
||||
|
||||
@Value("${webchatGZH.appid}")
|
||||
private String appid;
|
||||
@ -95,26 +99,36 @@ public class RepairRemindPushServiceImpl implements RepairRemindPushService {
|
||||
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
param.put("touser", openid);
|
||||
param.put("template_id", templateId);
|
||||
param.put("touser", openid);
|
||||
if (repairRemind.getTypeId() == 0) param.put("template_id", templateRP);//工单模板
|
||||
if (repairRemind.getTypeId() == 1) param.put("template_id", templateMR);//会议预约模板
|
||||
|
||||
JSONObject miniprogram = new JSONObject();
|
||||
miniprogram.put("appid", WX_SMALL_APP_ID);
|
||||
miniprogram.put("pagepath", WX_SMALL_APP_PAGE);
|
||||
param.put("miniprogram", miniprogram);
|
||||
|
||||
|
||||
JSONObject dataTime = new JSONObject();
|
||||
dataTime.put("value", time);
|
||||
JSONObject msg = new JSONObject();
|
||||
msg.put("value", content);
|
||||
|
||||
JSONObject data = new JSONObject();
|
||||
//工单模板填充数据
|
||||
if (repairRemind.getTypeId() == 0) {
|
||||
data.put("time38", dataTime);
|
||||
data.put("thing37", msg);
|
||||
|
||||
}
|
||||
//会议预约模板填充数据
|
||||
if (repairRemind.getTypeId() == 1) {
|
||||
data.put("time", dataTime);
|
||||
data.put("thing", msg);
|
||||
}
|
||||
param.put("data", data);
|
||||
JSONObject result = send(url, JSON.toJSONString(param));
|
||||
// System.out.println("==========ttt1==========");
|
||||
// System.out.println(result.toString());
|
||||
// System.out.println("==========ttt2==========");
|
||||
if (result == null || result.getInteger("errcode") == null || result.getInteger("errcode") != 0) {
|
||||
failed.add(repairRemind.getId());
|
||||
} else {
|
||||
|
@ -147,4 +147,5 @@ webchatGZH: #微信公众号用户绑定及模板消息推送相关配置
|
||||
appid: wxf164eab7ad1d9075
|
||||
secret: 199fc64445882192ae798816d949be0d
|
||||
access: https://company.haxy.com.cn:4443/shoot-hand #pc后端访问地址
|
||||
templateId: 3VU7ZY8RgiR9hcPysc34y-S2PxKQU2JrIT8v_mhkuic #模板消息模板id
|
||||
templateRP: 8zU-6KI4gz0NJeTeAjPbzu9eEBlWe18gGa3PW6h7MbM #工单模板消息模板id
|
||||
templateMR: QxM3pMorFhL8Wljouzw3ckLXW8AXCTL3dbOnLumH90I #会议室预约模板消息id
|
||||
|
@ -137,4 +137,5 @@ webchatGZH: #微信公众号用户绑定及模板消息推送相关配置
|
||||
appid: wxf164eab7ad1d9075
|
||||
secret: 199fc64445882192ae798816d949be0d
|
||||
access: https://company.haxy.com.cn:4443/shoot-hand #pc后端访问地址
|
||||
templateId: 3VU7ZY8RgiR9hcPysc34y-S2PxKQU2JrIT8v_mhkuic #模板消息模板id
|
||||
templateRP: 8zU-6KI4gz0NJeTeAjPbzu9eEBlWe18gGa3PW6h7MbM #工单模板消息模板id
|
||||
templateMR: QxM3pMorFhL8Wljouzw3ckLXW8AXCTL3dbOnLumH90I #会议室预约模板消息id
|
@ -137,4 +137,5 @@ webchatGZH: #微信公众号用户绑定及模板消息推送相关配置
|
||||
appid: wx88c3ba1d01b33b8b
|
||||
secret: db375b6db9c7b87b1daa48375b45731e
|
||||
access: https://baoxiu.jsgdha.com/shoot-hand #pc后端访问地址
|
||||
templateId: 4jgtzPfyX546n5ZDPHbN69YSSFf8NSOQUDJuPb6bYwA #模板消息模板id
|
||||
templateRP: 4jgtzPfyX546n5ZDPHbN69YSSFf8NSOQUDJuPb6bYwA #工单模板消息模板id
|
||||
templateMR: XXX #会议室预约模板消息id
|
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 80 KiB |
Loading…
x
Reference in New Issue
Block a user