fix-文本通知该图文

This commit is contained in:
xl
2024-07-19 14:17:58 +08:00
parent b0843e8235
commit 325f8a7c50
4 changed files with 40 additions and 3 deletions

View File

@@ -734,4 +734,14 @@ public class OrderConstants {
DIRECTLY_ADMINISTERED.put("重庆市", new Object());
DIRECTLY_ADMINISTERED.put("天津市", new Object());
}
/**
* * 个推标题
*/
public static final String GE_TUI_TITLE = "ge_tui_title";
/**
* * 个推内容
*/
public static final String GE_TUI_CONTENT = "ge_tui_content";
}

View File

@@ -46,7 +46,11 @@ public class RobotService {
message.setMsgType("template_card");
message.setMentionedList(Lists.newArrayList("@all"));
message.setMentionedList(Lists.newArrayList("@all"));
message.setCardType("text_notice");
String cardType = "news_notice";
if (StrUtil.isBlank(request.getCardImageUrl())) {
cardType = "text_notice";
}
message.setCardType(cardType);
message.setCardActionType(1);
message.setCardActionUrl(request.getWxUrl());
@@ -59,7 +63,7 @@ public class RobotService {
jump.setUrl(request.getWxUrl());
jumps.add(jump);
message.setJumps(jumps);
message.setCardImageUrl(request.getCardImageUrl());
WxCpConfigStorage wxCpConfigStorage = cpService.getWxCpConfigStorage();
String webhookKey = wxCpConfigStorage.getWebhookKey();
if (StringUtils.isEmpty(webhookKey)) {

View File

@@ -25,4 +25,7 @@ public class TemplateCardMessageRequest implements Serializable {
@ApiModelProperty("跳转链接")
private String wxUrl;
@ApiModelProperty("图片地址")
private String cardImageUrl;
}

View File

@@ -1222,6 +1222,7 @@ public class CarReservationOrderServiceImpl extends ServiceImpl<CarReservationOr
hor.add(new HorizontalContent(null, "进店日期:", DateUtil.format(order.getArriveTime(), DateConstants.DATE_FORMAT_HHMM), null, null, null));
messageRequest.setHorizontalContents(hor);
messageRequest.setWxUrl(StrUtil.format("{}?id={}", systemConfigService.getValueByKey(CarConstants.CAR_DEALER_WE_COM_LINK), order.getId()));
messageRequest.setCardImageUrl(getImageUrl(order.getRepairType(), order.getId()));
update.setUpdateTime(DateUtil.date());
CarReservationStatement finalStatement = statement;
Boolean execute = transactionTemplate.execute(e -> {
@@ -1246,7 +1247,7 @@ public class CarReservationOrderServiceImpl extends ServiceImpl<CarReservationOr
CarDealer carDealer = carDealerService.getById(order.getCarDealerId());
User user = userService.getById(carDealer.getUserId());
if (user != null && user.getIsOpenGeTui() && StrUtil.isNotBlank(user.getGeTuiCid())) {
carReservationInfoProjectService.push(null, "维修审核", "平台审核通过", user.getGeTuiCid(), null, null, null);
carReservationInfoProjectService.push(null, OrderConstants.GE_TUI_TITLE, OrderConstants.GE_TUI_CONTENT, user.getGeTuiCid(), null, null, null);
}
}
robotService.sendTemplateCardMessageAll(messageRequest, 1000009);
@@ -1257,6 +1258,25 @@ public class CarReservationOrderServiceImpl extends ServiceImpl<CarReservationOr
}
}
private String getImageUrl(Integer repairType, Integer orderId) {
String str = "";
switch (repairType) {
case 1:
case 2:
CarReservationInfoMaintenance infoMaintenance = infoMaintenanceService.getByReservationOrderId(orderId);
str = infoMaintenance.getHeaderImage();
break;
case 3:
str = "";
break;
case 4:
CarReservationReturnInfo info = returnInfoService.getByReservationOrderId(orderId);
str = info.getDamageImage();
break;
}
return str;
}
private String getRepairTypeStr(Integer repairType) {
String str = "";
switch (repairType) {