Merge remote-tracking branch 'origin/master'

master
mengjiao 7 months ago
commit 943f60e3e7

@ -81,7 +81,7 @@ public class EquSparepartsInOutImpl implements IEquSparepartsInOutService {
}
}else{//出库
if(sparePartsLedger.getAmount() != null){
if(sparePartsLedger.getAmount().compareTo(equSparepartsInOut.getAmount()) <= 0){
if(equSparepartsInOut.getAmount().compareTo(sparePartsLedger.getAmount()) == 1){
return AjaxResult.error("出库数量大于库存数量!");
}else{
BigDecimal result = sparePartsLedger.getAmount().subtract(equSparepartsInOut.getAmount());
@ -102,7 +102,7 @@ public class EquSparepartsInOutImpl implements IEquSparepartsInOutService {
String serialNum = String.format("%04d", equSparepartsInOutMapper.selectSerialNumber());
equSparepartsInOut.setOrderNo(date + serialNum);
equSparepartsInOutMapper.insertEquSparepartsInOut(equSparepartsInOut);
return AjaxResult.success("新增成功!");
return AjaxResult.success("新增出入库记录成功!");
}
/**
@ -137,8 +137,8 @@ public class EquSparepartsInOutImpl implements IEquSparepartsInOutService {
if(sparePartsLedger != null){
if(equSparepartsInOut.getInOutType().equals("type_in")){//入库
if(sparePartsLedger.getAmount() != null){
if(sparePartsLedger.getAmount().compareTo(equSparepartsInOut.getAmount()) <= 0){
return AjaxResult.error("备品备件台账的备品备件数量小于当时的入库数量");
if(sparePartsLedger.getAmount().compareTo(equSparepartsInOut.getAmount()) == -1){
return AjaxResult.error("目前该备品备件的库存数量,小于您选择的入库数量,无法还原库存");
}else{
BigDecimal result = sparePartsLedger.getAmount().subtract(equSparepartsInOut.getAmount());
//修改
@ -163,7 +163,7 @@ public class EquSparepartsInOutImpl implements IEquSparepartsInOutService {
}
}
equSparepartsInOutMapper.deleteEquSparepartsInOutByIds(ids);
return AjaxResult.success("删除成功");
return AjaxResult.success("删除成功,该备品备件库存已还原!");
}
/**
@ -181,8 +181,8 @@ public class EquSparepartsInOutImpl implements IEquSparepartsInOutService {
if(sparePartsLedger != null){
if(equSparepartsInOut.getInOutType().equals("type_in")){//入库
if(sparePartsLedger.getAmount() != null){
if(sparePartsLedger.getAmount().compareTo(equSparepartsInOut.getAmount()) <= 0){
return AjaxResult.error("备品备件台账的备品备件数量小于当时的入库数量");
if(sparePartsLedger.getAmount().compareTo(equSparepartsInOut.getAmount()) == -1){
return AjaxResult.error("目前该备品备件的库存数量,小于您选择的入库数量,无法还原库存");
}else{
BigDecimal result = sparePartsLedger.getAmount().subtract(equSparepartsInOut.getAmount());
//修改
@ -207,6 +207,6 @@ public class EquSparepartsInOutImpl implements IEquSparepartsInOutService {
}
equSparepartsInOutMapper.deleteEquSparepartsInOutById(id);
return AjaxResult.success("删除成功");
return AjaxResult.success("删除成功,该备品备件库存已还原!");
}
}

@ -41,14 +41,16 @@
<if test="createTime != null ">and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''">and update_by = #{updateBy}</if>
<if test="updateTime != null ">and update_time = #{updateTime}</if>
<if test="delFlag != null and delFlag != ''">and del_flag = #{delFlag}</if>
and del_flag = '0'
<if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if>
</where>
order by create_time desc
</select>
<select id="selectEquSparepartsInOutById" parameterType="String" resultMap="EquSparepartsInOutResult">
<include refid="selectEquSparepartsInOutVo"/>
where id = #{id}
and del_flag = '0'
</select>
<insert id="insertEquSparepartsInOut" parameterType="EquSparepartsInOut">

Loading…
Cancel
Save