소스 검색

店铺管理

yzc 1 년 전
부모
커밋
409196758c

+ 17 - 0
code/src/test/java/JushuitanDataSource.java

@@ -0,0 +1,17 @@
+import fly.generator.GeneratorApplication;
+
+public class JushuitanDataSource {
+
+    public static void main(String[] args) {
+        GeneratorApplication.builder()
+                .url(DataSourceInfo.URL)
+                .username(DataSourceInfo.USER_NAME)
+                .password(DataSourceInfo.PASSWORD)
+                .port(9989)
+                .module("hx-jushuitan")
+                .parent("com.fjhx.jushuitan")
+                .superServiceClass("com.ruoyi.common.core.service.BaseService")
+                .build();
+    }
+
+}

+ 5 - 0
hx-admin/pom.xml

@@ -99,6 +99,11 @@
         </dependency>
         </dependency>
 
 
         <dependency>
         <dependency>
+            <groupId>com.fjhx</groupId>
+            <artifactId>hx-jushuitan</artifactId>
+        </dependency>
+
+        <dependency>
             <groupId>org.springframework.boot</groupId>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-test</artifactId>
             <artifactId>spring-boot-starter-test</artifactId>
             <scope>test</scope>
             <scope>test</scope>

+ 22 - 0
hx-jushuitan/pom.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xmlns="http://maven.apache.org/POM/4.0.0"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>com.fjhx</groupId>
+        <artifactId>bytesailing</artifactId>
+        <version>1.0</version>
+    </parent>
+
+    <artifactId>hx-jushuitan</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.fjhx</groupId>
+            <artifactId>hx-base</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>

+ 71 - 0
hx-jushuitan/src/main/java/com/fjhx/jushuitan/controller/shop/ShopInfoController.java

@@ -0,0 +1,71 @@
+package com.fjhx.jushuitan.controller.shop;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.jushuitan.entity.shop.dto.ShopInfoDto;
+import com.fjhx.jushuitan.entity.shop.dto.ShopInfoSelectDto;
+import com.fjhx.jushuitan.entity.shop.vo.ShopInfoVo;
+import com.fjhx.jushuitan.service.shop.ShopInfoService;
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import org.springframework.beans.factory.annotation.Autowired;
+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;
+
+
+/**
+ * <p>
+ * 店铺管理 前端控制器
+ * </p>
+ *
+ * @author
+ * @since 2024-01-07
+ */
+@RestController
+@RequestMapping("/shopInfo")
+public class ShopInfoController {
+
+    @Autowired
+    private ShopInfoService shopInfoService;
+
+    /**
+     * 店铺管理分页
+     */
+    @PostMapping("/page")
+    public Page<ShopInfoVo> page(@RequestBody ShopInfoSelectDto dto) {
+        return shopInfoService.getPage(dto);
+    }
+
+    /**
+     * 店铺管理明细
+     */
+    @PostMapping("/detail")
+    public ShopInfoVo detail(@RequestBody BaseSelectDto dto) {
+        return shopInfoService.detail(dto.getId());
+    }
+
+    /**
+     * 店铺管理新增
+     */
+    @PostMapping("/add")
+    public void add(@RequestBody ShopInfoDto shopInfoDto) {
+        shopInfoService.add(shopInfoDto);
+    }
+
+    /**
+     * 店铺管理编辑
+     */
+    @PostMapping("/edit")
+    public void edit(@RequestBody ShopInfoDto shopInfoDto) {
+        shopInfoService.edit(shopInfoDto);
+    }
+
+    /**
+     * 店铺管理删除
+     */
+    @PostMapping("/delete")
+    public void delete(@RequestBody BaseSelectDto dto) {
+        shopInfoService.delete(dto.getId());
+    }
+
+}

+ 17 - 0
hx-jushuitan/src/main/java/com/fjhx/jushuitan/entity/shop/dto/ShopInfoDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.jushuitan.entity.shop.dto;
+
+import com.fjhx.jushuitan.entity.shop.po.ShopInfo;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * jushuitan_店铺管理新增编辑入参实体
+ *
+ * @author
+ * @since 2024-01-07
+ */
+@Getter
+@Setter
+public class ShopInfoDto extends ShopInfo {
+
+}

