新增品牌管理、商户列表等
This commit is contained in:
@@ -0,0 +1,114 @@
|
|||||||
|
package com.gxwebsoft.shop.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.shop.service.BrandService;
|
||||||
|
import com.gxwebsoft.shop.entity.Brand;
|
||||||
|
import com.gxwebsoft.shop.param.BrandParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 品牌控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-04-04 11:38:21
|
||||||
|
*/
|
||||||
|
@Api(tags = "品牌管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/shop/brand")
|
||||||
|
public class BrandController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private BrandService brandService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询品牌")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<Brand>> page(BrandParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(brandService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部品牌")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<Brand>> list(BrandParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(brandService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询品牌")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<Brand> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(brandService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加品牌")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody Brand brand) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
// User loginUser = getLoginUser();
|
||||||
|
// if (loginUser != null) {
|
||||||
|
// brand.setUserId(loginUser.getUserId());
|
||||||
|
// }
|
||||||
|
if (brandService.save(brand)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改品牌")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody Brand brand) {
|
||||||
|
if (brandService.updateById(brand)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除品牌")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (brandService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加品牌")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<Brand> list) {
|
||||||
|
if (brandService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改品牌")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<Brand> batchParam) {
|
||||||
|
if (batchParam.update(brandService, "brand_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除品牌")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (brandService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -65,7 +65,12 @@ public class GoodsController extends BaseController {
|
|||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public ApiResult<Goods> get(@PathVariable("id") Integer id) {
|
public ApiResult<Goods> get(@PathVariable("id") Integer id) {
|
||||||
// 使用关联查询
|
// 使用关联查询
|
||||||
return success(goodsService.getByIdRel(id));
|
final Goods goods = goodsService.getByIdRel(id);
|
||||||
|
final List<GoodsSpec> goodsSpecList = goodsSpecService.list(new LambdaQueryWrapper<GoodsSpec>().eq(GoodsSpec::getGoodsId, id));
|
||||||
|
final List<GoodsSku> goodsSkuList = goodsSkuService.list(new LambdaQueryWrapper<GoodsSku>().eq(GoodsSku::getGoodsId, id));
|
||||||
|
goods.setGoodsSpecs(goodsSpecList);
|
||||||
|
goods.setGoodsSkus(goodsSkuList);
|
||||||
|
return success(goods);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("添加商品记录表")
|
@ApiOperation("添加商品记录表")
|
||||||
@@ -77,22 +82,8 @@ public class GoodsController extends BaseController {
|
|||||||
goods.setUserId(loginUser.getUserId());
|
goods.setUserId(loginUser.getUserId());
|
||||||
}
|
}
|
||||||
if (goodsService.save(goods)) {
|
if (goodsService.save(goods)) {
|
||||||
|
// 保存商品规格及sku信息
|
||||||
// 保存商品规格
|
goodsService.saveBatchByAsync(goods);
|
||||||
final List<GoodsSpec> goodsSpecs = goods.getGoodsSpecs();
|
|
||||||
goodsSpecs.forEach(d -> {
|
|
||||||
d.setGoodsId(goods.getGoodsId());
|
|
||||||
final List<String> collect = d.getValueList().stream().map(SpecValue::getSpecValue).collect(Collectors.toList());
|
|
||||||
d.setSpecValues(StringUtils.join(collect, ','));
|
|
||||||
});
|
|
||||||
goodsSpecService.saveBatch(goodsSpecs);
|
|
||||||
|
|
||||||
// 保存商品sku表
|
|
||||||
final List<GoodsSku> goodsSkus = goods.getGoodsSkus();
|
|
||||||
goodsSkus.forEach(d -> {
|
|
||||||
d.setGoodsId(goods.getGoodsId());
|
|
||||||
});
|
|
||||||
goodsSkuService.saveBatch(goodsSkus);
|
|
||||||
return success("添加成功");
|
return success("添加成功");
|
||||||
}
|
}
|
||||||
return fail("添加失败");
|
return fail("添加失败");
|
||||||
@@ -102,14 +93,11 @@ public class GoodsController extends BaseController {
|
|||||||
@PutMapping()
|
@PutMapping()
|
||||||
public ApiResult<?> update(@RequestBody Goods goods) {
|
public ApiResult<?> update(@RequestBody Goods goods) {
|
||||||
if (goodsService.updateById(goods)) {
|
if (goodsService.updateById(goods)) {
|
||||||
// 更新spec规格表
|
// 删除旧信息
|
||||||
if (goodsSpecService.remove(new LambdaQueryWrapper<GoodsSpec>().eq(GoodsSpec::getGoodsId, goods.getGoodsId()))) {
|
goodsSpecService.remove(new LambdaQueryWrapper<GoodsSpec>().eq(GoodsSpec::getGoodsId, goods.getGoodsId()));
|
||||||
goodsSpecService.saveBatch(goods.getGoodsSpecs());
|
goodsSkuService.remove(new LambdaQueryWrapper<GoodsSku>().eq(GoodsSku::getGoodsId, goods.getGoodsId()));
|
||||||
}
|
// 保存商品规格及sku信息
|
||||||
// 更新sku表
|
goodsService.saveBatchByAsync(goods);
|
||||||
if (goodsSkuService.remove(new LambdaQueryWrapper<GoodsSku>().eq(GoodsSku::getGoodsId, goods.getGoodsId()))) {
|
|
||||||
goodsSkuService.saveBatch(goods.getGoodsSkus());
|
|
||||||
}
|
|
||||||
return success("修改成功");
|
return success("修改成功");
|
||||||
}
|
}
|
||||||
return fail("修改失败");
|
return fail("修改失败");
|
||||||
|
|||||||
@@ -0,0 +1,109 @@
|
|||||||
|
package com.gxwebsoft.shop.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.shop.service.MerchantApplyService;
|
||||||
|
import com.gxwebsoft.shop.entity.MerchantApply;
|
||||||
|
import com.gxwebsoft.shop.param.MerchantApplyParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户入驻申请控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-04-05 01:24:36
|
||||||
|
*/
|
||||||
|
@Api(tags = "商户入驻申请管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/shop/merchant-apply")
|
||||||
|
public class MerchantApplyController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private MerchantApplyService merchantApplyService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询商户入驻申请")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<MerchantApply>> page(MerchantApplyParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(merchantApplyService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部商户入驻申请")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<MerchantApply>> list(MerchantApplyParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(merchantApplyService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询商户入驻申请")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<MerchantApply> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(merchantApplyService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加商户入驻申请")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody MerchantApply merchantApply) {
|
||||||
|
if (merchantApplyService.save(merchantApply)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改商户入驻申请")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody MerchantApply merchantApply) {
|
||||||
|
if (merchantApplyService.updateById(merchantApply)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除商户入驻申请")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (merchantApplyService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加商户入驻申请")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<MerchantApply> list) {
|
||||||
|
if (merchantApplyService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改商户入驻申请")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<MerchantApply> batchParam) {
|
||||||
|
if (batchParam.update(merchantApplyService, "apply_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除商户入驻申请")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (merchantApplyService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
package com.gxwebsoft.shop.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.shop.service.MerchantService;
|
||||||
|
import com.gxwebsoft.shop.entity.Merchant;
|
||||||
|
import com.gxwebsoft.shop.param.MerchantParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-04-05 00:03:54
|
||||||
|
*/
|
||||||
|
@Api(tags = "商户管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/shop/merchant")
|
||||||
|
public class MerchantController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private MerchantService merchantService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询商户")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<Merchant>> page(MerchantParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(merchantService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部商户")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<Merchant>> list(MerchantParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(merchantService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询商户")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<Merchant> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(merchantService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加商户")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody Merchant merchant) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
// User loginUser = getLoginUser();
|
||||||
|
// if (loginUser != null) {
|
||||||
|
// merchant.setUserId(loginUser.getUserId());
|
||||||
|
// }
|
||||||
|
if (merchantService.save(merchant)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改商户")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody Merchant merchant) {
|
||||||
|
if (merchantService.updateById(merchant)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除商户")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (merchantService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加商户")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<Merchant> list) {
|
||||||
|
if (merchantService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改商户")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<Merchant> batchParam) {
|
||||||
|
if (batchParam.update(merchantService, "merchant_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除商户")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (merchantService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
package com.gxwebsoft.shop.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.shop.service.MerchantTypeService;
|
||||||
|
import com.gxwebsoft.shop.entity.MerchantType;
|
||||||
|
import com.gxwebsoft.shop.param.MerchantTypeParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户类型控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-04-05 00:08:51
|
||||||
|
*/
|
||||||
|
@Api(tags = "商户类型管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/shop/merchant-type")
|
||||||
|
public class MerchantTypeController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private MerchantTypeService merchantTypeService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询商户类型")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<MerchantType>> page(MerchantTypeParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(merchantTypeService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部商户类型")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<MerchantType>> list(MerchantTypeParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(merchantTypeService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询商户类型")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<MerchantType> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(merchantTypeService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加商户类型")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody MerchantType merchantType) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
// User loginUser = getLoginUser();
|
||||||
|
// if (loginUser != null) {
|
||||||
|
// merchantType.setUserId(loginUser.getUserId());
|
||||||
|
// }
|
||||||
|
if (merchantTypeService.save(merchantType)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改商户类型")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody MerchantType merchantType) {
|
||||||
|
if (merchantTypeService.updateById(merchantType)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除商户类型")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (merchantTypeService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加商户类型")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<MerchantType> list) {
|
||||||
|
if (merchantTypeService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改商户类型")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<MerchantType> batchParam) {
|
||||||
|
if (batchParam.update(merchantTypeService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除商户类型")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (merchantTypeService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package com.gxwebsoft.shop.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 品牌
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-04-04 11:38:21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "Brand对象", description = "品牌")
|
||||||
|
@TableName("shop_brand")
|
||||||
|
public class Brand implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "brand_id", type = IdType.AUTO)
|
||||||
|
private Integer brandId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "品牌名称")
|
||||||
|
private String brandName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "图标")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序号")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -38,9 +38,6 @@ public class GoodsSpec implements Serializable {
|
|||||||
@ApiModelProperty(value = "规格名称")
|
@ApiModelProperty(value = "规格名称")
|
||||||
private String specName;
|
private String specName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "规则值ID")
|
|
||||||
private Integer specValueId;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "规格值")
|
@ApiModelProperty(value = "规格值")
|
||||||
private String specValues;
|
private String specValues;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,84 @@
|
|||||||
|
package com.gxwebsoft.shop.entity;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-04-05 00:03:54
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "Merchant对象", description = "商户")
|
||||||
|
@TableName("shop_merchant")
|
||||||
|
public class Merchant implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "merchant_id", type = IdType.AUTO)
|
||||||
|
private Integer merchantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户名称")
|
||||||
|
private String merchantName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户图标")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户手机号")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户姓名")
|
||||||
|
private String realName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "店铺类型")
|
||||||
|
private String shopType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户分类")
|
||||||
|
private String category;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "手续费")
|
||||||
|
private BigDecimal commission;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关键字")
|
||||||
|
private String keywords;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "资质图片")
|
||||||
|
private String files;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否自营")
|
||||||
|
private Integer ownStore;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否推荐")
|
||||||
|
private Integer recommend;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否需要审核")
|
||||||
|
private Integer goodsReview;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序号")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
package com.gxwebsoft.shop.entity;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户入驻申请
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-04-05 01:24:36
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "MerchantApply对象", description = "商户入驻申请")
|
||||||
|
@TableName("shop_merchant_apply")
|
||||||
|
public class MerchantApply implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "apply_id", type = IdType.AUTO)
|
||||||
|
private Integer applyId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户名称")
|
||||||
|
private String merchantName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户图标")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户手机号")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户姓名")
|
||||||
|
private String realName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "店铺类型")
|
||||||
|
private String shopType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户分类")
|
||||||
|
private String category;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "手续费")
|
||||||
|
private BigDecimal commission;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关键字")
|
||||||
|
private String keywords;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "资质图片")
|
||||||
|
private String files;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否自营")
|
||||||
|
private Integer ownStore;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否推荐")
|
||||||
|
private Integer recommend;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否需要审核")
|
||||||
|
private Integer goodsReview;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序号")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package com.gxwebsoft.shop.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户类型
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-04-05 00:08:51
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "MerchantType对象", description = "商户类型")
|
||||||
|
@TableName("shop_merchant_type")
|
||||||
|
public class MerchantType implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "店铺类型")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "店铺入驻条件")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序号")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.shop.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.shop.entity.Brand;
|
||||||
|
import com.gxwebsoft.shop.param.BrandParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 品牌Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-04-04 11:38:21
|
||||||
|
*/
|
||||||
|
public interface BrandMapper extends BaseMapper<Brand> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<Brand>
|
||||||
|
*/
|
||||||
|
List<Brand> selectPageRel(@Param("page") IPage<Brand> page,
|
||||||
|
@Param("param") BrandParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<Brand> selectListRel(@Param("param") BrandParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.shop.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.shop.entity.MerchantApply;
|
||||||
|
import com.gxwebsoft.shop.param.MerchantApplyParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户入驻申请Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-04-05 01:24:36
|
||||||
|
*/
|
||||||
|
public interface MerchantApplyMapper extends BaseMapper<MerchantApply> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<MerchantApply>
|
||||||
|
*/
|
||||||
|
List<MerchantApply> selectPageRel(@Param("page") IPage<MerchantApply> page,
|
||||||
|
@Param("param") MerchantApplyParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<MerchantApply> selectListRel(@Param("param") MerchantApplyParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.shop.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.shop.entity.Merchant;
|
||||||
|
import com.gxwebsoft.shop.param.MerchantParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-04-05 00:03:54
|
||||||
|
*/
|
||||||
|
public interface MerchantMapper extends BaseMapper<Merchant> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<Merchant>
|
||||||
|
*/
|
||||||
|
List<Merchant> selectPageRel(@Param("page") IPage<Merchant> page,
|
||||||
|
@Param("param") MerchantParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<Merchant> selectListRel(@Param("param") MerchantParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.shop.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.shop.entity.MerchantType;
|
||||||
|
import com.gxwebsoft.shop.param.MerchantTypeParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户类型Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-04-05 00:08:51
|
||||||
|
*/
|
||||||
|
public interface MerchantTypeMapper extends BaseMapper<MerchantType> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<MerchantType>
|
||||||
|
*/
|
||||||
|
List<MerchantType> selectPageRel(@Param("page") IPage<MerchantType> page,
|
||||||
|
@Param("param") MerchantTypeParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<MerchantType> selectListRel(@Param("param") MerchantTypeParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
<?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.gxwebsoft.shop.mapper.BrandMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM shop_brand a
|
||||||
|
<where>
|
||||||
|
<if test="param.brandId != null">
|
||||||
|
AND a.brand_id = #{param.brandId}
|
||||||
|
</if>
|
||||||
|
<if test="param.brandName != null">
|
||||||
|
AND a.brand_name LIKE CONCAT('%', #{param.brandName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.image != null">
|
||||||
|
AND a.image LIKE CONCAT('%', #{param.image}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.Brand">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.Brand">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
<?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.gxwebsoft.shop.mapper.MerchantApplyMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM shop_merchant_apply a
|
||||||
|
<where>
|
||||||
|
<if test="param.applyId != null">
|
||||||
|
AND a.apply_id = #{param.applyId}
|
||||||
|
</if>
|
||||||
|
<if test="param.merchantName != null">
|
||||||
|
AND a.merchant_name LIKE CONCAT('%', #{param.merchantName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.image != null">
|
||||||
|
AND a.image LIKE CONCAT('%', #{param.image}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.phone != null">
|
||||||
|
AND a.phone LIKE CONCAT('%', #{param.phone}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.realName != null">
|
||||||
|
AND a.real_name LIKE CONCAT('%', #{param.realName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.shopType != null">
|
||||||
|
AND a.shop_type LIKE CONCAT('%', #{param.shopType}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.category != null">
|
||||||
|
AND a.category LIKE CONCAT('%', #{param.category}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.commission != null">
|
||||||
|
AND a.commission = #{param.commission}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND a.keywords LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.files != null">
|
||||||
|
AND a.files LIKE CONCAT('%', #{param.files}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.ownStore != null">
|
||||||
|
AND a.own_store = #{param.ownStore}
|
||||||
|
</if>
|
||||||
|
<if test="param.recommend != null">
|
||||||
|
AND a.recommend = #{param.recommend}
|
||||||
|
</if>
|
||||||
|
<if test="param.goodsReview != null">
|
||||||
|
AND a.goods_review = #{param.goodsReview}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.MerchantApply">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.MerchantApply">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
<?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.gxwebsoft.shop.mapper.MerchantMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM shop_merchant a
|
||||||
|
<where>
|
||||||
|
<if test="param.merchantId != null">
|
||||||
|
AND a.merchant_id = #{param.merchantId}
|
||||||
|
</if>
|
||||||
|
<if test="param.merchantName != null">
|
||||||
|
AND a.merchant_name LIKE CONCAT('%', #{param.merchantName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.image != null">
|
||||||
|
AND a.image LIKE CONCAT('%', #{param.image}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.phone != null">
|
||||||
|
AND a.phone LIKE CONCAT('%', #{param.phone}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.realName != null">
|
||||||
|
AND a.real_name LIKE CONCAT('%', #{param.realName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.shopType != null">
|
||||||
|
AND a.shop_type LIKE CONCAT('%', #{param.shopType}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.category != null">
|
||||||
|
AND a.category LIKE CONCAT('%', #{param.category}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.commission != null">
|
||||||
|
AND a.commission = #{param.commission}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND a.keywords LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.files != null">
|
||||||
|
AND a.files LIKE CONCAT('%', #{param.files}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.ownStore != null">
|
||||||
|
AND a.own_store = #{param.ownStore}
|
||||||
|
</if>
|
||||||
|
<if test="param.recommend != null">
|
||||||
|
AND a.recommend = #{param.recommend}
|
||||||
|
</if>
|
||||||
|
<if test="param.goodsReview != null">
|
||||||
|
AND a.goods_review = #{param.goodsReview}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.Merchant">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.Merchant">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
<?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.gxwebsoft.shop.mapper.MerchantTypeMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM shop_merchant_type a
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.name != null">
|
||||||
|
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.MerchantType">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.MerchantType">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.gxwebsoft.shop.param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 品牌查询参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-04-04 11:38:21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@ApiModel(value = "BrandParam对象", description = "品牌查询参数")
|
||||||
|
public class BrandParam extends BaseParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer brandId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "品牌名称")
|
||||||
|
private String brandName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "图标")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序号")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
package com.gxwebsoft.shop.param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户入驻申请查询参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-04-05 01:24:36
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@ApiModel(value = "MerchantApplyParam对象", description = "商户入驻申请查询参数")
|
||||||
|
public class MerchantApplyParam extends BaseParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer applyId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户名称")
|
||||||
|
private String merchantName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户图标")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户手机号")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户姓名")
|
||||||
|
private String realName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "店铺类型")
|
||||||
|
private String shopType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户分类")
|
||||||
|
private String category;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "手续费")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private BigDecimal commission;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关键字")
|
||||||
|
private String keywords;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "资质图片")
|
||||||
|
private String files;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否自营")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer ownStore;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否推荐")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer recommend;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否需要审核")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer goodsReview;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序号")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
package com.gxwebsoft.shop.param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户查询参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-04-05 00:03:54
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@ApiModel(value = "MerchantParam对象", description = "商户查询参数")
|
||||||
|
public class MerchantParam extends BaseParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer merchantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户名称")
|
||||||
|
private String merchantName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户图标")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户手机号")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户姓名")
|
||||||
|
private String realName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "店铺类型")
|
||||||
|
private String shopType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户分类")
|
||||||
|
private String category;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "手续费")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private BigDecimal commission;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关键字")
|
||||||
|
private String keywords;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "资质图片")
|
||||||
|
private String files;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否自营")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer ownStore;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否推荐")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer recommend;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否需要审核")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer goodsReview;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序号")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.gxwebsoft.shop.param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户类型查询参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-04-05 00:08:51
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@ApiModel(value = "MerchantTypeParam对象", description = "商户类型查询参数")
|
||||||
|
public class MerchantTypeParam extends BaseParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "店铺类型")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "店铺入驻条件")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序号")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.gxwebsoft.shop.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.shop.entity.Brand;
|
||||||
|
import com.gxwebsoft.shop.param.BrandParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 品牌Service
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-04-04 11:38:21
|
||||||
|
*/
|
||||||
|
public interface BrandService extends IService<Brand> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页关联查询
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return PageResult<Brand>
|
||||||
|
*/
|
||||||
|
PageResult<Brand> pageRel(BrandParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<Brand>
|
||||||
|
*/
|
||||||
|
List<Brand> listRel(BrandParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param brandId ID
|
||||||
|
* @return Brand
|
||||||
|
*/
|
||||||
|
Brand getByIdRel(Integer brandId);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -39,4 +39,5 @@ public interface GoodsService extends IService<Goods> {
|
|||||||
*/
|
*/
|
||||||
Goods getByIdRel(Integer goodsId);
|
Goods getByIdRel(Integer goodsId);
|
||||||
|
|
||||||
|
void saveBatchByAsync(Goods goods);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.gxwebsoft.shop.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.shop.entity.MerchantApply;
|
||||||
|
import com.gxwebsoft.shop.param.MerchantApplyParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户入驻申请Service
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-04-05 01:24:36
|
||||||
|
*/
|
||||||
|
public interface MerchantApplyService extends IService<MerchantApply> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页关联查询
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return PageResult<MerchantApply>
|
||||||
|
*/
|
||||||
|
PageResult<MerchantApply> pageRel(MerchantApplyParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<MerchantApply>
|
||||||
|
*/
|
||||||
|
List<MerchantApply> listRel(MerchantApplyParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param applyId ID
|
||||||
|
* @return MerchantApply
|
||||||
|
*/
|
||||||
|
MerchantApply getByIdRel(Integer applyId);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.gxwebsoft.shop.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.shop.entity.Merchant;
|
||||||
|
import com.gxwebsoft.shop.param.MerchantParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户Service
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-04-05 00:03:54
|
||||||
|
*/
|
||||||
|
public interface MerchantService extends IService<Merchant> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页关联查询
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return PageResult<Merchant>
|
||||||
|
*/
|
||||||
|
PageResult<Merchant> pageRel(MerchantParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<Merchant>
|
||||||
|
*/
|
||||||
|
List<Merchant> listRel(MerchantParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param merchantId ID
|
||||||
|
* @return Merchant
|
||||||
|
*/
|
||||||
|
Merchant getByIdRel(Integer merchantId);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.gxwebsoft.shop.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.shop.entity.MerchantType;
|
||||||
|
import com.gxwebsoft.shop.param.MerchantTypeParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户类型Service
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-04-05 00:08:51
|
||||||
|
*/
|
||||||
|
public interface MerchantTypeService extends IService<MerchantType> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页关联查询
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return PageResult<MerchantType>
|
||||||
|
*/
|
||||||
|
PageResult<MerchantType> pageRel(MerchantTypeParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<MerchantType>
|
||||||
|
*/
|
||||||
|
List<MerchantType> listRel(MerchantTypeParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param id ID
|
||||||
|
* @return MerchantType
|
||||||
|
*/
|
||||||
|
MerchantType getByIdRel(Integer id);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.gxwebsoft.shop.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gxwebsoft.shop.mapper.BrandMapper;
|
||||||
|
import com.gxwebsoft.shop.service.BrandService;
|
||||||
|
import com.gxwebsoft.shop.entity.Brand;
|
||||||
|
import com.gxwebsoft.shop.param.BrandParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 品牌Service实现
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-04-04 11:38:21
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class BrandServiceImpl extends ServiceImpl<BrandMapper, Brand> implements BrandService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<Brand> pageRel(BrandParam param) {
|
||||||
|
PageParam<Brand, BrandParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
List<Brand> list = baseMapper.selectPageRel(page, param);
|
||||||
|
return new PageResult<>(list, page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Brand> listRel(BrandParam param) {
|
||||||
|
List<Brand> list = baseMapper.selectListRel(param);
|
||||||
|
// 排序
|
||||||
|
PageParam<Brand, BrandParam> page = new PageParam<>();
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
return page.sortRecords(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Brand getByIdRel(Integer brandId) {
|
||||||
|
BrandParam param = new BrandParam();
|
||||||
|
param.setBrandId(brandId);
|
||||||
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,15 +1,25 @@
|
|||||||
package com.gxwebsoft.shop.service.impl;
|
package com.gxwebsoft.shop.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gxwebsoft.shop.entity.GoodsSku;
|
||||||
|
import com.gxwebsoft.shop.entity.GoodsSpec;
|
||||||
|
import com.gxwebsoft.shop.entity.SpecValue;
|
||||||
import com.gxwebsoft.shop.mapper.GoodsMapper;
|
import com.gxwebsoft.shop.mapper.GoodsMapper;
|
||||||
import com.gxwebsoft.shop.service.GoodsService;
|
import com.gxwebsoft.shop.service.GoodsService;
|
||||||
import com.gxwebsoft.shop.entity.Goods;
|
import com.gxwebsoft.shop.entity.Goods;
|
||||||
import com.gxwebsoft.shop.param.GoodsParam;
|
import com.gxwebsoft.shop.param.GoodsParam;
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.shop.service.GoodsSkuService;
|
||||||
|
import com.gxwebsoft.shop.service.GoodsSpecService;
|
||||||
|
import org.apache.tomcat.util.buf.StringUtils;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品记录表Service实现
|
* 商品记录表Service实现
|
||||||
@@ -19,6 +29,10 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements GoodsService {
|
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements GoodsService {
|
||||||
|
@Resource
|
||||||
|
private GoodsSpecService goodsSpecService;
|
||||||
|
@Resource
|
||||||
|
private GoodsSkuService goodsSkuService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<Goods> pageRel(GoodsParam param) {
|
public PageResult<Goods> pageRel(GoodsParam param) {
|
||||||
@@ -44,4 +58,22 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
return param.getOne(baseMapper.selectListRel(param));
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void saveBatchByAsync(Goods goods) {
|
||||||
|
// 保存商品规格
|
||||||
|
final List<GoodsSpec> goodsSpecs = goods.getGoodsSpecs();
|
||||||
|
goodsSpecs.forEach(d -> {
|
||||||
|
d.setGoodsId(goods.getGoodsId());
|
||||||
|
final List<String> collect = d.getValueList().stream().map(SpecValue::getSpecValue).collect(Collectors.toList());
|
||||||
|
d.setSpecValues(StringUtils.join(collect, ','));
|
||||||
|
});
|
||||||
|
goodsSpecService.saveBatch(goodsSpecs);
|
||||||
|
// 保存商品sku表
|
||||||
|
final List<GoodsSku> goodsSkus = goods.getGoodsSkus();
|
||||||
|
goodsSkus.forEach(d -> {
|
||||||
|
d.setGoodsId(goods.getGoodsId());
|
||||||
|
});
|
||||||
|
goodsSkuService.saveBatch(goodsSkus);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.gxwebsoft.shop.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gxwebsoft.shop.mapper.MerchantApplyMapper;
|
||||||
|
import com.gxwebsoft.shop.service.MerchantApplyService;
|
||||||
|
import com.gxwebsoft.shop.entity.MerchantApply;
|
||||||
|
import com.gxwebsoft.shop.param.MerchantApplyParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户入驻申请Service实现
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-04-05 01:24:36
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MerchantApplyServiceImpl extends ServiceImpl<MerchantApplyMapper, MerchantApply> implements MerchantApplyService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<MerchantApply> pageRel(MerchantApplyParam param) {
|
||||||
|
PageParam<MerchantApply, MerchantApplyParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
List<MerchantApply> list = baseMapper.selectPageRel(page, param);
|
||||||
|
return new PageResult<>(list, page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MerchantApply> listRel(MerchantApplyParam param) {
|
||||||
|
List<MerchantApply> list = baseMapper.selectListRel(param);
|
||||||
|
// 排序
|
||||||
|
PageParam<MerchantApply, MerchantApplyParam> page = new PageParam<>();
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
return page.sortRecords(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MerchantApply getByIdRel(Integer applyId) {
|
||||||
|
MerchantApplyParam param = new MerchantApplyParam();
|
||||||
|
param.setApplyId(applyId);
|
||||||
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.gxwebsoft.shop.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gxwebsoft.shop.mapper.MerchantMapper;
|
||||||
|
import com.gxwebsoft.shop.service.MerchantService;
|
||||||
|
import com.gxwebsoft.shop.entity.Merchant;
|
||||||
|
import com.gxwebsoft.shop.param.MerchantParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户Service实现
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-04-05 00:03:54
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MerchantServiceImpl extends ServiceImpl<MerchantMapper, Merchant> implements MerchantService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<Merchant> pageRel(MerchantParam param) {
|
||||||
|
PageParam<Merchant, MerchantParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
List<Merchant> list = baseMapper.selectPageRel(page, param);
|
||||||
|
return new PageResult<>(list, page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Merchant> listRel(MerchantParam param) {
|
||||||
|
List<Merchant> list = baseMapper.selectListRel(param);
|
||||||
|
// 排序
|
||||||
|
PageParam<Merchant, MerchantParam> page = new PageParam<>();
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
return page.sortRecords(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Merchant getByIdRel(Integer merchantId) {
|
||||||
|
MerchantParam param = new MerchantParam();
|
||||||
|
param.setMerchantId(merchantId);
|
||||||
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.gxwebsoft.shop.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gxwebsoft.shop.mapper.MerchantTypeMapper;
|
||||||
|
import com.gxwebsoft.shop.service.MerchantTypeService;
|
||||||
|
import com.gxwebsoft.shop.entity.MerchantType;
|
||||||
|
import com.gxwebsoft.shop.param.MerchantTypeParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户类型Service实现
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-04-05 00:08:51
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MerchantTypeServiceImpl extends ServiceImpl<MerchantTypeMapper, MerchantType> implements MerchantTypeService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<MerchantType> pageRel(MerchantTypeParam param) {
|
||||||
|
PageParam<MerchantType, MerchantTypeParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
List<MerchantType> list = baseMapper.selectPageRel(page, param);
|
||||||
|
return new PageResult<>(list, page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MerchantType> listRel(MerchantTypeParam param) {
|
||||||
|
List<MerchantType> list = baseMapper.selectListRel(param);
|
||||||
|
// 排序
|
||||||
|
PageParam<MerchantType, MerchantTypeParam> page = new PageParam<>();
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
return page.sortRecords(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MerchantType getByIdRel(Integer id) {
|
||||||
|
MerchantTypeParam param = new MerchantTypeParam();
|
||||||
|
param.setId(id);
|
||||||
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -50,7 +50,6 @@ public class ShopGenerator {
|
|||||||
// "shop_spec_value"
|
// "shop_spec_value"
|
||||||
// "shop_goods",
|
// "shop_goods",
|
||||||
// "shop_goods_spec",
|
// "shop_goods_spec",
|
||||||
"shop_goods_spec_rel",
|
|
||||||
// "shop_goods_sku",
|
// "shop_goods_sku",
|
||||||
// "shop_goods_category",
|
// "shop_goods_category",
|
||||||
// "shop_goods_coupon",
|
// "shop_goods_coupon",
|
||||||
@@ -59,6 +58,10 @@ public class ShopGenerator {
|
|||||||
// "shop_goods_relation",
|
// "shop_goods_relation",
|
||||||
// "shop_goods_comment",
|
// "shop_goods_comment",
|
||||||
// "shop_goods_rule"
|
// "shop_goods_rule"
|
||||||
|
// "shop_brand",
|
||||||
|
// "shop_merchant",
|
||||||
|
// "shop_merchant_type",
|
||||||
|
"shop_merchant_apply"
|
||||||
};
|
};
|
||||||
// 需要去除的表前缀
|
// 需要去除的表前缀
|
||||||
private static final String[] TABLE_PREFIX = new String[]{
|
private static final String[] TABLE_PREFIX = new String[]{
|
||||||
|
|||||||
@@ -19,37 +19,65 @@
|
|||||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<a-form-item label="${table.comment!}名称" name="${table.entityPath}Name">
|
<% for(field in table.fields) { %>
|
||||||
<a-input
|
<% if(field.propertyName == 'comments'){ %>
|
||||||
allow-clear
|
<a-form-item label="${field.comment!}" name="${field.propertyName}">
|
||||||
:maxlength="100"
|
|
||||||
placeholder="请输入${table.comment!}"
|
|
||||||
v-model:value="form.${table.entityPath}Name"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="描述" name="comments">
|
|
||||||
<a-textarea
|
<a-textarea
|
||||||
:rows="4"
|
:rows="4"
|
||||||
:maxlength="200"
|
:maxlength="200"
|
||||||
placeholder="请输入描述"
|
placeholder="请输入描述"
|
||||||
v-model:value="form.comments"
|
v-model:value="form.${field.propertyName}"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="排序号" name="sortNumber">
|
<% } %>
|
||||||
|
<% else if(field.propertyName == 'sortNumber'){ %>
|
||||||
|
<a-form-item label="${field.comment!}" name="${field.propertyName}">
|
||||||
<a-input-number
|
<a-input-number
|
||||||
:min="0"
|
:min="0"
|
||||||
:max="9999"
|
:max="9999"
|
||||||
class="ele-fluid"
|
class="ele-fluid"
|
||||||
placeholder="请输入排序号"
|
placeholder="请输入排序号"
|
||||||
v-model:value="form.sortNumber"
|
v-model:value="form.${field.propertyName}"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="状态" name="status">
|
<% } %>
|
||||||
|
<% else if(field.propertyName == 'status'){ %>
|
||||||
|
<a-form-item label="${field.comment!}" name="${field.propertyName}">
|
||||||
<a-radio-group v-model:value="form.status">
|
<a-radio-group v-model:value="form.status">
|
||||||
<a-radio :value="0">显示</a-radio>
|
<a-radio :value="0">显示</a-radio>
|
||||||
<a-radio :value="1">隐藏</a-radio>
|
<a-radio :value="1">隐藏</a-radio>
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
<% } %>
|
||||||
|
<% else if(field.propertyName == 'image'){ %>
|
||||||
|
<a-form-item
|
||||||
|
label="${field.comment!}"
|
||||||
|
name="${field.propertyName}">
|
||||||
|
<SelectFile
|
||||||
|
:placeholder="`请选择图片`"
|
||||||
|
:limit="1"
|
||||||
|
:data="images"
|
||||||
|
@done="chooseImage"
|
||||||
|
@del="onDeleteItem"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<% } %>
|
||||||
|
<% else if(field.keyFlag){ %>
|
||||||
|
<% } %>
|
||||||
|
<% else if(field.propertyName == 'tenantId'){ %>
|
||||||
|
<% } %>
|
||||||
|
<% else if(field.propertyName == 'createTime'){ %>
|
||||||
|
<% } %>
|
||||||
|
<% else { %>
|
||||||
|
<a-form-item label="${field.comment!}" name="${field.propertyName}">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入${field.comment!}"
|
||||||
|
v-model:value="form.${field.propertyName}"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<% } %>
|
||||||
|
<% } %>
|
||||||
</a-form>
|
</a-form>
|
||||||
</ele-modal>
|
</ele-modal>
|
||||||
</template>
|
</template>
|
||||||
@@ -57,12 +85,14 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, reactive, watch } from 'vue';
|
import { ref, reactive, watch } from 'vue';
|
||||||
import { Form, message } from 'ant-design-vue';
|
import { Form, message } from 'ant-design-vue';
|
||||||
import { assignObject } from 'ele-admin-pro';
|
import { assignObject, uuid } from 'ele-admin-pro';
|
||||||
import { add${entity}, update${entity} } from '@/api/${package.ModuleName}/${table.entityPath}';
|
import { add${entity}, update${entity} } from '@/api/${package.ModuleName}/${table.entityPath}';
|
||||||
import { ${entity} } from '@/api/${package.ModuleName}/${table.entityPath}/model';
|
import { ${entity} } from '@/api/${package.ModuleName}/${table.entityPath}/model';
|
||||||
import { useThemeStore } from '@/store/modules/theme';
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
import { FormInstance } from 'ant-design-vue/es/form';
|
import { FormInstance } from 'ant-design-vue/es/form';
|
||||||
|
import { FileRecord } from '@/api/system/file/model';
|
||||||
|
|
||||||
// 是否是修改
|
// 是否是修改
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
@@ -89,9 +119,13 @@
|
|||||||
const maxable = ref(true);
|
const maxable = ref(true);
|
||||||
// 表格选中数据
|
// 表格选中数据
|
||||||
const formRef = ref<FormInstance | null>(null);
|
const formRef = ref<FormInstance | null>(null);
|
||||||
|
const images = ref<ItemType[]>([]);
|
||||||
|
|
||||||
// 用户信息
|
// 用户信息
|
||||||
const form = reactive<${entity}>({
|
const form = reactive<${entity}>({
|
||||||
|
<% for(field in table.fields) { %>
|
||||||
|
${field.propertyName}: undefined,
|
||||||
|
<% } %>
|
||||||
${table.entityPath}Id: undefined,
|
${table.entityPath}Id: undefined,
|
||||||
${table.entityPath}Name: '',
|
${table.entityPath}Name: '',
|
||||||
status: 0,
|
status: 0,
|
||||||
@@ -116,6 +150,20 @@
|
|||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const chooseImage = (data: FileRecord) => {
|
||||||
|
images.value.push({
|
||||||
|
uid: data.id,
|
||||||
|
url: data.path,
|
||||||
|
status: 'done'
|
||||||
|
});
|
||||||
|
form.image = data.path;
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDeleteItem = (index: number) => {
|
||||||
|
images.value.splice(index, 1);
|
||||||
|
form.image = '';
|
||||||
|
};
|
||||||
|
|
||||||
const { resetFields } = useForm(form, rules);
|
const { resetFields } = useForm(form, rules);
|
||||||
|
|
||||||
/* 保存编辑 */
|
/* 保存编辑 */
|
||||||
@@ -150,8 +198,16 @@
|
|||||||
() => props.visible,
|
() => props.visible,
|
||||||
(visible) => {
|
(visible) => {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
|
images.value = [];
|
||||||
if (props.data) {
|
if (props.data) {
|
||||||
assignObject(form, props.data);
|
assignObject(form, props.data);
|
||||||
|
if(props.data.image){
|
||||||
|
images.value.push({
|
||||||
|
uid: uuid(),
|
||||||
|
url: props.data.image,
|
||||||
|
status: 'done'
|
||||||
|
})
|
||||||
|
}
|
||||||
isUpdate.value = true;
|
isUpdate.value = true;
|
||||||
} else {
|
} else {
|
||||||
isUpdate.value = false;
|
isUpdate.value = false;
|
||||||
|
|||||||
@@ -21,9 +21,12 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'image'">
|
||||||
|
<a-image :src="record.image" :width="50" />
|
||||||
|
</template>
|
||||||
<template v-if="column.key === 'status'">
|
<template v-if="column.key === 'status'">
|
||||||
<a-tag v-if="record.status === 0" color="green">开启</a-tag>
|
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||||
<a-tag v-if="record.status === 1" color="red">关闭</a-tag>
|
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'action'">
|
<template v-if="column.key === 'action'">
|
||||||
<a-space>
|
<a-space>
|
||||||
@@ -52,6 +55,7 @@
|
|||||||
import { message, Modal } from 'ant-design-vue';
|
import { message, Modal } from 'ant-design-vue';
|
||||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
import type { EleProTable } from 'ele-admin-pro';
|
import type { EleProTable } from 'ele-admin-pro';
|
||||||
|
import { toDateString } from 'ele-admin-pro';
|
||||||
import type {
|
import type {
|
||||||
DatasourceFunction,
|
DatasourceFunction,
|
||||||
ColumnItem
|
ColumnItem
|
||||||
@@ -96,28 +100,24 @@
|
|||||||
|
|
||||||
// 表格列配置
|
// 表格列配置
|
||||||
const columns = ref<ColumnItem[]>([
|
const columns = ref<ColumnItem[]>([
|
||||||
|
<% for(field in table.fields) { %>
|
||||||
|
<% if(field.propertyName != 'tenantId'){ %>
|
||||||
{
|
{
|
||||||
title: 'ID',
|
title: '${field.comment}',
|
||||||
width: 90,
|
dataIndex: '${field.propertyName}',
|
||||||
dataIndex: '${table.entityPath}Id'
|
key: '${field.propertyName}',
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '名称',
|
|
||||||
dataIndex: '${table.entityPath}name',
|
|
||||||
key: '${table.entityPath}name'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '描述',
|
|
||||||
dataIndex: 'comments',
|
|
||||||
ellipsis: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '状态',
|
|
||||||
dataIndex: 'status',
|
|
||||||
width: 120,
|
|
||||||
align: 'center',
|
align: 'center',
|
||||||
key: 'status'
|
<% if(field.keyFlag){ %>
|
||||||
|
width: 90,
|
||||||
|
<% } %>
|
||||||
|
<% if(field.propertyName == 'createTime'){ %>
|
||||||
|
sorter: true,
|
||||||
|
ellipsis: true,
|
||||||
|
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd')
|
||||||
|
<% } %>
|
||||||
},
|
},
|
||||||
|
<% } %>
|
||||||
|
<% } %>
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
key: 'action',
|
key: 'action',
|
||||||
@@ -148,7 +148,7 @@
|
|||||||
/* 删除单个 */
|
/* 删除单个 */
|
||||||
const remove = (row: ${entity}) => {
|
const remove = (row: ${entity}) => {
|
||||||
const hide = message.loading('请求中..', 0);
|
const hide = message.loading('请求中..', 0);
|
||||||
remove${entity}(row.id)
|
remove${entity}(row.${table.entityPath}Id)
|
||||||
.then((msg) => {
|
.then((msg) => {
|
||||||
hide();
|
hide();
|
||||||
message.success(msg);
|
message.success(msg);
|
||||||
@@ -173,7 +173,7 @@
|
|||||||
maskClosable: true,
|
maskClosable: true,
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
const hide = message.loading('请求中..', 0);
|
const hide = message.loading('请求中..', 0);
|
||||||
removeBatch${entity}(selection.value.map((d) => d.id))
|
removeBatch${entity}(selection.value.map((d) => d.${table.entityPath}Id))
|
||||||
.then((msg) => {
|
.then((msg) => {
|
||||||
hide();
|
hide();
|
||||||
message.success(msg);
|
message.success(msg);
|
||||||
@@ -205,7 +205,6 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
query();
|
query();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user