From a40c2eb885bcdb697c2e16dae4f43cb6cd718973 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期一, 22 一月 2024 11:28:03 +0800
Subject: [PATCH] 优化小区数据

---
 service-job/src/main/java/com/java110/job/adapt/payment/notice/MachinePaymentNoticeAdapt.java |  320 +++++++++++++---------------------------------------
 1 files changed, 82 insertions(+), 238 deletions(-)

diff --git a/service-job/src/main/java/com/java110/job/adapt/payment/notice/MachinePaymentNoticeAdapt.java b/service-job/src/main/java/com/java110/job/adapt/payment/notice/MachinePaymentNoticeAdapt.java
index 49f979f..f9ebc85 100755
--- a/service-job/src/main/java/com/java110/job/adapt/payment/notice/MachinePaymentNoticeAdapt.java
+++ b/service-job/src/main/java/com/java110/job/adapt/payment/notice/MachinePaymentNoticeAdapt.java
@@ -22,6 +22,7 @@
 import com.java110.dto.owner.OwnerCarDto;
 import com.java110.dto.owner.OwnerDto;
 import com.java110.dto.owner.OwnerRoomRelDto;
+import com.java110.dto.privilege.RoleCommunityDto;
 import com.java110.dto.wechat.SmallWeChatDto;
 import com.java110.dto.wechat.SmallWechatAttrDto;
 import com.java110.dto.user.StaffAppAuthDto;
@@ -36,21 +37,15 @@
 import com.java110.intf.order.IPrivilegeInnerServiceSMO;
 import com.java110.intf.store.ISmallWeChatInnerServiceSMO;
 import com.java110.intf.store.ISmallWechatAttrInnerServiceSMO;
-import com.java110.intf.user.IOwnerAppUserInnerServiceSMO;
-import com.java110.intf.user.IOwnerCarInnerServiceSMO;
-import com.java110.intf.user.IOwnerInnerServiceSMO;
-import com.java110.intf.user.IOwnerRoomRelInnerServiceSMO;
-import com.java110.intf.user.IStaffAppAuthInnerServiceSMO;
+import com.java110.intf.user.*;
 import com.java110.job.adapt.DatabusAdaptImpl;
+import com.java110.job.msgNotify.MsgNotifyFactory;
 import com.java110.po.fee.PayFeeDetailPo;
 import com.java110.utils.cache.MappingCache;
 import com.java110.utils.cache.UrlCache;
 import com.java110.utils.constant.MappingConstant;
 import com.java110.utils.constant.WechatConstant;
-import com.java110.utils.util.Assert;
-import com.java110.utils.util.BeanConvertUtil;
-import com.java110.utils.util.DateUtil;
-import com.java110.utils.util.StringUtil;
+import com.java110.utils.util.*;
 import org.slf4j.Logger;
 import com.java110.core.log.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -114,6 +109,9 @@
 
     @Autowired
     private IOwnerAppUserInnerServiceSMO ownerAppUserInnerServiceSMO;
+
+    @Autowired
+    private IRoleCommunityV1InnerServiceSMO roleCommunityV1InnerServiceSMOImpl;
 
     //妯℃澘淇℃伅鎺ㄩ�佸湴鍧�
     private static String sendMsgUrl = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=";
@@ -219,7 +217,8 @@
         JSONObject paramIn = new JSONObject();
         paramIn.put("payFeeRoom", name + "-" + payerObjName);
         paramIn.put("feeTypeCdName", feeTypeCdName);
-        paramIn.put("payFeeTime", startTime + "鑷�" + endTime);
+        paramIn.put("feeName",feeDtos.get(0).getFeeName());
+        paramIn.put("payFeeTime", startTime + "~" + endTime);
         paramIn.put("receivedAmount", receivedAmount);
         paramIn.put("startTime", startTime);
         paramIn.put("endTime", endTime);
@@ -248,32 +247,7 @@
      * @param payFeeDetailPo
      */
     private void publishMsg(JSONObject paramIn, CommunityDto communityDto, PayFeeDetailPo payFeeDetailPo) {
-        //鏌ヨ鍏紬鍙烽厤缃�
-        SmallWeChatDto smallWeChatDto = new SmallWeChatDto();
-        smallWeChatDto.setWeChatType("1100");
-        smallWeChatDto.setObjType(SmallWeChatDto.OBJ_TYPE_COMMUNITY);
-        smallWeChatDto.setObjId(communityDto.getCommunityId());
-        List<SmallWeChatDto> smallWeChatDtos = smallWeChatInnerServiceSMOImpl.querySmallWeChats(smallWeChatDto);
-        if (smallWeChatDto == null || smallWeChatDtos.size() <= 0) {
-            logger.info("鏈厤缃井淇″叕浼楀彿淇℃伅,瀹氭椂浠诲姟鎵ц缁撴潫");
-            return;
-        }
-        SmallWeChatDto weChatDto = smallWeChatDtos.get(0);
-        SmallWechatAttrDto smallWechatAttrDto = new SmallWechatAttrDto();
-        smallWechatAttrDto.setCommunityId(communityDto.getCommunityId());
-        smallWechatAttrDto.setWechatId(weChatDto.getWeChatId());
-        smallWechatAttrDto.setSpecCd(SmallWechatAttrDto.SPEC_CD_WECHAT_SUCCESS_TEMPLATE);
-        List<SmallWechatAttrDto> smallWechatAttrDtos = smallWechatAttrInnerServiceSMOImpl.querySmallWechatAttrs(smallWechatAttrDto);
-        if (smallWechatAttrDtos == null || smallWechatAttrDtos.size() <= 0) {
-            logger.info("鏈厤缃井淇″叕浼楀彿娑堟伅妯℃澘");
-            return;
-        }
-        String templateId = smallWechatAttrDtos.get(0).getValue();
-        String accessToken = WechatFactory.getAccessToken(weChatDto.getAppId(), weChatDto.getAppSecret());
-        if (StringUtil.isEmpty(accessToken)) {
-            logger.info("鎺ㄩ�佸井淇℃ā鏉�,鑾峰彇accessToken澶辫触:{}", accessToken);
-            return;
-        }
+
         FeeDto feeDto = new FeeDto();
         feeDto.setFeeId(payFeeDetailPo.getFeeId());
         feeDto.setCommunityId(payFeeDetailPo.getCommunityId());
@@ -281,54 +255,39 @@
         Assert.listOnlyOne(feeDtos, "璐圭敤涓嶅瓨鍦�");
         // 鏍规嵁鐗瑰畾鏉冮檺鏌ヨ 鏈夎鏉冮檺鐨� 鍛樺伐
         BasePrivilegeDto basePrivilegeDto = new BasePrivilegeDto();
-        //basePrivilegeDto.setPId("502020121454780004");
         basePrivilegeDto.setResource("/wechatNotification");
         basePrivilegeDto.setStoreId(feeDtos.get(0).getIncomeObjId());
         List<UserDto> userDtos = privilegeInnerServiceSMO.queryPrivilegeUsers(basePrivilegeDto);
-        String sendTemplate = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, WechatConstant.SEND_TEMPLATE_URL);
-        if (StringUtil.isEmpty(sendTemplate)) {
-            sendTemplate = sendMsgUrl;
-        }
-        String url = sendTemplate + accessToken;
+        String wechatUrl = MappingCache.getValue(MappingConstant.URL_DOMAIN, "STAFF_WECHAT_URL");
+
         //鑾峰彇浠樿垂瀵硅薄绫诲瀷
         String payerObjType = paramIn.getString("payerObjType");
