Просмотр исходного кода

[店铺][修改][判断名称惟一]

release_toaliyun_real
gongbiao 7 лет назад
Родитель
Сommit
0932cd608b
4 измененных файлов: 8 добавлений и 7 удалений
  1. +4
    -3
      mallinkAdmin/src/main/java/com/iformall/controller/WxShopController.java
  2. +1
    -1
      mallinkService/src/main/java/com/iformall/service/WxShopService.java
  3. +2
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java
  4. +1
    -1
      mallinkService/src/main/resources/mapper/WxShopMapper.xml

+ 4
- 3
mallinkAdmin/src/main/java/com/iformall/controller/WxShopController.java Просмотреть файл

@@ -95,10 +95,11 @@ public class WxShopController extends BaseController {
@GetMapping("hasShopNumber")
@ApiImplicitParams({
@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");
return wxShopService.hasShopNumber(getTenantId(), shopNumber,id);
return wxShopService.hasShopNumber(getTenantId(), shopNumber, id, type);
}




+ 1
- 1
mallinkService/src/main/java/com/iformall/service/WxShopService.java Просмотреть файл

@@ -46,7 +46,7 @@ public interface WxShopService {

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);



+ 2
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java Просмотреть файл

@@ -1,7 +1,6 @@
package com.iformall.service.impl;

import java.util.*;
import java.util.stream.Collectors;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@@ -86,10 +85,11 @@ public class WxShopServiceImpl implements WxShopService {
}

@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.setTenantId(tenantId);
wxShop.setShopNumber(shopNumber);
wxShop.setType(type);
wxShop.setId(id);
int count = wxShopMapper.hasShopNumber(wxShop);
return new ResultData(ResultData.SUCCESS, "查询成功", count > 0 ? true : false);


+ 1
- 1
mallinkService/src/main/resources/mapper/WxShopMapper.xml Просмотреть файл

@@ -315,7 +315,7 @@
<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">
and id != #{id}
</if>


Загрузка…
Отмена
Сохранить