Просмотр исходного кода

[专题][修改][修改status判断逻辑]

release_toaliyun_real
luozukai 7 лет назад
Родитель
Сommit
7f5ccba78a
11 измененных файлов: 290 добавлений и 104 удалений
  1. +1
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/WxFlowAbleController.java
  2. +7
    -21
      mallinkSchedule/src/main/java/com/iformall/schedule/BillNotificationSchedule.java
  3. +1
    -1
      mallinkService/src/main/java/com/iformall/domain/po/WxTopic.java
  4. +1
    -1
      mallinkService/src/main/java/com/iformall/enums/EnumMailMsgModel.java
  5. +5
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxBillAllMapper.java
  6. +2
    -0
      mallinkService/src/main/java/com/iformall/service/WxBillAllService.java
  7. +1
    -1
      mallinkService/src/main/java/com/iformall/service/WxFlowService.java
  8. +75
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java
  9. +93
    -26
      mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java
  10. +97
    -51
      mallinkService/src/main/resources/mapper/WxBillAllMapper.xml
  11. +7
    -2
      mallinkService/src/main/resources/mapper/WxTopicMapper.xml

+ 1
- 1
mallinkAdmin/src/main/java/com/iformall/controller/WxFlowAbleController.java Просмотреть файл

@@ -131,7 +131,7 @@ public class WxFlowAbleController extends BaseController {
@PostMapping(value = "reject")
@SystemControllerLog(description = "工作流-驳回")
public ResultData reject(@RequestBody Map<String, Object> params) {
return wxFlowService.reject(params,super.getUser().getId(),super.getUser().getName(),super.getTenantId());
return wxFlowService.reject(params,super.getUser().getId(),super.getUser().getName(),super.getUser().getPhone(),super.getTenantId());
}




+ 7
- 21
mallinkSchedule/src/main/java/com/iformall/schedule/BillNotificationSchedule.java Просмотреть файл

@@ -5,8 +5,8 @@ import com.iformall.domain.po.*;
import com.iformall.enums.*;
import com.iformall.mapper.*;
import com.iformall.mq.MqBaseProducer;
import com.iformall.service.WxBillAllService;
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;
@@ -43,6 +43,8 @@ public class BillNotificationSchedule {
@Autowired
private MqBaseProducer mqBaseProducer;

@Autowired
WxBillAllService wxBillAllService;

/**
* 每天9点执行
@@ -51,6 +53,7 @@ public class BillNotificationSchedule {
public void sendMsgFromBill() {
logger.info("账单通知任务启动");
sendWaitPayBill();
wxBillAllService.sendWaitPayBillEmail();
sendOweBill();
logger.info("账单通知任务结束");
}
@@ -91,8 +94,6 @@ 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);
@@ -124,25 +125,10 @@ 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 = "<div style=\"margin: 0 5%;width:90%;box-sizing: content-box; border: 1px solid #DEDEDE;background: #FFFFFF;\"><div style=\"overflow: hidden;height: auto;width: 100%;\">";
billListStr += "<div style=\"width: 33.3%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\">"+billType+"</div>";
billListStr += "<div style=\"width: 33.3%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\">"+price+"</div>";
billListStr += "<div style=\"width: 33.3%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\">"+receiveDate+"</div>";
billListStr += "</div></div>";
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());
}
}

}




}

+ 1
- 1
mallinkService/src/main/java/com/iformall/domain/po/WxTopic.java Просмотреть файл

@@ -38,7 +38,7 @@ public class WxTopic implements Serializable {
@io.swagger.annotations.ApiModelProperty(value="结束时间",name="endTime")
private Date endTime;
/*状态1投放2作废**/
@io.swagger.annotations.ApiModelProperty(value="状态",name="status")
@io.swagger.annotations.ApiModelProperty(value="状态1生效2失效3作废",name="status")
private Integer status;
@io.swagger.annotations.ApiModelProperty(value="创建时间",name="createtime")
private Date createtime;


+ 1
- 1
mallinkService/src/main/java/com/iformall/enums/EnumMailMsgModel.java Просмотреть файл

@@ -6,7 +6,7 @@ package com.iformall.enums;
*/
public enum EnumMailMsgModel {
MAIL_PASS_NODIFY(345, "审批通过通知"),
MAIL_BILL_WAIT_PAY(345, "代缴账单通知"),
MAIL_BILL_WAIT_PAY(346, "代缴账单通知"),
MAIL_APPLY_NODIFY(347, "审批通知"),
MAIL_BILL_OWE(348, "欠缴账单通知"),
MAIL_ASSIGNEE_NODIFY(349, "代办通知"),


+ 5
- 0
mallinkService/src/main/java/com/iformall/mapper/WxBillAllMapper.java Просмотреть файл

@@ -23,4 +23,9 @@ public interface WxBillAllMapper {

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

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

+ 2
- 0
mallinkService/src/main/java/com/iformall/service/WxBillAllService.java Просмотреть файл

@@ -26,4 +26,6 @@ public interface WxBillAllService {
Object getBillInfo(WxBillAll wxBillAll);

Long hasOweBill(Long contractId,Integer type);

void sendWaitPayBillEmail();
}

+ 1
- 1
mallinkService/src/main/java/com/iformall/service/WxFlowService.java Просмотреть файл

@@ -58,7 +58,7 @@ public interface WxFlowService {
* @param params
* @return
*/
ResultData reject(@RequestBody Map<String, Object> params,Long userId,String userName,String tenantId);
ResultData reject(@RequestBody Map<String, Object> params,Long userId,String userName,String userPhone,String tenantId);

/**
* 撤回


+ 75
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java Просмотреть файл

@@ -9,10 +9,14 @@ import com.iformall.domain.vo.WxBillAll;
import com.iformall.enums.*;
import com.iformall.exception.MallinkException;
import com.iformall.mapper.*;
import com.iformall.mq.MqBaseProducer;
import com.iformall.service.*;
import com.iformall.utils.Constant;
import com.iformall.utils.DateUtils;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
@@ -20,12 +24,14 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.stream.Collectors;

@@ -81,6 +87,9 @@ public class WxBillAllServiceImpl implements WxBillAllService {
@Autowired
WxBillOtherDepositMapper wxBillOtherDepositMapper;

@Autowired
MqBaseProducer mqBaseProducer;

@Override
public Map<String, Object> listAsPage(WxBillAll record, Integer pageIndex, Integer pageSize) {
//更新各账单状态
@@ -531,4 +540,70 @@ public class WxBillAllServiceImpl implements WxBillAllService {
}
return 0l;
}

public Map<Long, List<Map<String, Object>>> toMap(List<Map<String, Object>> mapList){
Map<Long, List<Map<String, Object>>> result = new HashMap<>();
for (Map<String, Object> bill:mapList) {
Long merchantId = (Long)bill.get("merchantId");
List<Map<String, Object>> currList = result.get(merchantId);
if(currList == null) currList = new ArrayList<>();
currList.add(bill);
result.put(merchantId,currList);
}
return result;
}

@Override
public void sendWaitPayBillEmail() {
List<Map<String, Object>> waitBillListForEmail = wxBillAllMapper.getWaitPayBillForEmail();

if(CollectionUtils.isNotEmpty(waitBillListForEmail)) {
Map<Long, List<Map<String, Object>>> merchantMap = toMap(waitBillListForEmail);
for (Long merchantId : merchantMap.keySet()) {
List<Map<String, Object>> mapList = merchantMap.get(merchantId);
if(CollectionUtils.isNotEmpty(mapList)){
String email = (String)mapList.get(0).get("email");
if(StringUtils.isBlank(email)){
continue;
}
String tenantId = (String)mapList.get(0).get("tenantId");
String receiveDate = (String)mapList.get(0).get("receiveDate");
String manager = (String)mapList.get(0).get("manager");
String managerPhone = (String)mapList.get(0).get("managerPhone");

String billListStr = "";
BigDecimal sumNeedPay = new BigDecimal(0);
for (Map<String, Object> bill : mapList) {
String billType = bill.get("billType").toString();
BigDecimal needPay = (BigDecimal) bill.get("needPay");
BigDecimal price = needPay.divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN);

sumNeedPay = sumNeedPay.add(price);
billListStr += "<div style=\"margin: 0 5%;width:90%;box-sizing: content-box; border: 1px solid #DEDEDE;background: #FFFFFF;\"><div style=\"overflow: hidden;height: auto;width: 100%;\">";
billListStr += "<div style=\"width: 33.3%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\">" + billType + "</div>";
billListStr += "<div style=\"width: 33.3%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\">" + price + "</div>";
billListStr += "<div style=\"width: 33.3%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\">" + receiveDate + "</div>";
billListStr += "</div></div>";
}
//发邮件
Map<String, String> map = new HashedMap();
map.put("price", sumNeedPay.toString());
map.put("date", receiveDate);
map.put("billList", billListStr);
map.put("linkName",manager==null?"":manager);
map.put("linkPhone",managerPhone==null?"":managerPhone);
MailMsg mailMsg = new MailMsg();
mailMsg.setSubject("代缴账单通知");
mailMsg.setHtml(true);
mailMsg.setMsgType(EnumMsgRecordType.EMAIL.getCode());
mailMsg.setModelId(EnumMailMsgModel.MAIL_BILL_WAIT_PAY.getCode());
mailMsg.setTo(new String[]{email});
mailMsg.setTenantId(tenantId);
mailMsg.setDynamicContentMap(map);
mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
}
}

}
}
}

+ 93
- 26
mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java Просмотреть файл

@@ -33,6 +33,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.*;

/**
@@ -238,21 +239,60 @@ public class WxFlowServiceImpl implements WxFlowService {
// 给审批人发送代办通知短信
List<MallUserInfo> mallUserInfoList = getUserByProcessInstanceId(processInstance.getId());
for (MallUserInfo mallUserInfo:mallUserInfoList) {
Map<String,String> content = new HashedMap();
content.put("userName",starterInfo.getName());
content.put("page", Constant.adminPage);

WxMsgRecord wxMsgRecord = new WxMsgRecord();
wxMsgRecord.setMsgType(EnumMsgRecordType.SMS.getCode());
wxMsgRecord.setModelType(EnumMsgModel.FLOW_ASSIGNEE_NODIFY.getCode());
wxMsgRecord.setReceiver(mallUserInfo.getPhone());
wxMsgRecord.setTenantId(tenantId);
wxMsgRecord.setDynamicContentMap(content);
mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode());
sendAssigneeMsgAndEmail(tenantId,mallUserInfo.getPhone(),mallUserInfo.getEmail(),starterInfo.getName(),businessId);
}
return new ResultData();
}

public void sendAssigneeMsgAndEmail(String tenantId,String phone,String email,String userName,Long businessId){
Map<String,String> dynamicContentMap = new HashMap<>();
dynamicContentMap.put("userName",userName);
dynamicContentMap.put("page", Constant.adminPage);
WxMsgRecord wxMsgRecord = new WxMsgRecord();
wxMsgRecord.setMsgType(EnumMsgRecordType.SMS.getCode());
wxMsgRecord.setModelType(EnumMsgModel.FLOW_ASSIGNEE_NODIFY.getCode());
wxMsgRecord.setReceiver(phone);
wxMsgRecord.setTenantId(tenantId);
wxMsgRecord.setDynamicContentMap(dynamicContentMap);
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()));
ResultData resultData = getTaskStatusList(businessId, tenantId);
List<WxFlowRecord> flowRecordList = (List<WxFlowRecord>) resultData.data;
String taskListHtml = "";
for (WxFlowRecord record : flowRecordList) {
if (record.getStatus().equals(EnumFlowRecordStatus.NEW.getCode())) {
msgReplaceMap.put("starter", record.getUserName());
msgReplaceMap.put("starterRemark", record.getRemark() == null ? "" : record.getRemark());
} else if (record.getStatus().equals(EnumFlowRecordStatus.ASSIGNEE.getCode())) {
taskListHtml += "<div style=\"overflow: hidden;\"><div style=\"overflow: hidden;\"><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><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><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() + "</div></div>";
} else {
taskListHtml += "<div style=\"overflow: hidden;\"><div style=\"overflow: hidden;\"><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><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><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() + "</div></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);
}
}

public String variablesToJson(List<Map<String,Object>> variables){
HashMap<String,Object> map = new HashMap<>();
for (Map<String,Object> mapInfo:variables) {
@@ -458,12 +498,13 @@ public class WxFlowServiceImpl implements WxFlowService {
*/
public boolean isEndAndSendMsg(Map<String,Object> mapInfo,String taskKey,String processInstanceId,String tenantId,String userName){
// 发送短信
Map<String,String> msgReplaceMap = new HashedMap();
Map<String,String> msgReplaceMap;
WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode();
wxMsgValidationcode.setTenantId(tenantId);
Map<String,Object> userMap = (Map<String,Object>)mapInfo.get("starter");
List<Map<String,String>> taskAssigneeList = (List)mapInfo.get("taskAssignee");
Long businessId = Long.parseLong(mapInfo.get("businessId").toString());
String email = (String)userMap.get("email");

// 判断下个节点是否有设置审批人,没有,直接通过,有,发短信通知
if(!isEnded(processInstanceId)){
@@ -472,16 +513,7 @@ public class WxFlowServiceImpl implements WxFlowService {
String assignee = "";
List<MallUserInfo> mallUserInfoList = getUserByProcessInstanceId(processInstanceId);
for (MallUserInfo mallUserInfo:mallUserInfoList) {
msgReplaceMap.put("userName",userName);
msgReplaceMap.put("page",Constant.adminPage);

WxMsgRecord wxMsgRecord = new WxMsgRecord();
wxMsgRecord.setMsgType(EnumMsgRecordType.SMS.getCode());
wxMsgRecord.setModelType(EnumMsgModel.FLOW_ASSIGNEE_NODIFY.getCode());
wxMsgRecord.setReceiver(mallUserInfo.getPhone());
wxMsgRecord.setTenantId(tenantId);
wxMsgRecord.setDynamicContentMap(msgReplaceMap);
mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode());
sendAssigneeMsgAndEmail(tenantId,mallUserInfo.getPhone(),mallUserInfo.getEmail(),userName,businessId);
}

// 给发起人发送短信
@@ -498,6 +530,22 @@ public class WxFlowServiceImpl implements WxFlowService {
wxMsgRecord.setTenantId(tenantId);
wxMsgRecord.setDynamicContentMap(msgReplaceMap);
mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode());

//发邮件
if(StringUtils.isNotBlank(email)){
msgReplaceMap = new HashedMap();
msgReplaceMap.put("contract", businessId + "");
msgReplaceMap.put("page", Constant.adminPage);
MailMsg mailMsg = new MailMsg();
mailMsg.setSubject("审批通知");
mailMsg.setHtml(true);
mailMsg.setMsgType(EnumMsgRecordType.EMAIL.getCode());
mailMsg.setModelId(EnumMailMsgModel.MAIL_APPLY_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());
}
return false;
}else{
//继续递归判断
@@ -520,7 +568,6 @@ public class WxFlowServiceImpl implements WxFlowService {
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());
@@ -561,7 +608,7 @@ public class WxFlowServiceImpl implements WxFlowService {

@Override
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class})
public ResultData reject(Map<String, Object> params,Long userId,String userName,String tenantId) {
public ResultData reject(Map<String, Object> params,Long userId,String userName,String userPhone,String tenantId) {
String processInstanceId = (String)params.get("processInstanceId");
String remark = (String)params.get("remark");

@@ -570,6 +617,7 @@ public class WxFlowServiceImpl implements WxFlowService {
Long businessId = Long.parseLong(mapInfo.get("businessId").toString());
Integer flowType = (Integer)mapInfo.get("flowType");
Map<String,Object> userMap = (Map<String,Object>)mapInfo.get("starter");
String email = (String) userMap.get("email");

String taskName;
String taskKey;
@@ -601,13 +649,12 @@ public class WxFlowServiceImpl implements WxFlowService {
//修改记录表当前状态
wxFlowRecordMapper.updateCurrStatus(new WxFlowRecord(processInstanceId,EnumRentContractAppStatus.REJECT.getCode()));

// 给发起人发送驳回消息
//给发起人发送驳回消息
Map<String,String> msgReplaceMap = new HashedMap();
WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode();
wxMsgValidationcode.setTenantId(tenantId);
msgReplaceMap.put("contract",businessId+"");
msgReplaceMap.put("page",Constant.adminPage);

WxMsgRecord wxMsgRecord = new WxMsgRecord();
wxMsgRecord.setMsgType(EnumMsgRecordType.SMS.getCode());
wxMsgRecord.setModelType(EnumMsgModel.FLOW_REJECT_NODIFY.getCode());
@@ -615,6 +662,26 @@ public class WxFlowServiceImpl implements WxFlowService {
wxMsgRecord.setTenantId(tenantId);
wxMsgRecord.setDynamicContentMap(msgReplaceMap);
mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode());

//发送邮件
if(StringUtils.isNotBlank(email)) {
msgReplaceMap = new HashedMap();
msgReplaceMap.put("contract", businessId + "");
msgReplaceMap.put("page", Constant.adminPage);
msgReplaceMap.put("name",userName);
msgReplaceMap.put("remark",remark);
msgReplaceMap.put("linkName",userName);
msgReplaceMap.put("linkPhone",userPhone);
MailMsg mailMsg = new MailMsg();
mailMsg.setSubject("驳回通知");
mailMsg.setHtml(true);
mailMsg.setMsgType(EnumMsgRecordType.EMAIL.getCode());
mailMsg.setModelId(EnumMailMsgModel.MAIL_REJECT_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());
}
return new ResultData();
}



+ 97
- 51
mallinkService/src/main/resources/mapper/WxBillAllMapper.xml Просмотреть файл

@@ -1,7 +1,7 @@
<?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="com.iformall.mapper.WxBillAllMapper">
<select id="list" parameterType="com.iformall.domain.vo.WxBillAll" resultType="hashmap">
select bill.id,bill.merchant_id merchantId,bill.shop_id shopId,bill.bill_type_value billTypeValue,bill.bill_type billType,bill.need_pay needPay,
bill.receive_pay receivePay,bill.pay,bill.owe,bill.receive_date receiveDate,bill.pay_date payDate,bill.expired_day expiredDay,bill.status,
@@ -53,14 +53,14 @@
<if test=" null != billTypeValue ">and bill.bill_type_value = #{billTypeValue}</if>
<if test=" null != status ">and bill.`status` = #{status}</if>
<if test=" null != rentShopType ">and bill.rent_shop_type = #{rentShopType}</if>
order by bill.id desc,bill.merchant_id,bill.status,bill.receive_date desc
</select>
<select id="queryOweInfo" parameterType="com.iformall.domain.vo.WxBillAll" resultType="hashmap">

select count(bill.id) owncount,IFNULL(sum(bill.owe),0) owe from (
select id,merchant_id,shop_id,tenant_id,1 bill_type_value,'租金'
@@ -103,9 +103,9 @@
and bill.rent_shop_type = #{rentShopType}
</if>
</select>
<select id="queryPaidInfo" parameterType="com.iformall.domain.vo.WxBillAll" resultType="hashmap">
select count(bill.id) paycount,IFNULL(sum(bill.pay),0) pay from (
select id,merchant_id,shop_id,tenant_id,1 bill_type_value,'租金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_rent where is_preview = 0
@@ -147,8 +147,8 @@
and bill.rent_shop_type = #{rentShopType}
</if>
</select>
<select id="listData" resultType="hashmap" parameterType="com.iformall.domain.vo.WxBillAll">
select bill.id,bill.merchant_id merchantId,bill.shop_id shopId,bill.bill_type_value billTypeValue,bill.bill_type billType,bill.need_pay needPay,
bill.receive_pay receivePay,bill.pay,bill.owe,bill.receive_date receiveDate,bill.pay_date payDate,bill.expired_day expiredDay,bill.status,
@@ -209,12 +209,12 @@
#{status}
</foreach>
</if>
<if test=" null != typeList ">
and bill.`bill_type_value` in
<foreach collection="typeList" index="index" item="type" open="(" separator="," close=")">
#{type}
</foreach>
</foreach>
</if>
<if test="null!=starttime and null!=endtime">
and DATE_FORMAT(bill.receive_date,'%Y-%m') between #{starttime} and #{endtime}
@@ -230,52 +230,98 @@
</if>
order by bill.merchant_id,bill.status,bill.receive_date desc
</select>
<select id="getWaitPayBill" resultType="hashmap">

select bill.tenant_id tenantId,bill.merchant_id merchantId,bill.receive_date receiveDate,
bill.need_pay needPay,m.link_phone linkPhone,app.appname,m.email,bill.bill_type billType from (
select bill.bill_type,bill.tenant_id,bill.merchant_id,bill.receive_date,ifnull(sum(need_pay),0) need_pay 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.need_pay needPay,m.link_phone linkPhone,app.appname from (
select bill.tenant_id,bill.merchant_id,bill.receive_date,ifnull(sum(need_pay),0) need_pay 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())=3 and bill.status not in(3,5,6)
group by bill.tenant_id,bill.merchant_id,bill.receive_date) 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>

<select id="getWaitPayBillForEmail" resultType="hashmap">
select bill.tenant_id tenantId,bill.merchant_id merchantId,bill.receive_date receiveDate,
bill.need_pay needPay,m.link_phone linkPhone,app.appname,m.email,bill.bill_type billType,ws.manager,ws.manager_phone managerPhone from (
select bill.bill_type,bill.tenant_id,bill.merchant_id,bill.receive_date,ifnull(sum(need_pay),0) need_pay 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
group by bill.tenant_id,bill.merchant_id,bill.receive_date,bill.bill_type
) 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
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
left join wx_merchant_shop wms on wms.merchant_id = m.id
left join wx_shop ws on wms.shop_id = ws.id
where m.status=1
</select>

<select id="getOweBill" resultType="hashmap">
select bill.tenant_id tenantId,bill.merchant_id merchantId,bill.owe,m.link_phone linkPhone,app.appname from (
select bill.tenant_id,bill.merchant_id,sum(owe) owe from (


+ 7
- 2
mallinkService/src/main/resources/mapper/WxTopicMapper.xml Просмотреть файл

@@ -16,7 +16,12 @@
<result column="updatetime" property="updatetime" />

</resultMap>

<sql id="allColumns">
`id`,`tenant_id`,`name`,`title`,content,cover,advert,begin_time,end_time,createtime,updatetime,
if(now() > end_time,2,status) as status
</sql>

<sql id="dynamicWhereConditions">
where 1 = 1
<if test=" null != id ">
@@ -43,7 +48,7 @@
</sql>
<select id="findList" parameterType="com.iformall.domain.po.WxTopic" resultMap="BaseResultMap">
select * from wx_topic
select <include refid="allColumns" /> from wx_topic
<include refid="dynamicWhereConditions" />
</select>



Загрузка…
Отмена
Сохранить