bug
This commit is contained in:
parent
43b159ca72
commit
1ed94a6706
|
|
@ -42,4 +42,11 @@ public interface MaMachineMapper {
|
||||||
SltAgreementApply getLeaseProject(MaMachine ma);
|
SltAgreementApply getLeaseProject(MaMachine ma);
|
||||||
|
|
||||||
SltAgreementApply getBackProject(MaMachine ma);
|
SltAgreementApply getBackProject(MaMachine ma);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据typeId修改库存
|
||||||
|
* @param typeId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int updateNum(long typeId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,17 @@ public class MaMachineServiceImpl implements MaMachineService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int remove(Long[] maIds) {
|
public int remove(Long[] maIds) {
|
||||||
return maMachineMapper.remove(maIds);
|
int res = 0;
|
||||||
|
if (maIds != null || maIds.length > 0) {
|
||||||
|
for (Long maId : maIds) {
|
||||||
|
MaMachine maMachine = maMachineMapper.selectMaMachineByMaId(maId);
|
||||||
|
if (maMachine.getTypeId() != 0 && ("15").equals(maMachine.getMaStatus())) {
|
||||||
|
res = maMachineMapper.updateNum(maMachine.getTypeId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
res += maMachineMapper.remove(maIds);
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -262,6 +262,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</set>
|
</set>
|
||||||
where ma_id = #{maId}
|
where ma_id = #{maId}
|
||||||
</update>
|
</update>
|
||||||
|
<update id="updateNum">
|
||||||
|
update ma_type set num = num - 1 where type_id = #{typeId}
|
||||||
|
</update>
|
||||||
|
|
||||||
<delete id="remove" parameterType="Long">
|
<delete id="remove" parameterType="Long">
|
||||||
delete from ma_machine where ma_id in
|
delete from ma_machine where ma_id in
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue