renkang
2025-01-24 d3767d594de66cb5f9d1294931acefea1866f783
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/SmsEmailServiceImpl.java
@@ -584,21 +584,22 @@
    @Override
    public Integer sendBillSms(String content,String mobile,Integer billId) {
        boolean result = true;
        if(StringUtils.isBlank(mobile)){
            throw  new BusinessException(ResponseStatus.BAD_REQUEST);
            result = false;
        }
        boolean result=   emayService.sendSingleSms(mobile,content);
        if(!result){
            throw  new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,短信发送失败,请稍后重试!");
        if(result){
            result = emayService.sendSingleSms(mobile,content);
        }
        SmsEmail smsEmail = new SmsEmail();
        smsEmail.setIsdeleted(Constants.ZERO);
        smsEmail.setCreateDate(new Date());
        smsEmail.setStatus(Constants.ZERO);
        smsEmail.setStatus(result?Constants.ZERO:Constants.ONE);
        smsEmail.setType(Constants.ZERO);
        smsEmail.setRemark(result?"短信发送成功":"短信发送失败");
        smsEmail.setTitle("账单催费");
        smsEmail.setObjId(billId);
        smsEmail.setObjType(Constants.ZERO+"");
        smsEmail.setObjType(Constants.ONE+"");
        smsEmail.setContent(content);
        smsEmailMapper.insert(smsEmail);
        return smsEmail.getId();
@@ -609,21 +610,21 @@
    @Override
    public Integer sendEmail(String email,String content,Integer billId) {
        boolean result = true;
        if(StringUtils.isBlank(email)){
            throw  new BusinessException(ResponseStatus.BAD_REQUEST);
            result = false;
        }
        boolean result=   emailService.sendEmail(email,"账单催费",content,null);
        if(result){
            result=   emailService.sendEmail(email,"账单催费",content,null);
        }
        SmsEmail smsEmail = new SmsEmail();
        smsEmail.setRemark("邮件发生成功");
        if(!result){
            smsEmail.setRemark("邮件发生失败");
        }
        smsEmail.setRemark(result?"邮件发送成功":"邮件发送失败");
        smsEmail.setIsdeleted(Constants.ZERO);
        smsEmail.setCreateDate(new Date());
        smsEmail.setStatus(Constants.ONE);
        smsEmail.setStatus(result?Constants.ZERO:Constants.ONE);
        smsEmail.setType(Constants.TWO);
        smsEmail.setObjId(billId);
        smsEmail.setObjType(Constants.ONE+"");
        smsEmail.setObjType(Constants.TWO+"");
        smsEmail.setContent(content);
        smsEmailMapper.insert(smsEmail);
        return smsEmail.getId();