20220905-zc1

zhc4dev
lenovo 2 years ago
parent 027b79f53a
commit 11ce9857b9
  1. 52
      jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/fabric/service/impl/ZyFabricServiceImpl.java

@ -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);

Loading…
Cancel
Save