添加耗材功能
This commit is contained in:
parent
b315c23402
commit
020975e8b4
|
|
@ -65,14 +65,15 @@ public class TbConsInfo implements Serializable {
|
|||
@ApiModelProperty(value = "单位值")
|
||||
private String conUnit;
|
||||
|
||||
@Column(name = "`surplus_stock`")
|
||||
@ApiModelProperty(value = "每份消耗值")
|
||||
private BigDecimal surplusStock;
|
||||
|
||||
@Column(name = "`laster_in_stock`")
|
||||
@ApiModelProperty(value = "最近一次入库量")
|
||||
private BigDecimal lasterInStock;
|
||||
|
||||
@Column(name = "`con_warning`")
|
||||
@ApiModelProperty(value = "耗材预警值")
|
||||
private BigDecimal conWarning;
|
||||
|
||||
@Column(name = "`create_time`")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Timestamp createTime;
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
|
@ -48,6 +49,11 @@ public class TbProskuCon implements Serializable {
|
|||
@ApiModelProperty(value = "状态 1 启用 0 禁用")
|
||||
private String status;
|
||||
|
||||
@Column(name = "`surplus_stock`")
|
||||
@ApiModelProperty(value = "每份消耗值")
|
||||
private BigDecimal surplusStock;
|
||||
|
||||
|
||||
@Column(name = "`create_time`")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Timestamp createTime;
|
||||
|
|
|
|||
|
|
@ -47,12 +47,14 @@ public class TbConsInfoDto implements Serializable {
|
|||
/** 单位值 */
|
||||
private String conUnit;
|
||||
|
||||
/** 剩余库存 */
|
||||
private BigDecimal surplusStock;
|
||||
|
||||
/** 最近一次入库量 */
|
||||
private BigDecimal lasterInStock;
|
||||
|
||||
/**
|
||||
* 耗材预警值
|
||||
*/
|
||||
private BigDecimal conWarning;
|
||||
|
||||
/** 创建时间 */
|
||||
private Timestamp createTime;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,11 @@
|
|||
*/
|
||||
package cn.ysk.cashier.cons.service.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
|
@ -35,6 +39,8 @@ public class TbProskuConDto implements Serializable {
|
|||
/** 状态 1 启用 0 禁用 */
|
||||
private String status;
|
||||
|
||||
private BigDecimal lasterInStock;
|
||||
|
||||
/** 创建时间 */
|
||||
private Timestamp createTime;
|
||||
|
||||
|
|
|
|||
|
|
@ -85,7 +85,8 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
|||
public void update(TbConsInfo resources) {
|
||||
TbConsInfo tbConsInfo = tbConsInfoRepository.findById(resources.getId()).orElseGet(TbConsInfo::new);
|
||||
ValidationUtil.isNull( tbConsInfo.getId(),"TbConsInfo","id",resources.getId());
|
||||
tbConsInfo.copy(resources);
|
||||
|
||||
tbConsInfo.setSurplusStock(resources.getSurplusStock());
|
||||
tbConsInfoRepository.save(tbConsInfo);
|
||||
}
|
||||
|
||||
|
|
@ -110,6 +111,7 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
|||
map.put("剩余库存", tbConsInfo.getSurplusStock());
|
||||
map.put("最近一次入库量", tbConsInfo.getLasterInStock());
|
||||
map.put("创建时间", tbConsInfo.getCreateTime());
|
||||
map.put("耗材预警值",tbConsInfo.getConWarning());
|
||||
map.put("更新时间", tbConsInfo.getUpdateTime());
|
||||
map.put("店铺id", tbConsInfo.getShopId());
|
||||
list.add(map);
|
||||
|
|
|
|||
Loading…
Reference in New Issue