queryAll(YxStoreProductRelationQueryCriteria criteria) {
+ return baseMapper.selectList(QueryHelpPlus.getPredicate(YxStoreEvaluationRelation.class, criteria));
+ }
+}
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/service/mapper/YxEvaluationRelationMapper.java b/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/service/mapper/YxEvaluationRelationMapper.java
new file mode 100644
index 00000000..aa9eefb4
--- /dev/null
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/service/mapper/YxEvaluationRelationMapper.java
@@ -0,0 +1,33 @@
+package co.yixiang.modules.evaluation.service.mapper;
+
+
+import co.yixiang.common.mapper.CoreMapper;
+import co.yixiang.modules.evaluation.domain.YxStoreEvaluationRelation;
+import co.yixiang.modules.evaluation.service.vo.YxStoreEvaluationRelationQueryVo;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ *
+ * 评测点赞和收藏表 Mapper 接口
+ *
+ *
+ * @author sj
+ * @since 2022-10-19
+ */
+@Repository
+public interface YxEvaluationRelationMapper extends CoreMapper {
+
+
+ @Select("select B.id pid,A.type as category,B.home_image as homeImage,A.id id," +
+ "B.is_show as isShow" +
+ " from yx_evaluation_relation A left join yx_evaluation B " +
+ "on A.evaluation_id = B.id where A.type=#{type} and A.uid=#{uid} and A.is_del = 0 and B.is_del = 0 order by A.create_time desc")
+ List selectRelationList(Page page, @Param("uid") Long uid, @Param("type") String type);
+
+
+}
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/service/vo/YxStoreEvaluationRelationQueryVo.java b/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/service/vo/YxStoreEvaluationRelationQueryVo.java
new file mode 100644
index 00000000..0964de15
--- /dev/null
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/service/vo/YxStoreEvaluationRelationQueryVo.java
@@ -0,0 +1,34 @@
+package co.yixiang.modules.evaluation.service.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Date;
+
+public class YxStoreEvaluationRelationQueryVo {
+
+ private static final long serialVersionUID = 1L;
+
+ private Long id;
+
+ @ApiModelProperty(value = "用户ID")
+ private Long uid;
+
+ @ApiModelProperty(value = "商品ID")
+ private Long productId;
+
+ @ApiModelProperty(value = "类型(收藏(collect")
+ private String type;
+
+ @ApiModelProperty(value = "添加时间")
+ private Date createTime;
+
+ @ApiModelProperty(value = "首页图片")
+ private String homeImage;
+
+ @ApiModelProperty(value = "是否显示")
+ private Integer isShow;
+
+
+
+
+}
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/inform/domin/CardAction.java b/zsw-bxg/src/main/java/co/yixiang/modules/inform/domin/CardAction.java
new file mode 100644
index 00000000..17d1e3a1
--- /dev/null
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/inform/domin/CardAction.java
@@ -0,0 +1,12 @@
+package co.yixiang.modules.inform.domin;
+
+import lombok.Data;
+
+@Data
+public class CardAction {
+ private Integer type;
+ private String url;
+ private String appid;
+ private String pagepath;
+
+}
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/inform/domin/EmphasisContent.java b/zsw-bxg/src/main/java/co/yixiang/modules/inform/domin/EmphasisContent.java
new file mode 100644
index 00000000..3bf00cd5
--- /dev/null
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/inform/domin/EmphasisContent.java
@@ -0,0 +1,11 @@
+package co.yixiang.modules.inform.domin;
+
+import lombok.Data;
+
+@Data
+public class EmphasisContent {
+ /** 关键数据样式 "title":"100",
+ "desc":"数据含义"*/
+ private String title;
+ private String desc;
+}
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/inform/domin/HorizontalContent.java b/zsw-bxg/src/main/java/co/yixiang/modules/inform/domin/HorizontalContent.java
new file mode 100644
index 00000000..897c059b
--- /dev/null
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/inform/domin/HorizontalContent.java
@@ -0,0 +1,18 @@
+package co.yixiang.modules.inform.domin;
+
+import lombok.Data;
+
+
+/** 二级标题+文本列表 type:0或不填代表是普通文本,1 代表跳转url,2 代表下载附件,3 代表@员工
+ keyname:二级标题、value:内容、url:链接
+ * */
+@Data
+public class HorizontalContent {
+ private String type;
+ private String keyname;
+ private String value;
+ private String url;
+ private String media_id;
+
+
+}
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/inform/domin/Jump.java b/zsw-bxg/src/main/java/co/yixiang/modules/inform/domin/Jump.java
new file mode 100644
index 00000000..38b58856
--- /dev/null
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/inform/domin/Jump.java
@@ -0,0 +1,26 @@
+package co.yixiang.modules.inform.domin;
+
+import lombok.Data;
+
+
+/** {
+ "type":1,
+ "url":"https://work.weixin.qq.com/?from=openApi",
+ "title":"企业微信官网"
+ },
+ {
+ "type":2,
+ "appid":"APPID",
+ "pagepath":"PAGEPATH",
+ "title":"跳转小程序"
+ }*/
+@Data
+public class Jump {
+ private Integer type;
+ private String appid;
+ private String url;
+ private String title;
+ private String pagepath;
+
+
+}
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/inform/domin/MainTitle.java b/zsw-bxg/src/main/java/co/yixiang/modules/inform/domin/MainTitle.java
new file mode 100644
index 00000000..80d89cce
--- /dev/null
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/inform/domin/MainTitle.java
@@ -0,0 +1,11 @@
+package co.yixiang.modules.inform.domin;
+
+import lombok.Data;
+
+@Data
+public class MainTitle {
+ /** 模版卡片的主要内容 title:一级标题、desc:标题辅助信息*/
+ private String title;
+ private String desc;
+
+}
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/inform/domin/QuoteArea.java b/zsw-bxg/src/main/java/co/yixiang/modules/inform/domin/QuoteArea.java
new file mode 100644
index 00000000..2f06b6c9
--- /dev/null
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/inform/domin/QuoteArea.java
@@ -0,0 +1,22 @@
+package co.yixiang.modules.inform.domin;
+
+import lombok.Data;
+
+
+/** 引用文献样式
+ * "type":1,
+ "url":"https://work.weixin.qq.com/?from=openApi",
+ "appid":"APPID",
+ "pagepath":"PAGEPATH",
+ "title":"引用文本标题",
+ "quote_text":"Jack:企业微信真的很好用~\nBalian:超级好的一款软件!"*/
+@Data
+public class QuoteArea {
+ private Integer type;
+ private String url;
+ private String appid;
+ private String pagepath;
+ private String title;
+ private String quote_text;
+
+}
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/inform/domin/Souce.java b/zsw-bxg/src/main/java/co/yixiang/modules/inform/domin/Souce.java
new file mode 100644
index 00000000..5930a63c
--- /dev/null
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/inform/domin/Souce.java
@@ -0,0 +1,14 @@
+package co.yixiang.modules.inform.domin;
+
+import io.swagger.models.auth.In;
+import lombok.Data;
+
+@Data
+public class Souce {
+/**卡片来源信息模板 icon_url:来源图片url、desc:描述、desc_color:颜色 0(默认) 灰色,1 黑色,2 红色,3 绿色 */
+
+ private String icon_url;
+ private String desc;
+ private Integer desc_color;
+
+}
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/inform/domin/TemplateCard.java b/zsw-bxg/src/main/java/co/yixiang/modules/inform/domin/TemplateCard.java
new file mode 100644
index 00000000..67d39112
--- /dev/null
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/inform/domin/TemplateCard.java
@@ -0,0 +1,62 @@
+package co.yixiang.modules.inform.domin;
+
+import co.yixiang.modules.inform.domin.*;
+import lombok.Data;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+@Data
+@Service
+public class TemplateCard {
+
+// /**消息类型*/
+// private String msgtype ;
+ /** 模板卡片的模板类型*/
+ private String card_type;
+
+ /**卡片来源信息模板 icon_url:来源图片url、desc:描述、desc_color:颜色 0(默认) 灰色,1 黑色,2 红色,3 绿色 */
+ private Souce source;
+
+ /** 模版卡片的主要内容 title:一级标题、desc:标题辅助信息*/
+ private MainTitle main_title;
+
+ /** 关键数据样式 "title":"100",
+ "desc":"数据含义"*/
+ private EmphasisContent emphasis_content;
+
+ /** 引用文献样式
+ * "type":1,
+ "url":"https://work.weixin.qq.com/?from=openApi",
+ "appid":"APPID",
+ "pagepath":"PAGEPATH",
+ "title":"引用文本标题",
+ "quote_text":"Jack:企业微信真的很好用~\nBalian:超级好的一款软件!"*/
+ private QuoteArea quote_area;
+
+
+ private String sub_title_text;
+
+ /** 二级标题+文本列表 type:0或不填代表是普通文本,1 代表跳转url,2 代表下载附件,3 代表@员工
+ keyname:二级标题、value:内容、url:链接
+ * */
+ private ArrayList horizontal_content_list;
+
+ /** {
+ "type":1,
+ "url":"https://work.weixin.qq.com/?from=openApi",
+ "title":"企业微信官网"
+ },
+ {
+ "type":2,
+ "appid":"APPID",
+ "pagepath":"PAGEPATH",
+ "title":"跳转小程序"
+ }*/
+ private ArrayList jump_list;
+
+ /** 0 = 未购买 1 = 已购买 "type":1,
+ "url":"https://work.weixin.qq.com/?from=openApi",
+ "appid":"APPID",
+ "pagepath":"PAGEPATH"*/
+ private CardAction card_action;
+}
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/inform/service/SendMsgService.java b/zsw-bxg/src/main/java/co/yixiang/modules/inform/service/SendMsgService.java
new file mode 100644
index 00000000..8ab483bf
--- /dev/null
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/inform/service/SendMsgService.java
@@ -0,0 +1,5 @@
+package co.yixiang.modules.inform.service;
+
+public interface SendMsgService {
+ String inform(long orderId);
+}
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/inform/service/impl/SendMsgServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/inform/service/impl/SendMsgServiceImpl.java
new file mode 100644
index 00000000..c721c858
--- /dev/null
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/inform/service/impl/SendMsgServiceImpl.java
@@ -0,0 +1,85 @@
+package co.yixiang.modules.inform.service.impl;
+
+import cn.hutool.json.JSONUtil;
+import co.yixiang.modules.inform.domin.*;
+import co.yixiang.modules.inform.service.SendMsgService;
+import co.yixiang.modules.order.service.YxStoreOrderService;
+import co.yixiang.modules.order.service.dto.YxStoreOrderDto;
+import com.alibaba.fastjson.JSONObject;
+import lombok.SneakyThrows;
+import org.apache.http.HttpStatus;
+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.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+@Service
+public class SendMsgServiceImpl implements SendMsgService {
+
+ @Autowired
+ private YxStoreOrderService yxStoreOrderService;
+
+ @Autowired
+ private TemplateCard templateCard;
+
+ @SneakyThrows
+ @Override
+ public String inform(long orderId) {
+ CloseableHttpClient httpClient = HttpClients.createDefault();//实例化对象
+ String webhook_url="https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=a2f0f8c9-e406-4f6b-86e4-d6ac9e4df88e";
+ HttpPost httpPost=new HttpPost(webhook_url);
+ httpPost.addHeader("Content-Type", "application/json; charset=utf-8");
+
+ TemplateCard templateCard=this.creatTemplatecard(orderId);
+ Map param = new HashMap<>();
+ param.put("msgtype", "template_card");
+ param.put("template_card", JSONObject.parseObject(JSONUtil.toJsonStr(templateCard)));
+ String jsonParam = JSONObject.toJSONString(param);
+
+ StringEntity stringEntity=new StringEntity(jsonParam, "utf-8");
+ httpPost.setEntity(stringEntity);
+ CloseableHttpResponse response=httpClient.execute(httpPost);
+// 发送成功接收返回值
+ if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
+ String result = EntityUtils.toString(response.getEntity(), "utf-8");
+ System.out.println("发送微信机器人消息成功 " + result);
+ return result;
+ } else {
+ System.out.println("发送微信机器人消息失败");
+ }
+ // 关闭
+ httpClient.close();
+ response.close();
+ return "发送微信机器人消息失败";
+ }
+
+ public TemplateCard creatTemplatecard(long orderId){
+ YxStoreOrderDto yxStoreOrderDto=yxStoreOrderService.getOrderDetailByOrderId(orderId);
+ templateCard.setCard_type("text_notice");
+ templateCard.setSource(new Souce().setDesc("眼界甄选").setIcon_url("https://wework.qpic.cn/wwpic/252813_jOfDHtcISzuodLa_1629280209/0").setDesc_color(0));
+ templateCard.setMain_title(new MainTitle().setTitle("有新的在线订单来啦").setDesc("订单号:"+orderId));
+ templateCard.setEmphasis_content(new EmphasisContent().setTitle(yxStoreOrderDto.getPayPrice().toString()).setDesc("订单总金额"));
+// templateCard.setQuote_area(new QuoteArea().setType(0).setUrl("").setAppid("APPID").setTitle("订单详情").setQuote_text("眼镜*1 0.01"));
+ templateCard.setSub_title_text("订单类型:"+yxStoreOrderDto.getPinkName());//订单类型
+ ArrayList arrayList=new ArrayList<>();
+ arrayList.add(new HorizontalContent().setKeyname("下单地址").setValue(yxStoreOrderDto.getUserAddress()));
+ arrayList.add(new HorizontalContent().setKeyname("下单时间").setValue(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(yxStoreOrderDto.getCreateTime())));
+ arrayList.add(new HorizontalContent().setKeyname("会员名称").setValue(yxStoreOrderDto.getRealName()));
+ arrayList.add(new HorizontalContent().setKeyname("会员手机号").setValue(yxStoreOrderDto.getUserPhone()));
+ templateCard.setHorizontal_content_list(arrayList);
+ ArrayList arrayList1=new ArrayList<>();
+ arrayList1.add(new Jump().setType(1).setUrl("https://work.weixin.qq.com/?from=openApi").setTitle("前去处理订单"));
+ templateCard.setJump_list(arrayList1);
+ templateCard.setCard_action(new CardAction().setType(1).setUrl("https://work.weixin.qq.com/?from=openApi"));
+ return templateCard;
+ }
+}
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/order/service/YxStoreOrderService.java b/zsw-bxg/src/main/java/co/yixiang/modules/order/service/YxStoreOrderService.java
index 965b59ea..4e242fa4 100644
--- a/zsw-bxg/src/main/java/co/yixiang/modules/order/service/YxStoreOrderService.java
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/order/service/YxStoreOrderService.java
@@ -299,4 +299,7 @@ public interface YxStoreOrderService extends BaseService{
void retrunStock(String orderId);
+
+
+ YxStoreOrderDto getOrderDetailByOrderId(Long orderId);
}
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderServiceImpl.java
index 9a3a55cf..878c7906 100644
--- a/zsw-bxg/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderServiceImpl.java
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderServiceImpl.java
@@ -121,7 +121,6 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreOrder::getOrderId, orderId);
+
YxStoreOrder yxStoreOrder=yxStoreOrderMapper.selectOne(wrapper);
+
+ return this.getOrderDetail(yxStoreOrder.getId());
+ };
+ /**
+ * 获取订单详情
+ *
+ * @param id
+ * @return
+ */
+ @Override
+ public YxStoreOrderDto getOrderDetail(Long id) {
+ YxStoreOrder yxStoreOrder = this.getById(id);
if (ObjectUtil.isEmpty(yxStoreOrder)) {
throw new BadRequestException("订单详情不存在");
}
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/order/service/mapper/StoreOrderMapper.java b/zsw-bxg/src/main/java/co/yixiang/modules/order/service/mapper/StoreOrderMapper.java
index 474b32ba..38d0d854 100644
--- a/zsw-bxg/src/main/java/co/yixiang/modules/order/service/mapper/StoreOrderMapper.java
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/order/service/mapper/StoreOrderMapper.java
@@ -49,6 +49,10 @@ public interface StoreOrderMapper extends CoreMapper {
double sumPrice(@Param("uid") Long uid);
+// @Select("select * from yx_store_order " +
+// "where orderId=#{orderId}")
+// YxStoreOrder SelectOne(@Param("orderId") Long orderId);
+
@Select("SELECT COUNT(*) FROM yx_store_order WHERE pay_time >= ${today}")
Integer countByPayTimeGreaterThanEqual(@Param("today")int today);