Browse Source

chore: 删除微信模板实现(微信官方已经不支持)

Junling Bu 6 years ago
parent
commit
35d874ef5e
23 changed files with 3 additions and 3299 deletions
  1. 1 1
      README.md
  2. 0 14
      deploy/litemall/application.yml
  3. 0 36
      doc/project.md
  4. 0 46
      litemall-core/src/main/java/org/linlinjava/litemall/core/notify/NotifyService.java
  5. 0 84
      litemall-core/src/main/java/org/linlinjava/litemall/core/notify/WxTemplateSender.java
  6. 0 12
      litemall-core/src/main/java/org/linlinjava/litemall/core/notify/config/NotifyAutoConfiguration.java
  7. 0 30
      litemall-core/src/main/java/org/linlinjava/litemall/core/notify/config/NotifyProperties.java
  8. 0 15
      litemall-core/src/main/resources/application-core.yml
  9. 0 4
      litemall-db/mybatis-generator/generatorConfig.xml
  10. 0 7
      litemall-db/sql/litemall_data.sql
  11. 0 19
      litemall-db/sql/litemall_table.sql
  12. 0 152
      litemall-db/src/main/java/org/linlinjava/litemall/db/dao/LitemallUserFormidMapper.java
  13. 0 653
      litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallUserFormid.java
  14. 0 1632
      litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallUserFormidExample.java
  15. 0 56
      litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallUserFormIdService.java
  16. 0 457
      litemall-db/src/main/resources/org/linlinjava/litemall/db/dao/LitemallUserFormidMapper.xml
  17. 0 2
      litemall-vue/src/api/api.js
  18. 0 16
      litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/service/WxOrderService.java
  19. 0 49
      litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxUserFormId.java
  20. 0 2
      litemall-wx/config/api.js
  21. 0 2
      renard-wx/config/api.js
  22. 0 8
      renard-wx/pages/index/index.js
  23. 2 2
      renard-wx/pages/index/index.wxml

+ 1 - 1
README.md

@@ -71,7 +71,7 @@ litemall = Spring Boot后端 + Vue管理员前端 + 微信小程序用户前端
 * 品牌列表、品牌详情
 * 新品首发、人气推荐
 * 优惠券列表、优惠券选择
-* 团购(团购业务有待完善)
+* 团购
 * 搜索
 * 商品详情、商品评价、商品分享
 * 购物车

+ 0 - 14
deploy/litemall/application.yml

@@ -82,20 +82,6 @@ litemall:
         accessKeyId: xxx
         accessKeySecret: xxx
 
-    # 微信模版通知配置
-    # 微信模版用于通知客户或者运营者,注意配置格式;template-name,template-templateId 请参考 NotifyType 枚举值
-    wx:
-      enable: false
-      template:
-        - name: paySucceed
-          templateId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-        - name: captcha
-          templateId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-        - name: ship
-          templateId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-        - name: refund
-          templateId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-
   # 快鸟物流查询配置
   express:
     enable: false

+ 0 - 36
doc/project.md

@@ -636,42 +636,6 @@ litemall:
 例如“你好,验证码是{code},时间是{code1}"。开发者可以查看`AliyunSmsSender`类的`sendWithTemplate`方法的
 源代码即可理解。如果觉得不合理,可以自行调整相关代码。
 
