1.3.3后端:

feat(应收款):完成财务应收款功能开发
dev
xs 1 day ago
parent bc9e530d28
commit caf56e787e

@ -132,8 +132,8 @@ public class ErpProjectInfoController extends BaseController {
/**
* with
*/
@GetMapping("/getErpProjectWithProjectList")
public TableDataInfo<ErpProjectInfoVo> getErpProjectWithProjectList(ErpProjectInfoBo bo, PageQuery pageQuery) {
return erpProjectInfoService.selectErpProjectWithProjectList(bo, pageQuery);
@GetMapping("/getErpProjectWithContractList")
public TableDataInfo<ErpProjectInfoVo> getErpProjectWithContractList(ErpProjectInfoBo bo, PageQuery pageQuery) {
return erpProjectInfoService.selectErpProjectWithContractList(bo, pageQuery);
}
}

@ -10,13 +10,12 @@ import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serial;
import java.util.List;
/**
* erp_fin_account_receivable
*
* @author xins
* @date 2026-02-25
* @date 2026-03-16
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ -152,18 +151,38 @@ public class ErpFinAccountReceivable extends TenantEntity {
*/
private String mesnacProjectCode;
/**
*
*/
private String managerName;
/**
*
*/
private String deptName;
/**
*
*/
private String oneCustomerName;
/**
*
*/
private String twoCustomerName;
/**
*
*/
private String remark;
@TableField(exist = false)
private List<ErpFinAccountReceivableStage> finAccountReceivableStageList;
@TableField(exist = false)
private String projectCode;
private String receivableProjectCode;
@TableField(exist = false)
private String projectName;
private String receivableProjectName;
@TableField(exist = false)
private String receivableProjectStatus;
}

@ -20,7 +20,7 @@ import org.dromara.oa.erp.domain.ErpFinAccountReceivableStage;
* erp_fin_account_receivable
*
* @author xins
* @date 2026-02-25
* @date 2026-03-16
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ -154,15 +154,37 @@ public class ErpFinAccountReceivableBo extends BaseEntity {
*/
private String mesnacProjectCode;
/**
*
*/
private String managerName;
/**
*
*/
private String deptName;
/**
*
*/
private String oneCustomerName;
/**
*
*/
private String twoCustomerName;
/**
*
*/
private String remark;
private List<ErpFinAccountReceivableStage> finAccountReceivableStageList;
private String projectCode;
private String projectName;
private String receivableProjectCode;
private String receivableProjectName;
private String receivableProjectStatus;
}

@ -2,6 +2,8 @@ package org.dromara.oa.erp.domain.vo;
import java.math.BigDecimal;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.dromara.oa.erp.domain.ErpFinAccountReceivable;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
@ -21,7 +23,7 @@ import java.util.Date;
* erp_fin_account_receivable
*
* @author xins
* @date 2026-02-25
* @date 2026-03-16
*/
@Data
@ExcelIgnoreUnannotated
@ -163,32 +165,65 @@ public class ErpFinAccountReceivableVo implements Serializable {
/**
*
*/
@ExcelProperty(value = "回款计划")
private Date repaymentPlan;
/**
*
*/
@ExcelProperty(value = "原计划")
private Date originalPlan;
/**
*
*/
@ExcelProperty(value = "软控订单号")
private String mesnacOrderNo;
/**
*
*/
@ExcelProperty(value = "软控项目号")
private String mesnacProjectCode;
/**
*
*/
@ExcelProperty(value = "项目经理昵称")
private String managerName;
/**
*
*/
@ExcelProperty(value = "部门名称")
private String deptName;
/**
*
*/
@ExcelProperty(value = "甲方名称")
private String oneCustomerName;
/**
*
*/
@ExcelProperty(value = "乙方名称")
private String twoCustomerName;
/**
*
*/
@ExcelProperty(value = "备注")
private String remark;
private String projectCode;
private String projectName;
private ErpContractInfoVo erpContractInfoVo;
private ErpProjectInfoVo erpProjectInfoVo;
private String receivableProjectCode;
private String receivableProjectName;
private String receivableProjectStatus;
}

