Browse Source

tt

release_toaliyun_real
xhxu 5 years ago
parent
commit
173abe17f6
2 changed files with 51 additions and 4 deletions
  1. +37
    -4
      mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java
  2. +14
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxMsgServiceImpl.java

+ 37
- 4
mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java View File

@@ -11,15 +11,13 @@ import com.iformall.common.IdWorker;
import com.iformall.common.ResultData;
import com.iformall.domain.po.*;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.po.msg.WxMsg;
import com.iformall.domain.vo.MerchantCreditRankingVo;
import com.iformall.domain.vo.WxCreditHistoryVo;
import com.iformall.enums.*;
import com.iformall.exception.MallinkException;
import com.iformall.mapper.*;
import com.iformall.service.ExcelService;
import com.iformall.service.WxCreditHistoryService;
import com.iformall.service.WxMallService;
import com.iformall.service.WxScoreRulesService;
import com.iformall.service.*;
import com.iformall.utils.CreditUtil;
import com.iformall.utils.RedisLock;
import com.iformall.utils.UserUtil;
@@ -91,6 +89,12 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService {
@Autowired
private WxMallService wxMallService;

@Autowired
private WxMsgService wxMsgService;

@Autowired
private WxTemplateMsgService wxTemplateMsgService;

@Override
public void clearCreditByYear() {
WxScoreRules wxScoreRules = new WxScoreRules();
@@ -308,6 +312,35 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService {
wxCUserBasicInfoMapper.updateById(wxCUserBasicInfoNew);
}

//发消息
try {
WxTemplateMsg temp = new WxTemplateMsg();
temp.updateTenantInfo(record);
temp.setType(EnumTemplateType.CREDIT_UPD_REMIND.getCode());
temp = wxTemplateMsgService.getByObj(temp);
if(temp.getId() != null){
WxMsg msg = new WxMsg();
msg.updateTenantInfo(record);
msg.setWay(EnumSendWay.APPINFOR.getCode());
msg.setIsright(EnumMsgSend.MSG_SEND_IMMEDIATELY.getCode());
msg.setPhones(wxCUserBasicInfo.getPhone());
msg.setModelId(temp.getId());
Map<String,String> map = new HashMap<>();
map.put("character_string1",record.getCreditNum().toString());
map.put("character_string2",record.getCreditAmount().toString());
map.put("time4",new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(record.getCreateDate()));
map.put("thing3",record.getChangePurpose());
map.put("goToPage","pages/index/index?type=jf");
msg.setMsg(JSONObject.toJSONString(map));
msg.setName(EnumTemplateType.CREDIT_UPD_REMIND.name());
msg.setSignature(EnumTemplateType.CREDIT_UPD_REMIND.name());
wxMsgService.add(msg);
}
} catch (Exception e) {
logger.error("积分消息发送异常");
}


} else {
//wxCreditHistoryMapper.updateById(record);
}


+ 14
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxMsgServiceImpl.java View File

@@ -366,6 +366,7 @@ public class WxMsgServiceImpl implements WxMsgService {
}
}

@Async
@Override
public void batchSendAppinfo(WxMsg wxMsg) {
TenantEntity tenantEntity = new TenantEntity();
@@ -418,6 +419,19 @@ public class WxMsgServiceImpl implements WxMsgService {
customParam.getString("thing4"),
customParam.getString("thing5")
));
}else if(wxTemplateMsg.getType() == EnumTemplateType.CREDIT_UPD_REMIND.getCode()){
/**
* 变更数量{{character_string1.DATA}}
* 积分余额{{character_string2.DATA}}
* 变动时间{{time4.DATA}}
* 变更原因{{thing3.DATA}}
*/
smartAppMsg.setDataList(Lists.newArrayList(
customParam.getString("character_string1"),
customParam.getString("character_string2"),
customParam.getString("time4"),
customParam.getString("thing3")
));
}else{
return;
}


Loading…
Cancel
Save