| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.by4cloud.platformx.business.dto.BusinessCustomerAddDTO; |
| | | import com.by4cloud.platformx.business.entity.Product; |
| | | import com.by4cloud.platformx.business.vo.BusinessCustomerSelectVo; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | |
| | | @Value("${dept.smjzt}") |
| | | private String smjzt; |
| | | |
| | | @Value("${dept.smjhw}") |
| | | private String smjhw; |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param page 分页对象 |
| | |
| | | public R getBusinessCustomerPage(@ParameterObject Page page, @ParameterObject BusinessCustomer businessCustomer) { |
| | | |
| | | if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) || |
| | | StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)) { |
| | | StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)|| |
| | | StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) { |
| | | LambdaQueryWrapper<BusinessCustomer> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.eq(businessCustomer.getIndustryId()!=null,BusinessCustomer::getIndustryId,businessCustomer.getIndustryId()); |
| | | wrapper.eq(businessCustomer.getAreaId()!=null,BusinessCustomer::getAreaId,businessCustomer.getAreaId()); |
| | | wrapper.eq(StrUtil.isNotEmpty(businessCustomer.getProvince()),BusinessCustomer::getProvince,businessCustomer.getProvince()); |
| | | wrapper.eq(StrUtil.isNotEmpty(businessCustomer.getIndustryId()),BusinessCustomer::getIndustryId,businessCustomer.getIndustryId()); |
| | | wrapper.like(StrUtil.isNotEmpty(businessCustomer.getCompanyName()),BusinessCustomer::getCompanyName,businessCustomer.getCompanyName()); |
| | | List<String> smjList = new ArrayList<>(); |
| | | smjList.add(smj); |
| | | smjList.add(smjsc); |
| | | smjList.add(smjzt); |
| | | smjList.add(smjhw); |
| | | wrapper.in(BusinessCustomer::getCompId, smjList); |
| | | wrapper.orderByDesc(BusinessCustomer::getCreateTime); |
| | | return R.ok(businessCustomerService.page(page, wrapper)); |
| | | } |
| | | LambdaQueryWrapper<BusinessCustomer> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.eq(businessCustomer.getIndustryId()!=null,BusinessCustomer::getIndustryId,businessCustomer.getIndustryId()); |
| | | wrapper.eq(businessCustomer.getAreaId()!=null,BusinessCustomer::getAreaId,businessCustomer.getAreaId()); |
| | | wrapper.eq(StrUtil.isNotEmpty(businessCustomer.getProvince()),BusinessCustomer::getProvince,businessCustomer.getProvince()); |
| | | wrapper.eq(StrUtil.isNotEmpty(businessCustomer.getIndustryId()),BusinessCustomer::getIndustryId,businessCustomer.getIndustryId()); |
| | | wrapper.like(StrUtil.isNotEmpty(businessCustomer.getCompanyName()),BusinessCustomer::getCompanyName,businessCustomer.getCompanyName()); |
| | | wrapper.orderByDesc(BusinessCustomer::getCreateTime); |
| | | return R.ok(businessCustomerService.pageByScope(page, wrapper)); |
| | |
| | | public R getBusinessCustomerList(@ParameterObject BusinessCustomer businessCustomer) { |
| | | |
| | | if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) || |
| | | StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)) { |
| | | StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)|| |
| | | StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) { |
| | | LambdaQueryWrapper<BusinessCustomer> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.like(StrUtil.isNotEmpty(businessCustomer.getCompanyName()),BusinessCustomer::getCompanyName,businessCustomer.getCompanyName()); |
| | | |
| | | List<String> smjList = new ArrayList<>(); |
| | | smjList.add(smj); |
| | | smjList.add(smjsc); |
| | | smjList.add(smjzt); |
| | | smjList.add(smjhw); |
| | | wrapper.in(BusinessCustomer::getCompId, smjList); |
| | | List<BusinessCustomer> businessCustomerList = businessCustomerService.list(wrapper); |
| | | if (CollUtil.isNotEmpty(businessCustomerList)){ |
| | |
| | | } |
| | | LambdaQueryWrapper<BusinessCustomer> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.like(StrUtil.isNotEmpty(businessCustomer.getCompanyName()),BusinessCustomer::getCompanyName,businessCustomer.getCompanyName()); |
| | | wrapper.eq(StrUtil.isNotEmpty(businessCustomer.getProvince()),BusinessCustomer::getProvince,businessCustomer.getProvince()); |
| | | wrapper.eq(StrUtil.isNotEmpty(businessCustomer.getIndustryId()),BusinessCustomer::getIndustryId,businessCustomer.getIndustryId()); |
| | | List<BusinessCustomer> businessCustomerList = businessCustomerService.listByScope(wrapper); |
| | | if (CollUtil.isNotEmpty(businessCustomerList)){ |
| | | List<BusinessCustomerSelectVo> voList = BeanUtil.copyToList(businessCustomerList, BusinessCustomerSelectVo.class); |
| | |
| | | return R.ok(businessCustomerService.save(businessCustomer)); |
| | | } |
| | | |
| | | @Operation(summary = "新增客商信息-石工泵" , description = "新增客商信息-石工泵" ) |
| | | @SysLog("新增客商信息-石工泵" ) |
| | | @PostMapping("/saveCustomerSgb") |
| | | public R saveCustomerSgb(@RequestBody BusinessCustomerAddDTO addDTO) { |
| | | return businessCustomerService.saveCustomerSgb(addDTO); |
| | | } |
| | | |
| | | /** |
| | | * 修改客商信息 |
| | | * @param businessCustomer 客商信息 |