| @@ -85,5 +85,10 @@ public class WxMerchantTradeDaily extends TenantEntity { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Long ignoreId; | private Long ignoreId; | ||||
| @TableField(exist = false) | |||||
| private Long buildingId; | |||||
| @TableField(exist = false) | |||||
| private Long floorId; | |||||
| } | } | ||||
| @@ -105,5 +105,7 @@ public interface WxShopService { | |||||
| List<WxShopVo> findMerchantShopVoList(TenantEntity tenantEntity,Long merchantId); | List<WxShopVo> findMerchantShopVoList(TenantEntity tenantEntity,Long merchantId); | ||||
| WxShop getShopByShopNumber(TenantEntity tenantEntity,String shopNumber); | WxShop getShopByShopNumber(TenantEntity tenantEntity,String shopNumber); | ||||
| List<Long> getShopIds(WxShop wxShop); | |||||
| } | } | ||||
| @@ -11,9 +11,11 @@ import com.iformall.domain.po.*; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.WxMerchantTradeDailyVo; | import com.iformall.domain.vo.WxMerchantTradeDailyVo; | ||||
| import com.iformall.enums.EnumTradeDailyDateType; | import com.iformall.enums.EnumTradeDailyDateType; | ||||
| import com.iformall.enums.EnumYesOrNo; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.WxMerchantTradeDailyHistoryMapper; | import com.iformall.mapper.WxMerchantTradeDailyHistoryMapper; | ||||
| import com.iformall.mapper.WxMerchantTradeDailyMapper; | import com.iformall.mapper.WxMerchantTradeDailyMapper; | ||||
| import com.iformall.mapper.WxShopMapper; | |||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| @@ -182,10 +184,13 @@ public class WxMerchantTradeDailyServiceImpl implements WxMerchantTradeDailyServ | |||||
| } | } | ||||
| private void handleQueryParam(WxMerchantTradeDaily record) { | private void handleQueryParam(WxMerchantTradeDaily record) { | ||||
| if (!StringUtils.isBlank(record.getMerchantName())) { | |||||
| //楼层楼座 | |||||
| List<Long> floorMids = wxMerchantService.getFloorBuildMerchantIds(record, null, record.getBuildingId(), record.getFloorId(), EnumYesOrNo.NO.getCode(), EnumYesOrNo.NO.getCode()); | |||||
| if (null != floorMids || StringUtils.isNotBlank(record.getMerchantName())) { | |||||
| WxMerchant m = new WxMerchant(); | WxMerchant m = new WxMerchant(); | ||||
| m.updateTenantInfo(record); | m.updateTenantInfo(record); | ||||
| m.setName(StringUtils.trimToNull(record.getMerchantName())); | m.setName(StringUtils.trimToNull(record.getMerchantName())); | ||||
| m.setIds(floorMids); | |||||
| List<Long> merchantIdList = wxMerchantService.findIdList(m); | List<Long> merchantIdList = wxMerchantService.findIdList(m); | ||||
| if (null != merchantIdList && merchantIdList.size() > 0 ) { | if (null != merchantIdList && merchantIdList.size() > 0 ) { | ||||
| record.setMerchantIdList(merchantIdList); | record.setMerchantIdList(merchantIdList); | ||||
| @@ -468,6 +473,7 @@ public class WxMerchantTradeDailyServiceImpl implements WxMerchantTradeDailyServ | |||||
| if (merchant == null) | if (merchant == null) | ||||
| return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND); | return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND); | ||||
| WxMerchantTradeDaily wxMerchantTradeDaily = new WxMerchantTradeDaily(); | WxMerchantTradeDaily wxMerchantTradeDaily = new WxMerchantTradeDaily(); | ||||
| wxMerchantTradeDaily.updateTenantInfo(merchant); | |||||
| wxMerchantTradeDaily.setMerchantId(merchantId); | wxMerchantTradeDaily.setMerchantId(merchantId); | ||||
| String startTime = DateUtils.getTimeBefore(29, new Date()); | String startTime = DateUtils.getTimeBefore(29, new Date()); | ||||
| String endTime = DateUtils.getSystemTime("yyyy-MM-dd"); | String endTime = DateUtils.getSystemTime("yyyy-MM-dd"); | ||||
| @@ -214,7 +214,9 @@ public class WxMsgCallbackServiceImpl implements WxMsgCallbackService { | |||||
| WxMsgCallback wxMsgCallback = new WxMsgCallback(); | WxMsgCallback wxMsgCallback = new WxMsgCallback(); | ||||
| wxMsgCallback.setBatchNo(param.get("biz_id")); | wxMsgCallback.setBatchNo(param.get("biz_id")); | ||||
| wxMsgCallback.setPhone(param.get("phone_number")); | wxMsgCallback.setPhone(param.get("phone_number")); | ||||
| if("true".equalsIgnoreCase(success)){ | |||||
| String smsSize = param.get("sms_size");//是否计算条数 | |||||
| boolean isSuccess = false; | |||||
| if("true".equalsIgnoreCase(success) || ("false".equalsIgnoreCase(success) && StringUtils.isNotBlank(smsSize))){ | |||||
| wxMsgCallback.setStatus(EnumMsgSendStatus.MSG_SEND_SUCCESS.getCode()); | wxMsgCallback.setStatus(EnumMsgSendStatus.MSG_SEND_SUCCESS.getCode()); | ||||
| if(StringUtils.isNotBlank(param.get("out_id"))){ | if(StringUtils.isNotBlank(param.get("out_id"))){ | ||||
| WxCouponPassword couponPassword = new WxCouponPassword(); | WxCouponPassword couponPassword = new WxCouponPassword(); | ||||
| @@ -223,13 +225,14 @@ public class WxMsgCallbackServiceImpl implements WxMsgCallbackService { | |||||
| couponPassword.setUpdateDate(new Date()); | couponPassword.setUpdateDate(new Date()); | ||||
| wxCouponPasswordMapper.updateById(couponPassword); | wxCouponPasswordMapper.updateById(couponPassword); | ||||
| } | } | ||||
| isSuccess = true; | |||||
| }else{ | }else{ | ||||
| wxMsgCallback.setStatus(EnumMsgSendStatus.MSG_SEND_FAIL.getCode()); | wxMsgCallback.setStatus(EnumMsgSendStatus.MSG_SEND_FAIL.getCode()); | ||||
| } | } | ||||
| wxMsgCallback.setStatusMsg(param.get("err_msg")); | wxMsgCallback.setStatusMsg(param.get("err_msg")); | ||||
| wxMsgCallbackMapper.updateByBatchNo(wxMsgCallback); | wxMsgCallbackMapper.updateByBatchNo(wxMsgCallback); | ||||
| //失败回滚 回滚数量 | //失败回滚 回滚数量 | ||||
| if (!"true".equalsIgnoreCase(success)) { | |||||
| if (!isSuccess) { | |||||
| String redisKey = Constant.cache_aliyun_msg+wxMsgCallback.getBatchNo()+":"+wxMsgCallback.getPhone(); | String redisKey = Constant.cache_aliyun_msg+wxMsgCallback.getBatchNo()+":"+wxMsgCallback.getPhone(); | ||||
| Integer msgCached = RedisCacheUtils.getCacheInteger(redisTemplate, redisKey); | Integer msgCached = RedisCacheUtils.getCacheInteger(redisTemplate, redisKey); | ||||
| if (null != msgCached && 1== msgCached) { | if (null != msgCached && 1== msgCached) { | ||||
| @@ -708,4 +708,9 @@ public class WxShopServiceImpl implements WxShopService { | |||||
| } | } | ||||
| return null; | return null; | ||||
| } | } | ||||
| @Override | |||||
| public List<Long> getShopIds(WxShop wxShop) { | |||||
| return wxShopMapper.findIdList(wxShop); | |||||
| } | |||||
| } | } | ||||