Ver Fonte

市场部领导按照回款来结算

wucl há 2 anos atrás
pai
commit
6f9fc9ba29

+ 1 - 0
biz-base/src/main/java/com/dayou/controller/ItemBrokerageSequenceController.java

@@ -121,5 +121,6 @@ public class ItemBrokerageSequenceController extends BaseController {
         Boolean nonResult = itemBrokerageSequenceService.doNonMarketerAheadSettle();
         return RestResponse.data((result && nonResult));
     }
+
 }
 

+ 223 - 21
biz-base/src/test/java/BrokerageTest.java

@@ -1,5 +1,6 @@
 import cn.hutool.core.lang.Assert;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.dayou.BaseApplication;
 import com.dayou.bo.LeaderRatioBO;
 import com.dayou.configuration.AsyncManager;
@@ -12,6 +13,7 @@ import com.dayou.entity.UserTarget;
 import com.dayou.service.*;
 import com.dayou.service.impl.ItemBrokerageSequenceServiceImpl;
 import com.dayou.utils.Md5Utils;
+import com.dayou.vo.ItemStageVO;
 import com.dayou.vo.ItemStatVO;
 import com.google.common.cache.Cache;
 import com.google.common.cache.LoadingCache;
@@ -51,36 +53,236 @@ public class BrokerageTest {
 
     @Autowired
     private ITeamMemberService teamMemberService;
-    
+
     @Autowired
-    private IItemBrokerageSequenceService itemBrokerageSequenceService;
+    private IItemBrokerageGeneralService iItemBrokerageGeneralService;
 
     @Autowired
-    private IUserTargetService userTargetService;
+    private IItemStageService itemStageService;
 
+    @Autowired
+    private IItemBrokerageSequenceService itemBrokerageSequenceService;
 
 
-    @Test
-    public void testBrokerageCache() throws ExecutionException {
-        userTargetService.getTeamTarget(140L);
-    }
 
-//    public static void main(String ages []) {
+//    @Test
+//    public void generalBatchBrokerage() throws ExecutionException {
+//        ArrayList<Long> itemIds = Lists.newArrayList(
+//                15L,
+//                16L,
+//                17L,
+//                18L,
+//                19L,
+//                23L,
+//                24L,
+//                25L,
+//                29L,
+//                30L,
+//                33L,
+//                35L,
+//                36L,
+//                46L,
+//                47L,
+//                48L,
+//                49L,
+//                50L,
+//                56L,
+//                57L,
+//                58L,
+//                59L,
+//                63L,
+//                64L,
+//                67L,
+//                68L,
+//                69L,
+//                71L,
+//                77L,
+//                80L,
+//                81L,
+//                85L,
+//                86L,
+//                87L,
+//                91L,
+//                92L,
+//                93L,
+//                95L,
+//                96L,
+//                97L,
+//                99L,
+//                100L,
+//                101L,
+//                108L,
+//                109L,
+//                110L,
+//                111L,
+//                112L,
+//                113L,
+//                114L,
+//                115L,
+//                117L,
+//                118L,
+//                119L,
+//                120L,
+//                121L,
+//                123L,
+//                124L,
+//                125L,
+//                127L,
+//                128L,
+//                129L,
+//                130L,
+//                131L,
+//                132L,
+//                134L,
+//                135L,
+//                136L,
+//                137L,
+//                139L,
+//                143L,
+//                145L,
+//                146L,
+//                147L,
+//                148L,
+//                150L,
+//                151L,
+//                152L,
+//                155L,
+//                156L,
+//                157L,
+//                159L,
+//                164L,
+//                165L,
+//                166L,
+//                167L,
+//                168L,
+//                169L,
+//                170L,
+//                171L,
+//                172L,
+//                173L,
+//                174L,
+//                175L,
+//                176L,
+//                177L,
+//                178L,
+//                179L,
+//                180L,
+//                181L,
+//                182L,
+//                183L,
+//                184L,
+//                185L,
+//                186L,
+//                187L,
+//                188L,
+//                189L,
+//                190L,
+//                191L,
+//                193L,
+//                194L,
+//                195L,
+//                196L,
+//                198L,
+//                200L,
+//                202L,
+//                203L,
+//                204L,
+//                205L,
+//                206L,
+//                207L,
+//                209L,
+//                210L,
+//                211L,
+//                212L,
+//                213L,
+//                214L,
+//                216L,
+//                217L,
+//                218L,
+//                219L,
+//                220L,
+//                221L,
+//                222L,
+//                223L,
+//                224L,
+//                225L,
+//                226L,
+//                227L,
+//                228L,
+//                229L,
+//                235L,
+//                237L,
+//                238L,
+//                239L,
+//                240L,
+//                245L,
+//                246L,
+//                247L,
+//                248L,
+//                249L,
+//                252L,
+//                254L,
+//                257L,
+//                259L,
+//                260L,
+//                261L,
+//                262L,
+//                264L,
+//                265L,
+//                266L,
+//                267L,
+//                268L,
+//                274L,
+//                275L,
+//                276L,
+//                277L,
+//                278L,
+//                279L,
+//                280L,
+//                281L,
+//                288L,
+//                289L,
+//                290L,
+//                291L,
+//                292L,
+//                293L,
+//                294L,
+//                296L,
+//                297L,
+//                298L,
+//                302L,
+//                303L,
+//                304L,
+//                309L,
+//                310L,
+//                311L,
+//                312L,
+//                313L,
+//                314L,
+//                315L,
+//                316L,
+//                319L
+//        );
 //
-//        new Thread(()->{System.out.println("xxx");}).start();
-//        List<Integer> list = Arrays.asList(1,2,3,4,5,6);
+//        for (Long itemId : itemIds){
+//            iItemBrokerageGeneralService.addMarketerBrokerage(itemId);
+//            List<ItemStageVO> itemStageVOS = itemStageService.listByItemId(itemId);
+//            if (CollectionUtils.isNotEmpty(itemStageVOS)){
+//                for (ItemStageVO itemStageVO :itemStageVOS){
+//                    if (itemStageVO!=null && itemStageVO.getId()!=null){
 //
-//        List<Integer> collect = list.stream().map(x->(x+1)).collect(Collectors.toList());
+//                        iItemBrokerageGeneralService.addParticipatorBrokerage(itemStageVO,itemStageVO.getId());
+//                    }
+//                }
+//            }
+//        }
+//    }
 //
-//        ItemController itemController = new ItemController();
-//        List<Integer> collect1 = list.stream().map(x->x+1).collect(Collectors.toList());
-//        list.stream().filter(x->x>2).collect(Collectors.toList());
-//        list.stream().forEach(x->System.out.println(x));
-//        List<Integer> collect2 = list.stream().limit(3L).collect(Collectors.toList());
-//        list.stream().sorted((x,y)->-1).collect(Collectors.toList());
-//        double sum = list.stream().mapToDouble(value->Double.valueOf(value)).sum();
+//
+//    @Test
+//    public void settle(){
+//        Boolean result = itemBrokerageSequenceService.doAbleItemBrokerageSettle();
+//        //Boolean nonResult = itemBrokerageSequenceService.doNonMarketerAheadSettle();
+//        Assert.isTrue(result);
 //    }
-
-
-
 }

