From 3d5e49a73f04fc8b6cbd3a440570063f556bb640 Mon Sep 17 00:00:00 2001 From: qiaohui <924337501@qq.com> Date: Tue, 22 Oct 2024 23:13:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=97=E9=93=BA=E6=89=93=E5=8D=B0=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E5=A2=9E=E5=88=A0=E6=94=B9=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ShopPrintController.java | 105 ++++++++++++++++++ .../core/shopprint/entity/ShopPrint.java | 39 +++++++ .../shopprint/mapper/ShopPrintMapper.java | 25 +++++ .../shopprint/service/ShopPrintService.java | 13 +++ .../service/impl/ShopPrintServiceImpl.java | 36 ++++++ .../core/shopprint/vo/ShopPrintQueryVo.java | 10 ++ .../main/resources/mapper/ShopPrintMapper.xml | 7 ++ 7 files changed, 235 insertions(+) create mode 100644 hiver-core/src/main/java/cc/hiver/core/shopprint/controller/ShopPrintController.java create mode 100644 hiver-core/src/main/java/cc/hiver/core/shopprint/entity/ShopPrint.java create mode 100644 hiver-core/src/main/java/cc/hiver/core/shopprint/mapper/ShopPrintMapper.java create mode 100644 hiver-core/src/main/java/cc/hiver/core/shopprint/service/ShopPrintService.java create mode 100644 hiver-core/src/main/java/cc/hiver/core/shopprint/service/impl/ShopPrintServiceImpl.java create mode 100644 hiver-core/src/main/java/cc/hiver/core/shopprint/vo/ShopPrintQueryVo.java create mode 100644 hiver-core/src/main/resources/mapper/ShopPrintMapper.xml diff --git a/hiver-core/src/main/java/cc/hiver/core/shopprint/controller/ShopPrintController.java b/hiver-core/src/main/java/cc/hiver/core/shopprint/controller/ShopPrintController.java new file mode 100644 index 00000000..1fd9a724 --- /dev/null +++ b/hiver-core/src/main/java/cc/hiver/core/shopprint/controller/ShopPrintController.java @@ -0,0 +1,105 @@ +package cc.hiver.core.shopprint.controller; + +import cc.hiver.core.common.utils.ResultUtil; +import cc.hiver.core.common.vo.Result; +import cc.hiver.core.logisticsroute.entity.LogisticsRoute; +import cc.hiver.core.logisticsroute.service.LogisticsRouteService; +import cc.hiver.core.logisticsroute.vo.LogisticsRouteQueryVo; +import cc.hiver.core.shopprint.entity.ShopPrint; +import cc.hiver.core.shopprint.service.ShopPrintService; +import cc.hiver.core.shopprint.vo.ShopPrintQueryVo; +import com.baomidou.mybatisplus.core.metadata.IPage; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @ClassName:ShopPrintController + * @Author: qiaohui + * @Date: 2024/10/22 22:07 + * @Description: 必须描述类做什么事情, 实现什么功能 + */ +@Slf4j +@RestController +@Api(tags = "店铺打印内容接口") +@RequestMapping("/hiver/app/shopprint") +@Transactional +public class ShopPrintController { + + @Autowired + private ShopPrintService shopPrintService; + + @PostMapping(value = "/add") + @ApiOperation("新增店铺打印内容") + public Result addLogisticsRoute(@RequestBody ShopPrint shopPrint) { + + final boolean b = shopPrintService.saveOrUpdate(shopPrint); + if (b) { + return ResultUtil.success("保存成功!"); + } else { + return ResultUtil.error("保存失败!"); + } + } + + /** + * 更新 + * @param shopPrint + * @return + */ + @PostMapping(value = "/update") + @ApiOperation("更新店铺打印内容") + public Result updateLogisticsRoute(@RequestBody ShopPrint shopPrint) { + if (StringUtils.isEmpty(shopPrint.getId())) { + return ResultUtil.error("id不能为空!"); + } + final boolean b = shopPrintService.saveOrUpdate(shopPrint); + if (b) { + return ResultUtil.success("保存成功!"); + } else { + return ResultUtil.error("保存失败!"); + } + } + + /** + * 删除物流线路 + * + * @param id + * @return Result + * @author 王富康 + * @date 2024/8/24 + */ + @PostMapping(value = "/delete") + @ApiOperation("删除店铺打印内容") + public Result deleteLogisticsRoute(String id) { + if (StringUtils.isEmpty(id)) { + return ResultUtil.error("线路id不能为空!"); + } + final boolean b = shopPrintService.removeById(id); + if (b) { + return ResultUtil.success("删除成功!"); + } else { + return ResultUtil.error("删除失败!"); + } + } + + /** + * 分页查询物流线路 + * + * @param logisticsRouteQueryVo + * @return Result> + * @author 王富康 + * @date 2024/8/24 + */ + @RequestMapping(value = "/getList", method = RequestMethod.POST) + @ApiOperation(value = "查询打印内容") + public Result> getLogisticsRoutePageList(@RequestBody(required = false) ShopPrintQueryVo logisticsRouteQueryVo) { + final List result = shopPrintService.getShopPrintList(logisticsRouteQueryVo); + return new ResultUtil>().setData(result); + } +} diff --git a/hiver-core/src/main/java/cc/hiver/core/shopprint/entity/ShopPrint.java b/hiver-core/src/main/java/cc/hiver/core/shopprint/entity/ShopPrint.java new file mode 100644 index 00000000..5383e59c --- /dev/null +++ b/hiver-core/src/main/java/cc/hiver/core/shopprint/entity/ShopPrint.java @@ -0,0 +1,39 @@ +package cc.hiver.core.shopprint.entity; + +import cc.hiver.core.base.HiverBaseEntity; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; + +import javax.persistence.Entity; +import javax.persistence.Table; + +/** + * @ClassName:ShopPrint + * @Author: qiaohui + * @Date: 2024/10/22 21:50 + * @Description: 必须描述类做什么事情, 实现什么功能 + */ +@Data +@Entity +@DynamicInsert +@DynamicUpdate +@Table(name = "t_shop_print") +@TableName("t_department") +@ApiModel(value = "部门") +public class ShopPrint extends HiverBaseEntity { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "打印名称") + private String printName; + + @ApiModelProperty(value = "商铺ID") + private String shopId; + + @ApiModelProperty(value = "打印具体内容") + private String content; +} diff --git a/hiver-core/src/main/java/cc/hiver/core/shopprint/mapper/ShopPrintMapper.java b/hiver-core/src/main/java/cc/hiver/core/shopprint/mapper/ShopPrintMapper.java new file mode 100644 index 00000000..d4142fb9 --- /dev/null +++ b/hiver-core/src/main/java/cc/hiver/core/shopprint/mapper/ShopPrintMapper.java @@ -0,0 +1,25 @@ +package cc.hiver.core.shopprint.mapper; + +import cc.hiver.core.logisticsaddressbook.entity.LogisticsAddressBook; +import cc.hiver.core.logisticsaddressbook.vo.LogisticsAddressBookQueryVo; +import cc.hiver.core.logisticscompanyroute.entity.LogisticsCompanyRoute; +import cc.hiver.core.logisticscompanyroute.vo.LogisticsCompanyRouteQueryVo; +import cc.hiver.core.logisticsroute.entity.LogisticsRoute; +import cc.hiver.core.logisticsroute.vo.LogisticsRouteQueryVo; +import cc.hiver.core.shopprint.entity.ShopPrint; +import cc.hiver.core.shopprint.vo.ShopPrintQueryVo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +@Mapper +public interface ShopPrintMapper extends BaseMapper { + + + + List getShopPrintList(@Param("queryParams") ShopPrintQueryVo shopPrintQueryVo); +} + diff --git a/hiver-core/src/main/java/cc/hiver/core/shopprint/service/ShopPrintService.java b/hiver-core/src/main/java/cc/hiver/core/shopprint/service/ShopPrintService.java new file mode 100644 index 00000000..b5e61d94 --- /dev/null +++ b/hiver-core/src/main/java/cc/hiver/core/shopprint/service/ShopPrintService.java @@ -0,0 +1,13 @@ +package cc.hiver.core.shopprint.service; + +import cc.hiver.core.shopprint.entity.ShopPrint; +import cc.hiver.core.shopprint.vo.ShopPrintQueryVo; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +public interface ShopPrintService extends IService { + + + List getShopPrintList(ShopPrintQueryVo shopPrintQueryVo); +} diff --git a/hiver-core/src/main/java/cc/hiver/core/shopprint/service/impl/ShopPrintServiceImpl.java b/hiver-core/src/main/java/cc/hiver/core/shopprint/service/impl/ShopPrintServiceImpl.java new file mode 100644 index 00000000..d8bbf00e --- /dev/null +++ b/hiver-core/src/main/java/cc/hiver/core/shopprint/service/impl/ShopPrintServiceImpl.java @@ -0,0 +1,36 @@ +package cc.hiver.core.shopprint.service.impl; + +import cc.hiver.core.logisticsroute.mapper.LogisticsRouteMapper; +import cc.hiver.core.logisticsroute.service.LogisticsRouteService; +import cc.hiver.core.logisticsuser.entity.LogisticsUser; +import cc.hiver.core.logisticsuser.mapper.LogisticsUserMapper; +import cc.hiver.core.logisticsuser.service.LogisticsUserService; +import cc.hiver.core.shopprint.entity.ShopPrint; +import cc.hiver.core.shopprint.mapper.ShopPrintMapper; +import cc.hiver.core.shopprint.service.ShopPrintService; +import cc.hiver.core.shopprint.vo.ShopPrintQueryVo; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @ClassName:ShopPrintServiceImpl + * @Author: qiaohui + * @Date: 2024/10/22 22:01 + * @Description: + */ +@Service +public class ShopPrintServiceImpl extends ServiceImpl implements ShopPrintService { + + @Autowired + private ShopPrintMapper shopPrintMapper; + + @Override + public List getShopPrintList(ShopPrintQueryVo shopPrintQueryVo){ + return shopPrintMapper.getShopPrintList(shopPrintQueryVo); + } + +} diff --git a/hiver-core/src/main/java/cc/hiver/core/shopprint/vo/ShopPrintQueryVo.java b/hiver-core/src/main/java/cc/hiver/core/shopprint/vo/ShopPrintQueryVo.java new file mode 100644 index 00000000..e13d139b --- /dev/null +++ b/hiver-core/src/main/java/cc/hiver/core/shopprint/vo/ShopPrintQueryVo.java @@ -0,0 +1,10 @@ +package cc.hiver.core.shopprint.vo; + +/** + * @ClassName:ShopPrintQueryVo + * @Author: qiaohui + * @Date: 2024/10/22 21:59 + * @Description: 必须描述类做什么事情, 实现什么功能 + */ +public class ShopPrintQueryVo { +} diff --git a/hiver-core/src/main/resources/mapper/ShopPrintMapper.xml b/hiver-core/src/main/resources/mapper/ShopPrintMapper.xml new file mode 100644 index 00000000..aecd56ad --- /dev/null +++ b/hiver-core/src/main/resources/mapper/ShopPrintMapper.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file