| | |
| | | tenant_id bigint not null default 0 comment 'ç§æ·ID', |
| | | is_white bigint not null default 0 comment 'æ¯å¦ç½åå' |
| | | ); |
| | | |
| | | alter table stock_inventory |
| | | add manufacturer_id bigint not null default 0 comment 'åå®¶id', |
| | | add source varchar(255) not null default '' comment 'æ¥æº'; |
| | | add source varchar(255) not null default '' comment 'æ¥æº', |
| | | add supplier_id bigint null comment 'ä¾åºåid'; |
| | | alter table stock_in_record |
| | | add manufacturer_id bigint not null default 0 comment 'åå®¶id', |
| | | add source varchar(255) not null default '' comment 'æ¥æº'; |
| | | add source varchar(255) not null default '' comment 'æ¥æº', |
| | | add supplier_id bigint null comment 'ä¾åºåid'; |
| | | alter table stock_uninventory |
| | | add manufacturer_id bigint not null default 0 comment 'åå®¶id', |
| | | add source varchar(255) not null default '' comment 'æ¥æº'; |
| | | |
| | | |
| | | alter table stock_uninventory |
| | | drop column manufacturer_id; |
| | | alter table stock_in_record |
| | | add supplier_id bigint null comment 'ä¾åºåid'; |
| | | alter table stock_inventory |
| | | add supplier_id bigint null comment 'ä¾åºåid'; |
| | | |
| | | alter table stock_in_record |
| | | add is_contains_water boolean default false comment 'æ¯å¦å«æ°´', |
| | | add water_content decimal(16, 4) default 0 comment '嫿°´é', |
| | |
| | | @Schema(description = "åæ ¼åºåæ¥æºææ¬") |
| | | private String qualifiedSourceText; |
| | | |
| | | @Schema(description = "åå®¶åç§°") |
| | | private String manufacturerName; |
| | | |
| | | @Schema(description = "ä¾åºååç§°") |
| | | private String supplierName; |
| | | |
| | | @Schema(description = "ä¸åæ ¼åºåæ¥æº") |
| | | private String unQualifiedSource; |
| | | |
| | |
| | | private String unit; |
| | | private Long productId; |
| | | private Long topParentProductId; |
| | | private String manufacturerName; |
| | | private BigDecimal pendingOutQuantity; |
| | | private String sourceText; |
| | | |
| | |
| | | @Excel(name = "è§æ ¼") |
| | | private String model; |
| | | |
| | | @Excel(name = "åå®¶") |
| | | private String manufacturerName; |
| | | |
| | | @Excel(name = "æ¥æº") |
| | | private String sourceText; |
| | | |
| | |
| | | @Schema(description = "æ¥æº") |
| | | private String source; |
| | | |
| | | @Schema(description = "ä¾åºåid") |
| | | private Long supplierId; |
| | | |
| | | @Schema(description = "æ¯å¦å«æ°´") |
| | | private Boolean isContainsWater; |
| | | |
| | |
| | | |
| | | @Schema(description = "æ¥æº") |
| | | private String source; |
| | | |
| | | @Schema(description = "ä¾åºåid") |
| | | private Long supplierId; |
| | | } |
| | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long deptId; |
| | | |
| | | @Schema(description = "åå®¶ID") |
| | | private Long manufacturerId; |
| | | |
| | | @Schema(description = "æ¥æº") |
| | | private String source; |
| | | } |
| | |
| | | setBatchNo(stockInRecord.getBatchNo()); |
| | | setRemark(stockInRecord.getRemark()); |
| | | setWarnNum(stockInRecord.getWarnNum()); |
| | | setManufacturerId(stockInRecord.getManufacturerId()); |
| | | setSource(stockInRecord.getSource()); |
| | | if (StockInventorySourceEnum.PURCHASE_RECEIPT.getCode().equals(stockInRecord.getSource())) { |
| | | setSupplierId(stockInRecord.getSupplierId()); |
| | | } else if (StockInventorySourceEnum.OUTSOURCED_RECEIPT.getCode().equals(stockInRecord.getSource())) { |
| | | setManufacturerId(stockInRecord.getManufacturerId()); |
| | | } |
| | | setVersion(1); |
| | | }}); |
| | | } else { |
| | |
| | | stockUninventoryDto.setBatchNo(stockInRecord.getBatchNo()); |
| | | stockUninventoryDto.setQualitity(finalStockInNum); |
| | | stockUninventoryDto.setRemark(stockInRecord.getRemark()); |
| | | stockUninventoryDto.setManufacturerId(stockInRecord.getManufacturerId()); |
| | | stockUninventoryDto.setSource(stockInRecord.getSource()); |
| | | stockUninventoryDto.setType(uninventoryType); |
| | | if (stockUninventory == null) { |
| | |
| | | setBatchNo(stockInRecord.getBatchNo()); |
| | | setType(uninventoryType); |
| | | setRemark(stockInRecord.getRemark()); |
| | | setManufacturerId(stockInRecord.getManufacturerId()); |
| | | setSource(stockInRecord.getSource()); |
| | | setVersion(1); |
| | | }}); |
| | |
| | | stockInventoryDto.setBatchNo(stockInRecord.getBatchNo()); |
| | | stockInventoryDto.setQualitity(stockInRecord.getStockInNum()); |
| | | stockInventoryDto.setRemark(stockInRecord.getRemark()); |
| | | stockInventoryDto.setManufacturerId(stockInRecord.getManufacturerId()); |
| | | stockInventoryDto.setSource(stockInRecord.getSource()); |
| | | if (StockInventorySourceEnum.PURCHASE_RECEIPT.getCode().equals(stockInRecord.getSource())) { |
| | | stockInventoryDto.setSupplierId(stockInRecord.getSupplierId()); |
| | | } else if (StockInventorySourceEnum.OUTSOURCED_RECEIPT.getCode().equals(stockInRecord.getSource())) { |
| | | stockInventoryDto.setManufacturerId(stockInRecord.getManufacturerId()); |
| | | } |
| | | return stockInventoryDto; |
| | | } |
| | | |
| | |
| | | eq.eq(StockInventory::getBatchNo, stockInventoryDto.getBatchNo()); |
| | | //æ°å¢å
¥åºè®°å½åæ·»å åºå |
| | | StockInRecordDto stockInRecordDto = new StockInRecordDto(); |
| | | stockInRecordDto.setRecordId(stockInventoryDto.getRecordId()); |
| | | stockInRecordDto.setRecordType(stockInventoryDto.getRecordType()); |
| | | stockInRecordDto.setStockInNum(stockInventoryDto.getQualitity()); |
| | | stockInRecordDto.setBatchNo(stockInventoryDto.getBatchNo()); |
| | | stockInRecordDto.setProductModelId(stockInventoryDto.getProductModelId()); |
| | | stockInRecordDto.setType("0"); |
| | | populateStockInRecord(stockInventoryDto, stockInRecordDto); |
| | | stockInRecordService.add(stockInRecordDto); |
| | | //åè¿è¡æ°å¢åºåæ°éåºå |
| | | //å
æ¥è¯¢åºå表ä¸çäº§åæ¯å¦åå¨ï¼ä¸å卿°å¢ï¼å卿´æ° |
| | |
| | | newStockInventory.setBatchNo(stockInventoryDto.getBatchNo()); |
| | | newStockInventory.setLockedQuantity(stockInventoryDto.getLockedQuantity()); |
| | | newStockInventory.setWarnNum(stockInventoryDto.getWarnNum()); |
| | | applySourceBindingFields(newStockInventory, stockInventoryDto); |
| | | stockInventoryMapper.insert(newStockInventory); |
| | | } else { |
| | | applySourceBindingFields(stockInventoryDto, stockInventoryDto); |
| | | stockInventoryMapper.updateAddStockInventory(stockInventoryDto); |
| | | } |
| | | return true; |
| | |
| | | stockInventoryDto.setBatchNo(batchNo); |
| | | |
| | | StockInRecordDto stockInRecordDto = new StockInRecordDto(); |
| | | populateStockInRecord(stockInventoryDto, stockInRecordDto); |
| | | stockInRecordService.add(stockInRecordDto); |
| | | return true; |
| | | } |
| | | |
| | | private void applySourceBindingFields(StockInventory target, StockInventoryDto source) { |
| | | if (target == null || source == null) { |
| | | return; |
| | | } |
| | | target.setSource(source.getSource()); |
| | | if (StockInventorySourceEnum.PURCHASE_RECEIPT.getCode().equals(source.getSource())) { |
| | | target.setSupplierId(source.getSupplierId()); |
| | | target.setManufacturerId(null); |
| | | return; |
| | | } |
| | | if (StockInventorySourceEnum.OUTSOURCED_RECEIPT.getCode().equals(source.getSource())) { |
| | | target.setManufacturerId(source.getManufacturerId()); |
| | | target.setSupplierId(null); |
| | | return; |
| | | } |
| | | target.setManufacturerId(null); |
| | | target.setSupplierId(null); |
| | | } |
| | | |
| | | private void populateStockInRecord(StockInventoryDto stockInventoryDto, StockInRecordDto stockInRecordDto) { |
| | | stockInRecordDto.setRecordId(stockInventoryDto.getRecordId()); |
| | | stockInRecordDto.setRecordType(stockInventoryDto.getRecordType()); |
| | | stockInRecordDto.setStockInNum(stockInventoryDto.getQualitity()); |
| | | stockInRecordDto.setBatchNo(batchNo); |
| | | stockInRecordDto.setBatchNo(stockInventoryDto.getBatchNo()); |
| | | stockInRecordDto.setProductModelId(stockInventoryDto.getProductModelId()); |
| | | stockInRecordDto.setType("0"); |
| | | stockInRecordDto.setRemark(stockInventoryDto.getRemark()); |
| | | stockInRecordDto.setWarnNum(stockInventoryDto.getWarnNum()); |
| | | stockInRecordDto.setManufacturerId(stockInventoryDto.getManufacturerId()); |
| | | stockInRecordDto.setSource(stockInventoryDto.getSource()); |
| | | if (StockInventorySourceEnum.PURCHASE_RECEIPT.getCode().equals(stockInventoryDto.getSource())) { |
| | | stockInRecordDto.setSupplierId(stockInventoryDto.getSupplierId()); |
| | | } else if (StockInventorySourceEnum.OUTSOURCED_RECEIPT.getCode().equals(stockInventoryDto.getSource())) { |
| | | stockInRecordDto.setManufacturerId(stockInventoryDto.getManufacturerId()); |
| | | } |
| | | // è®¾ç½®å«æ°´éç¸å
³ä¿¡æ¯ |
| | | stockInRecordDto.setIsContainsWater(stockInventoryDto.getIsContainsWater()); |
| | | stockInRecordDto.setWaterContent(stockInventoryDto.getWaterContent()); |
| | | stockInRecordDto.setTheoryStockInNum(stockInventoryDto.getTheoryStockInNum()); |
| | | stockInRecordDto.setDifferenceNum(stockInventoryDto.getDifferenceNum()); |
| | | stockInRecordService.add(stockInRecordDto); |
| | | return true; |
| | | } |
| | | |
| | | //è§åçæï¼20260424-产åç¼å·-001 |
| | |
| | | } else { |
| | | stockInRecordDto.setType("2"); |
| | | } |
| | | stockInRecordDto.setManufacturerId(stockUninventoryDto.getManufacturerId()); |
| | | stockInRecordDto.setSource(stockUninventoryDto.getSource()); |
| | | stockInRecordService.add(stockInRecordDto); |
| | | //审æ¹åæ·»å |
| | |
| | | <result column="version" property="version"/> |
| | | <result column="locked_quantity" property="lockedQuantity"/> |
| | | <result column="warn_num" property="warnNum"/> |
| | | <result column="manufacturer_id" property="manufacturerId"/> |
| | | <result column="source" property="source"/> |
| | | <result column="supplier_id" property="supplierId"/> |
| | | </resultMap> |
| | | <update id="updateAddStockInventory"> |
| | | update stock_inventory |
| | |
| | | </if> |
| | | <if test="ew.source != null and ew.source != ''"> |
| | | source = #{ew.source}, |
| | | </if> |
| | | <if test="ew.manufacturerId != null"> |
| | | manufacturer_id = #{ew.manufacturerId}, |
| | | </if> |
| | | <if test="ew.supplierId != null"> |
| | | supplier_id = #{ew.supplierId}, |
| | | </if> |
| | | update_time = now() |
| | | </set> |
| | |
| | | si.update_time, |
| | | COALESCE(si.warn_num, 0) as warn_num, |
| | | si.version, |
| | | si.source, |
| | | si.manufacturer_id, |
| | | si.supplier_id, |
| | | (si.qualitity - COALESCE(si.locked_quantity, 0)) as un_locked_quantity, |
| | | pm.model, |
| | | si.remark, |
| | |
| | | MAX(update_time) as update_time, |
| | | MAX(warn_num) as warn_num, |
| | | MAX(version) as version, |
| | | MAX(supplier_id) as supplier_id, |
| | | model, |
| | | MAX(remark) as remark, |
| | | unit, |
| | |
| | | si.update_time, |
| | | COALESCE(si.warn_num, 0) as warn_num, |
| | | si.version, |
| | | si.supplier_id, |
| | | (si.qualitity - COALESCE(si.locked_quantity, 0)) as un_locked_quantity, |
| | | pm.model, |
| | | si.remark, |
| | |
| | | su.update_time, |
| | | 0 as warn_num, |
| | | su.version, |
| | | null as supplier_id, |
| | | (su.qualitity - COALESCE(su.locked_quantity, 0)) as un_locked_quantity, |
| | | pm.model, |
| | | su.remark, |
| | |
| | | product_name, |
| | | product_id, |
| | | MAX(manufacturer_id) as manufacturer_id, |
| | | MAX(supplier_id) as supplier_id, |
| | | MAX(manufacturer_name) as manufacturerName, |
| | | MAX(supplier_name) as supplierName, |
| | | MAX(qualifiedSource) as qualifiedSource, |
| | | MAX(unQualifiedSource) as unQualifiedSource, |
| | | |
| | |
| | | p.product_name, |
| | | p.id as product_id, |
| | | si.manufacturer_id, |
| | | si.supplier_id, |
| | | m.name as manufacturer_name, |
| | | sm.supplier_name as supplier_name, |
| | | si.source as qualifiedSource, |
| | | null as unQualifiedSource, |
| | | |
| | |
| | | left join product_model pm on si.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | left join manufacturer m on si.manufacturer_id = m.id |
| | | left join supplier_manage sm on si.supplier_id = sm.id |
| | | |
| | | union all |
| | | |
| | |
| | | pm.unit, |
| | | p.product_name, |
| | | p.id as product_id, |
| | | su.manufacturer_id, |
| | | m.name as manufacturer_name, |
| | | null as manufacturer_id, |
| | | null as supplier_id, |
| | | null as manufacturer_name, |
| | | null as supplier_name, |
| | | null as qualifiedSource, |
| | | su.source as unQualifiedSource, |
| | | |
| | |
| | | from stock_uninventory su |
| | | left join product_model pm on su.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | left join manufacturer m on su.manufacturer_id = m.id |
| | | ) as combined |
| | | <where> |
| | | <if test="ew.productModelId != null and ew.productModelId > 0"> |
| | |
| | | product_name, |
| | | product_id, |
| | | manufacturer_id, |
| | | manufacturer_name |
| | | supplier_id, |
| | | manufacturer_name, |
| | | supplier_name |
| | | order by |
| | | batch_no |
| | | </select> |
| | |
| | | from stock_uninventory su |
| | | left join product_model pm on su.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | left join manufacturer m on su.manufacturer_id = m.id |
| | | </sql> |
| | | |
| | | <sql id="WastePageColumns"> |
| | |
| | | pm.model, |
| | | pm.unit, |
| | | p.product_name, |
| | | m.name as manufacturer_name, |
| | | su.source |
| | | </sql> |
| | | |
| | |
| | | pm.model, |
| | | pm.unit, |
| | | p.product_name, |
| | | m.name as manufacturer_name, |
| | | su.source |
| | | <include refid="BaseWasteFromClause" /> |
| | | <where> |
| | |
| | | su.*, |
| | | pm.model, |
| | | pm.unit, |
| | | p.product_name, |
| | | m.name as manufacturer_name |
| | | p.product_name |
| | | <include refid="BaseWasteFromClause" /> |
| | | <where> |
| | | <if test="ew.type != null and ew.type != ''"> |
| | |
| | | pm.model, |
| | | pm.unit, |
| | | p.product_name, |
| | | m.name as manufacturer_name, |
| | | su.source, |
| | | su.type, |
| | | GROUP_CONCAT(DISTINCT su.batch_no ORDER BY su.batch_no SEPARATOR ',') as batch_no, |
| | |
| | | su.id, |
| | | p.product_name, |
| | | pm.model, |
| | | m.name as manufacturer_name, |
| | | su.source, |
| | | pm.unit, |
| | | su.batch_no, |
| | |
| | | from stock_uninventory su |
| | | left join product_model pm on su.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | left join manufacturer m on su.manufacturer_id = m.id |
| | | <where> |
| | | and su.type = 'waste' |
| | | <if test="ew.productModelId != null and ew.productModelId > 0"> |