Commit b739bbf2dedb228c3f08592e161e5a93d3869b21
1 parent
e4b36074
feature商品修改
Showing
4 changed files
with
40 additions
and
80 deletions
ereport-core/src/main/java/com/diligrp/etrade/report/controller/StatController.java
1 | 1 | package com.diligrp.etrade.report.controller; |
2 | 2 | |
3 | 3 | import com.diligrp.etrade.core.domain.PageMessage; |
4 | -import com.diligrp.etrade.report.domain.co.*; | |
5 | -import com.diligrp.etrade.report.domain.message.*; | |
6 | -import com.diligrp.etrade.report.domain.vo.*; | |
4 | +import com.diligrp.etrade.report.domain.co.BusinessFlowCO; | |
5 | +import com.diligrp.etrade.report.domain.co.CategoriesBusinessCO; | |
6 | +import com.diligrp.etrade.report.domain.co.SellerBusinessCO; | |
7 | +import com.diligrp.etrade.report.domain.message.BusinessFlowPageMessage; | |
8 | +import com.diligrp.etrade.report.domain.message.CategoriesBusinessPageMessage; | |
9 | +import com.diligrp.etrade.report.domain.message.SellerBusinessPageMessage; | |
10 | +import com.diligrp.etrade.report.domain.vo.BusinessFlowVO; | |
11 | +import com.diligrp.etrade.report.domain.vo.SellerBusinessVO; | |
7 | 12 | import com.diligrp.etrade.report.service.StatService; |
8 | 13 | import jakarta.annotation.Resource; |
9 | 14 | import org.springframework.validation.annotation.Validated; |
... | ... | @@ -56,52 +61,4 @@ public class StatController { |
56 | 61 | public CategoriesBusinessPageMessage categoriesBusiness(@Validated @RequestBody CategoriesBusinessCO co) { |
57 | 62 | return statService.categoriesBusiness(co); |
58 | 63 | } |
59 | - | |
60 | - /** | |
61 | - * 卖方进分销 | |
62 | - * | |
63 | - * @param co 一氧化碳 | |
64 | - * @return {@link PageMessage}<{@link SellerDistributionVO}> | |
65 | - */ | |
66 | - @PostMapping("sellerDistribution") | |
67 | - public SellerDistributionPageMessage sellerDistribution(@Validated @RequestBody SellerDistributionCO co) { | |
68 | - return statService.sellerDistribution(co); | |
69 | - } | |
70 | - | |
71 | - | |
72 | - /** | |
73 | - * 分货 | |
74 | - * | |
75 | - * @param co 一氧化碳 | |
76 | - * @return {@link PageMessage}<{@link EntranceDivideStatStatDTO}> | |
77 | - */ | |
78 | - @PostMapping("divideGoods") | |
79 | - public DivideGoodsPageMessage divideGoods(@Validated @RequestBody DivideGoodsCO co) { | |
80 | - return statService.divideGoods(co); | |
81 | - } | |
82 | - | |
83 | - /** | |
84 | - * 分销和销售 | |
85 | - * | |
86 | - * @param co 一氧化碳 | |
87 | - * @return {@link PageMessage}<{@link EntranceDivideStatStatDTO}> | |
88 | - */ | |
89 | - @PostMapping("distributionAndSales") | |
90 | - public DistributionAndSalesPageMessage distributionAndSales(@Validated @RequestBody DistributionAndSalesCO co) { | |
91 | - return statService.distributionAndSales(co); | |
92 | - } | |
93 | - | |
94 | - | |
95 | - /** | |
96 | - * 库存统计 | |
97 | - * | |
98 | - * @param co 一氧化碳 | |
99 | - * @return {@link PageMessage}<{@link InventoryStatVO}> | |
100 | - */ | |
101 | - @PostMapping("inventoryStat") | |
102 | - public InventoryPageMessage inventoryStat(@Validated @RequestBody InventoryStatCO co) { | |
103 | - return statService.inventoryStat(co); | |
104 | - } | |
105 | - | |
106 | - | |
107 | 64 | } | ... | ... |
ereport-core/src/main/java/com/diligrp/etrade/report/domain/message/BusinessFlowPageMessage.java
... | ... | @@ -2,6 +2,7 @@ package com.diligrp.etrade.report.domain.message; |
2 | 2 | |
3 | 3 | import com.diligrp.etrade.core.domain.PageMessage; |
4 | 4 | import com.diligrp.etrade.core.jackson.serializer.MoneyF2YJsonSerializer; |
5 | +import com.diligrp.etrade.core.jackson.serializer.PieceSerializer; | |
5 | 6 | import com.diligrp.etrade.report.constant.NumberConstant; |
6 | 7 | import com.diligrp.etrade.report.domain.vo.BusinessFlowVO; |
7 | 8 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
... | ... | @@ -10,6 +11,7 @@ public class BusinessFlowPageMessage extends PageMessage<BusinessFlowVO> { |
10 | 11 | /** |
11 | 12 | *订单商品总重量 单位斤 |
12 | 13 | */ |
14 | + @JsonSerialize(using = PieceSerializer.class) | |
13 | 15 | private Long totalProductWeight; |
14 | 16 | |
15 | 17 | /** | ... | ... |
ereport-core/src/main/java/com/diligrp/etrade/report/service/impl/StatServiceImpl.java
... | ... | @@ -35,17 +35,17 @@ public class StatServiceImpl implements StatService { |
35 | 35 | PageHelper.startPage(co.getPageNo(), co.getPageSize()); |
36 | 36 | List<BusinessFlowVO> list = statMapper.queryBusinessFlow(co); |
37 | 37 | BusinessFlowPageMessage message = statMapper.querySumBusinessFlow(co); |
38 | - list.forEach(e->{ | |
39 | - CustomerDto customerDto = rpcExecutor.getByCustomerId(e.getShopCustomerId()); | |
40 | - e.setSellerName(customerDto.getName()); | |
41 | - e.setSellerCode(customerDto.getCode()); | |
42 | - e.setSellerCardNo(e.getShopCardNo()); | |
43 | - if (!ObjectUtils.isEmpty(e.getBuyerId())){ | |
44 | - CustomerDto buyer = rpcExecutor.getByCustomerId(e.getBuyerId()); | |
45 | - e.setBuyerName(buyer.getName()); | |
46 | - e.setBuyerCode(buyer.getCode()); | |
47 | - } | |
48 | - }); | |
38 | +// list.forEach(e->{ | |
39 | +// CustomerDto customerDto = rpcExecutor.getByCustomerId(e.getShopCustomerId()); | |
40 | +// e.setSellerName(customerDto.getName()); | |
41 | +// e.setSellerCode(customerDto.getCode()); | |
42 | +// e.setSellerCardNo(e.getShopCardNo()); | |
43 | +// if (!ObjectUtils.isEmpty(e.getBuyerId())){ | |
44 | +// CustomerDto buyer = rpcExecutor.getByCustomerId(e.getBuyerId()); | |
45 | +// e.setBuyerName(buyer.getName()); | |
46 | +// e.setBuyerCode(buyer.getCode()); | |
47 | +// } | |
48 | +// }); | |
49 | 49 | PageInfo<BusinessFlowVO> pageInfo = new PageInfo<>(list); |
50 | 50 | return PageMessage.success(message,pageInfo,list,BusinessFlowPageMessage.class); |
51 | 51 | } |
... | ... | @@ -56,9 +56,6 @@ public class StatServiceImpl implements StatService { |
56 | 56 | List<SellerBusinessVO> list = statMapper.querySellerBusiness(co); |
57 | 57 | SellerBusinessPageMessage message = statMapper.querySumSellerBusiness(co); |
58 | 58 | list.forEach(e -> { |
59 | - CustomerDto customerDto = rpcExecutor.getByCustomerId(e.getCustomId()); | |
60 | - e.setCustomName(customerDto.getName()); | |
61 | - e.setCustomCode(customerDto.getCode()); | |
62 | 59 | CusCategoryDTO cusCategory = rpcExecutor.getCusCategory(co.getMarketId(), e.getCategoryId()); |
63 | 60 | e.setProductName(cusCategory.getAlias()); |
64 | 61 | }); | ... | ... |
ereport-core/src/main/resources/com/diligrp/etrade/dao/mapper/StatMapper.xml
... | ... | @@ -11,9 +11,9 @@ |
11 | 11 | ,buyerCode |
12 | 12 | ,sellerName |
13 | 13 | ,sellerCode |
14 | + ,sellerCardNo | |
14 | 15 | ,buyerId |
15 | 16 | ,productName |
16 | - ,shopCardNo | |
17 | 17 | ,shopCustomerId |
18 | 18 | ,productTradeType |
19 | 19 | ,buyerCardNo |
... | ... | @@ -31,13 +31,13 @@ |
31 | 31 | , og.product_pieces AS productPieces |
32 | 32 | , o.pay_time AS payTime |
33 | 33 | , og.product_weight AS productWeight |
34 | - , o.buyer_name AS buyerName | |
35 | - , o.buyer_code AS buyerCode | |
36 | - , o.seller_name AS sellerName | |
37 | - , s.customer_code AS sellerCode | |
34 | + , bc.name AS buyerName | |
35 | + , bc.code AS buyerCode | |
36 | + , c.name AS sellerName | |
37 | + , c.code AS sellerCode | |
38 | + , o.shop_card_no AS sellerCardNo | |
38 | 39 | , o.buyer_id AS buyerId |
39 | 40 | , p.`alias` AS productName |
40 | - , o.shop_card_no AS shopCardNo | |
41 | 41 | , o.shop_customer_id AS shopCustomerId |
42 | 42 | , og.product_trade_type AS productTradeType |
43 | 43 | , o.buyer_card_no AS buyerCardNo |
... | ... | @@ -55,6 +55,8 @@ |
55 | 55 | LEFT JOIN `zr_etrade`.`product` p ON og.product_id = p.id |
56 | 56 | LEFT JOIN `zr_etrade`.`shop` s ON s.id = o.shop_id |
57 | 57 | LEFT JOIN `zr_etrade`.`store_employee` se ON se.id = o.seller_id |
58 | + LEFT JOIN `dili-customer`.`customer` c ON o.shop_customer_id = c.id | |
59 | + LEFT JOIN `dili-customer`.`customer` bc ON o.buyer_id = bc.id | |
58 | 60 | WHERE 1=1 |
59 | 61 | AND o.state IN (3,5) |
60 | 62 | AND o.order_status IS NULL |
... | ... | @@ -96,13 +98,13 @@ |
96 | 98 | , og.product_pieces AS productPieces |
97 | 99 | , o.pay_time AS payTime |
98 | 100 | , og.product_weight AS productWeight |
99 | - , o.buyer_name AS buyerName | |
100 | - , o.buyer_code AS buyerCode | |
101 | - , o.seller_name AS sellerName | |
102 | - , s.customer_code AS sellerCode | |
101 | + , bc.name AS buyerName | |
102 | + , bc.code AS buyerCode | |
103 | + , c.name AS sellerName | |
104 | + , c.code AS sellerCode | |
105 | + , o.shop_card_no AS sellerCardNo | |
103 | 106 | , o.buyer_id AS buyerId |
104 | 107 | , p.`alias` AS productName |
105 | - , o.shop_card_no AS shopCardNo | |
106 | 108 | , o.shop_customer_id AS shopCustomerId |
107 | 109 | , og.product_trade_type AS productTradeType |
108 | 110 | , o.buyer_card_no AS buyerCardNo |
... | ... | @@ -120,6 +122,8 @@ |
120 | 122 | LEFT JOIN `zr_etrade`.`product` p ON og.product_id = p.id |
121 | 123 | LEFT JOIN `zr_etrade`.`shop` s ON s.id = o.shop_id |
122 | 124 | LEFT JOIN `zr_etrade`.`store_employee` se ON se.id = o.seller_id |
125 | + LEFT JOIN `dili-customer`.`customer` c ON o.shop_customer_id = c.id | |
126 | + LEFT JOIN `dili-customer`.`customer` bc ON o.buyer_id = bc.id | |
123 | 127 | WHERE 1=1 |
124 | 128 | AND o.state =3 |
125 | 129 | AND o.order_status = 2 |
... | ... | @@ -213,7 +217,7 @@ |
213 | 217 | </if> |
214 | 218 | UNION ALL |
215 | 219 | SELECT |
216 | - og.product_weight AS productWeight | |
220 | + og.product_weight AS productWeight | |
217 | 221 | , og.product_pieces AS productPieces |
218 | 222 | , og.product_total_price AS productTotalPrice |
219 | 223 | , og.product_seller_fee AS productSellerFee |
... | ... | @@ -267,8 +271,8 @@ |
267 | 271 | ,SUM(businessWeight) AS businessWeight |
268 | 272 | ,shopName |
269 | 273 | ,districtName |
270 | - ,customName | |
271 | - ,customCode | |
274 | + ,c.name as customName | |
275 | + ,c.code as customCode | |
272 | 276 | ,shopId |
273 | 277 | ,customId |
274 | 278 | ,SUM(businessAmount) AS businessAmount |
... | ... | @@ -424,7 +428,7 @@ |
424 | 428 | <if test="statKeys != null and statKeys.contains('statKeyDistrict')"> |
425 | 429 | ,district |
426 | 430 | </if> |
427 | - ) t | |
431 | + ) t LEFT JOIN `dili-customer`.`customer` c on t.customId = c.id | |
428 | 432 | GROUP BY customId |
429 | 433 | <if test="statKeys != null and statKeys.contains('statKeyCategory')"> |
430 | 434 | ,categoryId | ... | ... |