java110
2022-05-11 62b325883b98587ff7950d979ebd548d97a352f9
service-job/src/main/java/com/java110/job/adapt/applyRoomDiscount/MachineAdoptApplyRoomDiscountAdapt.java
@@ -30,7 +30,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;
@@ -160,7 +160,7 @@
            logger.info("推送微信模板,获取accessToken失败:{}", accessToken);
            return;
        }
        // 根据特定权限查询 有该权限的 员工
        // 根据特定权限查询 有该权限的员工
        BasePrivilegeDto basePrivilegeDto = new BasePrivilegeDto();
        basePrivilegeDto.setResource("/wechatHousingApproval");
        List<UserDto> userDtos = privilegeInnerServiceSMO.queryPrivilegeUsers(basePrivilegeDto);
@@ -171,24 +171,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);
            }
        }
    }
@@ -260,6 +263,7 @@
            data.setKeyword3(new Content(paramIn.getString("checkRemark")));
            data.setRemark(new Content("空置房申请验房已通过,系统已为您安排下一步审核流程,请耐心等待!"));
            templateMessage.setData(data);
            //获取业主公众号地址
            String wechatUrl = MappingCache.getValue("OWNER_WECHAT_URL");
            templateMessage.setUrl(wechatUrl);
            logger.info("发送模板消息内容:{}", JSON.toJSONString(templateMessage));
@@ -336,6 +340,7 @@
            data.setKeyword3(new Content(paramIn.getString("checkRemark")));
            data.setRemark(new Content("感谢您的使用,如有疑问请联系相关物业人员。"));
            templateMessage.setData(data);
            //获取业主公众号地址
            String wechatUrl = MappingCache.getValue("OWNER_WECHAT_URL");
            templateMessage.setUrl(wechatUrl);
            logger.info("发送模板消息内容:{}", JSON.toJSONString(templateMessage));