liding
9 天以前 5cbfd0b2270edf6390cc1bb7c683956dbe93d66f
feat:耗材物料更改(字段变动)
已修改9个文件
53 ■■■■ 文件已修改
src/main/java/com/ruoyi/consumables/dto/ConsumablesInRecordDto.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/consumables/dto/ConsumablesOutRecordDto.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/consumables/pojo/ConsumablesInRecord.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/consumables/pojo/ConsumablesInventory.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/consumables/pojo/ConsumablesOutRecord.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/consumables/service/impl/ConsumablesInventoryServiceImpl.java 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/consumables/ConsumablesInRecordMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/consumables/ConsumablesInventoryMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/consumables/ConsumablesOutRecordMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/consumables/dto/ConsumablesInRecordDto.java
@@ -35,4 +35,7 @@
    //现净重
    private BigDecimal currentWeight;
    //数量
    private BigDecimal qualitity;
}
src/main/java/com/ruoyi/consumables/dto/ConsumablesOutRecordDto.java
@@ -5,6 +5,8 @@
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
@Data
@AllArgsConstructor
@NoArgsConstructor
@@ -25,4 +27,7 @@
    private String timeStr;
    private String createBy;
    //数量
    private BigDecimal qualitity;
}
src/main/java/com/ruoyi/consumables/pojo/ConsumablesInRecord.java
@@ -100,4 +100,7 @@
    @ApiModelProperty("产品id")
    private Long productId;
    @ApiModelProperty("采购员")
    private String purchaser;
}
src/main/java/com/ruoyi/consumables/pojo/ConsumablesInventory.java
@@ -66,4 +66,7 @@
    @ApiModelProperty("产品id")
    private Long productId;
    @ApiModelProperty("采购员")
    private String purchaser;
}
src/main/java/com/ruoyi/consumables/pojo/ConsumablesOutRecord.java
@@ -97,4 +97,7 @@
    @ApiModelProperty("磅单文件路径")
    private String weighbridgeDocPath;
    @ApiModelProperty("采购员")
    private String purchaser;
}
src/main/java/com/ruoyi/consumables/service/impl/ConsumablesInventoryServiceImpl.java
@@ -19,10 +19,8 @@
import com.ruoyi.framework.web.domain.R;
import com.ruoyi.sales.mapper.SalesLedgerProductMapper;
import com.ruoyi.sales.pojo.SalesLedgerProduct;
import com.ruoyi.stock.dto.StockInRecordDto;
import com.ruoyi.stock.word.WeighbridgeDocGenerator;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -64,21 +62,12 @@
        ConsumablesInRecordDto consumablesInRecordDto = new ConsumablesInRecordDto();
        consumablesInRecordDto.setRecordId(consumablesInventoryDto.getRecordId());
        consumablesInRecordDto.setRecordType(consumablesInventoryDto.getRecordType());
        consumablesInRecordDto.setStockInNum(consumablesInventoryDto.getNetWeight());
        consumablesInRecordDto.setStockInNum(consumablesInventoryDto.getQualitity());
        consumablesInRecordDto.setWeighingDate(consumablesInventoryDto.getWeighingDate());
        consumablesInRecordDto.setNetWeight(consumablesInventoryDto.getNetWeight());
        consumablesInRecordDto.setGrossWeight(consumablesInventoryDto.getGrossWeight());
        consumablesInRecordDto.setTareWeight(consumablesInventoryDto.getTareWeight());
        consumablesInRecordDto.setLicensePlateNo(consumablesInventoryDto.getLicensePlateNo());
        consumablesInRecordDto.setWeighingOperator(consumablesInventoryDto.getWeighingOperator());
        consumablesInRecordDto.setProductModelId(consumablesInventoryDto.getProductModelId());
        consumablesInRecordDto.setProductId(consumablesInventoryDto.getProductId());
        consumablesInRecordDto.setPurchaser(consumablesInventoryDto.getPurchaser());
        consumablesInRecordDto.setType("0");
        //生成磅单
        StockInRecordDto stockInRecordDto = new StockInRecordDto();
        BeanUtils.copyProperties(consumablesInventoryDto, stockInRecordDto);
        String absoluteDocPath = weighbridgeDocGenerator.generateWeighbridgeDoc(stockInRecordDto);
        consumablesInRecordDto.setWeighbridgeDocPath(absoluteDocPath);
        consumablesInRecordService.add(consumablesInRecordDto);
        //再进行新增库存数量库存
        //先查询库存表中的产品是否存在,不存在新增,存在更新
