diff --git a/mallinkAdmin/src/main/resources/db/migration/V201903300958__CHANGE_USER_LEN.sql b/mallinkAdmin/src/main/resources/db/migration/V201903300958__CHANGE_USER_LEN.sql
index e41e6f51d..a6969316b 100644
--- a/mallinkAdmin/src/main/resources/db/migration/V201903300958__CHANGE_USER_LEN.sql
+++ b/mallinkAdmin/src/main/resources/db/migration/V201903300958__CHANGE_USER_LEN.sql
@@ -4,7 +4,7 @@ ADD COLUMN `mp_open_id` VARCHAR(28) NULL AFTER `open_app_id`,
ADD COLUMN `mp_app_id` VARCHAR(18) NULL AFTER `mp_open_id`,
ADD COLUMN `mp_subscribe` TINYINT(2) NULL AFTER `mp_app_id`,
ADD COLUMN `mp_subscribe_time` datetime NULL AFTER `mp_subscribe`,
-ADD COLUMN `mp_subscribe_scene` VARCHAR(20) NULL AFTER `mp_subscribe_time`,
+NULL DEFAULT NULL COMMENT '经度' ;ADD COLUMN `mp_subscribe_scene` VARCHAR(20) NULL AFTER `mp_subscribe_time`,
ADD COLUMN `subs_open_id` VARCHAR(28) NULL AFTER `mp_subscribe_scene`,
ADD COLUMN `subs_app_id` VARCHAR(18) NULL AFTER `subs_open_id`,
ADD COLUMN `subs_subscribe` TINYINT(2) NULL AFTER `subs_app_id`,
@@ -16,4 +16,4 @@ CHANGE COLUMN `phone` `phone` VARCHAR(20) NULL DEFAULT NULL COMMENT '用户绑
CHANGE COLUMN `register_ip` `register_ip` VARCHAR(20) NULL DEFAULT NULL COMMENT '用户注册IP' ,
CHANGE COLUMN `app_id` `app_id` VARCHAR(20) NULL DEFAULT NULL COMMENT '小程序的appId' ,
CHANGE COLUMN `latitude` `latitude` DECIMAL(10,5) NULL DEFAULT NULL COMMENT '维度' ,
-CHANGE COLUMN `longitude` `longitude` DECIMAL(10,5) NULL DEFAULT NULL COMMENT '经度' ;
\ No newline at end of file
+CHANGE COLUMN `longitude` `longitude` DECIMAL(10,5)
\ No newline at end of file
diff --git a/mallinkAdmin/src/main/resources/db/migration/V201904011435__ADD_FLOW.sql b/mallinkAdmin/src/main/resources/db/migration/V201904011435__ADD_FLOW.sql
index 27037b466..edd1c8e3d 100644
--- a/mallinkAdmin/src/main/resources/db/migration/V201904011435__ADD_FLOW.sql
+++ b/mallinkAdmin/src/main/resources/db/migration/V201904011435__ADD_FLOW.sql
@@ -9,3 +9,14 @@ ADD COLUMN `apply_status` SMALLINT(1) DEFAULT 1 COMMENT '审核状态0未审核1
ALTER TABLE `wx_bill_other`
ADD COLUMN `apply_status` SMALLINT(1) DEFAULT 1 COMMENT '审核状态0未审核1审核中2审核完成3驳回4合同作废5撤回';
+
+alter table wx_msg_model modify column content text;
+
+ALTER TABLE `wx_shop`
+ADD COLUMN `email` varchar(100) DEFAULT NULL COMMENT '邮箱';
+
+ALTER TABLE `mall_user_info`
+ADD COLUMN `email` varchar(100) DEFAULT NULL COMMENT '邮箱';
+
+ALTER TABLE `wx_merchant`
+ADD COLUMN `email` varchar(100) DEFAULT NULL COMMENT '邮箱';
diff --git a/mallinkSchedule/src/main/java/com/iformall/schedule/BillNotificationSchedule.java b/mallinkSchedule/src/main/java/com/iformall/schedule/BillNotificationSchedule.java
index 77359957e..6d9fd75fd 100644
--- a/mallinkSchedule/src/main/java/com/iformall/schedule/BillNotificationSchedule.java
+++ b/mallinkSchedule/src/main/java/com/iformall/schedule/BillNotificationSchedule.java
@@ -6,6 +6,7 @@ import com.iformall.enums.*;
import com.iformall.mapper.*;
import com.iformall.mq.MqBaseProducer;
import org.apache.commons.collections.map.HashedMap;
+import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -90,6 +91,8 @@ public class BillNotificationSchedule {
BigDecimal price = needPay.divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN);
String phone = bill.get("linkPhone").toString();
String appname = bill.get("appname").toString();
+ String email = bill.get("email").toString();
+ String billType = bill.get("billType").toString();
logger.info("待缴账单检验短信配置信息");
// WxMsgConfig wxMsgConfig = checkMsgConfig(tenantId);
@@ -121,6 +124,23 @@ public class BillNotificationSchedule {
map.put("date",receiveDate);
wxMsgRecord.setDynamicContentMap(map);
mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode());
+
+ //发邮件
+ if(StringUtils.isNotBlank(email)) {
+ String billListStr = "
";
+ billListStr += "
"+billType+"
";
+ billListStr += "
"+price+"
";
+ billListStr += "
"+receiveDate+"
";
+ billListStr += "
";
+ map.put("billList",billListStr);
+ MailMsg mailMsg = new MailMsg();
+ mailMsg.setMsgType(EnumMsgRecordType.EMAIL.getCode());
+ mailMsg.setModelId(EnumMailMsgModel.MAIL_BILL_WAIT_PAY.getCode());
+ mailMsg.setReceiver(email);
+ mailMsg.setTenantId(tenantId);
+ mailMsg.setDynamicContentMap(map);
+ mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
+ }
}
}
diff --git a/mallinkService/src/main/java/com/iformall/domain/po/MallUserInfo.java b/mallinkService/src/main/java/com/iformall/domain/po/MallUserInfo.java
index 33ab0c92e..0c3b8a212 100644
--- a/mallinkService/src/main/java/com/iformall/domain/po/MallUserInfo.java
+++ b/mallinkService/src/main/java/com/iformall/domain/po/MallUserInfo.java
@@ -108,6 +108,17 @@ public class MallUserInfo implements Serializable {
@io.swagger.annotations.ApiModelProperty(value="1合同审批 2账单审批",name="flowPermission")
private String flowPermission;
+ @io.swagger.annotations.ApiModelProperty(value = "邮箱", name = "email")
+ private String email;
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
public String getFlowPermission() {
return flowPermission;
}
diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java b/mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java
index 247d16b01..e3d318cb7 100644
--- a/mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java
+++ b/mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java
@@ -143,6 +143,17 @@ public class WxMerchant implements Serializable {
@io.swagger.annotations.ApiModelProperty(value = "是否显示在C端", name = "isPublic")
private Integer isPublic;
+ @io.swagger.annotations.ApiModelProperty(value = "邮件", name = "email")
+ private String email;
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
public List getLevelConfigList() {
return levelConfigList;
}
diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxShop.java b/mallinkService/src/main/java/com/iformall/domain/po/WxShop.java
index 83dfa4812..ad768f539 100644
--- a/mallinkService/src/main/java/com/iformall/domain/po/WxShop.java
+++ b/mallinkService/src/main/java/com/iformall/domain/po/WxShop.java
@@ -11,7 +11,7 @@ import java.util.List;
@Table(name = "wx_shop")
public class WxShop implements Serializable {
private static final long serialVersionUID = 1L;
-
+
@Id
protected Long id;
@@ -113,6 +113,17 @@ public class WxShop implements Serializable {
@io.swagger.annotations.ApiModelProperty(value = "备注", name = "comments")
private String comments;
+ @io.swagger.annotations.ApiModelProperty(value = "邮箱", name = "email")
+ private String email;
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
public String getTenantId() {
return tenantId;
}
diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumMailMsgModel.java b/mallinkService/src/main/java/com/iformall/enums/EnumMailMsgModel.java
new file mode 100644
index 000000000..c615ebf56
--- /dev/null
+++ b/mallinkService/src/main/java/com/iformall/enums/EnumMailMsgModel.java
@@ -0,0 +1,40 @@
+package com.iformall.enums;
+
+/**
+ * Created by luozukai
+ * 短信模板
+ */
+public enum EnumMailMsgModel {
+ MAIL_PASS_NODIFY(345, "审批通过通知"),
+ MAIL_BILL_WAIT_PAY(345, "代缴账单通知"),
+ MAIL_APPLY_NODIFY(347, "审批通知"),
+ MAIL_BILL_OWE(348, "欠缴账单通知"),
+ MAIL_ASSIGNEE_NODIFY(349, "代办通知"),
+ MAIL_REJECT_NODIFY(350, "驳回通知"),
+ ;
+
+ public static EnumMailMsgModel getEnum(Integer code) {
+ for (EnumMailMsgModel value : values()) {
+ if (value.getCode().equals(code)) {
+ return value;
+ }
+ }
+ return null;
+ }
+
+ private Integer code;
+ private String message;
+
+ EnumMailMsgModel(Integer code, String message) {
+ this.code = code;
+ this.message = message;
+ }
+
+ public Integer getCode() {
+ return code;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+}
diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java
index 27ad4e78f..0709a0ae6 100644
--- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java
+++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java
@@ -518,6 +518,18 @@ public class WxFlowServiceImpl implements WxFlowService {
wxMsgRecord.setTenantId(tenantId);
wxMsgRecord.setDynamicContentMap(msgReplaceMap);
mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode());
+
+ //发邮件
+ String email = (String)userMap.get("email");
+ if(StringUtils.isNotBlank(email)) {
+ MailMsg mailMsg = new MailMsg();
+ mailMsg.setMsgType(EnumMsgRecordType.EMAIL.getCode());
+ mailMsg.setModelId(EnumMailMsgModel.MAIL_PASS_NODIFY.getCode());
+ mailMsg.setReceiver(email);
+ mailMsg.setTenantId(tenantId);
+ mailMsg.setDynamicContentMap(msgReplaceMap);
+ mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
+ }
return true;
}
}
diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxTopicServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxTopicServiceImpl.java
index bf5705e8d..60dbd4b3f 100644
--- a/mallinkService/src/main/java/com/iformall/service/impl/WxTopicServiceImpl.java
+++ b/mallinkService/src/main/java/com/iformall/service/impl/WxTopicServiceImpl.java
@@ -15,7 +15,6 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import com.iformall.common.ResultData;
import org.springframework.stereotype.Service;
-
import java.util.Date;
/**
@@ -85,6 +84,8 @@ public class WxTopicServiceImpl implements WxTopicService {
couponTopic.setBusId(couponArray[1]);
couponTopic.setTenantId(record.getTenantId());
couponTopic.setTopicId(record.getId());
+ final IdWorker idWorker = IdWorker.get();
+ couponTopic.setId(idWorker.nextId());
wxCouponTopicMapper.insertSelective(couponTopic);
}
}
diff --git a/mallinkService/src/main/resources/mapper/MallUserInfoMapper.xml b/mallinkService/src/main/resources/mapper/MallUserInfoMapper.xml
index bf30fd4b9..ca6dfbbbb 100644
--- a/mallinkService/src/main/resources/mapper/MallUserInfoMapper.xml
+++ b/mallinkService/src/main/resources/mapper/MallUserInfoMapper.xml
@@ -16,15 +16,16 @@
+
- `id`,`tenant_id`,`username`,`name`,`password`,`create_time`,`last_login_time`,`status`,`is_admin`,`nick_name`,`phone`,`flow_permission`,`web_open_id`
+ `id`,`tenant_id`,`username`,`name`,`password`,`create_time`,`last_login_time`,`status`,`is_admin`,`nick_name`,`phone`,`flow_permission`,`web_open_id`,email
`id`,`tenant_id`,`username`,`name`,`password`,`create_time`,`last_login_time`,`status`,`is_admin`,`nick_name`,`phone`,`flow_permission`,
- `bopen_id`,`web_open_id`
+ `bopen_id`,`web_open_id`,email
@@ -80,6 +81,10 @@
and JSON_CONTAINS(flow_permission->'$[*]', #{flowPermission}, '$')
+
+ and `email` = #{email}
+
+
and id in
@@ -220,6 +225,7 @@
+
@@ -229,13 +235,13 @@
u.`id`,u.`tenant_id`,u.`username`,u.`name`,u.`password`,u.`create_time`,u.`last_login_time`,u.`status`,u.`is_admin`,u.`nick_name`,u.`phone`,u.`flow_permission`,
- m.`name` as mall_name, m.`group` as mall_group, m.`img_url`, m.`img_url_h`
+ m.`name` as mall_name, m.`group` as mall_group, m.`img_url`, m.`img_url_h`,email
u.`id`,u.`tenant_id`,u.`username`,u.`name`,u.`password`,u.`create_time`,u.`last_login_time`,u.`status`,u.`is_admin`,u.`nick_name`,u.`phone`,u.`flow_permission`,
u.`bopen_id`,u.`web_open_id`,
- m.`name` as mall_name, m.`group` as mall_group, m.`img_url`, m.`img_url_h`
+ m.`name` as mall_name, m.`group` as mall_group, m.`img_url`, m.`img_url_h`,email
diff --git a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml
index 094b1129d..1819fd6d8 100644
--- a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml
@@ -233,47 +233,46 @@
diff --git a/mallinkService/src/main/resources/mapper/WxMerchantMapper.xml b/mallinkService/src/main/resources/mapper/WxMerchantMapper.xml
index a7e9c6949..f149ad453 100644
--- a/mallinkService/src/main/resources/mapper/WxMerchantMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxMerchantMapper.xml
@@ -18,12 +18,13 @@
+
`id`,`tenant_id`,`img_url`,`name`,`link_phone`,`create_date`,`update_date`,`car_vendor_type`,`car_params`,`status`,`link_person`,
- `business_id`,`shop_type`,`brand`,`type`,`is_public`
+ `business_id`,`shop_type`,`brand`,`type`,`is_public`,email
@@ -80,6 +81,9 @@
and `is_public` = #{isPublic}
+
+ and `email` = #{email}
+
and id in
@@ -100,7 +104,7 @@
m.id,
m.img_url,m.name,m.link_phone,m.status,m.business_id,
s.addr,s.shop_number,s.baidu_poi,
- mb.building_name,mf.floor_name,m.is_public
+ mb.building_name,mf.floor_name,m.is_public,m.email
@@ -116,7 +120,7 @@
-
+
diff --git a/mallinkService/src/main/resources/mapper/WxShopMapper.xml b/mallinkService/src/main/resources/mapper/WxShopMapper.xml
index ab7ebc0f2..f8ab09396 100644
--- a/mallinkService/src/main/resources/mapper/WxShopMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxShopMapper.xml
@@ -24,13 +24,13 @@
-
+
`id`,`tenant_id`,`shop_number`,`build_area`,`operation_area`,`building`,
`floor`,`status`,`x`,`y`,`addr`,`baidu_poi`,`longitude`,`latitude`,`create_date`,
- `update_date`,`img_url`,`manager`,`manager_phone`,`type`,`point_type`,`comments`
+ `update_date`,`img_url`,`manager`,`manager_phone`,`type`,`point_type`,`comments`,email
@@ -129,7 +129,9 @@
and `point_type` = #{pointType}
-
+
+ and `email` = #{email}
+
and id in
@@ -152,7 +154,7 @@
s.img_url imgUrl,s.operation_area operationArea,
s.status,b.building_name building,f.floor_name floor,m.`name` merchantName,m.id merchantId,
m.link_person linkPerson,m.link_phone linkPhone,s.manager,s.manager_phone managerPhone,
- s.type,s.point_type pointType,s.addr
+ s.type,s.point_type pointType,s.addr,s.email
from wx_shop s left join wx_merchant_shop ms on ms.shop_id=s.id and ms.is_del=0
left join wx_merchant m on ms.merchant_id=m.id
left join wx_mall_building b on s.building=b.id
@@ -251,6 +253,9 @@
and s.`point_type` = #{pointType}
+
+ and s.`email`= #{email}
+
and s.id in
@@ -266,7 +271,7 @@
s.img_url imgUrl,s.operation_area operationArea,
s.status,b.building_name building,f.floor_name floor,m.`name` merchantName,m.id merchantId,
m.link_person linkPerson,m.link_phone linkPhone,s.manager,s.manager_phone managerPhone,
- s.type,s.point_type pointType,s.addr,
+ s.type,s.point_type pointType,s.addr,s.email,
brand.name brand,m.link_person,m.link_phone,bus.title
from wx_shop s left join wx_merchant_shop ms on ms.shop_id=s.id and ms.is_del=0
left join wx_merchant m on ms.merchant_id=m.id
@@ -364,7 +369,9 @@
and s.`type` = #{type}
-
+
+ and s.`email` = #{email}
+
and s.`point_type` = #{pointType}
@@ -388,7 +395,7 @@