forked from angelo/java-retail-app
				
			Compare commits
	
		
			171 Commits
		
	
	
		
			a28d4bf5a6
			...
			490346ee73
		
	
	| Author | SHA1 | Date | 
|---|---|---|
| 
							
							
								
								 | 
						490346ee73 | |
| 
							
							
								
								 | 
						1aabd75a4a | |
| 
							
							
								
								 | 
						e4ef3827c1 | |
| 
							
							
								
								 | 
						bb2d5a2879 | |
| 
							
							
								
								 | 
						cfa49da17c | |
| 
							
							
								
								 | 
						0bf3304399 | |
| 
							
							
								
								 | 
						215cdd89aa | |
| 
							
							
								
								 | 
						3d10722857 | |
| 
							
							
								
								 | 
						5a888a6563 | |
| 
							
							
								
								 | 
						4d963c9321 | |
| 
							
							
								
								 | 
						1f27fe9df6 | |
| 
							
							
								
								 | 
						ff3e274f06 | |
| 
							
							
								
								 | 
						572bb244ea | |
| 
							
							
								
								 | 
						8ad1f1a942 | |
| 
							
							
								
								 | 
						07e886c5c2 | |
| 
							
							
								
								 | 
						16060e0bad | |
| 
							
							
								
								 | 
						17b2bde043 | |
| 
							
							
								
								 | 
						d299b38890 | |
| 
							
							
								
								 | 
						08fdaf709f | |
| 
							
							
								
								 | 
						8665a3c606 | |
| 
							
							
								
								 | 
						fb6b2d1d00 | |
| 
							
							
								
								 | 
						6c1680b089 | |
| 
							
							
								
								 | 
						af4d056488 | |
| 
							
							
								
								 | 
						9838b92b8c | |
| 
							
							
								
								 | 
						83f6aa393b | |
| 
							
							
								
								 | 
						aa42aa0263 | |
| 
							
							
								
								 | 
						392f89bb95 | |
| 
							
							
								
								 | 
						b376571da2 | |
| 
							
							
								
								 | 
						5e65591b8b | |
| 
							
							
								
								 | 
						9ed8555c10 | |
| 
							
							
								
								 | 
						da72754346 | |
| 
							
							
								
								 | 
						7f629705ab | |
| 
							
							
								
								 | 
						2d917202e4 | |
| 
							
							
								
								 | 
						8d95d51c27 | |
| 
							
							
								
								 | 
						bc16275050 | |
| 
							
							
								
								 | 
						671d8f112a | |
| 
							
							
								
								 | 
						18fe81305d | |
| 
							
							
								
								 | 
						b1e16744e2 | |
| 
							
							
								
								 | 
						efa0bc7279 | |
| 
							
							
								
								 | 
						ddec95414b | |
| 
							
							
								
								 | 
						93959a13d5 | |
| 
							
							
								
								 | 
						f018490660 | |
| 
							
							
								
								 | 
						a59eb25a3d | |
| 
							
							
								
								 | 
						12ccce74df | |
| 
							
							
								
								 | 
						5f8fe35ae2 | |
| 
							
							
								
								 | 
						f64bcf113f | |
| 
							
							
								
								 | 
						77ea53b875 | |
| 
							
							
								
								 | 
						4819485594 | |
| 
							
							
								
								 | 
						8f2e7e34fd | |
| 
							
							
								
								 | 
						b9e3491a76 | |
| 
							
							
								
								 | 
						f1f49ad964 | |
| 
							
							
								
								 | 
						d2448f09ba | |
| 
							
							
								
								 | 
						efd9c97929 | |
| 
							
							
								
								 | 
						71e7ef8242 | |
| 
							
							
								
								 | 
						999d64d007 | |
| 
							
							
								
								 | 
						3ca75b73a8 | |
| 
							
							
								
								 | 
						cef8a8889f | |
| 
							
							
								
								 | 
						73d1983528 | |
| 
							
							
								
								 | 
						2620930edf | |
| 
							
							
								
								 | 
						543cd96dec | |
| 
							
							
								
								 | 
						a4b8ef1931 | |
| 
							
							
								 | 
						cb93e84848 | |
| 
							
							
								 | 
						ef2cddc0d4 | |
| 
							
							
								 | 
						13218221d4 | |
| 
							
							
								 | 
						76c41feed5 | |
| 
							
							
								
								 | 
						5211181e31 | |
| 
							
							
								
								 | 
						b144ccbbd6 | |
| 
							
							
								
								 | 
						22963fd03c | |
| 
							
							
								
								 | 
						50b9786a33 | |
| 
							
							
								
								 | 
						1fb5f11470 | |
| 
							
							
								
								 | 
						45030e2077 | |
| 
							
							
								
								 | 
						25337ae93c | |
| 
							
							
								
								 | 
						f5886af09f | |
| 
							
							
								
								 | 
						04ca926570 | |
| 
							
							
								
								 | 
						76fcb536af | |
| 
							
							
								
								 | 
						9c9bbec06d | |
| 
							
							
								
								 | 
						385aef745d | |
| 
							
							
								
								 | 
						e2f34dd4ad | |
| 
							
							
								
								 | 
						7c3517bfa8 | |
| 
							
							
								
								 | 
						fe3fec9ba2 | |
| 
							
							
								 | 
						8a2f9f6467 | |
| 
							
							
								
								 | 
						f4562d46e8 | |
| 
							
							
								
								 | 
						4d06e04dc3 | |
| 
							
							
								
								 | 
						7fe6c4998e | |
| 
							
							
								 | 
						bc845181a5 | |
| 
							
							
								
								 | 
						ae2b7703a6 | |
| 
							
							
								
								 | 
						4a890936db | |
| 
							
							
								
								 | 
						bd50d74fb5 | |
| 
							
							
								
								 | 
						25e6739f06 | |
| 
							
							
								
								 | 
						1bdedf3e0d | |
| 
							
							
								
								 | 
						83d48fa99d | |
| 
							
							
								
								 | 
						a43f571940 | |
| 
							
							
								
								 | 
						3566191943 | |
| 
							
							
								
								 | 
						975b419cf9 | |
| 
							
							
								
								 | 
						979970fefe | |
| 
							
							
								
								 | 
						8b5da3c010 | |
| 
							
							
								
								 | 
						e1cc436284 | |
| 
							
							
								
								 | 
						a2d787d09f | |
| 
							
							
								
								 | 
						f017daaf64 | |
| 
							
							
								
								 | 
						957624ac96 | |
| 
							
							
								
								 | 
						5b13979b08 | |
| 
							
							
								
								 | 
						65b789561f | |
| 
							
							
								
								 | 
						d0ff900099 | |
| 
							
							
								
								 | 
						b67683a1c7 | |
| 
							
							
								
								 | 
						f59bb9000e | |
| 
							
							
								
								 | 
						ccbf6d1b37 | |
| 
							
							
								
								 | 
						a3e141de80 | |
| 
							
							
								
								 | 
						0d88669404 | |
| 
							
							
								
								 | 
						0f4b362a4b | |
| 
							
							
								
								 | 
						ba92fa8d68 | |
| 
							
							
								
								 | 
						e6cc920354 | |
| 
							
							
								
								 | 
						47281e4d6a | |
| 
							
							
								
								 | 
						f17367b2c1 | |
| 
							
							
								
								 | 
						8d941689d5 | |
| 
							
							
								
								 | 
						b70b873412 | |
| 
							
							
								
								 | 
						71e42c3311 | |
| 
							
							
								
								 | 
						8f1c7c8c14 | |
| 
							
							
								
								 | 
						884b8665c7 | |
| 
							
							
								
								 | 
						6e047194ce | |
| 
							
							
								
								 | 
						36d83f378a | |
| 
							
							
								
								 | 
						6263f4e9ab | |
| 
							
							
								
								 | 
						18def4fffc | |
| 
							
							
								
								 | 
						972d18549e | |
| 
							
							
								
								 | 
						1e0d0989c7 | |
| 
							
							
								
								 | 
						121dbc52ba | |
| 
							
							
								
								 | 
						7792dc47f0 | |
| 
							
							
								
								 | 
						cca882d4c8 | |
| 
							
							
								
								 | 
						7105312311 | |
| 
							
							
								
								 | 
						3fa3725101 | |
| 
							
							
								
								 | 
						90bab6aebd | |
| 
							
							
								
								 | 
						b9d073f8be | |
| 
							
							
								
								 | 
						31492704c5 | |
| 
							
							
								
								 | 
						b9f2c0884a | |
| 
							
							
								
								 | 
						712fda3fdf | |
| 
							
							
								
								 | 
						7c267b2444 | |
| 
							
							
								
								 | 
						59216b24d5 | |
| 
							
							
								
								 | 
						c902b720c2 | |
| 
							
							
								
								 | 
						b9472479cc | |
| 
							
							
								
								 | 
						443dbbe4b8 | |
| 
							
							
								
								 | 
						1df74dedba | |
| 
							
							
								
								 | 
						1ee7f13ca1 | |
| 
							
							
								
								 | 
						4e813f17b9 | |
| 
							
							
								
								 | 
						9b225459a0 | |
| 
							
							
								
								 | 
						1814abf5f9 | |
| 
							
							
								
								 | 
						8b9f461c20 | |
| 
							
							
								
								 | 
						f4ef2a9326 | |
| 
							
							
								
								 | 
						d0781ce37a | |
| 
							
							
								
								 | 
						3ebcfca6f7 | |
| 
							
							
								
								 | 
						e1943603de | |
| 
							
							
								
								 | 
						8ba98c5118 | |
| 
							
							
								
								 | 
						7819281f53 | |
| 
							
							
								
								 | 
						40992e2b4c | |
| 
							
							
								
								 | 
						c1cbe71ba6 | |
| 
							
							
								
								 | 
						0bc5b3fc56 | |
| 
							
							
								
								 | 
						a423df3ec8 | |
| 
							
							
								
								 | 
						0ab028638d | |
| 
							
							
								
								 | 
						ae9c04361a | |
| 
							
							
								
								 | 
						43fd4cb92b | |
| 
							
							
								
								 | 
						9b65d2bc58 | |
| 
							
							
								
								 | 
						12e56687f0 | |
| 
							
							
								
								 | 
						a19b8dbdbb | |
| 
							
							
								
								 | 
						b5b8132a7e | |
| 
							
							
								
								 | 
						a8522ea109 | |
| 
							
							
								
								 | 
						79e0ef0955 | |
| 
							
							
								
								 | 
						e3dc6b251f | |
| 
							
							
								
								 | 
						d4ce7fb9c2 | |
| 
							
							
								
								 | 
						c8f78e8480 | |
| 
							
							
								
								 | 
						9d68f6d7c8 | |
| 
							
							
								
								 | 
						2d834a9aa1 | |
| 
							
							
								
								 | 
						304ccac431 | |
| 
							
							
								
								 | 
						21a2db7a93 | 