-        if (userDtos != null && userDtos.size() > 0) {
-            for (UserDto userDto : userDtos) {
-                //鏍规嵁 userId 鏌ヨ鍒皁penId
-                try {
-                    StaffAppAuthDto staffAppAuthDto = new StaffAppAuthDto();
-                    staffAppAuthDto.setStaffId(userDto.getUserId());
-                    staffAppAuthDto.setAppType("WECHAT");
-                    List<StaffAppAuthDto> staffAppAuthDtos = staffAppAuthInnerServiceSMO.queryStaffAppAuths(staffAppAuthDto);
-                    if (staffAppAuthDtos == null || staffAppAuthDtos.size() < 1) {
-                        continue;
-                    }
-                    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("鏈缂磋垂宸插埌璐�"));
-                    if (payerObjType.equals("3333")) {  //鎴垮眿
-                        data.setKeyword1(new Content(paramIn.getString("payFeeRoom")));
-                        data.setKeyword2(new Content(paramIn.getString("feeTypeCdName")));
-                    } else {  //杞﹁締
-                        data.setKeyword1(new Content(communityDto.getName() + "-" + paramIn.getString("num") + "-" + paramIn.getString("spaceNum")));
-                        data.setKeyword2(new Content(paramIn.getString("feeTypeCdName") + "-" + paramIn.getString("carNum")));
-                    }
-                    data.setKeyword3(new Content(paramIn.getString("payFeeTime")));
-                    data.setKeyword4(new Content(paramIn.getString("receivedAmount") + "鍏�"));
-                    data.setRemark(new Content("鎰熻阿鎮ㄧ殑浣跨敤,濡傛湁鐤戦棶璇疯仈绯荤浉鍏崇墿涓氫汉鍛�"));
-                    templateMessage.setData(data);
-                    //鑾峰彇鍛樺伐鍏紬鍙峰湴鍧�
-                    String wechatUrl = MappingCache.getValue(MappingConstant.URL_DOMAIN, "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);
-                } catch (Exception e) {
-                    logger.error("鍙戦�佺即璐逛俊鎭け璐�", e);
-                }
+        if (userDtos == null || userDtos.size() < 1) {
+            return;
+        }
+        for (UserDto userDto : userDtos) {
+            //鏍规嵁 userId 鏌ヨ鍒皁penId
+
+            //todo 鍒ゆ柇缁欏憳宸ユ槸鍚︽巿鏉冧簡璇ュ皬鍖�
+            RoleCommunityDto roleCommunityDto = new RoleCommunityDto();
+            roleCommunityDto.setStaffId(userDto.getUserId());
+            roleCommunityDto.setCommunityId(payFeeDetailPo.getCommunityId());
+           List<RoleCommunityDto> roleCommunityDtos =  roleCommunityV1InnerServiceSMOImpl.queryRoleCommunitys(roleCommunityDto);
+           if(ListUtil.isNull(roleCommunityDtos)){
+               continue;
+           }
+
+            try {
+                JSONObject content = new JSONObject();
+                content.put("payFeeRoom", paramIn.getString("payFeeRoom"));
+                content.put("feeTypeCdName", paramIn.getString("feeTypeCdName"));
+                content.put("feeName", paramIn.getString("feeName"));
+                content.put("payFeeTime", paramIn.getString("payFeeTime"));
+                content.put("receivedAmount", paramIn.getString("receivedAmount") + "鍏�");
+                content.put("url", wechatUrl);
+                MsgNotifyFactory.sendPayFeeMsg(payFeeDetailPo.getCommunityId(), userDto.getUserId(), content, MsgNotifyFactory.ROLE_STAFF);
+            } catch (Exception e) {
+                logger.error("鍙戦�佺即璐逛俊鎭け璐�", e);
             }
         }
     }
@@ -341,32 +300,6 @@
      * @param payFeeDetailPo
      */
     private void sendMsg(JSONObject paramIn, CommunityDto communityDto, PayFeeDetailPo payFeeDetailPo) {
-        //鏌ヨ鍏紬鍙烽厤缃�
-        SmallWeChatDto smallWeChatDto = new SmallWeChatDto();
-        smallWeChatDto.setWeChatType("1100");
-        smallWeChatDto.setObjType(SmallWeChatDto.OBJ_TYPE_COMMUNITY);
-        smallWeChatDto.setObjId(communityDto.getCommunityId());
-        List<SmallWeChatDto> smallWeChatDtos = smallWeChatInnerServiceSMOImpl.querySmallWeChats(smallWeChatDto);
-        if (smallWeChatDto == null || smallWeChatDtos.size() <= 0) {
-            logger.info("鏈厤缃井淇″叕浼楀彿淇℃伅,瀹氭椂浠诲姟鎵ц缁撴潫");
-            return;
-        }
-        SmallWeChatDto weChatDto = smallWeChatDtos.get(0);
-        SmallWechatAttrDto smallWechatAttrDto = new SmallWechatAttrDto();
-        smallWechatAttrDto.setCommunityId(communityDto.getCommunityId());
-        smallWechatAttrDto.setWechatId(weChatDto.getWeChatId());
-        smallWechatAttrDto.setSpecCd(SmallWechatAttrDto.SPEC_CD_WECHAT_SUCCESS_TEMPLATE);
-        List<SmallWechatAttrDto> smallWechatAttrDtos = smallWechatAttrInnerServiceSMOImpl.querySmallWechatAttrs(smallWechatAttrDto);
-        if (smallWechatAttrDtos == null || smallWechatAttrDtos.size() <= 0) {
-            logger.info("鏈厤缃井淇″叕浼楀彿娑堟伅妯℃澘");
-            return;
-        }
-        String templateId = smallWechatAttrDtos.get(0).getValue();
-        String accessToken = WechatFactory.getAccessToken(weChatDto.getAppId(), weChatDto.getAppSecret());
-        if (StringUtil.isEmpty(accessToken)) {
-            logger.info("鎺ㄩ�佸井淇℃ā鏉�,鑾峰彇accessToken澶辫触:{}", accessToken);
-            return;
-        }
         FeeDto feeDto = new FeeDto();
         feeDto.setFeeId(payFeeDetailPo.getFeeId());
         feeDto.setCommunityId(payFeeDetailPo.getCommunityId());
@@ -374,36 +307,17 @@
         Assert.listOnlyOne(feeDtos, "璐圭敤涓嶅瓨鍦�");
         //鑾峰彇鍒涘缓鐢ㄦ埛,鍗冲鐞嗙粨鍗曠殑缁翠慨缁翠慨甯堝倕
         String userId = feeDtos.get(0).getUserId();
-        String sendTemplate = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, WechatConstant.SEND_TEMPLATE_URL);
-        if (StringUtil.isEmpty(sendTemplate)) {
-            sendTemplate = sendMsgUrl;
-        }
-        String url = sendTemplate + accessToken;
         //鏍规嵁 userId 鏌ヨ鍒皁penId
         try {
-            StaffAppAuthDto staffAppAuthDto = new StaffAppAuthDto();
-            staffAppAuthDto.setStaffId(userId);
-            staffAppAuthDto.setAppType("WECHAT");
-            List<StaffAppAuthDto> staffAppAuthDtos = staffAppAuthInnerServiceSMO.queryStaffAppAuths(staffAppAuthDto);
-            Assert.listOnlyOne(staffAppAuthDtos, "鍛樺伐鏈璇�");
-            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("payFeeRoom")));
-            data.setKeyword2(new Content(paramIn.getString("feeTypeCdName")));
-            data.setKeyword3(new Content(paramIn.getString("payFeeTime")));
-            data.setKeyword4(new Content(paramIn.getString("receivedAmount") + "鍏�"));
-            data.setRemark(new Content("璇蜂笌瀹㈡湇绠″鏍稿疄璐圭敤"));
-            templateMessage.setData(data);
-            //鑾峰彇鍛樺伐鍏紬鍙峰湴鍧�
-            String wechatUrl = MappingCache.getValue(MappingConstant.URL_DOMAIN, "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);
+            JSONObject content = new JSONObject();
+            content.put("payFeeRoom", paramIn.getString("payFeeRoom"));
+            content.put("feeName",paramIn.getString("feeName"));
+            content.put("feeTypeCdName", paramIn.getString("feeTypeCdName"));
+            content.put("payFeeTime", paramIn.getString("payFeeTime"));
+            content.put("receivedAmount", paramIn.getString("receivedAmount") + "鍏�");
+            content.put("url", paramIn.getString("wechatUrl"));
+            MsgNotifyFactory.sendPayFeeMsg(payFeeDetailPo.getCommunityId(), userId, content, MsgNotifyFactory.ROLE_STAFF);
+
         } catch (Exception e) {
             logger.error("鍙戦�佺即璐逛俊鎭け璐�", e);
         }
