|
@@ -2,6 +2,7 @@ package com.fjhx.sale.service.intermediate.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fjhx.common.entity.corporation.po.Corporation;
|
|
@@ -18,7 +19,9 @@ import com.fjhx.sale.mapper.intermediate.IntermediateContractMapper;
|
|
|
import com.fjhx.sale.service.contract.ContractService;
|
|
|
import com.fjhx.sale.service.documents.DocumentsService;
|
|
|
import com.fjhx.sale.service.intermediate.IntermediateContractService;
|
|
|
+import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.common.utils.wrapper.IWrapper;
|
|
|
+import com.ruoyi.common.utils.wrapper.SqlField;
|
|
|
import com.ruoyi.system.utils.UserUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -26,6 +29,7 @@ import org.springframework.stereotype.Service;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -52,11 +56,14 @@ public class IntermediateContractServiceImpl extends ServiceImpl<IntermediateCon
|
|
|
public Page<IntermediateContractVo> getPage(IntermediateContractSelectDto dto) {
|
|
|
IWrapper<IntermediateContract> wrapper = getWrapper();
|
|
|
//买方公司过滤
|
|
|
- wrapper.eq(IntermediateContract::getBuyCorporationId, dto.getBuyCorporationId());
|
|
|
+ wrapper.orderByDesc("d.create_time");
|
|
|
+ wrapper.eq(StringUtils.isNotEmpty(dto.getKeyword()),"c.code", dto.getKeyword());
|
|
|
+ wrapper.eq(ObjectUtil.isNotEmpty(dto.getBuyCorporationId()),"c.buy_corporation_id", dto.getBuyCorporationId());
|
|
|
+ wrapper.eq(ObjectUtil.isNotEmpty(dto.getSellCorporationId()),"c.sell_corporation_id", dto.getSellCorporationId());
|
|
|
+ List<IntermediateContract> intermediateContracts = this.list(Wrappers.<IntermediateContract>query().lambda().select(IntermediateContract::getDocumentsId));
|
|
|
+ List<Long> ids = intermediateContracts.stream().map(IntermediateContract::getDocumentsId).collect(Collectors.toList());
|
|
|
+ wrapper.notIn("d.id",ids);
|
|
|
//卖方公司过滤
|
|
|
- wrapper.eq(IntermediateContract::getSellCorporationId, dto.getSellCorporationId());
|
|
|
-
|
|
|
- wrapper.orderByDesc("ic", IntermediateContract::getId);
|
|
|
Page<IntermediateContractVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
|
|
|
List<IntermediateContractVo> records = page.getRecords();
|
|
|
//赋值原买方公司名称 客户
|
|
@@ -67,16 +74,16 @@ public class IntermediateContractServiceImpl extends ServiceImpl<IntermediateCon
|
|
|
corporationService.attributeAssign(records, IntermediateContractVo::getOldSellCorporationId, (item, corporation) -> {
|
|
|
item.setOldSellCorporationName(corporation.getName());
|
|
|
});
|
|
|
- //赋值中间合同重新赋值过后的买方名称
|
|
|
- corporationService.attributeAssign(records, IntermediateContractVo::getBuyCorporationId, (item, corporation) -> {
|
|
|
- item.setBuyCorporationName(corporation.getName());
|
|
|
- });
|
|
|
- //赋值中间合同重新赋值过后的卖方名称
|
|
|
- corporationService.attributeAssign(records, IntermediateContractVo::getSellCorporationId, (item, corporation) -> {
|
|
|
- item.setSellCorporationName(corporation.getName());
|
|
|
- });
|
|
|
+// //赋值中间合同重新赋值过后的买方名称
|
|
|
+// corporationService.attributeAssign(records, IntermediateContractVo::getBuyCorporationId, (item, corporation) -> {
|
|
|
+// item.setBuyCorporationName(corporation.getName());
|
|
|
+// });
|
|
|
+// //赋值中间合同重新赋值过后的卖方名称
|
|
|
+// corporationService.attributeAssign(records, IntermediateContractVo::getSellCorporationId, (item, corporation) -> {
|
|
|
+// item.setSellCorporationName(corporation.getName());
|
|
|
+// });
|
|
|
//赋值最近操作用户
|
|
|
- UserUtil.assignmentNickName(records, IntermediateContractVo::getUpdateUser, IntermediateContractVo::setOpUserName);
|
|
|
+// UserUtil.assignmentNickName(records, IntermediateContractVo::getUpdateUser, IntermediateContractVo::setOpUserName);
|
|
|
return page;
|
|
|
}
|
|
|
|