-#### 1.4.5.7 微信通知配置
-
-微信通知是微信上收到的服务通知。
-
-在litemall-core模块的`application-core.yml`文件中配置微信通知服务:
-```
-litemall:
-  notify:
-    # 微信模版通知配置
-    # 微信模版用于通知客户或者运营者,注意配置格式;template-name,template-templateId 请参考 NotifyType 枚举值
-    wx:
-      enable: false
-      template:
-      - name: paySucceed
-        templateId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-      - name: captcha
-        templateId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-      - name: ship
-        templateId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-      - name: refund
-        templateId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-```        
-
-配置方式:
-1. 微信公众平台申请,然后在`模板消息`中设置四个场景的微信模板;
-2. 开发者在配置文件设置`enable`的值`true`,然后其他信息设置
-微信公众平台中所设置模板ID。
-
-应用场景:
-目前微信通知场景只支持支付成功、验证码、订单发送、退款成功四种情况。
-以后可能需要继续优化扩展。
-
-验证配置成功:
-这里没有实现测试类,因为微信通知需要小程序前端的formId作为参数,因此需要
-小商城前端配合。开发者可以在实际场景中DBEUG看看。
-
 #### 1.4.5.8 物流配置
 
 物流配置是查询商品物流信息,这里主要是基于[第三方快递鸟服务](http://www.kdniao.com/api-track)。

+ 0 - 46
litemall-core/src/main/java/org/linlinjava/litemall/core/notify/NotifyService.java

@@ -19,7 +19,6 @@ public class NotifyService {
     private SmsSender smsSender;
     private List<Map<String, String>> smsTemplate = new ArrayList<>();
 
-    private WxTemplateSender wxTemplateSender;
     private List<Map<String, String>> wxTemplate = new ArrayList<>();
 
     public boolean isMailEnable() {
@@ -30,10 +29,6 @@ public class NotifyService {
         return smsSender != null;
     }
 
-    public boolean isWxEnable() {
-        return wxTemplateSender != null;
-    }
-
     /**
      * 短信消息通知
      *
@@ -85,43 +80,6 @@ public class NotifyService {
     }
 
     /**
-     * 微信模版消息通知,不跳转
-     * <p>
-     * 该方法会尝试从数据库获取缓存的FormId去发送消息
-     *
-     * @param touser     接收者openId
-     * @param notifyType 通知类别,通过该枚举值在配置文件中获取相应的模版ID
-     * @param params     通知模版内容里的参数,类似"您的验证码为{1}"中{1}的值
-     */
-    @Async
-    public void notifyWxTemplate(String touser, NotifyType notifyType, String[] params) {
-        if (wxTemplateSender == null)
-            return;
-
-        String templateId = getTemplateId(notifyType, wxTemplate);
-        wxTemplateSender.sendWechatMsg(touser, templateId, params);
-    }
-
-    /**
-     * 微信模版消息通知,带跳转
-     * <p>
-     * 该方法会尝试从数据库获取缓存的FormId去发送消息
-     *
-     * @param touser     接收者openId
-     * @param notifyType 通知类别,通过该枚举值在配置文件中获取相应的模版ID
-     * @param params     通知模版内容里的参数,类似"您的验证码为{1}"中{1}的值
-     * @param page       点击消息跳转的页面
-     */
-    @Async
-    public void notifyWxTemplate(String touser, NotifyType notifyType, String[] params, String page) {
-        if (wxTemplateSender == null)
-            return;
-
-        String templateId = getTemplateId(notifyType, wxTemplate);
-        wxTemplateSender.sendWechatMsg(touser, templateId, params, page);
-    }
-
-    /**
      * 邮件消息通知,
      * 接收者在spring.mail.sendto中指定
      *
@@ -171,10 +129,6 @@ public class NotifyService {
         this.smsTemplate = smsTemplate;
     }
 
-    public void setWxTemplateSender(WxTemplateSender wxTemplateSender) {
-        this.wxTemplateSender = wxTemplateSender;
-    }
-
     public void setWxTemplate(List<Map<String, String>> wxTemplate) {
         this.wxTemplate = wxTemplate;
     }

+ 0 - 84
litemall-core/src/main/java/org/linlinjava/litemall/core/notify/WxTemplateSender.java

@@ -1,84 +0,0 @@
-package org.linlinjava.litemall.core.notify;
-
-import cn.binarywang.wx.miniapp.api.WxMaService;
-import cn.binarywang.wx.miniapp.bean.WxMaTemplateData;
-import cn.binarywang.wx.miniapp.bean.WxMaTemplateMessage;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.linlinjava.litemall.db.domain.LitemallUserFormid;
-import org.linlinjava.litemall.db.service.LitemallUserFormIdService;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * 微信模版消息通知
- */
-public class WxTemplateSender {
-    private final Log logger = LogFactory.getLog(WxTemplateSender.class);
-
-    @Autowired
-    private WxMaService wxMaService;
-
-    @Autowired
-    private LitemallUserFormIdService formIdService;
-
-    /**
-     * 发送微信消息(模板消息),不带跳转
-     *
-     * @param touser    用户 OpenID
-     * @param templatId 模板消息ID
-     * @param parms     详细内容
-     */
-    public void sendWechatMsg(String touser, String templatId, String[] parms) {
-        sendMsg(touser, templatId, parms, "", "", "");
-    }
-
-    /**
-     * 发送微信消息(模板消息),带跳转
-     *
-     * @param touser    用户 OpenID
-     * @param templatId 模板消息ID
-     * @param parms     详细内容
-     * @param page      跳转页面
-     */
-    public void sendWechatMsg(String touser, String templatId, String[] parms, String page) {
-        sendMsg(touser, templatId, parms, page, "", "");
-    }
-
-    private void sendMsg(String touser, String templatId, String[] parms, String page, String color,
-                         String emphasisKeyword) {
-        LitemallUserFormid userFormid = formIdService.queryByOpenId(touser);
-        if (userFormid == null)
-            return;
-
-
-        WxMaTemplateMessage msg = new WxMaTemplateMessage();
-        msg.setTemplateId(templatId);
-        msg.setToUser(touser);
-        msg.setFormId(userFormid.getFormid());
-        msg.setPage(page);
-        msg.setColor(color);
-        msg.setEmphasisKeyword(emphasisKeyword);
-        msg.setData(createMsgData(parms));
-
-        try {
-            wxMaService.getMsgService().sendTemplateMsg(msg);
-            if (formIdService.updateUserFormId(userFormid) == 0) {
-                logger.warn("更新数据已失效");
-            }
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-        }
-    }
-
-    private List<WxMaTemplateData> createMsgData(String[] parms) {
-        List<WxMaTemplateData> dataList = new ArrayList<WxMaTemplateData>();
-        for (int i = 1; i <= parms.length; i++) {
-            dataList.add(new WxMaTemplateData("keyword" + i, parms[i - 1]));
-        }
-
-        return dataList;
-    }
-}

+ 0 - 12
litemall-core/src/main/java/org/linlinjava/litemall/core/notify/config/NotifyAutoConfiguration.java

@@ -4,7 +4,6 @@ import com.github.qcloudsms.SmsSingleSender;
 import org.linlinjava.litemall.core.notify.AliyunSmsSender;
 import org.linlinjava.litemall.core.notify.NotifyService;
 import org.linlinjava.litemall.core.notify.TencentSmsSender;
-import org.linlinjava.litemall.core.notify.WxTemplateSender;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -46,11 +45,6 @@ public class NotifyAutoConfiguration {
             notifyService.setSmsTemplate(smsConfig.getTemplate());
         }
 
-        NotifyProperties.Wx wxConfig = properties.getWx();
-        if (wxConfig.isEnable()) {
-            notifyService.setWxTemplateSender(wxTemplateSender());
-            notifyService.setWxTemplate(wxConfig.getTemplate());
-        }
         return notifyService;
     }
 
@@ -76,12 +70,6 @@ public class NotifyAutoConfiguration {
     }
 
     @Bean
-    public WxTemplateSender wxTemplateSender() {
-        WxTemplateSender wxTemplateSender = new WxTemplateSender();
-        return wxTemplateSender;
-    }
-
-    @Bean
     public TencentSmsSender tencentSmsSender() {
         NotifyProperties.Sms smsConfig = properties.getSms();
         TencentSmsSender smsSender = new TencentSmsSender();

+ 0 - 30
litemall-core/src/main/java/org/linlinjava/litemall/core/notify/config/NotifyProperties.java

@@ -10,7 +10,6 @@ import java.util.Map;
 public class NotifyProperties {
     private Mail mail;
     private Sms sms;
-    private Wx wx;
 
     public Mail getMail() {
         return mail;
@@ -28,14 +27,6 @@ public class NotifyProperties {
         this.sms = sms;
     }
 
-    public Wx getWx() {
-        return wx;
-    }
-
-    public void setWx(Wx wx) {
-        this.wx = wx;
-    }
-
     public static class Mail {
         private boolean enable;
         private String host;
@@ -209,25 +200,4 @@ public class NotifyProperties {
         }
     }
 
-    public static class Wx {
-        private boolean enable;
-        private List<Map<String, String>> template = new ArrayList<>();
-
-        public boolean isEnable() {
-            return enable;
-        }
-
-        public void setEnable(boolean enable) {
-            this.enable = enable;
-        }
-
-        public List<Map<String, String>> getTemplate() {
-            return template;
-        }
-
-        public void setTemplate(List<Map<String, String>> template) {
-            this.template = template;
-        }
-    }
-
 }

+ 0 - 15
litemall-core/src/main/resources/application-core.yml

@@ -46,21 +46,6 @@ litemall:
         accessKeyId: xxx
         accessKeySecret: xxx
 
-
-    # 微信模版通知配置
-    # 微信模版用于通知客户或者运营者,注意配置格式;template-name,template-templateId 请参考 NotifyType 枚举值
-    wx:
-      enable: false
-      template:
-      - name: paySucceed
-        templateId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-      - name: captcha
-        templateId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-      - name: ship
-        templateId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-      - name: refund
-        templateId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-
   # 快鸟物流查询配置
   express:
     enable: false

+ 0 - 4
litemall-db/mybatis-generator/generatorConfig.xml

@@ -150,10 +150,6 @@
             <generatedKey column="id" sqlStatement="MySql" identity="true"/>
         </table>
 
-        <table tableName="litemall_user_formid">
-            <generatedKey column="id" sqlStatement="MySql" identity="true"/>
-        </table>
-
         <table tableName="litemall_groupon_rules">
             <generatedKey column="id" sqlStatement="MySql" identity="true"/>
         </table>

+ 0 - 7
litemall-db/sql/litemall_data.sql

@@ -316,14 +316,6 @@ INSERT INTO `litemall_user` VALUES (1,'user123','$2a$10$lTu9qi0hr19OC800Db.eludF
 /*!40000 ALTER TABLE `litemall_user` ENABLE KEYS */;
 UNLOCK TABLES;
 
---
---
-
-LOCK TABLES `litemall_user_formid` WRITE;
-/*!40000 ALTER TABLE `litemall_user_formid` DISABLE KEYS */;
-/*!40000 ALTER TABLE `litemall_user_formid` ENABLE KEYS */;
-UNLOCK TABLES;
 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
 
 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;

+ 0 - 19
litemall-db/sql/litemall_table.sql

@@ -753,26 +753,6 @@ CREATE TABLE `litemall_user` (
 ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='用户表';
 /*!40101 SET character_set_client = @saved_cs_client */;
 
---
---
-
-DROP TABLE IF EXISTS `litemall_user_formid`;
-/*!40101 SET @saved_cs_client     = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `litemall_user_formid` (
-  `id` int(11) NOT NULL AUTO_INCREMENT,
-  `formId` varchar(63) NOT NULL COMMENT '缓存的FormId',
-  `isprepay` tinyint(1) NOT NULL COMMENT '是FormId还是prepayId',
-  `useAmount` int(2) NOT NULL COMMENT '可用次数,fromId为1,prepay为3,用1次减1',
-  `expire_time` datetime NOT NULL COMMENT '过期时间,腾讯规定为7天',
-  `openId` varchar(63) NOT NULL COMMENT '微信登录openid',
-  `add_time` datetime DEFAULT NULL COMMENT '创建时间',
-  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
-  `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
-  PRIMARY KEY (`id`) USING BTREE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
-/*!40101 SET character_set_client = @saved_cs_client */;
 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
 
 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;

+ 0 - 152
litemall-db/src/main/java/org/linlinjava/litemall/db/dao/LitemallUserFormidMapper.java

@@ -1,152 +0,0 @@
-package org.linlinjava.litemall.db.dao;
-
-import java.util.List;
-import org.apache.ibatis.annotations.Param;
-import org.linlinjava.litemall.db.domain.LitemallUserFormid;
-import org.linlinjava.litemall.db.domain.LitemallUserFormidExample;
-
-public interface LitemallUserFormidMapper {
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    long countByExample(LitemallUserFormidExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    int deleteByExample(LitemallUserFormidExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    int deleteByPrimaryKey(Integer id);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    int insert(LitemallUserFormid record);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    int insertSelective(LitemallUserFormid record);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    LitemallUserFormid selectOneByExample(LitemallUserFormidExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    LitemallUserFormid selectOneByExampleSelective(@Param("example") LitemallUserFormidExample example, @Param("selective") LitemallUserFormid.Column ... selective);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    List<LitemallUserFormid> selectByExampleSelective(@Param("example") LitemallUserFormidExample example, @Param("selective") LitemallUserFormid.Column ... selective);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    List<LitemallUserFormid> selectByExample(LitemallUserFormidExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    LitemallUserFormid selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") LitemallUserFormid.Column ... selective);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    LitemallUserFormid selectByPrimaryKey(Integer id);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    LitemallUserFormid selectByPrimaryKeyWithLogicalDelete(@Param("id") Integer id, @Param("andLogicalDeleted") boolean andLogicalDeleted);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    int updateByExampleSelective(@Param("record") LitemallUserFormid record, @Param("example") LitemallUserFormidExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    int updateByExample(@Param("record") LitemallUserFormid record, @Param("example") LitemallUserFormidExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    int updateByPrimaryKeySelective(LitemallUserFormid record);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    int updateByPrimaryKey(LitemallUserFormid record);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    int logicalDeleteByExample(@Param("example") LitemallUserFormidExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    int logicalDeleteByPrimaryKey(Integer id);
-}

+ 0 - 653
litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallUserFormid.java

@@ -1,653 +0,0 @@
-package org.linlinjava.litemall.db.domain;
-
-import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.Arrays;
-
-public class LitemallUserFormid {
-    /**
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    public static final Boolean IS_DELETED = Deleted.IS_DELETED.value();
-
-    /**
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    public static final Boolean NOT_DELETED = Deleted.NOT_DELETED.value();
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column litemall_user_formid.id
-     *
-     * @mbg.generated
-     */
-    private Integer id;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column litemall_user_formid.formId
-     *
-     * @mbg.generated
-     */
-    private String formid;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column litemall_user_formid.isprepay
-     *
-     * @mbg.generated
-     */
-    private Boolean isprepay;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column litemall_user_formid.useAmount
-     *
-     * @mbg.generated
-     */
-    private Integer useamount;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column litemall_user_formid.expire_time
-     *
-     * @mbg.generated
-     */
-    private LocalDateTime expireTime;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column litemall_user_formid.openId
-     *
-     * @mbg.generated
-     */
-    private String openid;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column litemall_user_formid.add_time
-     *
-     * @mbg.generated
-     */
-    private LocalDateTime addTime;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column litemall_user_formid.update_time
-     *
-     * @mbg.generated
-     */
-    private LocalDateTime updateTime;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column litemall_user_formid.deleted
-     *
-     * @mbg.generated
-     */
-    private Boolean deleted;
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column litemall_user_formid.id
-     *
-     * @return the value of litemall_user_formid.id
-     *
-     * @mbg.generated
-     */
-    public Integer getId() {
-        return id;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column litemall_user_formid.id
-     *
-     * @param id the value for litemall_user_formid.id
-     *
-     * @mbg.generated
-     */
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column litemall_user_formid.formId
-     *
-     * @return the value of litemall_user_formid.formId
-     *
-     * @mbg.generated
-     */
-    public String getFormid() {
-        return formid;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column litemall_user_formid.formId
-     *
-     * @param formid the value for litemall_user_formid.formId
-     *
-     * @mbg.generated
-     */
-    public void setFormid(String formid) {
-        this.formid = formid;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column litemall_user_formid.isprepay
-     *
-     * @return the value of litemall_user_formid.isprepay
-     *
-     * @mbg.generated
-     */
-    public Boolean getIsprepay() {
-        return isprepay;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column litemall_user_formid.isprepay
-     *
-     * @param isprepay the value for litemall_user_formid.isprepay
-     *
-     * @mbg.generated
-     */
-    public void setIsprepay(Boolean isprepay) {
-        this.isprepay = isprepay;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column litemall_user_formid.useAmount
-     *
-     * @return the value of litemall_user_formid.useAmount
-     *
-     * @mbg.generated
-     */
-    public Integer getUseamount() {
-        return useamount;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column litemall_user_formid.useAmount
-     *
-     * @param useamount the value for litemall_user_formid.useAmount
-     *
-     * @mbg.generated
-     */
-    public void setUseamount(Integer useamount) {
-        this.useamount = useamount;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column litemall_user_formid.expire_time
-     *
-     * @return the value of litemall_user_formid.expire_time
-     *
-     * @mbg.generated
-     */
-    public LocalDateTime getExpireTime() {
-        return expireTime;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column litemall_user_formid.expire_time
-     *
-     * @param expireTime the value for litemall_user_formid.expire_time
-     *
-     * @mbg.generated
-     */
-    public void setExpireTime(LocalDateTime expireTime) {
-        this.expireTime = expireTime;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column litemall_user_formid.openId
-     *
-     * @return the value of litemall_user_formid.openId
-     *
-     * @mbg.generated
-     */
-    public String getOpenid() {
-        return openid;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column litemall_user_formid.openId
-     *
-     * @param openid the value for litemall_user_formid.openId
-     *
-     * @mbg.generated
-     */
-    public void setOpenid(String openid) {
-        this.openid = openid;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column litemall_user_formid.add_time
-     *
-     * @return the value of litemall_user_formid.add_time
-     *
-     * @mbg.generated
-     */
-    public LocalDateTime getAddTime() {
-        return addTime;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column litemall_user_formid.add_time
-     *
-     * @param addTime the value for litemall_user_formid.add_time
-     *
-     * @mbg.generated
-     */
-    public void setAddTime(LocalDateTime addTime) {
-        this.addTime = addTime;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column litemall_user_formid.update_time
-     *
-     * @return the value of litemall_user_formid.update_time
-     *
-     * @mbg.generated
-     */
-    public LocalDateTime getUpdateTime() {
-        return updateTime;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column litemall_user_formid.update_time
-     *
-     * @param updateTime the value for litemall_user_formid.update_time
-     *
-     * @mbg.generated
-     */
-    public void setUpdateTime(LocalDateTime updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    public void andLogicalDeleted(boolean deleted) {
-        setDeleted(deleted ? Deleted.IS_DELETED.value() : Deleted.NOT_DELETED.value());
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column litemall_user_formid.deleted
-     *
-     * @return the value of litemall_user_formid.deleted
-     *
-     * @mbg.generated
-     */
-    public Boolean getDeleted() {
-        return deleted;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column litemall_user_formid.deleted
-     *
-     * @param deleted the value for litemall_user_formid.deleted
-     *
-     * @mbg.generated
-     */
-    public void setDeleted(Boolean deleted) {
-        this.deleted = deleted;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        sb.append(getClass().getSimpleName());
-        sb.append(" [");
-        sb.append("Hash = ").append(hashCode());
-        sb.append(", IS_DELETED=").append(IS_DELETED);
-        sb.append(", NOT_DELETED=").append(NOT_DELETED);
-        sb.append(", id=").append(id);
-        sb.append(", formid=").append(formid);
-        sb.append(", isprepay=").append(isprepay);
-        sb.append(", useamount=").append(useamount);
-        sb.append(", expireTime=").append(expireTime);
-        sb.append(", openid=").append(openid);
-        sb.append(", addTime=").append(addTime);
-        sb.append(", updateTime=").append(updateTime);
-        sb.append(", deleted=").append(deleted);
-        sb.append("]");
-        return sb.toString();
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    @Override
-    public boolean equals(Object that) {
-        if (this == that) {
-            return true;
-        }
-        if (that == null) {
-            return false;
-        }
-        if (getClass() != that.getClass()) {
-            return false;
-        }
-        LitemallUserFormid other = (LitemallUserFormid) that;
-        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
-            && (this.getFormid() == null ? other.getFormid() == null : this.getFormid().equals(other.getFormid()))
-            && (this.getIsprepay() == null ? other.getIsprepay() == null : this.getIsprepay().equals(other.getIsprepay()))
-            && (this.getUseamount() == null ? other.getUseamount() == null : this.getUseamount().equals(other.getUseamount()))
-            && (this.getExpireTime() == null ? other.getExpireTime() == null : this.getExpireTime().equals(other.getExpireTime()))
-            && (this.getOpenid() == null ? other.getOpenid() == null : this.getOpenid().equals(other.getOpenid()))
-            && (this.getAddTime() == null ? other.getAddTime() == null : this.getAddTime().equals(other.getAddTime()))
-            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
-            && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()));
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
-        result = prime * result + ((getFormid() == null) ? 0 : getFormid().hashCode());
-        result = prime * result + ((getIsprepay() == null) ? 0 : getIsprepay().hashCode());
-        result = prime * result + ((getUseamount() == null) ? 0 : getUseamount().hashCode());
-        result = prime * result + ((getExpireTime() == null) ? 0 : getExpireTime().hashCode());
-        result = prime * result + ((getOpenid() == null) ? 0 : getOpenid().hashCode());
-        result = prime * result + ((getAddTime() == null) ? 0 : getAddTime().hashCode());
-        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
-        result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
-        return result;
-    }
-
-    /**
-     * This enum was generated by MyBatis Generator.
-     * This enum corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    public enum Deleted {
-        NOT_DELETED(new Boolean("0"), "未删除"),
-        IS_DELETED(new Boolean("1"), "已删除");
-
-        /**
-         * This field was generated by MyBatis Generator.
-         * This field corresponds to the database table litemall_user_formid
-         *
-         * @mbg.generated
-         */
-        private final Boolean value;
-
-        /**
-         * This field was generated by MyBatis Generator.
-         * This field corresponds to the database table litemall_user_formid
-         *
-         * @mbg.generated
-         */
-        private final String name;
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table litemall_user_formid
-         *
-         * @mbg.generated
-         */
-        Deleted(Boolean value, String name) {
-            this.value = value;
-            this.name = name;
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table litemall_user_formid
-         *
-         * @mbg.generated
-         */
-        public Boolean getValue() {
-            return this.value;
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table litemall_user_formid
-         *
-         * @mbg.generated
-         */
-        public Boolean value() {
-            return this.value;
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table litemall_user_formid
-         *
-         * @mbg.generated
-         */
-        public String getName() {
-            return this.name;
-        }
-    }
-
-    /**
-     * This enum was generated by MyBatis Generator.
-     * This enum corresponds to the database table litemall_user_formid
-     *
-     * @mbg.generated
-     */
-    public enum Column {
-        id("id", "id", "INTEGER", false),
-        formid("formId", "formid", "VARCHAR", false),
-        isprepay("isprepay", "isprepay", "BIT", false),
-        useamount("useAmount", "useamount", "INTEGER", false),
-        expireTime("expire_time", "expireTime", "TIMESTAMP", false),
-        openid("openId", "openid", "VARCHAR", false),
-        addTime("add_time", "addTime", "TIMESTAMP", false),
-        updateTime("update_time", "updateTime", "TIMESTAMP", false),
-        deleted("deleted", "deleted", "BIT", false);
-
-        /**
-         * This field was generated by MyBatis Generator.
-         * This field corresponds to the database table litemall_user_formid
-         *
-         * @mbg.generated
-         */
-        private static final String BEGINNING_DELIMITER = "`";
-
-        /**
-         * This field was generated by MyBatis Generator.
-         * This field corresponds to the database table litemall_user_formid
-         *
-         * @mbg.generated
-         */
-        private static final String ENDING_DELIMITER = "`";
-
-        /**
-         * This field was generated by MyBatis Generator.
-         * This field corresponds to the database table litemall_user_formid
-         *
-         * @mbg.generated
-         */
-        private final String column;
-
-        /**
-         * This field was generated by MyBatis Generator.
-         * This field corresponds to the database table litemall_user_formid
-         *
-         * @mbg.generated
-         */
-        private final boolean isColumnNameDelimited;
-
-        /**
-         * This field was generated by MyBatis Generator.
-         * This field corresponds to the database table litemall_user_formid
-         *
-         * @mbg.generated
-         */
-        private final String javaProperty;
-
-        /**
-         * This field was generated by MyBatis Generator.
-         * This field corresponds to the database table litemall_user_formid
-         *
-         * @mbg.generated
-         */
-        private final String jdbcType;
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table litemall_user_formid
-         *
-         * @mbg.generated
-         */
-        public String value() {
-            return this.column;
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table litemall_user_formid
-         *
-         * @mbg.generated
-         */
-        public String getValue() {
-            return this.column;
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table litemall_user_formid
-         *
-         * @mbg.generated
-         */
-        public String getJavaProperty() {
-            return this.javaProperty;
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table litemall_user_formid
-         *
-         * @mbg.generated
-         */
-        public String getJdbcType() {
-            return this.jdbcType;
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table litemall_user_formid
-         *
-         * @mbg.generated
-         */
-        Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
-            this.column = column;
-            this.javaProperty = javaProperty;
-            this.jdbcType = jdbcType;
-            this.isColumnNameDelimited = isColumnNameDelimited;
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table litemall_user_formid
-         *
-         * @mbg.generated
-         */
-        public String desc() {
-            return this.getEscapedColumnName() + " DESC";
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table litemall_user_formid
-         *
-         * @mbg.generated
-         */
-        public String asc() {
-            return this.getEscapedColumnName() + " ASC";
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table litemall_user_formid
-         *
-         * @mbg.generated
-         */
-        public static Column[] excludes(Column ... excludes) {
-            ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
-            if (excludes != null && excludes.length > 0) {
-                columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
-            }
-            return columns.toArray(new Column[]{});
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table litemall_user_formid
-         *
-         * @mbg.generated
-         */
-        public String getEscapedColumnName() {
-            if (this.isColumnNameDelimited) {
-                return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
-            } else {
-                return this.column;
-            }
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table litemall_user_formid
-         *
-         * @mbg.generated
-         */
-        public String getAliasedEscapedColumnName() {
-            return this.getEscapedColumnName();
-        }
-    }
-}

File diff suppressed because it is too large
+ 0 - 1632
litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallUserFormidExample.java


+ 0 - 56
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallUserFormIdService.java

@@ -1,56 +0,0 @@
-package org.linlinjava.litemall.db.service;
-
-import org.linlinjava.litemall.db.dao.LitemallUserFormidMapper;
-import org.linlinjava.litemall.db.domain.LitemallUserFormid;
-import org.linlinjava.litemall.db.domain.LitemallUserFormidExample;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.time.LocalDateTime;
-
-@Service
-public class LitemallUserFormIdService {
-    @Resource
-    private LitemallUserFormidMapper formidMapper;
-
-    /**
-     * 查找是否有可用的FormId
-     *
-     * @param openId
-     * @return
-     */
-    public LitemallUserFormid queryByOpenId(String openId) {
-        LitemallUserFormidExample example = new LitemallUserFormidExample();
-        //符合找到该用户记录,且可用次数大于1,且还未过期
-        example.or().andOpenidEqualTo(openId).andExpireTimeGreaterThan(LocalDateTime.now());
-        example.setOrderByClause("add_time desc");
-        return formidMapper.selectOneByExample(example);
-    }
-
-    /**
-     * 更新或删除FormId
-     *
-     * @param userFormid
-     */
-    public int updateUserFormId(LitemallUserFormid userFormid) {
-        //更新或者删除缓存
-        if (userFormid.getIsprepay() && userFormid.getUseamount() > 1) {
-            userFormid.setUseamount(userFormid.getUseamount() - 1);
-            userFormid.setUpdateTime(LocalDateTime.now());
-            return formidMapper.updateByPrimaryKey(userFormid);
-        } else {
-            return formidMapper.deleteByPrimaryKey(userFormid.getId());
-        }
-    }
-
-    /**
-     * 添加一个 FormId
-     *
-     * @param userFormid
-     */
-    public void addUserFormid(LitemallUserFormid userFormid) {
-        userFormid.setAddTime(LocalDateTime.now());
-        userFormid.setUpdateTime(LocalDateTime.now());
-        formidMapper.insertSelective(userFormid);
-    }
-}

+ 0 - 457
litemall-db/src/main/resources/org/linlinjava/litemall/db/dao/LitemallUserFormidMapper.xml

@@ -1,457 +0,0 @@
-<?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="org.linlinjava.litemall.db.dao.LitemallUserFormidMapper">
-  <resultMap id="BaseResultMap" type="org.linlinjava.litemall.db.domain.LitemallUserFormid">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
-    <id column="id" jdbcType="INTEGER" property="id" />
-    <result column="formId" jdbcType="VARCHAR" property="formid" />
-    <result column="isprepay" jdbcType="BIT" property="isprepay" />
-    <result column="useAmount" jdbcType="INTEGER" property="useamount" />
-    <result column="expire_time" jdbcType="TIMESTAMP" property="expireTime" />
-    <result column="openId" jdbcType="VARCHAR" property="openid" />
-    <result column="add_time" jdbcType="TIMESTAMP" property="addTime" />
-    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
-    <result column="deleted" jdbcType="BIT" property="deleted" />
-  </resultMap>
-  <sql id="Example_Where_Clause">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
-    <where>
-      <foreach collection="oredCriteria" item="criteria" separator="or">
-        <if test="criteria.valid">
-          <trim prefix="(" prefixOverrides="and" suffix=")">
-            <foreach collection="criteria.criteria" item="criterion">
-              <choose>
-                <when test="criterion.noValue">
-                  and ${criterion.condition}
-                </when>
-                <when test="criterion.singleValue">
-                  and ${criterion.condition} #{criterion.value}
-                </when>
-                <when test="criterion.betweenValue">
-                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
-                </when>
-                <when test="criterion.listValue">
-                  and ${criterion.condition}
-                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
-                    #{listItem}
-                  </foreach>
-                </when>
-              </choose>
-            </foreach>
-          </trim>
-        </if>
-      </foreach>
-    </where>
-  </sql>
-  <sql id="Update_By_Example_Where_Clause">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
-    <where>
-      <foreach collection="example.oredCriteria" item="criteria" separator="or">
-        <if test="criteria.valid">
-          <trim prefix="(" prefixOverrides="and" suffix=")">
-            <foreach collection="criteria.criteria" item="criterion">
-              <choose>
-                <when test="criterion.noValue">
-                  and ${criterion.condition}
-                </when>
-                <when test="criterion.singleValue">
-                  and ${criterion.condition} #{criterion.value}
-                </when>
-                <when test="criterion.betweenValue">
-                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
-                </when>
-                <when test="criterion.listValue">
-                  and ${criterion.condition}
-                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
-                    #{listItem}
-                  </foreach>
-                </when>
-              </choose>
-            </foreach>
-          </trim>
-        </if>
-      </foreach>
-    </where>
-  </sql>
-  <sql id="Base_Column_List">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
-    id, formId, isprepay, useAmount, expire_time, openId, add_time, update_time, deleted
-  </sql>
-  <select id="selectByExample" parameterType="org.linlinjava.litemall.db.domain.LitemallUserFormidExample" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
-    select
-    <if test="distinct">
-      distinct
-    </if>
-    <include refid="Base_Column_List" />
-    from litemall_user_formid
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-    <if test="orderByClause != null">
-      order by ${orderByClause}
-    </if>
-  </select>
-  <select id="selectByExampleSelective" parameterType="map" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
-    select
-    <if test="example.distinct">
-      distinct
-    </if>
-    <choose>
-      <when test="selective != null and selective.length &gt; 0">
-        <foreach collection="selective" item="column" separator=",">
-          ${column.aliasedEscapedColumnName}
-        </foreach>
-      </when>
-      <otherwise>
-        <include refid="Base_Column_List" />
-      </otherwise>
-    </choose>
-    from litemall_user_formid
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-    <if test="example.orderByClause != null">
-      order by ${example.orderByClause}
-    </if>
-  </select>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
-    select 
-    <include refid="Base_Column_List" />
-    from litemall_user_formid
-    where id = #{id,jdbcType=INTEGER}
-  </select>
-  <select id="selectByPrimaryKeyWithLogicalDelete" parameterType="map" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
-    select 
-    <include refid="Base_Column_List" />
-    from litemall_user_formid
-    where id = #{id,jdbcType=INTEGER}
-      and deleted = 
-    <choose>
-      <when test="andLogicalDeleted">
-        1
-      </when>
-      <otherwise>
-        0
-      </otherwise>
-    </choose>
-  </select>
-  <select id="selectByPrimaryKeySelective" parameterType="map" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
-    select
-    <choose>
-      <when test="selective != null and selective.length &gt; 0">
-        <foreach collection="selective" item="column" separator=",">
-          ${column.aliasedEscapedColumnName}
-        </foreach>
-      </when>
-      <otherwise>
-        <include refid="Base_Column_List" />
-      </otherwise>
-    </choose>
-    from litemall_user_formid
-    where id = #{id,jdbcType=INTEGER}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
-    delete from litemall_user_formid
-    where id = #{id,jdbcType=INTEGER}
-  </delete>
-  <delete id="deleteByExample" parameterType="org.linlinjava.litemall.db.domain.LitemallUserFormidExample">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
-    delete from litemall_user_formid
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </delete>
-  <insert id="insert" parameterType="org.linlinjava.litemall.db.domain.LitemallUserFormid">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
-    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
-      SELECT LAST_INSERT_ID()
-    </selectKey>
-    insert into litemall_user_formid (formId, isprepay, useAmount, 
-      expire_time, openId, add_time, 
-      update_time, deleted)
-    values (#{formid,jdbcType=VARCHAR}, #{isprepay,jdbcType=BIT}, #{useamount,jdbcType=INTEGER}, 
-      #{expireTime,jdbcType=TIMESTAMP}, #{openid,jdbcType=VARCHAR}, #{addTime,jdbcType=TIMESTAMP}, 
-      #{updateTime,jdbcType=TIMESTAMP}, #{deleted,jdbcType=BIT})
-  </insert>
-  <insert id="insertSelective" parameterType="org.linlinjava.litemall.db.domain.LitemallUserFormid">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
-    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
-      SELECT LAST_INSERT_ID()
-    </selectKey>
-    insert into litemall_user_formid
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="formid != null">
-        formId,
-      </if>
-      <if test="isprepay != null">
-        isprepay,
-      </if>
-      <if test="useamount != null">
-        useAmount,
-      </if>
-      <if test="expireTime != null">
-        expire_time,
-      </if>
-      <if test="openid != null">
-        openId,
-      </if>
-      <if test="addTime != null">
-        add_time,
-      </if>
-      <if test="updateTime != null">
-        update_time,
-      </if>
-      <if test="deleted != null">
-        deleted,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="formid != null">
-        #{formid,jdbcType=VARCHAR},
-      </if>
-      <if test="isprepay != null">
-        #{isprepay,jdbcType=BIT},
-      </if>
-      <if test="useamount != null">
-        #{useamount,jdbcType=INTEGER},
-      </if>
-      <if test="expireTime != null">
-        #{expireTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="openid != null">
-        #{openid,jdbcType=VARCHAR},
-      </if>
-      <if test="addTime != null">
-        #{addTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateTime != null">
-        #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="deleted != null">
-        #{deleted,jdbcType=BIT},
-      </if>
-    </trim>
-  </insert>
-  <select id="countByExample" parameterType="org.linlinjava.litemall.db.domain.LitemallUserFormidExample" resultType="java.lang.Long">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
-    select count(*) from litemall_user_formid
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </select>
-  <update id="updateByExampleSelective" parameterType="map">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
-    update litemall_user_formid
-    <set>
-      <if test="record.id != null">
-        id = #{record.id,jdbcType=INTEGER},
-      </if>
-      <if test="record.formid != null">
-        formId = #{record.formid,jdbcType=VARCHAR},
-      </if>
-      <if test="record.isprepay != null">
-        isprepay = #{record.isprepay,jdbcType=BIT},
-      </if>
-      <if test="record.useamount != null">
-        useAmount = #{record.useamount,jdbcType=INTEGER},
-      </if>
-      <if test="record.expireTime != null">
-        expire_time = #{record.expireTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="record.openid != null">
-        openId = #{record.openid,jdbcType=VARCHAR},
-      </if>
-      <if test="record.addTime != null">
-        add_time = #{record.addTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="record.updateTime != null">
-        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="record.deleted != null">
-        deleted = #{record.deleted,jdbcType=BIT},
-      </if>
-    </set>
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByExample" parameterType="map">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
-    update litemall_user_formid
-    set id = #{record.id,jdbcType=INTEGER},
-      formId = #{record.formid,jdbcType=VARCHAR},
-      isprepay = #{record.isprepay,jdbcType=BIT},
-      useAmount = #{record.useamount,jdbcType=INTEGER},
-      expire_time = #{record.expireTime,jdbcType=TIMESTAMP},
-      openId = #{record.openid,jdbcType=VARCHAR},
-      add_time = #{record.addTime,jdbcType=TIMESTAMP},
-      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
-      deleted = #{record.deleted,jdbcType=BIT}
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByPrimaryKeySelective" parameterType="org.linlinjava.litemall.db.domain.LitemallUserFormid">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
-    update litemall_user_formid
-    <set>
-      <if test="formid != null">
-        formId = #{formid,jdbcType=VARCHAR},
-      </if>
-      <if test="isprepay != null">
-        isprepay = #{isprepay,jdbcType=BIT},
-      </if>
-      <if test="useamount != null">
-        useAmount = #{useamount,jdbcType=INTEGER},
-      </if>
-      <if test="expireTime != null">
-        expire_time = #{expireTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="openid != null">
-        openId = #{openid,jdbcType=VARCHAR},
-      </if>
-      <if test="addTime != null">
-        add_time = #{addTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateTime != null">
-        update_time = #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="deleted != null">
-        deleted = #{deleted,jdbcType=BIT},
-      </if>
-    </set>
-    where id = #{id,jdbcType=INTEGER}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="org.linlinjava.litemall.db.domain.LitemallUserFormid">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
-    update litemall_user_formid
-    set formId = #{formid,jdbcType=VARCHAR},
-      isprepay = #{isprepay,jdbcType=BIT},
-      useAmount = #{useamount,jdbcType=INTEGER},
-      expire_time = #{expireTime,jdbcType=TIMESTAMP},
-      openId = #{openid,jdbcType=VARCHAR},
-      add_time = #{addTime,jdbcType=TIMESTAMP},
-      update_time = #{updateTime,jdbcType=TIMESTAMP},
-      deleted = #{deleted,jdbcType=BIT}
-    where id = #{id,jdbcType=INTEGER}
-  </update>
-  <select id="selectOneByExample" parameterType="org.linlinjava.litemall.db.domain.LitemallUserFormidExample" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
-    select
-    <include refid="Base_Column_List" />
-    from litemall_user_formid
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-    <if test="orderByClause != null">
-      order by ${orderByClause}
-    </if>
-    limit 1
-  </select>
-  <select id="selectOneByExampleSelective" parameterType="map" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
-    select
-    <choose>
-      <when test="selective != null and selective.length &gt; 0">
-        <foreach collection="selective" item="column" separator=",">
-          ${column.aliasedEscapedColumnName}
-        </foreach>
-      </when>
-      <otherwise>
-        <include refid="Base_Column_List" />
-      </otherwise>
-    </choose>
-    from litemall_user_formid
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-    <if test="example.orderByClause != null">
-      order by ${example.orderByClause}
-    </if>
-    limit 1
-  </select>
-  <update id="logicalDeleteByExample" parameterType="map">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
-    update litemall_user_formid set deleted = 1
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="logicalDeleteByPrimaryKey" parameterType="java.lang.Integer">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-    -->
-    update litemall_user_formid set deleted = 1
-    where id = #{id,jdbcType=INTEGER}
-  </update>
-</mapper>

+ 0 - 2
litemall-vue/src/api/api.js

@@ -371,8 +371,6 @@ export function feedbackAdd(data) {
 const FootprintList='wx/footprint/list'; //足迹列表
 const FootprintDelete='wx/footprint/delete'; //删除足迹
 
-const UserFormIdCreate='wx/formid/create'; //用户FromId,用于发送模版消息
-
 const GrouponList='wx/groupon/list'; //团购列表
 export function grouponList(query) {
   return request({

+ 0 - 16
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/service/WxOrderService.java

@@ -91,8 +91,6 @@ public class WxOrderService {
     @Autowired
     private NotifyService notifyService;
     @Autowired
-    private LitemallUserFormIdService formIdService;
-    @Autowired
     private LitemallGrouponRulesService grouponRulesService;
     @Autowired
     private LitemallGrouponService grouponService;
@@ -588,18 +586,6 @@ public class WxOrderService {
             orderRequest.setSpbillCreateIp(IpUtil.getIpAddr(request));
 
             result = wxPayService.createOrder(orderRequest);
-
-            //缓存prepayID用于后续模版通知
-            String prepayId = result.getPackageValue();
-            prepayId = prepayId.replace("prepay_id=", "");
-            LitemallUserFormid userFormid = new LitemallUserFormid();
-            userFormid.setOpenid(user.getWeixinOpenid());
-            userFormid.setFormid(prepayId);
-            userFormid.setIsprepay(true);
-            userFormid.setUseamount(3);
-            userFormid.setExpireTime(LocalDateTime.now().plusDays(7));
-            formIdService.addUserFormid(userFormid);
-
         } catch (Exception e) {
             e.printStackTrace();
             return ResponseUtil.fail(ORDER_PAY_FAIL, "订单不能支付");
@@ -778,8 +764,6 @@ public class WxOrderService {
                 order.getAddress()
         };
 
-        notifyService.notifyWxTemplate(result.getOpenid(), NotifyType.PAY_SUCCEED, parms, "pages/index/index?orderId=" + order.getId());
-
         // 取消订单超时未支付任务
         taskService.removeTask(new OrderUnpaidTask(order.getId()));
 

+ 0 - 49
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxUserFormId.java

@@ -1,49 +0,0 @@
-package org.linlinjava.litemall.wx.web;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.linlinjava.litemall.core.util.ResponseUtil;
-import org.linlinjava.litemall.db.domain.LitemallUser;
-import org.linlinjava.litemall.db.domain.LitemallUserFormid;
-import org.linlinjava.litemall.db.service.LitemallUserFormIdService;
-import org.linlinjava.litemall.db.service.LitemallUserService;
-import org.linlinjava.litemall.wx.annotation.LoginUser;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.validation.constraints.NotNull;
-import java.time.LocalDateTime;
-
-@RestController
-@RequestMapping("/wx/formid")
-@Validated
-public class WxUserFormId {
-    private final Log logger = LogFactory.getLog(WxUserFormId.class);
-
-    @Autowired
-    private LitemallUserService userService;
-
-    @Autowired
-    private LitemallUserFormIdService formIdService;
-
-    @GetMapping("create")
-    public Object create(@LoginUser Integer userId, @NotNull String formId) {
-        if (userId == null) {
-            return ResponseUtil.unlogin();
-        }
-
-        LitemallUser user = userService.findById(userId);
-        LitemallUserFormid userFormid = new LitemallUserFormid();
-        userFormid.setOpenid(user.getWeixinOpenid());
-        userFormid.setFormid(formId);
-        userFormid.setIsprepay(false);
-        userFormid.setUseamount(1);
-        userFormid.setExpireTime(LocalDateTime.now().plusDays(7));
-        formIdService.addUserFormid(userFormid);
-
-        return ResponseUtil.ok();
-    }
-}

+ 0 - 2
litemall-wx/config/api.js

@@ -81,8 +81,6 @@ module.exports = {
   FootprintList: WxApiRoot + 'footprint/list', //足迹列表
   FootprintDelete: WxApiRoot + 'footprint/delete', //删除足迹
 
-  UserFormIdCreate: WxApiRoot + 'formid/create', //用户FromId,用于发送模版消息
-
   GroupOnList: WxApiRoot + 'groupon/list', //团购列表
   GroupOnMy: WxApiRoot + 'groupon/my', //团购API-我的团购
   GroupOnDetail: WxApiRoot + 'groupon/detail', //团购API-详情

+ 0 - 2
renard-wx/config/api.js

@@ -64,8 +64,6 @@ module.exports = {
   FootprintList: WxApiRoot + 'footprint/list', //足迹列表
   FootprintDelete: WxApiRoot + 'footprint/delete', //删除足迹
 
-  UserFormIdCreate: WxApiRoot + 'formid/create', //用户FromId,用于发送模版消息
-
   GroupOnList: WxApiRoot + 'groupon/list', //团购列表
   GroupOnMy: WxApiRoot + 'groupon/my', //团购API-我的团购
   GroupOnDetail: WxApiRoot + 'groupon/detail', //团购API-详情

+ 0 - 8
renard-wx/pages/index/index.js

@@ -24,14 +24,6 @@ Page({
     }
   },
 
-  saveFormId: function(v) {
-    if (v.detail.formId != 'the formId is a mock one') {
-      util.request(api.UserFormIdCreate, {
-        formId: v.detail.formId
-      });
-    }
-  },
-
   onPullDownRefresh() {
     this.getIndexData();
     wx.stopPullDownRefresh() //停止下拉刷新

+ 2 - 2
renard-wx/pages/index/index.wxml

@@ -13,11 +13,11 @@
         <navigator url="/pages/goods/goods?id={{item.id}}">
           <swiper-item>
             <view class="swiper-box">
-              <form bindsubmit="saveFormId" report-submit='true' class='form_class'>
+              <view class='form_class'>
                 <button formType="submit" class='form_button'>
                   <image src="{{item.picUrl}}" mode="aspectFill" data-id="{{item.id}}" />
                 </button>
-              </form>
+              </view>
               <view class="swiper-box-info">
                 <view class="name">{{item.name}}</view>
                 <view class="price">