|
|
@@ -177,11 +177,10 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
tradingBoxFees.setItemName(r.getData().getCname());
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- /*CorpsDesc corpsDesc = corpsDescClient.getCorpId(tradingBoxFees.getCorpId());
|
|
|
+ CorpsDesc corpsDesc = corpsDescClient.getCorpId(tradingBoxFees.getCorpId());
|
|
|
if (ObjectUtils.isNotNull(corpsDesc)) {
|
|
|
tradingBoxFees.setCorpName(corpsDesc.getCname());
|
|
|
- }*/
|
|
|
+ }
|
|
|
}
|
|
|
details.setTradingBoxFeesList(tradingBoxFeesList);
|
|
|
|
|
|
@@ -516,13 +515,13 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
if (tradingBoxItem.getId() == null) {
|
|
|
|
|
|
LambdaQueryWrapper<TradingBoxItem> tradingBoxItemLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- tradingBoxItemLambdaQueryWrapper.eq(TradingBoxItem::getIsDeleted,0)
|
|
|
- .eq(TradingBoxItem::getTenantId,AuthUtil.getTenantId())
|
|
|
- .eq(TradingBoxItem::getPid,tradingBox.getId())
|
|
|
- .eq(TradingBoxItem::getCode,tradingBoxItem.getCode());
|
|
|
+ tradingBoxItemLambdaQueryWrapper.eq(TradingBoxItem::getIsDeleted, 0)
|
|
|
+ .eq(TradingBoxItem::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(TradingBoxItem::getPid, tradingBox.getId())
|
|
|
+ .eq(TradingBoxItem::getCode, tradingBoxItem.getCode());
|
|
|
List<TradingBoxItem> tradingBoxItemList1 = tradingBoxItemMapper.selectList(tradingBoxItemLambdaQueryWrapper);
|
|
|
- if (ObjectUtils.isNotNull(tradingBoxItemList1) && tradingBoxItemList1.size()>0){
|
|
|
- throw new RuntimeException("箱号:"+tradingBoxItem.getCode()+"已存在,保存失败");
|
|
|
+ if (ObjectUtils.isNotNull(tradingBoxItemList1) && tradingBoxItemList1.size() > 0) {
|
|
|
+ throw new RuntimeException("箱号:" + tradingBoxItem.getCode() + "已存在,保存失败");
|
|
|
}
|
|
|
if (tradingBox.getType().equals("ZR")) {
|
|
|
if (ObjectUtils.isNotNull(tradingBoxItem.getLeaseCommencementDate())) {
|
|
|
@@ -546,47 +545,6 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
tradingBoxItem.setCreateUserName(AuthUtil.getUserName());
|
|
|
tradingBoxItem.setTenantId(AuthUtil.getTenantId());
|
|
|
tradingBoxItem.setPid(tradingBox.getId());
|
|
|
-
|
|
|
- //计算租金费用
|
|
|
- TradingBoxFees tradingBoxFees = new TradingBoxFees();
|
|
|
- tradingBoxFees.setCorpId(tradingBox.getPurchaseCompanyId());
|
|
|
- tradingBoxFees.setCorpName(tradingBox.getPurchaseCompanyName());
|
|
|
- tradingBoxFees.setAmount(tradingBoxItem.getAmount());
|
|
|
- tradingBoxFees.setPrice(tradingBoxItem.getAmount());
|
|
|
- tradingBoxFees.setQuantity(BigDecimal.valueOf(tradingBoxItem.getOverdueDays()));
|
|
|
- tradingBoxFees.setCurrency(tradingBoxItem.getCurrency());
|
|
|
- tradingBoxFees.setCode(tradingBoxItem.getCode());
|
|
|
- tradingBoxFees.setCorpName(tradingBox.getPurchaseCompanyName());
|
|
|
- //获取费用id
|
|
|
- R<FeesDesc> fees = feesDescClient.getFeesByName("租金");
|
|
|
- if (fees.isSuccess() && fees.getData() != null) {
|
|
|
- tradingBoxFees.setItemId(fees.getData().getId());
|
|
|
- }
|
|
|
- if ("ZR".equals(tradingBox.getType())) {
|
|
|
- tradingBoxFees.setFeesType(2);
|
|
|
- tradingBoxFees.setBillType("租入");
|
|
|
- } else {
|
|
|
- tradingBoxFees.setFeesType(1);
|
|
|
- tradingBoxFees.setBillType("租出");
|
|
|
- }
|
|
|
- tradingBoxFees.setPid(tradingBox.getId());
|
|
|
- tradingBoxFees.setSrcOrderNo(tradingBox.getContractNo());
|
|
|
- tradingBoxFees.setUnit(tradingBoxItem.getBoxType());
|
|
|
- tradingBoxFees.setExchangeRate(new BigDecimal(1));
|
|
|
- if (ObjectUtils.isNotNull(tradingBoxItem.getLeaseCommencementDate()) && ObjectUtils.isNotNull(tradingBoxItem.getOverdueDays())) {
|
|
|
- Calendar calendar = new GregorianCalendar();
|
|
|
- calendar.setTime(tradingBoxItem.getLeaseCommencementDate());
|
|
|
- calendar.add(Calendar.DATE, tradingBoxItem.getOverdueDays());
|
|
|
- tradingBoxFees.setRentStartDate(calendar.getTime());
|
|
|
- tradingBoxItem.setRentEndDate(calendar.getTime());
|
|
|
- }
|
|
|
- tradingBoxFees.setRentEndDate(tradingBox.getRentCalculationDate());
|
|
|
- tradingBoxFees.setCreateUser(AuthUtil.getUserId());
|
|
|
- tradingBoxFees.setCreateTime(new Date());
|
|
|
- tradingBoxFees.setTenantId(AuthUtil.getTenantId());
|
|
|
- tradingBoxFees.setSubmitPay(0);
|
|
|
- tradingBoxFeesMapper.insert(tradingBoxFees);
|
|
|
-
|
|
|
tradingBoxItemMapper.insert(tradingBoxItem);
|
|
|
} else {
|
|
|
if (tradingBox.getType().equals("ZR") && "录入".equals(tradingBoxItem.getStatus())) {
|
|
|
@@ -1072,6 +1030,48 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
tradingBoxItem.setUpdateUserName(AuthUtil.getUserName());
|
|
|
if ("1".equals(tradingBox.getRentType())) {
|
|
|
tradingBoxItem.setLeaseCommencementDate(tradingBox.getRentDate());
|
|
|
+ if (ObjectUtils.isNotNull(tradingBoxItem.getLeaseCommencementDate()) && ObjectUtils.isNotNull(tradingBoxItem.getOverdueDays())) {
|
|
|
+ //计算租金费用
|
|
|
+ TradingBoxFees tradingBoxFees = new TradingBoxFees();
|
|
|
+ tradingBoxFees.setCorpId(tradingBox.getPurchaseCompanyId());
|
|
|
+ tradingBoxFees.setCorpName(tradingBox.getPurchaseCompanyName());
|
|
|
+ tradingBoxFees.setAmount(tradingBoxItem.getAmount());
|
|
|
+ tradingBoxFees.setPrice(tradingBoxItem.getAmount());
|
|
|
+ tradingBoxFees.setQuantity(BigDecimal.valueOf(tradingBoxItem.getOverdueDays()));
|
|
|
+ tradingBoxFees.setCurrency(tradingBoxItem.getCurrency());
|
|
|
+ tradingBoxFees.setCode(tradingBoxItem.getCode());
|
|
|
+ tradingBoxFees.setCorpName(tradingBox.getPurchaseCompanyName());
|
|
|
+ //获取费用id
|
|
|
+ R<FeesDesc> fees = feesDescClient.getFeesByName("租金");
|
|
|
+ if (fees.isSuccess() && fees.getData() != null) {
|
|
|
+ tradingBoxFees.setItemId(fees.getData().getId());
|
|
|
+ }
|
|
|
+ if ("ZR".equals(tradingBox.getType())) {
|
|
|
+ tradingBoxFees.setFeesType(2);
|
|
|
+ tradingBoxFees.setBillType("租入");
|
|
|
+ } else {
|
|
|
+ tradingBoxFees.setFeesType(1);
|
|
|
+ tradingBoxFees.setBillType("租出");
|
|
|
+ }
|
|
|
+ tradingBoxFees.setPid(tradingBox.getId());
|
|
|
+ tradingBoxFees.setSrcOrderNo(tradingBox.getContractNo());
|
|
|
+ tradingBoxFees.setUnit(tradingBoxItem.getBoxType());
|
|
|
+ tradingBoxFees.setExchangeRate(new BigDecimal(1));
|
|
|
+
|
|
|
+ Calendar calendar = new GregorianCalendar();
|
|
|
+ calendar.setTime(tradingBoxItem.getLeaseCommencementDate());
|
|
|
+ calendar.add(Calendar.DATE, tradingBoxItem.getOverdueDays());
|
|
|
+
|
|
|
+ tradingBoxFees.setRentStartDate(tradingBoxItem.getLeaseCommencementDate());
|
|
|
+ tradingBoxFees.setRentEndDate(calendar.getTime());
|
|
|
+ tradingBoxFees.setCreateUser(AuthUtil.getUserId());
|
|
|
+ tradingBoxFees.setCreateTime(new Date());
|
|
|
+ tradingBoxFees.setTenantId(AuthUtil.getTenantId());
|
|
|
+ tradingBoxFees.setSubmitPay(0);
|
|
|
+ tradingBoxFeesMapper.insert(tradingBoxFees);
|
|
|
+
|
|
|
+ tradingBoxItem.setRentEndDate(calendar.getTime());
|
|
|
+ }
|
|
|
if (ObjectUtils.isNotNull(tradingBoxItem.getCode())) {
|
|
|
//更新箱档案信息
|
|
|
Archives archivesR = archivesMapper.selectOne(new LambdaQueryWrapper<Archives>().eq(Archives::getIsDeleted, 0).eq(Archives::getTenantId, AuthUtil.getTenantId()).eq(Archives::getCode, tradingBoxItem.getCode()));
|
|
|
@@ -1130,7 +1130,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
}
|
|
|
archivesTrajectory.setStatus("租入");
|
|
|
tradingBoxItem.setStatus("待使用");
|
|
|
- tradingBoxItem.setRentEndDate(tradingBoxItem.getLeaseCommencementDate());
|
|
|
+// tradingBoxItem.setRentEndDate(tradingBoxItem.getLeaseCommencementDate());
|
|
|
} else {
|
|
|
archives.setBoxAccessStatus("空箱离场");
|
|
|
archives.setStatus("使用");
|
|
|
@@ -1804,7 +1804,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
if (tradingBoxs.getId() == null) {
|
|
|
throw new RuntimeException("缺少必要参数");
|
|
|
}
|
|
|
- if ("JK".equals(tradingBoxs.getType()) || "CK".equals(tradingBoxs.getType())){
|
|
|
+ if ("JK".equals(tradingBoxs.getType()) || "CK".equals(tradingBoxs.getType())) {
|
|
|
Transport transport = transportMapper.selectById(tradingBoxs.getId());
|
|
|
Long pid = tradingBoxs.getId();
|
|
|
|
|
|
@@ -1908,7 +1908,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
}
|
|
|
}
|
|
|
return R.data(transport);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
TradingBox tradingBox = baseMapper.selectById(tradingBoxs.getId());
|
|
|
Long pid = tradingBoxs.getId();
|
|
|
|
|
|
@@ -2019,7 +2019,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
|
|
|
@Override
|
|
|
public R revokeBill(TradingBox tradingBox) {
|
|
|
- if ("JKFC".equals(tradingBox.getType()) || "CKZY".equals(tradingBox.getType())){
|
|
|
+ if ("JKFC".equals(tradingBox.getType()) || "CKZY".equals(tradingBox.getType())) {
|
|
|
Transport selectTransport = transportMapper.selectById(tradingBox.getId());
|
|
|
if (selectTransport == null) {
|
|
|
throw new SecurityException("撤销失败,未找到主表信息");
|
|
|
@@ -2050,7 +2050,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
throw new SecurityException("撤销失败,请选择费用明细");
|
|
|
}
|
|
|
return R.data(selectTransport);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
TradingBox selectTradingBox = baseMapper.selectById(tradingBox.getId());
|
|
|
if (selectTradingBox == null) {
|
|
|
throw new SecurityException("撤销失败,未找到主表信息");
|