|
|
@@ -50,7 +50,7 @@ public class QujingOrderServiceImpl implements IQujingOrderService {
|
|
|
public void statisticsOrder(String dateTime, Integer operatorId, Integer supplierId){
|
|
|
try {
|
|
|
//检查区域,没有的新增
|
|
|
- List<Order> list = baseMapper.listAll();
|
|
|
+ List<Order> list = baseMapper.listAll(supplierId);
|
|
|
/* Date date = new Date();
|
|
|
if(StringUtils.isNotEmpty(dateTime)){
|
|
|
date = DateUtils.parseDate(dateTime,"yyyy-MM-dd HH:mm:ss");
|
|
|
@@ -61,7 +61,7 @@ public class QujingOrderServiceImpl implements IQujingOrderService {
|
|
|
List<Integer> ids = Lists.newArrayList();
|
|
|
List<Order> newOrderList = Lists.newArrayList();
|
|
|
if(list.size()>0){
|
|
|
- ids = list.stream().map(o->o.getAreaId()).collect(Collectors.toList());
|
|
|
+ ids = list.stream().map(Order::getAreaId).collect(Collectors.toList());
|
|
|
}
|
|
|
for (AreaDTO areaDTO : areaList) {
|
|
|
if(!ids.contains(areaDTO.getId())){
|
|
|
@@ -71,7 +71,7 @@ public class QujingOrderServiceImpl implements IQujingOrderService {
|
|
|
order.setAreaName(areaDTO.getName());
|
|
|
order.setTreePath(areaDTO.getTreePath());
|
|
|
order.setSourceLevel(areaDTO.getLevel());
|
|
|
- Integer size = 0;
|
|
|
+ int size = 0;
|
|
|
switch (order.getSourceLevel()){
|
|
|
case 1:
|
|
|
size =4;
|
|
|
@@ -91,9 +91,9 @@ public class QujingOrderServiceImpl implements IQujingOrderService {
|
|
|
}
|
|
|
}
|
|
|
for(Order o:newOrderList) {
|
|
|
- baseMapper.saveOrder(o);
|
|
|
+ baseMapper.saveOrder(o,supplierId);
|
|
|
}
|
|
|
- list = baseMapper.listAll();
|
|
|
+ list = baseMapper.listAll(supplierId);
|
|
|
}
|
|
|
Map<Integer,List<Order>> maps = list.stream().collect(Collectors.groupingBy(Order::getAreaId));
|
|
|
|
|
|
@@ -140,14 +140,14 @@ public class QujingOrderServiceImpl implements IQujingOrderService {
|
|
|
log.info("---更新商户积分数据结束---");
|
|
|
|
|
|
log.info("---客户积分开始获取---");
|
|
|
- changeCustomerIntegral(maps,supplierId);
|
|
|
+ changeCustomerIntegral(maps,operatorId, supplierId);
|
|
|
log.info("---客户积分结束获取---");
|
|
|
log.info("---积分流水开始获取---");
|
|
|
- changeTransIntegral(maps,supplierId);
|
|
|
+ changeTransIntegral(maps,operatorId, supplierId);
|
|
|
log.info("---积分流水结束获取---");
|
|
|
// this.saveOrUpdateBatch(list);
|
|
|
for (Order o:list){
|
|
|
- baseMapper.updateOrder(o);
|
|
|
+ baseMapper.updateOrder(o,supplierId);
|
|
|
}
|
|
|
}
|
|
|
log.info("完成----");
|
|
|
@@ -479,16 +479,16 @@ public class QujingOrderServiceImpl implements IQujingOrderService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private List<SubsidyCustomerFace> integralCustomer(Integer supplierId){
|
|
|
+ private List<SubsidyCustomerFace> integralCustomer(Integer operatorId, Integer supplierId){
|
|
|
List<SubsidyCustomerFace> returnList = Lists.newArrayList();
|
|
|
- List<Integer> operationIds = baseMapper.getIntegralCardAccOperatorIdList(dbName,supplierId);
|
|
|
+// List<Integer> operationIds = baseMapper.getIntegralCardAccOperatorIdList(dbName,supplierId);
|
|
|
|
|
|
- List<IntegralTrans> detailsCustomer = Lists.newArrayList();
|
|
|
+ List<IntegralTrans> detailsCustomer;
|
|
|
|
|
|
- for (Integer operationId : operationIds) {
|
|
|
+// for (Integer operationId : operationIds) {
|
|
|
//获取积分数据
|
|
|
- detailsCustomer.addAll(baseMapper.integralCustomerList(operationId,dbName,supplierId));
|
|
|
- }
|
|
|
+ detailsCustomer= baseMapper.integralCustomerList(operatorId,dbName,supplierId);
|
|
|
+// }
|
|
|
|
|
|
log.info("---处理积分客户数据开始----");
|
|
|
if(!detailsCustomer.isEmpty()){
|
|
|
@@ -537,8 +537,8 @@ public class QujingOrderServiceImpl implements IQujingOrderService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void changeCustomerIntegral(Map<Integer, List<Order>> maps,Integer supplierId) {
|
|
|
- List<SubsidyCustomerFace> integralList = this.integralCustomer(supplierId);
|
|
|
+ private void changeCustomerIntegral(Map<Integer, List<Order>> maps,Integer operatorId, Integer supplierId) {
|
|
|
+ List<SubsidyCustomerFace> integralList = this.integralCustomer(operatorId, supplierId);
|
|
|
for (SubsidyCustomerFace subsidyCustomerFace : integralList) {
|
|
|
List<Order> orders = maps.get(subsidyCustomerFace.getAreaId());
|
|
|
if (CollectionUtils.isEmpty(orders)) {
|
|
|
@@ -558,14 +558,14 @@ public class QujingOrderServiceImpl implements IQujingOrderService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- private List<SubsidyCustomerFace> integralTrans(Integer supplierId){
|
|
|
+ private List<SubsidyCustomerFace> integralTrans(Integer operatorId, Integer supplierId){
|
|
|
List<SubsidyCustomerFace> returnList = Lists.newArrayList();
|
|
|
- List<Integer> operationIds = baseMapper.getIntegralCardDetailOperatorIdList(dbName,supplierId);
|
|
|
- List<IntegralTrans> detailsTrans = Lists.newArrayList();
|
|
|
- for (Integer operationId : operationIds) {
|
|
|
+// List<Integer> operationIds = baseMapper.getIntegralCardDetailOperatorIdList(dbName,supplierId);
|
|
|
+ List<IntegralTrans> detailsTrans ;
|
|
|
+// for (Integer operationId : operationIds) {
|
|
|
//获取积分数据
|
|
|
- detailsTrans.addAll(baseMapper.integralTransList(operationId,dbName,supplierId));
|
|
|
- }
|
|
|
+ detailsTrans=baseMapper.integralTransList(operatorId,dbName,supplierId);
|
|
|
+// }
|
|
|
|
|
|
log.info("---处理流水数据开始----");
|
|
|
Map<Integer,List<IntegralTrans>> streetTransMaps = detailsTrans.stream().filter(i->i.getStreetId() != null).collect(Collectors.groupingBy(IntegralTrans::getStreetId));
|
|
|
@@ -673,8 +673,8 @@ public class QujingOrderServiceImpl implements IQujingOrderService {
|
|
|
return monthList;
|
|
|
}
|
|
|
|
|
|
- private void changeTransIntegral(Map<Integer, List<Order>> maps, Integer supplierId) {
|
|
|
- List<SubsidyCustomerFace> integralList = this.integralTrans(supplierId);
|
|
|
+ private void changeTransIntegral(Map<Integer, List<Order>> maps, Integer operatorId, Integer supplierId) {
|
|
|
+ List<SubsidyCustomerFace> integralList = this.integralTrans(operatorId, supplierId);
|
|
|
|
|
|
for (SubsidyCustomerFace subsidyCustomerFace : integralList) {
|
|
|
List<Order> orders = maps.get(subsidyCustomerFace.getAreaId());
|