@ -34,4 +34,6 @@ public interface ErpFinAccountReceivableMapper extends BaseMapperPlus<ErpFinAcco
*/
public List<ErpFinAccountReceivableVo> selectCustomErpFinAccountReceivableVoList(@Param(Constants.WRAPPER) MPJLambdaWrapper<ErpFinAccountReceivable> queryWrapper);
ErpFinAccountReceivableVo selectReceivableVoWithProjectById(@Param("accountReceivableId") Long accountReceivableId);
}

@ -100,5 +100,5 @@ public interface IErpProjectInfoService {
* @param pageQuery
* @return TableDataInfo<ErpProjectInfoVo>
*/
public TableDataInfo<ErpProjectInfoVo> selectErpProjectWithProjectList(ErpProjectInfoBo projectInfoBo, PageQuery pageQuery);
public TableDataInfo<ErpProjectInfoVo> selectErpProjectWithContractList(ErpProjectInfoBo projectInfoBo, PageQuery pageQuery);
}

@ -1,6 +1,5 @@
package org.dromara.oa.erp.service.impl;
import com.alibaba.fastjson.JSONObject;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo;
@ -8,13 +7,9 @@ import org.dromara.common.mybatis.core.page.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.dromara.oa.erp.constant.ProjectCategoryConstant;
import org.dromara.oa.erp.domain.ErpFinAccountReceivableStage;
import org.dromara.oa.erp.domain.ErpProjectInfo;
import org.dromara.oa.erp.domain.bo.ErpProjectInfoBo;
import org.dromara.oa.erp.domain.vo.ErpProjectInfoVo;
import org.dromara.oa.erp.mapper.ErpFinAccountReceivableStageMapper;
import org.dromara.oa.erp.mapper.ErpProjectInfoMapper;
import org.springframework.stereotype.Service;
@ -25,9 +20,11 @@ import org.dromara.oa.erp.mapper.ErpFinAccountReceivableMapper;
import org.dromara.oa.erp.service.IErpFinAccountReceivableService;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Collection;
import java.util.stream.Collectors;
/**
* Service
@ -164,10 +161,23 @@ public class ErpFinAccountReceivableServiceImpl implements IErpFinAccountReceiva
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if (isValid) {
//TODO 做一些业务上的校验,判断是否需要校验
}
List<Long> allReceivableStageIdList = new ArrayList<>();
for (Long accountReceivableId : ids) {
MPJLambdaWrapper<ErpFinAccountReceivableStage> lqw = JoinWrappers.lambda(ErpFinAccountReceivableStage.class)
.selectAll(ErpFinAccountReceivableStage.class)
.eq(ErpFinAccountReceivableStage::getAccountReceivableId, accountReceivableId);
List<ErpFinAccountReceivableStage> finAccountReceivableStageList = stageMapper.selectList(lqw);
List<Long> receivableStageIdList = finAccountReceivableStageList.stream()
.map(ErpFinAccountReceivableStage::getReceivableStageId)
.toList();
allReceivableStageIdList.addAll(receivableStageIdList);
}
stageMapper.deleteByIds(allReceivableStageIdList);
return baseMapper.deleteByIds(ids) > 0;
}
@ -188,29 +198,22 @@ public class ErpFinAccountReceivableServiceImpl implements IErpFinAccountReceiva
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<ErpFinAccountReceivable> lqw = JoinWrappers.lambda(ErpFinAccountReceivable.class)
.selectAll(ErpFinAccountReceivable.class)
.select(ErpProjectInfo::getProjectCode)
.select(ErpProjectInfo::getProjectName)
.selectAs(ErpProjectInfo::getProjectCode,"receivableProjectCode")
.selectAs(ErpProjectInfo::getProjectName,"receivableProjectName")
.selectAs(ErpProjectInfo::getProjectStatus,"receivableProjectStatus")
.leftJoin(ErpProjectInfo.class, ErpProjectInfo::getProjectId, ErpFinAccountReceivable::getProjectId)
.eq(StringUtils.isNotBlank(bo.getInvoiceCode()), ErpFinAccountReceivable::getInvoiceCode, bo.getInvoiceCode())
.eq(bo.getProjectId() != null, ErpFinAccountReceivable::getProjectId, bo.getProjectId())
.eq(bo.getProjectCategory() != null, ErpFinAccountReceivable::getProjectCategory, bo.getProjectCategory())
.eq(StringUtils.isNotBlank(bo.getProjectType()), ErpFinAccountReceivable::getProjectType, bo.getProjectType())
.eq(bo.getContractId() != null, ErpFinAccountReceivable::getContractId, bo.getContractId())
.eq(StringUtils.isNotBlank(bo.getGeneralContractor()), ErpFinAccountReceivable::getGeneralContractor, bo.getGeneralContractor())
.eq(StringUtils.isNotBlank(bo.getCustomerAbbreviation()), ErpFinAccountReceivable::getCustomerAbbreviation, bo.getCustomerAbbreviation())
.eq(StringUtils.isNotBlank(bo.getContractParties()), ErpFinAccountReceivable::getContractParties, bo.getContractParties())
.eq(StringUtils.isNotBlank(bo.getWbsElement()), ErpFinAccountReceivable::getWbsElement, bo.getWbsElement())
.eq(StringUtils.isNotBlank(bo.getLineItem()), ErpFinAccountReceivable::getLineItem, bo.getLineItem())
.eq(StringUtils.isNotBlank(bo.getFinProjectStatus()), ErpFinAccountReceivable::getFinProjectStatus, bo.getFinProjectStatus())
.eq(bo.getSettlementMonth() != null, ErpFinAccountReceivable::getSettlementMonth, bo.getSettlementMonth())
.eq(bo.getIncome() != null, ErpFinAccountReceivable::getIncome, bo.getIncome())
.eq(bo.getBackToBackRatio() != null, ErpFinAccountReceivable::getBackToBackRatio, bo.getBackToBackRatio())
.eq(StringUtils.isNotBlank(bo.getCurrency()), ErpFinAccountReceivable::getCurrency, bo.getCurrency())
.eq(bo.getInvoiceAmount() != null, ErpFinAccountReceivable::getInvoiceAmount, bo.getInvoiceAmount())
.eq(bo.getTotalPrice() != null, ErpFinAccountReceivable::getTotalPrice, bo.getTotalPrice())
.eq(bo.getTotalPriceHighway() != null, ErpFinAccountReceivable::getTotalPriceHighway, bo.getTotalPriceHighway())
.eq(bo.getTotalPriceOri() != null, ErpFinAccountReceivable::getTotalPriceOri, bo.getTotalPriceOri())
.eq(bo.getExchangeRate() != null, ErpFinAccountReceivable::getExchangeRate, bo.getExchangeRate());
.like(StringUtils.isNotBlank(bo.getReceivableProjectCode()), ErpProjectInfo::getProjectCode, bo.getReceivableProjectCode())
.like(StringUtils.isNotBlank(bo.getReceivableProjectName()), ErpProjectInfo::getProjectName, bo.getReceivableProjectName())
.eq(StringUtils.isNotBlank(bo.getReceivableProjectStatus()), ErpProjectInfo::getProjectStatus, bo.getReceivableProjectStatus())
.like(StringUtils.isNotBlank(bo.getInvoiceCode()), ErpFinAccountReceivable::getInvoiceCode, bo.getInvoiceCode())
.like(bo.getProjectCategory() != null, ErpFinAccountReceivable::getProjectCategory, bo.getProjectCategory())
.like(StringUtils.isNotBlank(bo.getProjectType()), ErpFinAccountReceivable::getProjectType, bo.getProjectType())
.like(StringUtils.isNotBlank(bo.getGeneralContractor()), ErpFinAccountReceivable::getGeneralContractor, bo.getGeneralContractor())
.like(StringUtils.isNotBlank(bo.getCustomerAbbreviation()), ErpFinAccountReceivable::getCustomerAbbreviation, bo.getCustomerAbbreviation())
.like(StringUtils.isNotBlank(bo.getContractParties()), ErpFinAccountReceivable::getContractParties, bo.getContractParties())
.like(StringUtils.isNotBlank(bo.getWbsElement()), ErpFinAccountReceivable::getWbsElement, bo.getWbsElement())
.like(StringUtils.isNotBlank(bo.getLineItem()), ErpFinAccountReceivable::getLineItem, bo.getLineItem())
.like(StringUtils.isNotBlank(bo.getFinProjectStatus()), ErpFinAccountReceivable::getFinProjectStatus, bo.getFinProjectStatus());
return lqw;
}
@ -221,30 +224,9 @@ public class ErpFinAccountReceivableServiceImpl implements IErpFinAccountReceiva
*/
@Override
public ErpFinAccountReceivableVo getAccountReceivableWithProjectByReceivableId(Long accountReceivableId) {
ErpFinAccountReceivableVo erpFinAccountReceivableVo = this.queryById(accountReceivableId);
ErpProjectInfoVo erpProjectInfoVo = this.queryJoinProjectByProjectId(erpFinAccountReceivableVo.getProjectId());
erpFinAccountReceivableVo.setErpProjectInfoVo(erpProjectInfoVo);
return erpFinAccountReceivableVo;
return baseMapper.selectReceivableVoWithProjectById(accountReceivableId);
}
/**
* ID,使
*
* @param projectId ID
* @return
*/
private ErpProjectInfoVo queryJoinProjectByProjectId(Long projectId) {
ErpProjectInfoVo erpProjectInfoVo = new ErpProjectInfoVo();
MPJLambdaWrapper<ErpProjectInfo> lqw = JoinWrappers.lambda(ErpProjectInfo.class)
.selectAll(ErpProjectInfo.class)
.eq(projectId != null, ErpProjectInfo::getProjectId, projectId);
List<ErpProjectInfoVo> erpProjectInfoVoList = erpProjectInfoMapper.selectErpProjectInfoVoJoinList(lqw);
if (erpProjectInfoVoList != null && !erpProjectInfoVoList.isEmpty()) {
erpProjectInfoVo = erpProjectInfoVoList.get(0);
}
return erpProjectInfoVo;
}
}

