diff --git a/src/main/java/com/kiisoo/ic/customer/CustomerService.java b/src/main/java/com/kiisoo/ic/customer/CustomerService.java index ec85930..1bb4d5e 100644 --- a/src/main/java/com/kiisoo/ic/customer/CustomerService.java +++ b/src/main/java/com/kiisoo/ic/customer/CustomerService.java @@ -23,6 +23,7 @@ import com.kiisoo.ic.store.mapper.PoiStoreDOMapper; import com.kiisoo.ic.store.mapper.PoiStoreStaffDOMapper; import com.kiisoo.ic.system.enums.RoleEnum; import com.kiisoo.ic.webappmy.vo.StafferInfoVO; +import org.apache.commons.lang.time.DateUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -247,31 +248,31 @@ public class CustomerService { /** * * @param userId - * @param startDate - * @param endDate - * @param lastStartDate - * @param lastEndDate + * @param sellerId + * @param search + * @param roleCode */ - public Map listCustomer(Long userId,Long sellerId,String search,String roleCode,Date startDate,Date endDate,Date lastStartDate,Date lastEndDate){ + public Map listCustomer(Long userId,Long sellerId,String search,String roleCode){ Map results = new HashMap<>(); + Date thisDate = new Date(); + Date lastDate = DateUtils.addDays(thisDate, -1); if (roleCode.equals(RoleEnum.ROLE_CODE_DZ.getRoleCode())){ List stafferInfoVOS = poiStoreStaffDOMapper.selectInfoById(userId); Long shopId = stafferInfoVOS.get(0).getStoreId(); - List thisList = opSellerCustomerRelationDOMapper.selectShopListByDate(shopId,null,sellerId,search,startDate,endDate); + List thisList = opSellerCustomerRelationDOMapper.selectShopListByDate(shopId,null,sellerId,search,thisDate,thisDate); results.put("this",thisList); - List lastList = opSellerCustomerRelationDOMapper.selectShopListByDate(shopId,null,sellerId,search,lastStartDate,lastEndDate); + List lastList = opSellerCustomerRelationDOMapper.selectShopListByDate(shopId,null,sellerId,search,lastDate,lastDate); results.put("last",lastList); - List earlyList = opSellerCustomerRelationDOMapper.selectShopListByDate(shopId,null,sellerId,search,null,lastStartDate); + List earlyList = opSellerCustomerRelationDOMapper.selectShopListByDate(shopId,null,sellerId,search,null,lastDate); results.put("early",earlyList); }else{ - List thisList = opSellerCustomerRelationDOMapper.selectShopListByDate(null,userId,null,search,startDate,endDate); + List thisList = opSellerCustomerRelationDOMapper.selectShopListByDate(null,userId,null,search,thisDate,thisDate); results.put("this",thisList); - List lastList = opSellerCustomerRelationDOMapper.selectShopListByDate(null,userId,null,search,lastStartDate,lastEndDate); + List lastList = opSellerCustomerRelationDOMapper.selectShopListByDate(null,userId,null,search,lastDate,lastDate); results.put("last",lastList); - List earlyList = opSellerCustomerRelationDOMapper.selectShopListByDate(null,userId,null,search,null,lastStartDate); + List earlyList = opSellerCustomerRelationDOMapper.selectShopListByDate(null,userId,null,search,null,lastDate); results.put("early",earlyList); } return results; } - -} +} \ No newline at end of file diff --git a/src/main/java/com/kiisoo/ic/customer/controller/CustomerController.java b/src/main/java/com/kiisoo/ic/customer/controller/CustomerController.java index 7b28d87..52dfaa1 100644 --- a/src/main/java/com/kiisoo/ic/customer/controller/CustomerController.java +++ b/src/main/java/com/kiisoo/ic/customer/controller/CustomerController.java @@ -77,11 +77,9 @@ public class CustomerController extends BaseController { @ResponseBody @PostMapping("/list/friends") public Map listCustomer(@RequestParam("userId") Long userId,@RequestParam(value = "sellerId",required = false)Long sellerId, - @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){ + @RequestParam(value = "search",required = false)String search,@RequestParam("roleCode")String roleCode){ try { - Map stringObjectMap = customerService.listCustomer(userId, sellerId, search, roleCode, startDate, endDate, lastStartDate, lastEndDate); + Map stringObjectMap = customerService.listCustomer(userId, sellerId, search, roleCode); return success(); } catch (Exception e) { log.error("修改客户信息异常:",e);