|
|
@ -440,7 +440,66 @@ public class CustomerService {
|
|
|
|
* @param search
|
|
|
|
* @param search
|
|
|
|
* @param roleCode
|
|
|
|
* @param roleCode
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public Map<String, Object> listCustomer(Long userId, Long sellerId, String search, String roleCode, Integer type) throws Exception {
|
|
|
|
public Map<String, Object> listCustomerNew(Long userId, Long sellerId, String search, String roleCode, Integer type, Date startDate, Date endDate) throws Exception {
|
|
|
|
|
|
|
|
Map<String, Object> results = new HashMap<>();
|
|
|
|
|
|
|
|
// Date thisDate = new Date();
|
|
|
|
|
|
|
|
// DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
|
|
|
// Calendar calendar = Calendar.getInstance();
|
|
|
|
|
|
|
|
// calendar.set(Calendar.HOUR_OF_DAY, -24);
|
|
|
|
|
|
|
|
// Date lastDate = dateFormat.parse(dateFormat.format(calendar.getTime()));
|
|
|
|
|
|
|
|
// calendar.set(Calendar.HOUR_OF_DAY, -24);
|
|
|
|
|
|
|
|
// Date earlyDate = dateFormat.parse(dateFormat.format(calendar.getTime()));
|
|
|
|
|
|
|
|
List<StafferInfoVO> stafferInfoVOS = poiStoreStaffDOMapper.selectInfoById(userId);
|
|
|
|
|
|
|
|
if (CollectionUtils.isEmpty(stafferInfoVOS)) {
|
|
|
|
|
|
|
|
results.put("this", null);
|
|
|
|
|
|
|
|
// results.put("last", null);
|
|
|
|
|
|
|
|
// results.put("early", null);
|
|
|
|
|
|
|
|
return results;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Long shopId = stafferInfoVOS.get(0).getStoreId();
|
|
|
|
|
|
|
|
if (roleCode.equals(RoleEnum.ROLE_CODE_DZ.getRoleCode())) {
|
|
|
|
|
|
|
|
List<FriendDTO> thisList = opSellerCustomerRelationDOMapper.selectFriendListByShopId(shopId, sellerId, search, startDate, endDate, type);
|
|
|
|
|
|
|
|
thisList.forEach(friendDTO -> {
|
|
|
|
|
|
|
|
String inviteSellerName = opSellerCustomerRelationDOMapper.selectStaffName(friendDTO.getInviteSellerId());
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(inviteSellerName)) {
|
|
|
|
|
|
|
|
friendDTO.setInviteSellerName(inviteSellerName);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
// List<FriendDTO> lastList = opSellerCustomerRelationDOMapper.selectFriendListByShopId(shopId, sellerId, search, lastDate, lastDate, type);
|
|
|
|
|
|
|
|
// lastList.forEach(friendDTO -> {
|
|
|
|
|
|
|
|
// String inviteSellerName = opSellerCustomerRelationDOMapper.selectStaffName(friendDTO.getInviteSellerId());
|
|
|
|
|
|
|
|
// if (StringUtils.isNotBlank(inviteSellerName)) {
|
|
|
|
|
|
|
|
// friendDTO.setInviteSellerName(inviteSellerName);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// List<FriendDTO> earlyList = opSellerCustomerRelationDOMapper.selectFriendListByShopId(shopId, sellerId, search, null, earlyDate, type);
|
|
|
|
|
|
|
|
// earlyList.forEach(friendDTO -> {
|
|
|
|
|
|
|
|
// String inviteSellerName = opSellerCustomerRelationDOMapper.selectStaffName(friendDTO.getInviteSellerId());
|
|
|
|
|
|
|
|
// if (StringUtils.isNotBlank(inviteSellerName)) {
|
|
|
|
|
|
|
|
// friendDTO.setInviteSellerName(inviteSellerName);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
results.put("this", thisList);
|
|
|
|
|
|
|
|
// results.put("last", lastList);
|
|
|
|
|
|
|
|
// results.put("early", earlyList);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
List<FriendDTO> thisList = opSellerCustomerRelationDOMapper.selectFriendListBySeller(userId, search, startDate, endDate, type);
|
|
|
|
|
|
|
|
results.put("this", thisList);
|
|
|
|
|
|
|
|
// List<FriendDTO> lastList = opSellerCustomerRelationDOMapper.selectFriendListBySeller(userId, search, lastDate, lastDate, type);
|
|
|
|
|
|
|
|
// results.put("last", lastList);
|
|
|
|
|
|
|
|
// List<FriendDTO> earlyList = opSellerCustomerRelationDOMapper.selectFriendListBySeller(userId, search, null, earlyDate, type);
|
|
|
|
|
|
|
|
// results.put("early", earlyList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return results;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @param userId
|
|
|
|
|
|
|
|
* @param sellerId
|
|
|
|
|
|
|
|
* @param search
|
|
|
|
|
|
|
|
* @param roleCode
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public Map<String, Object> listCustomer(Long userId, Long sellerId, String search, String roleCode, Integer type, Date startDate, Date endDate) throws Exception {
|
|
|
|
Map<String, Object> results = new HashMap<>();
|
|
|
|
Map<String, Object> results = new HashMap<>();
|
|
|
|
Date thisDate = new Date();
|
|
|
|
Date thisDate = new Date();
|
|
|
|
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
@ -458,7 +517,7 @@ public class CustomerService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Long shopId = stafferInfoVOS.get(0).getStoreId();
|
|
|
|
Long shopId = stafferInfoVOS.get(0).getStoreId();
|
|
|
|
if (roleCode.equals(RoleEnum.ROLE_CODE_DZ.getRoleCode())) {
|
|
|
|
if (roleCode.equals(RoleEnum.ROLE_CODE_DZ.getRoleCode())) {
|
|
|
|
List<FriendDTO> thisList = opSellerCustomerRelationDOMapper.selectFriendListByShopId(shopId, sellerId, search, thisDate, thisDate, type);
|
|
|
|
List<FriendDTO> thisList = opSellerCustomerRelationDOMapper.selectFriendListByShopId(shopId, sellerId, search, startDate, endDate, type);
|
|
|
|
thisList.forEach(friendDTO -> {
|
|
|
|
thisList.forEach(friendDTO -> {
|
|
|
|
String inviteSellerName = opSellerCustomerRelationDOMapper.selectStaffName(friendDTO.getInviteSellerId());
|
|
|
|
String inviteSellerName = opSellerCustomerRelationDOMapper.selectStaffName(friendDTO.getInviteSellerId());
|
|
|
|
if (StringUtils.isNotBlank(inviteSellerName)) {
|
|
|
|
if (StringUtils.isNotBlank(inviteSellerName)) {
|
|
|
@ -483,7 +542,7 @@ public class CustomerService {
|
|
|
|
results.put("last", lastList);
|
|
|
|
results.put("last", lastList);
|
|
|
|
results.put("early", earlyList);
|
|
|
|
results.put("early", earlyList);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
List<FriendDTO> thisList = opSellerCustomerRelationDOMapper.selectFriendListBySeller(userId, search, thisDate, thisDate, type);
|
|
|
|
List<FriendDTO> thisList = opSellerCustomerRelationDOMapper.selectFriendListBySeller(userId, search, startDate, endDate, type);
|
|
|
|
results.put("this", thisList);
|
|
|
|
results.put("this", thisList);
|
|
|
|
List<FriendDTO> lastList = opSellerCustomerRelationDOMapper.selectFriendListBySeller(userId, search, lastDate, lastDate, type);
|
|
|
|
List<FriendDTO> lastList = opSellerCustomerRelationDOMapper.selectFriendListBySeller(userId, search, lastDate, lastDate, type);
|
|
|
|
results.put("last", lastList);
|
|
|
|
results.put("last", lastList);
|
|
|
|