| @@ -95,10 +95,11 @@ public class WxShopController extends BaseController { | |||||
| @GetMapping("hasShopNumber") | @GetMapping("hasShopNumber") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "shopNumber", value = "shopNumber", dataType = "String", paramType = "query", required = true), | @ApiImplicitParam(name = "shopNumber", value = "shopNumber", dataType = "String", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query")}) | |||||
| public ResultData hasShopNumber(String shopNumber,Long id) { | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query"), | |||||
| @ApiImplicitParam(name = "type", value = "type", dataType = "Integer", paramType = "query", required = true)}) | |||||
| public ResultData hasShopNumber(String shopNumber, Long id, Integer type) { | |||||
| logger.debug("[" + getIpAddr() + "] WxShopController::hasShopNumber"); | logger.debug("[" + getIpAddr() + "] WxShopController::hasShopNumber"); | ||||
| return wxShopService.hasShopNumber(getTenantId(), shopNumber,id); | |||||
| return wxShopService.hasShopNumber(getTenantId(), shopNumber, id, type); | |||||
| } | } | ||||
| @@ -46,7 +46,7 @@ public interface WxShopService { | |||||
| ResultData getMerchantShopByShopId(String tenantId, String shopId); | ResultData getMerchantShopByShopId(String tenantId, String shopId); | ||||
| ResultData hasShopNumber(String tenantId, String shopNumber, Long id); | |||||
| ResultData hasShopNumber(String tenantId, String shopNumber, Long id, Integer type); | |||||
| PageInfo<Map<String,Object>> listShopFromContract(WxShop wxShop, Integer pageNum, Integer pageSize); | PageInfo<Map<String,Object>> listShopFromContract(WxShop wxShop, Integer pageNum, Integer pageSize); | ||||
| @@ -1,7 +1,6 @@ | |||||
| package com.iformall.service.impl; | package com.iformall.service.impl; | ||||
| import java.util.*; | import java.util.*; | ||||
| import java.util.stream.Collectors; | |||||
| import com.github.pagehelper.PageHelper; | import com.github.pagehelper.PageHelper; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| @@ -86,10 +85,11 @@ public class WxShopServiceImpl implements WxShopService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public ResultData hasShopNumber(String tenantId, String shopNumber, Long id) { | |||||
| public ResultData hasShopNumber(String tenantId, String shopNumber, Long id, Integer type) { | |||||
| WxShop wxShop = new WxShop(); | WxShop wxShop = new WxShop(); | ||||
| wxShop.setTenantId(tenantId); | wxShop.setTenantId(tenantId); | ||||
| wxShop.setShopNumber(shopNumber); | wxShop.setShopNumber(shopNumber); | ||||
| wxShop.setType(type); | |||||
| wxShop.setId(id); | wxShop.setId(id); | ||||
| int count = wxShopMapper.hasShopNumber(wxShop); | int count = wxShopMapper.hasShopNumber(wxShop); | ||||
| return new ResultData(ResultData.SUCCESS, "查询成功", count > 0 ? true : false); | return new ResultData(ResultData.SUCCESS, "查询成功", count > 0 ? true : false); | ||||
| @@ -315,7 +315,7 @@ | |||||
| <select id="hasShopNumber" parameterType="com.iformall.domain.po.WxShop" resultType="Integer"> | <select id="hasShopNumber" parameterType="com.iformall.domain.po.WxShop" resultType="Integer"> | ||||
| select count(*) from wx_shop where tenant_id=#{tenantId} and shop_number=#{shopNumber} | |||||
| select count(*) from wx_shop where tenant_id=#{tenantId} and shop_number=#{shopNumber} and `type`=#{type} | |||||
| <if test=" null != id"> | <if test=" null != id"> | ||||
| and id != #{id} | and id != #{id} | ||||
| </if> | </if> | ||||