+ 17 - 0
hx-jushuitan/src/main/java/com/fjhx/jushuitan/entity/shop/dto/ShopInfoSelectDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.jushuitan.entity.shop.dto;
+
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * jushuitan_店铺管理列表查询入参实体
+ *
+ * @author
+ * @since 2024-01-07
+ */
+@Getter
+@Setter
+public class ShopInfoSelectDto extends BaseSelectDto {
+
+}

+ 36 - 0
hx-jushuitan/src/main/java/com/fjhx/jushuitan/entity/shop/po/ShopInfo.java

@@ -0,0 +1,36 @@
+package com.fjhx.jushuitan.entity.shop.po;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.ruoyi.common.core.domain.BasePo;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * jushuitan_店铺管理
+ * </p>
+ *
+ * @author
+ * @since 2024-01-07
+ */
+@Getter
+@Setter
+@TableName("shop_info")
+public class ShopInfo extends BasePo {
+
+    /**
+     * 店铺编号
+     */
+    private String code;
+
+    /**
+     * 店铺名称
+     */
+    private String name;
+
+    /**
+     * 部门id
+     */
+    private Long deptId;
+
+}

+ 22 - 0
hx-jushuitan/src/main/java/com/fjhx/jushuitan/entity/shop/vo/ShopInfoVo.java

@@ -0,0 +1,22 @@
+package com.fjhx.jushuitan.entity.shop.vo;
+
+import com.fjhx.jushuitan.entity.shop.po.ShopInfo;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * jushuitan_店铺管理列表查询返回值实体
+ *
+ * @author
+ * @since 2024-01-07
+ */
+@Getter
+@Setter
+public class ShopInfoVo extends ShopInfo {
+
+    /**
+     * 部门名称
+     */
+    private String deptName;
+
+}

+ 26 - 0
hx-jushuitan/src/main/java/com/fjhx/jushuitan/mapper/shop/ShopInfoMapper.java

@@ -0,0 +1,26 @@
+package com.fjhx.jushuitan.mapper.shop;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.jushuitan.entity.shop.po.ShopInfo;
+import com.fjhx.jushuitan.entity.shop.vo.ShopInfoVo;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import org.apache.ibatis.annotations.Param;
+
+
+/**
+ * <p>
+ * 店铺管理 Mapper 接口
+ * </p>
+ *
+ * @author
+ * @since 2024-01-07
+ */
+public interface ShopInfoMapper extends BaseMapper<ShopInfo> {
+
+    /**
+     * 店铺管理分页
+     */
+    Page<ShopInfoVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<ShopInfo> wrapper);
+
+}

+ 46 - 0
hx-jushuitan/src/main/java/com/fjhx/jushuitan/service/shop/ShopInfoService.java

@@ -0,0 +1,46 @@
+package com.fjhx.jushuitan.service.shop;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.jushuitan.entity.shop.dto.ShopInfoDto;
+import com.fjhx.jushuitan.entity.shop.dto.ShopInfoSelectDto;
+import com.fjhx.jushuitan.entity.shop.po.ShopInfo;
+import com.fjhx.jushuitan.entity.shop.vo.ShopInfoVo;
+import com.ruoyi.common.core.service.BaseService;
+
+
+/**
+ * <p>
+ * 店铺管理 服务类
+ * </p>
+ *
+ * @author
+ * @since 2024-01-07
+ */
+public interface ShopInfoService extends BaseService<ShopInfo> {
+
+    /**
+     * 店铺管理分页
+     */
+    Page<ShopInfoVo> getPage(ShopInfoSelectDto dto);
+
+    /**
+     * 店铺管理明细
+     */
+    ShopInfoVo detail(Long id);
+
+    /**
+     * 店铺管理新增
+     */
+    void add(ShopInfoDto shopInfoDto);
+
+    /**
+     * 店铺管理编辑
+     */
+    void edit(ShopInfoDto shopInfoDto);
+
+    /**
+     * 店铺管理删除
+     */
+    void delete(Long id);
+
+}

+ 66 - 0
hx-jushuitan/src/main/java/com/fjhx/jushuitan/service/shop/impl/ShopInfoServiceImpl.java