@ -204,6 +204,11 @@ public class ErpFinAccountReceivableStageServiceImpl implements IErpFinAccountRe
return result;
}
/**
* ID
* @param contractId
* @return
*/
private Map<Long,BigDecimal> getErpFinAccountInstallmentDetailMap(Long contractId) {
ErpFinAccountInstallmentDetailBo bo = new ErpFinAccountInstallmentDetailBo();
MPJLambdaWrapper<ErpFinAccountInstallmentDetail> lqw = JoinWrappers.lambda(ErpFinAccountInstallmentDetail.class)

@ -1,7 +1,11 @@
package org.dromara.oa.erp.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import org.apache.dubbo.config.annotation.DubboReference;
import org.dromara.common.core.enums.BusinessStatusEnum;
import org.dromara.common.core.enums.OAStatusEnum;
import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo;
@ -9,18 +13,12 @@ import org.dromara.common.mybatis.core.page.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.dromara.oa.erp.domain.ErpContractPaymentMethod;
import org.dromara.oa.erp.domain.ErpFinInvoiceDetail;
import org.dromara.oa.erp.domain.ErpProjectInfo;
import org.dromara.oa.erp.domain.bo.ErpBudgetInfoBo;
import org.dromara.oa.erp.domain.bo.ErpFinInvoiceDetailBo;
import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.oa.erp.domain.*;
import org.dromara.oa.erp.domain.vo.ErpContractPaymentMethodVo;
import org.dromara.oa.erp.domain.vo.ErpFinInvoiceDetailVo;
import org.dromara.oa.erp.domain.vo.ErpProjectInfoVo;
import org.dromara.oa.erp.mapper.ErpContractPaymentMethodMapper;
import org.dromara.oa.erp.mapper.ErpFinInvoiceAttachMapper;
import org.dromara.oa.erp.mapper.ErpFinInvoiceDetailMapper;
import org.dromara.oa.workflow.strategy.InvoiceWorkflowStrategy;
import org.dromara.workflow.api.RemoteWorkflowService;
@ -30,14 +28,15 @@ import org.dromara.workflow.strategy.WorkflowStrategy;
import org.springframework.stereotype.Service;
import org.dromara.oa.erp.domain.bo.ErpFinInvoiceInfoBo;
import org.dromara.oa.erp.domain.vo.ErpFinInvoiceInfoVo;
import org.dromara.oa.erp.domain.ErpFinInvoiceInfo;
import org.dromara.oa.erp.mapper.ErpFinInvoiceInfoMapper;
import org.dromara.oa.erp.service.IErpFinInvoiceInfoService;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Collection;
import java.util.concurrent.atomic.AtomicBoolean;
/**
* Service
@ -83,8 +82,8 @@ public class ErpFinInvoiceInfoServiceImpl extends AbstractWorkflowService<ErpFin
public ErpFinInvoiceInfoVo queryById(Long invoiceId) {
ErpFinInvoiceInfoVo erpFinInvoiceInfoVo = baseMapper.selectVoById(invoiceId);
MPJLambdaWrapper<ErpFinInvoiceDetail> lqw = JoinWrappers.lambda(ErpFinInvoiceDetail.class)
.selectAll(ErpFinInvoiceDetail.class)
.eq(invoiceId != null, ErpFinInvoiceDetail::getInvoiceId, invoiceId);
.selectAll(ErpFinInvoiceDetail.class)
.eq(invoiceId != null, ErpFinInvoiceDetail::getInvoiceId, invoiceId);
List<ErpFinInvoiceDetailVo> erpFinInvoiceDetailVoList = erpFinInvoiceDetailMapper.selectVoList(lqw);
erpFinInvoiceInfoVo.setErpFinInvoiceDetailVoList(erpFinInvoiceDetailVoList);
Long contractId = erpFinInvoiceInfoVo.getContractId();
@ -124,16 +123,16 @@ public class ErpFinInvoiceInfoServiceImpl extends AbstractWorkflowService<ErpFin
private MPJLambdaWrapper<ErpFinInvoiceInfo> buildQueryWrapper(ErpFinInvoiceInfoBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<ErpFinInvoiceInfo> lqw = JoinWrappers.lambda(ErpFinInvoiceInfo.class)
.selectAll(ErpFinInvoiceInfo.class)
.eq(ErpFinInvoiceInfo::getDelFlag, "0")
.like(StringUtils.isNotBlank(bo.getProjectCode()), ErpFinInvoiceInfo::getProjectCode, bo.getProjectCode())
.like(StringUtils.isNotBlank(bo.getProjectName()), ErpFinInvoiceInfo::getProjectName, bo.getProjectName())
.eq(StringUtils.isNotBlank(bo.getInvoiceCategory()), ErpFinInvoiceInfo::getInvoiceCategory, bo.getInvoiceCategory())
.like(StringUtils.isNotBlank(bo.getCustomerName()), ErpFinInvoiceInfo::getCustomerName, bo.getCustomerName())
.eq(StringUtils.isNotBlank(bo.getEarlyFlag()), ErpFinInvoiceInfo::getEarlyFlag, bo.getEarlyFlag())
.eq(StringUtils.isNotBlank(bo.getFlowStatus()), ErpFinInvoiceInfo::getFlowStatus, bo.getFlowStatus())
.eq(StringUtils.isNotBlank(bo.getInvoiceStatus()), ErpFinInvoiceInfo::getInvoiceStatus, bo.getInvoiceStatus())
.orderByDesc("invoice_id");
.selectAll(ErpFinInvoiceInfo.class)
.eq(ErpFinInvoiceInfo::getDelFlag, "0")
.like(StringUtils.isNotBlank(bo.getProjectCode()), ErpFinInvoiceInfo::getProjectCode, bo.getProjectCode())
.like(StringUtils.isNotBlank(bo.getProjectName()), ErpFinInvoiceInfo::getProjectName, bo.getProjectName())
.eq(StringUtils.isNotBlank(bo.getInvoiceCategory()), ErpFinInvoiceInfo::getInvoiceCategory, bo.getInvoiceCategory())
.like(StringUtils.isNotBlank(bo.getCustomerName()), ErpFinInvoiceInfo::getCustomerName, bo.getCustomerName())
.eq(StringUtils.isNotBlank(bo.getEarlyFlag()), ErpFinInvoiceInfo::getEarlyFlag, bo.getEarlyFlag())
.eq(StringUtils.isNotBlank(bo.getFlowStatus()), ErpFinInvoiceInfo::getFlowStatus, bo.getFlowStatus())
.eq(StringUtils.isNotBlank(bo.getInvoiceStatus()), ErpFinInvoiceInfo::getInvoiceStatus, bo.getInvoiceStatus())
.orderByDesc("invoice_id");
return lqw;
}
@ -202,10 +201,26 @@ public class ErpFinInvoiceInfoServiceImpl extends AbstractWorkflowService<ErpFin
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
AtomicBoolean flag = new AtomicBoolean(false);
if (isValid) {
//TODO 做一些业务上的校验,判断是否需要校验
ids.forEach(id -> {
ErpFinInvoiceInfo erpFinInvoiceInfo = baseMapper.selectById(id);
if (!erpFinInvoiceInfo.getInvoiceStatus().equals(OAStatusEnum.DRAFT.getStatus())
|| !erpFinInvoiceInfo.getFlowStatus().equals(BusinessStatusEnum.DRAFT.getStatus())) {
throw new ServiceException("此开票申请已进入审批,不能删除!");
}
LambdaUpdateWrapper<ErpFinInvoiceInfo> luw = new LambdaUpdateWrapper<>();
// luw.set(ObjectUtil.isNull(config.getPrefix()), SysOssConfig::getPrefix, "");
luw.set(ErpFinInvoiceInfo::getDelFlag, "1");
luw.set(ErpFinInvoiceInfo::getUpdateBy, LoginHelper.getUserId());
luw.set(ErpFinInvoiceInfo::getUpdateTime, new Date());
luw.eq(ErpFinInvoiceInfo::getInvoiceId, id);
flag.set(baseMapper.update(null, luw) > 0);
});
}
return baseMapper.deleteByIds(ids) > 0;
return flag.get();
}
/**
@ -217,9 +232,9 @@ public class ErpFinInvoiceInfoServiceImpl extends AbstractWorkflowService<ErpFin
@Override
public List<ErpContractPaymentMethodVo> getErpContractPaymentMethodList(Long contractId) {
MPJLambdaWrapper<ErpContractPaymentMethod> lqw = JoinWrappers.lambda(ErpContractPaymentMethod.class)
.selectAll(ErpContractPaymentMethod.class)
.eq(contractId != null, ErpContractPaymentMethod::getContractId, contractId)
.orderByAsc(ErpContractPaymentMethod::getSortOrder);
.selectAll(ErpContractPaymentMethod.class)
.eq(contractId != null, ErpContractPaymentMethod::getContractId, contractId)
.orderByAsc(ErpContractPaymentMethod::getSortOrder);
List<ErpContractPaymentMethodVo> erpContractPaymentMethodVoList = erpContractPaymentMethodMapper.selectCustomErpContractPaymentMethodVoList(lqw);
return erpContractPaymentMethodVoList;
}
@ -238,7 +253,7 @@ public class ErpFinInvoiceInfoServiceImpl extends AbstractWorkflowService<ErpFin
validEntityBeforeSave(update);
UpdateWrapper<ErpFinInvoiceInfo> updateWrapper = new UpdateWrapper<>();
updateWrapper.set("oss_id", bo.getOssId())
.eq("invoice_id", bo.getInvoiceId());
.eq("invoice_id", bo.getInvoiceId());
Boolean flag = baseMapper.update(updateWrapper) > 0;
return flag;

@ -584,8 +584,9 @@ public class ErpProjectInfoServiceImpl implements IErpProjectInfoService {
* @return TableDataInfo<ErpProjectInfoVo>
*/
@Override
public TableDataInfo<ErpProjectInfoVo> selectErpProjectWithProjectList(ErpProjectInfoBo projectInfoBo, PageQuery pageQuery) {
Page<ErpProjectInfoVo> page = baseMapper.selectVoPage(pageQuery.build(), this.buildQueryWrapper(projectInfoBo));
public TableDataInfo<ErpProjectInfoVo> selectErpProjectWithContractList(ErpProjectInfoBo projectInfoBo, PageQuery pageQuery) {
Page<ErpProjectInfoVo> page = baseMapper.selectErpProjectInfoVoJoinList(pageQuery.build(), this.buildQueryWrapper(projectInfoBo));
// 批量填充合同信息
if (CollUtil.isNotEmpty(page.getRecords())) {
List<Long> projectIds = StreamUtils.toList(page.getRecords(), ErpProjectInfoVo::getProjectId);
@ -599,6 +600,8 @@ public class ErpProjectInfoServiceImpl implements IErpProjectInfoService {
.selectAll(ErpContractInfo.class)
.selectAs(CrmCustomerInfo::getCustomerName,"oneCustomerName")
.leftJoin(CrmCustomerInfo.class,CrmCustomerInfo::getCustomerId,ErpContractInfo::getOneCustomerId)
.selectAs(CrmCustomerInfo::getCustomerName,"twoCustomerName")
.leftJoin(CrmCustomerInfo.class,CrmCustomerInfo::getCustomerId,ErpContractInfo::getTwoCustomerId)
.in(ErpContractInfo::getContractId, contractIds);
List<ErpContractInfoVo> allContracts = CollUtil.isEmpty(contractIds) ? new ArrayList<>() :
@ -620,4 +623,6 @@ public class ErpProjectInfoServiceImpl implements IErpProjectInfoService {
}
return TableDataInfo.build(page);
}
}

@ -11,4 +11,25 @@
${ew.getCustomSqlSegment}
</select>
<resultMap id="receivableWithProjectMap" type="ErpFinAccountReceivableVo">
<result property="accountReceivableId" column="account_receivable_id"/>
<result property="projectCategory" column="project_category"/>
<!-- 其他字段映射 -->
<association property="erpProjectInfoVo" javaType="org.dromara.oa.erp.domain.vo.ErpProjectInfoVo">
</association>
<association property="erpContractInfoVo" javaType="org.dromara.oa.erp.domain.vo.ErpContractInfoVo">
</association>
</resultMap>
<select id="selectReceivableVoWithProjectById" resultMap="receivableWithProjectMap">
SELECT ar.*,
p.project_name,p.project_code,p.project_status,
c.contract_code,c.contract_name,c.contract_date,c.external_contract_code,c.internal_contract_code,c.business_direction,c.project_contract_code,c.order_contract_code
FROM erp_fin_account_receivable ar
LEFT JOIN erp_project_info p ON ar.project_id = p.project_id
LEFT JOIN erp_contract_info c ON ar.contract_id = c.contract_id
WHERE ar.account_receivable_id = #{accountReceivableId}
</select>
</mapper>

@ -68,30 +68,15 @@
t.contract_flag,
t.project_code,
t.contract_id,
c.contract_date,
c.external_contract_code,
c.internal_contract_code,
c.warranty_period,
cui.customer_name,
cui1.customer_name as contractingEntity,
t.business_direction,
d.dept_name,
u2.nick_name customerManager,
c.order_contract_code,
c.project_contract_code,
u1.nick_name managerName,
t.project_name,
t.project_status,
c.total_price,
t.payment_method,
c.contract_code,
c.contract_name
t.amount
from erp_project_info t
left join sys_user u1 on u1.user_id = t.manager_id
left join erp_contract_info c on t.contract_id = c.contract_id
left join crm_customer_info cui on c.one_customer_id = cui.customer_id
left join crm_customer_info cui1 on c.two_customer_id = cui1.customer_id
left join sys_dept d on d.dept_id = c.contract_dept_id
left join sys_user u2 on u2.user_id = c.contract_manager_id
left join sys_dept d on d.dept_id = t.dept_id
${ew.getCustomSqlSegment}
</select>

Loading…
Cancel
Save