@@ -86,15 +75,16 @@
        if (ObjectUtils.isEmpty(oldConsumablesInventory)) {
            ConsumablesInventory newConsumablesInventory = new ConsumablesInventory();
            newConsumablesInventory.setProductModelId(consumablesInventoryDto.getProductModelId());
            newConsumablesInventory.setQualitity(consumablesInventoryDto.getNetWeight());
            newConsumablesInventory.setQualitity(consumablesInventoryDto.getQualitity());
            newConsumablesInventory.setVersion(1);
            newConsumablesInventory.setRemark(consumablesInventoryDto.getRemark());
            newConsumablesInventory.setLockedQuantity(consumablesInventoryDto.getLockedQuantity());
            newConsumablesInventory.setWarnNum(consumablesInventoryDto.getWarnNum());
            newConsumablesInventory.setProductId(consumablesInventoryDto.getProductId());
            newConsumablesInventory.setPurchaser(consumablesInventoryDto.getPurchaser());
            consumablesInventoryMapper.insert(newConsumablesInventory);
        } else {
            consumablesInventoryDto.setQualitity(consumablesInventoryDto.getNetWeight());
            consumablesInventoryDto.setQualitity(consumablesInventoryDto.getQualitity());
            consumablesInventoryMapper.updateAddConsumablesInventory(consumablesInventoryDto);
        }
        return true;
@@ -109,20 +99,13 @@
        consumablesOutRecordDto.setRecordId(consumablesInventoryDto.getRecordId());
        consumablesOutRecordDto.setRecordType(consumablesInventoryDto.getRecordType());
        consumablesOutRecordDto.setWeighingDate(consumablesInventoryDto.getWeighingDate());
        consumablesOutRecordDto.setStockOutNum(consumablesInventoryDto.getNetWeight());
        consumablesOutRecordDto.setNetWeight(consumablesInventoryDto.getNetWeight());
        consumablesOutRecordDto.setGrossWeight(consumablesInventoryDto.getGrossWeight());
        consumablesOutRecordDto.setTareWeight(consumablesInventoryDto.getTareWeight());
        consumablesOutRecordDto.setStockOutNum(consumablesInventoryDto.getQualitity());
        consumablesOutRecordDto.setWeighingOperator(consumablesInventoryDto.getWeighingOperator());
        consumablesOutRecordDto.setProductModelId(consumablesInventoryDto.getProductModelId());
        consumablesOutRecordDto.setLicensePlateNo(consumablesInventoryDto.getLicensePlateNo());
        consumablesOutRecordDto.setProductId(consumablesInventoryDto.getProductId());
        consumablesOutRecordDto.setPurchaser(consumablesInventoryDto.getPurchaser());
        consumablesOutRecordDto.setType("0");
        //生成磅单
        StockInRecordDto stockInRecordDto = new StockInRecordDto();
        BeanUtils.copyProperties(consumablesInventoryDto, stockInRecordDto);
        String absoluteDocPath = weighbridgeDocGenerator.generateWeighbridgeDoc(stockInRecordDto);
        consumablesOutRecordDto.setWeighbridgeDocPath(absoluteDocPath);
        consumablesOutRecordService.add(consumablesOutRecordDto);
        ConsumablesInventory oldConsumablesInventory = consumablesInventoryMapper.selectOne(new QueryWrapper<ConsumablesInventory>().lambda().eq(ConsumablesInventory::getProductModelId, consumablesInventoryDto.getProductModelId()));
        if (ObjectUtils.isEmpty(oldConsumablesInventory)) {
src/main/resources/mapper/consumables/ConsumablesInRecordMapper.xml
@@ -5,6 +5,7 @@
    <select id="listPage" resultType="com.ruoyi.consumables.dto.ConsumablesInRecordDto">
        SELECT
        sir.*,
        sir.stock_in_num as qualitity,
        p.product_name as product_name,
        pm.model,
        pm.unit,
src/main/resources/mapper/consumables/ConsumablesInventoryMapper.xml
@@ -43,7 +43,7 @@
        update consumables_inventory
        <set>
            <if test="ew.netWeight != null">
                qualitity = qualitity - #{ew.netWeight},
                qualitity = qualitity - #{ew.qualitity},
            </if>
            <if test="ew.version != null">
                version = version + 1,
@@ -62,6 +62,7 @@
        -- 当前净重 = 入库净重 - 出库净重
        (COALESCE(sir.total_net_weight,0) - COALESCE(sor.total_net_weight,0)) as net_weight,
        si.qualitity,
        si.purchaser,
        COALESCE(si.locked_quantity, 0) as locked_quantity,
        si.product_model_id,
        si.create_time,
src/main/resources/mapper/consumables/ConsumablesOutRecordMapper.xml
@@ -22,6 +22,7 @@
        SELECT
        sor.*,
        p.product_name as productName,
        sor.stock_out_num as qualitity,
        pm.model,
        pm.unit,
        sor.weighbridge_doc_path,