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