0
点赞
收藏
分享

微信扫一扫

java线程池

中间件小哥 2022-02-28 阅读 58


package com.hisense.cis.controller.cart;


import com.hisense.cis.config.CatchExceptionLog;

import com.hisense.cis.dao.salesOrder.SalesOrderDao;

import lombok.Data;


import java.util.ArrayList;

import java.util.List;

import java.util.Map;

/*

* 常规应急订单占比-多线程查询

* yshp

* 2021-01-22

* */

@Data

public class QueryRatioThread implements Runnable { //@Autowired

private SalesOrderDao salesOrderDao; //商家did

private Long custId; //年月

private String yearMonth; //物料

private String[] matklIdss; //组织

private String[] orgIds; //

private List<Map<String, String>> newList=new ArrayList<>(); public QueryRatioThread(){}

//构造器

public QueryRatioThread(Long custId, String yearMonth, String[] matklIdss, String[] orgIds,SalesOrderDao salesOrderDao) { this.custId = custId;

this.yearMonth = yearMonth;

this.matklIdss = matklIdss;

this.orgIds = orgIds;

this.salesOrderDao=salesOrderDao;

}

//具体方法

public List<Map<String, String>> getQueryRatioMethod(Long custId, String yearMonth, String[] matklIdss, String[] orgIds,SalesOrderDao salesOrderDao) { List<Map<String, String>> list=salesOrderDao.queryCustOrderRatioByOrgIdsAndMatkls(custId,yearMonth,matklIdss,orgIds);

if(list!=null&&list.size()>0){

list.forEach(st->{

newList.add(st);

});

}

return newList;

}

@Override

public void run() {

try{

getQueryRatioMethod(this.getCustId(),this.getYearMonth(),this.getMatklIdss(),this.getOrgIds(),this.getSalesOrderDao());

}catch (Exception e){

CatchExceptionLog.logError(e);

}

}

}



举报

相关推荐

0 条评论