修复采购入库列表库存的bug

This commit is contained in:
季圣华 2020-12-25 23:21:18 +08:00
parent 91a10eec82
commit 56bc53c235
3 changed files with 16 additions and 2 deletions

View File

@ -156,7 +156,10 @@ public class DepotItemController {
if(ratio!=null){
BigDecimal ratioDecimal = new BigDecimal(ratio.toString());
if(ratioDecimal.compareTo(BigDecimal.ZERO)!=0){
stock = stock.divide(ratioDecimal,2,BigDecimal.ROUND_HALF_UP); //两位小数
String otherUnit = diEx.getOtherUnit();
if(otherUnit.equals(diEx.getMaterialUnit())) {
stock = stock.divide(ratioDecimal,2,BigDecimal.ROUND_HALF_UP); //两位小数
}
}
}
item.put("Stock", stock);

View File

@ -34,6 +34,8 @@ public class DepotItemVo4WithInfoEx extends DepotItem{
private Integer ratio;
private String otherUnit;
private BigDecimal presetPriceOne;
private String priceStrategy;
@ -162,6 +164,14 @@ public class DepotItemVo4WithInfoEx extends DepotItem{
this.ratio = ratio;
}
public String getOtherUnit() {
return otherUnit;
}
public void setOtherUnit(String otherUnit) {
this.otherUnit = otherUnit;
}
public BigDecimal getPresetPriceOne() {
return presetPriceOne;
}

View File

@ -30,6 +30,7 @@
<result column="UnitId" jdbcType="BIGINT" property="UnitId" />
<result column="unit_name" jdbcType="VARCHAR" property="unitName" />
<result column="ratio" jdbcType="INTEGER" property="ratio" />
<result column="other_unit" jdbcType="INTEGER" property="otherUnit" />
<result column="barCode" jdbcType="VARCHAR" property="barCode" />
</resultMap>
@ -141,7 +142,7 @@
<select id="getDetailList" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap">
select di.*,m.name MName,m.model MModel,m.unit MaterialUnit,m.color MColor,m.standard MStandard,m.mfrs MMfrs,
m.other_field1 MOtherField1,m.other_field2 MOtherField2,m.other_field3 MOtherField3,
dp1.name DepotName,dp2.name AnotherDepotName, u.id UnitId, u.name unit_name, u.ratio, me.bar_code barCode
dp1.name DepotName,dp2.name AnotherDepotName, u.id UnitId, u.name unit_name, u.ratio, u.other_unit, me.bar_code barCode
from jsh_depot_item di
left join jsh_material m on di.material_id=m.id and ifnull(m.delete_flag,'0') !='1'
left join jsh_material_extend me on me.id=di.material_extend_id and ifnull(me.delete_Flag,'0') !='1'