| | |
| | | MEASURING(5), //计量器具台账 |
| | | MEASURINGRecord(6),//计量器具台账记录 |
| | | ApproveNode(7), //协同审批节点审核 |
| | | ApproveProcess(8); //协同审批主数据 |
| | | ApproveProcess(8), |
| | | Inventory(9); //协同审批主数据 |
| | | |
| | | private final int value; |
| | | |
| | |
| | | private String originalName; // 原始文件名 |
| | | private String tempPath; // 临时存储路径 |
| | | private LocalDateTime expireTime; // 过期时间 |
| | | private Integer type; // 关联表类型 |
| | | private Integer type; // 关联表类型 9-库存 |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | @Scheduled(cron = "0 0 3 * * ?") // 每天凌晨3点执行 |
| | | // @Scheduled(cron = "0 0 3 * * ?") // 每天凌晨3点执行 |
| | | public void cleanupExpiredTempFiles() { |
| | | LambdaQueryWrapper<TempFile> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.lt(TempFile::getExpireTime, LocalDateTime.now()); // expireTime < 当前时间 |
| | |
| | | @Excel(name = "待出库数量") |
| | | @TableField(exist = false) |
| | | private BigDecimal inboundNum0; |
| | | |
| | | /** |
| | | * 图片 |
| | | */ |
| | | private String url; |
| | | /** |
| | | * 出库数量 |
| | | */ |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.other.mapper.TempFileMapper; |
| | | import com.ruoyi.other.pojo.TempFile; |
| | | import com.ruoyi.sales.mapper.CommonFileMapper; |
| | |
| | | Files.copy(Paths.get(tempFile.getTempPath()), formalFilePath, StandardCopyOption.REPLACE_EXISTING); |
| | | Files.deleteIfExists(Paths.get(tempFile.getTempPath())); |
| | | log.info("文件迁移成功: {} -> {}", tempFile.getTempPath(), formalFilePath); |
| | | |
| | | // 更新文件记录(关联到业务ID) |
| | | CommonFile fileRecord = new CommonFile(); |
| | | fileRecord.setCommonId(businessId); |
| | |
| | | t2.tax_inclusive_unit_price, |
| | | (t1.inbound_num * t2.tax_inclusive_unit_price) as taxInclusiveTotalPrice, |
| | | (t1.inbound_num * t2.tax_inclusive_unit_price - t1.inbound_num * t2.tax_inclusive_unit_price * t2.tax_rate / 100) as taxExclusiveTotalPrice, |
| | | t1.unit_price, |
| | | t1.total_price, |
| | | t1.inbound_batches, |
| | | t1.inbound_num, |
| | | t1.inbound_num as inboundNum0, |
| | |
| | | t1.create_by, |
| | | t2.warn_num |
| | | from procurement_record_storage t1 |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 2 |
| | | left join purchase_ledger t3 on t3.id = t2.sales_ledger_id |
| | | <where> |
| | | 1 = 1 |
| | | t1.type = 1 |
| | | <if test="req.supplierName != null and req.supplierName != ''"> |
| | | and t3.supplier_name like concat('%',#{req.supplierName},'%') |
| | | </if> |
| | | <if test="req.productCategory != null and req.productCategory != ''"> |
| | | and t2.product_category like concat('%',#{req.productCategory},'%') |
| | | </if> |
| | | <if test="req.timeStr != null and req.timeStr != ''"> |
| | | and t1.create_time like concat('%',#{req.timeStr},'%') |
| | | </if> |
| | | </where> |
| | | order by t1.create_time desc |
| | | </select> |
| | | <select id="list" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDto"> |
| | | select |
| | |
| | | from procurement_record_storage t1 |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id |
| | | left join purchase_ledger t3 on t3.id = t2.sales_ledger_id |
| | | where t1.type = 1 |
| | | </select> |
| | | <select id="listOne" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDto"> |
| | | select |
| | | t3.customer_contract_no, |
| | | t3.sales_contract_no, |
| | | t3.customer_name, |
| | | t2.product_category, |
| | | t1.id, |
| | | t2.specification_model, |
| | | t2.unit, |
| | | t2.quantity, |
| | | t2.quantity as quantity0, |
| | | t2.tax_rate, |
| | | t2.tax_inclusive_unit_price, |
| | | t2.tax_inclusive_total_price, |
| | | t2.tax_exclusive_total_price, |
| | | t1.inbound_batches, |
| | | t1.inbound_num, |
| | | t1.create_time, |
| | | t1.create_time as time, |
| | | t1.create_by |
| | | from procurement_record_storage t1 |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id |
| | | left join sales_ledger t3 on t3.id = t2.sales_ledger_id |
| | | where t1.type = 2 |
| | | </select> |
| | | <select id="listPageCopy" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDtoCopy"> |
| | | select |
| | |
| | | t2.tax_inclusive_total_price, |
| | | t2.tax_exclusive_total_price, |
| | | t1.inbound_batches, |
| | | t1.unit_price as unitPrice, |
| | | sum(t1.total_price) as totalPrice, |
| | | sum(t1.inbound_num) as inboundNum, |
| | | sum(t1.inbound_num) as inboundNum0, |
| | | t1.inbound_num as totalInboundNum, |
| | | t1.create_time, |
| | | t1.update_time, |
| | | t1.create_by, |
| | | t2.warn_num |
| | | from procurement_record_storage t1 |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 2 |
| | | left join purchase_ledger t3 on t3.id = t2.sales_ledger_id |
| | | <where> |
| | | 1 = 1 |
| | | t1.type = 1 |
| | | <if test="req.supplierName != null and req.supplierName != ''"> |
| | | and t3.supplier_name like concat('%',#{req.supplierName},'%') |
| | | </if> |
| | | <if test="req.productCategory != null and req.productCategory != ''"> |
| | | and t2.product_category like concat('%',#{req.productCategory},'%') |
| | | </if> |
| | | <if test="req.timeStr != null and req.timeStr != ''"> |
| | | and t1.create_time like concat('%',#{req.timeStr},'%') |
| | |
| | | and t1.create_time <= #{req.endDate} |
| | | </if> |
| | | </where> |
| | | group by t3.supplier_name,t2.product_category,t2.specification_model |
| | | group by t2.product_category,t2.specification_model,t1.unit_price |
| | | order by t1.create_time desc |
| | | </select> |
| | | <select id="listCopy" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDtoCopy"> |
| | | select |
| | |
| | | t1.update_time as uTime, |
| | | t1.create_by |
| | | from procurement_record_storage t1 |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 2 |
| | | left join purchase_ledger t3 on t3.id = t2.sales_ledger_id |
| | | where t1.type = 1 |
| | | group by t3.supplier_name,t2.product_category,t2.specification_model |
| | | </select> |
| | | <select id="listCopyOne" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDtoCopy"> |
| | | select |
| | | t3.customer_contract_no, |
| | | t3.sales_contract_no, |
| | | t3.customer_name, |
| | | t2.product_category, |
| | | t1.id, |
| | | t1.sales_ledger_product_id, |
| | | t1.create_user, |
| | | t2.specification_model, |
| | | t2.unit, |
| | | t2.tax_rate, |
| | | t2.tax_inclusive_unit_price, |
| | | t2.tax_inclusive_total_price, |
| | | t2.tax_exclusive_total_price, |
| | | t1.inbound_batches, |
| | | t1.inbound_num, |
| | | t1.inbound_num as inboundNum0, |
| | | t1.create_time, |
| | | t1.update_time, |
| | | t1.create_time as cTime, |
| | | t1.update_time as uTime, |
| | | t1.create_by |
| | | from procurement_record_storage t1 |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 1 |
| | | left join sales_ledger t3 on t3.id = t2.sales_ledger_id |
| | | where t1.type = 2 |
| | | group by t3.customer_name,t2.product_category,t2.specification_model |
| | | </select> |
| | | <select id="listPageByProduction" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDto"> |
| | | select |
| | | t3.customer_contract_no, |
| | | t3.sales_contract_no, |
| | | t3.customer_name, |
| | | t2.product_category, |
| | | t1.id, |
| | | t1.sales_ledger_product_id, |
| | | t1.create_user, |
| | | t2.specification_model, |
| | | t2.unit, |
| | | t2.tax_rate, |
| | | t2.tax_inclusive_unit_price, |
| | | (t1.inbound_num * t2.tax_inclusive_unit_price) as taxInclusiveTotalPrice, |
| | | (t1.inbound_num * t2.tax_inclusive_unit_price - t1.inbound_num * t2.tax_inclusive_unit_price * t2.tax_rate / 100) as taxExclusiveTotalPrice, |
| | | t1.unit_price, |
| | | t1.total_price, |
| | | t1.inbound_batches, |
| | | t1.inbound_num, |
| | | t1.inbound_num as inboundNum0, |
| | | t1.create_time, |
| | | t1.update_time, |
| | | t1.create_by, |
| | | t2.warn_num |
| | | from procurement_record_storage t1 |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 1 |
| | | left join sales_ledger t3 on t3.id = t2.sales_ledger_id |
| | | <where> |
| | | t1.type = 2 |
| | | <if test="req.customerName != null and req.customerName != ''"> |
| | | and t3.customer_name like concat('%',#{req.customerName},'%') |
| | | </if> |
| | | <if test="req.productCategory != null and req.productCategory != ''"> |
| | | and t2.product_category like concat('%',#{req.productCategory},'%') |
| | | </if> |
| | | <if test="req.timeStr != null and req.timeStr != ''"> |
| | | and t1.create_time like concat('%',#{req.timeStr},'%') |
| | | </if> |
| | | </where> |
| | | order by t1.create_time desc |
| | | </select> |
| | | <select id="listPageCopyByProduction" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDtoCopy"> |
| | | select |
| | | t3.customer_contract_no, |
| | | t3.sales_contract_no, |
| | | t3.customer_name, |
| | | t2.product_category, |
| | | t1.id, |
| | | t1.sales_ledger_product_id, |
| | | t1.create_user, |
| | | t2.specification_model, |
| | | t2.unit, |
| | | t2.min_stock, |
| | | t2.tax_rate, |
| | | t2.tax_inclusive_unit_price, |
| | | t2.tax_inclusive_total_price, |
| | | t2.tax_exclusive_total_price, |
| | | t1.inbound_batches, |
| | | sum(t1.total_price) as totalPrice, |
| | | t1.unit_price, |
| | | sum(t1.inbound_num) as inboundNum, |
| | | sum(t1.inbound_num) as inboundNum0, |
| | | t1.create_time, |
| | | t1.update_time, |
| | | t1.create_by, |
| | | t2.warn_num |
| | | from procurement_record_storage t1 |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 1 |
| | | left join sales_ledger t3 on t3.id = t2.sales_ledger_id |
| | | <where> |
| | | t1.type = 2 |
| | | <if test="req.customerName != null and req.customerName != ''"> |
| | | and t3.customer_name like concat('%',#{req.customerName},'%') |
| | | </if> |
| | | <if test="req.productCategory != null and req.productCategory != ''"> |
| | | and t2.product_category like concat('%',#{req.productCategory},'%') |
| | | </if> |
| | | <if test="req.timeStr != null and req.timeStr != ''"> |
| | | and t1.create_time like concat('%',#{req.timeStr},'%') |
| | | </if> |
| | | <if test="req.reportDate != null"> |
| | | and t1.create_time >= #{req.reportDate} and t1.create_time < DATE_ADD(#{req.reportDate}, INTERVAL 1 DAY) |
| | | </if> |
| | | <if test="req.startMonth != null"> |
| | | and t1.create_time >= #{req.startMonth} |
| | | </if> |
| | | <if test="req.endMonth != null"> |
| | | and t1.create_time <= #{req.endMonth} |
| | | </if> |
| | | <if test="req.startDate != null"> |
| | | and t1.create_time >= #{req.startDate} |
| | | </if> |
| | | <if test="req.endDate != null"> |
| | | and t1.create_time <= #{req.endDate} |
| | | </if> |
| | | </where> |
| | | group by t2.product_category,t2.specification_model,t1.unit_price |
| | | order by t1.create_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | t1.inbound_num, |
| | | t1.create_time, |
| | | t1.create_by, |
| | | t2.warn_num |
| | | t2.warn_num, |
| | | t4.unit_price, |
| | | t4.unit_price * t1.inbound_num as totalPrice |
| | | from procurement_record_out t1 |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 2 |
| | | left join purchase_ledger t3 on t3.id = t2.sales_ledger_id |
| | | left join procurement_record_storage t4 on t4.id = t1.procurement_record_storage_id |
| | | <where> |
| | | 1 = 1 |
| | | and t1.type = 1 |
| | | <if test="req.supplierName != null and req.supplierName != ''"> |
| | | and t3.supplier_name like concat('%',#{req.supplierName},'%') |
| | | </if> |
| | | <if test="req.productCategory != null and req.productCategory != ''"> |
| | | and t2.product_category like concat('%',#{req.productCategory},'%') |
| | | </if> |
| | | <if test="req.timeStr != null and req.timeStr != ''"> |
| | | and t1.create_time like concat('%',#{req.timeStr},'%') |
| | | </if> |
| | | </where> |
| | | order by t1.create_time desc |
| | | </select> |
| | | <select id="list" resultType="com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto"> |
| | | select |
| | |
| | | from procurement_record_out t1 |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id |
| | | left join purchase_ledger t3 on t3.id = t2.sales_ledger_id |
| | | where t1.type = 1 |
| | | </select> |
| | | |
| | | <select id="listOne" resultType="com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto"> |
| | | select |
| | | t3.customer_contract_no, |
| | | t3.sales_contract_no, |
| | | t3.customer_name, |
| | | t2.product_category, |
| | | t1.id, |
| | | t2.specification_model, |
| | | t2.unit, |
| | | t2.tax_rate, |
| | | t2.tax_inclusive_unit_price, |
| | | t2.tax_inclusive_total_price, |
| | | t2.tax_exclusive_total_price, |
| | | t1.inbound_num, |
| | | t1.create_time, |
| | | t1.create_time as time, |
| | | t1.create_by |
| | | from procurement_record_out t1 |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id |
| | | left join sales_ledger t3 on t3.id = t2.sales_ledger_id |
| | | where t1.type = 2 |
| | | </select> |
| | | |
| | | <select id="listTwo" resultType="com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto"> |
| | | select |
| | | t1.supplier_name, |
| | | t1.product_category, |
| | | t1.id, |
| | | t1.specification_model, |
| | | t1.unit, |
| | | t1.tax_rate, |
| | | t1.tax_inclusive_unit_price, |
| | | t1.tax_inclusive_total_price, |
| | | t1.tax_exclusive_total_price, |
| | | t1.inbound_num, |
| | | t1.create_time, |
| | | t1.create_time as time, |
| | | t1.create_by |
| | | from procurement_record_out t1 |
| | | where t1.type = 3 |
| | | </select> |
| | | <select id="listPageByProduct" resultType="com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto"> |
| | | select |
| | | t3.customer_contract_no, |
| | | t3.sales_contract_no, |
| | | t3.customer_name, |
| | | t2.product_category, |
| | | t1.id, |
| | | t1.code, |
| | | t2.specification_model, |
| | | t2.unit, |
| | | t2.tax_rate, |
| | | t2.tax_inclusive_unit_price, |
| | | t2.tax_inclusive_total_price, |
| | | t2.tax_exclusive_total_price, |
| | | t1.inbound_num, |
| | | t1.create_time, |
| | | t1.create_by, |
| | | t4.unit_price, |
| | | t4.unit_price * t1.inbound_num as totalPrice |
| | | from procurement_record_out t1 |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 1 |
| | | left join sales_ledger t3 on t3.id = t2.sales_ledger_id |
| | | left join procurement_record_storage t4 on t4.id = t1.procurement_record_storage_id |
| | | <where> |
| | | and t1.type = 2 |
| | | <if test="req.customerName != null and req.customerName != ''"> |
| | | and t3.customer_name like concat('%',#{req.customerName},'%') |
| | | </if> |
| | | <if test="req.productCategory != null and req.productCategory != ''"> |
| | | and t2.product_category like concat('%',#{req.productCategory},'%') |
| | | </if> |
| | | <if test="req.timeStr != null and req.timeStr != ''"> |
| | | and t1.create_time like concat('%',#{req.timeStr},'%') |
| | | </if> |
| | | </where> |
| | | order by t1.create_time desc |
| | | </select> |
| | | <select id="listPageByCustom" resultType="com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto"> |
| | | select |
| | | t2.supplier_name, |
| | | t2.product_category, |
| | | t1.id, |
| | | t1.code, |
| | | t2.specification_model, |
| | | t2.unit, |
| | | t2.tax_rate, |
| | | t2.tax_inclusive_unit_price, |
| | | t2.tax_inclusive_unit_price * t1.inbound_num as totalPrice, |
| | | t2.tax_exclusive_total_price, |
| | | t1.inbound_num, |
| | | t1.create_time, |
| | | t1.create_by, |
| | | t2.item_type |
| | | from procurement_record_out t1 |
| | | left join custom_storage t2 on t2.id = t1.procurement_record_storage_id |
| | | <where> |
| | | t1.type = 3 |
| | | <if test="req.supplierName != null and req.supplierName != ''"> |
| | | and t2.supplier_name like concat('%',#{req.supplierName},'%') |
| | | </if> |
| | | <if test="req.productCategory != null and req.productCategory != ''"> |
| | | and t2.product_category like concat('%',#{req.productCategory},'%') |
| | | </if> |
| | | <if test="req.timeStr != null and req.timeStr != ''"> |
| | | and t1.create_time like concat('%',#{req.timeStr},'%') |
| | | </if> |
| | | </where> |
| | | order by t1.create_time desc |
| | | </select> |
| | | </mapper> |