java110
2022-05-11 62b325883b98587ff7950d979ebd548d97a352f9
service-job/src/main/java/com/java110/job/adapt/applyRoomDiscount/MachineApplyRoomDiscountAdapt.java
old mode 100644 new mode 100755
@@ -24,7 +24,7 @@
import com.java110.utils.cache.MappingCache;
import com.java110.utils.util.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.java110.core.log.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
@@ -149,24 +149,27 @@
            staffAppAuthDto.setStaffId(userDto.getUserId());
            staffAppAuthDto.setAppType("WECHAT");
            List<StaffAppAuthDto> staffAppAuthDtos = staffAppAuthInnerServiceSMO.queryStaffAppAuths(staffAppAuthDto);
            String openId = staffAppAuthDtos.get(0).getOpenId();
            Data data = new Data();
            PropertyFeeTemplateMessage templateMessage = new PropertyFeeTemplateMessage();
            templateMessage.setTemplate_id(templateId);
            templateMessage.setTouser(openId);
            data.setFirst(new Content("空置房申请,验房信息如下:"));
            data.setKeyword1(new Content(paramIn.getString("ardId")));
            data.setKeyword2(new Content("空置房申请-验房"));
            data.setKeyword3(new Content(paramIn.getString("createUserName")));
            data.setKeyword4(new Content(paramIn.getString("createUserName") + "提交空置房申请,需进行现场验房"));
            data.setKeyword5(new Content(paramIn.getString("stateName")));
            data.setRemark(new Content("请及时处理!"));
            templateMessage.setData(data);
            String wechatUrl = MappingCache.getValue("OWNER_WECHAT_URL");
            templateMessage.setUrl(wechatUrl);
            logger.info("发送模板消息内容:{}", JSON.toJSONString(templateMessage));
            ResponseEntity<String> responseEntity = outRestTemplate.postForEntity(url, JSON.toJSONString(templateMessage), String.class);
            logger.info("微信模板返回内容:{}", responseEntity);
            if (staffAppAuthDtos != null && staffAppAuthDtos.size() > 0) {
                String openId = staffAppAuthDtos.get(0).getOpenId();
                Data data = new Data();
                PropertyFeeTemplateMessage templateMessage = new PropertyFeeTemplateMessage();
                templateMessage.setTemplate_id(templateId);
                templateMessage.setTouser(openId);
                data.setFirst(new Content("空置房申请,验房信息如下:"));
                data.setKeyword1(new Content(paramIn.getString("ardId")));
                data.setKeyword2(new Content("空置房申请-验房"));
                data.setKeyword3(new Content(paramIn.getString("createUserName")));
                data.setKeyword4(new Content(paramIn.getString("createUserName") + "提交空置房申请,需进行现场验房"));
                data.setKeyword5(new Content(paramIn.getString("stateName")));
                data.setRemark(new Content("请及时处理!"));
                templateMessage.setData(data);
                //获取员工公众号地址
                String wechatUrl = MappingCache.getValue("STAFF_WECHAT_URL");
                templateMessage.setUrl(wechatUrl);
                logger.info("发送模板消息内容:{}", JSON.toJSONString(templateMessage));
                ResponseEntity<String> responseEntity = outRestTemplate.postForEntity(url, JSON.toJSONString(templateMessage), String.class);
                logger.info("微信模板返回内容:{}", responseEntity);
            }
        }
    }
}