|
@@ -198,7 +198,7 @@ public class TradingBoxItemController extends BladeController {
|
|
|
tradingBoxItem.setBoxSource("购买");
|
|
tradingBoxItem.setBoxSource("购买");
|
|
|
tradingBoxItem.setStatus("待使用");
|
|
tradingBoxItem.setStatus("待使用");
|
|
|
} else {
|
|
} else {
|
|
|
- if (tradingBoxItem.getBoxSource().equals("购买")) {
|
|
|
|
|
|
|
+ if ("购买".equals(tradingBoxItem.getBoxSource())) {
|
|
|
tradingBoxItem.setStatus("卖出");
|
|
tradingBoxItem.setStatus("卖出");
|
|
|
} else {
|
|
} else {
|
|
|
tradingBoxItem.setStatus("退租");
|
|
tradingBoxItem.setStatus("退租");
|
|
@@ -217,7 +217,10 @@ public class TradingBoxItemController extends BladeController {
|
|
|
tradingBoxItemService.updateById(tradingBoxItem);
|
|
tradingBoxItemService.updateById(tradingBoxItem);
|
|
|
if (ObjectUtils.isNotNull(tradingBoxItem.getCode())) {
|
|
if (ObjectUtils.isNotNull(tradingBoxItem.getCode())) {
|
|
|
//更新箱档案信息
|
|
//更新箱档案信息
|
|
|
- Archives archivesR = archivesService.getOne(new LambdaQueryWrapper<Archives>().eq(Archives::getIsDeleted, 0).eq(Archives::getTenantId, AuthUtil.getTenantId()).eq(Archives::getCode, tradingBoxItem.getCode()));
|
|
|
|
|
|
|
+ Archives archivesR = archivesService.getOne(new LambdaQueryWrapper<Archives>().eq(Archives::getIsDeleted, 0)
|
|
|
|
|
+ .eq(Archives::getTenantId, AuthUtil.getTenantId())
|
|
|
|
|
+ .eq(Archives::getCode, tradingBoxItem.getCode())
|
|
|
|
|
+ .eq(Archives::getStatus, ""));
|
|
|
Archives archives = new Archives();
|
|
Archives archives = new Archives();
|
|
|
if (ObjectUtils.isNotNull(archivesR)) {
|
|
if (ObjectUtils.isNotNull(archivesR)) {
|
|
|
BeanUtil.copy(archivesR, archives);
|
|
BeanUtil.copy(archivesR, archives);
|
|
@@ -248,11 +251,15 @@ public class TradingBoxItemController extends BladeController {
|
|
|
}
|
|
}
|
|
|
archives.setStatus(tradingBoxItem.getStatus());
|
|
archives.setStatus(tradingBoxItem.getStatus());
|
|
|
if (ObjectUtils.isNotNull(archivesR)) {
|
|
if (ObjectUtils.isNotNull(archivesR)) {
|
|
|
|
|
+ if ("BUY".equals(tradingBox.getType()) ) {
|
|
|
|
|
+ if (!"退租".equals(archivesR.getStatus()) && !"卖出".equals(archivesR.getStatus())) {
|
|
|
|
|
+ throw new RuntimeException("箱号:" + archivesR.getCode() + "已存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
archives.setUpdateTime(new Date());
|
|
archives.setUpdateTime(new Date());
|
|
|
archives.setUpdateUserName(AuthUtil.getUserName());
|
|
archives.setUpdateUserName(AuthUtil.getUserName());
|
|
|
archives.setUpdateUser(AuthUtil.getUserId());
|
|
archives.setUpdateUser(AuthUtil.getUserId());
|
|
|
archivesService.updateById(archives);
|
|
archivesService.updateById(archives);
|
|
|
-
|
|
|
|
|
} else {
|
|
} else {
|
|
|
archives.setCreateUser(AuthUtil.getUserId());
|
|
archives.setCreateUser(AuthUtil.getUserId());
|
|
|
archives.setCreateTime(new Date());
|
|
archives.setCreateTime(new Date());
|
|
@@ -341,9 +348,10 @@ public class TradingBoxItemController extends BladeController {
|
|
|
}
|
|
}
|
|
|
if (tradingBoxItem.getId() == null) {
|
|
if (tradingBoxItem.getId() == null) {
|
|
|
if (ObjectUtils.isNotNull(tradingBox)) {
|
|
if (ObjectUtils.isNotNull(tradingBox)) {
|
|
|
- if (tradingBox.getType().equals("ZR")) {
|
|
|
|
|
|
|
+ if ("ZR".equals(tradingBox.getType())) {
|
|
|
tradingBoxItem.setBoxSource("租入");
|
|
tradingBoxItem.setBoxSource("租入");
|
|
|
- } else if (tradingBox.getType().equals("ZC")) {
|
|
|
|
|
|
|
+ } else if ("ZC".equals(tradingBox.getType())) {
|
|
|
|
|
+ System.out.println("租出");
|
|
|
}
|
|
}
|
|
|
if (ObjectUtils.isNull(tradingBoxItem.getRentEndDate()) && ObjectUtils.isNull(tradingBoxItem.getRentStartDate())) {
|
|
if (ObjectUtils.isNull(tradingBoxItem.getRentEndDate()) && ObjectUtils.isNull(tradingBoxItem.getRentStartDate())) {
|
|
|
tradingBoxItem.setRentEndDate(tradingBoxItem.getLeaseCommencementDate());
|
|
tradingBoxItem.setRentEndDate(tradingBoxItem.getLeaseCommencementDate());
|
|
@@ -360,13 +368,13 @@ public class TradingBoxItemController extends BladeController {
|
|
|
if (ObjectUtils.isNotNull(tradingBoxItemList1) && tradingBoxItemList1.size() > 0) {
|
|
if (ObjectUtils.isNotNull(tradingBoxItemList1) && tradingBoxItemList1.size() > 0) {
|
|
|
throw new RuntimeException("箱号:" + tradingBoxItem.getCode() + "已存在,保存失败");
|
|
throw new RuntimeException("箱号:" + tradingBoxItem.getCode() + "已存在,保存失败");
|
|
|
}
|
|
}
|
|
|
- if (tradingBox.getType().equals("ZR")) {
|
|
|
|
|
|
|
+ if ("ZR".equals(tradingBox.getType())) {
|
|
|
if (ObjectUtils.isNotNull(tradingBoxItem.getLeaseCommencementDate())) {
|
|
if (ObjectUtils.isNotNull(tradingBoxItem.getLeaseCommencementDate())) {
|
|
|
tradingBoxItem.setStatus("待使用");
|
|
tradingBoxItem.setStatus("待使用");
|
|
|
} else {
|
|
} else {
|
|
|
tradingBoxItem.setStatus("录入");
|
|
tradingBoxItem.setStatus("录入");
|
|
|
}
|
|
}
|
|
|
- } else if (tradingBox.getType().equals("ZC")) {
|
|
|
|
|
|
|
+ } else if ("ZC".equals(tradingBox.getType())) {
|
|
|
// tradingBoxItem.setStatus("使用");
|
|
// tradingBoxItem.setStatus("使用");
|
|
|
if (ObjectUtils.isNotNull(tradingBoxItem.getLeaseCommencementDate())) {
|
|
if (ObjectUtils.isNotNull(tradingBoxItem.getLeaseCommencementDate())) {
|
|
|
tradingBoxItem.setStatus("使用");
|
|
tradingBoxItem.setStatus("使用");
|
|
@@ -384,13 +392,13 @@ public class TradingBoxItemController extends BladeController {
|
|
|
tradingBoxItem.setPid(tradingBox.getId());
|
|
tradingBoxItem.setPid(tradingBox.getId());
|
|
|
tradingBoxItemService.save(tradingBoxItem);
|
|
tradingBoxItemService.save(tradingBoxItem);
|
|
|
} else {
|
|
} else {
|
|
|
- if (tradingBox.getType().equals("ZR") && "录入".equals(tradingBoxItem.getStatus())) {
|
|
|
|
|
|
|
+ if ("ZR".equals(tradingBox.getType()) && "录入".equals(tradingBoxItem.getStatus())) {
|
|
|
if (ObjectUtils.isNotNull(tradingBoxItem.getLeaseCommencementDate())) {
|
|
if (ObjectUtils.isNotNull(tradingBoxItem.getLeaseCommencementDate())) {
|
|
|
tradingBoxItem.setStatus("待使用");
|
|
tradingBoxItem.setStatus("待使用");
|
|
|
} else {
|
|
} else {
|
|
|
tradingBoxItem.setStatus("录入");
|
|
tradingBoxItem.setStatus("录入");
|
|
|
}
|
|
}
|
|
|
- } else if (tradingBox.getType().equals("ZC") && "录入".equals(tradingBoxItem.getStatus())) {
|
|
|
|
|
|
|
+ } else if ("ZC".equals(tradingBox.getType()) && "录入".equals(tradingBoxItem.getStatus())) {
|
|
|
// tradingBoxItem.setStatus("使用");
|
|
// tradingBoxItem.setStatus("使用");
|
|
|
if (ObjectUtils.isNotNull(tradingBoxItem.getLeaseCommencementDate())) {
|
|
if (ObjectUtils.isNotNull(tradingBoxItem.getLeaseCommencementDate())) {
|
|
|
tradingBoxItem.setStatus("使用");
|
|
tradingBoxItem.setStatus("使用");
|
|
@@ -465,6 +473,11 @@ public class TradingBoxItemController extends BladeController {
|
|
|
archives.setContractNo(tradingBox.getContractNo());
|
|
archives.setContractNo(tradingBox.getContractNo());
|
|
|
archives.setBoxAccessStatus("");
|
|
archives.setBoxAccessStatus("");
|
|
|
if (ObjectUtils.isNotNull(archivesR)) {
|
|
if (ObjectUtils.isNotNull(archivesR)) {
|
|
|
|
|
+ if ("ZR".equals(tradingBox.getType()) ) {
|
|
|
|
|
+ if (!"退租".equals(archivesR.getStatus()) && !"卖出".equals(archivesR.getStatus())) {
|
|
|
|
|
+ throw new RuntimeException("箱号:" + archivesR.getCode() + "已存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
archives.setUpdateTime(new Date());
|
|
archives.setUpdateTime(new Date());
|
|
|
archives.setUpdateUserName(AuthUtil.getUserName());
|
|
archives.setUpdateUserName(AuthUtil.getUserName());
|
|
|
archives.setUpdateUser(AuthUtil.getUserId());
|
|
archives.setUpdateUser(AuthUtil.getUserId());
|