ErpSettlementVO.java
2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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
package com.skua.modules.erp.vo;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.skua.modules.erp.entity.ErpSettlement;
import com.skua.modules.erp.entity.ErpSettlementItem;
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 com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* 药剂结算单详情
*/
@Data
@ApiModel(value="erp_settlement数据传输对象", description="药剂结算单详情")
public class ErpSettlementVO extends ErpSettlement {
@ApiModelProperty(value = "项目名称")
private String projectName;
@ApiModelProperty(value = "供应商名称")
private String supplierName;
@ApiModelProperty(value = "部门名称")
private String departName;
/*@ApiModelProperty(value = "数量")
private String materialNum;
@ApiModelProperty(value = "结算金额")
private String totalPrice;
@ApiModelProperty(value = "结算金额-不含税")
private String totalPriceTax;*/
@ApiModelProperty(value = "结算清单")
private List<ErpSettlementItemVO> itemList ;
@ApiModelProperty(value = "物料结算记录")
private List<SparepartSettlementVO> sparepartSettlementList ;
/***
* 计算总数、总价、价税合计
*/
public void calculatePrice(){
String materialNumExpression = "0";
String totalPriceExpression = "0";
String totalPriceTaxExpression ="0";
if(itemList != null && !itemList.isEmpty()){
for(ErpSettlementItemVO settlementItemVO : itemList){
materialNumExpression = materialNumExpression + "+" +settlementItemVO.getMaterialNum();
totalPriceExpression = totalPriceExpression + "+" +settlementItemVO.getTotalPrice();
totalPriceTaxExpression = totalPriceTaxExpression + "+" +settlementItemVO.getTotalPriceTax();
//totalPriceExpression = totalPriceExpression + "+ (" +settlementItemVO.getUnitPrice() +" * "+settlementItemVO.getMaterialNum()+")";
//totalPriceTaxExpression = totalPriceTaxExpression + "+ (" +settlementItemVO.getUnitPrice() +" * "+settlementItemVO.getMaterialNum()+" / (1+ "+settlementItemVO.getTaxAmount()+" * 0.01))";
}
this.setMaterialNum( JSUtils.executeExpression(materialNumExpression,"0.00"));
this.setTotalPrice( JSUtils.executeExpression(totalPriceExpression,"0.00"));
this.setTotalPriceTax( JSUtils.executeExpression(totalPriceTaxExpression,"0.00"));
}
}
}