|
@@ -1,28 +1,31 @@
|
|
package com.slodon.b2b2c.controller.seller.admin;
|
|
package com.slodon.b2b2c.controller.seller.admin;
|
|
|
|
|
|
-import com.gexin.fastjson.JSON;
|
|
|
|
import com.slodon.b2b2c.aop.OperationLogger;
|
|
import com.slodon.b2b2c.aop.OperationLogger;
|
|
import com.slodon.b2b2c.core.constant.StoreConst;
|
|
import com.slodon.b2b2c.core.constant.StoreConst;
|
|
|
|
+import com.slodon.b2b2c.core.exception.MallException;
|
|
import com.slodon.b2b2c.core.response.JsonResult;
|
|
import com.slodon.b2b2c.core.response.JsonResult;
|
|
import com.slodon.b2b2c.core.response.PageVO;
|
|
import com.slodon.b2b2c.core.response.PageVO;
|
|
import com.slodon.b2b2c.core.response.PagerInfo;
|
|
import com.slodon.b2b2c.core.response.PagerInfo;
|
|
import com.slodon.b2b2c.core.response.SldResponse;
|
|
import com.slodon.b2b2c.core.response.SldResponse;
|
|
import com.slodon.b2b2c.core.util.*;
|
|
import com.slodon.b2b2c.core.util.*;
|
|
import com.slodon.b2b2c.dao.write.seller.StoreWriteMapper;
|
|
import com.slodon.b2b2c.dao.write.seller.StoreWriteMapper;
|
|
|
|
+import com.slodon.b2b2c.enums.WebSiteConstant;
|
|
|
|
+import com.slodon.b2b2c.goods.example.GoodsCategoryExample;
|
|
import com.slodon.b2b2c.goods.pojo.GoodsCategory;
|
|
import com.slodon.b2b2c.goods.pojo.GoodsCategory;
|
|
import com.slodon.b2b2c.model.goods.GoodsCategoryModel;
|
|
import com.slodon.b2b2c.model.goods.GoodsCategoryModel;
|
|
import com.slodon.b2b2c.model.seller.*;
|
|
import com.slodon.b2b2c.model.seller.*;
|
|
-import com.slodon.b2b2c.seller.example.StoreApplyExample;
|
|
|
|
-import com.slodon.b2b2c.seller.example.StoreBindCategoryExample;
|
|
|
|
-import com.slodon.b2b2c.seller.example.StoreCertificateExample;
|
|
|
|
|
|
+import com.slodon.b2b2c.model.system.SettingModel;
|
|
|
|
+import com.slodon.b2b2c.seller.example.*;
|
|
import com.slodon.b2b2c.seller.pojo.*;
|
|
import com.slodon.b2b2c.seller.pojo.*;
|
|
import com.slodon.b2b2c.system.pojo.Admin;
|
|
import com.slodon.b2b2c.system.pojo.Admin;
|
|
|
|
+import com.slodon.b2b2c.system.pojo.Setting;
|
|
import com.slodon.b2b2c.vo.seller.*;
|
|
import com.slodon.b2b2c.vo.seller.*;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.StringUtils;
|
|
import org.springframework.util.StringUtils;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -30,10 +33,7 @@ import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.Arrays;
|
|
|
|
-import java.util.Calendar;
|
|
|
|
-import java.util.List;
|
|
|
|
|
|
+import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -50,6 +50,8 @@ public class AdminStoreAuditController {
|
|
@Resource
|
|
@Resource
|
|
private StoreApplyModel storeApplyModel;
|
|
private StoreApplyModel storeApplyModel;
|
|
@Resource
|
|
@Resource
|
|
|
|
+ private StoreNameModel storeNameModel;
|
|
|
|
+ @Resource
|
|
private StoreGradeModel storeGradeModel;
|
|
private StoreGradeModel storeGradeModel;
|
|
@Resource
|
|
@Resource
|
|
private StoreCertificateModel storeCertificateModel;
|
|
private StoreCertificateModel storeCertificateModel;
|
|
@@ -59,9 +61,14 @@ public class AdminStoreAuditController {
|
|
private GoodsCategoryModel goodsCategoryModel;
|
|
private GoodsCategoryModel goodsCategoryModel;
|
|
@Resource
|
|
@Resource
|
|
private StoreWriteMapper storeWriteMapper;
|
|
private StoreWriteMapper storeWriteMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private StoreSiteInfoModel storeSiteInfoModel;
|
|
|
|
+ @Resource
|
|
|
|
+ private SettingModel settingModel;
|
|
|
|
|
|
@ApiOperation("入驻审核列表")
|
|
@ApiOperation("入驻审核列表")
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "webSite", value = "站点", paramType = "query"),
|
|
@ApiImplicitParam(name = "storeName", value = "店铺名称", paramType = "query"),
|
|
@ApiImplicitParam(name = "storeName", value = "店铺名称", paramType = "query"),
|
|
@ApiImplicitParam(name = "vendorName", value = "店主账号", paramType = "query"),
|
|
@ApiImplicitParam(name = "vendorName", value = "店主账号", paramType = "query"),
|
|
@ApiImplicitParam(name = "storeGradeId", value = "店铺等级", paramType = "query"),
|
|
@ApiImplicitParam(name = "storeGradeId", value = "店铺等级", paramType = "query"),
|
|
@@ -71,6 +78,7 @@ public class AdminStoreAuditController {
|
|
})
|
|
})
|
|
@GetMapping("list")
|
|
@GetMapping("list")
|
|
public JsonResult<PageVO<StoreApplyVO>> getList(HttpServletRequest request,
|
|
public JsonResult<PageVO<StoreApplyVO>> getList(HttpServletRequest request,
|
|
|
|
+ @RequestParam(value = "webSite", required = false) String webSite,
|
|
@RequestParam(value = "storeName", required = false) String storeName,
|
|
@RequestParam(value = "storeName", required = false) String storeName,
|
|
@RequestParam(value = "vendorName", required = false) String vendorName,
|
|
@RequestParam(value = "vendorName", required = false) String vendorName,
|
|
@RequestParam(value = "storeGradeId", required = false) Integer storeGradeId,
|
|
@RequestParam(value = "storeGradeId", required = false) Integer storeGradeId,
|
|
@@ -78,7 +86,9 @@ public class AdminStoreAuditController {
|
|
PagerInfo pager = WebUtil.handlerPagerInfo(request);
|
|
PagerInfo pager = WebUtil.handlerPagerInfo(request);
|
|
|
|
|
|
StoreApplyExample example = new StoreApplyExample();
|
|
StoreApplyExample example = new StoreApplyExample();
|
|
- example.setStoreNameLike(storeName);
|
|
|
|
|
|
+ if (WebSiteConstant.MEMBER_OVERSEA.equals(webSite)) {
|
|
|
|
+ example.setStoreNameLike(storeName);
|
|
|
|
+ }
|
|
example.setVendorNameLike(vendorName);
|
|
example.setVendorNameLike(vendorName);
|
|
example.setStoreGradeId(storeGradeId);
|
|
example.setStoreGradeId(storeGradeId);
|
|
example.setStoreType(StoreConst.NO_OWN_STORE);
|
|
example.setStoreType(StoreConst.NO_OWN_STORE);
|
|
@@ -90,8 +100,19 @@ public class AdminStoreAuditController {
|
|
example.setStateNotEquals(StoreConst.STATE_4_STORE_OPEN);
|
|
example.setStateNotEquals(StoreConst.STATE_4_STORE_OPEN);
|
|
}
|
|
}
|
|
List<StoreApply> storeApplyList = storeApplyModel.getStoreApplyList(example, pager);
|
|
List<StoreApply> storeApplyList = storeApplyModel.getStoreApplyList(example, pager);
|
|
|
|
+ List<StoreName> storeNameList = Collections.emptyList();
|
|
|
|
+ if (!WebSiteConstant.MEMBER_OVERSEA.equals(webSite)) {
|
|
|
|
+ StoreNameExample storeNameExample = new StoreNameExample();
|
|
|
|
+ storeNameExample.setStoreNameLike(storeName);
|
|
|
|
+ storeNameExample.setWebSite(webSite);
|
|
|
|
+ storeNameList = storeNameModel.getStoreNameList(new StoreNameExample(), null);
|
|
|
|
+ }
|
|
List<StoreApplyVO> vos = new ArrayList<>();
|
|
List<StoreApplyVO> vos = new ArrayList<>();
|
|
|
|
+ if (CollectionUtils.isEmpty(storeNameList) && !WebSiteConstant.MEMBER_OVERSEA.equals(webSite)) {
|
|
|
|
+ return SldResponse.success(new PageVO<>(vos, new PagerInfo(10, 1)));
|
|
|
|
+ }
|
|
if (!CollectionUtils.isEmpty(storeApplyList)) {
|
|
if (!CollectionUtils.isEmpty(storeApplyList)) {
|
|
|
|
+ List<StoreName> finalStoreNameList = storeNameList;
|
|
storeApplyList.forEach(storeApply -> {
|
|
storeApplyList.forEach(storeApply -> {
|
|
StoreApplyVO vo = new StoreApplyVO(storeApply);
|
|
StoreApplyVO vo = new StoreApplyVO(storeApply);
|
|
//根据等级id获取等级名称
|
|
//根据等级id获取等级名称
|
|
@@ -99,6 +120,22 @@ public class AdminStoreAuditController {
|
|
if (storeGrade != null) {
|
|
if (storeGrade != null) {
|
|
vo.setStoreGradeName(storeGrade.getGradeName());
|
|
vo.setStoreGradeName(storeGrade.getGradeName());
|
|
}
|
|
}
|
|
|
|
+ if (!WebSiteConstant.MEMBER_OVERSEA.equals(webSite)) {
|
|
|
|
+ vo.setStoreName(finalStoreNameList.stream()
|
|
|
|
+ .filter(storeNameWebSite -> storeNameWebSite.getStoreId().equals(storeApply.getStoreId()))
|
|
|
|
+ .findFirst()
|
|
|
|
+ .map(StoreName::getStoreName)
|
|
|
|
+ .orElse(""));
|
|
|
|
+ StoreSiteInfoExample storeSiteInfoExample = new StoreSiteInfoExample();
|
|
|
|
+ storeSiteInfoExample.setStoreId(storeApply.getStoreId());
|
|
|
|
+ storeSiteInfoExample.setWebSite(webSite);
|
|
|
|
+ StoreSiteInfo storeSiteInfo = storeSiteInfoModel.getStoreSiteInfo(storeSiteInfoExample);
|
|
|
|
+ if (storeSiteInfo != null) {
|
|
|
|
+ vo.setStoreGradeName(storeSiteInfo.getStoreGradeName());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
//获取联系人名称和电话
|
|
//获取联系人名称和电话
|
|
StoreCertificateExample storeCertificateExample = new StoreCertificateExample();
|
|
StoreCertificateExample storeCertificateExample = new StoreCertificateExample();
|
|
storeCertificateExample.setVendorId(storeApply.getVendorId());
|
|
storeCertificateExample.setVendorId(storeApply.getVendorId());
|
|
@@ -125,6 +162,7 @@ public class AdminStoreAuditController {
|
|
//获取商家申请信息
|
|
//获取商家申请信息
|
|
StoreApply storeApply = storeApplyModel.getStoreApplyByApplyId(applyId);
|
|
StoreApply storeApply = storeApplyModel.getStoreApplyByApplyId(applyId);
|
|
|
|
|
|
|
|
+
|
|
//获取申请资质信息
|
|
//获取申请资质信息
|
|
StoreCertificateExample storeCertificateExample = new StoreCertificateExample();
|
|
StoreCertificateExample storeCertificateExample = new StoreCertificateExample();
|
|
storeCertificateExample.setVendorId(storeApply.getVendorId());
|
|
storeCertificateExample.setVendorId(storeApply.getVendorId());
|
|
@@ -137,34 +175,65 @@ public class AdminStoreAuditController {
|
|
vo.setStoreGradeName(storeGrade.getGradeName());
|
|
vo.setStoreGradeName(storeGrade.getGradeName());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ Store store = storeModel.getStoreByStoreId(storeApply.getStoreId());
|
|
|
|
+ if (store != null) {
|
|
|
|
+ vo.setOpenTime(store.getOpenTime());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ StoreSiteInfoExample storeSiteInfoExample =new StoreSiteInfoExample();
|
|
|
|
+ storeSiteInfoExample.setStoreId(storeApply.getStoreId());
|
|
|
|
+ storeSiteInfoExample.setWebSite(WebSiteConstant.MEMBER_DISTRIBUTOR);
|
|
|
|
+ StoreSiteInfo storeSiteInfo = storeSiteInfoModel.getStoreSiteInfo(storeSiteInfoExample);
|
|
|
|
+ if (storeSiteInfo != null) {
|
|
|
|
+ vo.setStoreGradeIdCn(storeSiteInfo.getStoreGradeId());
|
|
|
|
+ vo.setStoreGradeNameCn(storeSiteInfo.getStoreGradeName());
|
|
|
|
+ vo.setOpenTimeCn(storeSiteInfo.getOpenTime());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ List<Setting> webSiteList = settingModel.getSiteSetting();
|
|
|
|
+ for (Setting setting : webSiteList) {
|
|
|
|
+ bulidStoreGoodsCateVOList(vo, storeApply, webSiteList, setting.getValue());
|
|
|
|
+ }
|
|
|
|
+ return SldResponse.success(vo, logMsg);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 构建不同站点经营类目信息
|
|
|
|
+ * @param vo
|
|
|
|
+ * @param storeApply
|
|
|
|
+ * @param webSiteList
|
|
|
|
+ * @param webSite
|
|
|
|
+ */
|
|
|
|
+ private void bulidStoreGoodsCateVOList(StoreApplyDetailVO vo, StoreApply storeApply, List<Setting> webSiteList, String webSite) {
|
|
|
|
+
|
|
//获取经营类目信息
|
|
//获取经营类目信息
|
|
StoreBindCategoryExample storeBindCategoryExample = new StoreBindCategoryExample();
|
|
StoreBindCategoryExample storeBindCategoryExample = new StoreBindCategoryExample();
|
|
|
|
+ storeBindCategoryExample.setWebSite(webSite);
|
|
storeBindCategoryExample.setCreateVendorId(storeApply.getVendorId());
|
|
storeBindCategoryExample.setCreateVendorId(storeApply.getVendorId());
|
|
List<StoreBindCategory> storeBindCategoryList = storeBindCategoryModel.getStoreBindCategoryList(storeBindCategoryExample, null);
|
|
List<StoreBindCategory> storeBindCategoryList = storeBindCategoryModel.getStoreBindCategoryList(storeBindCategoryExample, null);
|
|
|
|
+
|
|
|
|
+ GoodsCategoryExample goodsCategoryExample = new GoodsCategoryExample();
|
|
|
|
+ List<GoodsCategory> goodsCategoryList = goodsCategoryModel.getGoodsCategoryList(goodsCategoryExample, null);
|
|
|
|
+
|
|
List<StoreGoodsCateVO> storeGoodsCateVOList = new ArrayList<>();
|
|
List<StoreGoodsCateVO> storeGoodsCateVOList = new ArrayList<>();
|
|
if (!CollectionUtils.isEmpty(storeBindCategoryList)) {
|
|
if (!CollectionUtils.isEmpty(storeBindCategoryList)) {
|
|
- for (StoreBindCategory storeBindCategory : storeBindCategoryList) {
|
|
|
|
|
|
+ storeBindCategoryList.forEach(storeBindCategory -> {
|
|
StoreGoodsCateVO storeGoodsCateVO = new StoreGoodsCateVO(storeBindCategory);
|
|
StoreGoodsCateVO storeGoodsCateVO = new StoreGoodsCateVO(storeBindCategory);
|
|
- GoodsCategory goodsCategory1 = goodsCategoryModel.getGoodsCategoryByCategoryId(storeBindCategory.getGoodsCategoryId1());
|
|
|
|
- if (goodsCategory1 == null) {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- storeGoodsCateVO.setGoodsCateName1(goodsCategory1.getCategoryName());
|
|
|
|
- GoodsCategory goodsCategory2 = goodsCategoryModel.getGoodsCategoryByCategoryId(storeBindCategory.getGoodsCategoryId2());
|
|
|
|
- if (goodsCategory2 == null) {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- storeGoodsCateVO.setGoodsCateName2(goodsCategory2.getCategoryName());
|
|
|
|
- GoodsCategory goodsCategory3 = goodsCategoryModel.getGoodsCategoryByCategoryId(storeBindCategory.getGoodsCategoryId3());
|
|
|
|
- if (goodsCategory3 == null) {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- storeGoodsCateVO.setGoodsCateName3(goodsCategory3.getCategoryName());
|
|
|
|
|
|
+ storeGoodsCateVO.setWebSiteName(webSiteList.stream().filter(setting -> setting.getValue().equals(storeBindCategory.getWebSite())).findFirst().map(Setting::getTitle).orElse(""));
|
|
|
|
+ storeGoodsCateVO.setGoodsCateName1(goodsCategoryList.stream().filter(goodsCategory -> goodsCategory.getCategoryId().equals(storeBindCategory.getGoodsCategoryId1())).findFirst().map(GoodsCategory::getCategoryName).orElse(""));
|
|
|
|
+ storeGoodsCateVO.setGoodsCateName2(goodsCategoryList.stream().filter(goodsCategory -> goodsCategory.getCategoryId().equals(storeBindCategory.getGoodsCategoryId2())).findFirst().map(GoodsCategory::getCategoryName).orElse(""));
|
|
|
|
+ storeGoodsCateVO.setGoodsCateName3(goodsCategoryList.stream().filter(goodsCategory -> goodsCategory.getCategoryId().equals(storeBindCategory.getGoodsCategoryId3())).findFirst().map(GoodsCategory::getCategoryName).orElse(""));
|
|
storeGoodsCateVOList.add(storeGoodsCateVO);
|
|
storeGoodsCateVOList.add(storeGoodsCateVO);
|
|
|
|
+ });
|
|
|
|
+ if(WebSiteConstant.MEMBER_OVERSEA.equals(webSite)){
|
|
|
|
+ vo.setStoreGoodsCateVOList(storeGoodsCateVOList);
|
|
|
|
+ }else {
|
|
|
|
+ vo.setStoreGoodsCateCnVOList(storeGoodsCateVOList);
|
|
}
|
|
}
|
|
- vo.setStoreGoodsCateVOList(storeGoodsCateVOList);
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
- return SldResponse.success(vo, logMsg);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation("查看入驻详情所有接口")
|
|
@ApiOperation("查看入驻详情所有接口")
|
|
@@ -192,33 +261,22 @@ public class AdminStoreAuditController {
|
|
vo.setStoreGradeName(storeGrade.getGradeName());
|
|
vo.setStoreGradeName(storeGrade.getGradeName());
|
|
}
|
|
}
|
|
|
|
|
|
- //获取经营类目信息
|
|
|
|
- StoreBindCategoryExample storeBindCategoryExample = new StoreBindCategoryExample();
|
|
|
|
- storeBindCategoryExample.setCreateVendorId(storeApply.getVendorId());
|
|
|
|
- List<StoreBindCategory> storeBindCategoryList = storeBindCategoryModel.getStoreBindCategoryList(storeBindCategoryExample, null);
|
|
|
|
- List<StoreGoodsCateVO> storeGoodsCateVOList = new ArrayList<>();
|
|
|
|
- if (!CollectionUtils.isEmpty(storeBindCategoryList)) {
|
|
|
|
- for (StoreBindCategory storeBindCategory : storeBindCategoryList) {
|
|
|
|
- StoreGoodsCateVO storeGoodsCateVO = new StoreGoodsCateVO(storeBindCategory);
|
|
|
|
- GoodsCategory goodsCategory1 = goodsCategoryModel.getGoodsCategoryByCategoryId(storeBindCategory.getGoodsCategoryId1());
|
|
|
|
- if (goodsCategory1 == null) {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- storeGoodsCateVO.setGoodsCateName1(goodsCategory1.getCategoryName());
|
|
|
|
- GoodsCategory goodsCategory2 = goodsCategoryModel.getGoodsCategoryByCategoryId(storeBindCategory.getGoodsCategoryId2());
|
|
|
|
- if (goodsCategory2 == null) {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- storeGoodsCateVO.setGoodsCateName2(goodsCategory2.getCategoryName());
|
|
|
|
- GoodsCategory goodsCategory3 = goodsCategoryModel.getGoodsCategoryByCategoryId(storeBindCategory.getGoodsCategoryId3());
|
|
|
|
- if (goodsCategory3 == null) {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- storeGoodsCateVO.setGoodsCateName3(goodsCategory3.getCategoryName());
|
|
|
|
- storeGoodsCateVOList.add(storeGoodsCateVO);
|
|
|
|
- }
|
|
|
|
- vo.setStoreGoodsCateVOList(storeGoodsCateVOList);
|
|
|
|
- vos.add(vo);
|
|
|
|
|
|
+ Store store = storeModel.getStoreByStoreId(storeApply.getStoreId());
|
|
|
|
+ vo.setOpenTime(store.getOpenTime());
|
|
|
|
+
|
|
|
|
+ StoreSiteInfoExample storeSiteInfoExample =new StoreSiteInfoExample();
|
|
|
|
+ storeSiteInfoExample.setStoreId(storeApply.getStoreId());
|
|
|
|
+ storeSiteInfoExample.setWebSite(WebSiteConstant.MEMBER_DISTRIBUTOR);
|
|
|
|
+ StoreSiteInfo storeSiteInfo = storeSiteInfoModel.getStoreSiteInfo(storeSiteInfoExample);
|
|
|
|
+ if (storeSiteInfo != null) {
|
|
|
|
+ vo.setStoreGradeIdCn(storeSiteInfo.getStoreGradeId());
|
|
|
|
+ vo.setStoreGradeNameCn(storeSiteInfo.getStoreGradeName());
|
|
|
|
+ vo.setOpenTimeCn(storeSiteInfo.getOpenTime());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<Setting> webSiteList = settingModel.getSiteSetting();
|
|
|
|
+ for (Setting setting : webSiteList) {
|
|
|
|
+ bulidStoreGoodsCateVOList(vo, storeApply, webSiteList, setting.getValue());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -233,7 +291,11 @@ public class AdminStoreAuditController {
|
|
@ApiImplicitParam(name = "isPass", value = "是否通过[true==通过,false==驳回]", required = true),
|
|
@ApiImplicitParam(name = "isPass", value = "是否通过[true==通过,false==驳回]", required = true),
|
|
@ApiImplicitParam(name = "refuseReason", value = "审核原因,驳回时必填"),
|
|
@ApiImplicitParam(name = "refuseReason", value = "审核原因,驳回时必填"),
|
|
@ApiImplicitParam(name = "remark", value = "备注,拒绝时选填"),
|
|
@ApiImplicitParam(name = "remark", value = "备注,拒绝时选填"),
|
|
- @ApiImplicitParam(name = "scalingBindIds", value = "分佣比例,审核通过时必填,例:bindId1-scaling1,bindId2-scaling2,...")
|
|
|
|
|
|
+ @ApiImplicitParam(name = "scalingBindIds", value = "分佣比例,审核通过时必填,例:bindId1-scaling1,bindId2-scaling2,..."),
|
|
|
|
+ @ApiImplicitParam(name = "storeGradeId", value = "等级id"),
|
|
|
|
+ @ApiImplicitParam(name = "storeGradeIdCn", value = "国内店铺等级id"),
|
|
|
|
+ @ApiImplicitParam(name = "openTime", value = "开店时长"),
|
|
|
|
+ @ApiImplicitParam(name = "openTimeCn", value = "国内店铺开店时长"),
|
|
})
|
|
})
|
|
@PostMapping("audit")
|
|
@PostMapping("audit")
|
|
public JsonResult<Object> audit(HttpServletRequest request,
|
|
public JsonResult<Object> audit(HttpServletRequest request,
|
|
@@ -242,59 +304,70 @@ public class AdminStoreAuditController {
|
|
@RequestParam(value = "refuseReason", required = false) String refuseReason,
|
|
@RequestParam(value = "refuseReason", required = false) String refuseReason,
|
|
@RequestParam(value = "remark", required = false) String remark,
|
|
@RequestParam(value = "remark", required = false) String remark,
|
|
@RequestParam(value = "scalingBindIds", required = false) String scalingBindIds,
|
|
@RequestParam(value = "scalingBindIds", required = false) String scalingBindIds,
|
|
- @RequestParam(value = "openTime", required = false) Integer openTime) {
|
|
|
|
|
|
+ @RequestParam(value = "storeGradeId", required = false) Integer storeGradeId,
|
|
|
|
+ @RequestParam(value = "storeGradeIdCn", required = false) Integer storeGradeIdCn,
|
|
|
|
+ @RequestParam(value = "openTime", required = false) Integer openTime,
|
|
|
|
+ @RequestParam(value = "openTimeCn", required = false) Integer openTimeCn) {
|
|
|
|
|
|
Admin admin = UserUtil.getUser(request, Admin.class);
|
|
Admin admin = UserUtil.getUser(request, Admin.class);
|
|
|
|
|
|
AssertUtil.isTrue(!isPass && StringUtils.isEmpty(refuseReason), "请填写审核拒绝原因");
|
|
AssertUtil.isTrue(!isPass && StringUtils.isEmpty(refuseReason), "请填写审核拒绝原因");
|
|
- AssertUtil.isTrue(isPass && StringUtils.isEmpty(scalingBindIds), "请填写分佣比例");
|
|
|
|
|
|
+// AssertUtil.isTrue(isPass && StringUtils.isEmpty(scalingBindIds), "请填写分佣比例");
|
|
|
|
|
|
StoreApply storeApply = storeApplyModel.audit(applyId, isPass, refuseReason, remark, scalingBindIds, admin);
|
|
StoreApply storeApply = storeApplyModel.audit(applyId, isPass, refuseReason, remark, scalingBindIds, admin);
|
|
|
|
|
|
- //根据gradeId查询store_grade表
|
|
|
|
- StoreGrade storeGrade = storeGradeModel.getStoreGradeByGradeId(storeApply.getStoreGradeId());
|
|
|
|
-
|
|
|
|
- RegisterPayVO vo = new RegisterPayVO(storeGrade, storeApply);
|
|
|
|
- //获取经营类目信息
|
|
|
|
- StoreBindCategoryExample storeBindCategoryExample = new StoreBindCategoryExample();
|
|
|
|
- storeBindCategoryExample.setCreateVendorId(storeApply.getVendorId());
|
|
|
|
- List<StoreBindCategory> storeBindCategoryList = storeBindCategoryModel.getStoreBindCategoryList(storeBindCategoryExample, null);
|
|
|
|
- List<StoreGoodsCateVO> storeGoodsCateVOList = new ArrayList<>();
|
|
|
|
- if (!CollectionUtils.isEmpty(storeBindCategoryList)) {
|
|
|
|
- for (StoreBindCategory storeBindCategory : storeBindCategoryList) {
|
|
|
|
- StoreGoodsCateVO storeGoodsCateVO = new StoreGoodsCateVO(storeBindCategory);
|
|
|
|
- GoodsCategory goodsCategory1 = goodsCategoryModel.getGoodsCategoryByCategoryId(storeBindCategory.getGoodsCategoryId1());
|
|
|
|
- if (goodsCategory1 == null) {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- storeGoodsCateVO.setGoodsCateName1(goodsCategory1.getCategoryName());
|
|
|
|
- GoodsCategory goodsCategory2 = goodsCategoryModel.getGoodsCategoryByCategoryId(storeBindCategory.getGoodsCategoryId2());
|
|
|
|
- if (goodsCategory2 == null) {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- storeGoodsCateVO.setGoodsCateName2(goodsCategory2.getCategoryName());
|
|
|
|
- GoodsCategory goodsCategory3 = goodsCategoryModel.getGoodsCategoryByCategoryId(storeBindCategory.getGoodsCategoryId3());
|
|
|
|
- if (goodsCategory3 == null) {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- storeGoodsCateVO.setGoodsCateName3(goodsCategory3.getCategoryName());
|
|
|
|
- storeGoodsCateVOList.add(storeGoodsCateVO);
|
|
|
|
- }
|
|
|
|
- vo.setStoreGoodsCateVOList(storeGoodsCateVOList);
|
|
|
|
- }
|
|
|
|
|
|
+// //根据gradeId查询store_grade表
|
|
|
|
+// StoreGrade storeGrade = storeGradeModel.getStoreGradeByGradeId(storeApply.getStoreGradeId());
|
|
|
|
+//
|
|
|
|
+// RegisterPayVO vo = new RegisterPayVO(storeGrade, storeApply);
|
|
|
|
+// //获取经营类目信息
|
|
|
|
+// StoreBindCategoryExample storeBindCategoryExample = new StoreBindCategoryExample();
|
|
|
|
+// storeBindCategoryExample.setCreateVendorId(storeApply.getVendorId());
|
|
|
|
+// List<StoreBindCategory> storeBindCategoryList = storeBindCategoryModel.getStoreBindCategoryList(storeBindCategoryExample, null);
|
|
|
|
+// List<StoreGoodsCateVO> storeGoodsCateVOList = new ArrayList<>();
|
|
|
|
+// if (!CollectionUtils.isEmpty(storeBindCategoryList)) {
|
|
|
|
+// for (StoreBindCategory storeBindCategory : storeBindCategoryList) {
|
|
|
|
+// StoreGoodsCateVO storeGoodsCateVO = new StoreGoodsCateVO(storeBindCategory);
|
|
|
|
+// GoodsCategory goodsCategory1 = goodsCategoryModel.getGoodsCategoryByCategoryId(storeBindCategory.getGoodsCategoryId1());
|
|
|
|
+// if (goodsCategory1 == null) {
|
|
|
|
+// continue;
|
|
|
|
+// }
|
|
|
|
+// storeGoodsCateVO.setGoodsCateName1(goodsCategory1.getCategoryName());
|
|
|
|
+// GoodsCategory goodsCategory2 = goodsCategoryModel.getGoodsCategoryByCategoryId(storeBindCategory.getGoodsCategoryId2());
|
|
|
|
+// if (goodsCategory2 == null) {
|
|
|
|
+// continue;
|
|
|
|
+// }
|
|
|
|
+// storeGoodsCateVO.setGoodsCateName2(goodsCategory2.getCategoryName());
|
|
|
|
+// GoodsCategory goodsCategory3 = goodsCategoryModel.getGoodsCategoryByCategoryId(storeBindCategory.getGoodsCategoryId3());
|
|
|
|
+// if (goodsCategory3 == null) {
|
|
|
|
+// continue;
|
|
|
|
+// }
|
|
|
|
+// storeGoodsCateVO.setGoodsCateName3(goodsCategory3.getCategoryName());
|
|
|
|
+// storeGoodsCateVOList.add(storeGoodsCateVO);
|
|
|
|
+// }
|
|
|
|
+// vo.setStoreGoodsCateVOList(storeGoodsCateVOList);
|
|
|
|
+// }
|
|
if (isPass) {
|
|
if (isPass) {
|
|
// 店铺审核增加开店时长
|
|
// 店铺审核增加开店时长
|
|
- if (!StringUtil.isNullOrZero(openTime)) {
|
|
|
|
|
|
+ if (!StringUtil.isNullOrZero(openTime) && !StringUtil.isNullOrZero(openTimeCn)) {
|
|
storeApply.setApplyYear(openTime);
|
|
storeApply.setApplyYear(openTime);
|
|
|
|
+ storeApply.setApplyYearCn(openTimeCn);
|
|
|
|
+ }else{
|
|
|
|
+ throw new MallException("请选择开店时长");
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtil.isNullOrZero(storeGradeId) && !StringUtil.isNullOrZero(storeGradeIdCn)){
|
|
|
|
+ storeApply.setStoreGradeId(storeGradeId);
|
|
|
|
+ storeApply.setStoreGradeIdCn(storeGradeIdCn);
|
|
}else{
|
|
}else{
|
|
- AssertUtil.isTrue(StringUtil.isNullOrZero(openTime), "请选择开店时长");
|
|
|
|
|
|
+ throw new MallException("请选择店铺等级");
|
|
}
|
|
}
|
|
|
|
+
|
|
//todo 因业务需要暂不用此功能
|
|
//todo 因业务需要暂不用此功能
|
|
// if (storeApply.getPayAmount().compareTo(BigDecimal.ZERO) == 0) {
|
|
// if (storeApply.getPayAmount().compareTo(BigDecimal.ZERO) == 0) {
|
|
storeModel.openStore(storeApply);
|
|
storeModel.openStore(storeApply);
|
|
// }
|
|
// }
|
|
storeApplyModel.sendApplyStoreOkSms(storeApply);
|
|
storeApplyModel.sendApplyStoreOkSms(storeApply);
|
|
- return SldResponse.success("审核通过", vo);
|
|
|
|
|
|
+ return SldResponse.success("审核通过", storeApply);
|
|
} else {
|
|
} else {
|
|
ApplyRefuseVO applyRefuseVO = new ApplyRefuseVO(storeApply);
|
|
ApplyRefuseVO applyRefuseVO = new ApplyRefuseVO(storeApply);
|
|
storeApplyModel.sendApplyStoreFailedSms(storeApply);
|
|
storeApplyModel.sendApplyStoreFailedSms(storeApply);
|
|
@@ -310,7 +383,9 @@ public class AdminStoreAuditController {
|
|
@ApiImplicitParam(name = "isPass", value = "是否通过[true==通过,false==驳回]", required = true),
|
|
@ApiImplicitParam(name = "isPass", value = "是否通过[true==通过,false==驳回]", required = true),
|
|
@ApiImplicitParam(name = "refuseReason", value = "审核原因,驳回时必填"),
|
|
@ApiImplicitParam(name = "refuseReason", value = "审核原因,驳回时必填"),
|
|
@ApiImplicitParam(name = "remark", value = "备注,拒绝时选填"),
|
|
@ApiImplicitParam(name = "remark", value = "备注,拒绝时选填"),
|
|
- @ApiImplicitParam(name = "scalingBindIds", value = "分佣比例,审核通过时必填,例:bindId1-scaling1,bindId2-scaling2,...")
|
|
|
|
|
|
+ @ApiImplicitParam(name = "scalingBindIds", value = "分佣比例,审核通过时必填,例:bindId1-scaling1,bindId2-scaling2,..."),
|
|
|
|
+ @ApiImplicitParam(name = "openTime", value = "开店时长"),
|
|
|
|
+ @ApiImplicitParam(name = "openTimeCn", value = "国内店铺开店时长"),
|
|
})
|
|
})
|
|
@PostMapping("batchAudit")
|
|
@PostMapping("batchAudit")
|
|
public JsonResult<Object> batchAudit(HttpServletRequest request,
|
|
public JsonResult<Object> batchAudit(HttpServletRequest request,
|
|
@@ -319,7 +394,8 @@ public class AdminStoreAuditController {
|
|
@RequestParam(value = "refuseReason", required = false) String refuseReason,
|
|
@RequestParam(value = "refuseReason", required = false) String refuseReason,
|
|
@RequestParam(value = "remark", required = false) String remark,
|
|
@RequestParam(value = "remark", required = false) String remark,
|
|
@RequestParam(value = "scalingBindIds", required = false) String scalingBindIds,
|
|
@RequestParam(value = "scalingBindIds", required = false) String scalingBindIds,
|
|
- @RequestParam(value = "openTime", required = false) Integer openTime) {
|
|
|
|
|
|
+ @RequestParam(value = "openTime", required = false) Integer openTime,
|
|
|
|
+ @RequestParam(value = "openTimeCn", required = false) Integer openTimeCn) {
|
|
//参数校验
|
|
//参数校验
|
|
AssertUtil.notEmpty(applyIds, "绑定id不能为空");
|
|
AssertUtil.notEmpty(applyIds, "绑定id不能为空");
|
|
AssertUtil.notFormatFrontIds(applyIds, "applyIds格式错误,请重试");
|
|
AssertUtil.notFormatFrontIds(applyIds, "applyIds格式错误,请重试");
|
|
@@ -342,40 +418,41 @@ public class AdminStoreAuditController {
|
|
StoreGrade storeGrade = storeGradeModel.getStoreGradeByGradeId(storeApply.getStoreGradeId());
|
|
StoreGrade storeGrade = storeGradeModel.getStoreGradeByGradeId(storeApply.getStoreGradeId());
|
|
|
|
|
|
vo = new RegisterPayVO(storeGrade, storeApply);
|
|
vo = new RegisterPayVO(storeGrade, storeApply);
|
|
- //获取经营类目信息
|
|
|
|
- StoreBindCategoryExample storeBindCategoryExample = new StoreBindCategoryExample();
|
|
|
|
- storeBindCategoryExample.setCreateVendorId(storeApply.getVendorId());
|
|
|
|
- List<StoreBindCategory> storeBindCategoryList = storeBindCategoryModel.getStoreBindCategoryList(storeBindCategoryExample, null);
|
|
|
|
- List<StoreGoodsCateVO> storeGoodsCateVOList = new ArrayList<>();
|
|
|
|
- if (!CollectionUtils.isEmpty(storeBindCategoryList)) {
|
|
|
|
- for (StoreBindCategory storeBindCategory : storeBindCategoryList) {
|
|
|
|
- StoreGoodsCateVO storeGoodsCateVO = new StoreGoodsCateVO(storeBindCategory);
|
|
|
|
- GoodsCategory goodsCategory1 = goodsCategoryModel.getGoodsCategoryByCategoryId(storeBindCategory.getGoodsCategoryId1());
|
|
|
|
- if (goodsCategory1 == null) {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- storeGoodsCateVO.setGoodsCateName1(goodsCategory1.getCategoryName());
|
|
|
|
- GoodsCategory goodsCategory2 = goodsCategoryModel.getGoodsCategoryByCategoryId(storeBindCategory.getGoodsCategoryId2());
|
|
|
|
- if (goodsCategory2 == null) {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- storeGoodsCateVO.setGoodsCateName2(goodsCategory2.getCategoryName());
|
|
|
|
- GoodsCategory goodsCategory3 = goodsCategoryModel.getGoodsCategoryByCategoryId(storeBindCategory.getGoodsCategoryId3());
|
|
|
|
- if (goodsCategory3 == null) {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- storeGoodsCateVO.setGoodsCateName3(goodsCategory3.getCategoryName());
|
|
|
|
- storeGoodsCateVOList.add(storeGoodsCateVO);
|
|
|
|
- }
|
|
|
|
- vo.setStoreGoodsCateVOList(storeGoodsCateVOList);
|
|
|
|
- }
|
|
|
|
|
|
+// //获取经营类目信息
|
|
|
|
+// StoreBindCategoryExample storeBindCategoryExample = new StoreBindCategoryExample();
|
|
|
|
+// storeBindCategoryExample.setCreateVendorId(storeApply.getVendorId());
|
|
|
|
+// List<StoreBindCategory> storeBindCategoryList = storeBindCategoryModel.getStoreBindCategoryList(storeBindCategoryExample, null);
|
|
|
|
+// List<StoreGoodsCateVO> storeGoodsCateVOList = new ArrayList<>();
|
|
|
|
+// if (!CollectionUtils.isEmpty(storeBindCategoryList)) {
|
|
|
|
+// for (StoreBindCategory storeBindCategory : storeBindCategoryList) {
|
|
|
|
+// StoreGoodsCateVO storeGoodsCateVO = new StoreGoodsCateVO(storeBindCategory);
|
|
|
|
+// GoodsCategory goodsCategory1 = goodsCategoryModel.getGoodsCategoryByCategoryId(storeBindCategory.getGoodsCategoryId1());
|
|
|
|
+// if (goodsCategory1 == null) {
|
|
|
|
+// continue;
|
|
|
|
+// }
|
|
|
|
+// storeGoodsCateVO.setGoodsCateName1(goodsCategory1.getCategoryName());
|
|
|
|
+// GoodsCategory goodsCategory2 = goodsCategoryModel.getGoodsCategoryByCategoryId(storeBindCategory.getGoodsCategoryId2());
|
|
|
|
+// if (goodsCategory2 == null) {
|
|
|
|
+// continue;
|
|
|
|
+// }
|
|
|
|
+// storeGoodsCateVO.setGoodsCateName2(goodsCategory2.getCategoryName());
|
|
|
|
+// GoodsCategory goodsCategory3 = goodsCategoryModel.getGoodsCategoryByCategoryId(storeBindCategory.getGoodsCategoryId3());
|
|
|
|
+// if (goodsCategory3 == null) {
|
|
|
|
+// continue;
|
|
|
|
+// }
|
|
|
|
+// storeGoodsCateVO.setGoodsCateName3(goodsCategory3.getCategoryName());
|
|
|
|
+// storeGoodsCateVOList.add(storeGoodsCateVO);
|
|
|
|
+// }
|
|
|
|
+// vo.setStoreGoodsCateVOList(storeGoodsCateVOList);
|
|
|
|
+// }
|
|
|
|
|
|
if (isPass) {
|
|
if (isPass) {
|
|
// 店铺审核增加开店时长
|
|
// 店铺审核增加开店时长
|
|
- if (!StringUtil.isNullOrZero(openTime)) {
|
|
|
|
|
|
+ if (!StringUtil.isNullOrZero(openTime) && !StringUtil.isNullOrZero(openTimeCn)) {
|
|
storeApply.setApplyYear(openTime);
|
|
storeApply.setApplyYear(openTime);
|
|
|
|
+ storeApply.setApplyYearCn(openTimeCn);
|
|
}else{
|
|
}else{
|
|
- AssertUtil.isTrue(StringUtil.isNullOrZero(openTime), "请选择开店时长");
|
|
|
|
|
|
+ throw new MallException("请选择开店时长");
|
|
}
|
|
}
|
|
int count = storeModel.openStore(storeApply);
|
|
int count = storeModel.openStore(storeApply);
|
|
total += count;
|
|
total += count;
|