|
|
@ -23,6 +23,7 @@ import com.kiisoo.ic.store.mapper.PoiStoreDOMapper;
|
|
|
|
import com.kiisoo.ic.store.mapper.PoiStoreStaffDOMapper;
|
|
|
|
import com.kiisoo.ic.store.mapper.PoiStoreStaffDOMapper;
|
|
|
|
import com.kiisoo.ic.system.enums.RoleEnum;
|
|
|
|
import com.kiisoo.ic.system.enums.RoleEnum;
|
|
|
|
import com.kiisoo.ic.webappmy.vo.StafferInfoVO;
|
|
|
|
import com.kiisoo.ic.webappmy.vo.StafferInfoVO;
|
|
|
|
|
|
|
|
import org.apache.commons.lang.time.DateUtils;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@ -247,31 +248,31 @@ public class CustomerService {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param userId
|
|
|
|
* @param userId
|
|
|
|
* @param startDate
|
|
|
|
* @param sellerId
|
|
|
|
* @param endDate
|
|
|
|
* @param search
|
|
|
|
* @param lastStartDate
|
|
|
|
* @param roleCode
|
|
|
|
* @param lastEndDate
|
|
|
|
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public Map<String,Object> listCustomer(Long userId,Long sellerId,String search,String roleCode,Date startDate,Date endDate,Date lastStartDate,Date lastEndDate){
|
|
|
|
public Map<String,Object> listCustomer(Long userId,Long sellerId,String search,String roleCode){
|
|
|
|
Map<String,Object> results = new HashMap<>();
|
|
|
|
Map<String,Object> results = new HashMap<>();
|
|
|
|
|
|
|
|
Date thisDate = new Date();
|
|
|
|
|
|
|
|
Date lastDate = DateUtils.addDays(thisDate, -1);
|
|
|
|
if (roleCode.equals(RoleEnum.ROLE_CODE_DZ.getRoleCode())){
|
|
|
|
if (roleCode.equals(RoleEnum.ROLE_CODE_DZ.getRoleCode())){
|
|
|
|
List<StafferInfoVO> stafferInfoVOS = poiStoreStaffDOMapper.selectInfoById(userId);
|
|
|
|
List<StafferInfoVO> stafferInfoVOS = poiStoreStaffDOMapper.selectInfoById(userId);
|
|
|
|
Long shopId = stafferInfoVOS.get(0).getStoreId();
|
|
|
|
Long shopId = stafferInfoVOS.get(0).getStoreId();
|
|
|
|
List<FriendDTO> thisList = opSellerCustomerRelationDOMapper.selectShopListByDate(shopId,null,sellerId,search,startDate,endDate);
|
|
|
|
List<FriendDTO> thisList = opSellerCustomerRelationDOMapper.selectShopListByDate(shopId,null,sellerId,search,thisDate,thisDate);
|
|
|
|
results.put("this",thisList);
|
|
|
|
results.put("this",thisList);
|
|
|
|
List<FriendDTO> lastList = opSellerCustomerRelationDOMapper.selectShopListByDate(shopId,null,sellerId,search,lastStartDate,lastEndDate);
|
|
|
|
List<FriendDTO> lastList = opSellerCustomerRelationDOMapper.selectShopListByDate(shopId,null,sellerId,search,lastDate,lastDate);
|
|
|
|
results.put("last",lastList);
|
|
|
|
results.put("last",lastList);
|
|
|
|
List<FriendDTO> earlyList = opSellerCustomerRelationDOMapper.selectShopListByDate(shopId,null,sellerId,search,null,lastStartDate);
|
|
|
|
List<FriendDTO> earlyList = opSellerCustomerRelationDOMapper.selectShopListByDate(shopId,null,sellerId,search,null,lastDate);
|
|
|
|
results.put("early",earlyList);
|
|
|
|
results.put("early",earlyList);
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
List<FriendDTO> thisList = opSellerCustomerRelationDOMapper.selectShopListByDate(null,userId,null,search,startDate,endDate);
|
|
|
|
List<FriendDTO> thisList = opSellerCustomerRelationDOMapper.selectShopListByDate(null,userId,null,search,thisDate,thisDate);
|
|
|
|
results.put("this",thisList);
|
|
|
|
results.put("this",thisList);
|
|
|
|
List<FriendDTO> lastList = opSellerCustomerRelationDOMapper.selectShopListByDate(null,userId,null,search,lastStartDate,lastEndDate);
|
|
|
|
List<FriendDTO> lastList = opSellerCustomerRelationDOMapper.selectShopListByDate(null,userId,null,search,lastDate,lastDate);
|
|
|
|
results.put("last",lastList);
|
|
|
|
results.put("last",lastList);
|
|
|
|
List<FriendDTO> earlyList = opSellerCustomerRelationDOMapper.selectShopListByDate(null,userId,null,search,null,lastStartDate);
|
|
|
|
List<FriendDTO> earlyList = opSellerCustomerRelationDOMapper.selectShopListByDate(null,userId,null,search,null,lastDate);
|
|
|
|
results.put("early",earlyList);
|
|
|
|
results.put("early",earlyList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return results;
|
|
|
|
return results;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|