@@ -423,26 +337,12 @@
         smallWeChatDto.setObjType(SmallWeChatDto.OBJ_TYPE_COMMUNITY);
         smallWeChatDto.setObjId(communityDto.getCommunityId());
         List<SmallWeChatDto> smallWeChatDtos = smallWeChatInnerServiceSMOImpl.querySmallWeChats(smallWeChatDto);
-        if (smallWeChatDto == null || smallWeChatDtos.size() <= 0) {
+        if (smallWeChatDto == null || smallWeChatDtos.isEmpty()) {
             logger.info("鏈厤缃井淇″叕浼楀彿淇℃伅,瀹氭椂浠诲姟鎵ц缁撴潫");
             return;
         }
-        SmallWeChatDto weChatDto = smallWeChatDtos.get(0);
-        SmallWechatAttrDto smallWechatAttrDto = new SmallWechatAttrDto();
-        smallWechatAttrDto.setCommunityId(communityDto.getCommunityId());
-        smallWechatAttrDto.setWechatId(weChatDto.getWeChatId());
-        smallWechatAttrDto.setSpecCd(SmallWechatAttrDto.SPEC_CD_WECHAT_SUCCESS_TEMPLATE);
-        List<SmallWechatAttrDto> smallWechatAttrDtos = smallWechatAttrInnerServiceSMOImpl.querySmallWechatAttrs(smallWechatAttrDto);
-        if (smallWechatAttrDtos == null || smallWechatAttrDtos.size() <= 0) {
-            logger.info("鏈厤缃井淇″叕浼楀彿娑堟伅妯℃澘");
-            return;
-        }
-        String templateId = smallWechatAttrDtos.get(0).getValue();
-        String accessToken = WechatFactory.getAccessToken(weChatDto.getAppId(), weChatDto.getAppSecret());
-        if (StringUtil.isEmpty(accessToken)) {
-            logger.info("鎺ㄩ�佸井淇℃ā鏉�,鑾峰彇accessToken澶辫触:{}", accessToken);
-            return;
-        }
+
+
         FeeDto feeDto = new FeeDto();
         feeDto.setFeeId(payFeeDetailPo.getFeeId());
         feeDto.setCommunityId(payFeeDetailPo.getCommunityId());
@@ -486,94 +386,38 @@
         ownerAppUserDto.setMemberId(memberId);
         ownerAppUserDto.setAppType("WECHAT");
         List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserInnerServiceSMO.queryOwnerAppUsers(ownerAppUserDto);
-        if (ownerAppUserDtos.size() > 0) {
-            //鑾峰彇openId
-            String openId = ownerAppUserDtos.get(0).getOpenId();
-            String url = sendMsgUrl + accessToken;
-            Data data = new Data();
-            PropertyFeeTemplateMessage templateMessage = new PropertyFeeTemplateMessage();
-            templateMessage.setTemplate_id(templateId);
-            templateMessage.setTouser(openId);
-            if (!StringUtil.isEmpty(paramIn.getString("state")) && paramIn.getString("state").equals("1300")) {
-                data.setFirst(new Content("鏈閫�璐瑰凡鍒拌处"));
-            } else {
-                data.setFirst(new Content("鏈缂磋垂宸插埌璐�"));
-            }
-            if (payerObjType.equals("3333")) {  //鎴垮眿
-                data.setKeyword1(new Content(paramIn.getString("payFeeRoom")));
-                data.setKeyword2(new Content(paramIn.getString("feeTypeCdName")));
-            } else {  //杞﹁締
-                data.setKeyword1(new Content(communityDto.getName() + "-" + paramIn.getString("num") + "-" + paramIn.getString("spaceNum")));
-                data.setKeyword2(new Content(paramIn.getString("feeTypeCdName") + "-" + paramIn.getString("carNum")));
-            }
-            data.setKeyword3(new Content(paramIn.getString("payFeeTime")));
-            if (!StringUtil.isEmpty(paramIn.getString("state")) && paramIn.getString("state").equals("1300")) {
-                //鑾峰彇閫�璐归噾棰�
-                double receivedAmount = Double.parseDouble(paramIn.getString("receivedAmount"));
-                double money = receivedAmount * (-1.00);
-                data.setKeyword4(new Content("閫�璐�" + money + "鍏�"));
-            } else {
-                data.setKeyword4(new Content(paramIn.getString("receivedAmount") + "鍏�"));
-            }
-            data.setRemark(new Content("鎰熻阿鎮ㄧ殑浣跨敤,濡傛湁鐤戦棶璇疯仈绯荤浉鍏崇墿涓氫汉鍛�"));
-            templateMessage.setData(data);
-            //鑾峰彇涓氫富鍏紬鍙峰湴鍧�
-            String wechatUrl = UrlCache.getOwnerUrl();
-            if (wechatUrl.contains("?")) {
-                wechatUrl += ("&wAppId=" + smallWeChatDtos.get(0).getAppId());
-            } else {
-                wechatUrl += ("?wAppId=" + smallWeChatDtos.get(0).getAppId());
-            }
-            templateMessage.setUrl(wechatUrl);
-            logger.info("鍙戦�佹ā鏉挎秷鎭唴瀹�:{}", JSON.toJSONString(templateMessage));
-            ResponseEntity<String> responseEntity = outRestTemplate.postForEntity(url, JSON.toJSONString(templateMessage), String.class);
-            logger.info("寰俊妯℃澘杩斿洖鍐呭:{}", responseEntity);
-        } else {
-            //鑾峰彇涓氫富鎵嬫満鍙�
-            String tel = ownerDtos.get(0).getLink();
-            //鑾峰彇涓氫富濮撳悕
-            String name = ownerDtos.get(0).getName();
-            //鑾峰彇璐圭敤绫诲瀷
-            String feeTypeCdName = paramIn.getString("feeTypeCdName");
-            //鑾峰彇璐圭敤寮�濮嬫椂闂�
-            String startTime = paramIn.getString("startTime");
-            //鑾峰彇璐圭敤缁撴潫鏃堕棿
-            String endTime = paramIn.getString("endTime");
-            //鑾峰彇缂磋垂閲戦
-            String receivedAmount = paramIn.getString("receivedAmount");
-            //鑾峰彇鎴垮眿鍙�
-            String payFeeRoom = paramIn.getString("payFeeRoom");
-            DefaultProfile profile = DefaultProfile.getProfile(MappingCache.getValue(ALI_SMS_DOMAIN, "region"),
-                    MappingCache.getValue(ALI_SMS_DOMAIN, "accessKeyId"),
-                    MappingCache.getValue(ALI_SMS_DOMAIN, "accessSecret"));
-            IAcsClient client = new DefaultAcsClient(profile);
-
-            CommonRequest request = new CommonRequest();
-            request.setSysMethod(MethodType.POST);
-            request.setSysDomain("dysmsapi.aliyuncs.com");
-            request.setSysVersion("2017-05-25");
-            request.setSysAction("SendSms");
-            request.putQueryParameter("RegionId", MappingCache.getValue(ALI_SMS_DOMAIN, "region"));
-            request.putQueryParameter("PhoneNumbers", tel);
-            request.putQueryParameter("SignName", MappingCache.getValue(ALI_SMS_DOMAIN, "signName"));
-            //鑾峰彇妯℃澘缂栫爜(SMS_207160078涓虹即璐规垚鍔熸彁绀烘ā鏉跨紪鐮�)
-            String payFeeCode = MappingCache.getValue(ALI_SMS_DOMAIN, "PayFeeCode");
-            String substring = "";
-            if (!StringUtil.isEmpty(payFeeCode)) {
-                substring = payFeeCode.substring(0, 4);
-            }
-            if (substring.equals("SMS_")) {
-                request.putQueryParameter("TemplateCode", payFeeCode);
-            }
-            request.putQueryParameter("TemplateParam", "{\"user\":" + "\"" + name + "\"" + "," + "\"house\":" + "\"" + payFeeRoom + "\"" + "," + "\"feeType\":" + "\"" + feeTypeCdName + "\"" + "," + "\"startTime\":" + "\"" + startTime + "\"" + "," + "\"endTime\":" + "\"" + endTime + "\"" + "," + "\"mount\":" + "\"" + receivedAmount + "\"" + "}");
-            try {
-                CommonResponse response = client.getCommonResponse(request);
-                logger.debug("鍙戦�佺煭淇★細{}", response.getData());
-            } catch (ServerException e) {
-                e.printStackTrace();
-            } catch (ClientException e) {
-                e.printStackTrace();
-            }
+        if (ownerAppUserDtos == null || ownerAppUserDtos.size() < 1) {
+            return;
         }
+        JSONObject content = new JSONObject();
+        if (payerObjType.equals(FeeDto.PAYER_OBJ_TYPE_ROOM)) {  //鎴垮眿
+            content.put("payFeeRoom", paramIn.getString("payFeeRoom"));
+            content.put("feeTypeCdName", paramIn.getString("feeTypeCdName"));
+        } else {  //杞﹁締
+            content.put("payFeeRoom", communityDto.getName() + "-" + paramIn.getString("num") + "-" + paramIn.getString("spaceNum"));
+            content.put("feeTypeCdName", paramIn.getString("feeTypeCdName") + "-" + paramIn.getString("carNum"));
+        }
+        content.put("payFeeTime", paramIn.getString("payFeeTime"));
+        content.put("feeName",feeDtos.get(0).getFeeName());
+
+        //todo 閫�璐�
+        if (FeeDetailDto.STATE_RETURN_ORDER.equals(paramIn.getString("state"))) {
+            //鑾峰彇閫�璐归噾棰�
+            double receivedAmount = Double.parseDouble(paramIn.getString("receivedAmount"));
+            double money = receivedAmount * (-1.00);
+            content.put("receivedAmount", money + "鍏�");
+        } else {
+            content.put("receivedAmount", paramIn.getString("receivedAmount") + "鍏�");
+        }
+        //鑾峰彇涓氫富鍏紬鍙峰湴鍧�
+        String wechatUrl = UrlCache.getOwnerUrl();
+        if (!StringUtil.isEmpty(wechatUrl) && wechatUrl.contains("?")) {
+            wechatUrl += ("&wAppId=" + smallWeChatDtos.get(0).getAppId());
+        } else {
+            wechatUrl += ("?wAppId=" + smallWeChatDtos.get(0).getAppId());
+        }
+        content.put("url", wechatUrl);
+        MsgNotifyFactory.sendPayFeeMsg(payFeeDetailPo.getCommunityId(), ownerAppUserDtos.get(0).getUserId(), content, MsgNotifyFactory.ROLE_OWNER);
+
     }
 }

--
Gitblit v1.8.0