From 5d6c8691bd50328938703efdf0bc56aac6f91d8e Mon Sep 17 00:00:00 2001 From: yechenhao Date: Mon, 20 Apr 2020 19:26:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=91=E7=9A=84=E5=A5=BD=E5=8F=8B=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kiisoo/ic/customer/CustomerService.java | 27 ++++++++++--------- .../controller/CustomerController.java | 6 ++--- 2 files changed, 16 insertions(+), 17 deletions(-) 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);