| @@ -217,4 +217,13 @@ public class WxMerchantController extends BaseController { | |||||
| return wxMerchantService.useAccount(wxProfitSharingReceiver); | return wxMerchantService.useAccount(wxProfitSharingReceiver); | ||||
| } | } | ||||
| @ApiOperation("查看是否存在商户名称相同记录") | |||||
| @GetMapping("/hasMerchant") | |||||
| @SystemControllerLog(description = "商户-查看是否存在商户名称相同记录") | |||||
| public ResultData hasMerchant(@ModelAttribute WxMerchant wxMerchant) { | |||||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::hasMerchant"); | |||||
| boolean has = wxMerchantService.hasMerchant(wxMerchant); | |||||
| return new ResultData(has); | |||||
| } | |||||
| } | } | ||||
| @@ -19,4 +19,7 @@ public interface WxMerchantMapper extends CommonMapper<WxMerchant, Long> { | |||||
| List<WxMerchant> findQrcodeEmptyList(); | List<WxMerchant> findQrcodeEmptyList(); | ||||
| List<Map<String,Object>> findBusByFloorId(Map<String, Object> params); | List<Map<String,Object>> findBusByFloorId(Map<String, Object> params); | ||||
| int hasMerchant(WxMerchant wxMerchant); | |||||
| } | } | ||||
| @@ -100,4 +100,6 @@ public interface WxMerchantService { | |||||
| ResultData useAccount(WxProfitSharingReceiver wxProfitSharingReceiver); | ResultData useAccount(WxProfitSharingReceiver wxProfitSharingReceiver); | ||||
| boolean hasMerchant(WxMerchant wxMerchant); | |||||
| } | } | ||||
| @@ -693,4 +693,10 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| wxProfitSharingReceiverService.sendMsg(linkPhone, accout, merchantName, null, type, tenantId); | wxProfitSharingReceiverService.sendMsg(linkPhone, accout, merchantName, null, type, tenantId); | ||||
| return new ResultData(Result.SUCCESS, "操作成功"); | return new ResultData(Result.SUCCESS, "操作成功"); | ||||
| } | } | ||||
| @Override | |||||
| public boolean hasMerchant(WxMerchant wxMerchant) { | |||||
| wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); | |||||
| return wxMerchantMapper.hasMerchant(wxMerchant) > 0 ? true : false; | |||||
| } | |||||
| } | } | ||||
| @@ -243,4 +243,12 @@ | |||||
| and m.tenant_id = #{tenantId} | and m.tenant_id = #{tenantId} | ||||
| group by m.business_id | group by m.business_id | ||||
| </select> | </select> | ||||
| <select id="hasMerchant" parameterType="com.iformall.domain.po.WxMerchant" resultType="int"> | |||||
| select count(*) from wx_merchant where `name`=#{name} and status=#{status} | |||||
| <if test=" null != id"> | |||||
| and `id` != #{id} | |||||
| </if> | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||