java110
2022-01-17 d937205d5824dc44ab1567cf6f84fbfa817baa92
service-job/src/main/java/com/java110/job/adapt/Repair/MachineDistributeLeaflets.java
old mode 100644 new mode 100755
@@ -20,12 +20,14 @@
import com.java110.intf.community.IRepairUserInnerServiceSMO;
import com.java110.intf.store.ISmallWeChatInnerServiceSMO;
import com.java110.intf.store.ISmallWechatAttrInnerServiceSMO;
import com.java110.intf.user.*;
import com.java110.intf.user.IOwnerAppUserInnerServiceSMO;
import com.java110.intf.user.IStaffAppAuthInnerServiceSMO;
import com.java110.intf.user.IUserInnerServiceSMO;
import com.java110.job.adapt.DatabusAdaptImpl;
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;
@@ -132,7 +134,7 @@
                sendMsg(paramIn, communityDtos.get(0));
                //派单成功给业主推送信息
                publishMsg(paramIn, communityDtos.get(0));
            } else if (repairState.equals("1100") && repairWay.equals("100")) {
            } else if (repairState.equals("1100") && (repairWay.equals("100") || repairWay.equals("300"))) {
                String staffId = "";
                if (repairUserDtos.size() > 1) {
                    staffId = repairUserDtos.get(1).getStaffId();
@@ -156,7 +158,7 @@
                if (repairUserDtos.size() > 1) {
                    //给维修师傅推送信息
                    sendMsg(paramIn, communityDtos.get(0));
                }else {
                } else {
                    //抢单成功给维修师傅推送信息
                    publishMessage(paramIn, communityDtos.get(0));
                }
@@ -231,7 +233,8 @@
            data.setKeyword4(new Content(paramIn.getString("context") + "\r\n" + "报修位置:" + paramIn.getString("repairObjName")));
            data.setRemark(new Content(paramIn.getString("preStaffName") + "转单给您,请及时登录公众号接单确认!"));
            templateMessage.setData(data);
            String wechatUrl = MappingCache.getValue("OWNER_WECHAT_URL");
            //获取员工公众号地址
            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);
@@ -298,7 +301,8 @@
            data.setKeyword4(new Content(paramIn.getString("context") + "\r\n" + "报修位置:" + address));
            data.setRemark(new Content("请及时登录公众号接单确认!"));
            templateMessage.setData(data);
            String wechatUrl = MappingCache.getValue("OWNER_WECHAT_URL");
            //获取员工公众号地址
            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);
@@ -371,6 +375,7 @@
                data.setKeyword4(new Content(paramIn.getString("time")));
                data.setRemark(new Content("您的报修已受理,请保持电话畅通,以便维修人员及时跟您取得联系!感谢您的使用!"));
                templateMessage.setData(data);
                //获取业主公众号地址
                String wechatUrl = MappingCache.getValue("OWNER_WECHAT_URL");
                templateMessage.setUrl(wechatUrl);
                logger.info("发送模板消息内容:{}", JSON.toJSONString(templateMessage));
@@ -386,8 +391,7 @@
     * @param paramIn
     * @param communityDto
     */
    private void
    publishMessage(JSONObject paramIn, CommunityDto communityDto) {
    private void publishMessage(JSONObject paramIn, CommunityDto communityDto) {
        //查询公众号配置
        SmallWeChatDto smallWeChatDto = new SmallWeChatDto();
        smallWeChatDto.setWeChatType("1100");
@@ -439,7 +443,8 @@
        data.setKeyword4(new Content(paramIn.getString("context") + "\r\n" + "报修位置:" + address));
        data.setRemark(new Content("请及时与客户取得联系!"));
        templateMessage.setData(data);
        String wechatUrl = MappingCache.getValue("OWNER_WECHAT_URL");
        //获取员工公众号地址
        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);