|
@@ -22,6 +22,8 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.echepei.dto.mail.MailDto;
|
|
import com.echepei.dto.mail.MailDto;
|
|
|
import com.echepei.utils.mail.SendMailUtil;
|
|
import com.echepei.utils.mail.SendMailUtil;
|
|
|
|
|
+import com.fasterxml.jackson.databind.JsonNode;
|
|
|
|
|
+import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springblade.common.enums.CommonEnum;
|
|
import org.springblade.common.enums.CommonEnum;
|
|
|
import org.springblade.core.secure.BladeUser;
|
|
import org.springblade.core.secure.BladeUser;
|
|
@@ -32,6 +34,7 @@ import org.springblade.core.tool.utils.FileUtil;
|
|
|
import org.springblade.los.Util.BigDecimalUtils;
|
|
import org.springblade.los.Util.BigDecimalUtils;
|
|
|
import org.springblade.los.Util.IDeptUtils;
|
|
import org.springblade.los.Util.IDeptUtils;
|
|
|
import org.springblade.los.Util.MagicValues;
|
|
import org.springblade.los.Util.MagicValues;
|
|
|
|
|
+import org.springblade.los.Util.RegularUtils;
|
|
|
import org.springblade.los.basic.corps.entity.BCorps;
|
|
import org.springblade.los.basic.corps.entity.BCorps;
|
|
|
import org.springblade.los.basic.corps.entity.BCorpsBank;
|
|
import org.springblade.los.basic.corps.entity.BCorpsBank;
|
|
|
import org.springblade.los.basic.corps.service.IBCorpsBankService;
|
|
import org.springblade.los.basic.corps.service.IBCorpsBankService;
|
|
@@ -189,7 +192,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public R<Map<String, Object>> getReportData(String billId, String reportCode, String groupCode, String corpIds,
|
|
public R<Map<String, Object>> getReportData(String billId, String reportCode, String groupCode, String corpIds,
|
|
|
- String itemIds, String type, String curCode, String BillNumber) {
|
|
|
|
|
|
|
+ String itemIds, String type, String curCode, String BillNumber,
|
|
|
|
|
+ String params) {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
if (ObjectUtils.isNull(billId)) {
|
|
if (ObjectUtils.isNull(billId)) {
|
|
|
throw new RuntimeException("缺少比要参数");
|
|
throw new RuntimeException("缺少比要参数");
|
|
@@ -216,8 +220,18 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
|
|
|
} else {
|
|
} else {
|
|
|
throw new RuntimeException("获取报表表头数据失败");
|
|
throw new RuntimeException("获取报表表头数据失败");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ ObjectMapper reportParamsObjectMapper = new ObjectMapper();
|
|
|
|
|
+ JsonNode reportParams = null;
|
|
|
|
|
+ if(ObjectUtils.isNotNull(params)) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ reportParams = reportParamsObjectMapper.readTree(params);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (MagicValues.HYCK.equals(type) || MagicValues.HYJK.equals(type)) {
|
|
if (MagicValues.HYCK.equals(type) || MagicValues.HYJK.equals(type)) {
|
|
|
- return this.getReportDataHY(billId, reportCode, groupCode, corpIds, itemIds, type, curCode, BillNumber);
|
|
|
|
|
|
|
+ return this.getReportDataHY(reportParams, billId, reportCode, groupCode, corpIds, itemIds, type, curCode, BillNumber);
|
|
|
} else if (MagicValues.KYCK.equals(type) || MagicValues.KYJK.equals(type)) {
|
|
} else if (MagicValues.KYCK.equals(type) || MagicValues.KYJK.equals(type)) {
|
|
|
return this.getReportDataKY(billId, reportCode, groupCode, corpIds, itemIds, type, curCode, BillNumber);
|
|
return this.getReportDataKY(billId, reportCode, groupCode, corpIds, itemIds, type, curCode, BillNumber);
|
|
|
} else if (MagicValues.AMEND.equals(type)) {
|
|
} else if (MagicValues.AMEND.equals(type)) {
|
|
@@ -849,8 +863,10 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
|
|
|
return R.data(map);
|
|
return R.data(map);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public R<Map<String, Object>> getReportDataHY(String billId, String reportCode, String groupCode, String corpIds,
|
|
|
|
|
- String itemIds, String type, String curCode, String BillNumber) {
|
|
|
|
|
|
|
+ public R<Map<String, Object>> getReportDataHY(JsonNode reportParams,
|
|
|
|
|
+ String billId, String reportCode, String groupCode,
|
|
|
|
|
+ String corpIds, String itemIds, String type,
|
|
|
|
|
+ String curCode, String BillNumber) {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
if (ObjectUtils.isNull(billId)) {
|
|
if (ObjectUtils.isNull(billId)) {
|
|
|
throw new RuntimeException("缺少比要参数");
|
|
throw new RuntimeException("缺少比要参数");
|
|
@@ -1757,30 +1773,95 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
|
|
|
} else {
|
|
} else {
|
|
|
map.put(MagicValues.DATA, null);
|
|
map.put(MagicValues.DATA, null);
|
|
|
}
|
|
}
|
|
|
- } else if (MagicValues.DOCUMENT.equals(reportCode) && (MagicValues.BILLS_DETAIL.equals(groupCode) || MagicValues.BILLS_DETAIL_M.equals(groupCode)) && (MagicValues.HYCK.equals(type) || MagicValues.HYJK.equals(type))) {
|
|
|
|
|
|
|
+ } else if (MagicValues.DOCUMENT.equals(reportCode) && MagicValues.IsBillsDetail(groupCode) && MagicValues.IsSea(type)) {
|
|
|
Bills bills = billsService.getById(billId);
|
|
Bills bills = billsService.getById(billId);
|
|
|
if (bills != null) {
|
|
if (bills != null) {
|
|
|
|
|
+ // MASTER_BILLS
|
|
|
this.dictionaryConversion(bills);
|
|
this.dictionaryConversion(bills);
|
|
|
this.assignmentSeaBillsDetail(bills);
|
|
this.assignmentSeaBillsDetail(bills);
|
|
|
-// bills.setFM(MagicValues.FM);
|
|
|
|
|
- bills.setCapitalLetters("SAY " + BigDecimalUtils.convertToEnglish(bills.getQuantity()) + " " + bills.getPackingUnit() + " ONLY.");
|
|
|
|
|
- bills.setVesselCnName(bills.getVesselEnName() + "/" + bills.getVoyageNo());
|
|
|
|
|
- BigDecimal boxWeightSum = BigDecimal.ZERO;
|
|
|
|
|
|
|
+
|
|
|
List<Containers> containersList = containersService.list(new LambdaQueryWrapper<Containers>()
|
|
List<Containers> containersList = containersService.list(new LambdaQueryWrapper<Containers>()
|
|
|
.eq(Containers::getTenantId, AuthUtil.getTenantId())
|
|
.eq(Containers::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(Containers::getIsDeleted, 0)
|
|
.eq(Containers::getIsDeleted, 0)
|
|
|
.eq(Containers::getPid, bills.getId()));
|
|
.eq(Containers::getPid, bills.getId()));
|
|
|
|
|
+ if(ObjectUtils.isNull(containersList)){
|
|
|
|
|
+ containersList = new ArrayList<>();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
List<PreContainers> preContainersList = preContainersService.list(new LambdaQueryWrapper<PreContainers>()
|
|
List<PreContainers> preContainersList = preContainersService.list(new LambdaQueryWrapper<PreContainers>()
|
|
|
.eq(PreContainers::getTenantId, AuthUtil.getTenantId())
|
|
.eq(PreContainers::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(PreContainers::getIsDeleted, 0)
|
|
.eq(PreContainers::getIsDeleted, 0)
|
|
|
.eq(PreContainers::getPid, bills.getId()));
|
|
.eq(PreContainers::getPid, bills.getId()));
|
|
|
|
|
+ if(ObjectUtils.isNull(preContainersList)){
|
|
|
|
|
+ preContainersList = new ArrayList<>();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ PrepareBills(bills, preContainersList);
|
|
|
|
|
+
|
|
|
|
|
+// bills.setFM(MagicValues.FM);
|
|
|
|
|
+ if("1".equals(bills.getCapitalLettersRule())){
|
|
|
|
|
+ bills.setCapitalLetters(bills.getQuantityCntrTypesDescr());
|
|
|
|
|
+ }else{
|
|
|
|
|
+ bills.setCapitalLetters("SAY " + BigDecimalUtils.convertToEnglish(bills.getQuantity()) + " " + bills.getPackingUnit() + " ONLY.");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ StringBuilder text1 = new StringBuilder();
|
|
|
|
|
+ text1.append(bills.getQuantity()).append(System.lineSeparator());
|
|
|
|
|
+ text1.append(bills.getPackingUnit()).append(System.lineSeparator());
|
|
|
|
|
+
|
|
|
|
|
+ Boolean NumOfContainersOrPackagesAddPreCntrQty = RegularUtils.readJSONBooleanValue(reportParams, "NumOfContainersOrPackagesAddPreCntrQty", false);
|
|
|
|
|
+ if(NumOfContainersOrPackagesAddPreCntrQty==true){
|
|
|
|
|
+ for (PreContainers preContainers : preContainersList) {
|
|
|
|
|
+ text1.append(System.lineSeparator()).append(preContainers.getQuantity().toString() + "*" + preContainers.getCntrTypeCode()).append(System.lineSeparator());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ bills.setNumOfContainersOrPackages(text1.toString().trim());
|
|
|
|
|
+
|
|
|
|
|
+ String commodityDescrFirstLine = RegularUtils.readJSONStringValue(reportParams, "commodityDescrFirstLine", "");
|
|
|
|
|
+ String commodityDescr = ObjectUtils.isNotNull(bills.getCommodityDescr()) ? bills.getCommodityDescr() : "";
|
|
|
|
|
+ if(!commodityDescrFirstLine.isEmpty()){
|
|
|
|
|
+ commodityDescr = commodityDescrFirstLine + "\n" + commodityDescr;
|
|
|
|
|
+ }
|
|
|
|
|
+ commodityDescr += "\n\n" + bills.getServiceTerms();
|
|
|
|
|
+ if(MagicValues.BILLS_DETAIL.equals(groupCode)){
|
|
|
|
|
+ commodityDescr += "\n\n" + ("PP".equals(bills.getHpaymode()) ? "\"FREIGHT PREPAID\"" : "\"FREIGHT COLLECT\"");
|
|
|
|
|
+ }else{
|
|
|
|
|
+ commodityDescr += "\n\n" + ("PP".equals(bills.getMpaymode()) ? "\"FREIGHT PREPAID\"" : "\"FREIGHT COLLECT\"");
|
|
|
|
|
+ }
|
|
|
|
|
+ bills.setCommodityDescr(commodityDescr);
|
|
|
|
|
+
|
|
|
|
|
+ Boolean marksAddCntrNoSealNoList = RegularUtils.readJSONBooleanValue(reportParams, "marksAddCntrNoSealNoList", false);
|
|
|
|
|
+ Boolean marksAddCntrPGVList = RegularUtils.readJSONBooleanValue(reportParams, "marksAddCntrPGVList", false);
|
|
|
|
|
+ if(marksAddCntrNoSealNoList==true){
|
|
|
|
|
+ String marks = ObjectUtils.isNotNull(bills.getMarks()) ? bills.getMarks() : "";
|
|
|
|
|
+ for (Containers item : containersList) {
|
|
|
|
|
+ marks += System.lineSeparator() + item.getCntrNo() + "/" + item.getSealNo();
|
|
|
|
|
+ if(marksAddCntrPGVList==true){
|
|
|
|
|
+ marks += System.lineSeparator() + item.getQuantity() + "/"
|
|
|
|
|
+ + item.getGrossWeight().setScale(2, BigDecimal.ROUND_HALF_UP)
|
|
|
|
|
+ + "/" + item.getMeasurement().setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ bills.setMarks(marks);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ bills.setMeasurementOfBL(bills.getMeasurement().setScale(3, BigDecimal.ROUND_HALF_UP).toString() + "\nCBM");
|
|
|
|
|
+ bills.setGrossWeightOfBL(bills.getGrossWeight().setScale(3, BigDecimal.ROUND_HALF_UP).toString() + "\nKGS");
|
|
|
|
|
+
|
|
|
|
|
+ String issueDate = RegularUtils.translateEngMonthDate(bills.getIssueDate());
|
|
|
|
|
+ bills.setIssueDateOfBL(issueDate);
|
|
|
|
|
+
|
|
|
|
|
+ bills.setVesselCnName(bills.getVesselEnName() + "/" + bills.getVoyageNo());
|
|
|
|
|
+ BigDecimal boxWeightSum = BigDecimal.ZERO;
|
|
|
if (!containersList.isEmpty()) {
|
|
if (!containersList.isEmpty()) {
|
|
|
|
|
+ String firstCntrTypeCode = containersList.get(0).getCntrTypeCode();
|
|
|
|
|
+ BigDecimal firstGWT = containersList.get(0).getGrossWeight();
|
|
|
boxWeightSum = boxWeightSum.add(containersList.get(0).getGrossWeight());
|
|
boxWeightSum = boxWeightSum.add(containersList.get(0).getGrossWeight());
|
|
|
if (!preContainersList.isEmpty()) {
|
|
if (!preContainersList.isEmpty()) {
|
|
|
- List<PreContainers> preContainers = preContainersList.stream().filter(e -> e.getCntrTypeCode().equals(containersList.get(0).getCntrTypeCode()))
|
|
|
|
|
|
|
+ List<PreContainers> preContainers = preContainersList.stream().filter(e -> e.getCntrTypeCode().equals(firstCntrTypeCode))
|
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
|
if (!preContainers.isEmpty()) {
|
|
if (!preContainers.isEmpty()) {
|
|
|
- boxWeightSum = boxWeightSum.add(containersList.get(0).getGrossWeight());
|
|
|
|
|
|
|
+ boxWeightSum = boxWeightSum.add(firstGWT);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1793,7 +1874,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
|
|
|
.append(item.getGrossWeight()).append(item.getPackingUnit()).append("/")
|
|
.append(item.getGrossWeight()).append(item.getPackingUnit()).append("/")
|
|
|
.append(item.getMeasurement()).append("CBM");
|
|
.append(item.getMeasurement()).append("CBM");
|
|
|
if (ObjectUtils.isNotNull(item.getCntrNo()) || ObjectUtils.isNotNull(item.getSealNo())) {
|
|
if (ObjectUtils.isNotNull(item.getCntrNo()) || ObjectUtils.isNotNull(item.getSealNo())) {
|
|
|
- cntrSealNo.append(item.getCntrNo()).append("/").append(item.getSealNo()).append(" ");
|
|
|
|
|
|
|
+ cntrSealNo.append(item.getCntrNo()).append("/").append(item.getSealNo()).append(System.lineSeparator());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
bills.setCntryString(text.toString());
|
|
bills.setCntryString(text.toString());
|
|
@@ -1819,6 +1900,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
|
|
|
String ventilation = preContainersList.stream().map(PreContainers::getVentilation).filter(Objects::nonNull).collect(Collectors.joining(","));
|
|
String ventilation = preContainersList.stream().map(PreContainers::getVentilation).filter(Objects::nonNull).collect(Collectors.joining(","));
|
|
|
bills.setVentilation(ventilation);
|
|
bills.setVentilation(ventilation);
|
|
|
}
|
|
}
|
|
|
|
|
+ PrepareBills(bills, preContainersList);
|
|
|
|
|
+
|
|
|
bills.setVesselCnName(bills.getVesselEnName() + "/" + bills.getVoyageNo());
|
|
bills.setVesselCnName(bills.getVesselEnName() + "/" + bills.getVoyageNo());
|
|
|
bills.setDept(dept);
|
|
bills.setDept(dept);
|
|
|
map.put(MagicValues.DATA, bills);
|
|
map.put(MagicValues.DATA, bills);
|
|
@@ -1837,6 +1920,48 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
|
|
|
} else {
|
|
} else {
|
|
|
map.put(MagicValues.DATA, null);
|
|
map.put(MagicValues.DATA, null);
|
|
|
}
|
|
}
|
|
|
|
|
+ } else if (MagicValues.DOCUMENT.equals(reportCode) && MagicValues.FREIGHT_NOTE.equals(groupCode) && (MagicValues.HYCK.equals(type) || MagicValues.HYJK.equals(type))) {
|
|
|
|
|
+ Bills bills = billsService.getById(billId);
|
|
|
|
|
+ if (bills != null) {
|
|
|
|
|
+ this.dictionaryConversion(bills);
|
|
|
|
|
+ this.assignmentSeaBillsDetail(bills);
|
|
|
|
|
+ // bills.setFM(MagicValues.FM);
|
|
|
|
|
+ bills.setVesselCnName(bills.getVesselEnName().trim() + "/" + bills.getVoyageNo());
|
|
|
|
|
+ bills.setDept(dept);
|
|
|
|
|
+
|
|
|
|
|
+ List<PreContainers> preContainersList = preContainersService.list(new LambdaQueryWrapper<PreContainers>()
|
|
|
|
|
+ .eq(PreContainers::getTenantId, AuthUtil.getTenantId())
|
|
|
|
|
+ .eq(PreContainers::getIsDeleted, 0)
|
|
|
|
|
+ .eq(PreContainers::getPid, bills.getId()));
|
|
|
|
|
+ PrepareBills(bills, preContainersList);
|
|
|
|
|
+
|
|
|
|
|
+ // 提取应收海运费
|
|
|
|
|
+ List<FeeCenter> feeCenters = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
|
|
|
|
|
+ .select(FeeCenter::getId, FeeCenter::getFeeId, FeeCenter::getFeeCode, FeeCenter::getDc,
|
|
|
|
|
+ FeeCenter::getCurCode, FeeCenter::getAmount)
|
|
|
|
|
+ .eq(FeeCenter::getPid, bills.getId())
|
|
|
|
|
+ .eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
|
|
|
|
|
+ .eq(FeeCenter::getDc, "D")
|
|
|
|
|
+ .eq(FeeCenter::getFeeCode, "O/F")
|
|
|
|
|
+ .eq(FeeCenter::getCurCode, "USD")
|
|
|
|
|
+ .eq(FeeCenter::getIsDeleted, 0));
|
|
|
|
|
+
|
|
|
|
|
+ if(ObjectUtils.isNotNull(feeCenters)){
|
|
|
|
|
+ // 应收 USD 海运费
|
|
|
|
|
+ bills.setAmountDrUsd(feeCenters.stream().map(FeeCenter::getAmount)
|
|
|
|
|
+ .filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ String reserve1 = "FROM " + bills.getPolNamePrint() + " TO " + bills.getDestinationNamePrint() + "\n";
|
|
|
|
|
+ reserve1 += (" THE OCEAN FREIGHT AMOUNT PAID: USD: " + bills.getAmountDrUsd().setScale(2, BigDecimal.ROUND_HALF_UP).toString());
|
|
|
|
|
+ bills.setReserve1(reserve1);
|
|
|
|
|
+
|
|
|
|
|
+ bills.setReserve2(RegularUtils.translateEngMonthDate(new Date()));
|
|
|
|
|
+
|
|
|
|
|
+ map.put(MagicValues.DATA, bills);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ map.put(MagicValues.DATA, null);
|
|
|
|
|
+ }
|
|
|
} else if (MagicValues.COST.equals(reportCode) &&
|
|
} else if (MagicValues.COST.equals(reportCode) &&
|
|
|
(MagicValues.RECEIVABLE.equals(groupCode) || MagicValues.RECEIVABLE_BILL.equals(groupCode) ||
|
|
(MagicValues.RECEIVABLE.equals(groupCode) || MagicValues.RECEIVABLE_BILL.equals(groupCode) ||
|
|
|
MagicValues.BILL_NUMBER.equals(groupCode) || MagicValues.RECEIVABLE_AMEND.equals(groupCode))
|
|
MagicValues.BILL_NUMBER.equals(groupCode) || MagicValues.RECEIVABLE_AMEND.equals(groupCode))
|
|
@@ -1966,6 +2091,9 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
|
|
|
feeCenterReports.setUnitNo(item.getUnitNo());
|
|
feeCenterReports.setUnitNo(item.getUnitNo());
|
|
|
feeCenterReports.setPrice(item.getPrice());
|
|
feeCenterReports.setPrice(item.getPrice());
|
|
|
feeCenterReports.setMoney(item.getAmount());
|
|
feeCenterReports.setMoney(item.getAmount());
|
|
|
|
|
+ feeCenterReports.setDc(item.getDc());
|
|
|
|
|
+ feeCenterReports.setCurCode("D".equals(item.getDc()) ? item.getCurCode() : "");
|
|
|
|
|
+ feeCenterReports.setCurCodeC("C".equals(item.getDc()) ? item.getCurCode() : "");
|
|
|
feeCenterReportsList.add(feeCenterReports);
|
|
feeCenterReportsList.add(feeCenterReports);
|
|
|
}
|
|
}
|
|
|
if (!feeCenterList.isEmpty()) {
|
|
if (!feeCenterList.isEmpty()) {
|
|
@@ -2008,6 +2136,22 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
|
|
|
bills.setSwiftCode(bCorpsBanks.get(0).getSwiftCode());
|
|
bills.setSwiftCode(bCorpsBanks.get(0).getSwiftCode());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 提取箱号
|
|
|
|
|
+ List<Containers> containersList = containersService.list(new LambdaQueryWrapper<Containers>()
|
|
|
|
|
+ .eq(Containers::getTenantId, AuthUtil.getTenantId())
|
|
|
|
|
+ .eq(Containers::getIsDeleted, 0)
|
|
|
|
|
+ .eq(Containers::getPid, bills.getId()));
|
|
|
|
|
+ List<String> cntrNosCSV = new ArrayList<>();
|
|
|
|
|
+ if(ObjectUtils.isNotNull(containersList)){
|
|
|
|
|
+ for (Containers cntr : containersList) {
|
|
|
|
|
+ String cntrNo = ObjectUtils.isNotNull(cntr.getCntrNo()) ? cntr.getCntrNo().trim() : "";
|
|
|
|
|
+ if(!cntrNo.isEmpty() && !cntrNosCSV.contains(cntrNo)){
|
|
|
|
|
+ cntrNosCSV.add(cntrNo);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ bills.setContainerNosCsv(cntrNosCSV.stream().collect(Collectors.joining(",")));
|
|
|
|
|
+
|
|
|
String status = firstFeeUser > 0 ? "1" : "0";
|
|
String status = firstFeeUser > 0 ? "1" : "0";
|
|
|
if ("1".equals(status)) {
|
|
if ("1".equals(status)) {
|
|
|
R<User> resUser = userClient.userInfoById(firstFeeUser);
|
|
R<User> resUser = userClient.userInfoById(firstFeeUser);
|
|
@@ -2163,6 +2307,9 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
|
|
|
feeCenterReports.setUnitNo(item.getUnitNo());
|
|
feeCenterReports.setUnitNo(item.getUnitNo());
|
|
|
feeCenterReports.setPrice(item.getPrice());
|
|
feeCenterReports.setPrice(item.getPrice());
|
|
|
feeCenterReports.setMoney(item.getAmount());
|
|
feeCenterReports.setMoney(item.getAmount());
|
|
|
|
|
+ feeCenterReports.setDc(item.getDc());
|
|
|
|
|
+ feeCenterReports.setCurCode("D".equals(item.getDc()) ? item.getCurCode() : "");
|
|
|
|
|
+ feeCenterReports.setCurCodeC("C".equals(item.getDc()) ? item.getCurCode() : "");
|
|
|
feeCenterReportsList.add(feeCenterReports);
|
|
feeCenterReportsList.add(feeCenterReports);
|
|
|
}
|
|
}
|
|
|
if (!feeCenterList.isEmpty()) {
|
|
if (!feeCenterList.isEmpty()) {
|
|
@@ -7376,6 +7523,28 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
|
|
|
*/
|
|
*/
|
|
|
private Bills dictionaryConversion(Bills bills) {
|
|
private Bills dictionaryConversion(Bills bills) {
|
|
|
if(ObjectUtils.isNotNull(bills)) {
|
|
if(ObjectUtils.isNotNull(bills)) {
|
|
|
|
|
+ bills.setReserve1("");
|
|
|
|
|
+ bills.setReserve2("");
|
|
|
|
|
+ bills.setReserve3("");
|
|
|
|
|
+ bills.setReserve4("");
|
|
|
|
|
+ bills.setReserve5("");
|
|
|
|
|
+ bills.setReserve6("");
|
|
|
|
|
+ bills.setReserve7("");
|
|
|
|
|
+ bills.setReserve8("");
|
|
|
|
|
+ bills.setReserve9("");
|
|
|
|
|
+ bills.setReserve10("");
|
|
|
|
|
+
|
|
|
|
|
+ if("PP".equals(bills.getHpaymode())){
|
|
|
|
|
+ bills.setPrepaidAt(bills.getHpayplace());
|
|
|
|
|
+ bills.setPayableAt("");
|
|
|
|
|
+ }else{
|
|
|
|
|
+ bills.setPrepaidAt("");
|
|
|
|
|
+ bills.setPayableAt(bills.getHpayplace());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ String issueDate = RegularUtils.translateEngMonthDate(bills.getIssueDate());
|
|
|
|
|
+ bills.setIssueDateOfBL(issueDate);
|
|
|
|
|
+
|
|
|
bills.setCorpShortName(bills.getShortName());
|
|
bills.setCorpShortName(bills.getShortName());
|
|
|
|
|
|
|
|
bills.setSrcTypeDisplay(bills.getSrcType());
|
|
bills.setSrcTypeDisplay(bills.getSrcType());
|
|
@@ -7405,4 +7574,37 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
|
|
|
|
|
|
|
|
return bills;
|
|
return bills;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ private Bills PrepareBills(Bills bill, List<PreContainers> preContainersList){
|
|
|
|
|
+ if(ObjectUtils.isNotNull(bill)){
|
|
|
|
|
+ List<PreContainers> preCntrs = ObjectUtils.isNotNull(preContainersList) ? preContainersList : bill.getPreContainersList();
|
|
|
|
|
+ if(ObjectUtils.isNotNull(preCntrs)){
|
|
|
|
|
+ StringBuilder cntrQtys = new StringBuilder();
|
|
|
|
|
+ StringBuilder cntrQtyInwords = new StringBuilder();
|
|
|
|
|
+ BigDecimal teu = new BigDecimal("0.00");
|
|
|
|
|
+ for (PreContainers item : preCntrs) {
|
|
|
|
|
+ cntrQtys.append(item.getQuantity()).append("*").append(item.getCntrTypeCode()).append(",");
|
|
|
|
|
+ cntrQtyInwords.append(BigDecimalUtils.convertToEnglish(new BigDecimal(item.getQuantity() + ""))).append(" AND");
|
|
|
|
|
+ if (ObjectUtils.isNotNull(item.getQuantity()) && ObjectUtils.isNotNull(item.getTeu())) {
|
|
|
|
|
+ teu = teu.add(new BigDecimal(item.getQuantity()).multiply(item.getTeu()));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (cntrQtys.length() > 0) {
|
|
|
|
|
+ cntrQtys = new StringBuilder(cntrQtys.substring(0, cntrQtys.length() - 1));
|
|
|
|
|
+ bill.setQuantityCntrDescr(cntrQtys.toString());
|
|
|
|
|
+ }else{
|
|
|
|
|
+ bill.setQuantityCntrDescr("");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (cntrQtyInwords.length() > 0) {
|
|
|
|
|
+ cntrQtyInwords = new StringBuilder(cntrQtyInwords.substring(0, cntrQtyInwords.length() - 4));
|
|
|
|
|
+ cntrQtyInwords.append(" ONLY.");
|
|
|
|
|
+ bill.setQuantityCntrTypesDescr(cntrQtyInwords.toString());
|
|
|
|
|
+ }else{
|
|
|
|
|
+ bill.setQuantityCntrTypesDescr("");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return bill;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|