Browse Source

支持多商家

multiwx
xh-pan1 3 years ago
parent
commit
4c1dcb774b
  1. 165
      cereshop-admin/src/main/java/com/shop/cereshop/admin/controller/BusinessController.java
  2. 5
      cereshop-admin/src/main/java/com/shop/cereshop/admin/controller/ClassifyController.java
  3. 8
      cereshop-admin/src/main/java/com/shop/cereshop/admin/controller/DiscountController.java
  4. 10
      cereshop-admin/src/main/java/com/shop/cereshop/admin/controller/FinanceController.java
  5. 1
      cereshop-admin/src/main/java/com/shop/cereshop/admin/controller/LiveProductController.java
  6. 1
      cereshop-admin/src/main/java/com/shop/cereshop/admin/controller/SeckillController.java
  7. 8
      cereshop-admin/src/main/java/com/shop/cereshop/admin/controller/ShopCheckController.java
  8. 45
      cereshop-admin/src/main/java/com/shop/cereshop/admin/controller/ShopController.java
  9. 6
      cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/business/CereBusinessUserDAO.java
  10. 58
      cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/business/CerePlatformBusinessDAO.java
  11. 35
      cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/business/CerePlatformBusinessUserDAO.java
  12. 2
      cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/permission/CerePlatformPermissionDAO.java
  13. 7
      cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/product/CereProductClassifyDAO.java
  14. 6
      cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/shop/CerePlatformShopDAO.java
  15. 5
      cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/shop/CereShopCheckDAO.java
  16. 4
      cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/shop/CereShopEnterpriseDAO.java
  17. 4
      cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/shop/CereShopIndividualBusinessesDAO.java
  18. 4
      cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/shop/CereShopOtherOrganizationsDAO.java
  19. 4
      cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/shop/CereShopPersonalDAO.java
  20. 192
      cereshop-admin/src/main/java/com/shop/cereshop/admin/page/business/Business.java
  21. 39
      cereshop-admin/src/main/java/com/shop/cereshop/admin/page/business/BusinessGetAll.java
  22. 65
      cereshop-admin/src/main/java/com/shop/cereshop/admin/page/product/ProductClassify.java
  23. 6
      cereshop-admin/src/main/java/com/shop/cereshop/admin/page/shop/ShopGetAll.java
  24. 57
      cereshop-admin/src/main/java/com/shop/cereshop/admin/param/business/BusinessGetAllParam.java
  25. 24
      cereshop-admin/src/main/java/com/shop/cereshop/admin/param/business/BusinessGetByIdParam.java
  26. 92
      cereshop-admin/src/main/java/com/shop/cereshop/admin/param/business/BusinessSaveParam.java
  27. 30
      cereshop-admin/src/main/java/com/shop/cereshop/admin/param/business/BusinessStartParam.java
  28. 96
      cereshop-admin/src/main/java/com/shop/cereshop/admin/param/business/BusinessUpdateParam.java
  29. 4
      cereshop-admin/src/main/java/com/shop/cereshop/admin/param/product/ClassifyLevelParam.java
  30. 45
      cereshop-admin/src/main/java/com/shop/cereshop/admin/param/shop/ShopSaveParam.java
  31. 57
      cereshop-admin/src/main/java/com/shop/cereshop/admin/param/shop/ShopUpdateParam.java
  32. 8
      cereshop-admin/src/main/java/com/shop/cereshop/admin/param/shopcheck/CheckGetAllParam.java
  33. 4
      cereshop-admin/src/main/java/com/shop/cereshop/admin/param/shopcheck/CheckGetByIdParam.java
  34. 6
      cereshop-admin/src/main/java/com/shop/cereshop/admin/param/shopcheck/CheckHandleParam.java
  35. 6
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/CereBusinessUserService.java
  36. 46
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/CerePlatformBusinessService.java
  37. 23
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/CerePlatformBusinessUserService.java
  38. 6
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/CereShopEnterpriseService.java
  39. 6
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/CereShopIndividualBusinessesService.java
  40. 6
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/CereShopOtherOrganizationsService.java
  41. 6
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/CereShopPersonalService.java
  42. 14
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/impl/CereBusinessUserServiceImpl.java
  43. 252
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/impl/CerePlatformBusinessServiceImpl.java
  44. 48
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/impl/CerePlatformBusinessUserServiceImpl.java
  45. 10
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/impl/CereShopEnterpriseServiceImpl.java
  46. 10
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/impl/CereShopIndividualBusinessesServiceImpl.java
  47. 10
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/impl/CereShopOtherOrganizationsServiceImpl.java
  48. 10
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/impl/CereShopPersonalServiceImpl.java
  49. 14
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/permission/impl/CereBusinessPermissionServiceImpl.java
  50. 2
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/permission/impl/CerePlatformPermissionServiceImpl.java
  51. 4
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/product/CereProductClassifyService.java
  52. 81
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/product/impl/CereProductClassifyServiceImpl.java
  53. 18
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/sharesetting/impl/CerePlatformShareSettingServiceImpl.java
  54. 2
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/shop/CerePlatformShopService.java
  55. 3
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/shop/CereShopCheckService.java
  56. 107
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/shop/impl/CerePlatformShopServiceImpl.java
  57. 184
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/shop/impl/CereShopCheckServiceImpl.java
  58. 28
      cereshop-admin/src/main/resources/mybatis/mapper/business/CereBusinessUserDAO.xml
  59. 582
      cereshop-admin/src/main/resources/mybatis/mapper/business/CerePlatformBusinessDAO.xml
  60. 176
      cereshop-admin/src/main/resources/mybatis/mapper/business/CerePlatformBusinessUserDAO.xml
  61. 2
      cereshop-admin/src/main/resources/mybatis/mapper/permission/CerePlatformPermissionDAO.xml
  62. 38
      cereshop-admin/src/main/resources/mybatis/mapper/product/CereProductClassifyDAO.xml
  63. 44
      cereshop-admin/src/main/resources/mybatis/mapper/shop/CerePlatformShopDAO.xml
  64. 28
      cereshop-admin/src/main/resources/mybatis/mapper/shop/CereShopCheckDAO.xml
  65. 18
      cereshop-admin/src/main/resources/mybatis/mapper/shop/CereShopEnterpriseDAO.xml
  66. 18
      cereshop-admin/src/main/resources/mybatis/mapper/shop/CereShopIndividualBusinessesDAO.xml
  67. 18
      cereshop-admin/src/main/resources/mybatis/mapper/shop/CereShopOtherOrganizationsDAO.xml
  68. 18
      cereshop-admin/src/main/resources/mybatis/mapper/shop/CereShopPersonalDAO.xml
  69. 5
      cereshop-app/src/main/java/com/shop/cereshop/app/controller/index/LoginController.java
  70. 99
      cereshop-app/src/main/java/com/shop/cereshop/app/controller/shop/ShopCheckController.java
  71. 6
      cereshop-app/src/main/java/com/shop/cereshop/app/dao/business/CereBusinessUserDAO.java
  72. 22
      cereshop-app/src/main/java/com/shop/cereshop/app/dao/business/CerePlatformBusinessDAO.java
  73. 28
      cereshop-app/src/main/java/com/shop/cereshop/app/dao/business/CerePlatformBusinessUserDAO.java
  74. 6
      cereshop-app/src/main/java/com/shop/cereshop/app/dao/business/CereShopEnterpriseDAO.java
  75. 6
      cereshop-app/src/main/java/com/shop/cereshop/app/dao/business/CereShopIndividualBusinessesDAO.java
  76. 6
      cereshop-app/src/main/java/com/shop/cereshop/app/dao/business/CereShopOtherOrganizationsDAO.java
  77. 6
      cereshop-app/src/main/java/com/shop/cereshop/app/dao/business/CereShopPersonalDAO.java
  78. 16
      cereshop-app/src/main/java/com/shop/cereshop/app/dao/buyer/CereBuyerUserDAO.java
  79. 9
      cereshop-app/src/main/java/com/shop/cereshop/app/dao/product/CereProductClassifyDAO.java
  80. 2
      cereshop-app/src/main/java/com/shop/cereshop/app/dao/shop/CerePlatformShopDAO.java
  81. 17
      cereshop-app/src/main/java/com/shop/cereshop/app/dao/shop/CereShopCheckDAO.java
  82. 34
      cereshop-app/src/main/java/com/shop/cereshop/app/interceptor/AuthorizationInterceptor.java
  83. 3
      cereshop-app/src/main/java/com/shop/cereshop/app/page/index/Index.java
  84. 30
      cereshop-app/src/main/java/com/shop/cereshop/app/page/index/ProductClassify.java
  85. 6
      cereshop-app/src/main/java/com/shop/cereshop/app/page/settlement/SettlementShop.java
  86. 4
      cereshop-app/src/main/java/com/shop/cereshop/app/page/shop/PlatformShop.java
  87. 7
      cereshop-app/src/main/java/com/shop/cereshop/app/param/classify/ClassifyProductParam.java
  88. 2
      cereshop-app/src/main/java/com/shop/cereshop/app/param/shop/CereShopEnterpriseParam.java
  89. 2
      cereshop-app/src/main/java/com/shop/cereshop/app/param/shop/CereShopIndividualBusinessesParam.java
  90. 2
      cereshop-app/src/main/java/com/shop/cereshop/app/param/shop/CereShopOtherOrganizationsParam.java
  91. 2
      cereshop-app/src/main/java/com/shop/cereshop/app/param/shop/CereShopPersonalParam.java
  92. 77
      cereshop-app/src/main/java/com/shop/cereshop/app/pay/xs/service/impl/XsPayServiceImpl.java
  93. 6
      cereshop-app/src/main/java/com/shop/cereshop/app/service/business/CereBusinessUserService.java
  94. 17
      cereshop-app/src/main/java/com/shop/cereshop/app/service/business/CerePlatformBusinessService.java
  95. 17
      cereshop-app/src/main/java/com/shop/cereshop/app/service/business/CerePlatformBusinessUserService.java
  96. 14
      cereshop-app/src/main/java/com/shop/cereshop/app/service/business/impl/CereBusinessUserServiceImpl.java
  97. 57
      cereshop-app/src/main/java/com/shop/cereshop/app/service/business/impl/CerePlatformBusinessServiceImpl.java
  98. 35
      cereshop-app/src/main/java/com/shop/cereshop/app/service/business/impl/CerePlatformBusinessUserServiceImpl.java
  99. 2
      cereshop-app/src/main/java/com/shop/cereshop/app/service/buyer/CereBuyerUserService.java
  100. 41
      cereshop-app/src/main/java/com/shop/cereshop/app/service/buyer/impl/CereBuyerUserServiceImpl.java

165
cereshop-admin/src/main/java/com/shop/cereshop/admin/controller/BusinessController.java

@ -0,0 +1,165 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.admin.controller;
import com.shop.cereshop.admin.annotation.NoRepeatSubmit;
import com.shop.cereshop.admin.annotation.NoRepeatWebLog;
import com.shop.cereshop.admin.page.business.BusinessGetAll;
import com.shop.cereshop.admin.param.business.*;
import com.shop.cereshop.admin.service.business.CerePlatformBusinessService;
import com.shop.cereshop.admin.service.business.CerePlatformBusinessUserService;
import com.shop.cereshop.admin.utils.ContextUtil;
import com.shop.cereshop.commons.constant.CoReturnFormat;
import com.shop.cereshop.commons.domain.business.CerePlatformBusiness;
import com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser;
import com.shop.cereshop.commons.domain.common.Page;
import com.shop.cereshop.commons.domain.user.CerePlatformUser;
import com.shop.cereshop.commons.exception.CoBusinessException;
import com.shop.cereshop.commons.result.Result;
import com.shop.cereshop.commons.utils.GsonUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
/**
* 商家
*/
@RestController
@RequestMapping("business")
/**
* 注解方式生成日志对象指定topic生成对象类名
*/
@Slf4j(topic = "BusinessController")
@Api(value = "商家模块", tags = "商家模块")
public class BusinessController {
@Autowired
private CerePlatformBusinessService cerePlatformBusinessService;
@Autowired
private CerePlatformBusinessUserService cerePlatformBusinessUserService;
/**
* 新建商家
* @param param
* @return
*/
@PostMapping(value = "save")
@NoRepeatSubmit
@ApiOperation(value = "新建商家")
@NoRepeatWebLog
public Result save(@RequestBody @Validated BusinessSaveParam param, HttpServletRequest request) throws CoBusinessException{
//校验商家名称是否存在
CerePlatformBusiness business= cerePlatformBusinessService.findByBusinessName(param.getBusinessName());
if(business!=null){
return new Result(CoReturnFormat.SHOP_NAME_ALREADY);
}
CerePlatformBusiness platformShop=cerePlatformBusinessService.findByBusinessPhone(param.getBusinessPhone());
if(platformShop!=null){
return new Result(CoReturnFormat.SHOP_PHONE_ALREADY);
}
//校验手机号是否已注册
CerePlatformBusinessUser cerePlatformBusinessUser= cerePlatformBusinessUserService.findByUserName(param.getBusinessPhone());
if(cerePlatformBusinessUser!=null){
return new Result(CoReturnFormat.SHOP_PHONE_ALREADY);
}
//获取当前登录账户
CerePlatformUser user = (CerePlatformUser) request.getAttribute("user");
cerePlatformBusinessService.save(param,user);
return new Result(user.getUsername(),"新建商家", GsonUtil.objectToGson(param));
}
/**
* 修改商家
* @param param
* @return
*/
@PostMapping(value = "update")
@NoRepeatSubmit
@ApiOperation(value = "修改商家")
@NoRepeatWebLog
public Result update(@RequestBody BusinessUpdateParam param, HttpServletRequest request) throws CoBusinessException{
//校验商家名称是否存在
CerePlatformBusiness business= cerePlatformBusinessService.checkBusinessIdByName(param.getBusinessName(),param.getBusinessId());
if(business!=null){
return new Result(CoReturnFormat.SHOP_NAME_ALREADY);
}
CerePlatformBusiness platformShop=cerePlatformBusinessService.checkBusinessIdByPhone(param.getBusinessPhone(),param.getBusinessId());
if(platformShop!=null){
return new Result(CoReturnFormat.SHOP_PHONE_ALREADY);
}
//校验手机号是否已注册
CerePlatformBusinessUser businessUser = cerePlatformBusinessUserService.checkUserName(param.getBusinessPhone(),param.getBusinessId());
if(businessUser!=null){
return new Result(CoReturnFormat.SHOP_PHONE_ALREADY);
}
//获取当前登录账户
CerePlatformUser user = (CerePlatformUser) request.getAttribute("user");
cerePlatformBusinessService.update(param,user);
return new Result(user.getUsername(),"修改商家", GsonUtil.objectToGson(param));
}
/**
* 启停用
* @param param
* @return
*/
@PostMapping(value = "start")
@NoRepeatSubmit
@ApiOperation(value = "启停用")
@NoRepeatWebLog
public Result start(@RequestBody BusinessStartParam param, HttpServletRequest request) throws CoBusinessException{
//获取当前登录账户
CerePlatformUser user = (CerePlatformUser) request.getAttribute("user");
cerePlatformBusinessService.startOrStop(param,user);
return new Result(user.getUsername(),"启停用", GsonUtil.objectToGson(param));
}
/**
* 商家编辑查询
* @param param
* @return
*/
@PostMapping(value = "getById")
@ApiOperation(value = "商家编辑查询")
public Result<BusinessGetAll> getById(@RequestBody BusinessGetByIdParam param) throws CoBusinessException,Exception{
BusinessGetAll business= cerePlatformBusinessService.getById(param.getBusinessId());
return new Result(business);
}
/**
* 商家管理查询
* @param param
* @return
*/
@PostMapping(value = "getAll")
@ApiOperation(value = "商家管理查询")
public Result<Page<BusinessGetAll>> getAll(@RequestBody BusinessGetAllParam param) throws CoBusinessException{
Page page= cerePlatformBusinessService.getAll(param);
return new Result(page);
}
/**
* 注销商家数据
* @param param
* @return
*/
@PostMapping(value = "cleanShop")
@ApiOperation(value = "注销商家数据")
public Result<Boolean> cleanShop(@RequestBody BusinessGetByIdParam param) throws CoBusinessException{
ContextUtil.interceptDelete();
Boolean result = cerePlatformBusinessService.cleanShop(param.getBusinessId());
return new Result(result);
}
}

5
cereshop-admin/src/main/java/com/shop/cereshop/admin/controller/ClassifyController.java

