|
@@ -38,6 +38,7 @@ import com.fjhx.customer.entity.customer.po.Customer;
|
|
|
import com.fjhx.customer.service.customer.CustomerService;
|
|
|
import com.fjhx.file.entity.FileInfoVo;
|
|
|
import com.fjhx.file.utils.ObsFileUtil;
|
|
|
+import com.fjhx.flow.entity.flow.po.FlowExample;
|
|
|
import com.fjhx.flow.service.flow.FlowExampleService;
|
|
|
import com.fjhx.item.entity.product.dto.ProductInfoSelectDto;
|
|
|
import com.fjhx.item.entity.product.po.ProductInfo;
|
|
@@ -243,9 +244,9 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
public Page<ContractVo> getPage(ContractSelectDto dto) {
|
|
|
IWrapper<Contract> wrapper = getWrapper();
|
|
|
SysUser sysUser = UserUtil.getUserInfo();
|
|
|
- if(StringUtils.isEmpty(sysUser.getUserCode())){//不是业务员看所有
|
|
|
+ if (StringUtils.isEmpty(sysUser.getUserCode())) {//不是业务员看所有
|
|
|
return pageCommon(dto, wrapper);
|
|
|
- }else{//是业务员
|
|
|
+ } else {//是业务员
|
|
|
List<Long> authIdList = customerService.getAuthIdList();
|
|
|
if (authIdList.size() == 0) {
|
|
|
return new Page<>();
|
|
@@ -270,7 +271,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
private Page<ContractVo> pageCommon(ContractSelectDto dto, IWrapper<Contract> wrapper) {
|
|
|
wrapper.orderByDesc("t1", Contract::getCreateTime);
|
|
|
wrapper.eq("t1", Contract::getIsChange, "0");//列表只展示未变更得数据
|
|
|
- wrapper.ne("t1",Contract::getIsShow,1);
|
|
|
+ wrapper.ne("t1", Contract::getIsShow, 1);
|
|
|
wrapper.between("t1", Contract::getStatus, FlowStatusEnum1.DRAFT.getKey(), FlowStatusEnum1.CANCELLATION.getKey() - 1);
|
|
|
if (StringUtils.isNotEmpty(dto.getStatus())) {
|
|
|
wrapper.eq("t1", Contract::getStatus, dto.getStatus());
|
|
@@ -290,7 +291,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
List<Long> customerIds = customerService.listObject(Customer::getId, q -> q.like(Customer::getName, dto.getKeyword()));
|
|
|
wrapper.and(q -> q
|
|
|
.like("t1", Contract::getCode, dto.getKeyword())
|
|
|
- .or().like("t1",Contract::getUserName,dto.getUserName())
|
|
|
+ .or().like("t1", Contract::getUserName, dto.getUserName())
|
|
|
.or().in("t1", Contract::getSellCorporationId, corporationIds)
|
|
|
.or().in("t1", Contract::getBuyCorporationId, customerIds)
|
|
|
);
|
|
@@ -348,7 +349,8 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
}
|
|
|
|
|
|
// 赋值流程id
|
|
|
- flowExampleService.setFlowId(list, ContractVo::setFlowId);
|
|
|
+ List<ContractVo> collect = list.stream().filter(item -> Objects.isNull(item.getFlowId())).collect(Collectors.toList());
|
|
|
+ flowExampleService.setFlowId(collect, ContractVo::setFlowId);
|
|
|
//赋值原卖方公司名称 多公司
|
|
|
corporationService.attributeAssign(list, ContractVo::getSellCorporationId, (item, corporation) -> {
|
|
|
item.setSellCorporationName(corporation.getName());
|
|
@@ -625,7 +627,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
List<EhsdPurchaseProduct> purchaseProducts = ehsdPurchaseProductService.getPurchaseProductByContractProductIds(contractProductIds);
|
|
|
if (ObjectUtil.isNotEmpty(purchaseProducts)) {
|
|
|
Map<Long, List<EhsdPurchaseProduct>> collect = purchaseProducts.stream()
|
|
|
- .filter(item->ObjectUtil.isNotEmpty(item.getDataResourceId()))
|
|
|
+ .filter(item -> ObjectUtil.isNotEmpty(item.getDataResourceId()))
|
|
|
.collect(Collectors.groupingBy(EhsdPurchaseProduct::getDataResourceId));
|
|
|
for (ContractProduct contractProduct : contractProductList) {
|
|
|
List<EhsdPurchaseProduct> ehsdPurchaseProductList = collect.get(contractProduct.getId());
|
|
@@ -1287,12 +1289,12 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
|
|
|
IWrapper<Contract> wrapper = IWrapper.getWrapper();
|
|
|
SysUser sysUser = UserUtil.getUserInfo();
|
|
|
- if(StringUtils.isNotEmpty(sysUser.getUserCode())){//是业务员
|
|
|
+ if (StringUtils.isNotEmpty(sysUser.getUserCode())) {//是业务员
|
|
|
List<Long> authIdList = customerService.getAuthIdList();
|
|
|
if (authIdList.size() == 0) {
|
|
|
return new Page<>();
|
|
|
}
|
|
|
- wrapper.in( Contract::getBuyCorporationId, authIdList);
|
|
|
+ wrapper.in(Contract::getBuyCorporationId, authIdList);
|
|
|
}
|
|
|
// //销售跟单权限过滤
|
|
|
// List<Long> authUserIdList = UserUtil.getAuthUserIdList();
|
|
@@ -1792,7 +1794,8 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
}
|
|
|
List<ContractVo> contractVos = BeanUtil.copyToList(contractList, ContractVo.class);
|
|
|
// 赋值流程id
|
|
|
- flowExampleService.setFlowId(contractVos, ContractVo::setFlowId);
|
|
|
+ List<ContractVo> collect = contractVos.stream().filter(item -> Objects.isNull(item.getFlowId())).collect(Collectors.toList());
|
|
|
+ flowExampleService.setFlowId(collect, ContractVo::setFlowId);
|
|
|
return contractVos;
|
|
|
}
|
|
|
|