|
|
@ -344,7 +344,7 @@ public class ZyFabricServiceImpl extends ServiceImpl<ZyFabricMapper, ZyFabric> i |
|
|
|
String fabricId = zyAddFabricVo.getZyFabricId(); |
|
|
|
String fabricId = zyAddFabricVo.getZyFabricId(); |
|
|
|
Integer count = zyAddFabricVo.getCount(); |
|
|
|
Integer count = zyAddFabricVo.getCount(); |
|
|
|
ZyFabric zyFabric = this.getById(fabricId); |
|
|
|
ZyFabric zyFabric = this.getById(fabricId); |
|
|
|
zyFabric.setStore(zyFabric.getStore()+count); |
|
|
|
// zyFabric.setStore(zyFabric.getStore()+count);
|
|
|
|
// zyFabricMapper.addFabricCount(fabricId, count);
|
|
|
|
// zyFabricMapper.addFabricCount(fabricId, count);
|
|
|
|
UpdateWrapper<ZyFabric> updateWrapper = new UpdateWrapper<>(); |
|
|
|
UpdateWrapper<ZyFabric> updateWrapper = new UpdateWrapper<>(); |
|
|
|
updateWrapper.eq("id", fabricId); |
|
|
|
updateWrapper.eq("id", fabricId); |
|
|
@ -362,18 +362,18 @@ public class ZyFabricServiceImpl extends ServiceImpl<ZyFabricMapper, ZyFabric> i |
|
|
|
Integer count = zyAddFabricVo.getCount(); |
|
|
|
Integer count = zyAddFabricVo.getCount(); |
|
|
|
// zyFabricMapper.deleteFabricCount(fabricId, count);
|
|
|
|
// zyFabricMapper.deleteFabricCount(fabricId, count);
|
|
|
|
ZyFabric zyFabric = this.getById(fabricId); |
|
|
|
ZyFabric zyFabric = this.getById(fabricId); |
|
|
|
zyFabric.setStore(zyFabric.getStore()-count); |
|
|
|
// zyFabric.setStore(zyFabric.getStore()-count);
|
|
|
|
if (zyFabric.getStore() < 0) { |
|
|
|
// if (zyFabric.getStore() < 0) {
|
|
|
|
try { |
|
|
|
// try {
|
|
|
|
throw new Exception(); |
|
|
|
// throw new Exception();
|
|
|
|
} catch (Exception e) { |
|
|
|
// } catch (Exception e) {
|
|
|
|
e.printStackTrace(); |
|
|
|
// e.printStackTrace();
|
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
|
|
|
// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
|
return false; |
|
|
|
// return false;
|
|
|
|
} finally { |
|
|
|
// } finally {
|
|
|
|
return false; |
|
|
|
// return false;
|
|
|
|
} |
|
|
|
// }
|
|
|
|
} |
|
|
|
// }
|
|
|
|
UpdateWrapper<ZyFabric> updateWrapper = new UpdateWrapper<>(); |
|
|
|
UpdateWrapper<ZyFabric> updateWrapper = new UpdateWrapper<>(); |
|
|
|
updateWrapper.eq("id", fabricId); |
|
|
|
updateWrapper.eq("id", fabricId); |
|
|
|
|
|
|
|
|
|
|
@ -389,7 +389,7 @@ public class ZyFabricServiceImpl extends ServiceImpl<ZyFabricMapper, ZyFabric> i |
|
|
|
String fabricId = zyOrderFabric.getFabricId(); |
|
|
|
String fabricId = zyOrderFabric.getFabricId(); |
|
|
|
Integer count = zyOrderFabric.getOrderCount(); |
|
|
|
Integer count = zyOrderFabric.getOrderCount(); |
|
|
|
ZyFabric zyFabric = this.getById(fabricId); |
|
|
|
ZyFabric zyFabric = this.getById(fabricId); |
|
|
|
zyFabric.setStore(zyFabric.getStore()+count); |
|
|
|
// zyFabric.setStore(zyFabric.getStore()+count);
|
|
|
|
// zyFabricMapper.addFabricCount(fabricId, count);
|
|
|
|
// zyFabricMapper.addFabricCount(fabricId, count);
|
|
|
|
UpdateWrapper<ZyFabric> updateWrapper = new UpdateWrapper<>(); |
|
|
|
UpdateWrapper<ZyFabric> updateWrapper = new UpdateWrapper<>(); |
|
|
|
updateWrapper.eq("id", fabricId); |
|
|
|
updateWrapper.eq("id", fabricId); |
|
|
@ -407,18 +407,18 @@ public class ZyFabricServiceImpl extends ServiceImpl<ZyFabricMapper, ZyFabric> i |
|
|
|
Integer count = zyOrderFabric.getOrderCount(); |
|
|
|
Integer count = zyOrderFabric.getOrderCount(); |
|
|
|
// zyFabricMapper.deleteFabricCount(fabricId, count);
|
|
|
|
// zyFabricMapper.deleteFabricCount(fabricId, count);
|
|
|
|
ZyFabric zyFabric = this.getById(fabricId); |
|
|
|
ZyFabric zyFabric = this.getById(fabricId); |
|
|
|
zyFabric.setStore(zyFabric.getStore()-count); |
|
|
|
// zyFabric.setStore(zyFabric.getStore()-count);
|
|
|
|
if (zyFabric.getStore() < 0) { |
|
|
|
// if (zyFabric.getStore() < 0) {
|
|
|
|
try { |
|
|
|
// try {
|
|
|
|
throw new Exception(); |
|
|
|
// throw new Exception();
|
|
|
|
} catch (Exception e) { |
|
|
|
// } catch (Exception e) {
|
|
|
|
e.printStackTrace(); |
|
|
|
// e.printStackTrace();
|
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
|
|
|
// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
|
return false; |
|
|
|
// return false;
|
|
|
|
} finally { |
|
|
|
// } finally {
|
|
|
|
return false; |
|
|
|
// return false;
|
|
|
|
} |
|
|
|
// }
|
|
|
|
} |
|
|
|
// }
|
|
|
|
UpdateWrapper<ZyFabric> updateWrapper = new UpdateWrapper<>(); |
|
|
|
UpdateWrapper<ZyFabric> updateWrapper = new UpdateWrapper<>(); |
|
|
|
updateWrapper.eq("id", fabricId); |
|
|
|
updateWrapper.eq("id", fabricId); |
|
|
|
|
|
|
|
|
|
|
|