审计记录

sk-module-biz/src/main/java/com/skua/modules/erp/vo/MaterialINVO.java 3.1 KB
1 2 3 4
package com.skua.modules.erp.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.skua.modules.erp.entity.MaterialIN;
5
import com.skua.tool.util.JSUtils;
6 7 8 9 10
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
11 12 13 14
import org.apache.commons.lang3.StringUtils;
import org.jeecgframework.poi.excel.annotation.Excel;

import java.util.List;
15 16 17 18 19 20 21

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="MaterialINVO查询对象", description="MaterialINVO查询对象")
public class MaterialINVO   extends MaterialIN {

22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
    /**税额*/
    @ApiModelProperty(value = "税额")
    private String taxAmount;
    /**药剂(物料)名称*/
    @Excel(name = "药剂(物料)名称", width = 15)
    @ApiModelProperty(value = "药剂(物料)名称")
    private String sparepartName;

    @ApiModelProperty(value = "物料编码")
    private String sparepartCode;
    /**规格型号*/
    @Excel(name = "规格型号", width = 15)
    @ApiModelProperty(value = "规格型号")
    private String specification;



    /**计量单位*/
    @Excel(name = "计量单位", width = 15)
    @ApiModelProperty(value = "计量单位")
    private String measuringUnit;
43

44 45 46 47
    /**审批状态*/
    @TableField(exist=false)
    @ApiModelProperty(value = "审批状态  1通过2不通过")
    private String approveState;
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95

    @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 = "采购总价")
    private String purchaseTotalPrice;
    /**价税合计*/
    @TableField(exist = false)
    @ApiModelProperty(value = "总价(不含税)")
    private String totalPriceTax;

    @ApiModelProperty(value = "药剂列表")
    private List<PurchaseMaterialVO>  materiaList;


    public String getPurchaseTotalPrice() {
        if(StringUtils.isNotEmpty(this.getPurchasePrice()) && StringUtils.isNotEmpty(this.getMaterialNum())){
            purchaseTotalPrice = JSUtils.multiply(purchasePrice ,this.getMaterialNum())  ;
        }
        return purchaseTotalPrice;
    }


    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;
    }
96
}