| 
						 | 
				
			
			@ -282,22 +282,13 @@ public class BonusSettleRangeHandle extends BonusSettleHandle {
 | 
			
		|||
        CuMemberRetailRangeExt sourceMemberRangeExt = memberRangeExtMap.get(saOrderExt.getPkMember());
 | 
			
		||||
        // 推荐人
 | 
			
		||||
        long pkParent = sourceMemberRangeExt.getPkParent();
 | 
			
		||||
        // 2025.08.21 需要修改:累计升级制,按订单金额以及等级对应比例拿直推级差
 | 
			
		||||
        // 订单金额
 | 
			
		||||
        BigDecimal orderAmount = saOrderExt.getOrderAmount();
 | 
			
		||||
//        // TODO 累计升级,此处订单可能没有等级值
 | 
			
		||||
//        if (null != saOrderExt.getPkGrade()) {
 | 
			
		||||
//            // 订单存在升级记录信息
 | 
			
		||||
//            // 订单等级值
 | 
			
		||||
//            Integer orderGradeValue = gradeIdMap.get(saOrderExt.getPkGrade()).getGradeValue();
 | 
			
		||||
//        } else {
 | 
			
		||||
//
 | 
			
		||||
//        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        Integer orderGradeValue = gradeIdMap.get(saOrderExt.getPkGrade()).getGradeValue();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        if (null == orderAmount || orderAmount.compareTo(BigDecimal.ZERO) == 0) {
 | 
			
		||||
            log.warn("订单 {} 金额为0", saOrderExt.getOrderCode());
 | 
			
		||||
            return memberBonusRangeList;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // 前一个会员等级
 | 
			
		||||
        int beforeGradeValue = 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -311,7 +302,7 @@ public class BonusSettleRangeHandle extends BonusSettleHandle {
 | 
			
		|||
            if (beforeGradeValue == EGrade.COMPANY.getValue()) {
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
            // 推荐人
 | 
			
		||||
            // 推荐人 - 当前处理会员
 | 
			
		||||
            CuMemberRetailRangeExt targetMemberRangeExt = memberRangeExtMap.get(pkParent);
 | 
			
		||||
            if (null == targetMemberRangeExt) {
 | 
			
		||||
                break;
 | 
			
		||||
| 
						 | 
				
			
			@ -329,248 +320,72 @@ public class BonusSettleRangeHandle extends BonusSettleHandle {
 | 
			
		|||
            }
 | 
			
		||||
            // 当前会员等级值
 | 
			
		||||
            int targetGradeValue = targetMemberRangeExt.getGradeValue();
 | 
			
		||||
 | 
			
		||||
            // 直推级差收益
 | 
			
		||||
            BigDecimal rangeBonusIncome = BigDecimal.ZERO;
 | 
			
		||||
 | 
			
		||||
            if (EGrade.HAI_FAN.getValue() == orderGradeValue) {
 | 
			
		||||
                // 订单等级是会员、VIP
 | 
			
		||||
                if (targetGradeValue > beforeGradeValue) {
 | 
			
		||||
                    // 当前会员等级大于上一个会员等级
 | 
			
		||||
                    if (EGrade.HAI_FAN.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V1 推拿 30
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V1_V1;
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V1_V1;
 | 
			
		||||
                    } else if (EGrade.YOU_KE.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V2 推拿 40,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V2_V1.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V2_V1;
 | 
			
		||||
                    } else if (EGrade.MAKER.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V3 推拿 50,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V3_V1.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V3_V1;
 | 
			
		||||
                    } else if (EGrade.VIP.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V4 推拿 100,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V4_V1.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V4_V1;
 | 
			
		||||
                    } else if (EGrade.S_VIP.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V5 推拿 104,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V5_V1.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V5_V1;
 | 
			
		||||
                    } else if (EGrade.REGION.getValue() == targetGradeValue
 | 
			
		||||
                            || EGrade.DIRECTOR.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V6、V7 推拿 110 ,或者减去之前累计
 | 
			
		||||
                        // 前一等级不是V6、V7
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V6_V7_V1.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V6_V7_V1;
 | 
			
		||||
                    } else if (EGrade.COMPANY.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V8 推拿 120,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V8_V1.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V8_V1;
 | 
			
		||||
                    }
 | 
			
		||||
                    // 前一级会员等级
 | 
			
		||||
                    beforeGradeValue = targetGradeValue;
 | 
			
		||||
                }
 | 
			
		||||
            } else if (EGrade.YOU_KE.getValue() == orderGradeValue) {
 | 
			
		||||
                // 订单等级是VIP
 | 
			
		||||
                if (targetGradeValue > beforeGradeValue) {
 | 
			
		||||
                    // 当前会员等级大于上一个会员等级
 | 
			
		||||
                    if (EGrade.HAI_FAN.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V1 推拿 300
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V1_V2;
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V1_V2;
 | 
			
		||||
                    } else if (EGrade.YOU_KE.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V2 推拿 400,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V2_V2.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V2_V2;
 | 
			
		||||
                    } else if (EGrade.MAKER.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V3 推拿 500,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V3_V2.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V3_V2;
 | 
			
		||||
                    } else if (EGrade.VIP.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V4 推拿 1000,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V4_V2.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V4_V2;
 | 
			
		||||
                    } else if (EGrade.S_VIP.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V5 推拿 1040,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V5_V2.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V5_V2;
 | 
			
		||||
                    } else if (EGrade.REGION.getValue() == targetGradeValue
 | 
			
		||||
                            || EGrade.DIRECTOR.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V6、V7 推拿 1100,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V6_V7_V2.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V6_V7_V2;
 | 
			
		||||
                    } else if (EGrade.COMPANY.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V8 推拿 1200,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V8_V2.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V8_V2;
 | 
			
		||||
                    }
 | 
			
		||||
                    // 前一级会员等级
 | 
			
		||||
                    beforeGradeValue = targetGradeValue;
 | 
			
		||||
                }
 | 
			
		||||
            } else if (EGrade.MAKER.getValue() == orderGradeValue) {
 | 
			
		||||
                // 订单是合伙人
 | 
			
		||||
                if (targetGradeValue > beforeGradeValue) {
 | 
			
		||||
                    // 当前等级大于之前等级
 | 
			
		||||
                    if (EGrade.HAI_FAN.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V1 推拿 600
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V1_V3;
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V1_V3;
 | 
			
		||||
                    } else if (EGrade.YOU_KE.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V2 推拿 800,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V2_V3.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V2_V3;
 | 
			
		||||
                    } else if (EGrade.MAKER.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V3 推拿 1000,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V3_V3_1.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V3_V3_1;
 | 
			
		||||
                    } else if (EGrade.VIP.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V4 推拿 2000,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V4_V3.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V4_V3;
 | 
			
		||||
                    } else if (EGrade.S_VIP.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V5 推拿 2080,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V5_V3.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V5_V3;
 | 
			
		||||
                    } else if (EGrade.REGION.getValue() == targetGradeValue
 | 
			
		||||
                            || EGrade.DIRECTOR.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V6、V7 推拿 2200,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V6_V7_V3.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V6_V7_V3;
 | 
			
		||||
                    } else if (EGrade.COMPANY.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V8 推拿 2400,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V8_V3.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V8_V3;
 | 
			
		||||
                    }
 | 
			
		||||
                    // 前一级会员等级
 | 
			
		||||
                    beforeGradeValue = targetGradeValue;
 | 
			
		||||
                } else if (EGrade.MAKER.getValue() == beforeGradeValue
 | 
			
		||||
                        && EGrade.MAKER.getValue() == targetGradeValue) {
 | 
			
		||||
                    // 之前和现在都是合伙人,处理平级
 | 
			
		||||
                    if (v3Count == 1) {
 | 
			
		||||
                        // V3第一平级 推拿 1200,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V3_V3_2.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V3_V3_2;
 | 
			
		||||
                        v3Count++;
 | 
			
		||||
                    } else if (v3Count == 2) {
 | 
			
		||||
                        // V3第二平级 推拿 1300,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V3_V3_3.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V3_V3_3;
 | 
			
		||||
                        v3Count++;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            } else if (EGrade.VIP.getValue() == orderGradeValue) {
 | 
			
		||||
                // 订单是博羚店主
 | 
			
		||||
                if (targetGradeValue > beforeGradeValue) {
 | 
			
		||||
                    // 当前等级大于之前等级
 | 
			
		||||
                    if (EGrade.HAI_FAN.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V1 推拿 1200
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V1_V4;
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V1_V4;
 | 
			
		||||
                    } else if (EGrade.YOU_KE.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V2 推拿 1600,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V2_V4.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V2_V4;
 | 
			
		||||
                    } else if (EGrade.MAKER.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V3 推拿 2000,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V3_V4_1.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V3_V4_1;
 | 
			
		||||
                    } else if (EGrade.VIP.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V4 推拿 4000,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V4_V4.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V4_V4;
 | 
			
		||||
                    } else if (EGrade.S_VIP.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V5 推拿 4160,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V5_V4.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V5_V4;
 | 
			
		||||
                    } else if (EGrade.REGION.getValue() == targetGradeValue
 | 
			
		||||
                            || EGrade.DIRECTOR.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V6、V7 推拿 4400,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V6_V7_V4.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V6_V7_V4;
 | 
			
		||||
                    } else if (EGrade.COMPANY.getValue() == targetGradeValue) {
 | 
			
		||||
                        // V8 推拿 4800,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V8_V4.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V8_V4;
 | 
			
		||||
                    }
 | 
			
		||||
                    // 前一级会员等级
 | 
			
		||||
                    beforeGradeValue = targetGradeValue;
 | 
			
		||||
                } else if (EGrade.MAKER.getValue() == beforeGradeValue
 | 
			
		||||
                        && EGrade.MAKER.getValue() == targetGradeValue) {
 | 
			
		||||
                    // 之前和现在都是合伙人,处理平级
 | 
			
		||||
                    if (v3Count == 1) {
 | 
			
		||||
                        // V3第一平级 推拿 2400,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V3_V4_2.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V3_V4_2;
 | 
			
		||||
                        v3Count++;
 | 
			
		||||
                    } else if (v3Count == 2) {
 | 
			
		||||
                        // V3第二平级 推拿 2600,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V3_V4_3.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V3_V4_3;
 | 
			
		||||
                        v3Count++;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            } else if (EGrade.REGION.getValue() == orderGradeValue) {
 | 
			
		||||
                // 订单是区域代理
 | 
			
		||||
                if (targetGradeValue >= EGrade.VIP.getValue() && targetGradeValue > beforeGradeValue) {
 | 
			
		||||
                    // 博羚店主以上才有级差 并且 当前等级大于之前等级
 | 
			
		||||
                    if (EGrade.VIP.getValue() == targetGradeValue) {
 | 
			
		||||
                        // 博羚店主 拿 50000
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V4_V6.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V4_V6;
 | 
			
		||||
                    } else if (EGrade.S_VIP.getValue() == targetGradeValue) {
 | 
			
		||||
                        // 高级店主 拿 52000,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V5_V6.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V5_V6;
 | 
			
		||||
                    } else if (EGrade.REGION.getValue() == targetGradeValue
 | 
			
		||||
                            || EGrade.DIRECTOR.getValue() == targetGradeValue) {
 | 
			
		||||
                        // 区域代理、董事代理 拿 55000,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V6_V7_V6.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V6_V7_V6;
 | 
			
		||||
                    } else if (EGrade.COMPANY.getValue() == targetGradeValue) {
 | 
			
		||||
                        // 总公司 拿 60000,或者减去之前累计
 | 
			
		||||
                        rangeBonusIncome = RetailConstants.V8_V6.subtract(totalBonus);
 | 
			
		||||
                        // 前面累计的奖金
 | 
			
		||||
                        totalBonus = RetailConstants.V8_V6;
 | 
			
		||||
                    }
 | 
			
		||||
                    // 前一级会员等级
 | 
			
		||||
                    beforeGradeValue = targetGradeValue;
 | 
			
		||||
            if (EGrade.HAI_FAN.getValue() == targetGradeValue && targetGradeValue > beforeGradeValue) {
 | 
			
		||||
                // 推荐人是 会员
 | 
			
		||||
                rangeBonusIncome = orderAmount.multiply(RetailConstants.RECOMMEND_HAI_FAN).setScale(4, BigDecimal.ROUND_HALF_UP);
 | 
			
		||||
                // 已经算完级差等级的累计奖金
 | 
			
		||||
                totalBonus = totalBonus.add(rangeBonusIncome);
 | 
			
		||||
                // 前一级会员等级
 | 
			
		||||
                beforeGradeValue = targetGradeValue;
 | 
			
		||||
            } else if (EGrade.YOU_KE.getValue() == targetGradeValue && targetGradeValue > beforeGradeValue) {
 | 
			
		||||
                // 推荐人是 VIP
 | 
			
		||||
                rangeBonusIncome = orderAmount.multiply(RetailConstants.RECOMMEND_YOU_KE).subtract(totalBonus).setScale(4, BigDecimal.ROUND_HALF_UP);
 | 
			
		||||
                // 已经算完级差等级的累计奖金
 | 
			
		||||
                totalBonus = totalBonus.add(rangeBonusIncome);
 | 
			
		||||
                // 前一级会员等级
 | 
			
		||||
                beforeGradeValue = targetGradeValue;
 | 
			
		||||
            } else if (EGrade.MAKER.getValue() == targetGradeValue && targetGradeValue >= beforeGradeValue) {
 | 
			
		||||
                // 推荐人是 合伙人
 | 
			
		||||
                if (v3Count == 1) {
 | 
			
		||||
                    rangeBonusIncome = orderAmount.multiply(RetailConstants.RECOMMEND_MAKER_1).subtract(totalBonus).setScale(4, BigDecimal.ROUND_HALF_UP);
 | 
			
		||||
                } else if (v3Count == 2) {
 | 
			
		||||
                    rangeBonusIncome = orderAmount.multiply(RetailConstants.RECOMMEND_MAKER_2).subtract(totalBonus).setScale(4, BigDecimal.ROUND_HALF_UP);
 | 
			
		||||
                } else if (v3Count == 3) {
 | 
			
		||||
                    rangeBonusIncome = orderAmount.multiply(RetailConstants.RECOMMEND_MAKER_3).subtract(totalBonus).setScale(4, BigDecimal.ROUND_HALF_UP);
 | 
			
		||||
                }
 | 
			
		||||
                v3Count++;
 | 
			
		||||
                // 已经算完级差等级的累计奖金
 | 
			
		||||
                totalBonus = totalBonus.add(rangeBonusIncome);
 | 
			
		||||
                // 前一级会员等级
 | 
			
		||||
                beforeGradeValue = targetGradeValue;
 | 
			
		||||
            } else if (EGrade.VIP.getValue() == targetGradeValue && targetGradeValue > beforeGradeValue) {
 | 
			
		||||
                // 推荐人是 博羚店主
 | 
			
		||||
                rangeBonusIncome = orderAmount.multiply(RetailConstants.RECOMMEND_VIP).subtract(totalBonus).setScale(4, BigDecimal.ROUND_HALF_UP);
 | 
			
		||||
                // 已经算完级差等级的累计奖金
 | 
			
		||||
                totalBonus = totalBonus.add(rangeBonusIncome);
 | 
			
		||||
                // 前一级会员等级
 | 
			
		||||
                beforeGradeValue = targetGradeValue;
 | 
			
		||||
            } else if (EGrade.S_VIP.getValue() == targetGradeValue && targetGradeValue > beforeGradeValue) {
 | 
			
		||||
                // 推荐人是 高级店主
 | 
			
		||||
                rangeBonusIncome = orderAmount.multiply(RetailConstants.RECOMMEND_S_VIP).subtract(totalBonus).setScale(4, BigDecimal.ROUND_HALF_UP);
 | 
			
		||||
                // 已经算完级差等级的累计奖金
 | 
			
		||||
                totalBonus = totalBonus.add(rangeBonusIncome);
 | 
			
		||||
                // 前一级会员等级
 | 
			
		||||
                beforeGradeValue = targetGradeValue;
 | 
			
		||||
            } else if (EGrade.REGION.getValue() == targetGradeValue && targetGradeValue > beforeGradeValue) {
 | 
			
		||||
                // 推荐人是 区域代理
 | 
			
		||||
                rangeBonusIncome = orderAmount.multiply(RetailConstants.RECOMMEND_REGION).subtract(totalBonus).setScale(4, BigDecimal.ROUND_HALF_UP);
 | 
			
		||||
                // 已经算完级差等级的累计奖金
 | 
			
		||||
                totalBonus = totalBonus.add(rangeBonusIncome);
 | 
			
		||||
                // 前一级会员等级
 | 
			
		||||
                beforeGradeValue = targetGradeValue;
 | 
			
		||||
            } else if (EGrade.DIRECTOR.getValue() == targetGradeValue && targetGradeValue > beforeGradeValue) {
 | 
			
		||||
                // 推荐人是 董事代理
 | 
			
		||||
                rangeBonusIncome = orderAmount.multiply(RetailConstants.RECOMMEND_DIRECTOR).subtract(totalBonus).setScale(4, BigDecimal.ROUND_HALF_UP);
 | 
			
		||||
                // 已经算完级差等级的累计奖金
 | 
			
		||||
                totalBonus = totalBonus.add(rangeBonusIncome);
 | 
			
		||||
                // 前一级会员等级
 | 
			
		||||
                beforeGradeValue = targetGradeValue;
 | 
			
		||||
            } else if (EGrade.COMPANY.getValue() == targetGradeValue && targetGradeValue > beforeGradeValue) {
 | 
			
		||||
                // 推荐人是 总公司
 | 
			
		||||
                rangeBonusIncome = orderAmount.multiply(RetailConstants.RECOMMEND_COMPANY).subtract(totalBonus).setScale(4, BigDecimal.ROUND_HALF_UP);
 | 
			
		||||
                // 已经算完级差等级的累计奖金
 | 
			
		||||
                totalBonus = totalBonus.add(rangeBonusIncome);
 | 
			
		||||
                // 前一级会员等级
 | 
			
		||||
                beforeGradeValue = targetGradeValue;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (rangeBonusIncome.compareTo(BigDecimal.ZERO) > 0) {
 | 
			
		||||
| 
						 | 
				
			
			@ -737,7 +552,7 @@ public class BonusSettleRangeHandle extends BonusSettleHandle {
 | 
			
		|||
 | 
			
		||||
            // 2025.08.13 添加 代理 级差收益,每1盒(4个产品)区域代理4元,董事代理4元,公司6元,总拨出14元
 | 
			
		||||
            if ((EGrade.REGION.getValue() == targetMemberRangeExt.getGradeValue()
 | 
			
		||||
                    && EGrade.DIRECTOR.getValue() == targetMemberRangeExt.getGradeValue())
 | 
			
		||||
                    || EGrade.DIRECTOR.getValue() == targetMemberRangeExt.getGradeValue())
 | 
			
		||||
                    && branch < 2) {
 | 
			
		||||
                // 等级是分公司 并且 发放次数小于2
 | 
			
		||||
                this.calculateRetailRepurCompanyRangeBonus(sourceMemberRangeExt, targetMemberRangeExt, cuMemberBonusMap, bonusConfigDTO,
 | 
			
		||||
| 
						 | 
				
			
			@ -830,6 +645,10 @@ public class BonusSettleRangeHandle extends BonusSettleHandle {
 | 
			
		|||
            CuMemberRetailRangeExt targetMemberRangeExt = memberRangeExtMap.get(retailRegion.getPkMember());
 | 
			
		||||
            if (ObjectUtil.isEmpty(targetMemberRangeExt)) {
 | 
			
		||||
                targetMemberRangeExt = cuMemberRetailRangeMapper.queryCuMemberRetailRangeByMemberId(rangeTableName, retailRegion.getPkMember());
 | 
			
		||||
                if (null == targetMemberRangeExt) {
 | 
			
		||||
                    // 配送区域对应的会员不存在了,直接跳过
 | 
			
		||||
                    return memberBonusDetailList;
 | 
			
		||||
                }
 | 
			
		||||
                memberRangeExtMap.put(retailRegion.getPkMember(), targetMemberRangeExt);
 | 
			
		||||
            }
 | 
			
		||||
            // 复购配送区域收益
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -608,12 +608,12 @@ public interface CuMemberMapper extends BaseMapper<CuMember> {
 | 
			
		|||
    CuMember getShopkeeperMember(@Param("pkMember") Long pkMember, @Param("gradeValue") Integer gradeValue);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询高级店主
 | 
			
		||||
     * 查询会员等级
 | 
			
		||||
     *
 | 
			
		||||
     * @param pkMember
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    CuMember getGradeSvipMember(@Param("pkMember") Long pkMember);
 | 
			
		||||
    CuMemberExt getGradeSvipMember(@Param("pkMember") Long pkMember, @Param("gradeValue") Integer gradeValue);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询会员直推大于博羚店主的注册、升级订单查询会员直推大于博羚店主的注册、升级订单
 | 
			
		||||
| 
						 | 
				
			
			@ -622,7 +622,21 @@ public interface CuMemberMapper extends BaseMapper<CuMember> {
 | 
			
		|||
     * @param orderCode
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    SaOrder listRecommendVipOrder(@Param("pkMember") Long pkMember, @Param("orderCode") String orderCode);
 | 
			
		||||
    SaOrder listRecommendVipOrder(@Param("pkMember") Long pkMember, @Param("orderCode") String orderCode, @Param("gradeValue") Integer gradeValue);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     *
 | 
			
		||||
     */
 | 
			
		||||
    int getMemberCountWithGradeAndParent(@Param("parentId") Long parentId, @Param("gradeValue") Integer gradeValue);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询业绩汇总
 | 
			
		||||
     *
 | 
			
		||||
     * @param censusSummaryParam
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    List<MemberMeritsSummaryVo> queryDateBySummary(CensusSummaryParam censusSummaryParam);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -106,7 +106,7 @@ public class MemberServiceProvider implements IMemberServiceApi {
 | 
			
		|||
            if (iCuMemberBusinessService.mergeRevokeMemberByRegisterOrder(pkApprove, memberList, saOrderMap, businessCommissionDTO)) {
 | 
			
		||||
                return R.ok();
 | 
			
		||||
            }
 | 
			
		||||
            return R.fail("会员信息处理失败");
 | 
			
		||||
            return R.fail("合并撤单会员信息处理失败");
 | 
			
		||||
        } catch (Exception e) {
 | 
			
		||||
            log.error("mergeRevokeMemberByRegisterOrder error msg:{}", e.getMessage(), e);
 | 
			
		||||
            return R.fail(e.getMessage());
 | 
			
		||||
| 
						 | 
				
			
			@ -116,10 +116,13 @@ public class MemberServiceProvider implements IMemberServiceApi {
 | 
			
		|||
    @Override
 | 
			
		||||
    public R<Boolean> normalRevokeOrder(Long pkApprove, SaOrderExt saOrder, CuMember cuMember, BusinessCommissionDTO businessCommissionDTO) {
 | 
			
		||||
        try {
 | 
			
		||||
            return R.ok(iCuMemberBusinessService.normalRevokeOrder(pkApprove, saOrder, cuMember, businessCommissionDTO));
 | 
			
		||||
            if (iCuMemberBusinessService.normalRevokeOrder(pkApprove, saOrder, cuMember, businessCommissionDTO)) {
 | 
			
		||||
                return R.ok();
 | 
			
		||||
            }
 | 
			
		||||
            return R.fail("其它撤单会员信息处理失败");
 | 
			
		||||
        } catch (Exception e) {
 | 
			
		||||
            log.error("normalRevokeOrder error msg: {}", e.getMessage(), e);
 | 
			
		||||
            return R.ok(false);
 | 
			
		||||
            return R.fail(e.getMessage());
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -878,12 +878,12 @@ public interface ICuMemberService extends IService<CuMember> {
 | 
			
		|||
    CuMember getShopkeeperMember(Long pkMember, Integer gradeValue);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询高级店主
 | 
			
		||||
     * 查询会员等级
 | 
			
		||||
     *
 | 
			
		||||
     * @param pkMember
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    CuMember getGradeSvipMember(Long pkMember);
 | 
			
		||||
    CuMemberExt getGradeSvipMember(Long pkMember, Integer gradeValue);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询会员直推大于博羚店主的注册、升级订单查询会员直推大于博羚店主的注册、升级订单
 | 
			
		||||
| 
						 | 
				
			
			@ -892,7 +892,15 @@ public interface ICuMemberService extends IService<CuMember> {
 | 
			
		|||
     * @param orderCode
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    SaOrder listRecommendVipOrder(Long pkMember, String orderCode);
 | 
			
		||||
    SaOrder listRecommendVipOrder(Long pkMember, String orderCode, Integer gradeValue);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询汇总
 | 
			
		||||
     *
 | 
			
		||||
     * @param censusSummaryParam 表格名称
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    List<CensusSummaryVo> selectCensusSummary(CensusSummaryParam censusSummaryParam, List<String> days);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询汇总
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -618,7 +618,6 @@ public class CuMemberBusinessServiceImpl implements ICuMemberBusinessService {
 | 
			
		|||
            updateWrapper.set(CuMember::getPkModified, saOrder.getPkModified());
 | 
			
		||||
            updateWrapper.eq(CuMember::getPkId, member.getPkId());
 | 
			
		||||
            iCuMemberService.update(updateWrapper);
 | 
			
		||||
 | 
			
		||||
            // 删除会员注册表
 | 
			
		||||
            LambdaUpdateWrapper<CuMemberRegister> updateWrapperRegister = new LambdaUpdateWrapper<>();
 | 
			
		||||
            updateWrapperRegister.set(CuMemberRegister::getDelFlag, EDelFlag.DELETE.getValue());
 | 
			
		||||
| 
						 | 
				
			
			@ -853,6 +852,12 @@ public class CuMemberBusinessServiceImpl implements ICuMemberBusinessService {
 | 
			
		|||
            SaOrderExt saOrder = saOrderMap.get(pkMember);
 | 
			
		||||
            // 删除等级
 | 
			
		||||
            iCuMemberLevelService.deleteCuMemberLevelRecord(saOrder.getPkId(), pkApprove, currentDateTime);
 | 
			
		||||
            // 删除会员区域
 | 
			
		||||
            iCuMemberRetailRegionService.update(Wrappers.<CuMemberRetailRegion>lambdaUpdate()
 | 
			
		||||
                    .eq(CuMemberRetailRegion::getPkMember, saOrder.getPkMember())
 | 
			
		||||
                    .set(CuMemberRetailRegion::getDelFlag, EDelFlag.DELETE.getValue())
 | 
			
		||||
                    .set(CuMemberRetailRegion::getModifiedTime, currentDateTime)
 | 
			
		||||
            );
 | 
			
		||||
            // 回退奖衔,根据订单从 cu_member_awards查询
 | 
			
		||||
            iCuMemberAwardsService.deleteCuMemberAwards(saOrder.getPkId(), pkApprove, currentDateTime);
 | 
			
		||||
            iCuMemberService.deleteCuMemberByPkMember(pkMember, pkApprove, currentDateTime);
 | 
			
		||||
| 
						 | 
				
			
			@ -899,12 +904,26 @@ public class CuMemberBusinessServiceImpl implements ICuMemberBusinessService {
 | 
			
		|||
            // 升级订单
 | 
			
		||||
            // 回退等级
 | 
			
		||||
            iCuMemberLevelService.deleteCuMemberLevelRecord(saOrder.getPkId(), pkApprove, currentDateTime);
 | 
			
		||||
            // 删除会员区域
 | 
			
		||||
            iCuMemberRetailRegionService.update(Wrappers.<CuMemberRetailRegion>lambdaUpdate()
 | 
			
		||||
                    .eq(CuMemberRetailRegion::getPkMember, saOrder.getPkMember())
 | 
			
		||||
                    .set(CuMemberRetailRegion::getDelFlag, EDelFlag.DELETE.getValue())
 | 
			
		||||
                    .set(CuMemberRetailRegion::getModifiedTime, currentDateTime)
 | 
			
		||||
            );
 | 
			
		||||
            // 如果会员等级非代理,则需要删除会员区域
 | 
			
		||||
            GradeDTO gradeDTO = iGradeServiceApi.getGrade(cuMember.getPkSettleGrade()).getData();
 | 
			
		||||
            if (gradeDTO.getGradeValue() != EGrade.REGION.getValue()
 | 
			
		||||
                    && gradeDTO.getGradeValue() != EGrade.DIRECTOR.getValue()) {
 | 
			
		||||
                // 删除会员区域选择
 | 
			
		||||
                iCuMemberRetailRegionService.update(Wrappers.<CuMemberRetailRegion>lambdaUpdate()
 | 
			
		||||
                        .eq(CuMemberRetailRegion::getPkMember, saOrder.getPkMember())
 | 
			
		||||
                        .eq(CuMemberRetailRegion::getBusinessType, 1)
 | 
			
		||||
                        .set(CuMemberRetailRegion::getDelFlag, EDelFlag.DELETE.getValue())
 | 
			
		||||
                        .set(CuMemberRetailRegion::getModifiedTime, currentDateTime)
 | 
			
		||||
                );
 | 
			
		||||
                // 更新会员配送中心为失效
 | 
			
		||||
                iCuMemberRetailRegionService.update(Wrappers.<CuMemberRetailRegion>lambdaUpdate()
 | 
			
		||||
                        .eq(CuMemberRetailRegion::getPkMember, saOrder.getPkMember())
 | 
			
		||||
                        .eq(CuMemberRetailRegion::getBusinessType, 2)
 | 
			
		||||
                        .set(CuMemberRetailRegion::getEffective, EYesNo.NO.getIntValue())
 | 
			
		||||
                        .set(CuMemberRetailRegion::getEffectiveEndDate, DateUtils.getEndTime(null))
 | 
			
		||||
                        .set(CuMemberRetailRegion::getModifiedTime, currentDateTime)
 | 
			
		||||
                );
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // 更新会员标记,如果是则更新会员信息
 | 
			
		||||
| 
						 | 
				
			
			@ -1674,38 +1693,66 @@ public class CuMemberBusinessServiceImpl implements ICuMemberBusinessService {
 | 
			
		|||
            memberLevelQuery.eq(CuMemberLevel::getUpType, EUpgradeType.AUTO_UPGRADE.getValue());
 | 
			
		||||
            CuMemberLevel parentLevel = iCuMemberLevelService.getOne(memberLevelQuery);
 | 
			
		||||
            if (null != parentLevel) {
 | 
			
		||||
                // 查询推荐人信息(必须是高级店主)
 | 
			
		||||
                CuMember parentMember = iCuMemberService.getGradeSvipMember(parentLevel.getPkMember());
 | 
			
		||||
                // 查询推荐人及等级信息
 | 
			
		||||
                CuMemberExt parentMember = iCuMemberService.getGradeSvipMember(parentLevel.getPkMember(), null);
 | 
			
		||||
                if (null != parentMember) {
 | 
			
		||||
                    // 推荐是高级店主,查询直推博羚店主以上订单
 | 
			
		||||
                    SaOrder parentOrder = iCuMemberService.listRecommendVipOrder(parentMember.getPkId(), saOrder.getOrderCode());
 | 
			
		||||
                    if (null != parentOrder) {
 | 
			
		||||
                        // 存在其它博羚店主订单,重新处理升级记录
 | 
			
		||||
                        CuMemberLevel parentNewLevel = BeanUtil.copyProperties(parentLevel, CuMemberLevel.class);
 | 
			
		||||
                        parentNewLevel.setPkId(null);
 | 
			
		||||
                        parentNewLevel.setPkOrder(parentOrder.getPkId());
 | 
			
		||||
                        parentNewLevel.setUpgradeTime(parentOrder.getPayTime());
 | 
			
		||||
                        parentNewLevel.setModifiedTime(parentOrder.getPayTime());
 | 
			
		||||
                        parentNewLevel.setPkModified(parentOrder.getPkMember());
 | 
			
		||||
                        iCuMemberLevelService.save(parentNewLevel);
 | 
			
		||||
                    } else {
 | 
			
		||||
                        // 不存在其它博羚店主订单,会员需要降级处理
 | 
			
		||||
                        LambdaUpdateWrapper<CuMember> parentMemberUpdate = new LambdaUpdateWrapper<>();
 | 
			
		||||
                        parentMemberUpdate.eq(CuMember::getPkId, parentMember.getPkId());
 | 
			
		||||
                        parentMemberUpdate.set(CuMember::getPkSettleGrade, parentLevel.getOldLevel());
 | 
			
		||||
                        parentMemberUpdate.set(CuMember::getModifiedTime, currentDateTime);
 | 
			
		||||
                        iCuMemberService.update(parentMemberUpdate);
 | 
			
		||||
                    SaOrder parentOrder = null;
 | 
			
		||||
                    if (parentMember.getGradeValue() == EGrade.DIRECTOR.getValue()) {
 | 
			
		||||
                        // 推荐人是董事代理,查询直推区域代理以上订单
 | 
			
		||||
                        parentOrder = iCuMemberService.listRecommendVipOrder(parentMember.getPkId(), saOrder.getOrderCode(), EGrade.REGION.getValue());
 | 
			
		||||
                    } else if (parentMember.getGradeValue() == EGrade.S_VIP.getValue()) {
 | 
			
		||||
                        // 推荐人是高级店主,查询直推博羚店主以上订单
 | 
			
		||||
                        parentOrder = iCuMemberService.listRecommendVipOrder(parentMember.getPkId(), saOrder.getOrderCode(), EGrade.VIP.getValue());
 | 
			
		||||
                    }
 | 
			
		||||
                    // 删除原来升级记录
 | 
			
		||||
                    LambdaUpdateWrapper<CuMemberLevel> updateMemberLevel = new LambdaUpdateWrapper<>();
 | 
			
		||||
                    updateMemberLevel.eq(CuMemberLevel::getPkId, parentLevel.getPkId());
 | 
			
		||||
                    updateMemberLevel.set(CuMemberLevel::getDelFlag, EDelFlag.DELETE.getValue());
 | 
			
		||||
                    updateMemberLevel.set(CuMemberLevel::getModifiedTime, currentDateTime);
 | 
			
		||||
                    iCuMemberLevelService.update(updateMemberLevel);
 | 
			
		||||
                    this.handleParentLevelUpdate(parentOrder, parentLevel, parentMember, currentDateTime);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void handleParentLevelUpdate(SaOrder parentOrder, CuMemberLevel parentLevel, CuMemberExt parentMember, Date currentDateTime) {
 | 
			
		||||
        if (null != parentOrder) {
 | 
			
		||||
            // 存在其它博羚店主订单,重新处理升级记录
 | 
			
		||||
            CuMemberLevel parentNewLevel = BeanUtil.copyProperties(parentLevel, CuMemberLevel.class);
 | 
			
		||||
            parentNewLevel.setPkId(null);
 | 
			
		||||
            parentNewLevel.setPkOrder(parentOrder.getPkId());
 | 
			
		||||
            parentNewLevel.setUpgradeTime(parentOrder.getPayTime());
 | 
			
		||||
            parentNewLevel.setModifiedTime(parentOrder.getPayTime());
 | 
			
		||||
            parentNewLevel.setPkModified(parentOrder.getPkMember());
 | 
			
		||||
            iCuMemberLevelService.save(parentNewLevel);
 | 
			
		||||
        } else {
 | 
			
		||||
            // 不存在其它博羚店主订单,会员需要降级处理
 | 
			
		||||
            LambdaUpdateWrapper<CuMember> parentMemberUpdate = new LambdaUpdateWrapper<>();
 | 
			
		||||
            parentMemberUpdate.eq(CuMember::getPkId, parentMember.getPkId());
 | 
			
		||||
            parentMemberUpdate.set(CuMember::getPkSettleGrade, parentLevel.getOldLevel());
 | 
			
		||||
            parentMemberUpdate.set(CuMember::getModifiedTime, currentDateTime);
 | 
			
		||||
            iCuMemberService.update(parentMemberUpdate);
 | 
			
		||||
        }
 | 
			
		||||
        // 删除原来升级记录
 | 
			
		||||
        LambdaUpdateWrapper<CuMemberLevel> updateMemberLevel = new LambdaUpdateWrapper<>();
 | 
			
		||||
        updateMemberLevel.eq(CuMemberLevel::getPkId, parentLevel.getPkId());
 | 
			
		||||
        updateMemberLevel.set(CuMemberLevel::getDelFlag, EDelFlag.DELETE.getValue());
 | 
			
		||||
        updateMemberLevel.set(CuMemberLevel::getModifiedTime, currentDateTime);
 | 
			
		||||
        iCuMemberLevelService.update(updateMemberLevel);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 在线支付退款
 | 
			
		||||
     *
 | 
			
		||||
     * @param saOrder
 | 
			
		||||
     */
 | 
			
		||||
    private void handleOnlineRefund(SaOrderExt saOrder) {
 | 
			
		||||
        R<TOnlinePayment> onlinePaymentR = itOnlinePaymentServiceApi.getOnlinePayment(saOrder.getOrderCode());
 | 
			
		||||
        if (ObjectUtil.isNotEmpty(onlinePaymentR)) {
 | 
			
		||||
            TOnlinePayment onlinePayment = onlinePaymentR.getData();
 | 
			
		||||
            if (ObjectUtil.isNotEmpty(onlinePayment)) {
 | 
			
		||||
                R<String> result = itOnlinePaymentServiceApi.refund(saOrder.getOrderCode(), saOrder.getPkCreator());
 | 
			
		||||
                if (!result.isSuccess()) {
 | 
			
		||||
                    throw new ServiceException(result.getMsg());
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3250,13 +3250,13 @@ public class CuMemberServiceImpl extends ServiceImpl<CuMemberMapper, CuMember> i
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public CuMember getGradeSvipMember(Long pkMember) {
 | 
			
		||||
        return baseMapper.getGradeSvipMember(pkMember);
 | 
			
		||||
    public CuMemberExt getGradeSvipMember(Long pkMember, Integer gradeValue) {
 | 
			
		||||
        return baseMapper.getGradeSvipMember(pkMember, gradeValue);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public SaOrder listRecommendVipOrder(Long pkMember, String orderCode) {
 | 
			
		||||
        return baseMapper.listRecommendVipOrder(pkMember, orderCode);
 | 
			
		||||
    public SaOrder listRecommendVipOrder(Long pkMember, String orderCode, Integer gradeValue) {
 | 
			
		||||
        return baseMapper.listRecommendVipOrder(pkMember, orderCode, gradeValue);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2382,16 +2382,18 @@
 | 
			
		|||
          and bg.grade_value = #{gradeValue}
 | 
			
		||||
    </select>
 | 
			
		||||
 | 
			
		||||
    <!-- 查询高级店主 -->
 | 
			
		||||
    <select id="getGradeSvipMember" resultType="com.hzs.common.domain.member.base.CuMember">
 | 
			
		||||
        select cm.*
 | 
			
		||||
    <!-- 查询会员等级 -->
 | 
			
		||||
    <select id="getGradeSvipMember" resultType="com.hzs.common.domain.member.ext.CuMemberExt">
 | 
			
		||||
        select cm.*, bg.grade_value gradeValue
 | 
			
		||||
        from cu_member cm
 | 
			
		||||
                 left join bd_grade bg
 | 
			
		||||
                           on bg.pk_id = cm.pk_settle_grade
 | 
			
		||||
        where cm.del_flag = 0
 | 
			
		||||
          and cm.category = 0
 | 
			
		||||
          and cm.pk_id = #{pkMember}
 | 
			
		||||
          and bg.grade_value = 70
 | 
			
		||||
          <!--
 | 
			
		||||
          and bg.grade_value = #{gradeValue}
 | 
			
		||||
          -->
 | 
			
		||||
    </select>
 | 
			
		||||
 | 
			
		||||
    <!-- 查询会员直推大于博羚店主的注册、升级订单 -->
 | 
			
		||||
| 
						 | 
				
			
			@ -2416,7 +2418,7 @@
 | 
			
		|||
        <if test="orderCode != null and orderCode != ''">
 | 
			
		||||
            and so.order_code != #{orderCode}
 | 
			
		||||
        </if>
 | 
			
		||||
        and bg.grade_value >= 60) so
 | 
			
		||||
        and bg.grade_value >= #{gradeValue}) so
 | 
			
		||||
        where rownum = 1
 | 
			
		||||
    </select>
 | 
			
		||||
    <select id="getMemberCountWithGradeAndParent" resultType="java.lang.Integer">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1180,69 +1180,69 @@ public class MemberReportController extends BaseController {
 | 
			
		|||
 | 
			
		||||
        return getDataTable(orderDistributionList);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 出货明细汇总统计
 | 
			
		||||
     */
 | 
			
		||||
    @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.PRODUCT_SHIPPING_DETAILS_LIST, method = EOperationMethod.SELECT)
 | 
			
		||||
    @GetMapping("/product-shipping-details-list")
 | 
			
		||||
    public TableDataInfo productShippingDetailsList(String productName, Integer pkClassify, Date startTime, Date endTime, Integer orderType) {
 | 
			
		||||
        startPage();
 | 
			
		||||
        Integer pkCountry = SecurityUtils.getPkCountry();
 | 
			
		||||
        List<Integer> orderTypeList = EOrderBusiness.getOrderTypeList(orderType);
 | 
			
		||||
        if (endTime != null) {
 | 
			
		||||
            endTime = DateUtils.getEndTime(endTime);
 | 
			
		||||
        }
 | 
			
		||||
        List<ProductOrderInfoVo> memberReportList = memberReportService.getProductOrderInfo(productName, pkClassify, startTime, endTime, pkCountry, orderTypeList);
 | 
			
		||||
        for (ProductOrderInfoVo productOrderInfoVo : memberReportList) {
 | 
			
		||||
            if (productOrderInfoVo.getProductPrice() != null) {
 | 
			
		||||
                productOrderInfoVo.setProductTotalPrice(productOrderInfoVo.getProductPrice());
 | 
			
		||||
            } else {
 | 
			
		||||
                productOrderInfoVo.setProductTotalPrice(BigDecimal.ZERO);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (productOrderInfoVo.getOrderType() != null) {
 | 
			
		||||
                productOrderInfoVo.setOrderTypeStr(EOrderType.getEnumByValue(productOrderInfoVo.getOrderType()).getLabel());
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        // 计算总计
 | 
			
		||||
        Integer count = memberReportService.sumQuantity(productName, pkClassify, startTime, endTime, pkCountry, orderTypeList);
 | 
			
		||||
        ProductOrderInfoVo productOrderInfoVo = new ProductOrderInfoVo();
 | 
			
		||||
        productOrderInfoVo.setProductCode("总计");
 | 
			
		||||
        productOrderInfoVo.setProductName("-");
 | 
			
		||||
        productOrderInfoVo.setQuantity(count);
 | 
			
		||||
        productOrderInfoVo.setProductTotalPrice(BigDecimal.ZERO);
 | 
			
		||||
        memberReportList.add(productOrderInfoVo);
 | 
			
		||||
        return getDataTable(memberReportList);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 出货明细汇总导出
 | 
			
		||||
     *
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.PRODUCT_SHIPPING_DETAILS_LIST, method = EOperationMethod.EXPORT)
 | 
			
		||||
    @PostMapping("/product-shipping-details-export")
 | 
			
		||||
    public void productShippingDetailsExport(String productName, Integer pkClassify, Date startTime, Date endTime, Integer orderType, HttpServletResponse response) {
 | 
			
		||||
        Integer pkCountry = SecurityUtils.getPkCountry();
 | 
			
		||||
        List<Integer> orderTypeList = EOrderBusiness.getOrderTypeList(orderType);
 | 
			
		||||
        if (endTime != null) {
 | 
			
		||||
            endTime = DateUtils.getEndTime(endTime);
 | 
			
		||||
        }
 | 
			
		||||
        List<ProductOrderInfoVo> memberReportList = memberReportService.getProductOrderInfo(productName, pkClassify, startTime, endTime, pkCountry, orderTypeList);
 | 
			
		||||
        for (ProductOrderInfoVo productOrderInfoVo : memberReportList) {
 | 
			
		||||
            if (productOrderInfoVo.getProductPrice() != null) {
 | 
			
		||||
                productOrderInfoVo.setProductTotalPrice(productOrderInfoVo.getProductPrice());
 | 
			
		||||
            } else {
 | 
			
		||||
                productOrderInfoVo.setProductTotalPrice(BigDecimal.ZERO);
 | 
			
		||||
            }
 | 
			
		||||
            if (productOrderInfoVo.getOrderType() != null) {
 | 
			
		||||
                productOrderInfoVo.setOrderTypeStr(EOrderType.getEnumByValue(productOrderInfoVo.getOrderType()).getLabel());
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        ExcelUtil<ProductOrderInfoVo> util = new ExcelUtil<>(ProductOrderInfoVo.class);
 | 
			
		||||
        util.exportExcel(response, memberReportList, "出货明细汇总导出");
 | 
			
		||||
    }
 | 
			
		||||
//
 | 
			
		||||
//    /**
 | 
			
		||||
//     * 出货明细汇总统计
 | 
			
		||||
//     */
 | 
			
		||||
//    @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.PRODUCT_SHIPPING_DETAILS_LIST, method = EOperationMethod.SELECT)
 | 
			
		||||
//    @GetMapping("/product-shipping-details-list")
 | 
			
		||||
//    public TableDataInfo productShippingDetailsList(String productName, Integer pkClassify, Date startTime, Date endTime, Integer orderType) {
 | 
			
		||||
//        startPage();
 | 
			
		||||
//        Integer pkCountry = SecurityUtils.getPkCountry();
 | 
			
		||||
//        List<Integer> orderTypeList = EOrderBusiness.getOrderTypeList(orderType);
 | 
			
		||||
//        if (endTime != null) {
 | 
			
		||||
//            endTime = DateUtils.getEndTime(endTime);
 | 
			
		||||
//        }
 | 
			
		||||
//        List<ProductOrderInfoVo> memberReportList = memberReportService.getProductOrderInfo(productName, pkClassify, startTime, endTime, pkCountry, orderTypeList);
 | 
			
		||||
//        for (ProductOrderInfoVo productOrderInfoVo : memberReportList) {
 | 
			
		||||
//            if (productOrderInfoVo.getProductPrice() != null) {
 | 
			
		||||
//                productOrderInfoVo.setProductTotalPrice(productOrderInfoVo.getProductPrice());
 | 
			
		||||
//            } else {
 | 
			
		||||
//                productOrderInfoVo.setProductTotalPrice(BigDecimal.ZERO);
 | 
			
		||||
//            }
 | 
			
		||||
//
 | 
			
		||||
//            if (productOrderInfoVo.getOrderType() != null) {
 | 
			
		||||
//                productOrderInfoVo.setOrderTypeStr(EOrderType.getEnumByValue(productOrderInfoVo.getOrderType()).getLabel());
 | 
			
		||||
//            }
 | 
			
		||||
//        }
 | 
			
		||||
//        // 计算总计
 | 
			
		||||
//        Integer count = memberReportService.sumQuantity(productName, pkClassify, startTime, endTime, pkCountry, orderTypeList);
 | 
			
		||||
//        ProductOrderInfoVo productOrderInfoVo = new ProductOrderInfoVo();
 | 
			
		||||
//        productOrderInfoVo.setProductCode("总计");
 | 
			
		||||
//        productOrderInfoVo.setProductName("-");
 | 
			
		||||
//        productOrderInfoVo.setQuantity(count);
 | 
			
		||||
//        productOrderInfoVo.setProductTotalPrice(BigDecimal.ZERO);
 | 
			
		||||
//        memberReportList.add(productOrderInfoVo);
 | 
			
		||||
//        return getDataTable(memberReportList);
 | 
			
		||||
//    }
 | 
			
		||||
//
 | 
			
		||||
//    /**
 | 
			
		||||
//     * 出货明细汇总导出
 | 
			
		||||
//     *
 | 
			
		||||
//     * @return
 | 
			
		||||
//     */
 | 
			
		||||
//    @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.PRODUCT_SHIPPING_DETAILS_LIST, method = EOperationMethod.EXPORT)
 | 
			
		||||
//    @PostMapping("/product-shipping-details-export")
 | 
			
		||||
//    public void productShippingDetailsExport(String productName, Integer pkClassify, Date startTime, Date endTime, Integer orderType, HttpServletResponse response) {
 | 
			
		||||
//        Integer pkCountry = SecurityUtils.getPkCountry();
 | 
			
		||||
//        List<Integer> orderTypeList = EOrderBusiness.getOrderTypeList(orderType);
 | 
			
		||||
//        if (endTime != null) {
 | 
			
		||||
//            endTime = DateUtils.getEndTime(endTime);
 | 
			
		||||
//        }
 | 
			
		||||
//        List<ProductOrderInfoVo> memberReportList = memberReportService.getProductOrderInfo(productName, pkClassify, startTime, endTime, pkCountry, orderTypeList);
 | 
			
		||||
//        for (ProductOrderInfoVo productOrderInfoVo : memberReportList) {
 | 
			
		||||
//            if (productOrderInfoVo.getProductPrice() != null) {
 | 
			
		||||
//                productOrderInfoVo.setProductTotalPrice(productOrderInfoVo.getProductPrice());
 | 
			
		||||
//            } else {
 | 
			
		||||
//                productOrderInfoVo.setProductTotalPrice(BigDecimal.ZERO);
 | 
			
		||||
//            }
 | 
			
		||||
//            if (productOrderInfoVo.getOrderType() != null) {
 | 
			
		||||
//                productOrderInfoVo.setOrderTypeStr(EOrderType.getEnumByValue(productOrderInfoVo.getOrderType()).getLabel());
 | 
			
		||||
//            }
 | 
			
		||||
//        }
 | 
			
		||||
//        ExcelUtil<ProductOrderInfoVo> util = new ExcelUtil<>(ProductOrderInfoVo.class);
 | 
			
		||||
//        util.exportExcel(response, memberReportList, "出货明细汇总导出");
 | 
			
		||||
//    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 出货明细汇总统计详情
 | 
			
		||||
| 
						 | 
				
			
			@ -1544,4 +1544,60 @@ public class MemberReportController extends BaseController {
 | 
			
		|||
        return AjaxResult.success();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 产品销售统计列表
 | 
			
		||||
     */
 | 
			
		||||
    @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.PRODUCT_SHIPPING, method = EOperationMethod.SELECT)
 | 
			
		||||
    @GetMapping("/product-shipping")
 | 
			
		||||
    public TableDataInfo productShipping(ProductShippingParam param) {
 | 
			
		||||
        startPage();
 | 
			
		||||
        List<ProductShippingVO> productShippingList = memberReportService.listProductShipping(param);
 | 
			
		||||
        return getDataTable(productShippingList);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 产品销售统计导出
 | 
			
		||||
     */
 | 
			
		||||
    @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.PRODUCT_SHIPPING, method = EOperationMethod.EXPORT)
 | 
			
		||||
    @PostMapping("/product-shipping-export")
 | 
			
		||||
    public void productShippingExport(HttpServletResponse response, ProductShippingParam param) {
 | 
			
		||||
        List<ProductShippingVO> productShippingList = memberReportService.listProductShipping(param);
 | 
			
		||||
        ExcelUtil<ProductShippingVO> util = new ExcelUtil<>(ProductShippingVO.class);
 | 
			
		||||
        util.exportExcel(response, productShippingList, "出货明细汇总导出");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 产品销售统计详情
 | 
			
		||||
     */
 | 
			
		||||
    @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.PRODUCT_SHIPPING_DETAILS, method = EOperationMethod.SELECT)
 | 
			
		||||
    @GetMapping("/product-shipping-details")
 | 
			
		||||
    public TableDataInfo productShippingDetails(ProductShippingParam param) {
 | 
			
		||||
        startPage();
 | 
			
		||||
        List<ProductShippingDetailsVO> productOrderInfoVoList = memberReportService.listProductShippingDetail(param);
 | 
			
		||||
        if (CollectionUtil.isNotEmpty(productOrderInfoVoList)) {
 | 
			
		||||
            for (ProductShippingDetailsVO productShippingDetailsVO : productOrderInfoVoList) {
 | 
			
		||||
                productShippingDetailsVO.setSpecialAreaVal(ESpecialArea.getLabelByValue(productShippingDetailsVO.getSpecialArea()));
 | 
			
		||||
                productShippingDetailsVO.setIsMakerGiftVal(EWaresType.getEnumLabelByValue(productShippingDetailsVO.getIsMakerGift()));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return getDataTable(productOrderInfoVoList);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 产品销售统计详情导出
 | 
			
		||||
     */
 | 
			
		||||
    @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.PRODUCT_SHIPPING_DETAILS, method = EOperationMethod.EXPORT)
 | 
			
		||||
    @PostMapping("/product-shipping-details-export")
 | 
			
		||||
    public void productShippingDetailsExport(HttpServletResponse response, ProductShippingParam param) {
 | 
			
		||||
        List<ProductShippingDetailsVO> productOrderInfoVoList = memberReportService.listProductShippingDetail(param);
 | 
			
		||||
        if (CollectionUtil.isNotEmpty(productOrderInfoVoList)) {
 | 
			
		||||
            for (ProductShippingDetailsVO productShippingDetailsVO : productOrderInfoVoList) {
 | 
			
		||||
                productShippingDetailsVO.setSpecialAreaVal(ESpecialArea.getLabelByValue(productShippingDetailsVO.getSpecialArea()));
 | 
			
		||||
                productShippingDetailsVO.setIsMakerGiftVal(EWaresType.getEnumLabelByValue(productShippingDetailsVO.getIsMakerGift()));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        ExcelUtil<ProductShippingDetailsVO> util = new ExcelUtil<>(ProductShippingDetailsVO.class);
 | 
			
		||||
        util.exportExcel(response, productOrderInfoVoList, "出货明细汇总统计详情");
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,7 @@
 | 
			
		|||
package com.hzs.report.member.mapper;
 | 
			
		||||
 | 
			
		||||
import com.hzs.report.member.param.ProductDetailQueryParam;
 | 
			
		||||
import com.hzs.report.member.param.ProductShippingParam;
 | 
			
		||||
import com.hzs.report.member.vo.*;
 | 
			
		||||
import org.apache.ibatis.annotations.Param;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -425,4 +426,13 @@ public interface MemberReportMapper {
 | 
			
		|||
     **/
 | 
			
		||||
    List<DirectPushNewVo> querDirectPushDetails(DirectPushNewVo directPushNewVo);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 产品销售统计列表
 | 
			
		||||
     */
 | 
			
		||||
    List<ProductShippingVO> listProductShipping(@Param("param") ProductShippingParam param);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 出货明细汇总统计详情
 | 
			
		||||
     */
 | 
			
		||||
    List<ProductShippingDetailsVO> listProductShippingDetail(@Param("param") ProductShippingParam param);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,35 @@
 | 
			
		|||
package com.hzs.report.member.param;
 | 
			
		||||
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 产品销售统计入参
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
public class ProductShippingParam {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 仓储编号
 | 
			
		||||
     */
 | 
			
		||||
    private String wmsCode;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 产品编号
 | 
			
		||||
     */
 | 
			
		||||
    private String productCode;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 产品名称
 | 
			
		||||
     */
 | 
			
		||||
    private String productName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 开始时间
 | 
			
		||||
     */
 | 
			
		||||
    private String startTime;
 | 
			
		||||
    /**
 | 
			
		||||
     * 结束时间
 | 
			
		||||
     */
 | 
			
		||||
    private String endTime;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,6 +1,7 @@
 | 
			
		|||
package com.hzs.report.member.service;
 | 
			
		||||
 | 
			
		||||
import com.hzs.report.member.param.ProductDetailQueryParam;
 | 
			
		||||
import com.hzs.report.member.param.ProductShippingParam;
 | 
			
		||||
import com.hzs.report.member.vo.*;
 | 
			
		||||
 | 
			
		||||
import java.math.BigDecimal;
 | 
			
		||||
| 
						 | 
				
			
			@ -232,4 +233,14 @@ public interface MemberReportService {
 | 
			
		|||
     * 创建表
 | 
			
		||||
     **/
 | 
			
		||||
    void createCuMemberAmountBoxTable(String tabeName);
 | 
			
		||||
    /**
 | 
			
		||||
     * 产品销售统计列表
 | 
			
		||||
     */
 | 
			
		||||
    List<ProductShippingVO> listProductShipping(ProductShippingParam param);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 产品销售统计详情列表
 | 
			
		||||
     */
 | 
			
		||||
    List<ProductShippingDetailsVO> listProductShippingDetail(ProductShippingParam param);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -12,6 +12,7 @@ import com.hzs.common.domain.system.config.BdAccount;
 | 
			
		|||
import com.hzs.common.service.ITransactionCommonService;
 | 
			
		||||
import com.hzs.report.member.mapper.MemberReportMapper;
 | 
			
		||||
import com.hzs.report.member.param.ProductDetailQueryParam;
 | 
			
		||||
import com.hzs.report.member.param.ProductShippingParam;
 | 
			
		||||
import com.hzs.report.member.service.MemberReportService;
 | 
			
		||||
import com.hzs.report.member.vo.*;
 | 
			
		||||
import com.hzs.report.report.service.ICuMemberSettlePeriodService;
 | 
			
		||||
| 
						 | 
				
			
			@ -602,5 +603,14 @@ public class MemberReportServiceImpl implements MemberReportService {
 | 
			
		|||
        memberReportMapper.createCuMemberAmountBoxTable(tabeName);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<ProductShippingVO> listProductShipping(ProductShippingParam param) {
 | 
			
		||||
        return memberReportMapper.listProductShipping(param);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<ProductShippingDetailsVO> listProductShippingDetail(ProductShippingParam param) {
 | 
			
		||||
        return memberReportMapper.listProductShippingDetail(param);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,37 @@
 | 
			
		|||
package com.hzs.report.member.vo;
 | 
			
		||||
 | 
			
		||||
import com.hzs.common.core.annotation.Excel;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
public class ProductShippingDetailsVO implements Serializable {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 仓储编号
 | 
			
		||||
     */
 | 
			
		||||
    @Excel(name = "仓储编号")
 | 
			
		||||
    private String wmsCode;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 所属专区
 | 
			
		||||
     */
 | 
			
		||||
    private Integer specialArea;
 | 
			
		||||
    @Excel(name = "所属专区")
 | 
			
		||||
    private String specialAreaVal;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 商品类型
 | 
			
		||||
     */
 | 
			
		||||
    private Integer isMakerGift;
 | 
			
		||||
    @Excel(name = "商品类型")
 | 
			
		||||
    private String isMakerGiftVal;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 销量
 | 
			
		||||
     */
 | 
			
		||||
    @Excel(name = "销量")
 | 
			
		||||
    private Integer quantity;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,35 @@
 | 
			
		|||
package com.hzs.report.member.vo;
 | 
			
		||||
 | 
			
		||||
import com.hzs.common.core.annotation.Excel;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
public class ProductShippingVO implements Serializable {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 仓储编号
 | 
			
		||||
     */
 | 
			
		||||
    @Excel(name = "仓储编号")
 | 
			
		||||
    private String wmsCode;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 产品名称
 | 
			
		||||
     */
 | 
			
		||||
    @Excel(name = "产品名称")
 | 
			
		||||
    private String productName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 产品编号
 | 
			
		||||
     */
 | 
			
		||||
    @Excel(name = "产品编号")
 | 
			
		||||
    private String productCode;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 销量
 | 
			
		||||
     */
 | 
			
		||||
    @Excel(name = "销量")
 | 
			
		||||
    private Integer quantity;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -2005,4 +2005,79 @@
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    <!-- 产品销售统计列表 -->
 | 
			
		||||
    <select id="listProductShipping" resultType="com.hzs.report.member.vo.ProductShippingVO">
 | 
			
		||||
        select bp.wms_code,
 | 
			
		||||
        nvl(sum(tmp.quantity), 0) quantity,
 | 
			
		||||
        to_char(wm_concat(bp.product_name)) product_name,
 | 
			
		||||
        to_char(wm_concat(bp.product_code)) product_code
 | 
			
		||||
        from bd_product bp
 | 
			
		||||
        left join (
 | 
			
		||||
        select soi.pk_product, sum(soi.quantity) quantity
 | 
			
		||||
        from sa_order so
 | 
			
		||||
        left join sa_order_items soi
 | 
			
		||||
        on soi.pk_order = so.pk_id
 | 
			
		||||
        and soi.del_flag = 0
 | 
			
		||||
        where so.del_flag = 0
 | 
			
		||||
        and so.order_status = 1
 | 
			
		||||
        <if test="param.startTime != null">
 | 
			
		||||
            and so.pay_time >= to_date(#{param.startTime}, 'yyyy-mm-dd')
 | 
			
		||||
        </if>
 | 
			
		||||
        <if test="param.endTime != null">
 | 
			
		||||
            and to_date(#{param.endTime} || ' 23:59:59', 'yyyy-mm-dd hh24:mi:ss') >= so.pay_time
 | 
			
		||||
        </if>
 | 
			
		||||
        group by soi.pk_product
 | 
			
		||||
        ) tmp
 | 
			
		||||
        on tmp.pk_product = bp.pk_id
 | 
			
		||||
        where bp.del_flag = 0
 | 
			
		||||
        <if test="param.wmsCode != null and param.wmsCode !=''">
 | 
			
		||||
            and bp.wms_code = #{param.wmsCode}
 | 
			
		||||
        </if>
 | 
			
		||||
        <if test="param.productCode != null and param.productCode !=''">
 | 
			
		||||
            and bp.product_code = #{param.productCode}
 | 
			
		||||
        </if>
 | 
			
		||||
        <if test="param.productName != null and param.productName !=''">
 | 
			
		||||
            and bp.product_name like '%' || #{param.productName} ||'%'
 | 
			
		||||
        </if>
 | 
			
		||||
        group by bp.wms_code
 | 
			
		||||
        order by quantity desc
 | 
			
		||||
    </select>
 | 
			
		||||
 | 
			
		||||
    <!-- 产品销售统计明细列表 -->
 | 
			
		||||
    <select id="listProductShippingDetail" resultType="com.hzs.report.member.vo.ProductShippingDetailsVO">
 | 
			
		||||
        select #{param.wmsCode} wmsCode,
 | 
			
		||||
        soi.pk_product,
 | 
			
		||||
        so.order_type specialArea,
 | 
			
		||||
        soi.is_maker_gift,
 | 
			
		||||
        sum(soi.quantity) quantity
 | 
			
		||||
        from sa_order so
 | 
			
		||||
        left join sa_order_items soi
 | 
			
		||||
        on soi.pk_order = so.pk_id
 | 
			
		||||
        and soi.del_flag = 0
 | 
			
		||||
        where so.del_flag = 0
 | 
			
		||||
        and so.order_status = 1
 | 
			
		||||
        <if test="param.startTime != null">
 | 
			
		||||
            and so.pay_time >= to_date(#{param.startTime}, 'yyyy-mm-dd')
 | 
			
		||||
        </if>
 | 
			
		||||
        <if test="param.endTime != null">
 | 
			
		||||
            and to_date(#{param.endTime} || ' 23:59:59', 'yyyy-mm-dd hh24:mi:ss') >= so.pay_time
 | 
			
		||||
        </if>
 | 
			
		||||
        and soi.pk_product in
 | 
			
		||||
        (select bp.pk_id
 | 
			
		||||
        from bd_product bp
 | 
			
		||||
        where bp.del_flag = 0
 | 
			
		||||
        <if test="param.wmsCode != null and param.wmsCode !=''">
 | 
			
		||||
            and bp.wms_code = #{param.wmsCode}
 | 
			
		||||
        </if>
 | 
			
		||||
        <if test="param.productCode != null and param.productCode !=''">
 | 
			
		||||
            and bp.product_code = #{param.productCode}
 | 
			
		||||
        </if>
 | 
			
		||||
        <if test="param.productName != null and param.productName !=''">
 | 
			
		||||
            and bp.product_name like '%' || #{param.productName} ||'%'
 | 
			
		||||
        </if>
 | 
			
		||||
        )
 | 
			
		||||
        group by soi.pk_product, so.order_type, soi.IS_MAKER_GIFT
 | 
			
		||||
        order by so.order_type, soi.IS_MAKER_GIFT
 | 
			
		||||
    </select>
 | 
			
		||||
</mapper>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -98,6 +98,11 @@ public class ApiRetailOrderController {
 | 
			
		|||
            BdGrade bdGrade = iSaOrderService.calculateGrade(levelParam.getSpecialArea(), convertShoppingCarToSku(SecurityUtils.getUserId(), levelParam.getShopList()),
 | 
			
		||||
                    null, levelParam.getUpgradeMember(), SecurityUtils.getSystemType(), EYesNo.NO.getIntValue());
 | 
			
		||||
            if (null != bdGrade) {
 | 
			
		||||
                if (ESpecialArea.RETAIL_REGISTER.getValue() == levelParam.getSpecialArea()) {
 | 
			
		||||
                    // 注册专区,校验会员等级推荐范围
 | 
			
		||||
                    iRetailOrderService.checkMemberRegisterScope(iMemberServiceApi.getMember(SecurityUtils.getUserId()).getData(), bdGrade.getPkId());
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                orderLevelVO.setIsEnough(true);
 | 
			
		||||
                orderLevelVO.setPkGradeVal(bdGrade.getGradeName());
 | 
			
		||||
                orderLevelVO.setGradeValue(bdGrade.getGradeValue());
 | 
			
		||||
| 
						 | 
				
			
			@ -292,6 +297,9 @@ public class ApiRetailOrderController {
 | 
			
		|||
        // 封装订单信息
 | 
			
		||||
        SaOrderExt saOrderExt = iRetailOrderService.createSaOrder(registerParam, gradeList, newMember);
 | 
			
		||||
 | 
			
		||||
        // 校验会员等级推荐范围
 | 
			
		||||
        iRetailOrderService.checkMemberRegisterScope(registerParam.getCreatorMember(), newMember.getPkSettleGrade());
 | 
			
		||||
 | 
			
		||||
        // 校验会员账户状态等
 | 
			
		||||
        R<CuMemberAccountExt> accountResult = iRetailOrderService.validMemberAccount(pkMember, payParam.getPayPwd());
 | 
			
		||||
        if (!accountResult.isSuccess()) {
 | 
			
		||||
| 
						 | 
				
			
			@ -700,7 +708,6 @@ public class ApiRetailOrderController {
 | 
			
		|||
        orderParam.setPkParent(orderParam.getPkCreator());
 | 
			
		||||
 | 
			
		||||
        if (!creatorMember.getMemberCode().equals(orderParam.getParentCode())) {
 | 
			
		||||
 | 
			
		||||
            CuMember parentMember = iMemberServiceApi.getRetailMember(null, orderParam.getParentCode()).getData();
 | 
			
		||||
            if (null == parentMember) {
 | 
			
		||||
                return "推荐编号不存在";
 | 
			
		||||
| 
						 | 
				
			
			@ -718,7 +725,6 @@ public class ApiRetailOrderController {
 | 
			
		|||
            }
 | 
			
		||||
            orderParam.setPkParent(parentMember.getPkId());
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return null;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -141,4 +141,12 @@ public interface IRetailOrderService {
 | 
			
		|||
     */
 | 
			
		||||
    Long savePickOrder(SaOrder saOrder, List<SaOrderItems> saOrderItemsList);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 校验会员注册范围
 | 
			
		||||
     *
 | 
			
		||||
     * @param createMember
 | 
			
		||||
     * @param newSettleGrade
 | 
			
		||||
     */
 | 
			
		||||
    void checkMemberRegisterScope(CuMember createMember, Integer newSettleGrade);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -13,7 +13,6 @@ import com.hzs.common.core.config.BdConfig;
 | 
			
		|||
import com.hzs.common.core.constant.*;
 | 
			
		||||
import com.hzs.common.core.domain.R;
 | 
			
		||||
import com.hzs.common.core.enums.*;
 | 
			
		||||
import com.hzs.common.core.enums.retail.ERetailWaresPrice;
 | 
			
		||||
import com.hzs.common.core.exception.ServiceException;
 | 
			
		||||
import com.hzs.common.core.service.RedisService;
 | 
			
		||||
import com.hzs.common.core.utils.*;
 | 
			
		||||
| 
						 | 
				
			
			@ -31,6 +30,7 @@ import com.hzs.common.domain.sale.product.BdProduct;
 | 
			
		|||
import com.hzs.common.domain.sale.wares.BdWaresRange;
 | 
			
		||||
import com.hzs.common.domain.system.base.BdStorehouse;
 | 
			
		||||
import com.hzs.common.domain.system.config.BdGrade;
 | 
			
		||||
import com.hzs.common.domain.system.ext.BdGradeScopeExt;
 | 
			
		||||
import com.hzs.common.security.utils.SecurityUtils;
 | 
			
		||||
import com.hzs.member.account.IMemberAccountServiceApi;
 | 
			
		||||
import com.hzs.member.base.IMemberServiceApi;
 | 
			
		||||
| 
						 | 
				
			
			@ -120,6 +120,9 @@ public class RetailOrderServiceImpl implements IRetailOrderService {
 | 
			
		|||
        // 封装订单信息
 | 
			
		||||
        SaOrderExt saOrderExt = this.createSaOrder(registerParam, gradeList, newMember);
 | 
			
		||||
 | 
			
		||||
        // 校验会员等级推荐范围
 | 
			
		||||
        this.checkMemberRegisterScope(registerParam.getCreatorMember(), newMember.getPkSettleGrade());
 | 
			
		||||
 | 
			
		||||
        // 订单缓存(60分钟有效,防止在线支付回调慢)
 | 
			
		||||
        redisService.setCacheObject(CacheConstants.RETAIL_TEMP_ORDER + registerParam.getPkCreator() + registerParam.getOrderCode(), saOrderExt, CacheConstants.RETAIL_ORDER_EXPIRE_TIME * 2, TimeUnit.MINUTES);
 | 
			
		||||
        registerParam.setPkGrade(newMember.getPkSettleGrade());
 | 
			
		||||
| 
						 | 
				
			
			@ -990,4 +993,18 @@ public class RetailOrderServiceImpl implements IRetailOrderService {
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void checkMemberRegisterScope(CuMember createMember, Integer newSettleGrade) {
 | 
			
		||||
        // 2025.08.21 店主及以下,只能推荐店主及以下
 | 
			
		||||
        List<BdGradeScopeExt> bdGradeScopeExtList = iGradeServiceApi.queryGradeConfigByCondition(createMember.getPkSettleCountry(), createMember.getPkSettleGrade()).getData().getBdGradeScopeExtList();
 | 
			
		||||
        if (CollectionUtil.isNotEmpty(bdGradeScopeExtList)) {
 | 
			
		||||
            for (BdGradeScopeExt bdGradeScopeExt : bdGradeScopeExtList) {
 | 
			
		||||
                if (bdGradeScopeExt.getPkScope().equals(newSettleGrade)) {
 | 
			
		||||
                    return;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        throw new ServiceException("不能注册当前新会员等级");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -61,8 +61,6 @@ public class ApiOrderController extends BaseController {
 | 
			
		|||
    private ISaDeliverService iSaDeliverService;
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private IOrderBusinessService iOrderBusinessService;
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private ISaDeliverItemsService saDeliverItemsService;
 | 
			
		||||
 | 
			
		||||
    @DubboReference
 | 
			
		||||
    ICurrencyServiceApi iCurrencyServiceApi;
 | 
			
		||||
| 
						 | 
				
			
			@ -537,8 +535,6 @@ public class ApiOrderController extends BaseController {
 | 
			
		|||
        if (null != param.getCreationTimeEnd()) {
 | 
			
		||||
            param.setCreationTimeEnd(DateUtils.getEndTime(param.getCreationTimeEnd()));
 | 
			
		||||
        }
 | 
			
		||||
        // 会员ID
 | 
			
		||||
        Long userId = SecurityUtils.getUserId();
 | 
			
		||||
        // 返回的订单数据
 | 
			
		||||
        List<MyOrderVO> myOrderList = new ArrayList<>();
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,7 +6,6 @@ import cn.hutool.json.JSONUtil;
 | 
			
		|||
import com.alibaba.fastjson2.JSONObject;
 | 
			
		||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 | 
			
		||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 | 
			
		||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 | 
			
		||||
import com.hzs.bonus.settle.IMemberSettleBonusApi;
 | 
			
		||||
import com.hzs.common.core.constant.*;
 | 
			
		||||
import com.hzs.common.core.constant.msg.*;
 | 
			
		||||
| 
						 | 
				
			
			@ -2356,8 +2355,7 @@ public class OrderBusinessServiceImpl implements IOrderBusinessService {
 | 
			
		|||
            return myOrderVO;
 | 
			
		||||
        }
 | 
			
		||||
        if (myOrderVO.getOrderType() == EOrderType.RETAIL_REGISTER.getValue() ||
 | 
			
		||||
                myOrderVO.getOrderType() == EOrderType.RETAIL_UPGRADE.getValue() ||
 | 
			
		||||
                myOrderVO.getOrderType() == EOrderType.RETAIL_REPURCHASE.getValue()) {
 | 
			
		||||
                myOrderVO.getOrderType() == EOrderType.RETAIL_UPGRADE.getValue()) {
 | 
			
		||||
            String lastOrderCode = iSaOrderService.lastOrderList(userId, myOrderVO.getPkCountry());
 | 
			
		||||
            if (StringUtils.isEmpty(lastOrderCode) || !lastOrderCode.equals(myOrderVO.getOrderCode())) {
 | 
			
		||||
                myOrderVO.setMsg(TransactionUtils.getContent(SaOrderMsgConstants.CHECK_MEMBER_LAST_ORDER));
 | 
			
		||||
| 
						 | 
				
			
			@ -2397,7 +2395,8 @@ public class OrderBusinessServiceImpl implements IOrderBusinessService {
 | 
			
		|||
        }
 | 
			
		||||
        // 校验订单是否存在进行中的签呈
 | 
			
		||||
        if (iSaOrderChargeLogService.checkOrderApprovalExist(
 | 
			
		||||
                Arrays.asList(EApprovalBusiness.ORDER_CHANGE_ADDRESS.getValue(), EApprovalBusiness.ORDER_CHANGE_PRODUCT.getValue(),
 | 
			
		||||
                Arrays.asList(EApprovalBusiness.ORDER_CHANGE_ADDRESS.getValue(),
 | 
			
		||||
                        EApprovalBusiness.ORDER_CHANGE_PRODUCT.getValue(),
 | 
			
		||||
                        EApprovalBusiness.ORDER_RETURN.getValue(), approveBusiness,
 | 
			
		||||
                        EApprovalBusiness.ORDER_CANCEL_PRODUCT.getValue()
 | 
			
		||||
                ),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2119,8 +2119,9 @@ public class SaOrderServiceImpl extends ServiceImpl<SaOrderMapper, SaOrder> impl
 | 
			
		|||
//            iSaOrderWaresLimitService.updateCancelOrder(saOrderExt.getPkId(), saOrderExt.getPkMember(), saOrderExt.getModifiedTime(), boxProductList);
 | 
			
		||||
//        }
 | 
			
		||||
 | 
			
		||||
        if (!iMemberServiceApi.normalRevokeOrder(pkApprove, saOrderExt, cuMember, businessCommissionDTO).getData()) {
 | 
			
		||||
            throw new ServiceException("撤单处理会员失败");
 | 
			
		||||
        R<Boolean> tmpR = iMemberServiceApi.normalRevokeOrder(pkApprove, saOrderExt, cuMember, businessCommissionDTO);
 | 
			
		||||
        if (!tmpR.isSuccess()) {
 | 
			
		||||
            throw new ServiceException("撤单失败 " + tmpR.getMsg());
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -320,7 +320,7 @@
 | 
			
		|||
        soi.soi.wares_quantity,
 | 
			
		||||
        bc.in_exchange_rate,
 | 
			
		||||
        case
 | 
			
		||||
        when soi.order_status in (1, 2) then
 | 
			
		||||
        when soi.order_status in (1, 2, 6) then
 | 
			
		||||
        0
 | 
			
		||||
        else
 | 
			
		||||
        1
 | 
			
		||||
| 
						 | 
				
			
			@ -529,7 +529,7 @@
 | 
			
		|||
            <choose>
 | 
			
		||||
                <when test="param.orderStatus == 1">
 | 
			
		||||
                    <!-- 前台如果查询待发货,需要包括已合单 -->
 | 
			
		||||
                    and soi.order_status in (1, 2)
 | 
			
		||||
                    and soi.order_status in (1, 2, 6)
 | 
			
		||||
                </when>
 | 
			
		||||
                <otherwise>
 | 
			
		||||
                    and soi.order_status = #{param.orderStatus}
 | 
			
		||||
| 
						 | 
				
			
			@ -607,7 +607,7 @@
 | 
			
		|||
        </if>
 | 
			
		||||
        <!-- 订单显示的时候,待支付只有注册订单显示,其它状态不做限制 -->
 | 
			
		||||
        and (
 | 
			
		||||
        soi.order_status in (1, 2, 3, 5)
 | 
			
		||||
        soi.order_status in (1, 2, 3, 5, 6)
 | 
			
		||||
        or (soi.order_status = 0 and so.order_type in (1))
 | 
			
		||||
        )
 | 
			
		||||
        <!-- 续约定单不能撤单
 | 
			
		||||
| 
						 | 
				
			
			@ -1197,12 +1197,12 @@
 | 
			
		|||
                          LEFT JOIN sa_order_items soi ON soi.pk_order = so.pk_id
 | 
			
		||||
                     AND soi.del_flag = 0
 | 
			
		||||
                 WHERE so.del_flag = 0
 | 
			
		||||
                   and so.order_type in (41, 42,43)
 | 
			
		||||
                   and so.order_type in (41, 42)
 | 
			
		||||
                   and soi.del_flag = 0
 | 
			
		||||
                   and so.ORDER_STATUS = 1
 | 
			
		||||
                   and so.PAY_TIME is not null
 | 
			
		||||
                   and (so.pk_creator = #{memberId} or so.pk_member = #{memberId})
 | 
			
		||||
                   AND soi.order_status = 1
 | 
			
		||||
                   AND soi.order_status in (1, 6)
 | 
			
		||||
                 ORDER BY so.PAY_TIME DESC
 | 
			
		||||
             )
 | 
			
		||||
        WHERE ROWNUM = 1
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -330,7 +330,19 @@ public class EnumsController extends BaseController {
 | 
			
		|||
        return AjaxResult.success(enumEntityList);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 出货相关订单类型
 | 
			
		||||
     *
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    @GetMapping("/order-shipment")
 | 
			
		||||
    public AjaxResult orderShipment() {
 | 
			
		||||
        List<EnumEntity> enumEntityList = new ArrayList<>();
 | 
			
		||||
        for (EOrderShipment value : EOrderShipment.values()) {
 | 
			
		||||
            enumEntityList.add(new EnumEntity(value.getValue(), value.getLabel(), EnumsPrefixConstants.ORDER_SHIPMENT));
 | 
			
		||||
        }
 | 
			
		||||
        return AjaxResult.success(enumEntityList);
 | 
			
		||||
    }
 | 
			
		||||
    /**
 | 
			
		||||
     * 单个批量枚举
 | 
			
		||||
     *
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -109,7 +109,7 @@
 | 
			
		|||
                 from sa_order so
 | 
			
		||||
                 where so.del_flag = 0
 | 
			
		||||
                   and so.order_status = 1
 | 
			
		||||
                   and so.order_type in (1, 2, 24, 25)
 | 
			
		||||
                   and so.order_type in (41, 42)
 | 
			
		||||
                   and to_char(so.pay_time, 'yyyy-mm-dd') =
 | 
			
		||||
                       to_char(sysdate, 'yyyy-mm-dd')
 | 
			
		||||
             ) a
 | 
			
		||||
| 
						 | 
				
			
			@ -119,7 +119,7 @@
 | 
			
		|||
            from sa_order so
 | 
			
		||||
            where so.del_flag = 0
 | 
			
		||||
              and so.order_status = 1
 | 
			
		||||
              and so.order_type in (3, 26, 10)
 | 
			
		||||
              and so.order_type in (43, 44)
 | 
			
		||||
              and to_char(so.pay_time, 'yyyy-mm-dd') =
 | 
			
		||||
                  to_char(sysdate, 'yyyy-mm-dd')
 | 
			
		||||
        ) b on 1 = 1
 | 
			
		||||
| 
						 | 
				
			
			@ -131,7 +131,7 @@
 | 
			
		|||
                 from sa_order so
 | 
			
		||||
                 where so.del_flag = 0
 | 
			
		||||
                   and so.order_status = 1
 | 
			
		||||
                   and so.order_type in (1, 2, 24, 25)
 | 
			
		||||
                   and so.order_type in (41, 42)
 | 
			
		||||
                   and to_char(so.pay_time, 'yyyy-mm-dd') =
 | 
			
		||||
                       to_char(sysdate - 1, 'yyyy-mm-dd')
 | 
			
		||||
             ) a
 | 
			
		||||
| 
						 | 
				
			
			@ -141,7 +141,7 @@
 | 
			
		|||
            from sa_order so
 | 
			
		||||
            where so.del_flag = 0
 | 
			
		||||
              and so.order_status = 1
 | 
			
		||||
              and so.order_type in (3, 26, 10)
 | 
			
		||||
              and so.order_type in (43, 44)
 | 
			
		||||
              and to_char(so.pay_time, 'yyyy-mm-dd') =
 | 
			
		||||
                  to_char(sysdate - 1, 'yyyy-mm-dd')
 | 
			
		||||
        ) b on 1 = 1
 | 
			
		||||
| 
						 | 
				
			
			@ -156,7 +156,7 @@
 | 
			
		|||
              from sa_order so
 | 
			
		||||
              where so.del_flag = 0
 | 
			
		||||
                and so.order_status = 1
 | 
			
		||||
                and so.order_type in (1, 2, 24, 25)
 | 
			
		||||
                and so.order_type in (41, 42)
 | 
			
		||||
                and to_char(so.pay_time, 'yyyy-mm') = to_char(sysdate, 'yyyy-mm')
 | 
			
		||||
             ) a
 | 
			
		||||
                 left join (
 | 
			
		||||
| 
						 | 
				
			
			@ -165,7 +165,7 @@
 | 
			
		|||
            from sa_order so
 | 
			
		||||
            where so.del_flag = 0
 | 
			
		||||
              and so.order_status = 1
 | 
			
		||||
              and so.order_type in (3, 26, 10)
 | 
			
		||||
              and so.order_type in (43, 44)
 | 
			
		||||
              and to_char(so.pay_time, 'yyyy-mm') =
 | 
			
		||||
                  to_char(sysdate, 'yyyy-mm')
 | 
			
		||||
        ) b on 1 = 1
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -330,6 +330,11 @@ public class EnumsPrefixConstants {
 | 
			
		|||
     */
 | 
			
		||||
    public static final String ORDER_UP_BUSINESS = "ENU_ORDER_UP_BUSINESS_";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 出货相关订单类型
 | 
			
		||||
     */
 | 
			
		||||
    public static final String ORDER_SHIPMENT = "ENU_ORDER_SHIPMENT_";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 支付业务类型
 | 
			
		||||
     */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,6 +14,30 @@ public class RetailConstants {
 | 
			
		|||
     */
 | 
			
		||||
    public static final Integer PICK_BASE = 4;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 2025.08.21 直推级差金额比例
 | 
			
		||||
     * 会员 - 15%
 | 
			
		||||
     * VIP - 20%
 | 
			
		||||
     * 合伙人1 - 25%
 | 
			
		||||
     * 合伙人2 - 30%
 | 
			
		||||
     * 合伙人3 - 32.5%
 | 
			
		||||
     * 博羚店主 - 50%
 | 
			
		||||
     * 高级店主 - 52%
 | 
			
		||||
     * 区域代理 - 55%
 | 
			
		||||
     * 董事代理 - 55%
 | 
			
		||||
     * 总公司 - 60%
 | 
			
		||||
     */
 | 
			
		||||
    public static final BigDecimal RECOMMEND_HAI_FAN = new BigDecimal("0.15");
 | 
			
		||||
    public static final BigDecimal RECOMMEND_YOU_KE = new BigDecimal("0.2");
 | 
			
		||||
    public static final BigDecimal RECOMMEND_MAKER_1 = new BigDecimal("0.25");
 | 
			
		||||
    public static final BigDecimal RECOMMEND_MAKER_2 = new BigDecimal("0.3");
 | 
			
		||||
    public static final BigDecimal RECOMMEND_MAKER_3 = new BigDecimal("0.325");
 | 
			
		||||
    public static final BigDecimal RECOMMEND_VIP = new BigDecimal("0.5");
 | 
			
		||||
    public static final BigDecimal RECOMMEND_S_VIP = new BigDecimal("0.52");
 | 
			
		||||
    public static final BigDecimal RECOMMEND_REGION = new BigDecimal("0.55");
 | 
			
		||||
    public static final BigDecimal RECOMMEND_DIRECTOR = new BigDecimal("0.55");
 | 
			
		||||
    public static final BigDecimal RECOMMEND_COMPANY = new BigDecimal("0.6");
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 2025.08.13 添加分公司级差收益,每1盒(4个产品)
 | 
			
		||||
     * 第一分公司4元 -- 区域代理
 | 
			
		||||
| 
						 | 
				
			
			@ -24,94 +48,6 @@ public class RetailConstants {
 | 
			
		|||
    public static final BigDecimal BRANCH = new BigDecimal("4");
 | 
			
		||||
    public static final BigDecimal COMPANY_TOTAL = new BigDecimal("14");
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 会员 推 会员 30
 | 
			
		||||
     * VIP 推 会员 40
 | 
			
		||||
     * 合伙人 推 会员 50
 | 
			
		||||
     * 博羚店主 推 会员 100
 | 
			
		||||
     * 高级店主 推 会员 104
 | 
			
		||||
     * 区域代理、董事代理 推 会员 110
 | 
			
		||||
     * 总公司 推 会员 120
 | 
			
		||||
     */
 | 
			
		||||
    public static final BigDecimal V1_V1 = new BigDecimal("30");
 | 
			
		||||
    public static final BigDecimal V2_V1 = new BigDecimal("40");
 | 
			
		||||
    public static final BigDecimal V3_V1 = new BigDecimal("50");
 | 
			
		||||
    public static final BigDecimal V4_V1 = new BigDecimal("100");
 | 
			
		||||
    public static final BigDecimal V5_V1 = new BigDecimal("104");
 | 
			
		||||
    public static final BigDecimal V6_V7_V1 = new BigDecimal("110");
 | 
			
		||||
    public static final BigDecimal V8_V1 = new BigDecimal("120");
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 会员 推 VIP 300
 | 
			
		||||
     * VIP 推 VIP 400
 | 
			
		||||
     * 合伙人 推 VIP 500
 | 
			
		||||
     * 博羚店主 推 VIP 1000
 | 
			
		||||
     * 高级店主 推 VIP 1040
 | 
			
		||||
     * 区域代理、董事代理 推 VIP 1100
 | 
			
		||||
     * 总公司 推 VIP 1200
 | 
			
		||||
     */
 | 
			
		||||
    public static final BigDecimal V1_V2 = new BigDecimal("300");
 | 
			
		||||
    public static final BigDecimal V2_V2 = new BigDecimal("400");
 | 
			
		||||
    public static final BigDecimal V3_V2 = new BigDecimal("500");
 | 
			
		||||
    public static final BigDecimal V4_V2 = new BigDecimal("1000");
 | 
			
		||||
    public static final BigDecimal V5_V2 = new BigDecimal("1040");
 | 
			
		||||
    public static final BigDecimal V6_V7_V2 = new BigDecimal("1100");
 | 
			
		||||
    public static final BigDecimal V8_V2 = new BigDecimal("1200");
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 会员 推 合伙人 600
 | 
			
		||||
     * VIP 推 合伙人 800
 | 
			
		||||
     * 合伙人1 推 合伙人 1000
 | 
			
		||||
     * 合伙人2 推 合伙人 1200
 | 
			
		||||
     * 合伙人3 推 合伙人 1300
 | 
			
		||||
     * 博羚店主 推 合伙人 2000
 | 
			
		||||
     * 高级店主 推 合伙人 2080
 | 
			
		||||
     * 区域代理、董事代理 推 合伙人 2200
 | 
			
		||||
     * 总公司 推 合伙人 2400
 | 
			
		||||
     */
 | 
			
		||||
    public static final BigDecimal V1_V3 = new BigDecimal("600");
 | 
			
		||||
    public static final BigDecimal V2_V3 = new BigDecimal("800");
 | 
			
		||||
    public static final BigDecimal V3_V3_1 = new BigDecimal("1000");
 | 
			
		||||
    public static final BigDecimal V3_V3_2 = new BigDecimal("1200");
 | 
			
		||||
    public static final BigDecimal V3_V3_3 = new BigDecimal("1300");
 | 
			
		||||
    public static final BigDecimal V4_V3 = new BigDecimal("2000");
 | 
			
		||||
    public static final BigDecimal V5_V3 = new BigDecimal("2080");
 | 
			
		||||
    public static final BigDecimal V6_V7_V3 = new BigDecimal("2200");
 | 
			
		||||
    public static final BigDecimal V8_V3 = new BigDecimal("2400");
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 会员 推 博羚店主 1200
 | 
			
		||||
     * VIP 推 博羚店主 1600
 | 
			
		||||
     * 合伙人1 推 博羚店主 2000
 | 
			
		||||
     * 合伙人2 推 博羚店主 2400
 | 
			
		||||
     * 合伙人3 推 博羚店主 2600
 | 
			
		||||
     * 博羚店主 推 博羚店主 4000
 | 
			
		||||
     * 高级店主 推 博羚店主 4160
 | 
			
		||||
     * 区域代理、董事代理 推 博羚店主 4400
 | 
			
		||||
     * 总公司 推 博羚店主 4800
 | 
			
		||||
     */
 | 
			
		||||
    public static final BigDecimal V1_V4 = new BigDecimal("1200");
 | 
			
		||||
    public static final BigDecimal V2_V4 = new BigDecimal("1600");
 | 
			
		||||
    public static final BigDecimal V3_V4_1 = new BigDecimal("2000");
 | 
			
		||||
    public static final BigDecimal V3_V4_2 = new BigDecimal("2400");
 | 
			
		||||
    public static final BigDecimal V3_V4_3 = new BigDecimal("2600");
 | 
			
		||||
    public static final BigDecimal V4_V4 = new BigDecimal("4000");
 | 
			
		||||
    public static final BigDecimal V5_V4 = new BigDecimal("4160");
 | 
			
		||||
    public static final BigDecimal V6_V7_V4 = new BigDecimal("4400");
 | 
			
		||||
    public static final BigDecimal V8_V4 = new BigDecimal("4800");
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 博羚店主 推 分公司 50000
 | 
			
		||||
     * 高级店主 推 分公司 52000
 | 
			
		||||
     * 区域代理、董事代理 推 分公司 55000
 | 
			
		||||
     * 总公司 推 分公司 60000
 | 
			
		||||
     */
 | 
			
		||||
    public static final BigDecimal V4_V6 = new BigDecimal("50000");
 | 
			
		||||
    public static final BigDecimal V5_V6 = new BigDecimal("52000");
 | 
			
		||||
    public static final BigDecimal V6_V7_V6 = new BigDecimal("55000");
 | 
			
		||||
    public static final BigDecimal V8_V6 = new BigDecimal("60000");
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 复购:
 | 
			
		||||
     * 会员 拿 6
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -13,7 +13,7 @@ public class BonusMsgConstants {
 | 
			
		|||
    /**
 | 
			
		||||
     * 直推级差收益说明
 | 
			
		||||
     */
 | 
			
		||||
    public static String RANGE = "订单编号%s,%s为%s贡献了直推级差收益,计算金额%f,前一级差等级名称%s,当前级差等级名称%s。";
 | 
			
		||||
    public static String RANGE = "订单编号%s,%s为%s贡献了直推级差收益,计算金额%f,来源等级名称%s,当前级差等级名称%s。";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 复购级差收益说明
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -150,11 +150,6 @@ public class SaOrderMsgConstants {
 | 
			
		|||
     * 待支付订单支付时,校验商品已经下架,不能继续购买 -- 订单下商品已下架,不能购买
 | 
			
		||||
     */
 | 
			
		||||
    public static final String ORDER_ITEM_OFF = "订单下商品已下架,不能购买";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 待支付订单支付时,校验商品已经下架,不能继续购买 -- 订单已经绑定条形码,建议解绑后在撤单!
 | 
			
		||||
     */
 | 
			
		||||
    public static final String ORDER_BIND_BAR_CODE = "订单已经绑定条形码,建议解绑后在撤单!";
 | 
			
		||||
    /**
 | 
			
		||||
     * 请填写驳回信息 -- 请填写驳回信息
 | 
			
		||||
     */
 | 
			
		||||
| 
						 | 
				
			
			@ -168,9 +163,4 @@ public class SaOrderMsgConstants {
 | 
			
		|||
     */
 | 
			
		||||
    public static final String CHECK_MEMBER_LOWER_EXIST = "该会员推荐存在会员不能撤单";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 商品预售数量不足
 | 
			
		||||
     */
 | 
			
		||||
    public static final String WARES_PRE_SALE_QUANTITY_LACK = "商品预售数量不足";
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -405,6 +405,10 @@ public enum EOperationBusiness {
 | 
			
		|||
    PRODUCT_DETAIL_QUERY_LIST("产品明细查询"),
 | 
			
		||||
    MONTHLY_JOB_LEVEL("月度职级名单查询"),
 | 
			
		||||
    MEMBER_RETAIL_STAT("收益区域数据"),
 | 
			
		||||
 | 
			
		||||
    PRODUCT_SHIPPING("产品销售统计"),
 | 
			
		||||
 | 
			
		||||
    PRODUCT_SHIPPING_DETAILS("产品销售统计详情"),
 | 
			
		||||
    ;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,168 @@
 | 
			
		|||
package com.hzs.common.core.enums;
 | 
			
		||||
 | 
			
		||||
import com.hzs.common.core.constant.EnumsPrefixConstants;
 | 
			
		||||
import lombok.AllArgsConstructor;
 | 
			
		||||
import lombok.Getter;
 | 
			
		||||
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 出货相关订单类型枚举
 | 
			
		||||
 */
 | 
			
		||||
@AllArgsConstructor
 | 
			
		||||
@Getter
 | 
			
		||||
public enum EOrderShipment {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 全部 注册 + 升级+ 复购
 | 
			
		||||
     */
 | 
			
		||||
    WHOLE(1, "全部", 0, EnumsPrefixConstants.ORDER_SHIPMENT + 1),
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 首购  注册 + 升级
 | 
			
		||||
     */
 | 
			
		||||
    FIRST_PURCHASE(2, "首购", 0, EnumsPrefixConstants.ORDER_SHIPMENT + 2),
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 复购
 | 
			
		||||
     */
 | 
			
		||||
    REPURCHASE(3, "复购", 0, EnumsPrefixConstants.ORDER_SHIPMENT + 3),
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 注册
 | 
			
		||||
     */
 | 
			
		||||
    REGISTER_ORDER(5, "注册专区", 0, EnumsPrefixConstants.ORDER_SHIPMENT + 5),
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 升级
 | 
			
		||||
     */
 | 
			
		||||
    UPGRADE_ORDER(6, "升级专区", 0, EnumsPrefixConstants.ORDER_SHIPMENT + 6),
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 复购专区
 | 
			
		||||
     */
 | 
			
		||||
    REPURCHASE_ORDER(7, "复购专区", 0, EnumsPrefixConstants.ORDER_SHIPMENT + 7),
 | 
			
		||||
 | 
			
		||||
//    /**
 | 
			
		||||
//     * 福利
 | 
			
		||||
//     */
 | 
			
		||||
//    WELFARE_ORDER(9, "福利专区", 0, EnumsPrefixConstants.ORDER_SHIPMENT + 9),
 | 
			
		||||
//    /**
 | 
			
		||||
//     * 虚拟订单
 | 
			
		||||
//     */
 | 
			
		||||
//    FICTITIOUS_ORDER(12, "虚拟订单", 0, EnumsPrefixConstants.ORDER_SHIPMENT + 12),
 | 
			
		||||
    /**
 | 
			
		||||
     * 重销订单
 | 
			
		||||
     */
 | 
			
		||||
    CONSUME_ORDER(17, "重销订单", 0, EnumsPrefixConstants.ORDER_SHIPMENT + 17),
 | 
			
		||||
    /**
 | 
			
		||||
     * 提货订单
 | 
			
		||||
     */
 | 
			
		||||
    PICK_ORDER(18, "提货订单", 0, EnumsPrefixConstants.ORDER_SHIPMENT + 18),
 | 
			
		||||
//    /**
 | 
			
		||||
//     * 积分订单
 | 
			
		||||
//     */
 | 
			
		||||
//    EXCHANGE_ORDER(20, "积分订单", 0, EnumsPrefixConstants.ORDER_SHIPMENT + 20),
 | 
			
		||||
//    /**
 | 
			
		||||
//     * 专供专区
 | 
			
		||||
//     */
 | 
			
		||||
//    WHOLESALE_AREA(21, "专供专区", 0, EnumsPrefixConstants.ORDER_SHIPMENT + 21),
 | 
			
		||||
 | 
			
		||||
    ;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 实际值
 | 
			
		||||
     */
 | 
			
		||||
    private final int value;
 | 
			
		||||
    /**
 | 
			
		||||
     * 显示标签
 | 
			
		||||
     */
 | 
			
		||||
    private final String label;
 | 
			
		||||
    /**
 | 
			
		||||
     * 是否启用(0=是,1=否) -- 来源EYesNo
 | 
			
		||||
     */
 | 
			
		||||
    private final int enable;
 | 
			
		||||
    /**
 | 
			
		||||
     * 国际化翻译key值
 | 
			
		||||
     */
 | 
			
		||||
    private final String key;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据值,返回枚举
 | 
			
		||||
     *
 | 
			
		||||
     * @param value
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    public static EOrderShipment getEnumByValue(int value) {
 | 
			
		||||
        for (EOrderShipment eOrderType : EOrderShipment.values()) {
 | 
			
		||||
            if (eOrderType.getValue() == value) {
 | 
			
		||||
                return eOrderType;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return null;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据值,返回订单类型集合
 | 
			
		||||
     *
 | 
			
		||||
     * @param value
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    public static List<Integer> getOrderTypeList(Integer value) {
 | 
			
		||||
        List<Integer> orderTypeList = new ArrayList<>();
 | 
			
		||||
        if (null == value || EOrderShipment.WHOLE.getValue() == value) {
 | 
			
		||||
            //首购 1,2,24,25,20
 | 
			
		||||
            orderTypeList.add(EOrderType.REGISTER_ORDER.getValue());
 | 
			
		||||
            orderTypeList.add(EOrderType.UPGRADE_ORDER.getValue());
 | 
			
		||||
//            orderTypeList.add(EOrderType.SPECIAL_REGISTER_ORDER.getValue());
 | 
			
		||||
//            orderTypeList.add(EOrderType.SPECIAL_UPGRADE_ORDER.getValue());
 | 
			
		||||
 | 
			
		||||
            //复购 3,26,22,14,12,18,19,7,28,13,31,10
 | 
			
		||||
            orderTypeList.add(EOrderType.CONSUME_ORDER.getValue());
 | 
			
		||||
            orderTypeList.add(EOrderType.REPURCHASE_ORDER.getValue());
 | 
			
		||||
//            orderTypeList.add(EOrderType.SPECIAL_REPURCHASE_ORDER.getValue());
 | 
			
		||||
//            orderTypeList.add(EOrderType.PICK_ORDER.getValue());
 | 
			
		||||
            orderTypeList.add(EOrderType.CONSUME_ORDER.getValue());
 | 
			
		||||
        } else if (EOrderShipment.FIRST_PURCHASE.getValue() == value) {
 | 
			
		||||
            //首购
 | 
			
		||||
            orderTypeList.add(EOrderType.REGISTER_ORDER.getValue());
 | 
			
		||||
            orderTypeList.add(EOrderType.UPGRADE_ORDER.getValue());
 | 
			
		||||
//            orderTypeList.add(EOrderType.SPECIAL_REGISTER_ORDER.getValue());
 | 
			
		||||
//            orderTypeList.add(EOrderType.SPECIAL_UPGRADE_ORDER.getValue());
 | 
			
		||||
        } else if (EOrderShipment.REPURCHASE.getValue() == value) {
 | 
			
		||||
            //复购
 | 
			
		||||
            orderTypeList.add(EOrderType.REPURCHASE_ORDER.getValue());
 | 
			
		||||
//            orderTypeList.add(EOrderType.SPECIAL_REPURCHASE_ORDER.getValue());
 | 
			
		||||
//            orderTypeList.add(EOrderType.PICK_ORDER.getValue());
 | 
			
		||||
            orderTypeList.add(EOrderType.CONSUME_ORDER.getValue());
 | 
			
		||||
        } else if (EOrderShipment.REGISTER_ORDER.getValue() == value) {
 | 
			
		||||
            //注册专区
 | 
			
		||||
            orderTypeList.add(EOrderType.REGISTER_ORDER.getValue());
 | 
			
		||||
//            orderTypeList.add(EOrderType.SPECIAL_REGISTER_ORDER.getValue());
 | 
			
		||||
        } else if (EOrderShipment.UPGRADE_ORDER.getValue() == value) {
 | 
			
		||||
            //升级专区
 | 
			
		||||
            orderTypeList.add(EOrderType.UPGRADE_ORDER.getValue());
 | 
			
		||||
//            orderTypeList.add(EOrderType.SPECIAL_UPGRADE_ORDER.getValue());
 | 
			
		||||
        } else if (EOrderShipment.REPURCHASE_ORDER.getValue() == value) {
 | 
			
		||||
            //复购专区 3,26,22,14,12,18,19,28,13
 | 
			
		||||
            orderTypeList.add(EOrderType.REPURCHASE_ORDER.getValue());
 | 
			
		||||
//            orderTypeList.add(EOrderType.SPECIAL_REPURCHASE_ORDER.getValue());
 | 
			
		||||
            orderTypeList.add(EOrderType.CONSUME_ORDER.getValue());
 | 
			
		||||
        } else if (EOrderShipment.CONSUME_ORDER.getValue() == value) {
 | 
			
		||||
            //重销订单
 | 
			
		||||
            orderTypeList.add(EOrderType.CONSUME_ORDER.getValue());
 | 
			
		||||
        } else if (EOrderShipment.PICK_ORDER.getValue() == value) {
 | 
			
		||||
            //提货订单
 | 
			
		||||
//            orderTypeList.add(EOrderType.PICK_ORDER.getValue());
 | 
			
		||||
        }
 | 
			
		||||
        return orderTypeList;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 会员前端列表
 | 
			
		||||
     */
 | 
			
		||||
    private static List<EOrderShipment> apiList;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -46,4 +46,16 @@ public enum EWaresType {
 | 
			
		|||
        }
 | 
			
		||||
        return null;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static String getEnumLabelByValue(Integer value) {
 | 
			
		||||
        if (null == value) {
 | 
			
		||||
            return "";
 | 
			
		||||
        }
 | 
			
		||||
        for (EWaresType eApproveStatus : EWaresType.values()) {
 | 
			
		||||
            if (eApproveStatus.getValue().equals(value)) {
 | 
			
		||||
                return eApproveStatus.getLabel();
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return "";
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue