package com.skua.modules.erp.vo; import com.baomidou.mybatisplus.annotation.TableField; import com.skua.modules.erp.entity.MaterialIN; import com.skua.tool.util.JSUtils; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import org.apache.commons.lang3.StringUtils; import org.jeecgframework.poi.excel.annotation.Excel; import java.util.List; @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @ApiModel(value="MaterialINVO查询对象", description="MaterialINVO查询对象") public class MaterialINVO extends MaterialIN { /**税额*/ @ApiModelProperty(value = "税额") private String taxAmount; @ApiModelProperty(value = "药剂入口编号") private String materialInId; @ApiModelProperty(value = "权限厂站编号集合") private String departIds; @ApiModelProperty(value = "物料编码") private String sparepartCode; /**规格型号*/ @Excel(name = "规格型号", width = 15) @ApiModelProperty(value = "规格型号") private String specification; /**计量单位*/ @Excel(name = "计量单位", width = 15) @ApiModelProperty(value = "计量单位") private String measuringUnit; /**审批状态*/ @TableField(exist=false) @ApiModelProperty(value = "审批状态 1通过2不通过") private String approveState; @TableField(exist = false) @ApiModelProperty(value = "物料类别") private String sparepartTypeName; @TableField(exist = false) @ApiModelProperty(value = "供应商名称") private String supplierName; @TableField(exist = false) private String departName; /**采购单价*/ @ApiModelProperty(value = "采购单价") private String purchasePrice; /**分销单价*/ @ApiModelProperty(value = "分销单价") private String distributPrice; /**采购总价*/ @TableField(exist = false) @ApiModelProperty(value = "采购总价") @Excel(name = "采购总价", width = 15) private String purchaseTotalPrice; /**价税合计*/ @TableField(exist = false) @ApiModelProperty(value = "总价(不含税)") private String totalPriceTax; @ApiModelProperty(value = "药剂列表") private List<PurchaseMaterialVO> materiaList; public String getTotalPriceTax() { //不含税总价 = 含税总价 / (1 + 税率) if(StringUtils.isNotEmpty(this.getTaxAmount()) && StringUtils.isNotEmpty(this.getDistributPrice()) && StringUtils.isNotEmpty(this.getMaterialNum())){ String expression = distributPrice +" * " +this.getMaterialNum() +"/( 1 +"+taxAmount+"* 0.01)"; totalPriceTax = JSUtils.executeExpression(expression ,"0.00" ) ; } return totalPriceTax; } }