|
|
@@ -21,7 +21,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
-import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springblade.client.entity.Message;
|
|
|
@@ -38,7 +37,6 @@ import org.springblade.los.basic.business.entity.BusinessType;
|
|
|
import org.springblade.los.basic.business.service.IBusinessTypeService;
|
|
|
import org.springblade.los.basic.corps.entity.BCorps;
|
|
|
import org.springblade.los.basic.corps.mapper.CorpsMapper;
|
|
|
-import org.springblade.los.basic.corps.service.IBCorpsService;
|
|
|
import org.springblade.los.basic.cur.entity.BCurExrate;
|
|
|
import org.springblade.los.basic.fees.entity.BFees;
|
|
|
import org.springblade.los.basic.fees.service.IBFeesService;
|
|
|
@@ -46,6 +44,10 @@ import org.springblade.los.basic.ports.entity.BPorts;
|
|
|
import org.springblade.los.basic.ports.service.IBPortsService;
|
|
|
import org.springblade.los.billno.entity.BusinessBillNo;
|
|
|
import org.springblade.los.billno.service.IBusinessBillNoService;
|
|
|
+import org.springblade.los.box.entity.RouteCost;
|
|
|
+import org.springblade.los.box.entity.RouteCostItem;
|
|
|
+import org.springblade.los.box.service.IRouteCostItemService;
|
|
|
+import org.springblade.los.box.service.IRouteCostService;
|
|
|
import org.springblade.los.business.amends.entity.Amends;
|
|
|
import org.springblade.los.business.amends.mapper.AmendsMapper;
|
|
|
import org.springblade.los.business.files.entity.FilesCenter;
|
|
|
@@ -88,10 +90,7 @@ import java.time.LocalDateTime;
|
|
|
import java.time.Year;
|
|
|
import java.time.ZoneId;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Objects;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
@@ -150,14 +149,16 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
|
|
|
private final IBFeesService bFeesService;
|
|
|
|
|
|
- private final IBCorpsService bCorpsService;
|
|
|
-
|
|
|
private final IBPortsService ibPortsService;
|
|
|
|
|
|
private final AmendsMapper amendsMapper;
|
|
|
|
|
|
private final IReceiptService receiptService;
|
|
|
|
|
|
+ private final IRouteCostService routeCostService;
|
|
|
+
|
|
|
+ private final IRouteCostItemService routeCostItemService;
|
|
|
+
|
|
|
private final IBillUtils billUtils;
|
|
|
|
|
|
@Override
|
|
|
@@ -167,7 +168,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public R submit(Bills billss) throws Exception {
|
|
|
+ public R<Bills> submit(Bills billss) throws Exception {
|
|
|
Object object = StringTools.handle(billss, "Bills");
|
|
|
Bills bills = JSONObject.parseObject(JSONObject.toJSONString(object), Bills.class);
|
|
|
String deptId;
|
|
|
@@ -240,16 +241,6 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
throw new RuntimeException("该客户为黑名单客户,保存失败");
|
|
|
}
|
|
|
}
|
|
|
- /*if (ObjectUtils.isNotNull(bills.getHscode())) {
|
|
|
- BCommodity commodity = commodityMapper.selectOne(new LambdaQueryWrapper<BCommodity>()
|
|
|
- .eq(BCommodity::getTenantId, AuthUtil.getTenantId())
|
|
|
- .eq(BCommodity::getIsDeleted, 0)
|
|
|
- .eq(BCommodity::getHsCode, bills.getHscode())
|
|
|
- .last("limit 1"));
|
|
|
- if ("D".equals(commodity.getCreditLevel())) {
|
|
|
- throw new RuntimeException("该商品为黑名单商品,保存失败");
|
|
|
- }
|
|
|
- }*/
|
|
|
if (bills.getId() == null) {
|
|
|
if (!"MH".equals(bills.getBillType())) {
|
|
|
if (ObjectUtils.isNotNull(bills.getMblno())) {
|
|
|
@@ -278,12 +269,12 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
businessBillNo.setCode(bills.getBillNoFormat());
|
|
|
businessBillNo.setBranchId(bills.getBranchId());
|
|
|
businessBillNo.setDate(bills.getBillDate());
|
|
|
- R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
|
|
|
+ R<String> clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
|
|
|
if (!clientBillNo.isSuccess()) {
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return R.fail(500, "生成订单编号失败");
|
|
|
}
|
|
|
- bills.setBillNo((String) clientBillNo.getData());
|
|
|
+ bills.setBillNo(clientBillNo.getData());
|
|
|
bills.setCreateTime(new Date());
|
|
|
bills.setCreateUser(AuthUtil.getUserId());
|
|
|
bills.setCreateUserName(AuthUtil.getUserName());
|
|
|
@@ -399,18 +390,25 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
item.setUpdateUserName(AuthUtil.getUserName());
|
|
|
}
|
|
|
item.setPid(bills.getId());
|
|
|
- if (item.getCntrTypeCode().equals("20GP")) {
|
|
|
- V20 += item.getQuantity();
|
|
|
- } else if (item.getCntrTypeCode().equals("20HC")) {
|
|
|
- V45 += item.getQuantity();
|
|
|
- } else if (item.getCntrTypeCode().equals("40FR")) {
|
|
|
- V48 += item.getQuantity();
|
|
|
- } else if (item.getCntrTypeCode().equals("40GP")) {
|
|
|
- V40 += item.getQuantity();
|
|
|
- } else if (item.getCntrTypeCode().equals("40HC")) {
|
|
|
- V40HC += item.getQuantity();
|
|
|
- } else {
|
|
|
- other += item.getQuantity();
|
|
|
+ switch (item.getCntrTypeCode()) {
|
|
|
+ case "20GP":
|
|
|
+ V20 += item.getQuantity();
|
|
|
+ break;
|
|
|
+ case "20HC":
|
|
|
+ V45 += item.getQuantity();
|
|
|
+ break;
|
|
|
+ case "40FR":
|
|
|
+ V48 += item.getQuantity();
|
|
|
+ break;
|
|
|
+ case "40GP":
|
|
|
+ V40 += item.getQuantity();
|
|
|
+ break;
|
|
|
+ case "40HC":
|
|
|
+ V40HC += item.getQuantity();
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ other += item.getQuantity();
|
|
|
+ break;
|
|
|
}
|
|
|
boxTypeSum.append(item.getCntrTypeCode()).append("*").append(item.getQuantity()).append(",");
|
|
|
if (ObjectUtils.isNotNull(item.getQuantity()) && ObjectUtils.isNotNull(item.getTeu())) {
|
|
|
@@ -1063,11 +1061,6 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
item.setCarrierCnName(bills.getCarrierCnName());
|
|
|
item.setCarrierEnName(bills.getCarrierEnName());
|
|
|
item.setCarrierArgreementNo(bills.getCarrierArgreementNo());
|
|
|
- /*item.setForeignAgencyId(bills.getForeignAgencyId());
|
|
|
- item.setForeignAgencyCode(bills.getForeignAgencyCode());
|
|
|
- item.setForeignAgencyCnName(bills.getForeignAgencyCnName());
|
|
|
- item.setForeignAgencyEnName(bills.getForeignAgencyEnName());
|
|
|
- item.setForeignAgencyDetails(bills.getForeignAgencyDetails());*/
|
|
|
item.setForeignCntyName(bills.getForeignCntyName());
|
|
|
item.setIssueAtId(bills.getIssueAtId());
|
|
|
item.setIssueAt(bills.getIssueAt());
|
|
|
@@ -1177,7 +1170,9 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
List<Containers> containersList = containersService.list(new LambdaQueryWrapper<Containers>()
|
|
|
.eq(Containers::getIsDeleted, 0)
|
|
|
.eq(Containers::getTenantId, AuthUtil.getTenantId())
|
|
|
- .eq(Containers::getPid, detail.getId()));
|
|
|
+ .eq(Containers::getPid, detail.getId())
|
|
|
+ .orderByAsc(Containers::getMblno)
|
|
|
+ .orderByAsc(Containers::getHblno));
|
|
|
List<ContainersBills> containersBillsList = new ArrayList<>();
|
|
|
List<ContainersCommodity> containersCommodityList = new ArrayList<>();
|
|
|
if (!containersList.isEmpty()) {
|
|
|
@@ -1289,7 +1284,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public R add(Bills billss) throws Exception {
|
|
|
+ public R<Bills> add(Bills billss) throws Exception {
|
|
|
Object object = StringTools.handle(billss, "Bills");
|
|
|
Bills bills = JSONObject.parseObject(JSONObject.toJSONString(object), Bills.class);
|
|
|
if (bills.getId() == null) {
|
|
|
@@ -1528,29 +1523,11 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
item.setUpdateUserName(AuthUtil.getUserName());
|
|
|
}
|
|
|
this.updateBatchById(billsList);
|
|
|
- /* BigDecimal amountDr = bills.getAmountDr();
|
|
|
- BigDecimal amountCr = bills.getAmountCr();
|
|
|
- BigDecimal amountProfit = bills.getAmountProfit();
|
|
|
- BigDecimal amountDrUsd = bills.getAmountDrUsd();
|
|
|
- BigDecimal amountCrUsd = bills.getAmountCrUsd();
|
|
|
- BigDecimal amountProfitUsd = bills.getAmountProfitUsd();
|
|
|
- BigDecimal amountDrLoc = bills.getAmountDrLoc();
|
|
|
- BigDecimal amountCrLoc = bills.getAmountCrLoc();
|
|
|
- BigDecimal amountProfitLoc = bills.getAmountProfitLoc();*/
|
|
|
BigDecimal grossWeight = bills.getGrossWeight();
|
|
|
BigDecimal quantity = bills.getQuantity();
|
|
|
BigDecimal measurement = bills.getMeasurement();
|
|
|
Integer teuTotal = bills.getTeuTotal();
|
|
|
if (!billsList.isEmpty()) {
|
|
|
- /*amountDr = amountDr.subtract(billsList.stream().map(Bills::getAmountDr).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
- amountCr = amountCr.subtract(billsList.stream().map(Bills::getAmountCr).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
- amountProfit = amountProfit.subtract(billsList.stream().map(Bills::getAmountProfit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
- amountDrUsd = amountDrUsd.subtract(billsList.stream().map(Bills::getAmountDrUsd).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
- amountCrUsd = amountCrUsd.subtract(billsList.stream().map(Bills::getAmountCrUsd).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
- amountProfitUsd = amountProfitUsd.subtract(billsList.stream().map(Bills::getAmountProfitUsd).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
- amountDrLoc = amountDrLoc.subtract(billsList.stream().map(Bills::getAmountDrLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
- amountCrLoc = amountCrLoc.subtract(billsList.stream().map(Bills::getAmountCrLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
- amountProfitLoc = amountProfitLoc.subtract(billsList.stream().map(Bills::getAmountProfitLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));*/
|
|
|
teuTotal = teuTotal - billsList.stream().map(Bills::getTeu).filter(Objects::nonNull).reduce(0, Integer::sum);
|
|
|
grossWeight = grossWeight.subtract(billsList.stream().map(Bills::getGrossWeight).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
quantity = quantity.subtract(billsList.stream().map(Bills::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
@@ -1584,15 +1561,6 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
}
|
|
|
}
|
|
|
bills.setTeuTotal(teuTotal);
|
|
|
- /*bills.setAmountDr(amountDr);
|
|
|
- bills.setAmountCr(amountCr);
|
|
|
- bills.setAmountProfit(amountProfit);
|
|
|
- bills.setAmountDrUsd(amountDrUsd);
|
|
|
- bills.setAmountCrUsd(amountCrUsd);
|
|
|
- bills.setAmountProfitUsd(amountProfitUsd);
|
|
|
- bills.setAmountDrLoc(amountDrLoc);
|
|
|
- bills.setAmountCrLoc(amountCrLoc);
|
|
|
- bills.setAmountProfitLoc(amountProfitLoc);*/
|
|
|
bills.setGrossWeight(grossWeight);
|
|
|
bills.setQuantity(quantity);
|
|
|
bills.setMeasurement(measurement);
|
|
|
@@ -1699,10 +1667,6 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
.eq(Bills::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(Bills::getIsDeleted, 0)
|
|
|
.in(Bills::getId, Func.toLongList(ids)));
|
|
|
- List<PreContainers> preContainersList = preContainersService.list(new LambdaQueryWrapper<PreContainers>()
|
|
|
- .eq(PreContainers::getIsDeleted, 0)
|
|
|
- .eq(PreContainers::getTenantId, AuthUtil.getTenantId())
|
|
|
- .in(PreContainers::getPid, Func.toLongList(ids)));
|
|
|
for (Bills item : billsList) {
|
|
|
if ("MH".equals(item.getBillType()) && ObjectUtils.isNotNull(item.getMasterBillNo())) {
|
|
|
throw new RuntimeException("单号:" + item.getBillNo() + "已添加主单,请先撤销在退舱");
|
|
|
@@ -1716,16 +1680,6 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
if (item.getBillStatus() == 3) {
|
|
|
throw new RuntimeException("单据已完成,退舱失败");
|
|
|
}
|
|
|
- /*if ("MH".equals(item.getBillType())) {
|
|
|
- List<PreContainers> preContainers = new ArrayList<>();
|
|
|
- if (!preContainersList.isEmpty()) {
|
|
|
- preContainers = preContainersList.stream().filter(e -> e.getPid().equals(item.getId()))
|
|
|
- .collect(Collectors.toList());
|
|
|
- }
|
|
|
- if (!preContainers.isEmpty()) {
|
|
|
- this.revokeSelectedContainerNumber(item, preContainers);
|
|
|
- }
|
|
|
- }*/
|
|
|
item.setBillStatus(1);
|
|
|
item.setBookingWithdrawTime(new Date());
|
|
|
}
|
|
|
@@ -2046,7 +2000,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
bills.setStatus(3);
|
|
|
bills.setBillStatus(2);
|
|
|
baseMapper.updateById(bills);
|
|
|
- List<FeeCenter> feeCenterList = new ArrayList<>();
|
|
|
+ List<FeeCenter> feeCenterList;
|
|
|
feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
|
|
|
.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(FeeCenter::getIsDeleted, 0)
|
|
|
@@ -2078,7 +2032,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
item.setApproveTime(new Date());
|
|
|
}
|
|
|
feeCenterService.saveOrUpdateBatch(feeCenterList);
|
|
|
- if (feeCenterList.size() != 0) {
|
|
|
+ if (!feeCenterList.isEmpty()) {
|
|
|
FinAccBills finAccBills = new FinAccBills();
|
|
|
finAccBills.setFeeCenterList(feeCenterList);
|
|
|
finAccBills.setBusinessTypeCode("HYZD");
|
|
|
@@ -2420,6 +2374,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public R revokeDisembarking(String ids) {
|
|
|
List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
|
|
|
.eq(Bills::getTenantId, AuthUtil.getTenantId())
|
|
|
@@ -2548,65 +2503,10 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
}
|
|
|
List<SeaReleaseBillItems> seaReleaseBillItemsList = new ArrayList<>();
|
|
|
for (Bills item : billsList) {
|
|
|
- SeaReleaseBillItems seaReleaseBillItems = new SeaReleaseBillItems();
|
|
|
- seaReleaseBillItems.setBillId(item.getId());
|
|
|
- seaReleaseBillItems.setBillNo(item.getBillNo());
|
|
|
- seaReleaseBillItems.setSeaType(item.getBusinessType());
|
|
|
- seaReleaseBillItems.setBillType(item.getBillType());
|
|
|
- seaReleaseBillItems.setMasterId(item.getMasterId());
|
|
|
- seaReleaseBillItems.setMasterBillNo(item.getMasterBillNo());
|
|
|
- seaReleaseBillItems.setBillDate(item.getBillDate());
|
|
|
- seaReleaseBillItems.setUserId(item.getCreateUser());
|
|
|
- seaReleaseBillItems.setUserName(item.getCreateUserName());
|
|
|
- seaReleaseBillItems.setDeptId(item.getCreateDept());
|
|
|
- seaReleaseBillItems.setDeptName(item.getCreateDeptName());
|
|
|
- seaReleaseBillItems.setOperatorId(item.getOperatorId());
|
|
|
- seaReleaseBillItems.setOperatorName(item.getOperatorName());
|
|
|
- seaReleaseBillItems.setSrcType(item.getSrcType());
|
|
|
- seaReleaseBillItems.setSrcId(item.getSrcId());
|
|
|
- seaReleaseBillItems.setSrcCnName(item.getSrcCnName());
|
|
|
- seaReleaseBillItems.setSrcEnName(item.getSrcEnName());
|
|
|
- seaReleaseBillItems.setCorpId(item.getCorpId());
|
|
|
- seaReleaseBillItems.setCorpCnName(item.getCorpCnName());
|
|
|
- seaReleaseBillItems.setCorpEnName(item.getCorpEnName());
|
|
|
- seaReleaseBillItems.setCorpTel(item.getCorpAttnTel());
|
|
|
- seaReleaseBillItems.setCorpEmail(item.getCorpAttnEmail());
|
|
|
- seaReleaseBillItems.setCorpAttnName(item.getCorpAttnName());
|
|
|
- seaReleaseBillItems.setCorpAttnTel(item.getCorpAttnTel());
|
|
|
- seaReleaseBillItems.setLineId(item.getLineId());
|
|
|
- seaReleaseBillItems.setLineCnName(item.getLineCnName());
|
|
|
- seaReleaseBillItems.setLineEnName(item.getLineEnName());
|
|
|
- seaReleaseBillItems.setCarrierId(item.getCarrierId());
|
|
|
- seaReleaseBillItems.setCarrierCnName(item.getCarrierCnName());
|
|
|
- seaReleaseBillItems.setCarrierEnName(item.getCarrierEnName());
|
|
|
- seaReleaseBillItems.setCarrierArgreementNo(item.getCarrierArgreementNo());
|
|
|
- seaReleaseBillItems.setBookingNo(item.getBookingNo());
|
|
|
- seaReleaseBillItems.setVesselId(item.getVesselId());
|
|
|
- seaReleaseBillItems.setVesselCnName(item.getVesselCnName());
|
|
|
- seaReleaseBillItems.setVesselEnName(item.getVesselEnName());
|
|
|
- seaReleaseBillItems.setVoyageNo(item.getVoyageNo());
|
|
|
- seaReleaseBillItems.setMblno(item.getMblno());
|
|
|
- seaReleaseBillItems.setHblno(item.getHblno());
|
|
|
- seaReleaseBillItems.setEtd(item.getEtd());
|
|
|
- seaReleaseBillItems.setEta(item.getEta());
|
|
|
- seaReleaseBillItems.setPolId(item.getPolId());
|
|
|
- seaReleaseBillItems.setPolCode(item.getPolCode());
|
|
|
- seaReleaseBillItems.setPolCnName(item.getPolCnName());
|
|
|
- seaReleaseBillItems.setPolEnName(item.getPolEnName());
|
|
|
- seaReleaseBillItems.setPolNamePrint(item.getPolNamePrint());
|
|
|
- seaReleaseBillItems.setPodId(item.getPodId());
|
|
|
- seaReleaseBillItems.setPodCode(item.getPodCode());
|
|
|
- seaReleaseBillItems.setPodCnName(item.getPodCnName());
|
|
|
- seaReleaseBillItems.setPodEnName(item.getPodEnName());
|
|
|
- seaReleaseBillItems.setPodNamePrint(item.getPodNamePrint());
|
|
|
- seaReleaseBillItems.setNumberOfObl(1);
|
|
|
- seaReleaseBillItems.setNumberOfCopy(1);
|
|
|
- seaReleaseBillItems.setIssueType(item.getIssueType());
|
|
|
- seaReleaseBillItems.setIssueDate(item.getIssueDate());
|
|
|
- seaReleaseBillItems.setIssueAt(item.getIssueAt());
|
|
|
- seaReleaseBillItems.setRemarks(item.getRemarks());
|
|
|
-// seaReleaseBillItems.setStlMode(item.getHpaymode());
|
|
|
- seaReleaseBillItemsList.add(seaReleaseBillItems);
|
|
|
+ SeaReleaseBillItems seaReleaseBillItems = billUtils.addSeaReleaseBillItems(item);
|
|
|
+ if (seaReleaseBillItems != null) {
|
|
|
+ seaReleaseBillItemsList.add(seaReleaseBillItems);
|
|
|
+ }
|
|
|
}
|
|
|
return seaReleaseBillItemsList;
|
|
|
}
|
|
|
@@ -2855,33 +2755,12 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
this.updateBatchById(billsList);
|
|
|
}
|
|
|
}
|
|
|
- LocalDateTime now = LocalDateTime.now();
|
|
|
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
- String formatted = now.format(formatter);
|
|
|
- //发送消息
|
|
|
if (ObjectUtils.isNotNull(bills.getShippingStaffId())) {
|
|
|
- R<User> userR = userClient.userInfoById(bills.getShippingStaffId());
|
|
|
- if (userR.isSuccess() && ObjectUtils.isNotNull(userR.getData())) {
|
|
|
- User datum = userR.getData();
|
|
|
- Message sendMessage = new Message();
|
|
|
- sendMessage.setParameter(detail.getId() + "");
|
|
|
- sendMessage.setUserName(AuthUtil.getUserName());
|
|
|
- sendMessage.setUserId(null);
|
|
|
- sendMessage.setToUserId(datum.getId());
|
|
|
- sendMessage.setToUserName(datum.getName());
|
|
|
- sendMessage.setMessageType(1);
|
|
|
- sendMessage.setTenantId(AuthUtil.getTenantId());
|
|
|
- sendMessage.setCreateUser(null);
|
|
|
- sendMessage.setCreateTime(new Date());
|
|
|
- sendMessage.setUrl("/iosBasicData/SeafreightExportF/bills/index");
|
|
|
- sendMessage.setPageLabel("海运出口");
|
|
|
- sendMessage.setPageStatus("this.$store.getters.domSaleStatus");
|
|
|
- sendMessage.setMessageBody("您有新的海运出口物流已提交,请及时待处理!提单号:" + detail.getMblno() + "时间:" + formatted);
|
|
|
- R save = messageClient.save(sendMessage);
|
|
|
- if (!save.isSuccess()) {
|
|
|
- throw new SecurityException("发送消息失败");
|
|
|
- }
|
|
|
- }
|
|
|
+ String url = "/iosBasicData/SeafreightExportF/bills/index";
|
|
|
+ String pageLabel = "海运出口";
|
|
|
+ String pageStatus = "this.$store.getters.domSaleStatus";
|
|
|
+ String messageBody = "您有新的海运出口物流已提交,请及时待处理!提单号:" + detail.getMblno();
|
|
|
+ billUtils.sendMessage(detail, url, pageLabel, pageStatus, messageBody, "1", bills.getShippingStaffId(), null);
|
|
|
}
|
|
|
return R.data(detail);
|
|
|
}
|
|
|
@@ -2896,33 +2775,13 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
if ("录入".equals(detail.getLogisticsStatus())) {
|
|
|
throw new RuntimeException("已撤销提交,请勿重复撤销");
|
|
|
}
|
|
|
- LocalDateTime now = LocalDateTime.now();
|
|
|
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
- String formatted = now.format(formatter);
|
|
|
//发送消息
|
|
|
if (ObjectUtils.isNotNull(detail.getShippingStaffId())) {
|
|
|
- R<User> userR = userClient.userInfoById(detail.getShippingStaffId());
|
|
|
- if (userR.isSuccess() && ObjectUtils.isNotNull(userR.getData())) {
|
|
|
- User datum = userR.getData();
|
|
|
- Message sendMessage = new Message();
|
|
|
- sendMessage.setParameter(detail.getId() + "");
|
|
|
- sendMessage.setUserName(AuthUtil.getUserName());
|
|
|
- sendMessage.setUserId(null);
|
|
|
- sendMessage.setToUserId(datum.getId());
|
|
|
- sendMessage.setToUserName(datum.getName());
|
|
|
- sendMessage.setMessageType(1);
|
|
|
- sendMessage.setTenantId(AuthUtil.getTenantId());
|
|
|
- sendMessage.setCreateUser(null);
|
|
|
- sendMessage.setCreateTime(new Date());
|
|
|
- sendMessage.setUrl("/iosBasicData/SeafreightExportF/bills/index");
|
|
|
- sendMessage.setPageLabel("海运出口");
|
|
|
- sendMessage.setPageStatus("this.$store.getters.domSaleStatus");
|
|
|
- sendMessage.setMessageBody("您的海运出口物流提交已撤销!时间:" + formatted);
|
|
|
- R save = messageClient.save(sendMessage);
|
|
|
- if (!save.isSuccess()) {
|
|
|
- throw new SecurityException("发送消息失败");
|
|
|
- }
|
|
|
- }
|
|
|
+ String url = "/iosBasicData/SeafreightExportF/bills/index";
|
|
|
+ String pageLabel = "海运出口";
|
|
|
+ String pageStatus = "this.$store.getters.domSaleStatus";
|
|
|
+ String messageBody = "您的海运出口物流提交已撤销,请及时待处理!提单号:" + detail.getMblno();
|
|
|
+ billUtils.sendMessage(detail, url, pageLabel, pageStatus, messageBody, "1", detail.getShippingStaffId(), null);
|
|
|
}
|
|
|
detail.setLogisticsStatus("录入");
|
|
|
detail.setUpdateUser(AuthUtil.getUserId());
|
|
|
@@ -3097,13 +2956,6 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
billsJk.setAmountProfitLoc(new BigDecimal("0.00"));
|
|
|
baseMapper.insert(billsJk);
|
|
|
Bills billsJkNew = this.addItemList(billsJk);
|
|
|
-
|
|
|
- /*BigDecimal amountCr = new BigDecimal("0.00");
|
|
|
- BigDecimal amountProfit;
|
|
|
- BigDecimal amountCrUsd = new BigDecimal("0.00");
|
|
|
- BigDecimal amountProfitUsd;
|
|
|
- BigDecimal amountCrLoc = new BigDecimal("0.00");
|
|
|
- BigDecimal amountProfitLoc;*/
|
|
|
//主单应加上分单费用
|
|
|
if ("MM".equals(billsJkNew.getBillType()) && ObjectUtils.isNotNull(billsJkNew.getId())) {
|
|
|
List<Bills> details = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
|
|
|
@@ -3124,7 +2976,6 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
item.setPodStaffName(bills.getPodStaffName());
|
|
|
}
|
|
|
this.updateBatchById(details);
|
|
|
- List<Bills> billsList = new ArrayList<>();
|
|
|
for (Bills item : details) {
|
|
|
item.setOperatorId(bills.getPodStaffId());
|
|
|
item.setOperatorName(bills.getPodStaffName());
|
|
|
@@ -3201,51 +3052,17 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
baseMapper.insert(item);
|
|
|
Bills itemNew = this.addItemList(item);
|
|
|
baseMapper.updateById(itemNew);
|
|
|
- billsList.add(itemNew);
|
|
|
}
|
|
|
- /*amountCr = amountCr.add(billsList.stream().map(Bills::getAmountCr).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
- amountCrUsd = amountCrUsd.add(billsList.stream().map(Bills::getAmountCrUsd).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
- amountCrLoc = amountCrLoc.add(billsList.stream().map(Bills::getAmountCrLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));*/
|
|
|
}
|
|
|
}
|
|
|
- //利润 = 收 - 付
|
|
|
- /*amountProfit = new BigDecimal("0.00").subtract(amountCr);
|
|
|
- amountProfitUsd = new BigDecimal("0.00").subtract(amountCrUsd);
|
|
|
- amountProfitLoc = new BigDecimal("0.00").subtract(amountCrLoc);
|
|
|
- billsJkNew.setAmountCr(billsJkNew.getAmountCr().add(amountCr));
|
|
|
- billsJkNew.setAmountProfit(billsJkNew.getAmountProfit().add(amountProfit));
|
|
|
- billsJkNew.setAmountCrUsd(billsJkNew.getAmountCrUsd().add(amountCrUsd));
|
|
|
- billsJkNew.setAmountProfitUsd(billsJkNew.getAmountProfitUsd().add(amountProfitUsd));
|
|
|
- billsJkNew.setAmountCrLoc(billsJkNew.getAmountCrLoc().add(amountCrLoc));
|
|
|
- billsJkNew.setAmountProfitLoc(billsJkNew.getAmountProfitLoc().add(amountProfitLoc));*/
|
|
|
this.updateById(billsJkNew);
|
|
|
- LocalDateTime now = LocalDateTime.now();
|
|
|
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
- String formatted = now.format(formatter);
|
|
|
//发送消息
|
|
|
if (ObjectUtils.isNotNull(bills.getPodStaffId())) {
|
|
|
- R<User> userR = userClient.userInfoById(bills.getPodStaffId());
|
|
|
- if (userR.isSuccess() && ObjectUtils.isNotNull(userR.getData())) {
|
|
|
- User datum = userR.getData();
|
|
|
- Message sendMessage = new Message();
|
|
|
- sendMessage.setParameter(billsJkNew.getId() + "");
|
|
|
- sendMessage.setUserName(AuthUtil.getUserName());
|
|
|
- sendMessage.setUserId(null);
|
|
|
- sendMessage.setToUserId(datum.getId());
|
|
|
- sendMessage.setToUserName(datum.getName());
|
|
|
- sendMessage.setMessageType(1);
|
|
|
- sendMessage.setTenantId(AuthUtil.getTenantId());
|
|
|
- sendMessage.setCreateUser(null);
|
|
|
- sendMessage.setCreateTime(new Date());
|
|
|
- sendMessage.setUrl("/iosBasicData/OceanFreightImport/bills/index");
|
|
|
- sendMessage.setPageLabel("海运进口");
|
|
|
- sendMessage.setPageStatus("this.$store.getters.domSaleStatus");
|
|
|
- sendMessage.setMessageBody("您有新的海运进口转单,请及时待处理!提单号:" + billsJkNew.getMblno() + "时间:" + formatted);
|
|
|
- R save = messageClient.save(sendMessage);
|
|
|
- if (!save.isSuccess()) {
|
|
|
- throw new SecurityException("发送消息失败");
|
|
|
- }
|
|
|
- }
|
|
|
+ String url = "/iosBasicData/OceanFreightImport/bills/index";
|
|
|
+ String pageLabel = "海运出口";
|
|
|
+ String pageStatus = "this.$store.getters.domSaleStatus";
|
|
|
+ String messageBody = "您有新的海运进口转单,请及时待处理!提单号:" + billsJkNew.getMblno();
|
|
|
+ billUtils.sendMessage(billsJkNew, url, pageLabel, pageStatus, messageBody, "1", bills.getPodStaffId(), null);
|
|
|
}
|
|
|
return R.data(billsJkNew);
|
|
|
}
|
|
|
@@ -3315,62 +3132,6 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
containersListNew.add(item);
|
|
|
}
|
|
|
containersService.saveBatch(containersListNew);
|
|
|
- /*List<ContainersCommodity> containersCommodityList = containersCommodityService.list(new LambdaQueryWrapper<ContainersCommodity>()
|
|
|
- .eq(ContainersCommodity::getTenantId, AuthUtil.getTenantId())
|
|
|
- .eq(ContainersCommodity::getIsDeleted, 0)
|
|
|
- .eq(ContainersCommodity::getPpId, billsJk.getSrcBusId()));
|
|
|
- if (!containersCommodityList.isEmpty()) {
|
|
|
- List<ContainersCommodity> containersCommodityListNew = new ArrayList<>();
|
|
|
- for (ContainersCommodity item : containersCommodityList) {
|
|
|
- Containers containers = containersList.stream().filter(e -> e.getSrcId().equals(item.getPid())).findFirst().orElse(null);
|
|
|
- if (containers != null) {
|
|
|
- item.setId(null);
|
|
|
- item.setCreateTime(new Date());
|
|
|
- item.setCreateUser(AuthUtil.getUserId());
|
|
|
- item.setCreateUserName(AuthUtil.getUserName());
|
|
|
- item.setBranchId(billsJk.getBranchId());
|
|
|
- item.setCreateDept(billsJk.getCreateDept());
|
|
|
- item.setCreateDeptName(billsJk.getCreateDeptName());
|
|
|
- item.setUpdateUser(null);
|
|
|
- item.setUpdateTime(null);
|
|
|
- item.setUpdateUserName(null);
|
|
|
- item.setPid(containers.getId());
|
|
|
- item.setPpId(billsJk.getId());
|
|
|
- } else {
|
|
|
- throw new RuntimeException("装箱明细数据错误,请联系管理员");
|
|
|
- }
|
|
|
- containersCommodityListNew.add(item);
|
|
|
- }
|
|
|
- containersCommodityService.saveBatch(containersCommodityListNew);
|
|
|
- }
|
|
|
- List<ContainersBills> containersBillsList = containersBillsService.list(new LambdaQueryWrapper<ContainersBills>()
|
|
|
- .eq(ContainersBills::getTenantId, AuthUtil.getTenantId())
|
|
|
- .eq(ContainersBills::getIsDeleted, 0)
|
|
|
- .eq(ContainersBills::getPpId, billsJk.getSrcBusId()));
|
|
|
- if (!containersBillsList.isEmpty()) {
|
|
|
- List<ContainersBills> containersBillsListNew = new ArrayList<>();
|
|
|
- for (ContainersBills item : containersBillsList) {
|
|
|
- Containers containers = containersList.stream().filter(e -> e.getSrcId().equals(item.getPid())).findFirst().orElse(null);
|
|
|
- if (containers != null) {
|
|
|
- item.setId(null);
|
|
|
- item.setCreateTime(new Date());
|
|
|
- item.setCreateUser(AuthUtil.getUserId());
|
|
|
- item.setCreateUserName(AuthUtil.getUserName());
|
|
|
- item.setBranchId(billsJk.getBranchId());
|
|
|
- item.setCreateDept(billsJk.getCreateDept());
|
|
|
- item.setCreateDeptName(billsJk.getCreateDeptName());
|
|
|
- item.setUpdateUser(null);
|
|
|
- item.setUpdateTime(null);
|
|
|
- item.setUpdateUserName(null);
|
|
|
- item.setPid(containers.getId());
|
|
|
- item.setPpId(billsJk.getId());
|
|
|
- } else {
|
|
|
- throw new RuntimeException("装箱明细数据错误,请联系管理员");
|
|
|
- }
|
|
|
- containersBillsListNew.add(item);
|
|
|
- }
|
|
|
- containersBillsService.saveBatch(containersBillsListNew);
|
|
|
- }*/
|
|
|
}
|
|
|
List<FilesCenter> filesList = filesCenterService.list(new LambdaQueryWrapper<FilesCenter>()
|
|
|
.eq(FilesCenter::getTenantId, AuthUtil.getTenantId())
|
|
|
@@ -3395,11 +3156,11 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
filesCenterService.saveBatch(filesListNew);
|
|
|
}
|
|
|
BigDecimal amountCr = new BigDecimal("0.00");
|
|
|
- BigDecimal amountProfit = new BigDecimal("0.00");
|
|
|
+ BigDecimal amountProfit;
|
|
|
BigDecimal amountCrUsd = new BigDecimal("0.00");
|
|
|
- BigDecimal amountProfitUsd = new BigDecimal("0.00");
|
|
|
+ BigDecimal amountProfitUsd;
|
|
|
BigDecimal amountCrLoc = new BigDecimal("0.00");
|
|
|
- BigDecimal amountProfitLoc = new BigDecimal("0.00");
|
|
|
+ BigDecimal amountProfitLoc;
|
|
|
//应收
|
|
|
int statusD = 0;
|
|
|
List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
|
|
|
@@ -3595,33 +3356,13 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
this.removeByIds(details.stream().map(Bills::getId).collect(Collectors.toList()));
|
|
|
}
|
|
|
}
|
|
|
- LocalDateTime now = LocalDateTime.now();
|
|
|
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
- String formatted = now.format(formatter);
|
|
|
//发送消息
|
|
|
if (ObjectUtils.isNotNull(detail.getPodStaffId())) {
|
|
|
- R<User> userR = userClient.userInfoById(bills.getPodStaffId());
|
|
|
- if (userR.isSuccess() && ObjectUtils.isNotNull(userR.getData())) {
|
|
|
- User datum = userR.getData();
|
|
|
- Message sendMessage = new Message();
|
|
|
- sendMessage.setParameter(detail.getId() + "");
|
|
|
- sendMessage.setUserName(AuthUtil.getUserName());
|
|
|
- sendMessage.setUserId(null);
|
|
|
- sendMessage.setToUserId(datum.getId());
|
|
|
- sendMessage.setToUserName(datum.getName());
|
|
|
- sendMessage.setMessageType(1);
|
|
|
- sendMessage.setTenantId(AuthUtil.getTenantId());
|
|
|
- sendMessage.setCreateUser(null);
|
|
|
- sendMessage.setCreateTime(new Date());
|
|
|
- sendMessage.setUrl("/iosBasicData/OceanFreightImport/bills/index");
|
|
|
- sendMessage.setPageLabel("海运进口");
|
|
|
- sendMessage.setPageStatus("this.$store.getters.domSaleStatus");
|
|
|
- sendMessage.setMessageBody("您有新的海运进口转单已撤销!时间:" + formatted);
|
|
|
- R save = messageClient.save(sendMessage);
|
|
|
- if (!save.isSuccess()) {
|
|
|
- throw new SecurityException("发送消息失败");
|
|
|
- }
|
|
|
- }
|
|
|
+ String url = "/iosBasicData/OceanFreightImport/bills/index";
|
|
|
+ String pageLabel = "海运出口";
|
|
|
+ String pageStatus = "this.$store.getters.domSaleStatus";
|
|
|
+ String messageBody = "您有新的海运进口转单已撤销!";
|
|
|
+ billUtils.sendMessage(detail, url, pageLabel, pageStatus, messageBody, "1", detail.getPodStaffId(), null);
|
|
|
}
|
|
|
return R.data(billsJk);
|
|
|
}
|
|
|
@@ -4500,7 +4241,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
detail.setIssueStatus("1");
|
|
|
baseMapper.updateById(detail);
|
|
|
boolean type = false;
|
|
|
- String billType = "";
|
|
|
+ String billType;
|
|
|
if ("YDC".equals(detail.getBusinessType())) {
|
|
|
billType = "MM";
|
|
|
} else if ("KHTS".equals(detail.getBusinessType())) {
|
|
|
@@ -4860,12 +4601,6 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
if (!Objects.equals(dataSourceBill.getVersion(), bills.getVersion())) {
|
|
|
return R.fail(601, "数据已被其他用户更新,请等待刷新后重试");
|
|
|
}
|
|
|
- /*if ("1".equals(dataSourceBill.getIssueStatus())) {
|
|
|
- throw new RuntimeException("单据已生成订单");
|
|
|
- }
|
|
|
- if (0 != dataSourceBill.getStatus()) {
|
|
|
- throw new RuntimeException("单据状态不是录入,保存失败");
|
|
|
- }*/
|
|
|
// 每更新一次往上累加一次版本
|
|
|
// 旧数据处理
|
|
|
int version = StringUtil.isBlank(dataSourceBill.getVersion()) ? 1 : Integer.parseInt(dataSourceBill.getVersion());
|
|
|
@@ -4903,18 +4638,25 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
item.setUpdateUserName(AuthUtil.getUserName());
|
|
|
}
|
|
|
item.setPid(bills.getId());
|
|
|
- if (item.getCntrTypeCode().equals("20GP")) {
|
|
|
- V20 += item.getQuantity();
|
|
|
- } else if (item.getCntrTypeCode().equals("20HC")) {
|
|
|
- V45 += item.getQuantity();
|
|
|
- } else if (item.getCntrTypeCode().equals("40FR")) {
|
|
|
- V48 += item.getQuantity();
|
|
|
- } else if (item.getCntrTypeCode().equals("40GP")) {
|
|
|
- V40 += item.getQuantity();
|
|
|
- } else if (item.getCntrTypeCode().equals("40HC")) {
|
|
|
- V40HC += item.getQuantity();
|
|
|
- } else {
|
|
|
- other += item.getQuantity();
|
|
|
+ switch (item.getCntrTypeCode()) {
|
|
|
+ case "20GP":
|
|
|
+ V20 += item.getQuantity();
|
|
|
+ break;
|
|
|
+ case "20HC":
|
|
|
+ V45 += item.getQuantity();
|
|
|
+ break;
|
|
|
+ case "40FR":
|
|
|
+ V48 += item.getQuantity();
|
|
|
+ break;
|
|
|
+ case "40GP":
|
|
|
+ V40 += item.getQuantity();
|
|
|
+ break;
|
|
|
+ case "40HC":
|
|
|
+ V40HC += item.getQuantity();
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ other += item.getQuantity();
|
|
|
+ break;
|
|
|
}
|
|
|
boxTypeSum.append(item.getCntrTypeCode()).append("*").append(item.getQuantity()).append(",");
|
|
|
if (ObjectUtils.isNotNull(item.getQuantity()) && ObjectUtils.isNotNull(item.getTeu())) {
|
|
|
@@ -5573,18 +5315,25 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
item.setUpdateUserName(AuthUtil.getUserName());
|
|
|
}
|
|
|
item.setPid(bills.getId());
|
|
|
- if (item.getCntrTypeCode().equals("20GP")) {
|
|
|
- V20 += item.getQuantity();
|
|
|
- } else if (item.getCntrTypeCode().equals("20HC")) {
|
|
|
- V45 += item.getQuantity();
|
|
|
- } else if (item.getCntrTypeCode().equals("40FR")) {
|
|
|
- V48 += item.getQuantity();
|
|
|
- } else if (item.getCntrTypeCode().equals("40GP")) {
|
|
|
- V40 += item.getQuantity();
|
|
|
- } else if (item.getCntrTypeCode().equals("40HC")) {
|
|
|
- V40HC += item.getQuantity();
|
|
|
- } else {
|
|
|
- other += item.getQuantity();
|
|
|
+ switch (item.getCntrTypeCode()) {
|
|
|
+ case "20GP":
|
|
|
+ V20 += item.getQuantity();
|
|
|
+ break;
|
|
|
+ case "20HC":
|
|
|
+ V45 += item.getQuantity();
|
|
|
+ break;
|
|
|
+ case "40FR":
|
|
|
+ V48 += item.getQuantity();
|
|
|
+ break;
|
|
|
+ case "40GP":
|
|
|
+ V40 += item.getQuantity();
|
|
|
+ break;
|
|
|
+ case "40HC":
|
|
|
+ V40HC += item.getQuantity();
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ other += item.getQuantity();
|
|
|
+ break;
|
|
|
}
|
|
|
boxTypeSum.append(item.getCntrTypeCode()).append("*").append(item.getQuantity()).append(",");
|
|
|
if (ObjectUtils.isNotNull(item.getQuantity()) && ObjectUtils.isNotNull(item.getTeu())) {
|
|
|
@@ -5957,9 +5706,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
item.setUpdateTime(null);
|
|
|
preContainers.add(item);
|
|
|
}
|
|
|
- if (!preContainers.isEmpty()) {
|
|
|
- preContainersService.saveBatch(preContainers);
|
|
|
- }
|
|
|
+ preContainersService.saveBatch(preContainers);
|
|
|
return R.data(bills);
|
|
|
}
|
|
|
|
|
|
@@ -6183,48 +5930,12 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
if ("已换单".equals(bills.getChangeOrderStatus())) {
|
|
|
throw new RuntimeException("已换单,请勿重复申请");
|
|
|
}
|
|
|
- List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
|
|
|
- .eq(FeeCenter::getPid, id)
|
|
|
- .eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
|
|
|
- .eq(FeeCenter::getIsDeleted, 0)
|
|
|
- .eq(FeeCenter::getDc, "D"));
|
|
|
- if (!feeCenterList.isEmpty()) {
|
|
|
- BigDecimal amount = feeCenterList.stream().map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
- BigDecimal amountStl = feeCenterList.stream().map(FeeCenter::getStlTtlAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
- /*if (amount.compareTo(amountStl) != 0) {
|
|
|
- throw new RuntimeException("应收金额:" + amount + "实收金额:" + amountStl + "不等,申请失败");
|
|
|
- }*/
|
|
|
- }
|
|
|
- LocalDateTime now = LocalDateTime.now();
|
|
|
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
- String formatted = now.format(formatter);
|
|
|
//发送消息
|
|
|
- R<String> clientDeptIds = sysClient.getRoleIds(AuthUtil.getTenantId(), "前台");
|
|
|
- if (clientDeptIds.isSuccess() && StringUtils.isNotBlank(clientDeptIds.getData())) {
|
|
|
- R<List<User>> userList = userClient.listUserByRoleId(clientDeptIds.getData(), AuthUtil.getTenantId(), bills.getBranchId());
|
|
|
- if (userList.isSuccess() && CollectionUtils.isNotEmpty(userList.getData())) {
|
|
|
- for (User datum : userList.getData()) {
|
|
|
- //循环发送消息
|
|
|
- Message sendMessage = new Message();
|
|
|
- sendMessage.setParameter(bills.getId() + "");
|
|
|
- sendMessage.setUserName(AuthUtil.getUserName());
|
|
|
- sendMessage.setUserId(null);
|
|
|
- sendMessage.setToUserId(datum.getId());
|
|
|
- sendMessage.setToUserName(datum.getName());
|
|
|
- sendMessage.setMessageType(1);
|
|
|
- sendMessage.setTenantId(AuthUtil.getTenantId());
|
|
|
- sendMessage.setCreateUser(null);
|
|
|
- sendMessage.setCreateTime(new Date());
|
|
|
- sendMessage.setUrl("/iosBasicData/ImportExchange/index");
|
|
|
- sendMessage.setPageLabel("进口换单");
|
|
|
- sendMessage.setMessageBody("分单号:" + bills.getHblno() + "已申请换单,请及时处理!" + "时间:" + formatted);
|
|
|
- R save = messageClient.save(sendMessage);
|
|
|
- if (!save.isSuccess()) {
|
|
|
- throw new SecurityException("发送消息失败");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ String url = "/iosBasicData/ImportExchange/index";
|
|
|
+ String pageLabel = "进口换单";
|
|
|
+ String pageStatus = "this.$store.getters.domSaleStatus";
|
|
|
+ String messageBody = "分单号:" + bills.getHblno() + "已申请换单,请及时处理!";
|
|
|
+ billUtils.sendMessage(bills, url, pageLabel, pageStatus, messageBody, "2", bills.getOperatorId(), "前台");
|
|
|
bills.setChangeOrderStatus("申请");
|
|
|
bills.setBoxPackingAmount(boxPackingAmount);
|
|
|
bills.setUpdateTime(new Date());
|
|
|
@@ -6289,32 +6000,13 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
if ("已换单".equals(bills.getChangeOrderStatus())) {
|
|
|
throw new RuntimeException("已换单,请勿重复确认");
|
|
|
}
|
|
|
- LocalDateTime now = LocalDateTime.now();
|
|
|
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
- String formatted = now.format(formatter);
|
|
|
//发送消息
|
|
|
if (ObjectUtils.isNotNull(bills.getOperatorId())) {
|
|
|
- R<User> userR = userClient.userInfoById(bills.getOperatorId());
|
|
|
- if (userR.isSuccess() && ObjectUtils.isNotNull(userR.getData())) {
|
|
|
- User datum = userR.getData();
|
|
|
- Message sendMessage = new Message();
|
|
|
- sendMessage.setParameter(bills.getId() + "");
|
|
|
- sendMessage.setUserName(AuthUtil.getUserName());
|
|
|
- sendMessage.setUserId(null);
|
|
|
- sendMessage.setToUserId(datum.getId());
|
|
|
- sendMessage.setToUserName(datum.getName());
|
|
|
- sendMessage.setMessageType(1);
|
|
|
- sendMessage.setTenantId(AuthUtil.getTenantId());
|
|
|
- sendMessage.setCreateUser(null);
|
|
|
- sendMessage.setCreateTime(new Date());
|
|
|
- sendMessage.setUrl("/iosBasicData/OceanFreightImport/bills/index");
|
|
|
- sendMessage.setPageLabel("海运进口");
|
|
|
- sendMessage.setMessageBody("您的海运进口已换单,请及时待处理!分单号:" + bills.getHblno() + "时间:" + formatted);
|
|
|
- R save = messageClient.save(sendMessage);
|
|
|
- if (!save.isSuccess()) {
|
|
|
- throw new SecurityException("发送消息失败");
|
|
|
- }
|
|
|
- }
|
|
|
+ String url = "/iosBasicData/OceanFreightImport/bills/index";
|
|
|
+ String pageLabel = "海运出口";
|
|
|
+ String pageStatus = "this.$store.getters.domSaleStatus";
|
|
|
+ String messageBody = "您的海运进口已换单,请及时待处理!分单号:" + bills.getHblno();
|
|
|
+ billUtils.sendMessage(bills, url, pageLabel, pageStatus, messageBody, "1", bills.getOperatorId(), null);
|
|
|
}
|
|
|
bills.setChangeOrderStatus("已换单");
|
|
|
bills.setUpdateTime(new Date());
|
|
|
@@ -6325,6 +6017,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public R confirmEquipmentList(String ids) {
|
|
|
if (ObjectUtils.isNull(ids)) {
|
|
|
throw new RuntimeException("缺少必要参数");
|
|
|
@@ -6350,6 +6043,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public R confirmPaymentCollection(Bills bills) {
|
|
|
if (bills.getIds() == null) {
|
|
|
throw new RuntimeException("缺少必要参数");
|
|
|
@@ -6361,9 +6055,6 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
if (billsList.isEmpty()) {
|
|
|
throw new RuntimeException("未查到单据信息");
|
|
|
}
|
|
|
- LocalDateTime now = LocalDateTime.now();
|
|
|
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
- String formatted = now.format(formatter);
|
|
|
Receipt receipt = new Receipt();
|
|
|
receipt.setCreateTime(new Date());
|
|
|
receipt.setCreateUserName(AuthUtil.getUserName());
|
|
|
@@ -6433,30 +6124,14 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
throw new SecurityException("生成码失败");
|
|
|
}
|
|
|
receiptService.save(receipt);
|
|
|
+ String url = "/iosBasicData/OceanFreightImport/bills/index";
|
|
|
+ String pageLabel = "海运出口";
|
|
|
+ String pageStatus = "this.$store.getters.domSaleStatus";
|
|
|
+ String messageBody = "您的海运进口换单押箱款已收款,请及时待处理!分单号:" + bills.getHblno();
|
|
|
for (Bills detail : billsList) {
|
|
|
//发送消息
|
|
|
if (ObjectUtils.isNotNull(bills.getOperatorId())) {
|
|
|
- R<User> userR = userClient.userInfoById(bills.getOperatorId());
|
|
|
- if (userR.isSuccess() && ObjectUtils.isNotNull(userR.getData())) {
|
|
|
- User datum = userR.getData();
|
|
|
- Message sendMessage = new Message();
|
|
|
- sendMessage.setParameter(bills.getId() + "");
|
|
|
- sendMessage.setUserName(AuthUtil.getUserName());
|
|
|
- sendMessage.setUserId(null);
|
|
|
- sendMessage.setToUserId(datum.getId());
|
|
|
- sendMessage.setToUserName(datum.getName());
|
|
|
- sendMessage.setMessageType(1);
|
|
|
- sendMessage.setTenantId(AuthUtil.getTenantId());
|
|
|
- sendMessage.setCreateUser(null);
|
|
|
- sendMessage.setCreateTime(new Date());
|
|
|
- sendMessage.setUrl("/iosBasicData/OceanFreightImport/bills/index");
|
|
|
- sendMessage.setPageLabel("海运进口");
|
|
|
- sendMessage.setMessageBody("您的海运进口换单押箱款已收款,请及时待处理!分单号:" + bills.getHblno() + "时间:" + formatted);
|
|
|
- R save = messageClient.save(sendMessage);
|
|
|
- if (!save.isSuccess()) {
|
|
|
- throw new SecurityException("发送消息失败");
|
|
|
- }
|
|
|
- }
|
|
|
+ billUtils.sendMessage(bills, url, pageLabel, pageStatus, messageBody, "1", bills.getOperatorId(), null);
|
|
|
}
|
|
|
detail.setHarvestBoxPackingDate(bills.getHarvestBoxPackingDate());
|
|
|
detail.setUpdateTime(new Date());
|
|
|
@@ -6477,32 +6152,13 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
if (detail == null) {
|
|
|
throw new RuntimeException("未查到单据信息");
|
|
|
}
|
|
|
- LocalDateTime now = LocalDateTime.now();
|
|
|
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
- String formatted = now.format(formatter);
|
|
|
//发送消息
|
|
|
if (ObjectUtils.isNotNull(bills.getOperatorId())) {
|
|
|
- R<User> userR = userClient.userInfoById(bills.getOperatorId());
|
|
|
- if (userR.isSuccess() && ObjectUtils.isNotNull(userR.getData())) {
|
|
|
- User datum = userR.getData();
|
|
|
- Message sendMessage = new Message();
|
|
|
- sendMessage.setParameter(bills.getId() + "");
|
|
|
- sendMessage.setUserName(AuthUtil.getUserName());
|
|
|
- sendMessage.setUserId(null);
|
|
|
- sendMessage.setToUserId(datum.getId());
|
|
|
- sendMessage.setToUserName(datum.getName());
|
|
|
- sendMessage.setMessageType(1);
|
|
|
- sendMessage.setTenantId(AuthUtil.getTenantId());
|
|
|
- sendMessage.setCreateUser(null);
|
|
|
- sendMessage.setCreateTime(new Date());
|
|
|
- sendMessage.setUrl("/iosBasicData/OceanFreightImport/bills/index");
|
|
|
- sendMessage.setPageLabel("海运进口");
|
|
|
- sendMessage.setMessageBody("您的海运进口换单押箱款已退款,请及时待处理!分单号:" + bills.getHblno() + "时间:" + formatted);
|
|
|
- R save = messageClient.save(sendMessage);
|
|
|
- if (!save.isSuccess()) {
|
|
|
- throw new SecurityException("发送消息失败");
|
|
|
- }
|
|
|
- }
|
|
|
+ String url = "/iosBasicData/OceanFreightImport/bills/index";
|
|
|
+ String pageLabel = "海运进口";
|
|
|
+ String pageStatus = "this.$store.getters.domSaleStatus";
|
|
|
+ String messageBody = "您的海运进口换单押箱款已退款,请及时待处理!分单号:" + bills.getHblno();
|
|
|
+ billUtils.sendMessage(bills, url, pageLabel, pageStatus, messageBody, "1", bills.getOperatorId(), null);
|
|
|
}
|
|
|
detail.setRetreatBoxPackingDate(bills.getRetreatBoxPackingDate());
|
|
|
detail.setUpdateTime(new Date());
|
|
|
@@ -6581,30 +6237,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
if (detail == null) {
|
|
|
throw new SecurityException("未查到单据信息");
|
|
|
}
|
|
|
- /*List<PreContainers> preContainersList = preContainersService.list(new LambdaQueryWrapper<PreContainers>()
|
|
|
- .eq(PreContainers::getTenantId, AuthUtil.getTenantId())
|
|
|
- .eq(PreContainers::getIsDeleted, 0)
|
|
|
- .eq(PreContainers::getPid, detail.getId()));
|
|
|
- StringBuilder texts = new StringBuilder();
|
|
|
- for (PreContainers containers : preContainersList) {
|
|
|
- if (ObjectUtils.isNull(containers.getSrcCostNo())) {
|
|
|
- texts.append(containers.getCntrTypeCode()).append("未提取到成本价,请先提取成本!");
|
|
|
- }
|
|
|
- }
|
|
|
- if (ObjectUtils.isNotNull(texts.toString())) {
|
|
|
- return R.success(texts.toString());
|
|
|
- }*/
|
|
|
- StringBuilder text = new StringBuilder();
|
|
|
- /*for (PreContainers containers : preContainersList) {
|
|
|
- if (containers.getSalesPrice().compareTo(containers.getCostPrice()) > 0) {
|
|
|
- text.append(containers.getCntrTypeCode()).append("销售价大于成本中心销售价,是否继续!");
|
|
|
- }
|
|
|
- }*/
|
|
|
- if (ObjectUtils.isNotNull(text.toString())) {
|
|
|
- return R.success(text.toString());
|
|
|
- } else {
|
|
|
- return R.success("操作成功");
|
|
|
- }
|
|
|
+ return R.success("操作成功");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -6612,97 +6245,92 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
if (ObjectUtils.isNull(ids)) {
|
|
|
throw new RuntimeException("缺少必要参数,发送失败!");
|
|
|
}
|
|
|
- List<Long> idList = Func.toLongList(ids);
|
|
|
- List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
|
|
|
- .eq(Bills::getIsDeleted, 0)
|
|
|
- .in(Bills::getId, idList));
|
|
|
- if (billsList.isEmpty()) {
|
|
|
+ Bills bills = baseMapper.selectById(ids);
|
|
|
+ if (bills == null) {
|
|
|
throw new RuntimeException("未查到海运出口单据,发送失败!");
|
|
|
}
|
|
|
- List<PreContainers> preContainersList = preContainersService.list(new LambdaQueryWrapper<PreContainers>()
|
|
|
- .eq(PreContainers::getIsDeleted, 0)
|
|
|
- .in(PreContainers::getPid, idList));
|
|
|
- if (preContainersList.isEmpty()) {
|
|
|
- throw new RuntimeException("未查到预配箱型信息,发送失败!");
|
|
|
- }
|
|
|
- List<SeaContainerNumberItem> containerNumberItemList = seaContainerNumberItemService.list(new LambdaQueryWrapper<SeaContainerNumberItem>()
|
|
|
- .eq(SeaContainerNumberItem::getIsDeleted, 0)
|
|
|
- .in(SeaContainerNumberItem::getPid, idList)
|
|
|
- .in(SeaContainerNumberItem::getBoxType, preContainersList.stream().map(PreContainers::getCntrTypeCode)
|
|
|
- .distinct().collect(Collectors.toList())));
|
|
|
- if (containerNumberItemList.isEmpty()) {
|
|
|
- throw new RuntimeException("未选择放箱号,发送失败!");
|
|
|
- }
|
|
|
- List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
|
|
|
- .eq(FeeCenter::getIsDeleted, 0)
|
|
|
- .eq(FeeCenter::getDc, "D")
|
|
|
- .eq(FeeCenter::getFeeCode, "HYF")
|
|
|
- .in(FeeCenter::getPid, idList));
|
|
|
- if (feeCenterList.isEmpty()) {
|
|
|
- throw new RuntimeException("未查到应收海运费,发送失败!");
|
|
|
- }
|
|
|
- String boxBusinessConnectionTime = sysClient.getParamService("box.business.connection.time");
|
|
|
- Date date = null;
|
|
|
- DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- if (ObjectUtils.isNotNull(boxBusinessConnectionTime)) {
|
|
|
- try {
|
|
|
- date = dateFormat.parse(boxBusinessConnectionTime);
|
|
|
- } catch (ParseException e) {
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
- }
|
|
|
StringBuilder text = new StringBuilder();
|
|
|
- for (Bills item : billsList) {
|
|
|
- boolean status = true;
|
|
|
- if (item.getEtd().compareTo(date) < 0) {
|
|
|
- status = false;
|
|
|
+ if ("SOC".equals(bills.getBoxBelongsTo()) && "DD,MH".contains(bills.getBillType())) {
|
|
|
+ SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ List<RouteCost> costList = routeCostService.list(new LambdaQueryWrapper<RouteCost>()
|
|
|
+ .eq(RouteCost::getPodId, bills.getPolId())
|
|
|
+ .eq(RouteCost::getDestinationId, bills.getPodId())
|
|
|
+ .eq(RouteCost::getShippingCompanyId, bills.getCarrierId())
|
|
|
+ .eq(RouteCost::getBusinessType, bills.getBoxBelongsTo())
|
|
|
+ .apply( "DATE_FORMAT(effective_start_date,'%Y-%m-%d') <= '" + formatter.format(bills.getEtd()) + "'")
|
|
|
+ .apply( "DATE_FORMAT(effective_end_date,'%Y-%m-%d') >= '" + formatter.format(bills.getEtd()) + "'")
|
|
|
+ );
|
|
|
+ if (costList.isEmpty()) {
|
|
|
+ throw new RuntimeException("请先维护成本!");
|
|
|
+ }
|
|
|
+ List<RouteCostItem> costItemList = routeCostItemService.list(new LambdaQueryWrapper<RouteCostItem>()
|
|
|
+ .eq(RouteCostItem::getIsDeleted, 0)
|
|
|
+ .eq(RouteCostItem::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .in(RouteCostItem::getPid, costList.stream().map(RouteCost::getId).collect(Collectors.toList())));
|
|
|
+ if (costItemList.isEmpty()) {
|
|
|
+ throw new RuntimeException("请先维护成本!");
|
|
|
}
|
|
|
+ List<PreContainers> preContainersList = preContainersService.list(new LambdaQueryWrapper<PreContainers>()
|
|
|
+ .eq(PreContainers::getIsDeleted, 0)
|
|
|
+ .eq(PreContainers::getPid, ids));
|
|
|
+ if (preContainersList.isEmpty()) {
|
|
|
+ throw new RuntimeException("未查到预配箱型信息,发送失败!");
|
|
|
+ }
|
|
|
+ List<SeaContainerNumberItem> containerNumberItemList = seaContainerNumberItemService.list(new LambdaQueryWrapper<SeaContainerNumberItem>()
|
|
|
+ .eq(SeaContainerNumberItem::getIsDeleted, 0)
|
|
|
+ .eq(SeaContainerNumberItem::getPid, ids)
|
|
|
+ .in(SeaContainerNumberItem::getBoxType, preContainersList.stream().map(PreContainers::getCntrTypeCode)
|
|
|
+ .distinct().collect(Collectors.toList())));
|
|
|
+ if (containerNumberItemList.isEmpty()) {
|
|
|
+ throw new RuntimeException("未选择放箱号,发送失败!");
|
|
|
+ }
|
|
|
+ List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
|
|
|
+ .eq(FeeCenter::getIsDeleted, 0)
|
|
|
+ .eq(FeeCenter::getDc, "D")
|
|
|
+ .eq(FeeCenter::getFeeCode, "HYF")
|
|
|
+ .eq(FeeCenter::getPid, ids));
|
|
|
+ if (feeCenterList.isEmpty()) {
|
|
|
+ throw new RuntimeException("未查到应收海运费,发送失败!");
|
|
|
+ }
|
|
|
+ String boxBusinessConnectionTime = sysClient.getParamService("box.business.connection.time");
|
|
|
+ Date date = null;
|
|
|
+ DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ if (ObjectUtils.isNotNull(boxBusinessConnectionTime)) {
|
|
|
+ try {
|
|
|
+ date = dateFormat.parse(boxBusinessConnectionTime);
|
|
|
+ } catch (ParseException e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ boolean status = bills.getEtd().compareTo(date) >= 0;
|
|
|
if (status) {
|
|
|
- List<PreContainers> preContainers = preContainersList.stream().filter(e -> e.getPid().equals(item.getId()))
|
|
|
- .collect(Collectors.toList());
|
|
|
- for (PreContainers containers : preContainers) {
|
|
|
- if (feeCenterList.stream().anyMatch(e -> e.getPid().equals(item.getId()) &&
|
|
|
- containers.getCntrTypeCode().equals(e.getUnitNo()) && e.getPrice().compareTo(containers.getCostPrice()) > 0)) {
|
|
|
- text.append("提单号:").append(item.getMblno()).append("箱型:").append(containers.getCntrTypeCode()).append("应收海运费用大于成本中心销售价,发送失败!");
|
|
|
+ for (PreContainers containers : preContainersList) {
|
|
|
+ BigDecimal price = feeCenterList.stream().filter(e -> containers.getCntrTypeCode().equals(e.getUnitNo()))
|
|
|
+ .map(FeeCenter::getPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ List<RouteCostItem> minCostItem = costItemList.stream().filter(e -> containers.getCntrTypeCode().equals(e.getBoxType()))
|
|
|
+ .sorted(Comparator.comparing(RouteCostItem::getOceanFreight))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ if (price.compareTo(minCostItem.get(0).getOceanFreight()) < 0) {
|
|
|
+ text.append("提单号:").append(bills.getMblno()).append("箱型:").append(containers.getCntrTypeCode()).append("应收海运费用大于成本中心销售价,发送失败!");
|
|
|
}
|
|
|
if (containerNumberItemList.stream().filter(e -> e.getPid().equals(containers.getPid()))
|
|
|
.mapToInt(SeaContainerNumberItem::getOccupyNum).sum() != containers.getQuantity()) {
|
|
|
- text.append("提单号:").append(item.getMblno()).append("箱型:").append(containers.getCntrTypeCode()).append("箱量与所选放箱号数量不等,发送失败!");
|
|
|
+ text.append("提单号:").append(bills.getMblno()).append("箱型:").append(containers.getCntrTypeCode()).append("箱量与所选放箱号数量不等,发送失败!");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if (ObjectUtils.isNotNull(text.toString())) {
|
|
|
- LocalDateTime now = LocalDateTime.now();
|
|
|
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
- String formatted = now.format(formatter);
|
|
|
- R<String> res = sysClient.getRoleIds(AuthUtil.getTenantId(), "成本中心");
|
|
|
- if (res.isSuccess() && ObjectUtils.isNotNull()) {
|
|
|
- R<List<User>> userListR = userClient.listUserByRoleIds(res.getData());
|
|
|
- if (userListR.isSuccess() && ObjectUtils.isNotNull(userListR.getData())) {
|
|
|
- for (User item : userListR.getData()) {
|
|
|
- Message sendMessage = new Message();
|
|
|
- sendMessage.setUserName(AuthUtil.getUserName());
|
|
|
- sendMessage.setUserId(null);
|
|
|
- sendMessage.setToUserId(item.getId());
|
|
|
- sendMessage.setToUserName(item.getName());
|
|
|
- sendMessage.setMessageType(1);
|
|
|
- sendMessage.setTenantId(AuthUtil.getTenantId());
|
|
|
- sendMessage.setCreateUser(null);
|
|
|
- sendMessage.setCreateTime(new Date());
|
|
|
- sendMessage.setPageLabel("海运出口");
|
|
|
- sendMessage.setMessageBody("发送下货纸:" + text + ";时间:" + formatted + ";");
|
|
|
- R save = messageClient.save(sendMessage);
|
|
|
- if (!save.isSuccess()) {
|
|
|
- throw new SecurityException("发送消息失败");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ String url = "/iosBasicData/OceanFreightImport/bills/index";
|
|
|
+ String pageLabel = "海运出口";
|
|
|
+ String pageStatus = "this.$store.getters.domSaleStatus";
|
|
|
+ String messageBody = "发送下货纸:" + text;
|
|
|
+ billUtils.sendMessage(bills, url, pageLabel, pageStatus, messageBody, "2", bills.getOperatorId(), "成本中心");
|
|
|
return R.success(text.toString());
|
|
|
} else {
|
|
|
return R.success("操作成功");
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|