| @@ -206,8 +206,8 @@ public class AliPayController extends BaseController { | |||||
| * https://opendocs.alipay.com/pre-apis/00fi1b | * https://opendocs.alipay.com/pre-apis/00fi1b | ||||
| * @throws Exception 可能产生的任何异常 | * @throws Exception 可能产生的任何异常 | ||||
| */ | */ | ||||
| @RequestMapping(value = "/notify/{tenantId}") | |||||
| public String __Notify(@PathVariable String tenantId,@RequestParam Map<String, Object> paramMap) throws Exception { | |||||
| @RequestMapping(value = "/notify") | |||||
| public String __Notify(@RequestParam Map<String, Object> paramMap) throws Exception { | |||||
| String msgMethod = (String) paramMap.get("msg_method"); | String msgMethod = (String) paramMap.get("msg_method"); | ||||
| String notifyId = (String) paramMap.get("notify_id"); | String notifyId = (String) paramMap.get("notify_id"); | ||||
| @@ -256,9 +256,14 @@ public class AliPayController extends BaseController { | |||||
| String mallName = jo.getString("mall_name"); | String mallName = jo.getString("mall_name"); | ||||
| // WxMerchant merchant = wxMerchantService.getById(Long.parseLong(mallStoreId)); | // WxMerchant merchant = wxMerchantService.getById(Long.parseLong(mallStoreId)); | ||||
| WxMall mall = mallService.getByAliMallId(mallId); | |||||
| if (null == mall) { | |||||
| logger.error("支付宝mallId未找到wxMall:"+mallId); | |||||
| return "fail"; | |||||
| } | |||||
| WxMerchant merchant = null; | WxMerchant merchant = null; | ||||
| if (StringUtils.isNotBlank(mallStoreId)) { | if (StringUtils.isNotBlank(mallStoreId)) { | ||||
| merchant = wxMerchantService.getMerchantByEncode(tenantId,mallStoreId); | |||||
| merchant = wxMerchantService.getMerchantByEncode(mall.getTenantId(),mallStoreId); | |||||
| } | } | ||||
| // if(merchant == null){ | // if(merchant == null){ | ||||
| @@ -306,7 +311,12 @@ public class AliPayController extends BaseController { | |||||
| String mallName = jo.getString("mall_name"); | String mallName = jo.getString("mall_name"); | ||||
| // WxMerchant merchant = wxMerchantService.getById(Long.parseLong(mallStoreId)); | // WxMerchant merchant = wxMerchantService.getById(Long.parseLong(mallStoreId)); | ||||
| WxMerchant merchant = wxMerchantService.getMerchantByEncode(tenantId,mallStoreId); | |||||
| WxMall mall = mallService.getByAliMallId(mallId); | |||||
| if (null == mall) { | |||||
| logger.error("支付宝mallId未找到wxMall:"+mallId); | |||||
| return "fail"; | |||||
| } | |||||
| WxMerchant merchant = wxMerchantService.getMerchantByEncode(mall.getTenantId(),mallStoreId); | |||||
| if(merchant == null){ | if(merchant == null){ | ||||
| logger.error("alipay notify . 找不到门店:"+paramMap); | logger.error("alipay notify . 找不到门店:"+paramMap); | ||||
| return "fail"; | return "fail"; | ||||
| @@ -95,6 +95,8 @@ public class WxMall extends TenantEntity { | |||||
| private String alipayAppAuthToken; | private String alipayAppAuthToken; | ||||
| @io.swagger.annotations.ApiModelProperty(value="支付宝app authToken,永久有效",name="alipayAppAuthToken") | @io.swagger.annotations.ApiModelProperty(value="支付宝app authToken,永久有效",name="alipayAppAuthToken") | ||||
| private String alipayMemberTemplateId; | private String alipayMemberTemplateId; | ||||
| @io.swagger.annotations.ApiModelProperty(value="支付宝商圈mallId",name="aliMallId") | |||||
| private String aliMallId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="是否支持商户根据手机号查询使用卡",name="useCardBySearchPhone") | @io.swagger.annotations.ApiModelProperty(value="是否支持商户根据手机号查询使用卡",name="useCardBySearchPhone") | ||||
| private Integer useCardBySearchPhone; | private Integer useCardBySearchPhone; | ||||
| @@ -12,6 +12,8 @@ public interface WxMallMapper extends CommonMapper<WxMall, Long> { | |||||
| List<WxMall> findList(WxMall wxMall); | List<WxMall> findList(WxMall wxMall); | ||||
| WxMall getByTenantId(String tenantId); | WxMall getByTenantId(String tenantId); | ||||
| WxMall getByAliMallId(String aliMallId); | |||||
| WxMall getByTenantInfo(TenantEntity tenantEntity); | WxMall getByTenantInfo(TenantEntity tenantEntity); | ||||
| @@ -40,6 +40,8 @@ public interface WxMallService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| WxMall getById(Long id); | WxMall getById(Long id); | ||||
| WxMall getByAliMallId(String aliMallId); | |||||
| /** | /** | ||||
| * 保存实体 | * 保存实体 | ||||
| @@ -113,6 +113,11 @@ public class WxMallServiceImpl implements WxMallService { | |||||
| public WxMall getById(Long id) { | public WxMall getById(Long id) { | ||||
| return this.getByTenantId(String.valueOf(id)); | return this.getByTenantId(String.valueOf(id)); | ||||
| } | } | ||||
| @Override | |||||
| public WxMall getByAliMallId(String aliMallId) { | |||||
| return this.getByAliMallId(aliMallId); | |||||
| } | |||||
| @Override | @Override | ||||
| public int save(WxMall record) { | public int save(WxMall record) { | ||||
| @@ -44,7 +44,7 @@ | |||||
| <result column="cash_out_limit" jdbcType="INTEGER" property="cashOutLimit"/> | <result column="cash_out_limit" jdbcType="INTEGER" property="cashOutLimit"/> | ||||
| <result column="alipay_app_auth_token" jdbcType="VARCHAR" property="alipayAppAuthToken"/> | <result column="alipay_app_auth_token" jdbcType="VARCHAR" property="alipayAppAuthToken"/> | ||||
| <result column="alipay_member_template_id" jdbcType="VARCHAR" property="alipayMemberTemplateId"/> | <result column="alipay_member_template_id" jdbcType="VARCHAR" property="alipayMemberTemplateId"/> | ||||
| <result column="ali_mall_id" jdbcType="VARCHAR" property="aliMallId"/> | |||||
| <result column="admin_id" jdbcType="BIGINT" property="adminId"/> | <result column="admin_id" jdbcType="BIGINT" property="adminId"/> | ||||
| <result column="admin_name" jdbcType="VARCHAR" property="adminName"/> | <result column="admin_name" jdbcType="VARCHAR" property="adminName"/> | ||||
| @@ -61,7 +61,7 @@ | |||||
| `weapp_share_title`,`weapp_share_cover_img`, `pos_qrcode_rule`, | `weapp_share_title`,`weapp_share_cover_img`, `pos_qrcode_rule`, | ||||
| `sale_type`, `valid_start`, `valid_end`,`business_hours`,`introduction`,`img`, | `sale_type`, `valid_start`, `valid_end`,`business_hours`,`introduction`,`img`, | ||||
| `latitude`,`longitude`,`default_sign`,`group_support`,`live_support`,`use_card_by_search_phone`, | `latitude`,`longitude`,`default_sign`,`group_support`,`live_support`,`use_card_by_search_phone`, | ||||
| `cash_out_support`,`cash_out_limit`,`alipay_app_auth_token`,`alipay_member_template_id` | |||||
| `cash_out_support`,`cash_out_limit`,`alipay_app_auth_token`,`alipay_member_template_id`,`ali_mall_id` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -149,6 +149,10 @@ | |||||
| <if test=" null != groupSupport "> | <if test=" null != groupSupport "> | ||||
| and `group_support` = #{groupSupport} | and `group_support` = #{groupSupport} | ||||
| </if> | </if> | ||||
| <if test=" null != aliMallId "> | |||||
| and `ali_mall_id` = #{aliMallId} | |||||
| </if> | |||||
| <if test=" null != tenantIdList "> | <if test=" null != tenantIdList "> | ||||
| and tenant_id in | and tenant_id in | ||||
| @@ -196,6 +200,13 @@ | |||||
| from wx_mall | from wx_mall | ||||
| where `tenant_id` = #{value} | where `tenant_id` = #{value} | ||||
| </select> | </select> | ||||
| <select id="getByAliMallId" parameterType="string" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_mall | |||||
| where `ali_mall_id` = #{aliMallId} | |||||
| </select> | |||||
| <select id="getByTenantInfo" parameterType="com.iformall.domain.po.base.TenantEntity" resultMap="BaseResultMap"> | <select id="getByTenantInfo" parameterType="com.iformall.domain.po.base.TenantEntity" resultMap="BaseResultMap"> | ||||
| select | select | ||||
| <include refid="allColumns"/> | <include refid="allColumns"/> | ||||