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);
}
}
}