修改商城购买物料包报错的问题,修改后台查询错误的问题
This commit is contained in:
parent
dbba0c5545
commit
40450a24e7
|
@ -148,6 +148,7 @@ public class MaterialArtificerServiceImpl extends ServiceImpl<MaterialArtificerM
|
||||||
}
|
}
|
||||||
//根据物料包id和技师id查询技师对应物料包
|
//根据物料包id和技师id查询技师对应物料包
|
||||||
MaterialArtificer materialArtificer = baseMapper.selectOne(new QueryWrapper<MaterialArtificer>().eq("artificer_id",artificer.getArtificerId()).eq("material_id",material.getId()));
|
MaterialArtificer materialArtificer = baseMapper.selectOne(new QueryWrapper<MaterialArtificer>().eq("artificer_id",artificer.getArtificerId()).eq("material_id",material.getId()));
|
||||||
|
if(materialArtificer != null && materialArtificer.getResidue() !=null){
|
||||||
//修改物料包数量
|
//修改物料包数量
|
||||||
materialArtificer.setResidue(materialArtificer.getResidue().add(new BigDecimal(number)));
|
materialArtificer.setResidue(materialArtificer.getResidue().add(new BigDecimal(number)));
|
||||||
baseMapper.updateById(materialArtificer);
|
baseMapper.updateById(materialArtificer);
|
||||||
|
@ -165,6 +166,8 @@ public class MaterialArtificerServiceImpl extends ServiceImpl<MaterialArtificerM
|
||||||
materialRecord.setRecordDescribe(DateUtil.date()+"通过商城购买"+(materialRecord.getType().equals(1)?"新增剩余数量:":"减少剩余数量:")+materialArtificer.getResidue()+"总和:"+materialRecord.getTotal());
|
materialRecord.setRecordDescribe(DateUtil.date()+"通过商城购买"+(materialRecord.getType().equals(1)?"新增剩余数量:":"减少剩余数量:")+materialArtificer.getResidue()+"总和:"+materialRecord.getTotal());
|
||||||
materialRecordService.addMaterialRecord(materialRecord);
|
materialRecordService.addMaterialRecord(materialRecord);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -174,6 +174,9 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
|
||||||
IPage<MaterialArtificerResult> page1 = new Page(page, limit);
|
IPage<MaterialArtificerResult> page1 = new Page(page, limit);
|
||||||
IPage<MaterialArtificerResult> materialIPage = materialMapper.selectMaterialArtificer(page1,materialArtificer);
|
IPage<MaterialArtificerResult> materialIPage = materialMapper.selectMaterialArtificer(page1,materialArtificer);
|
||||||
for(MaterialArtificerResult par:materialIPage.getRecords()){
|
for(MaterialArtificerResult par:materialIPage.getRecords()){
|
||||||
|
if(par.getResidue() == null){
|
||||||
|
par.setResidue(BigDecimal.ZERO);
|
||||||
|
}
|
||||||
if(par.getResidue().compareTo(BigDecimal.ZERO)<0){
|
if(par.getResidue().compareTo(BigDecimal.ZERO)<0){
|
||||||
par.setResidue(BigDecimal.ZERO);
|
par.setResidue(BigDecimal.ZERO);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue