| ¶Ô±ÈÐÂÎļþ |
| | |
| | | -- æ·»å è¿ç£
æ¥æåæ®µ |
| | | ALTER TABLE stock_in_record |
| | | ADD COLUMN weighing_date timestamp COMMENT 'è¿ç£
æ¥æ'; |
| | | |
| | | -- æ·»å è¿ç£
æ¥æåæ®µ |
| | | ALTER TABLE stock_out_record |
| | | ADD COLUMN weighing_date timestamp COMMENT 'è¿ç£
æ¥æ'; |
| | | |
| | | -- æ·»å åéåæ®µ |
| | | ALTER TABLE stock_inventory |
| | | ADD COLUMN net_weight DECIMAL(16,3) COMMENT 'åé'; |
| | |
| | | |
| | | @TableField(exist = false) |
| | | private LocalDateTime createTime; |
| | | |
| | | @TableField(exist = false) |
| | | private Long parentId; |
| | | |
| | | @TableField(exist = false) |
| | | private String parentName; |
| | | |
| | | private Long productType; |
| | | } |
| | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.stock.pojo.StockInventory; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class StockInventoryDto extends StockInventory { |
| | |
| | | private BigDecimal currentStock; |
| | | |
| | | private BigDecimal unLockedQuantity; |
| | | |
| | | private Long parentId; |
| | | |
| | | @ApiModelProperty("è¿ç£
æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime weighingDate; |
| | | |
| | | private String parentName; |
| | | } |
| | |
| | | @ApiModelProperty(value = "ä¿®æ¹ç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty("è¿ç£
æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime weighingDate; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("夿³¨") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("åé") |
| | | private BigDecimal netWeight; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "ç±»å 0åæ ¼å
¥åº 1ä¸åæ ¼å
¥åº") |
| | | private String type; |
| | | |
| | | @ApiModelProperty("è¿ç£
æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime weighingDate; |
| | | } |
| | |
| | | stockInRecordDto.setRecordId(stockInventoryDto.getRecordId()); |
| | | stockInRecordDto.setRecordType(stockInventoryDto.getRecordType()); |
| | | stockInRecordDto.setStockInNum(stockInventoryDto.getQualitity()); |
| | | stockInRecordDto.setWeighingDate(stockInventoryDto.getWeighingDate()); |
| | | stockInRecordDto.setProductModelId(stockInventoryDto.getProductModelId()); |
| | | stockInRecordDto.setType("0"); |
| | | stockInRecordService.add(stockInRecordDto); |
| | |
| | | StockInventory newStockInventory = new StockInventory(); |
| | | newStockInventory.setProductModelId(stockInventoryDto.getProductModelId()); |
| | | newStockInventory.setQualitity(stockInventoryDto.getQualitity()); |
| | | newStockInventory.setNetWeight(stockInventoryDto.getNetWeight()); |
| | | newStockInventory.setVersion(1); |
| | | newStockInventory.setRemark(stockInventoryDto.getRemark()); |
| | | newStockInventory.setLockedQuantity(stockInventoryDto.getLockedQuantity()); |
| | |
| | | StockOutRecordDto stockOutRecordDto = new StockOutRecordDto(); |
| | | stockOutRecordDto.setRecordId(stockInventoryDto.getRecordId()); |
| | | stockOutRecordDto.setRecordType(stockInventoryDto.getRecordType()); |
| | | stockInventoryDto.setWeighingDate(stockInventoryDto.getWeighingDate()); |
| | | stockOutRecordDto.setStockOutNum(stockInventoryDto.getQualitity()); |
| | | stockOutRecordDto.setProductModelId(stockInventoryDto.getProductModelId()); |
| | | stockOutRecordDto.setType("0"); |
| | |
| | | <result column="product_id" property="productId" /> |
| | | </resultMap> |
| | | <select id="listPageProductModel" resultType="com.ruoyi.basic.pojo.ProductModel"> |
| | | select pm.*,p.product_name |
| | | select pm.*,p.product_name,p.parent_id,p1.product_name as parent_name, |
| | | case |
| | | when p1.product_name is null then 0 -- åææ |
| | | when p1.product_name is not null and p1.product_name like '%åæå%' then 1 -- åæå |
| | | when p1.product_name is not null and p1.product_name like '%æå%' then 2 -- æå |
| | | else 0 -- é»è®¤ä¸ºåææ |
| | | end as product_type |
| | | from product_model pm |
| | | left join product p on pm.product_id = p.id |
| | | left join product p1 on p1.id = p.parent_id |
| | | <where> |
| | | <if test="c.model != null and c.model != ''"> |
| | | and pm.model like concat('%',#{c.model},'%') |
| | | and pm.model like concat('%',#{c.model},'%') |
| | | </if> |
| | | <if test="c.productName != null and c.productName != ''"> |
| | | and p.product_name like concat('%',#{c.productName},'%') |
| | | and p.product_name like concat('%',#{c.productName},'%') |
| | | </if> |
| | | </where> |
| | | order by pm.id |
| | | order by pm.id |
| | | |
| | | </select> |
| | | <select id="selectLatestRecord" resultType="com.ruoyi.basic.pojo.ProductModel"> |
| | | SELECT * FROM product_model |
| | |
| | | <if test="ew.qualitity != null"> |
| | | qualitity = qualitity + #{ew.qualitity}, |
| | | </if> |
| | | <if test="ew.netWeight != null"> |
| | | net_weight = net_weight + #{ew.netWeight}, |
| | | </if> |
| | | <if test="ew.version != null"> |
| | | version = version + 1, |
| | | </if> |
| | | |
| | | <if test="ew.remark != null and ew.remark !=''"> |
| | | remark = #{ew.remark}, |
| | | </if> |
| | |
| | | <if test="ew.qualitity != null"> |
| | | qualitity = qualitity - #{ew.qualitity}, |
| | | </if> |
| | | <if test="ew.netWeight != null"> |
| | | net_weight = net_weight - #{ew.netWeight}, |
| | | </if> |
| | | <if test="ew.version != null"> |
| | | version = version + 1, |
| | | </if> |
| | |
| | | </update> |
| | | <select id="pagestockInventory" resultType="com.ruoyi.stock.dto.StockInventoryDto"> |
| | | select si.id, |
| | | si.net_weight, |
| | | si.qualitity, |
| | | COALESCE(si.locked_quantity, 0) as locked_quantity, |
| | | si.product_model_id, |
| | |
| | | pm.model, |
| | | si.remark, |
| | | pm.unit, |
| | | p.product_name |
| | | p.product_name, |
| | | p1.product_name as parent_name, |
| | | p1.id as parent_id |
| | | from stock_inventory si |
| | | left join product_model pm on si.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | where 1 = 1 |
| | | <if test="ew.productName != null and ew.productName !=''"> |
| | | and p.product_name like concat('%',#{ew.productName},'%') |
| | | </if> |
| | | left join product p1 on p.parent_id = p1.id |
| | | <where> |
| | | 1=1 |
| | | <if test="ew.parentId != null and ew.parentId !=''"> |
| | | and p.parent_id = #{ew.parentId} |
| | | </if> |
| | | <if test="ew.productName != null and ew.productName !=''"> |
| | | and p.product_name like concat('%',#{ew.productName},'%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="listStockInventoryExportData" resultType="com.ruoyi.stock.execl.StockInventoryExportData"> |
| | | select si.qualitity, |