|
|
|
@@ -6,10 +6,13 @@ import com.iformall.common.Result; |
|
|
|
import com.iformall.common.ResultData; |
|
|
|
import com.iformall.controller.base.BaseController; |
|
|
|
import com.iformall.domain.po.WxBrand; |
|
|
|
import com.iformall.domain.po.WxMerchant; |
|
|
|
import com.iformall.service.WxBrandService; |
|
|
|
import com.iformall.service.WxMerchantService; |
|
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import org.apache.commons.collections.CollectionUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
@@ -30,6 +33,8 @@ public class WxBrandController extends BaseController { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WxBrandService wxBrandService; |
|
|
|
@Autowired |
|
|
|
private WxMerchantService wxMerchantService; |
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("list") |
|
|
|
@@ -60,6 +65,19 @@ public class WxBrandController extends BaseController { |
|
|
|
public ResultData update(@RequestBody WxBrand wxBrand) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxBrandController::update"); |
|
|
|
wxBrand.setTenantId(getTenantId()); |
|
|
|
|
|
|
|
if(wxBrand.getIsDel().equals(1)){ |
|
|
|
//判断是否解绑商户 |
|
|
|
WxMerchant wxMerchant = new WxMerchant(); |
|
|
|
wxMerchant.setTenantId(wxBrand.getTenantId()); |
|
|
|
wxMerchant.setIsDel(0); |
|
|
|
wxMerchant.setBrand(wxBrand.getId()); |
|
|
|
List<WxMerchant> merchantList = wxMerchantService.findList(wxMerchant); |
|
|
|
if(CollectionUtils.isNotEmpty(merchantList)){ |
|
|
|
return new ResultData(Result.ERROR, "您有未解绑的商户,请先解绑。"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return wxBrandService.update(wxBrand); |
|
|
|
} |
|
|
|
|
|
|
|
|