This commit is contained in:
mx 2024-12-03 17:23:02 +08:00
parent 90f0929c62
commit 9ea6a3b501
5 changed files with 41 additions and 16 deletions

View File

@ -84,6 +84,15 @@ public class PsContractInfoController extends BaseController {
return R.ok(psContractInfoService.queryInfoByCustomId(customerId)); return R.ok(psContractInfoService.queryInfoByCustomId(customerId));
} }
/**
* 分页查询合同列表
*/
@SaCheckPermission("business:contractInfo:LIST")
@GetMapping("/countContract")
public R<PsContractCountVo> countContract(PsContractInfoQueryBo bo) {
PsContractCountVo contractCountVo = psContractInfoService.countContractInfo(bo);
return R.ok(contractCountVo);
}
/** /**
* 分页查询合同列表 * 分页查询合同列表
*/ */
@ -91,8 +100,6 @@ public class PsContractInfoController extends BaseController {
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo<PsContractInfoVo> list(PsContractInfoQueryBo bo, PageQuery pageQuery) { public TableDataInfo<PsContractInfoVo> list(PsContractInfoQueryBo bo, PageQuery pageQuery) {
TableDataInfo<PsContractInfoVo> psContractInfoVoTableDataInfo = psContractInfoService.queryPageList(bo, pageQuery); TableDataInfo<PsContractInfoVo> psContractInfoVoTableDataInfo = psContractInfoService.queryPageList(bo, pageQuery);
PsContractCountVo contractCountVo = psContractInfoService.countContractInfo(bo);
return psContractInfoVoTableDataInfo; return psContractInfoVoTableDataInfo;
} }
@SaCheckPermission("business:contractInfo:LIST") @SaCheckPermission("business:contractInfo:LIST")

View File

@ -44,15 +44,16 @@ public class PsCustomController extends BaseController {
private final DictService dictService; private final DictService dictService;
private final IPsCustomInfoService psCustomInfoService; private final IPsCustomInfoService psCustomInfoService;
private final ISysNoticeService noticeService; private final ISysNoticeService noticeService;
/** /**
* 查询登陆人下所有的客户名称和id * 查询登陆人下所有的客户名称和id
*/ */
@SaCheckPermission("business:customInfo:list") @SaCheckPermission("business:customInfo:list")
@GetMapping("/listByLoginUser") @GetMapping("/listByLoginUser")
public R<List<Map<String,Object>>> listByLoginUser(String name, PageQuery pageQuery) { public TableDataInfo<List<Map<String,Object>>> listByLoginUser(String customName, String customMobile, String companyName, PageQuery pageQuery) {
return R.ok(psCustomInfoService.listByLoginUser(name, pageQuery)); return psCustomInfoService.listByLoginUser(customName, customMobile, companyName, pageQuery);
} }
/** /**
* 查询客户信息列表 * 查询客户信息列表
*/ */

View File

@ -38,10 +38,6 @@ public class PsContractCountVo implements Serializable {
* 已付金额 * 已付金额
*/ */
private BigDecimal payMoney; private BigDecimal payMoney;
/**
* 退款金额
*/
private BigDecimal returnMoney;
/** /**
* 未付金额 = 所有已有回款合同的总金额 - 所有已有回款合同的已回款金额 * 未付金额 = 所有已有回款合同的总金额 - 所有已有回款合同的已回款金额

View File

@ -1,5 +1,6 @@
package com.pusong.business.service; package com.pusong.business.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pusong.business.domain.PsCustomCallback; import com.pusong.business.domain.PsCustomCallback;
import com.pusong.business.domain.PsCustomInfo; import com.pusong.business.domain.PsCustomInfo;
import com.pusong.business.domain.bo.PsCustomCallbackBo; import com.pusong.business.domain.bo.PsCustomCallbackBo;
@ -31,7 +32,7 @@ public interface IPsCustomInfoService {
* 查询登陆人下所有的客户名称和id * 查询登陆人下所有的客户名称和id
* @return 客户id和姓名 * @return 客户id和姓名
*/ */
List<Map<String,Object>> listByLoginUser(String name, PageQuery pageQuery); TableDataInfo listByLoginUser(String customName, String customMobile, String companyName, PageQuery pageQuery);
/** /**
* 分页查询客户基本信息列表 * 分页查询客户基本信息列表
* *

View File

@ -72,14 +72,30 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
* @return 客户id和姓名 * @return 客户id和姓名
*/ */
@Override @Override
public List<Map<String,Object>> listByLoginUser(String name, PageQuery pageQuery) { public TableDataInfo listByLoginUser(String customName, String customMobile, String companyName, PageQuery pageQuery) {
//查询客户基本信息 //查询客户基本信息
Page<PsCustomInfoVo> list = baseMapper.selectVoPage(pageQuery.build() Page<PsCustomInfoVo> list = baseMapper.selectVoPage(pageQuery.build()
, new QueryWrapper<PsCustomInfo>() , new QueryWrapper<PsCustomInfo>()
.select("id", "custom_name", "custom_mobile", "create_time", "custom_source") .select("id", "custom_name", "custom_mobile", "create_time", "custom_source")
.lambda().eq(PsCustomInfo::getDelFlag, 0).isNotNull(PsCustomInfo::getCustomName).ne(PsCustomInfo::getCustomName,"").ne(PsCustomInfo::getCustomName,"") .lambda()
.and(StringUtils.isNotBlank(name), wq->wq.like(PsCustomInfo::getCustomName,name).or().like(PsCustomInfo::getCustomMobile,name))); .eq(PsCustomInfo::getDelFlag, 0)
.isNotNull(PsCustomInfo::getCustomName)
.ne(PsCustomInfo::getCustomName,"")
.ne(PsCustomInfo::getCustomName,"")
.and(StringUtils.isNotBlank(customName) || StringUtils.isNotBlank(customMobile) || StringUtils.isNotBlank(companyName)
, wq -> wq.like(StringUtils.isNotBlank(customName), PsCustomInfo::getCustomName, customName)
.or()
.like(StringUtils.isNotBlank(customMobile), PsCustomInfo::getCustomMobile, customMobile)
.or()
.exists(StringUtils.isNotBlank(companyName), "select 1 from ps_company_info where ps_company_info.custom_id = ps_custom_info.id and ps_company_info.del_flag = 0 and company_type = 2 and company_name like '%" + companyName + "%'")
));
if (list.getRecords().isEmpty()){
TableDataInfo tableDataInfo = new TableDataInfo();
tableDataInfo.setRows(null);
tableDataInfo.setTotal(0);
return tableDataInfo;
}
List<Long> ids = list.getRecords().stream().map(PsCustomInfoVo::getId).collect(Collectors.toList()); List<Long> ids = list.getRecords().stream().map(PsCustomInfoVo::getId).collect(Collectors.toList());
//查询公司信息 //查询公司信息
@ -107,10 +123,14 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
map.put("createTime", DateUtils.toString(item.getCreateTime(),"yyyy-MM-dd")); map.put("createTime", DateUtils.toString(item.getCreateTime(),"yyyy-MM-dd"));
map.put("customSource", item.getCustomSource()); map.put("customSource", item.getCustomSource());
map.put("psCompanySerivceVo", id_companyMap.get(item.getId())); map.put("psCompanySerivceVo", id_companyMap.get(item.getId()));
listmap.add(map); listmap.add(map);
} }
return listmap; TableDataInfo tableDataInfo = new TableDataInfo();
tableDataInfo.setRows(listmap);
tableDataInfo.setTotal(list.getTotal());
return tableDataInfo;
} }
/** /**