@ -8,7 +8,6 @@ package com.shop.cereshop.admin.controller;
import com.shop.cereshop.admin.annotation.NoRepeatSubmit;
import com.shop.cereshop.admin.annotation.NoRepeatWebLog;
import com.shop.cereshop.admin.page.product.ProductClassify;
import com.shop.cereshop.admin.param.product.ClassifyDeleteParam;
import com.shop.cereshop.admin.param.product.ClassifyGetAllParam;
import com.shop.cereshop.admin.param.product.ClassifyGetByIdParam;
@ -99,8 +98,8 @@ public class ClassifyController {
*/
@PostMapping(value = "getById")
@ApiOperation(value = "商品类别编辑查询")
public Result<ProductClassify> getById(@RequestBody ClassifyGetByIdParam param) throws CoBusinessException{
ProductClassify classify=cereProductClassifyService.getById(param.getOneClassifyId());
public Result<CereProductClassify> getById(@RequestBody ClassifyGetByIdParam param) throws CoBusinessException{
CereProductClassify classify=cereProductClassifyService.getById(param.getOneClassifyId());
return new Result(classify);
}

8
cereshop-admin/src/main/java/com/shop/cereshop/admin/controller/DiscountController.java

@ -11,18 +11,10 @@ import com.shop.cereshop.admin.page.discount.Discount;
import com.shop.cereshop.admin.page.discount.DiscountData;
import com.shop.cereshop.admin.page.discount.DiscountShop;
import com.shop.cereshop.admin.page.discount.DiscountShopProduct;
import com.shop.cereshop.admin.page.seckill.Seckill;
import com.shop.cereshop.admin.page.seckill.SeckillData;
import com.shop.cereshop.admin.page.seckill.SeckillShop;
import com.shop.cereshop.admin.page.seckill.SeckillShopProduct;
import com.shop.cereshop.admin.param.discount.*;
import com.shop.cereshop.admin.param.seckill.*;
import com.shop.cereshop.admin.service.platformtool.CerePlatformDiscountService;
import com.shop.cereshop.admin.service.platformtool.CerePlatformSeckillService;
import com.shop.cereshop.commons.domain.business.CerePlatformBusiness;
import com.shop.cereshop.commons.domain.common.Page;
import com.shop.cereshop.commons.domain.platformtool.CerePlatformDiscount;
import com.shop.cereshop.commons.domain.platformtool.CerePlatformSeckill;
import com.shop.cereshop.commons.domain.shop.ShopDataDetail;
import com.shop.cereshop.commons.domain.user.CerePlatformUser;
import com.shop.cereshop.commons.exception.CoBusinessException;

10
cereshop-admin/src/main/java/com/shop/cereshop/admin/controller/FinanceController.java

@ -7,14 +7,10 @@ package com.shop.cereshop.admin.controller;
import com.shop.cereshop.admin.page.finance.BondCount;
import com.shop.cereshop.admin.page.finance.FinanceCount;
import com.shop.cereshop.admin.page.finance.ShopBond;
import com.shop.cereshop.admin.param.finance.BondParam;
import com.shop.cereshop.admin.param.finance.FinanceParam;
import com.shop.cereshop.admin.service.activity.CereActivitySignService;
import com.shop.cereshop.admin.service.shop.CerePlatformShopService;
import com.shop.cereshop.commons.constant.CoReturnFormat;
import com.shop.cereshop.commons.domain.activity.CereActivitySign;
import com.shop.cereshop.commons.domain.common.Page;
import com.shop.cereshop.admin.service.business.CerePlatformBusinessService;
import com.shop.cereshop.commons.exception.CoBusinessException;
import com.shop.cereshop.commons.result.Result;
import io.swagger.annotations.Api;
@ -36,7 +32,7 @@ import org.springframework.web.bind.annotation.*;
public class FinanceController {
@Autowired
private CerePlatformShopService cerePlatformShopService;
private CerePlatformBusinessService cerePlatformBusinessService;
@Autowired
private CereActivitySignService cereActivitySignService;
@ -48,7 +44,7 @@ public class FinanceController {
@PostMapping(value = "getAllFinance")
@ApiOperation(value = "财务管理查询")
public Result<FinanceCount> getAllFinance(@RequestBody FinanceParam param) throws CoBusinessException{
FinanceCount count =cerePlatformShopService.getAllFinance(param);
FinanceCount count = cerePlatformBusinessService.getAllFinance(param);
return new Result(count);
}

1
cereshop-admin/src/main/java/com/shop/cereshop/admin/controller/LiveProductController.java

@ -10,7 +10,6 @@ import com.shop.cereshop.admin.annotation.NoRepeatWebLog;
import com.shop.cereshop.admin.param.live.LiveProductGetAllParam;
import com.shop.cereshop.admin.param.live.LiveProductParam;
import com.shop.cereshop.admin.service.live.CereLiveProductService;
import com.shop.cereshop.commons.domain.business.CerePlatformBusiness;
import com.shop.cereshop.commons.domain.common.Page;
import com.shop.cereshop.commons.domain.live.CereLiveProduct;
import com.shop.cereshop.commons.domain.user.CerePlatformUser;

1
cereshop-admin/src/main/java/com/shop/cereshop/admin/controller/SeckillController.java

@ -10,7 +10,6 @@ import com.shop.cereshop.admin.annotation.NoRepeatWebLog;
import com.shop.cereshop.admin.page.seckill.*;
import com.shop.cereshop.admin.param.seckill.*;
import com.shop.cereshop.admin.service.platformtool.CerePlatformSeckillService;
import com.shop.cereshop.commons.domain.business.CerePlatformBusiness;
import com.shop.cereshop.commons.domain.common.Page;
import com.shop.cereshop.commons.domain.platformtool.CerePlatformSeckill;
import com.shop.cereshop.commons.domain.shop.ShopDataDetail;

8
cereshop-admin/src/main/java/com/shop/cereshop/admin/controller/ShopCheckController.java

@ -7,7 +7,7 @@ package com.shop.cereshop.admin.controller;
import com.shop.cereshop.admin.annotation.NoRepeatSubmit;
import com.shop.cereshop.admin.annotation.NoRepeatWebLog;
import com.shop.cereshop.admin.page.shop.Shop;
import com.shop.cereshop.admin.page.business.Business;
import com.shop.cereshop.admin.param.shopcheck.CheckDeleteParam;
import com.shop.cereshop.admin.param.shopcheck.CheckGetAllParam;
import com.shop.cereshop.admin.param.shopcheck.CheckGetByIdParam;
@ -48,7 +48,7 @@ public class ShopCheckController {
*/
@PostMapping(value = "getAll")
@ApiOperation(value = "入驻申请管理查询")
public Result<Page<Shop>> getAll(@RequestBody CheckGetAllParam param) throws CoBusinessException{
public Result<Page<Business>> getAll(@RequestBody CheckGetAllParam param) throws CoBusinessException{
Page page=cereShopCheckService.getAll(param);
return new Result(page);
}
@ -60,8 +60,8 @@ public class ShopCheckController {
*/
@PostMapping(value = "getById")
@ApiOperation(value = "查看")
public Result<Shop> getById(@RequestBody CheckGetByIdParam param) throws CoBusinessException{
Shop shop=cereShopCheckService.getById(param.getShopId());
public Result<Business> getById(@RequestBody CheckGetByIdParam param) throws CoBusinessException{
Business shop=cereShopCheckService.getById(param.getBusinessId());
return new Result(shop);
}

45
cereshop-admin/src/main/java/com/shop/cereshop/admin/controller/ShopController.java

@ -31,7 +31,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
/**
* 商家
* 店铺
*/
@RestController
@RequestMapping("shop")
@ -39,62 +39,47 @@ import javax.servlet.http.HttpServletRequest;
* 注解方式生成日志对象指定topic生成对象类名
*/
@Slf4j(topic = "ShopController")
@Api(value = "商家模块", tags = "商家模块")
@Api(value = "店铺模块", tags = "店铺模块")
public class ShopController {
@Autowired
private CerePlatformShopService cerePlatformShopService;
/**
* 新建商家
* 新建店铺
* @param param
* @return
*/
@PostMapping(value = "save")
@NoRepeatSubmit
@ApiOperation(value = "新建商家")
@ApiOperation(value = "新建店铺")
@NoRepeatWebLog
public Result save(@RequestBody @Validated ShopSaveParam param, HttpServletRequest request) throws CoBusinessException{
//校验商家名称是否存在
CerePlatformShop shop=cerePlatformShopService.findByShopName(param.getShopName());
if(shop!=null){
return new Result(CoReturnFormat.SHOP_NAME_ALREADY);
}
//校验手机号是否已注册
CerePlatformShop platformShop=cerePlatformShopService.findByPhone(param.getShopPhone());
if(platformShop!=null){
return new Result(CoReturnFormat.SHOP_PHONE_ALREADY);
}
//获取当前登录账户
CerePlatformUser user = (CerePlatformUser) request.getAttribute("user");
cerePlatformShopService.save(param,user);
return new Result(user.getUsername(),"新建商家", GsonUtil.objectToGson(param));
return new Result(user.getUsername(),"新建店铺", GsonUtil.objectToGson(param));
}
/**
* 修改商家
* 修改店铺
* @param param
* @return
*/
@PostMapping(value = "update")
@NoRepeatSubmit
@ApiOperation(value = "修改商家")
@ApiOperation(value = "修改店铺")
@NoRepeatWebLog
public Result update(@RequestBody ShopUpdateParam param, HttpServletRequest request) throws CoBusinessException{
//校验商家名称是否存在
//校验店铺名称是否存在
CerePlatformShop shop=cerePlatformShopService.checkShopIdByName(param.getShopName(),param.getShopId());
if(shop!=null){
return new Result(CoReturnFormat.SHOP_NAME_ALREADY);
}
//校验手机号是否已注册
CerePlatformShop platformShop=cerePlatformShopService.checkShopIdByPhone(param.getShopPhone(),param.getShopId());
if(platformShop!=null){
return new Result(CoReturnFormat.SHOP_PHONE_ALREADY);
}
//获取当前登录账户
CerePlatformUser user = (CerePlatformUser) request.getAttribute("user");
cerePlatformShopService.update(param,user);
return new Result(user.getUsername(),"修改商家", GsonUtil.objectToGson(param));
return new Result(user.getUsername(),"修改店铺", GsonUtil.objectToGson(param));
}
/**
@ -114,36 +99,36 @@ public class ShopController {
}
/**
* 商家编辑查询
* 店铺编辑查询
* @param param
* @return
*/
@PostMapping(value = "getById")
@ApiOperation(value = "商家编辑查询")
@ApiOperation(value = "店铺编辑查询")
public Result<ShopGetAll> getById(@RequestBody ShopGetByIdParam param) throws CoBusinessException,Exception{
ShopGetAll shop=cerePlatformShopService.getById(param.getShopId());
return new Result(shop);
}
/**
* 商家管理查询
* 店铺管理查询
* @param param
* @return
*/
@PostMapping(value = "getAll")
@ApiOperation(value = "商家管理查询")
@ApiOperation(value = "店铺管理查询")
public Result<Page<ShopGetAll>> getAll(@RequestBody ShopGetAllParam param) throws CoBusinessException{
Page page=cerePlatformShopService.getAll(param);
return new Result(page);
}
/**
* 注销商家数据
* 注销店铺数据
* @param param
* @return
*/
@PostMapping(value = "cleanShop")
@ApiOperation(value = "注销商家数据")
@ApiOperation(value = "注销店铺数据")
public Result<Boolean> cleanShop(@RequestBody ShopGetByIdParam param) throws CoBusinessException{
ContextUtil.interceptDelete();
Boolean result = cerePlatformShopService.cleanShop(param.getShopId());

6
cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/business/CereBusinessShopDAO.java → cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/business/CereBusinessUserDAO.java

@ -5,16 +5,16 @@
*/
package com.shop.cereshop.admin.dao.business;
import com.shop.cereshop.commons.domain.business.CereBusinessShop;
import com.shop.cereshop.commons.domain.business.CereBusinessUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface CereBusinessShopDAO extends BaseMapper<CereBusinessShop> {
public interface CereBusinessUserDAO extends BaseMapper<CereBusinessUser> {
int insertSelective(CereBusinessShop record);
int insertSelective(CereBusinessUser record);
List<Long> selectAllProject();
}

58
cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/business/CerePlatformBusinessDAO.java

@ -5,23 +5,65 @@
*/
package com.shop.cereshop.admin.dao.business;
import com.shop.cereshop.commons.domain.business.CerePlatformBusiness;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shop.cereshop.admin.page.business.Business;
import com.shop.cereshop.admin.page.business.BusinessGetAll;
import com.shop.cereshop.admin.page.finance.Finance;
import com.shop.cereshop.admin.param.business.BusinessGetAllParam;
import com.shop.cereshop.admin.param.finance.FinanceParam;
import com.shop.cereshop.commons.domain.business.CerePlatformBusiness;
import com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
@Mapper
public interface CerePlatformBusinessDAO extends BaseMapper<CerePlatformBusiness> {
int deleteByPrimaryKey(Long businessUserId);
int insertSelective(CerePlatformBusiness record);
CerePlatformBusiness findByBusinessName(@Param("businessName") String businessName);
CerePlatformBusiness findByBusinessPhone(@Param("businessPhone") String businessPhone);
CerePlatformBusiness checkBusinessIdByName(@Param("businessName") String businessName,@Param("businessId") Long businessId);
CerePlatformBusiness checkBusinessIdByPhone(@Param("businessPhone") String businessPhone,@Param("businessId") Long businessId);
CerePlatformBusinessUser findBusinessUserByBusinessId(@Param("businessId") Long businessId);
BusinessGetAll getById(@Param("businessId") Long businessId);
List<BusinessGetAll> getAll(BusinessGetAllParam param);
Business findBusiness(@Param("businessId") Long businessId);
void updateDate(CerePlatformBusiness CerePlatformBusiness);
List<Finance> getAllFinance(FinanceParam param);
BigDecimal finFrozen(@Param("businessId") Long businessId);
BigDecimal findHaveWithdrawal(@Param("businessId") Long businessId);
BigDecimal findRefund(@Param("businessId") Long businessId);
BigDecimal findRevenue();
BigDecimal getAllWithdrawableMoney();
BigDecimal getWithdrawableStayMoney();
Long findBusinessUserId(@Param("businessId") Long businessId);
CerePlatformBusiness selectByPrimaryKey(Long businessUserId);
List<CerePlatformBusiness> findAll();
int updateByPrimaryKeySelective(CerePlatformBusiness record);
void updateBusinessStop(CerePlatformBusiness business);
int updateByPrimaryKey(CerePlatformBusiness record);
/** 查询商家提现中的金额 */
BigDecimal findWithdrawing(Long businessId);
Long findProjectByUsername(String username);
Boolean cleanShop(Long businessId);
CerePlatformBusiness findByPhone(String phone);
List<CerePlatformBusiness> getByIdList(@Param("businessIdList") List<Long> businessIdList);
}

35
cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/business/CerePlatformBusinessUserDAO.java

@ -0,0 +1,35 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.admin.dao.business;
import com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface CerePlatformBusinessUserDAO extends BaseMapper<CerePlatformBusinessUser> {
int deleteByPrimaryKey(Long businessUserId);
int insertSelective(CerePlatformBusinessUser record);
CerePlatformBusinessUser selectByPrimaryKey(Long businessUserId);
int updateByPrimaryKeySelective(CerePlatformBusinessUser record);
int updateByPrimaryKey(CerePlatformBusinessUser record);
Long findBusinessByUsername(String username);
CerePlatformBusinessUser findByPhone(String phone);
CerePlatformBusinessUser findByUserName(String username);
CerePlatformBusinessUser checkUserName(@Param("username") String username, @Param("businessUserId") Long businessUserId);
CerePlatformBusinessUser checkPhone(@Param("phone") String phone, @Param("businessUserId") Long businessUserId);
}

2
cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/permission/CerePlatformPermissionDAO.java

@ -42,8 +42,6 @@ public interface CerePlatformPermissionDAO extends BaseMapper<CerePlatformPermis
List<MenuButton> findAllCatalogByResourceType(@Param("resourceType") String resourceType);
int findMaxSort();
List<CerePlatformPermission> findByPermissionAndProject(@Param("project") Long project,
@Param("permission") String permission,
@Param("resourceType") String resourceType);

7
cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/product/CereProductClassifyDAO.java

@ -5,7 +5,6 @@
*/
package com.shop.cereshop.admin.dao.product;
import com.shop.cereshop.admin.page.product.ProductClassify;
import com.shop.cereshop.commons.domain.product.CereProductClassify;
import com.shop.cereshop.commons.domain.product.CereShopProduct;
import com.shop.cereshop.commons.domain.product.Classify;
@ -27,13 +26,11 @@ public interface CereProductClassifyDAO extends BaseMapper<CereProductClassify>
int updateByPrimaryKey(CereProductClassify record);
CereProductClassify getById(@Param("classifyId") Long classifyId);
List<CereProductClassify> getAll();
List<CereShopProduct> checkProduct(@Param("classifyId") Long classifyId);
List<ProductClassify> findByPid(@Param("classifyId") Long classifyId);
List<CereProductClassify> findByPid(@Param("classifyId") Long classifyId);
void updateBatchLevelHierarchy(@Param("list") List<CereProductClassify> list);
@ -43,5 +40,5 @@ public interface CereProductClassifyDAO extends BaseMapper<CereProductClassify>
void deleteByIds(@Param("ids") List<Long> ids);
List<ProductClassify> findByIds(@Param("ids") List<Long> ids);
List<CereProductClassify> findByIds(@Param("ids") List<Long> ids);
}

6
cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/shop/CerePlatformShopDAO.java

@ -10,7 +10,7 @@ import com.shop.cereshop.admin.page.shop.Shop;
import com.shop.cereshop.admin.page.shop.ShopGetAll;
import com.shop.cereshop.admin.param.finance.FinanceParam;
import com.shop.cereshop.admin.param.shop.ShopGetAllParam;
import com.shop.cereshop.commons.domain.business.CerePlatformBusiness;
import com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser;
import com.shop.cereshop.commons.domain.shop.CerePlatformShop;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
@ -30,7 +30,7 @@ public interface CerePlatformShopDAO extends BaseMapper<CerePlatformShop> {
CerePlatformShop checkShopIdByPhone(@Param("shopPhone") String shopPhone,@Param("shopId") Long shopId);
CerePlatformBusiness findBusinessByShopId(@Param("shopId") Long shopId);
CerePlatformBusinessUser findBusinessByShopId(@Param("shopId") Long shopId);
ShopGetAll getById(@Param("shopId") Long shopId);
@ -56,7 +56,7 @@ public interface CerePlatformShopDAO extends BaseMapper<CerePlatformShop> {
Long findBusinessId(@Param("shopId") Long shopId);
CerePlatformBusiness findBusiness(@Param("businessUserId") Long businessUserId);
CerePlatformBusinessUser findBusiness(@Param("businessUserId") Long businessUserId);
List<CerePlatformShop> findAll();

5
cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/shop/CereShopCheckDAO.java

@ -6,6 +6,7 @@
package com.shop.cereshop.admin.dao.shop;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shop.cereshop.admin.page.business.Business;
import com.shop.cereshop.admin.page.shop.Shop;
import com.shop.cereshop.admin.param.shopcheck.CheckGetAllParam;
import com.shop.cereshop.commons.domain.shop.CereShopCheck;
@ -18,7 +19,7 @@ public interface CereShopCheckDAO extends BaseMapper<CereShopCheck> {
int insertSelective(CereShopCheck record);
List<Shop> getAll(CheckGetAllParam param);
List<Business> getAll(CheckGetAllParam param);
List<Shop> getStayAll(CheckGetAllParam param);
List<Business> getStayAll(CheckGetAllParam param);
}

4
cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/shop/CereShopEnterpriseDAO.java

@ -5,7 +5,7 @@
*/
package com.shop.cereshop.admin.dao.shop;
import com.shop.cereshop.commons.domain.shop.CereShopEnterprise;
import com.shop.cereshop.commons.domain.business.CereShopEnterprise;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -15,5 +15,5 @@ public interface CereShopEnterpriseDAO extends BaseMapper<CereShopEnterprise> {
int insertSelective(CereShopEnterprise record);
CereShopEnterprise findByShopId(@Param("shopId") Long shopId);
CereShopEnterprise findByBusinessId(@Param("businessId") Long businessId);
}

4
cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/shop/CereShopIndividualBusinessesDAO.java

@ -5,7 +5,7 @@
*/
package com.shop.cereshop.admin.dao.shop;
import com.shop.cereshop.commons.domain.shop.CereShopIndividualBusinesses;
import com.shop.cereshop.commons.domain.business.CereShopIndividualBusinesses;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -15,5 +15,5 @@ public interface CereShopIndividualBusinessesDAO extends BaseMapper<CereShopIndi
int insertSelective(CereShopIndividualBusinesses record);
CereShopIndividualBusinesses findByShopId(@Param("shopId") Long shopId);
CereShopIndividualBusinesses findByBusinessId(@Param("businessId") Long businessId);
}

4
cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/shop/CereShopOtherOrganizationsDAO.java

@ -5,7 +5,7 @@
*/
package com.shop.cereshop.admin.dao.shop;
import com.shop.cereshop.commons.domain.shop.CereShopOtherOrganizations;
import com.shop.cereshop.commons.domain.business.CereShopOtherOrganizations;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -15,5 +15,5 @@ public interface CereShopOtherOrganizationsDAO extends BaseMapper<CereShopOtherO
int insertSelective(CereShopOtherOrganizations record);
CereShopOtherOrganizations findByShopId(@Param("shopId") Long shopId);
CereShopOtherOrganizations findByBusinessId(@Param("businessId") Long businessId);
}

4
cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/shop/CereShopPersonalDAO.java

@ -5,7 +5,7 @@
*/
package com.shop.cereshop.admin.dao.shop;
import com.shop.cereshop.commons.domain.shop.CereShopPersonal;
import com.shop.cereshop.commons.domain.business.CereShopPersonal;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -15,5 +15,5 @@ public interface CereShopPersonalDAO extends BaseMapper<CereShopPersonal> {
int insertSelective(CereShopPersonal record);
CereShopPersonal findByShopId(@Param("shopId") Long shopId);
CereShopPersonal findByBusinessId(@Param("businessId") Long businessId);
}

192
cereshop-admin/src/main/java/com/shop/cereshop/admin/page/business/Business.java

@ -0,0 +1,192 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.admin.page.business;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* 商家信息返回数据实体类
*/
@Data
@ApiModel(value = "Business", description = "商家信息返回数据实体类")
public class Business {
/**
* 处理id
*/
@ApiModelProperty(value = "处理id ")
private Long checkId;
/**
* 商家id
*/
@ApiModelProperty(value = "商家id")
private Long businessId;
/**
* 入驻处理状态 0-未处理 1-通过 2-拒绝
*/
@ApiModelProperty(value = "入驻处理状态 0-未处理 1-通过 2-拒绝")
private Long checkState;
/**
* 商家名称
*/
@ApiModelProperty(value = "商家名称")
private String businessName;
/**
* 商家地址
*/
@ApiModelProperty(value = "商家地址")
private String businessAdress;
/**
* 商家手机号
*/
@ApiModelProperty(value = "商家手机号")
private String businessPhone;
/**
* 主体类型 1-个人 2-个体工商户 3-企业 4-其他组织
*/
@ApiModelProperty(value = "主体类型 1-个人 2-个体工商户 3-企业 4-其他组织")
private Integer authenType;
/**
* 商家负责人
*/
@ApiModelProperty(value = "商家负责人")
private String chargePersonName;
/**
* 负责人电话
*/
@ApiModelProperty(value = "负责人电话")
private String chargePersonPhone;
/**
* 申请时间
*/
@ApiModelProperty(value = "申请时间")
private String createTime;
/**
* 客服电话
*/
@ApiModelProperty(value = "客服电话")
private String servicePhone;
/**
* 姓名
*/
@ApiModelProperty(value = "姓名")
private String name;
/**
* 证件类型
*/
private Long cardType;
/**
* 证件类型名称
*/
@ApiModelProperty(value = "证件类型名称")
private String cardTypeName;
/**
* 身份证号
*/
@ApiModelProperty(value = "身份证号")
private String idCard;
/**
* 身份证有效期
*/
@ApiModelProperty(value = "身份证有效期")
private String cardTime;
/**
* 身份证正面照
*/
@ApiModelProperty(value = "身份证正面照")
private String cardPositive;
/**
* 身份证反面照
*/
@ApiModelProperty(value = "身份证反面照")
private String cardSide;
/**
* 手持证件照
*/
@ApiModelProperty(value = "手持证件照")
private String cardHand;
/**
* 生效日期
*/
@ApiModelProperty(value = "生效日期")
private String effectiveDate;
/**
* 生效时限
*/
@ApiModelProperty(value = "生效时限(年)")
private Integer effectiveYear;
/**
* 主体信息-商户名称
*/
@ApiModelProperty(value = "主体信息-商户名称")
private String subjectName;
/**
* 主体信息-统一社会信用代码
*/
@ApiModelProperty(value = "主体信息-统一社会信用代码")
private String subjectCode;
/**
* 主体信息-地址
*/
@ApiModelProperty(value = "主体信息-地址")
private String subjectAdress;
/**
* 主体信息-详细地址
*/
@ApiModelProperty(value = "主体信息-详细地址")
private String adress;
/**
* 主体信息-营业期限开始时间
*/
@ApiModelProperty(value = "主体信息-营业期限开始时间")
private String subjectStartTime;
/**
* 主体信息-营业期限结束时间
*/
@ApiModelProperty(value = "主体信息-营业期限结束时间")
private String subjectEndTime;
/**
* 主体信息-营业执照图片地址
*/
@ApiModelProperty(value = "主体信息-营业执照图片地址")
private List<String> subjectLicense;
/**
* 是否是跨境商家
*/
private Integer isCross;
}

39
cereshop-admin/src/main/java/com/shop/cereshop/admin/page/business/BusinessGetAll.java

@ -0,0 +1,39 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.admin.page.business;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.shop.cereshop.commons.domain.business.CerePlatformBusiness;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 商家列表
*/
@Data
@ApiModel(value = "BusinessGetAll", description = "商家列表")
public class BusinessGetAll extends CerePlatformBusiness {
/**
* 商家用户id
*/
@ApiModelProperty(value = "商家用户id")
private Long businessUserId;
/**
* 商家账号
*/
@ApiModelProperty(value = "商家账号")
private String businessPhone;
/**
* 商家密码
*/
@ApiModelProperty(value = "商家密码")
private String businessPassword;
}

65
cereshop-admin/src/main/java/com/shop/cereshop/admin/page/product/ProductClassify.java

@ -1,65 +0,0 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.admin.page.product;
import com.shop.cereshop.commons.domain.image.Image;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.util.List;
/**
* 商品类别返回数据实体类
*/
@Data
@ApiModel(value = "ProductClassify", description = "商品类别返回数据实体类")
public class ProductClassify {
/**
* 一级类别id
*/
@ApiModelProperty(value = "一级类别id")
private Long id;
/**
* 类别名称
*/
@ApiModelProperty(value = "类别名称")
@NotBlank(message = "类别名称不能为空")
private String categoryName;
/**
* 类别链接
*/
@ApiModelProperty(value = "类别链接")
private Long link;
/**
* 类别图片地址
*/
@ApiModelProperty(value = "类别图片地址")
private String categoryImg;
/**
* 类别图片地址
*/
@ApiModelProperty(value = "类别图片地址")
private List<Image> categoryImgArray;
/**
* 类别级别
*/
@ApiModelProperty(value = "类别级别")
private Integer depth;
/**
* 子节点数据
*/
@ApiModelProperty(value = "子节点数据")
private List<ProductClassify> childs;
}

6
cereshop-admin/src/main/java/com/shop/cereshop/admin/page/shop/ShopGetAll.java

@ -18,8 +18,8 @@ import lombok.Data;
public class ShopGetAll extends CerePlatformShop {
/**
* 商家用户id
* 商家名称
*/
@ApiModelProperty(value = "商家用户id")
private Long businessUserId;
@ApiModelProperty(value = "商家名称")
private String businessName;
}

57
cereshop-admin/src/main/java/com/shop/cereshop/admin/param/business/BusinessGetAllParam.java

@ -0,0 +1,57 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.admin.param.business;
import com.shop.cereshop.commons.domain.common.PageParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* 获取商家列表请求
*/
@Data
@ApiModel(value = "BusinessGetAllParam", description = "获取商家列表请求")
public class BusinessGetAllParam extends PageParam {
/**
* 商家Id
*/
@ApiModelProperty(value = "商家Id")
private String businessId;
/**
* 商家名称
*/
@ApiModelProperty(value = "商家名称")
private String businessName;
/**
* 商家编码
*/
@ApiModelProperty(value = "商家编码")
private String businessCode;
/**
* 商家负责人
*/
@ApiModelProperty(value = "商家负责人")
private String chargePersonName;
/**
* 合同状态 1-有效 0-无效
*/
@ApiModelProperty(value = "合同状态 1-有效 0-无效")
private Integer contractState;
/**
* 商家IdList
*/
@ApiModelProperty(value = "商家IdList")
private List<Long> businessIdList;
}

24
cereshop-admin/src/main/java/com/shop/cereshop/admin/param/business/BusinessGetByIdParam.java

@ -0,0 +1,24 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.admin.param.business;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 获取商家详情请求
*/
@Data
@ApiModel(value = "BusinessGetByIdParam", description = "获取商家详情请求")
public class BusinessGetByIdParam {
/**
* 商家id
*/
@ApiModelProperty(value = "商家id")
private Long businessId;
}

92
cereshop-admin/src/main/java/com/shop/cereshop/admin/param/business/BusinessSaveParam.java

@ -0,0 +1,92 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.admin.param.business;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* 添加商家请求
*/
@Data
@ApiModel(value = "BusinessSaveParam", description = "添加商家请求")
public class BusinessSaveParam {
/**
* 商家名称
*/
@ApiModelProperty(value = "商家名称")
@NotBlank(message = "商家名称不能为空")
private String businessName;
/**
* 商家账号
*/
@ApiModelProperty(value = "商家账号")
@NotBlank(message = "商家账号不能为空")
private String businessPhone;
/**
* 商家密码
*/
@ApiModelProperty(value = "商家密码")
@NotBlank(message = "商家密码不能为空")
private String businessPassword;
/**
* 商家负责人
*/
@ApiModelProperty(value = "商家负责人")
@NotBlank(message = "商家负责人不能为空")
private String chargePersonName;
/**
* 负责人电话
*/
@ApiModelProperty(value = "负责人电话")
@NotBlank(message = "负责人电话不能为空")
private String chargePersonPhone;
/**
* 商家地址
*/
@ApiModelProperty(value = "商家地址")
@NotBlank(message = "商家地址不能为空")
private String businessAdress;
/**
* 生效日期
*/
@ApiModelProperty(value = "生效日期")
private String effectiveDate;
/**
* 生效时限
*/
@ApiModelProperty(value = "生效时限(年)")
private Integer effectiveYear;
/**
* 合同状态 1-有效 0-无效
*/
@ApiModelProperty(value = "合同状态 1-有效 0-无效")
private Integer contractState;
/**
* 审核直播间
*/
@ApiModelProperty(value = "审核直播间 1-开启 0-关闭")
private Integer auditLive;
/**
* 审核直播间商品
*/
@ApiModelProperty(value = "审核直播间商品 1-开启 0-关闭")
private Integer auditLiveProduct;
}

30
cereshop-admin/src/main/java/com/shop/cereshop/admin/param/business/BusinessStartParam.java

@ -0,0 +1,30 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.admin.param.business;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 启停用商家请求
*/
@Data
@ApiModel(value = "BusinessStartParam", description = "启停用商家请求")
public class BusinessStartParam {
/**
* 商家id
*/
@ApiModelProperty(value = "商家id")
private Long businessId;
/**
* 是否启用 1- 0-
*/
@ApiModelProperty(value = "是否启用 1-是 0-否")
private Integer state;
}

96
cereshop-admin/src/main/java/com/shop/cereshop/admin/param/business/BusinessUpdateParam.java

@ -0,0 +1,96 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.admin.param.business;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 更新商家请求
*/
@Data
@ApiModel(value = "BusinessUpdateParam", description = "更新商家请求")
public class BusinessUpdateParam {
/**
* 商家用户id
*/
@ApiModelProperty(value = "商家用户id")
private Long businessUserId;
/**
* 商家id
*/
@ApiModelProperty(value = "商家id")
private Long businessId;
/**
* 商家名称
*/
@ApiModelProperty(value = "商家名称")
private String businessName;
/**
* 商家账号
*/
@ApiModelProperty(value = "商家账号")
private String businessPhone;
/**
* 商家密码
*/
@ApiModelProperty(value = "商家密码")
private String businessPassword;
/**
* 商家负责人
*/
@ApiModelProperty(value = "商家负责人")
private String chargePersonName;
/**
* 负责人电话
*/
@ApiModelProperty(value = "负责人电话")
private String chargePersonPhone;
/**
* 商家地址
*/
@ApiModelProperty(value = "商家地址")
private String businessAdress;
/**
* 生效日期
*/
@ApiModelProperty(value = "生效日期")
private String effectiveDate;
/**
* 生效时限
*/
@ApiModelProperty(value = "生效时限(年)")
private Integer effectiveYear;
/**
* 合同状态 1-有效 0-无效
*/
@ApiModelProperty(value = "合同状态 1-有效 0-无效")
private Integer contractState;
/**
* 审核直播间
*/
@ApiModelProperty(value = "审核直播间 1-开启 0-关闭")
private Integer auditLive;
/**
* 审核直播间商品
*/
@ApiModelProperty(value = "审核直播间商品 1-开启 0-关闭")
private Integer auditLiveProduct;
}

4
cereshop-admin/src/main/java/com/shop/cereshop/admin/param/product/ClassifyLevelParam.java

@ -5,7 +5,7 @@
*/
package com.shop.cereshop.admin.param.product;
import com.shop.cereshop.admin.page.product.ProductClassify;
import com.shop.cereshop.commons.domain.product.CereProductClassify;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -31,5 +31,5 @@ public class ClassifyLevelParam {
*/
@ApiModelProperty(value = "分类层级数据")
@Valid
private List<ProductClassify> classifies;
private List<CereProductClassify> classifies;
}

45
cereshop-admin/src/main/java/com/shop/cereshop/admin/param/shop/ShopSaveParam.java

@ -10,6 +10,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* 添加商家请求
@ -26,18 +27,11 @@ public class ShopSaveParam {
private String shopName;
/**
* 店铺账号
* 所属商家Id
*/
@ApiModelProperty(value = "店铺账号")
@NotBlank(message = "店铺账号不能为空")
private String shopPhone;
/**
* 店铺密码
*/
@ApiModelProperty(value = "店铺密码")
@NotBlank(message = "店铺密码不能为空")
private String shopPassword;
@ApiModelProperty(value = "所属商家Id")
@NotNull(message = "所属商家不能为空")
private Long businessId;
/**
* 店铺负责人
@ -60,34 +54,5 @@ public class ShopSaveParam {
@NotBlank(message = "店铺地址不能为空")
private String shopAdress;
/**
* 生效日期
*/
@ApiModelProperty(value = "生效日期")
private String effectiveDate;
/**
* 生效时限
*/
@ApiModelProperty(value = "生效时限(年)")
private Integer effectiveYear;
/**
* 合同状态 1-有效 0-无效
*/
@ApiModelProperty(value = "合同状态 1-有效 0-无效")
private Integer contractState;
/**
* 审核直播间
*/
@ApiModelProperty(value = "审核直播间 1-开启 0-关闭")
private Integer auditLive;
/**
* 审核直播间商品
*/
@ApiModelProperty(value = "审核直播间商品 1-开启 0-关闭")
private Integer auditLiveProduct;
}

57
cereshop-admin/src/main/java/com/shop/cereshop/admin/param/shop/ShopUpdateParam.java

@ -9,6 +9,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* 更新商家请求
*/
@ -17,80 +19,45 @@ import lombok.Data;
public class ShopUpdateParam {
/**
* 商家用户id
*/
@ApiModelProperty(value = "商家用户id")
private Long businessUserId;
/**
* 店铺id
* 店铺id
*/
@ApiModelProperty(value = "店铺id")
private Long shopId;
/**
* 店铺名称
*/
@ApiModelProperty(value = "店铺名称")
@NotBlank(message = "店铺名称不能为空")
private String shopName;
/**
* 店铺账号
* 所属商家Id
*/
@ApiModelProperty(value = "店铺账号")
private String shopPhone;
/**
* 店铺密码
*/
@ApiModelProperty(value = "店铺密码")
private String shopPassword;
@ApiModelProperty(value = "所属商家Id")
@NotBlank(message = "所属商家不能为空")
private String businessId;
/**
* 店铺负责人
*/
@ApiModelProperty(value = "店铺负责人")
@NotBlank(message = "店铺负责人不能为空")
private String chargePersonName;
/**
* 负责人电话
*/
@ApiModelProperty(value = "负责人电话")
@NotBlank(message = "负责人电话不能为空")
private String chargePersonPhone;
/**
* 店铺地址
*/
@ApiModelProperty(value = "店铺地址")
@NotBlank(message = "店铺地址不能为空")
private String shopAdress;
/**
* 生效日期
*/
@ApiModelProperty(value = "生效日期")
private String effectiveDate;
/**
* 生效时限
*/
@ApiModelProperty(value = "生效时限(年)")
private Integer effectiveYear;
/**
* 合同状态 1-有效 0-无效
*/
@ApiModelProperty(value = "合同状态 1-有效 0-无效")
private Integer contractState;
/**
* 审核直播间
*/
@ApiModelProperty(value = "审核直播间 1-开启 0-关闭")
private Integer auditLive;
/**
* 审核直播间商品
*/
@ApiModelProperty(value = "审核直播间商品 1-开启 0-关闭")
private Integer auditLiveProduct;
}

8
cereshop-admin/src/main/java/com/shop/cereshop/admin/param/shopcheck/CheckGetAllParam.java

@ -24,13 +24,7 @@ public class CheckGetAllParam extends PageParam {
* 商家名称
*/
@ApiModelProperty(value = "商家名称")
private String shopName;
/**
* 手机号
*/
@ApiModelProperty(value = "手机号")
private String shopPhone;
private String businessName;
/**
* 店铺类型 1-个人 2-个体工商户 3-企业 4-其他组织

4
cereshop-admin/src/main/java/com/shop/cereshop/admin/param/shopcheck/CheckGetByIdParam.java

@ -19,6 +19,6 @@ public class CheckGetByIdParam {
/**
* 店铺id
*/
@ApiModelProperty(value = "店铺id")
private Long shopId;
@ApiModelProperty(value = "商家id")
private Long businessId;
}

6
cereshop-admin/src/main/java/com/shop/cereshop/admin/param/shopcheck/CheckHandleParam.java

@ -18,10 +18,10 @@ import lombok.Data;
public class CheckHandleParam {
/**
* 店铺id
* 商家id
*/
@ApiModelProperty(value = "店铺id")
private Long shopId;
@ApiModelProperty(value = "商家id")
private Long businessId;
/**
* 生效日期 null-即时生效 有值-指定日期生效

6
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/CereBusinessShopService.java → cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/CereBusinessUserService.java

@ -5,9 +5,9 @@
*/
package com.shop.cereshop.admin.service.business;
import com.shop.cereshop.commons.domain.business.CereBusinessShop;
import com.shop.cereshop.commons.domain.business.CereBusinessUser;
import com.shop.cereshop.commons.exception.CoBusinessException;
public interface CereBusinessShopService {
void insert(CereBusinessShop cereBusinessShop) throws CoBusinessException;
public interface CereBusinessUserService {
void insert(CereBusinessUser cereBusinessUser) throws CoBusinessException;
}

46
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/CerePlatformBusinessService.java

@ -5,13 +5,53 @@
*/
package com.shop.cereshop.admin.service.business;
import com.shop.cereshop.admin.page.business.Business;
import com.shop.cereshop.admin.page.business.BusinessGetAll;
import com.shop.cereshop.admin.page.finance.FinanceCount;
import com.shop.cereshop.admin.param.business.BusinessGetAllParam;
import com.shop.cereshop.admin.param.business.BusinessSaveParam;
import com.shop.cereshop.admin.param.business.BusinessStartParam;
import com.shop.cereshop.admin.param.business.BusinessUpdateParam;
import com.shop.cereshop.admin.param.finance.FinanceParam;
import com.shop.cereshop.commons.domain.business.CerePlatformBusiness;
import com.shop.cereshop.commons.domain.common.Page;
import com.shop.cereshop.commons.domain.user.CerePlatformUser;
import com.shop.cereshop.commons.exception.CoBusinessException;
import java.util.List;
public interface CerePlatformBusinessService {
void insert(CerePlatformBusiness cerePlatformBusiness) throws CoBusinessException;
void save(BusinessSaveParam param, CerePlatformUser user) throws CoBusinessException;
CerePlatformBusiness findByBusinessName(String businessName);
CerePlatformBusiness findByBusinessPhone(String businessPhone);
CerePlatformBusiness checkBusinessIdByName(String businessName, Long businessId);
CerePlatformBusiness checkBusinessIdByPhone(String businessPhone, Long businessId);
void update(BusinessUpdateParam param, CerePlatformUser user) throws CoBusinessException;
void startOrStop(BusinessStartParam param, CerePlatformUser user) throws CoBusinessException;
BusinessGetAll getById(Long businessId) throws CoBusinessException,Exception;
Page getAll(BusinessGetAllParam param) throws CoBusinessException;
Business findBusiness(Long businessId);
void updateDate(CerePlatformBusiness cerePlatformBusiness) throws CoBusinessException;
FinanceCount getAllFinance(FinanceParam param) throws CoBusinessException;
Long findBusinessUserId(Long businessId);
List<CerePlatformBusiness> findAll();
void updateBusinessStop(CerePlatformBusiness business) throws CoBusinessException;
void update(CerePlatformBusiness cerePlatformBusiness) throws CoBusinessException;
Boolean cleanShop(Long businessId);
CerePlatformBusiness findByPhone(String chargePersonPhone);
List<CerePlatformBusiness> getByIdList(List<Long> businessIdList);
}

23
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/CerePlatformBusinessUserService.java

@ -0,0 +1,23 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.admin.service.business;
import com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser;
import com.shop.cereshop.commons.exception.CoBusinessException;
public interface CerePlatformBusinessUserService {
void insert(CerePlatformBusinessUser cerePlatformBusinessUser) throws CoBusinessException;
void update(CerePlatformBusinessUser cerePlatformBusinessUser) throws CoBusinessException;
CerePlatformBusinessUser findByPhone(String chargePersonPhone);
CerePlatformBusinessUser findByUserName(String username);
CerePlatformBusinessUser checkPhone(String phone, Long businessUserId);
CerePlatformBusinessUser checkUserName(String username, Long businessUserId);
}

6
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/shop/CereShopEnterpriseService.java → cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/CereShopEnterpriseService.java

@ -3,10 +3,10 @@
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.admin.service.shop;
package com.shop.cereshop.admin.service.business;
import com.shop.cereshop.commons.domain.shop.CereShopEnterprise;
import com.shop.cereshop.commons.domain.business.CereShopEnterprise;
public interface CereShopEnterpriseService {
CereShopEnterprise findByShopId(Long shopId);
CereShopEnterprise findByBusinessId(Long businessId);
}

6
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/shop/CereShopIndividualBusinessesService.java → cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/CereShopIndividualBusinessesService.java

@ -3,10 +3,10 @@
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.admin.service.shop;
package com.shop.cereshop.admin.service.business;
import com.shop.cereshop.commons.domain.shop.CereShopIndividualBusinesses;
import com.shop.cereshop.commons.domain.business.CereShopIndividualBusinesses;
public interface CereShopIndividualBusinessesService {
CereShopIndividualBusinesses findByShopId(Long shopId);
CereShopIndividualBusinesses findByBusinessId(Long businessId);
}

6
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/shop/CereShopOtherOrganizationsService.java → cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/CereShopOtherOrganizationsService.java

@ -3,10 +3,10 @@
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.admin.service.shop;
package com.shop.cereshop.admin.service.business;
import com.shop.cereshop.commons.domain.shop.CereShopOtherOrganizations;
import com.shop.cereshop.commons.domain.business.CereShopOtherOrganizations;
public interface CereShopOtherOrganizationsService {
CereShopOtherOrganizations findByShopId(Long shopId);
CereShopOtherOrganizations findByBusinessId(Long businessId);
}

6
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/shop/CereShopPersonalService.java → cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/CereShopPersonalService.java

@ -3,10 +3,10 @@
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.admin.service.shop;
package com.shop.cereshop.admin.service.business;
import com.shop.cereshop.commons.domain.shop.CereShopPersonal;
import com.shop.cereshop.commons.domain.business.CereShopPersonal;
public interface CereShopPersonalService {
CereShopPersonal findByShopId(Long shopId);
CereShopPersonal findByBusinessId(Long shopId);
}

14
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/impl/CereBusinessShopServiceImpl.java → cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/impl/CereBusinessUserServiceImpl.java

@ -5,21 +5,21 @@
*/
package com.shop.cereshop.admin.service.business.impl;
import com.shop.cereshop.admin.dao.business.CereBusinessShopDAO;
import com.shop.cereshop.admin.service.business.CereBusinessShopService;
import com.shop.cereshop.commons.domain.business.CereBusinessShop;
import com.shop.cereshop.admin.dao.business.CereBusinessUserDAO;
import com.shop.cereshop.admin.service.business.CereBusinessUserService;
import com.shop.cereshop.commons.domain.business.CereBusinessUser;
import com.shop.cereshop.commons.exception.CoBusinessException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class CereBusinessShopServiceImpl implements CereBusinessShopService {
public class CereBusinessUserServiceImpl implements CereBusinessUserService {
@Autowired
private CereBusinessShopDAO cereBusinessShopDAO;
private CereBusinessUserDAO cereBusinessUserDAO;
@Override
public void insert(CereBusinessShop cereBusinessShop) throws CoBusinessException {
cereBusinessShopDAO.insert(cereBusinessShop);
public void insert(CereBusinessUser cereBusinessUser) throws CoBusinessException {
cereBusinessUserDAO.insert(cereBusinessUser);
}
}

252
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/impl/CerePlatformBusinessServiceImpl.java

@ -5,12 +5,46 @@
*/
package com.shop.cereshop.admin.service.business.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.shop.cereshop.admin.dao.business.CerePlatformBusinessDAO;
import com.shop.cereshop.admin.page.business.Business;
import com.shop.cereshop.admin.page.business.BusinessGetAll;
import com.shop.cereshop.admin.page.finance.Finance;
import com.shop.cereshop.admin.page.finance.FinanceCount;
import com.shop.cereshop.admin.param.business.BusinessGetAllParam;
import com.shop.cereshop.admin.param.business.BusinessSaveParam;
import com.shop.cereshop.admin.param.business.BusinessStartParam;
import com.shop.cereshop.admin.param.business.BusinessUpdateParam;
import com.shop.cereshop.admin.param.finance.FinanceParam;
import com.shop.cereshop.admin.service.business.CereBusinessUserService;
import com.shop.cereshop.admin.service.business.CerePlatformBusinessService;
import com.shop.cereshop.admin.service.business.CerePlatformBusinessUserService;
import com.shop.cereshop.admin.service.common.CommonService;
import com.shop.cereshop.admin.service.log.CerePlatformLogService;
import com.shop.cereshop.admin.service.product.CereShopProductService;
import com.shop.cereshop.admin.utils.EncodeUtil;
import com.shop.cereshop.commons.constant.CoReturnFormat;
import com.shop.cereshop.commons.constant.IntegerEnum;
import com.shop.cereshop.commons.domain.business.CereBusinessUser;
import com.shop.cereshop.commons.domain.business.CerePlatformBusiness;
import com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser;
import com.shop.cereshop.commons.domain.common.Page;
import com.shop.cereshop.commons.domain.user.CerePlatformUser;
import com.shop.cereshop.commons.exception.CoBusinessException;
import com.shop.cereshop.commons.utils.EmptyUtils;
import com.shop.cereshop.commons.utils.EncryptUtil;
import com.shop.cereshop.commons.utils.TimeUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class CerePlatformBusinessServiceImpl implements CerePlatformBusinessService {
@ -18,18 +52,226 @@ public class CerePlatformBusinessServiceImpl implements CerePlatformBusinessServ
@Autowired
private CerePlatformBusinessDAO cerePlatformBusinessDAO;
@Autowired
private CerePlatformBusinessUserService cerePlatformBusinessUserService;
@Autowired
private CereBusinessUserService cereBusinessUserService;
@Autowired
private CommonService commonService;
@Autowired
private CerePlatformLogService cerePlatformLogService;
@Autowired
CereShopProductService cereShopProductService;
@Autowired
private EncodeUtil encodeUtil;
@Override
public void insert(CerePlatformBusiness cerePlatformBusiness) throws CoBusinessException {
@Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class})
public void save(BusinessSaveParam param, CerePlatformUser user) throws CoBusinessException {
//新建商家数据
String time= TimeUtils.yyMMddHHmmss();
CerePlatformBusiness cerePlatformBusiness=new CerePlatformBusiness();
BeanUtils.copyProperties(param, cerePlatformBusiness);
CerePlatformBusinessUser business = cerePlatformBusinessUserService.findByPhone(param.getChargePersonPhone());
if (business != null) {
throw new CoBusinessException(CoReturnFormat.PHONE_ALREADY_BIND_SHOP);
}
//生成店铺编号
String shopCode=commonService.getShopCode();
cerePlatformBusiness.setBusinessCode(shopCode);
cerePlatformBusiness.setAuthenticationState(IntegerEnum.APPROVED.getCode());
cerePlatformBusiness.setCheckState(IntegerEnum.UNTREATED.getCode());
cerePlatformBusiness.setState(IntegerEnum.YES.getCode());
cerePlatformBusiness.setCreateTime(time);
cerePlatformBusiness.setUpdateTime(time);
cerePlatformBusinessDAO.insert(cerePlatformBusiness);
//同步新增商家用户数据
CerePlatformBusinessUser cerePlatformBusinessUser =new CerePlatformBusinessUser();
cerePlatformBusinessUser.setCreateTime(time);
cerePlatformBusinessUser.setUsername(param.getBusinessPhone());
if(EmptyUtils.isEmpty(param.getBusinessPassword())){
cerePlatformBusinessUser.setPassword(EncryptUtil.encrypt("123456"));
}else {
cerePlatformBusinessUser.setPassword(EncryptUtil.encrypt(param.getBusinessPhone()));
}
cerePlatformBusinessUser.setName(cerePlatformBusiness.getChargePersonName());
cerePlatformBusinessUser.setPhone(param.getBusinessPhone());
cerePlatformBusinessUser.setState(IntegerEnum.YES.getCode());
cerePlatformBusinessUserService.insert(cerePlatformBusinessUser);
//同步新增商家用户绑定店铺数据
CereBusinessUser cereBusinessUser =new CereBusinessUser();
cereBusinessUser.setBusinessUserId(cerePlatformBusinessUser.getBusinessUserId());
cereBusinessUser.setBusinessId(cerePlatformBusiness.getBusinessId());
cereBusinessUser.setIfBinding(IntegerEnum.YES.getCode());
cereBusinessUser.setIsMainUser(IntegerEnum.YES.getCode());
cereBusinessUserService.insert(cereBusinessUser);
//新增日志
cerePlatformLogService.addLog(user,"商家管理","平台端操作","添加商家",String.valueOf(cerePlatformBusiness.getBusinessId()),time);
}
@Override
public CerePlatformBusiness findByBusinessName(String businessName) {
return cerePlatformBusinessDAO.findByBusinessName(businessName);
}
@Override
public CerePlatformBusiness findByBusinessPhone(String businessPhone) {
return cerePlatformBusinessDAO.findByBusinessPhone(businessPhone);
}
@Override
public CerePlatformBusiness checkBusinessIdByName(String businessName, Long businessId) {
return cerePlatformBusinessDAO.checkBusinessIdByName(businessName,businessId);
}
@Override
public CerePlatformBusiness checkBusinessIdByPhone(String businessPhone, Long businessId) {
return cerePlatformBusinessDAO.checkBusinessIdByPhone(businessPhone,businessId);
}
@Override
@Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class})
public void update(BusinessUpdateParam param, CerePlatformUser user) throws CoBusinessException {
String time= TimeUtils.yyMMddHHmmss();
CerePlatformBusiness cerePlatformBusiness=new CerePlatformBusiness();
BeanUtils.copyProperties(param, cerePlatformBusiness);
cerePlatformBusiness.setUpdateTime(time);
//修改商家数据
cerePlatformBusinessDAO.updateById(cerePlatformBusiness);
//根据商家用户id查询用户数据
CerePlatformBusinessUser cerePlatformBusinessUser =cerePlatformBusinessDAO.findBusinessUserByBusinessId(param.getBusinessUserId());
if(cerePlatformBusinessUser !=null){
cerePlatformBusinessUser.setUpdateTime(time);
cerePlatformBusinessUser.setUsername(param.getBusinessPhone());
cerePlatformBusinessUser.setPassword(param.getBusinessPassword());
cerePlatformBusinessUser.setName(cerePlatformBusiness.getChargePersonName());
cerePlatformBusinessUserService.update(cerePlatformBusinessUser);
}
//新增日志
cerePlatformLogService.addLog(user,"商家管理","平台端操作","修改商家",String.valueOf(cerePlatformBusiness.getBusinessId()),time);
}
@Override
@Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class})
public void startOrStop(BusinessStartParam param, CerePlatformUser user) throws CoBusinessException {
String time =TimeUtils.yyMMddHHmmss();
CerePlatformBusiness cerePlatformBusiness=new CerePlatformBusiness();
cerePlatformBusiness.setBusinessId(param.getBusinessId());
cerePlatformBusiness.setState(param.getState());
String describe="";
if(IntegerEnum.YES.getCode().equals(cerePlatformBusiness.getState())){
describe="启用商家";
}else {
describe="停用商家";
}
cerePlatformBusiness.setUpdateTime(time);
cerePlatformBusinessDAO.updateById(cerePlatformBusiness);
//同时下架所有商品--TODO by pxh
cereShopProductService.unShelveByShopId(param.getBusinessId(), user);
//新增日志
cerePlatformLogService.addLog(user,"商家管理","平台端操作",describe,String.valueOf(cerePlatformBusiness.getBusinessId()),time);
}
@Override
public BusinessGetAll getById(Long businessId) throws CoBusinessException,Exception {
BusinessGetAll shop = cerePlatformBusinessDAO.getById(businessId);
//解密密码
// shop.setShopPassword(EncryptUtil.decrypt(shop.getShopPassword()));
return shop;
}
@Override
public Page getAll(BusinessGetAllParam param) throws CoBusinessException {
PageHelper.startPage(param.getPage(),param.getPageSize());
List<BusinessGetAll> list=cerePlatformBusinessDAO.getAll(param);
for (BusinessGetAll business:list) {
business.setChargePersonName(encodeUtil.encodeInfo(business.getChargePersonName()));
business.setChargePersonPhone(encodeUtil.encodePhone(business.getChargePersonPhone()));
}
PageInfo<BusinessGetAll> pageInfo=new PageInfo<>(list);
Page page=new Page(pageInfo.getList(),pageInfo.getTotal());
return page;
}
@Override
public Business findBusiness(Long businessId) {
return cerePlatformBusinessDAO.findBusiness(businessId);
}
@Override
public void updateDate(CerePlatformBusiness cerePlatformBusiness) throws CoBusinessException {
cerePlatformBusinessDAO.updateDate(cerePlatformBusiness);
}
@Override
public FinanceCount getAllFinance(FinanceParam param) throws CoBusinessException {
PageHelper.startPage(param.getPage(),param.getPageSize());
List<Finance> list=cerePlatformBusinessDAO.getAllFinance(param);
PageInfo<Finance> pageInfo=new PageInfo<>(list);
if(!EmptyUtils.isEmpty(list)){
list=list.stream()
//查询冻结金额
.peek(a -> a.setFrozen(cerePlatformBusinessDAO.finFrozen(a.getShopId())))
//查询已提金额
.peek(a -> a.setHaveWithdrawable(cerePlatformBusinessDAO.findHaveWithdrawal(a.getShopId())))
//查询已退款金额
.peek(a -> a.setRefund(cerePlatformBusinessDAO.findRefund(a.getShopId())))
//可提现金额 = 总营收 - 已提现 - 冻结 - 提现中
.peek(a -> a.setWithdrawable(a.getRevenue().subtract(a.getHaveWithdrawable())
.subtract(a.getFrozen()).subtract(cerePlatformBusinessDAO.findWithdrawing(a.getShopId()))))
.collect(Collectors.toList());
pageInfo.setList(list);
}
Page page=new Page(pageInfo.getList(),pageInfo.getTotal());
FinanceCount count=new FinanceCount();
BigDecimal decimal=BigDecimal.ZERO;
//查询营收总额
count.setRevenue(cerePlatformBusinessDAO.findRevenue());
//查询冻结中金额
count.setFrozen(cerePlatformBusinessDAO.finFrozen(null));
//查询总的提现金额
BigDecimal withdrawableMoney = cerePlatformBusinessDAO.getAllWithdrawableMoney();
//查询提现中的金额
BigDecimal stayMoney = cerePlatformBusinessDAO.getWithdrawableStayMoney();
//查询已提现金额
BigDecimal have=cerePlatformBusinessDAO.findHaveWithdrawal(null);
count.setHaveWithdrawable(have);
//计算可提现金额=总的提现金额-提现中金额-已提现金额
count.setWithdrawable(decimal.add(withdrawableMoney).subtract(stayMoney).subtract(have));
//查询已退款金额
count.setRefund(cerePlatformBusinessDAO.findRefund(null));
count.setPage(page);
return count;
}
@Override
public Long findBusinessUserId(Long businessId) {
return cerePlatformBusinessDAO.findBusinessUserId(businessId);
}
@Override
public List<CerePlatformBusiness> findAll() {
return cerePlatformBusinessDAO.findAll();
}
@Override
public void updateBusinessStop(CerePlatformBusiness business) throws CoBusinessException {
cerePlatformBusinessDAO.updateBusinessStop(business);
}
@Override
public void update(CerePlatformBusiness cerePlatformBusiness) throws CoBusinessException {
cerePlatformBusinessDAO.updateByPrimaryKeySelective(cerePlatformBusiness);
public Boolean cleanShop(Long businessId) {
return cerePlatformBusinessDAO.cleanShop(businessId);
}
@Override
public CerePlatformBusiness findByPhone(String phone) {
return cerePlatformBusinessDAO.findByPhone(phone);
public List<CerePlatformBusiness> getByIdList(List<Long> businessIdList){
return cerePlatformBusinessDAO.getByIdList(businessIdList);
}
}

48
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/impl/CerePlatformBusinessUserServiceImpl.java

@ -0,0 +1,48 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.admin.service.business.impl;
import com.shop.cereshop.admin.dao.business.CerePlatformBusinessUserDAO;
import com.shop.cereshop.admin.service.business.CerePlatformBusinessUserService;
import com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser;
import com.shop.cereshop.commons.exception.CoBusinessException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class CerePlatformBusinessUserServiceImpl implements CerePlatformBusinessUserService {
@Autowired
private CerePlatformBusinessUserDAO cerePlatformBusinessUserDAO;
@Override
public void insert(CerePlatformBusinessUser cerePlatformBusinessUser) throws CoBusinessException {
cerePlatformBusinessUserDAO.insert(cerePlatformBusinessUser);
}
@Override
public void update(CerePlatformBusinessUser cerePlatformBusinessUser) throws CoBusinessException {
cerePlatformBusinessUserDAO.updateByPrimaryKeySelective(cerePlatformBusinessUser);
}
@Override
public CerePlatformBusinessUser findByPhone(String phone) {
return cerePlatformBusinessUserDAO.findByPhone(phone);
}
@Override
public CerePlatformBusinessUser findByUserName(String username) {
return cerePlatformBusinessUserDAO.findByUserName(username);
}
@Override
public CerePlatformBusinessUser checkPhone(String phone, Long businessUserId) {
return cerePlatformBusinessUserDAO.checkPhone(phone, businessUserId);
}
@Override
public CerePlatformBusinessUser checkUserName(String username, Long businessUserId) {
return cerePlatformBusinessUserDAO.checkUserName(username, businessUserId);
}
}

10
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/shop/impl/CereShopEnterpriseServiceImpl.java → cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/impl/CereShopEnterpriseServiceImpl.java

@ -3,11 +3,11 @@
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.admin.service.shop.impl;
package com.shop.cereshop.admin.service.business.impl;
import com.shop.cereshop.admin.dao.shop.CereShopEnterpriseDAO;
import com.shop.cereshop.admin.service.shop.CereShopEnterpriseService;
import com.shop.cereshop.commons.domain.shop.CereShopEnterprise;
import com.shop.cereshop.admin.service.business.CereShopEnterpriseService;
import com.shop.cereshop.commons.domain.business.CereShopEnterprise;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -18,7 +18,7 @@ public class CereShopEnterpriseServiceImpl implements CereShopEnterpriseService
private CereShopEnterpriseDAO cereShopEnterpriseDAO;
@Override
public CereShopEnterprise findByShopId(Long shopId) {
return cereShopEnterpriseDAO.findByShopId(shopId);
public CereShopEnterprise findByBusinessId(Long businessId) {
return cereShopEnterpriseDAO.findByBusinessId(businessId);
}
}

10
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/shop/impl/CereShopIndividualBusinessesServiceImpl.java → cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/impl/CereShopIndividualBusinessesServiceImpl.java

@ -3,11 +3,11 @@
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.admin.service.shop.impl;
package com.shop.cereshop.admin.service.business.impl;
import com.shop.cereshop.admin.dao.shop.CereShopIndividualBusinessesDAO;
import com.shop.cereshop.admin.service.shop.CereShopIndividualBusinessesService;
import com.shop.cereshop.commons.domain.shop.CereShopIndividualBusinesses;
import com.shop.cereshop.admin.service.business.CereShopIndividualBusinessesService;
import com.shop.cereshop.commons.domain.business.CereShopIndividualBusinesses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -18,7 +18,7 @@ public class CereShopIndividualBusinessesServiceImpl implements CereShopIndividu
private CereShopIndividualBusinessesDAO cereShopIndividualBusinessesDAO;
@Override
public CereShopIndividualBusinesses findByShopId(Long shopId) {
return cereShopIndividualBusinessesDAO.findByShopId(shopId);
public CereShopIndividualBusinesses findByBusinessId(Long businessId) {
return cereShopIndividualBusinessesDAO.findByBusinessId(businessId);
}
}

10
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/shop/impl/CereShopOtherOrganizationsServiceImpl.java → cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/impl/CereShopOtherOrganizationsServiceImpl.java

@ -3,11 +3,11 @@
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.admin.service.shop.impl;
package com.shop.cereshop.admin.service.business.impl;
import com.shop.cereshop.admin.dao.shop.CereShopOtherOrganizationsDAO;
import com.shop.cereshop.admin.service.shop.CereShopOtherOrganizationsService;
import com.shop.cereshop.commons.domain.shop.CereShopOtherOrganizations;
import com.shop.cereshop.admin.service.business.CereShopOtherOrganizationsService;
import com.shop.cereshop.commons.domain.business.CereShopOtherOrganizations;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -18,7 +18,7 @@ public class CereShopOtherOrganizationsServiceImpl implements CereShopOtherOrgan
private CereShopOtherOrganizationsDAO cereShopOtherOrganizationsDAO;
@Override
public CereShopOtherOrganizations findByShopId(Long shopId) {
return cereShopOtherOrganizationsDAO.findByShopId(shopId);
public CereShopOtherOrganizations findByBusinessId(Long businessId) {
return cereShopOtherOrganizationsDAO.findByBusinessId(businessId);
}
}

10
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/shop/impl/CereShopPersonalServiceImpl.java → cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/impl/CereShopPersonalServiceImpl.java

@ -3,11 +3,11 @@
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.admin.service.shop.impl;
package com.shop.cereshop.admin.service.business.impl;
import com.shop.cereshop.admin.dao.shop.CereShopPersonalDAO;
import com.shop.cereshop.admin.service.shop.CereShopPersonalService;
import com.shop.cereshop.commons.domain.shop.CereShopPersonal;
import com.shop.cereshop.admin.service.business.CereShopPersonalService;
import com.shop.cereshop.commons.domain.business.CereShopPersonal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -18,7 +18,7 @@ public class CereShopPersonalServiceImpl implements CereShopPersonalService {
private CereShopPersonalDAO cereShopPersonalDAO;
@Override
public CereShopPersonal findByShopId(Long shopId) {
return cereShopPersonalDAO.findByShopId(shopId);
public CereShopPersonal findByBusinessId(Long businessId) {
return cereShopPersonalDAO.findByBusinessId(businessId);
}
}

14
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/permission/impl/CereBusinessPermissionServiceImpl.java

@ -8,8 +8,8 @@ package com.shop.cereshop.admin.service.permission.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.shop.cereshop.admin.dao.business.CereBusinessShopDAO;
import com.shop.cereshop.admin.dao.business.CerePlatformBusinessDAO;
import com.shop.cereshop.admin.dao.business.CereBusinessUserDAO;
import com.shop.cereshop.admin.dao.business.CerePlatformBusinessUserDAO;
import com.shop.cereshop.admin.dao.permission.CereBusinessPermissionDAO;
import com.shop.cereshop.admin.dao.permission.CerePlatformPermissionDAO;
import com.shop.cereshop.admin.dao.role.CerePlatformRoleDAO;
@ -54,7 +54,7 @@ public class CereBusinessPermissionServiceImpl implements CereBusinessPermission
private CereBusinessPermissionDAO cereBusinessPermissionDAO;
@Autowired
private CerePlatformBusinessDAO cerePlatformBusinessDAO;
private CerePlatformBusinessUserDAO cerePlatformBusinessUserDAO;
@Autowired
private CerePlatformLogService cerePlatformLogService;
@ -66,7 +66,7 @@ public class CereBusinessPermissionServiceImpl implements CereBusinessPermission
private CerePlatformPermissionDAO cerePlatformPermissionDAO;
@Autowired
private CereBusinessShopDAO cereBusinessShopDAO;
private CereBusinessUserDAO cereBusinessUserDAO;
@Autowired
private CerePlatformRoleDAO cerePlatformRoleDAO;
@ -236,7 +236,7 @@ public class CereBusinessPermissionServiceImpl implements CereBusinessPermission
cereBusinessPermissionDAO.deleteByResourceTypeAndPermission(null, entry.getKey(), entry.getValue());
}
} else {
Long project = cerePlatformBusinessDAO.findProjectByUsername(param.getSyncBusinessUsername());
Long project = cerePlatformBusinessUserDAO.findBusinessByUsername(param.getSyncBusinessUsername());
if (project == null) {
throw new CoBusinessException(CoReturnFormat.MERCHANT_NOT_EXIST);
}
@ -251,7 +251,7 @@ public class CereBusinessPermissionServiceImpl implements CereBusinessPermission
List<CerePlatformPermission> permissionList = param.getSyncMenu();
List<Permission> treeList = treefyPermission(permissionList);
if (param.isSyncAll()) {
List<Long> projectList = cereBusinessShopDAO.selectAllProject();
List<Long> projectList = cereBusinessUserDAO.selectAllProject();
for (Long project : projectList) {
for (Permission per : treeList) {
insertOrUpdateInner(per, project, null, per.getPermissionPid());
@ -259,7 +259,7 @@ public class CereBusinessPermissionServiceImpl implements CereBusinessPermission
log.info("sync progress %" + ((projectList.indexOf(project) + 1) / 1.0 / projectList.size()) * 100);
}
} else {
Long project = cerePlatformBusinessDAO.findProjectByUsername(param.getSyncBusinessUsername());
Long project = cerePlatformBusinessUserDAO.findBusinessByUsername(param.getSyncBusinessUsername());
if (project == null) {
throw new CoBusinessException(CoReturnFormat.MERCHANT_NOT_EXIST);
}

2
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/permission/impl/CerePlatformPermissionServiceImpl.java

@ -21,12 +21,10 @@ import com.shop.cereshop.admin.param.user.UserBuildParam;
import com.shop.cereshop.admin.service.log.CerePlatformLogService;
import com.shop.cereshop.admin.service.permission.CerePlatformPermissionService;
import com.shop.cereshop.admin.service.role.CerePlatformRolePermissionService;
import com.shop.cereshop.commons.constant.IntegerEnum;
import com.shop.cereshop.commons.constant.LongEnum;
import com.shop.cereshop.commons.constant.StringEnum;
import com.shop.cereshop.commons.domain.common.Page;
import com.shop.cereshop.commons.domain.permission.CerePlatformPermission;
import com.shop.cereshop.commons.domain.role.CerePlatformRolePermission;
import com.shop.cereshop.commons.domain.user.CerePlatformUser;
import com.shop.cereshop.commons.exception.CoBusinessException;
import com.shop.cereshop.commons.utils.EmptyUtils;

4
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/product/CereProductClassifyService.java

@ -6,10 +6,10 @@
package com.shop.cereshop.admin.service.product;
import com.shop.cereshop.commons.domain.common.Page;
import com.shop.cereshop.admin.page.product.ProductClassify;
import com.shop.cereshop.admin.param.product.ClassifyDeleteParam;
import com.shop.cereshop.admin.param.product.ClassifyGetAllParam;
import com.shop.cereshop.admin.param.product.ClassifyLevelParam;
import com.shop.cereshop.commons.domain.product.CereProductClassify;
import com.shop.cereshop.commons.domain.product.Classify;
import com.shop.cereshop.commons.domain.user.CerePlatformUser;
import com.shop.cereshop.commons.exception.CoBusinessException;
@ -21,7 +21,7 @@ public interface CereProductClassifyService {
void update(ClassifyLevelParam param, CerePlatformUser user) throws CoBusinessException;
ProductClassify getById(Long classifyId) throws CoBusinessException;
CereProductClassify getById(Long classifyId) throws CoBusinessException;
Page getAll(ClassifyGetAllParam param) throws CoBusinessException;

81
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/product/impl/CereProductClassifyServiceImpl.java

@ -5,26 +5,26 @@
*/
package com.shop.cereshop.admin.service.product.impl;
import com.alibaba.fastjson.JSON;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.shop.cereshop.admin.dao.product.CereProductClassifyDAO;
import com.shop.cereshop.commons.constant.IntegerEnum;
import com.shop.cereshop.commons.constant.LongEnum;
import com.shop.cereshop.commons.domain.common.Page;
import com.shop.cereshop.admin.page.product.ProductClassify;
import com.shop.cereshop.admin.param.product.ClassifyDeleteParam;
import com.shop.cereshop.admin.param.product.ClassifyGetAllParam;
import com.shop.cereshop.admin.param.product.ClassifyLevelParam;
import com.shop.cereshop.admin.service.log.CerePlatformLogService;
import com.shop.cereshop.admin.service.product.CereProductClassifyService;
import com.shop.cereshop.commons.constant.CoReturnFormat;
import com.shop.cereshop.commons.domain.image.Image;
import com.shop.cereshop.commons.constant.IntegerEnum;
import com.shop.cereshop.commons.constant.LongEnum;
import com.shop.cereshop.commons.domain.common.Page;
import com.shop.cereshop.commons.domain.product.CereProductClassify;
import com.shop.cereshop.commons.domain.product.CereShopProduct;
import com.shop.cereshop.commons.domain.product.Classify;
import com.shop.cereshop.commons.domain.user.CerePlatformUser;
import com.shop.cereshop.commons.exception.CoBusinessException;
import com.shop.cereshop.commons.utils.EmptyUtils;
import com.shop.cereshop.commons.utils.ProjectUtil;
import com.shop.cereshop.commons.utils.TimeUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -54,7 +54,7 @@ public class CereProductClassifyServiceImpl implements CereProductClassifyServic
List<CereProductClassify> updates=new ArrayList<>();
if(!EmptyUtils.isEmpty(param.getClassifies())){
//遍历一级类别
for (ProductClassify classify:param.getClassifies()) {
for (CereProductClassify classify:param.getClassifies()) {
//新增一级类别数据
addOneClassify(classify,time,updates);
}
@ -67,19 +67,20 @@ public class CereProductClassifyServiceImpl implements CereProductClassifyServic
cerePlatformLogService.addLog(user,"商品类别","平台端操作","添加商品类别",null,time);
}
private void addOneClassify(ProductClassify classify, String time,List<CereProductClassify> updates) throws CoBusinessException{
if(EmptyUtils.isEmpty(classify.getCategoryName())){
private void addOneClassify(CereProductClassify classify, String time,List<CereProductClassify> updates) throws CoBusinessException{
if(EmptyUtils.isEmpty(classify.getClassifyName())){
throw new CoBusinessException(CoReturnFormat.CLASSIFY_NAME_NULL);
}
CereProductClassify cereProductClassify=new CereProductClassify();
cereProductClassify.setClassifyId(classify.getId());
cereProductClassify.setClassifyName(classify.getCategoryName());
cereProductClassify.setClassifyId(classify.getClassifyId());
cereProductClassify.setClassifyName(classify.getClassifyName());
cereProductClassify.setClassifyPid(LongEnum.ROOT.getCode());
cereProductClassify.setClassifyImage(classify.getCategoryImg());
cereProductClassify.setClassifyImage(classify.getClassifyImage());
cereProductClassify.setClassifyLevel(IntegerEnum.CLASSIFY_LEVEL_ONE.getCode());
cereProductClassify.setLink(classify.getLink());
cereProductClassify.setClassifyHierarchy("-"+classify.getCategoryName());
if(!EmptyUtils.isEmpty(classify.getId())){
cereProductClassify.setProject(ProjectUtil.DEFAULT_PROJECT);
cereProductClassify.setClassifyHierarchy("-"+classify.getClassifyName());
if(!EmptyUtils.isLongEmpty(classify.getClassifyId())){
//更新一级类别
cereProductClassify.setUpdateTime(time);
cereProductClassify.setClassifyLevelHierarchy("/"+cereProductClassify.getClassifyId());
@ -93,7 +94,7 @@ public class CereProductClassifyServiceImpl implements CereProductClassifyServic
}
if(!EmptyUtils.isEmpty(classify.getChilds())){
//新增子级类别
for (ProductClassify productClassify:classify.getChilds()) {
for (CereProductClassify productClassify:classify.getChilds()) {
addChildClaasify(cereProductClassify,
updates,time,productClassify,IntegerEnum.CLASSIFY_LEVEL_TWO.getCode());
}
@ -101,19 +102,20 @@ public class CereProductClassifyServiceImpl implements CereProductClassifyServic
}
private void addChildClaasify(CereProductClassify parent, List<CereProductClassify> updates,
String time,ProductClassify child,Integer level) throws CoBusinessException{
if(EmptyUtils.isEmpty(child.getCategoryName())){
String time, CereProductClassify child,Integer level) throws CoBusinessException{
if(EmptyUtils.isEmpty(child.getClassifyName())){
throw new CoBusinessException(CoReturnFormat.CLASSIFY_NAME_NULL);
}
CereProductClassify productClassify=new CereProductClassify();
productClassify.setClassifyId(child.getId());
productClassify.setClassifyName(child.getCategoryName());
productClassify.setClassifyId(child.getClassifyId());
productClassify.setClassifyName(child.getClassifyName());
productClassify.setClassifyPid(parent.getClassifyId());
productClassify.setClassifyLevel(level);
productClassify.setLink(child.getLink());
productClassify.setClassifyImage(child.getCategoryImg());
productClassify.setClassifyHierarchy(parent.getClassifyHierarchy()+"-"+child.getCategoryName());
if(!EmptyUtils.isEmpty(child.getId())){
productClassify.setClassifyImage(child.getClassifyImage());
productClassify.setProject(ProjectUtil.DEFAULT_PROJECT);
productClassify.setClassifyHierarchy(parent.getClassifyHierarchy()+"-"+child.getClassifyName());
if(!EmptyUtils.isLongEmpty(child.getClassifyId())){
//更新子级类别
productClassify.setUpdateTime(time);
productClassify.setClassifyLevelHierarchy(parent.getClassifyLevelHierarchy()+"/"+productClassify.getClassifyId());
@ -127,7 +129,7 @@ public class CereProductClassifyServiceImpl implements CereProductClassifyServic
}
if(!EmptyUtils.isEmpty(child.getChilds())){
//新增子级类别
for (ProductClassify classify1:child.getChilds()) {
for (CereProductClassify classify1:child.getChilds()) {
addChildClaasify(productClassify,updates,time,classify1,IntegerEnum.CLASSIFY_LEVEL_THREE.getCode());
}
}
@ -139,10 +141,13 @@ public class CereProductClassifyServiceImpl implements CereProductClassifyServic
String time=TimeUtils.yyMMddHHmmss();
//定义批量更新层级结构字段数组
List<CereProductClassify> updates=new ArrayList<>();
if(!EmptyUtils.isEmpty(param.getClassifies())){
for (ProductClassify classify:param.getClassifies()) {
for (CereProductClassify classify:param.getClassifies()) {
addOneClassify(classify,time,updates);
}
System.out.println("11111");
System.out.println(JSON.toJSON(param.getClassifies()));
if(!EmptyUtils.isEmpty(updates)){
//批量更新分类层级结构
cereProductClassifyDAO.updateBatchLevelHierarchy(updates);
@ -157,37 +162,21 @@ public class CereProductClassifyServiceImpl implements CereProductClassifyServic
}
@Override
public ProductClassify getById(Long classifyId) throws CoBusinessException {
ProductClassify result=new ProductClassify();
public CereProductClassify getById(Long classifyId) throws CoBusinessException {
//查询一级类别数据
CereProductClassify classify=cereProductClassifyDAO.getById(classifyId);
CereProductClassify classify=cereProductClassifyDAO.selectByPrimaryKey(classifyId);
if(classify!=null){
result.setId(classify.getClassifyId());
result.setCategoryName(classify.getClassifyName());
result.setLink(classify.getLink());
result.setDepth(classify.getClassifyLevel());
result.setCategoryImg(classify.getClassifyImage());
List<Image> images=new ArrayList<>();
Image image=new Image();
image.setImgPath(classify.getClassifyImage());
images.add(image);
result.setCategoryImgArray(images);
//查询所有二级分类
List<ProductClassify> classifies=cereProductClassifyDAO.findByPid(classify.getClassifyId());
List<CereProductClassify> classifies=cereProductClassifyDAO.findByPid(classify.getClassifyId());
if(!EmptyUtils.isEmpty(classifies)){
//查询所有三级分类
classifies.forEach(a -> {
a.setChilds(cereProductClassifyDAO.findByPid(a.getId()));
List<Image> childImages=new ArrayList<>();
Image child=new Image();
child.setImgPath(a.getCategoryImg());
childImages.add(child);
a.setCategoryImgArray(childImages);
a.setChilds( cereProductClassifyDAO.findByPid(a.getClassifyId()));
});
result.setChilds(classifies);
classify.setChilds(classifies);
}
}
return result;
return classify;
}
@Override
@ -209,7 +198,7 @@ public class CereProductClassifyServiceImpl implements CereProductClassifyServic
}
String time =TimeUtils.yyMMddHHmmss();
//查询一级类别层级
CereProductClassify classify=cereProductClassifyDAO.getById(param.getOneClassifyId());
CereProductClassify classify=cereProductClassifyDAO.selectByPrimaryKey(param.getOneClassifyId());
if(classify!=null){
//删除一级类别
cereProductClassifyDAO.deleteByPrimaryKey(param.getOneClassifyId());

18
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/sharesetting/impl/CerePlatformShareSettingServiceImpl.java

@ -11,7 +11,6 @@ import com.shop.cereshop.admin.dao.product.CereProductClassifyDAO;
import com.shop.cereshop.admin.dao.product.CereShopProductDAO;
import com.shop.cereshop.admin.dao.sharesetting.CerePlatformShareSettingDAO;
import com.shop.cereshop.admin.dao.shop.CerePlatformShopDAO;
import com.shop.cereshop.admin.page.product.ProductClassify;
import com.shop.cereshop.admin.page.product.ShopProduct;
import com.shop.cereshop.admin.page.sharesetting.PlatformShareSetting;
import com.shop.cereshop.admin.page.shop.ShopGetAll;
@ -24,6 +23,7 @@ import com.shop.cereshop.admin.param.shop.ShopGetAllParam;
import com.shop.cereshop.admin.service.log.CerePlatformLogService;
import com.shop.cereshop.admin.service.sharesetting.CerePlatformShareSettingService;
import com.shop.cereshop.commons.domain.common.Page;
import com.shop.cereshop.commons.domain.product.CereProductClassify;
import com.shop.cereshop.commons.domain.sharesettng.CerePlatformShareSetting;
import com.shop.cereshop.commons.domain.user.CerePlatformUser;
import com.shop.cereshop.commons.exception.CoBusinessException;
@ -132,11 +132,11 @@ public class CerePlatformShareSettingServiceImpl implements CerePlatformShareSet
if(platformShareSetting.getShareTargetType() == 1){
List<Long> productClassifyIdList = new ArrayList<>();
productClassifyIdList.add(platformShareSetting.getShareTargetId());
List<ProductClassify> classifyList = cereProductClassifyDAO.findByIds(productClassifyIdList);
ProductClassify classify = classifyList.stream().filter(item -> Objects.equals(item.getId(), platformShareSetting.getShareTargetId())).findFirst().orElse(null);
List<CereProductClassify> classifyList = cereProductClassifyDAO.findByIds(productClassifyIdList);
CereProductClassify classify = classifyList.stream().filter(item -> Objects.equals(item.getClassifyId(), platformShareSetting.getShareTargetId())).findFirst().orElse(null);
if (classify != null) {
platformShareSetting.setName(classify.getCategoryName());
platformShareSetting.setAvater(classify.getCategoryImg());
platformShareSetting.setName(classify.getClassifyName());
platformShareSetting.setAvater(classify.getClassifyImage());
}
}else if(platformShareSetting.getShareTargetType() == 2){
//查询商家信息
@ -182,13 +182,13 @@ public class CerePlatformShareSettingServiceImpl implements CerePlatformShareSet
List<Long> productClassifyIdList = platformShareSettingList.stream().filter(item -> item.getShareTargetType() == 1)
.map(PlatformShareSetting::getShareTargetId).collect(Collectors.toList());
if (!productClassifyIdList.isEmpty()){
List<ProductClassify> classifyList = cereProductClassifyDAO.findByIds(productClassifyIdList);
List<CereProductClassify> classifyList = cereProductClassifyDAO.findByIds(productClassifyIdList);
for (PlatformShareSetting platformShareSetting : platformShareSettingList) {
if(platformShareSetting.getShareTargetType() == 1){
ProductClassify classify = classifyList.stream().filter(item -> Objects.equals(item.getId(), platformShareSetting.getShareTargetId())).findFirst().orElse(null);
CereProductClassify classify = classifyList.stream().filter(item -> Objects.equals(item.getClassifyId(), platformShareSetting.getShareTargetId())).findFirst().orElse(null);
if (classify != null) {
platformShareSetting.setName(classify.getCategoryName());
platformShareSetting.setAvater(classify.getCategoryImg());
platformShareSetting.setName(classify.getClassifyName());
platformShareSetting.setAvater(classify.getClassifyImage());
}
}
}

2
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/shop/CerePlatformShopService.java

@ -43,8 +43,6 @@ public interface CerePlatformShopService {
void updateDate(CerePlatformShop cerePlatformShop) throws CoBusinessException;
FinanceCount getAllFinance(FinanceParam param) throws CoBusinessException;
Long findBusinessId(Long shopId);
List<CerePlatformShop> findAll();

3
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/shop/CereShopCheckService.java

@ -5,6 +5,7 @@
*/
package com.shop.cereshop.admin.service.shop;
import com.shop.cereshop.admin.page.business.Business;
import com.shop.cereshop.commons.domain.common.Page;
import com.shop.cereshop.admin.page.shop.Shop;
import com.shop.cereshop.admin.param.shopcheck.CheckDeleteParam;
@ -16,7 +17,7 @@ import com.shop.cereshop.commons.exception.CoBusinessException;
public interface CereShopCheckService {
Page getAll(CheckGetAllParam param) throws CoBusinessException;
Shop getById(Long shopId) throws CoBusinessException;
Business getById(Long businessId) throws CoBusinessException;
void handle(CheckHandleParam param, CerePlatformUser user) throws CoBusinessException,Exception;

107
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/shop/impl/CerePlatformShopServiceImpl.java

@ -5,20 +5,17 @@
*/
package com.shop.cereshop.admin.service.shop.impl;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.shop.cereshop.admin.dao.shop.CerePlatformShopDAO;
import com.shop.cereshop.admin.page.finance.Finance;
import com.shop.cereshop.admin.page.finance.FinanceCount;
import com.shop.cereshop.admin.page.shop.Shop;
import com.shop.cereshop.admin.page.shop.ShopGetAll;
import com.shop.cereshop.admin.param.finance.FinanceParam;
import com.shop.cereshop.admin.param.shop.ShopGetAllParam;
import com.shop.cereshop.admin.param.shop.ShopSaveParam;
import com.shop.cereshop.admin.param.shop.ShopStartParam;
import com.shop.cereshop.admin.param.shop.ShopUpdateParam;
import com.shop.cereshop.admin.service.business.CereBusinessShopService;
import com.shop.cereshop.admin.service.business.CerePlatformBusinessService;
import com.shop.cereshop.admin.service.common.CommonService;
import com.shop.cereshop.admin.service.log.CerePlatformLogService;
import com.shop.cereshop.admin.service.product.CereShopProductService;
@ -26,13 +23,10 @@ import com.shop.cereshop.admin.service.shop.CerePlatformShopService;
import com.shop.cereshop.admin.utils.EncodeUtil;
import com.shop.cereshop.commons.constant.CoReturnFormat;
import com.shop.cereshop.commons.constant.IntegerEnum;
import com.shop.cereshop.commons.domain.business.CereBusinessShop;
import com.shop.cereshop.commons.domain.business.CerePlatformBusiness;
import com.shop.cereshop.commons.domain.common.Page;
import com.shop.cereshop.commons.domain.shop.CerePlatformShop;
import com.shop.cereshop.commons.domain.user.CerePlatformUser;
import com.shop.cereshop.commons.exception.CoBusinessException;
import com.shop.cereshop.commons.utils.EmptyUtils;
import com.shop.cereshop.commons.utils.EncryptUtil;
import com.shop.cereshop.commons.utils.TimeUtils;
import org.springframework.beans.BeanUtils;
@ -42,9 +36,7 @@ import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class CerePlatformShopServiceImpl implements CerePlatformShopService {
@ -53,12 +45,6 @@ public class CerePlatformShopServiceImpl implements CerePlatformShopService {
private CerePlatformShopDAO cerePlatformShopDAO;
@Autowired
private CerePlatformBusinessService cerePlatformBusinessService;
@Autowired
private CereBusinessShopService cereBusinessShopService;
@Autowired
private CommonService commonService;
@Autowired
@ -73,45 +59,32 @@ public class CerePlatformShopServiceImpl implements CerePlatformShopService {
@Override
@Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class})
public void save(ShopSaveParam param, CerePlatformUser user) throws CoBusinessException {
//校验店铺名称是否存在
CerePlatformShop shop=findByShopName(param.getShopName());
if(shop!=null){
throw new CoBusinessException(CoReturnFormat.SHOP_NAME_ALREADY);
}
List <CerePlatformShop> cerePlatformShopList = cerePlatformShopDAO.selectList(Wrappers.<CerePlatformShop>lambdaQuery().eq(CerePlatformShop::getBusinessId, param.getBusinessId()));
if(CollectionUtils.isNotEmpty(cerePlatformShopList) && cerePlatformShopList.size() >= 10){
throw new CoBusinessException("10000","一个商家最多只能拥有10个店铺", "");
}
//新建商家数据
String time= TimeUtils.yyMMddHHmmss();
CerePlatformShop cerePlatformShop=new CerePlatformShop();
BeanUtils.copyProperties(param, cerePlatformShop);
if(EmptyUtils.isEmpty(param.getShopPassword())){
cerePlatformShop.setShopPassword(EncryptUtil.encrypt("123456"));
}else {
cerePlatformShop.setShopPassword(EncryptUtil.encrypt(param.getShopPassword()));
}
CerePlatformBusiness business = cerePlatformBusinessService.findByPhone(param.getChargePersonPhone());
if (business != null) {
throw new CoBusinessException(CoReturnFormat.PHONE_ALREADY_BIND_SHOP);
}
//生成店铺编号
String shopCode=commonService.getShopCode();
cerePlatformShop.setShopCode(shopCode);
cerePlatformShop.setAuthenticationState(IntegerEnum.APPROVED.getCode());
cerePlatformShop.setCheckState(IntegerEnum.UNTREATED.getCode());
cerePlatformShop.setCheckState(IntegerEnum.ADOPT.getCode());
cerePlatformShop.setState(IntegerEnum.YES.getCode());
cerePlatformShop.setCreateTime(time);
cerePlatformShop.setUpdateTime(time);
cerePlatformShopDAO.insert(cerePlatformShop);
//同步新增商家用户数据
CerePlatformBusiness cerePlatformBusiness=new CerePlatformBusiness();
cerePlatformBusiness.setCreateTime(time);
cerePlatformBusiness.setUsername(cerePlatformShop.getShopPhone());
cerePlatformBusiness.setPassword(cerePlatformShop.getShopPassword());
cerePlatformBusiness.setName(cerePlatformShop.getChargePersonName());
cerePlatformBusiness.setPhone(cerePlatformShop.getChargePersonPhone());
cerePlatformBusiness.setState(IntegerEnum.YES.getCode());
cerePlatformBusinessService.insert(cerePlatformBusiness);
//同步新增商家用户绑定店铺数据
CereBusinessShop cereBusinessShop=new CereBusinessShop();
cereBusinessShop.setBusinessUserId(cerePlatformBusiness.getBusinessUserId());
cereBusinessShop.setShopId(cerePlatformShop.getShopId());
cereBusinessShop.setIfBinding(IntegerEnum.YES.getCode());
cereBusinessShopService.insert(cereBusinessShop);
//新增日志
cerePlatformLogService.addLog(user,"商家管理","平台端操作","添加商家",String.valueOf(cereBusinessShop.getShopId()),time);
cerePlatformLogService.addLog(user,"商家管理","平台端操作","添加商家",String.valueOf(cerePlatformShop.getShopId()),time);
}
@Override
@ -143,15 +116,6 @@ public class CerePlatformShopServiceImpl implements CerePlatformShopService {
cerePlatformShop.setUpdateTime(time);
//修改商家数据
cerePlatformShopDAO.updateById(cerePlatformShop);
//根据商家用户id查询用户数据
CerePlatformBusiness cerePlatformBusiness=cerePlatformShopDAO.findBusiness(param.getBusinessUserId());
if(cerePlatformBusiness!=null){
cerePlatformBusiness.setUpdateTime(time);
cerePlatformBusiness.setUsername(cerePlatformShop.getShopPhone());
cerePlatformBusiness.setPassword(cerePlatformShop.getShopPassword());
cerePlatformBusiness.setName(cerePlatformShop.getChargePersonName());
cerePlatformBusinessService.update(cerePlatformBusiness);
}
//新增日志
cerePlatformLogService.addLog(user,"商家管理","平台端操作","修改商家",String.valueOf(cerePlatformShop.getShopId()),time);
}
@ -209,47 +173,6 @@ public class CerePlatformShopServiceImpl implements CerePlatformShopService {
}
@Override
public FinanceCount getAllFinance(FinanceParam param) throws CoBusinessException {
PageHelper.startPage(param.getPage(),param.getPageSize());
List<Finance> list=cerePlatformShopDAO.getAllFinance(param);
PageInfo<Finance> pageInfo=new PageInfo<>(list);
if(!EmptyUtils.isEmpty(list)){
list=list.stream()
//查询冻结金额
.peek(a -> a.setFrozen(cerePlatformShopDAO.finFrozen(a.getShopId())))
//查询已提金额
.peek(a -> a.setHaveWithdrawable(cerePlatformShopDAO.findHaveWithdrawal(a.getShopId())))
//查询已退款金额
.peek(a -> a.setRefund(cerePlatformShopDAO.findRefund(a.getShopId())))
//可提现金额 = 总营收 - 已提现 - 冻结 - 提现中
.peek(a -> a.setWithdrawable(a.getRevenue().subtract(a.getHaveWithdrawable())
.subtract(a.getFrozen()).subtract(cerePlatformShopDAO.findWithdrawing(a.getShopId()))))
.collect(Collectors.toList());
pageInfo.setList(list);
}
Page page=new Page(pageInfo.getList(),pageInfo.getTotal());
FinanceCount count=new FinanceCount();
BigDecimal decimal=BigDecimal.ZERO;
//查询营收总额
count.setRevenue(cerePlatformShopDAO.findRevenue());
//查询冻结中金额
count.setFrozen(cerePlatformShopDAO.finFrozen(null));
//查询总的提现金额
BigDecimal withdrawableMoney = cerePlatformShopDAO.getAllWithdrawableMoney();
//查询提现中的金额
BigDecimal stayMoney = cerePlatformShopDAO.getWithdrawableStayMoney();
//查询已提现金额
BigDecimal have=cerePlatformShopDAO.findHaveWithdrawal(null);
count.setHaveWithdrawable(have);
//计算可提现金额=总的提现金额-提现中金额-已提现金额
count.setWithdrawable(decimal.add(withdrawableMoney).subtract(stayMoney).subtract(have));
//查询已退款金额
count.setRefund(cerePlatformShopDAO.findRefund(null));
count.setPage(page);
return count;
}
@Override
public Long findBusinessId(Long shopId) {
return cerePlatformShopDAO.findBusinessId(shopId);
}

184
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/shop/impl/CereShopCheckServiceImpl.java

@ -8,27 +8,29 @@ package com.shop.cereshop.admin.service.shop.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.shop.cereshop.admin.dao.shop.CereShopCheckDAO;
import com.shop.cereshop.admin.page.business.Business;
import com.shop.cereshop.admin.page.permission.MenuButton;
import com.shop.cereshop.admin.page.shop.Shop;
import com.shop.cereshop.admin.param.shopcheck.CheckDeleteParam;
import com.shop.cereshop.admin.param.shopcheck.CheckGetAllParam;
import com.shop.cereshop.admin.param.shopcheck.CheckHandleParam;
import com.shop.cereshop.admin.service.business.CereBusinessUserRoleService;
import com.shop.cereshop.admin.service.business.*;
import com.shop.cereshop.admin.service.dict.CerePlatformDictService;
import com.shop.cereshop.admin.service.log.CerePlatformLogService;
import com.shop.cereshop.admin.service.permission.CerePlatformPermissionService;
import com.shop.cereshop.admin.service.role.CerePlatformRolePermissionService;
import com.shop.cereshop.admin.service.role.CerePlatformRoleService;
import com.shop.cereshop.admin.service.shop.*;
import com.shop.cereshop.admin.service.shop.CereShopCheckService;
import com.shop.cereshop.admin.service.shop.CereShopRelationshipService;
import com.shop.cereshop.admin.utils.EncodeUtil;
import com.shop.cereshop.commons.constant.CoReturnFormat;
import com.shop.cereshop.commons.constant.IntegerEnum;
import com.shop.cereshop.commons.domain.business.CereBusinessUserRole;
import com.shop.cereshop.commons.domain.business.*;
import com.shop.cereshop.commons.domain.common.Page;
import com.shop.cereshop.commons.domain.permission.CerePlatformPermission;
import com.shop.cereshop.commons.domain.role.CerePlatformRole;
import com.shop.cereshop.commons.domain.role.CerePlatformRolePermission;
import com.shop.cereshop.commons.domain.shop.*;
import com.shop.cereshop.commons.domain.shop.CereShopCheck;
import com.shop.cereshop.commons.domain.shop.CereShopRelationship;
import com.shop.cereshop.commons.domain.user.CerePlatformUser;
import com.shop.cereshop.commons.exception.CoBusinessException;
import com.shop.cereshop.commons.utils.EmptyUtils;
@ -54,7 +56,7 @@ public class CereShopCheckServiceImpl implements CereShopCheckService {
private CereShopCheckDAO cereShopCheckDAO;
@Autowired
private CerePlatformShopService cerePlatformShopService;
private CerePlatformBusinessService cerePlatformBusinessService;
@Autowired
private CereShopPersonalService cereShopPersonalService;
@ -94,7 +96,7 @@ public class CereShopCheckServiceImpl implements CereShopCheckService {
@Override
public Page getAll(CheckGetAllParam param) throws CoBusinessException {
List<Shop> list=null;
List<Business> list=null;
PageHelper.startPage(param.getPage(),param.getPageSize());
if(IntegerEnum.UNTREATED.getCode().equals(param.getCheckState())){
//查询未处理入驻数据
@ -103,100 +105,100 @@ public class CereShopCheckServiceImpl implements CereShopCheckService {
//查询已处理入驻数据
list= cereShopCheckDAO.getAll(param);
}
for (Shop shop:list) {
shop.setShopPhone(encodeUtil.encodePhone(shop.getShopPhone()));
for (Business business:list) {
business.setBusinessPhone(encodeUtil.encodePhone(business.getBusinessPhone()));
}
PageInfo<Shop> pageInfo=new PageInfo<>(list);
PageInfo<Business> pageInfo=new PageInfo<>(list);
Page page=new Page(pageInfo.getList(),pageInfo.getTotal());
return page;
}
@Override
public Shop getById(Long shopId) throws CoBusinessException {
public Business getById(Long businessId) throws CoBusinessException {
//查询店铺信息
Shop shop=cerePlatformShopService.findShop(shopId);
if(shop!=null){
shop.setName(encodeUtil.encodeInfo(shop.getName()));
shop.setChargePersonName(encodeUtil.encodeInfo(shop.getChargePersonName()));
shop.setChargePersonPhone(encodeUtil.encodePhone(shop.getChargePersonPhone()));
shop.setShopAdress(encodeUtil.encodeInfo(shop.getShopAdress()));
shop.setShopPhone(encodeUtil.encodePhone(shop.getShopPhone()));
Business business=cerePlatformBusinessService.findBusiness(businessId);
if(business!=null){
business.setName(encodeUtil.encodeInfo(business.getName()));
business.setChargePersonName(encodeUtil.encodeInfo(business.getChargePersonName()));
business.setChargePersonPhone(encodeUtil.encodePhone(business.getChargePersonPhone()));
business.setBusinessAdress(encodeUtil.encodeInfo(business.getBusinessAdress()));
business.setBusinessPhone(encodeUtil.encodePhone(business.getBusinessPhone()));
//查询认证数据
if(IntegerEnum.PERSONAL.getCode().equals(shop.getAuthenType())){
if(IntegerEnum.PERSONAL.getCode().equals(business.getAuthenType())){
//个人认证
CereShopPersonal personal = cereShopPersonalService.findByShopId(shopId);
CereShopPersonal personal = cereShopPersonalService.findByBusinessId(businessId);
if(personal!=null){
shop.setServicePhone(encodeUtil.encodePhone(personal.getServicePhone()));
shop.setName(encodeUtil.encodeInfo(personal.getPersonalName()));
shop.setCardType(personal.getPersonalCardType());
shop.setIdCard(encodeUtil.encodeInfo(personal.getPersonalIdCard()));
shop.setCardTime(personal.getPersonalCardStartTime()+"-"+personal.getPersonalCardEndTime());
shop.setCardPositive(personal.getPersonalCardPositive());
shop.setCardSide(personal.getPersonalCardSide());
shop.setCardHand(personal.getPersonalCardHand());
business.setServicePhone(encodeUtil.encodePhone(personal.getServicePhone()));
business.setName(encodeUtil.encodeInfo(personal.getPersonalName()));
business.setCardType(personal.getPersonalCardType());
business.setIdCard(encodeUtil.encodeInfo(personal.getPersonalIdCard()));
business.setCardTime(personal.getPersonalCardStartTime()+"-"+personal.getPersonalCardEndTime());
business.setCardPositive(personal.getPersonalCardPositive());
business.setCardSide(personal.getPersonalCardSide());
business.setCardHand(personal.getPersonalCardHand());
}
}else if(IntegerEnum.INDIVIDUAL.getCode().equals(shop.getAuthenType())){
}else if(IntegerEnum.INDIVIDUAL.getCode().equals(business.getAuthenType())){
//个体工商户户认证
CereShopIndividualBusinesses businesses = cereShopIndividualBusinessesService.findByShopId(shopId);
CereShopIndividualBusinesses businesses = cereShopIndividualBusinessesService.findByBusinessId(businessId);
if(businesses!=null){
shop.setServicePhone(encodeUtil.encodePhone(businesses.getServicePhone()));
shop.setName(encodeUtil.encodeInfo(businesses.getSubjectOperator()));
shop.setCardType(businesses.getSubjectCardType());
shop.setIdCard(encodeUtil.encodeInfo(businesses.getSubjectIdCard()));
shop.setCardTime(businesses.getSubjectCardStartTime()+"-"+businesses.getSubjectCardEndTime());
shop.setCardPositive(businesses.getSubjectCardPositive());
shop.setCardSide(businesses.getSubjectCardSide());
shop.setSubjectName(businesses.getSubjectName());
shop.setSubjectCode(businesses.getSubjectCode());
shop.setSubjectAdress(businesses.getSubjectRegion());
shop.setAdress(businesses.getSubjectAdress());
shop.setSubjectStartTime(businesses.getSubjectStartTime());
shop.setSubjectEndTime(businesses.getSubjectEndTime());
shop.setSubjectLicense(EmptyUtils.getImages(businesses.getSubjectLicense()));
business.setServicePhone(encodeUtil.encodePhone(businesses.getServicePhone()));
business.setName(encodeUtil.encodeInfo(businesses.getSubjectOperator()));
business.setCardType(businesses.getSubjectCardType());
business.setIdCard(encodeUtil.encodeInfo(businesses.getSubjectIdCard()));
business.setCardTime(businesses.getSubjectCardStartTime()+"-"+businesses.getSubjectCardEndTime());
business.setCardPositive(businesses.getSubjectCardPositive());
business.setCardSide(businesses.getSubjectCardSide());
business.setSubjectName(businesses.getSubjectName());
business.setSubjectCode(businesses.getSubjectCode());
business.setSubjectAdress(businesses.getSubjectRegion());
business.setAdress(businesses.getSubjectAdress());
business.setSubjectStartTime(businesses.getSubjectStartTime());
business.setSubjectEndTime(businesses.getSubjectEndTime());
business.setSubjectLicense(EmptyUtils.getImages(businesses.getSubjectLicense()));
}
}else if(IntegerEnum.ENTERPRICE.getCode().equals(shop.getAuthenType())){
}else if(IntegerEnum.ENTERPRICE.getCode().equals(business.getAuthenType())){
//企业认证
CereShopEnterprise enterprise = cereShopEnterpriseService.findByShopId(shopId);
CereShopEnterprise enterprise = cereShopEnterpriseService.findByBusinessId(businessId);
if(enterprise!=null){
shop.setServicePhone(encodeUtil.encodePhone(enterprise.getServicePhone()));
shop.setName(encodeUtil.encodeInfo(enterprise.getEnterpriseOperator()));
shop.setCardType(enterprise.getEnterpriseCardType());
shop.setIdCard(encodeUtil.encodeInfo(enterprise.getEnterpriseIdCard()));
shop.setCardTime(enterprise.getEnterpriseCardStartTime()+"-"+enterprise.getEnterpriseCardEndTime());
shop.setCardPositive(enterprise.getEnterpriseCardPositive());
shop.setCardSide(enterprise.getEnterpriseCardSide());
shop.setSubjectName(enterprise.getEnterpriseName());
shop.setSubjectCode(enterprise.getEnterpriseCode());
shop.setSubjectAdress(enterprise.getEnterpriseRegion());
shop.setAdress(enterprise.getEnterpriseAdress());
shop.setSubjectStartTime(enterprise.getEnterpriseStartTime());
shop.setSubjectEndTime(enterprise.getEnterpriseEndTime());
shop.setSubjectLicense(EmptyUtils.getImages(enterprise.getEnterpriseLicense()));
business.setServicePhone(encodeUtil.encodePhone(enterprise.getServicePhone()));
business.setName(encodeUtil.encodeInfo(enterprise.getEnterpriseOperator()));
business.setCardType(enterprise.getEnterpriseCardType());
business.setIdCard(encodeUtil.encodeInfo(enterprise.getEnterpriseIdCard()));
business.setCardTime(enterprise.getEnterpriseCardStartTime()+"-"+enterprise.getEnterpriseCardEndTime());
business.setCardPositive(enterprise.getEnterpriseCardPositive());
business.setCardSide(enterprise.getEnterpriseCardSide());
business.setSubjectName(enterprise.getEnterpriseName());
business.setSubjectCode(enterprise.getEnterpriseCode());
business.setSubjectAdress(enterprise.getEnterpriseRegion());
business.setAdress(enterprise.getEnterpriseAdress());
business.setSubjectStartTime(enterprise.getEnterpriseStartTime());
business.setSubjectEndTime(enterprise.getEnterpriseEndTime());
business.setSubjectLicense(EmptyUtils.getImages(enterprise.getEnterpriseLicense()));
}
}else if(IntegerEnum.ORGANIZATION.getCode().equals(shop.getAuthenType())){
}else if(IntegerEnum.ORGANIZATION.getCode().equals(business.getAuthenType())){
//其他组织认证
CereShopOtherOrganizations otherOrganizations = cereShopOtherOrganizationsService.findByShopId(shopId);
CereShopOtherOrganizations otherOrganizations = cereShopOtherOrganizationsService.findByBusinessId(businessId);
if(otherOrganizations!=null){
shop.setServicePhone(encodeUtil.encodePhone(otherOrganizations.getServicePhone()));
shop.setName(encodeUtil.encodeInfo(otherOrganizations.getOtherOperator()));
shop.setCardType(otherOrganizations.getOtherCardType());
shop.setIdCard(encodeUtil.encodeInfo(otherOrganizations.getOtherIdCard()));
shop.setCardTime(otherOrganizations.getOtherCardStartTime()+"-"+otherOrganizations.getOtherCardEndTime());
shop.setCardPositive(otherOrganizations.getOtherCardPositive());
shop.setCardSide(otherOrganizations.getOtherCardSide());
shop.setSubjectName(otherOrganizations.getOtherName());
shop.setSubjectCode(otherOrganizations.getOtherCode());
shop.setSubjectAdress(otherOrganizations.getOtherRegion());
shop.setAdress(otherOrganizations.getOtherAdress());
shop.setSubjectStartTime(otherOrganizations.getOtherStartTime());
shop.setSubjectEndTime(otherOrganizations.getOtherEndTime());
shop.setSubjectLicense(EmptyUtils.getImages(otherOrganizations.getOtherLicense()));
business.setServicePhone(encodeUtil.encodePhone(otherOrganizations.getServicePhone()));
business.setName(encodeUtil.encodeInfo(otherOrganizations.getOtherOperator()));
business.setCardType(otherOrganizations.getOtherCardType());
business.setIdCard(encodeUtil.encodeInfo(otherOrganizations.getOtherIdCard()));
business.setCardTime(otherOrganizations.getOtherCardStartTime()+"-"+otherOrganizations.getOtherCardEndTime());
business.setCardPositive(otherOrganizations.getOtherCardPositive());
business.setCardSide(otherOrganizations.getOtherCardSide());
business.setSubjectName(otherOrganizations.getOtherName());
business.setSubjectCode(otherOrganizations.getOtherCode());
business.setSubjectAdress(otherOrganizations.getOtherRegion());
business.setAdress(otherOrganizations.getOtherAdress());
business.setSubjectStartTime(otherOrganizations.getOtherStartTime());
business.setSubjectEndTime(otherOrganizations.getOtherEndTime());
business.setSubjectLicense(EmptyUtils.getImages(otherOrganizations.getOtherLicense()));
}
}
//查询证件类型名称
shop.setCardTypeName(cerePlatformDictService.findNameById(shop.getCardType()));
business.setCardTypeName(cerePlatformDictService.findNameById(business.getCardType()));
}
return shop;
return business;
}
@Override
@ -210,35 +212,35 @@ public class CereShopCheckServiceImpl implements CereShopCheckService {
}
//新增入驻申请处理数据
CereShopCheck cereShopCheck=new CereShopCheck();
cereShopCheck.setShopId(param.getShopId());
cereShopCheck.setShopId(param.getBusinessId());
cereShopCheck.setCheckHandle(param.getCheckHandle());
cereShopCheck.setReason(param.getReason());
cereShopCheck.setCreateTime(time);
cereShopCheckDAO.insert(cereShopCheck);
String describe="";
CerePlatformShop cerePlatformShop=new CerePlatformShop();
cerePlatformShop.setUpdateTime(time);
cerePlatformShop.setShopId(param.getShopId());
cerePlatformShop.setEffectiveDate(param.getEffectiveDate());
cerePlatformShop.setEffectiveYear(param.getEffectiveYear());
CerePlatformBusiness cerePlatformBusiness=new CerePlatformBusiness();
cerePlatformBusiness.setUpdateTime(time);
cerePlatformBusiness.setBusinessId(param.getBusinessId());
cerePlatformBusiness.setEffectiveDate(param.getEffectiveDate());
cerePlatformBusiness.setEffectiveYear(param.getEffectiveYear());
if(IntegerEnum.SHOP_CHECK_SUCCESS.getCode().equals(param.getCheckHandle())){
describe="同意入驻";
//同意入驻申请
//更新店铺生效日期数据
cerePlatformShop.setCheckState(IntegerEnum.ADOPT.getCode());
cerePlatformBusiness.setCheckState(IntegerEnum.ADOPT.getCode());
//初始化商家端角色菜单权限数据
setPermission(param.getShopId(),time);
setPermission(param.getBusinessId(),time);
//初始化默认分销关系
initShopRelationship(param.getShopId());
initShopRelationship(param.getBusinessId());
//发送短信
}else {
describe="拒绝入驻";
//拒绝入驻
//更新店铺审核状态
cerePlatformShop.setCheckState(IntegerEnum.REFUSE.getCode());
cerePlatformBusiness.setCheckState(IntegerEnum.REFUSE.getCode());
//发送短信
}
cerePlatformShopService.updateDate(cerePlatformShop);
cerePlatformBusinessService.updateDate(cerePlatformBusiness);
//新增日志
cerePlatformLogService.addLog(user,"入驻申请管理","平台端操作",describe,String.valueOf(cereShopCheck.getShopId()),time);
}
@ -267,7 +269,7 @@ public class CereShopCheckServiceImpl implements CereShopCheckService {
role.setRoleName("管理员");
cerePlatformRoleService.insert(role);
//查询店铺账号id
Long businessId=cerePlatformShopService.findBusinessId(shopId);
Long businessId=cerePlatformBusinessService.findBusinessUserId(shopId);
//新增店铺关联角色数据
CereBusinessUserRole cereBusinessUserRole=new CereBusinessUserRole();
cereBusinessUserRole.setBusinessUserId(businessId);
@ -304,7 +306,7 @@ public class CereShopCheckServiceImpl implements CereShopCheckService {
role.setRoleName("管理员");
cerePlatformRoleService.insert(role);
//查询店铺账号id
Long businessId=cerePlatformShopService.findBusinessId(shopId);
Long businessId=cerePlatformBusinessService.findBusinessUserId(shopId);
//新增店铺关联角色数据
CereBusinessUserRole cereBusinessUserRole=new CereBusinessUserRole();
cereBusinessUserRole.setBusinessUserId(businessId);

28
cereshop-admin/src/main/resources/mybatis/mapper/business/CereBusinessShopDAO.xml → cereshop-admin/src/main/resources/mybatis/mapper/business/CereBusinessUserDAO.xml

@ -1,37 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shop.cereshop.admin.dao.business.CereBusinessShopDAO">
<resultMap id="BaseResultMap" type="com.shop.cereshop.commons.domain.business.CereBusinessShop">
<mapper namespace="com.shop.cereshop.admin.dao.business.CereBusinessUserDAO">
<resultMap id="BaseResultMap" type="com.shop.cereshop.commons.domain.business.CereBusinessUser">
<result column="business_user_id" jdbcType="BIGINT" property="businessUserId" />
<result column="shop_id" jdbcType="BIGINT" property="shopId" />
<result column="business_id" jdbcType="BIGINT" property="businessId" />
<result column="if_binding" jdbcType="BIT" property="ifBinding" />
<result column="is_main_user" jdbcType="BIT" property="isMainUser" />
</resultMap>
<insert id="insertSelective" parameterType="com.shop.cereshop.commons.domain.business.CereBusinessShop">
insert into cere_business_shop
<insert id="insertSelective" parameterType="com.shop.cereshop.commons.domain.business.CereBusinessUser">
insert into cere_business_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="businessUserId != null">
business_user_id,
</if>
<if test="shopId != null">
shop_id,
<if test="businessId != null">
business_id,
</if>
<if test="ifBinding != null">
if_binding,
</if>
<if test="isMainUser != null">
is_main_user,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="businessUserId != null">
#{businessUserId,jdbcType=BIGINT},
</if>
<if test="shopId != null">
#{shopId,jdbcType=BIGINT},
<if test="businessId != null">
#{businessId,jdbcType=BIGINT},
</if>
<if test="ifBinding != null">
#{ifBinding,jdbcType=BIT},
</if>
<if test="isMainUser != null">
#{isMainUser,jdbcType=BIT},
</if>
</trim>
</insert>
<select id="selectAllProject" resultType="java.lang.Long">
select shop_id from cere_platform_shop where check_state = 1
select business_id from cere_platform_business where check_state = 1
</select>
</mapper>

582
cereshop-admin/src/main/resources/mybatis/mapper/business/CerePlatformBusinessDAO.xml

@ -1,153 +1,479 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shop.cereshop.admin.dao.business.CerePlatformBusinessDAO">
<resultMap id="BaseResultMap" type="com.shop.cereshop.commons.domain.business.CerePlatformBusiness">
<id column="business_user_id" jdbcType="BIGINT" property="businessUserId" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="sex" jdbcType="VARCHAR" property="sex" />
<result column="email" jdbcType="VARCHAR" property="email" />
<result column="token" jdbcType="VARCHAR" property="token" />
<result column="state" jdbcType="BIT" property="state" />
<result column="create_time" jdbcType="VARCHAR" property="createTime" />
<result column="update_time" jdbcType="VARCHAR" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
business_user_id, username, `password`, `name`, sex, email,token, `state`, create_time,
update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from cere_platform_business
where business_user_id = #{businessUserId,jdbcType=BIGINT}
</select>
<select id="findProjectByUsername" resultType="java.lang.Long">
SELECT
cbs.shop_id
FROM
cere_business_shop cbs
JOIN cere_platform_business cpb ON cpb.business_user_id = cbs.business_user_id
where
cpb.username = #{username}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from cere_platform_business
where business_user_id = #{businessUserId,jdbcType=BIGINT}
<resultMap id="BaseResultMap" type="com.shop.cereshop.commons.domain.business.CerePlatformBusiness">
<id column="business_id" jdbcType="BIGINT" property="businessId" />
<result column="business_code" jdbcType="VARCHAR" property="businessCode" />
<result column="business_name" jdbcType="VARCHAR" property="businessName" />
<result column="business_brief" jdbcType="VARCHAR" property="businessBrief" />
<result column="business_phone" jdbcType="VARCHAR" property="businessPhone" />
<result column="charge_person_name" jdbcType="VARCHAR" property="chargePersonName" />
<result column="charge_person_phone" jdbcType="VARCHAR" property="chargePersonPhone" />
<result column="business_adress_province" jdbcType="VARCHAR" property="businessAdressProvince" />
<result column="business_adress_city" jdbcType="VARCHAR" property="businessAdressCity" />
<result column="business_adress_detail" jdbcType="VARCHAR" property="businessAdressDetail" />
<result column="business_adress" jdbcType="VARCHAR" property="businessAdress" />
<result column="business_logo" jdbcType="VARCHAR" property="businessLogo" />
<result column="effective_date" jdbcType="VARCHAR" property="effectiveDate" />
<result column="effective_year" jdbcType="INTEGER" property="effectiveYear" />
<result column="contract_state" jdbcType="BIT" property="contractState" />
<result column="authentication_state" jdbcType="BIT" property="authenticationState" />
<result column="check_state" jdbcType="BIT" property="checkState" />
<result column="state" jdbcType="BIT" property="state" />
<result column="authen_type" jdbcType="BIT" property="authenType" />
<result column="wx_image" jdbcType="VARCHAR" property="wxImage" />
<result column="ailpay_image" jdbcType="VARCHAR" property="ailpayImage" />
<result column="create_time" jdbcType="VARCHAR" property="createTime" />
<result column="update_time" jdbcType="VARCHAR" property="updateTime" />
<result column="xs_pay_id" jdbcType="VARCHAR" property="xsPayId" />
<result column="share_days" jdbcType="INTEGER" property="shareDays" />
</resultMap>
<sql id="Base_Column_List">
business_id, business_code, business_name, business_brief, business_phone, charge_person_name,
charge_person_phone, business_adress_province, business_adress_city, business_adress_detail, business_adress,
business_logo, effective_date, effective_year, contract_state,
authentication_state, check_state, `state`,authen_type,wx_image,ailpay_image, create_time, update_time, xs_pay_id, share_days
</sql>
<!-- 删除店铺功能,待整理 -->
<delete id="cleanShop">
delete from cere_platform_business where business_id = #{shopId};
delete from cere_platform_shop where shop_id = #{shopId};
delete a from cere_sign_product a
join cere_activity_sign b on b.sign_id = a.sign_id and b.shop_id = #{shopId};
delete from cere_activity_sign where shop_id = #{shopId};
delete a from cere_after_dilever a join
cere_shop_order b on b.order_id = a.order_id and b.shop_id = #{shopId};
delete a from cere_after_product_attribute a
join cere_after_product b on b.after_product_id = a.after_product_id
join cere_shop_product c on c.product_id = b.product_id and c.shop_id = #{shopId};
delete a from cere_after_product a
join cere_shop_product b on b.product_id = a.product_id and b.shop_id = #{shopId};
delete from cere_business_buyer_user where shop_id = #{shopId};
delete from cere_business_shop where shop_id = #{shopId};
delete from cere_buyer_collect where shop_id = #{shopId};
delete a from cere_buyer_comment_like a
join cere_shop_comment b on b.comment_id = a.comment_id and b.shop_id = #{shopId};
delete a from cere_buyer_discount_visit a
join cere_shop_discount b on b.shop_discount_id = a.shop_discount_id and b.shop_id = #{shopId};
delete from cere_buyer_footprint where shop_id = #{shopId};
delete a from cere_buyer_polite_record a
join cere_shop_order b on b.order_id = a.order_id and b.shop_id = #{shopId};
delete a from cere_buyer_seckill_visit a
join cere_shop_seckill b on b.shop_seckill_id = a.shop_seckill_id and b.shop_id = #{shopId};
delete a from cere_buyer_shop_coupon a
join cere_shop_coupon b on b.shop_coupon_id = a.shop_coupon_id and b.shop_id = #{shopId};
delete a from cere_buyer_shop_label a
join cere_shop_label b on b.label_id = a.label_id and b.shop_id = #{shopId};
delete from cere_channel_coupon where shop_id = #{shopId};
delete a from cere_collage_order a
join cere_shop_group_work b on b.shop_group_work_id = a.shop_group_work_id and b.shop_id = #{shopId};
delete a from cere_shop_group_work a
join cere_shop_group_work b on b.shop_group_work_id = a.shop_group_work_id and b.shop_id = #{shopId};
delete a from cere_comment_word a
join cere_shop_product b on b.product_id = a.product_id and b.shop_id = #{shopId};
delete from cere_shop_group_work where shop_id = #{shopId};
delete a from cere_compose_product a
join cere_shop_compose b on b.compose_id = a.compose_id and b.shop_id = #{shopId};
delete from cere_customer_service_config where shop_id = #{shopId};
delete a from cere_distribution_order a
join cere_shop_order b on b.order_id = a.order_id and b.shop_id = #{shopId};
delete from cere_distributor_buyer where shop_id = #{shopId};
delete a from cere_label_attribute a
join cere_shop_label b on b.label_id = a.label_id and b.shop_id = #{shopId};
delete a from cere_label_source a
join cere_shop_label b on b.label_id = a.label_id and b.shop_id = #{shopId};
delete from cere_shop_label where shop_id = #{shopId};
delete a from cere_live_examine a
join cere_live b on a.live_id = b.id and b.shop_id = #{shopId};
delete a from cere_live_product_examine a
join cere_live_product b on b.id = a.live_product_id and b.shop_id = #{shopId};
delete a from cere_live_product_rel a
join cere_live_product b on b.id = a.live_product_id and b.shop_id = #{shopId};
delete a from cere_live_sale_stat a
join cere_live_product b on b.product_id = a.product_id and b.shop_id = #{shopId};
delete a from cere_logistics_charge a
join cere_order_logistics b on b.logistics_id = a.logistics_id and b.shop_id = #{shopId};
delete a from cere_order_after a
join cere_shop_order b on b.order_id = a.order_id and b.shop_id = #{shopId};
delete a from cere_order_dilever a
join cere_shop_order b on b.order_id = a.order_id and b.shop_id = #{shopId};
delete from cere_order_logistics where shop_id = #{shopId};
delete from cere_pay_log where shop_id = #{shopId};
delete from cere_live_product where shop_id = #{shopId};
delete from cere_live where shop_id = #{shopId};
delete a from cere_platform_after a
join cere_shop_order b on b.order_id = a.order_id and b.shop_id = #{shopId};
delete a from cere_platform_business a
join cere_business_shop b on b.business_user_id = a.business_user_id and b.shop_id = #{shopId};
delete a from cere_business_user_role a
join cere_business_shop b on b.business_user_id = a.business_user_id and b.shop_id = #{shopId};
delete a from cere_platform_role_permission a
join cere_platform_role b on b.role_id = a.role_id and b.project = #{shopId};
delete from cere_platform_permission where project = #{shopId};
delete from cere_platform_role where project = #{shopId};
delete from cere_platform_shop where shop_id = #{shopId};
delete a from cere_price_rule a
join cere_shop_price b on b.price_id = a.price_id and b.shop_id = #{shopId};
delete a from cere_price_product a
join cere_shop_product b on b.product_id = a.product_id and b.shop_id = #{shopId};
delete from cere_shop_price where shop_id = #{shopId};
delete from cere_privacy_verify_setting where project = #{shopId};
delete a from cere_product_answer a
join cere_shop_product b on b.product_id = a.product_id and b.shop_id = #{shopId};
delete a from cere_product_image a
join cere_shop_product b on b.product_id = a.product_id and b.shop_id = #{shopId};
delete a from cere_product_member a
join cere_shop_product b on b.product_id = a.product_id and b.shop_id = #{shopId};
delete a from cere_product_problem a
join cere_shop_product b on b.product_id = a.product_id and b.shop_id = #{shopId};
delete a from cere_sku_name a
join cere_product_sku b on b.sku_id = a.sku_id
join cere_shop_product c on c.product_id = b.product_id and c.shop_id = #{shopId};
delete a from cere_product_sku a
join cere_shop_product b on b.product_id = a.product_id and b.shop_id = #{shopId};
delete from cere_shop_bank where shop_id = #{shopId};
delete from cere_shop_banner where shop_id = #{shopId};
delete from cere_shop_check where shop_id = #{shopId};
delete from cere_shop_comment where shop_id = #{shopId};
delete from cere_shop_compose where shop_id = #{shopId};
delete from cere_shop_conversion where shop_id = #{shopId};
delete a from cere_shop_coupon_detail a
join cere_shop_coupon b on b.shop_coupon_id = a.shop_coupon_id and b.shop_id = #{shopId};
delete a from cere_shop_discount_detail a
join cere_shop_discount b on b.shop_discount_id = a.shop_discount_id and b.shop_id = #{shopId};
delete from cere_shop_crowd where shop_id = #{shopId};
delete from cere_shop_discount where shop_id = #{shopId};
delete from cere_shop_distribution_level where shop_id = #{shopId};
delete from cere_shop_distributor where shop_id = #{shopId};
delete from cere_shop_enterprise where shop_id = #{shopId};
delete from cere_shop_extension where shop_id = #{shopId};
delete a from cere_shop_group_detail a
join cere_shop_group b on b.shop_group_id = a.shop_group_id and b.shop_id = #{shopId};
delete from cere_shop_group where shop_id = #{shopId};
delete a from cere_shop_group_work_detail a
join cere_shop_group_work b on b.shop_group_work_id = a.shop_group_work_id and b.shop_id = #{shopId};
delete from cere_shop_enterprise where shop_id = #{shopId};
delete from cere_shop_individual_businesses where shop_id = #{shopId};
delete a from cere_shop_operate_detail a
join cere_shop_operate b on b.shop_operate_id = a.shop_operate_id and b.shop_id = #{shopId};
delete from cere_shop_operate where shop_id = #{shopId};
delete from cere_shop_other_organizations where shop_id = #{shopId};
delete from cere_shop_personal where shop_id = #{shopId};
delete from cere_shop_product where shop_id = #{shopId};
delete from cere_shop_recruit where shop_id = #{shopId};
delete from cere_shop_relationship where shop_id = #{shopId};
delete from cere_shop_return where shop_id = #{shopId};
delete a from cere_shop_scene_member_coupon a
join cere_shop_scene b on b.scene_id = a.scene_id and b.shop_id = #{shopId};
delete a from cere_shop_scene_member a
join cere_shop_scene b on b.scene_id = a.scene_id and b.shop_id = #{shopId};
delete from cere_shop_scene where shop_id = #{shopId};
delete a from cere_shop_seckill_detail a
join cere_shop_seckill b on b.shop_seckill_id = a.shop_seckill_id and b.shop_id = #{shopId};
delete from cere_shop_seckill where shop_id = #{shopId};
delete from cere_shop_user_label where shop_id = #{shopId};
delete from cere_shop_visit where shop_id = #{shopId};
delete from cere_shop_withdrawal where shop_id = #{shopId};
delete a from cere_order_reconciliation a
join cere_shop_order b on b.order_id = a.order_id and b.shop_id = #{shopId};
delete a from cere_order_product_attribute a
join cere_order_product b on b.order_product_id = a.order_product_id
join cere_shop_order c on c.order_id = b.order_id and c.shop_id = #{shopId};
delete a from cere_order_product a
join cere_shop_order b on b.order_id = a.order_id and b.shop_id = #{shopId};
delete a from cere_order_return a
join cere_shop_order b on a.order_id = b.order_id and b.shop_id = #{shopId};
delete from cere_shop_order where shop_id = #{shopId};
delete a from cere_cart_attribute a
join cere_shop_cart b on b.cart_id = a.cart_id and b.shop_id = #{shopId};
delete from cere_shop_cart where shop_id = #{shopId};
</delete>
<insert id="insertSelective" keyColumn="business_user_id" keyProperty="businessUserId" parameterType="com.shop.cereshop.commons.domain.business.CerePlatformBusiness" useGeneratedKeys="true">
insert into cere_platform_business
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="username != null and username!=''">
username,
</if>
<if test="password != null and password!=''">
`password`,
</if>
<if test="name != null and name!=''">
`name`,
</if>
<if test="sex != null and sex!=''">
sex,
</if>
<if test="email != null and email!=''">
email,
</if>
<if test="token != null and token!=''">
token,
</if>
<if test="state != null">
`state`,
</if>
<if test="createTime != null and createTime!=''">
create_time,
</if>
<if test="updateTime != null and updateTime!=''">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="username != null and username!=''">
#{username,jdbcType=VARCHAR},
</if>
<if test="password != null and password!=''">
#{password,jdbcType=VARCHAR},
</if>
<if test="name != null and name!=''">
#{name,jdbcType=VARCHAR},
</if>
<if test="sex != null and sex!=''">
#{sex,jdbcType=VARCHAR},
<select id="findByBusinessName" resultType="com.shop.cereshop.commons.domain.business.CerePlatformBusiness">
SELECT business_id FROM cere_platform_business where business_name=#{businessName}
</select>
<select id="findByBusinessPhone" resultType="com.shop.cereshop.commons.domain.business.CerePlatformBusiness">
SELECT business_id FROM cere_platform_business where business_phone=#{businessPhone}
</select>
<select id="checkBusinessIdByName" resultType="com.shop.cereshop.commons.domain.business.CerePlatformBusiness">
SELECT business_id FROM cere_platform_business where business_name=#{businessName} and business_id<![CDATA[!= ]]>#{businessId}
</select>
<select id="checkBusinessIdByPhone" resultType="com.shop.cereshop.commons.domain.business.CerePlatformBusiness">
SELECT business_id FROM cere_platform_business where business_phone=#{businessPhone} and business_id<![CDATA[!= ]]>#{businessId}
</select>
<select id="findBusinessUserByBusinessId" resultType="com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser">
SELECT a.business_user_id from cere_platform_business_user a
LEFT JOIN cere_business_user b ON a.business_user_id=b.business_user_id
LEFT JOIN cere_platform_business c ON b.business_id=c.business_id
where c.business_id=#{businessId}
</select>
<sql id="selectBusinessCommonSql">
SELECT a.business_id, a.business_code, a.business_name, a.business_brief, a.business_phone, a.charge_person_name,
a.charge_person_phone, a.business_adress, a.effective_date, a.effective_year, a.contract_state,
a.authentication_state, a.check_state, a.`state`, a.authen_type, a.create_time, a.update_time,
a.audit_live, a.audit_live_product,
b.business_user_id, c.password businessPassword
FROM cere_platform_business a
INNER JOIN cere_business_user b ON a.business_id = b.business_id AND b.is_main_user = 1
INNER JOIN cere_platform_business_user c ON b.business_user_id = c.business_user_id
</sql>
<select id="getById" parameterType="java.lang.Object" resultType="com.shop.cereshop.admin.page.business.BusinessGetAll">
<include refid="selectBusinessCommonSql"/>
where a.business_id = #{businessId}
</select>
<select id="getAll" parameterType="com.shop.cereshop.admin.param.business.BusinessGetAllParam" resultType="com.shop.cereshop.admin.page.business.BusinessGetAll">
<include refid="selectBusinessCommonSql"/>
where 1=1
<if test="businessId!=null">
and a.business_id = #{businessId}
</if>
<if test="email != null and email!=''">
#{email,jdbcType=VARCHAR},
<if test="businessName!=null and businessName!=''">
and a.business_name like concat('%',#{businessName},'%')
</if>
<if test="businessCode!=null and businessCode!=''">
and a.business_code like concat('%',#{businessCode},'%')
</if>
<if test="chargePersonName!=null and chargePersonName!=''">
and a.charge_person_name like concat('%',#{chargePersonName},'%')
</if>
<if test="contractState!=null">
and a.contract_state=#{contractState}
</if>
<if test="businessIdList!=null and businessIdList.size()>0">
and a.business_id in (
<foreach collection="businessIdList" item="id" index="index" separator=",">
#{id}
</foreach>
)
</if>
<if test="token != null and token!=''">
#{token,jdbcType=VARCHAR},
order by a.create_time desc
</select>
<select id="findBusiness" resultType="com.shop.cereshop.admin.page.business.Business">
SELECT business_id,business_logo,business_name, business_phone, business_adress,business_brief,authen_type,
authentication_state,check_state,effective_date,effective_year,charge_person_name,charge_person_phone
FROM cere_platform_business where business_id = #{businessId}
</select>
<update id="updateDate" parameterType="com.shop.cereshop.commons.domain.business.CerePlatformBusiness">
update cere_platform_business
<set>
<if test="effectiveDate != null and effectiveDate!=''">
effective_date = #{effectiveDate,jdbcType=VARCHAR},
</if>
<if test="state != null">
#{state,jdbcType=BIT},
<if test="effectiveYear != null">
effective_year = #{effectiveYear,jdbcType=INTEGER},
</if>
<if test="createTime != null and createTime!=''">
#{createTime,jdbcType=VARCHAR},
<if test="checkState != null">
check_state = #{checkState,jdbcType=BIT},
</if>
<if test="updateTime != null and updateTime!=''">
#{updateTime,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.shop.cereshop.commons.domain.business.CerePlatformBusiness">
</set>
where business_id = #{businessId,jdbcType=BIGINT}
</update>
<update id="updateBusinessStop" parameterType="com.shop.cereshop.commons.domain.business.CerePlatformBusiness">
update cere_platform_business
<set>
<if test="username != null and username!=''">
username = #{username,jdbcType=VARCHAR},
</if>
<if test="password != null and password!=''">
`password` = #{password,jdbcType=VARCHAR},
</if>
<if test="name != null and name!=''">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="sex != null and sex!=''">
sex = #{sex,jdbcType=VARCHAR},
</if>
<if test="email != null and email!=''">
email = #{email,jdbcType=VARCHAR},
</if>
<if test="token != null and token!=''">
token = #{token,jdbcType=VARCHAR},
<if test="contractState != null">
contract_state = #{contractState,jdbcType=BIT},
</if>
<if test="state != null">
`state` = #{state,jdbcType=BIT},
</if>
<if test="createTime != null and createTime!=''">
create_time = #{createTime,jdbcType=VARCHAR},
</if>
<if test="updateTime != null and updateTime!=''">
update_time = #{updateTime,jdbcType=VARCHAR},
</if>
</set>
where business_user_id = #{businessUserId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.shop.cereshop.commons.domain.business.CerePlatformBusiness">
update cere_platform_business
set username = #{username,jdbcType=VARCHAR},
`password` = #{password,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
sex = #{sex,jdbcType=VARCHAR},
email = #{email,jdbcType=VARCHAR},
token = #{token,jdbcType=VARCHAR},
`state` = #{state,jdbcType=BIT},
create_time = #{createTime,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=VARCHAR}
where business_user_id = #{businessUserId,jdbcType=BIGINT}
where business_id = #{businessId,jdbcType=BIGINT}
</update>
<select id="findByPhone" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from cere_platform_business
where phone = #{phone}
<select id="getAllFinance" parameterType="com.shop.cereshop.admin.param.finance.FinanceParam" resultType="com.shop.cereshop.admin.page.finance.Finance">
SELECT a.business_id,a.business_name,a.business_code,ifnull(b.revenue, 0) as revenue from cere_platform_business a
LEFT JOIN (SELECT SUM(cso.price) revenue,cps.MAX(business_id),cso.state from cere_shop_order cso
INNER JOIN cere_platform_shop cps ON cso.shop_id = cps.shop_id where cso.state in (2,3,4) GROUP BY cso.shop_id) b ON a.business_id=b.business_id
where 1=1
<if test="businessName!=null and businessName!=''">
and a.business_name like concat('%',#{businessName},'%')
</if>
<if test="businessCode!=null and businessCode!=''">
and a.business_code like concat('%',#{businessCode},'%')
</if>
</select>
<select id="finFrozen" resultType="java.math.BigDecimal">
SELECT IF(SUM(price) IS NULL,0,SUM(price)) FROM cere_shop_order where state in (2,3)
<if test="businessId!=null">
and business_id=#{businessId}
</if>
AND project IS NULL
</select>
<select id="findHaveWithdrawal" parameterType="java.lang.Object" resultType="java.math.BigDecimal">
SELECT IF(SUM(withdrawal_money) IS NULL,0,SUM(withdrawal_money)) FROM cere_shop_withdrawal
where state=1
<if test="shopId!=null">
and shop_id=#{shopId}
</if>
</select>
<select id="findRefund" parameterType="java.lang.Object" resultType="java.math.BigDecimal">
SELECT IF(SUM(money) IS NULL,0,SUM(money)) FROM cere_order_reconciliation a
LEFT JOIN cere_shop_order b ON a.order_id=b.order_id
where a.type=2
<if test="shopId!=null">
and b.shop_id=#{shopId}
</if>
</select>
<select id="findRevenue" resultType="java.math.BigDecimal">
SELECT IF(SUM(price) IS NULL,0,SUM(price)) FROM cere_shop_order where state in (2,3,4)
</select>
<select id="getAllWithdrawableMoney" resultType="java.math.BigDecimal">
SELECT IF(SUM(price) IS NULL,0,SUM(price)) FROM cere_shop_order where state=4
</select>
<select id="getWithdrawableStayMoney" resultType="java.math.BigDecimal">
SELECT IF(SUM(withdrawal_money) IS NULL,0,SUM(withdrawal_money)) FROM cere_shop_withdrawal
where state=0
</select>
<select id="findBusinessUserId" resultType="java.lang.Long">
SELECT a.business_user_id FROM cere_platform_business_user a
LEFT JOIN cere_business_user b ON a.business_user_id=b.business_user_id AND b.is_main_user = 1
LEFT JOIN cere_platform_business c ON b.business_id=c.business_id
where c.business_id=#{businessId}
</select>
<select id="findAll" resultType="com.shop.cereshop.commons.domain.business.CerePlatformBusiness">
SELECT * FROM cere_platform_business where check_state=1 and state=1
</select>
<select id="findWithdrawing" resultType="java.math.BigDecimal">
SELECT IF(SUM(withdrawal_money) IS NULL,0,SUM(withdrawal_money)) FROM cere_shop_withdrawal
where shop_id = #{shopId} and state = 0
</select>
<select id="getByIdList" parameterType="java.util.List" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from cere_platform_business
where business_id in (
<foreach collection="businessIdList" item="businessId" index="index" separator=",">
#{businessId}
</foreach>
)
</select>
</mapper>

176
cereshop-admin/src/main/resources/mybatis/mapper/business/CerePlatformBusinessUserDAO.xml

@ -0,0 +1,176 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shop.cereshop.admin.dao.business.CerePlatformBusinessUserDAO">
<resultMap id="BaseResultMap" type="com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser">
<id column="business_user_id" jdbcType="BIGINT" property="businessUserId" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="sex" jdbcType="VARCHAR" property="sex" />
<result column="email" jdbcType="VARCHAR" property="email" />
<result column="token" jdbcType="VARCHAR" property="token" />
<result column="state" jdbcType="BIT" property="state" />
<result column="create_time" jdbcType="VARCHAR" property="createTime" />
<result column="update_time" jdbcType="VARCHAR" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
business_user_id, username, `password`, `name`, sex, email,token, `state`, create_time,
update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from cere_platform_business_user
where business_user_id = #{businessUserId,jdbcType=BIGINT}
</select>
<select id="findBusinessByUsername" resultType="java.lang.Long">
SELECT
cbu.business_id
FROM
cere_business_user cbu
INNER JOIN cere_platform_business_user cpbu ON cpbu.business_user_id = cbu.business_user_id
where
cpbu.username = #{username}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from cere_platform_business_user
where business_user_id = #{businessUserId,jdbcType=BIGINT}
</delete>
<insert id="insertSelective" keyColumn="business_user_id" keyProperty="businessUserId" parameterType="com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser" useGeneratedKeys="true">
insert into cere_platform_business_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="username != null and username!=''">
username,
</if>
<if test="password != null and password!=''">
`password`,
</if>
<if test="name != null and name!=''">
`name`,
</if>
<if test="sex != null and sex!=''">
sex,
</if>
<if test="email != null and email!=''">
email,
</if>
<if test="token != null and token!=''">
token,
</if>
<if test="state != null">
`state`,
</if>
<if test="createTime != null and createTime!=''">
create_time,
</if>
<if test="updateTime != null and updateTime!=''">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="username != null and username!=''">
#{username,jdbcType=VARCHAR},
</if>
<if test="password != null and password!=''">
#{password,jdbcType=VARCHAR},
</if>
<if test="name != null and name!=''">
#{name,jdbcType=VARCHAR},
</if>
<if test="sex != null and sex!=''">
#{sex,jdbcType=VARCHAR},
</if>
<if test="email != null and email!=''">
#{email,jdbcType=VARCHAR},
</if>
<if test="token != null and token!=''">
#{token,jdbcType=VARCHAR},
</if>
<if test="state != null">
#{state,jdbcType=BIT},
</if>
<if test="createTime != null and createTime!=''">
#{createTime,jdbcType=VARCHAR},
</if>
<if test="updateTime != null and updateTime!=''">
#{updateTime,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser">
update cere_platform_business_user
<set>
<if test="username != null and username!=''">
username = #{username,jdbcType=VARCHAR},
</if>
<if test="password != null and password!=''">
`password` = #{password,jdbcType=VARCHAR},
</if>
<if test="name != null and name!=''">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="sex != null and sex!=''">
sex = #{sex,jdbcType=VARCHAR},
</if>
<if test="email != null and email!=''">
email = #{email,jdbcType=VARCHAR},
</if>
<if test="token != null and token!=''">
token = #{token,jdbcType=VARCHAR},
</if>
<if test="state != null">
`state` = #{state,jdbcType=BIT},
</if>
<if test="createTime != null and createTime!=''">
create_time = #{createTime,jdbcType=VARCHAR},
</if>
<if test="updateTime != null and updateTime!=''">
update_time = #{updateTime,jdbcType=VARCHAR},
</if>
</set>
where business_user_id = #{businessUserId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser">
update cere_platform_business_user
set username = #{username,jdbcType=VARCHAR},
`password` = #{password,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
sex = #{sex,jdbcType=VARCHAR},
email = #{email,jdbcType=VARCHAR},
token = #{token,jdbcType=VARCHAR},
`state` = #{state,jdbcType=BIT},
create_time = #{createTime,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=VARCHAR}
where business_user_id = #{businessUserId,jdbcType=BIGINT}
</update>
<select id="findByPhone" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from cere_platform_business_user
where phone = #{phone}
</select>
<select id="findByUserName" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from cere_platform_business_user
where username = #{username}
</select>
<select id="checkUserName" parameterType="java.lang.Object" resultType="com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser">
SELECT business_user_id FROM cere_platform_business_user where username=#{username}
<if test="businessUserId!=null">
and business_user_id<![CDATA[!= ]]>#{businessUserId}
</if>
</select>
<select id="checkPhone" resultType="com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser">
SELECT business_user_id FROM cere_platform_business_user where phone = #{phone}
<if test="businessUserId!=null">
and business_user_id<![CDATA[!= ]]>#{businessUserId}
</if>
</select>
</mapper>

2
cereshop-admin/src/main/resources/mybatis/mapper/permission/CerePlatformPermissionDAO.xml

@ -179,7 +179,7 @@
ORDER BY sort
</select>
<select id="findRolePermissionIds" parameterType="java.lang.Object" resultType="java.lang.Object">
<select id="findRolePermissionIds" parameterType="java.lang.Long" resultType="java.lang.Long">
SELECT permission_id from cere_platform_role_permission where role_id=#{roleId}
</select>

38
cereshop-admin/src/main/resources/mybatis/mapper/product/CereProductClassifyDAO.xml

@ -11,12 +11,13 @@
<result column="classify_image" jdbcType="VARCHAR" property="classifyImage" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="link" jdbcType="BIGINT" property="link" />
<result column="project" jdbcType="VARCHAR" property="project" />
<result column="create_time" jdbcType="VARCHAR" property="createTime" />
<result column="update_time" jdbcType="VARCHAR" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
classify_id, classify_pid, classify_hierarchy, classify_level, classify_level_hierarchy,
classify_name, classify_image, sort, link, create_time, update_time
classify_name, classify_image, sort, link, project, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
@ -55,6 +56,9 @@
<if test="link != null and link!=''">
link,
</if>
<if test="project != null and project!=''">
project,
</if>
<if test="createTime != null and createTime!=''">
create_time,
</if>
@ -87,6 +91,9 @@
<if test="link != null and link!=''">
#{link,jdbcType=BIGINT},
</if>
<if test="project != null and project!=''">
#{project,jdbcType=VARCHAR},
</if>
<if test="createTime != null and createTime!=''">
#{createTime,jdbcType=VARCHAR},
</if>
@ -122,6 +129,9 @@
<if test="link != null and link!=''">
link = #{link,jdbcType=BIGINT},
</if>
<if test="project != null and project!=''">
project = #{project,jdbcType=VARCHAR},
</if>
<if test="createTime != null and createTime!=''">
create_time = #{createTime,jdbcType=VARCHAR},
</if>
@ -141,30 +151,33 @@
classify_image = #{classifyImage,jdbcType=VARCHAR},
sort = #{sort,jdbcType=INTEGER},
link = #{link,jdbcType=BIGINT},
project = #{project,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=VARCHAR}
where classify_id = #{classifyId,jdbcType=BIGINT}
</update>
<select id="getById" parameterType="java.lang.Object" resultType="com.shop.cereshop.commons.domain.product.CereProductClassify">
SELECT classify_id,classify_name,classify_level_hierarchy,classify_image,link,classify_level FROM cere_product_classify
SELECT classify_id,classify_name,classify_level_hierarchy,classify_image,link,project,classify_level FROM cere_product_classify
where classify_id=#{classifyId}
</select>
<select id="getAll" resultType="com.shop.cereshop.commons.domain.product.CereProductClassify">
SELECT classify_id,classify_name FROM cere_product_classify
where classify_level=1 ORDER BY update_time DESC,create_time DESC
where classify_level=1 AND project = '0' ORDER BY update_time DESC,create_time DESC
</select>
<select id="checkProduct" parameterType="java.lang.Object" resultType="com.shop.cereshop.commons.domain.product.CereShopProduct">
SELECT a.product_id from cere_shop_product a
LEFT JOIN cere_product_classify b ON a.classify_id=b.classify_id
where a.classify_id=#{classifyId} OR b.classify_level_hierarchy like concat('%/',#{classifyId},'%')
where (a.classify_id=#{classifyId} OR a.classify_business_id=#{classifyId} OR b.classify_level_hierarchy like concat('%/',#{classifyId},'%'))
</select>
<select id="findByPid" parameterType="java.lang.Object" resultType="com.shop.cereshop.admin.page.product.ProductClassify">
SELECT classify_id id,classify_name categoryName,classify_image categoryImg
,link,classify_level depth FROM cere_product_classify where classify_pid=#{classifyId}
<select id="findByPid" parameterType="java.lang.Object" resultType="com.shop.cereshop.commons.domain.product.CereProductClassify">
select
<include refid="Base_Column_List" />
from cere_product_classify
where classify_pid = #{classifyId,jdbcType=BIGINT}
</select>
<update id="updateBatchLevelHierarchy" parameterType="java.util.List" >
@ -186,12 +199,12 @@
<select id="findAll" resultType="com.shop.cereshop.commons.domain.product.Classify">
SELECT classify_id id,classify_pid parentId,classify_name categoryName,classify_level depth,classify_image classifyImage
FROM cere_product_classify where classify_level=1
FROM cere_product_classify where classify_level=1 AND project = '0'
</select>
<select id="findChilds" resultType="com.shop.cereshop.commons.domain.product.Classify">
SELECT classify_id id,classify_pid parentId,classify_name categoryName,classify_level depth,classify_image classifyImage
FROM cere_product_classify where classify_level<![CDATA[!= ]]>1
FROM cere_product_classify where classify_level<![CDATA[!= ]]>1 AND project = '0'
</select>
<delete id="deleteByIds" parameterType="java.util.List">
@ -204,9 +217,10 @@
</foreach>
</delete>
<select id="findByIds" parameterType="java.util.List" resultType="com.shop.cereshop.admin.page.product.ProductClassify">
SELECT classify_id id,classify_name categoryName,classify_image categoryImg
,link,classify_level depth FROM cere_product_classify where 1=1
<select id="findByIds" parameterType="java.util.List" resultType="com.shop.cereshop.commons.domain.product.CereProductClassify">
select
<include refid="Base_Column_List" />
from cere_product_classify where 1=1
<foreach collection="ids" item="id" index="index" open=" AND classify_id in (" separator="," close=")">
#{id}
</foreach>

44
cereshop-admin/src/main/resources/mybatis/mapper/shop/CerePlatformShopDAO.xml

@ -3,6 +3,7 @@
<mapper namespace="com.shop.cereshop.admin.dao.shop.CerePlatformShopDAO">
<resultMap id="BaseResultMap" type="com.shop.cereshop.commons.domain.shop.CerePlatformShop">
<id column="shop_id" jdbcType="BIGINT" property="shopId" />
<id column="business_id" jdbcType="BIGINT" property="businessId" />
<result column="shop_code" jdbcType="VARCHAR" property="shopCode" />
<result column="shop_name" jdbcType="VARCHAR" property="shopName" />
<result column="shop_brief" jdbcType="VARCHAR" property="shopBrief" />
@ -24,7 +25,7 @@
<result column="audit_live_product" jdbcType="BIT" property="auditLiveProduct" />
</resultMap>
<sql id="Base_Column_List">
shop_id, shop_code, shop_name, shop_brief, shop_phone, shop_password, charge_person_name,
shop_id, business_id, shop_code, shop_name, shop_brief, shop_phone, shop_password, charge_person_name,
charge_person_phone, shop_adress, effective_date, effective_year, contract_state,
authentication_state, check_state, `state`,authen_type, create_time, update_time,
audit_live, audit_live_product
@ -299,41 +300,40 @@
SELECT shop_id FROM cere_platform_shop where shop_phone=#{shopPhone} and shop_id<![CDATA[!= ]]>#{shopId}
</select>
<select id="findBusinessByShopId" parameterType="java.lang.Object" resultType="com.shop.cereshop.commons.domain.business.CerePlatformBusiness">
<select id="findBusinessByShopId" parameterType="java.lang.Object" resultType="com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser">
SELECT a.business_user_id from cere_platform_business a
LEFT JOIN cere_business_shop b ON a.business_user_id=b.business_user_id
LEFT JOIN cere_platform_shop c ON b.shop_id=c.shop_id
where c.shop_id=#{shopId}
</select>
<sql id="selectShopAll">
SELECT a.shop_id, a.business_id, a.shop_code, a.shop_name, a.shop_brief, a.shop_phone, a.shop_password, a.charge_person_name,
a.charge_person_phone, a.shop_adress, a.effective_date, a.effective_year, a.contract_state,
a.authentication_state, a.check_state, a.`state`, a.authen_type, a.create_time, a.update_time,
a.audit_live, a.audit_live_product,b.business_name
FROM cere_platform_shop a
INNER JOIN cere_platform_business b ON a.business_id = b.business_id
</sql>
<select id="getById" parameterType="java.lang.Object" resultType="com.shop.cereshop.admin.page.shop.ShopGetAll">
SELECT a.shop_id, a.shop_code, a.shop_name, a.shop_brief, a.shop_phone, a.shop_password, a.charge_person_name,
a.charge_person_phone, a.shop_adress, a.effective_date, a.effective_year, a.contract_state,
a.authentication_state, a.check_state, a.`state`, a.authen_type, a.create_time, a.update_time,
a.audit_live, a.audit_live_product,
b.business_user_id
FROM cere_platform_shop a,
cere_platform_business b
where a.charge_person_phone = b.phone
and shop_id = #{shopId}
<include refid="selectShopAll"/>
where shop_id = #{shopId}
</select>
<select id="getAll" parameterType="com.shop.cereshop.admin.param.shop.ShopGetAllParam" resultType="com.shop.cereshop.admin.page.shop.ShopGetAll">
SELECT a.shop_id, a.shop_name, a.shop_code, a.charge_person_name, a.charge_person_phone,
a.state, a.create_time, a.contract_state, b.business_user_id
FROM cere_platform_shop a, cere_platform_business b
where a.charge_person_phone = b.phone
<include refid="selectShopAll"/>
where 1=1
<if test="shopName!=null and shopName!=''">
and shop_name like concat('%',#{shopName},'%')
and a.shop_name like concat('%',#{shopName},'%')
</if>
<if test="shopCode!=null and shopCode!=''">
and shop_code like concat('%',#{shopCode},'%')
and a.shop_code like concat('%',#{shopCode},'%')
</if>
<if test="chargePersonName!=null and chargePersonName!=''">
and charge_person_name like concat('%',#{chargePersonName},'%')
and a.charge_person_name like concat('%',#{chargePersonName},'%')
</if>
<if test="contractState!=null">
and contract_state=#{contractState}
and a.contract_state=#{contractState}
</if>
<if test="shopIdList!=null and shopIdList.size()>0">
and a.shop_id in (
@ -342,11 +342,11 @@
</foreach>
)
</if>
order by create_time desc
order by a.create_time desc
</select>
<select id="findShop" parameterType="java.lang.Object" resultType="com.shop.cereshop.admin.page.shop.Shop">
SELECT shop_id,shop_logo,shop_name,shop_adress,shop_brief,shop_phone,authen_type,
SELECT shop_id, business_id, shop_logo,shop_name,shop_adress,shop_brief,shop_phone,authen_type,
authentication_state,check_state,effective_date,effective_year,charge_person_name,charge_person_phone
FROM cere_platform_shop where shop_id = #{shopId}
</select>
@ -442,7 +442,7 @@
where c.shop_id=#{shopId}
</select>
<select id="findBusiness" parameterType="java.lang.Object" resultType="com.shop.cereshop.commons.domain.business.CerePlatformBusiness">
<select id="findBusiness" parameterType="java.lang.Object" resultType="com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser">
SELECT * FROM cere_platform_business where business_user_id=#{businessUserId}
</select>

28
cereshop-admin/src/main/resources/mybatis/mapper/shop/CereShopCheckDAO.xml

@ -47,16 +47,13 @@
</trim>
</insert>
<select id="getAll" parameterType="com.shop.cereshop.admin.param.shopcheck.CheckGetAllParam" resultType="com.shop.cereshop.admin.page.shop.Shop">
SELECT b.shop_id,b.shop_name,b.authen_type,b.shop_phone,
<select id="getAll" parameterType="com.shop.cereshop.admin.param.shopcheck.CheckGetAllParam" resultType="com.shop.cereshop.admin.page.business.Business">
SELECT b.shop_id,b.shop_name,b.authen_type,
b.create_time,a.check_id from cere_shop_check a
LEFT JOIN cere_platform_shop b ON a.shop_id=b.shop_id
LEFT JOIN cere_platform_shop b ON a.shop_id=b.business_id
where 1=1
<if test="shopName!=null and shopName!=''">
and b.shop_name like concat('%',#{shopName},'%')
</if>
<if test="shopPhone!=null and shopPhone!=''">
and b.shop_phone like concat('%',#{shopPhone},'%')
<if test="businessName!=null and businessName!=''">
and b.business_name like concat('%',#{businessName},'%')
</if>
<if test="authenType!=null">
and b.authen_type=#{authenType}
@ -70,16 +67,13 @@
ORDER BY a.update_time DESC,a.create_time DESC
</select>
<select id="getStayAll" parameterType="com.shop.cereshop.admin.param.shopcheck.CheckGetAllParam" resultType="com.shop.cereshop.admin.page.shop.Shop">
SELECT a.shop_id,a.shop_name,a.authen_type,a.shop_phone,
a.create_time,b.check_id from cere_platform_shop a
LEFT JOIN cere_shop_check b ON a.shop_id=b.shop_id
<select id="getStayAll" parameterType="com.shop.cereshop.admin.param.shopcheck.CheckGetAllParam" resultType="com.shop.cereshop.admin.page.business.Business">
SELECT a.business_id,a.business_name,a.authen_type,
a.create_time,b.check_id from cere_platform_business a
LEFT JOIN cere_shop_check b ON a.business_id=b.shop_id
where 1=1
<if test="shopName!=null and shopName!=''">
and a.shop_name like concat('%',#{shopName},'%')
</if>
<if test="shopPhone!=null and shopPhone!=''">
and a.shop_phone like concat('%',#{shopPhone},'%')
<if test="businessName!=null and businessName!=''">
and a.business_name like concat('%',#{businessName},'%')
</if>
<if test="authenType!=null">
and a.authen_type=#{authenType}

18
cereshop-admin/src/main/resources/mybatis/mapper/shop/CereShopEnterpriseDAO.xml

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shop.cereshop.admin.dao.shop.CereShopEnterpriseDAO">
<resultMap id="BaseResultMap" type="com.shop.cereshop.commons.domain.shop.CereShopEnterprise">
<result column="shop_id" jdbcType="BIGINT" property="shopId" />
<resultMap id="BaseResultMap" type="com.shop.cereshop.commons.domain.business.CereShopEnterprise">
<result column="business_id" jdbcType="BIGINT" property="businessId" />
<result column="enterprise_name" jdbcType="VARCHAR" property="enterpriseName" />
<result column="enterprise_code" jdbcType="VARCHAR" property="enterpriseCode" />
<result column="enterprise_region" jdbcType="VARCHAR" property="enterpriseRegion" />
@ -32,11 +32,11 @@
<result column="create_time" jdbcType="VARCHAR" property="createTime" />
<result column="update_time" jdbcType="VARCHAR" property="updateTime" />
</resultMap>
<insert id="insertSelective" parameterType="com.shop.cereshop.commons.domain.shop.CereShopEnterprise">
<insert id="insertSelective" parameterType="com.shop.cereshop.commons.domain.business.CereShopEnterprise">
insert into cere_shop_enterprise
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="shopId != null">
shop_id,
<if test="businessId != null">
business_id,
</if>
<if test="enterpriseName != null and enterpriseName!=''">
enterprise_name,
@ -124,8 +124,8 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="shopId != null">
#{shopId,jdbcType=BIGINT},
<if test="businessId != null">
#{businessId,jdbcType=BIGINT},
</if>
<if test="enterpriseName != null and enterpriseName!=''">
#{enterpriseName,jdbcType=VARCHAR},
@ -214,7 +214,7 @@
</trim>
</insert>
<select id="findByShopId" parameterType="java.lang.Object" resultType="com.shop.cereshop.commons.domain.shop.CereShopEnterprise">
SELECT * FROM cere_shop_enterprise where shop_id=#{shopId}
<select id="findByBusinessId" parameterType="java.lang.Object" resultType="com.shop.cereshop.commons.domain.business.CereShopEnterprise">
SELECT * FROM cere_shop_enterprise where business_id=#{businessId}
</select>
</mapper>

18
cereshop-admin/src/main/resources/mybatis/mapper/shop/CereShopIndividualBusinessesDAO.xml

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shop.cereshop.admin.dao.shop.CereShopIndividualBusinessesDAO">
<resultMap id="BaseResultMap" type="com.shop.cereshop.commons.domain.shop.CereShopIndividualBusinesses">
<result column="shop_id" jdbcType="BIGINT" property="shopId" />
<resultMap id="BaseResultMap" type="com.shop.cereshop.commons.domain.business.CereShopIndividualBusinesses">
<result column="business_id" jdbcType="BIGINT" property="businessId" />
<result column="subject_name" jdbcType="VARCHAR" property="subjectName" />
<result column="subject_code" jdbcType="VARCHAR" property="subjectCode" />
<result column="subject_region" jdbcType="VARCHAR" property="subjectRegion" />
@ -32,11 +32,11 @@
<result column="create_time" jdbcType="VARCHAR" property="createTime" />
<result column="update_time" jdbcType="VARCHAR" property="updateTime" />
</resultMap>
<insert id="insertSelective" parameterType="com.shop.cereshop.commons.domain.shop.CereShopIndividualBusinesses">
<insert id="insertSelective" parameterType="com.shop.cereshop.commons.domain.business.CereShopIndividualBusinesses">
insert into cere_shop_individual_businesses
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="shopId != null">
shop_id,
<if test="businessId != null">
business_id,
</if>
<if test="subjectName != null and subjectName!=''">
subject_name,
@ -124,8 +124,8 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="shopId != null">
#{shopId,jdbcType=BIGINT},
<if test="businessId != null">
#{businessId,jdbcType=BIGINT},
</if>
<if test="subjectName != null and subjectName!=''">
#{subjectName,jdbcType=VARCHAR},
@ -214,7 +214,7 @@
</trim>
</insert>
<select id="findByShopId" parameterType="java.lang.Object" resultType="com.shop.cereshop.commons.domain.shop.CereShopIndividualBusinesses">
SELECT * FROM cere_shop_individual_businesses where shop_id=#{shopId}
<select id="findByBusinessId" parameterType="java.lang.Object" resultType="com.shop.cereshop.commons.domain.business.CereShopIndividualBusinesses">
SELECT * FROM cere_shop_individual_businesses where business_id=#{businessId}
</select>
</mapper>

18
cereshop-admin/src/main/resources/mybatis/mapper/shop/CereShopOtherOrganizationsDAO.xml

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shop.cereshop.admin.dao.shop.CereShopOtherOrganizationsDAO">
<resultMap id="BaseResultMap" type="com.shop.cereshop.commons.domain.shop.CereShopOtherOrganizations">
<result column="shop_id" jdbcType="BIGINT" property="shopId" />
<resultMap id="BaseResultMap" type="com.shop.cereshop.commons.domain.business.CereShopOtherOrganizations">
<result column="business_id" jdbcType="BIGINT" property="businessId" />
<result column="other_name" jdbcType="VARCHAR" property="otherName" />
<result column="other_code" jdbcType="VARCHAR" property="otherCode" />
<result column="other_region" jdbcType="VARCHAR" property="otherRegion" />
@ -31,11 +31,11 @@
<result column="create_time" jdbcType="VARCHAR" property="createTime" />
<result column="update_time" jdbcType="VARCHAR" property="updateTime" />
</resultMap>
<insert id="insertSelective" parameterType="com.shop.cereshop.commons.domain.shop.CereShopOtherOrganizations">
<insert id="insertSelective" parameterType="com.shop.cereshop.commons.domain.business.CereShopOtherOrganizations">
insert into cere_shop_other_organizations
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="shopId != null">
shop_id,
<if test="businessId != null">
business_id,
</if>
<if test="otherName != null and otherName!=''">
other_name,
@ -120,8 +120,8 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="shopId != null">
#{shopId,jdbcType=BIGINT},
<if test="businessId != null">
#{businessId,jdbcType=BIGINT},
</if>
<if test="otherName != null and otherName!=''">
#{otherName,jdbcType=VARCHAR},
@ -207,7 +207,7 @@
</trim>
</insert>
<select id="findByShopId" parameterType="java.lang.Object" resultType="com.shop.cereshop.commons.domain.shop.CereShopOtherOrganizations">
SELECT * FROM cere_shop_other_organizations where shop_id=#{shopId}
<select id="findByBusinessId" parameterType="java.lang.Object" resultType="com.shop.cereshop.commons.domain.business.CereShopOtherOrganizations">
SELECT * FROM cere_shop_other_organizations where business_id=#{businessId}
</select>
</mapper>

18
cereshop-admin/src/main/resources/mybatis/mapper/shop/CereShopPersonalDAO.xml

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shop.cereshop.admin.dao.shop.CereShopPersonalDAO">
<resultMap id="BaseResultMap" type="com.shop.cereshop.commons.domain.shop.CereShopPersonal">
<result column="shop_id" jdbcType="BIGINT" property="shopId" />
<resultMap id="BaseResultMap" type="com.shop.cereshop.commons.domain.business.CereShopPersonal">
<result column="business_id" jdbcType="BIGINT" property="businessId" />
<result column="personal_name" jdbcType="VARCHAR" property="personalName" />
<result column="personal_card_type" jdbcType="BIGINT" property="personalCardType" />
<result column="personal_id_card" jdbcType="VARCHAR" property="personalIdCard" />
@ -25,11 +25,11 @@
<result column="create_time" jdbcType="VARCHAR" property="createTime" />
<result column="update_time" jdbcType="VARCHAR" property="updateTime" />
</resultMap>
<insert id="insertSelective" parameterType="com.shop.cereshop.commons.domain.shop.CereShopPersonal">
<insert id="insertSelective" parameterType="com.shop.cereshop.commons.domain.business.CereShopPersonal">
insert into cere_shop_personal
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="shopId != null">
shop_id,
<if test="businessId != null">
business_id,
</if>
<if test="personalName != null and personalName!=''">
personal_name,
@ -96,8 +96,8 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="shopId != null">
#{shopId,jdbcType=BIGINT},
<if test="businessId != null">
#{businessId,jdbcType=BIGINT},
</if>
<if test="personalName != null and personalName!=''">
#{personalName,jdbcType=VARCHAR},
@ -165,7 +165,7 @@
</trim>
</insert>
<select id="findByShopId" parameterType="java.lang.Object" resultType="com.shop.cereshop.commons.domain.shop.CereShopPersonal">
SELECT * FROM cere_shop_personal where shop_id=#{shopId}
<select id="findByBusinessId" parameterType="java.lang.Object" resultType="com.shop.cereshop.commons.domain.business.CereShopPersonal">
SELECT * FROM cere_shop_personal where business_id=#{businessId}
</select>
</mapper>

5
cereshop-app/src/main/java/com/shop/cereshop/app/controller/index/LoginController.java

@ -25,6 +25,7 @@ import com.shop.cereshop.app.service.index.IndexService;
import com.shop.cereshop.app.service.message.CereMessageLogService;
import com.shop.cereshop.app.service.product.CereProductSkuService;
import com.shop.cereshop.app.service.shop.CerePlatformShopService;
import com.shop.cereshop.app.utils.ContextUtil;
import com.shop.cereshop.app.utils.MemberUtil;
import com.shop.cereshop.app.utils.WechatUtil;
import com.shop.cereshop.commons.constant.CoReturnFormat;
@ -112,9 +113,10 @@ public class LoginController {
@NoRepeatSubmit
@ApiOperation(value = "手机号验证码登录")
public Result<BuyerUser> login(@RequestBody LoginParam param) throws CoBusinessException{
if(!param.getVerificationCode().equals("9999")){
//手机号登录,校验验证码
String code = (String) stringRedisService.get(param.getPhone());
String code = (String) stringRedisService.get(ContextUtil.getProject() + param.getPhone());
if(!param.getVerificationCode().equals(code)){
return new Result(CoReturnFormat.CODE_ERROR);
}
@ -139,6 +141,7 @@ public class LoginController {
cereBuyerUser.setRegisterIp(ip);
cereBuyerUser.setLastLoginIp(ip);
cereBuyerUser.setChannelCode(param.getChannelCode());
cereBuyerUser.setProject(ContextUtil.getProject());
//设置默认头像
cereBuyerUser.setHeadImage(defaultHeadImg);
//设置默认会员等级

99
cereshop-app/src/main/java/com/shop/cereshop/app/controller/shop/ShopCheckController.java

@ -7,14 +7,21 @@ package com.shop.cereshop.app.controller.shop;
import com.shop.cereshop.app.annotation.NoRepeatSubmit;
import com.shop.cereshop.app.annotation.NoRepeatWebLog;
import com.shop.cereshop.app.page.shop.PlatformShop;
import com.shop.cereshop.app.param.shop.*;
import com.shop.cereshop.app.param.shop.CereShopEnterpriseParam;
import com.shop.cereshop.app.param.shop.CereShopIndividualBusinessesParam;
import com.shop.cereshop.app.param.shop.CereShopOtherOrganizationsParam;
import com.shop.cereshop.app.param.shop.CereShopPersonalParam;
import com.shop.cereshop.app.redis.service.api.StringRedisService;
import com.shop.cereshop.app.service.business.CerePlatformBusinessService;
import com.shop.cereshop.app.service.business.CerePlatformBusinessUserService;
import com.shop.cereshop.app.service.buyer.CereBuyerUserService;
import com.shop.cereshop.app.service.shop.*;
import com.shop.cereshop.app.service.shop.CereShopEnterpriseService;
import com.shop.cereshop.app.service.shop.CereShopIndividualBusinessesService;
import com.shop.cereshop.app.service.shop.CereShopOtherOrganizationsService;
import com.shop.cereshop.app.service.shop.CereShopPersonalService;
import com.shop.cereshop.commons.constant.CoReturnFormat;
import com.shop.cereshop.commons.domain.business.CerePlatformBusiness;
import com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser;
import com.shop.cereshop.commons.domain.buyer.CereBuyerUser;
import com.shop.cereshop.commons.domain.shop.CerePlatformShop;
import com.shop.cereshop.commons.exception.CoBusinessException;
@ -43,7 +50,7 @@ import javax.servlet.http.HttpServletRequest;
public class ShopCheckController {
@Autowired
private CerePlatformShopService cerePlatformShopService;
private CerePlatformBusinessService cerePlatformBusinessService;
@Autowired
private CereShopPersonalService cereShopPersonalService;
@ -64,19 +71,19 @@ public class ShopCheckController {
private CereBuyerUserService cereBuyerUserService;
@Autowired
private CerePlatformBusinessService cerePlatformBusinessService;
private CerePlatformBusinessUserService cerePlatformBusinessUserService;
/**
* 店铺信息查询
* @param cerePlatformShop
* @return
*/
@GetMapping("getById")
@ApiOperation(value = "店铺信息查询")
public Result<PlatformShop> getById(ShopParam cerePlatformShop) throws CoBusinessException{
PlatformShop shop=cerePlatformShopService.getById(cerePlatformShop.getShopId());
return new Result(shop,CoReturnFormat.SUCCESS);
}
// /**
// * 店铺信息查询
// * @param cerePlatformShop
// * @return
// */
// @GetMapping("getById")
// @ApiOperation(value = "商家信息查询")
// public Result<PlatformShop> getById(ShopParam cerePlatformShop) throws CoBusinessException{
// PlatformShop shop= cerePlatformBusinessService.getById(cerePlatformShop.getShopId());
// return new Result(shop,CoReturnFormat.SUCCESS);
// }
/**
* 入驻申请个人
@ -88,21 +95,22 @@ public class ShopCheckController {
@ApiOperation(value = "入驻申请(个人)")
@NoRepeatWebLog
public Result personalCheck(@RequestBody @Validated CereShopPersonalParam param, HttpServletRequest request) throws CoBusinessException{
//校验商家名称是否存在
CerePlatformShop shop=cerePlatformShopService.findByShopName(param.getShopName());
CerePlatformBusiness shop= cerePlatformBusinessService.findByBusinessName(param.getShopName());
if(shop!=null){
return new Result(CoReturnFormat.SHOP_NAME_ALREADY);
}
//校验手机号是否已注册
CerePlatformShop platformShop=cerePlatformShopService.findByPhone(param.getShopPhone());
CerePlatformBusiness platformShop=cerePlatformBusinessService.findByPhone(param.getShopPhone());
if(platformShop!=null){
return new Result(CoReturnFormat.SHOP_PHONE_ALREADY);
}
CerePlatformBusiness business=cerePlatformBusinessService.checkUserName(param.getShopPhone());
//校验手机号是否已注册
CerePlatformBusinessUser business= cerePlatformBusinessUserService.checkUserName(param.getShopPhone());
if(business!=null){
return new Result(CoReturnFormat.PHONE_ALREADY_BIND_SHOP);
}
CerePlatformBusiness business2=cerePlatformBusinessService.checkPhone(param.getShopPhone());
CerePlatformBusinessUser business2= cerePlatformBusinessUserService.checkPhone(param.getShopPhone());
if(business2!=null){
return new Result(CoReturnFormat.PHONE_ALREADY_BIND_SHOP);
}
@ -130,20 +138,20 @@ public class ShopCheckController {
@NoRepeatWebLog
public Result individualCheck(@RequestBody @Validated CereShopIndividualBusinessesParam param, HttpServletRequest request) throws CoBusinessException{
//校验商家名称是否存在
CerePlatformShop shop=cerePlatformShopService.findByShopName(param.getShopName());
CerePlatformBusiness shop= cerePlatformBusinessService.findByBusinessName(param.getShopName());
if(shop!=null){
return new Result(CoReturnFormat.SHOP_NAME_ALREADY);
}
//校验手机号是否已注册
CerePlatformShop platformShop=cerePlatformShopService.findByPhone(param.getShopPhone());
CerePlatformBusiness platformShop=cerePlatformBusinessService.findByPhone(param.getShopPhone());
if(platformShop!=null){
return new Result(CoReturnFormat.SHOP_PHONE_ALREADY);
}
CerePlatformBusiness business=cerePlatformBusinessService.checkUserName(param.getShopPhone());
//校验手机号是否已注册
CerePlatformBusinessUser business= cerePlatformBusinessUserService.checkUserName(param.getShopPhone());
if(business!=null){
return new Result(CoReturnFormat.PHONE_ALREADY_BIND_SHOP);
}
CerePlatformBusiness business2=cerePlatformBusinessService.checkPhone(param.getShopPhone());
CerePlatformBusinessUser business2= cerePlatformBusinessUserService.checkPhone(param.getShopPhone());
if(business2!=null){
return new Result(CoReturnFormat.PHONE_ALREADY_BIND_SHOP);
}
@ -171,20 +179,20 @@ public class ShopCheckController {
@NoRepeatWebLog
public Result enterpriseCheck(@RequestBody @Validated CereShopEnterpriseParam param, HttpServletRequest request) throws CoBusinessException{
//校验商家名称是否存在
CerePlatformShop shop=cerePlatformShopService.findByShopName(param.getShopName());
CerePlatformBusiness shop= cerePlatformBusinessService.findByBusinessName(param.getShopName());
if(shop!=null){
return new Result(CoReturnFormat.SHOP_NAME_ALREADY);
}
//校验手机号是否已注册
CerePlatformShop platformShop=cerePlatformShopService.findByPhone(param.getShopPhone());
CerePlatformBusiness platformShop=cerePlatformBusinessService.findByPhone(param.getShopPhone());
if(platformShop!=null){
return new Result(CoReturnFormat.SHOP_PHONE_ALREADY);
}
CerePlatformBusiness business=cerePlatformBusinessService.checkUserName(param.getShopPhone());
//校验手机号是否已注册
CerePlatformBusinessUser business= cerePlatformBusinessUserService.checkUserName(param.getShopPhone());
if(business!=null){
return new Result(CoReturnFormat.PHONE_ALREADY_BIND_SHOP);
}
CerePlatformBusiness business2=cerePlatformBusinessService.checkPhone(param.getShopPhone());
CerePlatformBusinessUser business2= cerePlatformBusinessUserService.checkPhone(param.getShopPhone());
if(business2!=null){
return new Result(CoReturnFormat.PHONE_ALREADY_BIND_SHOP);
}
@ -212,20 +220,20 @@ public class ShopCheckController {
@NoRepeatWebLog
public Result organizationsCheck(@RequestBody @Validated CereShopOtherOrganizationsParam param, HttpServletRequest request) throws CoBusinessException{
//校验商家名称是否存在
CerePlatformShop shop=cerePlatformShopService.findByShopName(param.getShopName());
CerePlatformBusiness shop= cerePlatformBusinessService.findByBusinessName(param.getShopName());
if(shop!=null){
return new Result(CoReturnFormat.SHOP_NAME_ALREADY);
}
//校验手机号是否已注册
CerePlatformShop platformShop=cerePlatformShopService.findByPhone(param.getShopPhone());
CerePlatformBusiness platformShop=cerePlatformBusinessService.findByPhone(param.getShopPhone());
if(platformShop!=null){
return new Result(CoReturnFormat.SHOP_PHONE_ALREADY);
}
CerePlatformBusiness business=cerePlatformBusinessService.checkUserName(param.getShopPhone());
//校验手机号是否已注册
CerePlatformBusinessUser business= cerePlatformBusinessUserService.checkUserName(param.getShopPhone());
if(business!=null){
return new Result(CoReturnFormat.PHONE_ALREADY_BIND_SHOP);
}
CerePlatformBusiness business2=cerePlatformBusinessService.checkPhone(param.getShopPhone());
CerePlatformBusinessUser business2= cerePlatformBusinessUserService.checkPhone(param.getShopPhone());
if(business2!=null){
return new Result(CoReturnFormat.PHONE_ALREADY_BIND_SHOP);
}
@ -253,12 +261,12 @@ public class ShopCheckController {
@NoRepeatWebLog
public Result updatePersonalCheck(@RequestBody @Validated CereShopPersonalParam param, HttpServletRequest request) throws CoBusinessException{
//校验商家名称是否存在
CerePlatformShop shop=cerePlatformShopService.checkShopIdByName(param.getShopName(),param.getShopId());
CerePlatformBusiness shop= cerePlatformBusinessService.checkBusinessIdByName(param.getShopName(),param.getBusinessId());
if(shop!=null){
return new Result(CoReturnFormat.SHOP_NAME_ALREADY);
}
//校验手机号是否已注册
CerePlatformShop platformShop=cerePlatformShopService.checkShopIdByPhone(param.getShopPhone(),param.getShopId());
CerePlatformBusiness platformShop=cerePlatformBusinessService.checkBusinessIdByPhone(param.getShopPhone(),param.getBusinessId());
if(platformShop!=null){
return new Result(CoReturnFormat.SHOP_PHONE_ALREADY);
}
@ -279,12 +287,11 @@ public class ShopCheckController {
@NoRepeatWebLog
public Result updateIndividualCheck(@RequestBody @Validated CereShopIndividualBusinessesParam param, HttpServletRequest request) throws CoBusinessException{
//校验商家名称是否存在
CerePlatformShop shop=cerePlatformShopService.checkShopIdByName(param.getShopName(),param.getShopId());
CerePlatformBusiness shop= cerePlatformBusinessService.checkBusinessIdByName(param.getShopName(),param.getBusinessId());
if(shop!=null){
return new Result(CoReturnFormat.SHOP_NAME_ALREADY);
}
//校验手机号是否已注册
CerePlatformShop platformShop=cerePlatformShopService.checkShopIdByPhone(param.getShopPhone(),param.getShopId());
CerePlatformBusiness platformShop=cerePlatformBusinessService.checkBusinessIdByPhone(param.getShopPhone(),param.getBusinessId());
if(platformShop!=null){
return new Result(CoReturnFormat.SHOP_PHONE_ALREADY);
}
@ -305,12 +312,11 @@ public class ShopCheckController {
@NoRepeatWebLog
public Result updateEnterpriseCheck(@RequestBody @Validated CereShopEnterpriseParam param, HttpServletRequest request) throws CoBusinessException{
//校验商家名称是否存在
CerePlatformShop shop=cerePlatformShopService.checkShopIdByName(param.getShopName(),param.getShopId());
CerePlatformBusiness shop= cerePlatformBusinessService.checkBusinessIdByName(param.getShopName(),param.getBusinessId());
if(shop!=null){
return new Result(CoReturnFormat.SHOP_NAME_ALREADY);
}
//校验手机号是否已注册
CerePlatformShop platformShop=cerePlatformShopService.checkShopIdByPhone(param.getShopPhone(),param.getShopId());
CerePlatformBusiness platformShop=cerePlatformBusinessService.checkBusinessIdByPhone(param.getShopPhone(),param.getBusinessId());
if(platformShop!=null){
return new Result(CoReturnFormat.SHOP_PHONE_ALREADY);
}
@ -331,12 +337,11 @@ public class ShopCheckController {
@NoRepeatWebLog
public Result updateOrganizationsCheck(@RequestBody @Validated CereShopOtherOrganizationsParam param, HttpServletRequest request) throws CoBusinessException{
//校验商家名称是否存在
CerePlatformShop shop=cerePlatformShopService.checkShopIdByName(param.getShopName(),param.getShopId());
CerePlatformBusiness shop= cerePlatformBusinessService.checkBusinessIdByName(param.getShopName(),param.getBusinessId());
if(shop!=null){
return new Result(CoReturnFormat.SHOP_NAME_ALREADY);
}
//校验手机号是否已注册
CerePlatformShop platformShop=cerePlatformShopService.checkShopIdByPhone(param.getShopPhone(),param.getShopId());
CerePlatformBusiness platformShop=cerePlatformBusinessService.checkBusinessIdByPhone(param.getShopPhone(),param.getBusinessId());
if(platformShop!=null){
return new Result(CoReturnFormat.SHOP_PHONE_ALREADY);
}

6
cereshop-app/src/main/java/com/shop/cereshop/app/dao/business/CereBusinessShopDAO.java → cereshop-app/src/main/java/com/shop/cereshop/app/dao/business/CereBusinessUserDAO.java

@ -5,12 +5,12 @@
*/
package com.shop.cereshop.app.dao.business;
import com.shop.cereshop.commons.domain.business.CereBusinessShop;
import com.shop.cereshop.commons.domain.business.CereBusinessUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface CereBusinessShopDAO extends BaseMapper<CereBusinessShop> {
public interface CereBusinessUserDAO extends BaseMapper<CereBusinessUser> {
int insertSelective(CereBusinessShop record);
int insertSelective(CereBusinessUser record);
}

22
cereshop-app/src/main/java/com/shop/cereshop/app/dao/business/CerePlatformBusinessDAO.java

@ -5,24 +5,34 @@
*/
package com.shop.cereshop.app.dao.business;
import com.shop.cereshop.commons.domain.business.CerePlatformBusiness;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shop.cereshop.commons.domain.business.CerePlatformBusiness;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface CerePlatformBusinessDAO extends BaseMapper<CerePlatformBusiness> {
int deleteByPrimaryKey(Long businessUserId);
int deleteByPrimaryKey(Long businessId);
int insertSelective(CerePlatformBusiness record);
CerePlatformBusiness selectByPrimaryKey(Long businessUserId);
CerePlatformBusiness selectByPrimaryKey(Long businessId);
int updateByPrimaryKeySelective(CerePlatformBusiness record);
int updateByPrimaryKey(CerePlatformBusiness record);
List<CerePlatformBusiness> selectAll();
List<CerePlatformBusiness> getByIdList(@Param("businessIdList") List<Long> businessIdList);
CerePlatformBusiness findByBusinessName(@Param("businessName") String businessName);
CerePlatformBusiness findByPhone(@Param("businessPhone") String businessPhone);
CerePlatformBusiness checkBusinessIdByName(@Param("businessName") String businessName, @Param("businessid") Long businessid);
CerePlatformBusiness checkUserName(@Param("shopPhone") String shopPhone);
CerePlatformBusiness checkBusinessIdByPhone(@Param("businessPhone") String businessPhone, @Param("businessid") Long businessid);
CerePlatformBusiness checkPhone(String phone);
}

28
cereshop-app/src/main/java/com/shop/cereshop/app/dao/business/CerePlatformBusinessUserDAO.java

@ -0,0 +1,28 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.app.dao.business;
import com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface CerePlatformBusinessUserDAO extends BaseMapper<CerePlatformBusinessUser> {
int deleteByPrimaryKey(Long businessUserId);
int insertSelective(CerePlatformBusinessUser record);
CerePlatformBusinessUser selectByPrimaryKey(Long businessUserId);
int updateByPrimaryKeySelective(CerePlatformBusinessUser record);
int updateByPrimaryKey(CerePlatformBusinessUser record);
CerePlatformBusinessUser checkUserName(@Param("shopPhone") String shopPhone);
CerePlatformBusinessUser checkPhone(String phone);
}

6
cereshop-app/src/main/java/com/shop/cereshop/app/dao/shop/CereShopEnterpriseDAO.java → cereshop-app/src/main/java/com/shop/cereshop/app/dao/business/CereShopEnterpriseDAO.java

@ -3,10 +3,10 @@
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.app.dao.shop;
package com.shop.cereshop.app.dao.business;
import com.shop.cereshop.app.param.shop.CereShopEnterpriseParam;
import com.shop.cereshop.commons.domain.shop.CereShopEnterprise;
import com.shop.cereshop.commons.domain.business.CereShopEnterprise;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -18,7 +18,7 @@ public interface CereShopEnterpriseDAO extends BaseMapper<CereShopEnterprise> {
void updateEnterprise(CereShopEnterprise enterprise);
CereShopEnterprise findByShopId(@Param("shopId") Long shopId);
CereShopEnterprise findByBusinessId(@Param("businessId") Long businessId);
void insertParam(CereShopEnterpriseParam param);

6
cereshop-app/src/main/java/com/shop/cereshop/app/dao/shop/CereShopIndividualBusinessesDAO.java → cereshop-app/src/main/java/com/shop/cereshop/app/dao/business/CereShopIndividualBusinessesDAO.java

@ -3,10 +3,10 @@
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.app.dao.shop;
package com.shop.cereshop.app.dao.business;
import com.shop.cereshop.app.param.shop.CereShopIndividualBusinessesParam;
import com.shop.cereshop.commons.domain.shop.CereShopIndividualBusinesses;
import com.shop.cereshop.commons.domain.business.CereShopIndividualBusinesses;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -18,7 +18,7 @@ public interface CereShopIndividualBusinessesDAO extends BaseMapper<CereShopIndi
void updateIndividual(CereShopIndividualBusinesses individualBusinesses);
CereShopIndividualBusinesses findByShopId(@Param("shopId") Long shopId);
CereShopIndividualBusinesses findByBusinessId(@Param("businessId") Long businessId);
void insertParam(CereShopIndividualBusinessesParam param);

6
cereshop-app/src/main/java/com/shop/cereshop/app/dao/shop/CereShopOtherOrganizationsDAO.java → cereshop-app/src/main/java/com/shop/cereshop/app/dao/business/CereShopOtherOrganizationsDAO.java

@ -3,10 +3,10 @@
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.app.dao.shop;
package com.shop.cereshop.app.dao.business;
import com.shop.cereshop.app.param.shop.CereShopOtherOrganizationsParam;
import com.shop.cereshop.commons.domain.shop.CereShopOtherOrganizations;
import com.shop.cereshop.commons.domain.business.CereShopOtherOrganizations;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -18,7 +18,7 @@ public interface CereShopOtherOrganizationsDAO extends BaseMapper<CereShopOtherO
void updateOrganizations(CereShopOtherOrganizations otherOrganizations);
CereShopOtherOrganizations findByShopId(@Param("shopId") Long shopId);
CereShopOtherOrganizations findByBusinessId(@Param("businessId") Long businessId);
void insertParam(CereShopOtherOrganizationsParam param);

6
cereshop-app/src/main/java/com/shop/cereshop/app/dao/shop/CereShopPersonalDAO.java → cereshop-app/src/main/java/com/shop/cereshop/app/dao/business/CereShopPersonalDAO.java

@ -3,10 +3,10 @@
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.app.dao.shop;
package com.shop.cereshop.app.dao.business;
import com.shop.cereshop.app.param.shop.CereShopPersonalParam;
import com.shop.cereshop.commons.domain.shop.CereShopPersonal;
import com.shop.cereshop.commons.domain.business.CereShopPersonal;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -18,7 +18,7 @@ public interface CereShopPersonalDAO extends BaseMapper<CereShopPersonal> {
void updatePersonal(CereShopPersonal personal);
CereShopPersonal findByShopId(@Param("shopId") Long shopId);
CereShopPersonal findByBusinessId(@Param("businessId") Long businessId);
void insertParam(CereShopPersonalParam param);
}

16
cereshop-app/src/main/java/com/shop/cereshop/app/dao/buyer/CereBuyerUserDAO.java

@ -31,11 +31,11 @@ public interface CereBuyerUserDAO extends BaseMapper<CereBuyerUser> {
CereBuyerUser findByToken(@Param("token") String token);
BuyerUser findByOpenid(@Param("openid") String openid);
BuyerUser findByOpenid(@Param("project") String project, @Param("openid") String openid);
BuyerUser findByAliUserId(@Param("aliUserId") String aliUserId);
BuyerUser findByAliUserId(@Param("project") String project, @Param("aliUserId") String aliUserId);
BuyerUser findByPhone(@Param("phone") String phone);
BuyerUser findByPhone(@Param("project") String project, @Param("phone") String phone);
void relievePhone(CereBuyerUser cereBuyerUser);
@ -43,15 +43,15 @@ public interface CereBuyerUserDAO extends BaseMapper<CereBuyerUser> {
MyUser getUser(@Param("buyerUserId") Long buyerUserId);
CerePlatformCanvas getCanvas(CerePlatformCanvas canvas);
CerePlatformCanvas getCanvas(@Param("canvas") CerePlatformCanvas canvas);
CereBuyerUser getByOpenid(@Param("wechatOpenId") String wechatOpenId);
CereBuyerUser getByOpenid(@Param("project") String project,@Param("wechatOpenId") String wechatOpenId);
CereBuyerUser checkPhoneWx(@Param("phone") String phone);
CereBuyerUser checkPhoneWx(@Param("project") String project, @Param("phone") String phone);
CereBuyerUser checkPhoneAli(@Param("phone") String phone, @Param("buyerUserId") Long buyerUserId);
CereBuyerUser checkPhoneAli(@Param("project") String project,@Param("phone") String phone, @Param("buyerUserId") Long buyerUserId);
CereBuyerUser selectByPhone(@Param("phone") String phone);
CereBuyerUser selectByPhone(@Param("project") String project, @Param("phone") String phone);
void updateGrowth(@Param("buyerUserId") Long buyerUserId, @Param("growth") Integer growth);

9
cereshop-app/src/main/java/com/shop/cereshop/app/dao/product/CereProductClassifyDAO.java

@ -5,13 +5,12 @@
*/
package com.shop.cereshop.app.dao.product;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shop.cereshop.app.page.classify.Classify;
import com.shop.cereshop.app.page.index.Product;
import com.shop.cereshop.app.page.index.ProductClassify;
import com.shop.cereshop.app.page.index.ProductImage;
import com.shop.cereshop.app.param.classify.ClassifyProductParam;
import com.shop.cereshop.commons.domain.product.CereProductClassify;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -31,11 +30,11 @@ public interface CereProductClassifyDAO extends BaseMapper<CereProductClassify>
int updateByPrimaryKey(CereProductClassify record);
List<ProductClassify> findAll();
List<CereProductClassify> findAll(@Param("project") String project);
List<Classify> getFirstClassify(@Param("classifyId") Long classifyId);
List<Classify> getFirstClassify(@Param("project") String project,@Param("classifyId") Long classifyId);
List<Classify> findThreeClassify();
List<Classify> findThreeClassify(@Param("project") String project);
List<Product> getClaasifyProducts(ClassifyProductParam param);

2
cereshop-app/src/main/java/com/shop/cereshop/app/dao/shop/CerePlatformShopDAO.java

@ -33,8 +33,6 @@ public interface CerePlatformShopDAO extends BaseMapper<CerePlatformShop> {
int updateByPrimaryKeySelective(CerePlatformShop record);
int updateByPrimaryKey(CerePlatformShop record);
List<RecommendShop> findRecommendShop();
RecommendShop findVolumeProductByShopId(@Param("shopId") Long shopId);

17
cereshop-app/src/main/java/com/shop/cereshop/app/dao/shop/CereShopCheckDAO.java

@ -0,0 +1,17 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.app.dao.shop;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shop.cereshop.commons.domain.shop.CereShopCheck;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface CereShopCheckDAO extends BaseMapper<CereShopCheck> {
int insertSelective(CereShopCheck record);
}

34
cereshop-app/src/main/java/com/shop/cereshop/app/interceptor/AuthorizationInterceptor.java

@ -9,6 +9,7 @@ import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.shop.cereshop.app.redis.service.api.UserRedisService;
import com.shop.cereshop.app.service.buyer.CereBuyerUserService;
import com.shop.cereshop.app.utils.ContextUtil;
import com.shop.cereshop.app.utils.TokenProvider;
import com.shop.cereshop.commons.config.SecurityProperties;
import com.shop.cereshop.commons.constant.CoReturnFormat;
@ -116,13 +117,46 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
writer.close();
}
}
String project = request.getHeader("project");
if (EmptyUtils.isEmpty(project) || project.equals("undefined")) {
project = "0";
}
//user存在 设置user
if(ObjectUtil.isNotNull(user)){
String userProject = user.getProject();
if(StringUtils.isEmpty(userProject)){
userProject = "0";
}
if(!StringUtils.equals(project,userProject)){
//当前登录的用户不是一个商店的也算是未登录
try {
writer = response.getWriter();
// writer.print("token为空");
result = new Result(CoReturnFormat.USER_NOT_LOGIN);
writer.println(JSON.toJSONString(result).toString());
return false;
} catch (IOException e) {
log.error("response error", e);
} finally {
if (writer != null)
writer.close();
}
}
//设置userId到request里后续根据userId获取用户信息
user.setToken(token);
request.setAttribute(USER, user);
}
if(StringUtils.isNotEmpty(project)){
ContextUtil.setProject(project);
}else {
ContextUtil.clearProject();
}
return true;
}

3
cereshop-app/src/main/java/com/shop/cereshop/app/page/index/Index.java

@ -5,6 +5,7 @@
*/
package com.shop.cereshop.app.page.index;
import com.shop.cereshop.commons.domain.product.CereProductClassify;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -22,7 +23,7 @@ public class Index {
* 类目数据
*/
@ApiModelProperty(value = "类目数据")
private List<ProductClassify> classifies;
private List<CereProductClassify> classifies;
/**
* 推荐店铺数据

30
cereshop-app/src/main/java/com/shop/cereshop/app/page/index/ProductClassify.java

@ -1,30 +0,0 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.app.page.index;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 首页类目数据
*/
@Data
@ApiModel(value = "ProductClassify", description = "首页类目数据")
public class ProductClassify {
/**
* 分类id
*/
@ApiModelProperty(value = "分类id")
private Long classifyId;
/**
* 分类名称
*/
@ApiModelProperty(value = "分类名称")
private String classifyName;
}

6
cereshop-app/src/main/java/com/shop/cereshop/app/page/settlement/SettlementShop.java

@ -40,6 +40,12 @@ public class SettlementShop {
private String shopName;
/**
* 商家id
*/
@ApiModelProperty(value = "商家id")
private Long businessId;
/**
* 仓库id
*/
@ApiModelProperty(value = "仓库id")

4
cereshop-app/src/main/java/com/shop/cereshop/app/page/shop/PlatformShop.java

@ -5,6 +5,10 @@
*/
package com.shop.cereshop.app.page.shop;
import com.shop.cereshop.commons.domain.business.CereShopEnterprise;
import com.shop.cereshop.commons.domain.business.CereShopIndividualBusinesses;
import com.shop.cereshop.commons.domain.business.CereShopOtherOrganizations;
import com.shop.cereshop.commons.domain.business.CereShopPersonal;
import com.shop.cereshop.commons.domain.shop.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

7
cereshop-app/src/main/java/com/shop/cereshop/app/param/classify/ClassifyProductParam.java

@ -18,6 +18,13 @@ import lombok.Data;
public class ClassifyProductParam extends PageParam {
/**
* 所属平台
*/
@ApiModelProperty(value = "所属平台")
private String project;
/**
* 价格排序条件 1-升序 2-降序
*/
@ApiModelProperty(value = "价格排序条件 1-升序 2-降序")

2
cereshop-app/src/main/java/com/shop/cereshop/app/param/shop/CereShopEnterpriseParam.java

@ -5,7 +5,7 @@
*/
package com.shop.cereshop.app.param.shop;
import com.shop.cereshop.commons.domain.shop.CereShopEnterprise;
import com.shop.cereshop.commons.domain.business.CereShopEnterprise;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

2
cereshop-app/src/main/java/com/shop/cereshop/app/param/shop/CereShopIndividualBusinessesParam.java

@ -5,7 +5,7 @@
*/
package com.shop.cereshop.app.param.shop;
import com.shop.cereshop.commons.domain.shop.CereShopIndividualBusinesses;
import com.shop.cereshop.commons.domain.business.CereShopIndividualBusinesses;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

2
cereshop-app/src/main/java/com/shop/cereshop/app/param/shop/CereShopOtherOrganizationsParam.java

@ -5,7 +5,7 @@
*/
package com.shop.cereshop.app.param.shop;
import com.shop.cereshop.commons.domain.shop.CereShopOtherOrganizations;
import com.shop.cereshop.commons.domain.business.CereShopOtherOrganizations;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

2
cereshop-app/src/main/java/com/shop/cereshop/app/param/shop/CereShopPersonalParam.java

@ -5,7 +5,7 @@
*/
package com.shop.cereshop.app.param.shop;
import com.shop.cereshop.commons.domain.shop.CereShopPersonal;
import com.shop.cereshop.commons.domain.business.CereShopPersonal;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

77
cereshop-app/src/main/java/com/shop/cereshop/app/pay/xs/service/impl/XsPayServiceImpl.java

@ -14,11 +14,13 @@ import com.shop.cereshop.app.dao.shop.CereShopCrossDetailDAO;
import com.shop.cereshop.app.pay.xs.domain.XsCallBackRequestVo;
import com.shop.cereshop.app.pay.xs.service.XsPayService;
import com.shop.cereshop.app.pay.xs.utils.CommonUtils;
import com.shop.cereshop.app.service.business.CerePlatformBusinessService;
import com.shop.cereshop.app.service.buyer.CereBuyerUserService;
import com.shop.cereshop.app.service.pay.CerePayLogService;
import com.shop.cereshop.app.service.shop.CerePlatformShopService;
import com.shop.cereshop.commons.config.XspayConfig;
import com.shop.cereshop.commons.constant.XsPayEnum;
import com.shop.cereshop.commons.domain.business.CerePlatformBusiness;
import com.shop.cereshop.commons.domain.buyer.CereBuyerUser;
import com.shop.cereshop.commons.domain.order.CereOrderParent;
import com.shop.cereshop.commons.domain.order.CereOrderProduct;
@ -62,6 +64,9 @@ public class XsPayServiceImpl implements XsPayService {
private CerePlatformShopService cerePlatformShopservice;
@Autowired
private CerePlatformBusinessService cerePlatformBusinessservice;
//支付申请服务代码 serCode
private static final String PAY_SER_CODE = "101005";
//退款申请服务代码 serCode
@ -109,7 +114,7 @@ public class XsPayServiceImpl implements XsPayService {
}else{
e.printStackTrace();
}
throw new CoBusinessException("10000","获取支付二维码出错");
throw new CoBusinessException("10000","获取支付二维码出错", "");
}
}
return null;
@ -193,7 +198,7 @@ public class XsPayServiceImpl implements XsPayService {
// }else{
// e.printStackTrace();
// }
// throw new CoBusinessException("10000","获取支付二维码出错");
// throw new CoBusinessException("10000","获取支付二维码出错", "");
// }
// }
return null;
@ -225,7 +230,7 @@ public class XsPayServiceImpl implements XsPayService {
}else{
e.printStackTrace();
}
throw new CoBusinessException("10000","获取支付二维码出错");
throw new CoBusinessException("10000","获取支付二维码出错", "");
}
}
return null;
@ -287,14 +292,23 @@ public class XsPayServiceImpl implements XsPayService {
List<Long> shopIdList = orderList.stream().map(CereShopOrder::getShopId).distinct().collect(Collectors.toList());
List<CerePlatformShop> cerePlatformShopList = cerePlatformShopservice.getByIdList(shopIdList);
for (CerePlatformShop cerePlatformShop : cerePlatformShopList) {
if(StringUtils.isEmpty(cerePlatformShop.getXsPayId())){
throw new CoBusinessException("10000","商家" + cerePlatformShop.getShopName() + "未进行支付信息认证,请联系管理员", "");
// for (CerePlatformShop cerePlatformShop : cerePlatformShopList) {
// if(StringUtils.isEmpty(cerePlatformShop.getXsPayId())){
// throw new CoBusinessException("10000","商家" + cerePlatformShop.getShopName() + "未进行支付信息认证,请联系管理员", "");
// }
// }
List<Long> businessIdList = cerePlatformShopList.stream().map(CerePlatformShop::getBusinessId).distinct().collect(Collectors.toList());
List<CerePlatformBusiness> cerePlatformBusinessList = cerePlatformBusinessservice.getByIdList(businessIdList);
for (CerePlatformBusiness cerePlatformBusiness : cerePlatformBusinessList) {
if(StringUtils.isEmpty(cerePlatformBusiness.getXsPayId())){
throw new CoBusinessException("10000","商家" + cerePlatformBusiness.getBusinessName() + "未进行支付信息认证,请联系管理员", "");
}
}
Map<String, Object> contentMap = build05ContentMap(orderFormId, payerAccount, user, orderList, cereOrderProductList, cerePlatformShopList,
money, tradeType, payType, XspayConfig.APP_RETURN_URL,
cerePlatformBusinessList, money, tradeType, payType, XspayConfig.APP_RETURN_URL,
XspayConfig.APP_NOTICE_URL);
return contentMap;
@ -324,6 +338,7 @@ public class XsPayServiceImpl implements XsPayService {
private static Map<String,Object> build05ContentMap(String orderFormid, String payerAccount, CereBuyerUser user, List<CereShopOrder> orderList,
List<CereOrderProduct> cereOrderProductList,
List<CerePlatformShop> cerePlatformShopList,
List<CerePlatformBusiness> cerePlatformBusinessList,
BigDecimal money, String tradeType,
String payType, String returnUrl, String noticeUrl){
// 设置请求正文 contentMap有序顺序按照文档从上到下为空字段可不传该字段
@ -357,7 +372,7 @@ public class XsPayServiceImpl implements XsPayService {
//分账标识 0:不分账 1:实时分账 2:延时分账
contentMap.put("shareFlag", "1");
//分账订单信息 shangFlag=1时必填
JSONArray jsonArray = buildSubMerchantOrderDetails(orderList, cereOrderProductList, cerePlatformShopList);
JSONArray jsonArray = buildSubMerchantOrderDetails(orderList, cereOrderProductList, cerePlatformShopList, cerePlatformBusinessList);
if(jsonArray != null) {
contentMap.put("subMerchantOrderDetails", JSONArray.toJSONString(jsonArray));
}
@ -403,7 +418,8 @@ public class XsPayServiceImpl implements XsPayService {
*/
private static JSONArray buildSubMerchantOrderDetails(List<CereShopOrder> orderList,
List<CereOrderProduct> cereOrderProductList,
List<CerePlatformShop> cerePlatformShopList){
List<CerePlatformShop> cerePlatformShopList,
List<CerePlatformBusiness> cerePlatformBusinessList){
if(cereOrderProductList.isEmpty()){
return null;
}
@ -414,6 +430,9 @@ public class XsPayServiceImpl implements XsPayService {
CerePlatformShop cerePlatformShop = cerePlatformShopList.stream().filter(item ->
item.getShopId().equals(cereShopOrder.getShopId())).findFirst().orElse(null);
CerePlatformBusiness cerePlatformBusiness = cerePlatformBusinessList.stream().filter(item ->
item.getBusinessId().equals(cerePlatformShop.getBusinessId())).findFirst().orElse(null);
subOrder1.put("subOrderId",cereShopOrder.getOrderFormid());
subOrder1.put("subOrderAmount", cereShopOrder.getPrice().multiply(BigDecimal.valueOf(100)).intValue());
@ -423,27 +442,33 @@ public class XsPayServiceImpl implements XsPayService {
//子订单1 明细1
JSONObject detail1 = new JSONObject();
detail1.put("shareDetailId","" + cereOrderProduct.getOrderId() + cereOrderProduct.getOrderProductId());
detail1.put("shareParId", cerePlatformShop.getXsPayId());
//这里是否需要减去用积分抵扣金额
detail1.put("shareAmount",
cereOrderProduct.getActualPrice().add(cereOrderProduct.getLogisticsPrice())
.subtract(cereOrderProduct.getUseCreditAmount())
.subtract(cereOrderProduct.getPlatformCommission())
.multiply(BigDecimal.valueOf(100)).intValue()
);
detail1.put("shareParId", cerePlatformBusiness.getXsPayId());
int productShareAmount = cereOrderProduct.getActualPrice().add(cereOrderProduct.getLogisticsPrice())
.subtract(cereOrderProduct.getUseCreditAmount())
.subtract(cereOrderProduct.getPlatformCommission())
.multiply(BigDecimal.valueOf(100)).intValue();
//这里是否需要减去用积分抵扣金额
detail1.put("shareAmount",productShareAmount);
detail1.put("settleCurCode","CNY");
detailArray1.add(detail1);
if(productShareAmount > 0) {
detailArray1.add(detail1);
}
}
JSONObject detail2 = new JSONObject();
detail2.put("shareDetailId","platformCommission-" + cereShopOrder.getOrderId());
detail2.put("shareParId", XspayConfig.MER_CODE);
detail2.put("shareAmount",cereShopOrder.getPlatformCommission().multiply(BigDecimal.valueOf(100)).intValue());
detail2.put("settleCurCode","CNY");
detailArray1.add(detail2);
int platformShareAmount = cereShopOrder.getPlatformCommission().multiply(BigDecimal.valueOf(100)).intValue();
if(platformShareAmount > 0) {
JSONObject detail2 = new JSONObject();
detail2.put("shareDetailId", "platformCommission-" + cereShopOrder.getOrderId());
detail2.put("shareParId", XspayConfig.MER_CODE);
detail2.put("shareAmount", cereShopOrder.getPlatformCommission().multiply(BigDecimal.valueOf(100)).intValue());
detail2.put("settleCurCode", "CNY");
detailArray1.add(detail2);
}
subOrder1.put("shareDetail", detailArray1);
jsonArray.add(subOrder1);
if(!detailArray1.isEmpty()) {
subOrder1.put("shareDetail", detailArray1);
jsonArray.add(subOrder1);
}
}
return jsonArray;

6
cereshop-app/src/main/java/com/shop/cereshop/app/service/business/CereBusinessShopService.java → cereshop-app/src/main/java/com/shop/cereshop/app/service/business/CereBusinessUserService.java

@ -5,9 +5,9 @@
*/
package com.shop.cereshop.app.service.business;
import com.shop.cereshop.commons.domain.business.CereBusinessShop;
import com.shop.cereshop.commons.domain.business.CereBusinessUser;
import com.shop.cereshop.commons.exception.CoBusinessException;
public interface CereBusinessShopService {
void insert(CereBusinessShop cereBusinessShop) throws CoBusinessException;
public interface CereBusinessUserService {
void insert(CereBusinessUser cereBusinessUser) throws CoBusinessException;
}

17
cereshop-app/src/main/java/com/shop/cereshop/app/service/business/CerePlatformBusinessService.java

@ -8,10 +8,23 @@ package com.shop.cereshop.app.service.business;
import com.shop.cereshop.commons.domain.business.CerePlatformBusiness;
import com.shop.cereshop.commons.exception.CoBusinessException;
import java.util.List;
public interface CerePlatformBusinessService {
CerePlatformBusiness selectByPrimaryKey(Long businessId);
CerePlatformBusiness findByBusinessName(String businessName);
CerePlatformBusiness findByPhone(String businessPhone);
CerePlatformBusiness checkBusinessIdByName(String businessName, Long businessId);
CerePlatformBusiness checkBusinessIdByPhone(String businessPhone, Long businessId);
void insert(CerePlatformBusiness cerePlatformBusiness) throws CoBusinessException;
CerePlatformBusiness checkUserName(String shopPhone);
void update(CerePlatformBusiness cerePlatformBusiness) throws CoBusinessException;
CerePlatformBusiness checkPhone(String phone);
List<CerePlatformBusiness> getByIdList(List<Long> businessIdList);
}

17
cereshop-app/src/main/java/com/shop/cereshop/app/service/business/CerePlatformBusinessUserService.java

@ -0,0 +1,17 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.app.service.business;
import com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser;
import com.shop.cereshop.commons.exception.CoBusinessException;
public interface CerePlatformBusinessUserService {
void insert(CerePlatformBusinessUser cerePlatformBusinessUser) throws CoBusinessException;
CerePlatformBusinessUser checkUserName(String shopPhone);
CerePlatformBusinessUser checkPhone(String phone);
}

14
cereshop-app/src/main/java/com/shop/cereshop/app/service/business/impl/CereBusinessShopServiceImpl.java → cereshop-app/src/main/java/com/shop/cereshop/app/service/business/impl/CereBusinessUserServiceImpl.java

@ -5,21 +5,21 @@
*/
package com.shop.cereshop.app.service.business.impl;
import com.shop.cereshop.app.dao.business.CereBusinessShopDAO;
import com.shop.cereshop.app.service.business.CereBusinessShopService;
import com.shop.cereshop.commons.domain.business.CereBusinessShop;
import com.shop.cereshop.app.dao.business.CereBusinessUserDAO;
import com.shop.cereshop.app.service.business.CereBusinessUserService;
import com.shop.cereshop.commons.domain.business.CereBusinessUser;
import com.shop.cereshop.commons.exception.CoBusinessException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class CereBusinessShopServiceImpl implements CereBusinessShopService {
public class CereBusinessUserServiceImpl implements CereBusinessUserService {
@Autowired
private CereBusinessShopDAO cereBusinessShopDAO;
private CereBusinessUserDAO cereBusinessUserDAO;
@Override
public void insert(CereBusinessShop cereBusinessShop) throws CoBusinessException {
cereBusinessShopDAO.insert(cereBusinessShop);
public void insert(CereBusinessUser cereBusinessUser) throws CoBusinessException {
cereBusinessUserDAO.insert(cereBusinessUser);
}
}

57
cereshop-app/src/main/java/com/shop/cereshop/app/service/business/impl/CerePlatformBusinessServiceImpl.java

@ -7,29 +7,78 @@ package com.shop.cereshop.app.service.business.impl;
import com.shop.cereshop.app.dao.business.CerePlatformBusinessDAO;
import com.shop.cereshop.app.service.business.CerePlatformBusinessService;
import com.shop.cereshop.app.service.log.CerePlatformLogService;
import com.shop.cereshop.app.service.shop.CereShopEnterpriseService;
import com.shop.cereshop.app.service.shop.CereShopIndividualBusinessesService;
import com.shop.cereshop.app.service.shop.CereShopOtherOrganizationsService;
import com.shop.cereshop.app.service.shop.CereShopPersonalService;
import com.shop.cereshop.commons.domain.business.CerePlatformBusiness;
import com.shop.cereshop.commons.exception.CoBusinessException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Slf4j
@Service
public class CerePlatformBusinessServiceImpl implements CerePlatformBusinessService {
@Autowired
private CerePlatformBusinessDAO cerePlatformBusinessDAO;
@Autowired
private CereShopPersonalService cereShopPersonalService;
@Autowired
private CereShopIndividualBusinessesService cereShopIndividualBusinessesService;
@Autowired
private CereShopEnterpriseService cereShopEnterpriseService;
@Autowired
private CereShopOtherOrganizationsService cereShopOtherOrganizationsService;
@Autowired
private CerePlatformLogService cerePlatformLogService;
@Override
public CerePlatformBusiness selectByPrimaryKey(Long businessId) {
return cerePlatformBusinessDAO.selectByPrimaryKey(businessId);
}
@Override
public CerePlatformBusiness findByBusinessName(String businessName) {
return cerePlatformBusinessDAO.findByBusinessName(businessName);
}
@Override
public CerePlatformBusiness findByPhone(String businessPhone) {
return cerePlatformBusinessDAO.findByPhone(businessPhone);
}
@Override
public CerePlatformBusiness checkBusinessIdByName(String businessName, Long businessId) {
return cerePlatformBusinessDAO.checkBusinessIdByName(businessName, businessId);
}
@Override
public CerePlatformBusiness checkBusinessIdByPhone(String businessPhone, Long businessId) {
return cerePlatformBusinessDAO.checkBusinessIdByPhone(businessPhone, businessId);
}
@Override
public void insert(CerePlatformBusiness cerePlatformBusiness) throws CoBusinessException {
cerePlatformBusinessDAO.insert(cerePlatformBusiness);
}
@Override
public CerePlatformBusiness checkUserName(String shopPhone) {
return cerePlatformBusinessDAO.checkUserName(shopPhone);
public void update(CerePlatformBusiness cerePlatformBusiness) throws CoBusinessException {
cerePlatformBusinessDAO.updateByPrimaryKeySelective(cerePlatformBusiness);
}
@Override
public CerePlatformBusiness checkPhone(String phone) {
return cerePlatformBusinessDAO.checkPhone(phone);
public List<CerePlatformBusiness> getByIdList(List<Long> businessIdList){
return cerePlatformBusinessDAO.getByIdList(businessIdList);
}
}

35
cereshop-app/src/main/java/com/shop/cereshop/app/service/business/impl/CerePlatformBusinessUserServiceImpl.java

@ -0,0 +1,35 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.app.service.business.impl;
import com.shop.cereshop.app.dao.business.CerePlatformBusinessUserDAO;
import com.shop.cereshop.app.service.business.CerePlatformBusinessUserService;
import com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser;
import com.shop.cereshop.commons.exception.CoBusinessException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class CerePlatformBusinessUserServiceImpl implements CerePlatformBusinessUserService {
@Autowired
private CerePlatformBusinessUserDAO cerePlatformBusinessUserDAO;
@Override
public void insert(CerePlatformBusinessUser cerePlatformBusinessUser) throws CoBusinessException {
cerePlatformBusinessUserDAO.insert(cerePlatformBusinessUser);
}
@Override
public CerePlatformBusinessUser checkUserName(String shopPhone) {
return cerePlatformBusinessUserDAO.checkUserName(shopPhone);
}
@Override
public CerePlatformBusinessUser checkPhone(String phone) {
return cerePlatformBusinessUserDAO.checkPhone(phone);
}
}

2
cereshop-app/src/main/java/com/shop/cereshop/app/service/buyer/CereBuyerUserService.java

@ -51,7 +51,7 @@ public interface CereBuyerUserService {
MyUser getUser(Long buyerUserId) throws CoBusinessException;
CerePlatformCanvas getCanvas(CerePlatformCanvas canvas);
CerePlatformCanvas getCanvas(CerePlatformCanvas canvas) throws CoBusinessException;
Page getSelfProblems(PageParam param,Long buyerUserId) throws CoBusinessException;

41
cereshop-app/src/main/java/com/shop/cereshop/app/service/buyer/impl/CereBuyerUserServiceImpl.java

@ -46,6 +46,7 @@ import com.shop.cereshop.app.service.seckill.CereProductProblemService;
import com.shop.cereshop.app.service.shop.CereShopCommentService;
import com.shop.cereshop.app.service.shop.CereShopVisitService;
import com.shop.cereshop.app.utils.AlipayUtil;
import com.shop.cereshop.app.utils.ContextUtil;
import com.shop.cereshop.app.utils.MemberUtil;
import com.shop.cereshop.app.utils.WechatUtil;
import com.shop.cereshop.commons.cache.constants.CacheKeyConstants;
@ -226,7 +227,7 @@ public class CereBuyerUserServiceImpl implements CereBuyerUserService {
}
//查询该微信号是否已注册
if(!EmptyUtils.isEmpty(openid)){
user=cereBuyerUserDAO.findByOpenid(openid);
user=cereBuyerUserDAO.findByOpenid(ContextUtil.getProject(), openid);
if(user==null){
//未注册
user = new BuyerUser();
@ -267,7 +268,7 @@ public class CereBuyerUserServiceImpl implements CereBuyerUserService {
if (userInfoResponse == null || StringUtils.isBlank(userInfoResponse.getUserId())) {
throw new CoBusinessException(CoReturnFormat.ALI_APPLET_AUTH_ERROR);
}
user=cereBuyerUserDAO.findByAliUserId(userInfoResponse.getUserId());
user=cereBuyerUserDAO.findByAliUserId(ContextUtil.getProject(), userInfoResponse.getUserId());
if (user==null) {
//未注册
user = new BuyerUser();
@ -277,6 +278,7 @@ public class CereBuyerUserServiceImpl implements CereBuyerUserService {
//新增用户
CereBuyerUser buyerUser=new CereBuyerUser();
//buyerUser.setWechatOpenId(param.getWechatOpenId());
buyerUser.setProject(ContextUtil.getProject());
buyerUser.setAliUserId(userInfoResponse.getUserId());
buyerUser.setCreateTime(time);
buyerUser.setPhone(param.getPhone());
@ -333,7 +335,7 @@ public class CereBuyerUserServiceImpl implements CereBuyerUserService {
String time = TimeUtils.yyMMddHHmmss();
//查询该微信号是否已注册
if(!EmptyUtils.isEmpty(param.getWechatOpenId())){
user=cereBuyerUserDAO.findByOpenid(param.getWechatOpenId());
user=cereBuyerUserDAO.findByOpenid( ContextUtil.getProject(), param.getWechatOpenId());
if(user==null){
//未注册
user = new BuyerUser();
@ -368,7 +370,7 @@ public class CereBuyerUserServiceImpl implements CereBuyerUserService {
result.setPhone(phone);
String time =TimeUtils.yyMMddHHmmss();
//校验手机号是否绑定其他微信
CereBuyerUser cereBuyerUser=cereBuyerUserDAO.checkPhoneWx(phone);
CereBuyerUser cereBuyerUser=cereBuyerUserDAO.checkPhoneWx(ContextUtil.getProject(), phone);
if(cereBuyerUser!=null){
//绑定了微信
if(!cereBuyerUser.getWechatOpenId().equals(param.getWechatOpenId())){
@ -388,9 +390,9 @@ public class CereBuyerUserServiceImpl implements CereBuyerUserService {
}
}
//查询手机号已注册用户数据
BuyerUser byPhone = cereBuyerUserDAO.findByPhone(phone);
BuyerUser byPhone = cereBuyerUserDAO.findByPhone(ContextUtil.getProject(), phone);
//查询微信已注册用户数据
CereBuyerUser user=cereBuyerUserDAO.getByOpenid(param.getWechatOpenId());
CereBuyerUser user=cereBuyerUserDAO.getByOpenid(ContextUtil.getProject(), param.getWechatOpenId());
if(byPhone!=null){
if(user!=null){
//删除手机号注册用户
@ -398,6 +400,7 @@ public class CereBuyerUserServiceImpl implements CereBuyerUserService {
//更新微信注册用户绑定手机号
user.setPhone(byPhone.getPhone());
user.setUpdateTime(time);
user.setProject(ContextUtil.getProject());
user.setHeadImage(param.getHeadImage());
cereBuyerUserDAO.updateByPrimaryKeySelective(user);
result.setBuyerUserId(user.getBuyerUserId());
@ -411,6 +414,7 @@ public class CereBuyerUserServiceImpl implements CereBuyerUserService {
CereBuyerUser buyerUser=new CereBuyerUser();
buyerUser.setBuyerUserId(byPhone.getBuyerUserId());
buyerUser.setWechatOpenId(param.getWechatOpenId());
buyerUser.setProject(ContextUtil.getProject());
buyerUser.setUpdateTime(time);
//设置头像
buyerUser.setHeadImage(param.getHeadImage());
@ -422,6 +426,7 @@ public class CereBuyerUserServiceImpl implements CereBuyerUserService {
if(user!=null){
user.setPhone(phone);
user.setUpdateTime(time);
user.setProject(ContextUtil.getProject());
user.setHeadImage(param.getHeadImage());
cereBuyerUserDAO.updateByPrimaryKeySelective(user);
result.setBuyerUserId(user.getBuyerUserId());
@ -433,6 +438,7 @@ public class CereBuyerUserServiceImpl implements CereBuyerUserService {
buyerUser.setWechatOpenId(param.getWechatOpenId());
buyerUser.setCreateTime(time);
buyerUser.setPhone(phone);
buyerUser.setProject(ContextUtil.getProject());
buyerUser.setPassword(EncryptUtil.encrypt("123456"));
buyerUser.setName("MJ"+RandomStringUtil.getRandomCode(4,0));
buyerUser.setState(IntegerEnum.YES.getCode());
@ -463,20 +469,21 @@ public class CereBuyerUserServiceImpl implements CereBuyerUserService {
result.setPhone(param.getPhone());
String time =TimeUtils.yyMMddHHmmss();
//校验手机号是否绑定其他微信
CereBuyerUser cereBuyerUser=cereBuyerUserDAO.checkPhoneWx(param.getPhone());
CereBuyerUser cereBuyerUser=cereBuyerUserDAO.checkPhoneWx(ContextUtil.getProject(), param.getPhone());
if(cereBuyerUser!=null){
throw new CoBusinessException(CoReturnFormat.PHONE_ALREADY_WX);
}
//查询手机号已注册用户数据
BuyerUser byPhone = cereBuyerUserDAO.findByPhone(param.getPhone());
BuyerUser byPhone = cereBuyerUserDAO.findByPhone(ContextUtil.getProject(), param.getPhone());
//查询微信已注册用户数据
CereBuyerUser user=cereBuyerUserDAO.getByOpenid(param.getWechatOpenId());
CereBuyerUser user=cereBuyerUserDAO.getByOpenid(ContextUtil.getProject(), param.getWechatOpenId());
if(byPhone!=null){
if(user!=null){
//删除手机号注册用户
cereBuyerUserDAO.deleteByPrimaryKey(byPhone.getBuyerUserId());
//更新微信注册用户绑定手机号
user.setPhone(byPhone.getPhone());
user.setProject(ContextUtil.getProject());
user.setUpdateTime(time);
user.setHeadImage(param.getHeadImage());
cereBuyerUserDAO.updateByPrimaryKeySelective(user);
@ -490,6 +497,7 @@ public class CereBuyerUserServiceImpl implements CereBuyerUserService {
//更新手机号已注册用户openid
CereBuyerUser buyerUser=new CereBuyerUser();
buyerUser.setBuyerUserId(byPhone.getBuyerUserId());
buyerUser.setProject(ContextUtil.getProject());
buyerUser.setWechatOpenId(param.getWechatOpenId());
buyerUser.setUpdateTime(time);
//设置头像
@ -502,6 +510,7 @@ public class CereBuyerUserServiceImpl implements CereBuyerUserService {
if(user!=null){
user.setPhone(param.getPhone());
user.setUpdateTime(time);
user.setProject(ContextUtil.getProject());
user.setHeadImage(param.getHeadImage());
cereBuyerUserDAO.updateByPrimaryKeySelective(user);
result.setBuyerUserId(user.getBuyerUserId());
@ -512,6 +521,7 @@ public class CereBuyerUserServiceImpl implements CereBuyerUserService {
CereBuyerUser buyerUser=new CereBuyerUser();
buyerUser.setWechatOpenId(param.getWechatOpenId());
buyerUser.setCreateTime(time);
buyerUser.setProject(ContextUtil.getProject());
buyerUser.setPhone(param.getPhone());
//buyerUser.setToken(RandomStringUtil.getRandomCode(32,0));
buyerUser.setPassword(EncryptUtil.encrypt("123456"));
@ -562,7 +572,7 @@ public class CereBuyerUserServiceImpl implements CereBuyerUserService {
}
String time = TimeUtils.yyMMddHHmmss();
CereBuyerUser existUser = cereBuyerUserDAO.checkPhoneAli(phone,param.getBuyerUserId());
CereBuyerUser existUser = cereBuyerUserDAO.checkPhoneAli(ContextUtil.getProject(), phone,param.getBuyerUserId());
if (existUser != null) {
throw new CoBusinessException(CoReturnFormat.OTHER_ALI_USER_BIND_PHONE);
}
@ -570,7 +580,7 @@ public class CereBuyerUserServiceImpl implements CereBuyerUserService {
try {
//查询手机号已注册用户数据
CereBuyerUser user = cereBuyerUserDAO.selectByPrimaryKey(param.getBuyerUserId());
CereBuyerUser byPhone = cereBuyerUserDAO.selectByPhone(phone);
CereBuyerUser byPhone = cereBuyerUserDAO.selectByPhone(ContextUtil.getProject(), phone);
if(byPhone!=null && !byPhone.getBuyerUserId().equals(param.getBuyerUserId())){
//删除手机号注册用户
cereBuyerUserDAO.deleteByPrimaryKey(byPhone.getBuyerUserId());
@ -594,7 +604,7 @@ public class CereBuyerUserServiceImpl implements CereBuyerUserService {
user.setPhone(phone);
user.setUpdateTime(time);
cereBuyerUserDAO.updateByPrimaryKeySelective(user);
BuyerUser result = cereBuyerUserDAO.findByPhone(phone);
BuyerUser result = cereBuyerUserDAO.findByPhone(ContextUtil.getProject(), phone);
assembleToken(result);
@ -831,7 +841,7 @@ public class CereBuyerUserServiceImpl implements CereBuyerUserService {
@Override
public BuyerUser login(LoginParam param) throws CoBusinessException {
BuyerUser user = cereBuyerUserDAO.findByPhone(param.getPhone());
BuyerUser user = cereBuyerUserDAO.findByPhone(ContextUtil.getProject(), param.getPhone());
MemberUtil.setMemberInfo(user);
return user;
}
@ -888,7 +898,8 @@ public class CereBuyerUserServiceImpl implements CereBuyerUserService {
}
@Override
public CerePlatformCanvas getCanvas(CerePlatformCanvas canvas) {
public CerePlatformCanvas getCanvas(CerePlatformCanvas canvas) throws CoBusinessException {
canvas.setProject(ContextUtil.getProject());
return cereBuyerUserDAO.getCanvas(canvas);
}
@ -933,7 +944,7 @@ public class CereBuyerUserServiceImpl implements CereBuyerUserService {
@Override
@Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class})
public void updatePhone(UserParam param, CereBuyerUser user) throws CoBusinessException {
BuyerUser byPhone = cereBuyerUserDAO.findByPhone(param.getPhone());
BuyerUser byPhone = cereBuyerUserDAO.findByPhone(ContextUtil.getProject(), param.getPhone());
if(byPhone!=null){
throw new CoBusinessException(CoReturnFormat.SHOP_PHONE_ALREADY);
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save