l
chenfeng 7 months ago
parent ac643fa753
commit a3c7713d8b
  1. 10
      src/main/java/com/cjy/back/ybsjAppointment/dao/YbsjyAppointmentRecordMapper.java
  2. 153
      src/main/java/com/cjy/back/ybsjAppointment/dao/YbsjyAppointmentRecordMapper.xml
  3. 27
      src/main/java/com/cjy/back/ybsjAppointment/service/impl/YbsjyAppointmentRecordImpl.java
  4. 100
      src/main/java/com/cjy/back/ybsjMessageInfo/controller/YbsjMessageInfoController.java
  5. 8
      src/main/webapp/html/back/yuyueList/reservationRecord_commont.html
  6. 10
      src/main/webapp/html/back/yuyueList/reservationRecord_commontTwo.html

@ -199,9 +199,15 @@ public interface YbsjyAppointmentRecordMapper {
//查询预约设置时间段 //查询预约设置时间段
List<Map<String, Object>> getTimeInfo(@Param("timeInfoId") Integer timeInfoId); List<Map<String, Object>> getTimeInfo(@Param("timeInfoId") Integer timeInfoId);
//预约统计 //预约统计-预约总数和核销总数
List<Map<String, Object>> selectStatistics(@Param("getAppointmentRecordVO") GetAppointmentRecordVO getAppointmentRecordVO); List<Map<String, Object>> selectStatistics(@Param("getAppointmentRecordVO") GetAppointmentRecordVO getAppointmentRecordVO);
//预约统计-取消总数
List<Map<String, Object>> selectStatisticsQx(@Param("getAppointmentRecordVO") GetAppointmentRecordVO getAppointmentRecordVO);
//预约统计- 过期总数
List<Map<String, Object>> selectStatisticsGq(@Param("getAppointmentRecordVO") GetAppointmentRecordVO getAppointmentRecordVO);
//查询弹框内容 //查询弹框内容
Map<String,Object>selectPop(); Map<String, Object> selectPop();
} }