@@ -0,0 +1,66 @@
+package com.fjhx.jushuitan.service.shop.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.jushuitan.entity.shop.dto.ShopInfoDto;
+import com.fjhx.jushuitan.entity.shop.dto.ShopInfoSelectDto;
+import com.fjhx.jushuitan.entity.shop.po.ShopInfo;
+import com.fjhx.jushuitan.entity.shop.vo.ShopInfoVo;
+import com.fjhx.jushuitan.mapper.shop.ShopInfoMapper;
+import com.fjhx.jushuitan.service.shop.ShopInfoService;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import com.ruoyi.common.utils.wrapper.SqlField;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * <p>
+ * 店铺管理 服务实现类
+ * </p>
+ *
+ * @author
+ * @since 2024-01-07
+ */
+@Service
+public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> implements ShopInfoService {
+
+    @Override
+    public Page<ShopInfoVo> getPage(ShopInfoSelectDto dto) {
+        IWrapper<ShopInfo> wrapper = getWrapper();
+
+        //关键字检索
+        wrapper.keyword(dto.getKeyword(),
+                new SqlField(ShopInfo::getCode),
+                new SqlField(ShopInfo::getCode),
+                new SqlField("de", ShopInfoVo::getDeptName)
+        );
+
+        wrapper.orderByDesc("si", ShopInfo::getId);
+        Page<ShopInfoVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
+        return page;
+    }
+
+    @Override
+    public ShopInfoVo detail(Long id) {
+        ShopInfo ShopInfo = this.getById(id);
+        ShopInfoVo result = BeanUtil.toBean(ShopInfo, ShopInfoVo.class);
+        return result;
+    }
+
+    @Override
+    public void add(ShopInfoDto shopInfoDto) {
+        this.save(shopInfoDto);
+    }
+
+    @Override
+    public void edit(ShopInfoDto shopInfoDto) {
+        this.updateById(shopInfoDto);
+    }
+
+    @Override
+    public void delete(Long id) {
+        this.removeById(id);
+    }
+
+}

+ 19 - 0
hx-jushuitan/src/main/resources/mapper/shop/ShopInfoMapper.xml

@@ -0,0 +1,19 @@
+<?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.fjhx.jushuitan.mapper.shop.ShopInfoMapper">
+    <select id="getPage" resultType="com.fjhx.jushuitan.entity.shop.vo.ShopInfoVo">
+        select si.id,
+               si.code,
+               si.name,
+               si.dept_id,
+               si.create_user,
+               si.create_time,
+               si.update_user,
+               si.update_time,
+               de.dept_name
+        from shop_info si
+                 LEFT JOIN sys_dept de ON si.dept_id = de.dept_id
+            ${ew.customSqlSegment}
+    </select>
+
+</mapper>

+ 10 - 4
pom.xml

@@ -15,7 +15,6 @@
         <module>hx-admin</module>
         <module>hx-admin</module>
         <module>hx-customer</module>
         <module>hx-customer</module>
         <module>hx-ehsd</module>
         <module>hx-ehsd</module>
-<!--        <module>hx-iot</module>-->
         <module>hx-item</module>
         <module>hx-item</module>
         <module>hx-mail</module>
         <module>hx-mail</module>
         <module>hx-mes</module>
         <module>hx-mes</module>
@@ -26,10 +25,12 @@
         <module>hx-purchase</module>
         <module>hx-purchase</module>
         <module>hx-account</module>
         <module>hx-account</module>
         <module>hx-sale</module>
         <module>hx-sale</module>
-<!--        <module>hx-victoriatourist</module>-->
-        <!--        <module>hx-dingding</module>-->
         <module>hx-form</module>
         <module>hx-form</module>
-<!--        <module>hx-jxst</module>-->
+        <module>hx-jushuitan</module>
+        <!--        <module>hx-iot</module>-->
+        <!--        <module>hx-jxst</module>-->
+        <!--        <module>hx-victoriatourist</module>-->
+        <!--        <module>hx-dingding</module>-->
     </modules>
     </modules>
 
 
     <properties>
     <properties>
@@ -150,6 +151,11 @@
             <!--                <artifactId>hx-jxst</artifactId>-->
             <!--                <artifactId>hx-jxst</artifactId>-->
             <!--                <version>${hx.version}</version>-->
             <!--                <version>${hx.version}</version>-->
             <!--            </dependency>-->
             <!--            </dependency>-->
+            <dependency>
+                <groupId>com.fjhx</groupId>
+                <artifactId>hx-jushuitan</artifactId>
+                <version>${hx.version}</version>
+            </dependency>
 
 
         </dependencies>
         </dependencies>
     </dependencyManagement>
     </dependencyManagement>