| src/main/java/com/ruoyi/basic/dto/CustomerPrivatePoolDto.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/ruoyi/basic/pojo/CustomerPrivate.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/ruoyi/sales/vo/ExportProcessContractVo.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/resources/mapper/basic/CustomerPrivatePoolMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/ruoyi/basic/dto/CustomerPrivatePoolDto.java
@@ -121,4 +121,26 @@ private List<Long> ids; @ApiModelProperty(value = "法人") @Excel(name = "法人") @TableField(value = "corporation") private String corporation; @ApiModelProperty(value = "传真") @Excel(name = "传真") @TableField(value = "fax") private String fax; @ApiModelProperty(value = "开户行") @Excel(name = "开户行") @TableField(value = "bank_name") private String bankName; @ApiModelProperty(value = "代理") @Excel(name = "代理") @TableField(value = "agent") private String agent; } src/main/java/com/ruoyi/basic/pojo/CustomerPrivate.java
@@ -88,6 +88,28 @@ @Excel(name = "客户分类") private String customerType; @ApiModelProperty(value = "法人") @Excel(name = "法人") @TableField(value = "corporation") private String corporation; @ApiModelProperty(value = "传真") @Excel(name = "传真") @TableField(value = "fax") private String fax; @ApiModelProperty(value = "开户行") @Excel(name = "开户行") @TableField(value = "bank_name") private String bankName; @ApiModelProperty(value = "代理") @Excel(name = "代理") @TableField(value = "agent") private String agent; @ApiModelProperty("创建人ID") @TableField(fill = FieldFill.INSERT) private Long createUser; src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java
@@ -185,12 +185,15 @@ if (!salesLedgers.isEmpty()) { throw new RuntimeException("客户档案下有销售合同,请先删除销售合同"); } // 删除客户的同时也需要删除对应的客户跟随、附件和回访提醒 for (Long id : ids) { customerFollowUpService.deleteByCustomerId(id); customerReturnVisitService.deleteByCustomerId(id); List<CustomerPrivatePool> customerPrivatePools = customerPrivatePoolMapper.selectList(new QueryWrapper<CustomerPrivatePool>().lambda().in(CustomerPrivatePool::getCustomerId, idList)); if (!customerPrivatePools.isEmpty()) { throw new RuntimeException("客户档案下有客户私海,请先收回私海数据"); } // 删除客户的同时也需要删除对应的客户跟随、附件和回访提醒 // for (Long id : ids) { // customerFollowUpService.deleteByCustomerId(id); // customerReturnVisitService.deleteByCustomerId(id); // } return customerMapper.deleteBatchIds(idList); } src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
@@ -480,14 +480,15 @@ exportProcessContract.setId(id); SalesLedger salesLedger = salesLedgerMapper.selectById(id); // 查询客户公司信息 Customer customer = customerMapper.selectById(salesLedger.getCustomerId()); CustomerPrivatePoolDto customerPrivatePoolDto = customerPrivatePoolMapper.selectInfo(salesLedger.getCustomerId()); exportProcessContract.setCreateTime(LocalDateTimeUtil.format(Optional.ofNullable(salesLedger.getExecutionDate()).orElse(LocalDate.now()), "yyyy年MM月dd日")); exportProcessContract.setRemark(Optional.ofNullable(salesLedger.getRemarks()).orElse("无")); // 备注 exportProcessContract.setPlaceOfSinging(Optional.ofNullable(salesLedger.getPlaceOfSinging()).orElse("")); // 填写甲方信息 ExportProcessContractVo.Customer partyA = ExportProcessContractVo.Customer.getCustomer(customer); exportProcessContract.setPartyAClientName(customer.getCustomerName()); ExportProcessContractVo.Customer partyA = ExportProcessContractVo.Customer.getCustomer(customerPrivatePoolDto); exportProcessContract.setPartyAClientName(customerPrivatePoolDto.getCustomerName()); exportProcessContract.setPartyA(partyA); // 填写乙方信息 src/main/java/com/ruoyi/sales/vo/ExportProcessContractVo.java
@@ -83,7 +83,7 @@ // 邮编 private String postCode = ""; public static ExportProcessContractVo.Customer getCustomer(com.ruoyi.basic.pojo.Customer customer) { public static ExportProcessContractVo.Customer getCustomer(com.ruoyi.basic.dto.CustomerPrivatePoolDto customer) { ExportProcessContractVo.Customer partyA = new ExportProcessContractVo.Customer(); partyA.setFax(Optional.ofNullable(customer.getFax()).orElse("")); partyA.setAddress(padRight(customer.getCompanyAddress(), 15)); src/main/resources/mapper/basic/CustomerPrivatePoolMapper.xml
@@ -29,7 +29,11 @@ coalesce(c.tenant_id, cp.tenant_id) as tenant_id, coalesce(c.basic_bank_account, cp.basic_bank_account) as basic_bank_account, coalesce(c.bank_account, cp.bank_account) as bank_account, coalesce(c.bank_code, cp.bank_code) as bank_code coalesce(c.bank_code, cp.bank_code) as bank_code, coalesce(c.corporation, cp.corporation) as corporation, coalesce(c.fax, cp.fax) as fax, coalesce(c.agent, cp.agent) as agent, coalesce(c.bank_name, cp.bank_name) as bank_name from customer_private_pool cpp left join customer c on c.id = cpp.customer_id and cpp.type = 1 left join customer_private cp on cp.id = cpp.customer_id and cpp.type = 0 @@ -40,6 +44,9 @@ </if> <if test="c.customerType != null"> and c.customer_type = #{c.customerType} </if> <if test="c.boundId != null"> and cpp.bound_id = #{c.boundId} </if> </where> order by cpp.id desc @@ -61,7 +68,11 @@ coalesce(c.tenant_id, cp.tenant_id) as tenant_id, coalesce(c.basic_bank_account, cp.basic_bank_account) as basic_bank_account, coalesce(c.bank_account, cp.bank_account) as bank_account, coalesce(c.bank_code, cp.bank_code) as bank_code coalesce(c.bank_code, cp.bank_code) as bank_code, coalesce(c.corporation, cp.corporation) as corporation, coalesce(c.fax, cp.fax) as fax, coalesce(c.agent, cp.agent) as agent, coalesce(c.bank_name, cp.bank_name) as bank_name from customer_private_pool cpp left join customer c on c.id = cpp.customer_id and cpp.type = 1 left join customer_private cp on cp.id = cpp.customer_id and cpp.type = 0 @@ -89,9 +100,13 @@ coalesce(c.basic_bank_account, cp.basic_bank_account) as basic_bank_account, coalesce(c.bank_account, cp.bank_account) as bank_account, coalesce(c.bank_code, cp.bank_code) as bank_code coalesce(c.corporation, cp.corporation) as corporation, coalesce(c.fax, cp.fax) as fax, coalesce(c.agent, cp.agent) as agent, coalesce(c.bank_name, cp.bank_name) as bank_name from customer_private_pool cpp left join customer c on c.id = cpp.customer_id and cpp.type = 1 left join customer_private cp on cp.id = cpp.customer_id and cpp.type = 0 left join customer c on c.id = cpp.customer_id and cpp.type = 1 left join customer_private cp on cp.id = cpp.customer_id and cpp.type = 0 </select> </mapper>