绑定仪器成功发送消息

master
382696293@qq.com 2 years ago
parent 450c5f2d5a
commit b9d11f1798

@ -11,6 +11,7 @@ import com.flossom.common.security.utils.SecurityUtils;
import com.flossom.miniProgram.service.IWxInstrumentService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -61,6 +62,12 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
@Autowired
private WxUserMemberMapper wxUserMemberMapper;
@Autowired
private WxScriptMessageMapper wxScriptMessageMapper;
@Autowired
private WxUserScriptLogMapper wxUserScriptLogMapper;
@Override
public List<WxInstrument> bindingInstrumentList() {
return wxInstrumentMapper.selectBindingInstrumentListByUserId(SecurityUtils.getLoginUser().getWxUserMember().getId());
@ -216,6 +223,24 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
updateDevicesNum.setDevicesNum(wxUserMember.getDevicesNum() + 1);
wxUserMemberMapper.updateWxUserMember(updateDevicesNum);
// 绑定成功发送消息
WxScriptMessage wxScriptMessage = wxScriptMessageMapper.selectOneByMessageType(MessageTypeEnum.BINDING_INSTRUMENTS.getCode());
if (wxScriptMessage != null) {
WxUserScriptLog wxUserScriptLog = new WxUserScriptLog();
BeanUtils.copyProperties(wxScriptMessage, wxUserScriptLog);
wxUserScriptLog.setId(null);
wxUserScriptLog.setWxUserId(wxUserMember.getId());
wxUserScriptLog.setMessageType(WxUserIntegralMessageTypeEnum.BINDING_INSTRUMENTS.getCode());
wxUserScriptLog.setIsCustom(0);
wxUserScriptLog.setTitile(wxScriptMessage.getMessageTitle());
wxUserScriptLog.setContent(wxScriptMessage.getMessageContent());
wxUserScriptLog.setCreateTime(DateUtils.getNowDate());
wxUserScriptLog.setCreateBy(null);
wxUserScriptLog.setUpdateTime(null);
wxUserScriptLog.setUpdateBy(null);
wxUserScriptLogMapper.insertWxUserScriptLog(wxUserScriptLog);
}
/**
* TODO:
*/

Loading…
Cancel
Save