22 changed files with 1306 additions and 1 deletions
-
134cereshop-admin/src/main/java/com/shop/cereshop/admin/controller/image/CereInteractionDiagramController.java
-
16cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/image/CereInteractionDiagramDAO.java
-
37cereshop-admin/src/main/java/com/shop/cereshop/admin/param/image/InteractionDiagramParam.java
-
66cereshop-admin/src/main/java/com/shop/cereshop/admin/service/image/CereInteractionDiagramService.java
-
89cereshop-admin/src/main/java/com/shop/cereshop/admin/service/image/impl/CereInteractionDiagramServiceImpl.java
-
22cereshop-admin/src/main/resources/mybatis/mapper/image/CereInteractionDiagramDAO.xml
-
134cereshop-app/src/main/java/com/shop/cereshop/app/controller/image/CereInteractionDiagramController.java
-
16cereshop-app/src/main/java/com/shop/cereshop/app/dao/image/CereInteractionDiagramDAO.java
-
38cereshop-app/src/main/java/com/shop/cereshop/app/param/image/InteractionDiagramParam.java
-
68cereshop-app/src/main/java/com/shop/cereshop/app/service/image/CereInteractionDiagramService.java
-
94cereshop-app/src/main/java/com/shop/cereshop/app/service/image/impl/CereInteractionDiagramServiceImpl.java
-
3cereshop-app/src/main/resources/application-security.yml
-
22cereshop-app/src/main/resources/mybatis/mapper/image/CereInteractionDiagramDAO.xml
-
24cereshop-business/src/main/java/com/shop/cereshop/business/controller/CanvasController.java
-
134cereshop-business/src/main/java/com/shop/cereshop/business/controller/image/CereInteractionDiagramController.java
-
16cereshop-business/src/main/java/com/shop/cereshop/business/dao/image/CereInteractionDiagramDAO.java
-
37cereshop-business/src/main/java/com/shop/cereshop/business/param/image/InteractionDiagramParam.java
-
66cereshop-business/src/main/java/com/shop/cereshop/business/service/image/CereInteractionDiagramService.java
-
89cereshop-business/src/main/java/com/shop/cereshop/business/service/image/impl/CereInteractionDiagramServiceImpl.java
-
22cereshop-business/src/main/resources/mybatis/mapper/image/CereInteractionDiagramDAO.xml
-
118cereshop-commons/src/main/java/com/shop/cereshop/commons/domain/image/CereInteractionDiagram.java
-
62cereshop-commons/src/main/java/com/shop/cereshop/commons/domain/image/CereInteractionDiagramDetail.java
@ -0,0 +1,134 @@ |
|||
/* |
|||
* Copyright (C) 2017-2021 |
|||
* All rights reserved, Designed By 深圳中科鑫智科技有限公司 |
|||
* Copyright authorization contact 18814114118 |
|||
*/ |
|||
package com.shop.cereshop.admin.controller.image; |
|||
|
|||
import com.shop.cereshop.admin.annotation.NoRepeatSubmit; |
|||
import com.shop.cereshop.admin.annotation.NoRepeatWebLog; |
|||
import com.shop.cereshop.admin.service.image.CereInteractionDiagramService; |
|||
import com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser; |
|||
import com.shop.cereshop.commons.domain.common.Page; |
|||
import com.shop.cereshop.commons.domain.image.CereInteractionDiagram; |
|||
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; |
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* <p> |
|||
* 前端控制器 |
|||
* 商品图片信息表 |
|||
* </p> |
|||
* |
|||
* @author |
|||
* @date 2024-04-04 |
|||
*/ |
|||
@Slf4j |
|||
@RestController |
|||
@RequestMapping("/cereInteractionDiagram") |
|||
@Api(value = "CereInteractionDiagram", tags = "商品图片信息表") |
|||
public class CereInteractionDiagramController { |
|||
|
|||
@Autowired |
|||
private CereInteractionDiagramService cereInteractionDiagramService; |
|||
|
|||
// /** |
|||
// * 物流方案修改查询 |
|||
// * @param param |
|||
// * @return |
|||
// */ |
|||
// @PostMapping(value = "getById") |
|||
// @ApiOperation(value = "联动图查询") |
|||
// public Result<CereInteractionDiagram> getById(@RequestBody CereInteractionDiagram param) throws CoBusinessException { |
|||
// CereInteractionDiagram storehouse=cereInteractionDiagramService.getById(param.getInteractionDiagramId()); |
|||
// return new Result(storehouse); |
|||
// } |
|||
// |
|||
// /** |
|||
// * 联动图管理查询 |
|||
// * @return |
|||
// */ |
|||
// @PostMapping(value = "getAll") |
|||
// @ApiOperation(value = "联动图管理查询") |
|||
// public Result<Page<CereInteractionDiagram>> getAll(@RequestBody InteractionDiagramParam param, HttpServletRequest request) throws CoBusinessException{ |
|||
// param.setBusinessId(Long.parseLong(ContextUtil.getProject())); |
|||
// return new Result(cereInteractionDiagramService.getAll(param)); |
|||
// } |
|||
// |
|||
// /** |
|||
// * 联动图管理查询 |
|||
// * @return |
|||
// */ |
|||
// @PostMapping(value = "getList") |
|||
// @ApiOperation(value = "联动图管理查询") |
|||
// public Result<List<CereInteractionDiagram>> getList(@RequestBody InteractionDiagramParam param, HttpServletRequest request) throws CoBusinessException{ |
|||
// param.setBusinessId(Long.parseLong(ContextUtil.getProject())); |
|||
// return new Result(cereInteractionDiagramService.selectAllByParam(param)); |
|||
// } |
|||
// |
|||
// |
|||
// |
|||
// /** |
|||
// * 新增联动图 |
|||
// * @param param |
|||
// * @return |
|||
// */ |
|||
// @PostMapping(value = "save") |
|||
// @NoRepeatSubmit |
|||
// @ApiOperation(value = "新增联动图") |
|||
// @NoRepeatWebLog |
|||
// public Result save(@RequestBody @Validated CereInteractionDiagram param, HttpServletRequest request) throws CoBusinessException{ |
|||
// //获取当前登录账户 |
|||
// CerePlatformBusinessUser user = (CerePlatformBusinessUser) request.getAttribute("user"); |
|||
// param.setBusinessId(Long.parseLong(ContextUtil.getProject())); |
|||
// cereInteractionDiagramService.insert(param); |
|||
// return new Result(user.getUsername(),"新增联动图", GsonUtil.objectToGson(param)); |
|||
// } |
|||
// |
|||
// /** |
|||
// * 更新联动图 |
|||
// * @param param |
|||
// * @return |
|||
// */ |
|||
// @PostMapping(value = "update") |
|||
// @NoRepeatSubmit |
|||
// @ApiOperation(value = "更新联动图") |
|||
// @NoRepeatWebLog |
|||
// public Result update(@RequestBody CereInteractionDiagram param, HttpServletRequest request) throws CoBusinessException{ |
|||
// //获取当前登录账户 |
|||
// CerePlatformBusinessUser user = (CerePlatformBusinessUser) request.getAttribute("user"); |
|||
// param.setBusinessId(Long.parseLong(ContextUtil.getProject())); |
|||
// cereInteractionDiagramService.update(param); |
|||
// return new Result(user.getUsername(),"更新联动图", GsonUtil.objectToGson(param)); |
|||
// } |
|||
// |
|||
// /** |
|||
// * 删除联动图 |
|||
// * @param param |
|||
// * @return |
|||
// */ |
|||
// @PostMapping(value = "delete") |
|||
// @NoRepeatSubmit |
|||
// @ApiOperation(value = "删除联动图") |
|||
// @NoRepeatWebLog |
|||
// public Result delete(@RequestBody CereInteractionDiagram param, HttpServletRequest request) throws CoBusinessException,Exception{ |
|||
// //获取当前登录账户 |
|||
// CerePlatformBusinessUser user = (CerePlatformBusinessUser) request.getAttribute("user"); |
|||
// cereInteractionDiagramService.deleteById(param.getInteractionDiagramId()); |
|||
// return new Result(user.getUsername(),"删除联动图", GsonUtil.objectToGson(param)); |
|||
// } |
|||
} |
@ -0,0 +1,16 @@ |
|||
/* |
|||
* Copyright (C) 2017-2021 |
|||
* All rights reserved, Designed By 深圳中科鑫智科技有限公司 |
|||
* Copyright authorization contact 18814114118 |
|||
*/ |
|||
package com.shop.cereshop.admin.dao.image; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.shop.cereshop.commons.domain.image.CereInteractionDiagram; |
|||
|
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
@Mapper |
|||
public interface CereInteractionDiagramDAO extends BaseMapper<CereInteractionDiagram> { |
|||
|
|||
} |
@ -0,0 +1,37 @@ |
|||
package com.shop.cereshop.admin.param.image; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.shop.cereshop.commons.domain.common.PageParam; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
|
|||
@Data |
|||
@ApiModel(value = "InteractionDiagramParam", description = "互动图参数") |
|||
public class InteractionDiagramParam extends PageParam { |
|||
|
|||
/** |
|||
* 商家Id |
|||
*/ |
|||
@ApiModelProperty(value = "商家Id") |
|||
@TableField("business_id") |
|||
private Long businessId; |
|||
|
|||
/** |
|||
* 联动图Id |
|||
*/ |
|||
@ApiModelProperty(value = "联动图Id") |
|||
@NotNull(message = "联动图Id不能为空") |
|||
private Long interactionDiagramId; |
|||
|
|||
|
|||
/** |
|||
* 联动图名字 |
|||
*/ |
|||
@ApiModelProperty(value = "联动图名字") |
|||
@Length(max = 1000, message = "联动图名字长度不能超过1000") |
|||
private String interactionDiagramName; |
|||
} |
@ -0,0 +1,66 @@ |
|||
/* |
|||
* Copyright (C) 2017-2021 |
|||
* All rights reserved, Designed By 深圳中科鑫智科技有限公司 |
|||
* Copyright authorization contact 18814114118 |
|||
*/ |
|||
package com.shop.cereshop.admin.service.image; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import com.shop.cereshop.admin.param.image.InteractionDiagramParam; |
|||
import com.shop.cereshop.commons.domain.common.Page; |
|||
import com.shop.cereshop.commons.domain.image.CereInteractionDiagram; |
|||
import com.shop.cereshop.commons.exception.CoBusinessException; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* <p> |
|||
* 业务接口 |
|||
* 商品图片信息表 |
|||
* </p> |
|||
* |
|||
* @author |
|||
* @date 2024-04-04 |
|||
*/ |
|||
public interface CereInteractionDiagramService extends IService<CereInteractionDiagram> { |
|||
/** |
|||
* 查询详情 |
|||
* @return |
|||
*/ |
|||
CereInteractionDiagram getById(Long interactionDiagramId); |
|||
|
|||
/** |
|||
* 查询列表 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
Page<CereInteractionDiagram> getAll(InteractionDiagramParam param); |
|||
|
|||
List<CereInteractionDiagram> selectAllByParam(InteractionDiagramParam param); |
|||
|
|||
/** |
|||
* 更新仓库 |
|||
* @param cereInteractionDiagram |
|||
* @return |
|||
* @throws CoBusinessException |
|||
*/ |
|||
int update(CereInteractionDiagram cereInteractionDiagram) throws CoBusinessException; |
|||
|
|||
/** |
|||
* 插入仓库 |
|||
* @param cereInteractionDiagram |
|||
* @return |
|||
* @throws CoBusinessException |
|||
*/ |
|||
int insert(CereInteractionDiagram cereInteractionDiagram) throws CoBusinessException; |
|||
|
|||
/** |
|||
* 删除仓库 |
|||
* @param interactionDiagramId |
|||
* @return |
|||
* @throws CoBusinessException |
|||
*/ |
|||
int deleteById(Long interactionDiagramId) throws CoBusinessException; |
|||
|
|||
List<CereInteractionDiagram> selectAll(); |
|||
} |
@ -0,0 +1,89 @@ |
|||
/* |
|||
* Copyright (C) 2017-2021 |
|||
* All rights reserved, Designed By 深圳中科鑫智科技有限公司 |
|||
* Copyright authorization contact 18814114118 |
|||
*/ |
|||
package com.shop.cereshop.admin.service.image.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import com.github.pagehelper.PageHelper; |
|||
import com.github.pagehelper.PageInfo; |
|||
import com.shop.cereshop.admin.dao.image.CereInteractionDiagramDAO; |
|||
import com.shop.cereshop.admin.param.image.InteractionDiagramParam; |
|||
import com.shop.cereshop.admin.service.image.CereInteractionDiagramService; |
|||
import com.shop.cereshop.commons.domain.common.Page; |
|||
import com.shop.cereshop.commons.domain.image.CereInteractionDiagram; |
|||
import com.shop.cereshop.commons.exception.CoBusinessException; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
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.util.List; |
|||
import java.util.Objects; |
|||
|
|||
/** |
|||
* <p> |
|||
* 业务实现类 |
|||
* 商品图片信息表 |
|||
* </p> |
|||
* |
|||
* @author |
|||
* @date 2024-04-04 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
public class CereInteractionDiagramServiceImpl extends ServiceImpl<CereInteractionDiagramDAO, CereInteractionDiagram> implements CereInteractionDiagramService { |
|||
|
|||
@Override |
|||
public CereInteractionDiagram getById(Long interactionDiagramId) { |
|||
return baseMapper.selectById(interactionDiagramId); |
|||
} |
|||
|
|||
@Override |
|||
public Page<CereInteractionDiagram> getAll(InteractionDiagramParam param) { |
|||
PageHelper.startPage(param.getPage(),param.getPageSize()); |
|||
List<CereInteractionDiagram> list= baseMapper.selectList(buildQuery(param)); |
|||
PageInfo<CereInteractionDiagram> pageInfo=new PageInfo<>(list); |
|||
return new Page<>(pageInfo.getList(), pageInfo.getTotal()); |
|||
} |
|||
|
|||
@Override |
|||
public List<CereInteractionDiagram> selectAllByParam(InteractionDiagramParam param) { |
|||
return baseMapper.selectList(buildQuery(param)); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class}) |
|||
public int update(CereInteractionDiagram cereInteractionDiagram) throws CoBusinessException { |
|||
return baseMapper.updateById(cereInteractionDiagram); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class}) |
|||
public int insert(CereInteractionDiagram cereInteractionDiagram) throws CoBusinessException { |
|||
return baseMapper.insert(cereInteractionDiagram); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class}) |
|||
public int deleteById(Long interactionDiagramId) throws CoBusinessException { |
|||
return baseMapper.deleteById(interactionDiagramId); |
|||
} |
|||
|
|||
@Override |
|||
public List<CereInteractionDiagram> selectAll() { |
|||
return baseMapper.selectList(Wrappers.lambdaQuery()); |
|||
} |
|||
|
|||
private LambdaQueryWrapper<CereInteractionDiagram> buildQuery(InteractionDiagramParam bo){ |
|||
LambdaQueryWrapper<CereInteractionDiagram> queryWrapper = Wrappers.lambdaQuery(); |
|||
queryWrapper.eq(Objects.nonNull(bo.getInteractionDiagramId()), CereInteractionDiagram::getInteractionDiagramId, bo.getInteractionDiagramId()); |
|||
queryWrapper.like(StringUtils.isNotEmpty(bo.getInteractionDiagramName()), CereInteractionDiagram::getInteractionDiagramName, bo.getInteractionDiagramName()); |
|||
return queryWrapper; |
|||
} |
|||
} |
@ -0,0 +1,22 @@ |
|||
<?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.image.CereInteractionDiagramDAO"> |
|||
|
|||
<!-- 通用查询映射结果 --> |
|||
<resultMap id="BaseResultMap" type="com.shop.cereshop.commons.domain.image.CereInteractionDiagram"> |
|||
<result column="interaction_diagram_id" jdbcType="BIGINT" property="interactionDiagramId"/> |
|||
<result column="interaction_diagram_name" jdbcType="VARCHAR" property="interactionDiagramName"/> |
|||
<result column="interaction_diagram_image" jdbcType="VARCHAR" property="interactionDiagramImage"/> |
|||
<result column="image_width" jdbcType="INTEGER" property="imageWidth"/> |
|||
<result column="image_height" jdbcType="INTEGER" property="imageHeight"/> |
|||
<result column="point_data" jdbcType="VARCHAR" property="pointData"/> |
|||
<result column="business_id" jdbcType="BIGINT" property="businessId"/> |
|||
<result column="terminal" jdbcType="TINYINT" property="terminal"/> |
|||
</resultMap> |
|||
|
|||
<!-- 通用查询结果列 --> |
|||
<sql id="Base_Column_List"> |
|||
interaction_diagram_id, interaction_diagram_name, interaction_diagram_image, image_width, image_height, point_data, business_id, terminal |
|||
</sql> |
|||
|
|||
</mapper> |
@ -0,0 +1,134 @@ |
|||
/* |
|||
* Copyright (C) 2017-2021 |
|||
* All rights reserved, Designed By 深圳中科鑫智科技有限公司 |
|||
* Copyright authorization contact 18814114118 |
|||
*/ |
|||
package com.shop.cereshop.app.controller.image; |
|||
|
|||
import com.shop.cereshop.app.annotation.NoRepeatSubmit; |
|||
import com.shop.cereshop.app.annotation.NoRepeatWebLog; |
|||
import com.shop.cereshop.app.param.image.InteractionDiagramParam; |
|||
import com.shop.cereshop.app.service.image.CereInteractionDiagramService; |
|||
import com.shop.cereshop.app.utils.ContextUtil; |
|||
import com.shop.cereshop.commons.constant.CoReturnFormat; |
|||
import com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser; |
|||
import com.shop.cereshop.commons.domain.common.Page; |
|||
import com.shop.cereshop.commons.domain.image.CereInteractionDiagram; |
|||
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.*; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* <p> |
|||
* 前端控制器 |
|||
* 商品图片信息表 |
|||
* </p> |
|||
* |
|||
* @author |
|||
* @date 2024-04-04 |
|||
*/ |
|||
@Slf4j |
|||
@RestController |
|||
@RequestMapping("/cereInteractionDiagram") |
|||
@Api(value = "CereInteractionDiagram", tags = "商品图片信息表") |
|||
public class CereInteractionDiagramController { |
|||
|
|||
@Autowired |
|||
private CereInteractionDiagramService cereInteractionDiagramService; |
|||
|
|||
/** |
|||
* 物流方案修改查询 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@GetMapping(value = "getById") |
|||
@ApiOperation(value = "联动图查询") |
|||
public Result<CereInteractionDiagram> getById(CereInteractionDiagram param) throws CoBusinessException { |
|||
CereInteractionDiagram storehouse=cereInteractionDiagramService.getById(param.getInteractionDiagramId()); |
|||
return new Result(storehouse, CoReturnFormat.SUCCESS); |
|||
} |
|||
|
|||
/** |
|||
* 联动图管理查询 |
|||
* @return |
|||
*/ |
|||
@GetMapping(value = "getAll") |
|||
@ApiOperation(value = "联动图管理查询") |
|||
public Result<Page<CereInteractionDiagram>> getAll(InteractionDiagramParam param, HttpServletRequest request) throws CoBusinessException{ |
|||
param.setBusinessId(Long.parseLong(ContextUtil.getProject())); |
|||
return new Result(cereInteractionDiagramService.getAll(param), CoReturnFormat.SUCCESS); |
|||
} |
|||
|
|||
/** |
|||
* 联动图管理查询 |
|||
* @return |
|||
*/ |
|||
@GetMapping(value = "getList") |
|||
@ApiOperation(value = "联动图管理查询") |
|||
public Result<List<CereInteractionDiagram>> getList(InteractionDiagramParam param, HttpServletRequest request) throws CoBusinessException{ |
|||
param.setBusinessId(Long.parseLong(ContextUtil.getProject())); |
|||
return new Result(cereInteractionDiagramService.selectAllByParam(param), CoReturnFormat.SUCCESS); |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* 新增联动图 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping(value = "save") |
|||
@NoRepeatSubmit |
|||
@ApiOperation(value = "新增联动图") |
|||
@NoRepeatWebLog |
|||
public Result save(@RequestBody @Validated CereInteractionDiagram param, HttpServletRequest request) throws CoBusinessException{ |
|||
//获取当前登录账户 |
|||
CerePlatformBusinessUser user = (CerePlatformBusinessUser) request.getAttribute("user"); |
|||
param.setBusinessId(Long.parseLong(ContextUtil.getProject())); |
|||
cereInteractionDiagramService.insert(param); |
|||
return new Result(CoReturnFormat.SUCCESS, user.getUsername(),"新增联动图", GsonUtil.objectToGson(param)); |
|||
} |
|||
|
|||
/** |
|||
* 更新联动图 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping(value = "update") |
|||
@NoRepeatSubmit |
|||
@ApiOperation(value = "更新联动图") |
|||
@NoRepeatWebLog |
|||
public Result update(@RequestBody CereInteractionDiagram param, HttpServletRequest request) throws CoBusinessException{ |
|||
//获取当前登录账户 |
|||
CerePlatformBusinessUser user = (CerePlatformBusinessUser) request.getAttribute("user"); |
|||
param.setBusinessId(Long.parseLong(ContextUtil.getProject())); |
|||
cereInteractionDiagramService.update(param); |
|||
return new Result(CoReturnFormat.SUCCESS, user.getUsername(),"更新联动图", GsonUtil.objectToGson(param), CoReturnFormat.SUCCESS); |
|||
} |
|||
|
|||
/** |
|||
* 删除联动图 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping(value = "delete") |
|||
@NoRepeatSubmit |
|||
@ApiOperation(value = "删除联动图") |
|||
@NoRepeatWebLog |
|||
public Result delete(@RequestBody CereInteractionDiagram param, HttpServletRequest request) throws CoBusinessException,Exception{ |
|||
//获取当前登录账户 |
|||
CerePlatformBusinessUser user = (CerePlatformBusinessUser) request.getAttribute("user"); |
|||
cereInteractionDiagramService.deleteById(param.getInteractionDiagramId()); |
|||
return new Result(CoReturnFormat.SUCCESS, user.getUsername(),"删除联动图", GsonUtil.objectToGson(param), CoReturnFormat.SUCCESS); |
|||
} |
|||
} |
@ -0,0 +1,16 @@ |
|||
/* |
|||
* Copyright (C) 2017-2021 |
|||
* All rights reserved, Designed By 深圳中科鑫智科技有限公司 |
|||
* Copyright authorization contact 18814114118 |
|||
*/ |
|||
package com.shop.cereshop.app.dao.image; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.shop.cereshop.commons.domain.image.CereInteractionDiagram; |
|||
|
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
@Mapper |
|||
public interface CereInteractionDiagramDAO extends BaseMapper<CereInteractionDiagram> { |
|||
|
|||
} |
@ -0,0 +1,38 @@ |
|||
package com.shop.cereshop.app.param.image; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.shop.cereshop.commons.domain.common.PageParam; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
|
|||
@Data |
|||
@ApiModel(value = "InteractionDiagramParam", description = "互动图参数") |
|||
public class InteractionDiagramParam extends PageParam { |
|||
|
|||
/** |
|||
* 商家Id |
|||
*/ |
|||
@ApiModelProperty(value = "商家Id") |
|||
@TableField("business_id") |
|||
private Long businessId; |
|||
|
|||
|
|||
/** |
|||
* 联动图Id |
|||
*/ |
|||
@ApiModelProperty(value = "联动图Id") |
|||
@NotNull(message = "联动图Id不能为空") |
|||
private Long interactionDiagramId; |
|||
|
|||
|
|||
/** |
|||
* 联动图名字 |
|||
*/ |
|||
@ApiModelProperty(value = "联动图名字") |
|||
@Length(max = 1000, message = "联动图名字长度不能超过1000") |
|||
private String interactionDiagramName; |
|||
} |
@ -0,0 +1,68 @@ |
|||
/* |
|||
* Copyright (C) 2017-2021 |
|||
* All rights reserved, Designed By 深圳中科鑫智科技有限公司 |
|||
* Copyright authorization contact 18814114118 |
|||
*/ |
|||
package com.shop.cereshop.app.service.image; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import com.shop.cereshop.app.param.image.InteractionDiagramParam; |
|||
import com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser; |
|||
import com.shop.cereshop.commons.domain.common.Page; |
|||
import com.shop.cereshop.commons.domain.image.CereInteractionDiagram; |
|||
import com.shop.cereshop.commons.domain.storehouse.CereShopStorehouse; |
|||
import com.shop.cereshop.commons.exception.CoBusinessException; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* <p> |
|||
* 业务接口 |
|||
* 商品图片信息表 |
|||
* </p> |
|||
* |
|||
* @author |
|||
* @date 2024-04-04 |
|||
*/ |
|||
public interface CereInteractionDiagramService extends IService<CereInteractionDiagram> { |
|||
/** |
|||
* 查询详情 |
|||
* @return |
|||
*/ |
|||
CereInteractionDiagram getById(Long interactionDiagramId); |
|||
|
|||
/** |
|||
* 查询列表 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
Page<CereInteractionDiagram> getAll(InteractionDiagramParam param); |
|||
|
|||
List<CereInteractionDiagram> selectAllByParam(InteractionDiagramParam param); |
|||
|
|||
/** |
|||
* 更新仓库 |
|||
* @param cereInteractionDiagram |
|||
* @return |
|||
* @throws CoBusinessException |
|||
*/ |
|||
int update(CereInteractionDiagram cereInteractionDiagram) throws CoBusinessException; |
|||
|
|||
/** |
|||
* 插入仓库 |
|||
* @param cereInteractionDiagram |
|||
* @return |
|||
* @throws CoBusinessException |
|||
*/ |
|||
int insert(CereInteractionDiagram cereInteractionDiagram) throws CoBusinessException; |
|||
|
|||
/** |
|||
* 删除仓库 |
|||
* @param interactionDiagramId |
|||
* @return |
|||
* @throws CoBusinessException |
|||
*/ |
|||
int deleteById(Long interactionDiagramId) throws CoBusinessException; |
|||
|
|||
List<CereInteractionDiagram> selectAll(); |
|||
} |
@ -0,0 +1,94 @@ |
|||
/* |
|||
* Copyright (C) 2017-2021 |
|||
* All rights reserved, Designed By 深圳中科鑫智科技有限公司 |
|||
* Copyright authorization contact 18814114118 |
|||
*/ |
|||
package com.shop.cereshop.app.service.image.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|||
import com.github.pagehelper.PageHelper; |
|||
import com.github.pagehelper.PageInfo; |
|||
import com.shop.cereshop.app.dao.image.CereInteractionDiagramDAO; |
|||
import com.shop.cereshop.app.param.image.InteractionDiagramParam; |
|||
import com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser; |
|||
import com.shop.cereshop.commons.domain.common.Page; |
|||
import com.shop.cereshop.commons.domain.image.CereInteractionDiagram; |
|||
import com.shop.cereshop.app.service.image.CereInteractionDiagramService; |
|||
|
|||
import com.shop.cereshop.commons.domain.storehouse.CereShopStorehouse; |
|||
import com.shop.cereshop.commons.exception.CoBusinessException; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import org.springframework.beans.BeanUtils; |
|||
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.util.List; |
|||
import java.util.Objects; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* <p> |
|||
* 业务实现类 |
|||
* 商品图片信息表 |
|||
* </p> |
|||
* |
|||
* @author |
|||
* @date 2024-04-04 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
public class CereInteractionDiagramServiceImpl extends ServiceImpl<CereInteractionDiagramDAO, CereInteractionDiagram> implements CereInteractionDiagramService { |
|||
|
|||
@Override |
|||
public CereInteractionDiagram getById(Long interactionDiagramId) { |
|||
return baseMapper.selectById(interactionDiagramId); |
|||
} |
|||
|
|||
@Override |
|||
public Page<CereInteractionDiagram> getAll(InteractionDiagramParam param) { |
|||
PageHelper.startPage(param.getPage(),param.getPageSize()); |
|||
List<CereInteractionDiagram> list= baseMapper.selectList(buildQuery(param)); |
|||
PageInfo<CereInteractionDiagram> pageInfo=new PageInfo<>(list); |
|||
return new Page<>(pageInfo.getList(), pageInfo.getTotal()); |
|||
} |
|||
|
|||
@Override |
|||
public List<CereInteractionDiagram> selectAllByParam(InteractionDiagramParam param) { |
|||
return baseMapper.selectList(buildQuery(param)); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class}) |
|||
public int update(CereInteractionDiagram cereInteractionDiagram) throws CoBusinessException { |
|||
return baseMapper.updateById(cereInteractionDiagram); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class}) |
|||
public int insert(CereInteractionDiagram cereInteractionDiagram) throws CoBusinessException { |
|||
return baseMapper.insert(cereInteractionDiagram); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class}) |
|||
public int deleteById(Long interactionDiagramId) throws CoBusinessException { |
|||
return baseMapper.deleteById(interactionDiagramId); |
|||
} |
|||
|
|||
@Override |
|||
public List<CereInteractionDiagram> selectAll() { |
|||
return baseMapper.selectList(Wrappers.lambdaQuery()); |
|||
} |
|||
|
|||
private LambdaQueryWrapper<CereInteractionDiagram> buildQuery(InteractionDiagramParam bo){ |
|||
LambdaQueryWrapper<CereInteractionDiagram> queryWrapper = Wrappers.lambdaQuery(); |
|||
queryWrapper.eq(Objects.nonNull(bo.getInteractionDiagramId()), CereInteractionDiagram::getInteractionDiagramId, bo.getInteractionDiagramId()); |
|||
queryWrapper.like(StringUtils.isNotEmpty(bo.getInteractionDiagramName()), CereInteractionDiagram::getInteractionDiagramName, bo.getInteractionDiagramName()); |
|||
return queryWrapper; |
|||
} |
|||
} |
@ -0,0 +1,22 @@ |
|||
<?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.app.dao.image.CereInteractionDiagramDAO"> |
|||
|
|||
<!-- 通用查询映射结果 --> |
|||
<resultMap id="BaseResultMap" type="com.shop.cereshop.commons.domain.image.CereInteractionDiagram"> |
|||
<result column="interaction_diagram_id" jdbcType="BIGINT" property="interactionDiagramId"/> |
|||
<result column="interaction_diagram_name" jdbcType="VARCHAR" property="interactionDiagramName"/> |
|||
<result column="interaction_diagram_image" jdbcType="VARCHAR" property="interactionDiagramImage"/> |
|||
<result column="image_width" jdbcType="INTEGER" property="imageWidth"/> |
|||
<result column="image_height" jdbcType="INTEGER" property="imageHeight"/> |
|||
<result column="point_data" jdbcType="VARCHAR" property="pointData"/> |
|||
<result column="business_id" jdbcType="BIGINT" property="businessId"/> |
|||
<result column="terminal" jdbcType="TINYINT" property="terminal"/> |
|||
</resultMap> |
|||
|
|||
<!-- 通用查询结果列 --> |
|||
<sql id="Base_Column_List"> |
|||
interaction_diagram_id, interaction_diagram_name, interaction_diagram_image, image_width, image_height, point_data, business_id, terminal |
|||
</sql> |
|||
|
|||
</mapper> |
@ -0,0 +1,134 @@ |
|||
/* |
|||
* Copyright (C) 2017-2021 |
|||
* All rights reserved, Designed By 深圳中科鑫智科技有限公司 |
|||
* Copyright authorization contact 18814114118 |
|||
*/ |
|||
package com.shop.cereshop.business.controller.image; |
|||
|
|||
import com.shop.cereshop.business.annotation.NoRepeatSubmit; |
|||
import com.shop.cereshop.business.annotation.NoRepeatWebLog; |
|||
import com.shop.cereshop.business.param.image.InteractionDiagramParam; |
|||
import com.shop.cereshop.business.service.image.CereInteractionDiagramService; |
|||
import com.shop.cereshop.business.utils.ContextUtil; |
|||
import com.shop.cereshop.commons.constant.CoReturnFormat; |
|||
import com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser; |
|||
import com.shop.cereshop.commons.domain.common.Page; |
|||
import com.shop.cereshop.commons.domain.image.CereInteractionDiagram; |
|||
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.*; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* <p> |
|||
* 前端控制器 |
|||
* 商品图片信息表 |
|||
* </p> |
|||
* |
|||
* @author |
|||
* @date 2024-04-04 |
|||
*/ |
|||
@Slf4j |
|||
@RestController |
|||
@RequestMapping("/cereInteractionDiagram") |
|||
@Api(value = "CereInteractionDiagram", tags = "商品图片信息表") |
|||
public class CereInteractionDiagramController { |
|||
|
|||
@Autowired |
|||
private CereInteractionDiagramService cereInteractionDiagramService; |
|||
|
|||
/** |
|||
* 物流方案修改查询 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@GetMapping(value = "getById") |
|||
@ApiOperation(value = "联动图查询") |
|||
public Result<CereInteractionDiagram> getById(CereInteractionDiagram param) throws CoBusinessException { |
|||
CereInteractionDiagram storehouse=cereInteractionDiagramService.getById(param.getInteractionDiagramId()); |
|||
return new Result(storehouse, CoReturnFormat.SUCCESS); |
|||
} |
|||
|
|||
/** |
|||
* 联动图管理查询 |
|||
* @return |
|||
*/ |
|||
@GetMapping(value = "getAll") |
|||
@ApiOperation(value = "联动图管理查询") |
|||
public Result<Page<CereInteractionDiagram>> getAll(InteractionDiagramParam param) throws CoBusinessException{ |
|||
param.setBusinessId(ContextUtil.getBusinessId()); |
|||
return new Result(cereInteractionDiagramService.getAll(param), CoReturnFormat.SUCCESS); |
|||
} |
|||
|
|||
/** |
|||
* 联动图管理查询 |
|||
* @return |
|||
*/ |
|||
@GetMapping(value = "getList") |
|||
@ApiOperation(value = "联动图管理查询") |
|||
public Result<List<CereInteractionDiagram>> getList(InteractionDiagramParam param, HttpServletRequest request) throws CoBusinessException{ |
|||
param.setBusinessId(ContextUtil.getBusinessId()); |
|||
return new Result(cereInteractionDiagramService.selectAllByParam(param), CoReturnFormat.SUCCESS); |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* 新增联动图 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping(value = "save") |
|||
@NoRepeatSubmit |
|||
@ApiOperation(value = "新增联动图") |
|||
@NoRepeatWebLog |
|||
public Result save(@RequestBody @Validated CereInteractionDiagram param, HttpServletRequest request) throws CoBusinessException{ |
|||
//获取当前登录账户 |
|||
CerePlatformBusinessUser user = (CerePlatformBusinessUser) request.getAttribute("user"); |
|||
param.setBusinessId(ContextUtil.getBusinessId()); |
|||
cereInteractionDiagramService.insert(param); |
|||
return new Result(CoReturnFormat.SUCCESS, user.getUsername(),"新增联动图", GsonUtil.objectToGson(param)); |
|||
} |
|||
|
|||
/** |
|||
* 更新联动图 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping(value = "update") |
|||
@NoRepeatSubmit |
|||
@ApiOperation(value = "更新联动图") |
|||
@NoRepeatWebLog |
|||
public Result update(@RequestBody CereInteractionDiagram param, HttpServletRequest request) throws CoBusinessException{ |
|||
//获取当前登录账户 |
|||
CerePlatformBusinessUser user = (CerePlatformBusinessUser) request.getAttribute("user"); |
|||
param.setBusinessId(ContextUtil.getBusinessId()); |
|||
cereInteractionDiagramService.update(param); |
|||
return new Result(CoReturnFormat.SUCCESS, user.getUsername(),"更新联动图", GsonUtil.objectToGson(param)); |
|||
} |
|||
|
|||
/** |
|||
* 删除联动图 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping(value = "delete") |
|||
@NoRepeatSubmit |
|||
@ApiOperation(value = "删除联动图") |
|||
@NoRepeatWebLog |
|||
public Result delete(@RequestBody CereInteractionDiagram param, HttpServletRequest request) throws CoBusinessException,Exception{ |
|||
//获取当前登录账户 |
|||
CerePlatformBusinessUser user = (CerePlatformBusinessUser) request.getAttribute("user"); |
|||
cereInteractionDiagramService.deleteById(param.getInteractionDiagramId()); |
|||
return new Result(CoReturnFormat.SUCCESS, user.getUsername(),"删除联动图", GsonUtil.objectToGson(param)); |
|||
} |
|||
} |
@ -0,0 +1,16 @@ |
|||
/* |
|||
* Copyright (C) 2017-2021 |
|||
* All rights reserved, Designed By 深圳中科鑫智科技有限公司 |
|||
* Copyright authorization contact 18814114118 |
|||
*/ |
|||
package com.shop.cereshop.business.dao.image; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.shop.cereshop.commons.domain.image.CereInteractionDiagram; |
|||
|
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
@Mapper |
|||
public interface CereInteractionDiagramDAO extends BaseMapper<CereInteractionDiagram> { |
|||
|
|||
} |
@ -0,0 +1,37 @@ |
|||
package com.shop.cereshop.business.param.image; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.shop.cereshop.commons.domain.common.PageParam; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
|
|||
@Data |
|||
@ApiModel(value = "InteractionDiagramParam", description = "互动图参数") |
|||
public class InteractionDiagramParam extends PageParam { |
|||
|
|||
/** |
|||
* 商家Id |
|||
*/ |
|||
@ApiModelProperty(value = "商家Id") |
|||
@TableField("business_id") |
|||
private Long businessId; |
|||
|
|||
/** |
|||
* 联动图Id |
|||
*/ |
|||
@ApiModelProperty(value = "联动图Id") |
|||
@NotNull(message = "联动图Id不能为空") |
|||
private Long interactionDiagramId; |
|||
|
|||
|
|||
/** |
|||
* 联动图名字 |
|||
*/ |
|||
@ApiModelProperty(value = "联动图名字") |
|||
@Length(max = 1000, message = "联动图名字长度不能超过1000") |
|||
private String interactionDiagramName; |
|||
} |
@ -0,0 +1,66 @@ |
|||
/* |
|||
* Copyright (C) 2017-2021 |
|||
* All rights reserved, Designed By 深圳中科鑫智科技有限公司 |
|||
* Copyright authorization contact 18814114118 |
|||
*/ |
|||
package com.shop.cereshop.business.service.image; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import com.shop.cereshop.business.param.image.InteractionDiagramParam; |
|||
import com.shop.cereshop.commons.domain.common.Page; |
|||
import com.shop.cereshop.commons.domain.image.CereInteractionDiagram; |
|||
import com.shop.cereshop.commons.exception.CoBusinessException; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* <p> |
|||
* 业务接口 |
|||
* 商品图片信息表 |
|||
* </p> |
|||
* |
|||
* @author |
|||
* @date 2024-04-04 |
|||
*/ |
|||
public interface CereInteractionDiagramService extends IService<CereInteractionDiagram> { |
|||
/** |
|||
* 查询详情 |
|||
* @return |
|||
*/ |
|||
CereInteractionDiagram getById(Long interactionDiagramId); |
|||
|
|||
/** |
|||
* 查询列表 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
Page<CereInteractionDiagram> getAll(InteractionDiagramParam param); |
|||
|
|||
List<CereInteractionDiagram> selectAllByParam(InteractionDiagramParam param); |
|||
|
|||
/** |
|||
* 更新仓库 |
|||
* @param cereInteractionDiagram |
|||
* @return |
|||
* @throws CoBusinessException |
|||
*/ |
|||
int update(CereInteractionDiagram cereInteractionDiagram) throws CoBusinessException; |
|||
|
|||
/** |
|||
* 插入仓库 |
|||
* @param cereInteractionDiagram |
|||
* @return |
|||
* @throws CoBusinessException |
|||
*/ |
|||
int insert(CereInteractionDiagram cereInteractionDiagram) throws CoBusinessException; |
|||
|
|||
/** |
|||
* 删除仓库 |
|||
* @param interactionDiagramId |
|||
* @return |
|||
* @throws CoBusinessException |
|||
*/ |
|||
int deleteById(Long interactionDiagramId) throws CoBusinessException; |
|||
|
|||
List<CereInteractionDiagram> selectAll(); |
|||
} |
@ -0,0 +1,89 @@ |
|||
/* |
|||
* Copyright (C) 2017-2021 |
|||
* All rights reserved, Designed By 深圳中科鑫智科技有限公司 |
|||
* Copyright authorization contact 18814114118 |
|||
*/ |
|||
package com.shop.cereshop.business.service.image.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import com.github.pagehelper.PageHelper; |
|||
import com.github.pagehelper.PageInfo; |
|||
import com.shop.cereshop.business.dao.image.CereInteractionDiagramDAO; |
|||
import com.shop.cereshop.business.param.image.InteractionDiagramParam; |
|||
import com.shop.cereshop.business.service.image.CereInteractionDiagramService; |
|||
import com.shop.cereshop.commons.domain.common.Page; |
|||
import com.shop.cereshop.commons.domain.image.CereInteractionDiagram; |
|||
import com.shop.cereshop.commons.exception.CoBusinessException; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
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.util.List; |
|||
import java.util.Objects; |
|||
|
|||
/** |
|||
* <p> |
|||
* 业务实现类 |
|||
* 商品图片信息表 |
|||
* </p> |
|||
* |
|||
* @author |
|||
* @date 2024-04-04 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
public class CereInteractionDiagramServiceImpl extends ServiceImpl<CereInteractionDiagramDAO, CereInteractionDiagram> implements CereInteractionDiagramService { |
|||
|
|||
@Override |
|||
public CereInteractionDiagram getById(Long interactionDiagramId) { |
|||
return baseMapper.selectById(interactionDiagramId); |
|||
} |
|||
|
|||
@Override |
|||
public Page<CereInteractionDiagram> getAll(InteractionDiagramParam param) { |
|||
PageHelper.startPage(param.getPage(),param.getPageSize()); |
|||
List<CereInteractionDiagram> list= baseMapper.selectList(buildQuery(param)); |
|||
PageInfo<CereInteractionDiagram> pageInfo=new PageInfo<>(list); |
|||
return new Page<>(pageInfo.getList(), pageInfo.getTotal()); |
|||
} |
|||
|
|||
@Override |
|||
public List<CereInteractionDiagram> selectAllByParam(InteractionDiagramParam param) { |
|||
return baseMapper.selectList(buildQuery(param)); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class}) |
|||
public int update(CereInteractionDiagram cereInteractionDiagram) throws CoBusinessException { |
|||
return baseMapper.updateById(cereInteractionDiagram); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class}) |
|||
public int insert(CereInteractionDiagram cereInteractionDiagram) throws CoBusinessException { |
|||
return baseMapper.insert(cereInteractionDiagram); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class}) |
|||
public int deleteById(Long interactionDiagramId) throws CoBusinessException { |
|||
return baseMapper.deleteById(interactionDiagramId); |
|||
} |
|||
|
|||
@Override |
|||
public List<CereInteractionDiagram> selectAll() { |
|||
return baseMapper.selectList(Wrappers.lambdaQuery()); |
|||
} |
|||
|
|||
private LambdaQueryWrapper<CereInteractionDiagram> buildQuery(InteractionDiagramParam bo){ |
|||
LambdaQueryWrapper<CereInteractionDiagram> queryWrapper = Wrappers.lambdaQuery(); |
|||
queryWrapper.eq(Objects.nonNull(bo.getInteractionDiagramId()), CereInteractionDiagram::getInteractionDiagramId, bo.getInteractionDiagramId()); |
|||
queryWrapper.like(StringUtils.isNotEmpty(bo.getInteractionDiagramName()), CereInteractionDiagram::getInteractionDiagramName, bo.getInteractionDiagramName()); |
|||
return queryWrapper; |
|||
} |
|||
} |
@ -0,0 +1,22 @@ |
|||
<?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.business.dao.image.CereInteractionDiagramDAO"> |
|||
|
|||
<!-- 通用查询映射结果 --> |
|||
<resultMap id="BaseResultMap" type="com.shop.cereshop.commons.domain.image.CereInteractionDiagram"> |
|||
<result column="interaction_diagram_id" jdbcType="BIGINT" property="interactionDiagramId"/> |
|||
<result column="interaction_diagram_name" jdbcType="VARCHAR" property="interactionDiagramName"/> |
|||
<result column="interaction_diagram_image" jdbcType="VARCHAR" property="interactionDiagramImage"/> |
|||
<result column="image_width" jdbcType="INTEGER" property="imageWidth"/> |
|||
<result column="image_height" jdbcType="INTEGER" property="imageHeight"/> |
|||
<result column="point_data" jdbcType="VARCHAR" property="pointData"/> |
|||
<result column="business_id" jdbcType="BIGINT" property="businessId"/> |
|||
<result column="terminal" jdbcType="TINYINT" property="terminal"/> |
|||
</resultMap> |
|||
|
|||
<!-- 通用查询结果列 --> |
|||
<sql id="Base_Column_List"> |
|||
interaction_diagram_id, interaction_diagram_name, interaction_diagram_image, image_width, image_height, point_data, business_id, terminal |
|||
</sql> |
|||
|
|||
</mapper> |
@ -0,0 +1,118 @@ |
|||
/* |
|||
* Copyright (C) 2017-2021 |
|||
* All rights reserved, Designed By 深圳中科鑫智科技有限公司 |
|||
* Copyright authorization contact 18814114118 |
|||
*/ |
|||
package com.shop.cereshop.commons.domain.image; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.baomidou.mybatisplus.annotation.IdType; |
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import javax.validation.constraints.NotEmpty; |
|||
import javax.validation.constraints.NotNull; |
|||
import org.hibernate.validator.constraints.Length; |
|||
import org.hibernate.validator.constraints.Range; |
|||
import java.time.LocalDateTime; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Builder; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.NoArgsConstructor; |
|||
import lombok.ToString; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE; |
|||
|
|||
/** |
|||
* <p> |
|||
* 实体类 |
|||
* 商品图片信息表 |
|||
* </p> |
|||
* |
|||
* @since 2024-04-04 |
|||
*/ |
|||
@Data |
|||
@NoArgsConstructor |
|||
@ToString(callSuper = true) |
|||
@TableName("cere_interaction_diagram") |
|||
@ApiModel(value = "CereInteractionDiagram", description = "商品图片信息表") |
|||
@AllArgsConstructor |
|||
public class CereInteractionDiagram { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 联动图Id |
|||
*/ |
|||
@ApiModelProperty(value = "联动图Id") |
|||
@NotNull(message = "联动图Id不能为空") |
|||
@TableId(type = IdType.AUTO) |
|||
private Long interactionDiagramId; |
|||
|
|||
|
|||
/** |
|||
* 联动图名字 |
|||
*/ |
|||
@ApiModelProperty(value = "联动图名字") |
|||
@Length(max = 1000, message = "联动图名字长度不能超过1000") |
|||
@TableField(value = "interaction_diagram_name", condition = LIKE) |
|||
private String interactionDiagramName; |
|||
|
|||
|
|||
/** |
|||
* 联动图背景图 |
|||
*/ |
|||
@ApiModelProperty(value = "联动图背景图") |
|||
@Length(max = 1000, message = "联动图背景图长度不能超过1000") |
|||
@TableField(value = "interaction_diagram_image", condition = LIKE) |
|||
private String interactionDiagramImage; |
|||
|
|||
|
|||
/** |
|||
* 图片宽度 |
|||
*/ |
|||
@ApiModelProperty(value = "图片宽度") |
|||
@TableField("image_width") |
|||
private Integer imageWidth; |
|||
|
|||
|
|||
/** |
|||
* 图片高度 |
|||
*/ |
|||
@ApiModelProperty(value = "图片高度") |
|||
@TableField("image_height") |
|||
private Integer imageHeight; |
|||
|
|||
|
|||
/** |
|||
* 联动图数据 |
|||
*/ |
|||
@ApiModelProperty(value = "联动图数据") |
|||
@Length(max = 6000, message = "联动图数据长度不能超过6000") |
|||
@TableField(value = "point_data", condition = LIKE) |
|||
private String pointData; |
|||
|
|||
|
|||
/** |
|||
* 商家Id |
|||
*/ |
|||
@ApiModelProperty(value = "商家Id") |
|||
@TableField("business_id") |
|||
private Long businessId; |
|||
|
|||
|
|||
/** |
|||
* 终端 1-小程序 2-H5 3-APP 4-PC |
|||
*/ |
|||
@ApiModelProperty(value = "终端 1-小程序 2-H5 3-APP 4-PC") |
|||
@NotNull(message = "终端 1-小程序 2-H5 3-APP 4-PC不能为空") |
|||
@TableField("terminal") |
|||
private Boolean terminal; |
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,62 @@ |
|||
/* |
|||
* Copyright (C) 2017-2021 |
|||
* All rights reserved, Designed By 深圳中科鑫智科技有限公司 |
|||
* Copyright authorization contact 18814114118 |
|||
*/ |
|||
package com.shop.cereshop.commons.domain.image; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
import lombok.ToString; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
|
|||
/** |
|||
* <p> |
|||
* 实体类 |
|||
* 商品图片信息表 |
|||
* </p> |
|||
* |
|||
* @since 2024-04-04 |
|||
*/ |
|||
@Data |
|||
@NoArgsConstructor |
|||
@ToString(callSuper = true) |
|||
@ApiModel(value = "CereInteractionDiagramDetail", description = "商品图片信息详情表") |
|||
@AllArgsConstructor |
|||
public class CereInteractionDiagramDetail { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 数据类型 |
|||
*/ |
|||
@ApiModelProperty(value = "数据类型") |
|||
@NotNull(message = "数据类型") |
|||
private String type; |
|||
|
|||
|
|||
/** |
|||
* 具体数据 |
|||
*/ |
|||
@ApiModelProperty(value = "具体数据") |
|||
private String data; |
|||
|
|||
|
|||
|
|||
/** |
|||
* X轴的位置 |
|||
*/ |
|||
@ApiModelProperty(value = "X轴的位置") |
|||
private Integer pointX; |
|||
|
|||
|
|||
/** |
|||
* Y轴的位置 |
|||
*/ |
|||
@ApiModelProperty(value = "Y轴的位置") |
|||
private Integer pointY; |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue