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

[审批][修改][修改消息发送]

release_toaliyun_real
luozukai 7 лет назад
Родитель
Сommit
c61f870295
1 измененных файлов: 40 добавлений и 56 удалений
  1. +40
    -56
      mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java

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

@@ -295,14 +295,9 @@ public class WxFlowServiceImpl implements WxFlowService {
wxMsgRecord.setModelType(EnumMsgModel.FLOW_ASSIGNEE_NODIFY.getCode());
wxMsgRecord.setReceiver(phone);
wxMsgRecord.setTenantId(tenantId);
if(EnumFlowKey.CONTRACT.getCode().equals(flowType) || EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_SHOP_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_SHOP_END_CONTRACT.getCode().equals(flowType)
){
if(isContract(flowType)){
dynamicContentMap.put("bustype","合同");
}else if(EnumFlowKey.BILL.getCode().equals(flowType)){
}else if(isBill(flowType)){
dynamicContentMap.put("bustype","账单");
dynamicContentMap.put("contract", businessId.toString());
}
@@ -376,21 +371,36 @@ public class WxFlowServiceImpl implements WxFlowService {
mailMsg.setModelId(EnumMsgModelId.MAIL_MSG_FLOW.getCode());
mailMsg.setTo(new String[]{email});
mailMsg.setTenantId(tenantId);
if(EnumFlowKey.CONTRACT.getCode().equals(flowType) || EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_SHOP_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_SHOP_END_CONTRACT.getCode().equals(flowType)
){
if(isContract(flowType)){
dynamicContentMap.put("bustype","合同");
}else if(EnumFlowKey.BILL.getCode().equals(flowType)){
}else if(isBill(flowType)){
dynamicContentMap.put("bustype","账单");
dynamicContentMap.put("contract", businessId.toString());
}
mailMsg.setDynamicContentMap(msgReplaceMap);
mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
}
}

public boolean isContract(Integer flowType){
if(EnumFlowKey.CONTRACT.getCode().equals(flowType)
||EnumFlowKey.END_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_SHOP_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_SHOP_END_CONTRACT.getCode().equals(flowType)
){
return true;
}
return false;
}

public boolean isBill(Integer flowType){
if(EnumFlowKey.BILL.getCode().equals(flowType)
||EnumFlowKey.NEW_BILL_CHANGE.getCode().equals(flowType)){
return true;
}
return false;
}

public String variablesToJson(List<Map<String,Object>> variables){
@@ -526,6 +536,7 @@ public class WxFlowServiceImpl implements WxFlowService {
WxFlowRecord wxFlowRecord = new WxFlowRecord();
wxFlowRecord.setUserName(userName.trim());
wxFlowRecord.setStatus(EnumFlowRecordStatus.ASSIGNEE.getCode());
wxFlowRecord.setTaskKey(task.getTaskDefinitionKey());
resultList.add(0,wxFlowRecord);

//不是最后一个节点,设置下一个待审批节点代办人
@@ -545,6 +556,7 @@ public class WxFlowServiceImpl implements WxFlowService {
wxFlowRecord = new WxFlowRecord();
wxFlowRecord.setUserName(userName.trim());
wxFlowRecord.setStatus(EnumFlowRecordStatus.ASSIGNEE.getCode());
wxFlowRecord.setTaskKey(UUID.randomUUID().toString());
resultList.add(0,wxFlowRecord);
break;
}
@@ -576,6 +588,7 @@ public class WxFlowServiceImpl implements WxFlowService {
WxFlowRecord wxFlowRecord = new WxFlowRecord();
wxFlowRecord.setUserName(userName.trim());
wxFlowRecord.setStatus(EnumFlowRecordStatus.ASSIGNEE.getCode());
wxFlowRecord.setTaskKey(assignee.getKey());
resultList.add(0,wxFlowRecord);

//不是最后一个节点,设置下一个待审批节点代办人
@@ -597,6 +610,7 @@ public class WxFlowServiceImpl implements WxFlowService {
wxFlowRecord = new WxFlowRecord();
wxFlowRecord.setUserName(userName.trim());
wxFlowRecord.setStatus(EnumFlowRecordStatus.ASSIGNEE.getCode());
wxFlowRecord.setTaskKey(UUID.randomUUID().toString());
resultList.add(0,wxFlowRecord);
break;
}
@@ -737,14 +751,9 @@ public class WxFlowServiceImpl implements WxFlowService {
wxMsgRecord.setModelType(EnumMsgModel.FLOW_APPLY_NODIFY.getCode());
wxMsgRecord.setReceiver(userMap!=null?(String)userMap.get("phone"):"");
wxMsgRecord.setTenantId(tenantId);
if(EnumFlowKey.CONTRACT.getCode().equals(flowType) || EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_SHOP_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_SHOP_END_CONTRACT.getCode().equals(flowType)
){
if(isContract(flowType)){
msgReplaceMap.put("bustype","合同");
}else if(EnumFlowKey.BILL.getCode().equals(flowType)){
}else if(isBill(flowType)){
msgReplaceMap.put("bustype","账单");
msgReplaceMap.put("contract", businessId.toString());
}
@@ -761,14 +770,9 @@ public class WxFlowServiceImpl implements WxFlowService {
mailMsg.setModelId(EnumMsgModelId.MAIL_MSG_FLOW.getCode());
mailMsg.setTo(new String[]{email});
mailMsg.setTenantId(tenantId);
if(EnumFlowKey.CONTRACT.getCode().equals(flowType) || EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_SHOP_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_SHOP_END_CONTRACT.getCode().equals(flowType)
){
if(isContract(flowType)){
msgReplaceMap.put("bustype","合同");
}else if(EnumFlowKey.BILL.getCode().equals(flowType)){
}else if(isBill(flowType)){
msgReplaceMap.put("bustype","账单");
msgReplaceMap.put("contract", businessId.toString());
}
@@ -795,14 +799,9 @@ public class WxFlowServiceImpl implements WxFlowService {
wxMsgRecord.setModelType(EnumMsgModel.FLOW_PASS_NODIFY.getCode());
wxMsgRecord.setReceiver(userMap!=null?(String)userMap.get("phone"):"");
wxMsgRecord.setTenantId(tenantId);
if(EnumFlowKey.CONTRACT.getCode().equals(flowType) || EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_SHOP_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_SHOP_END_CONTRACT.getCode().equals(flowType)
){
if(isContract(flowType)){
msgReplaceMap.put("bustype","合同");
}else if(EnumFlowKey.BILL.getCode().equals(flowType)){
}else if(isBill(flowType)){
msgReplaceMap.put("bustype","账单");
msgReplaceMap.put("contract", businessId.toString());
}
@@ -819,14 +818,9 @@ public class WxFlowServiceImpl implements WxFlowService {
mailMsg.setModelId(EnumMsgModelId.MAIL_MSG_FLOW.getCode());
mailMsg.setTo(new String[]{email});
mailMsg.setTenantId(tenantId);
if(EnumFlowKey.CONTRACT.getCode().equals(flowType) || EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_SHOP_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_SHOP_END_CONTRACT.getCode().equals(flowType)
){
if(isContract(flowType)){
msgReplaceMap.put("bustype","合同");
}else if(EnumFlowKey.BILL.getCode().equals(flowType)){
}else if(isBill(flowType)){
msgReplaceMap.put("bustype","账单");
msgReplaceMap.put("contract", businessId.toString());
}
@@ -940,14 +934,9 @@ public class WxFlowServiceImpl implements WxFlowService {
wxMsgRecord.setModelType(EnumMsgModel.FLOW_REJECT_NODIFY.getCode());
wxMsgRecord.setReceiver(userMap!=null?(String)userMap.get("phone"):"");
wxMsgRecord.setTenantId(tenantId);
if(EnumFlowKey.CONTRACT.getCode().equals(flowType) || EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_SHOP_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_SHOP_END_CONTRACT.getCode().equals(flowType)
){
if(isContract(flowType)){
msgReplaceMap.put("bustype","合同");
}else if(EnumFlowKey.BILL.getCode().equals(flowType)){
}else if(isBill(flowType)){
msgReplaceMap.put("bustype","账单");
msgReplaceMap.put("contract", businessId.toString());
}
@@ -971,14 +960,9 @@ public class WxFlowServiceImpl implements WxFlowService {
mailMsg.setModelId(EnumMsgModelId.MAIL_MSG_FLOW.getCode());
mailMsg.setTo(new String[]{email});
mailMsg.setTenantId(tenantId);
if(EnumFlowKey.CONTRACT.getCode().equals(flowType) || EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_SHOP_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_SHOP_END_CONTRACT.getCode().equals(flowType)
){
if(isContract(flowType)){
msgReplaceMap.put("bustype","合同");
}else if(EnumFlowKey.BILL.getCode().equals(flowType)){
}else if(isBill(flowType)){
msgReplaceMap.put("bustype","账单");
msgReplaceMap.put("contract", businessId.toString());
}


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