|  |  | 
 |  |  | package com.matrix; | 
 |  |  |  | 
 |  |  | import com.matrix.core.tools.StringUtils; | 
 |  |  | import com.matrix.system.hive.bean.AchieveNew; | 
 |  |  | import com.matrix.system.hive.bean.SysOrderFlow; | 
 |  |  | import com.matrix.system.hive.dao.AchieveNewDao; | 
 |  |  | import com.matrix.system.hive.dao.SysOrderFlowDao; | 
 |  |  | import com.matrix.system.hive.dao.SysProjUseDao; | 
 |  |  | import com.matrix.system.hive.plugin.util.CollectionUtils; | 
 |  |  | import org.junit.Test; | 
 |  |  | import org.junit.runner.RunWith; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.boot.test.context.SpringBootTest; | 
 |  |  | import org.springframework.test.context.junit4.SpringRunner; | 
 |  |  |  | 
 |  |  | import java.util.ArrayList; | 
 |  |  | import java.util.List; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * @author wzy | 
 |  |  | 
 |  |  |     @Autowired | 
 |  |  |     AchieveNewDao achieveNewDao; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     SysOrderFlowDao orderFlowDao; | 
 |  |  |  | 
 |  |  |     @Test | 
 |  |  |     public void tcProjTest() { | 
 |  |  |         //achieveNewDao | 
 |  |  |         List<AchieveNew> achieveNewList=achieveNewDao.selectInPage(null,null); | 
 |  |  |         ArrayList<Long> ids=new ArrayList<>(); | 
 |  |  |         ArrayList<Long> xjs=new ArrayList<>(); | 
 |  |  |         ArrayList<Long> hks=new ArrayList<>(); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         for (int i = 0; i < achieveNewList.size(); i++) { | 
 |  |  |             AchieveNew item=achieveNewList.get(i); | 
 |  |  |             if(StringUtils.isBlank(item.getPayMethod())){ | 
 |  |  |                 List<SysOrderFlow> orderFlows = orderFlowDao.selectByOrderId(item.getOrderId()); | 
 |  |  |                 if(orderFlows.size()==1){ | 
 |  |  |                     if(orderFlows.get(0).getPayMethod().equals("现金支付")){ | 
 |  |  |                         xjs.add(item.getId()); | 
 |  |  |                     }else{ | 
 |  |  |                         hks.add(item.getId()); | 
 |  |  |                     } | 
 |  |  |                 }else{ | 
 |  |  |                     ids.add(item.getOrderId()); | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         if(CollectionUtils.isNotEmpty(xjs)){ | 
 |  |  |             achieveNewDao.setPayMethod("现金",xjs); | 
 |  |  |         } | 
 |  |  |         if(CollectionUtils.isNotEmpty(hks)){ | 
 |  |  |             achieveNewDao.setPayMethod("划扣",hks); | 
 |  |  |         } | 
 |  |  |         System.out.println("未处理订单id"+ StringUtils.collToStr(ids,",")); | 
 |  |  |     } | 
 |  |  | } |