+ 6 - 0
dao/src/main/resources/mapper/ItemBrokerageSequenceDetailMapper.xml

@@ -67,6 +67,12 @@
         <if test="vo!=null and vo.brokerageCate!=null and vo.brokerageCate!='' ">
             and ibsd.brokerage_cate = #{vo.brokerageCate}
         </if>
+        <if test="vo!=null and vo.userIds!=null and vo.userIds.size!=0">
+            and  ibsd.user_id in
+            <foreach collection="vo.userIds" open="(" close=")" separator="," item="userId">
+                #{userId}
+            </foreach>
+        </if>
         order by ibsd.id DESC
     </select>
 

+ 1 - 1
service/src/main/java/com/dayou/brokerage/handler/LandMarketerBrokerageHandler.java

@@ -204,7 +204,7 @@ public class LandMarketerBrokerageHandler extends BrokerageCalculateSupport impl
                 .eq(BrokeragePostRatio::getBrokerageRule, LAND_MANAGER_RULE.getCode()).eq(BaseEntity::getDeleted, Boolean.FALSE)).getBrokerageRatio();
         BigDecimal amount = managerAmount(bo.getAmount(), null, bo.getUserId(), brokerageRatio);
         bo.setPredictAmount(amount);
-        bo.setBrokerageMode(BrokerageMode.PERSONAL.getCode());
+        bo.setBrokerageMode(BrokerageMode.TEAM_SHARE.getCode());
         bo.setRate(BigDecimal.ZERO);
         bo.setMarketerAdvanceBrokerageAble(Boolean.FALSE);
         bo.setBrokerageRule(LAND_MANAGER_RULE.getCode());