wuxw
2024-01-22 a40c2eb885bcdb697c2e16dae4f43cb6cd718973
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,11 +37,7 @@
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;
@@ -48,10 +45,7 @@
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;
@@ -115,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=";
@@ -220,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);
@@ -269,10 +267,21 @@
        }
        for (UserDto userDto : userDtos) {
            //根据 userId 查询到openId
            //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);
@@ -302,6 +311,7 @@
        try {
            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") + "元");
@@ -327,7 +337,7 @@
        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;
        }
@@ -388,6 +398,7 @@
            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"))) {