我的好友列表接口

master
yechenhao 6 years ago
parent 69f7f08995
commit 5d6c8691bd

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

@ -77,11 +77,9 @@ public class CustomerController extends BaseController {
@ResponseBody @ResponseBody
@PostMapping("/list/friends") @PostMapping("/list/friends")
public Map<String, Object> listCustomer(@RequestParam("userId") Long userId,@RequestParam(value = "sellerId",required = false)Long sellerId, public Map<String, Object> listCustomer(@RequestParam("userId") Long userId,@RequestParam(value = "sellerId",required = false)Long sellerId,
@RequestParam(value = "search",required = false)String search,@RequestParam("roleCode")String roleCode, @RequestParam(value = "search",required = false)String search,@RequestParam("roleCode")String roleCode){
@RequestParam("startDate")Date startDate,@RequestParam("endDate")Date endDate,
@RequestParam("lastStartDate")Date lastStartDate,@RequestParam("lastEndDate")Date lastEndDate){
try { try {
Map<String, Object> stringObjectMap = customerService.listCustomer(userId, sellerId, search, roleCode, startDate, endDate, lastStartDate, lastEndDate); Map<String, Object> stringObjectMap = customerService.listCustomer(userId, sellerId, search, roleCode);
return success(); return success();
} catch (Exception e) { } catch (Exception e) {
log.error("修改客户信息异常:",e); log.error("修改客户信息异常:",e);

Loading…
Cancel
Save