合同,项目id更改为项目名称
This commit is contained in:
parent
8a968f1a49
commit
987c4eeb38
|
@ -45,10 +45,10 @@ public class ContractEntity extends AuditableEntity implements Serializable {
|
||||||
@TableField("code")
|
@TableField("code")
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
@ExcelProperty("项目id")
|
@ExcelProperty("项目名称")
|
||||||
@ApiModelProperty("项目id")
|
@ApiModelProperty("项目名称")
|
||||||
@TableField("project_id")
|
@TableField("project_name")
|
||||||
private String projectId;
|
private String projectName;
|
||||||
|
|
||||||
@ExcelProperty("业务员id")
|
@ExcelProperty("业务员id")
|
||||||
@ApiModelProperty("业务员id")
|
@ApiModelProperty("业务员id")
|
||||||
|
|
|
@ -32,8 +32,8 @@ public class ContractListReq implements Serializable {
|
||||||
@ApiModelProperty("合同编号")
|
@ApiModelProperty("合同编号")
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
@ApiModelProperty("项目id")
|
@ApiModelProperty("项目名称")
|
||||||
private String projectId;
|
private String projectName;
|
||||||
|
|
||||||
@ApiModelProperty("业务员id")
|
@ApiModelProperty("业务员id")
|
||||||
private String salespersonId;
|
private String salespersonId;
|
||||||
|
|
|
@ -31,8 +31,8 @@ public class ContractReq implements Serializable {
|
||||||
@ApiModelProperty("合同编号")
|
@ApiModelProperty("合同编号")
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
@ApiModelProperty("项目id")
|
@ApiModelProperty("项目名称")
|
||||||
private String projectId;
|
private String projectName;
|
||||||
|
|
||||||
@ApiModelProperty("业务员id")
|
@ApiModelProperty("业务员id")
|
||||||
private String salespersonId;
|
private String salespersonId;
|
||||||
|
|
|
@ -18,9 +18,6 @@ import java.math.BigDecimal;
|
||||||
@ApiModel("合同响应实体")
|
@ApiModel("合同响应实体")
|
||||||
public class ContractResp extends ContractEntity {
|
public class ContractResp extends ContractEntity {
|
||||||
|
|
||||||
@ApiModelProperty("项目名称")
|
|
||||||
private String projectName;
|
|
||||||
|
|
||||||
@ApiModelProperty("业务员姓名")
|
@ApiModelProperty("业务员姓名")
|
||||||
private String salespersonName;
|
private String salespersonName;
|
||||||
|
|
||||||
|
|
|
@ -4,15 +4,18 @@ import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.dite.znpt.domain.entity.ContractEntity;
|
import com.dite.znpt.domain.entity.ContractEntity;
|
||||||
|
import com.dite.znpt.domain.entity.ContractSettlementEntity;
|
||||||
import com.dite.znpt.domain.vo.ContractListReq;
|
import com.dite.znpt.domain.vo.ContractListReq;
|
||||||
import com.dite.znpt.domain.vo.ContractReq;
|
import com.dite.znpt.domain.vo.ContractReq;
|
||||||
import com.dite.znpt.domain.vo.ContractResp;
|
import com.dite.znpt.domain.vo.ContractResp;
|
||||||
import com.dite.znpt.enums.ContractStatusEnum;
|
import com.dite.znpt.enums.ContractStatusEnum;
|
||||||
import com.dite.znpt.mapper.ContractMapper;
|
import com.dite.znpt.mapper.ContractMapper;
|
||||||
import com.dite.znpt.service.ContractService;
|
import com.dite.znpt.service.ContractService;
|
||||||
|
import com.dite.znpt.service.ContractSettlementService;
|
||||||
import com.dite.znpt.util.PageUtil;
|
import com.dite.znpt.util.PageUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -25,6 +28,8 @@ import java.util.List;
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class ContractServiceImpl extends ServiceImpl<ContractMapper, ContractEntity> implements ContractService {
|
public class ContractServiceImpl extends ServiceImpl<ContractMapper, ContractEntity> implements ContractService {
|
||||||
|
|
||||||
|
private final ContractSettlementService contractSettlementService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 功能描述:查询合同列表
|
* 功能描述:查询合同列表
|
||||||
*
|
*
|
||||||
|
@ -96,9 +101,10 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, ContractEnt
|
||||||
* @date 2025/07/21 20:29
|
* @date 2025/07/21 20:29
|
||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void deleteById(String contractId) {
|
public void deleteById(String contractId) {
|
||||||
// todo 校验
|
|
||||||
removeById(contractId);
|
removeById(contractId);
|
||||||
|
contractSettlementService.lambdaUpdate().eq(ContractSettlementEntity::getContractId, contractId).remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<mapper namespace="com.dite.znpt.mapper.ContractMapper">
|
<mapper namespace="com.dite.znpt.mapper.ContractMapper">
|
||||||
|
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
a.contract_id, a.customer, a.code, a.project_id,
|
a.contract_id, a.customer, a.code, a.project_name,
|
||||||
a.salesperson_id, a.department_id, a.sign_date, a.duration,
|
a.salesperson_id, a.department_id, a.sign_date, a.duration,
|
||||||
a.type, a.product_service, a.payment_date, a.payment_address,
|
a.type, a.product_service, a.payment_date, a.payment_address,
|
||||||
a.amount, a.account_number, a.notes, a.contract_status,
|
a.amount, a.account_number, a.notes, a.contract_status,
|
||||||
|
@ -14,11 +14,10 @@
|
||||||
select
|
select
|
||||||
<include refid="Base_Column_List"/>,
|
<include refid="Base_Column_List"/>,
|
||||||
u.name as salespersonName, d.dept_name as salespersonDeptName,
|
u.name as salespersonName, d.dept_name as salespersonDeptName,
|
||||||
p.project_name, (select sum(cs.amount) from contract_settlement cs where a.contract_id=cs.contract_id) as settlementAmount
|
(select sum(cs.amount) from contract_settlement cs where a.contract_id=cs.contract_id) as settlementAmount
|
||||||
from contract a
|
from contract a
|
||||||
left join user u on a.salesperson_id = u.user_id
|
left join user u on a.salesperson_id = u.user_id
|
||||||
left join dept d on a.department_id=d.dept_id
|
left join dept d on a.department_id=d.dept_id
|
||||||
left join project p on a.project_id=p.project_id
|
|
||||||
<where>
|
<where>
|
||||||
<if test="contractId != null and contractId != ''">
|
<if test="contractId != null and contractId != ''">
|
||||||
and a.contract_id like concat ('%', #{contractId}, '%')
|
and a.contract_id like concat ('%', #{contractId}, '%')
|
||||||
|
@ -29,8 +28,8 @@
|
||||||
<if test="code != null and code != ''">
|
<if test="code != null and code != ''">
|
||||||
and a.code like concat ('%', #{code}, '%')
|
and a.code like concat ('%', #{code}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="projectId != null and projectId != ''">
|
<if test="projectName != null and projectName != ''">
|
||||||
and a.project_id like concat ('%', #{projectId}, '%')
|
and a.project_name like concat ('%', #{projectName}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="salespersonId != null and salespersonId != ''">
|
<if test="salespersonId != null and salespersonId != ''">
|
||||||
and a.salesperson_id like concat ('%', #{salespersonId}, '%')
|
and a.salesperson_id like concat ('%', #{salespersonId}, '%')
|
||||||
|
|
Loading…
Reference in New Issue