| | |
| | | if (pageWrap.getModel().getAreaCode() != null) { |
| | | queryWrapper.lambda().eq(Customer::getAreaCode, pageWrap.getModel().getAreaCode()); |
| | | } |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |
| | | queryWrapper.orderByDesc(sortData.getProperty()); |
| | | } else { |
| | | queryWrapper.orderByAsc(sortData.getProperty()); |
| | | } |
| | | } |
| | | queryWrapper.lambda().orderByDesc(Customer::getCreateDate ); |
| | | return PageData.from(customerMapper.selectPage(page, queryWrapper)); |
| | | } |
| | | |
| | |
| | | return customerMapper.selectCount(wrapper); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void saveRenovationCalculator(RenovationCalculatorDTO renovationCalculatorDTO){ |
| | | public CustomerLog saveRenovationCalculator(RenovationCalculatorDTO renovationCalculatorDTO){ |
| | | if(Objects.isNull(renovationCalculatorDTO) |
| | | || Objects.isNull(renovationCalculatorDTO.getMemberId()) |
| | | || Objects.isNull(renovationCalculatorDTO.getHouseStatus()) |
| | |
| | | customerLog.setIsdeleted(Constants.ZERO); |
| | | customerLog.setType(Constants.TWO); |
| | | customerLog.setCrmStatus(Constants.ZERO); |
| | | customerLog.setName(StringUtils.isEmpty(member.getName())?member.getNickname():member.getName()); |
| | | customerLog.setPhone(customer.getPhone()); |
| | | customerLog.setBudget(renovationCalculatorDTO.getBudget().multiply(new BigDecimal(10000)).toString()); |
| | | customerLog.setHouseStatus(renovationCalculatorDTO.getHouseStatus()); |
| | |
| | | customerLog.setHouseType(renovationCalculatorDTO.getHouseType()); |
| | | customerLog.setCostomerId(customer.getId().toString()); |
| | | customerLogMapper.insert(customerLog); |
| | | customerLog.setOpenid(member.getOpenid()); |
| | | return customerLog; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void saveFreeCustomizationApply(FreeCustomizationDTO freeCustomizationDTO){ |
| | | public CustomerLog saveFreeCustomizationApply(FreeCustomizationDTO freeCustomizationDTO){ |
| | | if(Objects.isNull(freeCustomizationDTO) |
| | | || Objects.isNull(freeCustomizationDTO.getMemberId()) |
| | | || StringUtils.isEmpty(freeCustomizationDTO.getName()) |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到用户信息"); |
| | | } |
| | | if(StringUtils.isEmpty(member.getPhone())){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未授权手机号"); |
| | | member.setPhone(freeCustomizationDTO.getPhone()); |
| | | memberMapper.updateById(member); |
| | | } |
| | | Customer customer = customerMapper.selectOne(new QueryWrapper<Customer>().lambda() |
| | | .eq(Customer::getPhone,freeCustomizationDTO.getPhone()).eq(Customer::getIsdeleted, Constants.ZERO).last("limit 1")); |
| | |
| | | customerLog.setName(freeCustomizationDTO.getName()); |
| | | customerLog.setPhone(freeCustomizationDTO.getPhone()); |
| | | customerLogMapper.insert(customerLog); |
| | | customerLog.setOpenid(member.getOpenid()); |
| | | return customerLog; |
| | | } |
| | | |
| | | @Override |
| | | public void saveTestTrimStyle(TestTrimStyleDTO testTrimStyleDTO){ |
| | | public CustomerLog saveTestTrimStyle(TestTrimStyleDTO testTrimStyleDTO){ |
| | | if(Objects.isNull(testTrimStyleDTO) |
| | | || Objects.isNull(testTrimStyleDTO.getMemberId()) |
| | | |
| | |
| | | customerLog.setAgeInfo(testTrimStyleDTO.getAgeInfo()); |
| | | customerLog.setPhone(testTrimStyleDTO.getPhone()); |
| | | customerLogMapper.insert(customerLog); |
| | | customerLog.setOpenid(member.getOpenid()); |
| | | return customerLog; |
| | | } |
| | | |
| | | |