From 398c44843dc31536eb1fd137974da170d41cc5b7 Mon Sep 17 00:00:00 2001 From: huangqizhen Date: Tue, 3 Dec 2024 17:41:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E7=AB=AF=E6=A1=86=E6=9E=B6=E7=AC=AC?= =?UTF-8?q?=E4=BA=8C=E7=89=88=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/audit/pom.xml | 2 +- .../java/com/example/audit/AuditApplication.java | 2 + .../java/com/example/audit/mapper/AuditMapper.java | 9 ++- .../com/example/commons/domain/entity/Audit.java | 1 + .../com/example/commons/domain/entity/Detail.java | 5 +- .../example/commons/domain/vo/ConsumeDetail.java | 1 + .../com/example/commons/domain/vo/RechargeVo.java | 1 + .../com/example/commons/sevice/ProductService.java | 6 +- .../example/commons/sevice/RechargeService.java | 2 + demo/recharge/pom.xml | 12 ++++ .../com/example/recharge/RechargeApplication.java | 2 + .../example/recharge/mapper/ActivityMapper.java | 4 +- .../example/recharge/mapper/RechargeMapper.java | 7 ++- .../recharge/service/RechargeServiceImpl.java | 71 +++++++++++++++++++++- .../example/statistics/StatisticsApplication.java | 2 + .../example/statistics/mapper/DetailMapper.java | 22 ++++--- .../statistics/service/DetailServiceImpl.java | 2 +- .../example/user/controller/ProductController.java | 25 ++++++++ .../com/example/user/mapper/ProductMapper.java | 15 +++++ .../example/user/service/ProductServiceImpl.java | 16 ++++- 20 files changed, 182 insertions(+), 25 deletions(-) create mode 100644 demo/user/src/main/java/com/example/user/controller/ProductController.java create mode 100644 demo/user/src/main/java/com/example/user/mapper/ProductMapper.java diff --git a/demo/audit/pom.xml b/demo/audit/pom.xml index 4dfef45..64850ed 100644 --- a/demo/audit/pom.xml +++ b/demo/audit/pom.xml @@ -5,7 +5,7 @@ com.example audit - 0.0.1-SNAPSHOT + 0.0.1 audit audit diff --git a/demo/audit/src/main/java/com/example/audit/AuditApplication.java b/demo/audit/src/main/java/com/example/audit/AuditApplication.java index 334f5b8..58d3bbf 100644 --- a/demo/audit/src/main/java/com/example/audit/AuditApplication.java +++ b/demo/audit/src/main/java/com/example/audit/AuditApplication.java @@ -1,9 +1,11 @@ package com.example.audit; +import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication +@MapperScan("com.example.**.mapper") public class AuditApplication { public static void main(String[] args) { diff --git a/demo/audit/src/main/java/com/example/audit/mapper/AuditMapper.java b/demo/audit/src/main/java/com/example/audit/mapper/AuditMapper.java index fb6e75b..c386ae7 100644 --- a/demo/audit/src/main/java/com/example/audit/mapper/AuditMapper.java +++ b/demo/audit/src/main/java/com/example/audit/mapper/AuditMapper.java @@ -14,15 +14,18 @@ public interface AuditMapper { @Insert({ "INSERT INTO audit", - "(jwcode,recharge_id,refund_id,name,status,auditFlag)", + "(jwcode,recharge_id,refund_id,admin_id,reson,detail_id,status,audit_flag)", "values", - "(#{jwcode},#{rechargeId},#{refundId},#{name},0,1)" + "(#{jwcode},#{rechargeId},#{refundId},#{adminId},#{reson},#{detailId},0,1)" }) + int insert(Audit audit); @Update({ "" diff --git a/demo/statistics/src/main/java/com/example/statistics/service/DetailServiceImpl.java b/demo/statistics/src/main/java/com/example/statistics/service/DetailServiceImpl.java index d7e104e..0b5dbb1 100644 --- a/demo/statistics/src/main/java/com/example/statistics/service/DetailServiceImpl.java +++ b/demo/statistics/src/main/java/com/example/statistics/service/DetailServiceImpl.java @@ -37,7 +37,7 @@ public class DetailServiceImpl implements DetailService { @Override public List getAllDetail(Detail detail) { - return List.of(); + return detailMapper.select(detail); } diff --git a/demo/user/src/main/java/com/example/user/controller/ProductController.java b/demo/user/src/main/java/com/example/user/controller/ProductController.java new file mode 100644 index 0000000..3c9649e --- /dev/null +++ b/demo/user/src/main/java/com/example/user/controller/ProductController.java @@ -0,0 +1,25 @@ +package com.example.user.controller; + +import com.example.commons.domain.entity.Product; +import com.example.commons.domain.entity.User; +import com.example.commons.domain.vo.Result; +import com.example.commons.sevice.ProductService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import java.util.Arrays; + +@RestController +@RequestMapping("/product") +@RequiredArgsConstructor +@Slf4j +@CrossOrigin +public class ProductController { + private final ProductService productService; + @PostMapping + public Result Product(@RequestBody Product product){ + return Result.success(productService.findAll(product)); + } +} + diff --git a/demo/user/src/main/java/com/example/user/mapper/ProductMapper.java b/demo/user/src/main/java/com/example/user/mapper/ProductMapper.java new file mode 100644 index 0000000..2d057d6 --- /dev/null +++ b/demo/user/src/main/java/com/example/user/mapper/ProductMapper.java @@ -0,0 +1,15 @@ +package com.example.user.mapper; + +import com.example.commons.domain.entity.Product; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +@Mapper +public interface ProductMapper { + @Select({ + "select * from product" + }) + public List findAll(Product product); +} diff --git a/demo/user/src/main/java/com/example/user/service/ProductServiceImpl.java b/demo/user/src/main/java/com/example/user/service/ProductServiceImpl.java index fbdb468..8995cde 100644 --- a/demo/user/src/main/java/com/example/user/service/ProductServiceImpl.java +++ b/demo/user/src/main/java/com/example/user/service/ProductServiceImpl.java @@ -1,5 +1,19 @@ package com.example.user.service; -public class ProductServiceImpl { +import com.example.commons.domain.entity.Product; +import com.example.commons.sevice.ProductService; +import com.example.user.mapper.ProductMapper; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import java.util.List; + +@Service +@RequiredArgsConstructor +public class ProductServiceImpl implements ProductService { + private final ProductMapper productMapper; + @Override + public List findAll(Product product) { + return productMapper.findAll(product); + } }