@ -426,27 +426,160 @@
<select id="selectStatistics" resultType="map"> <select id="selectStatistics" resultType="map">
SELECT SELECT
( SELECT GROUP_CONCAT( cnm.dicname ) FROM sys_dictionary cnm WHERE FIND_IN_SET( cnm.dicnum, b.visit_types ) AND dicpcode = 58 ) visitingPlace, visitingPlace,
SUM( CASE WHEN write_off = 0 THEN 1 ELSE 0 END ) AS unverified, SUM( altogether ) AS altogether, -- 预约总数
SUM( CASE WHEN write_off = 1 THEN 1 ELSE 0 END ) AS verified, SUM( verified_personal + verified_team ) AS verified -- 核销总数
SUM( CASE WHEN write_off = 3 THEN 1 ELSE 0 END ) AS cancel,
SUM( CASE WHEN expired_state = 1 THEN 1 ELSE 0 END ) AS hasExpired,
COUNT( * ) AS altogether
FROM FROM
ybsj_appointment_people_info a (
LEFT JOIN ybsj_appointment_documents_info b ON a.appointment_documents_id = b.id SELECT
WHERE ( SELECT GROUP_CONCAT( cnm.dicname ) FROM sys_dictionary cnm WHERE FIND_IN_SET( cnm.dicnum, a.visit_types ) AND dicpcode = 58 ) AS visitingPlace,-- 总预约数
1 = 1 a.appointment_count AS altogether,-- 团队核销数
CASE
WHEN a.appointment_documents_write_off = 1
AND a.appointment_type_id != 5701 THEN
a.appointment_count ELSE 0
END AS verified_team,-- 个人核销数
CASE
WHEN a.appointment_type_id = 5701 THEN
( SELECT COUNT( b.id ) FROM ybsj_appointment_people_info b WHERE b.appointment_documents_id = a.id AND b.write_off = 1 ) ELSE 0
END AS verified_personal
FROM
ybsj_appointment_documents_info a
where 1 = 1
and a.del_flag = 0
<if test="getAppointmentRecordVO.reservationStartDate !=null and getAppointmentRecordVO.reservationStartDate!=''"> <if test="getAppointmentRecordVO.reservationStartDate !=null and getAppointmentRecordVO.reservationStartDate!=''">
and a.appointment_date &gt;= #{getAppointmentRecordVO.reservationStartDate} and a.appointment_date &gt;= #{getAppointmentRecordVO.reservationStartDate}
</if> </if>
<if test="getAppointmentRecordVO.reservationEndDate !=null and getAppointmentRecordVO.reservationEndDate!=''"> <if test="getAppointmentRecordVO.reservationEndDate !=null and getAppointmentRecordVO.reservationEndDate!=''">
and a.appointment_date &lt;= #{getAppointmentRecordVO.reservationEndDate} and a.appointment_date &lt;= #{getAppointmentRecordVO.reservationEndDate}
</if> </if>
) base
GROUP BY GROUP BY
visitingPlace visitingPlace
</select> </select>
<select id="selectStatisticsQx" resultType="map">
SELECT
visitingPlace,
SUM(cancel) AS cancel
FROM (
-- 第一个查询
SELECT
SUM(a.appointment_count) AS cancel,
(
SELECT GROUP_CONCAT(cnm.dicname)
FROM sys_dictionary cnm
WHERE FIND_IN_SET(cnm.dicnum, a.visit_types) AND dicpcode = 58
) AS visitingPlace
FROM
ybsj_appointment_documents_info a
WHERE
a.appointment_documents_write_off = 3
AND a.appointment_type_id != 5701
and a.del_flag = 0
<if test="getAppointmentRecordVO.reservationStartDate !=null and getAppointmentRecordVO.reservationStartDate!=''">
and a.appointment_date &gt;= #{getAppointmentRecordVO.reservationStartDate}
</if>
<if test="getAppointmentRecordVO.reservationEndDate !=null and getAppointmentRecordVO.reservationEndDate!=''">
and a.appointment_date &lt;= #{getAppointmentRecordVO.reservationEndDate}
</if>
GROUP BY
(
SELECT GROUP_CONCAT(cnm.dicname)
FROM sys_dictionary cnm
WHERE FIND_IN_SET(cnm.dicnum, a.visit_types) AND dicpcode = 58
)
UNION ALL
-- 第二个查询
SELECT
COUNT(b.id) AS cancel,
(
SELECT GROUP_CONCAT(cnm.dicname)
FROM sys_dictionary cnm
WHERE FIND_IN_SET(cnm.dicnum, a.visit_types) AND dicpcode = 58
) AS visitingPlace
FROM
ybsj_appointment_people_info b
LEFT JOIN ybsj_appointment_documents_info a ON a.id = b.appointment_documents_id
WHERE
b.write_off = 3
AND a.appointment_type_id = 5701
and a.del_flag = 0
<if test="getAppointmentRecordVO.reservationStartDate !=null and getAppointmentRecordVO.reservationStartDate!=''">
and a.appointment_date &gt;= #{getAppointmentRecordVO.reservationStartDate}
</if>
<if test="getAppointmentRecordVO.reservationEndDate !=null and getAppointmentRecordVO.reservationEndDate!=''">
and a.appointment_date &lt;= #{getAppointmentRecordVO.reservationEndDate}
</if>
GROUP BY
(
SELECT GROUP_CONCAT(cnm.dicname)
FROM sys_dictionary cnm
WHERE FIND_IN_SET(cnm.dicnum, a.visit_types) AND dicpcode = 58
)
) AS combined
GROUP BY
visitingPlace;
</select>
<select id="selectStatisticsGq" resultType="map">
SELECT
visitingPlace,
SUM(team_cancel + personal_cancel) AS hasExpired
FROM (
-- 团队/研学过期人数
SELECT
(SELECT GROUP_CONCAT(cnm.dicname)
FROM sys_dictionary cnm
WHERE FIND_IN_SET(cnm.dicnum, a.visit_types) AND dicpcode = 58) AS visitingPlace,
IFNULL(SUM(a.appointment_count), 0) AS team_cancel,
0 AS personal_cancel
FROM
ybsj_appointment_documents_info a
LEFT JOIN ybsj_appointment_people_info b ON a.id = b.appointment_documents_id AND b.expired_state = 1
WHERE
b.expired_state = 1
AND a.appointment_type_id != 5701
and a.del_flag = 0
<if test="getAppointmentRecordVO.reservationStartDate !=null and getAppointmentRecordVO.reservationStartDate!=''">
and a.appointment_date &gt;= #{getAppointmentRecordVO.reservationStartDate}
</if>
<if test="getAppointmentRecordVO.reservationEndDate !=null and getAppointmentRecordVO.reservationEndDate!=''">
and a.appointment_date &lt;= #{getAppointmentRecordVO.reservationEndDate}
</if>
GROUP BY visitingPlace
UNION ALL
-- 个人过期人数
SELECT
(SELECT GROUP_CONCAT(cnm.dicname)
FROM sys_dictionary cnm
WHERE FIND_IN_SET(cnm.dicnum, a.visit_types) AND dicpcode = 58) AS visitingPlace,
0 AS team_cancel,
COUNT(b.id) AS personal_cancel
FROM
ybsj_appointment_people_info b
LEFT JOIN ybsj_appointment_documents_info a ON a.id = b.appointment_documents_id
WHERE
b.expired_state = 1
AND a.appointment_type_id = 5701
and a.del_flag = 0
<if test="getAppointmentRecordVO.reservationStartDate !=null and getAppointmentRecordVO.reservationStartDate!=''">
and a.appointment_date &gt;= #{getAppointmentRecordVO.reservationStartDate}
</if>
<if test="getAppointmentRecordVO.reservationEndDate !=null and getAppointmentRecordVO.reservationEndDate!=''">
and a.appointment_date &lt;= #{getAppointmentRecordVO.reservationEndDate}
</if>
GROUP BY visitingPlace
) combined
GROUP BY visitingPlace;
</select>
<select id="selectPop" resultType="map"> <select id="selectPop" resultType="map">
select guid,ybsj_message_info.title,ybsj_tk_content.content,ybsj_tk_content.start_time,ybsj_tk_content.end_time select guid,ybsj_message_info.title,ybsj_tk_content.content,ybsj_tk_content.start_time,ybsj_tk_content.end_time
from ybsj_message_info left join ybsj_tk_content from ybsj_message_info left join ybsj_tk_content

