diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java b/blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java index 3439f30cc..ee49ea2ed 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java @@ -8,7 +8,7 @@ public interface ModuleNameConstant { /** * 如果不需要 "" */ - public static final String DEVAUTH =""; + public static final String DEVAUTH ="-chenlong"; /** * 工厂对接服务名称 diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/controller/StockOutDetailController.java b/blade-service/logpm-report/src/main/java/com/logpm/report/controller/StockOutDetailController.java new file mode 100644 index 000000000..cea6f79a1 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/controller/StockOutDetailController.java @@ -0,0 +1,39 @@ +package com.logpm.report.controller; + +import com.logpm.report.service.StockOutDetailService; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; +import java.util.Map; + +/** + * 库存品出库明细 + */ +@RestController +@AllArgsConstructor +@RequestMapping(path = "/stock-out-detail") +public class StockOutDetailController extends BladeController { + + private StockOutDetailService test; + + /** + * 报表数据 + * @param query 所有请求参数 + * @param current 当前页 + * @param size 每页数据量 + */ + @GetMapping("/report") + public R>> report( + @RequestParam Map query, + @RequestParam Integer current, + @RequestParam Integer size){ + List> data = test.report(current, size, query); + return data(data); + } +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/StockOutDetailMapper.java b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/StockOutDetailMapper.java new file mode 100644 index 000000000..b585848a4 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/StockOutDetailMapper.java @@ -0,0 +1,17 @@ +package com.logpm.report.mapper; + +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 库存出库明细 + */ +@Mapper +public interface StockOutDetailMapper { + + List> getList(Map where); + + Integer getCount(Map where); +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/StockOutDetailMapper.xml b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/StockOutDetailMapper.xml new file mode 100644 index 000000000..0a281a4d2 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/StockOutDetailMapper.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + FROM logpm_distribution_stock a + INNER JOIN logpm_warehouse_goods_allocation b ON a.allocation_id = b.id AND b.is_deleted = 0 + INNER JOIN logpm_warehouse_warehouse w ON w.id = b.warehouse_id AND w.is_deleted = 0 + INNER JOIN logpm_distribution_stock_list_info c ON c.package_code = a.coding AND c.is_deleted = 0 + INNER JOIN logpm_basicdata_material m ON m.id = c.material_id AND c.is_deleted = 0 + INNER JOIN logpm_distribution_signfor d + ON d.reservation_id = a.reservation_id AND a.outbound_type IN (1, 2) AND d.is_deleted = 0 + INNER JOIN logpm_distribution_delivery_list e ON e.id = d.delivery_id AND e.is_deleted = 0 + INNER JOIN logpm_distribution_reservation r ON r.id = d.reservation_id AND r.is_deleted = 0 + + + + WHERE 1 = 1 + + AND b.warehouse_id = #{warehouse_id} + + + AND c.market_name LIKE CONCAT('%', #{market_name} , '%') + + + AND e.note_number = #{note_number} + + + AND a.reservation_code = #{reservation_code} + + + AND r.consignee LIKE CONCAT('%', #{client_name}, '%') + + + + diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/StockOutDetailService.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/StockOutDetailService.java new file mode 100644 index 000000000..bbfcc9c31 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/StockOutDetailService.java @@ -0,0 +1,9 @@ +package com.logpm.report.service; + +import java.util.List; +import java.util.Map; + +public interface StockOutDetailService { + + List> report(Integer current, Integer size, Map where); +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/StockOutDetailServiceImp.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/StockOutDetailServiceImp.java new file mode 100644 index 000000000..01edf7b54 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/StockOutDetailServiceImp.java @@ -0,0 +1,49 @@ +package com.logpm.report.service.impl; + +import com.logpm.report.mapper.StockOutDetailMapper; +import com.logpm.report.service.StockOutDetailService; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 库存品出口明细报表 + */ +@Service +@AllArgsConstructor +public class StockOutDetailServiceImp implements StockOutDetailService { + + private StockOutDetailMapper testMapper; + + /** + * 报表统计信息 + * + * @param current 当前页 + * @param size 每页大小 + * @param query 所有的query参数 + * @return 查询结果 + */ + @Override + public List> report(Integer current, Integer size, Map query) { + Integer offset = (current - 1) * size; + boolean getCacheCount = true; + long whereCount = query.entrySet().stream().filter((entry) -> entry.getValue() != null) + .filter(entry -> !entry.getKey().equals("current") && !entry.getKey().equals("size")) + .count(); + if (whereCount > 0) { + getCacheCount = false; + } + + query.put("offset", offset); + query.put("size", size); + + List> List = testMapper.getList(query); + Integer count = testMapper.getCount(query); + + return List; + } +} diff --git a/blade-service/logpm-report/src/main/resources/application-dev.yml b/blade-service/logpm-report/src/main/resources/application-dev.yml index 3db9ae091..3848e6af9 100644 --- a/blade-service/logpm-report/src/main/resources/application-dev.yml +++ b/blade-service/logpm-report/src/main/resources/application-dev.yml @@ -32,7 +32,8 @@ spring: #validation-query: select 1 from dual url: ${blade.datasource.report.master.url} username: ${blade.datasource.report.master.username} - password: ${blade.datasource.report.master.password} +# password: ${blade.datasource.report.master.password} + password: Hwy@1234 slave: druid: #独立校验配置 @@ -41,5 +42,6 @@ spring: #validation-query: select 1 from dual url: ${blade.datasource.report.slave.url} username: ${blade.datasource.report.slave.username} - password: ${blade.datasource.report.slave.password} +# password: ${blade.datasource.report.slave.password} + password: Hwy@1234