|
|
@@ -17,7 +17,6 @@
|
|
|
package org.springblade.box.tube.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
@@ -28,8 +27,8 @@ import lombok.AllArgsConstructor;
|
|
|
import org.springblade.box.tube.dto.TradingBoxItemRentExcelEnter;
|
|
|
import org.springblade.box.tube.entity.*;
|
|
|
import org.springblade.box.tube.mapper.*;
|
|
|
-import org.springblade.box.tube.ocean.entity.ShippingBill;
|
|
|
-import org.springblade.box.tube.ocean.entity.ShippingFees;
|
|
|
+import org.springblade.box.tube.service.ITradingBoxFeesService;
|
|
|
+import org.springblade.box.tube.service.ITradingBoxItemService;
|
|
|
import org.springblade.box.tube.service.ITradingBoxService;
|
|
|
import org.springblade.box.tube.service.ITransferService;
|
|
|
import org.springblade.box.tube.vo.TradingBoxVO;
|
|
|
@@ -72,11 +71,11 @@ import java.util.stream.Collectors;
|
|
|
@AllArgsConstructor
|
|
|
public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, TradingBox> implements ITradingBoxService {
|
|
|
|
|
|
- private final TradingBoxFeesMapper tradingBoxFeesMapper;
|
|
|
+ private final ITradingBoxFeesService tradingBoxFeesService;
|
|
|
|
|
|
private final ITransferService transferService;
|
|
|
|
|
|
- private final TradingBoxItemMapper tradingBoxItemMapper;
|
|
|
+ private final ITradingBoxItemService tradingBoxItemService;
|
|
|
|
|
|
private final TradingBoxFilesMapper tradingBoxFilesMapper;
|
|
|
|
|
|
@@ -106,9 +105,6 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
|
|
|
private final IPortClient portClient;
|
|
|
|
|
|
- private final RedisTemplate<String, Object> redisTemplate;
|
|
|
- private IRedisClient redisClient;
|
|
|
-
|
|
|
private final TransportItemFeesMapper transportItemFeesMapper;
|
|
|
|
|
|
private final TransportMapper transportMapper;
|
|
|
@@ -126,48 +122,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
TradingBox details = baseMapper.selectById(tradingBox.getId());
|
|
|
if (ObjectUtils.isNotNull(details)) {
|
|
|
details.setTradingBoxItemsList(new ArrayList<>());
|
|
|
- //获取明细信息
|
|
|
- /*
|
|
|
- LambdaQueryWrapper<TradingBoxItem> tradingBoxItemLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- tradingBoxItemLambdaQueryWrapper.eq(TradingBoxItem::getIsDeleted, 0)
|
|
|
- .eq(TradingBoxItem::getTenantId, AuthUtil.getTenantId())
|
|
|
- .eq(TradingBoxItem::getPid, details.getId())
|
|
|
- .orderByDesc(TradingBoxItem::getCreateTime);
|
|
|
- List<TradingBoxItem> tradingBoxItemList = tradingBoxItemMapper.selectList(tradingBoxItemLambdaQueryWrapper);
|
|
|
- details.setTradingBoxItemsList(tradingBoxItemList);
|
|
|
- //商品
|
|
|
- List<FeesDesc> feesDescList = new ArrayList<>();
|
|
|
- feesDescList = castToList(redisTemplate.opsForValue().get("feeName"), FeesDesc.class);
|
|
|
- if (feesDescList.size() == 0) {
|
|
|
- redisClient.basicData("feeName");
|
|
|
- feesDescList = castToList(redisTemplate.opsForValue().get("feeName"), FeesDesc.class);
|
|
|
- }
|
|
|
- //获取费用信息
|
|
|
- LambdaQueryWrapper<TradingBoxFees> tradingBoxFeesLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- tradingBoxFeesLambdaQueryWrapper.eq(TradingBoxFees::getIsDeleted, 0)
|
|
|
- .eq(TradingBoxFees::getTenantId, AuthUtil.getTenantId())
|
|
|
- .eq(TradingBoxFees::getPid, details.getId())
|
|
|
- .orderByDesc(TradingBoxFees::getCreateTime);
|
|
|
- List<TradingBoxFees> tradingBoxFeesList = tradingBoxFeesMapper.selectList(tradingBoxFeesLambdaQueryWrapper);
|
|
|
- for (TradingBoxFees tradingBoxFees : tradingBoxFeesList) {
|
|
|
- //品名
|
|
|
- FeesDesc feesDesc = feesDescList.stream().filter(e -> e.getId().equals(tradingBoxFees.getItemId())).findFirst().orElse(null);
|
|
|
- if (ObjectUtils.isNotNull(feesDesc)) {
|
|
|
- tradingBoxFees.setItemName(feesDesc.getCname());
|
|
|
- } else {
|
|
|
- R<FeesDesc> r = feesDescClient.detail(tradingBoxFees.getItemId());
|
|
|
- if (r.isSuccess() && ObjectUtils.isNotNull(r.getData())) {
|
|
|
- tradingBoxFees.setItemName(r.getData().getCname());
|
|
|
- }
|
|
|
- }
|
|
|
- CorpsDesc corpsDesc = corpsDescClient.getCorpId(tradingBoxFees.getCorpId());
|
|
|
- if (ObjectUtils.isNotNull(corpsDesc)) {
|
|
|
- tradingBoxFees.setCorpName(corpsDesc.getCname());
|
|
|
- }
|
|
|
- }
|
|
|
- details.setTradingBoxFeesList(tradingBoxFeesList);*/
|
|
|
details.setTradingBoxFeesList(new ArrayList<>());
|
|
|
- //获取附件信息
|
|
|
LambdaQueryWrapper<TradingBoxFiles> tradingBoxFilesLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
tradingBoxFilesLambdaQueryWrapper.eq(TradingBoxFiles::getIsDeleted, 0)
|
|
|
.eq(TradingBoxFiles::getTenantId, AuthUtil.getTenantId())
|
|
|
@@ -222,7 +177,12 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
baseMapper.updateById(tradingBox);
|
|
|
}
|
|
|
//明细数据
|
|
|
- List<TradingBoxItem> tradingBoxItemList = tradingBox.getTradingBoxItemsList();
|
|
|
+ LambdaQueryWrapper<TradingBoxItem> tradingBoxItemLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ tradingBoxItemLambdaQueryWrapper.eq(TradingBoxItem::getIsDeleted, 0)
|
|
|
+ .eq(TradingBoxItem::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(TradingBoxItem::getPid, tradingBox.getId())
|
|
|
+ .orderByDesc(TradingBoxItem::getCreateTime);
|
|
|
+ List<TradingBoxItem> tradingBoxItemList = tradingBoxItemService.list(tradingBoxItemLambdaQueryWrapper);
|
|
|
if (ObjectUtils.isNotNull(tradingBoxItemList) && tradingBoxItemList.size() > 0) {
|
|
|
tradingBox.setTotalAmount(tradingBoxItemList.stream().map(TradingBoxItem::getAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
//箱号拼接字符串
|
|
|
@@ -248,10 +208,6 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
if ("BUY".equals(tradingBox.getType())) {
|
|
|
tradingBoxItem.setBoxSource("购买");
|
|
|
tradingBoxItem.setStatus("待使用");
|
|
|
- /*if (archivesMapper.selectCount(new LambdaQueryWrapper<Archives>()
|
|
|
- .eq(Archives::getCode, tradingBoxItem.getCode())) > 0) {
|
|
|
- throw new RuntimeException("箱号:"+tradingBoxItem.getCode()+"已存在,操作失败!");
|
|
|
- }*/
|
|
|
} else {
|
|
|
if (tradingBoxItem.getBoxSource().equals("购买")) {
|
|
|
tradingBoxItem.setStatus("卖出");
|
|
|
@@ -259,50 +215,17 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
tradingBoxItem.setStatus("退租");
|
|
|
}
|
|
|
}
|
|
|
- if (tradingBoxItem.getId() == null) {
|
|
|
- tradingBoxItem.setCreateUser(AuthUtil.getUserId());
|
|
|
- tradingBoxItem.setCreateTime(new Date());
|
|
|
- tradingBoxItem.setCreateUserName(AuthUtil.getUserName());
|
|
|
- tradingBoxItem.setTenantId(AuthUtil.getTenantId());
|
|
|
- tradingBoxItem.setPid(tradingBox.getId());
|
|
|
- tradingBoxItem.setStackingStatus("未堆存");
|
|
|
- tradingBoxItemMapper.insert(tradingBoxItem);
|
|
|
- } else {
|
|
|
- tradingBoxItem.setUpdateUser(AuthUtil.getUserId());
|
|
|
- tradingBoxItem.setUpdateTime(new Date());
|
|
|
- tradingBoxItem.setUpdateUserName(AuthUtil.getUserName());
|
|
|
- tradingBoxItem.setPid(tradingBox.getId());
|
|
|
- tradingBoxItemMapper.updateById(tradingBoxItem);
|
|
|
- }
|
|
|
- //明细图片
|
|
|
- List<TradingBoxFiles> tradingBoxItemFilesList = tradingBoxItem.getTradingBoxFilesList();
|
|
|
- if (ObjectUtils.isNotNull(tradingBoxItemFilesList) && tradingBoxItemFilesList.size() > 0) {
|
|
|
- for (TradingBoxFiles tradingBoxFiles : tradingBoxItemFilesList) {
|
|
|
- if (tradingBoxFiles.getId() == null) {
|
|
|
- tradingBoxFiles.setCreateUser(AuthUtil.getUserId());
|
|
|
- tradingBoxFiles.setCreateTime(new Date());
|
|
|
- tradingBoxFiles.setTenantId(AuthUtil.getTenantId());
|
|
|
- tradingBoxFiles.setPid(tradingBoxItem.getId());
|
|
|
- tradingBoxFiles.setType("2");
|
|
|
- tradingBoxFiles.setFileName(tradingBoxFiles.getLabel());
|
|
|
- tradingBoxFiles.setUrl(tradingBoxFiles.getValue());
|
|
|
- tradingBoxFilesMapper.insert(tradingBoxFiles);
|
|
|
- } else {
|
|
|
- tradingBoxFiles.setUpdateUser(AuthUtil.getUserId());
|
|
|
- tradingBoxFiles.setUpdateTime(new Date());
|
|
|
- tradingBoxFiles.setPid(tradingBoxItem.getId());
|
|
|
- tradingBoxFiles.setType("2");
|
|
|
- tradingBoxFiles.setFileName(tradingBoxFiles.getLabel());
|
|
|
- tradingBoxFiles.setUrl(tradingBoxFiles.getValue());
|
|
|
- tradingBoxFilesMapper.updateById(tradingBoxFiles);
|
|
|
- }
|
|
|
- }
|
|
|
- tradingBoxItem.setTradingBoxFilesList(tradingBoxItemFilesList);
|
|
|
- }
|
|
|
+ tradingBoxItem.setCreateUser(AuthUtil.getUserId());
|
|
|
+ tradingBoxItem.setCreateTime(new Date());
|
|
|
+ tradingBoxItem.setCreateUserName(AuthUtil.getUserName());
|
|
|
+ tradingBoxItem.setTenantId(AuthUtil.getTenantId());
|
|
|
+ tradingBoxItem.setPid(tradingBox.getId());
|
|
|
+ tradingBoxItem.setStackingStatus("未堆存");
|
|
|
+ tradingBoxItemService.updateById(tradingBoxItem);
|
|
|
String updateChar = tradingBoxItem.getCode() + tradingBoxItem.getBoxType() + tradingBoxItem.getAddress() + tradingBoxItem.getNewDate() + tradingBoxItem.getStatus();
|
|
|
if (ObjectUtils.isNull(tradingBoxItem.getUpdateChar()) || !updateChar.equals(tradingBoxItem.getUpdateChar())) {
|
|
|
tradingBoxItem.setUpdateChar(updateChar);
|
|
|
- tradingBoxItemMapper.updateById(tradingBoxItem);
|
|
|
+ tradingBoxItemService.updateById(tradingBoxItem);
|
|
|
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()));
|
|
|
@@ -388,28 +311,26 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
}
|
|
|
baseMapper.updateById(tradingBox);
|
|
|
//费用明细
|
|
|
- List<TradingBoxFees> tradingBoxFeesList = tradingBox.getTradingBoxFeesList();
|
|
|
+ LambdaQueryWrapper<TradingBoxFees> tradingBoxFeesLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ tradingBoxFeesLambdaQueryWrapper.eq(TradingBoxFees::getIsDeleted, 0)
|
|
|
+ .eq(TradingBoxFees::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(TradingBoxFees::getPid, tradingBox.getId())
|
|
|
+ .orderByDesc(TradingBoxFees::getCreateTime);
|
|
|
+ List<TradingBoxFees> tradingBoxFeesList = tradingBoxFeesService.list(tradingBoxFeesLambdaQueryWrapper);
|
|
|
if (ObjectUtils.isNotNull(tradingBoxFeesList) && tradingBoxFeesList.size() > 0) {
|
|
|
for (TradingBoxFees tradingBoxFees : tradingBoxFeesList) {
|
|
|
- if (tradingBoxFees.getId() == null) {
|
|
|
- if ("BUY".equals(tradingBox.getType())) {
|
|
|
- tradingBoxFees.setBillType("买箱");
|
|
|
- } else {
|
|
|
- tradingBoxFees.setBillType("卖箱");
|
|
|
- }
|
|
|
- tradingBoxFees.setCreateUser(AuthUtil.getUserId());
|
|
|
- tradingBoxFees.setCreateTime(new Date());
|
|
|
- tradingBoxFees.setTenantId(AuthUtil.getTenantId());
|
|
|
- tradingBoxFees.setPid(tradingBox.getId());
|
|
|
- tradingBoxFeesMapper.insert(tradingBoxFees);
|
|
|
+ if ("BUY".equals(tradingBox.getType())) {
|
|
|
+ tradingBoxFees.setBillType("买箱");
|
|
|
} else {
|
|
|
- tradingBoxFees.setUpdateUser(AuthUtil.getUserId());
|
|
|
- tradingBoxFees.setUpdateTime(new Date());
|
|
|
- tradingBoxFees.setPid(tradingBox.getId());
|
|
|
- tradingBoxFeesMapper.updateById(tradingBoxFees);
|
|
|
+ tradingBoxFees.setBillType("卖箱");
|
|
|
}
|
|
|
+ tradingBoxFees.setCreateUser(AuthUtil.getUserId());
|
|
|
+ tradingBoxFees.setCreateTime(new Date());
|
|
|
+ tradingBoxFees.setTenantId(AuthUtil.getTenantId());
|
|
|
+ tradingBoxFees.setPid(tradingBox.getId());
|
|
|
}
|
|
|
tradingBox.setTradingBoxFeesList(tradingBoxFeesList);
|
|
|
+ tradingBoxFeesService.updateBatchById(tradingBoxFeesList);
|
|
|
}
|
|
|
//主表附件
|
|
|
List<TradingBoxFiles> tradingBoxFilesList = tradingBox.getTradingBoxFilesList();
|
|
|
@@ -513,7 +434,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
.eq(TradingBoxItem::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(TradingBoxItem::getPid, tradingBox.getId())
|
|
|
.eq(TradingBoxItem::getCode, tradingBoxItem.getCode());
|
|
|
- List<TradingBoxItem> tradingBoxItemList1 = tradingBoxItemMapper.selectList(tradingBoxItemLambdaQueryWrapper);
|
|
|
+ List<TradingBoxItem> tradingBoxItemList1 = tradingBoxItemService.list(tradingBoxItemLambdaQueryWrapper);
|
|
|
if (ObjectUtils.isNotNull(tradingBoxItemList1) && tradingBoxItemList1.size() > 0) {
|
|
|
throw new RuntimeException("箱号:" + tradingBoxItem.getCode() + "已存在,保存失败");
|
|
|
}
|
|
|
@@ -539,7 +460,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
tradingBoxItem.setCreateUserName(AuthUtil.getUserName());
|
|
|
tradingBoxItem.setTenantId(AuthUtil.getTenantId());
|
|
|
tradingBoxItem.setPid(tradingBox.getId());
|
|
|
- tradingBoxItemMapper.insert(tradingBoxItem);
|
|
|
+ tradingBoxItemService.save(tradingBoxItem);
|
|
|
} else {
|
|
|
if (tradingBox.getType().equals("ZR") && "录入".equals(tradingBoxItem.getStatus())) {
|
|
|
if (ObjectUtils.isNotNull(tradingBoxItem.getLeaseCommencementDate())) {
|
|
|
@@ -559,7 +480,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
tradingBoxItem.setUpdateTime(new Date());
|
|
|
tradingBoxItem.setUpdateUserName(AuthUtil.getUserName());
|
|
|
tradingBoxItem.setPid(tradingBox.getId());
|
|
|
- tradingBoxItemMapper.updateById(tradingBoxItem);
|
|
|
+ tradingBoxItemService.updateById(tradingBoxItem);
|
|
|
}
|
|
|
//明细图片
|
|
|
List<TradingBoxFiles> tradingBoxItemFilesList = tradingBoxItem.getTradingBoxFilesList();
|
|
|
@@ -589,7 +510,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
String updateChar = tradingBoxItem.getCode() + tradingBoxItem.getBoxType() + tradingBoxItem.getAddress() + tradingBoxItem.getNewDate() + tradingBoxItem.getStatus();
|
|
|
if (ObjectUtils.isNull(tradingBoxItem.getUpdateChar()) || !updateChar.equals(tradingBoxItem.getUpdateChar())) {
|
|
|
tradingBoxItem.setUpdateChar(updateChar);
|
|
|
- tradingBoxItemMapper.updateById(tradingBoxItem);
|
|
|
+ tradingBoxItemService.updateById(tradingBoxItem);
|
|
|
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()));
|
|
|
@@ -671,8 +592,8 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
}
|
|
|
}
|
|
|
tradingBox.setTradingBoxItemsList(tradingBoxItemList);
|
|
|
+ tradingBox.setBoxNumber(tradingBoxItemList.size());
|
|
|
}
|
|
|
- tradingBox.setBoxNumber(tradingBoxItemList.size());
|
|
|
baseMapper.updateById(tradingBox);
|
|
|
//费用明细
|
|
|
List<TradingBoxFees> tradingBoxFeesList = tradingBox.getTradingBoxFeesList();
|
|
|
@@ -688,15 +609,14 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
tradingBoxFees.setCreateTime(new Date());
|
|
|
tradingBoxFees.setTenantId(AuthUtil.getTenantId());
|
|
|
tradingBoxFees.setPid(tradingBox.getId());
|
|
|
- tradingBoxFeesMapper.insert(tradingBoxFees);
|
|
|
} else {
|
|
|
tradingBoxFees.setUpdateUser(AuthUtil.getUserId());
|
|
|
tradingBoxFees.setUpdateTime(new Date());
|
|
|
tradingBoxFees.setPid(tradingBox.getId());
|
|
|
- tradingBoxFeesMapper.updateById(tradingBoxFees);
|
|
|
}
|
|
|
}
|
|
|
tradingBox.setTradingBoxFeesList(tradingBoxFeesList);
|
|
|
+ tradingBoxFeesService.saveOrUpdateBatch(tradingBoxFeesList);
|
|
|
}
|
|
|
//主表附件
|
|
|
List<TradingBoxFiles> tradingBoxFilesList = tradingBox.getTradingBoxFilesList();
|
|
|
@@ -815,7 +735,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
tradingBoxItemLambdaQueryWrapper.eq(TradingBoxItem::getIsDeleted, 0)
|
|
|
.eq(TradingBoxItem::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(TradingBoxItem::getPid, selectTradingBox.getId());
|
|
|
- List<TradingBoxItem> tradingBoxItemList = tradingBoxItemMapper.selectList(tradingBoxItemLambdaQueryWrapper);
|
|
|
+ List<TradingBoxItem> tradingBoxItemList = tradingBoxItemService.list(tradingBoxItemLambdaQueryWrapper);
|
|
|
String code = "";
|
|
|
if (CollectionUtils.isNotEmpty(tradingBoxItemList)) {
|
|
|
//数量
|
|
|
@@ -836,7 +756,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
receivableLambdaQueryWrapper.eq(TradingBoxFees::getTenantId, AuthUtil.getTenantId());
|
|
|
receivableLambdaQueryWrapper.eq(TradingBoxFees::getPid, selectTradingBox.getId());
|
|
|
receivableLambdaQueryWrapper.eq(TradingBoxFees::getFeesType, 2);
|
|
|
- List<TradingBoxFees> receivableOrderFeesList = tradingBoxFeesMapper.selectList(receivableLambdaQueryWrapper);
|
|
|
+ List<TradingBoxFees> receivableOrderFeesList = tradingBoxFeesService.list(receivableLambdaQueryWrapper);
|
|
|
BigDecimal payAmount = new BigDecimal("0.00");
|
|
|
if (ObjectUtils.isNotNull(receivableOrderFeesList)) {
|
|
|
for (TradingBoxFees tradingBoxFees : receivableOrderFeesList) {
|
|
|
@@ -856,7 +776,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
payLambdaQueryWrapper.eq(TradingBoxFees::getTenantId, AuthUtil.getTenantId());
|
|
|
payLambdaQueryWrapper.eq(TradingBoxFees::getPid, selectTradingBox.getId());
|
|
|
payLambdaQueryWrapper.eq(TradingBoxFees::getFeesType, 1);
|
|
|
- List<TradingBoxFees> payOrderFeesList = tradingBoxFeesMapper.selectList(payLambdaQueryWrapper);
|
|
|
+ List<TradingBoxFees> payOrderFeesList = tradingBoxFeesService.list(payLambdaQueryWrapper);
|
|
|
BigDecimal receivableAmount = new BigDecimal("0.00");
|
|
|
if (ObjectUtils.isNotNull(payOrderFeesList)) {
|
|
|
for (TradingBoxFees tradingBoxFees : payOrderFeesList) {
|
|
|
@@ -978,10 +898,10 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
tradingBoxFeesLambdaQueryWrapper.eq(TradingBoxFees::getPid, selectTradingBox.getId());
|
|
|
tradingBoxFeesLambdaQueryWrapper.eq(TradingBoxFees::getTenantId, AuthUtil.getTenantId());
|
|
|
tradingBoxFeesLambdaQueryWrapper.eq(TradingBoxFees::getSubmitPay, 1);
|
|
|
- List<TradingBoxFees> tradingBoxFeesList = tradingBoxFeesMapper.selectList(tradingBoxFeesLambdaQueryWrapper);
|
|
|
+ List<TradingBoxFees> tradingBoxFeesList = tradingBoxFeesService.selectList(tradingBoxFeesLambdaQueryWrapper);
|
|
|
for (TradingBoxFees tradingBoxFees : tradingBoxFeesList) {
|
|
|
tradingBoxFees.setSubmitPay(0);
|
|
|
- tradingBoxFeesMapper.updateById(tradingBoxFees);
|
|
|
+ tradingBoxFeesService.updateById(tradingBoxFees);
|
|
|
}*/
|
|
|
iCheckClient.deteleByBillId(tradingBox.getId());
|
|
|
return selectTradingBox;
|
|
|
@@ -1062,7 +982,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
tradingBoxFees.setCreateTime(new Date());
|
|
|
tradingBoxFees.setTenantId(AuthUtil.getTenantId());
|
|
|
tradingBoxFees.setSubmitPay(0);
|
|
|
- tradingBoxFeesMapper.insert(tradingBoxFees);
|
|
|
+ tradingBoxFeesService.save(tradingBoxFees);
|
|
|
|
|
|
tradingBoxItem.setRentEndDate(calendar.getTime());
|
|
|
}
|
|
|
@@ -1211,7 +1131,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
tradingBoxFees.setCreateTime(new Date());
|
|
|
tradingBoxFees.setTenantId(AuthUtil.getTenantId());
|
|
|
tradingBoxFees.setSubmitPay(0);
|
|
|
- tradingBoxFeesMapper.insert(tradingBoxFees);
|
|
|
+ tradingBoxFeesService.save(tradingBoxFees);
|
|
|
tradingBoxFeesList.add(tradingBoxFees);
|
|
|
|
|
|
Items items = new Items();
|
|
|
@@ -1254,7 +1174,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
tradingBoxItem.setAddress(tradingBox.getAddress());
|
|
|
tradingBoxItem.setAddressId(tradingBox.getAddressId());
|
|
|
}
|
|
|
- tradingBoxItemMapper.updateById(tradingBoxItem);
|
|
|
+ tradingBoxItemService.updateById(tradingBoxItem);
|
|
|
//记录箱轨迹信息
|
|
|
archivesTrajectory.setCorpId(tradingBox.getPurchaseCompanyId());
|
|
|
archivesTrajectory.setCorpName(tradingBox.getPurchaseCompanyName());
|
|
|
@@ -1276,7 +1196,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
//给角色为财务的人发送消息
|
|
|
R<String> clientDeptIds = sysClient.getRoleIds(SecureUtil.getTenantId(), "财务");
|
|
|
if (clientDeptIds.isSuccess() && StringUtils.isNotBlank(clientDeptIds.getData())) {
|
|
|
- R<List<User>> userList = userClient.listUserByRoleId(Long.valueOf(clientDeptIds.getData()),null,null);
|
|
|
+ R<List<User>> userList = userClient.listUserByRoleId(Long.valueOf(clientDeptIds.getData()), null, null);
|
|
|
if (userList.isSuccess() && CollectionUtils.isNotEmpty(userList.getData())) {
|
|
|
for (User datum : userList.getData()) {
|
|
|
//循环发送消息
|
|
|
@@ -1364,7 +1284,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
tradingBoxFees.setCreateTime(new Date());
|
|
|
tradingBoxFees.setTenantId(AuthUtil.getTenantId());
|
|
|
tradingBoxFees.setSubmitPay(0);
|
|
|
- tradingBoxFeesMapper.insert(tradingBoxFees);
|
|
|
+ tradingBoxFeesService.save(tradingBoxFees);
|
|
|
tradingBoxFeesList.add(tradingBoxFees);
|
|
|
tradingBoxItem.setOverdueAmount(tradingBoxItem.getPrice().multiply(BigDecimal.valueOf(days)));
|
|
|
tradingBoxItem.setUpdateTime(new Date());
|
|
|
@@ -1373,7 +1293,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
tradingBoxItem.setRentEndDate(tradingBox.getRentCalculationDate());
|
|
|
tradingBoxItem.setRentStartDate(tradingBox.getRentStartDate());
|
|
|
tradingBoxItem.setCount(tradingBoxItem.getCount() + 1);
|
|
|
- tradingBoxItemMapper.updateById(tradingBoxItem);
|
|
|
+ tradingBoxItemService.updateById(tradingBoxItem);
|
|
|
|
|
|
/*Items items = new Items();
|
|
|
if (1 == tradingBoxFees.getFeesType()) {
|
|
|
@@ -1466,9 +1386,9 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
tradingBoxFeesLambdaQueryWrapper.eq(TradingBoxFees::getSubmitPay, 1);
|
|
|
tradingBoxFeesLambdaQueryWrapper.eq(TradingBoxFees::getCode, tradingBoxItem.getCode());
|
|
|
tradingBoxFeesLambdaQueryWrapper.orderByDesc(TradingBoxFees::getCreateTime);
|
|
|
- List<TradingBoxFees> tradingBoxFeesList = tradingBoxFeesMapper.selectList(tradingBoxFeesLambdaQueryWrapper);
|
|
|
+ List<TradingBoxFees> tradingBoxFeesList = tradingBoxFeesService.list(tradingBoxFeesLambdaQueryWrapper);
|
|
|
if (tradingBoxFeesList.size() > 1) {
|
|
|
- tradingBoxFeesMapper.deleteById(tradingBoxFeesList.get(0).getId());
|
|
|
+ tradingBoxFeesService.removeById(tradingBoxFeesList.get(0).getId());
|
|
|
//获取账单信息
|
|
|
Acc acc = new Acc();
|
|
|
acc.setSrcParentId(tradingBox.getId());
|
|
|
@@ -1505,7 +1425,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
tradingBoxItem.setRentEndDate(tradingBoxFeesList.get(0).getRentEndDate());
|
|
|
tradingBoxItem.setRentStartDate(tradingBoxFeesList.get(0).getRentStartDate());
|
|
|
}
|
|
|
- tradingBoxItemMapper.updateById(tradingBoxItem);
|
|
|
+ tradingBoxItemService.updateById(tradingBoxItem);
|
|
|
}
|
|
|
tradingBox.setTradingBoxItemsList(tradingBoxItemList);
|
|
|
return tradingBox;
|
|
|
@@ -1648,7 +1568,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
tradingBoxItemLambdaQueryWrapper.eq(TradingBoxItem::getIsDeleted, 0)
|
|
|
.eq(TradingBoxItem::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(TradingBoxItem::getPid, details.getId());
|
|
|
- List<TradingBoxItem> tradingBoxItemList = tradingBoxItemMapper.selectList(tradingBoxItemLambdaQueryWrapper);
|
|
|
+ List<TradingBoxItem> tradingBoxItemList = tradingBoxItemService.list(tradingBoxItemLambdaQueryWrapper);
|
|
|
for (TradingBoxItem tradingBoxItem : tradingBoxItemList) {
|
|
|
//获取费用信息
|
|
|
LambdaQueryWrapper<TradingBoxFees> tradingBoxFeesLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
@@ -1657,7 +1577,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
.eq(TradingBoxFees::getCode, tradingBoxItem.getCode())
|
|
|
.eq(ObjectUtils.isNotNull(feesId), TradingBoxFees::getItemId, feesId)
|
|
|
.eq(TradingBoxFees::getPid, details.getId());
|
|
|
- int count = tradingBoxFeesMapper.selectCount(tradingBoxFeesLambdaQueryWrapper);
|
|
|
+ int count = tradingBoxFeesService.count(tradingBoxFeesLambdaQueryWrapper);
|
|
|
tradingBoxItem.setCount(count);
|
|
|
tradingBoxItem.setId(null);
|
|
|
tradingBoxItem.setPid(null);
|
|
|
@@ -1687,7 +1607,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
tradingBoxFeesLambdaQueryWrapper.eq(TradingBoxFees::getIsDeleted, 0)
|
|
|
.eq(TradingBoxFees::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(TradingBoxFees::getPid, details.getId());
|
|
|
- List<TradingBoxFees> tradingBoxFeesList = tradingBoxFeesMapper.selectList(tradingBoxFeesLambdaQueryWrapper);
|
|
|
+ List<TradingBoxFees> tradingBoxFeesList = tradingBoxFeesService.list(tradingBoxFeesLambdaQueryWrapper);
|
|
|
for (TradingBoxFees tradingBoxFees : tradingBoxFeesList) {
|
|
|
R<FeesDesc> r = feesDescClient.detail(tradingBoxFees.getItemId());
|
|
|
if (r.isSuccess() && ObjectUtils.isNotNull(r.getData())) {
|
|
|
@@ -1737,9 +1657,9 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
tradingBoxFeesLambdaQueryWrapper.eq(TradingBoxFees::getSubmitPay, 1);
|
|
|
tradingBoxFeesLambdaQueryWrapper.eq(TradingBoxFees::getCode, tradingBoxItem.getCode());
|
|
|
tradingBoxFeesLambdaQueryWrapper.orderByDesc(TradingBoxFees::getRentEndDate);
|
|
|
- List<TradingBoxFees> tradingBoxFeesList = tradingBoxFeesMapper.selectList(tradingBoxFeesLambdaQueryWrapper);
|
|
|
+ List<TradingBoxFees> tradingBoxFeesList = tradingBoxFeesService.list(tradingBoxFeesLambdaQueryWrapper);
|
|
|
if (tradingBoxFeesList.size() > 0) {
|
|
|
- tradingBoxFeesMapper.deleteById(tradingBoxFeesList.get(0).getId());
|
|
|
+ tradingBoxFeesService.removeById(tradingBoxFeesList.get(0).getId());
|
|
|
//获取账单信息
|
|
|
Acc acc = new Acc();
|
|
|
acc.setSrcParentId(tradingBox.getId());
|
|
|
@@ -1773,7 +1693,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
tradingBoxItem.setRentEndDate(tradingBoxFeesList.get(0).getRentEndDate());
|
|
|
tradingBoxItem.setRentStartDate(tradingBoxFeesList.get(0).getRentStartDate());
|
|
|
tradingBoxItem.setRentingOutDate(null);
|
|
|
- tradingBoxItemMapper.updateById(tradingBoxItem);
|
|
|
+ tradingBoxItemService.updateById(tradingBoxItem);
|
|
|
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()));
|
|
|
@@ -1879,7 +1799,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
//给角色为财务的人发送消息
|
|
|
R<String> clientDeptIds = sysClient.getRoleIds(SecureUtil.getTenantId(), "财务");
|
|
|
if (clientDeptIds.isSuccess() && StringUtils.isNotBlank(clientDeptIds.getData())) {
|
|
|
- R<List<User>> userList = userClient.listUserByRoleId(Long.valueOf(clientDeptIds.getData()),null,null);
|
|
|
+ R<List<User>> userList = userClient.listUserByRoleId(Long.valueOf(clientDeptIds.getData()), null, null);
|
|
|
if (userList.isSuccess() && CollectionUtils.isNotEmpty(userList.getData())) {
|
|
|
for (User datum : userList.getData()) {
|
|
|
//循环发送消息
|
|
|
@@ -1977,7 +1897,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
//修改费用明细
|
|
|
tradingBoxFees.setSubmitPay(1);
|
|
|
tradingBoxFees.setExpenseGenerationTime(new Date());
|
|
|
- tradingBoxFeesMapper.updateById(tradingBoxFees);
|
|
|
+ tradingBoxFeesService.updateById(tradingBoxFees);
|
|
|
}
|
|
|
if (CollectionUtils.isNotEmpty(itemsList)) {
|
|
|
//生成账单
|
|
|
@@ -1988,7 +1908,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
//给角色为财务的人发送消息
|
|
|
R<String> clientDeptIds = sysClient.getRoleIds(SecureUtil.getTenantId(), "财务");
|
|
|
if (clientDeptIds.isSuccess() && StringUtils.isNotBlank(clientDeptIds.getData())) {
|
|
|
- R<List<User>> userList = userClient.listUserByRoleId(Long.valueOf(clientDeptIds.getData()),null,null);
|
|
|
+ R<List<User>> userList = userClient.listUserByRoleId(Long.valueOf(clientDeptIds.getData()), null, null);
|
|
|
if (userList.isSuccess() && CollectionUtils.isNotEmpty(userList.getData())) {
|
|
|
for (User datum : userList.getData()) {
|
|
|
//循环发送消息
|
|
|
@@ -2079,7 +1999,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
}
|
|
|
tradingBoxFees.setSubmitPay(0);
|
|
|
tradingBoxFees.setExpenseGenerationTime(null);
|
|
|
- tradingBoxFeesMapper.updateById(tradingBoxFees);
|
|
|
+ tradingBoxFeesService.updateById(tradingBoxFees);
|
|
|
}
|
|
|
} else {
|
|
|
throw new SecurityException("撤销失败,请选择费用明细");
|
|
|
@@ -2123,7 +2043,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
tradingBoxFeesLambdaQueryWrapper.eq(TradingBoxFees::getPid, pid);
|
|
|
tradingBoxFeesLambdaQueryWrapper.eq(TradingBoxFees::getTenantId, AuthUtil.getTenantId());
|
|
|
tradingBoxFeesLambdaQueryWrapper.eq(TradingBoxFees::getSubmitPay, 0);
|
|
|
- List<TradingBoxFees> tradingBoxFeesList = tradingBoxFeesMapper.selectList(tradingBoxFeesLambdaQueryWrapper);
|
|
|
+ List<TradingBoxFees> tradingBoxFeesList = tradingBoxFeesService.list(tradingBoxFeesLambdaQueryWrapper);
|
|
|
if (CollectionUtils.isNotEmpty(tradingBoxFeesList)) {
|
|
|
//账单明细
|
|
|
List<Items> itemsList = new ArrayList<>();
|
|
|
@@ -2175,7 +2095,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
//给角色为财务的人发送消息
|
|
|
R<String> clientDeptIds = sysClient.getRoleIds(SecureUtil.getTenantId(), "财务");
|
|
|
if (clientDeptIds.isSuccess() && StringUtils.isNotBlank(clientDeptIds.getData())) {
|
|
|
- R<List<User>> userList = userClient.listUserByRoleId(Long.valueOf(clientDeptIds.getData()),null,null);
|
|
|
+ R<List<User>> userList = userClient.listUserByRoleId(Long.valueOf(clientDeptIds.getData()), null, null);
|
|
|
if (userList.isSuccess() && CollectionUtils.isNotEmpty(userList.getData())) {
|
|
|
for (User datum : userList.getData()) {
|
|
|
//循环发送消息
|
|
|
@@ -2201,7 +2121,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
}
|
|
|
}
|
|
|
//修改费用明细
|
|
|
- tradingBoxFeesMapper.submitPay(tradingBox.getId());
|
|
|
+ tradingBoxFeesService.submitPay(tradingBox.getId());
|
|
|
}
|
|
|
}
|
|
|
}
|