Procházet zdrojové kódy

[商铺][修改][删除商铺]

release_toaliyun_real
gongbiao před 7 roky
rodič
revize
b7273b2d46
3 změnil soubory, kde provedl 10 přidání a 9 odebrání
  1. +1
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/WxShopController.java
  2. +1
    -1
      mallinkService/src/main/java/com/iformall/service/WxShopService.java
  3. +8
    -6
      mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java

+ 1
- 2
mallinkAdmin/src/main/java/com/iformall/controller/WxShopController.java Zobrazit soubor

@@ -71,8 +71,7 @@ public class WxShopController extends BaseController {
public ResultData delete(Long id) {
logger.debug("[" + getIpAddr() + "] WxShopController::delete");
Integer isAdmin = getUser().getIsAdmin();
wxShopService.deleteById(id, isAdmin);
return new ResultData(Result.SUCCESS, "删除成功", null);
return wxShopService.deleteById(id, isAdmin);
}

@ApiOperation("根据id查询接口")


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/WxShopService.java Zobrazit soubor

@@ -42,7 +42,7 @@ public interface WxShopService {
* @param id
* @param isAdmin
*/
void deleteById(Long id, Integer isAdmin);
ResultData deleteById(Long id, Integer isAdmin);


ResultData getbshoplist(String tenantId, String shopNumber);


+ 8
- 6
mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java Zobrazit soubor

@@ -13,7 +13,6 @@ import com.iformall.enums.EnumDelStatus;
import com.iformall.enums.EnumRentShopType;
import com.iformall.enums.EnumShopStatus;
import com.iformall.enums.EnumUserAdmin;
import com.iformall.exception.MallinkException;
import com.iformall.mapper.WxMerchantShopMapper;
import com.iformall.mapper.WxShopMapper;
import com.iformall.service.ExcelService;
@@ -80,14 +79,14 @@ public class WxShopServiceImpl implements WxShopService {
}

@Override
public void deleteById(Long id, Integer isAdmin) {
public ResultData deleteById(Long id, Integer isAdmin) {
//1、已出租不让删除
WxShop wxShop = wxShopMapper.selectByPrimaryKey(id);
if (wxShop == null) {
throw new MallinkException(ErrorCode.SHOP_IS_NOT_FOUND);
return new ResultData(ErrorCode.SHOP_IS_NOT_FOUND);
}
if (wxShop.getStatus().equals(EnumShopStatus.RENT.getCode())) {
throw new MallinkException(ErrorCode.SHOP_BAN_DELETED);
return new ResultData(ErrorCode.SHOP_BAN_DELETED);
}
//2、是否关联过商户
WxMerchantShop wxMerchantShop = new WxMerchantShop();
@@ -97,7 +96,7 @@ public class WxShopServiceImpl implements WxShopService {
int count = wxMerchantShops.size();
if (count > 0) {
if (!isAdmin.equals(EnumUserAdmin.ADMIN.getCode())) {
throw new MallinkException(ErrorCode.SHOP_DELETED_BY_ADMIN);
return new ResultData(ErrorCode.SHOP_DELETED_BY_ADMIN);
}
//更新标记
wxShop.setIsDel(EnumDelStatus.DEL.getCode());
@@ -108,8 +107,11 @@ public class WxShopServiceImpl implements WxShopService {
updateMerchantShop.setIsDel(EnumDelStatus.DEL.getCode());
wxMerchantShopMapper.updateByPrimaryKeySelective(updateMerchantShop);
}
} else {
//无关联商铺直接删除
wxShopMapper.deleteByPrimaryKey(id);
}
wxShopMapper.deleteByPrimaryKey(id);
return new ResultData(Result.SUCCESS, "删除成功");
}

@Override


Načítá se…
Zrušit
Uložit