Browse Source

1.pod返场,空箱返场增加返场时间
2.费用审核撤销增加版本号控制
3.报表打印数字转大写问题修改
4.换单查询列表检索条件修改
5.财务-金额添加接口增加判断,本次金额不能为零

纪新园 2 weeks ago
parent
commit
d6ed8a63e6

+ 5 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/Bills.java

@@ -2679,5 +2679,10 @@ public class Bills implements Serializable {
 	 */
 	@TableField(exist = false)
 	private List<Bills> billsList;
+	/**
+	 * 提单上货物描述(报表专用)
+	 */
+	@TableField(exist = false)
+	private String commodityDescrs;
 
 }

+ 20 - 13
blade-service/blade-los/src/main/java/org/springblade/los/Util/BigDecimalUtils.java

@@ -39,6 +39,9 @@ public class BigDecimalUtils {
 			}
 			return data;
 		}*/
+		if (new BigDecimal("0.00").compareTo(amount) < 0) {
+			amount = amount.abs();
+		}
 		if (amount.compareTo(BigDecimal.ZERO) == 0) return "ZERO";
 		String[] parts = amount.toPlainString().split("\\.");
 		String integerPart = parts[0];
@@ -53,27 +56,31 @@ public class BigDecimalUtils {
 		}
 		String data = result.toString().trim().substring(result.toString().trim().lastIndexOf("AND"));
 		if ("AND".equals(data)) {
-			data = result.toString().trim().substring(0,result.toString().trim().lastIndexOf("AND"));
-			if (data.trim().lastIndexOf("AND") >= 0){
+			data = result.toString().trim().substring(0, result.toString().trim().lastIndexOf("AND"));
+			if (data.trim().lastIndexOf("AND") >= 0) {
 				String data1 = data.trim().substring(data.trim().lastIndexOf("AND"));
-				if ("AND".equals(data1)){
-					data = data.trim().substring(0,data.trim().lastIndexOf("AND"));
+				if ("AND".equals(data1)) {
+					data = data.trim().substring(0, data.trim().lastIndexOf("AND"));
 				}
 			}
 			data = data.trim();
-			if (data.lastIndexOf("-")>= 0){
+			if (data.lastIndexOf("-") >= 0) {
 				String data2 = data.substring(data.lastIndexOf("-"));
-				if ("-".equals(data2)){
-					data = data.substring(0,data.lastIndexOf("-"));
+				if ("-".equals(data2)) {
+					data = data.substring(0, data.lastIndexOf("-"));
 				}
 			}
 			return data;
-		}else{
-			String data2 = result.toString().trim().substring(result.toString().trim().lastIndexOf("-"));
-			if ("-".equals(data2)){
-				data2 = result.toString().trim().substring(0,result.toString().trim().lastIndexOf("-"));
-				return data2;
-			}else{
+		} else {
+			if (result.toString().trim().lastIndexOf("-") >= 0) {
+				String data2 = result.toString().trim().substring(result.toString().trim().lastIndexOf("-"));
+				if ("-".equals(data2)) {
+					data2 = result.toString().trim().substring(0, result.toString().trim().lastIndexOf("-"));
+					return data2;
+				} else {
+					return result.toString().trim();
+				}
+			} else {
 				return result.toString().trim();
 			}
 		}

+ 11 - 0
blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsServiceImpl.java

@@ -961,6 +961,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 			if (bills != null) {
 				String exrateType = currencyUtils.standardCurrency(bills.getBranchId());
 				bills.setExrateType(exrateType);
+				bills.setCommodityDescrs(bills.getCommodityDescr());
 				bills.setPrintPeople(AuthUtil.getUserName());
 				bills = this.dictionaryConversion(bills);
 				bills = this.assignmentSeaBillsDetail(bills);
@@ -1377,6 +1378,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 			if (bills != null) {
 				String exrateType = currencyUtils.standardCurrency(bills.getBranchId());
 				bills.setExrateType(exrateType);
+				bills.setCommodityDescrs(bills.getCommodityDescr());
 				bills = this.dictionaryConversion(bills);
 				bills = this.assignmentSeaBillsDetail(bills);
 //				bills.setFM(MagicValues.FM);
@@ -1440,6 +1442,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 			if (bills != null) {
 				String exrateType = currencyUtils.standardCurrency(bills.getBranchId());
 				bills.setExrateType(exrateType);
+				bills.setCommodityDescrs(bills.getCommodityDescr());
 				bills = this.dictionaryConversion(bills);
 				bills = this.assignmentSeaBillsDetail(bills);
 				bills.setCapitalLetters("SAY " + BigDecimalUtils.convertToEnglish(bills.getQuantity()) + " " + bills.getPackingUnit() + " ONLY.");
@@ -1505,6 +1508,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 			if (bills != null) {
 				String exrateType = currencyUtils.standardCurrency(bills.getBranchId());
 				bills.setExrateType(exrateType);
+				bills.setCommodityDescrs(bills.getCommodityDescr());
 				bills = this.dictionaryConversion(bills);
 				bills = this.assignmentSeaBillsDetail(bills);
 //				bills.setFM(MagicValues.FM);
@@ -1584,6 +1588,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 			if (bills != null) {
 				String exrateType = currencyUtils.standardCurrency(bills.getBranchId());
 				bills.setExrateType(exrateType);
+				bills.setCommodityDescrs(bills.getCommodityDescr());
 				bills = this.dictionaryConversion(bills);
 				bills = this.assignmentSeaBillsDetail(bills);
 //				bills.setFM(MagicValues.FM);
@@ -1608,6 +1613,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 			if (bills != null) {
 				String exrateType = currencyUtils.standardCurrency(bills.getBranchId());
 				bills.setExrateType(exrateType);
+				bills.setCommodityDescrs(bills.getCommodityDescr());
 				bills = this.dictionaryConversion(bills);
 				bills = this.assignmentSeaBillsDetail(bills);
 //				bills.setFM(MagicValues.FM);
@@ -1636,6 +1642,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 			(MagicValues.HYCK.equals(type) || MagicValues.HYJK.equals(type))) {
 			Bills bills = billsService.getById(billId);
 			if (bills != null) {
+				bills.setCommodityDescrs(bills.getCommodityDescr());
 				String exrateType = currencyUtils.standardCurrency(bills.getBranchId());
 				bills.setExrateType(exrateType);
 				Date date;
@@ -1739,6 +1746,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 			if (bills != null) {
 				String exrateType = currencyUtils.standardCurrency(bills.getBranchId());
 				bills.setExrateType(exrateType);
+				bills.setCommodityDescrs(bills.getCommodityDescr());
 				Date date;
 				if ("SE".equals(bills.getBusinessType())) {
 					date = bills.getEtd();
@@ -1826,6 +1834,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 			if (bills != null) {
 				String exrateType = currencyUtils.standardCurrency(bills.getBranchId());
 				bills.setExrateType(exrateType);
+				bills.setCommodityDescrs(bills.getCommodityDescr());
 				bills = this.dictionaryConversion(bills);
 				bills = this.assignmentSeaBillsDetail(bills);
 				bills.setPrintPeople(AuthUtil.getUserName());
@@ -2266,6 +2275,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 			if (bills != null) {
 				String exrateType = currencyUtils.standardCurrency(bills.getBranchId());
 				bills.setExrateType(exrateType);
+				bills.setCommodityDescrs(bills.getCommodityDescr());
 				bills = this.dictionaryConversion(bills);
 				bills = this.assignmentSeaBillsDetail(bills);
 				List<Containers> containersList = containersService.list(new LambdaQueryWrapper<Containers>()
@@ -2300,6 +2310,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 			if (bills != null) {
 				String exrateType = currencyUtils.standardCurrency(bills.getBranchId());
 				bills.setExrateType(exrateType);
+				bills.setCommodityDescrs(bills.getCommodityDescr());
 				bills = this.dictionaryConversion(bills);
 				bills = this.assignmentSeaBillsDetail(bills);
 //				bills.setFM(MagicValues.FM);

+ 15 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/ExpenseApplicationServiceImpl.java

@@ -964,7 +964,22 @@ public class ExpenseApplicationServiceImpl extends ServiceImpl<ExpenseApplicatio
 		} else {
 			StringBuilder text = new StringBuilder();
 			List<FeeCenter> feeCenterList = new ArrayList<>();
+			List<Long> idList = expenseApplication.getFeeCenterList().stream().map(FeeCenter::getStlPid).filter(Objects::nonNull).distinct().collect(Collectors.toList());
+			List<FeeCenter> feeCenterListOld = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
+				.eq(FeeCenter::getIsDeleted, 0)
+				.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+				.in(FeeCenter::getStlPid, idList));
 			for (FeeCenter item : expenseApplication.getFeeCenterList()) {
+				if (!feeCenterListOld.isEmpty()) {
+					FeeCenter feeCenter1 = feeCenterListOld.stream().filter(e -> e.getId().equals(item.getId())).findFirst().orElse(null);
+					if (feeCenter1 != null) {
+						if (!Objects.equals(feeCenter1.getVersion(), item.getVersion())) {
+							throw new RuntimeException("数据已被其他用户更新,请等待刷新后重试");
+						}
+					}
+				}
+				int version = StringUtil.isBlank(item.getVersion()) ? 1 : Integer.parseInt(item.getVersion());
+				item.setVersion(String.valueOf(version + 1));
 				if (item.getStlTtlAmount().compareTo(BigDecimal.ZERO) != 0) {
 					text.append("费用:").append(item.getFeeCnName()).append("已结算");
 				}

+ 2 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/PutBoxServiceImpl.java

@@ -3648,6 +3648,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 				item.setPodCyContact(podStationR.getPodCyContact());
 				item.setPodCyEmail(podStationR.getPodCyEmail());
 				item.setPodCyTel(podStationR.getPodCyTel());
+				item.setPodEmptyContainerReturnDate(podStationR.getReturnEmptyTime());
 				item.setMarks(podStationR.getMarks());
 				item.setUpdateTime(new Date());
 				item.setUpdateUser(AuthUtil.getUserId());
@@ -3687,6 +3688,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 						item.setPodCyContact(podStationR.getPodCyContact());
 						item.setPodCyEmail(podStationR.getPodCyEmail());
 						item.setPodCyTel(podStationR.getPodCyTel());
+						item.setPodEmptyContainerReturnDate(podStationR.getReturnEmptyTime());
 						item.setUpdateTime(new Date());
 						item.setUpdateUser(AuthUtil.getUserId());
 						item.setUpdateUserName(AuthUtil.getUserName());

+ 1 - 1
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/BillsMapper.xml

@@ -293,7 +293,7 @@
         <if test='data.changeOrderStatus != null and data.changeOrderStatus != "" and data.changeOrderStatus == "已换单"'>
             and change_order_status = '已换单'
             and box_packing_amount != 0
-            and harvest_box_packing_date is null
+            and retreat_box_packing_date is null
         </if>
         <if test='data.changeOrderStatus != null and data.changeOrderStatus != "" and data.changeOrderStatus == "已退单"'>
             and box_packing_amount = 0

+ 8 - 6
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/ContainersMapper.xml

@@ -98,9 +98,10 @@
         sc.pod_cy_email as podCyEmail,
         sc.pod_cy_tel as podCyTel,
         sc.id as containersId,
+        sc.pod_empty_container_return_date as podEmptyContainerReturnDate,
         se.id as id,
-        se.eta as eta,
-        se.etd as etd,
+        DATE_FORMAT(se.eta, '%Y-%m-%d') as eta,
+        DATE_FORMAT(se.etd, '%Y-%m-%d') as etd,
         se.business_type as businessType,
         sc.marks as marks
         FROM
@@ -129,7 +130,7 @@
             and se.box_belongs_to = #{data.boxBelongsTo}
         </if>
         <if test="data.podStationCname != null and data.podStationCname != ''">
-            and se.pod_station_cname like concat('%', #{data.podStationCname}, '%')
+            and sc.pod_station_cname like concat('%', #{data.podStationCname}, '%')
         </if>
         <if test="data.mblno != null and data.mblno != ''">
             and se.mblno like concat('%', #{data.mblno}, '%')
@@ -203,9 +204,10 @@
         sc.pod_cy_email as podCyEmail,
         sc.pod_cy_tel as podCyTel,
         sc.id as containersId,
+        sc.pod_empty_container_return_date as podEmptyContainerReturnDate,
         se.id as id,
-        se.eta as eta,
-        se.etd as etd,
+        DATE_FORMAT(se.eta, '%Y-%m-%d') as eta,
+        DATE_FORMAT(se.etd, '%Y-%m-%d') as etd,
         se.business_type as businessType,
         sc.marks as marks
         FROM
@@ -234,7 +236,7 @@
             and se.box_belongs_to = #{data.boxBelongsTo}
         </if>
         <if test="data.podStationCname != null and data.podStationCname != ''">
-            and se.pod_station_cname like concat('%', #{data.podStationCname}, '%')
+            and sc.pod_station_cname like concat('%', #{data.podStationCname}, '%')
         </if>
         <if test="data.mblno != null and data.mblno != ''">
             and se.mblno like concat('%', #{data.mblno}, '%')

+ 9 - 3
blade-service/blade-los/src/main/java/org/springblade/los/excel/UpdatePodStationExcel.java

@@ -2,6 +2,8 @@ package org.springblade.los.excel;
 
 import com.alibaba.excel.annotation.ExcelIgnore;
 import com.alibaba.excel.annotation.ExcelProperty;
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
+import com.baomidou.mybatisplus.annotation.TableField;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -34,12 +36,12 @@ public class UpdatePodStationExcel {
 	 * ETD
 	 */
 	@ExcelProperty(value = "ETD")
-	private Date etd;
+	private String etd;
 	/**
 	 * ETA
 	 */
 	@ExcelProperty(value = "ETA")
-	private Date eta;
+	private String eta;
 	/**
 	 * 船名
 	 */
@@ -98,7 +100,11 @@ public class UpdatePodStationExcel {
 	 */
 	@ExcelProperty(value = "箱型")
 	private String cntrTypeCode;
-
+	/**
+	 * pod空箱还箱日期
+	 */
+	@ApiModelProperty(value = "pod空箱还箱日期")
+	private String podEmptyContainerReturnDate;
 	/**
 	 * pod场站
 	 */

+ 4 - 2
blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/service/impl/FinInvoicesServiceImpl.java

@@ -1324,7 +1324,7 @@ public class FinInvoicesServiceImpl extends ServiceImpl<FinInvoicesMapper, FinIn
 			List<FinInvoicesItems> finInvoicesItemsList = new ArrayList<>();
 			for (FinAccBillsVO item : finInvoices.getFinAccBillsVOList()) {
 				FinInvoicesItems invoicesItems = this.assignmentProcess(item, invoicesApply);
-				if (new BigDecimal("0.00").compareTo(item.getAppliedInvoiceCurrentAmount()) == 0){
+				if (new BigDecimal("0.00").compareTo(item.getAppliedInvoiceCurrentAmount()) == 0) {
 					throw new RuntimeException("本次金额不能为零");
 				}
 				invoicesItems.setCurrentAmountNet(item.getAppliedInvoiceCurrentAmount());
@@ -1420,7 +1420,7 @@ public class FinInvoicesServiceImpl extends ServiceImpl<FinInvoicesMapper, FinIn
 			List<FinInvoicesItems> finInvoicesItemsList = new ArrayList<>();
 			for (FinAccBillsVO item : finInvoices.getFinAccBillsVOList()) {
 				FinInvoicesItems invoicesItems = this.assignmentProcess(item, invoices);
-				if (new BigDecimal("0.00").compareTo(item.getAppliedInvoiceCurrentAmount()) == 0){
+				if (new BigDecimal("0.00").compareTo(item.getAppliedInvoiceCurrentAmount()) == 0) {
 					throw new RuntimeException("本次金额不能为零");
 				}
 				invoicesItems.setCurrentAmountNet(item.getAppliedInvoiceCurrentAmount());
@@ -1634,6 +1634,8 @@ public class FinInvoicesServiceImpl extends ServiceImpl<FinInvoicesMapper, FinIn
 					if (currentStlAmount.compareTo(new BigDecimal("0.00")) != 0) {
 						throw new RuntimeException("撤销金额计算错误,操作失败");
 					}
+				} else {
+					throw new RuntimeException("未查到费用:" + item.getFeeCnName() + "分单号:" + item.getHblno() + "对应账单信息");
 				}
 			}
 		} else if ("5".equals(finInvoices.getCostType())) {