maven
16 小时以前 c58c05fa307754061c9264758eff668105f89625
yys 商机管理优化
已修改4个文件
35 ■■■■ 文件已修改
src/main/java/com/ruoyi/purchase/service/impl/PurchaseLedgerServiceImpl.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/pojo/BusinessOpportunity.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-prod.yml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/purchase/service/impl/PurchaseLedgerServiceImpl.java
@@ -27,9 +27,11 @@
import com.ruoyi.project.system.domain.SysUser;
import com.ruoyi.project.system.mapper.SysUserMapper;
import com.ruoyi.purchase.dto.PurchaseLedgerDto;
import com.ruoyi.purchase.mapper.PaymentRegistrationMapper;
import com.ruoyi.purchase.mapper.ProductRecordMapper;
import com.ruoyi.purchase.mapper.PurchaseLedgerMapper;
import com.ruoyi.purchase.mapper.TicketRegistrationMapper;
import com.ruoyi.purchase.pojo.PaymentRegistration;
import com.ruoyi.purchase.pojo.ProductRecord;
import com.ruoyi.purchase.pojo.PurchaseLedger;
import com.ruoyi.purchase.pojo.TicketRegistration;
@@ -97,6 +99,8 @@
    private final InvoiceRegistrationProductMapper invoiceRegistrationProductMapper;
    private final StringRedisTemplate redisTemplate;
    private final PaymentRegistrationMapper  paymentRegistrationMapper;
    @Value("${file.upload-dir}")
    private String uploadDir;
@@ -359,6 +363,10 @@
        LambdaQueryWrapper<ProductRecord> productRecordLambdaQueryWrapper = new LambdaQueryWrapper<>();
        productRecordLambdaQueryWrapper.in(ProductRecord::getPurchaseLedgerId,ids);
        productRecordMapper.delete(productRecordLambdaQueryWrapper);
        // 删除付款记录
        LambdaQueryWrapper<PaymentRegistration> paymentRegistrationLambdaQueryWrapper = new LambdaQueryWrapper<>();
        paymentRegistrationLambdaQueryWrapper.in(PaymentRegistration::getPurchaseLedgerId,ids);
        paymentRegistrationMapper.delete(paymentRegistrationLambdaQueryWrapper);
        // 批量删除采购台账
        return purchaseLedgerMapper.deleteBatchIds(Arrays.asList(ids));
    }
src/main/java/com/ruoyi/sales/pojo/BusinessOpportunity.java
@@ -72,6 +72,9 @@
    @TableField(exist = false)
    private String description;
    @ApiModelProperty(value = "改造内容")
    private String renContent;
    @ApiModelProperty(value = "合同金额")
    private BigDecimal contractAmount;
src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
@@ -83,6 +83,10 @@
    private final SalesLedgerSchedulingMapper salesLedgerSchedulingMapper;
    private final InvoiceRegistrationProductMapper invoiceRegistrationProductMapper;
    private final InvoiceRegistrationMapper invoiceRegistrationMapper;
    @Autowired
    private SysDeptMapper sysDeptMapper;
@@ -348,6 +352,13 @@
        if (CollectionUtils.isEmpty(idList)) {
            return 0;
        }
        // 判断是否有开票记录
        LambdaQueryWrapper<InvoiceRegistrationProduct> invoiceLedgerQuery = new LambdaQueryWrapper<>();
        invoiceLedgerQuery.in(InvoiceRegistrationProduct::getSalesLedgerId, idList);
        List<InvoiceRegistrationProduct> invoiceRegistrationProducts = invoiceRegistrationProductMapper.selectList(invoiceLedgerQuery);
        if (CollectionUtils.isNotEmpty(invoiceRegistrationProducts)) {
            throw new BaseException("有开票记录,不可删除");
        }
        // 生产订单有待排产数据,台账不可删除
        LambdaQueryWrapper<SalesLedgerScheduling> salesLedgerSchedulingLambdaQueryWrapper = new LambdaQueryWrapper<SalesLedgerScheduling>()
                .in(SalesLedgerScheduling::getSalesLedgerId, idList);
@@ -356,7 +367,8 @@
        }
        // 1. 先删除子表数据
        LambdaQueryWrapper<SalesLedgerProduct> productWrapper = new LambdaQueryWrapper<>();
        productWrapper.in(SalesLedgerProduct::getSalesLedgerId, idList);
        productWrapper.in(SalesLedgerProduct::getSalesLedgerId, idList)
                .eq(SalesLedgerProduct::getType,1);
        salesLedgerProductMapper.delete(productWrapper);
        // 删除生产订单数据
        LambdaQueryWrapper<SalesLedgerScheduling> in = new LambdaQueryWrapper<SalesLedgerScheduling>()
src/main/resources/application-prod.yml
@@ -143,16 +143,16 @@
  # redis 配置
  redis:
    # 地址
    host: 127.0.0.1
#    host: 127.0.0.1
#    host: localhost
#    host: 172.17.0.1
    host: 172.17.0.1
    # 端口,默认为6379
    port: 6379
    # 数据库索引
    database: 0
    database: 15
    # 密码
    password: root2022!
#    password:
#    password: root2022!
    password:
    # 连接超时时间
    timeout: 10s