| @@ -22,6 +22,7 @@ import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.PathVariable; | |||||
| import org.springframework.web.bind.annotation.RequestMapping; | import org.springframework.web.bind.annotation.RequestMapping; | ||||
| import org.springframework.web.bind.annotation.RequestParam; | import org.springframework.web.bind.annotation.RequestParam; | ||||
| import org.springframework.web.bind.annotation.ResponseBody; | import org.springframework.web.bind.annotation.ResponseBody; | ||||
| @@ -205,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") | |||||
| public String __Notify(@RequestParam Map<String, Object> paramMap) throws Exception { | |||||
| @RequestMapping(value = "/notify/{tenantId}") | |||||
| public String __Notify(@PathVariable String tenantId,@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"); | ||||
| @@ -255,7 +256,7 @@ 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(mallStoreId); | |||||
| WxMerchant merchant = wxMerchantService.getMerchantByEncode(tenantId,mallStoreId); | |||||
| if(merchant == null){ | if(merchant == null){ | ||||
| logger.error("alipay notify . 找不到门店:"+paramMap); | logger.error("alipay notify . 找不到门店:"+paramMap); | ||||
| return "fail"; | return "fail"; | ||||
| @@ -301,7 +302,7 @@ 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(mallStoreId); | |||||
| WxMerchant merchant = wxMerchantService.getMerchantByEncode(tenantId,mallStoreId); | |||||
| if(merchant == null){ | if(merchant == null){ | ||||
| logger.error("alipay notify . 找不到门店:"+paramMap); | logger.error("alipay notify . 找不到门店:"+paramMap); | ||||
| return "fail"; | return "fail"; | ||||
| @@ -46,7 +46,7 @@ public interface WxMerchantMapper extends CommonMapper<WxMerchant, Long> { | |||||
| void reSetCashCount(WxMerchant record); | void reSetCashCount(WxMerchant record); | ||||
| WxMerchant getMerchantByEncode(@Param("encode")String encode); | |||||
| WxMerchant getMerchantByEncode(@Param("tenantId")String tenantId,@Param("encode")String encode); | |||||
| int recordedAmount(WxMerchant record); | int recordedAmount(WxMerchant record); | ||||
| @@ -169,7 +169,7 @@ public interface WxMerchantService { | |||||
| boolean hasMerchantBrand(WxMerchant wxMerchant); | boolean hasMerchantBrand(WxMerchant wxMerchant); | ||||
| boolean hasMerchantIsAdmin(WxMerchant wxMerchant); | boolean hasMerchantIsAdmin(WxMerchant wxMerchant); | ||||
| WxMerchant getMerchantByEncode(String encode); | |||||
| WxMerchant getMerchantByEncode(String tenantId,String encode); | |||||
| Optional<WxMerchant> findByName(String name); | Optional<WxMerchant> findByName(String name); | ||||
| @@ -134,7 +134,7 @@ public class AliBusinessCircleOrderServiceImpl implements AliBusinessCircleOrder | |||||
| record.setUpdateTime(now); | record.setUpdateTime(now); | ||||
| if(wxMerchant == null && StringUtils.isNotBlank(record.getMallStoreId())){ | if(wxMerchant == null && StringUtils.isNotBlank(record.getMallStoreId())){ | ||||
| wxMerchant = wxMerchantService.getMerchantByEncode(record.getMallStoreId()); | |||||
| wxMerchant = wxMerchantService.getMerchantByEncode(record.getTenantId(),record.getMallStoreId()); | |||||
| } | } | ||||
| if(wxMerchant != null){ | if(wxMerchant != null){ | ||||
| record.setMerchantId(wxMerchant.getId()); | record.setMerchantId(wxMerchant.getId()); | ||||
| @@ -162,7 +162,7 @@ public class WxBusinessCircleOrderServiceImpl implements WxBusinessCircleOrderSe | |||||
| //TODO 第三方获取门店(标识可能发生变化) | //TODO 第三方获取门店(标识可能发生变化) | ||||
| // WxMerchant wxMerchant = wxMerchantService.getById(Long.parseLong(record.getWxShopNumber())); | // WxMerchant wxMerchant = wxMerchantService.getById(Long.parseLong(record.getWxShopNumber())); | ||||
| WxMerchant wxMerchant = wxMerchantService.getMerchantByEncode(record.getWxShopNumber()); | |||||
| WxMerchant wxMerchant = wxMerchantService.getMerchantByEncode(record.getTenantId(),record.getWxShopNumber()); | |||||
| if (wxMerchant != null) { | if (wxMerchant != null) { | ||||
| record.setMerchantId(wxMerchant.getId()); | record.setMerchantId(wxMerchant.getId()); | ||||
| record.setMerchantName(wxMerchant.getName()); | record.setMerchantName(wxMerchant.getName()); | ||||
| @@ -1143,8 +1143,8 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public WxMerchant getMerchantByEncode(String encode){ | |||||
| return wxMerchantMapper.getMerchantByEncode(encode); | |||||
| public WxMerchant getMerchantByEncode(String tenantId,String encode){ | |||||
| return wxMerchantMapper.getMerchantByEncode(tenantId,encode); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -138,7 +138,7 @@ public class WxThirdPartyOrdersServiceImpl implements WxThirdPartyOrdersService | |||||
| //TODO 第三方获取门店(标识可能发生变化) | //TODO 第三方获取门店(标识可能发生变化) | ||||
| // WxMerchant wxMerchant = wxMerchantService.getById(Long.parseLong(record.getShopNumber())); | // WxMerchant wxMerchant = wxMerchantService.getById(Long.parseLong(record.getShopNumber())); | ||||
| WxMerchant wxMerchant = wxMerchantService.getMerchantByEncode(record.getShopNumber()); | |||||
| WxMerchant wxMerchant = wxMerchantService.getMerchantByEncode(record.getTenantId(),record.getShopNumber()); | |||||
| if(wxMerchant != null){ | if(wxMerchant != null){ | ||||
| record.setMerchantId(wxMerchant.getId()); | record.setMerchantId(wxMerchant.getId()); | ||||
| record.setMerchantName(wxMerchant.getName()); | record.setMerchantName(wxMerchant.getName()); | ||||
| @@ -408,7 +408,7 @@ public class WxThirdPartyOrdersServiceImpl implements WxThirdPartyOrdersService | |||||
| //TODO 第三方获取门店(标识可能发生变化) | //TODO 第三方获取门店(标识可能发生变化) | ||||
| // WxMerchant wxMerchant = wxMerchantService.getById(Long.parseLong(record.getShopNumber())); | // WxMerchant wxMerchant = wxMerchantService.getById(Long.parseLong(record.getShopNumber())); | ||||
| WxMerchant wxMerchant = wxMerchantService.getMerchantByEncode(record.getShopNumber()); | |||||
| WxMerchant wxMerchant = wxMerchantService.getMerchantByEncode(record.getTenantId(),record.getShopNumber()); | |||||
| if(wxMerchant != null){ | if(wxMerchant != null){ | ||||
| record.setMerchantId(wxMerchant.getId()); | record.setMerchantId(wxMerchant.getId()); | ||||
| record.setMerchantName(wxMerchant.getName()); | record.setMerchantName(wxMerchant.getName()); | ||||
| @@ -264,7 +264,7 @@ | |||||
| <select id="getMerchantByEncode" parameterType="String" resultMap="BaseResultMap"> | <select id="getMerchantByEncode" parameterType="String" resultMap="BaseResultMap"> | ||||
| select | select | ||||
| <include refid="allColumns"/> | <include refid="allColumns"/> | ||||
| from wx_merchant m where m.encode = #{encode} | |||||
| from wx_merchant m where m.`tenant_id` = #{tenantId} and m.encode = #{encode} | |||||
| </select> | </select> | ||||
| <select id="getMerchantByCode" parameterType="java.util.Map" resultMap="BaseResultMap"> | <select id="getMerchantByCode" parameterType="java.util.Map" resultMap="BaseResultMap"> | ||||