Browse Source

[消息组件][添加][添加账单邮件通知]

release_toaliyun_real
luozukai 7 years ago
parent
commit
acf48f5c73
10 changed files with 174 additions and 79 deletions
  1. +7
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/HomeController.java
  2. +1
    -0
      mallinkSchedule/src/main/java/com/iformall/schedule/BillNotificationSchedule.java
  3. +9
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxTopic.java
  4. +6
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxBillAllMapper.java
  5. +8
    -1
      mallinkService/src/main/java/com/iformall/service/WxBillAllService.java
  6. +5
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java
  7. +78
    -72
      mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java
  8. +12
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxTopicServiceImpl.java
  9. +43
    -1
      mallinkService/src/main/resources/mapper/WxBillAllMapper.xml
  10. +5
    -5
      mallinkService/src/main/resources/mapper/WxTopicMapper.xml

+ 7
- 0
mallinkAdmin/src/main/java/com/iformall/controller/HomeController.java View File

@@ -71,8 +71,15 @@ public class HomeController extends BaseController {
@Autowired
private MallUserActionService mallUserActionService;

@Autowired
private WxBillAllService wxBillAllService;

@GetMapping("/captcha.jpg")
public void captcha(HttpServletResponse response)throws ServletException, IOException {
// //todo 测试
// wxBillAllService.getOweBillForEmail();


logger.debug("[" + getIpAddr() + "] HomeController::captcha");
response.setHeader("Cache-Control", "no-store, no-cache");
response.setContentType("image/jpeg");


+ 1
- 0
mallinkSchedule/src/main/java/com/iformall/schedule/BillNotificationSchedule.java View File

@@ -55,6 +55,7 @@ public class BillNotificationSchedule {
sendWaitPayBill();
wxBillAllService.sendWaitPayBillEmail();
sendOweBill();
wxBillAllService.getOweBillForEmail();
logger.info("账单通知任务结束");
}



+ 9
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxTopic.java View File

@@ -59,7 +59,16 @@ public class WxTopic implements Serializable {
//状态,一个或者多个
@Transient
private String statusStr;
@Transient
protected List<Integer> statusList;

public List<Integer> getStatusList() {
return statusList;
}

public void setStatusList(List<Integer> statusList) {
this.statusList = statusList;
}

public String getBgColor() {
return bgColor;


+ 6
- 0
mallinkService/src/main/java/com/iformall/mapper/WxBillAllMapper.java View File

@@ -24,6 +24,12 @@ public interface WxBillAllMapper {

List<Map<String, Object>> getOweBill();

/**
* +group by账单类型
* @return
*/
List<Map<String, Object>> getOweBillForEmail();

/**
* +group by账单类型
* @return


+ 8
- 1
mallinkService/src/main/java/com/iformall/service/WxBillAllService.java View File

@@ -2,7 +2,6 @@ package com.iformall.service;

import com.iformall.common.ResultData;
import com.iformall.domain.vo.WxBillAll;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@@ -27,5 +26,13 @@ public interface WxBillAllService {

Long hasOweBill(Long contractId,Integer type);

/**
* 发送代缴通知邮件
*/
void sendWaitPayBillEmail();

/**
* 发送欠缴通知邮件
*/
void getOweBillForEmail();
}

+ 5
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java View File

@@ -643,4 +643,9 @@ public class WxBillAllServiceImpl implements WxBillAllService {

}
}

@Override
public void getOweBillForEmail() {
wxBillAllMapper.getOweBillForEmail();
}
}

+ 78
- 72
mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java View File

@@ -1,5 +1,8 @@
package com.iformall.service.impl;

import java.lang.reflect.Field;
import java.text.SimpleDateFormat;
import java.util.*;
import com.alibaba.druid.support.json.JSONUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@@ -182,13 +185,20 @@ public class WxFlowServiceImpl implements WxFlowService {
}

public Map<String,Object> mallUserInfoToMap(MallUserInfo userInfo){
Map<String,Object> map = new HashedMap();
if(userInfo != null){
map.put("name",userInfo.getName());
map.put("id",userInfo.getId());
map.put("phone",userInfo.getPhone());
try {
Map<String, Object> map = new HashMap<>();
Class<?> clazz = userInfo.getClass();
for (Field field : clazz.getDeclaredFields()) {
field.setAccessible(true);
String fieldName = field.getName();
Object value = field.get(userInfo);
map.put(fieldName, value);
}
return map;
}catch (IllegalAccessException e){
logger.error("mallUserInfoToMap error",e);
}
return map;
return new HashMap<>();
}

@Override
@@ -257,73 +267,69 @@ public class WxFlowServiceImpl implements WxFlowService {
mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode());

//发邮件
if(StringUtils.isNotBlank(email)){
Map msgReplaceMap = new HashedMap();
msgReplaceMap.put("page", Constant.adminPage);
msgReplaceMap.put("applyTime", new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(new Date()));
msgReplaceMap.put("name",userName);
msgReplaceMap.put("linkName",userName);
msgReplaceMap.put("linkPhone",phone);
ResultData resultData = getTaskStatusList(businessId, tenantId);
List<WxFlowRecord> flowRecordList = (List<WxFlowRecord>) resultData.data;
String taskListHtml = "";
for (int i = flowRecordList.size() -1; i>=0; i--) {
WxFlowRecord record = flowRecordList.get(i);
if (record.getStatus().equals(EnumFlowRecordStatus.NEW.getCode())) {
taskListHtml += "<div style=\"overflow: hidden;\">";
taskListHtml += "<div style=\"overflow: hidden;\">";
taskListHtml += "<div style=\"float: left; width: 40px;height: 30px;\"><img src=\"https://s3.cn-northwest-1.amazonaws.com.cn/iformall-net/cimg/emailduihao.png\" style=\"display: block; width: 20px;height: 20px;margin-top: 10px;\"></div>";
taskListHtml += "<div style=\"float: left; width: auto;margin-right:10px;height: 30px;line-height: 18px;font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(51,51,51,1);margin-top: 11px;\">发起申请</div>";
taskListHtml += "<div style=\"float: left; width: auto;margin-right:10px;height: 30px;margin-top:15px;line-height: 14px;font-size:14px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(51,51,51,1);\">"+record.getUserName()+"</div>";
taskListHtml += "</div>";
if(i == flowRecordList.size() - 1){
taskListHtml += "<div style=\"width: 80%; overflow: hidden;font-size:14px;font-family:MicrosoftYaHei;font-weight:400;padding-left: 30px;margin-left: 10px;padding-bottom: 20px; line-height: 24px; color:rgba(153,153,153,1);\">"+record.getRemark() == null ? "" : record.getRemark()+"</div>";
}else{
taskListHtml += "<div style=\"width: 80%; overflow: hidden;font-size:14px;font-family:MicrosoftYaHei;font-weight:400;padding-left: 30px;margin-left: 10px;padding-bottom: 20px; line-height: 24px; border-left: 2px dashed #DEDEDE; color:rgba(153,153,153,1);\">"+record.getRemark() == null ? "" : record.getRemark()+"</div>";
}
taskListHtml += "</div>";
} else if (record.getStatus().equals(EnumFlowRecordStatus.ASSIGNEE.getCode())) {
taskListHtml += "<div style=\"overflow: hidden;\">";
taskListHtml += "<div style=\"overflow: hidden;\">";
taskListHtml += "<div style=\"float: left; width: 40px;height: 30px;\"><img src=\"https://s3.cn-northwest-1.amazonaws.com.cn/iformall-net/cimg/emailhong.png\" style=\"display: block; width: 20px;height: 20px;margin-top: 10px;\"></div>";
taskListHtml += "<div style=\"float: left; width: auto;margin-right:10px;height: 30px;line-height: 18px;font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(200,89,98,1);margin-top: 11px;\">待审批</div>";
taskListHtml += "<div style=\"float: left; width: auto;margin-right:10px;height: 30px;margin-top:15px;line-height: 14px;font-size:14px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(200,89,98,1);\">"+record.getUserName()+"</div>";
taskListHtml += "</div>";
if(i == flowRecordList.size() - 1){
taskListHtml += "<div style=\"width: 80%; overflow: hidden;font-size:14px;font-family:MicrosoftYaHei;font-weight:400;padding-left: 30px;margin-left: 10px;padding-bottom: 20px; line-height: 24px; color:rgba(153,153,153,1);\">"+record.getRemark() == null ? "" : record.getRemark()+"</div>";
}else{
taskListHtml += "<div style=\"width: 80%; overflow: hidden;font-size:14px;font-family:MicrosoftYaHei;font-weight:400;padding-left: 30px;margin-left: 10px;padding-bottom: 20px; line-height: 24px; border-left: 2px dashed #DEDEDE; color:rgba(153,153,153,1);\">"+record.getRemark() == null ? "" : record.getRemark()+"</div>";
}
taskListHtml += "</div>";
} else {
taskListHtml += "<div style=\"overflow: hidden;\">";
taskListHtml += "<div style=\"overflow: hidden;\">";
taskListHtml += "<div style=\"float: left; width: 40px;height: 30px;\"><img src=\"https://s3.cn-northwest-1.amazonaws.com.cn/iformall-net/cimg/emailhui.png\" style=\"display: block; width: 20px;height: 20px;margin-top: 10px;\"></div>";
taskListHtml += "<div style=\"float: left; width: auto;margin-right:10px;height: 30px;line-height: 18px;font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-top: 11px;\">同意并呈送</div>";
taskListHtml += "<div style=\"float: left; width: auto;margin-right:10px;height: 30px;margin-top:15px;line-height: 14px;font-size:14px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);\">"+record.getUserName()+"</div>";
taskListHtml += "</div>";
if(i == flowRecordList.size() - 1){
taskListHtml += "<div style=\"width: 80%; overflow: hidden;font-size:14px;font-family:MicrosoftYaHei;font-weight:400;padding-left: 30px;margin-left: 10px;padding-bottom: 20px; line-height: 24px; color:rgba(153,153,153,1);\">"+record.getRemark() == null ? "" : record.getRemark()+"</div>";
}else{
taskListHtml += "<div style=\"width: 80%; overflow: hidden;font-size:14px;font-family:MicrosoftYaHei;font-weight:400;padding-left: 30px;margin-left: 10px;padding-bottom: 20px; line-height: 24px; border-left: 2px dashed #DEDEDE; color:rgba(153,153,153,1);\">"+record.getRemark() == null ? "" : record.getRemark()+"</div>";
}

taskListHtml += "</div>";
Map msgReplaceMap = new HashedMap();
msgReplaceMap.put("page", Constant.adminPage);
msgReplaceMap.put("applyTime", new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(new Date()));
msgReplaceMap.put("name",userName);
msgReplaceMap.put("linkName",userName);
msgReplaceMap.put("linkPhone",phone);
ResultData resultData = getTaskStatusList(businessId, tenantId);
List<WxFlowRecord> flowRecordList = (List<WxFlowRecord>) resultData.data;
String taskListHtml = "";
for (int i = flowRecordList.size() -1; i>=0; i--) {
WxFlowRecord record = flowRecordList.get(i);
String remark = record.getRemark()==null?"":record.getRemark();
if (record.getStatus().equals(EnumFlowRecordStatus.NEW.getCode())) {
taskListHtml += "<div style=\"overflow: hidden;\">";
taskListHtml += "<div style=\"overflow: hidden;\">";
taskListHtml += "<div style=\"float: left; width: 40px;height: 30px;\"><img src=\"https://s3.cn-northwest-1.amazonaws.com.cn/iformall-net/cimg/emailduihao.png\" style=\"display: block; width: 20px;height: 20px;margin-top: 10px;\"></div>";
taskListHtml += "<div style=\"float: left; width: auto;margin-right:10px;height: 30px;line-height: 18px;font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(51,51,51,1);margin-top: 11px;\">发起申请</div>";
taskListHtml += "<div style=\"float: left; width: auto;margin-right:10px;height: 30px;margin-top:15px;line-height: 14px;font-size:14px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(51,51,51,1);\">"+record.getUserName()+"</div>";
taskListHtml += "</div>";
if(i == 0){
taskListHtml += "<div style=\"width: 80%; overflow: hidden;font-size:14px;font-family:MicrosoftYaHei;font-weight:400;padding-left: 30px;margin-left: 10px;padding-bottom: 20px; line-height: 24px; color:rgba(153,153,153,1);\">"+remark+"</div>";
}else{
taskListHtml += "<div style=\"width: 80%; overflow: hidden;font-size:14px;font-family:MicrosoftYaHei;font-weight:400;padding-left: 30px;margin-left: 10px;padding-bottom: 20px; line-height: 24px; border-left: 2px dashed #DEDEDE; color:rgba(153,153,153,1);\">"+remark+"</div>";
}
taskListHtml += "</div>";
} else if (record.getStatus().equals(EnumFlowRecordStatus.ASSIGNEE.getCode())) {
taskListHtml += "<div style=\"overflow: hidden;\">";
taskListHtml += "<div style=\"overflow: hidden;\">";
taskListHtml += "<div style=\"float: left; width: 40px;height: 30px;\"><img src=\"https://s3.cn-northwest-1.amazonaws.com.cn/iformall-net/cimg/emailhong.png\" style=\"display: block; width: 20px;height: 20px;margin-top: 10px;\"></div>";
taskListHtml += "<div style=\"float: left; width: auto;margin-right:10px;height: 30px;line-height: 18px;font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(200,89,98,1);margin-top: 11px;\">待审批</div>";
taskListHtml += "<div style=\"float: left; width: auto;margin-right:10px;height: 30px;margin-top:15px;line-height: 14px;font-size:14px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(200,89,98,1);\">"+record.getUserName()+"</div>";
taskListHtml += "</div>";
if(i == 0){
taskListHtml += "<div style=\"width: 80%; overflow: hidden;font-size:14px;font-family:MicrosoftYaHei;font-weight:400;padding-left: 30px;margin-left: 10px;padding-bottom: 20px; line-height: 24px; color:rgba(153,153,153,1);\">"+remark+"</div>";
}else{
taskListHtml += "<div style=\"width: 80%; overflow: hidden;font-size:14px;font-family:MicrosoftYaHei;font-weight:400;padding-left: 30px;margin-left: 10px;padding-bottom: 20px; line-height: 24px; border-left: 2px dashed #DEDEDE; color:rgba(153,153,153,1);\">"+remark+"</div>";
}
taskListHtml += "</div>";
} else {
taskListHtml += "<div style=\"overflow: hidden;\">";
taskListHtml += "<div style=\"overflow: hidden;\">";
taskListHtml += "<div style=\"float: left; width: 40px;height: 30px;\"><img src=\"https://s3.cn-northwest-1.amazonaws.com.cn/iformall-net/cimg/emailhui.png\" style=\"display: block; width: 20px;height: 20px;margin-top: 10px;\"></div>";
taskListHtml += "<div style=\"float: left; width: auto;margin-right:10px;height: 30px;line-height: 18px;font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-top: 11px;\">同意并呈送</div>";
taskListHtml += "<div style=\"float: left; width: auto;margin-right:10px;height: 30px;margin-top:15px;line-height: 14px;font-size:14px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);\">"+record.getUserName()+"</div>";
taskListHtml += "</div>";
if(i == 0){
taskListHtml += "<div style=\"width: 80%; overflow: hidden;font-size:14px;font-family:MicrosoftYaHei;font-weight:400;padding-left: 30px;margin-left: 10px;padding-bottom: 20px; line-height: 24px; color:rgba(153,153,153,1);\">"+remark+"</div>";
}else{
taskListHtml += "<div style=\"width: 80%; overflow: hidden;font-size:14px;font-family:MicrosoftYaHei;font-weight:400;padding-left: 30px;margin-left: 10px;padding-bottom: 20px; line-height: 24px; border-left: 2px dashed #DEDEDE; color:rgba(153,153,153,1);\">"+remark+"</div>";
}
taskListHtml += "</div>";
}
msgReplaceMap.put("taskList", taskListHtml);
MailMsg mailMsg = new MailMsg();
mailMsg.setSubject("代办通知");
mailMsg.setHtml(true);
mailMsg.setMsgType(EnumMsgRecordType.EMAIL.getCode());
mailMsg.setModelId(EnumMailMsgModel.MAIL_ASSIGNEE_NODIFY.getCode());
mailMsg.setTo(new String[]{email});
mailMsg.setTenantId(tenantId);
mailMsg.setDynamicContentMap(msgReplaceMap);
mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
}else{
logger.info("邮件地址为空,不发邮件,phone:{},userName:{}",phone,userName);
}
msgReplaceMap.put("taskList", taskListHtml);
MailMsg mailMsg = new MailMsg();
mailMsg.setSubject("代办通知");
mailMsg.setHtml(true);
mailMsg.setMsgType(EnumMsgRecordType.EMAIL.getCode());
mailMsg.setModelId(EnumMailMsgModel.MAIL_ASSIGNEE_NODIFY.getCode());
mailMsg.setTo(new String[]{email});
mailMsg.setTenantId(tenantId);
mailMsg.setDynamicContentMap(msgReplaceMap);
mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
}

public String variablesToJson(List<Map<String,Object>> variables){
@@ -702,9 +708,9 @@ public class WxFlowServiceImpl implements WxFlowService {
msgReplaceMap.put("contract", businessId + "");
msgReplaceMap.put("page", Constant.adminPage);
msgReplaceMap.put("name",userName);
msgReplaceMap.put("remark",remark);
msgReplaceMap.put("remark",remark==null?"":remark);
msgReplaceMap.put("linkName",userName);
msgReplaceMap.put("linkPhone",userPhone);
msgReplaceMap.put("linkPhone",userPhone==null?"":userPhone);
MailMsg mailMsg = new MailMsg();
mailMsg.setSubject("驳回通知");
mailMsg.setHtml(true);


+ 12
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxTopicServiceImpl.java View File

@@ -16,7 +16,11 @@ 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.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
* @author luozukai ^_^
@@ -33,6 +37,14 @@ public class WxTopicServiceImpl implements WxTopicService {

@Override
public PageInfo<WxTopic> listAsPage(WxTopic record, Integer pageIndex, Integer pageSize) {
if(StringUtils.isNotBlank(record.getStatusStr())){
String[] array = record.getStatusStr().split(",");
List<Integer> integerList = new ArrayList<>();
for (String status:array) {
integerList.add(Integer.parseInt(status));
}
record.setStatusList(integerList);
}
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxTopicMapper.findList(record));
}



+ 43
- 1
mallinkService/src/main/resources/mapper/WxBillAllMapper.xml View File

@@ -388,8 +388,8 @@
select id,merchant_id,shop_id,tenant_id,name,8 bill_type_value,'其他押金' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_other_deposit

) bill
where DATEDIFF(bill.receive_date,now())=3 and bill.status not in(3,5,6)
group by bill.tenant_id,bill.merchant_id,bill.receive_date,bill.bill_type
) bill
left join wx_merchant m on bill.merchant_id=m.id
@@ -398,4 +398,46 @@
left join wx_shop ws on wms.shop_id = ws.id
where m.status=1
</select>

<select id="getOweBillForEmail" resultType="hashmap">
select bill.tenant_id tenantId,bill.merchant_id merchantId,bill.bill_type,bill.owe,m.link_phone linkPhone,m.email,app.appname from (
select bill.tenant_id,bill.merchant_id,bill.bill_type,sum(owe) owe from (
select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_rent where is_preview = 0
union
select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_rent_deposit
union
select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_property where is_preview = 0
union
select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_property_deposit
union
select id,merchant_id,shop_id,tenant_id,'水费' name,5 bill_type_value,'水费' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_daily where type=1
union
select id,merchant_id,shop_id,tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_daily where type=2
union
select id,merchant_id,shop_id,tenant_id,name,7 bill_type_value,'其他' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_other
union
select id,merchant_id,shop_id,tenant_id,name,8 bill_type_value,'其他押金' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_other_deposit
) bill
where DATEDIFF(bill.receive_date,now()) &lt;0 and bill.status not in(3,5,6)
group by bill.tenant_id,bill.merchant_id,bill.bill_type) bill
left join wx_merchant m on bill.merchant_id=m.id
left join (select tenant_id,`name` appname from wx_appinfo app where type=1) app on bill.tenant_id=app.tenant_id
where m.status=1
</select>
</mapper>

+ 5
- 5
mallinkService/src/main/resources/mapper/WxTopicMapper.xml View File

@@ -33,17 +33,17 @@
<if test=" null != status ">
and `status` = #{status}
</if>
<if test=" null != status ">
and `status` = #{status}
</if>
<if test=" null != beginTime ">
and `begin_time` >= #{beginTime}
</if>
<if test=" null != endTime ">
and `end_time` &lt;= #{endTime}
</if>
<if test=" null != statusStr and '' != statusStr">
and `status` in (#{statusStr})
<if test=" null != statusList ">
and status in
<foreach collection="statusList" index="index" item="statusItem" open="(" separator="," close=")">
#{statusItem}
</foreach>
</if>

order by createtime desc


Loading…
Cancel
Save