@ -28,10 +28,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* @author liangjiawei * @author liangjiawei
@ -51,6 +48,7 @@ public class YbsjyAppointmentRecordImpl implements YbsjyAppointmentRecordService
private String rule; private String rule;
@Value("${jqzhgk.scjSynchronousWriteOffData}") @Value("${jqzhgk.scjSynchronousWriteOffData}")
private String scjSynchronousWriteOffData; private String scjSynchronousWriteOffData;
/** /**
* 查询预约记录 * 查询预约记录
* *
@ -191,7 +189,7 @@ public class YbsjyAppointmentRecordImpl implements YbsjyAppointmentRecordService
List<SynchronousWriteOffDataVO> synchronousWriteOffDataVOS = new ArrayList<>(); List<SynchronousWriteOffDataVO> synchronousWriteOffDataVOS = new ArrayList<>();
//核销人ID //核销人ID
SynchronousWriteOffDataVO synchronousWriteOffDataVO = new SynchronousWriteOffDataVO(); SynchronousWriteOffDataVO synchronousWriteOffDataVO = new SynchronousWriteOffDataVO();
//核销人ID //核销类型
synchronousWriteOffDataVO.setBookingCategory(2); synchronousWriteOffDataVO.setBookingCategory(2);
synchronousWriteOffDataVO.setWriteOff("3"); synchronousWriteOffDataVO.setWriteOff("3");
synchronousWriteOffDataVO.setDocumentsId(appointmentDocumentsDetails.getId().toString()); synchronousWriteOffDataVO.setDocumentsId(appointmentDocumentsDetails.getId().toString());
@ -474,7 +472,24 @@ public class YbsjyAppointmentRecordImpl implements YbsjyAppointmentRecordService
@Override @Override
public List<Map<String, Object>> selectStatistics(GetAppointmentRecordVO getAppointmentRecordVO) { public List<Map<String, Object>> selectStatistics(GetAppointmentRecordVO getAppointmentRecordVO) {
return ybsjyAppointmentRecordMapper.selectStatistics(getAppointmentRecordVO); List<Map<String, Object>> selectStatistics = ybsjyAppointmentRecordMapper.selectStatistics(getAppointmentRecordVO);
List<Map<String, Object>> selectStatisticsQx = ybsjyAppointmentRecordMapper.selectStatisticsQx(getAppointmentRecordVO);
List<Map<String, Object>> selectStatisticsGq = ybsjyAppointmentRecordMapper.selectStatisticsGq(getAppointmentRecordVO);
for (Map<String, Object> map : selectStatistics) {
Optional<Map<String, Object>> objectMap = selectStatisticsQx.stream().filter(map1 -> map.get("visitingPlace").equals(map1.get("visitingPlace"))).findAny();
if (objectMap.isPresent()) {
map.put("cancel",Integer.parseInt(objectMap.get().get("cancel").toString()));
}else {
map.put("cancel",0);
}
Optional<Map<String, Object>> mapOptional = selectStatisticsGq.stream().filter(map1 -> map.get("visitingPlace").equals(map1.get("visitingPlace"))).findAny();
if (mapOptional.isPresent()) {
map.put("hasExpired",Integer.parseInt(mapOptional.get().get("hasExpired").toString()));
}else {
map.put("hasExpired",0);
}
}
return selectStatistics;
} }
@Override @Override

@ -33,145 +33,136 @@ public class YbsjMessageInfoController {
private final String appSecret = "bc11e97b8e00841053cfc7ba8497c876"; private final String appSecret = "bc11e97b8e00841053cfc7ba8497c876";
/** /**
*
* @Description: 消息类型列表
* @param type 消息类型 * @param type 消息类型
* @return * @return
* @Description: 消息类型列表
* @author hpr * @author hpr
* @date 2019/10/30 * @date 2019/10/30
*/ */
@RequestMapping("/getListData.do") @RequestMapping("/getListData.do")
public ServerResponse getListData(String type, HttpServletRequest request, HttpSession session){ public ServerResponse getListData(String type, HttpServletRequest request, HttpSession session) {
return messageInfoService.getListData(type,session,request); return messageInfoService.getListData(type, session, request);
} }
/** /**
*
* @Description: 修改排序
* @param request guid/sort * @param request guid/sort
* @return * @return
* @Description: 修改排序
* @author hpr * @author hpr
* @date 2019/10/30 * @date 2019/10/30
*/ */
@RequestMapping("/updateMessageInfoSort.do") @RequestMapping("/updateMessageInfoSort.do")
public ServerResponse updateMessageInfoSort(HttpServletRequest request, HttpSession session){ public ServerResponse updateMessageInfoSort(HttpServletRequest request, HttpSession session) {
return messageInfoService.updateMessageInfoSort(request,session); return messageInfoService.updateMessageInfoSort(request, session);
} }
/** /**
*
* @Description: 修改是否推荐
* @param request 主键 是否推荐 * @param request 主键 是否推荐
* @return * @return
* @Description: 修改是否推荐
* @author hpr * @author hpr
* @date 2019/10/30 * @date 2019/10/30
*/ */
@RequestMapping("/recommendMessageInfo.do") @RequestMapping("/recommendMessageInfo.do")
public ServerResponse recommendMessageInfo(HttpServletRequest request, HttpSession session){ public ServerResponse recommendMessageInfo(HttpServletRequest request, HttpSession session) {
return messageInfoService.recommendMessageInfo(request,session); return messageInfoService.recommendMessageInfo(request, session);
} }
/** /**
*
* @Description: 修改是否弹框
* @param request 主键 是否弹框 * @param request 主键 是否弹框
* @return * @return
* @Description: 修改是否弹框
* @author hpr * @author hpr
* @date 2019/10/30 * @date 2019/10/30
*/ */
@RequestMapping("/updateIspopupMessageInfo.do") @RequestMapping("/updateIspopupMessageInfo.do")
public ServerResponse updateIspopupMessageInfo(HttpServletRequest request, HttpSession session){ public ServerResponse updateIspopupMessageInfo(HttpServletRequest request, HttpSession session) {
return messageInfoService.updateIspopupMessageInfo(request,session); return messageInfoService.updateIspopupMessageInfo(request, session);
} }
/** /**
* 查询弹框内容 * 查询弹框内容
*
* @param messageInfoId * @param messageInfoId
* @return * @return
*/ */
@RequestMapping("/selectContentById.do") @RequestMapping("/selectContentById.do")
public ServerResponse selectContentById(Long messageInfoId){ public ServerResponse selectContentById(Long messageInfoId) {
return ServerResponse.createBySuccess(messageInfoService.selectContentById(messageInfoId)); return ServerResponse.createBySuccess(messageInfoService.selectContentById(messageInfoId));
} }
/** /**
*
* @Description: 修改假删除
* @param request 主键 是否推荐 * @param request 主键 是否推荐
* @return * @return
* @Description: 修改假删除
* @author hpr * @author hpr
* @date 2019/11/4 * @date 2019/11/4
*/ */
@RequestMapping("/isdelMessageInfo.do") @RequestMapping("/isdelMessageInfo.do")
public ServerResponse isdelMessageInfo(HttpServletRequest request, HttpSession session){ public ServerResponse isdelMessageInfo(HttpServletRequest request, HttpSession session) {
return messageInfoService.isdelMessageInfo(request,session); return messageInfoService.isdelMessageInfo(request, session);
} }
/** /**
*
* @Description: 查询信息详情
* @param request 主键 * @param request 主键
* @return * @return
* @Description: 查询信息详情
* @author hpr * @author hpr
* @date 2019/10/30 * @date 2019/10/30
*/ */
@RequestMapping("/detailMessageInfo.do") @RequestMapping("/detailMessageInfo.do")
public ServerResponse detailMessageInfo(HttpServletRequest request, HttpSession session){ public ServerResponse detailMessageInfo(HttpServletRequest request, HttpSession session) {
return messageInfoService.detailMessageInfo(request,session); return messageInfoService.detailMessageInfo(request, session);
} }
/** /**
*
* @Description: 查询附加字段的数据内容
* @param request 类型 * @param request 类型
* @return * @return
* @Description: 查询附加字段的数据内容
* @author hpr * @author hpr
* @date 2019/10/30 * @date 2019/10/30
*/ */
@RequestMapping("/selectSubColumnData.do") @RequestMapping("/selectSubColumnData.do")
public ServerResponse selectSubColumnData(HttpServletRequest request, HttpSession session){ public ServerResponse selectSubColumnData(HttpServletRequest request, HttpSession session) {
return messageInfoService.selectSubColumnData(request,session); return messageInfoService.selectSubColumnData(request, session);
} }
/** /**
*
* @Description: 修改信息
* @param messageInfo 信息实体 * @param messageInfo 信息实体
* @return * @return
* @Description: 修改信息
* @author hpr * @author hpr
* @date 2019/10/30 * @date 2019/10/30
*/ */
@RequestMapping("/updateMessageInfo.do") @RequestMapping("/updateMessageInfo.do")
public ServerResponse updateMessageInfo(YbsjMessageInfo messageInfo, HttpSession session){ public ServerResponse updateMessageInfo(YbsjMessageInfo messageInfo, HttpSession session) {
return messageInfoService.updateMessageInfo(messageInfo,session); return messageInfoService.updateMessageInfo(messageInfo, session);
} }
/** /**
*
* @Description: 新增信息
* @param messageInfo 信息实体 * @param messageInfo 信息实体
* @return * @return
* @Description: 新增信息
* @author hpr * @author hpr
* @date 2019/11/1 * @date 2019/11/1
*/ */
@RequestMapping("/saveMessageInfo.do") @RequestMapping("/saveMessageInfo.do")
public ServerResponse saveMessageInfo(YbsjMessageInfo messageInfo, HttpSession session){ public ServerResponse saveMessageInfo(YbsjMessageInfo messageInfo, HttpSession session) {
pushMessage(messageInfo); pushMessage(messageInfo);
return messageInfoService.saveMessageInfo(messageInfo,session); return messageInfoService.saveMessageInfo(messageInfo, session);
} }
/** /**
*
* @Description: 删除信息
* @param guids 多主键 * @param guids 多主键
* @return * @return
* @Description: 删除信息
* @author hpr * @author hpr
* @date 2019/11/1 * @date 2019/11/1
*/ */
@RequestMapping("/delMessageInfo.do") @RequestMapping("/delMessageInfo.do")
public ServerResponse delMessageInfo(String guids, HttpSession session){ public ServerResponse delMessageInfo(String guids, HttpSession session) {
return messageInfoService.delMessageInfo(guids,session); return messageInfoService.delMessageInfo(guids, session);
} }
/** /**
@ -191,15 +182,18 @@ public class YbsjMessageInfoController {
String processedContent = processContent(messageInfo.getContent(), accessToken); String processedContent = processContent(messageInfo.getContent(), accessToken);
System.out.println("处理后的内容:" + processedContent); System.out.println("处理后的内容:" + processedContent);
logger.warn("处理后的内容" + processedContent); logger.warn("处理后的内容" + processedContent);
//下载logo图片上传到微信素材中心
File tempFile = downloadImage("https://www.lbgjtoa.com/" + messageInfo.getLogo());
JSONObject jsonObject = uploadToWeChat(accessToken, tempFile);
logger.warn("封面图上传素材中心返回数据" + jsonObject);
// 步骤2: 创建草稿 // 步骤2: 创建草稿
createDraft(accessToken, messageInfo.getTitle(), processedContent); createDraft(accessToken, messageInfo.getTitle(), processedContent, jsonObject.getString("media_id"));
} catch (Exception e) { } catch (Exception e) {
logger.error("通知公告推送至微信公众号异常:{}",e); logger.error("通知公告推送至微信公众号异常:{}", e);
} }
} }
public String getAccessToken(String appId, String appSecret) throws IOException { public String getAccessToken(String appId, String appSecret) throws IOException {
try { try {
// 目标 URL // 目标 URL
@ -230,14 +224,12 @@ public class YbsjMessageInfoController {
JSONObject result = new JSONObject(response.toString()); JSONObject result = new JSONObject(response.toString());
return result.getString("access_token"); return result.getString("access_token");
} catch (Exception e) { } catch (Exception e) {
logger.error("获取token异常:{}",e); logger.error("获取token异常:{}", e);
throw new RuntimeException(e); throw new RuntimeException(e);
} }
} }
// 1. 下载网络图片(支持自动重试) // 1. 下载网络图片(支持自动重试)
private static File downloadImage(String imageUrl) throws IOException, InterruptedException { private static File downloadImage(String imageUrl) throws IOException, InterruptedException {
File tempFile = File.createTempFile("wx_", ".tmp"); // 先创建临时文件 File tempFile = File.createTempFile("wx_", ".tmp"); // 先创建临时文件
@ -262,8 +254,8 @@ public class YbsjMessageInfoController {
} }
// 2. 微信图片上传(修复41005错误) // 2. 微信图片上传(修复41005错误)
private static String uploadToWeChat(String accessToken, File file) throws IOException { private static JSONObject uploadToWeChat(String accessToken, File file) throws IOException {
String newName =""; String newName = "";
// 1. 验证文件类型 // 1. 验证文件类型
String fileName = file.getName().toLowerCase(); String fileName = file.getName().toLowerCase();
if (!fileName.endsWith(".jpg") && !fileName.endsWith(".jpeg") && !fileName.endsWith(".png")) { if (!fileName.endsWith(".jpg") && !fileName.endsWith(".jpeg") && !fileName.endsWith(".png")) {
@ -328,7 +320,7 @@ public class YbsjMessageInfoController {
reader.close(); reader.close();
JSONObject result = new JSONObject(response.toString()); JSONObject result = new JSONObject(response.toString());
return result.getString("url"); return result;
} else { } else {
throw new IOException("Server returned non-OK status: " + responseCode); throw new IOException("Server returned non-OK status: " + responseCode);
} }
@ -349,8 +341,8 @@ public class YbsjMessageInfoController {
while (matcher.find()) { while (matcher.find()) {
String imgUrl = matcher.group(1); String imgUrl = matcher.group(1);
File tempFile = downloadImage(imgUrl); File tempFile = downloadImage(imgUrl);
String wechatUrl = uploadToWeChat(accessToken, tempFile); JSONObject wechatUrl = uploadToWeChat(accessToken, tempFile);
matcher.appendReplacement(result, "<img src='" + wechatUrl + "'/>"); matcher.appendReplacement(result, "<img src='" + wechatUrl.getString("url") + "'/>");
tempFile.delete(); tempFile.delete();
} }
matcher.appendTail(result); matcher.appendTail(result);
@ -358,13 +350,13 @@ public class YbsjMessageInfoController {
} }
// 4. 创建草稿 // 4. 创建草稿
private static void createDraft(String accessToken, String title, String content) throws IOException { private static void createDraft(String accessToken, String title, String content, String mediaId) throws IOException {
String url = "https://api.weixin.qq.com/cgi-bin/draft/add?access_token=" + accessToken; String url = "https://api.weixin.qq.com/cgi-bin/draft/add?access_token=" + accessToken;
JSONObject article = new JSONObject() JSONObject article = new JSONObject()
.put("title", title) .put("title", title)
.put("content", content) .put("content", content)
.put("thumb_media_id", "qR_BnS7D9o1TqpJLTGV3Pmbnz48dU3zFGu6Y_9ws5iKDXNFBGdIHIyRXJVuIjK1b") .put("thumb_media_id", mediaId)
.put("show_cover_pic", 1); .put("show_cover_pic", 1);
JSONArray articles = new JSONArray().put(article); JSONArray articles = new JSONArray().put(article);
String requestBody = new JSONObject().put("articles", articles).toString(); String requestBody = new JSONObject().put("articles", articles).toString();

@ -474,14 +474,6 @@
min: 0, min: 0,
value: currentDate, value: currentDate,
trigger: 'click', trigger: 'click',
// ✅ 方法 2:如果仍然无效,改用 done 回调手动拦截
done: function(value, date) {
if (value === currentDate) {
layer.msg("不能选择原预约日期!");
$('#modifyAppointmentDate').val(''); // 清空选择
return false;
}
}
}); });
}, 100); }, 100);

@ -484,11 +484,11 @@
trigger: 'click', trigger: 'click',
// ✅ 方法 2:如果仍然无效,改用 done 回调手动拦截 // ✅ 方法 2:如果仍然无效,改用 done 回调手动拦截
done: function(value, date) { done: function(value, date) {
if (value === currentDate) { // if (value === currentDate) {
layer.msg("不能选择原预约日期!"); // layer.msg("不能选择原预约日期!");
$('#modifyAppointmentDate').val(''); // 清空选择 // $('#modifyAppointmentDate').val(''); // 清空选择
return false; // return false;
} // }
} }
}); });
}, 100); }, 100);

Loading…
Cancel
Save